From 64ffb19b802e270f1809352e34772a6013704e0d Mon Sep 17 00:00:00 2001 From: David Cramer Date: Thu, 24 Jun 2021 14:25:53 +0200 Subject: [PATCH 01/56] separate meta system --- php/class-media.php | 104 ++++++++++++++++++------------- php/class-sync.php | 68 +++++++++++++++----- php/media/class-upgrade.php | 8 +-- php/sync/class-download-sync.php | 17 +---- php/sync/class-push-sync.php | 20 +++--- php/sync/class-upload-sync.php | 5 +- php/traits/trait-cli.php | 1 - 7 files changed, 127 insertions(+), 96 deletions(-) diff --git a/php/class-media.php b/php/class-media.php index 51c603675..85971e9a9 100644 --- a/php/class-media.php +++ b/php/class-media.php @@ -1094,7 +1094,7 @@ public function get_cloudinary_folder( $add_trailing_slash = true ) { public function get_public_id( $attachment_id, $suffixed = false ) { // Check for a public_id. if ( $this->has_public_id( $attachment_id ) ) { - $public_id = get_post_meta( $attachment_id, Sync::META_KEYS['public_id'], true ); + $public_id = $this->get_post_meta( $attachment_id, Sync::META_KEYS['public_id'], true ); if ( $this->is_folder_synced( $attachment_id ) ) { $public_id = $this->get_cloudinary_folder() . pathinfo( $public_id, PATHINFO_BASENAME ); } @@ -1116,7 +1116,10 @@ public function get_public_id( $attachment_id, $suffixed = false ) { * @return bool */ public function has_public_id( $attachment_id ) { - return ! empty( get_post_meta( $attachment_id, Sync::META_KEYS['public_id'], true ) ); + $new_id = $this->get_post_meta( $attachment_id, Sync::META_KEYS['public_id'], true ); + $id = get_post_meta( $attachment_id, Sync::META_KEYS['public_id'], true ); + + return ! empty( $new_id ) || ! empty( $id ); } /** @@ -1156,23 +1159,29 @@ public function get_cloudinary_id( $attachment_id ) { * * @param int $attachment_id The ID to get Cloudinary id for. * - * @return string|null the ID or null if not existing. + * @return string|false the ID or null if not existing. */ public function cloudinary_id( $attachment_id ) { + static $cloudinary_ids = array(); + + // Return cached ID if we've already gotten it before. + if ( isset( $cloudinary_ids[ $attachment_id ] ) ) { + return $cloudinary_ids[ $attachment_id ]; + } if ( ! $this->is_media( $attachment_id ) ) { + $cloudinary_ids[ $attachment_id ] = null; return null; } - // Return cached ID if we've already gotten it before. - if ( isset( $this->cloudinary_ids[ $attachment_id ] ) ) { - return $this->cloudinary_ids[ $attachment_id ]; - } + if ( ! $this->sync->is_synced( $attachment_id ) && ! defined( 'REST_REQUEST' ) ) { $sync_type = $this->sync->maybe_prepare_sync( $attachment_id ); // Check sync type allows for continued rendering. i.e meta update, breakpoints etc, will still allow the URL to work, // Where is type "file" will not since it's still being uploaded. - if ( ! is_null( $sync_type ) && $this->sync->is_required( $sync_type, $attachment_id ) ) { - return null; // Return and render local URLs. + if ( is_null( $sync_type ) || $this->sync->is_required( $sync_type, $attachment_id ) ) { + // Cache ID to prevent multiple lookups. + $cloudinary_ids[ $attachment_id ] = false; + return false; // Return and render local URLs. } } @@ -1195,8 +1204,9 @@ public function cloudinary_id( $attachment_id ) { * @param int $attachment_id The id of the asset. */ do_action( 'cloudinary_id', $cloudinary_id, $attachment_id ); - // Cache ID to prevent multiple lookups. - $this->cloudinary_ids[ $attachment_id ] = $cloudinary_id; + + $cloudinary_ids[ $attachment_id ] = $cloudinary_id; + return $cloudinary_id; } @@ -1480,7 +1490,8 @@ private function create_attachment( $asset, $public_id ) { $sync_key = $asset['sync_key']; // Capture public_id. Use core update_post_meta since this attachment data doesnt exist yet. - update_post_meta( $attachment_id, Sync::META_KEYS['public_id'], $public_id ); + $this->update_post_meta( $attachment_id, Sync::META_KEYS['public_id'], $public_id ); + // Capture version number. $this->update_post_meta( $attachment_id, Sync::META_KEYS['version'], $asset['version'] ); if ( ! empty( $asset['transformations'] ) ) { @@ -1488,10 +1499,7 @@ private function create_attachment( $asset, $public_id ) { $sync_key .= wp_json_encode( $asset['transformations'] ); $this->update_post_meta( $attachment_id, Sync::META_KEYS['transformation'], $asset['transformations'] ); } - // create a trackable key in post meta. - update_post_meta( $attachment_id, '_' . md5( $sync_key ), true ); - // record a base to ensure primary isn't deleted. - update_post_meta( $attachment_id, '_' . md5( 'base_' . $public_id ), true ); + // capture the delivery type. $this->update_post_meta( $attachment_id, Sync::META_KEYS['delivery'], $asset['type'] ); // Capture the ALT Text. @@ -1835,23 +1843,24 @@ public function get_transformation_from_meta( $post_id ) { */ public function get_post_meta( $post_id, $key = '', $single = false ) { - $meta_data = wp_get_attachment_metadata( $post_id, true ); - if ( ! is_array( $meta_data ) ) { - return get_post_meta( $post_id, $key, $single ); - } - if ( ! isset( $meta_data[ Sync::META_KEYS['cloudinary'] ] ) ) { - $meta_data[ Sync::META_KEYS['cloudinary'] ] = array(); + $meta = get_post_meta( $post_id, Sync::META_KEYS['cloudinary'], true ); + if ( empty( $meta ) ) { + $meta = array(); + $old_meta = wp_get_attachment_metadata( $post_id ); + if ( isset( $old_meta[ Sync::META_KEYS['cloudinary'] ] ) ) { + $meta = $old_meta[ Sync::META_KEYS['cloudinary'] ]; + // Add public ID. + $public_id = get_post_meta( $post_id, Sync::META_KEYS['public_id'], true ); + $meta[ Sync::META_KEYS['public_id'] ] = $public_id; + update_post_meta( $post_id, Sync::META_KEYS['cloudinary'], $meta ); + delete_post_meta( $post_id, Sync::META_KEYS['public_id'] ); + } } - - if ( '' === $key ) { - $data = $meta_data[ Sync::META_KEYS['cloudinary'] ]; - } elseif ( ! empty( $meta_data[ Sync::META_KEYS['cloudinary'] ][ $key ] ) ) { - $data = $meta_data[ Sync::META_KEYS['cloudinary'] ][ $key ]; - } else { - $data = $this->build_cached_meta( $post_id, $key, $single ); + if ( '' !== $key ) { + $meta = isset( $meta[ $key ] ) ? $meta[ $key ] : ''; } - return $data; + return $single ? $meta : (array) $meta; } /** @@ -1878,19 +1887,21 @@ public function build_cached_meta( $post_id, $key, $single ) { * @param int $post_id The attachment ID. * @param string $key The meta key to get. * @param string|array $data $the meta data to update. + * + * @return bool */ public function update_post_meta( $post_id, $key, $data ) { - $meta_data = wp_get_attachment_metadata( $post_id, true ); - if ( is_array( $meta_data ) ) { - if ( ! isset( $meta_data[ Sync::META_KEYS['cloudinary'] ] ) ) { - $meta_data[ Sync::META_KEYS['cloudinary'] ] = array(); - } - $meta_data[ Sync::META_KEYS['cloudinary'] ][ $key ] = $data; - wp_update_attachment_metadata( $post_id, $meta_data ); - } else { - // Update core mete data for consistency. - update_post_meta( $post_id, $key, $data ); + + $meta = $this->get_post_meta( $post_id ); + if ( ! isset( $meta[ $key ] ) ) { + $meta[ $key ] = ''; } + + if ( $meta[ $key ] !== $data ) { + $meta[ $key ] = $data; + } + + return update_post_meta( $post_id, Sync::META_KEYS['cloudinary'], $meta ); } /** @@ -1898,14 +1909,17 @@ public function update_post_meta( $post_id, $key, $data ) { * * @param int $post_id The attachment ID. * @param string $key The meta key to get. + * + * @return bool */ public function delete_post_meta( $post_id, $key ) { - $meta_data = wp_get_attachment_metadata( $post_id, true ); - if ( is_array( $meta_data ) && isset( $meta_data[ Sync::META_KEYS['cloudinary'] ] ) && is_array( $meta_data[ Sync::META_KEYS['cloudinary'] ] ) ) { - // Only do this side if has been set before. - unset( $meta_data[ Sync::META_KEYS['cloudinary'] ][ $key ] ); - wp_update_attachment_metadata( $post_id, $meta_data ); + + $meta = $this->get_post_meta( $post_id ); + if ( isset( $meta[ $key ] ) ) { + 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 31a66b978..a8dadfe19 100644 --- a/php/class-sync.php +++ b/php/class-sync.php @@ -160,24 +160,51 @@ public function been_synced( $attachment_id ) { /** * Checks if an asset is synced and up to date. * - * @param int $post_id The post id to check. + * @param int $post_id The post id to check. + * @param bool $re_check Flag to bypass cache and recheck. * * @return bool */ - public function is_synced( $post_id ) { - $expecting = $this->generate_signature( $post_id ); - - if ( ! is_wp_error( $expecting ) ) { - $signature = $this->get_signature( $post_id ); - // Sort to align orders for comparison. - ksort( $signature ); - ksort( $expecting ); - if ( ! empty( $signature ) && ! empty( $expecting ) && $expecting === $signature ) { - return true; + public function is_synced( $post_id, $re_check = false ) { + static $synced = array(); + if ( isset( $synced[ $post_id ] ) && false === $re_check ) { + return $synced[ $post_id ]; + } + $return = false; + if ( $this->managers['media']->has_public_id( $post_id ) ) { + $expecting = $this->generate_signature( $post_id ); + if ( ! is_wp_error( $expecting ) ) { + $signature = $this->get_signature( $post_id ); + // Sort to align orders for comparison. + ksort( $signature ); + ksort( $expecting ); + if ( ! empty( $signature ) && ! empty( $expecting ) && $expecting === $signature ) { + $return = true; + } } } + $synced[ $post_id ] = $return; - return false; + return $synced[ $post_id ]; + } + + /** + * Log a sync result. + * + * @param int $attachment_id The attachment id. + * @param string $type The sync type. + * @param mixed $result The result. + */ + public function log_sync_result( $attachment_id, $type, $result ) { + $log = $this->managers['media']->get_post_meta( $attachment_id, self::META_KEYS['process_log'], true ); + $keys = array_keys( $this->sync_base_struct ); + if ( empty( $log ) || count( $log ) !== count( $keys ) ) { + $log = array_fill_keys( $keys, array() ); + } + if ( isset( $log[ $type ] ) ) { + $log[ $type ] = $result; + $this->managers['media']->update_post_meta( $attachment_id, self::META_KEYS['process_log'], $log ); + } } /** @@ -512,7 +539,7 @@ public function setup_sync_base_struct() { 'sync' => function ( $attachment_id ) { $meta = $this->managers['media']->get_post_meta( $attachment_id ); foreach ( $meta as $key => $value ) { - if ( self::META_KEYS['public_id'] === $key ) { + if ( Sync::META_KEYS['cloudinary'] === $key ) { $this->managers['media']->delete_post_meta( $attachment_id, $key ); continue; } @@ -665,10 +692,17 @@ public function sync_base( $post ) { * @return string | null */ public function maybe_prepare_sync( $attachment_id ) { - - $type = $this->get_sync_type( $attachment_id ); - if ( $type && $this->can_sync( $attachment_id, $type ) ) { - $this->add_to_sync( $attachment_id ); + $type = null; + if ( $this->can_sync( $attachment_id, $type ) ) { + $type = $this->get_sync_type( $attachment_id ); + if ( $type ) { + $this->add_to_sync( $attachment_id ); + } else { + // if null, and can sync but has no type, realtime syncs may have been applied. so recheck. + if ( $this->is_synced( $attachment_id, true ) ) { + $type = true; + } + } } return $type; diff --git a/php/media/class-upgrade.php b/php/media/class-upgrade.php index 19f3f23dc..a0289c832 100644 --- a/php/media/class-upgrade.php +++ b/php/media/class-upgrade.php @@ -98,7 +98,7 @@ public function convert_cloudinary_version( $attachment_id ) { if ( empty( $public_id ) ) { $public_id = implode( '/', $parts ); } - update_post_meta( $attachment_id, Sync::META_KEYS['public_id'], $public_id ); + $this->media->update_post_meta( $attachment_id, Sync::META_KEYS['public_id'], $public_id ); $this->media->update_post_meta( $attachment_id, Sync::META_KEYS['version'], $asset_version ); if ( ! empty( $asset_transformations ) ) { $this->media->update_post_meta( $attachment_id, Sync::META_KEYS['transformation'], $asset_transformations ); @@ -115,7 +115,7 @@ public function convert_cloudinary_version( $attachment_id ) { } $public_id .= $suffix; $this->media->delete_post_meta( $attachment_id, Sync::META_KEYS['suffix'] ); - update_post_meta( $attachment_id, Sync::META_KEYS['public_id'], $public_id ); + $this->media->update_post_meta( $attachment_id, Sync::META_KEYS['public_id'], $public_id ); } // Check folder sync in order. if ( $this->media->is_folder_synced( $attachment_id ) ) { @@ -142,8 +142,8 @@ public function convert_cloudinary_version( $attachment_id ) { if ( ! empty( $transformations ) ) { $sync_key .= wp_json_encode( $transformations ); } - update_post_meta( $attachment_id, '_' . md5( $sync_key ), true ); - update_post_meta( $attachment_id, '_' . md5( 'base_' . $public_id ), true ); + delete_post_meta( $attachment_id, '_' . md5( $sync_key ), true ); + delete_post_meta( $attachment_id, '_' . md5( 'base_' . $public_id ), true ); // Get a new uncached signature. $this->sync->get_signature( $attachment_id, true ); diff --git a/php/sync/class-download-sync.php b/php/sync/class-download-sync.php index 932e0e5d9..77c05a37b 100644 --- a/php/sync/class-download-sync.php +++ b/php/sync/class-download-sync.php @@ -174,21 +174,8 @@ public function download_asset( $attachment_id, $source = null, $date = null ) { // Prepare the asset. update_attached_file( $attachment_id, $upload['file'] ); - $old_meta = wp_get_attachment_metadata( $attachment_id ); - ob_start(); // Catch possible errors in WordPress's ID3 module when setting meta for transformed videos. - $meta = wp_generate_attachment_metadata( $attachment_id, $upload['file'] ); - $captured_errors = ob_get_clean(); // Capture issues. - // Be sure to record v2 meta. - if ( ! empty( $old_meta[ Sync::META_KEYS['cloudinary'] ] ) ) { - $meta[ Sync::META_KEYS['cloudinary'] ] = $old_meta[ Sync::META_KEYS['cloudinary'] ]; - } else { - // Maybe capture newest meta. - $maybe_new = wp_get_attachment_metadata( $attachment_id ); - if ( ! empty( $maybe_new[ Sync::META_KEYS['cloudinary'] ] ) ) { - $meta[ Sync::META_KEYS['cloudinary'] ] = $maybe_new[ Sync::META_KEYS['cloudinary'] ]; - } - } - wp_update_attachment_metadata( $attachment_id, $meta ); + wp_generate_attachment_metadata( $attachment_id, $upload['file'] ); + // Update the folder synced flag. $public_id = $this->media->get_public_id( $attachment_id ); $asset_folder = strpos( $public_id, '/' ) ? dirname( $public_id ) : '/'; diff --git a/php/sync/class-push-sync.php b/php/sync/class-push-sync.php index 979581c6b..391741ca7 100644 --- a/php/sync/class-push-sync.php +++ b/php/sync/class-push-sync.php @@ -194,8 +194,6 @@ public function process_assets( $attachments = array() ) { $ids = array_map( 'intval', (array) $attachments ); // Handle based on Sync Type. foreach ( $ids as $attachment_id ) { - // Create synced post meta as a way to search for synced / unsynced items. - update_post_meta( $attachment_id, Sync::META_KEYS['public_id'], $this->media->get_public_id( $attachment_id ) ); // Skip external media. if ( ! $this->media->is_local_media( $attachment_id ) ) { @@ -209,21 +207,23 @@ public function process_assets( $attachments = array() ) { update_post_meta( $attachment_id, Sync::META_KEYS['syncing'], time() ); $stat[ $attachment_id ] = array(); 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 ); if ( isset( $stat[ $attachment_id ][ $type ] ) ) { // Loop prevention. break; } - $stat[ $attachment_id ][ $type ] = $this->sync->run_sync_method( $type, 'sync', $attachment_id ); - } - $prev_stat = $this->media->get_post_meta( $attachment_id, Sync::META_KEYS['process_log'], true ); - if ( empty( $prev_stat ) ) { - $prev_stat = array(); + $stat[ $attachment_id ][ $type ] = true; + $result = $this->sync->run_sync_method( $type, 'sync', $attachment_id ); + if ( ! empty( $result ) ) { + $this->sync->log_sync_result( $attachment_id, $type, $result ); + } } - $stat[ $attachment_id ] = array_merge( $prev_stat, $stat ); + // remove pending. delete_post_meta( $attachment_id, Sync::META_KEYS['pending'] ); - // Record Process log. - $this->media->update_post_meta( $attachment_id, Sync::META_KEYS['process_log'], $stat[ $attachment_id ] ); + // Remove processing flag. delete_post_meta( $attachment_id, Sync::META_KEYS['syncing'] ); diff --git a/php/sync/class-upload-sync.php b/php/sync/class-upload-sync.php index 2362776a9..d9362db4d 100644 --- a/php/sync/class-upload-sync.php +++ b/php/sync/class-upload-sync.php @@ -277,14 +277,11 @@ function ( $is_synced, $post_id ) use ( $attachment_id ) { // Set folder Synced. $this->media->update_post_meta( $attachment_id, Sync::META_KEYS['folder_sync'], $this->media->is_folder_synced( $attachment_id ) ); // Set public_id. - update_post_meta( $attachment_id, Sync::META_KEYS['public_id'], $public_id ); + $this->media->update_post_meta( $attachment_id, Sync::META_KEYS['public_id'], $result['public_id'] ); // Set version. $this->media->update_post_meta( $attachment_id, Sync::META_KEYS['version'], $result['version'] ); // Set the delivery type. $this->media->update_post_meta( $attachment_id, Sync::META_KEYS['delivery'], $result['type'] ); - // Set traceable sync keys. - update_post_meta( $attachment_id, '_' . md5( $options['public_id'] ), true ); - update_post_meta( $attachment_id, '_' . md5( 'base_' . $options['public_id'] ), true ); // Update signature for all that use the same method. $this->sync->sync_signature_by_type( $attachment_id, $type ); // Update options and public_id as well (full sync). diff --git a/php/traits/trait-cli.php b/php/traits/trait-cli.php index 9e6b071d1..9a8180f98 100644 --- a/php/traits/trait-cli.php +++ b/php/traits/trait-cli.php @@ -206,7 +206,6 @@ protected function process_sync( $posts, $total ) { $this->plugin->get_component( 'sync' )->managers['push']->process_assets( $asset, $bar ); } delete_post_meta( $asset, '_cld_unsynced', true ); - $bar->tick(); } // Done message - reanalyze. if ( $done === $total ) { From 3d95d364f0af3fec98a25e437826b634a0672aa6 Mon Sep 17 00:00:00 2001 From: David Cramer Date: Thu, 24 Jun 2021 14:44:31 +0200 Subject: [PATCH 02/56] change meta check --- php/sync/class-sync-queue.php | 2 +- php/ui/component/class-media-status.php | 2 +- php/ui/component/class-sync.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/php/sync/class-sync-queue.php b/php/sync/class-sync-queue.php index 30edb2689..29d006748 100644 --- a/php/sync/class-sync-queue.php +++ b/php/sync/class-sync-queue.php @@ -299,7 +299,7 @@ public function build_queue() { 'compare' => 'NOT EXISTS', ), array( - 'key' => Sync::META_KEYS['public_id'], + 'key' => Sync::META_KEYS['cloudinary'], 'compare' => 'NOT EXISTS', ), array( diff --git a/php/ui/component/class-media-status.php b/php/ui/component/class-media-status.php index 917f82a75..21e204540 100644 --- a/php/ui/component/class-media-status.php +++ b/php/ui/component/class-media-status.php @@ -161,7 +161,7 @@ protected function get_total_synced_media() { 'posts_per_page' => 1, 'meta_query' => array( // phpcs:ignore WordPress.DB.SlowDBQuery array( - 'key' => Sync::META_KEYS['public_id'], + 'key' => Sync::META_KEYS['cloudinary'], 'compare' => 'EXISTS', ), diff --git a/php/ui/component/class-sync.php b/php/ui/component/class-sync.php index 991ef44f8..95503aa4e 100644 --- a/php/ui/component/class-sync.php +++ b/php/ui/component/class-sync.php @@ -151,7 +151,7 @@ protected function count_to_sync() { 'posts_per_page' => 1, 'meta_query' => array( // phpcs:ignore array( - 'key' => \Cloudinary\Sync::META_KEYS['public_id'], + 'key' => \Cloudinary\Sync::META_KEYS['cloudinary'], 'compare' => 'NOT EXISTS', ), From ce5ae19a536be77f9fbb9a3b530a357fd025e961 Mon Sep 17 00:00:00 2001 From: David Cramer Date: Thu, 24 Jun 2021 15:11:08 +0200 Subject: [PATCH 03/56] upload via url if not a local file --- php/connect/class-api.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/php/connect/class-api.php b/php/connect/class-api.php index 21767968b..45e43b852 100644 --- a/php/connect/class-api.php +++ b/php/connect/class-api.php @@ -396,6 +396,12 @@ function_exists( 'wp_get_original_image_url' ) && } else { $file_url = wp_get_attachment_url( $attachment_id ); } + if ( ! is_local_attachment( $attachment_id ) ) { + $disable_https_fetch = false; // Remote can upload via url. + // translators: variable is thread name and queue size. + $action_message = sprintf( __( 'Uploading remote url: %1$s.', 'cloudinary' ), $file_url ); + do_action( '_cloudinary_queue_action', $action_message ); + } $media = get_plugin_instance()->get_component( 'media' ); $tempfile = false; if ( $media && $media->is_cloudinary_url( $file_url ) ) { From 2e445197b0a99c80c5d5b802a2bf2156ccd240d0 Mon Sep 17 00:00:00 2001 From: David Cramer Date: Sat, 26 Jun 2021 06:56:57 +0200 Subject: [PATCH 04/56] add limit and unfilter meta --- php/class-media.php | 2 +- php/class-sync.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/php/class-media.php b/php/class-media.php index 85971e9a9..2c414a2c2 100644 --- a/php/class-media.php +++ b/php/class-media.php @@ -1846,7 +1846,7 @@ public function get_post_meta( $post_id, $key = '', $single = false ) { $meta = get_post_meta( $post_id, Sync::META_KEYS['cloudinary'], true ); if ( empty( $meta ) ) { $meta = array(); - $old_meta = wp_get_attachment_metadata( $post_id ); + $old_meta = wp_get_attachment_metadata( $post_id, true ); if ( isset( $old_meta[ Sync::META_KEYS['cloudinary'] ] ) ) { $meta = $old_meta[ Sync::META_KEYS['cloudinary'] ]; // Add public ID. diff --git a/php/class-sync.php b/php/class-sync.php index a8dadfe19..3a30d168f 100644 --- a/php/class-sync.php +++ b/php/class-sync.php @@ -202,7 +202,11 @@ public function log_sync_result( $attachment_id, $type, $result ) { $log = array_fill_keys( $keys, array() ); } if ( isset( $log[ $type ] ) ) { - $log[ $type ] = $result; + + $log[ $type ][ time() ] = $result; + if ( 5 < count( $log[ $type ] ) ) { + array_shift( $log[ $type ] ); + } $this->managers['media']->update_post_meta( $attachment_id, self::META_KEYS['process_log'], $log ); } } From bd021057f19d340204bc5c6a0eb1c811f6565567 Mon Sep 17 00:00:00 2001 From: Marco Pereirinha Date: Wed, 30 Jun 2021 12:29:45 +0100 Subject: [PATCH 05/56] Cleanup --- 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 85971e9a9..020db038f 100644 --- a/php/class-media.php +++ b/php/class-media.php @@ -955,7 +955,7 @@ public function default_image_freeform_transformations( $default ) { * @return string The converted URL. */ public function cloudinary_url( $attachment_id, $size = array(), $transformations = array(), $cloudinary_id = null, $overwrite_transformations = false ) { - if ( ! ( $cloudinary_id ) ) { + if ( ! $cloudinary_id ) { $cloudinary_id = $this->cloudinary_id( $attachment_id ); if ( ! $cloudinary_id ) { return null; From f1d56121e158f6479f3a55ac2929dbcbb476f442 Mon Sep 17 00:00:00 2001 From: Marco Pereirinha Date: Wed, 30 Jun 2021 12:30:35 +0100 Subject: [PATCH 06/56] Improve output consistency --- php/class-media.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/php/class-media.php b/php/class-media.php index 020db038f..76015c6a6 100644 --- a/php/class-media.php +++ b/php/class-media.php @@ -1159,7 +1159,7 @@ public function get_cloudinary_id( $attachment_id ) { * * @param int $attachment_id The ID to get Cloudinary id for. * - * @return string|false the ID or null if not existing. + * @return string|false the ID or false if not existing. */ public function cloudinary_id( $attachment_id ) { static $cloudinary_ids = array(); @@ -1170,8 +1170,8 @@ public function cloudinary_id( $attachment_id ) { } if ( ! $this->is_media( $attachment_id ) ) { - $cloudinary_ids[ $attachment_id ] = null; - return null; + $cloudinary_ids[ $attachment_id ] = false; + return false; } if ( ! $this->sync->is_synced( $attachment_id ) && ! defined( 'REST_REQUEST' ) ) { From c714cb09c75722eb8aead5497046f645f1041002 Mon Sep 17 00:00:00 2001 From: Marco Pereirinha Date: Wed, 30 Jun 2021 12:31:26 +0100 Subject: [PATCH 07/56] Default get meta to null --- 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 76015c6a6..8304a7076 100644 --- a/php/class-media.php +++ b/php/class-media.php @@ -1857,7 +1857,7 @@ public function get_post_meta( $post_id, $key = '', $single = false ) { } } if ( '' !== $key ) { - $meta = isset( $meta[ $key ] ) ? $meta[ $key ] : ''; + $meta = isset( $meta[ $key ] ) ? $meta[ $key ] : null; } return $single ? $meta : (array) $meta; From 9f59afc560ba8e674b5cd07bc27a3e37799ee5d1 Mon Sep 17 00:00:00 2001 From: Marco Pereirinha Date: Wed, 30 Jun 2021 12:32:00 +0100 Subject: [PATCH 08/56] Get single key for delivery type --- php/class-sync.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/class-sync.php b/php/class-sync.php index a8dadfe19..63589bb54 100644 --- a/php/class-sync.php +++ b/php/class-sync.php @@ -499,7 +499,7 @@ public function setup_sync_base_struct() { 'priority' => 25, 'sync' => array( $this->managers['upload'], 'explicit_update' ), 'validate' => function ( $attachment_id ) { - $delivery = $this->managers['media']->get_post_meta( $attachment_id, self::META_KEYS['delivery'] ); + $delivery = $this->managers['media']->get_post_meta( $attachment_id, self::META_KEYS['delivery'], true ); return empty( $delivery ) || 'upload' === $delivery; }, From 23ab2c0f71e652eb8843d360095546c3b496a331 Mon Sep 17 00:00:00 2001 From: Marco Pereirinha Date: Wed, 30 Jun 2021 12:32:35 +0100 Subject: [PATCH 09/56] Change the source of information into the newly added Cloudinary meta key --- php/class-report.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/php/class-report.php b/php/class-report.php index fe7beb66e..b9de63d41 100644 --- a/php/class-report.php +++ b/php/class-report.php @@ -163,7 +163,8 @@ public function image_meta_viewer() { */ public function render( $post ) { if ( 'attachment' === $post->post_type ) { - $meta = wp_get_attachment_metadata( $post->ID ); + $sync = $this->plugin->get_component( 'sync' ); + $meta = get_post_meta( $post->ID, $sync::META_KEYS['cloudinary'], true ); $args = array( 'type' => 'tag', From fca6001572c136bcc6f002e0006b15500ba654e2 Mon Sep 17 00:00:00 2001 From: Marco Pereirinha Date: Wed, 30 Jun 2021 12:33:06 +0100 Subject: [PATCH 10/56] Use plugin internal logic to check if the media is local --- php/connect/class-api.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php/connect/class-api.php b/php/connect/class-api.php index 45e43b852..147412e11 100644 --- a/php/connect/class-api.php +++ b/php/connect/class-api.php @@ -396,13 +396,13 @@ function_exists( 'wp_get_original_image_url' ) && } else { $file_url = wp_get_attachment_url( $attachment_id ); } - if ( ! is_local_attachment( $attachment_id ) ) { + $media = get_plugin_instance()->get_component( 'media' ); + if ( ! $media->is_local_media( $attachment_id ) ) { $disable_https_fetch = false; // Remote can upload via url. // translators: variable is thread name and queue size. $action_message = sprintf( __( 'Uploading remote url: %1$s.', 'cloudinary' ), $file_url ); do_action( '_cloudinary_queue_action', $action_message ); } - $media = get_plugin_instance()->get_component( 'media' ); $tempfile = false; if ( $media && $media->is_cloudinary_url( $file_url ) ) { // If this is a Cloudinary URL, then we can use it to fetch from that location. From 4526fa0404c1ed7f604a9994fd7064601907ba79 Mon Sep 17 00:00:00 2001 From: David Cramer Date: Thu, 1 Jul 2021 13:07:15 +0200 Subject: [PATCH 11/56] add url and asset --- php/media/class-asset.php | 295 +++++++++++++++++ php/media/class-cloudinary-url.php | 498 +++++++++++++++++++++++++++++ 2 files changed, 793 insertions(+) create mode 100644 php/media/class-asset.php create mode 100644 php/media/class-cloudinary-url.php diff --git a/php/media/class-asset.php b/php/media/class-asset.php new file mode 100644 index 000000000..fd8bd1ff4 --- /dev/null +++ b/php/media/class-asset.php @@ -0,0 +1,295 @@ + 'https', + 'host' => null, + 'cloudname' => null, + 'resource_type' => null, + 'delivery' => null, + 'size' => null, + 'transformations' => array( + 'asset' => array(), + 'taxonomy' => array(), + 'global' => array(), + 'optimizations' => array(), + ), + 'version' => 'v1', + 'public_id' => null, + 'seo' => null, + 'extension' => null, + ); + + /** + * Asset constructor. + * + * @param int $attachment_id The attachment ID. + * @param array|null $meta The post meta. + */ + public function __construct( $attachment_id, $meta = null ) { + $this->attachment_id = $attachment_id; + $this->init( $meta ); + $this->synced(); + $this->set_post_context(); + } + + /** + * Init an asset. + * + * @param null|array $meta The post meta to init the asset with. + */ + protected function init( $meta = null ) { + if ( ! $meta ) { + $meta = wp_get_attachment_metadata( $this->attachment_id, true ); + } + if ( ! empty( $meta['sizes'] ) ) { + $this->current_size = 'full'; + $this->full_size['width'] = ! empty( $meta['width'] ) ? $meta['width'] : $meta['sizes']['full']['width']; + $this->full_size['height'] = ! empty( $meta['height'] ) ? $meta['height'] : $meta['sizes']['full']['height']; + foreach ( $meta['sizes'] as $size => $data ) { + $this->files[ $size ] = $data['file']; + $this->sizes[ $size ] = array( + 'width' => $data['width'], + 'height' => $data['height'], + ); + if ( ! $this->matches_ratio( $data['width'], $data['height'] ) ) { + $this->sizes[ $size ]['crop'] = 'fill'; + } + } + } + } + + /** + * Checks if a size matches the original size. + * + * @param int $width The Width to check. + * @param int $height the Height to check. + * + * @return bool + */ + public function matches_ratio( $width, $height ) { + $matches = false; + if ( ! empty( $this->full_size ) ) { + $matches = wp_image_matches_ratio( + // PDFs do not always have width and height, but they do have full sizes. + // This is important for the thumbnail crops on the media library. + $this->full_size['width'], + $this->full_size['height'], + $width, + $height + ); + } + + return $matches; + } + + /** + * Set the objects size. + * + * @param null|string|array $size The size to set. + */ + public function set_size( $size = null ) { + $set_size = $this->full_size; + $this->parts['seo'] = null; + if ( isset( $this->sizes[ $size ] ) ) { + $set_size = $this->sizes[ $size ]; + $this->parts['seo'] = $this->files[ $size ]; + } elseif ( is_array( $size ) ) { + $clean = array_filter( $size, 'is_numeric' ); + $set_size['width'] = array_shift( $clean ); + if ( ! empty( $clean ) ) { + $set_size['height'] = array_shift( $clean ); + if ( ! $this->matches_ratio( $set_size['width'], $set_size['height'] ) ) { + $set_size['crop'] = 'fill'; + } + } + } + + $this->parts['size'] = $set_size; + } + + /** + * Get the assets ID. + * + * @return int + */ + public function get_id() { + return $this->attachment_id; + } + + /** + * Checks if synced. + * + * @param bool $recheck Flag to signal a recheck. + * + * @return bool + */ + public function synced( $recheck = false ) { + if ( is_null( $this->synced ) || true === $recheck ) { + $this->synced = get_plugin_instance()->get_component( 'sync' )->is_synced( $this->attachment_id ); + } + + return $this->synced; + } + + /** + * Magic method to set the Parts, which can be larger as needed.. + * + * @param string $name The key to set. + * @param mixed $value The value to set. + */ + public function __set( $name, $value ) { + $this->parts[ $name ] = $value; + } + + /** + * Set transformations. + * + * @param string $type The type to set. + * @param array $value The transformation array to set. + */ + public function set_transformation( $type, $value ) { + $this->parts['transformations'][ $type ] = $value; + } + + /** + * Clear a transformation set. + * + * @param string $type The key to clear. + */ + public function clear_transformation( $type ) { + $this->set_transformation( $type, array() ); + } + + /** + * Sets the post id. + * + * @param null|int $post_context_id The post ID. + */ + public function set_post_context( $post_context_id = null ) { + if ( is_null( $post_context_id ) ) { + $post_context = get_post(); + if ( $post_context ) { + $post_context_id = $post_context->ID; + } + } + + if ( $post_context_id && $post_context_id !== $this->current_post_id ) { + $globals = Cloudinary_URL::get_instance()->get_post_globals( $post_context_id ); + if ( ! empty( $globals['taxonomy'] ) ) { + $this->set_transformation( 'taxonomy', $globals['taxonomy'] ); + if ( true === $globals['taxonomy_overwrite'] ) { + $this->clear_transformation( 'global' ); + } + } + $this->current_post_id = $post_context_id; + } + } + + /** + * Get the assets local URL. + * + * @return false|string + */ + public function get_local_url() { + if ( 'image' === $this->parts['resource_type'] ) { + $url = wp_get_attachment_image_url( $this->attachment_id, $this->current_size ); + } else { + $url = wp_get_attachment_url( $this->attachment_id ); + } + + return $url; + } + + /** + * Render the cloudinary URL. + * + * @return false|string + */ + public function render() { + if ( ! $this->synced ) { + return $this->get_local_url(); + } + $parts = $this->parts; + $parts['scheme'] .= ':/'; + if ( ! empty( $parts['seo'] ) ) { + $parts['resource_type'] = 'images'; + $parts['public_id'] = strtok( $parts['public_id'], '.' ); + unset( $parts['delivery'] ); + } + $parts = array_filter( $parts ); + + return Cloudinary_URL::generate_transformation_string( $parts ); + } +} diff --git a/php/media/class-cloudinary-url.php b/php/media/class-cloudinary-url.php new file mode 100644 index 000000000..7b9fcc50b --- /dev/null +++ b/php/media/class-cloudinary-url.php @@ -0,0 +1,498 @@ + array( + 'a' => 'angle', + 'ar' => 'aspect_ratio', + 'b' => 'background', + 'bo' => 'border', + 'c' => 'crop', + 'co' => 'color', + 'dpr' => 'dpr', + 'du' => 'duration', + 'e' => 'effect', + 'eo' => 'end_offset', + 'fl' => 'flags', + 'h' => 'height', + 'l' => 'overlay', + 'o' => 'opacity', + 'q' => 'quality', + 'r' => 'radius', + 'so' => 'start_offset', + 't' => 'named_transformation', + 'u' => 'underlay', + 'vc' => 'video_codec', + 'w' => 'width', + 'x' => 'x', + 'y' => 'y', + 'z' => 'zoom', + 'ac' => 'audio_codec', + 'af' => 'audio_frequency', + 'br' => 'bit_rate', + 'cs' => 'color_space', + 'd' => 'default_image', + 'dl' => 'delay', + 'dn' => 'density', + 'f' => 'fetch_format', + 'g' => 'gravity', + 'p' => 'prefix', + 'pg' => 'page', + 'sp' => 'streaming_profile', + 'vs' => 'video_sampling', + 'if' => 'if', + ), + 'video' => array( + 'w' => 'width', + 'h' => 'height', + 'c' => 'crop', + 'ar' => 'aspect_ratio', + 'g' => 'gravity', + 'b' => 'background', + 'e' => 'effect', + 'l' => 'overlay', + 'so' => 'start_offset', + 'eo' => 'end_offset', + 'du' => 'duration', + 'a' => 'angle', + 'vs' => 'video_sampling', + 'dl' => 'delay', + 'vc' => 'video_codec', + 'fps' => 'fps', + 'dpr' => 'dpr', + 'br' => 'bit_rate', + 'ki' => 'keyframe_interval', + 'sp' => 'streaming_profile', + 'ac' => 'audio_codec', + 'af' => 'audio_frequency', + 'fl' => 'flags', + 'f' => 'fetch_format', + 'q' => 'quality', + 'if' => 'if', + ), + ); + + /** + * Holds the base URLS for each media type. + * + * @var array + */ + protected $base_urls = array(); + + /** + * Holds the base media types. + * + * @var array + */ + protected $media_types = array( + 'image', + 'video', + ); + + /** + * Holds the posts globals. + * + * @var array + */ + protected $posts = array(); + + /** + * Holds requested assets. + * + * @var Asset[] + */ + protected $assets = array(); + + /** + * Holds all the local urls for requested assets. + * + * @var array + */ + protected $local_urls = array(); + + /** + * Holds the current post ID. + * + * @var int + */ + protected $current_post_id; + + /** + * Filter constructor. + * + * @param Media $media The plugin. + */ + public function __construct( Media $media ) { + $this->media = $media; + $this->credentials = $media->credentials; + add_action( 'the_post', array( $this, 'capture_post_transformations' ) ); + add_filter( 'wp_get_attachment_metadata', array( $this, 'meta_asset' ), 10, 2 ); + } + + /** + * Get the single instance. + * + * @return Cloudinary_URL + */ + public static function get_instance() { + if ( ! self::$instance ) { + $media = get_plugin_instance()->get_component( 'media' ); + self::$instance = new self( $media ); + } + + return self::$instance; + } + + /** + * Catch an asset via the meta filter. + * + * @param array $meta The metadata. + * @param int $attachment_id The attachement id. + * + * @return array + */ + public function meta_asset( $meta, $attachment_id ) { + + if ( ! isset( $this->assets[ $attachment_id ] ) ) { + $this->assets[ $attachment_id ] = new Asset( $attachment_id, $meta ); + $this->init_asset( $attachment_id ); + $this->assets[ $attachment_id ]->set_post_context( $this->current_post_id ); + + $local_url = wp_get_attachment_url( $attachment_id ); + $this->local_urls[ $local_url ]['attachment_id'] = $attachment_id; + $this->local_urls[ $local_url ]['cloudinary_url'] = $this->assets[ $attachment_id ]->render(); + if ( $meta['sizes'] ) { + foreach ( $meta['sizes'] as $size => $data ) { + $sized = wp_get_attachment_image_url( $attachment_id, $size ); + $this->assets[ $attachment_id ]->set_size( $size ); + $this->local_urls[ $sized ] = array( + 'attachment_id' => $attachment_id, + 'size' => $size, + 'cloudinary_url' => $this->assets[ $attachment_id ]->render(), + ); + } + } + } + + return $meta; + } + + /** + * Get the globals at a post level. + * + * @param int $post_id The post ID. + * + * @return array + */ + public function get_post_globals( $post_id ) { + $return = array(); + if ( isset( $this->posts[ $post_id ] ) ) { + $return = $this->posts[ $post_id ]; + } + + return $return; + } + + /** + * Get an asset by URL. + * + * @param string $url The url to get asset for. + * + * @return null|Asset + */ + public function get_asset_by_url( $url ) { + $asset = null; + if ( isset( $this->local_urls[ $url ] ) ) { + $attachment_id = $this->local_urls[ $url ]['attachment_id']; + $asset = $this->get_asset( $attachment_id ); + if ( ! empty( $this->local_urls[ $url ]['size'] ) ) { + $asset->set_size( $this->local_urls[ $url ]['size'] ); + } + } + + return $asset; + } + + /** + * Get all url pairs. + * + * @return array + */ + public function get_url_pairs() { + return array_map( + function ( $item ) { + return $item['cloudinary_url']; + }, + $this->local_urls + ); + } + + /** + * Capture globals for a post. + * + * @param WP_Post $post The post. + */ + public function capture_post_transformations( $post ) { + $this->current_post_id = $post->ID; + if ( $post && ! isset( $this->posts[ $post->ID ] ) ) { + foreach ( $this->media_types as $type ) { + $this->posts[ $post->ID ]['taxonomy'][ $type ] = $this->media->global_transformations->get_taxonomy_transformations( $type ); + $this->posts[ $post->ID ]['taxonomy_overwrite'] = $this->media->global_transformations->is_taxonomy_overwrite(); + } + } + } + + /** + * Get an asset by ID. + * + * @param int $attachment_id The attachment ID. + * @param string|array|null $size The optional size. + * + * @return Asset + */ + public function get_asset( $attachment_id, $size = null ) { + if ( ! isset( $this->assets[ $attachment_id ] ) ) { + $this->assets[ $attachment_id ] = new Asset( $attachment_id ); + $this->init_asset( $attachment_id ); + } + $asset = $this->assets[ $attachment_id ]; + $asset->set_size( $size ); + + return $this->assets[ $attachment_id ]; + } + + /** + * Get all assets. + * + * @return Asset[] + */ + public function get_assets() { + return $this->assets; + } + + /** + * Init the base urls. + */ + protected function init_base_urls() { + + /** + * Filter the base Media Types. + * + * @param array $default The default media types array. + * + * @return array + */ + $base_types = apply_filters( 'cloudinary_base_media_types', $this->media_types ); + foreach ( $base_types as $type ) { + $this->base_urls[ $type ] = $this->url( $type ); + } + } + + /** + * Return an endpoint for a specific resource type. + * + * @param string $resource The resource type for the endpoint. + * @param string $delivery The delivery type. + * + * @return array + */ + protected function url( $resource, $delivery = 'upload' ) { + $globals = apply_filters( "cloudinary_default_freeform_transformations_{$resource}", array(), array() ); + $global_transformations = array(); + foreach ( $globals as $global ) { + $global_transformations = array_merge( $global_transformations, self::get_transformations_from_string( $global, $resource ) ); + } + $parts = array( + 'scheme' => 'https', + 'host' => $this->asset_url, + 'cloudname' => isset( $this->credentials['cname'] ) ? $this->credentials['cname'] : $this->credentials['cloud_name'], + 'resource_type' => $resource, + 'delivery' => $delivery, + 'transformations' => array( + 'asset' => array(), + 'taxonomy' => array(), + 'global' => $global_transformations, + 'optimizations' => apply_filters( "cloudinary_default_qf_transformations_{$resource}", array(), array() ), + ), + + ); + + return $parts; + } + + /** + * Generate a transformation set. + * + * @param array $options The transformation options to generate from. + * @param string $type The asset Type. + * + * @return string + */ + protected static function build_transformation_set( array $options, $type = 'image' ) { + if ( ! isset( self::$transformation_index[ $type ] ) ) { + return ''; + } + $transformation_index = array_flip( self::$transformation_index[ $type ] ); + $transformations = array(); + + foreach ( $options as $key => $value ) { + if ( isset( $transformation_index[ $key ] ) ) { + $transformations[] = $transformation_index[ $key ] . '_' . $value; + } elseif ( ! is_numeric( $key ) && '$' === $key[0] ) { + $transformations[] = $key . '_' . $value; + } + } + // Clear out empty parts. + $transformations = array_filter( $transformations ); + + return implode( ',', $transformations ); + } + + /** + * Generate a transformation string made up of slash separated transformation sets. + * + * @param array $options The transformation options to generate from. + * @param string $type The asset Type. + * + * @return string + */ + public static function generate_transformation_string( array $options, $type = 'image' ) { + if ( ! isset( self::$transformation_index[ $type ] ) ) { + return ''; + } + $transformations = array(); + foreach ( $options as $index => $option ) { + if ( is_string( $option ) ) { + $transformations[] = $option; + continue; + } + if ( is_array( $option ) && ! empty( $option ) ) { + $depth = Utils::array_depth( $option ); + if ( 0 === $depth ) { + $transformations[] = self::build_transformation_set( $option, $type ); + } else { + $transformations[] = self::generate_transformation_string( $option, $type ); + } + } + // Clear out empty parts. + $transformations = array_filter( $transformations ); + } + + return implode( '/', $transformations ); + } + + /** + * Convert a url param based transformation string into an array. + * + * @param string $str The transformation string. + * @param string $type The type of transformation string. + * + * @return array The array of found transformations within the string. + */ + public static function get_transformations_from_string( $str, $type = 'image' ) { + + $params = self::$transformation_index[ $type ]; + + $transformation_chains = explode( '/', $str ); + $transformations = array(); + foreach ( $transformation_chains as $index => $chain ) { + $items = explode( ',', $chain ); + foreach ( $items as $item ) { + $item = trim( $item ); + foreach ( $params as $param => $type ) { + if ( substr( $item, 0, strlen( $param ) + 1 ) === $param . '_' ) { + $transformations[ $index ][ $type ] = substr( $item, strlen( $param ) + 1 ); + } + } + } + } + + return array_values( $transformations ); // Reset the keys. + } + + /** + * Get the cloudinary URL for an attachment. + * + * @param int $attachment_id The attachment ID. + * + * @return void + */ + protected function init_asset( $attachment_id ) { + if ( empty( $this->base_urls ) ) { + $this->init_base_urls(); + } + + $type = $this->media->get_resource_type( $attachment_id ); + if ( ! isset( $this->base_urls[ $type ] ) || ! isset( $this->assets[ $attachment_id ] ) ) { + return; + } + + foreach ( $this->base_urls[ $type ] as $key => $value ) { + $this->assets[ $attachment_id ]->{$key} = $value; + } + $this->assets[ $attachment_id ]->version = 'v' . $this->media->get_post_meta( $attachment_id, Sync::META_KEYS['version'], true ); + $this->assets[ $attachment_id ]->public_id = $this->media->cloudinary_id( $attachment_id ); + $this->assets[ $attachment_id ]->set_transformation( 'asset', $this->media->get_transformation_from_meta( $attachment_id ) ); + } +} From 3aedcef5b51eaca4b131c99e64aeaa63aab8d5f6 Mon Sep 17 00:00:00 2001 From: David Cramer Date: Thu, 1 Jul 2021 13:56:06 +0200 Subject: [PATCH 12/56] cleanup settings and styling --- css/cloudinary.css | 2 +- css/src/components/_ui.scss | 4 +-- php/class-beta.php | 15 +++++++++-- php/class-connect.php | 8 +++--- php/class-media.php | 2 +- php/class-sync.php | 2 +- php/settings/class-setting.php | 46 +++++++++++++++++++------------- php/ui/class-component.php | 32 +++++++++++++--------- php/ui/component/class-group.php | 2 +- 9 files changed, 68 insertions(+), 45 deletions(-) diff --git a/css/cloudinary.css b/css/cloudinary.css index bab83e705..802d11857 100644 --- a/css/cloudinary.css +++ b/css/cloudinary.css @@ -1 +1 @@ -.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{background-color:#333;border-radius:4px;color:#fff;font-size:14px;line-height:1.4;outline:0;position:relative;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{border-top-color:initial;border-width:8px 8px 0;bottom:-7px;left:0;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:initial;border-width:0 8px 8px;left:0;top:-7px;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-left-color:initial;border-width:8px 0 8px 8px;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{border-right-color:initial;border-width:8px 8px 8px 0;left:-7px;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{color:#333;height:16px;width:16px}.tippy-arrow:before{border-color:transparent;border-style:solid;content:"";position:absolute}.tippy-content{padding:5px 9px;position:relative;z-index:1}@font-face{font-family:cloudinary;font-style:normal;font-weight:500;src:url(../css/fonts/cloudinary.7e6e75b25255a2b3b6e7ced1092c210c.eot);src:url(../css/fonts/cloudinary.7e6e75b25255a2b3b6e7ced1092c210c.eot#iefix) format("embedded-opentype"),url(../css/fonts/cloudinary.34cb260ad722325c597cdc3a3e7584d8.woff) format("woff"),url(../css/fonts/cloudinary.c2afda9d25532c03cd41beb20a1ce439.ttf) format("truetype"),url(../css/cloudinary.svg#cloudinary) format("svg")}.dashicons-cloudinary{speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-style:normal;font-variant:normal;font-weight:400;line-height:1;text-transform:none}.dashicons-cloudinary:before{content:"";font-family:cloudinary,monospace!important}.dashicons-cloudinary.success{color:#558b2f}.dashicons-cloudinary.error{color:#dd2c00}.dashicons-cloudinary.error:before{content:""}.dashicons-cloudinary.uploading{color:#fd9d2c}.dashicons-cloudinary.uploading:before{content:""}.dashicons-cloudinary.info{color:#0071ba}.dashicons-cloudinary.downloading:before{content:""}.dashicons-cloudinary.syncing:before{content:""}.column-cld_status{width:5.5em}.column-cld_status .dashicons-cloudinary{display:inline-block}.column-cld_status .dashicons-cloudinary:before{font-size:1.8rem}.form-field .error-notice,.form-table .error-notice{color:#dd2c00;display:none}.form-field input.cld-field:invalid,.form-table input.cld-field:invalid{border-color:#dd2c00}.form-field input.cld-field:invalid+.error-notice,.form-table input.cld-field:invalid+.error-notice{display:inline-block}.cloudinary-welcome{background-image:url(../css/logo.svg);background-position:top 12px right 20px;background-repeat:no-repeat;background-size:153px}.cloudinary-stats{display:inline-block;margin-left:25px}.cloudinary-stat{cursor:help}.cloudinary-percent{color:#0071ba;font-size:.8em;vertical-align:top}.settings-image{max-width:100%;padding-top:5px}.settings-tabs>li{display:inline-block}.settings-tabs>li a{padding:.6em}.settings-tabs>li a.active{background-color:#fff}.settings-tab-section{max-width:1030px;padding:20px 0 0;position:relative}.settings-tab-section.cloudinary-welcome .settings-tab-section-fields-dashboard{align-content:flex-start;align-items:flex-start;display:flex;margin-top:40px}.settings-tab-section.cloudinary-welcome .settings-tab-section-fields-dashboard-description{margin:0 auto 0 0;width:55%}.settings-tab-section.cloudinary-welcome .settings-tab-section-fields-dashboard-content{margin:0 auto;width:35%}.settings-tab-section.cloudinary-welcome .settings-tab-section-fields-dashboard-content .dashicons{color:#9ea3a8}.settings-tab-section.cloudinary-welcome .settings-tab-section-card{margin-top:0}.settings-tab-section-fields .field-heading th{color:#23282d;display:block;font-size:1.1em;margin:1em 0;width:auto}.settings-tab-section-fields .field-heading td{display:none;visibility:hidden}.settings-tab-section-fields .regular-textarea{height:60px;width:100%}.settings-tab-section-fields .dashicons{text-decoration:none;vertical-align:middle}.settings-tab-section-fields a .dashicons{color:#5f5f5f}.settings-tab-section-fields-dashboard-error{color:#5f5f5f;font-size:1.2em}.settings-tab-section-fields-dashboard-error.expanded{margin-bottom:25px;padding-top:40px}.settings-tab-section-fields-dashboard-error .dashicons{color:#ac0000}.settings-tab-section-fields-dashboard-error .button{font-size:1.1em;height:40px;line-height:40px;padding-left:40px;padding-right:40px}.settings-tab-section-fields-dashboard-success{color:#23282d;font-size:1.2em}.settings-tab-section-fields-dashboard-success.expanded{margin-bottom:25px;padding-top:40px}.settings-tab-section-fields-dashboard-success .dashicons{color:#4fb651}.settings-tab-section-fields-dashboard-success .button{font-size:1.1em;height:40px;line-height:40px;padding-left:40px;padding-right:40px}.settings-tab-section-fields-dashboard-success .description{color:#5f5f5f;font-weight:400;margin-top:12px}.settings-tab-section-card{background-color:#fff;border:1px solid #e5e5e5;box-shadow:0 1px 1px 0 rgba(0,0,0,.07);box-sizing:border-box;margin-top:12px;padding:20px 23px}.settings-tab-section-card .dashicons{font-size:1.4em}.settings-tab-section-card h2{font-size:1.8em;font-weight:400;margin-top:0}.settings-tab-section-card.pull-right{float:right;padding:12px;position:relative;width:450px;z-index:10}.settings-tab-section-card.pull-right img.settings-image{border:1px solid #979797;box-shadow:0 2px 4px 0 rgba(0,0,0,.5);margin-top:12px}.settings-tab-section-card.pull-right h3,.settings-tab-section-card.pull-right h4{margin-top:0}.settings-tab-section .field-row-cloudinary_url,.settings-tab-section .field-row-signup{display:block}.settings-tab-section .field-row-cloudinary_url td,.settings-tab-section .field-row-cloudinary_url th,.settings-tab-section .field-row-signup td,.settings-tab-section .field-row-signup th{display:block;padding:10px 0 0;width:auto}.settings-tab-section .field-row-cloudinary_url td .sign-up,.settings-tab-section .field-row-cloudinary_url th .sign-up,.settings-tab-section .field-row-signup td .sign-up,.settings-tab-section .field-row-signup th .sign-up{vertical-align:baseline}.settings-tab-section.connect .form-table{display:inline-block;max-width:580px;width:auto}.settings-valid{color:#558b2f;font-size:30px}.settings-valid-field{border-color:#558b2f!important}.settings-invalid-field{border-color:#dd2c00!important}.settings-alert{box-shadow:0 1px 1px rgba(0,0,0,.04);display:inline-block;padding:5px 7px}.settings-alert-info{background-color:#e9faff;border:1px solid #ccd0d4;border-left:4px solid #00a0d2}.settings-alert-warning{background-color:#fff5e9;border:1px solid #f6e7b6;border-left:4px solid #e3be38}.settings-alert-error{background-color:#ffe9e9;border:1px solid #d4cccc;border-left:4px solid #d20000}.field-radio input[type=radio].cld-field{margin:0 5px 0 0}.field-radio label{margin-right:10px}.settings-tab-section h2{margin:0}.cloudinary-collapsible{background-color:#fff;border:1px solid #ccd0d4;box-shadow:0 1px 1px rgba(0,0,0,.04);box-sizing:border-box;margin:20px 0;padding:10px;width:95%}.cloudinary-collapsible__toggle{cursor:pointer;display:flex;justify-content:space-between}.cloudinary-collapsible__toggle h2{margin:0!important}.cloudinary-collapsible__toggle button{background-color:inherit;border:none;cursor:pointer;margin:0;padding:0;width:auto}.cloudinary-deactivation .more{display:none}.cloudinary-deactivation input[type=radio]:checked~.more{color:#32373c;display:block;line-height:2;margin-left:2em;margin-top:.5em}.cloudinary-deactivation input[type=checkbox]~label{margin-left:.25em}.cloudinary-deactivation .modal-footer{background-color:#fcfcfc;border-top:1px solid #ddd;bottom:0;margin:0 -15px;padding:1em;position:absolute;width:calc(100% - 2em)}.cloudinary-deactivation .modal-footer .button-link{float:right}.cloudinary-deactivation .modal-footer .button-link:hover{background:transparent}.cloudinary-deactivation textarea{resize:none}.cloudinary-deactivation p{display:flex}.sync .spinner{display:inline-block;float:none;margin:0 5px 0 0;visibility:visible}.sync-media,.sync-media-progress{display:none}.sync-media-progress-outer{background-color:#e5e5e5;height:20px;margin:20px 0 10px;position:relative;width:500px}.sync-media-progress-outer .progress-bar{background-color:#558b2f;height:20px;transition:width .25s;width:0}.sync-media-progress-notice{color:#dd2c00}.sync-media-resource{display:inline-block;width:100px}.sync-media-error{color:#dd2c00}.sync-count{font-weight:700}.sync-details{margin-top:10px}.sync .button.start-sync,.sync .button.stop-sync{display:none;padding:0 16px}.sync .button.start-sync .dashicons,.sync .button.stop-sync .dashicons{line-height:2.2}.sync .progress-text{display:inline-block;font-weight:700;padding:12px 4px 12px 12px}.sync .completed{display:none;max-width:300px}.sync-status-disabled{color:#dd2c00}.sync-status-enabled{color:#558b2f}.sync-status-button.button{vertical-align:baseline}.cloudinary-widget{height:100%}.cloudinary-widget-wrapper{background-image:url(data:image/svg+xml;base64,PHN2ZyBjbGFzcz0ic3Bpbm5lciIgdmlld0JveD0iLTQgLTQgMTUxIDEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+PCFbQ0RBVEFbCiAgICAgIEBrZXlmcmFtZXMgY29sb3JzIHsKICAgICAgICAwJSB7IHN0cm9rZTogIzAwNzhGRjsgfQogICAgICAgICAgNTAlIHsgc3Ryb2tlOiAjMGUyZjVhOyB9CiAgICAgICAgICAxMDAlIHsgc3Ryb2tlOiAjMDA3OEZGOyB9CiAgICAgIH0KCiAgICAgIEBrZXlmcmFtZXMgZGFzaCB7CiAgICAgICAwJSB7IHN0cm9rZS1kYXNob2Zmc2V0OiA1NjA7IH0KICAgICAgIDUwJSB7CiAgICAgICAgICBzdHJva2UtZGFzaG9mZnNldDogMDsKICAgICAgIH0KICAgICAgIDEwMCUgeyAgIHN0cm9rZS1kYXNob2Zmc2V0OiA1NjA7IH0KICAgICAgfQogICAgICBALXdlYmtpdC1rZXlmcmFtZXMgY29sb3JzIHsKICAgICAgICAwJSB7IHN0cm9rZTogIzAwNzhmZjsgfQogICAgICAgICAgNTAlIHsgc3Ryb2tlOiAjMGUyZjVhOyB9CiAgICAgICAgICAxMDAlIHsgc3Ryb2tlOiAjMDA3OGZmOyB9CiAgICAgIH0KCiAgICAgIEAtd2Via2l0LWtleWZyYW1lcyBkYXNoIHsKICAgICAgIDAlIHsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDU2MDsgfQogICAgICAgNTAlIHsKICAgICAgICAgIHN0cm9rZS1kYXNob2Zmc2V0OiAwOwogICAgICAgfQogICAgICAgMTAwJSB7ICAgc3Ryb2tlLWRhc2hvZmZzZXQ6IDU2MDsKICAgICAgIH0KICAgICAgfQogICAgICAucGF0aCB7CiAgICAgICAgc3Ryb2tlLWRhc2hhcnJheTogMjgwOwogICAgICAgIHN0cm9rZS1kYXNob2Zmc2V0OiAwOwogICAgICAgIHRyYW5zZm9ybS1vcmlnaW46IGNlbnRlcjsKICAgICAgICAtd2Via2l0LWFuaW1hdGlvbjoKICAgICAgICAgIGRhc2ggMnMgZWFzZS1pbi1vdXQgaW5maW5pdGUsIGNvbG9ycyA4cyBlYXNlLWluLW91dCBpbmZpbml0ZTsKICAgICAgICBhbmltYXRpb246CiAgICAgICAgICBkYXNoIDJzIGVhc2UtaW4tb3V0IGluZmluaXRlLCBjb2xvcnMgOHMgZWFzZS1pbi1vdXQgaW5maW5pdGU7CiAgICAgIH0KICAgIF1dPjwvc3R5bGU+CiAgPHBhdGggY2xhc3M9InBhdGgiIGQ9Ik0xMjEuNjYzIDkwLjYzOGMtMS43OTYgMC05OS4zMy0uNDk4LTEwMS40NzQtMS40NzhDOC42ODUgODMuODc3IDEuMjUgNzIuMTk2IDEuMjUgNTkuMzk2YzAtMTYuNjU2IDEyLjc5Ny0zMC42MSAyOS4wNTItMzIuMzIzIDcuNDktMTUuNzA2IDIzLjE4Ni0yNS43MDcgNDAuNzE0LTI1LjcwNyAyMC45OCAwIDM5LjIxNSAxNC43NTIgNDMuOTQ1IDM0LjkwNyAxNS4wOS4yNDUgMjcuMjkgMTIuNjMgMjcuMjkgMjcuODIyIDAgMTEuOTY4LTcuNzM4IDIyLjU1LTE5LjI1NiAyNi4zMyIgc3Ryb2tlLXdpZHRoPSI5IiBzdHJva2UtbGluZWNhcD0icm91bmQiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPgo8L3N2Zz4K);background-position:50%;background-repeat:no-repeat;background-size:150px;height:100%;overflow:hidden}.attachment-actions .button.edit-attachment,.attachment-info .edit-attachment{display:none}.global-transformations-preview{max-width:600px;position:relative}.global-transformations-spinner{display:none}.global-transformations-button.button-primary{display:none;position:absolute;z-index:100}.global-transformations-url{margin-bottom:5px;margin-top:5px}.global-transformations-url-transformation{color:#51a3ff;max-width:100px;overflow:hidden;text-overflow:ellipsis}.global-transformations-url-file{color:#f2d864}.global-transformations-url-link{background-color:#262c35;border-radius:6px;color:#fff;display:block;overflow:hidden;padding:16px;text-decoration:none;text-overflow:ellipsis}.global-transformations-url-link:hover{color:#888;text-decoration:underline}.cld-tax-order-list-item{background-color:#fff;border:1px solid #efefef;margin:0 0 -1px;padding:4px}.cld-tax-order-list-item.no-items{color:#888;display:none;text-align:center}.cld-tax-order-list-item.no-items:last-child{display:block}.cld-tax-order-list-item.ui-sortable-helper{box-shadow:0 2px 5px rgba(0,0,0,.2)}.cld-tax-order-list-item-placeholder{background-color:#efefef;height:45px;margin:0}.cld-tax-order-list-item-handle{color:#999;cursor:grab;margin-right:4px}.cld-tax-order-list-type{display:inline-block;margin-right:8px}.cld-tax-order-list-type input{margin-right:4px!important}.cloudinary-media-library{margin-left:-20px;position:relative}@media screen and (max-width:782px){.cloudinary-media-library{margin-left:-10px}}.cld-pagenav{color:#555;line-height:2.4em;margin-top:5px;text-align:right}.cld-pagenav-text{margin:0 2em}.cld-delete{color:#dd2c00;cursor:pointer;float:right}.cld-apply-action{float:right}.cld-table thead tr th.cld-table-th{line-height:1.8em}.cld-loading{background-image:url(data:image/svg+xml;base64,PHN2ZyBjbGFzcz0ic3Bpbm5lciIgdmlld0JveD0iLTQgLTQgMTUxIDEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+PCFbQ0RBVEFbCiAgICAgIEBrZXlmcmFtZXMgY29sb3JzIHsKICAgICAgICAwJSB7IHN0cm9rZTogIzAwNzhGRjsgfQogICAgICAgICAgNTAlIHsgc3Ryb2tlOiAjMGUyZjVhOyB9CiAgICAgICAgICAxMDAlIHsgc3Ryb2tlOiAjMDA3OEZGOyB9CiAgICAgIH0KCiAgICAgIEBrZXlmcmFtZXMgZGFzaCB7CiAgICAgICAwJSB7IHN0cm9rZS1kYXNob2Zmc2V0OiA1NjA7IH0KICAgICAgIDUwJSB7CiAgICAgICAgICBzdHJva2UtZGFzaG9mZnNldDogMDsKICAgICAgIH0KICAgICAgIDEwMCUgeyAgIHN0cm9rZS1kYXNob2Zmc2V0OiA1NjA7IH0KICAgICAgfQogICAgICBALXdlYmtpdC1rZXlmcmFtZXMgY29sb3JzIHsKICAgICAgICAwJSB7IHN0cm9rZTogIzAwNzhmZjsgfQogICAgICAgICAgNTAlIHsgc3Ryb2tlOiAjMGUyZjVhOyB9CiAgICAgICAgICAxMDAlIHsgc3Ryb2tlOiAjMDA3OGZmOyB9CiAgICAgIH0KCiAgICAgIEAtd2Via2l0LWtleWZyYW1lcyBkYXNoIHsKICAgICAgIDAlIHsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDU2MDsgfQogICAgICAgNTAlIHsKICAgICAgICAgIHN0cm9rZS1kYXNob2Zmc2V0OiAwOwogICAgICAgfQogICAgICAgMTAwJSB7ICAgc3Ryb2tlLWRhc2hvZmZzZXQ6IDU2MDsKICAgICAgIH0KICAgICAgfQogICAgICAucGF0aCB7CiAgICAgICAgc3Ryb2tlLWRhc2hhcnJheTogMjgwOwogICAgICAgIHN0cm9rZS1kYXNob2Zmc2V0OiAwOwogICAgICAgIHRyYW5zZm9ybS1vcmlnaW46IGNlbnRlcjsKICAgICAgICAtd2Via2l0LWFuaW1hdGlvbjoKICAgICAgICAgIGRhc2ggMnMgZWFzZS1pbi1vdXQgaW5maW5pdGUsIGNvbG9ycyA4cyBlYXNlLWluLW91dCBpbmZpbml0ZTsKICAgICAgICBhbmltYXRpb246CiAgICAgICAgICBkYXNoIDJzIGVhc2UtaW4tb3V0IGluZmluaXRlLCBjb2xvcnMgOHMgZWFzZS1pbi1vdXQgaW5maW5pdGU7CiAgICAgIH0KICAgIF1dPjwvc3R5bGU+CiAgPHBhdGggY2xhc3M9InBhdGgiIGQ9Ik0xMjEuNjYzIDkwLjYzOGMtMS43OTYgMC05OS4zMy0uNDk4LTEwMS40NzQtMS40NzhDOC42ODUgODMuODc3IDEuMjUgNzIuMTk2IDEuMjUgNTkuMzk2YzAtMTYuNjU2IDEyLjc5Ny0zMC42MSAyOS4wNTItMzIuMzIzIDcuNDktMTUuNzA2IDIzLjE4Ni0yNS43MDcgNDAuNzE0LTI1LjcwNyAyMC45OCAwIDM5LjIxNSAxNC43NTIgNDMuOTQ1IDM0LjkwNyAxNS4wOS4yNDUgMjcuMjkgMTIuNjMgMjcuMjkgMjcuODIyIDAgMTEuOTY4LTcuNzM4IDIyLjU1LTE5LjI1NiAyNi4zMyIgc3Ryb2tlLXdpZHRoPSI5IiBzdHJva2UtbGluZWNhcD0icm91bmQiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPgo8L3N2Zz4K);background-position:50%;background-repeat:no-repeat;background-size:50px 50px;height:100px;width:auto}.cld-loading.tree-branch{background-position:25px;background-size:50px 50px}.cld-syncing{background:url(../css/loading.svg) no-repeat 50%;display:inline-block;height:20px;margin-left:12px;padding:4px;width:30px}.cld-footer{bottom:0;color:#555d66;left:0;padding:0;position:absolute;right:0}@media only screen and (min-width:783px){.cld-footer{margin-left:36px}}@media only screen and (min-width:960px){.cld-footer{margin-left:160px}}.cld-footer .cld-notice-box.is-success{background-color:#fff;border:0;color:#555;margin:0;padding:0}.cld-footer .cld-notice-box.is-success .cld-stars{margin-left:12px;text-decoration:none}.cld-footer .cld-notice-box.is-success .cld-stars .dashicons{color:#fd9d2c;position:inherit}.cld-footer .notice-dismiss:before{content:"";font-size:1.4rem;padding:6px 0 0}.cld-tooltip{font-size:1rem;margin-left:2px;margin-top:1px}.cld-notice-box{box-shadow:0 0 2px rgba(0,0,0,.1);margin-bottom:12px;margin-right:20px;position:relative}.cld-notice-box .cld-notice{padding:1rem 2.2rem .75rem 1.2rem}.cld-notice-box .cld-notice img.cld-ui-icon{height:100%}.cld-notice-box.is-dismissible{padding-right:38px}.cld-notice-box.has-icon{padding-left:38px}.cld-notice-box.is-created,.cld-notice-box.is-success,.cld-notice-box.is-updated{background-color:#ebf5ec;border-left:4px solid #42ad4f}.cld-notice-box.is-created .dashicons,.cld-notice-box.is-success .dashicons,.cld-notice-box.is-updated .dashicons{color:#2a0}.cld-notice-box.is-error{background-color:#f8e8e7;border-left:4px solid #cb3435}.cld-notice-box.is-error .dashicons{color:#dd2c00}.cld-notice-box.is-warning{background-color:#fff7e5;border-left:4px solid #f2ad4c}.cld-notice-box.is-warning .dashicons{color:#fd9d2c}.cld-notice-box.is-info{background-color:#e4f4f8;border-left:4px solid #2a95c3}.cld-notice-box.is-info .dashicons{color:#3273ab}.cld-notice-box.is-neutral{background-color:#fff;border-left:4px solid #ccd0d4}.cld-notice-box.is-neutral .dashicons{color:#90a0b3}.cld-notice-box.dismissed{overflow:hidden;transition:height .3s ease-out}.cld-notice-box .cld-ui-icon,.cld-notice-box .dashicons{left:19px;position:absolute;top:14px}.cld-ui-collapse{align-self:center;cursor:pointer;padding:0 .45rem;position:absolute;right:0}.cld-ui-title.collapsible{cursor:pointer}.cld-ui-conditional .closed,.cld-ui-wrap .closed{display:none}.cld-ui-wrap .cld-row{clear:both;margin:0 -1.75em}.cld-ui-wrap .cld-column{box-sizing:border-box;float:left;padding:0 1.75em;width:100%}@media only screen and (min-width:783px){.cld-ui-wrap .cld-column.column-45{width:45%}.cld-ui-wrap .cld-column.column-55{width:55%}}.cld-ui-wrap .cld-row:after{clear:both;content:"";display:table}.cld-image-preview,.cld-video-preview{background-color:hsla(0,0%,84.7%,.5);border-radius:5px;padding:7px}.cld-image-preview-wrapper,.cld-video-preview-wrapper{position:relative}.cld-image-preview .cld-ui-title,.cld-video-preview .cld-ui-title{font-weight:400;margin:0 0 .4rem}.cld-image-preview img,.cld-video-preview img{width:100%}.cld-page-header{align-items:center;margin-bottom:1em;padding:1.2rem}.cld-page-header,.cld-page-tabs{background-color:#fff;display:flex;margin-left:-20px}.cld-page-tabs{border-bottom:1px solid #e5e5e5;border-top:1px solid #e5e5e5;flex-wrap:wrap;margin-top:-1em;padding:0 1rem}.cld-page-tabs-tab{list-style:none;margin-bottom:0;text-indent:0}.cld-page-tabs-tab a{color:#000001;display:block;font-weight:500;padding:1rem 2rem;text-align:center;text-decoration:none;white-space:nowrap}.cld-page-tabs-tab.is-active a{border-bottom:2px solid #3273ab;color:#3273ab}.cld-group hr{border-top:1px solid #e5e5e5;clear:both;margin:1.5rem 0}.cld-group-heading{display:flex}.cld-group-heading h3{font-size:.9rem}.cld-group-heading h3 .description{font-size:.7rem;font-weight:400;margin-left:.7em}.cld-input{display:block;margin-bottom:1.4rem}.cld-input-label{display:block;font-weight:700}.cld-input .regular-number,.cld-input .regular-text{border:1px solid #d0d0d0;border-radius:3px;padding:.1rem .5rem;width:100%}.cld-input .regular-number-small,.cld-input .regular-text-small{width:40%}.cld-input .prefixed{margin-left:6px;width:40%}.cld-input .suffixed{margin-right:6px;width:40%}.cld-input .regular-number{width:100px}.cld-input .regular-select{appearance:none;border:1px solid #d0d0d0;border-radius:3px;display:block;margin-top:.6rem;padding:.1rem .5rem;width:100%}.cld-input-on-off{align-items:center;display:inline-flex}.cld-input-on-off .description{margin:0}.cld-input-on-off .description.left{margin-left:0;margin-right:.4rem}.cld-input-on-off-control{display:inline-block;height:20px;margin-right:.4rem;position:relative;width:40px}.cld-input-on-off-control.disabled{opacity:.4}.cld-input-on-off-control input{height:0;opacity:0;width:0}.cld-input-on-off-control-slider{background-color:#90a0b3;border-radius:34px;bottom:0;cursor:pointer;left:0;position:absolute;right:0;top:0;transition:background-color .3s}input:checked+.cld-input-on-off-control-slider{background-color:#2a0!important}input:checked.partial+.cld-input-on-off-control-slider{background-color:#fd9d2c!important}input:checked.delete+.cld-input-on-off-control-slider{background-color:#dd2c00!important}.cld-input-on-off-control-slider:before{background-color:#fff;border-radius:50%;bottom:2px;content:"";display:block;height:16px;left:2px;position:absolute;transition:transform .2s;width:16px}input:checked+.cld-input-on-off-control-slider:before{transform:translateX(20px)}.mini input:checked+.cld-input-on-off-control-slider:before{transform:translateX(10px)}.cld-input-on-off-control.mini{height:10px;width:20px}.mini .cld-input-on-off-control-slider:before{bottom:1px;height:8px;left:1px;width:8px}.cld-input-icon-toggle{align-items:center;display:inline-flex}.cld-input-icon-toggle .description{margin:0 0 0 .4rem}.cld-input-icon-toggle .description.left{margin-left:0;margin-right:.4rem}.cld-input-icon-toggle-control{display:inline-block;position:relative}.cld-input-icon-toggle-control input{height:0;opacity:0;position:absolute;width:0}.cld-input-icon-toggle-control-slider .icon-on{display:none;visibility:hidden}.cld-input-icon-toggle-control-slider .icon-off,input:checked+.cld-input-icon-toggle-control-slider .icon-on{display:inline-block;visibility:visible}input:checked+.cld-input-icon-toggle-control-slider .icon-off{display:none;visibility:hidden}.cld-input-checkbox-label,.cld-input-radio-label{display:block;margin-bottom:.4rem}.cld-input-checkbox-label.list-inline,.cld-input-radio-label.list-inline{display:inline-block;margin-right:.4rem}.cld-info-box,.cld-panel,.cld-panel-short,.cld-submit,.cld-switch-cloud{background-color:#fff;border:1px solid #e5e5e5;margin-right:1rem;max-width:870px}.cld-info-box.full-width,.cld-panel-short.full-width,.cld-panel.full-width,.cld-submit.full-width,.cld-switch-cloud.full-width{max-width:100%}.cld-submit,.cld-switch-cloud{border-top:0;padding:1.2rem 1.75rem}.cld-info-box,.cld-panel,.cld-panel-short{margin-top:1rem;padding:2rem 1.75rem}.cld-info-box-inner,.cld-panel-inner,.cld-panel-short-inner{background-color:hsla(0,0%,86.3%,.2);border:1px solid #e5e5e5;margin:1em 0;padding:1.3rem}.cld-info-box-inner h2,.cld-panel-inner h2,.cld-panel-short-inner h2{color:#3273ab}.cld-info-box .cld-input-label,.cld-panel-short .cld-input-label,.cld-panel .cld-input-label{margin-bottom:.6rem}.cld-info-box.has-heading,.cld-panel-short.has-heading,.cld-panel.has-heading{border-top:0;margin-top:0}.cld-info-box-heading,.cld-panel-heading,.cld-panel-short-heading{display:flex;padding:.4rem 1.75rem .2rem;position:relative}.cld-info-box-heading.full-width,.cld-panel-heading.full-width,.cld-panel-short-heading.full-width{max-width:100%}.cld-info-box-heading img,.cld-panel-heading img,.cld-panel-short-heading img{margin-right:.6rem}.cld-info-box-heading.collapsible,.cld-panel-heading.collapsible,.cld-panel-short-heading.collapsible{cursor:pointer}.cld-info-box ul,.cld-panel-short ul,.cld-panel ul{list-style:initial;padding:0 3em}.cld-info-box .cld-plan,.cld-panel-short .cld-plan,.cld-panel .cld-plan{color:#3273ab;font-size:1.5em;font-weight:700}.cld-info-box .stat-boxes,.cld-panel-short .stat-boxes,.cld-panel .stat-boxes{border:1px solid #e5e5e5;font-size:1.2em}.cld-info-box .stat-boxes .box,.cld-panel-short .stat-boxes .box,.cld-panel .stat-boxes .box{border-bottom:1px solid #e5e5e5;padding:2rem;text-align:center}.cld-info-box .stat-boxes .box:last-of-type,.cld-panel-short .stat-boxes .box:last-of-type,.cld-panel .stat-boxes .box:last-of-type{border-bottom:none}.cld-info-box .stat-boxes .box .cld-ui-icon,.cld-panel-short .stat-boxes .box .cld-ui-icon,.cld-panel .stat-boxes .box .cld-ui-icon{height:35px;width:35px}.cld-info-box .stat-boxes .icon,.cld-panel-short .stat-boxes .icon,.cld-panel .stat-boxes .icon{height:50px;margin-right:.5em;width:50px}.cld-info-box .stat-boxes h3,.cld-panel-short .stat-boxes h3,.cld-panel .stat-boxes h3{margin-bottom:1.5rem;margin-top:2.4rem}.cld-info-box .stat-boxes .limit,.cld-panel-short .stat-boxes .limit,.cld-panel .stat-boxes .limit{font-size:2em;font-weight:700;margin-right:.5em;white-space:nowrap}.cld-info-box .stat-boxes .usage,.cld-panel-short .stat-boxes .usage,.cld-panel .stat-boxes .usage{color:#3273ab;font-size:1.5em;font-weight:400}@media only screen and (min-width:783px){.cld-info-box .stat-boxes,.cld-panel-short .stat-boxes,.cld-panel .stat-boxes{display:flex;flex-wrap:nowrap;font-size:1em}.cld-info-box .stat-boxes .box,.cld-panel-short .stat-boxes .box,.cld-panel .stat-boxes .box{border-bottom:none;border-right:1px solid #e5e5e5;flex-grow:1}.cld-info-box .stat-boxes .box:last-of-type,.cld-panel-short .stat-boxes .box:last-of-type,.cld-panel .stat-boxes .box:last-of-type{border-right:none}}@media only screen and (min-width:1200px){.cld-info-box .stat-boxes,.cld-panel-short .stat-boxes,.cld-panel .stat-boxes{font-size:1.2em}}.cld-info-box .img-connection-string,.cld-panel-short .img-connection-string,.cld-panel .img-connection-string{max-width:607px;width:100%}.cld-info-box .connection-string,.cld-panel-short .connection-string,.cld-panel .connection-string{max-width:40em;width:100%}.cld-info-box .media-status-box,.cld-info-box .stat-boxes,.cld-panel-short .media-status-box,.cld-panel-short .stat-boxes,.cld-panel .media-status-box,.cld-panel .stat-boxes{border:1px solid #e5e5e5}.cld-info-box .media-status-box,.cld-panel-short .media-status-box,.cld-panel .media-status-box{padding:2rem;text-align:center}.cld-info-box .media-status-box .status,.cld-panel-short .media-status-box .status,.cld-panel .media-status-box .status{font-size:2rem;font-weight:700;margin-right:.5em}.cld-info-box .media-status-box .cld-ui-icon,.cld-panel-short .media-status-box .cld-ui-icon,.cld-panel .media-status-box .cld-ui-icon{height:35px;width:35px}.cld-info-box .notification,.cld-panel-short .notification,.cld-panel .notification{display:inline-flex;font-weight:700;padding:1.5rem}.cld-info-box .notification-success,.cld-panel-short .notification-success,.cld-panel .notification-success{background-color:rgba(32,184,50,.2);border:2px solid #20b832}.cld-info-box .notification-success:before,.cld-panel-short .notification-success:before,.cld-panel .notification-success:before{color:#20b832}.cld-info-box .notification-syncing,.cld-panel-short .notification-syncing,.cld-panel .notification-syncing{background-color:rgba(50,115,171,.2);border:2px solid #3273ab;color:#444;text-decoration:none}.cld-info-box .notification-syncing:before,.cld-panel-short .notification-syncing:before,.cld-panel .notification-syncing:before{-webkit-animation:spin 1s infinite running;-moz-animation:spin 1s linear infinite;animation:spin 1s linear infinite;color:#3273ab}@keyframes spin{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.cld-info-box .notification:before,.cld-panel-short .notification:before,.cld-panel .notification:before{margin-right:.5em}.cld-info-box{display:flex;flex-direction:column}@media only screen and (min-width:783px){.cld-info-box{flex-direction:row}}.cld-info-box a.button,.cld-info-box img{align-self:center}.cld-info-box .cld-ui-body{margin:0 1.2rem}.cld-panel-short{display:inline-block;min-width:270px;width:auto}.cld-gallery-settings{box-sizing:border-box;display:flex;flex-wrap:wrap;padding:1rem 0;width:100%}@media only screen and (min-width:960px){.cld-gallery-settings{margin-left:-1rem;margin-right:-1rem}}.cld-gallery-settings__column{box-sizing:border-box;width:100%}@media only screen and (min-width:960px){.cld-gallery-settings__column{padding-left:1rem;padding-right:1rem;width:50%}}.components-base-control__field select{display:block;margin:1rem 0}.components-range-control__wrapper{margin:0!important}.components-range-control__root{flex-direction:row-reverse;margin:1rem 0}.components-input-control.components-number-control.components-range-control__number{margin-left:0!important;margin-right:16px}.components-panel{border:0!important}.components-panel__body:first-child{border-top:0!important}.components-panel__body:last-child{border-bottom:0!important}.components-textarea-control__input{display:block;margin:.5rem 0;width:100%}.tippy-box[data-theme~=cloudinary]{background-color:rgba(0,0,0,.8);color:#fff;font-size:.8em}table .cld-input{margin-bottom:0}tr .file-size.small{color:#a8a8a8;font-size:.8em;font-style:italic;letter-spacing:.4px;margin-left:6px;margin-right:6px}td.tree{color:#212529;line-height:1.5;padding-top:0;position:relative}td.tree ul.striped>:nth-child(odd){background-color:#f6f7f7}td.tree ul.striped>:nth-child(2n){background-color:#fff}td.tree .success{color:#20b832}td+td.tree{padding-top:0}td.tree .cld-input{margin-bottom:0;vertical-align:text-bottom}td.tree .cld-search{font-size:.9em;height:26px;margin-right:12px;min-height:20px;padding:4px 6px;vertical-align:initial}td.tree .file-size{color:#a8a8a8;font-size:.8em;font-style:italic;letter-spacing:.4px;margin-left:6px}td.tree .fa-folder,td.tree .fa-folder-open{color:#007bff}td.tree .fa-html5{color:#f21f10}td.tree ul{list-style:none;margin:0;padding-left:5px}td.tree ul li{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin-bottom:0;padding-bottom:5px;padding-left:25px;padding-top:5px;position:relative}td.tree ul li:before{height:1px;margin:auto;top:14px;width:20px}td.tree ul li:after,td.tree ul li:before{background-color:#666;content:"";left:0;position:absolute}td.tree ul li:after{bottom:0;height:100%;top:0;width:1px}td.tree ul li:after:nth-of-type(odd){background-color:#666}td.tree ul li:last-child:after{height:14px}td.tree ul a{cursor:pointer}td.tree ul a:hover{text-decoration:none} \ No newline at end of file +.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{background-color:#333;border-radius:4px;color:#fff;font-size:14px;line-height:1.4;outline:0;position:relative;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{border-top-color:initial;border-width:8px 8px 0;bottom:-7px;left:0;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:initial;border-width:0 8px 8px;left:0;top:-7px;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-left-color:initial;border-width:8px 0 8px 8px;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{border-right-color:initial;border-width:8px 8px 8px 0;left:-7px;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{color:#333;height:16px;width:16px}.tippy-arrow:before{border-color:transparent;border-style:solid;content:"";position:absolute}.tippy-content{padding:5px 9px;position:relative;z-index:1}@font-face{font-family:cloudinary;font-style:normal;font-weight:500;src:url(../css/fonts/cloudinary.7e6e75b25255a2b3b6e7ced1092c210c.eot);src:url(../css/fonts/cloudinary.7e6e75b25255a2b3b6e7ced1092c210c.eot#iefix) format("embedded-opentype"),url(../css/fonts/cloudinary.34cb260ad722325c597cdc3a3e7584d8.woff) format("woff"),url(../css/fonts/cloudinary.c2afda9d25532c03cd41beb20a1ce439.ttf) format("truetype"),url(../css/cloudinary.svg#cloudinary) format("svg")}.dashicons-cloudinary{speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-style:normal;font-variant:normal;font-weight:400;line-height:1;text-transform:none}.dashicons-cloudinary:before{content:"";font-family:cloudinary,monospace!important}.dashicons-cloudinary.success{color:#558b2f}.dashicons-cloudinary.error{color:#dd2c00}.dashicons-cloudinary.error:before{content:""}.dashicons-cloudinary.uploading{color:#fd9d2c}.dashicons-cloudinary.uploading:before{content:""}.dashicons-cloudinary.info{color:#0071ba}.dashicons-cloudinary.downloading:before{content:""}.dashicons-cloudinary.syncing:before{content:""}.column-cld_status{width:5.5em}.column-cld_status .dashicons-cloudinary{display:inline-block}.column-cld_status .dashicons-cloudinary:before{font-size:1.8rem}.form-field .error-notice,.form-table .error-notice{color:#dd2c00;display:none}.form-field input.cld-field:invalid,.form-table input.cld-field:invalid{border-color:#dd2c00}.form-field input.cld-field:invalid+.error-notice,.form-table input.cld-field:invalid+.error-notice{display:inline-block}.cloudinary-welcome{background-image:url(../css/logo.svg);background-position:top 12px right 20px;background-repeat:no-repeat;background-size:153px}.cloudinary-stats{display:inline-block;margin-left:25px}.cloudinary-stat{cursor:help}.cloudinary-percent{color:#0071ba;font-size:.8em;vertical-align:top}.settings-image{max-width:100%;padding-top:5px}.settings-tabs>li{display:inline-block}.settings-tabs>li a{padding:.6em}.settings-tabs>li a.active{background-color:#fff}.settings-tab-section{max-width:1030px;padding:20px 0 0;position:relative}.settings-tab-section.cloudinary-welcome .settings-tab-section-fields-dashboard{align-content:flex-start;align-items:flex-start;display:flex;margin-top:40px}.settings-tab-section.cloudinary-welcome .settings-tab-section-fields-dashboard-description{margin:0 auto 0 0;width:55%}.settings-tab-section.cloudinary-welcome .settings-tab-section-fields-dashboard-content{margin:0 auto;width:35%}.settings-tab-section.cloudinary-welcome .settings-tab-section-fields-dashboard-content .dashicons{color:#9ea3a8}.settings-tab-section.cloudinary-welcome .settings-tab-section-card{margin-top:0}.settings-tab-section-fields .field-heading th{color:#23282d;display:block;font-size:1.1em;margin:1em 0;width:auto}.settings-tab-section-fields .field-heading td{display:none;visibility:hidden}.settings-tab-section-fields .regular-textarea{height:60px;width:100%}.settings-tab-section-fields .dashicons{text-decoration:none;vertical-align:middle}.settings-tab-section-fields a .dashicons{color:#5f5f5f}.settings-tab-section-fields-dashboard-error{color:#5f5f5f;font-size:1.2em}.settings-tab-section-fields-dashboard-error.expanded{margin-bottom:25px;padding-top:40px}.settings-tab-section-fields-dashboard-error .dashicons{color:#ac0000}.settings-tab-section-fields-dashboard-error .button{font-size:1.1em;height:40px;line-height:40px;padding-left:40px;padding-right:40px}.settings-tab-section-fields-dashboard-success{color:#23282d;font-size:1.2em}.settings-tab-section-fields-dashboard-success.expanded{margin-bottom:25px;padding-top:40px}.settings-tab-section-fields-dashboard-success .dashicons{color:#4fb651}.settings-tab-section-fields-dashboard-success .button{font-size:1.1em;height:40px;line-height:40px;padding-left:40px;padding-right:40px}.settings-tab-section-fields-dashboard-success .description{color:#5f5f5f;font-weight:400;margin-top:12px}.settings-tab-section-card{background-color:#fff;border:1px solid #e5e5e5;box-shadow:0 1px 1px 0 rgba(0,0,0,.07);box-sizing:border-box;margin-top:12px;padding:20px 23px}.settings-tab-section-card .dashicons{font-size:1.4em}.settings-tab-section-card h2{font-size:1.8em;font-weight:400;margin-top:0}.settings-tab-section-card.pull-right{float:right;padding:12px;position:relative;width:450px;z-index:10}.settings-tab-section-card.pull-right img.settings-image{border:1px solid #979797;box-shadow:0 2px 4px 0 rgba(0,0,0,.5);margin-top:12px}.settings-tab-section-card.pull-right h3,.settings-tab-section-card.pull-right h4{margin-top:0}.settings-tab-section .field-row-cloudinary_url,.settings-tab-section .field-row-signup{display:block}.settings-tab-section .field-row-cloudinary_url td,.settings-tab-section .field-row-cloudinary_url th,.settings-tab-section .field-row-signup td,.settings-tab-section .field-row-signup th{display:block;padding:10px 0 0;width:auto}.settings-tab-section .field-row-cloudinary_url td .sign-up,.settings-tab-section .field-row-cloudinary_url th .sign-up,.settings-tab-section .field-row-signup td .sign-up,.settings-tab-section .field-row-signup th .sign-up{vertical-align:baseline}.settings-tab-section.connect .form-table{display:inline-block;max-width:580px;width:auto}.settings-valid{color:#558b2f;font-size:30px}.settings-valid-field{border-color:#558b2f!important}.settings-invalid-field{border-color:#dd2c00!important}.settings-alert{box-shadow:0 1px 1px rgba(0,0,0,.04);display:inline-block;padding:5px 7px}.settings-alert-info{background-color:#e9faff;border:1px solid #ccd0d4;border-left:4px solid #00a0d2}.settings-alert-warning{background-color:#fff5e9;border:1px solid #f6e7b6;border-left:4px solid #e3be38}.settings-alert-error{background-color:#ffe9e9;border:1px solid #d4cccc;border-left:4px solid #d20000}.field-radio input[type=radio].cld-field{margin:0 5px 0 0}.field-radio label{margin-right:10px}.settings-tab-section h2{margin:0}.cloudinary-collapsible{background-color:#fff;border:1px solid #ccd0d4;box-shadow:0 1px 1px rgba(0,0,0,.04);box-sizing:border-box;margin:20px 0;padding:10px;width:95%}.cloudinary-collapsible__toggle{cursor:pointer;display:flex;justify-content:space-between}.cloudinary-collapsible__toggle h2{margin:0!important}.cloudinary-collapsible__toggle button{background-color:inherit;border:none;cursor:pointer;margin:0;padding:0;width:auto}.cloudinary-deactivation .more{display:none}.cloudinary-deactivation input[type=radio]:checked~.more{color:#32373c;display:block;line-height:2;margin-left:2em;margin-top:.5em}.cloudinary-deactivation input[type=checkbox]~label{margin-left:.25em}.cloudinary-deactivation .modal-footer{background-color:#fcfcfc;border-top:1px solid #ddd;bottom:0;margin:0 -15px;padding:1em;position:absolute;width:calc(100% - 2em)}.cloudinary-deactivation .modal-footer .button-link{float:right}.cloudinary-deactivation .modal-footer .button-link:hover{background:transparent}.cloudinary-deactivation textarea{resize:none}.cloudinary-deactivation p{display:flex}.sync .spinner{display:inline-block;float:none;margin:0 5px 0 0;visibility:visible}.sync-media,.sync-media-progress{display:none}.sync-media-progress-outer{background-color:#e5e5e5;height:20px;margin:20px 0 10px;position:relative;width:500px}.sync-media-progress-outer .progress-bar{background-color:#558b2f;height:20px;transition:width .25s;width:0}.sync-media-progress-notice{color:#dd2c00}.sync-media-resource{display:inline-block;width:100px}.sync-media-error{color:#dd2c00}.sync-count{font-weight:700}.sync-details{margin-top:10px}.sync .button.start-sync,.sync .button.stop-sync{display:none;padding:0 16px}.sync .button.start-sync .dashicons,.sync .button.stop-sync .dashicons{line-height:2.2}.sync .progress-text{display:inline-block;font-weight:700;padding:12px 4px 12px 12px}.sync .completed{display:none;max-width:300px}.sync-status-disabled{color:#dd2c00}.sync-status-enabled{color:#558b2f}.sync-status-button.button{vertical-align:baseline}.cloudinary-widget{height:100%}.cloudinary-widget-wrapper{background-image:url(data:image/svg+xml;base64,PHN2ZyBjbGFzcz0ic3Bpbm5lciIgdmlld0JveD0iLTQgLTQgMTUxIDEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+PCFbQ0RBVEFbCiAgICAgIEBrZXlmcmFtZXMgY29sb3JzIHsKICAgICAgICAwJSB7IHN0cm9rZTogIzAwNzhGRjsgfQogICAgICAgICAgNTAlIHsgc3Ryb2tlOiAjMGUyZjVhOyB9CiAgICAgICAgICAxMDAlIHsgc3Ryb2tlOiAjMDA3OEZGOyB9CiAgICAgIH0KCiAgICAgIEBrZXlmcmFtZXMgZGFzaCB7CiAgICAgICAwJSB7IHN0cm9rZS1kYXNob2Zmc2V0OiA1NjA7IH0KICAgICAgIDUwJSB7CiAgICAgICAgICBzdHJva2UtZGFzaG9mZnNldDogMDsKICAgICAgIH0KICAgICAgIDEwMCUgeyAgIHN0cm9rZS1kYXNob2Zmc2V0OiA1NjA7IH0KICAgICAgfQogICAgICBALXdlYmtpdC1rZXlmcmFtZXMgY29sb3JzIHsKICAgICAgICAwJSB7IHN0cm9rZTogIzAwNzhmZjsgfQogICAgICAgICAgNTAlIHsgc3Ryb2tlOiAjMGUyZjVhOyB9CiAgICAgICAgICAxMDAlIHsgc3Ryb2tlOiAjMDA3OGZmOyB9CiAgICAgIH0KCiAgICAgIEAtd2Via2l0LWtleWZyYW1lcyBkYXNoIHsKICAgICAgIDAlIHsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDU2MDsgfQogICAgICAgNTAlIHsKICAgICAgICAgIHN0cm9rZS1kYXNob2Zmc2V0OiAwOwogICAgICAgfQogICAgICAgMTAwJSB7ICAgc3Ryb2tlLWRhc2hvZmZzZXQ6IDU2MDsKICAgICAgIH0KICAgICAgfQogICAgICAucGF0aCB7CiAgICAgICAgc3Ryb2tlLWRhc2hhcnJheTogMjgwOwogICAgICAgIHN0cm9rZS1kYXNob2Zmc2V0OiAwOwogICAgICAgIHRyYW5zZm9ybS1vcmlnaW46IGNlbnRlcjsKICAgICAgICAtd2Via2l0LWFuaW1hdGlvbjoKICAgICAgICAgIGRhc2ggMnMgZWFzZS1pbi1vdXQgaW5maW5pdGUsIGNvbG9ycyA4cyBlYXNlLWluLW91dCBpbmZpbml0ZTsKICAgICAgICBhbmltYXRpb246CiAgICAgICAgICBkYXNoIDJzIGVhc2UtaW4tb3V0IGluZmluaXRlLCBjb2xvcnMgOHMgZWFzZS1pbi1vdXQgaW5maW5pdGU7CiAgICAgIH0KICAgIF1dPjwvc3R5bGU+CiAgPHBhdGggY2xhc3M9InBhdGgiIGQ9Ik0xMjEuNjYzIDkwLjYzOGMtMS43OTYgMC05OS4zMy0uNDk4LTEwMS40NzQtMS40NzhDOC42ODUgODMuODc3IDEuMjUgNzIuMTk2IDEuMjUgNTkuMzk2YzAtMTYuNjU2IDEyLjc5Ny0zMC42MSAyOS4wNTItMzIuMzIzIDcuNDktMTUuNzA2IDIzLjE4Ni0yNS43MDcgNDAuNzE0LTI1LjcwNyAyMC45OCAwIDM5LjIxNSAxNC43NTIgNDMuOTQ1IDM0LjkwNyAxNS4wOS4yNDUgMjcuMjkgMTIuNjMgMjcuMjkgMjcuODIyIDAgMTEuOTY4LTcuNzM4IDIyLjU1LTE5LjI1NiAyNi4zMyIgc3Ryb2tlLXdpZHRoPSI5IiBzdHJva2UtbGluZWNhcD0icm91bmQiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPgo8L3N2Zz4K);background-position:50%;background-repeat:no-repeat;background-size:150px;height:100%;overflow:hidden}.attachment-actions .button.edit-attachment,.attachment-info .edit-attachment{display:none}.global-transformations-preview{max-width:600px;position:relative}.global-transformations-spinner{display:none}.global-transformations-button.button-primary{display:none;position:absolute;z-index:100}.global-transformations-url{margin-bottom:5px;margin-top:5px}.global-transformations-url-transformation{color:#51a3ff;max-width:100px;overflow:hidden;text-overflow:ellipsis}.global-transformations-url-file{color:#f2d864}.global-transformations-url-link{background-color:#262c35;border-radius:6px;color:#fff;display:block;overflow:hidden;padding:16px;text-decoration:none;text-overflow:ellipsis}.global-transformations-url-link:hover{color:#888;text-decoration:underline}.cld-tax-order-list-item{background-color:#fff;border:1px solid #efefef;margin:0 0 -1px;padding:4px}.cld-tax-order-list-item.no-items{color:#888;display:none;text-align:center}.cld-tax-order-list-item.no-items:last-child{display:block}.cld-tax-order-list-item.ui-sortable-helper{box-shadow:0 2px 5px rgba(0,0,0,.2)}.cld-tax-order-list-item-placeholder{background-color:#efefef;height:45px;margin:0}.cld-tax-order-list-item-handle{color:#999;cursor:grab;margin-right:4px}.cld-tax-order-list-type{display:inline-block;margin-right:8px}.cld-tax-order-list-type input{margin-right:4px!important}.cloudinary-media-library{margin-left:-20px;position:relative}@media screen and (max-width:782px){.cloudinary-media-library{margin-left:-10px}}.cld-pagenav{color:#555;line-height:2.4em;margin-top:5px;text-align:right}.cld-pagenav-text{margin:0 2em}.cld-delete{color:#dd2c00;cursor:pointer;float:right}.cld-apply-action{float:right}.cld-table thead tr th.cld-table-th{line-height:1.8em}.cld-loading{background-image:url(data:image/svg+xml;base64,PHN2ZyBjbGFzcz0ic3Bpbm5lciIgdmlld0JveD0iLTQgLTQgMTUxIDEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+PCFbQ0RBVEFbCiAgICAgIEBrZXlmcmFtZXMgY29sb3JzIHsKICAgICAgICAwJSB7IHN0cm9rZTogIzAwNzhGRjsgfQogICAgICAgICAgNTAlIHsgc3Ryb2tlOiAjMGUyZjVhOyB9CiAgICAgICAgICAxMDAlIHsgc3Ryb2tlOiAjMDA3OEZGOyB9CiAgICAgIH0KCiAgICAgIEBrZXlmcmFtZXMgZGFzaCB7CiAgICAgICAwJSB7IHN0cm9rZS1kYXNob2Zmc2V0OiA1NjA7IH0KICAgICAgIDUwJSB7CiAgICAgICAgICBzdHJva2UtZGFzaG9mZnNldDogMDsKICAgICAgIH0KICAgICAgIDEwMCUgeyAgIHN0cm9rZS1kYXNob2Zmc2V0OiA1NjA7IH0KICAgICAgfQogICAgICBALXdlYmtpdC1rZXlmcmFtZXMgY29sb3JzIHsKICAgICAgICAwJSB7IHN0cm9rZTogIzAwNzhmZjsgfQogICAgICAgICAgNTAlIHsgc3Ryb2tlOiAjMGUyZjVhOyB9CiAgICAgICAgICAxMDAlIHsgc3Ryb2tlOiAjMDA3OGZmOyB9CiAgICAgIH0KCiAgICAgIEAtd2Via2l0LWtleWZyYW1lcyBkYXNoIHsKICAgICAgIDAlIHsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDU2MDsgfQogICAgICAgNTAlIHsKICAgICAgICAgIHN0cm9rZS1kYXNob2Zmc2V0OiAwOwogICAgICAgfQogICAgICAgMTAwJSB7ICAgc3Ryb2tlLWRhc2hvZmZzZXQ6IDU2MDsKICAgICAgIH0KICAgICAgfQogICAgICAucGF0aCB7CiAgICAgICAgc3Ryb2tlLWRhc2hhcnJheTogMjgwOwogICAgICAgIHN0cm9rZS1kYXNob2Zmc2V0OiAwOwogICAgICAgIHRyYW5zZm9ybS1vcmlnaW46IGNlbnRlcjsKICAgICAgICAtd2Via2l0LWFuaW1hdGlvbjoKICAgICAgICAgIGRhc2ggMnMgZWFzZS1pbi1vdXQgaW5maW5pdGUsIGNvbG9ycyA4cyBlYXNlLWluLW91dCBpbmZpbml0ZTsKICAgICAgICBhbmltYXRpb246CiAgICAgICAgICBkYXNoIDJzIGVhc2UtaW4tb3V0IGluZmluaXRlLCBjb2xvcnMgOHMgZWFzZS1pbi1vdXQgaW5maW5pdGU7CiAgICAgIH0KICAgIF1dPjwvc3R5bGU+CiAgPHBhdGggY2xhc3M9InBhdGgiIGQ9Ik0xMjEuNjYzIDkwLjYzOGMtMS43OTYgMC05OS4zMy0uNDk4LTEwMS40NzQtMS40NzhDOC42ODUgODMuODc3IDEuMjUgNzIuMTk2IDEuMjUgNTkuMzk2YzAtMTYuNjU2IDEyLjc5Ny0zMC42MSAyOS4wNTItMzIuMzIzIDcuNDktMTUuNzA2IDIzLjE4Ni0yNS43MDcgNDAuNzE0LTI1LjcwNyAyMC45OCAwIDM5LjIxNSAxNC43NTIgNDMuOTQ1IDM0LjkwNyAxNS4wOS4yNDUgMjcuMjkgMTIuNjMgMjcuMjkgMjcuODIyIDAgMTEuOTY4LTcuNzM4IDIyLjU1LTE5LjI1NiAyNi4zMyIgc3Ryb2tlLXdpZHRoPSI5IiBzdHJva2UtbGluZWNhcD0icm91bmQiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPgo8L3N2Zz4K);background-position:50%;background-repeat:no-repeat;background-size:50px 50px;height:100px;width:auto}.cld-loading.tree-branch{background-position:25px;background-size:50px 50px}.cld-syncing{background:url(../css/loading.svg) no-repeat 50%;display:inline-block;height:20px;margin-left:12px;padding:4px;width:30px}.cld-footer{bottom:0;color:#555d66;left:0;padding:0;position:absolute;right:0}@media only screen and (min-width:783px){.cld-footer{margin-left:36px}}@media only screen and (min-width:960px){.cld-footer{margin-left:160px}}.cld-footer .cld-notice-box.is-success{background-color:#fff;border:0;color:#555;margin:0;padding:0}.cld-footer .cld-notice-box.is-success .cld-stars{margin-left:12px;text-decoration:none}.cld-footer .cld-notice-box.is-success .cld-stars .dashicons{color:#fd9d2c;position:inherit}.cld-footer .notice-dismiss:before{content:"";font-size:1.4rem;padding:6px 0 0}.cld-tooltip{font-size:1rem;margin-left:2px;margin-top:1px}.cld-notice-box{box-shadow:0 0 2px rgba(0,0,0,.1);margin-bottom:12px;margin-right:20px;position:relative}.cld-notice-box .cld-notice{padding:1rem 2.2rem .75rem 1.2rem}.cld-notice-box .cld-notice img.cld-ui-icon{height:100%}.cld-notice-box.is-dismissible{padding-right:38px}.cld-notice-box.has-icon{padding-left:38px}.cld-notice-box.is-created,.cld-notice-box.is-success,.cld-notice-box.is-updated{background-color:#ebf5ec;border-left:4px solid #42ad4f}.cld-notice-box.is-created .dashicons,.cld-notice-box.is-success .dashicons,.cld-notice-box.is-updated .dashicons{color:#2a0}.cld-notice-box.is-error{background-color:#f8e8e7;border-left:4px solid #cb3435}.cld-notice-box.is-error .dashicons{color:#dd2c00}.cld-notice-box.is-warning{background-color:#fff7e5;border-left:4px solid #f2ad4c}.cld-notice-box.is-warning .dashicons{color:#fd9d2c}.cld-notice-box.is-info{background-color:#e4f4f8;border-left:4px solid #2a95c3}.cld-notice-box.is-info .dashicons{color:#3273ab}.cld-notice-box.is-neutral{background-color:#fff;border-left:4px solid #ccd0d4}.cld-notice-box.is-neutral .dashicons{color:#90a0b3}.cld-notice-box.dismissed{overflow:hidden;transition:height .3s ease-out}.cld-notice-box .cld-ui-icon,.cld-notice-box .dashicons{left:19px;position:absolute;top:14px}.cld-ui-collapse{align-self:center;cursor:pointer;padding:0 .45rem}.cld-ui-title.collapsible{cursor:pointer}.cld-ui-conditional .closed,.cld-ui-wrap .closed{display:none}.cld-ui-wrap .cld-row{clear:both;margin:0 -1.75em}.cld-ui-wrap .cld-column{box-sizing:border-box;float:left;padding:0 1.75em;width:100%}@media only screen and (min-width:783px){.cld-ui-wrap .cld-column.column-45{width:45%}.cld-ui-wrap .cld-column.column-55{width:55%}}.cld-ui-wrap .cld-row:after{clear:both;content:"";display:table}.cld-image-preview,.cld-video-preview{background-color:hsla(0,0%,84.7%,.5);border-radius:5px;padding:7px}.cld-image-preview-wrapper,.cld-video-preview-wrapper{position:relative}.cld-image-preview .cld-ui-title,.cld-video-preview .cld-ui-title{font-weight:400;margin:0 0 .4rem}.cld-image-preview img,.cld-video-preview img{width:100%}.cld-page-header{align-items:center;margin-bottom:1em;padding:1.2rem}.cld-page-header,.cld-page-tabs{background-color:#fff;display:flex;margin-left:-20px}.cld-page-tabs{border-bottom:1px solid #e5e5e5;border-top:1px solid #e5e5e5;flex-wrap:wrap;margin-top:-1em;padding:0 1rem}.cld-page-tabs-tab{list-style:none;margin-bottom:0;text-indent:0}.cld-page-tabs-tab a{color:#000001;display:block;font-weight:500;padding:1rem 2rem;text-align:center;text-decoration:none;white-space:nowrap}.cld-page-tabs-tab.is-active a{border-bottom:2px solid #3273ab;color:#3273ab}.cld-group hr{border-top:1px solid #e5e5e5;clear:both;margin:1.5rem 0}.cld-group-heading{display:flex;justify-content:space-between}.cld-group-heading h3{font-size:.9rem}.cld-group-heading h3 .description{font-size:.7rem;font-weight:400;margin-left:.7em}.cld-input{display:block;margin-bottom:1.4rem}.cld-input-label{display:block;font-weight:700}.cld-input .regular-number,.cld-input .regular-text{border:1px solid #d0d0d0;border-radius:3px;padding:.1rem .5rem;width:100%}.cld-input .regular-number-small,.cld-input .regular-text-small{width:40%}.cld-input .prefixed{margin-left:6px;width:40%}.cld-input .suffixed{margin-right:6px;width:40%}.cld-input .regular-number{width:100px}.cld-input .regular-select{appearance:none;border:1px solid #d0d0d0;border-radius:3px;display:block;margin-top:.6rem;padding:.1rem .5rem;width:100%}.cld-input-on-off{align-items:center;display:inline-flex}.cld-input-on-off .description{margin:0}.cld-input-on-off .description.left{margin-left:0;margin-right:.4rem}.cld-input-on-off-control{display:inline-block;height:20px;margin-right:.4rem;position:relative;width:40px}.cld-input-on-off-control.disabled{opacity:.4}.cld-input-on-off-control input{height:0;opacity:0;width:0}.cld-input-on-off-control-slider{background-color:#90a0b3;border-radius:34px;bottom:0;cursor:pointer;left:0;position:absolute;right:0;top:0;transition:background-color .3s}input:checked+.cld-input-on-off-control-slider{background-color:#2a0!important}input:checked.partial+.cld-input-on-off-control-slider{background-color:#fd9d2c!important}input:checked.delete+.cld-input-on-off-control-slider{background-color:#dd2c00!important}.cld-input-on-off-control-slider:before{background-color:#fff;border-radius:50%;bottom:2px;content:"";display:block;height:16px;left:2px;position:absolute;transition:transform .2s;width:16px}input:checked+.cld-input-on-off-control-slider:before{transform:translateX(20px)}.mini input:checked+.cld-input-on-off-control-slider:before{transform:translateX(10px)}.cld-input-on-off-control.mini{height:10px;width:20px}.mini .cld-input-on-off-control-slider:before{bottom:1px;height:8px;left:1px;width:8px}.cld-input-icon-toggle{align-items:center;display:inline-flex}.cld-input-icon-toggle .description{margin:0 0 0 .4rem}.cld-input-icon-toggle .description.left{margin-left:0;margin-right:.4rem}.cld-input-icon-toggle-control{display:inline-block;position:relative}.cld-input-icon-toggle-control input{height:0;opacity:0;position:absolute;width:0}.cld-input-icon-toggle-control-slider .icon-on{display:none;visibility:hidden}.cld-input-icon-toggle-control-slider .icon-off,input:checked+.cld-input-icon-toggle-control-slider .icon-on{display:inline-block;visibility:visible}input:checked+.cld-input-icon-toggle-control-slider .icon-off{display:none;visibility:hidden}.cld-input-checkbox-label,.cld-input-radio-label{display:block;margin-bottom:.4rem}.cld-input-checkbox-label.list-inline,.cld-input-radio-label.list-inline{display:inline-block;margin-right:.4rem}.cld-info-box,.cld-panel,.cld-panel-short,.cld-submit,.cld-switch-cloud{background-color:#fff;border:1px solid #e5e5e5;margin-right:1rem;max-width:870px}.cld-info-box.full-width,.cld-panel-short.full-width,.cld-panel.full-width,.cld-submit.full-width,.cld-switch-cloud.full-width{max-width:100%}.cld-submit,.cld-switch-cloud{border-top:0;padding:1.2rem 1.75rem}.cld-info-box,.cld-panel,.cld-panel-short{margin-top:1rem;padding:2rem 1.75rem}.cld-info-box-inner,.cld-panel-inner,.cld-panel-short-inner{background-color:hsla(0,0%,86.3%,.2);border:1px solid #e5e5e5;margin:1em 0;padding:1.3rem}.cld-info-box-inner h2,.cld-panel-inner h2,.cld-panel-short-inner h2{color:#3273ab}.cld-info-box .cld-input-label,.cld-panel-short .cld-input-label,.cld-panel .cld-input-label{margin-bottom:.6rem}.cld-info-box.has-heading,.cld-panel-short.has-heading,.cld-panel.has-heading{border-top:0;margin-top:0}.cld-info-box-heading,.cld-panel-heading,.cld-panel-short-heading{display:flex;padding:.4rem 1.75rem .2rem;position:relative}.cld-info-box-heading.full-width,.cld-panel-heading.full-width,.cld-panel-short-heading.full-width{max-width:100%}.cld-info-box-heading img,.cld-panel-heading img,.cld-panel-short-heading img{margin-right:.6rem}.cld-info-box-heading.collapsible,.cld-panel-heading.collapsible,.cld-panel-short-heading.collapsible{cursor:pointer}.cld-info-box ul,.cld-panel-short ul,.cld-panel ul{list-style:initial;padding:0 3em}.cld-info-box .cld-plan,.cld-panel-short .cld-plan,.cld-panel .cld-plan{color:#3273ab;font-size:1.5em;font-weight:700}.cld-info-box .stat-boxes,.cld-panel-short .stat-boxes,.cld-panel .stat-boxes{border:1px solid #e5e5e5;font-size:1.2em}.cld-info-box .stat-boxes .box,.cld-panel-short .stat-boxes .box,.cld-panel .stat-boxes .box{border-bottom:1px solid #e5e5e5;padding:2rem;text-align:center}.cld-info-box .stat-boxes .box:last-of-type,.cld-panel-short .stat-boxes .box:last-of-type,.cld-panel .stat-boxes .box:last-of-type{border-bottom:none}.cld-info-box .stat-boxes .box .cld-ui-icon,.cld-panel-short .stat-boxes .box .cld-ui-icon,.cld-panel .stat-boxes .box .cld-ui-icon{height:35px;width:35px}.cld-info-box .stat-boxes .icon,.cld-panel-short .stat-boxes .icon,.cld-panel .stat-boxes .icon{height:50px;margin-right:.5em;width:50px}.cld-info-box .stat-boxes h3,.cld-panel-short .stat-boxes h3,.cld-panel .stat-boxes h3{margin-bottom:1.5rem;margin-top:2.4rem}.cld-info-box .stat-boxes .limit,.cld-panel-short .stat-boxes .limit,.cld-panel .stat-boxes .limit{font-size:2em;font-weight:700;margin-right:.5em;white-space:nowrap}.cld-info-box .stat-boxes .usage,.cld-panel-short .stat-boxes .usage,.cld-panel .stat-boxes .usage{color:#3273ab;font-size:1.5em;font-weight:400}@media only screen and (min-width:783px){.cld-info-box .stat-boxes,.cld-panel-short .stat-boxes,.cld-panel .stat-boxes{display:flex;flex-wrap:nowrap;font-size:1em}.cld-info-box .stat-boxes .box,.cld-panel-short .stat-boxes .box,.cld-panel .stat-boxes .box{border-bottom:none;border-right:1px solid #e5e5e5;flex-grow:1}.cld-info-box .stat-boxes .box:last-of-type,.cld-panel-short .stat-boxes .box:last-of-type,.cld-panel .stat-boxes .box:last-of-type{border-right:none}}@media only screen and (min-width:1200px){.cld-info-box .stat-boxes,.cld-panel-short .stat-boxes,.cld-panel .stat-boxes{font-size:1.2em}}.cld-info-box .img-connection-string,.cld-panel-short .img-connection-string,.cld-panel .img-connection-string{max-width:607px;width:100%}.cld-info-box .connection-string,.cld-panel-short .connection-string,.cld-panel .connection-string{max-width:40em;width:100%}.cld-info-box .media-status-box,.cld-info-box .stat-boxes,.cld-panel-short .media-status-box,.cld-panel-short .stat-boxes,.cld-panel .media-status-box,.cld-panel .stat-boxes{border:1px solid #e5e5e5}.cld-info-box .media-status-box,.cld-panel-short .media-status-box,.cld-panel .media-status-box{padding:2rem;text-align:center}.cld-info-box .media-status-box .status,.cld-panel-short .media-status-box .status,.cld-panel .media-status-box .status{font-size:2rem;font-weight:700;margin-right:.5em}.cld-info-box .media-status-box .cld-ui-icon,.cld-panel-short .media-status-box .cld-ui-icon,.cld-panel .media-status-box .cld-ui-icon{height:35px;width:35px}.cld-info-box .notification,.cld-panel-short .notification,.cld-panel .notification{display:inline-flex;font-weight:700;padding:1.5rem}.cld-info-box .notification-success,.cld-panel-short .notification-success,.cld-panel .notification-success{background-color:rgba(32,184,50,.2);border:2px solid #20b832}.cld-info-box .notification-success:before,.cld-panel-short .notification-success:before,.cld-panel .notification-success:before{color:#20b832}.cld-info-box .notification-syncing,.cld-panel-short .notification-syncing,.cld-panel .notification-syncing{background-color:rgba(50,115,171,.2);border:2px solid #3273ab;color:#444;text-decoration:none}.cld-info-box .notification-syncing:before,.cld-panel-short .notification-syncing:before,.cld-panel .notification-syncing:before{-webkit-animation:spin 1s infinite running;-moz-animation:spin 1s linear infinite;animation:spin 1s linear infinite;color:#3273ab}@keyframes spin{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.cld-info-box .notification:before,.cld-panel-short .notification:before,.cld-panel .notification:before{margin-right:.5em}.cld-info-box{display:flex;flex-direction:column}@media only screen and (min-width:783px){.cld-info-box{flex-direction:row}}.cld-info-box a.button,.cld-info-box img{align-self:center}.cld-info-box .cld-ui-body{margin:0 1.2rem}.cld-panel-short{display:inline-block;min-width:270px;width:auto}.cld-gallery-settings{box-sizing:border-box;display:flex;flex-wrap:wrap;padding:1rem 0;width:100%}@media only screen and (min-width:960px){.cld-gallery-settings{margin-left:-1rem;margin-right:-1rem}}.cld-gallery-settings__column{box-sizing:border-box;width:100%}@media only screen and (min-width:960px){.cld-gallery-settings__column{padding-left:1rem;padding-right:1rem;width:50%}}.components-base-control__field select{display:block;margin:1rem 0}.components-range-control__wrapper{margin:0!important}.components-range-control__root{flex-direction:row-reverse;margin:1rem 0}.components-input-control.components-number-control.components-range-control__number{margin-left:0!important;margin-right:16px}.components-panel{border:0!important}.components-panel__body:first-child{border-top:0!important}.components-panel__body:last-child{border-bottom:0!important}.components-textarea-control__input{display:block;margin:.5rem 0;width:100%}.tippy-box[data-theme~=cloudinary]{background-color:rgba(0,0,0,.8);color:#fff;font-size:.8em}table .cld-input{margin-bottom:0}tr .file-size.small{color:#a8a8a8;font-size:.8em;font-style:italic;letter-spacing:.4px;margin-left:6px;margin-right:6px}td.tree{color:#212529;line-height:1.5;padding-top:0;position:relative}td.tree ul.striped>:nth-child(odd){background-color:#f6f7f7}td.tree ul.striped>:nth-child(2n){background-color:#fff}td.tree .success{color:#20b832}td+td.tree{padding-top:0}td.tree .cld-input{margin-bottom:0;vertical-align:text-bottom}td.tree .cld-search{font-size:.9em;height:26px;margin-right:12px;min-height:20px;padding:4px 6px;vertical-align:initial}td.tree .file-size{color:#a8a8a8;font-size:.8em;font-style:italic;letter-spacing:.4px;margin-left:6px}td.tree .fa-folder,td.tree .fa-folder-open{color:#007bff}td.tree .fa-html5{color:#f21f10}td.tree ul{list-style:none;margin:0;padding-left:5px}td.tree ul li{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin-bottom:0;padding-bottom:5px;padding-left:25px;padding-top:5px;position:relative}td.tree ul li:before{height:1px;margin:auto;top:14px;width:20px}td.tree ul li:after,td.tree ul li:before{background-color:#666;content:"";left:0;position:absolute}td.tree ul li:after{bottom:0;height:100%;top:0;width:1px}td.tree ul li:after:nth-of-type(odd){background-color:#666}td.tree ul li:last-child:after{height:14px}td.tree ul a{cursor:pointer}td.tree ul a:hover{text-decoration:none} \ No newline at end of file diff --git a/css/src/components/_ui.scss b/css/src/components/_ui.scss index 737dfb3b8..3c81bde9b 100644 --- a/css/src/components/_ui.scss +++ b/css/src/components/_ui.scss @@ -198,8 +198,6 @@ align-self: center; padding: 0 0.45rem; cursor: pointer; - position: absolute; - right: 0; } &-title { @@ -327,7 +325,7 @@ &-heading { display: flex; - + justify-content: space-between; h3 { font-size: 0.9rem; diff --git a/php/class-beta.php b/php/class-beta.php index b502f26f0..578f1351d 100644 --- a/php/class-beta.php +++ b/php/class-beta.php @@ -35,14 +35,25 @@ public function __construct( Plugin $plugin ) { $this->plugin = $plugin; $this->components = array( - 'delivery' => array( + 'delivery' => array( 'class' => 'Cloudinary\Delivery', 'name' => __( 'New Delivery method', 'cloudinary' ), 'options' => array(), ), + 'responsive_breakpoints' => array( + 'class' => 'Cloudinary\Responsive_Breakpoints', + 'name' => __( 'New Responsive Breakpoints', 'cloudinary' ), + 'options' => array(), + 'deps' => array( 'delivery' ), + ), ); foreach ( $this->components as $key => $data ) { + + if ( ! empty( $data['deps'] ) && empty( array_intersect( $data['deps'], array_keys( $this->plugin->components ) ) ) ) { + continue; + } + /** * Filter to enable beta features for testing. * @@ -53,7 +64,7 @@ public function __construct( Plugin $plugin ) { * @param $feature {string} Optional feature type. * @param $data {array} The beta feature data. * - * @return {bool} + * @return {bool} */ if ( apply_filters( 'cloudinary_beta', false, $key, $data ) ) { $this->plugin->components[ $key ] = new $data['class']( $this->plugin ); diff --git a/php/class-connect.php b/php/class-connect.php index 029ada4b2..989ba9bd8 100644 --- a/php/class-connect.php +++ b/php/class-connect.php @@ -332,7 +332,7 @@ public function updated_option() { add_query_arg( array( 'page' => 'dashboard', - 'tab' => 'connect', + 'tab' => 'connection', ), admin_url( 'admin.php' ) ) @@ -766,7 +766,7 @@ public function maybe_connection_string_constant( $value, $setting ) { } if ( 'signature' === $setting ) { - $value = md5( $url ); + $value = md5( $url ); } if ( 'connect' === $setting ) { @@ -811,7 +811,7 @@ public function settings() { 'page_title' => __( 'Getting Started', 'cloudinary' ), 'type' => 'page', 'tabs' => array( - 'about' => array( + 'about' => array( 'page_title' => __( 'About', 'cloudinary' ), array( 'type' => 'info_box', @@ -857,7 +857,7 @@ public function settings() { 'link_text' => __( 'See Examples', 'cloudinary' ), ), ), - 'connect' => array( + 'connection' => array( 'page_title' => __( 'Connect', 'cloudinary' ), array( 'enabled' => function () use ( $self ) { diff --git a/php/class-media.php b/php/class-media.php index 7aaca4969..caf3597e3 100644 --- a/php/class-media.php +++ b/php/class-media.php @@ -1935,7 +1935,7 @@ public function get_breakpoint_options( $attachment_id ) { $settings = $this->settings->get_setting( self::MEDIA_SETTINGS_SLUG )->get_value(); if ( 'on' === $settings['enable_breakpoints'] && wp_attachment_is_image( $attachment_id ) ) { - $meta = wp_get_attachment_metadata( $attachment_id ); + $meta = wp_get_attachment_metadata( $attachment_id, true ); // Get meta image size if non exists. if ( empty( $meta ) ) { $meta = array(); diff --git a/php/class-sync.php b/php/class-sync.php index 2cd6154fa..81cf81a58 100644 --- a/php/class-sync.php +++ b/php/class-sync.php @@ -152,7 +152,7 @@ public function is_active() { public function been_synced( $attachment_id ) { $public_id = $this->managers['media']->has_public_id( $attachment_id ); - $meta = wp_get_attachment_metadata( $attachment_id ); + $meta = wp_get_attachment_metadata( $attachment_id, true ); return ! empty( $public_id ) || ! empty( $meta['cloudinary'] ); // From v1. } diff --git a/php/settings/class-setting.php b/php/settings/class-setting.php index aa92162e0..f4b8e18d6 100644 --- a/php/settings/class-setting.php +++ b/php/settings/class-setting.php @@ -377,8 +377,8 @@ public function get_setting( $slug, $create = true ) { */ public function setting_exists( $slug ) { $exists = false; - $setting = $this->get_root_setting()->get_setting( $slug, false ); - if ( ! $this->is_private_slug( $slug ) && ! is_null( $setting ) && $setting->get_param( 'is_setup', false ) ) { + $setting = $this->get_root_setting()->get_param( 'index:' . $slug, null ); + if ( ! $this->is_private_slug( $slug ) && ! is_null( $setting ) ) { $exists = true; } @@ -396,19 +396,9 @@ public function find_setting( $slug ) { if ( ! $this->is_root_setting() ) { return $this->get_root_setting()->find_setting( $slug ); } - $parts = explode( ':', $slug ); - $index = $this->get_param( 'index', array() ); + $setting = $this->get_param( 'index:' . $slug, null ); - $slug = sanitize_file_name( trim( array_shift( $parts ) ) ); - if ( isset( $index[ $slug ] ) ) { - if ( ! empty( $parts ) ) { - return $index[ $slug ]->get_setting( implode( ':', $parts ) ); - } - - return $index[ $slug ]; - } - - return $this->get_setting( $slug ); + return $setting ? $setting : $this->create_setting( $slug, null, $this ); // return a dynamic setting. } /** @@ -737,6 +727,14 @@ public function get_component() { return $this->component; } + /** + * Rebuild a component. + */ + public function rebuild_component() { + $this->component = null; + $this->setup_component(); + } + /** * Render the settings Component. * @@ -991,13 +989,23 @@ protected function get_default_values_recursive() { * @return Setting */ public function create_setting( $slug, $params = array(), $parent = null ) { - $slug = sanitize_file_name( $slug ); + $slug = sanitize_file_name( $slug ); + $existing = false; if ( $this->setting_exists( $slug ) ) { - // translators: Placeholder is the slug. - $message = sprintf( __( 'Duplicate setting slug %s. This setting will not be usable.', 'cloudinary' ), $slug ); - $this->add_admin_notice( 'duplicate_setting', $message, 'warning' ); + $existing_maybe = $this->find_setting( $slug ); + if ( $existing_maybe->get_param( 'is_setup' ) ) { + // translators: Placeholder is the slug. + $message = sprintf( __( 'Duplicate setting slug %s. This setting will not be usable.', 'cloudinary' ), $slug ); + $this->add_admin_notice( 'duplicate_setting', $message, 'warning' ); + } else { + // Use existing. + $existing = $existing_maybe; + if ( ! empty( $params ) ) { + $existing->setup_setting( $params ); + } + } } - $new_setting = new Setting( $slug, $params, $this->root_setting ); + $new_setting = $existing ? $existing : new Setting( $slug, $params, $this->root_setting ); $new_setting->set_value( null ); // Set value to null. if ( $parent ) { $parent->add_setting( $new_setting ); diff --git a/php/ui/class-component.php b/php/ui/class-component.php index b9f710ff0..3906b417c 100644 --- a/php/ui/class-component.php +++ b/php/ui/class-component.php @@ -86,31 +86,37 @@ public function __construct( $setting ) { // Setup blueprint. $this->blueprint = $this->setting->get_param( 'blueprint', $this->blueprint ); - // Setup conditional logic. - if ( $this->setting->has_param( 'condition' ) ) { - $condition = $this->setting->get_param( 'condition' ); - foreach ( $condition as $slug => $value ) { - $bound = $this->setting->get_root_setting()->get_setting( $slug, false ); - if ( ! is_null( $bound ) ) { - $bound->set_param( 'attributes:input:data-bind-trigger', $bound->get_slug() ); - } else { - $this->setting->set_param( 'condition', null ); - } - } - } - // Setup the components parts for render. $this->setup_component_parts(); // Add scripts. add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); + } /** * Setup the component. */ public function setup() { + $this->setup_conditions(); + } + /** + * Setup the conditions. + */ + public function setup_conditions() { + // Setup conditional logic. + if ( $this->setting->has_param( 'condition' ) ) { + $condition = $this->setting->get_param( 'condition' ); + foreach ( $condition as $slug => $value ) { + $bound = $this->setting->get_root_setting()->get_setting( $slug, false ); + if ( ! is_null( $bound ) ) { + $bound->set_param( 'attributes:input:data-bind-trigger', $bound->get_slug() ); + } else { + $this->setting->set_param( 'condition', null ); + } + } + } } /** diff --git a/php/ui/component/class-group.php b/php/ui/component/class-group.php index cc7560003..aa9abb11a 100644 --- a/php/ui/component/class-group.php +++ b/php/ui/component/class-group.php @@ -22,7 +22,7 @@ class Group extends Panel { * * @var string */ - protected $blueprint = 'header|icon/|title/|collapse/|/header|wrap|settings/|hr/|/wrap'; + protected $blueprint = 'div|header|icon/|title/|collapse/|/header|wrap|settings/|hr/|/wrap|/div'; /** From 4fe2e1eab49d5f3331d2c7da3b49019e9f5a10c2 Mon Sep 17 00:00:00 2001 From: David Cramer Date: Thu, 1 Jul 2021 14:05:15 +0200 Subject: [PATCH 13/56] add breakpoints class --- php/class-responsive-breakpoints.php | 353 +++++++++++++++++++++++++++ 1 file changed, 353 insertions(+) create mode 100644 php/class-responsive-breakpoints.php diff --git a/php/class-responsive-breakpoints.php b/php/class-responsive-breakpoints.php new file mode 100644 index 000000000..b721547b9 --- /dev/null +++ b/php/class-responsive-breakpoints.php @@ -0,0 +1,353 @@ +plugin = $plugin; + $this->media = $plugin->get_component( 'media' ); + } + + /** + * Filter the URL components. + * + * @param array $url_parts The components. + * + * @return array|object|string + */ + public function filter_url_parts( $url_parts ) { + if ( false === $this->doing_responsive ) { + return $url_parts; + } + $default = array( + 'path' => '', + 'size' => array(), + 'transformations' => array(), + 'placeholder' => '--placehold--', + 'version' => '', + 'public_id' => '', + 'seo_string' => '', + 'file_extension' => '', + ); + $breakpoints = $this->media->get_settings()->get_value( 'enable_breakpoints' ); + if ( 'on' === $breakpoints ) { + $url_parts['size'] = '--size--'; + } + + return wp_parse_args( $url_parts, $default ); + } + + /** + * Get the placeholder generation transformations. + * + * @param string $placeholder The placeholder to get. + * + * @return array + */ + public function get_placeholder_transformations( $placeholder ) { + $transformations = array( + 'predominant' => array( + array( + '$currWidth' => 'w', + '$currHeight' => 'h', + ), + array( + 'width' => 'iw_div_2', + 'aspect_ratio' => 1, + 'crop' => 'pad', + 'background' => 'auto', + ), + array( + 'crop' => 'crop', + 'width' => 10, + 'height' => 10, + 'gravity' => 'north_east', + ), + array( + 'width' => '$currWidth', + 'height' => '$currHeight', + 'crop' => 'fill', + ), + array( + 'fetch_format' => 'auto', + 'quality' => 'auto', + ), + ), + 'vectorize' => array( + array( + 'effect' => 'vectorize:3:0.1', + 'fetch_format' => 'svg', + ), + ), + 'blur' => array( + array( + 'effect' => 'blur:2000', + 'quality' => 1, + 'fetch_format' => 'auto', + ), + ), + 'pixelate' => array( + array( + 'effect' => 'pixelate', + 'quality' => 1, + 'fetch_format' => 'auto', + ), + ), + ); + + return $transformations[ $placeholder ]; + } + + /** + * Add features to a tag element set. + * + * @param array $tag_element The tag element set. + * @param int $attachment_id The attachment id. + * @param string $original_tag The original html tag. + * + * @return array + */ + public function add_features( $tag_element, $attachment_id, $original_tag ) { + + $settings = $this->settings->get_value(); + + $meta = wp_get_attachment_metadata( $attachment_id, true ); + $format = $this->media->get_settings()->get_value( 'image_format' ); + if ( isset( $tag_element['atts']['srcset'] ) ) { + unset( $tag_element['atts']['srcset'] ); + } + $this->doing_responsive = true; + $tag_element['atts']['data-src'] = $tag_element['atts']['src']; + $breakpoints = $this->media->get_settings()->get_value( 'enable_breakpoints' ); + if ( 'on' === $breakpoints ) { + $tag_element['atts']['data-src'] = $this->media->cloudinary_url( $attachment_id, array( 1 ) ); + } + $this->doing_responsive = false; + + // placeholder. + if ( 'off' !== $settings['lazy_placeholder'] ) { + $placeholder = $this->media->cloudinary_url( + $attachment_id, + 'medium', + array( 'asset' => $this->get_placeholder_transformations( $settings['lazy_placeholder'] ) ), + null, + true + ); + $tag_element['atts']['src'] = $placeholder; + if ( ! empty( $settings['lazy_preloader'] ) ) { + $tag_element['atts']['data-placeholder'] = $placeholder; + } + } + + if ( ! empty( $settings['lazy_preloader'] ) ) { + $svg = ''; + $tag_element['atts']['src'] = 'data:image/svg+xml;utf8,' . $svg; + $tag_element['atts']['data-type'] = $format; + } + + unset( $tag_element['atts']['loading'] ); + $this->doing_responsive = false; + $tag_element['atts']['decoding'] = 'async'; + $tag_element['atts']['data-width'] = $meta['width']; + + return $tag_element; + } + + /** + * Check if component is active.§ + * + * @return bool + */ + public function is_active() { + return ! is_admin(); + } + + /** + * Register assets to be used for the class. + */ + public function register_assets() { + wp_register_script( 'cld-responsive-breakpoints', $this->plugin->dir_url . 'js/responsive-breakpoints.js', null, $this->plugin->version, false ); + if ( ! is_admin() ) { + $this->enqueue_assets(); + } + } + + /** + * Enqueue Assets + */ + public function enqueue_assets() { + wp_enqueue_script( 'cld-responsive-breakpoints' ); + $breakpoints = $this->media->get_settings()->get_value( 'image_display' ); + wp_add_inline_script( 'cld-responsive-breakpoints', 'var CLDLB = ' . wp_json_encode( $breakpoints ), 'before' ); + } + + /** + * Setup the class. + */ + public function setup() { + $this->register_settings(); + if ( ! is_admin() ) { + $settings = $this->settings->get_value(); + if ( isset( $settings['use_lazy_loading'] ) && 'on' === $settings['use_lazy_loading'] ) { + add_filter( 'cloudinary_pre_image_tag', array( $this, 'add_features' ), 10, 3 ); + add_filter( 'cloudinary_url_parts', array( $this, 'filter_url_parts' ) ); + } + } + } + + /** + * Define the settings. + * + * @return array + */ + public function settings() { + + $args = array( + 'type' => 'group', + 'title' => __( 'Lazy Loading', 'cloudinary' ), + 'slug' => 'lazy_loading', + 'priority' => 9, + array( + 'type' => 'on_off', + 'description' => __( 'Enable lazy loading', 'cloudinary' ), + 'slug' => 'use_lazy_loading', + 'default' => 'off', + ), + array( + 'type' => 'group', + 'condition' => array( + 'use_lazy_loading' => true, + ), + array( + 'type' => 'number', + 'title' => __( 'Lazy loading threshold', 'cloudinary' ), + 'slug' => 'lazy_threshold', + 'description' => __( ' The threshold', 'cloudinary' ), + 'default' => 1000, + ), + array( + 'type' => 'radio', + 'title' => __( 'Placeholder generation', 'cloudinary' ), + 'slug' => 'lazy_placeholder', + 'description' => __( ' The placeholder', 'cloudinary' ), + 'default' => 'blur', + 'options' => array( + 'blur' => __( 'Blur', 'cloudinary' ), + 'pixelate' => __( 'Pixelate', 'cloudinary' ), + 'vectorize' => __( 'Vectorize', 'cloudinary' ), + 'predominant' => __( 'Dominant Color', 'cloudinary' ), + 'off' => __( 'Off', 'cloudinary' ), + ), + ), + array( + 'type' => 'checkbox', + 'title' => __( 'Initial preloader', 'cloudinary' ), + 'slug' => 'lazy_preloader', + 'description' => __( ' The preloader', 'cloudinary' ), + 'default' => 'on', + 'options' => array( + 'on' => __( 'Use an initial preloader', 'cloudinary' ), + ), + ), + array( + 'type' => 'checkbox', + 'title' => __( 'Use custom preloader', 'cloudinary' ), + 'slug' => 'lazy_custom_preloader', + 'description' => __( ' The custom preloader', 'cloudinary' ), + 'default' => 'on', + 'condition' => array( + 'lazy_preloader' => true, + ), + 'options' => array( + 'on' => __( 'Use a custom preloader', 'cloudinary' ), + ), + ), + ), + ); + + return $args; + } + + /** + * Register the setting under media. + */ + protected function register_settings() { + + // Move setting to media. + $media_settings = $this->media->get_settings()->get_setting( 'image_display' ); + $condition = array( + 'use_lazy_loading' => false, + ); + $settings_params = $this->settings(); + $this->settings = $this->plugin->settings->create_setting( $this->settings_slug, $settings_params ); + $media_settings->add_setting( $this->settings ); + + $bk = $media_settings->get_setting( 'breakpoints' ); + $bk->set_param( 'condition', $condition ); + $bk->rebuild_component(); + + } +} From 496e50ccdc876cbb0e2f87c5727780d03a169b43 Mon Sep 17 00:00:00 2001 From: David Cramer Date: Thu, 1 Jul 2021 14:56:58 +0200 Subject: [PATCH 14/56] add breakpoints js --- js/responsive-breakpoints.asset.php | 1 + js/responsive-breakpoints.js | 1 + js/src/responsive-breakpoints.js | 143 ++++++++++++++++++++++++++++ webpack.config.js | 9 ++ 4 files changed, 154 insertions(+) create mode 100644 js/responsive-breakpoints.asset.php create mode 100644 js/responsive-breakpoints.js create mode 100644 js/src/responsive-breakpoints.js diff --git a/js/responsive-breakpoints.asset.php b/js/responsive-breakpoints.asset.php new file mode 100644 index 000000000..6bd267203 --- /dev/null +++ b/js/responsive-breakpoints.asset.php @@ -0,0 +1 @@ + array('wp-polyfill'), 'version' => 'f521a16b27c948915bdd8d8de9428134'); \ No newline at end of file diff --git a/js/responsive-breakpoints.js b/js/responsive-breakpoints.js new file mode 100644 index 000000000..dc0b28bf5 --- /dev/null +++ b/js/responsive-breakpoints.js @@ -0,0 +1 @@ +!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);ne.naturalWidth/this.density||!e.cld_loaded)},_shouldPlacehold:function(e){var t=this.scaleSize(e.originalWidth,e.width,this.config.bytes_step),n=e.getBoundingClientRect(),o=window.innerHeight+parseInt(this.config.lazy_threshold,10);return!e.cld_loaded&&n.top<2*o&&(t>e.naturalWidth/this.density||!e.cld_placehold)},getResponsiveSteps:function(e){return Math.ceil(e.dataset.breakpoints?e.originalWidth/e.dataset.breakpoints:this.responsiveStep)},getQuality:function(){var e="q_auto";switch(navigator&&navigator.connection?navigator.connection.effectiveType:"none"){case"none":break;case"4g":e="q_auto:good";break;case"3g":e="q_auto:eco";break;case"2g":case"slow-2g":e="q_auto:low";break;default:e="q_auto:best"}return e},scaleSize:function(e,t,n){var o=e-n*Math.floor((e-t)/n);return(o>e||this.config.max_width { + if ( ! image.dataset.src ) { + return; + } + image.originalWidth = image.dataset.width; + this.images.push( image ); + } ); + + // Resize handler. + window.addEventListener( 'resize', ( ev ) => { + this._debounceBuild(); + } ); + window.addEventListener( 'scroll', ( ev ) => { + this._debounceBuild(); + } ); + // Build images. + this._build(); + }, + _debounceBuild() { + if ( this.debounce ) { + clearTimeout( this.debounce ); + } + this.debounce = setTimeout( () => { + this._build(); + }, 100 ); + }, + _build() { + this.images.forEach( ( image ) => { + this.buildSize( image ); + } ); + }, + _shouldRebuild( image ) { + const width = this.scaleSize( + image.originalWidth, + image.width, + this.config.bytes_step + ); + const rect = image.getBoundingClientRect(); + const diff = + window.innerHeight + parseInt( this.config.lazy_threshold, 10 ); + return ( + rect.top < diff && + ( width > image.naturalWidth / this.density || ! image.cld_loaded ) + ); + }, + _shouldPlacehold( image ) { + const width = this.scaleSize( + image.originalWidth, + image.width, + this.config.bytes_step + ); + const rect = image.getBoundingClientRect(); + const diff = window.innerHeight + parseInt( this.config.lazy_threshold, 10 ); + return ( + ! image.cld_loaded && + rect.top < diff * 2 && + ( width > image.naturalWidth / this.density || ! image.cld_placehold ) + ); + }, + getResponsiveSteps( image ) { + const steps = Math.ceil( + image.dataset.breakpoints + ? image.originalWidth / image.dataset.breakpoints + : this.responsiveStep + ); + return steps; + }, + getQuality() { + let quality = 'q_auto'; + switch ( + navigator && navigator.connection + ? navigator.connection.effectiveType + : 'none' + ) { + case 'none': + break; + case '4g': + quality = 'q_auto:good'; + break; + case '3g': + quality = 'q_auto:eco'; + break; + case '2g': + case 'slow-2g': + quality = 'q_auto:low'; + break; + default: + quality = 'q_auto:best'; + break; + } + return quality; + }, + scaleSize( original, newSize, responsiveStep ) { + const diff = Math.floor( ( original - newSize ) / responsiveStep ); + let scaledSize = original - responsiveStep * diff; + if ( scaledSize > original ) { + scaledSize = original; + } + else if ( this.config.max_width < scaledSize ) { + scaledSize = original; + } + return scaledSize; + }, + buildSize( image ) { + if ( this._shouldRebuild( image ) ) { + image.src = this.getSizeURL( image ); + } + else if ( this._shouldPlacehold( image ) ) { + image.src = this.getPlaceholderURL( image ); + } + }, + getSizeURL( image ) { + image.cld_loaded = true; + if ( image.dataset.srcset ) { + image.srcset = image.dataset.srcset; + delete image.dataset.srcset; + return ''; + } + const width = this.scaleSize( + image.originalWidth, + image.width, + this.config.bytes_step + ); + const newSize = 'w_' + width + ',dpr_' + this.density; + return image.dataset.src.replace( '--size--', newSize ) + .replace( '/--placehold--', '' ) + .replace( 'q_auto', this.getQuality() ); + }, + getPlaceholderURL( image ) { + image.cld_placehold = true; + return image.dataset.placeholder; + } +}; +// Init. +window.addEventListener( 'load', () => { + ResponsiveBreakpoints._init(); +} ); diff --git a/webpack.config.js b/webpack.config.js index 02de043a7..404509b7b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -197,6 +197,14 @@ const cldVideoInit = { }, }; +const cldResponsiveBreakpoints = { + ...defaultConfig, + ...sharedConfig, + entry: { + 'responsive-breakpoints': './js/src/responsive-breakpoints.js', + }, +}; + module.exports = [ cldBlockEditor, cldCore, @@ -206,4 +214,5 @@ module.exports = [ cldVideoInit, cldSettingsGallery, cldGalleryUI, + cldResponsiveBreakpoints, ]; From 06d634e83aa56ee720a5366bef66ec80b3f18492 Mon Sep 17 00:00:00 2001 From: David Cramer Date: Thu, 1 Jul 2021 14:57:52 +0200 Subject: [PATCH 15/56] add settings --- .eslintrc.json | 1 + php/class-utils.php | 23 +++++++++++++++++++++++ ui-definitions/settings-image.php | 4 ++++ 3 files changed, 28 insertions(+) diff --git a/.eslintrc.json b/.eslintrc.json index 42a5e8b6a..8f8f8ae8f 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -7,6 +7,7 @@ "jQuery": "readonly", "$": "readonly", "CLDN": "readonly", + "CLDLB": "readonly", "CLD_GLOBAL_TRANSFORMATIONS": "readonly", "samplePlayer": "readonly", "CLDCACHE": "readonly" diff --git a/php/class-utils.php b/php/class-utils.php index 4be4688d9..e28351b52 100644 --- a/php/class-utils.php +++ b/php/class-utils.php @@ -129,4 +129,27 @@ public static function get_tag_attributes( $tag ) { return $return; } + + /** + * Get the depth of an array. + * + * @param array $array The array to check. + * + * @return int + */ + public static function array_depth( array $array ) { + $depth = 0; + + foreach ( $array as $value ) { + if ( is_array( $value ) ) { + $level = self::array_depth( $value ) + 1; + + if ( $level > $depth ) { + $depth = $level; + } + } + } + + return $depth; + } } diff --git a/ui-definitions/settings-image.php b/ui-definitions/settings-image.php index 38b82dd1f..fecb88c2a 100644 --- a/ui-definitions/settings-image.php +++ b/ui-definitions/settings-image.php @@ -87,6 +87,9 @@ ), array( 'type' => 'group', + 'title' => __( 'Image Display', 'cloudinary' ), + 'collapsible' => 'open', + 'slug' => 'image_display', array( 'type' => 'on_off', 'slug' => 'enable_breakpoints', @@ -101,6 +104,7 @@ 'condition' => array( 'enable_breakpoints' => true, ), + 'collapsible' => 'open', array( 'type' => 'number', 'slug' => 'breakpoints', From c4dbe4f507a270b41afd7228c4ef65d7551a4ed7 Mon Sep 17 00:00:00 2001 From: David Cramer Date: Thu, 1 Jul 2021 16:34:31 +0200 Subject: [PATCH 16/56] connect delivery with breakpoints. --- php/class-delivery.php | 45 ++- php/class-responsive-breakpoints.php | 77 ++--- php/media/class-asset.php | 295 ---------------- php/media/class-cloudinary-url.php | 498 --------------------------- 4 files changed, 67 insertions(+), 848 deletions(-) delete mode 100644 php/media/class-asset.php delete mode 100644 php/media/class-cloudinary-url.php diff --git a/php/class-delivery.php b/php/class-delivery.php index ce2970d8f..56227961f 100644 --- a/php/class-delivery.php +++ b/php/class-delivery.php @@ -68,6 +68,7 @@ class Delivery implements Setup { * @param Plugin $plugin Global instance of the main plugin. */ public function __construct( Plugin $plugin ) { + $this->plugin = $plugin; $this->plugin->components['replace'] = new String_Replace( $this->plugin ); $this->media = $this->plugin->get_component( 'media' ); @@ -78,6 +79,7 @@ public function __construct( Plugin $plugin ) { * Setup early needed hooks. */ protected function setup_hooks() { + add_filter( 'cloudinary_filter_out_local', '__return_false' ); add_action( 'update_option_cloudinary_media_display', array( $this, 'clear_cache' ) ); add_filter( 'cloudinary_current_post_id', array( $this, 'get_current_post_id' ) ); @@ -94,6 +96,7 @@ protected function setup_hooks() { * Clear cached meta. */ public function clear_cache() { + delete_post_meta_by_key( self::META_CACHE_KEY ); } @@ -105,6 +108,7 @@ public function clear_cache() { * @return string */ public function add_post_id( $content ) { + return str_replace( array( 'wp-image-', @@ -124,6 +128,7 @@ public function add_post_id( $content ) { * @return int|null */ public function get_current_post_id() { + return $this->current_post_id ? $this->current_post_id : null; } @@ -131,6 +136,7 @@ public function get_current_post_id() { * Setup component. */ public function setup() { + $this->filter = $this->media->filter; $this->sync = $this->media->sync; @@ -150,6 +156,7 @@ public function setup() { * @return string */ public function process_featured_image( $html, $post_id, $attachment_id ) { + // Get tag element. $tag_element = $this->parse_element( $html ); $tag_element['atts']['class'][] = 'wp-image-' . $attachment_id; @@ -168,6 +175,7 @@ public function process_featured_image( $html, $post_id, $attachment_id ) { * @param int $post_id The post ID to remove cache from. */ public function remove_replace_cache( $post_id ) { + delete_post_meta( $post_id, self::META_CACHE_KEY ); } @@ -179,6 +187,7 @@ public function remove_replace_cache( $post_id ) { * @return array */ public function get_attachment_size_urls( $attachment_id ) { + $urls = array(); $meta = wp_get_attachment_metadata( $attachment_id ); $baseurl = wp_get_attachment_url( $attachment_id ); @@ -208,6 +217,7 @@ public function get_attachment_size_urls( $attachment_id ) { * @return array */ public function find_attachment_size_urls( $urls ) { + global $wpdb; $dirs = wp_get_upload_dir(); $search = array(); @@ -254,6 +264,7 @@ public function find_attachment_size_urls( $urls ) { * @return array */ public function convert_tags( $content ) { + if ( is_singular() ) { $cache_key = self::META_CACHE_KEY; $has_cache = get_post_meta( get_the_ID(), $cache_key, true ); @@ -306,22 +317,26 @@ public function convert_tags( $content ) { * @return string */ public function rebuild_tag( $element, $attachment_id ) { + // Add our filter if not already added. if ( ! has_filter( 'wp_calculate_image_srcset', array( $this->media, 'image_srcset' ) ) ) { add_filter( 'wp_calculate_image_srcset', array( $this->media, 'image_srcset' ), 10, 5 ); } + $overwrite = (bool) strpos( $element, 'cld-overwrite' ); + + // Add new srcset. + $element = str_replace( 'srcsert=', 'old-srcset=', $element ); + $element = str_replace( 'sizes=', 'old-sizes=', $element ); + $element = $this->media->apply_srcset( $element, $attachment_id, $overwrite ); // Get tag element. $tag_element = $this->parse_element( $element ); // Remove the old srcset if it has one. - if ( isset( $tag_element['atts']['srcset'] ) ) { - unset( $tag_element['atts']['srcset'] ); + if ( isset( $tag_element['atts']['old-srcset'] ) ) { + unset( $tag_element['atts']['old-srcset'], $tag_element['atts']['old-sizes'] ); } - // Get overwrite flag. - $overwrite = in_array( 'cld-overwrite', $tag_element['atts']['class'], true ); - // Get size. $size = $this->get_size_from_atts( $tag_element['atts'] ); @@ -331,11 +346,21 @@ public function rebuild_tag( $element, $attachment_id ) { // Create new src url. $tag_element['atts']['src'] = $this->media->cloudinary_url( $attachment_id, $size, $transformations, null, $overwrite ); + /** + * Filter the tag element. + * + * @param array $tag_element The tag and element array.. + * @param int $attachment_id The attachment ID. + * @param string $element The original html tag. + * + * @return array + */ + $tag_element = apply_filters( 'cloudinary_pre_image_tag', $tag_element, $attachment_id, $element ); + // Setup new tag. $replace = HTML::build_tag( $tag_element['tag'], $tag_element['atts'] ); - // Add new srcset. - return $this->media->apply_srcset( $replace, $attachment_id, $overwrite ); + return $replace; } /** @@ -346,6 +371,7 @@ public function rebuild_tag( $element, $attachment_id ) { * @return array */ public function parse_element( $element ) { + // Cleanup element. $element = trim( $element, '' ); @@ -370,6 +396,7 @@ public function parse_element( $element ) { * @return array */ protected function get_size_from_atts( $atts ) { + $size = array(); if ( ! empty( $atts['width'] ) ) { $size[] = $atts['width']; @@ -389,6 +416,7 @@ protected function get_size_from_atts( $atts ) { * @return array|null */ protected function get_transformations_maybe( $url ) { + $transformations = null; $query = wp_parse_url( $url, PHP_URL_QUERY ); if ( ! empty( $query ) && false !== strpos( $query, 'cld_params' ) ) { @@ -407,11 +435,12 @@ protected function get_transformations_maybe( $url ) { * @param string $content The HTML to catch URLS from. */ public function catch_urls( $content ) { + $known = $this->convert_tags( $content ); $urls = wp_extract_urls( $content ); $dirs = wp_get_upload_dir(); $urls = array_map( - function ( $url ) use ( $dirs ) { + function( $url ) use ( $dirs ) { if ( false === strpos( $url, $dirs['baseurl'] ) ) { return null; diff --git a/php/class-responsive-breakpoints.php b/php/class-responsive-breakpoints.php index b721547b9..df02922ff 100644 --- a/php/class-responsive-breakpoints.php +++ b/php/class-responsive-breakpoints.php @@ -9,6 +9,7 @@ use Cloudinary\Component\Assets; use Cloudinary\Component\Setup; +use Cloudinary\Connect\Api; /** * Class Responsive_Breakpoints @@ -67,39 +68,11 @@ class Responsive_Breakpoints implements Setup, Assets { * @param Plugin $plugin Instance of the plugin. */ public function __construct( Plugin $plugin ) { + $this->plugin = $plugin; $this->media = $plugin->get_component( 'media' ); } - /** - * Filter the URL components. - * - * @param array $url_parts The components. - * - * @return array|object|string - */ - public function filter_url_parts( $url_parts ) { - if ( false === $this->doing_responsive ) { - return $url_parts; - } - $default = array( - 'path' => '', - 'size' => array(), - 'transformations' => array(), - 'placeholder' => '--placehold--', - 'version' => '', - 'public_id' => '', - 'seo_string' => '', - 'file_extension' => '', - ); - $breakpoints = $this->media->get_settings()->get_value( 'enable_breakpoints' ); - if ( 'on' === $breakpoints ) { - $url_parts['size'] = '--size--'; - } - - return wp_parse_args( $url_parts, $default ); - } - /** * Get the placeholder generation transformations. * @@ -108,6 +81,7 @@ public function filter_url_parts( $url_parts ) { * @return array */ public function get_placeholder_transformations( $placeholder ) { + $transformations = array( 'predominant' => array( array( @@ -176,26 +150,34 @@ public function add_features( $tag_element, $attachment_id, $original_tag ) { $meta = wp_get_attachment_metadata( $attachment_id, true ); $format = $this->media->get_settings()->get_value( 'image_format' ); - if ( isset( $tag_element['atts']['srcset'] ) ) { - unset( $tag_element['atts']['srcset'] ); - } - $this->doing_responsive = true; - $tag_element['atts']['data-src'] = $tag_element['atts']['src']; - $breakpoints = $this->media->get_settings()->get_value( 'enable_breakpoints' ); + + $src = $tag_element['atts']['src']; + $transformations = $this->media->get_transformations_from_string( $src ); + $placehold_transformations = $transformations; + $original_string = Api::generate_transformation_string( $transformations ); + $breakpoints = $this->media->get_settings()->get_value( 'enable_breakpoints' ); if ( 'on' === $breakpoints ) { - $tag_element['atts']['data-src'] = $this->media->cloudinary_url( $attachment_id, array( 1 ) ); + // Check if first is a size. + if ( isset( $transformations[0] ) && isset( $transformations[0]['width'] ) || isset( $transformations[0]['height'] ) ) { + // remove the size. + array_shift( $transformations ); + } + $size_str = '--size--/' . Api::generate_transformation_string( $transformations ); + $data_url = str_replace( $original_string, $size_str, $src ); + $tag_element['atts']['data-src'] = $data_url; + if ( isset( $tag_element['atts']['srcset'] ) ) { + unset( $tag_element['atts']['srcset'], $tag_element['atts']['sizes'] ); + } } - $this->doing_responsive = false; // placeholder. if ( 'off' !== $settings['lazy_placeholder'] ) { - $placeholder = $this->media->cloudinary_url( - $attachment_id, - 'medium', - array( 'asset' => $this->get_placeholder_transformations( $settings['lazy_placeholder'] ) ), - null, - true - ); + // Remove the optimize (last) transformation. + array_pop( $placehold_transformations ); + $placehold_transformations = array_merge( $placehold_transformations, $this->get_placeholder_transformations( $settings['lazy_placeholder'] ) ); + $palcehold_str = Api::generate_transformation_string( $placehold_transformations ); + $placeholder = str_replace( $original_string, $palcehold_str, $src ); + $tag_element['atts']['src'] = $placeholder; if ( ! empty( $settings['lazy_preloader'] ) ) { $tag_element['atts']['data-placeholder'] = $placeholder; @@ -209,7 +191,6 @@ public function add_features( $tag_element, $attachment_id, $original_tag ) { } unset( $tag_element['atts']['loading'] ); - $this->doing_responsive = false; $tag_element['atts']['decoding'] = 'async'; $tag_element['atts']['data-width'] = $meta['width']; @@ -222,6 +203,7 @@ public function add_features( $tag_element, $attachment_id, $original_tag ) { * @return bool */ public function is_active() { + return ! is_admin(); } @@ -229,6 +211,7 @@ public function is_active() { * Register assets to be used for the class. */ public function register_assets() { + wp_register_script( 'cld-responsive-breakpoints', $this->plugin->dir_url . 'js/responsive-breakpoints.js', null, $this->plugin->version, false ); if ( ! is_admin() ) { $this->enqueue_assets(); @@ -239,6 +222,7 @@ public function register_assets() { * Enqueue Assets */ public function enqueue_assets() { + wp_enqueue_script( 'cld-responsive-breakpoints' ); $breakpoints = $this->media->get_settings()->get_value( 'image_display' ); wp_add_inline_script( 'cld-responsive-breakpoints', 'var CLDLB = ' . wp_json_encode( $breakpoints ), 'before' ); @@ -248,12 +232,12 @@ public function enqueue_assets() { * Setup the class. */ public function setup() { + $this->register_settings(); if ( ! is_admin() ) { $settings = $this->settings->get_value(); if ( isset( $settings['use_lazy_loading'] ) && 'on' === $settings['use_lazy_loading'] ) { add_filter( 'cloudinary_pre_image_tag', array( $this, 'add_features' ), 10, 3 ); - add_filter( 'cloudinary_url_parts', array( $this, 'filter_url_parts' ) ); } } } @@ -348,6 +332,5 @@ protected function register_settings() { $bk = $media_settings->get_setting( 'breakpoints' ); $bk->set_param( 'condition', $condition ); $bk->rebuild_component(); - } } diff --git a/php/media/class-asset.php b/php/media/class-asset.php deleted file mode 100644 index fd8bd1ff4..000000000 --- a/php/media/class-asset.php +++ /dev/null @@ -1,295 +0,0 @@ - 'https', - 'host' => null, - 'cloudname' => null, - 'resource_type' => null, - 'delivery' => null, - 'size' => null, - 'transformations' => array( - 'asset' => array(), - 'taxonomy' => array(), - 'global' => array(), - 'optimizations' => array(), - ), - 'version' => 'v1', - 'public_id' => null, - 'seo' => null, - 'extension' => null, - ); - - /** - * Asset constructor. - * - * @param int $attachment_id The attachment ID. - * @param array|null $meta The post meta. - */ - public function __construct( $attachment_id, $meta = null ) { - $this->attachment_id = $attachment_id; - $this->init( $meta ); - $this->synced(); - $this->set_post_context(); - } - - /** - * Init an asset. - * - * @param null|array $meta The post meta to init the asset with. - */ - protected function init( $meta = null ) { - if ( ! $meta ) { - $meta = wp_get_attachment_metadata( $this->attachment_id, true ); - } - if ( ! empty( $meta['sizes'] ) ) { - $this->current_size = 'full'; - $this->full_size['width'] = ! empty( $meta['width'] ) ? $meta['width'] : $meta['sizes']['full']['width']; - $this->full_size['height'] = ! empty( $meta['height'] ) ? $meta['height'] : $meta['sizes']['full']['height']; - foreach ( $meta['sizes'] as $size => $data ) { - $this->files[ $size ] = $data['file']; - $this->sizes[ $size ] = array( - 'width' => $data['width'], - 'height' => $data['height'], - ); - if ( ! $this->matches_ratio( $data['width'], $data['height'] ) ) { - $this->sizes[ $size ]['crop'] = 'fill'; - } - } - } - } - - /** - * Checks if a size matches the original size. - * - * @param int $width The Width to check. - * @param int $height the Height to check. - * - * @return bool - */ - public function matches_ratio( $width, $height ) { - $matches = false; - if ( ! empty( $this->full_size ) ) { - $matches = wp_image_matches_ratio( - // PDFs do not always have width and height, but they do have full sizes. - // This is important for the thumbnail crops on the media library. - $this->full_size['width'], - $this->full_size['height'], - $width, - $height - ); - } - - return $matches; - } - - /** - * Set the objects size. - * - * @param null|string|array $size The size to set. - */ - public function set_size( $size = null ) { - $set_size = $this->full_size; - $this->parts['seo'] = null; - if ( isset( $this->sizes[ $size ] ) ) { - $set_size = $this->sizes[ $size ]; - $this->parts['seo'] = $this->files[ $size ]; - } elseif ( is_array( $size ) ) { - $clean = array_filter( $size, 'is_numeric' ); - $set_size['width'] = array_shift( $clean ); - if ( ! empty( $clean ) ) { - $set_size['height'] = array_shift( $clean ); - if ( ! $this->matches_ratio( $set_size['width'], $set_size['height'] ) ) { - $set_size['crop'] = 'fill'; - } - } - } - - $this->parts['size'] = $set_size; - } - - /** - * Get the assets ID. - * - * @return int - */ - public function get_id() { - return $this->attachment_id; - } - - /** - * Checks if synced. - * - * @param bool $recheck Flag to signal a recheck. - * - * @return bool - */ - public function synced( $recheck = false ) { - if ( is_null( $this->synced ) || true === $recheck ) { - $this->synced = get_plugin_instance()->get_component( 'sync' )->is_synced( $this->attachment_id ); - } - - return $this->synced; - } - - /** - * Magic method to set the Parts, which can be larger as needed.. - * - * @param string $name The key to set. - * @param mixed $value The value to set. - */ - public function __set( $name, $value ) { - $this->parts[ $name ] = $value; - } - - /** - * Set transformations. - * - * @param string $type The type to set. - * @param array $value The transformation array to set. - */ - public function set_transformation( $type, $value ) { - $this->parts['transformations'][ $type ] = $value; - } - - /** - * Clear a transformation set. - * - * @param string $type The key to clear. - */ - public function clear_transformation( $type ) { - $this->set_transformation( $type, array() ); - } - - /** - * Sets the post id. - * - * @param null|int $post_context_id The post ID. - */ - public function set_post_context( $post_context_id = null ) { - if ( is_null( $post_context_id ) ) { - $post_context = get_post(); - if ( $post_context ) { - $post_context_id = $post_context->ID; - } - } - - if ( $post_context_id && $post_context_id !== $this->current_post_id ) { - $globals = Cloudinary_URL::get_instance()->get_post_globals( $post_context_id ); - if ( ! empty( $globals['taxonomy'] ) ) { - $this->set_transformation( 'taxonomy', $globals['taxonomy'] ); - if ( true === $globals['taxonomy_overwrite'] ) { - $this->clear_transformation( 'global' ); - } - } - $this->current_post_id = $post_context_id; - } - } - - /** - * Get the assets local URL. - * - * @return false|string - */ - public function get_local_url() { - if ( 'image' === $this->parts['resource_type'] ) { - $url = wp_get_attachment_image_url( $this->attachment_id, $this->current_size ); - } else { - $url = wp_get_attachment_url( $this->attachment_id ); - } - - return $url; - } - - /** - * Render the cloudinary URL. - * - * @return false|string - */ - public function render() { - if ( ! $this->synced ) { - return $this->get_local_url(); - } - $parts = $this->parts; - $parts['scheme'] .= ':/'; - if ( ! empty( $parts['seo'] ) ) { - $parts['resource_type'] = 'images'; - $parts['public_id'] = strtok( $parts['public_id'], '.' ); - unset( $parts['delivery'] ); - } - $parts = array_filter( $parts ); - - return Cloudinary_URL::generate_transformation_string( $parts ); - } -} diff --git a/php/media/class-cloudinary-url.php b/php/media/class-cloudinary-url.php deleted file mode 100644 index 7b9fcc50b..000000000 --- a/php/media/class-cloudinary-url.php +++ /dev/null @@ -1,498 +0,0 @@ - array( - 'a' => 'angle', - 'ar' => 'aspect_ratio', - 'b' => 'background', - 'bo' => 'border', - 'c' => 'crop', - 'co' => 'color', - 'dpr' => 'dpr', - 'du' => 'duration', - 'e' => 'effect', - 'eo' => 'end_offset', - 'fl' => 'flags', - 'h' => 'height', - 'l' => 'overlay', - 'o' => 'opacity', - 'q' => 'quality', - 'r' => 'radius', - 'so' => 'start_offset', - 't' => 'named_transformation', - 'u' => 'underlay', - 'vc' => 'video_codec', - 'w' => 'width', - 'x' => 'x', - 'y' => 'y', - 'z' => 'zoom', - 'ac' => 'audio_codec', - 'af' => 'audio_frequency', - 'br' => 'bit_rate', - 'cs' => 'color_space', - 'd' => 'default_image', - 'dl' => 'delay', - 'dn' => 'density', - 'f' => 'fetch_format', - 'g' => 'gravity', - 'p' => 'prefix', - 'pg' => 'page', - 'sp' => 'streaming_profile', - 'vs' => 'video_sampling', - 'if' => 'if', - ), - 'video' => array( - 'w' => 'width', - 'h' => 'height', - 'c' => 'crop', - 'ar' => 'aspect_ratio', - 'g' => 'gravity', - 'b' => 'background', - 'e' => 'effect', - 'l' => 'overlay', - 'so' => 'start_offset', - 'eo' => 'end_offset', - 'du' => 'duration', - 'a' => 'angle', - 'vs' => 'video_sampling', - 'dl' => 'delay', - 'vc' => 'video_codec', - 'fps' => 'fps', - 'dpr' => 'dpr', - 'br' => 'bit_rate', - 'ki' => 'keyframe_interval', - 'sp' => 'streaming_profile', - 'ac' => 'audio_codec', - 'af' => 'audio_frequency', - 'fl' => 'flags', - 'f' => 'fetch_format', - 'q' => 'quality', - 'if' => 'if', - ), - ); - - /** - * Holds the base URLS for each media type. - * - * @var array - */ - protected $base_urls = array(); - - /** - * Holds the base media types. - * - * @var array - */ - protected $media_types = array( - 'image', - 'video', - ); - - /** - * Holds the posts globals. - * - * @var array - */ - protected $posts = array(); - - /** - * Holds requested assets. - * - * @var Asset[] - */ - protected $assets = array(); - - /** - * Holds all the local urls for requested assets. - * - * @var array - */ - protected $local_urls = array(); - - /** - * Holds the current post ID. - * - * @var int - */ - protected $current_post_id; - - /** - * Filter constructor. - * - * @param Media $media The plugin. - */ - public function __construct( Media $media ) { - $this->media = $media; - $this->credentials = $media->credentials; - add_action( 'the_post', array( $this, 'capture_post_transformations' ) ); - add_filter( 'wp_get_attachment_metadata', array( $this, 'meta_asset' ), 10, 2 ); - } - - /** - * Get the single instance. - * - * @return Cloudinary_URL - */ - public static function get_instance() { - if ( ! self::$instance ) { - $media = get_plugin_instance()->get_component( 'media' ); - self::$instance = new self( $media ); - } - - return self::$instance; - } - - /** - * Catch an asset via the meta filter. - * - * @param array $meta The metadata. - * @param int $attachment_id The attachement id. - * - * @return array - */ - public function meta_asset( $meta, $attachment_id ) { - - if ( ! isset( $this->assets[ $attachment_id ] ) ) { - $this->assets[ $attachment_id ] = new Asset( $attachment_id, $meta ); - $this->init_asset( $attachment_id ); - $this->assets[ $attachment_id ]->set_post_context( $this->current_post_id ); - - $local_url = wp_get_attachment_url( $attachment_id ); - $this->local_urls[ $local_url ]['attachment_id'] = $attachment_id; - $this->local_urls[ $local_url ]['cloudinary_url'] = $this->assets[ $attachment_id ]->render(); - if ( $meta['sizes'] ) { - foreach ( $meta['sizes'] as $size => $data ) { - $sized = wp_get_attachment_image_url( $attachment_id, $size ); - $this->assets[ $attachment_id ]->set_size( $size ); - $this->local_urls[ $sized ] = array( - 'attachment_id' => $attachment_id, - 'size' => $size, - 'cloudinary_url' => $this->assets[ $attachment_id ]->render(), - ); - } - } - } - - return $meta; - } - - /** - * Get the globals at a post level. - * - * @param int $post_id The post ID. - * - * @return array - */ - public function get_post_globals( $post_id ) { - $return = array(); - if ( isset( $this->posts[ $post_id ] ) ) { - $return = $this->posts[ $post_id ]; - } - - return $return; - } - - /** - * Get an asset by URL. - * - * @param string $url The url to get asset for. - * - * @return null|Asset - */ - public function get_asset_by_url( $url ) { - $asset = null; - if ( isset( $this->local_urls[ $url ] ) ) { - $attachment_id = $this->local_urls[ $url ]['attachment_id']; - $asset = $this->get_asset( $attachment_id ); - if ( ! empty( $this->local_urls[ $url ]['size'] ) ) { - $asset->set_size( $this->local_urls[ $url ]['size'] ); - } - } - - return $asset; - } - - /** - * Get all url pairs. - * - * @return array - */ - public function get_url_pairs() { - return array_map( - function ( $item ) { - return $item['cloudinary_url']; - }, - $this->local_urls - ); - } - - /** - * Capture globals for a post. - * - * @param WP_Post $post The post. - */ - public function capture_post_transformations( $post ) { - $this->current_post_id = $post->ID; - if ( $post && ! isset( $this->posts[ $post->ID ] ) ) { - foreach ( $this->media_types as $type ) { - $this->posts[ $post->ID ]['taxonomy'][ $type ] = $this->media->global_transformations->get_taxonomy_transformations( $type ); - $this->posts[ $post->ID ]['taxonomy_overwrite'] = $this->media->global_transformations->is_taxonomy_overwrite(); - } - } - } - - /** - * Get an asset by ID. - * - * @param int $attachment_id The attachment ID. - * @param string|array|null $size The optional size. - * - * @return Asset - */ - public function get_asset( $attachment_id, $size = null ) { - if ( ! isset( $this->assets[ $attachment_id ] ) ) { - $this->assets[ $attachment_id ] = new Asset( $attachment_id ); - $this->init_asset( $attachment_id ); - } - $asset = $this->assets[ $attachment_id ]; - $asset->set_size( $size ); - - return $this->assets[ $attachment_id ]; - } - - /** - * Get all assets. - * - * @return Asset[] - */ - public function get_assets() { - return $this->assets; - } - - /** - * Init the base urls. - */ - protected function init_base_urls() { - - /** - * Filter the base Media Types. - * - * @param array $default The default media types array. - * - * @return array - */ - $base_types = apply_filters( 'cloudinary_base_media_types', $this->media_types ); - foreach ( $base_types as $type ) { - $this->base_urls[ $type ] = $this->url( $type ); - } - } - - /** - * Return an endpoint for a specific resource type. - * - * @param string $resource The resource type for the endpoint. - * @param string $delivery The delivery type. - * - * @return array - */ - protected function url( $resource, $delivery = 'upload' ) { - $globals = apply_filters( "cloudinary_default_freeform_transformations_{$resource}", array(), array() ); - $global_transformations = array(); - foreach ( $globals as $global ) { - $global_transformations = array_merge( $global_transformations, self::get_transformations_from_string( $global, $resource ) ); - } - $parts = array( - 'scheme' => 'https', - 'host' => $this->asset_url, - 'cloudname' => isset( $this->credentials['cname'] ) ? $this->credentials['cname'] : $this->credentials['cloud_name'], - 'resource_type' => $resource, - 'delivery' => $delivery, - 'transformations' => array( - 'asset' => array(), - 'taxonomy' => array(), - 'global' => $global_transformations, - 'optimizations' => apply_filters( "cloudinary_default_qf_transformations_{$resource}", array(), array() ), - ), - - ); - - return $parts; - } - - /** - * Generate a transformation set. - * - * @param array $options The transformation options to generate from. - * @param string $type The asset Type. - * - * @return string - */ - protected static function build_transformation_set( array $options, $type = 'image' ) { - if ( ! isset( self::$transformation_index[ $type ] ) ) { - return ''; - } - $transformation_index = array_flip( self::$transformation_index[ $type ] ); - $transformations = array(); - - foreach ( $options as $key => $value ) { - if ( isset( $transformation_index[ $key ] ) ) { - $transformations[] = $transformation_index[ $key ] . '_' . $value; - } elseif ( ! is_numeric( $key ) && '$' === $key[0] ) { - $transformations[] = $key . '_' . $value; - } - } - // Clear out empty parts. - $transformations = array_filter( $transformations ); - - return implode( ',', $transformations ); - } - - /** - * Generate a transformation string made up of slash separated transformation sets. - * - * @param array $options The transformation options to generate from. - * @param string $type The asset Type. - * - * @return string - */ - public static function generate_transformation_string( array $options, $type = 'image' ) { - if ( ! isset( self::$transformation_index[ $type ] ) ) { - return ''; - } - $transformations = array(); - foreach ( $options as $index => $option ) { - if ( is_string( $option ) ) { - $transformations[] = $option; - continue; - } - if ( is_array( $option ) && ! empty( $option ) ) { - $depth = Utils::array_depth( $option ); - if ( 0 === $depth ) { - $transformations[] = self::build_transformation_set( $option, $type ); - } else { - $transformations[] = self::generate_transformation_string( $option, $type ); - } - } - // Clear out empty parts. - $transformations = array_filter( $transformations ); - } - - return implode( '/', $transformations ); - } - - /** - * Convert a url param based transformation string into an array. - * - * @param string $str The transformation string. - * @param string $type The type of transformation string. - * - * @return array The array of found transformations within the string. - */ - public static function get_transformations_from_string( $str, $type = 'image' ) { - - $params = self::$transformation_index[ $type ]; - - $transformation_chains = explode( '/', $str ); - $transformations = array(); - foreach ( $transformation_chains as $index => $chain ) { - $items = explode( ',', $chain ); - foreach ( $items as $item ) { - $item = trim( $item ); - foreach ( $params as $param => $type ) { - if ( substr( $item, 0, strlen( $param ) + 1 ) === $param . '_' ) { - $transformations[ $index ][ $type ] = substr( $item, strlen( $param ) + 1 ); - } - } - } - } - - return array_values( $transformations ); // Reset the keys. - } - - /** - * Get the cloudinary URL for an attachment. - * - * @param int $attachment_id The attachment ID. - * - * @return void - */ - protected function init_asset( $attachment_id ) { - if ( empty( $this->base_urls ) ) { - $this->init_base_urls(); - } - - $type = $this->media->get_resource_type( $attachment_id ); - if ( ! isset( $this->base_urls[ $type ] ) || ! isset( $this->assets[ $attachment_id ] ) ) { - return; - } - - foreach ( $this->base_urls[ $type ] as $key => $value ) { - $this->assets[ $attachment_id ]->{$key} = $value; - } - $this->assets[ $attachment_id ]->version = 'v' . $this->media->get_post_meta( $attachment_id, Sync::META_KEYS['version'], true ); - $this->assets[ $attachment_id ]->public_id = $this->media->cloudinary_id( $attachment_id ); - $this->assets[ $attachment_id ]->set_transformation( 'asset', $this->media->get_transformation_from_meta( $attachment_id ) ); - } -} From 5ee314426cbc1fc3b39c21893027198c5f5f05c8 Mon Sep 17 00:00:00 2001 From: David Cramer Date: Fri, 2 Jul 2021 06:44:39 +0200 Subject: [PATCH 17/56] fix formatting --- js/src/responsive-breakpoints.js | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/js/src/responsive-breakpoints.js b/js/src/responsive-breakpoints.js index 4f7d4779a..f45fd872a 100644 --- a/js/src/responsive-breakpoints.js +++ b/js/src/responsive-breakpoints.js @@ -56,11 +56,13 @@ const ResponsiveBreakpoints = { this.config.bytes_step ); const rect = image.getBoundingClientRect(); - const diff = window.innerHeight + parseInt( this.config.lazy_threshold, 10 ); + const diff = + window.innerHeight + parseInt( this.config.lazy_threshold, 10 ); return ( ! image.cld_loaded && rect.top < diff * 2 && - ( width > image.naturalWidth / this.density || ! image.cld_placehold ) + ( width > image.naturalWidth / this.density || + ! image.cld_placehold ) ); }, getResponsiveSteps( image ) { @@ -77,7 +79,7 @@ const ResponsiveBreakpoints = { navigator && navigator.connection ? navigator.connection.effectiveType : 'none' - ) { + ) { case 'none': break; case '4g': @@ -101,8 +103,7 @@ const ResponsiveBreakpoints = { let scaledSize = original - responsiveStep * diff; if ( scaledSize > original ) { scaledSize = original; - } - else if ( this.config.max_width < scaledSize ) { + } else if ( this.config.max_width < scaledSize ) { scaledSize = original; } return scaledSize; @@ -110,8 +111,7 @@ const ResponsiveBreakpoints = { buildSize( image ) { if ( this._shouldRebuild( image ) ) { image.src = this.getSizeURL( image ); - } - else if ( this._shouldPlacehold( image ) ) { + } else if ( this._shouldPlacehold( image ) ) { image.src = this.getPlaceholderURL( image ); } }, @@ -128,14 +128,15 @@ const ResponsiveBreakpoints = { this.config.bytes_step ); const newSize = 'w_' + width + ',dpr_' + this.density; - return image.dataset.src.replace( '--size--', newSize ) - .replace( '/--placehold--', '' ) - .replace( 'q_auto', this.getQuality() ); + return image.dataset.src + .replace( '--size--', newSize ) + .replace( '/--placehold--', '' ) + .replace( 'q_auto', this.getQuality() ); }, getPlaceholderURL( image ) { image.cld_placehold = true; return image.dataset.placeholder; - } + }, }; // Init. window.addEventListener( 'load', () => { From ef04fbf0abb9b0d2b54bf31918acd7edcb04b83d Mon Sep 17 00:00:00 2001 From: David Cramer Date: Wed, 7 Jul 2021 12:13:28 +0200 Subject: [PATCH 18/56] add dpr and q_auto to js src --- js/responsive-breakpoints.asset.php | 2 +- js/responsive-breakpoints.js | 2 +- js/src/responsive-breakpoints.js | 22 +++++++++++++++++----- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/js/responsive-breakpoints.asset.php b/js/responsive-breakpoints.asset.php index 6bd267203..45d388a08 100644 --- a/js/responsive-breakpoints.asset.php +++ b/js/responsive-breakpoints.asset.php @@ -1 +1 @@ - array('wp-polyfill'), 'version' => 'f521a16b27c948915bdd8d8de9428134'); \ No newline at end of file + array('wp-polyfill'), 'version' => '38460ca7b7c06420b515c0e8a7342d49'); \ No newline at end of file diff --git a/js/responsive-breakpoints.js b/js/responsive-breakpoints.js index dc0b28bf5..b06ebfb6a 100644 --- a/js/responsive-breakpoints.js +++ b/js/responsive-breakpoints.js @@ -1 +1 @@ -!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);ne.naturalWidth/this.density||!e.cld_loaded)},_shouldPlacehold:function(e){var t=this.scaleSize(e.originalWidth,e.width,this.config.bytes_step),n=e.getBoundingClientRect(),o=window.innerHeight+parseInt(this.config.lazy_threshold,10);return!e.cld_loaded&&n.top<2*o&&(t>e.naturalWidth/this.density||!e.cld_placehold)},getResponsiveSteps:function(e){return Math.ceil(e.dataset.breakpoints?e.originalWidth/e.dataset.breakpoints:this.responsiveStep)},getQuality:function(){var e="q_auto";switch(navigator&&navigator.connection?navigator.connection.effectiveType:"none"){case"none":break;case"4g":e="q_auto:good";break;case"3g":e="q_auto:eco";break;case"2g":case"slow-2g":e="q_auto:low";break;default:e="q_auto:best"}return e},scaleSize:function(e,t,n){var o=e-n*Math.floor((e-t)/n);return(o>e||this.config.max_widthe.length)&&(t=e.length);for(var n=0,i=new Array(t);nMath.ceil(e)?e:t),t},_build:function(){var e=this;this.images.forEach((function(t){e.buildSize(t)}))},_shouldRebuild:function(e){var t=this.scaleSize(e.originalWidth,e.width,this.config.bytes_step),n=e.getBoundingClientRect(),i="auto"!==this.density?this._getDensity():1,o=window.innerHeight+parseInt(this.config.lazy_threshold,10);return n.tope.naturalWidth/i||!e.cld_loaded)},_shouldPlacehold:function(e){var t=this.scaleSize(e.originalWidth,e.width,this.config.bytes_step),n=e.getBoundingClientRect(),i="auto"!==this.density?this._getDensity():1,o=window.innerHeight+parseInt(this.config.lazy_threshold,10);return!e.cld_loaded&&n.top<2*o&&(t>e.naturalWidth/i||!e.cld_placehold)},getResponsiveSteps:function(e){return Math.ceil(e.dataset.breakpoints?e.originalWidth/e.dataset.breakpoints:this.responsiveStep)},getQuality:function(){var e="q_auto";switch(navigator&&navigator.connection?navigator.connection.effectiveType:"none"){case"none":break;case"4g":e="q_auto:good";break;case"3g":e="q_auto:eco";break;case"2g":case"slow-2g":e="q_auto:low";break;default:e="q_auto:best"}return e},scaleSize:function(e,t,n){var i=e-n*Math.floor((e-t)/n);return(i>e||this.config.max_width Math.ceil( maxDensity ) + ? maxDensity + : deviceDensity; + } + return deviceDensity; + }, _build() { this.images.forEach( ( image ) => { this.buildSize( image ); @@ -42,11 +53,12 @@ const ResponsiveBreakpoints = { this.config.bytes_step ); const rect = image.getBoundingClientRect(); + const density = 'auto' !== this.density ? this._getDensity() : 1; const diff = window.innerHeight + parseInt( this.config.lazy_threshold, 10 ); return ( rect.top < diff && - ( width > image.naturalWidth / this.density || ! image.cld_loaded ) + ( width > image.naturalWidth / density || ! image.cld_loaded ) ); }, _shouldPlacehold( image ) { @@ -56,13 +68,13 @@ const ResponsiveBreakpoints = { this.config.bytes_step ); const rect = image.getBoundingClientRect(); + const density = 'auto' !== this.density ? this._getDensity() : 1; const diff = window.innerHeight + parseInt( this.config.lazy_threshold, 10 ); return ( ! image.cld_loaded && rect.top < diff * 2 && - ( width > image.naturalWidth / this.density || - ! image.cld_placehold ) + ( width > image.naturalWidth / density || ! image.cld_placehold ) ); }, getResponsiveSteps( image ) { @@ -127,11 +139,11 @@ const ResponsiveBreakpoints = { image.width, this.config.bytes_step ); - const newSize = 'w_' + width + ',dpr_' + this.density; + const newSize = 'w_' + width + ',dpr_' + this._getDensity(); return image.dataset.src .replace( '--size--', newSize ) .replace( '/--placehold--', '' ) - .replace( 'q_auto', this.getQuality() ); + .replace( /q_auto(?!:)/gi, this.getQuality() ); }, getPlaceholderURL( image ) { image.cld_placehold = true; From 9de64bc412a2e0dbdd7742def0d46bf71092810c Mon Sep 17 00:00:00 2001 From: David Cramer Date: Wed, 7 Jul 2021 12:16:00 +0200 Subject: [PATCH 19/56] separate classes and update beta --- php/class-beta.php | 10 +- php/class-lazy-load.php | 297 +++++++++++++++++++++++++++ php/class-responsive-breakpoints.php | 252 ++++++----------------- ui-definitions/settings-image.php | 7 +- 4 files changed, 375 insertions(+), 191 deletions(-) create mode 100644 php/class-lazy-load.php diff --git a/php/class-beta.php b/php/class-beta.php index 578f1351d..f49eb7801 100644 --- a/php/class-beta.php +++ b/php/class-beta.php @@ -41,8 +41,8 @@ public function __construct( Plugin $plugin ) { 'options' => array(), ), 'responsive_breakpoints' => array( - 'class' => 'Cloudinary\Responsive_Breakpoints', - 'name' => __( 'New Responsive Breakpoints', 'cloudinary' ), + 'class' => array( 'Cloudinary\Lazy_Load', 'Cloudinary\Responsive_Breakpoints' ), + 'name' => __( 'New Lazy Load and Responsive Breakpoints', 'cloudinary' ), 'options' => array(), 'deps' => array( 'delivery' ), ), @@ -67,7 +67,11 @@ public function __construct( Plugin $plugin ) { * @return {bool} */ if ( apply_filters( 'cloudinary_beta', false, $key, $data ) ) { - $this->plugin->components[ $key ] = new $data['class']( $this->plugin ); + foreach ( (array) $data['class'] as $class ) { + $namespace = explode( '\\', $class ); + $name = strtolower( array_pop( $namespace ) ); + $this->plugin->components[ $name ] = new $class( $this->plugin ); + } } } } diff --git a/php/class-lazy-load.php b/php/class-lazy-load.php new file mode 100644 index 000000000..6f4c9e49d --- /dev/null +++ b/php/class-lazy-load.php @@ -0,0 +1,297 @@ +plugin = $plugin; + $this->media = $plugin->get_component( 'media' ); + } + + /** + * Get the placeholder generation transformations. + * + * @param string $placeholder The placeholder to get. + * + * @return array + */ + public function get_placeholder_transformations( $placeholder ) { + + $transformations = array( + 'predominant' => array( + array( + '$currWidth' => 'w', + '$currHeight' => 'h', + ), + array( + 'width' => 'iw_div_2', + 'aspect_ratio' => 1, + 'crop' => 'pad', + 'background' => 'auto', + ), + array( + 'crop' => 'crop', + 'width' => 10, + 'height' => 10, + 'gravity' => 'north_east', + ), + array( + 'width' => '$currWidth', + 'height' => '$currHeight', + 'crop' => 'fill', + ), + array( + 'fetch_format' => 'auto', + 'quality' => 'auto', + ), + ), + 'vectorize' => array( + array( + 'effect' => 'vectorize:3:0.1', + 'fetch_format' => 'svg', + ), + ), + 'blur' => array( + array( + 'effect' => 'blur:2000', + 'quality' => 1, + 'fetch_format' => 'auto', + ), + ), + 'pixelate' => array( + array( + 'effect' => 'pixelate', + 'quality' => 1, + 'fetch_format' => 'auto', + ), + ), + ); + + return $transformations[ $placeholder ]; + } + + /** + * Add features to a tag element set. + * + * @param array $tag_element The tag element set. + * @param int $attachment_id The attachment id. + * @param string $original_tag The original html tag. + * + * @return array + */ + public function add_features( $tag_element, $attachment_id, $original_tag ) { + + $settings = $this->settings->get_value(); + + $meta = wp_get_attachment_metadata( $attachment_id, true ); + $format = $this->media->get_settings()->get_value( 'image_format' ); + + $src = $tag_element['atts']['src']; + if ( ! $this->media->is_cloudinary_url( $src ) ) { + $src = $this->media->cloudinary_url( $attachment_id ); + } + $transformations = $this->media->get_transformations_from_string( $src ); + $placehold_transformations = $transformations; + $original_string = Api::generate_transformation_string( $transformations ); + + // placeholder. + if ( 'off' !== $settings['lazy_placeholder'] ) { + // Remove the optimize (last) transformation. + array_pop( $placehold_transformations ); + $placehold_transformations = array_merge( $placehold_transformations, $this->get_placeholder_transformations( $settings['lazy_placeholder'] ) ); + $palcehold_str = Api::generate_transformation_string( $placehold_transformations ); + $placeholder = str_replace( $original_string, $palcehold_str, $src ); + + $tag_element['atts']['src'] = $placeholder; + if ( ! empty( $settings['lazy_preloader'] ) ) { + $tag_element['atts']['data-placeholder'] = $placeholder; + } + } + + if ( ! empty( $settings['lazy_preloader'] ) ) { + $svg = ''; + $tag_element['atts']['src'] = 'data:image/svg+xml;utf8,' . $svg; + $tag_element['atts']['data-type'] = $format; + } + + unset( $tag_element['atts']['loading'] ); + $tag_element['atts']['decoding'] = 'async'; + $tag_element['atts']['data-width'] = $meta['width']; + + return $tag_element; + } + + /** + * Check if component is active. + * + * @return bool + */ + public function is_active() { + + return ! is_admin(); + } + + /** + * Setup the class. + */ + public function setup() { + + $this->register_settings(); + if ( ! is_admin() ) { + $settings = $this->settings->get_value(); + if ( isset( $settings['use_lazy_loading'] ) && 'on' === $settings['use_lazy_loading'] ) { + add_filter( 'cloudinary_pre_image_tag', array( $this, 'add_features' ), 10, 3 ); + } + } + } + + /** + * Define the settings. + * + * @return array + */ + public function settings() { + + $args = array( + 'type' => 'group', + 'title' => __( 'Lazy Loading', 'cloudinary' ), + 'priority' => 9, + array( + 'type' => 'on_off', + 'description' => __( 'Enable lazy loading', 'cloudinary' ), + 'slug' => 'use_lazy_loading', + 'default' => 'off', + ), + array( + 'type' => 'group', + 'condition' => array( + 'use_lazy_loading' => true, + ), + array( + 'type' => 'number', + 'title' => __( 'Lazy loading threshold', 'cloudinary' ), + 'slug' => 'lazy_threshold', + 'description' => __( ' The threshold', 'cloudinary' ), + 'default' => 1000, + ), + array( + 'type' => 'radio', + 'title' => __( 'Placeholder generation', 'cloudinary' ), + 'slug' => 'lazy_placeholder', + 'description' => __( ' The placeholder', 'cloudinary' ), + 'default' => 'blur', + 'options' => array( + 'blur' => __( 'Blur', 'cloudinary' ), + 'pixelate' => __( 'Pixelate', 'cloudinary' ), + 'vectorize' => __( 'Vectorize', 'cloudinary' ), + 'predominant' => __( 'Dominant Color', 'cloudinary' ), + 'off' => __( 'Off', 'cloudinary' ), + ), + ), + array( + 'type' => 'checkbox', + 'title' => __( 'Initial preloader', 'cloudinary' ), + 'slug' => 'lazy_preloader', + 'description' => __( ' The preloader', 'cloudinary' ), + 'default' => 'on', + 'options' => array( + 'on' => __( 'Use an initial preloader', 'cloudinary' ), + ), + ), + array( + 'type' => 'checkbox', + 'title' => __( 'Use custom preloader', 'cloudinary' ), + 'slug' => 'lazy_custom_preloader', + 'description' => __( ' The custom preloader', 'cloudinary' ), + 'default' => 'on', + 'condition' => array( + 'lazy_preloader' => true, + ), + 'options' => array( + 'on' => __( 'Use a custom preloader', 'cloudinary' ), + ), + ), + ), + ); + + return $args; + } + + /** + * Register the setting under media. + */ + protected function register_settings() { + + // Move setting to media. + $media_settings = $this->media->get_settings()->get_setting( 'image_display' ); + + $settings_params = $this->settings(); + $this->settings = $media_settings->create_setting( $this->settings_slug, $settings_params, $media_settings ); + + $condition = array( + 'use_lazy_loading' => false, + ); + $bk = $media_settings->get_setting( 'breakpoints' ); + $bk->set_param( 'condition', $condition ); + $bk->rebuild_component(); + + $image_breakpoints = $media_settings->get_setting( 'image_breakpoints' ); + $bytes_step = $image_breakpoints->get_setting( 'bytes_step' ); + $condition = array( + 'use_lazy_loading' => false, + ); + $bytes_step->set_param( 'condition', $condition ); + $bytes_step->rebuild_component(); + + } +} diff --git a/php/class-responsive-breakpoints.php b/php/class-responsive-breakpoints.php index df02922ff..e63debb85 100644 --- a/php/class-responsive-breakpoints.php +++ b/php/class-responsive-breakpoints.php @@ -73,68 +73,6 @@ public function __construct( Plugin $plugin ) { $this->media = $plugin->get_component( 'media' ); } - /** - * Get the placeholder generation transformations. - * - * @param string $placeholder The placeholder to get. - * - * @return array - */ - public function get_placeholder_transformations( $placeholder ) { - - $transformations = array( - 'predominant' => array( - array( - '$currWidth' => 'w', - '$currHeight' => 'h', - ), - array( - 'width' => 'iw_div_2', - 'aspect_ratio' => 1, - 'crop' => 'pad', - 'background' => 'auto', - ), - array( - 'crop' => 'crop', - 'width' => 10, - 'height' => 10, - 'gravity' => 'north_east', - ), - array( - 'width' => '$currWidth', - 'height' => '$currHeight', - 'crop' => 'fill', - ), - array( - 'fetch_format' => 'auto', - 'quality' => 'auto', - ), - ), - 'vectorize' => array( - array( - 'effect' => 'vectorize:3:0.1', - 'fetch_format' => 'svg', - ), - ), - 'blur' => array( - array( - 'effect' => 'blur:2000', - 'quality' => 1, - 'fetch_format' => 'auto', - ), - ), - 'pixelate' => array( - array( - 'effect' => 'pixelate', - 'quality' => 1, - 'fetch_format' => 'auto', - ), - ), - ); - - return $transformations[ $placeholder ]; - } - /** * Add features to a tag element set. * @@ -146,54 +84,25 @@ public function get_placeholder_transformations( $placeholder ) { */ public function add_features( $tag_element, $attachment_id, $original_tag ) { - $settings = $this->settings->get_value(); - - $meta = wp_get_attachment_metadata( $attachment_id, true ); - $format = $this->media->get_settings()->get_value( 'image_format' ); - - $src = $tag_element['atts']['src']; - $transformations = $this->media->get_transformations_from_string( $src ); - $placehold_transformations = $transformations; - $original_string = Api::generate_transformation_string( $transformations ); - $breakpoints = $this->media->get_settings()->get_value( 'enable_breakpoints' ); - if ( 'on' === $breakpoints ) { - // Check if first is a size. - if ( isset( $transformations[0] ) && isset( $transformations[0]['width'] ) || isset( $transformations[0]['height'] ) ) { - // remove the size. - array_shift( $transformations ); - } - $size_str = '--size--/' . Api::generate_transformation_string( $transformations ); - $data_url = str_replace( $original_string, $size_str, $src ); - $tag_element['atts']['data-src'] = $data_url; - if ( isset( $tag_element['atts']['srcset'] ) ) { - unset( $tag_element['atts']['srcset'], $tag_element['atts']['sizes'] ); - } + $src = $tag_element['atts']['src']; + if ( ! $this->media->is_cloudinary_url( $src ) ) { + $src = $this->media->cloudinary_url( $attachment_id ); } + $transformations = $this->media->get_transformations_from_string( $src ); + $original_string = Api::generate_transformation_string( $transformations ); - // placeholder. - if ( 'off' !== $settings['lazy_placeholder'] ) { - // Remove the optimize (last) transformation. - array_pop( $placehold_transformations ); - $placehold_transformations = array_merge( $placehold_transformations, $this->get_placeholder_transformations( $settings['lazy_placeholder'] ) ); - $palcehold_str = Api::generate_transformation_string( $placehold_transformations ); - $placeholder = str_replace( $original_string, $palcehold_str, $src ); - - $tag_element['atts']['src'] = $placeholder; - if ( ! empty( $settings['lazy_preloader'] ) ) { - $tag_element['atts']['data-placeholder'] = $placeholder; - } + // Check if first is a size. + if ( isset( $transformations[0] ) && isset( $transformations[0]['width'] ) || isset( $transformations[0]['height'] ) ) { + // remove the size. + array_shift( $transformations ); } - - if ( ! empty( $settings['lazy_preloader'] ) ) { - $svg = ''; - $tag_element['atts']['src'] = 'data:image/svg+xml;utf8,' . $svg; - $tag_element['atts']['data-type'] = $format; + $size_str = '--size--/' . Api::generate_transformation_string( $transformations ); + $data_url = str_replace( $original_string, $size_str, $src ); + $tag_element['atts']['data-src'] = $data_url; + if ( isset( $tag_element['atts']['srcset'] ) ) { + unset( $tag_element['atts']['srcset'], $tag_element['atts']['sizes'] ); } - unset( $tag_element['atts']['loading'] ); - $tag_element['atts']['decoding'] = 'async'; - $tag_element['atts']['data-width'] = $meta['width']; - return $tag_element; } @@ -222,97 +131,46 @@ public function register_assets() { * Enqueue Assets */ public function enqueue_assets() { - wp_enqueue_script( 'cld-responsive-breakpoints' ); - $breakpoints = $this->media->get_settings()->get_value( 'image_display' ); - wp_add_inline_script( 'cld-responsive-breakpoints', 'var CLDLB = ' . wp_json_encode( $breakpoints ), 'before' ); + $config = $this->media->get_settings()->get_value( 'image_display' ); + wp_add_inline_script( 'cld-responsive-breakpoints', 'var CLDLB = ' . wp_json_encode( $config ), 'before' ); } /** * Setup the class. */ public function setup() { - $this->register_settings(); + add_filter( 'cloudinary_sync_base_struct', array( $this, 'remove_legacy_breakpoints' ) ); if ( ! is_admin() ) { $settings = $this->settings->get_value(); - if ( isset( $settings['use_lazy_loading'] ) && 'on' === $settings['use_lazy_loading'] ) { + if ( isset( $settings['use_lazy_loading'] ) && 'on' === $settings['use_lazy_loading'] && 'on' === $settings['enable_breakpoints'] ) { add_filter( 'cloudinary_pre_image_tag', array( $this, 'add_features' ), 10, 3 ); } } } /** - * Define the settings. + * Remove the legacy breakpoints sync type and filters. + * + * @param array $structs The sync types structure. * * @return array */ - public function settings() { + public function remove_legacy_breakpoints( $structs ) { + unset( $structs['breakpoints'] ); + remove_filter( 'wp_calculate_image_srcset', array( $this->media, 'image_srcset' ), 10 ); - $args = array( - 'type' => 'group', - 'title' => __( 'Lazy Loading', 'cloudinary' ), - 'slug' => 'lazy_loading', - 'priority' => 9, - array( - 'type' => 'on_off', - 'description' => __( 'Enable lazy loading', 'cloudinary' ), - 'slug' => 'use_lazy_loading', - 'default' => 'off', - ), - array( - 'type' => 'group', - 'condition' => array( - 'use_lazy_loading' => true, - ), - array( - 'type' => 'number', - 'title' => __( 'Lazy loading threshold', 'cloudinary' ), - 'slug' => 'lazy_threshold', - 'description' => __( ' The threshold', 'cloudinary' ), - 'default' => 1000, - ), - array( - 'type' => 'radio', - 'title' => __( 'Placeholder generation', 'cloudinary' ), - 'slug' => 'lazy_placeholder', - 'description' => __( ' The placeholder', 'cloudinary' ), - 'default' => 'blur', - 'options' => array( - 'blur' => __( 'Blur', 'cloudinary' ), - 'pixelate' => __( 'Pixelate', 'cloudinary' ), - 'vectorize' => __( 'Vectorize', 'cloudinary' ), - 'predominant' => __( 'Dominant Color', 'cloudinary' ), - 'off' => __( 'Off', 'cloudinary' ), - ), - ), - array( - 'type' => 'checkbox', - 'title' => __( 'Initial preloader', 'cloudinary' ), - 'slug' => 'lazy_preloader', - 'description' => __( ' The preloader', 'cloudinary' ), - 'default' => 'on', - 'options' => array( - 'on' => __( 'Use an initial preloader', 'cloudinary' ), - ), - ), - array( - 'type' => 'checkbox', - 'title' => __( 'Use custom preloader', 'cloudinary' ), - 'slug' => 'lazy_custom_preloader', - 'description' => __( ' The custom preloader', 'cloudinary' ), - 'default' => 'on', - 'condition' => array( - 'lazy_preloader' => true, - ), - 'options' => array( - 'on' => __( 'Use a custom preloader', 'cloudinary' ), - ), - ), - ), - ); + return $structs; + } - return $args; + /** + * Define the settings. + * + * @return array + */ + public function settings() { + return array(); } /** @@ -320,17 +178,41 @@ public function settings() { */ protected function register_settings() { - // Move setting to media. - $media_settings = $this->media->get_settings()->get_setting( 'image_display' ); - $condition = array( - 'use_lazy_loading' => false, + $media_settings = $this->media->get_settings()->get_setting( 'image_display' ); + $image_breakpoints = $media_settings->get_setting( 'image_breakpoints' ); + // Add pixel step. + $params = array( + 'type' => 'number', + 'slug' => 'pixel_step', + 'priority' => 9, + 'title' => __( 'Breakpoints distance', 'cloudinary' ), + 'tooltip_text' => __( 'The distance from the original image for responsive breakpoints generation.', 'cloudinary' ), + 'suffix' => __( 'px', 'cloudinary' ), + 'default' => 100, + 'condition' => array( + 'use_lazy_loading' => true, + ), + ); + $image_breakpoints->create_setting( 'pixel_step', $params, $image_breakpoints ); + + // Add density. + $params = array( + 'type' => 'select', + 'slug' => 'dpr', + 'priority' => 8, + 'title' => __( 'DPR settings', 'cloudinary' ), + 'tooltip_text' => __( 'The distance from the original image for responsive breakpoints generation.', 'cloudinary' ), + 'default' => 'auto', + 'options' => array( + '0' => __( 'None', 'cloudinary' ), + 'auto' => __( 'Auto', 'cloudinary' ), + '2' => __( '2X', 'cloudinary' ), + '3' => __( '3X', 'cloudinary' ), + '4' => __( '4X', 'cloudinary' ), + ), ); - $settings_params = $this->settings(); - $this->settings = $this->plugin->settings->create_setting( $this->settings_slug, $settings_params ); - $media_settings->add_setting( $this->settings ); + $image_breakpoints->create_setting( 'dpr', $params, $image_breakpoints )->get_value(); - $bk = $media_settings->get_setting( 'breakpoints' ); - $bk->set_param( 'condition', $condition ); - $bk->rebuild_component(); + $this->settings = $media_settings; } } diff --git a/ui-definitions/settings-image.php b/ui-definitions/settings-image.php index fecb88c2a..73e7b058c 100644 --- a/ui-definitions/settings-image.php +++ b/ui-definitions/settings-image.php @@ -99,9 +99,10 @@ 'default' => 'off', ), array( - 'type' => 'group', - 'title' => __( 'Image breakpoints', 'cloudinary' ), - 'condition' => array( + 'type' => 'group', + 'title' => __( 'Image breakpoints', 'cloudinary' ), + 'slug' => 'image_breakpoints', + 'condition' => array( 'enable_breakpoints' => true, ), 'collapsible' => 'open', From 97ce324bd45e9e9557f561355697c0d28739519d Mon Sep 17 00:00:00 2001 From: David Cramer Date: Wed, 7 Jul 2021 12:19:45 +0200 Subject: [PATCH 20/56] clean up delivery class --- php/class-delivery.php | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/php/class-delivery.php b/php/class-delivery.php index 56227961f..fbb66e3b4 100644 --- a/php/class-delivery.php +++ b/php/class-delivery.php @@ -141,6 +141,7 @@ public function setup() { $this->sync = $this->media->sync; // Add filters. + add_filter( 'wp_calculate_image_srcset', array( $this->media, 'image_srcset' ), 10, 5 ); add_action( 'save_post', array( $this, 'remove_replace_cache' ) ); add_action( 'cloudinary_string_replace', array( $this, 'catch_urls' ) ); add_filter( 'post_thumbnail_html', array( $this, 'process_featured_image' ), 100, 3 ); @@ -318,34 +319,35 @@ public function convert_tags( $content ) { */ public function rebuild_tag( $element, $attachment_id ) { - // Add our filter if not already added. - if ( ! has_filter( 'wp_calculate_image_srcset', array( $this->media, 'image_srcset' ) ) ) { - add_filter( 'wp_calculate_image_srcset', array( $this->media, 'image_srcset' ), 10, 5 ); - } - + // Check overwrite. $overwrite = (bool) strpos( $element, 'cld-overwrite' ); - // Add new srcset. - $element = str_replace( 'srcsert=', 'old-srcset=', $element ); - $element = str_replace( 'sizes=', 'old-sizes=', $element ); - $element = $this->media->apply_srcset( $element, $attachment_id, $overwrite ); // Get tag element. $tag_element = $this->parse_element( $element ); - // Remove the old srcset if it has one. - if ( isset( $tag_element['atts']['old-srcset'] ) ) { - unset( $tag_element['atts']['old-srcset'], $tag_element['atts']['old-sizes'] ); - } - // Get size. $size = $this->get_size_from_atts( $tag_element['atts'] ); + // If no srcset, lets see if we can create them (ie, featured image etc...). + if ( ! isset( $tag_element['atts']['srcset'] ) && ! empty( $this->media->get_post_meta( $attachment_id, Sync::META_KEYS['breakpoints'] ) ) ) { + $image_meta = wp_get_attachment_metadata( $attachment_id ); + $srcset = $this->media->image_srcset( array(), $size, $tag_element['atts']['src'], $image_meta, $attachment_id ); + $srcset = array_map( + function ( $set ) { + return $set['url'] . ' ' . $set['value'] . $set['descriptor']; + }, + $srcset + ); + $tag_element['atts']['srcset'] = implode( ', ', $srcset ); + } // Get transformations if present. $transformations = $this->get_transformations_maybe( $tag_element['atts']['src'] ); - // Create new src url. - $tag_element['atts']['src'] = $this->media->cloudinary_url( $attachment_id, $size, $transformations, null, $overwrite ); - + // Get cloudinary URL, only if overwrite or has inline transformations. Catch all will replace standard urls. + if ( $overwrite || $transformations ) { + // Create new src url. + $tag_element['atts']['src'] = $this->media->cloudinary_url( $attachment_id, $size, $transformations, null, $overwrite ); + } /** * Filter the tag element. * From 4e41144c4ae35e6ca3ae7b80b49f2876213d32b0 Mon Sep 17 00:00:00 2001 From: David Cramer Date: Wed, 7 Jul 2021 12:29:44 +0200 Subject: [PATCH 21/56] fix connection tag renaming issue. --- php/class-connect.php | 8 ++++---- php/sync/class-storage.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/php/class-connect.php b/php/class-connect.php index 989ba9bd8..e360df7e2 100644 --- a/php/class-connect.php +++ b/php/class-connect.php @@ -85,7 +85,7 @@ class Connect extends Settings_Component implements Config, Setup, Notice { 'signature' => 'cloudinary_connection_signature', 'version' => 'cloudinary_version', 'url' => 'cloudinary_url', - 'connect' => 'cloudinary_connect', + 'connection' => 'cloudinary_connect', 'status' => 'cloudinary_status', ); @@ -332,7 +332,7 @@ public function updated_option() { add_query_arg( array( 'page' => 'dashboard', - 'tab' => 'connection', + 'tab' => 'connect', ), admin_url( 'admin.php' ) ) @@ -811,7 +811,7 @@ public function settings() { 'page_title' => __( 'Getting Started', 'cloudinary' ), 'type' => 'page', 'tabs' => array( - 'about' => array( + 'about' => array( 'page_title' => __( 'About', 'cloudinary' ), array( 'type' => 'info_box', @@ -857,7 +857,7 @@ public function settings() { 'link_text' => __( 'See Examples', 'cloudinary' ), ), ), - 'connection' => array( + 'connect' => array( 'page_title' => __( 'Connect', 'cloudinary' ), array( 'enabled' => function () use ( $self ) { diff --git a/php/sync/class-storage.php b/php/sync/class-storage.php index 02821973d..c91d4b1c0 100644 --- a/php/sync/class-storage.php +++ b/php/sync/class-storage.php @@ -288,7 +288,7 @@ public function status() { */ public function get_notices() { $notices = array(); - if ( 'cld' === $this->settings['offload'] ) { + if ( ! empty( $this->settings ) && 'cld' === $this->settings['offload'] ) { $storage = $this->connect->get_usage_stat( 'storage', 'used_percent' ); $transformations = $this->connect->get_usage_stat( 'transformations', 'used_percent' ); $bandwidth = $this->connect->get_usage_stat( 'bandwidth', 'used_percent' ); From 4a81544bd70af6ba9d2d26a06f26fd5307f0a514 Mon Sep 17 00:00:00 2001 From: David Cramer Date: Wed, 7 Jul 2021 13:14:31 +0200 Subject: [PATCH 22/56] reset values --- php/class-lazy-load.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/php/class-lazy-load.php b/php/class-lazy-load.php index 6f4c9e49d..9a35aca1e 100644 --- a/php/class-lazy-load.php +++ b/php/class-lazy-load.php @@ -278,6 +278,9 @@ protected function register_settings() { $settings_params = $this->settings(); $this->settings = $media_settings->create_setting( $this->settings_slug, $settings_params, $media_settings ); + // Reset the option parent. + $this->settings->get_option_parent()->set_value( null ); + $condition = array( 'use_lazy_loading' => false, ); From 97e3d5f1bb75c444a3816703d858f86650c1c7e9 Mon Sep 17 00:00:00 2001 From: David Cramer Date: Wed, 7 Jul 2021 14:00:21 +0200 Subject: [PATCH 23/56] add auto suffix and cleanup settings --- js/cloudinary.js | 2 +- js/responsive-breakpoints.asset.php | 2 +- js/src/components/ui.js | 27 ++++++++++++++++++++++++++- php/class-delivery.php | 14 +++++++++----- php/class-lazy-load.php | 28 +++++++++++++++++----------- 5 files changed, 54 insertions(+), 19 deletions(-) diff --git a/js/cloudinary.js b/js/cloudinary.js index 139f62874..9d91151ce 100644 --- a/js/cloudinary.js +++ b/js/cloudinary.js @@ -1 +1 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=13)}([function(e,t,n){var r;!function(){"use strict";var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function o(e){return s(l(e),arguments)}function a(e,t){return o.apply(null,[e].concat(t||[]))}function s(e,t){var n,r,a,s,c,l,u,d,p,f=1,h=e.length,m="";for(r=0;r=0),s.type){case"b":n=parseInt(n,10).toString(2);break;case"c":n=String.fromCharCode(parseInt(n,10));break;case"d":case"i":n=parseInt(n,10);break;case"j":n=JSON.stringify(n,null,s.width?parseInt(s.width):0);break;case"e":n=s.precision?parseFloat(n).toExponential(s.precision):parseFloat(n).toExponential();break;case"f":n=s.precision?parseFloat(n).toFixed(s.precision):parseFloat(n);break;case"g":n=s.precision?String(Number(n.toPrecision(s.precision))):parseFloat(n);break;case"o":n=(parseInt(n,10)>>>0).toString(8);break;case"s":n=String(n),n=s.precision?n.substring(0,s.precision):n;break;case"t":n=String(!!n),n=s.precision?n.substring(0,s.precision):n;break;case"T":n=Object.prototype.toString.call(n).slice(8,-1).toLowerCase(),n=s.precision?n.substring(0,s.precision):n;break;case"u":n=parseInt(n,10)>>>0;break;case"v":n=n.valueOf(),n=s.precision?n.substring(0,s.precision):n;break;case"x":n=(parseInt(n,10)>>>0).toString(16);break;case"X":n=(parseInt(n,10)>>>0).toString(16).toUpperCase()}i.json.test(s.type)?m+=n:(!i.number.test(s.type)||d&&!s.sign?p="":(p=d?"+":"-",n=n.toString().replace(i.sign,"")),l=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",u=s.width-(p+n).length,c=s.width&&u>0?l.repeat(u):"",m+=s.align?p+n+c:"0"===l?p+c+n:c+p+n)}return m}var c=Object.create(null);function l(e){if(c[e])return c[e];for(var t,n=e,r=[],o=0;n;){if(null!==(t=i.text.exec(n)))r.push(t[0]);else if(null!==(t=i.modulo.exec(n)))r.push("%");else{if(null===(t=i.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(t[2]){o|=1;var a=[],s=t[2],l=[];if(null===(l=i.key.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(a.push(l[1]);""!==(s=s.substring(l[0].length));)if(null!==(l=i.key_access.exec(s)))a.push(l[1]);else{if(null===(l=i.index_access.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");a.push(l[1])}t[2]=a}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");r.push({placeholder:t[0],param_no:t[1],keys:t[2],sign:t[3],pad_char:t[4],align:t[5],width:t[6],precision:t[7],type:t[8]})}n=n.substring(t[0].length)}return c[e]=r}t.sprintf=o,t.vsprintf=a,"undefined"!=typeof window&&(window.sprintf=o,window.vsprintf=a,void 0===(r=function(){return{sprintf:o,vsprintf:a}}.call(t,n,t,e))||(e.exports=r))}()},function(e,t,n){e.exports=n(11)},function(e,t){!function(){const e=function(){const e=jQuery("#field-video_player").val(),t=jQuery("#field-video_controls").prop("checked"),n=jQuery('#field-video_autoplay_mode option[value="off"]');"cld"!==e||t?n.prop("disabled",!1):(n.prop("disabled",!0),n.prop("selected")&&n.next().prop("selected",!0))};e(),jQuery(document).on("change","#field-video_player",e),jQuery(document).on("change","#field-video_controls",e),jQuery(document).ready((function(e){e.isFunction(e.fn.wpColorPicker)&&e(".regular-color").wpColorPicker(),e(document).on("tabs.init",(function(){const t=e(".settings-tab-trigger"),n=e(".settings-tab-section");e(this).on("click",".settings-tab-trigger",(function(r){const i=e(this),o=e(i.attr("href"));r.preventDefault(),t.removeClass("active"),n.removeClass("active"),i.addClass("active"),o.addClass("active"),e(document).trigger("settings.tabbed",i)})),e(".cld-field").not('[data-condition="false"]').each((function(){const t=e(this),n=t.data("condition");for(const r in n){let i=e("#field-"+r);const o=n[r],a=t.closest("tr");i.length||(i=e(`[id^=field-${r}-]`));let s=!1;i.on("change init",(function(e,t=!1){if(s&&t)return;let n=this.value===o||this.checked;if(Array.isArray(o)&&2===o.length)switch(o[1]){case"neq":n=this.value!==o[0];break;case"gt":n=this.value>o[0];break;case"lt":n=this.value=0&&(e.metadata.cldoverwrite="true")})),wp.media.events.on("editor:image-update",(function(e){const t=e.image.className.split(" ");e.metadata.cldoverwrite&&-1===t.indexOf("cld-overwrite")?t.push("cld-overwrite"):!e.metadata.cldoverwrite&&t.indexOf("cld-overwrite")>=0&&delete t[t.indexOf("cld-overwrite")],e.image.className=t.join(" ")}));let e=null;const t=wp.media.string.props;wp.media.string.props=function(n,r){n.cldoverwrite&&(n.classes=["cld-overwrite"],e=!0);return t(n,r)},wp.media.post=function(t,n){if("send-attachment-to-editor"===t){const t=wp.media.editor.get().state().get("selection").get(n.attachment);t.attributes.transformations&&(n.attachment.transformations=t.attributes.transformations),(n.html.indexOf("cld-overwrite")>-1||!0===e)&&(n.attachment.cldoverwrite=!0,e=null)}return wp.ajax.post(t,n)};const n=wp.media.view.MediaFrame.Select,r=wp.media.view.MediaFrame.Post,i=wp.media.view.MediaFrame.ImageDetails,o=wp.media.view.MediaFrame.VideoDetails,a=wp.media.View.extend({tagName:"div",className:"cloudinary-widget",template:wp.template("cloudinary-dam"),active:!1,toolbar:null,frame:null,ready(){const e=this.controller,t=this.model.get("selection"),n=this.model.get("library"),r=wp.media.model.Attachment;if(CLDN.mloptions.multiple=e.options.multiple,this.cid!==this.active){if(CLDN.mloptions.inline_container="#cloudinary-dam-"+e.cid,1===t.length){const e=r.get(t.models[0].id);void 0!==e.attributes.public_id&&(CLDN.mloptions.asset={resource_id:e.attributes.public_id})}else CLDN.mloptions.asset=null;try{CLDN.mloptions.folder||(CLDN.mloptions.folder={path:""});const e=t.props.attributes.type;CLDN.mloptions.folder.resource_type=Array.isArray(e)?e[0]:e}catch(e){}window.ml=cloudinary.openMediaLibrary(CLDN.mloptions,{insertHandler(i){for(let o=0;o0;a--)s/=o;return s.toFixed(2)},r.human=function(e){var t=r.calculate(e);return t.fixed+r.spacer+t.suffix},r}},e.exports?e.exports=a():(i=[],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){e.exports=function(e,t){var n,r,i=0;function o(){var o,a,s=n,c=arguments.length;e:for(;s;){if(s.args.length===arguments.length){for(a=0;a'+t),t=t.replace(/(?:\r\n|\r|\n|\t| )srcset=/g," data-lazy-srcset=").replace(/(?:\r\n|\r|\n|\t| )src=/g,' src="'+r+'" data-lazy-src='))),t}(e);t.firstChild;)o||!a||void 0===n||!t.firstChild.tagName||"img"!==t.firstChild.tagName.toLowerCase()&&"iframe"!==t.firstChild.tagName.toLowerCase()||n.observe(t.firstChild),e.parentNode.insertBefore(t.firstChild,e);e.parentNode.removeChild(e)}function l(){document.querySelectorAll("noscript.loading-lazy").forEach(c),void 0!==window.matchMedia&&window.matchMedia("print").addListener((function(e){e.matches&&document.querySelectorAll(i.lazyImage+"[data-lazy-src],"+i.lazyIframe+"[data-lazy-src]").forEach((function(e){s(e)}))}))}"undefined"!=typeof NodeList&&NodeList.prototype&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),"IntersectionObserver"in window&&(n=new IntersectionObserver((function(e,t){e.forEach((function(e){if(0!==e.intersectionRatio){var n=e.target;t.unobserve(n),s(n)}}))}),i)),r="requestAnimationFrame"in window?window.requestAnimationFrame:function(e){e()},/comp|inter/.test(document.readyState)?r(l):"addEventListener"in document?document.addEventListener("DOMContentLoaded",(function(){r(l)})):document.attachEvent("onreadystatechange",(function(){"complete"===document.readyState&&l()}))}()},function(e,t){const n=document.querySelector(".cloudinary-collapsible__toggle");n&&n.addEventListener("click",(function(){const e=document.querySelector(".cloudinary-collapsible__content"),t="none"===window.getComputedStyle(e,null).getPropertyValue("display"),n=document.querySelector(".cloudinary-collapsible__toggle button i");e.style.display=t?"block":"none";const r="dashicons-arrow-down-alt2",i="dashicons-arrow-up-alt2";n.classList.contains(r)?(n.classList.remove(r),n.classList.add(i)):(n.classList.remove(i),n.classList.add(r))}))},function(e,t,n){var r=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof v?t:v,o=Object.create(i.prototype),a=new C(r||[]);return o._invoke=function(e,t,n){var r=d;return function(i,o){if(r===f)throw new Error("Generator is already running");if(r===h){if("throw"===i)throw o;return T()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=j(a,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var c=u(e,t,n);if("normal"===c.type){if(r=n.done?h:p,c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=h,n.method="throw",n.arg=c.arg)}}}(e,n,a),o}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var d="suspendedStart",p="suspendedYield",f="executing",h="completed",m={};function v(){}function g(){}function y(){}var b={};b[o]=function(){return this};var w=Object.getPrototypeOf,_=w&&w(w(A([])));_&&_!==n&&r.call(_,o)&&(b=_);var x=y.prototype=v.prototype=Object.create(b);function O(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function n(i,o,a,s){var c=u(e[i],e,o);if("throw"!==c.type){var l=c.arg,d=l.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(d).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,s)}))}s(c.arg)}var i;this._invoke=function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}}function j(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,j(e,n),"throw"===n.method))return m;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var i=u(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function A(e){if(e){var n=e[o];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function n(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=r}catch(e){Function("r","regeneratorRuntime = r")(r)}},,function(e,t,n){"use strict";n.r(t),n.d(t,"cloudinary",(function(){return $n}));n(9),n(10);var r=n(2),i=n.n(r),o=n(3),a=n.n(o);const s={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_optimization"),video:document.getElementById("video_optimization")},error_container:document.getElementById("cld-preview-error"),activeItem:null,elements:{image:[],video:[]},_placeItem(e){null!==e&&(e.style.display="block",e.style.visibility="visible",e.style.position="absolute",e.style.top=e.parentElement.clientHeight/2-e.clientHeight/2+"px",e.style.left=e.parentElement.clientWidth/2-e.clientWidth/2+"px")},_setLoading(e){this.button[e].style.display="block",this._placeItem(this.button[e]),this.preview[e].style.opacity="0.1"},_build(e){this.sample[e].innerHTML="",this.elements[e]=[];for(const t of this.fields){if(e!==t.dataset.context||t.dataset.disabled&&"true"===t.dataset.disabled)continue;let n=t.value.trim();if(n.length){if("select-one"===t.type){if("none"===n||!1===this.optimization[e].checked)continue;n=t.dataset.meta+"_"+n}else e=t.dataset.context,t.dataset.meta&&(n=t.dataset.meta+"_"+n),t.dataset.suffix&&(n+=t.dataset.suffix),n=this._transformations(n,e,!0);n&&this.elements[e].push(n)}}let t="";this.elements[e].length&&(t="/"+this._getGlobalTransformationElements(e).replace(/ /g,"%20")),this.sample[e].textContent=t,this.sample[e].parentElement.href="https://res.cloudinary.com/demo/"+this.sample[e].parentElement.innerText.trim().replace("../","").replace(/ /g,"%20")},_clearLoading(e){this.spinner[e].style.visibility="hidden",this.activeItem=null,this.preview[e].style.opacity=1},_refresh(e,t){e&&e.preventDefault();const n=this,r=CLD_GLOBAL_TRANSFORMATIONS[t].preview_url+this._getGlobalTransformationElements(t)+CLD_GLOBAL_TRANSFORMATIONS[t].file;if(this.button[t].style.display="none",this._placeItem(this.spinner[t]),"image"===t){const e=new Image;e.onload=function(){n.preview[t].src=this.src,n._clearLoading(t),n.error_container&&(n.error_container.style.display="none"),e.remove()},e.onerror=function(){const e=n.elements[t].includes("f_mp4");n.error_container&&(n.error_container.style.display="block",e?(n.error_container.innerHTML=CLD_GLOBAL_TRANSFORMATIONS[t].warning.replace("%s","f_mp4"),n.error_container.classList.replace("settings-alert-error","settings-alert-warning")):(n.error_container.innerHTML=CLD_GLOBAL_TRANSFORMATIONS[t].error,n.error_container.classList.replace("settings-alert-warning","settings-alert-error"))),n._clearLoading(t)},e.src=r}else{const e=n._transformations(n._getGlobalTransformationElements(t),t);samplePlayer.source({publicId:"dog",transformation:e}),n._clearLoading(t)}},_getGlobalTransformationElements(e){let t=[];return t.push(this.elements[e].slice(0,2).join(",")),t.push(this.elements[e].slice(2).join(",")),t=t.filter((e=>e)).join("/"),t},_transformations(e,t,n=!1){const r=CLD_GLOBAL_TRANSFORMATIONS[t].valid_types;let i=null;const o=e.split("/"),a=[];for(let e=0;e{const r=!!n.length&&jQuery('[data-item="'+i+":"+n[0].id+'"]');r.length?r.remove():(jQuery(`.cld-tax-order-list-item:contains(${a})`).remove(),--e.startId),this.processTags(t)}))}),jQuery("body").on("change",".selectit input",(function(){const t=jQuery(this),n=t.val(),r=t.is(":checked"),i=t.parent().text().trim();!0===r?e.tags.find(`[data-item="category:${n}"]`).length||e._pushItem(`category:${n}`,i):e.tags.find(`[data-item="category:${n}"]`).remove()}))},_createItem(e,t){const n=jQuery("
  • "),r=jQuery(""),i=jQuery("");return n.addClass("cld-tax-order-list-item").attr("data-item",e),i.addClass("cld-tax-order-list-item-input").attr("type","hidden").attr("name","cld_tax_order[]").val(e),r.addClass("dashicons dashicons-menu cld-tax-order-list-item-handle"),n.append(r).append(t).append(i),n},_pushItem(e,t){const n=this._createItem(e,t);this.tags.append(n)},_sortable(){jQuery(".cld-tax-order-list").sortable({connectWith:".cld-tax-order",axis:"y",handle:".cld-tax-order-list-item-handle",placeholder:"cld-tax-order-list-item-placeholder",forcePlaceholderSize:!0,helper:"clone"})}};if(void 0!==window.CLDN&&(l._init(),jQuery("[data-wp-lists] .selectit input[checked]").each(((e,t)=>{jQuery(t).trigger("change")}))),wp.data&&wp.data.select("core/editor")){const e={};wp.data.subscribe((function(){const t=wp.data.select("core").getTaxonomies();if(t)for(const n in t){const r=wp.data.select("core/editor").getEditedPostAttribute(t[n].rest_base);e[t[n].slug]=r}}));const t=wp.element.createElement,n=n=>{class r extends n{constructor(e){super(e),this.currentItems=jQuery(".cld-tax-order-list-item").map(((e,t)=>jQuery(t).data("item"))).get()}makeItem(e){if(this.currentItems.includes(this.getId(e)))return;const t=this.makeElement(e);jQuery("#cld-tax-items").append(t)}removeItem(e){const t=jQuery(`[data-item="${this.getId(e)}"]`);t.length&&(t.remove(),this.currentItems=this.currentItems.filter((t=>t!==this.getId(e))))}findOrCreateTerm(e){return(e=super.findOrCreateTerm(e)).then((e=>this.makeItem(e))),e}onChange(t){super.onChange(t);const n=this.pickItem(t);n&&(e[this.props.slug].includes(n.id)?this.makeItem(n):this.removeItem(n))}pickItem(e){if("object"==typeof e){if(e.target){for(const t in this.state.availableTerms)if(this.state.availableTerms[t].id===parseInt(e.target.value))return this.state.availableTerms[t]}else if(Array.isArray(e)){let t=this.state.selectedTerms.filter((t=>!e.includes(t)))[0];return void 0===t&&(t=e.filter((e=>!this.state.selectedTerms.includes(e)))[0]),this.state.availableTerms.find((e=>e.name===t))}}else if("number"==typeof e){for(const t in this.state.availableTerms)if(this.state.availableTerms[t].id===e)return this.state.availableTerms[t]}else{let t;if(e.length>this.state.selectedTerms.length)for(const n in e)-1===this.state.selectedTerms.indexOf(e[n])&&(t=e[n]);else for(const n in this.state.selectedTerms)-1===e.indexOf(this.state.selectedTerms[n])&&(t=this.state.selectedTerms[n]);for(const e in this.state.availableTerms)if(this.state.availableTerms[e].name===t)return this.state.availableTerms[e]}}getId(e){return`${this.props.slug}:${e.id}`}makeElement(e){const t=jQuery("
  • "),n=jQuery(""),r=jQuery("");return t.addClass("cld-tax-order-list-item").attr("data-item",this.getId(e)),r.addClass("cld-tax-order-list-item-input").attr("type","hidden").attr("name","cld_tax_order[]").val(this.getId(e)),n.addClass("dashicons dashicons-menu cld-tax-order-list-item-handle"),t.append(n).append(e.name).append(r),t}}return e=>t(r,e)};wp.hooks.addFilter("editor.PostTaxonomyType","cld",n)}var u=l;const d={wpWrap:document.getElementById("wpwrap"),wpContent:document.getElementById("wpbody-content"),libraryWrap:document.getElementById("cloudinary-embed"),_init(){const e=this;"undefined"!=typeof CLD_ML&&(cloudinary.openMediaLibrary(CLD_ML.mloptions,{insertHandler(){alert("Import is not yet implemented.")}}),window.addEventListener("resize",(function(){e._resize()})),e._resize())},_resize(){const e=getComputedStyle(this.wpContent);this.libraryWrap.style.height=this.wpWrap.offsetHeight-parseInt(e.getPropertyValue("padding-bottom"))+"px"}};var p=d;d._init();const f={_init(){const e=this;if("undefined"!=typeof CLDIS){[...document.getElementsByClassName("cld-notice-box")].forEach((t=>{const n=t.getElementsByClassName("notice-dismiss");n.length&&n[0].addEventListener("click",(n=>{t.style.height=t.offsetHeight+"px",n.preventDefault(),setTimeout((function(){e._dismiss(t)}),5)}))}))}},_dismiss(e){const t=e.dataset.dismiss,n=parseInt(e.dataset.duration);e.classList.add("dismissed"),e.style.height="0px",setTimeout((function(){e.remove()}),400),0=0?e.ownerDocument.body:b(e)&&j(e)?e:A(C(e))}function T(e,t){var n;void 0===t&&(t=[]);var r=A(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=v(r),a=i?[o].concat(o.visualViewport||[],j(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(T(C(a)))}function P(e){return["table","td","th"].indexOf(_(e))>=0}function S(e){return b(e)&&"fixed"!==E(e).position?e.offsetParent:null}function D(e){for(var t=v(e),n=S(e);n&&P(n)&&"static"===E(n).position;)n=S(n);return n&&("html"===_(n)||"body"===_(n)&&"static"===E(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&b(e)&&"fixed"===E(e).position)return null;for(var n=C(e);b(n)&&["html","body"].indexOf(_(n))<0;){var r=E(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}var I="top",N="bottom",M="right",F="left",B="auto",R=[I,N,M,F],z="start",H="end",q="viewport",U="popper",W=R.reduce((function(e,t){return e.concat([t+"-"+z,t+"-"+H])}),[]),Q=[].concat(R,[B]).reduce((function(e,t){return e.concat([t,t+"-"+z,t+"-"+H])}),[]),V=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function G(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),r}var $={placement:"bottom",modifiers:[],strategy:"absolute"};function J(){for(var e=arguments.length,t=new Array(e),n=0;n=0?"x":"y"}function ne(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?Z(i):null,a=i?ee(i):null,s=n.x+n.width/2-r.width/2,c=n.y+n.height/2-r.height/2;switch(o){case I:t={x:s,y:n.y-r.height};break;case N:t={x:s,y:n.y+n.height};break;case M:t={x:n.x+n.width,y:c};break;case F:t={x:n.x-r.width,y:c};break;default:t={x:n.x,y:n.y}}var l=o?te(o):null;if(null!=l){var u="y"===l?"height":"width";switch(a){case z:t[l]=t[l]-(n[u]/2-r[u]/2);break;case H:t[l]=t[l]+(n[u]/2-r[u]/2)}}return t}var re={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=ne({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},ie=Math.max,oe=Math.min,ae=Math.round,se={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ce(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.offsets,a=e.position,s=e.gpuAcceleration,c=e.adaptive,l=e.roundOffsets,u=!0===l?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:ae(ae(t*r)/r)||0,y:ae(ae(n*r)/r)||0}}(o):"function"==typeof l?l(o):o,d=u.x,p=void 0===d?0:d,f=u.y,h=void 0===f?0:f,m=o.hasOwnProperty("x"),g=o.hasOwnProperty("y"),y=F,b=I,w=window;if(c){var _=D(n),O="clientHeight",j="clientWidth";_===v(n)&&"static"!==E(_=x(n)).position&&(O="scrollHeight",j="scrollWidth"),_=_,i===I&&(b=N,h-=_[O]-r.height,h*=s?1:-1),i===F&&(y=M,p-=_[j]-r.width,p*=s?1:-1)}var L,k=Object.assign({position:a},c&&se);return s?Object.assign({},k,((L={})[b]=g?"0":"",L[y]=m?"0":"",L.transform=(w.devicePixelRatio||1)<2?"translate("+p+"px, "+h+"px)":"translate3d("+p+"px, "+h+"px, 0)",L)):Object.assign({},k,((t={})[b]=g?h+"px":"",t[y]=m?p+"px":"",t.transform="",t))}var le={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];b(i)&&_(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],i=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});b(r)&&_(r)&&(Object.assign(r.style,o),Object.keys(i).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};var ue={left:"right",right:"left",bottom:"top",top:"bottom"};function de(e){return e.replace(/left|right|bottom|top/g,(function(e){return ue[e]}))}var pe={start:"end",end:"start"};function fe(e){return e.replace(/start|end/g,(function(e){return pe[e]}))}function he(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&w(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function me(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){return t===q?me(function(e){var t=v(e),n=x(e),r=t.visualViewport,i=n.clientWidth,o=n.clientHeight,a=0,s=0;return r&&(i=r.width,o=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,s=r.offsetTop)),{width:i,height:o,x:a+O(e),y:s}}(e)):b(t)?function(e){var t=m(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):me(function(e){var t,n=x(e),r=g(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=ie(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=ie(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+O(e),c=-r.scrollTop;return"rtl"===E(i||n).direction&&(s+=ie(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:c}}(x(e)))}function ge(e,t,n){var r="clippingParents"===t?function(e){var t=T(C(e)),n=["absolute","fixed"].indexOf(E(e).position)>=0&&b(e)?D(e):e;return y(n)?t.filter((function(e){return y(e)&&he(e,n)&&"body"!==_(e)})):[]}(e):[].concat(t),i=[].concat(r,[n]),o=i[0],a=i.reduce((function(t,n){var r=ve(e,n);return t.top=ie(r.top,t.top),t.right=oe(r.right,t.right),t.bottom=oe(r.bottom,t.bottom),t.left=ie(r.left,t.left),t}),ve(e,o));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ye(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function be(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function we(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=void 0===r?e.placement:r,o=n.boundary,a=void 0===o?"clippingParents":o,s=n.rootBoundary,c=void 0===s?q:s,l=n.elementContext,u=void 0===l?U:l,d=n.altBoundary,p=void 0!==d&&d,f=n.padding,h=void 0===f?0:f,v=ye("number"!=typeof h?h:be(h,R)),g=u===U?"reference":U,b=e.elements.reference,w=e.rects.popper,_=e.elements[p?g:u],O=ge(y(_)?_:_.contextElement||x(e.elements.popper),a,c),E=m(b),j=ne({reference:E,element:w,strategy:"absolute",placement:i}),L=me(Object.assign({},w,j)),k=u===U?L:E,C={top:O.top-k.top+v.top,bottom:k.bottom-O.bottom+v.bottom,left:O.left-k.left+v.left,right:k.right-O.right+v.right},A=e.modifiersData.offset;if(u===U&&A){var T=A[i];Object.keys(C).forEach((function(e){var t=[M,N].indexOf(e)>=0?1:-1,n=[I,N].indexOf(e)>=0?"y":"x";C[e]+=T[n]*t}))}return C}function _e(e,t,n){return ie(e,oe(t,n))}function xe(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Oe(e){return[I,M,N,F].some((function(t){return e[t]>=0}))}var Ee=X({defaultModifiers:[K,re,{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,a=void 0===o||o,s=n.roundOffsets,c=void 0===s||s,l={placement:Z(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,ce(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,ce(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},le,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=void 0===i?[0,0]:i,a=Q.reduce((function(e,n){return e[n]=function(e,t,n){var r=Z(e),i=[F,I].indexOf(r)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[F,M].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,o),e}),{}),s=a[t.placement],c=s.x,l=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=a}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0===a||a,c=n.fallbackPlacements,l=n.padding,u=n.boundary,d=n.rootBoundary,p=n.altBoundary,f=n.flipVariations,h=void 0===f||f,m=n.allowedAutoPlacements,v=t.options.placement,g=Z(v),y=c||(g===v||!h?[de(v)]:function(e){if(Z(e)===B)return[];var t=de(e);return[fe(e),t,fe(t)]}(v)),b=[v].concat(y).reduce((function(e,n){return e.concat(Z(n)===B?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,l=void 0===c?Q:c,u=ee(r),d=u?s?W:W.filter((function(e){return ee(e)===u})):R,p=d.filter((function(e){return l.indexOf(e)>=0}));0===p.length&&(p=d);var f=p.reduce((function(t,n){return t[n]=we(e,{placement:n,boundary:i,rootBoundary:o,padding:a})[Z(n)],t}),{});return Object.keys(f).sort((function(e,t){return f[e]-f[t]}))}(t,{placement:n,boundary:u,rootBoundary:d,padding:l,flipVariations:h,allowedAutoPlacements:m}):n)}),[]),w=t.rects.reference,_=t.rects.popper,x=new Map,O=!0,E=b[0],j=0;j=0,T=A?"width":"height",P=we(t,{placement:L,boundary:u,rootBoundary:d,altBoundary:p,padding:l}),S=A?C?M:F:C?N:I;w[T]>_[T]&&(S=de(S));var D=de(S),H=[];if(o&&H.push(P[k]<=0),s&&H.push(P[S]<=0,P[D]<=0),H.every((function(e){return e}))){E=L,O=!1;break}x.set(L,H)}if(O)for(var q=function(e){var t=b.find((function(t){var n=x.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return E=t,"break"},U=h?3:1;U>0;U--){if("break"===q(U))break}t.placement!==E&&(t.modifiersData[r]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0!==a&&a,c=n.boundary,l=n.rootBoundary,u=n.altBoundary,d=n.padding,p=n.tether,f=void 0===p||p,h=n.tetherOffset,m=void 0===h?0:h,v=we(t,{boundary:c,rootBoundary:l,padding:d,altBoundary:u}),g=Z(t.placement),y=ee(t.placement),b=!y,w=te(g),_="x"===w?"y":"x",x=t.modifiersData.popperOffsets,O=t.rects.reference,E=t.rects.popper,j="function"==typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,L={x:0,y:0};if(x){if(o||s){var C="y"===w?I:F,A="y"===w?N:M,T="y"===w?"height":"width",P=x[w],S=x[w]+v[C],B=x[w]-v[A],R=f?-E[T]/2:0,H=y===z?O[T]:E[T],q=y===z?-E[T]:-O[T],U=t.elements.arrow,W=f&&U?k(U):{width:0,height:0},Q=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},V=Q[C],G=Q[A],$=_e(0,O[T],W[T]),J=b?O[T]/2-R-$-V-j:H-$-V-j,X=b?-O[T]/2+R+$+G+j:q+$+G+j,Y=t.elements.arrow&&D(t.elements.arrow),K=Y?"y"===w?Y.clientTop||0:Y.clientLeft||0:0,ne=t.modifiersData.offset?t.modifiersData.offset[t.placement][w]:0,re=x[w]+J-ne-K,ae=x[w]+X-ne;if(o){var se=_e(f?oe(S,re):S,P,f?ie(B,ae):B);x[w]=se,L[w]=se-P}if(s){var ce="x"===w?I:F,le="x"===w?N:M,ue=x[_],de=ue+v[ce],pe=ue-v[le],fe=_e(f?oe(de,re):de,ue,f?ie(pe,ae):pe);x[_]=fe,L[_]=fe-ue}}t.modifiersData[r]=L}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Z(n.placement),c=te(s),l=[F,M].indexOf(s)>=0?"height":"width";if(o&&a){var u=function(e,t){return ye("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:be(e,R))}(i.padding,n),d=k(o),p="y"===c?I:F,f="y"===c?N:M,h=n.rects.reference[l]+n.rects.reference[c]-a[c]-n.rects.popper[l],m=a[c]-n.rects.reference[c],v=D(o),g=v?"y"===c?v.clientHeight||0:v.clientWidth||0:0,y=h/2-m/2,b=u[p],w=g-d[l]-u[f],_=g/2-d[l]/2+y,x=_e(b,_,w),O=c;n.modifiersData[r]=((t={})[O]=x,t.centerOffset=x-_,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&he(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=we(t,{elementContext:"reference"}),s=we(t,{altBoundary:!0}),c=xe(a,r),l=xe(s,i,o),u=Oe(c),d=Oe(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}}]}),je="tippy-content",Le="tippy-backdrop",ke="tippy-arrow",Ce="tippy-svg-arrow",Ae={passive:!0,capture:!0};function Te(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function Pe(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function Se(e,t){return"function"==typeof e?e.apply(void 0,t):e}function De(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function Ie(e){return[].concat(e)}function Ne(e,t){-1===e.indexOf(t)&&e.push(t)}function Me(e){return e.split("-")[0]}function Fe(e){return[].slice.call(e)}function Be(){return document.createElement("div")}function Re(e){return["Element","Fragment"].some((function(t){return Pe(e,t)}))}function ze(e){return Pe(e,"MouseEvent")}function He(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function qe(e){return Re(e)?[e]:function(e){return Pe(e,"NodeList")}(e)?Fe(e):Array.isArray(e)?e:Fe(document.querySelectorAll(e))}function Ue(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function We(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function Qe(e){var t,n=Ie(e)[0];return(null==n||null==(t=n.ownerDocument)?void 0:t.body)?n.ownerDocument:document}function Ve(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}var Ge={isTouch:!1},$e=0;function Je(){Ge.isTouch||(Ge.isTouch=!0,window.performance&&document.addEventListener("mousemove",Xe))}function Xe(){var e=performance.now();e-$e<20&&(Ge.isTouch=!1,document.removeEventListener("mousemove",Xe)),$e=e}function Ye(){var e=document.activeElement;if(He(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var Ke="undefined"!=typeof window&&"undefined"!=typeof document?navigator.userAgent:"",Ze=/MSIE |Trident\//.test(Ke);var et={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},tt=Object.assign({appendTo:function(){return document.body},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},et,{},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),nt=Object.keys(tt);function rt(e){var t=(e.plugins||[]).reduce((function(t,n){var r=n.name,i=n.defaultValue;return r&&(t[r]=void 0!==e[r]?e[r]:i),t}),{});return Object.assign({},e,{},t)}function it(e,t){var n=Object.assign({},t,{content:Se(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(rt(Object.assign({},tt,{plugins:t}))):nt).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},tt.aria,{},n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function ot(e,t){e.innerHTML=t}function at(e){var t=Be();return!0===e?t.className=ke:(t.className=Ce,Re(e)?t.appendChild(e):ot(t,e)),t}function st(e,t){Re(t.content)?(ot(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?ot(e,t.content):e.textContent=t.content)}function ct(e){var t=e.firstElementChild,n=Fe(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(je)})),arrow:n.find((function(e){return e.classList.contains(ke)||e.classList.contains(Ce)})),backdrop:n.find((function(e){return e.classList.contains(Le)}))}}function lt(e){var t=Be(),n=Be();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Be();function i(n,r){var i=ct(t),o=i.box,a=i.content,s=i.arrow;r.theme?o.setAttribute("data-theme",r.theme):o.removeAttribute("data-theme"),"string"==typeof r.animation?o.setAttribute("data-animation",r.animation):o.removeAttribute("data-animation"),r.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?o.setAttribute("role",r.role):o.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||st(a,e.props),r.arrow?s?n.arrow!==r.arrow&&(o.removeChild(s),o.appendChild(at(r.arrow))):o.appendChild(at(r.arrow)):s&&o.removeChild(s)}return r.className=je,r.setAttribute("data-state","hidden"),st(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props),{popper:t,onUpdate:i}}lt.$$tippy=!0;var ut=1,dt=[],pt=[];function ft(e,t){var n,r,i,o,a,s,c,l,u,d=it(e,Object.assign({},tt,{},rt((n=t,Object.keys(n).reduce((function(e,t){return void 0!==n[t]&&(e[t]=n[t]),e}),{}))))),p=!1,f=!1,h=!1,m=!1,v=[],g=De($,d.interactiveDebounce),y=ut++,b=(u=d.plugins).filter((function(e,t){return u.indexOf(e)===t})),w={id:y,reference:e,popper:Be(),popperInstance:null,props:d,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:b,clearDelayTimeouts:function(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)},setProps:function(t){0;if(w.state.isDestroyed)return;I("onBeforeUpdate",[w,t]),V();var n=w.props,r=it(e,Object.assign({},w.props,{},t,{ignoreAttributes:!0}));w.props=r,Q(),n.interactiveDebounce!==r.interactiveDebounce&&(F(),g=De($,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?Ie(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");M(),D(),O&&O(n,r);w.popperInstance&&(K(),ee().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));I("onAfterUpdate",[w,t])},setContent:function(e){w.setProps({content:e})},show:function(){0;var e=w.state.isVisible,t=w.state.isDestroyed,n=!w.state.isEnabled,r=Ge.isTouch&&!w.props.touch,i=Te(w.props.duration,0,tt.duration);if(e||t||n||r)return;if(A().hasAttribute("disabled"))return;if(I("onShow",[w],!1),!1===w.props.onShow(w))return;w.state.isVisible=!0,C()&&(x.style.visibility="visible");D(),H(),w.state.isMounted||(x.style.transition="none");if(C()){var o=P(),a=o.box,s=o.content;Ue([a,s],0)}c=function(){var e;if(w.state.isVisible&&!m){if(m=!0,x.offsetHeight,x.style.transition=w.props.moveTransition,C()&&w.props.animation){var t=P(),n=t.box,r=t.content;Ue([n,r],i),We([n,r],"visible")}N(),M(),Ne(pt,w),null==(e=w.popperInstance)||e.forceUpdate(),w.state.isMounted=!0,I("onMount",[w]),w.props.animation&&C()&&function(e,t){U(e,t)}(i,(function(){w.state.isShown=!0,I("onShown",[w])}))}},function(){var e,t=w.props.appendTo,n=A();e=w.props.interactive&&t===tt.appendTo||"parent"===t?n.parentNode:Se(t,[n]);e.contains(x)||e.appendChild(x);K(),!1}()},hide:function(){0;var e=!w.state.isVisible,t=w.state.isDestroyed,n=!w.state.isEnabled,r=Te(w.props.duration,1,tt.duration);if(e||t||n)return;if(I("onHide",[w],!1),!1===w.props.onHide(w))return;w.state.isVisible=!1,w.state.isShown=!1,m=!1,p=!1,C()&&(x.style.visibility="hidden");if(F(),q(),D(),C()){var i=P(),o=i.box,a=i.content;w.props.animation&&(Ue([o,a],r),We([o,a],"hidden"))}N(),M(),w.props.animation?C()&&function(e,t){U(e,(function(){!w.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&t()}))}(r,w.unmount):w.unmount()},hideWithInteractivity:function(e){0;T().addEventListener("mousemove",g),Ne(dt,g),g(e)},enable:function(){w.state.isEnabled=!0},disable:function(){w.hide(),w.state.isEnabled=!1},unmount:function(){0;w.state.isVisible&&w.hide();if(!w.state.isMounted)return;Z(),ee().forEach((function(e){e._tippy.unmount()})),x.parentNode&&x.parentNode.removeChild(x);pt=pt.filter((function(e){return e!==w})),w.state.isMounted=!1,I("onHidden",[w])},destroy:function(){0;if(w.state.isDestroyed)return;w.clearDelayTimeouts(),w.unmount(),V(),delete e._tippy,w.state.isDestroyed=!0,I("onDestroy",[w])}};if(!d.render)return w;var _=d.render(w),x=_.popper,O=_.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+w.id,w.popper=x,e._tippy=w,x._tippy=w;var E=b.map((function(e){return e.fn(w)})),j=e.hasAttribute("aria-expanded");return Q(),M(),D(),I("onCreate",[w]),d.showOnCreate&&te(),x.addEventListener("mouseenter",(function(){w.props.interactive&&w.state.isVisible&&w.clearDelayTimeouts()})),x.addEventListener("mouseleave",(function(e){w.props.interactive&&w.props.trigger.indexOf("mouseenter")>=0&&(T().addEventListener("mousemove",g),g(e))})),w;function L(){var e=w.props.touch;return Array.isArray(e)?e:[e,0]}function k(){return"hold"===L()[0]}function C(){var e;return!!(null==(e=w.props.render)?void 0:e.$$tippy)}function A(){return l||e}function T(){var e=A().parentNode;return e?Qe(e):document}function P(){return ct(x)}function S(e){return w.state.isMounted&&!w.state.isVisible||Ge.isTouch||a&&"focus"===a.type?0:Te(w.props.delay,e?0:1,tt.delay)}function D(){x.style.pointerEvents=w.props.interactive&&w.state.isVisible?"":"none",x.style.zIndex=""+w.props.zIndex}function I(e,t,n){var r;(void 0===n&&(n=!0),E.forEach((function(n){n[e]&&n[e].apply(void 0,t)})),n)&&(r=w.props)[e].apply(r,t)}function N(){var t=w.props.aria;if(t.content){var n="aria-"+t.content,r=x.id;Ie(w.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(w.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var i=t&&t.replace(r,"").trim();i?e.setAttribute(n,i):e.removeAttribute(n)}}))}}function M(){!j&&w.props.aria.expanded&&Ie(w.props.triggerTarget||e).forEach((function(e){w.props.interactive?e.setAttribute("aria-expanded",w.state.isVisible&&e===A()?"true":"false"):e.removeAttribute("aria-expanded")}))}function F(){T().removeEventListener("mousemove",g),dt=dt.filter((function(e){return e!==g}))}function B(e){if(!(Ge.isTouch&&(h||"mousedown"===e.type)||w.props.interactive&&x.contains(e.target))){if(A().contains(e.target)){if(Ge.isTouch)return;if(w.state.isVisible&&w.props.trigger.indexOf("click")>=0)return}else I("onClickOutside",[w,e]);!0===w.props.hideOnClick&&(w.clearDelayTimeouts(),w.hide(),f=!0,setTimeout((function(){f=!1})),w.state.isMounted||q())}}function R(){h=!0}function z(){h=!1}function H(){var e=T();e.addEventListener("mousedown",B,!0),e.addEventListener("touchend",B,Ae),e.addEventListener("touchstart",z,Ae),e.addEventListener("touchmove",R,Ae)}function q(){var e=T();e.removeEventListener("mousedown",B,!0),e.removeEventListener("touchend",B,Ae),e.removeEventListener("touchstart",z,Ae),e.removeEventListener("touchmove",R,Ae)}function U(e,t){var n=P().box;function r(e){e.target===n&&(Ve(n,"remove",r),t())}if(0===e)return t();Ve(n,"remove",s),Ve(n,"add",r),s=r}function W(t,n,r){void 0===r&&(r=!1),Ie(w.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),v.push({node:e,eventType:t,handler:n,options:r})}))}function Q(){var e;k()&&(W("touchstart",G,{passive:!0}),W("touchend",J,{passive:!0})),(e=w.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(W(e,G),e){case"mouseenter":W("mouseleave",J);break;case"focus":W(Ze?"focusout":"blur",X);break;case"focusin":W("focusout",X)}}))}function V(){v.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,i=e.options;t.removeEventListener(n,r,i)})),v=[]}function G(e){var t,n=!1;if(w.state.isEnabled&&!Y(e)&&!f){var r="focus"===(null==(t=a)?void 0:t.type);a=e,l=e.currentTarget,M(),!w.state.isVisible&&ze(e)&&dt.forEach((function(t){return t(e)})),"click"===e.type&&(w.props.trigger.indexOf("mouseenter")<0||p)&&!1!==w.props.hideOnClick&&w.state.isVisible?n=!0:te(e),"click"===e.type&&(p=!n),n&&!r&&ne(e)}}function $(e){var t=e.target,n=A().contains(t)||x.contains(t);"mousemove"===e.type&&n||function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,i=e.popperState,o=e.props.interactiveBorder,a=Me(i.placement),s=i.modifiersData.offset;if(!s)return!0;var c="bottom"===a?s.top.y:0,l="top"===a?s.bottom.y:0,u="right"===a?s.left.x:0,d="left"===a?s.right.x:0,p=t.top-r+c>o,f=r-t.bottom-l>o,h=t.left-n+u>o,m=n-t.right-d>o;return p||f||h||m}))}(ee().concat(x).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:d}:null})).filter(Boolean),e)&&(F(),ne(e))}function J(e){Y(e)||w.props.trigger.indexOf("click")>=0&&p||(w.props.interactive?w.hideWithInteractivity(e):ne(e))}function X(e){w.props.trigger.indexOf("focusin")<0&&e.target!==A()||w.props.interactive&&e.relatedTarget&&x.contains(e.relatedTarget)||ne(e)}function Y(e){return!!Ge.isTouch&&k()!==e.type.indexOf("touch")>=0}function K(){Z();var t=w.props,n=t.popperOptions,r=t.placement,i=t.offset,o=t.getReferenceClientRect,a=t.moveTransition,s=C()?ct(x).arrow:null,l=o?{getBoundingClientRect:o,contextElement:o.contextElement||A()}:e,u=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(C()){var n=P().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}}];C()&&s&&u.push({name:"arrow",options:{element:s,padding:3}}),u.push.apply(u,(null==n?void 0:n.modifiers)||[]),w.popperInstance=Ee(l,x,Object.assign({},n,{placement:r,onFirstUpdate:c,modifiers:u}))}function Z(){w.popperInstance&&(w.popperInstance.destroy(),w.popperInstance=null)}function ee(){return Fe(x.querySelectorAll("[data-tippy-root]"))}function te(e){w.clearDelayTimeouts(),e&&I("onTrigger",[w,e]),H();var t=S(!0),n=L(),i=n[0],o=n[1];Ge.isTouch&&"hold"===i&&o&&(t=o),t?r=setTimeout((function(){w.show()}),t):w.show()}function ne(e){if(w.clearDelayTimeouts(),I("onUntrigger",[w,e]),w.state.isVisible){if(!(w.props.trigger.indexOf("mouseenter")>=0&&w.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&p)){var t=S(!1);t?i=setTimeout((function(){w.state.isVisible&&w.hide()}),t):o=requestAnimationFrame((function(){w.hide()}))}}else q()}}function ht(e,t){void 0===t&&(t={});var n=tt.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",Je,Ae),window.addEventListener("blur",Ye);var r=Object.assign({},t,{plugins:n}),i=qe(e).reduce((function(e,t){var n=t&&ft(t,r);return n&&e.push(n),e}),[]);return Re(e)?i[0]:i}ht.defaultProps=tt,ht.setDefaultProps=function(e){Object.keys(e).forEach((function(t){tt[t]=e[t]}))},ht.currentInput=Ge;Object.assign({},le,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}});ht.setDefaultProps({render:lt});var mt=ht,vt=n(4),gt=n.n(vt);var yt={controlled:null,bind(e){this.controlled=e,this.controlled.forEach((e=>{this._master(e)})),this._init()},_init(){this.controlled.forEach((e=>{this._checkUp(e)}))},_master(e){const t=JSON.parse(e.dataset.master);e.dataset.size&&(e.filesize=parseInt(e.dataset.size,10)),e.masters=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.masters.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.masters&&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.masters&&[...e.masters].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 i="off"!==r;e.checked===i&&e.value===r||(e.value=r,e.checked=i,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;0=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var _t,xt,Ot,Et,jt=n(5),Lt=n.n(jt);n(0),Lt()(console.error);_t={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},xt=["(","?"],Ot={")":["("],":":["?","?:"]},Et=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var kt={"!":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 Ct(e){var t=function(e){for(var t,n,r,i,o=[],a=[];t=e.match(Et);){for(n=t[0],(r=e.substr(0,t.index).trim())&&o.push(r);i=a.pop();){if(Ot[n]){if(Ot[n][0]===i){n=Ot[n][1]||n;break}}else if(xt.indexOf(i)>=0||_t[i]<_t[n]){a.push(i);break}o.push(i)}Ot[n]||a.push(n),e=e.substr(t.index+n.length)}return(e=e.trim())&&o.push(e),o.concat(a.reverse())}(e);return function(e){return function(e,t){var n,r,i,o,a,s,c=[];for(n=0;n3&&void 0!==arguments[3]?arguments[3]:10,a=e[t];if(Mt(n)&&Nt(r))if("function"==typeof i)if("number"==typeof o){var s={callback:i,priority:o,namespace:r};if(a[n]){var c,l=a[n].handlers;for(c=l.length;c>0&&!(o>=l[c-1].priority);c--);c===l.length?l[c]=s:l.splice(c,0,s),a.__current.forEach((function(e){e.name===n&&e.currentIndex>=c&&e.currentIndex++}))}else a[n]={handlers:[s],runs:0};"hookAdded"!==n&&e.doAction("hookAdded",n,r,i,o)}else console.error("If specified, the hook priority must be a number.");else console.error("The hook callback must be a function.")}};var Bt=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(r,i){var o=e[t];if(Mt(r)&&(n||Nt(i))){if(!o[r])return 0;var a=0;if(n)a=o[r].handlers.length,o[r]={runs:o[r].runs,handlers:[]};else for(var s=o[r].handlers,c=function(e){s[e].namespace===i&&(s.splice(e,1),a++,o.__current.forEach((function(t){t.name===r&&t.currentIndex>=e&&t.currentIndex--})))},l=s.length-1;l>=0;l--)c(l);return"hookRemoved"!==r&&e.doAction("hookRemoved",r,i),a}}};var Rt=function(e,t){return function(n,r){var i=e[t];return void 0!==r?n in i&&i[n].handlers.some((function(e){return e.namespace===r})):n in i}};function zt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]&&arguments[2];return function(r){var i=e[t];i[r]||(i[r]={handlers:[],runs:0}),i[r].runs++;var o=i[r].handlers;for(var a=arguments.length,s=new Array(a>1?a-1:0),c=1;c1&&void 0!==arguments[1]?arguments[1]:"default";r.data[t]=St(St(St({},Dt),r.data[t]),e),r.data[t][""]=St(St({},Dt[""]),r.data[t][""])},s=function(e,t){a(e,t),o()},c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;return r.data[e]||a(void 0,e),r.dcnpgettext(e,t,n,i,o)},l=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return e},u=function(e,t,r){var i=c(r,t,e);return n?(i=n.applyFilters("i18n.gettext_with_context",i,e,t,r),n.applyFilters("i18n.gettext_with_context_"+l(r),i,e,t,r)):i};if(e&&s(e,t),n){var d=function(e){It.test(e)&&o()};n.addAction("hookAdded","core/i18n",d),n.addAction("hookRemoved","core/i18n",d)}return{getLocaleData:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return r.data[e]},setLocaleData:s,resetLocaleData:function(e,t){r.data={},r.pluralForms={},s(e,t)},subscribe:function(e){return i.add(e),function(){return i.delete(e)}},__:function(e,t){var r=c(t,void 0,e);return n?(r=n.applyFilters("i18n.gettext",r,e,t),n.applyFilters("i18n.gettext_"+l(t),r,e,t)):r},_x:u,_n:function(e,t,r,i){var o=c(i,void 0,e,t,r);return n?(o=n.applyFilters("i18n.ngettext",o,e,t,r,i),n.applyFilters("i18n.ngettext_"+l(i),o,e,t,r,i)):o},_nx:function(e,t,r,i,o){var a=c(o,i,e,t,r);return n?(a=n.applyFilters("i18n.ngettext_with_context",a,e,t,r,i,o),n.applyFilters("i18n.ngettext_with_context_"+l(o),a,e,t,r,i,o)):a},isRTL:function(){return"rtl"===u("ltr","text direction")},hasTranslation:function(e,t,i){var o,a,s=t?t+""+e:e,c=!(null===(o=r.data)||void 0===o||null===(a=o[null!=i?i:"default"])||void 0===a||!a[s]);return n&&(c=n.applyFilters("i18n.has_translation",c,e,t,i),c=n.applyFilters("i18n.has_translation_"+l(i),c,e,t,i)),c}}}(void 0,void 0,Gt)),Jt=($t.getLocaleData.bind($t),$t.setLocaleData.bind($t),$t.resetLocaleData.bind($t),$t.subscribe.bind($t),$t.__.bind($t));$t._x.bind($t),$t._n.bind($t),$t._nx.bind($t),$t.isRTL.bind($t),$t.hasTranslation.bind($t);function Xt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yt(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function vn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;if(!t||!Object.keys(t).length)return e;var n=e,r=e.indexOf("?");return-1!==r&&(t=Object.assign(hn(e),t),n=n.substr(0,r)),n+"?"+gn(t)}function bn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wn(e){for(var t=1;t]+)>; rel="next"/);return t?{next:t[1]}:{}}(e.headers.get("link")).next},On=function(e){var t=!!e.path&&-1!==e.path.indexOf("per_page=-1"),n=!!e.url&&-1!==e.url.indexOf("per_page=-1");return t||n},En=function(){var e,t=(e=un.a.mark((function e(t,n){var r,i,o,a,s,c;return un.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!1!==t.parse){e.next=2;break}return e.abrupt("return",n(t));case 2:if(On(t)){e.next=4;break}return e.abrupt("return",n(t));case 4:return e.next=6,Wn(wn(wn({},(u={per_page:100},d=void 0,p=void 0,d=(l=t).path,p=l.url,wn(wn({},wt(l,["path","url"])),{},{url:p&&yn(p,u),path:d&&yn(d,u)}))),{},{parse:!1}));case 6:return r=e.sent,e.next=9,_n(r);case 9:if(i=e.sent,Array.isArray(i)){e.next=12;break}return e.abrupt("return",i);case 12:if(o=xn(r)){e.next=15;break}return e.abrupt("return",i);case 15:a=[].concat(i);case 16:if(!o){e.next=27;break}return e.next=19,Wn(wn(wn({},t),{},{path:void 0,url:o,parse:!1}));case 19:return s=e.sent,e.next=22,_n(s);case 22:c=e.sent,a=a.concat(c),o=xn(s),e.next=16;break;case 27:return e.abrupt("return",a);case 28:case"end":return e.stop()}var l,u,d,p}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){cn(o,r,i,a,s,"next",e)}function s(e){cn(o,r,i,a,s,"throw",e)}a(void 0)}))});return function(e,n){return t.apply(this,arguments)}}();function jn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ln(e){for(var t=1;t1&&void 0!==arguments[1])||arguments[1];return t?204===e.status?null:e.json?e.json():Promise.reject(e):e},Tn=function(e){var t={code:"invalid_json",message:Jt("The response is not a valid JSON response.")};if(!e||!e.json)throw t;return e.json().catch((function(){throw t}))},Pn=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Promise.resolve(An(e,t)).catch((function(e){return Sn(e,t)}))};function Sn(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!t)throw e;return Tn(e).then((function(e){var t={code:"unknown_error",message:Jt("An unknown error occurred.")};throw e||t}))}function Dn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function In(e){for(var t=1;t=500&&t.status<600&&n?r(n).catch((function(){return!1!==e.parse?Promise.reject({code:"post_process",message:Jt("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(t)})):Sn(t,e.parse)})).then((function(t){return Pn(t,e.parse)}))};function Mn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Fn(e){for(var t=1;t=200&&e.status<300)return e;throw e},qn=function(e){var t=e.url,n=e.path,r=e.data,i=e.parse,o=void 0===i||i,a=wt(e,["url","path","data","parse"]),s=e.body,c=e.headers;return c=Fn(Fn({},Bn),c),r&&(s=JSON.stringify(r),c["Content-Type"]="application/json"),window.fetch(t||n||window.location.href,Fn(Fn(Fn({},Rn),a),{},{body:s,headers:c})).then((function(e){return Promise.resolve(e).then(Hn).catch((function(e){return Sn(e,o)})).then((function(e){return Pn(e,o)}))}),(function(){throw{code:"fetch_error",message:Jt("You are probably offline.")}}))};function Un(e){return zn.reduceRight((function(e,t){return function(n){return t(n,e)}}),qn)(e).catch((function(t){return"rest_cookie_invalid_nonce"!==t.code?Promise.reject(t):window.fetch(Un.nonceEndpoint).then(Hn).then((function(e){return e.text()})).then((function(t){return Un.nonceMiddleware.nonce=t,Un(e)}))}))}Un.use=function(e){zn.unshift(e)},Un.setFetchHandler=function(e){qn=e},Un.createNonceMiddleware=Kt,Un.createPreloadingMiddleware=sn,Un.createRootURLMiddleware=on,Un.fetchAllMiddleware=En,Un.mediaUploadMiddleware=Nn;var Wn=Un;var Qn={cachePoints:{},spinners:{},init(e){if("undefined"!=typeof CLDCACHE){Wn.use(Wn.createNonceMiddleware(CLDCACHE.nonce));e.querySelectorAll("[data-cache-point]").forEach((e=>this._bind(e)))}},getCachePoint(e){return this.cachePoints["_"+e]?this.cachePoints["_"+e]:null},setCachePoint(e,t){const n=document.createElement("div"),r=this._getRow(),i=document.createElement("td");i.colSpan=2,i.className="cld-loading",r.appendChild(i);const o=document.getElementById(t.dataset.slug),a=document.getElementById(t.dataset.slug+"_search"),s=document.getElementById(t.dataset.slug+"_reload"),c=document.getElementById(t.dataset.browser),l=document.getElementById(t.dataset.apply);c.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)})),s.addEventListener("click",(t=>{this._load(e)})),a.addEventListener("keydown",(t=>{13===t.which&&(t.preventDefault(),t.stopPropagation(),this._load(e))})),n.className="cld-pagenav",l.cacheChanges={disable:[],enable:[],delete:[]},t.master=o,t.search=a,t.controller=c,t.viewer=t.parentNode.parentNode,t.loader=r,t.table=t.parentNode,t.apply=l,t.paginate=n,t.currentPage=1,t.viewer.appendChild(n),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.master.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),t.loaded||this._load(e)):(this.close(t.viewer),t.controller.checked=!1))},_load(e){const t=this.getCachePoint(e);this._clearChildren(t),t.appendChild(t.loader),this.open(t.loader),Wn({path:CLDCACHE.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-master]");yt.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){this.close(e.apply);const t=e.apply.cacheChanges;let n=!1;for(const e in t)t[e].length&&(n=!0);n&&this.open(e.apply)},_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])},_set_state(e,t,n){this._showSpinners(n),Wn({path:CLDCACHE.update_url,data:{state:t,ids:n},method:"POST"}).then((n=>{this._hideSpinners(n),n.forEach((n=>{this.close(e.apply),this._removeFromList(e,n,t),this._evaluateApply(e),e.apply.disabled=""})),"delete"===t&&this._load(e.dataset.cachePoint)}))},_purgeCache(e){Wn({path:CLDCACHE.purge_url,data:{cachePoint:e.dataset.cachePoint},method:"POST"}).then((()=>{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 i=!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"}),i=this._getFile(e,t,n);n.appendChild(i),n.appendChild(r),e.appendChild(n)}))},_buildNav(e,t){e.paginate.innerHTML="";const n=document.createElement("button"),r=document.createElement("button");if(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="left",e.paginate.appendChild(t),t.addEventListener("click",(t=>{confirm(wp.i18n.__("Purge entire cache point?","cloudinary"))&&this._purgeCache(e)}))}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 i=document.createElement("span");i.innerText=t.nav_text,i.className="cld-pagenav-text",e.paginate.appendChild(n),e.paginate.appendChild(i),e.paginate.appendChild(r)},_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},_getFile(e,t){const n=document.createElement("td"),r=document.createElement("label"),i=this._getDeleter(e,n,t);r.innerText=t.short_url,r.htmlFor=t.key,n.appendChild(i),n.appendChild(r);const o=document.createElement("span"),a="spinner_"+t.ID;return o.className="spinner",o.id=a,n.appendChild(o),this.spinners[a]=o,n},_getDeleter(e,t,n){const r=document.createElement("input"),i=[e.dataset.slug+"_deleter"],o=this._getListIndex(e,n.ID,"delete");return r.type="checkbox",r.value=n.ID,r.id=n.key,r.dataset.master=JSON.stringify(i),-1{t.style.opacity=1,t.style.textDecoration="",r.checked&&(t.style.opacity=.8,t.style.textDecoration="line-through");const o=new CustomEvent("CacheToggle",{detail:{checked:r.checked,states:{on:"delete",off:n.active?"enable":"disable"},item:n,cachePoint:e}});window.dispatchEvent(o)})),r},_getStateSwitch(e,t,n){const r=document.createElement("td"),i=document.createElement("label"),o=document.createElement("input"),a=document.createElement("span"),s=[e.dataset.slug+"_selector"],c=this._getListIndex(e,t.ID,"disable");return r.style.textAlign="right",i.className="cld-input-on-off-control mini",o.type="checkbox",o.value=t.ID,o.checked=!(-1{const i=new CustomEvent("CacheToggle",{detail:{checked:o.checked,states:n,item:t,cachePoint:e}});window.dispatchEvent(i)})),r.appendChild(i),r}};const Vn={bindings:{},parent_check_data:{},check_parents:{},_init(e){const t=e.querySelectorAll("[data-condition]"),n=e.querySelectorAll("[data-toggle]"),r=e.querySelectorAll("[data-for]"),i=e.querySelectorAll("[data-tooltip]"),o=e.querySelectorAll("[data-bind-trigger]"),a=e.querySelectorAll("[data-master]"),s=e.querySelectorAll("[data-file]"),c={};yt.bind(a),o.forEach((e=>this._trigger(e))),n.forEach((e=>this._toggle(e))),t.forEach((e=>this._bind(e))),r.forEach((e=>this._alias(e))),s.forEach((e=>this._files(e,c))),mt(i,{theme:"cloudinary",arrow:!1,placement:"bottom-start",aria:{content:"auto",expanded:"auto"},content:t=>e.getElementById(t.getAttribute("data-tooltip")).innerHTML}),[...o].forEach((e=>{e.dispatchEvent(new Event("input"))})),Qn.init(e)},_files(e,t){const n=e.dataset.parent;n&&(this.check_parents[n]=document.getElementById(n),this.parent_check_data[n]||(this.parent_check_data[n]=this.check_parents[n].value?JSON.parse(this.check_parents[n].value):[]),e.addEventListener("change",(()=>{const r=this.parent_check_data[n].indexOf(e.value);e.checked?this.parent_check_data[n].push(e.value):this.parent_check_data[n].splice(r,1),t[n]&&clearTimeout(t[n]),t[n]=setTimeout((()=>{this._compileParent(n)}),10)})))},_compileParent(e){this.check_parents[e].value=JSON.stringify(this.parent_check_data[e]),this.check_parents[e].dispatchEvent(new Event("change"))},_bind(e){e.condition=JSON.parse(e.dataset.condition);for(const t in e.condition)this.bindings[t]&&this.bindings[t].elements.push(e)},_trigger(e){const t=e.dataset.bindTrigger,n=this;n.bindings[t]={input:e,value:e.value,checked:!0,elements:[]},e.addEventListener("change",(function(t){e.dispatchEvent(new Event("input"))})),e.addEventListener("input",(function(){n.bindings[t].value=e.value,"checkbox"!==e.type&&"radio"!==e.type||(n.bindings[t].checked=e.checked);for(const r in n.bindings[t].elements)n.toggle(n.bindings[t].elements[r],e)}))},_alias(e){e.addEventListener("click",(function(){document.getElementById(e.dataset.for).dispatchEvent(new Event("click"))}))},_toggle(e){const t=this;e.addEventListener("click",(function(n){n.stopPropagation();const r=document.querySelector('[data-wrap="'+e.dataset.toggle+'"]'),i=r.classList.contains("open")?"closed":"open";t.toggle(r,e,i)}))},toggle(e,t,n){if(!n){n="open";for(const t in e.condition){let r=this.bindings[t].value;const i=e.condition[t];"boolean"==typeof i&&(r=this.bindings[t].checked),i!==r&&(n="closed")}}const r=e.getElementsByClassName("cld-ui-input");"closed"===n?(e.classList.remove("open"),e.classList.add("closed"),t&&t.classList.contains("dashicons")&&(t.classList.remove("dashicons-arrow-up-alt2"),t.classList.add("dashicons-arrow-down-alt2")),[...r].forEach((function(e){e.dataset.disabled=!0}))):(e.classList.remove("closed"),e.classList.add("open"),t&&t.classList.contains("dashicons")&&(t.classList.remove("dashicons-arrow-down-alt2"),t.classList.add("dashicons-arrow-up-alt2")),[...r].forEach((function(e){e.dataset.disabled=!1})))}};window.addEventListener("load",Vn._init(document));var Gn=Vn;window.$=window.jQuery;const $n={UI:Gn,Settings:i.a,Widget:a.a,GlobalTransformations:c,TermsOrder:u,MediaLibrary:p,Notices:h}}]); \ No newline at end of file +!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=13)}([function(e,t,n){var r;!function(){"use strict";var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function o(e){return s(l(e),arguments)}function a(e,t){return o.apply(null,[e].concat(t||[]))}function s(e,t){var n,r,a,s,c,l,u,d,p,f=1,h=e.length,m="";for(r=0;r=0),s.type){case"b":n=parseInt(n,10).toString(2);break;case"c":n=String.fromCharCode(parseInt(n,10));break;case"d":case"i":n=parseInt(n,10);break;case"j":n=JSON.stringify(n,null,s.width?parseInt(s.width):0);break;case"e":n=s.precision?parseFloat(n).toExponential(s.precision):parseFloat(n).toExponential();break;case"f":n=s.precision?parseFloat(n).toFixed(s.precision):parseFloat(n);break;case"g":n=s.precision?String(Number(n.toPrecision(s.precision))):parseFloat(n);break;case"o":n=(parseInt(n,10)>>>0).toString(8);break;case"s":n=String(n),n=s.precision?n.substring(0,s.precision):n;break;case"t":n=String(!!n),n=s.precision?n.substring(0,s.precision):n;break;case"T":n=Object.prototype.toString.call(n).slice(8,-1).toLowerCase(),n=s.precision?n.substring(0,s.precision):n;break;case"u":n=parseInt(n,10)>>>0;break;case"v":n=n.valueOf(),n=s.precision?n.substring(0,s.precision):n;break;case"x":n=(parseInt(n,10)>>>0).toString(16);break;case"X":n=(parseInt(n,10)>>>0).toString(16).toUpperCase()}i.json.test(s.type)?m+=n:(!i.number.test(s.type)||d&&!s.sign?p="":(p=d?"+":"-",n=n.toString().replace(i.sign,"")),l=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",u=s.width-(p+n).length,c=s.width&&u>0?l.repeat(u):"",m+=s.align?p+n+c:"0"===l?p+c+n:c+p+n)}return m}var c=Object.create(null);function l(e){if(c[e])return c[e];for(var t,n=e,r=[],o=0;n;){if(null!==(t=i.text.exec(n)))r.push(t[0]);else if(null!==(t=i.modulo.exec(n)))r.push("%");else{if(null===(t=i.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(t[2]){o|=1;var a=[],s=t[2],l=[];if(null===(l=i.key.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(a.push(l[1]);""!==(s=s.substring(l[0].length));)if(null!==(l=i.key_access.exec(s)))a.push(l[1]);else{if(null===(l=i.index_access.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");a.push(l[1])}t[2]=a}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");r.push({placeholder:t[0],param_no:t[1],keys:t[2],sign:t[3],pad_char:t[4],align:t[5],width:t[6],precision:t[7],type:t[8]})}n=n.substring(t[0].length)}return c[e]=r}t.sprintf=o,t.vsprintf=a,"undefined"!=typeof window&&(window.sprintf=o,window.vsprintf=a,void 0===(r=function(){return{sprintf:o,vsprintf:a}}.call(t,n,t,e))||(e.exports=r))}()},function(e,t,n){e.exports=n(11)},function(e,t){!function(){const e=function(){const e=jQuery("#field-video_player").val(),t=jQuery("#field-video_controls").prop("checked"),n=jQuery('#field-video_autoplay_mode option[value="off"]');"cld"!==e||t?n.prop("disabled",!1):(n.prop("disabled",!0),n.prop("selected")&&n.next().prop("selected",!0))};e(),jQuery(document).on("change","#field-video_player",e),jQuery(document).on("change","#field-video_controls",e),jQuery(document).ready((function(e){e.isFunction(e.fn.wpColorPicker)&&e(".regular-color").wpColorPicker(),e(document).on("tabs.init",(function(){const t=e(".settings-tab-trigger"),n=e(".settings-tab-section");e(this).on("click",".settings-tab-trigger",(function(r){const i=e(this),o=e(i.attr("href"));r.preventDefault(),t.removeClass("active"),n.removeClass("active"),i.addClass("active"),o.addClass("active"),e(document).trigger("settings.tabbed",i)})),e(".cld-field").not('[data-condition="false"]').each((function(){const t=e(this),n=t.data("condition");for(const r in n){let i=e("#field-"+r);const o=n[r],a=t.closest("tr");i.length||(i=e(`[id^=field-${r}-]`));let s=!1;i.on("change init",(function(e,t=!1){if(s&&t)return;let n=this.value===o||this.checked;if(Array.isArray(o)&&2===o.length)switch(o[1]){case"neq":n=this.value!==o[0];break;case"gt":n=this.value>o[0];break;case"lt":n=this.value=0&&(e.metadata.cldoverwrite="true")})),wp.media.events.on("editor:image-update",(function(e){const t=e.image.className.split(" ");e.metadata.cldoverwrite&&-1===t.indexOf("cld-overwrite")?t.push("cld-overwrite"):!e.metadata.cldoverwrite&&t.indexOf("cld-overwrite")>=0&&delete t[t.indexOf("cld-overwrite")],e.image.className=t.join(" ")}));let e=null;const t=wp.media.string.props;wp.media.string.props=function(n,r){n.cldoverwrite&&(n.classes=["cld-overwrite"],e=!0);return t(n,r)},wp.media.post=function(t,n){if("send-attachment-to-editor"===t){const t=wp.media.editor.get().state().get("selection").get(n.attachment);t.attributes.transformations&&(n.attachment.transformations=t.attributes.transformations),(n.html.indexOf("cld-overwrite")>-1||!0===e)&&(n.attachment.cldoverwrite=!0,e=null)}return wp.ajax.post(t,n)};const n=wp.media.view.MediaFrame.Select,r=wp.media.view.MediaFrame.Post,i=wp.media.view.MediaFrame.ImageDetails,o=wp.media.view.MediaFrame.VideoDetails,a=wp.media.View.extend({tagName:"div",className:"cloudinary-widget",template:wp.template("cloudinary-dam"),active:!1,toolbar:null,frame:null,ready(){const e=this.controller,t=this.model.get("selection"),n=this.model.get("library"),r=wp.media.model.Attachment;if(CLDN.mloptions.multiple=e.options.multiple,this.cid!==this.active){if(CLDN.mloptions.inline_container="#cloudinary-dam-"+e.cid,1===t.length){const e=r.get(t.models[0].id);void 0!==e.attributes.public_id&&(CLDN.mloptions.asset={resource_id:e.attributes.public_id})}else CLDN.mloptions.asset=null;try{CLDN.mloptions.folder||(CLDN.mloptions.folder={path:""});const e=t.props.attributes.type;CLDN.mloptions.folder.resource_type=Array.isArray(e)?e[0]:e}catch(e){}window.ml=cloudinary.openMediaLibrary(CLDN.mloptions,{insertHandler(i){for(let o=0;o0;a--)s/=o;return s.toFixed(2)},r.human=function(e){var t=r.calculate(e);return t.fixed+r.spacer+t.suffix},r}},e.exports?e.exports=a():(i=[],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){e.exports=function(e,t){var n,r,i=0;function o(){var o,a,s=n,c=arguments.length;e:for(;s;){if(s.args.length===arguments.length){for(a=0;a'+t),t=t.replace(/(?:\r\n|\r|\n|\t| )srcset=/g," data-lazy-srcset=").replace(/(?:\r\n|\r|\n|\t| )src=/g,' src="'+r+'" data-lazy-src='))),t}(e);t.firstChild;)o||!a||void 0===n||!t.firstChild.tagName||"img"!==t.firstChild.tagName.toLowerCase()&&"iframe"!==t.firstChild.tagName.toLowerCase()||n.observe(t.firstChild),e.parentNode.insertBefore(t.firstChild,e);e.parentNode.removeChild(e)}function l(){document.querySelectorAll("noscript.loading-lazy").forEach(c),void 0!==window.matchMedia&&window.matchMedia("print").addListener((function(e){e.matches&&document.querySelectorAll(i.lazyImage+"[data-lazy-src],"+i.lazyIframe+"[data-lazy-src]").forEach((function(e){s(e)}))}))}"undefined"!=typeof NodeList&&NodeList.prototype&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),"IntersectionObserver"in window&&(n=new IntersectionObserver((function(e,t){e.forEach((function(e){if(0!==e.intersectionRatio){var n=e.target;t.unobserve(n),s(n)}}))}),i)),r="requestAnimationFrame"in window?window.requestAnimationFrame:function(e){e()},/comp|inter/.test(document.readyState)?r(l):"addEventListener"in document?document.addEventListener("DOMContentLoaded",(function(){r(l)})):document.attachEvent("onreadystatechange",(function(){"complete"===document.readyState&&l()}))}()},function(e,t){const n=document.querySelector(".cloudinary-collapsible__toggle");n&&n.addEventListener("click",(function(){const e=document.querySelector(".cloudinary-collapsible__content"),t="none"===window.getComputedStyle(e,null).getPropertyValue("display"),n=document.querySelector(".cloudinary-collapsible__toggle button i");e.style.display=t?"block":"none";const r="dashicons-arrow-down-alt2",i="dashicons-arrow-up-alt2";n.classList.contains(r)?(n.classList.remove(r),n.classList.add(i)):(n.classList.remove(i),n.classList.add(r))}))},function(e,t,n){var r=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof v?t:v,o=Object.create(i.prototype),a=new C(r||[]);return o._invoke=function(e,t,n){var r=d;return function(i,o){if(r===f)throw new Error("Generator is already running");if(r===h){if("throw"===i)throw o;return T()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=j(a,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var c=u(e,t,n);if("normal"===c.type){if(r=n.done?h:p,c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=h,n.method="throw",n.arg=c.arg)}}}(e,n,a),o}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var d="suspendedStart",p="suspendedYield",f="executing",h="completed",m={};function v(){}function g(){}function y(){}var b={};b[o]=function(){return this};var w=Object.getPrototypeOf,_=w&&w(w(A([])));_&&_!==n&&r.call(_,o)&&(b=_);var x=y.prototype=v.prototype=Object.create(b);function O(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function n(i,o,a,s){var c=u(e[i],e,o);if("throw"!==c.type){var l=c.arg,d=l.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(d).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,s)}))}s(c.arg)}var i;this._invoke=function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}}function j(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,j(e,n),"throw"===n.method))return m;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var i=u(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function A(e){if(e){var n=e[o];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function n(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=r}catch(e){Function("r","regeneratorRuntime = r")(r)}},,function(e,t,n){"use strict";n.r(t),n.d(t,"cloudinary",(function(){return $n}));n(9),n(10);var r=n(2),i=n.n(r),o=n(3),a=n.n(o);const s={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_optimization"),video:document.getElementById("video_optimization")},error_container:document.getElementById("cld-preview-error"),activeItem:null,elements:{image:[],video:[]},_placeItem(e){null!==e&&(e.style.display="block",e.style.visibility="visible",e.style.position="absolute",e.style.top=e.parentElement.clientHeight/2-e.clientHeight/2+"px",e.style.left=e.parentElement.clientWidth/2-e.clientWidth/2+"px")},_setLoading(e){this.button[e].style.display="block",this._placeItem(this.button[e]),this.preview[e].style.opacity="0.1"},_build(e){this.sample[e].innerHTML="",this.elements[e]=[];for(const t of this.fields){if(e!==t.dataset.context||t.dataset.disabled&&"true"===t.dataset.disabled)continue;let n=t.value.trim();if(n.length){if("select-one"===t.type){if("none"===n||!1===this.optimization[e].checked)continue;n=t.dataset.meta+"_"+n}else e=t.dataset.context,t.dataset.meta&&(n=t.dataset.meta+"_"+n),t.dataset.suffix&&(n+=t.dataset.suffix),n=this._transformations(n,e,!0);n&&this.elements[e].push(n)}}let t="";this.elements[e].length&&(t="/"+this._getGlobalTransformationElements(e).replace(/ /g,"%20")),this.sample[e].textContent=t,this.sample[e].parentElement.href="https://res.cloudinary.com/demo/"+this.sample[e].parentElement.innerText.trim().replace("../","").replace(/ /g,"%20")},_clearLoading(e){this.spinner[e].style.visibility="hidden",this.activeItem=null,this.preview[e].style.opacity=1},_refresh(e,t){e&&e.preventDefault();const n=this,r=CLD_GLOBAL_TRANSFORMATIONS[t].preview_url+this._getGlobalTransformationElements(t)+CLD_GLOBAL_TRANSFORMATIONS[t].file;if(this.button[t].style.display="none",this._placeItem(this.spinner[t]),"image"===t){const e=new Image;e.onload=function(){n.preview[t].src=this.src,n._clearLoading(t),n.error_container&&(n.error_container.style.display="none"),e.remove()},e.onerror=function(){const e=n.elements[t].includes("f_mp4");n.error_container&&(n.error_container.style.display="block",e?(n.error_container.innerHTML=CLD_GLOBAL_TRANSFORMATIONS[t].warning.replace("%s","f_mp4"),n.error_container.classList.replace("settings-alert-error","settings-alert-warning")):(n.error_container.innerHTML=CLD_GLOBAL_TRANSFORMATIONS[t].error,n.error_container.classList.replace("settings-alert-warning","settings-alert-error"))),n._clearLoading(t)},e.src=r}else{const e=n._transformations(n._getGlobalTransformationElements(t),t);samplePlayer.source({publicId:"dog",transformation:e}),n._clearLoading(t)}},_getGlobalTransformationElements(e){let t=[];return t.push(this.elements[e].slice(0,2).join(",")),t.push(this.elements[e].slice(2).join(",")),t=t.filter((e=>e)).join("/"),t},_transformations(e,t,n=!1){const r=CLD_GLOBAL_TRANSFORMATIONS[t].valid_types;let i=null;const o=e.split("/"),a=[];for(let e=0;e{const r=!!n.length&&jQuery('[data-item="'+i+":"+n[0].id+'"]');r.length?r.remove():(jQuery(`.cld-tax-order-list-item:contains(${a})`).remove(),--e.startId),this.processTags(t)}))}),jQuery("body").on("change",".selectit input",(function(){const t=jQuery(this),n=t.val(),r=t.is(":checked"),i=t.parent().text().trim();!0===r?e.tags.find(`[data-item="category:${n}"]`).length||e._pushItem(`category:${n}`,i):e.tags.find(`[data-item="category:${n}"]`).remove()}))},_createItem(e,t){const n=jQuery("
  • "),r=jQuery(""),i=jQuery("");return n.addClass("cld-tax-order-list-item").attr("data-item",e),i.addClass("cld-tax-order-list-item-input").attr("type","hidden").attr("name","cld_tax_order[]").val(e),r.addClass("dashicons dashicons-menu cld-tax-order-list-item-handle"),n.append(r).append(t).append(i),n},_pushItem(e,t){const n=this._createItem(e,t);this.tags.append(n)},_sortable(){jQuery(".cld-tax-order-list").sortable({connectWith:".cld-tax-order",axis:"y",handle:".cld-tax-order-list-item-handle",placeholder:"cld-tax-order-list-item-placeholder",forcePlaceholderSize:!0,helper:"clone"})}};if(void 0!==window.CLDN&&(l._init(),jQuery("[data-wp-lists] .selectit input[checked]").each(((e,t)=>{jQuery(t).trigger("change")}))),wp.data&&wp.data.select("core/editor")){const e={};wp.data.subscribe((function(){const t=wp.data.select("core").getTaxonomies();if(t)for(const n in t){const r=wp.data.select("core/editor").getEditedPostAttribute(t[n].rest_base);e[t[n].slug]=r}}));const t=wp.element.createElement,n=n=>{class r extends n{constructor(e){super(e),this.currentItems=jQuery(".cld-tax-order-list-item").map(((e,t)=>jQuery(t).data("item"))).get()}makeItem(e){if(this.currentItems.includes(this.getId(e)))return;const t=this.makeElement(e);jQuery("#cld-tax-items").append(t)}removeItem(e){const t=jQuery(`[data-item="${this.getId(e)}"]`);t.length&&(t.remove(),this.currentItems=this.currentItems.filter((t=>t!==this.getId(e))))}findOrCreateTerm(e){return(e=super.findOrCreateTerm(e)).then((e=>this.makeItem(e))),e}onChange(t){super.onChange(t);const n=this.pickItem(t);n&&(e[this.props.slug].includes(n.id)?this.makeItem(n):this.removeItem(n))}pickItem(e){if("object"==typeof e){if(e.target){for(const t in this.state.availableTerms)if(this.state.availableTerms[t].id===parseInt(e.target.value))return this.state.availableTerms[t]}else if(Array.isArray(e)){let t=this.state.selectedTerms.filter((t=>!e.includes(t)))[0];return void 0===t&&(t=e.filter((e=>!this.state.selectedTerms.includes(e)))[0]),this.state.availableTerms.find((e=>e.name===t))}}else if("number"==typeof e){for(const t in this.state.availableTerms)if(this.state.availableTerms[t].id===e)return this.state.availableTerms[t]}else{let t;if(e.length>this.state.selectedTerms.length)for(const n in e)-1===this.state.selectedTerms.indexOf(e[n])&&(t=e[n]);else for(const n in this.state.selectedTerms)-1===e.indexOf(this.state.selectedTerms[n])&&(t=this.state.selectedTerms[n]);for(const e in this.state.availableTerms)if(this.state.availableTerms[e].name===t)return this.state.availableTerms[e]}}getId(e){return`${this.props.slug}:${e.id}`}makeElement(e){const t=jQuery("
  • "),n=jQuery(""),r=jQuery("");return t.addClass("cld-tax-order-list-item").attr("data-item",this.getId(e)),r.addClass("cld-tax-order-list-item-input").attr("type","hidden").attr("name","cld_tax_order[]").val(this.getId(e)),n.addClass("dashicons dashicons-menu cld-tax-order-list-item-handle"),t.append(n).append(e.name).append(r),t}}return e=>t(r,e)};wp.hooks.addFilter("editor.PostTaxonomyType","cld",n)}var u=l;const d={wpWrap:document.getElementById("wpwrap"),wpContent:document.getElementById("wpbody-content"),libraryWrap:document.getElementById("cloudinary-embed"),_init(){const e=this;"undefined"!=typeof CLD_ML&&(cloudinary.openMediaLibrary(CLD_ML.mloptions,{insertHandler(){alert("Import is not yet implemented.")}}),window.addEventListener("resize",(function(){e._resize()})),e._resize())},_resize(){const e=getComputedStyle(this.wpContent);this.libraryWrap.style.height=this.wpWrap.offsetHeight-parseInt(e.getPropertyValue("padding-bottom"))+"px"}};var p=d;d._init();const f={_init(){const e=this;if("undefined"!=typeof CLDIS){[...document.getElementsByClassName("cld-notice-box")].forEach((t=>{const n=t.getElementsByClassName("notice-dismiss");n.length&&n[0].addEventListener("click",(n=>{t.style.height=t.offsetHeight+"px",n.preventDefault(),setTimeout((function(){e._dismiss(t)}),5)}))}))}},_dismiss(e){const t=e.dataset.dismiss,n=parseInt(e.dataset.duration);e.classList.add("dismissed"),e.style.height="0px",setTimeout((function(){e.remove()}),400),0=0?e.ownerDocument.body:b(e)&&j(e)?e:A(C(e))}function T(e,t){var n;void 0===t&&(t=[]);var r=A(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=v(r),a=i?[o].concat(o.visualViewport||[],j(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(T(C(a)))}function P(e){return["table","td","th"].indexOf(_(e))>=0}function S(e){return b(e)&&"fixed"!==E(e).position?e.offsetParent:null}function D(e){for(var t=v(e),n=S(e);n&&P(n)&&"static"===E(n).position;)n=S(n);return n&&("html"===_(n)||"body"===_(n)&&"static"===E(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&b(e)&&"fixed"===E(e).position)return null;for(var n=C(e);b(n)&&["html","body"].indexOf(_(n))<0;){var r=E(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}var I="top",N="bottom",M="right",F="left",B="auto",R=[I,N,M,F],z="start",H="end",q="viewport",U="popper",W=R.reduce((function(e,t){return e.concat([t+"-"+z,t+"-"+H])}),[]),Q=[].concat(R,[B]).reduce((function(e,t){return e.concat([t,t+"-"+z,t+"-"+H])}),[]),V=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function G(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),r}var $={placement:"bottom",modifiers:[],strategy:"absolute"};function J(){for(var e=arguments.length,t=new Array(e),n=0;n=0?"x":"y"}function ne(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?Z(i):null,a=i?ee(i):null,s=n.x+n.width/2-r.width/2,c=n.y+n.height/2-r.height/2;switch(o){case I:t={x:s,y:n.y-r.height};break;case N:t={x:s,y:n.y+n.height};break;case M:t={x:n.x+n.width,y:c};break;case F:t={x:n.x-r.width,y:c};break;default:t={x:n.x,y:n.y}}var l=o?te(o):null;if(null!=l){var u="y"===l?"height":"width";switch(a){case z:t[l]=t[l]-(n[u]/2-r[u]/2);break;case H:t[l]=t[l]+(n[u]/2-r[u]/2)}}return t}var re={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=ne({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},ie=Math.max,oe=Math.min,ae=Math.round,se={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ce(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.offsets,a=e.position,s=e.gpuAcceleration,c=e.adaptive,l=e.roundOffsets,u=!0===l?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:ae(ae(t*r)/r)||0,y:ae(ae(n*r)/r)||0}}(o):"function"==typeof l?l(o):o,d=u.x,p=void 0===d?0:d,f=u.y,h=void 0===f?0:f,m=o.hasOwnProperty("x"),g=o.hasOwnProperty("y"),y=F,b=I,w=window;if(c){var _=D(n),O="clientHeight",j="clientWidth";_===v(n)&&"static"!==E(_=x(n)).position&&(O="scrollHeight",j="scrollWidth"),_=_,i===I&&(b=N,h-=_[O]-r.height,h*=s?1:-1),i===F&&(y=M,p-=_[j]-r.width,p*=s?1:-1)}var L,k=Object.assign({position:a},c&&se);return s?Object.assign({},k,((L={})[b]=g?"0":"",L[y]=m?"0":"",L.transform=(w.devicePixelRatio||1)<2?"translate("+p+"px, "+h+"px)":"translate3d("+p+"px, "+h+"px, 0)",L)):Object.assign({},k,((t={})[b]=g?h+"px":"",t[y]=m?p+"px":"",t.transform="",t))}var le={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];b(i)&&_(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],i=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});b(r)&&_(r)&&(Object.assign(r.style,o),Object.keys(i).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};var ue={left:"right",right:"left",bottom:"top",top:"bottom"};function de(e){return e.replace(/left|right|bottom|top/g,(function(e){return ue[e]}))}var pe={start:"end",end:"start"};function fe(e){return e.replace(/start|end/g,(function(e){return pe[e]}))}function he(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&w(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function me(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){return t===q?me(function(e){var t=v(e),n=x(e),r=t.visualViewport,i=n.clientWidth,o=n.clientHeight,a=0,s=0;return r&&(i=r.width,o=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,s=r.offsetTop)),{width:i,height:o,x:a+O(e),y:s}}(e)):b(t)?function(e){var t=m(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):me(function(e){var t,n=x(e),r=g(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=ie(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=ie(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+O(e),c=-r.scrollTop;return"rtl"===E(i||n).direction&&(s+=ie(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:c}}(x(e)))}function ge(e,t,n){var r="clippingParents"===t?function(e){var t=T(C(e)),n=["absolute","fixed"].indexOf(E(e).position)>=0&&b(e)?D(e):e;return y(n)?t.filter((function(e){return y(e)&&he(e,n)&&"body"!==_(e)})):[]}(e):[].concat(t),i=[].concat(r,[n]),o=i[0],a=i.reduce((function(t,n){var r=ve(e,n);return t.top=ie(r.top,t.top),t.right=oe(r.right,t.right),t.bottom=oe(r.bottom,t.bottom),t.left=ie(r.left,t.left),t}),ve(e,o));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ye(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function be(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function we(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=void 0===r?e.placement:r,o=n.boundary,a=void 0===o?"clippingParents":o,s=n.rootBoundary,c=void 0===s?q:s,l=n.elementContext,u=void 0===l?U:l,d=n.altBoundary,p=void 0!==d&&d,f=n.padding,h=void 0===f?0:f,v=ye("number"!=typeof h?h:be(h,R)),g=u===U?"reference":U,b=e.elements.reference,w=e.rects.popper,_=e.elements[p?g:u],O=ge(y(_)?_:_.contextElement||x(e.elements.popper),a,c),E=m(b),j=ne({reference:E,element:w,strategy:"absolute",placement:i}),L=me(Object.assign({},w,j)),k=u===U?L:E,C={top:O.top-k.top+v.top,bottom:k.bottom-O.bottom+v.bottom,left:O.left-k.left+v.left,right:k.right-O.right+v.right},A=e.modifiersData.offset;if(u===U&&A){var T=A[i];Object.keys(C).forEach((function(e){var t=[M,N].indexOf(e)>=0?1:-1,n=[I,N].indexOf(e)>=0?"y":"x";C[e]+=T[n]*t}))}return C}function _e(e,t,n){return ie(e,oe(t,n))}function xe(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Oe(e){return[I,M,N,F].some((function(t){return e[t]>=0}))}var Ee=X({defaultModifiers:[K,re,{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,a=void 0===o||o,s=n.roundOffsets,c=void 0===s||s,l={placement:Z(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,ce(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,ce(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},le,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=void 0===i?[0,0]:i,a=Q.reduce((function(e,n){return e[n]=function(e,t,n){var r=Z(e),i=[F,I].indexOf(r)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[F,M].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,o),e}),{}),s=a[t.placement],c=s.x,l=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=a}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0===a||a,c=n.fallbackPlacements,l=n.padding,u=n.boundary,d=n.rootBoundary,p=n.altBoundary,f=n.flipVariations,h=void 0===f||f,m=n.allowedAutoPlacements,v=t.options.placement,g=Z(v),y=c||(g===v||!h?[de(v)]:function(e){if(Z(e)===B)return[];var t=de(e);return[fe(e),t,fe(t)]}(v)),b=[v].concat(y).reduce((function(e,n){return e.concat(Z(n)===B?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,l=void 0===c?Q:c,u=ee(r),d=u?s?W:W.filter((function(e){return ee(e)===u})):R,p=d.filter((function(e){return l.indexOf(e)>=0}));0===p.length&&(p=d);var f=p.reduce((function(t,n){return t[n]=we(e,{placement:n,boundary:i,rootBoundary:o,padding:a})[Z(n)],t}),{});return Object.keys(f).sort((function(e,t){return f[e]-f[t]}))}(t,{placement:n,boundary:u,rootBoundary:d,padding:l,flipVariations:h,allowedAutoPlacements:m}):n)}),[]),w=t.rects.reference,_=t.rects.popper,x=new Map,O=!0,E=b[0],j=0;j=0,T=A?"width":"height",P=we(t,{placement:L,boundary:u,rootBoundary:d,altBoundary:p,padding:l}),S=A?C?M:F:C?N:I;w[T]>_[T]&&(S=de(S));var D=de(S),H=[];if(o&&H.push(P[k]<=0),s&&H.push(P[S]<=0,P[D]<=0),H.every((function(e){return e}))){E=L,O=!1;break}x.set(L,H)}if(O)for(var q=function(e){var t=b.find((function(t){var n=x.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return E=t,"break"},U=h?3:1;U>0;U--){if("break"===q(U))break}t.placement!==E&&(t.modifiersData[r]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0!==a&&a,c=n.boundary,l=n.rootBoundary,u=n.altBoundary,d=n.padding,p=n.tether,f=void 0===p||p,h=n.tetherOffset,m=void 0===h?0:h,v=we(t,{boundary:c,rootBoundary:l,padding:d,altBoundary:u}),g=Z(t.placement),y=ee(t.placement),b=!y,w=te(g),_="x"===w?"y":"x",x=t.modifiersData.popperOffsets,O=t.rects.reference,E=t.rects.popper,j="function"==typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,L={x:0,y:0};if(x){if(o||s){var C="y"===w?I:F,A="y"===w?N:M,T="y"===w?"height":"width",P=x[w],S=x[w]+v[C],B=x[w]-v[A],R=f?-E[T]/2:0,H=y===z?O[T]:E[T],q=y===z?-E[T]:-O[T],U=t.elements.arrow,W=f&&U?k(U):{width:0,height:0},Q=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},V=Q[C],G=Q[A],$=_e(0,O[T],W[T]),J=b?O[T]/2-R-$-V-j:H-$-V-j,X=b?-O[T]/2+R+$+G+j:q+$+G+j,Y=t.elements.arrow&&D(t.elements.arrow),K=Y?"y"===w?Y.clientTop||0:Y.clientLeft||0:0,ne=t.modifiersData.offset?t.modifiersData.offset[t.placement][w]:0,re=x[w]+J-ne-K,ae=x[w]+X-ne;if(o){var se=_e(f?oe(S,re):S,P,f?ie(B,ae):B);x[w]=se,L[w]=se-P}if(s){var ce="x"===w?I:F,le="x"===w?N:M,ue=x[_],de=ue+v[ce],pe=ue-v[le],fe=_e(f?oe(de,re):de,ue,f?ie(pe,ae):pe);x[_]=fe,L[_]=fe-ue}}t.modifiersData[r]=L}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Z(n.placement),c=te(s),l=[F,M].indexOf(s)>=0?"height":"width";if(o&&a){var u=function(e,t){return ye("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:be(e,R))}(i.padding,n),d=k(o),p="y"===c?I:F,f="y"===c?N:M,h=n.rects.reference[l]+n.rects.reference[c]-a[c]-n.rects.popper[l],m=a[c]-n.rects.reference[c],v=D(o),g=v?"y"===c?v.clientHeight||0:v.clientWidth||0:0,y=h/2-m/2,b=u[p],w=g-d[l]-u[f],_=g/2-d[l]/2+y,x=_e(b,_,w),O=c;n.modifiersData[r]=((t={})[O]=x,t.centerOffset=x-_,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&he(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=we(t,{elementContext:"reference"}),s=we(t,{altBoundary:!0}),c=xe(a,r),l=xe(s,i,o),u=Oe(c),d=Oe(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}}]}),je="tippy-content",Le="tippy-backdrop",ke="tippy-arrow",Ce="tippy-svg-arrow",Ae={passive:!0,capture:!0};function Te(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function Pe(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function Se(e,t){return"function"==typeof e?e.apply(void 0,t):e}function De(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function Ie(e){return[].concat(e)}function Ne(e,t){-1===e.indexOf(t)&&e.push(t)}function Me(e){return e.split("-")[0]}function Fe(e){return[].slice.call(e)}function Be(){return document.createElement("div")}function Re(e){return["Element","Fragment"].some((function(t){return Pe(e,t)}))}function ze(e){return Pe(e,"MouseEvent")}function He(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function qe(e){return Re(e)?[e]:function(e){return Pe(e,"NodeList")}(e)?Fe(e):Array.isArray(e)?e:Fe(document.querySelectorAll(e))}function Ue(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function We(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function Qe(e){var t,n=Ie(e)[0];return(null==n||null==(t=n.ownerDocument)?void 0:t.body)?n.ownerDocument:document}function Ve(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}var Ge={isTouch:!1},$e=0;function Je(){Ge.isTouch||(Ge.isTouch=!0,window.performance&&document.addEventListener("mousemove",Xe))}function Xe(){var e=performance.now();e-$e<20&&(Ge.isTouch=!1,document.removeEventListener("mousemove",Xe)),$e=e}function Ye(){var e=document.activeElement;if(He(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var Ke="undefined"!=typeof window&&"undefined"!=typeof document?navigator.userAgent:"",Ze=/MSIE |Trident\//.test(Ke);var et={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},tt=Object.assign({appendTo:function(){return document.body},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},et,{},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),nt=Object.keys(tt);function rt(e){var t=(e.plugins||[]).reduce((function(t,n){var r=n.name,i=n.defaultValue;return r&&(t[r]=void 0!==e[r]?e[r]:i),t}),{});return Object.assign({},e,{},t)}function it(e,t){var n=Object.assign({},t,{content:Se(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(rt(Object.assign({},tt,{plugins:t}))):nt).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},tt.aria,{},n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function ot(e,t){e.innerHTML=t}function at(e){var t=Be();return!0===e?t.className=ke:(t.className=Ce,Re(e)?t.appendChild(e):ot(t,e)),t}function st(e,t){Re(t.content)?(ot(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?ot(e,t.content):e.textContent=t.content)}function ct(e){var t=e.firstElementChild,n=Fe(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(je)})),arrow:n.find((function(e){return e.classList.contains(ke)||e.classList.contains(Ce)})),backdrop:n.find((function(e){return e.classList.contains(Le)}))}}function lt(e){var t=Be(),n=Be();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Be();function i(n,r){var i=ct(t),o=i.box,a=i.content,s=i.arrow;r.theme?o.setAttribute("data-theme",r.theme):o.removeAttribute("data-theme"),"string"==typeof r.animation?o.setAttribute("data-animation",r.animation):o.removeAttribute("data-animation"),r.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?o.setAttribute("role",r.role):o.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||st(a,e.props),r.arrow?s?n.arrow!==r.arrow&&(o.removeChild(s),o.appendChild(at(r.arrow))):o.appendChild(at(r.arrow)):s&&o.removeChild(s)}return r.className=je,r.setAttribute("data-state","hidden"),st(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props),{popper:t,onUpdate:i}}lt.$$tippy=!0;var ut=1,dt=[],pt=[];function ft(e,t){var n,r,i,o,a,s,c,l,u,d=it(e,Object.assign({},tt,{},rt((n=t,Object.keys(n).reduce((function(e,t){return void 0!==n[t]&&(e[t]=n[t]),e}),{}))))),p=!1,f=!1,h=!1,m=!1,v=[],g=De($,d.interactiveDebounce),y=ut++,b=(u=d.plugins).filter((function(e,t){return u.indexOf(e)===t})),w={id:y,reference:e,popper:Be(),popperInstance:null,props:d,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:b,clearDelayTimeouts:function(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)},setProps:function(t){0;if(w.state.isDestroyed)return;I("onBeforeUpdate",[w,t]),V();var n=w.props,r=it(e,Object.assign({},w.props,{},t,{ignoreAttributes:!0}));w.props=r,Q(),n.interactiveDebounce!==r.interactiveDebounce&&(F(),g=De($,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?Ie(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");M(),D(),O&&O(n,r);w.popperInstance&&(K(),ee().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));I("onAfterUpdate",[w,t])},setContent:function(e){w.setProps({content:e})},show:function(){0;var e=w.state.isVisible,t=w.state.isDestroyed,n=!w.state.isEnabled,r=Ge.isTouch&&!w.props.touch,i=Te(w.props.duration,0,tt.duration);if(e||t||n||r)return;if(A().hasAttribute("disabled"))return;if(I("onShow",[w],!1),!1===w.props.onShow(w))return;w.state.isVisible=!0,C()&&(x.style.visibility="visible");D(),H(),w.state.isMounted||(x.style.transition="none");if(C()){var o=P(),a=o.box,s=o.content;Ue([a,s],0)}c=function(){var e;if(w.state.isVisible&&!m){if(m=!0,x.offsetHeight,x.style.transition=w.props.moveTransition,C()&&w.props.animation){var t=P(),n=t.box,r=t.content;Ue([n,r],i),We([n,r],"visible")}N(),M(),Ne(pt,w),null==(e=w.popperInstance)||e.forceUpdate(),w.state.isMounted=!0,I("onMount",[w]),w.props.animation&&C()&&function(e,t){U(e,t)}(i,(function(){w.state.isShown=!0,I("onShown",[w])}))}},function(){var e,t=w.props.appendTo,n=A();e=w.props.interactive&&t===tt.appendTo||"parent"===t?n.parentNode:Se(t,[n]);e.contains(x)||e.appendChild(x);K(),!1}()},hide:function(){0;var e=!w.state.isVisible,t=w.state.isDestroyed,n=!w.state.isEnabled,r=Te(w.props.duration,1,tt.duration);if(e||t||n)return;if(I("onHide",[w],!1),!1===w.props.onHide(w))return;w.state.isVisible=!1,w.state.isShown=!1,m=!1,p=!1,C()&&(x.style.visibility="hidden");if(F(),q(),D(),C()){var i=P(),o=i.box,a=i.content;w.props.animation&&(Ue([o,a],r),We([o,a],"hidden"))}N(),M(),w.props.animation?C()&&function(e,t){U(e,(function(){!w.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&t()}))}(r,w.unmount):w.unmount()},hideWithInteractivity:function(e){0;T().addEventListener("mousemove",g),Ne(dt,g),g(e)},enable:function(){w.state.isEnabled=!0},disable:function(){w.hide(),w.state.isEnabled=!1},unmount:function(){0;w.state.isVisible&&w.hide();if(!w.state.isMounted)return;Z(),ee().forEach((function(e){e._tippy.unmount()})),x.parentNode&&x.parentNode.removeChild(x);pt=pt.filter((function(e){return e!==w})),w.state.isMounted=!1,I("onHidden",[w])},destroy:function(){0;if(w.state.isDestroyed)return;w.clearDelayTimeouts(),w.unmount(),V(),delete e._tippy,w.state.isDestroyed=!0,I("onDestroy",[w])}};if(!d.render)return w;var _=d.render(w),x=_.popper,O=_.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+w.id,w.popper=x,e._tippy=w,x._tippy=w;var E=b.map((function(e){return e.fn(w)})),j=e.hasAttribute("aria-expanded");return Q(),M(),D(),I("onCreate",[w]),d.showOnCreate&&te(),x.addEventListener("mouseenter",(function(){w.props.interactive&&w.state.isVisible&&w.clearDelayTimeouts()})),x.addEventListener("mouseleave",(function(e){w.props.interactive&&w.props.trigger.indexOf("mouseenter")>=0&&(T().addEventListener("mousemove",g),g(e))})),w;function L(){var e=w.props.touch;return Array.isArray(e)?e:[e,0]}function k(){return"hold"===L()[0]}function C(){var e;return!!(null==(e=w.props.render)?void 0:e.$$tippy)}function A(){return l||e}function T(){var e=A().parentNode;return e?Qe(e):document}function P(){return ct(x)}function S(e){return w.state.isMounted&&!w.state.isVisible||Ge.isTouch||a&&"focus"===a.type?0:Te(w.props.delay,e?0:1,tt.delay)}function D(){x.style.pointerEvents=w.props.interactive&&w.state.isVisible?"":"none",x.style.zIndex=""+w.props.zIndex}function I(e,t,n){var r;(void 0===n&&(n=!0),E.forEach((function(n){n[e]&&n[e].apply(void 0,t)})),n)&&(r=w.props)[e].apply(r,t)}function N(){var t=w.props.aria;if(t.content){var n="aria-"+t.content,r=x.id;Ie(w.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(w.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var i=t&&t.replace(r,"").trim();i?e.setAttribute(n,i):e.removeAttribute(n)}}))}}function M(){!j&&w.props.aria.expanded&&Ie(w.props.triggerTarget||e).forEach((function(e){w.props.interactive?e.setAttribute("aria-expanded",w.state.isVisible&&e===A()?"true":"false"):e.removeAttribute("aria-expanded")}))}function F(){T().removeEventListener("mousemove",g),dt=dt.filter((function(e){return e!==g}))}function B(e){if(!(Ge.isTouch&&(h||"mousedown"===e.type)||w.props.interactive&&x.contains(e.target))){if(A().contains(e.target)){if(Ge.isTouch)return;if(w.state.isVisible&&w.props.trigger.indexOf("click")>=0)return}else I("onClickOutside",[w,e]);!0===w.props.hideOnClick&&(w.clearDelayTimeouts(),w.hide(),f=!0,setTimeout((function(){f=!1})),w.state.isMounted||q())}}function R(){h=!0}function z(){h=!1}function H(){var e=T();e.addEventListener("mousedown",B,!0),e.addEventListener("touchend",B,Ae),e.addEventListener("touchstart",z,Ae),e.addEventListener("touchmove",R,Ae)}function q(){var e=T();e.removeEventListener("mousedown",B,!0),e.removeEventListener("touchend",B,Ae),e.removeEventListener("touchstart",z,Ae),e.removeEventListener("touchmove",R,Ae)}function U(e,t){var n=P().box;function r(e){e.target===n&&(Ve(n,"remove",r),t())}if(0===e)return t();Ve(n,"remove",s),Ve(n,"add",r),s=r}function W(t,n,r){void 0===r&&(r=!1),Ie(w.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),v.push({node:e,eventType:t,handler:n,options:r})}))}function Q(){var e;k()&&(W("touchstart",G,{passive:!0}),W("touchend",J,{passive:!0})),(e=w.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(W(e,G),e){case"mouseenter":W("mouseleave",J);break;case"focus":W(Ze?"focusout":"blur",X);break;case"focusin":W("focusout",X)}}))}function V(){v.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,i=e.options;t.removeEventListener(n,r,i)})),v=[]}function G(e){var t,n=!1;if(w.state.isEnabled&&!Y(e)&&!f){var r="focus"===(null==(t=a)?void 0:t.type);a=e,l=e.currentTarget,M(),!w.state.isVisible&&ze(e)&&dt.forEach((function(t){return t(e)})),"click"===e.type&&(w.props.trigger.indexOf("mouseenter")<0||p)&&!1!==w.props.hideOnClick&&w.state.isVisible?n=!0:te(e),"click"===e.type&&(p=!n),n&&!r&&ne(e)}}function $(e){var t=e.target,n=A().contains(t)||x.contains(t);"mousemove"===e.type&&n||function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,i=e.popperState,o=e.props.interactiveBorder,a=Me(i.placement),s=i.modifiersData.offset;if(!s)return!0;var c="bottom"===a?s.top.y:0,l="top"===a?s.bottom.y:0,u="right"===a?s.left.x:0,d="left"===a?s.right.x:0,p=t.top-r+c>o,f=r-t.bottom-l>o,h=t.left-n+u>o,m=n-t.right-d>o;return p||f||h||m}))}(ee().concat(x).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:d}:null})).filter(Boolean),e)&&(F(),ne(e))}function J(e){Y(e)||w.props.trigger.indexOf("click")>=0&&p||(w.props.interactive?w.hideWithInteractivity(e):ne(e))}function X(e){w.props.trigger.indexOf("focusin")<0&&e.target!==A()||w.props.interactive&&e.relatedTarget&&x.contains(e.relatedTarget)||ne(e)}function Y(e){return!!Ge.isTouch&&k()!==e.type.indexOf("touch")>=0}function K(){Z();var t=w.props,n=t.popperOptions,r=t.placement,i=t.offset,o=t.getReferenceClientRect,a=t.moveTransition,s=C()?ct(x).arrow:null,l=o?{getBoundingClientRect:o,contextElement:o.contextElement||A()}:e,u=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(C()){var n=P().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}}];C()&&s&&u.push({name:"arrow",options:{element:s,padding:3}}),u.push.apply(u,(null==n?void 0:n.modifiers)||[]),w.popperInstance=Ee(l,x,Object.assign({},n,{placement:r,onFirstUpdate:c,modifiers:u}))}function Z(){w.popperInstance&&(w.popperInstance.destroy(),w.popperInstance=null)}function ee(){return Fe(x.querySelectorAll("[data-tippy-root]"))}function te(e){w.clearDelayTimeouts(),e&&I("onTrigger",[w,e]),H();var t=S(!0),n=L(),i=n[0],o=n[1];Ge.isTouch&&"hold"===i&&o&&(t=o),t?r=setTimeout((function(){w.show()}),t):w.show()}function ne(e){if(w.clearDelayTimeouts(),I("onUntrigger",[w,e]),w.state.isVisible){if(!(w.props.trigger.indexOf("mouseenter")>=0&&w.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&p)){var t=S(!1);t?i=setTimeout((function(){w.state.isVisible&&w.hide()}),t):o=requestAnimationFrame((function(){w.hide()}))}}else q()}}function ht(e,t){void 0===t&&(t={});var n=tt.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",Je,Ae),window.addEventListener("blur",Ye);var r=Object.assign({},t,{plugins:n}),i=qe(e).reduce((function(e,t){var n=t&&ft(t,r);return n&&e.push(n),e}),[]);return Re(e)?i[0]:i}ht.defaultProps=tt,ht.setDefaultProps=function(e){Object.keys(e).forEach((function(t){tt[t]=e[t]}))},ht.currentInput=Ge;Object.assign({},le,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}});ht.setDefaultProps({render:lt});var mt=ht,vt=n(4),gt=n.n(vt);var yt={controlled:null,bind(e){this.controlled=e,this.controlled.forEach((e=>{this._master(e)})),this._init()},_init(){this.controlled.forEach((e=>{this._checkUp(e)}))},_master(e){const t=JSON.parse(e.dataset.master);e.dataset.size&&(e.filesize=parseInt(e.dataset.size,10)),e.masters=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.masters.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.masters&&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.masters&&[...e.masters].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 i="off"!==r;e.checked===i&&e.value===r||(e.value=r,e.checked=i,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;0=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var _t,xt,Ot,Et,jt=n(5),Lt=n.n(jt);n(0),Lt()(console.error);_t={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},xt=["(","?"],Ot={")":["("],":":["?","?:"]},Et=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var kt={"!":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 Ct(e){var t=function(e){for(var t,n,r,i,o=[],a=[];t=e.match(Et);){for(n=t[0],(r=e.substr(0,t.index).trim())&&o.push(r);i=a.pop();){if(Ot[n]){if(Ot[n][0]===i){n=Ot[n][1]||n;break}}else if(xt.indexOf(i)>=0||_t[i]<_t[n]){a.push(i);break}o.push(i)}Ot[n]||a.push(n),e=e.substr(t.index+n.length)}return(e=e.trim())&&o.push(e),o.concat(a.reverse())}(e);return function(e){return function(e,t){var n,r,i,o,a,s,c=[];for(n=0;n3&&void 0!==arguments[3]?arguments[3]:10,a=e[t];if(Mt(n)&&Nt(r))if("function"==typeof i)if("number"==typeof o){var s={callback:i,priority:o,namespace:r};if(a[n]){var c,l=a[n].handlers;for(c=l.length;c>0&&!(o>=l[c-1].priority);c--);c===l.length?l[c]=s:l.splice(c,0,s),a.__current.forEach((function(e){e.name===n&&e.currentIndex>=c&&e.currentIndex++}))}else a[n]={handlers:[s],runs:0};"hookAdded"!==n&&e.doAction("hookAdded",n,r,i,o)}else console.error("If specified, the hook priority must be a number.");else console.error("The hook callback must be a function.")}};var Bt=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(r,i){var o=e[t];if(Mt(r)&&(n||Nt(i))){if(!o[r])return 0;var a=0;if(n)a=o[r].handlers.length,o[r]={runs:o[r].runs,handlers:[]};else for(var s=o[r].handlers,c=function(e){s[e].namespace===i&&(s.splice(e,1),a++,o.__current.forEach((function(t){t.name===r&&t.currentIndex>=e&&t.currentIndex--})))},l=s.length-1;l>=0;l--)c(l);return"hookRemoved"!==r&&e.doAction("hookRemoved",r,i),a}}};var Rt=function(e,t){return function(n,r){var i=e[t];return void 0!==r?n in i&&i[n].handlers.some((function(e){return e.namespace===r})):n in i}};function zt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]&&arguments[2];return function(r){var i=e[t];i[r]||(i[r]={handlers:[],runs:0}),i[r].runs++;var o=i[r].handlers;for(var a=arguments.length,s=new Array(a>1?a-1:0),c=1;c1&&void 0!==arguments[1]?arguments[1]:"default";r.data[t]=St(St(St({},Dt),r.data[t]),e),r.data[t][""]=St(St({},Dt[""]),r.data[t][""])},s=function(e,t){a(e,t),o()},c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;return r.data[e]||a(void 0,e),r.dcnpgettext(e,t,n,i,o)},l=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return e},u=function(e,t,r){var i=c(r,t,e);return n?(i=n.applyFilters("i18n.gettext_with_context",i,e,t,r),n.applyFilters("i18n.gettext_with_context_"+l(r),i,e,t,r)):i};if(e&&s(e,t),n){var d=function(e){It.test(e)&&o()};n.addAction("hookAdded","core/i18n",d),n.addAction("hookRemoved","core/i18n",d)}return{getLocaleData:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return r.data[e]},setLocaleData:s,resetLocaleData:function(e,t){r.data={},r.pluralForms={},s(e,t)},subscribe:function(e){return i.add(e),function(){return i.delete(e)}},__:function(e,t){var r=c(t,void 0,e);return n?(r=n.applyFilters("i18n.gettext",r,e,t),n.applyFilters("i18n.gettext_"+l(t),r,e,t)):r},_x:u,_n:function(e,t,r,i){var o=c(i,void 0,e,t,r);return n?(o=n.applyFilters("i18n.ngettext",o,e,t,r,i),n.applyFilters("i18n.ngettext_"+l(i),o,e,t,r,i)):o},_nx:function(e,t,r,i,o){var a=c(o,i,e,t,r);return n?(a=n.applyFilters("i18n.ngettext_with_context",a,e,t,r,i,o),n.applyFilters("i18n.ngettext_with_context_"+l(o),a,e,t,r,i,o)):a},isRTL:function(){return"rtl"===u("ltr","text direction")},hasTranslation:function(e,t,i){var o,a,s=t?t+""+e:e,c=!(null===(o=r.data)||void 0===o||null===(a=o[null!=i?i:"default"])||void 0===a||!a[s]);return n&&(c=n.applyFilters("i18n.has_translation",c,e,t,i),c=n.applyFilters("i18n.has_translation_"+l(i),c,e,t,i)),c}}}(void 0,void 0,Gt)),Jt=($t.getLocaleData.bind($t),$t.setLocaleData.bind($t),$t.resetLocaleData.bind($t),$t.subscribe.bind($t),$t.__.bind($t));$t._x.bind($t),$t._n.bind($t),$t._nx.bind($t),$t.isRTL.bind($t),$t.hasTranslation.bind($t);function Xt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yt(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function vn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;if(!t||!Object.keys(t).length)return e;var n=e,r=e.indexOf("?");return-1!==r&&(t=Object.assign(hn(e),t),n=n.substr(0,r)),n+"?"+gn(t)}function bn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wn(e){for(var t=1;t]+)>; rel="next"/);return t?{next:t[1]}:{}}(e.headers.get("link")).next},On=function(e){var t=!!e.path&&-1!==e.path.indexOf("per_page=-1"),n=!!e.url&&-1!==e.url.indexOf("per_page=-1");return t||n},En=function(){var e,t=(e=un.a.mark((function e(t,n){var r,i,o,a,s,c;return un.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!1!==t.parse){e.next=2;break}return e.abrupt("return",n(t));case 2:if(On(t)){e.next=4;break}return e.abrupt("return",n(t));case 4:return e.next=6,Wn(wn(wn({},(u={per_page:100},d=void 0,p=void 0,d=(l=t).path,p=l.url,wn(wn({},wt(l,["path","url"])),{},{url:p&&yn(p,u),path:d&&yn(d,u)}))),{},{parse:!1}));case 6:return r=e.sent,e.next=9,_n(r);case 9:if(i=e.sent,Array.isArray(i)){e.next=12;break}return e.abrupt("return",i);case 12:if(o=xn(r)){e.next=15;break}return e.abrupt("return",i);case 15:a=[].concat(i);case 16:if(!o){e.next=27;break}return e.next=19,Wn(wn(wn({},t),{},{path:void 0,url:o,parse:!1}));case 19:return s=e.sent,e.next=22,_n(s);case 22:c=e.sent,a=a.concat(c),o=xn(s),e.next=16;break;case 27:return e.abrupt("return",a);case 28:case"end":return e.stop()}var l,u,d,p}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){cn(o,r,i,a,s,"next",e)}function s(e){cn(o,r,i,a,s,"throw",e)}a(void 0)}))});return function(e,n){return t.apply(this,arguments)}}();function jn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ln(e){for(var t=1;t1&&void 0!==arguments[1])||arguments[1];return t?204===e.status?null:e.json?e.json():Promise.reject(e):e},Tn=function(e){var t={code:"invalid_json",message:Jt("The response is not a valid JSON response.")};if(!e||!e.json)throw t;return e.json().catch((function(){throw t}))},Pn=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Promise.resolve(An(e,t)).catch((function(e){return Sn(e,t)}))};function Sn(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!t)throw e;return Tn(e).then((function(e){var t={code:"unknown_error",message:Jt("An unknown error occurred.")};throw e||t}))}function Dn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function In(e){for(var t=1;t=500&&t.status<600&&n?r(n).catch((function(){return!1!==e.parse?Promise.reject({code:"post_process",message:Jt("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(t)})):Sn(t,e.parse)})).then((function(t){return Pn(t,e.parse)}))};function Mn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Fn(e){for(var t=1;t=200&&e.status<300)return e;throw e},qn=function(e){var t=e.url,n=e.path,r=e.data,i=e.parse,o=void 0===i||i,a=wt(e,["url","path","data","parse"]),s=e.body,c=e.headers;return c=Fn(Fn({},Bn),c),r&&(s=JSON.stringify(r),c["Content-Type"]="application/json"),window.fetch(t||n||window.location.href,Fn(Fn(Fn({},Rn),a),{},{body:s,headers:c})).then((function(e){return Promise.resolve(e).then(Hn).catch((function(e){return Sn(e,o)})).then((function(e){return Pn(e,o)}))}),(function(){throw{code:"fetch_error",message:Jt("You are probably offline.")}}))};function Un(e){return zn.reduceRight((function(e,t){return function(n){return t(n,e)}}),qn)(e).catch((function(t){return"rest_cookie_invalid_nonce"!==t.code?Promise.reject(t):window.fetch(Un.nonceEndpoint).then(Hn).then((function(e){return e.text()})).then((function(t){return Un.nonceMiddleware.nonce=t,Un(e)}))}))}Un.use=function(e){zn.unshift(e)},Un.setFetchHandler=function(e){qn=e},Un.createNonceMiddleware=Kt,Un.createPreloadingMiddleware=sn,Un.createRootURLMiddleware=on,Un.fetchAllMiddleware=En,Un.mediaUploadMiddleware=Nn;var Wn=Un;var Qn={cachePoints:{},spinners:{},init(e){if("undefined"!=typeof CLDCACHE){Wn.use(Wn.createNonceMiddleware(CLDCACHE.nonce));e.querySelectorAll("[data-cache-point]").forEach((e=>this._bind(e)))}},getCachePoint(e){return this.cachePoints["_"+e]?this.cachePoints["_"+e]:null},setCachePoint(e,t){const n=document.createElement("div"),r=this._getRow(),i=document.createElement("td");i.colSpan=2,i.className="cld-loading",r.appendChild(i);const o=document.getElementById(t.dataset.slug),a=document.getElementById(t.dataset.slug+"_search"),s=document.getElementById(t.dataset.slug+"_reload"),c=document.getElementById(t.dataset.browser),l=document.getElementById(t.dataset.apply);c.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)})),s.addEventListener("click",(t=>{this._load(e)})),a.addEventListener("keydown",(t=>{13===t.which&&(t.preventDefault(),t.stopPropagation(),this._load(e))})),n.className="cld-pagenav",l.cacheChanges={disable:[],enable:[],delete:[]},t.master=o,t.search=a,t.controller=c,t.viewer=t.parentNode.parentNode,t.loader=r,t.table=t.parentNode,t.apply=l,t.paginate=n,t.currentPage=1,t.viewer.appendChild(n),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.master.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),t.loaded||this._load(e)):(this.close(t.viewer),t.controller.checked=!1))},_load(e){const t=this.getCachePoint(e);this._clearChildren(t),t.appendChild(t.loader),this.open(t.loader),Wn({path:CLDCACHE.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-master]");yt.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){this.close(e.apply);const t=e.apply.cacheChanges;let n=!1;for(const e in t)t[e].length&&(n=!0);n&&this.open(e.apply)},_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])},_set_state(e,t,n){this._showSpinners(n),Wn({path:CLDCACHE.update_url,data:{state:t,ids:n},method:"POST"}).then((n=>{this._hideSpinners(n),n.forEach((n=>{this.close(e.apply),this._removeFromList(e,n,t),this._evaluateApply(e),e.apply.disabled=""})),"delete"===t&&this._load(e.dataset.cachePoint)}))},_purgeCache(e){Wn({path:CLDCACHE.purge_url,data:{cachePoint:e.dataset.cachePoint},method:"POST"}).then((()=>{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 i=!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"}),i=this._getFile(e,t,n);n.appendChild(i),n.appendChild(r),e.appendChild(n)}))},_buildNav(e,t){e.paginate.innerHTML="";const n=document.createElement("button"),r=document.createElement("button");if(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="left",e.paginate.appendChild(t),t.addEventListener("click",(t=>{confirm(wp.i18n.__("Purge entire cache point?","cloudinary"))&&this._purgeCache(e)}))}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 i=document.createElement("span");i.innerText=t.nav_text,i.className="cld-pagenav-text",e.paginate.appendChild(n),e.paginate.appendChild(i),e.paginate.appendChild(r)},_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},_getFile(e,t){const n=document.createElement("td"),r=document.createElement("label"),i=this._getDeleter(e,n,t);r.innerText=t.short_url,r.htmlFor=t.key,n.appendChild(i),n.appendChild(r);const o=document.createElement("span"),a="spinner_"+t.ID;return o.className="spinner",o.id=a,n.appendChild(o),this.spinners[a]=o,n},_getDeleter(e,t,n){const r=document.createElement("input"),i=[e.dataset.slug+"_deleter"],o=this._getListIndex(e,n.ID,"delete");return r.type="checkbox",r.value=n.ID,r.id=n.key,r.dataset.master=JSON.stringify(i),-1{t.style.opacity=1,t.style.textDecoration="",r.checked&&(t.style.opacity=.8,t.style.textDecoration="line-through");const o=new CustomEvent("CacheToggle",{detail:{checked:r.checked,states:{on:"delete",off:n.active?"enable":"disable"},item:n,cachePoint:e}});window.dispatchEvent(o)})),r},_getStateSwitch(e,t,n){const r=document.createElement("td"),i=document.createElement("label"),o=document.createElement("input"),a=document.createElement("span"),s=[e.dataset.slug+"_selector"],c=this._getListIndex(e,t.ID,"disable");return r.style.textAlign="right",i.className="cld-input-on-off-control mini",o.type="checkbox",o.value=t.ID,o.checked=!(-1{const i=new CustomEvent("CacheToggle",{detail:{checked:o.checked,states:n,item:t,cachePoint:e}});window.dispatchEvent(i)})),r.appendChild(i),r}};const Vn={bindings:{},parent_check_data:{},check_parents:{},_init(e){const t=e.querySelectorAll("[data-condition]"),n=e.querySelectorAll("[data-toggle]"),r=e.querySelectorAll("[data-for]"),i=e.querySelectorAll("[data-tooltip]"),o=e.querySelectorAll("[data-bind-trigger]"),a=e.querySelectorAll("[data-master]"),s=e.querySelectorAll("[data-file]"),c=e.querySelectorAll("[data-auto-suffix]"),l={};yt.bind(a),c.forEach((e=>this._autoSuffix(e))),o.forEach((e=>this._trigger(e))),n.forEach((e=>this._toggle(e))),t.forEach((e=>this._bind(e))),r.forEach((e=>this._alias(e))),s.forEach((e=>this._files(e,l))),mt(i,{theme:"cloudinary",arrow:!1,placement:"bottom-start",aria:{content:"auto",expanded:"auto"},content:t=>e.getElementById(t.getAttribute("data-tooltip")).innerHTML}),[...o].forEach((e=>{e.dispatchEvent(new Event("input"))})),Qn.init(e)},_autoSuffix(e){const t=e.dataset.autoSuffix;let n="";const r=[...t.split(";")].map((e=>0===e.indexOf("*")?(n=e.replace("*",""),n):e));e.addEventListener("change",(()=>{const t=e.value.replace(" ",""),i=t.replace(/[^0-9]/g,""),o=t.replace(/[0-9]/g,"").toLowerCase();i&&(-1===r.indexOf(o)?e.value=i+" "+n:e.value=i+" "+o)})),e.dispatchEvent(new Event("change"))},_files(e,t){const n=e.dataset.parent;n&&(this.check_parents[n]=document.getElementById(n),this.parent_check_data[n]||(this.parent_check_data[n]=this.check_parents[n].value?JSON.parse(this.check_parents[n].value):[]),e.addEventListener("change",(()=>{const r=this.parent_check_data[n].indexOf(e.value);e.checked?this.parent_check_data[n].push(e.value):this.parent_check_data[n].splice(r,1),t[n]&&clearTimeout(t[n]),t[n]=setTimeout((()=>{this._compileParent(n)}),10)})))},_compileParent(e){this.check_parents[e].value=JSON.stringify(this.parent_check_data[e]),this.check_parents[e].dispatchEvent(new Event("change"))},_bind(e){e.condition=JSON.parse(e.dataset.condition);for(const t in e.condition)this.bindings[t]&&this.bindings[t].elements.push(e)},_trigger(e){const t=e.dataset.bindTrigger,n=this;n.bindings[t]={input:e,value:e.value,checked:!0,elements:[]},e.addEventListener("change",(function(t){e.dispatchEvent(new Event("input"))})),e.addEventListener("input",(function(){n.bindings[t].value=e.value,"checkbox"!==e.type&&"radio"!==e.type||(n.bindings[t].checked=e.checked);for(const r in n.bindings[t].elements)n.toggle(n.bindings[t].elements[r],e)}))},_alias(e){e.addEventListener("click",(function(){document.getElementById(e.dataset.for).dispatchEvent(new Event("click"))}))},_toggle(e){const t=this;e.addEventListener("click",(function(n){n.stopPropagation();const r=document.querySelector('[data-wrap="'+e.dataset.toggle+'"]'),i=r.classList.contains("open")?"closed":"open";t.toggle(r,e,i)}))},toggle(e,t,n){if(!n){n="open";for(const t in e.condition){let r=this.bindings[t].value;const i=e.condition[t];"boolean"==typeof i&&(r=this.bindings[t].checked),i!==r&&(n="closed")}}const r=e.getElementsByClassName("cld-ui-input");"closed"===n?(e.classList.remove("open"),e.classList.add("closed"),t&&t.classList.contains("dashicons")&&(t.classList.remove("dashicons-arrow-up-alt2"),t.classList.add("dashicons-arrow-down-alt2")),[...r].forEach((function(e){e.dataset.disabled=!0}))):(e.classList.remove("closed"),e.classList.add("open"),t&&t.classList.contains("dashicons")&&(t.classList.remove("dashicons-arrow-down-alt2"),t.classList.add("dashicons-arrow-up-alt2")),[...r].forEach((function(e){e.dataset.disabled=!1})))}};window.addEventListener("load",Vn._init(document));var Gn=Vn;window.$=window.jQuery;const $n={UI:Gn,Settings:i.a,Widget:a.a,GlobalTransformations:c,TermsOrder:u,MediaLibrary:p,Notices:h}}]); \ No newline at end of file diff --git a/js/responsive-breakpoints.asset.php b/js/responsive-breakpoints.asset.php index 45d388a08..fdac4cce7 100644 --- a/js/responsive-breakpoints.asset.php +++ b/js/responsive-breakpoints.asset.php @@ -1 +1 @@ - array('wp-polyfill'), 'version' => '38460ca7b7c06420b515c0e8a7342d49'); \ No newline at end of file + array('wp-polyfill'), 'version' => '2e57412f751e461e197eb337dd1ce4bb'); \ No newline at end of file diff --git a/js/src/components/ui.js b/js/src/components/ui.js index deddf7322..3bbaef01b 100644 --- a/js/src/components/ui.js +++ b/js/src/components/ui.js @@ -17,12 +17,13 @@ const UI = { const triggers = context.querySelectorAll( '[data-bind-trigger]' ); const masters = context.querySelectorAll( '[data-master]' ); const files = context.querySelectorAll( '[data-file]' ); + const autoSuffix = context.querySelectorAll( '[data-auto-suffix]' ); const self = this; const compilerDebounce = {}; // Bind on offs. OnOff.bind( masters ); - + autoSuffix.forEach( ( input ) => this._autoSuffix( input ) ); triggers.forEach( ( input ) => this._trigger( input ) ); toggles.forEach( ( toggle ) => this._toggle( toggle ) ); conditions.forEach( ( condition ) => this._bind( condition ) ); @@ -48,6 +49,30 @@ const UI = { // Start cache manager. CacheManage.init( context ); }, + _autoSuffix( input ) { + const suffixes = input.dataset.autoSuffix; + let defaultSuffix = ''; + const valid = [ ...suffixes.split( ';' ) ].map( ( suffix ) => { + if ( 0 === suffix.indexOf( '*' ) ) { + defaultSuffix = suffix.replace( '*', '' ); + return defaultSuffix; + } + return suffix; + } ); + input.addEventListener( 'change', () => { + const value = input.value.replace( ' ', '' ); + const number = value.replace( /[^0-9]/g, '' ); + const type = value.replace( /[0-9]/g, '' ).toLowerCase(); + if ( number ) { + if ( -1 === valid.indexOf( type ) ) { + input.value = number + ' ' + defaultSuffix; + } else { + input.value = number + ' ' + type; + } + } + } ); + input.dispatchEvent( new Event( 'change' ) ); + }, _files( file, compilerDebounce ) { const parent = file.dataset.parent; if ( ! parent ) { diff --git a/php/class-delivery.php b/php/class-delivery.php index fbb66e3b4..c4e75d9d6 100644 --- a/php/class-delivery.php +++ b/php/class-delivery.php @@ -348,14 +348,18 @@ function ( $set ) { // Create new src url. $tag_element['atts']['src'] = $this->media->cloudinary_url( $attachment_id, $size, $transformations, null, $overwrite ); } + /** * Filter the tag element. * - * @param array $tag_element The tag and element array.. - * @param int $attachment_id The attachment ID. - * @param string $element The original html tag. + * @hook cloudinary_pre_image_tag + * @since 2.7.5 + * + * @param $tag_element {array} The tag_element ( tag + attributes array). + * @param $attachment_id {int} The attachment ID. + * @param $element {string} The original HTML tag. * - * @return array + * @return array */ $tag_element = apply_filters( 'cloudinary_pre_image_tag', $tag_element, $attachment_id, $element ); @@ -442,7 +446,7 @@ public function catch_urls( $content ) { $urls = wp_extract_urls( $content ); $dirs = wp_get_upload_dir(); $urls = array_map( - function( $url ) use ( $dirs ) { + function ( $url ) use ( $dirs ) { if ( false === strpos( $url, $dirs['baseurl'] ) ) { return null; diff --git a/php/class-lazy-load.php b/php/class-lazy-load.php index 9a35aca1e..84775c025 100644 --- a/php/class-lazy-load.php +++ b/php/class-lazy-load.php @@ -218,17 +218,23 @@ public function settings() { 'use_lazy_loading' => true, ), array( - 'type' => 'number', - 'title' => __( 'Lazy loading threshold', 'cloudinary' ), - 'slug' => 'lazy_threshold', - 'description' => __( ' The threshold', 'cloudinary' ), - 'default' => 1000, + 'type' => 'text', + 'title' => __( 'Lazy loading threshold', 'cloudinary' ), + 'slug' => 'lazy_threshold', + 'attributes' => array( + 'style' => array( + 'width:100px;display:block;', + ), + 'data-auto-suffix' => '*px;em;rem;vw;vh', + ), + + 'default' => '1000px', ), array( 'type' => 'radio', 'title' => __( 'Placeholder generation', 'cloudinary' ), 'slug' => 'lazy_placeholder', - 'description' => __( ' The placeholder', 'cloudinary' ), + 'description' => __( 'The placeholder', 'cloudinary' ), 'default' => 'blur', 'options' => array( 'blur' => __( 'Blur', 'cloudinary' ), @@ -242,7 +248,7 @@ public function settings() { 'type' => 'checkbox', 'title' => __( 'Initial preloader', 'cloudinary' ), 'slug' => 'lazy_preloader', - 'description' => __( ' The preloader', 'cloudinary' ), + 'description' => __( 'The preloader', 'cloudinary' ), 'default' => 'on', 'options' => array( 'on' => __( 'Use an initial preloader', 'cloudinary' ), @@ -252,7 +258,7 @@ public function settings() { 'type' => 'checkbox', 'title' => __( 'Use custom preloader', 'cloudinary' ), 'slug' => 'lazy_custom_preloader', - 'description' => __( ' The custom preloader', 'cloudinary' ), + 'description' => __( 'The custom preloader', 'cloudinary' ), 'default' => 'on', 'condition' => array( 'lazy_preloader' => true, @@ -273,7 +279,7 @@ public function settings() { protected function register_settings() { // Move setting to media. - $media_settings = $this->media->get_settings()->get_setting( 'image_display' ); + $media_settings = $this->media->get_settings()->get_setting( 'image_display' ); $settings_params = $this->settings(); $this->settings = $media_settings->create_setting( $this->settings_slug, $settings_params, $media_settings ); @@ -281,10 +287,10 @@ protected function register_settings() { // Reset the option parent. $this->settings->get_option_parent()->set_value( null ); - $condition = array( + $condition = array( 'use_lazy_loading' => false, ); - $bk = $media_settings->get_setting( 'breakpoints' ); + $bk = $media_settings->get_setting( 'breakpoints' ); $bk->set_param( 'condition', $condition ); $bk->rebuild_component(); From adbfb56c0b1c3f4851d7d8bd88f7594b1dc282b9 Mon Sep 17 00:00:00 2001 From: David Cramer Date: Wed, 7 Jul 2021 16:46:22 +0200 Subject: [PATCH 24/56] add colors --- js/wp-color-picker-alpha.min.js | 11 ++++++++ php/class-lazy-load.php | 42 ++++++++++++++++++++----------- php/ui/component/class-color.php | 42 +++++++++++++++++++++++++++++-- php/ui/component/class-on-off.php | 2 +- 4 files changed, 79 insertions(+), 18 deletions(-) create mode 100644 js/wp-color-picker-alpha.min.js diff --git a/js/wp-color-picker-alpha.min.js b/js/wp-color-picker-alpha.min.js new file mode 100644 index 000000000..1aeb1f2b8 --- /dev/null +++ b/js/wp-color-picker-alpha.min.js @@ -0,0 +1,11 @@ +/**! + * wp-color-picker-alpha + * + * Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker + * Only run in input and is defined data alpha in true + * + * Version: 3.0.0 + * https://github.com/kallookoo/wp-color-picker-alpha + * Licensed under the GPLv2 license or later. + */ +!function(e,a){var l,o={version:300};if("wpColorPickerAlpha"in window&&"version"in window.wpColorPickerAlpha){var t=parseInt(window.wpColorPickerAlpha.version,10);if(!isNaN(t)&&o.version<=t)return}Color.fn.hasOwnProperty("to_s")||(Color.fn.to_s=function(o){"hex"===(o=o||"hex")&&this._alpha<1&&(o="rgba");var a="";return"hex"===o?a=this.toString():this.error||(a=this.toCSS(o).replace(/\(\s+/,"(").replace(/\s+\)/,")")),a},window.wpColorPickerAlpha=o,l="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==",e.widget("a8c.iris",e.a8c.iris,{alphaOptions:{alphaEnabled:!1},_getColor:function(o){return o===a&&(o=this._color),this.alphaOptions.alphaEnabled?(o=o.to_s(this.alphaOptions.alphaColorType),this.alphaOptions.alphaColorWithSpace||(o=o.replace(/\s+/g,"")),o):o.toString()},_create:function(){try{this.alphaOptions=this.element.wpColorPicker("instance").alphaOptions}catch(o){}e.extend({},this.alphaOptions,{alphaEnabled:!1,alphaCustomWidth:130,alphaReset:!1,alphaColorType:"hex",alphaColorWithSpace:!1}),this._super()},_addInputListeners:function(i){function o(o){var a=i.val(),t=new Color(a),a=a.replace(/^(#|(rgb|hsl)a?)/,""),r=l.alphaOptions.alphaColorType;i.removeClass("iris-error"),t.error?""!==a&&i.addClass("iris-error"):"hex"===r&&"keyup"===o.type&&a.match(/^[0-9a-fA-F]{3}$/)||t.toIEOctoHex()!==l._color.toIEOctoHex()&&l._setOption("color",l._getColor(t))}var l=this;i.on("change",o).on("keyup",l._debounce(o,100)),l.options.hide&&i.one("focus",function(){l.show()})},_initControls:function(){var t,o,a,r;this._super(),this.alphaOptions.alphaEnabled&&(a=(o=(t=this).controls.strip.clone(!1,!1)).find(".iris-slider-offset"),r={stripAlpha:o,stripAlphaSlider:a},o.addClass("iris-strip-alpha"),a.addClass("iris-slider-offset-alpha"),o.appendTo(t.picker.find(".iris-picker-inner")),e.each(r,function(o,a){t.controls[o]=a}),t.controls.stripAlphaSlider.slider({orientation:"vertical",min:0,max:100,step:1,value:parseInt(100*t._color._alpha),slide:function(o,a){t.active="strip",t._color._alpha=parseFloat(a.value/100),t._change.apply(t,arguments)}}))},_dimensions:function(o){if(this._super(o),this.alphaOptions.alphaEnabled){for(var a=this,t=a.options,r=a.controls.square,o=a.picker.find(".iris-strip"),i=Math.round(a.picker.outerWidth(!0)-(t.border?22:0)),l=Math.round(r.outerWidth()),e=Math.round((i-l)/2),s=Math.round(e/2),n=Math.round(l+2*e+2*s);i'):t.toggler.append(''),t.colorAlpha=t.toggler.find("span.color-alpha").css({width:"30px",height:"100%",position:"absolute",top:0,"background-color":r.val()}),"ltr"===t.colorAlpha.css("direction")?t.colorAlpha.css({"border-bottom-left-radius":"2px","border-top-left-radius":"2px",left:0}):t.colorAlpha.css({"border-bottom-right-radius":"2px","border-top-right-radius":"2px",right:0}),r.iris({change:function(o,a){t.colorAlpha.css({"background-color":a.color.to_s(t.alphaOptions.alphaColorType)}),e.isFunction(t.options.change)&&t.options.change.call(this,o,a)}}),t.wrap.on("click.wpcolorpicker",function(o){o.stopPropagation()}),t.toggler.click(function(){t.toggler.hasClass("wp-picker-open")?t.close():t.open()}),r.change(function(o){var a=e(this).val();(r.hasClass("iris-error")||""===a||a.match(/^(#|(rgb|hsl)a?)$/))&&(i&&t.toggler.removeAttr("style"),t.colorAlpha.css("background-color",""),e.isFunction(t.options.clear)&&t.options.clear.call(this,o))}),t.button.click(function(o){e(this).hasClass("wp-picker-default")?r.val(t.options.defaultColor).change():e(this).hasClass("wp-picker-clear")&&(r.val(""),i&&t.toggler.removeAttr("style"),t.colorAlpha.css("background-color",""),e.isFunction(t.options.clear)&&t.options.clear.call(this,o),r.trigger("change"))})}}))}(jQuery); \ No newline at end of file diff --git a/php/class-lazy-load.php b/php/class-lazy-load.php index 84775c025..6d14befe2 100644 --- a/php/class-lazy-load.php +++ b/php/class-lazy-load.php @@ -159,7 +159,14 @@ public function add_features( $tag_element, $attachment_id, $original_tag ) { } if ( ! empty( $settings['lazy_preloader'] ) ) { - $svg = ''; + $color_str = $settings['lazy_custom_color']; + if ( 'on' === $settings['lazy_animate'] ) { + $colors = explode( ',', rtrim( substr( $settings['lazy_custom_color'], 5 ), ')' ) ); + $color1 = 'rgba(' . $colors[0] . ',' . $colors[1] . ',' . $colors[2] . ',' . $colors[3] . ')'; + $color2 = 'rgba(' . $colors[0] . ',' . $colors[1] . ',' . $colors[2] . ',0)'; + $color_str = $color1 . ';' . $color2 . ';' . $color1; + } + $svg = ''; $tag_element['atts']['src'] = 'data:image/svg+xml;utf8,' . $svg; $tag_element['atts']['data-type'] = $format; } @@ -245,26 +252,31 @@ public function settings() { ), ), array( - 'type' => 'checkbox', - 'title' => __( 'Initial preloader', 'cloudinary' ), - 'slug' => 'lazy_preloader', - 'description' => __( 'The preloader', 'cloudinary' ), - 'default' => 'on', - 'options' => array( + 'type' => 'checkbox', + 'title' => __( 'Initial preloader', 'cloudinary' ), + 'slug' => 'lazy_preloader', + + 'default' => 'on', + 'options' => array( 'on' => __( 'Use an initial preloader', 'cloudinary' ), ), ), array( - 'type' => 'checkbox', - 'title' => __( 'Use custom preloader', 'cloudinary' ), - 'slug' => 'lazy_custom_preloader', - 'description' => __( 'The custom preloader', 'cloudinary' ), - 'default' => 'on', - 'condition' => array( + 'type' => 'color', + 'title' => __( 'Use custom color', 'cloudinary' ), + 'slug' => 'lazy_custom_color', + 'default' => 'rgba(153,153,153,0.5)', + 'condition' => array( 'lazy_preloader' => true, ), - 'options' => array( - 'on' => __( 'Use a custom preloader', 'cloudinary' ), + ), + array( + 'type' => 'on_off', + 'title' => __( 'Animate', 'cloudinary' ), + 'slug' => 'lazy_animate', + 'default' => 'on', + 'condition' => array( + 'lazy_preloader' => true, ), ), ), diff --git a/php/ui/component/class-color.php b/php/ui/component/class-color.php index 1c67cdc0d..635bc10e1 100644 --- a/php/ui/component/class-color.php +++ b/php/ui/component/class-color.php @@ -7,6 +7,8 @@ namespace Cloudinary\UI\Component; +use function Cloudinary\get_plugin_instance; + /** * Class Color Component * @@ -14,6 +16,17 @@ */ class Color extends Text { + /** + * Enqueue scripts. + */ + public function enqueue_scripts() { + parent::enqueue_scripts(); + + $instance = get_plugin_instance(); + wp_enqueue_style( 'wp-color-picker' ); + wp_enqueue_script( 'wp-color-picker-alpha', $instance->dir_url . '/js/wp-color-picker-alpha.min.js', array( 'wp-color-picker' ), $instance->version, true ); + } + /** * Filter the input parts structure. * @@ -22,10 +35,35 @@ class Color extends Text { * @return array */ protected function input( $struct ) { - $struct = parent::input( $struct ); - $struct['attributes']['type'] = 'text'; + $struct = parent::input( $struct ); + $struct['attributes']['type'] = 'text'; + $struct['attributes']['data-alpha-enabled'] = true; + $struct['attributes']['data-default-color'] = $this->setting->get_param( 'default' ); return $struct; } + /** + * Render the component. + * + * @param false $echo Flag to echo out or return. + * + * @return string|null + */ + public function render( $echo = false ) { + $return = parent::render( $echo ); + ?> + + Date: Thu, 8 Jul 2021 10:15:26 +0200 Subject: [PATCH 25/56] clean up cache clearing and prevent sizes that have the same file. --- js/cloudinary.js | 2 +- js/src/components/ui.js | 4 +-- php/class-delivery.php | 4 +++ php/class-lazy-load.php | 76 +++++++++++++++-------------------------- 4 files changed, 34 insertions(+), 52 deletions(-) diff --git a/js/cloudinary.js b/js/cloudinary.js index 9d91151ce..99caacb48 100644 --- a/js/cloudinary.js +++ b/js/cloudinary.js @@ -1 +1 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=13)}([function(e,t,n){var r;!function(){"use strict";var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function o(e){return s(l(e),arguments)}function a(e,t){return o.apply(null,[e].concat(t||[]))}function s(e,t){var n,r,a,s,c,l,u,d,p,f=1,h=e.length,m="";for(r=0;r=0),s.type){case"b":n=parseInt(n,10).toString(2);break;case"c":n=String.fromCharCode(parseInt(n,10));break;case"d":case"i":n=parseInt(n,10);break;case"j":n=JSON.stringify(n,null,s.width?parseInt(s.width):0);break;case"e":n=s.precision?parseFloat(n).toExponential(s.precision):parseFloat(n).toExponential();break;case"f":n=s.precision?parseFloat(n).toFixed(s.precision):parseFloat(n);break;case"g":n=s.precision?String(Number(n.toPrecision(s.precision))):parseFloat(n);break;case"o":n=(parseInt(n,10)>>>0).toString(8);break;case"s":n=String(n),n=s.precision?n.substring(0,s.precision):n;break;case"t":n=String(!!n),n=s.precision?n.substring(0,s.precision):n;break;case"T":n=Object.prototype.toString.call(n).slice(8,-1).toLowerCase(),n=s.precision?n.substring(0,s.precision):n;break;case"u":n=parseInt(n,10)>>>0;break;case"v":n=n.valueOf(),n=s.precision?n.substring(0,s.precision):n;break;case"x":n=(parseInt(n,10)>>>0).toString(16);break;case"X":n=(parseInt(n,10)>>>0).toString(16).toUpperCase()}i.json.test(s.type)?m+=n:(!i.number.test(s.type)||d&&!s.sign?p="":(p=d?"+":"-",n=n.toString().replace(i.sign,"")),l=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",u=s.width-(p+n).length,c=s.width&&u>0?l.repeat(u):"",m+=s.align?p+n+c:"0"===l?p+c+n:c+p+n)}return m}var c=Object.create(null);function l(e){if(c[e])return c[e];for(var t,n=e,r=[],o=0;n;){if(null!==(t=i.text.exec(n)))r.push(t[0]);else if(null!==(t=i.modulo.exec(n)))r.push("%");else{if(null===(t=i.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(t[2]){o|=1;var a=[],s=t[2],l=[];if(null===(l=i.key.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(a.push(l[1]);""!==(s=s.substring(l[0].length));)if(null!==(l=i.key_access.exec(s)))a.push(l[1]);else{if(null===(l=i.index_access.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");a.push(l[1])}t[2]=a}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");r.push({placeholder:t[0],param_no:t[1],keys:t[2],sign:t[3],pad_char:t[4],align:t[5],width:t[6],precision:t[7],type:t[8]})}n=n.substring(t[0].length)}return c[e]=r}t.sprintf=o,t.vsprintf=a,"undefined"!=typeof window&&(window.sprintf=o,window.vsprintf=a,void 0===(r=function(){return{sprintf:o,vsprintf:a}}.call(t,n,t,e))||(e.exports=r))}()},function(e,t,n){e.exports=n(11)},function(e,t){!function(){const e=function(){const e=jQuery("#field-video_player").val(),t=jQuery("#field-video_controls").prop("checked"),n=jQuery('#field-video_autoplay_mode option[value="off"]');"cld"!==e||t?n.prop("disabled",!1):(n.prop("disabled",!0),n.prop("selected")&&n.next().prop("selected",!0))};e(),jQuery(document).on("change","#field-video_player",e),jQuery(document).on("change","#field-video_controls",e),jQuery(document).ready((function(e){e.isFunction(e.fn.wpColorPicker)&&e(".regular-color").wpColorPicker(),e(document).on("tabs.init",(function(){const t=e(".settings-tab-trigger"),n=e(".settings-tab-section");e(this).on("click",".settings-tab-trigger",(function(r){const i=e(this),o=e(i.attr("href"));r.preventDefault(),t.removeClass("active"),n.removeClass("active"),i.addClass("active"),o.addClass("active"),e(document).trigger("settings.tabbed",i)})),e(".cld-field").not('[data-condition="false"]').each((function(){const t=e(this),n=t.data("condition");for(const r in n){let i=e("#field-"+r);const o=n[r],a=t.closest("tr");i.length||(i=e(`[id^=field-${r}-]`));let s=!1;i.on("change init",(function(e,t=!1){if(s&&t)return;let n=this.value===o||this.checked;if(Array.isArray(o)&&2===o.length)switch(o[1]){case"neq":n=this.value!==o[0];break;case"gt":n=this.value>o[0];break;case"lt":n=this.value=0&&(e.metadata.cldoverwrite="true")})),wp.media.events.on("editor:image-update",(function(e){const t=e.image.className.split(" ");e.metadata.cldoverwrite&&-1===t.indexOf("cld-overwrite")?t.push("cld-overwrite"):!e.metadata.cldoverwrite&&t.indexOf("cld-overwrite")>=0&&delete t[t.indexOf("cld-overwrite")],e.image.className=t.join(" ")}));let e=null;const t=wp.media.string.props;wp.media.string.props=function(n,r){n.cldoverwrite&&(n.classes=["cld-overwrite"],e=!0);return t(n,r)},wp.media.post=function(t,n){if("send-attachment-to-editor"===t){const t=wp.media.editor.get().state().get("selection").get(n.attachment);t.attributes.transformations&&(n.attachment.transformations=t.attributes.transformations),(n.html.indexOf("cld-overwrite")>-1||!0===e)&&(n.attachment.cldoverwrite=!0,e=null)}return wp.ajax.post(t,n)};const n=wp.media.view.MediaFrame.Select,r=wp.media.view.MediaFrame.Post,i=wp.media.view.MediaFrame.ImageDetails,o=wp.media.view.MediaFrame.VideoDetails,a=wp.media.View.extend({tagName:"div",className:"cloudinary-widget",template:wp.template("cloudinary-dam"),active:!1,toolbar:null,frame:null,ready(){const e=this.controller,t=this.model.get("selection"),n=this.model.get("library"),r=wp.media.model.Attachment;if(CLDN.mloptions.multiple=e.options.multiple,this.cid!==this.active){if(CLDN.mloptions.inline_container="#cloudinary-dam-"+e.cid,1===t.length){const e=r.get(t.models[0].id);void 0!==e.attributes.public_id&&(CLDN.mloptions.asset={resource_id:e.attributes.public_id})}else CLDN.mloptions.asset=null;try{CLDN.mloptions.folder||(CLDN.mloptions.folder={path:""});const e=t.props.attributes.type;CLDN.mloptions.folder.resource_type=Array.isArray(e)?e[0]:e}catch(e){}window.ml=cloudinary.openMediaLibrary(CLDN.mloptions,{insertHandler(i){for(let o=0;o0;a--)s/=o;return s.toFixed(2)},r.human=function(e){var t=r.calculate(e);return t.fixed+r.spacer+t.suffix},r}},e.exports?e.exports=a():(i=[],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){e.exports=function(e,t){var n,r,i=0;function o(){var o,a,s=n,c=arguments.length;e:for(;s;){if(s.args.length===arguments.length){for(a=0;a'+t),t=t.replace(/(?:\r\n|\r|\n|\t| )srcset=/g," data-lazy-srcset=").replace(/(?:\r\n|\r|\n|\t| )src=/g,' src="'+r+'" data-lazy-src='))),t}(e);t.firstChild;)o||!a||void 0===n||!t.firstChild.tagName||"img"!==t.firstChild.tagName.toLowerCase()&&"iframe"!==t.firstChild.tagName.toLowerCase()||n.observe(t.firstChild),e.parentNode.insertBefore(t.firstChild,e);e.parentNode.removeChild(e)}function l(){document.querySelectorAll("noscript.loading-lazy").forEach(c),void 0!==window.matchMedia&&window.matchMedia("print").addListener((function(e){e.matches&&document.querySelectorAll(i.lazyImage+"[data-lazy-src],"+i.lazyIframe+"[data-lazy-src]").forEach((function(e){s(e)}))}))}"undefined"!=typeof NodeList&&NodeList.prototype&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),"IntersectionObserver"in window&&(n=new IntersectionObserver((function(e,t){e.forEach((function(e){if(0!==e.intersectionRatio){var n=e.target;t.unobserve(n),s(n)}}))}),i)),r="requestAnimationFrame"in window?window.requestAnimationFrame:function(e){e()},/comp|inter/.test(document.readyState)?r(l):"addEventListener"in document?document.addEventListener("DOMContentLoaded",(function(){r(l)})):document.attachEvent("onreadystatechange",(function(){"complete"===document.readyState&&l()}))}()},function(e,t){const n=document.querySelector(".cloudinary-collapsible__toggle");n&&n.addEventListener("click",(function(){const e=document.querySelector(".cloudinary-collapsible__content"),t="none"===window.getComputedStyle(e,null).getPropertyValue("display"),n=document.querySelector(".cloudinary-collapsible__toggle button i");e.style.display=t?"block":"none";const r="dashicons-arrow-down-alt2",i="dashicons-arrow-up-alt2";n.classList.contains(r)?(n.classList.remove(r),n.classList.add(i)):(n.classList.remove(i),n.classList.add(r))}))},function(e,t,n){var r=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof v?t:v,o=Object.create(i.prototype),a=new C(r||[]);return o._invoke=function(e,t,n){var r=d;return function(i,o){if(r===f)throw new Error("Generator is already running");if(r===h){if("throw"===i)throw o;return T()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=j(a,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var c=u(e,t,n);if("normal"===c.type){if(r=n.done?h:p,c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=h,n.method="throw",n.arg=c.arg)}}}(e,n,a),o}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var d="suspendedStart",p="suspendedYield",f="executing",h="completed",m={};function v(){}function g(){}function y(){}var b={};b[o]=function(){return this};var w=Object.getPrototypeOf,_=w&&w(w(A([])));_&&_!==n&&r.call(_,o)&&(b=_);var x=y.prototype=v.prototype=Object.create(b);function O(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function n(i,o,a,s){var c=u(e[i],e,o);if("throw"!==c.type){var l=c.arg,d=l.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(d).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,s)}))}s(c.arg)}var i;this._invoke=function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}}function j(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,j(e,n),"throw"===n.method))return m;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var i=u(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function A(e){if(e){var n=e[o];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function n(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=r}catch(e){Function("r","regeneratorRuntime = r")(r)}},,function(e,t,n){"use strict";n.r(t),n.d(t,"cloudinary",(function(){return $n}));n(9),n(10);var r=n(2),i=n.n(r),o=n(3),a=n.n(o);const s={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_optimization"),video:document.getElementById("video_optimization")},error_container:document.getElementById("cld-preview-error"),activeItem:null,elements:{image:[],video:[]},_placeItem(e){null!==e&&(e.style.display="block",e.style.visibility="visible",e.style.position="absolute",e.style.top=e.parentElement.clientHeight/2-e.clientHeight/2+"px",e.style.left=e.parentElement.clientWidth/2-e.clientWidth/2+"px")},_setLoading(e){this.button[e].style.display="block",this._placeItem(this.button[e]),this.preview[e].style.opacity="0.1"},_build(e){this.sample[e].innerHTML="",this.elements[e]=[];for(const t of this.fields){if(e!==t.dataset.context||t.dataset.disabled&&"true"===t.dataset.disabled)continue;let n=t.value.trim();if(n.length){if("select-one"===t.type){if("none"===n||!1===this.optimization[e].checked)continue;n=t.dataset.meta+"_"+n}else e=t.dataset.context,t.dataset.meta&&(n=t.dataset.meta+"_"+n),t.dataset.suffix&&(n+=t.dataset.suffix),n=this._transformations(n,e,!0);n&&this.elements[e].push(n)}}let t="";this.elements[e].length&&(t="/"+this._getGlobalTransformationElements(e).replace(/ /g,"%20")),this.sample[e].textContent=t,this.sample[e].parentElement.href="https://res.cloudinary.com/demo/"+this.sample[e].parentElement.innerText.trim().replace("../","").replace(/ /g,"%20")},_clearLoading(e){this.spinner[e].style.visibility="hidden",this.activeItem=null,this.preview[e].style.opacity=1},_refresh(e,t){e&&e.preventDefault();const n=this,r=CLD_GLOBAL_TRANSFORMATIONS[t].preview_url+this._getGlobalTransformationElements(t)+CLD_GLOBAL_TRANSFORMATIONS[t].file;if(this.button[t].style.display="none",this._placeItem(this.spinner[t]),"image"===t){const e=new Image;e.onload=function(){n.preview[t].src=this.src,n._clearLoading(t),n.error_container&&(n.error_container.style.display="none"),e.remove()},e.onerror=function(){const e=n.elements[t].includes("f_mp4");n.error_container&&(n.error_container.style.display="block",e?(n.error_container.innerHTML=CLD_GLOBAL_TRANSFORMATIONS[t].warning.replace("%s","f_mp4"),n.error_container.classList.replace("settings-alert-error","settings-alert-warning")):(n.error_container.innerHTML=CLD_GLOBAL_TRANSFORMATIONS[t].error,n.error_container.classList.replace("settings-alert-warning","settings-alert-error"))),n._clearLoading(t)},e.src=r}else{const e=n._transformations(n._getGlobalTransformationElements(t),t);samplePlayer.source({publicId:"dog",transformation:e}),n._clearLoading(t)}},_getGlobalTransformationElements(e){let t=[];return t.push(this.elements[e].slice(0,2).join(",")),t.push(this.elements[e].slice(2).join(",")),t=t.filter((e=>e)).join("/"),t},_transformations(e,t,n=!1){const r=CLD_GLOBAL_TRANSFORMATIONS[t].valid_types;let i=null;const o=e.split("/"),a=[];for(let e=0;e{const r=!!n.length&&jQuery('[data-item="'+i+":"+n[0].id+'"]');r.length?r.remove():(jQuery(`.cld-tax-order-list-item:contains(${a})`).remove(),--e.startId),this.processTags(t)}))}),jQuery("body").on("change",".selectit input",(function(){const t=jQuery(this),n=t.val(),r=t.is(":checked"),i=t.parent().text().trim();!0===r?e.tags.find(`[data-item="category:${n}"]`).length||e._pushItem(`category:${n}`,i):e.tags.find(`[data-item="category:${n}"]`).remove()}))},_createItem(e,t){const n=jQuery("
  • "),r=jQuery(""),i=jQuery("");return n.addClass("cld-tax-order-list-item").attr("data-item",e),i.addClass("cld-tax-order-list-item-input").attr("type","hidden").attr("name","cld_tax_order[]").val(e),r.addClass("dashicons dashicons-menu cld-tax-order-list-item-handle"),n.append(r).append(t).append(i),n},_pushItem(e,t){const n=this._createItem(e,t);this.tags.append(n)},_sortable(){jQuery(".cld-tax-order-list").sortable({connectWith:".cld-tax-order",axis:"y",handle:".cld-tax-order-list-item-handle",placeholder:"cld-tax-order-list-item-placeholder",forcePlaceholderSize:!0,helper:"clone"})}};if(void 0!==window.CLDN&&(l._init(),jQuery("[data-wp-lists] .selectit input[checked]").each(((e,t)=>{jQuery(t).trigger("change")}))),wp.data&&wp.data.select("core/editor")){const e={};wp.data.subscribe((function(){const t=wp.data.select("core").getTaxonomies();if(t)for(const n in t){const r=wp.data.select("core/editor").getEditedPostAttribute(t[n].rest_base);e[t[n].slug]=r}}));const t=wp.element.createElement,n=n=>{class r extends n{constructor(e){super(e),this.currentItems=jQuery(".cld-tax-order-list-item").map(((e,t)=>jQuery(t).data("item"))).get()}makeItem(e){if(this.currentItems.includes(this.getId(e)))return;const t=this.makeElement(e);jQuery("#cld-tax-items").append(t)}removeItem(e){const t=jQuery(`[data-item="${this.getId(e)}"]`);t.length&&(t.remove(),this.currentItems=this.currentItems.filter((t=>t!==this.getId(e))))}findOrCreateTerm(e){return(e=super.findOrCreateTerm(e)).then((e=>this.makeItem(e))),e}onChange(t){super.onChange(t);const n=this.pickItem(t);n&&(e[this.props.slug].includes(n.id)?this.makeItem(n):this.removeItem(n))}pickItem(e){if("object"==typeof e){if(e.target){for(const t in this.state.availableTerms)if(this.state.availableTerms[t].id===parseInt(e.target.value))return this.state.availableTerms[t]}else if(Array.isArray(e)){let t=this.state.selectedTerms.filter((t=>!e.includes(t)))[0];return void 0===t&&(t=e.filter((e=>!this.state.selectedTerms.includes(e)))[0]),this.state.availableTerms.find((e=>e.name===t))}}else if("number"==typeof e){for(const t in this.state.availableTerms)if(this.state.availableTerms[t].id===e)return this.state.availableTerms[t]}else{let t;if(e.length>this.state.selectedTerms.length)for(const n in e)-1===this.state.selectedTerms.indexOf(e[n])&&(t=e[n]);else for(const n in this.state.selectedTerms)-1===e.indexOf(this.state.selectedTerms[n])&&(t=this.state.selectedTerms[n]);for(const e in this.state.availableTerms)if(this.state.availableTerms[e].name===t)return this.state.availableTerms[e]}}getId(e){return`${this.props.slug}:${e.id}`}makeElement(e){const t=jQuery("
  • "),n=jQuery(""),r=jQuery("");return t.addClass("cld-tax-order-list-item").attr("data-item",this.getId(e)),r.addClass("cld-tax-order-list-item-input").attr("type","hidden").attr("name","cld_tax_order[]").val(this.getId(e)),n.addClass("dashicons dashicons-menu cld-tax-order-list-item-handle"),t.append(n).append(e.name).append(r),t}}return e=>t(r,e)};wp.hooks.addFilter("editor.PostTaxonomyType","cld",n)}var u=l;const d={wpWrap:document.getElementById("wpwrap"),wpContent:document.getElementById("wpbody-content"),libraryWrap:document.getElementById("cloudinary-embed"),_init(){const e=this;"undefined"!=typeof CLD_ML&&(cloudinary.openMediaLibrary(CLD_ML.mloptions,{insertHandler(){alert("Import is not yet implemented.")}}),window.addEventListener("resize",(function(){e._resize()})),e._resize())},_resize(){const e=getComputedStyle(this.wpContent);this.libraryWrap.style.height=this.wpWrap.offsetHeight-parseInt(e.getPropertyValue("padding-bottom"))+"px"}};var p=d;d._init();const f={_init(){const e=this;if("undefined"!=typeof CLDIS){[...document.getElementsByClassName("cld-notice-box")].forEach((t=>{const n=t.getElementsByClassName("notice-dismiss");n.length&&n[0].addEventListener("click",(n=>{t.style.height=t.offsetHeight+"px",n.preventDefault(),setTimeout((function(){e._dismiss(t)}),5)}))}))}},_dismiss(e){const t=e.dataset.dismiss,n=parseInt(e.dataset.duration);e.classList.add("dismissed"),e.style.height="0px",setTimeout((function(){e.remove()}),400),0=0?e.ownerDocument.body:b(e)&&j(e)?e:A(C(e))}function T(e,t){var n;void 0===t&&(t=[]);var r=A(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=v(r),a=i?[o].concat(o.visualViewport||[],j(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(T(C(a)))}function P(e){return["table","td","th"].indexOf(_(e))>=0}function S(e){return b(e)&&"fixed"!==E(e).position?e.offsetParent:null}function D(e){for(var t=v(e),n=S(e);n&&P(n)&&"static"===E(n).position;)n=S(n);return n&&("html"===_(n)||"body"===_(n)&&"static"===E(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&b(e)&&"fixed"===E(e).position)return null;for(var n=C(e);b(n)&&["html","body"].indexOf(_(n))<0;){var r=E(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}var I="top",N="bottom",M="right",F="left",B="auto",R=[I,N,M,F],z="start",H="end",q="viewport",U="popper",W=R.reduce((function(e,t){return e.concat([t+"-"+z,t+"-"+H])}),[]),Q=[].concat(R,[B]).reduce((function(e,t){return e.concat([t,t+"-"+z,t+"-"+H])}),[]),V=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function G(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),r}var $={placement:"bottom",modifiers:[],strategy:"absolute"};function J(){for(var e=arguments.length,t=new Array(e),n=0;n=0?"x":"y"}function ne(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?Z(i):null,a=i?ee(i):null,s=n.x+n.width/2-r.width/2,c=n.y+n.height/2-r.height/2;switch(o){case I:t={x:s,y:n.y-r.height};break;case N:t={x:s,y:n.y+n.height};break;case M:t={x:n.x+n.width,y:c};break;case F:t={x:n.x-r.width,y:c};break;default:t={x:n.x,y:n.y}}var l=o?te(o):null;if(null!=l){var u="y"===l?"height":"width";switch(a){case z:t[l]=t[l]-(n[u]/2-r[u]/2);break;case H:t[l]=t[l]+(n[u]/2-r[u]/2)}}return t}var re={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=ne({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},ie=Math.max,oe=Math.min,ae=Math.round,se={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ce(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.offsets,a=e.position,s=e.gpuAcceleration,c=e.adaptive,l=e.roundOffsets,u=!0===l?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:ae(ae(t*r)/r)||0,y:ae(ae(n*r)/r)||0}}(o):"function"==typeof l?l(o):o,d=u.x,p=void 0===d?0:d,f=u.y,h=void 0===f?0:f,m=o.hasOwnProperty("x"),g=o.hasOwnProperty("y"),y=F,b=I,w=window;if(c){var _=D(n),O="clientHeight",j="clientWidth";_===v(n)&&"static"!==E(_=x(n)).position&&(O="scrollHeight",j="scrollWidth"),_=_,i===I&&(b=N,h-=_[O]-r.height,h*=s?1:-1),i===F&&(y=M,p-=_[j]-r.width,p*=s?1:-1)}var L,k=Object.assign({position:a},c&&se);return s?Object.assign({},k,((L={})[b]=g?"0":"",L[y]=m?"0":"",L.transform=(w.devicePixelRatio||1)<2?"translate("+p+"px, "+h+"px)":"translate3d("+p+"px, "+h+"px, 0)",L)):Object.assign({},k,((t={})[b]=g?h+"px":"",t[y]=m?p+"px":"",t.transform="",t))}var le={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];b(i)&&_(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],i=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});b(r)&&_(r)&&(Object.assign(r.style,o),Object.keys(i).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};var ue={left:"right",right:"left",bottom:"top",top:"bottom"};function de(e){return e.replace(/left|right|bottom|top/g,(function(e){return ue[e]}))}var pe={start:"end",end:"start"};function fe(e){return e.replace(/start|end/g,(function(e){return pe[e]}))}function he(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&w(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function me(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){return t===q?me(function(e){var t=v(e),n=x(e),r=t.visualViewport,i=n.clientWidth,o=n.clientHeight,a=0,s=0;return r&&(i=r.width,o=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,s=r.offsetTop)),{width:i,height:o,x:a+O(e),y:s}}(e)):b(t)?function(e){var t=m(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):me(function(e){var t,n=x(e),r=g(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=ie(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=ie(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+O(e),c=-r.scrollTop;return"rtl"===E(i||n).direction&&(s+=ie(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:c}}(x(e)))}function ge(e,t,n){var r="clippingParents"===t?function(e){var t=T(C(e)),n=["absolute","fixed"].indexOf(E(e).position)>=0&&b(e)?D(e):e;return y(n)?t.filter((function(e){return y(e)&&he(e,n)&&"body"!==_(e)})):[]}(e):[].concat(t),i=[].concat(r,[n]),o=i[0],a=i.reduce((function(t,n){var r=ve(e,n);return t.top=ie(r.top,t.top),t.right=oe(r.right,t.right),t.bottom=oe(r.bottom,t.bottom),t.left=ie(r.left,t.left),t}),ve(e,o));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ye(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function be(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function we(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=void 0===r?e.placement:r,o=n.boundary,a=void 0===o?"clippingParents":o,s=n.rootBoundary,c=void 0===s?q:s,l=n.elementContext,u=void 0===l?U:l,d=n.altBoundary,p=void 0!==d&&d,f=n.padding,h=void 0===f?0:f,v=ye("number"!=typeof h?h:be(h,R)),g=u===U?"reference":U,b=e.elements.reference,w=e.rects.popper,_=e.elements[p?g:u],O=ge(y(_)?_:_.contextElement||x(e.elements.popper),a,c),E=m(b),j=ne({reference:E,element:w,strategy:"absolute",placement:i}),L=me(Object.assign({},w,j)),k=u===U?L:E,C={top:O.top-k.top+v.top,bottom:k.bottom-O.bottom+v.bottom,left:O.left-k.left+v.left,right:k.right-O.right+v.right},A=e.modifiersData.offset;if(u===U&&A){var T=A[i];Object.keys(C).forEach((function(e){var t=[M,N].indexOf(e)>=0?1:-1,n=[I,N].indexOf(e)>=0?"y":"x";C[e]+=T[n]*t}))}return C}function _e(e,t,n){return ie(e,oe(t,n))}function xe(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Oe(e){return[I,M,N,F].some((function(t){return e[t]>=0}))}var Ee=X({defaultModifiers:[K,re,{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,a=void 0===o||o,s=n.roundOffsets,c=void 0===s||s,l={placement:Z(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,ce(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,ce(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},le,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=void 0===i?[0,0]:i,a=Q.reduce((function(e,n){return e[n]=function(e,t,n){var r=Z(e),i=[F,I].indexOf(r)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[F,M].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,o),e}),{}),s=a[t.placement],c=s.x,l=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=a}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0===a||a,c=n.fallbackPlacements,l=n.padding,u=n.boundary,d=n.rootBoundary,p=n.altBoundary,f=n.flipVariations,h=void 0===f||f,m=n.allowedAutoPlacements,v=t.options.placement,g=Z(v),y=c||(g===v||!h?[de(v)]:function(e){if(Z(e)===B)return[];var t=de(e);return[fe(e),t,fe(t)]}(v)),b=[v].concat(y).reduce((function(e,n){return e.concat(Z(n)===B?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,l=void 0===c?Q:c,u=ee(r),d=u?s?W:W.filter((function(e){return ee(e)===u})):R,p=d.filter((function(e){return l.indexOf(e)>=0}));0===p.length&&(p=d);var f=p.reduce((function(t,n){return t[n]=we(e,{placement:n,boundary:i,rootBoundary:o,padding:a})[Z(n)],t}),{});return Object.keys(f).sort((function(e,t){return f[e]-f[t]}))}(t,{placement:n,boundary:u,rootBoundary:d,padding:l,flipVariations:h,allowedAutoPlacements:m}):n)}),[]),w=t.rects.reference,_=t.rects.popper,x=new Map,O=!0,E=b[0],j=0;j=0,T=A?"width":"height",P=we(t,{placement:L,boundary:u,rootBoundary:d,altBoundary:p,padding:l}),S=A?C?M:F:C?N:I;w[T]>_[T]&&(S=de(S));var D=de(S),H=[];if(o&&H.push(P[k]<=0),s&&H.push(P[S]<=0,P[D]<=0),H.every((function(e){return e}))){E=L,O=!1;break}x.set(L,H)}if(O)for(var q=function(e){var t=b.find((function(t){var n=x.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return E=t,"break"},U=h?3:1;U>0;U--){if("break"===q(U))break}t.placement!==E&&(t.modifiersData[r]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0!==a&&a,c=n.boundary,l=n.rootBoundary,u=n.altBoundary,d=n.padding,p=n.tether,f=void 0===p||p,h=n.tetherOffset,m=void 0===h?0:h,v=we(t,{boundary:c,rootBoundary:l,padding:d,altBoundary:u}),g=Z(t.placement),y=ee(t.placement),b=!y,w=te(g),_="x"===w?"y":"x",x=t.modifiersData.popperOffsets,O=t.rects.reference,E=t.rects.popper,j="function"==typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,L={x:0,y:0};if(x){if(o||s){var C="y"===w?I:F,A="y"===w?N:M,T="y"===w?"height":"width",P=x[w],S=x[w]+v[C],B=x[w]-v[A],R=f?-E[T]/2:0,H=y===z?O[T]:E[T],q=y===z?-E[T]:-O[T],U=t.elements.arrow,W=f&&U?k(U):{width:0,height:0},Q=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},V=Q[C],G=Q[A],$=_e(0,O[T],W[T]),J=b?O[T]/2-R-$-V-j:H-$-V-j,X=b?-O[T]/2+R+$+G+j:q+$+G+j,Y=t.elements.arrow&&D(t.elements.arrow),K=Y?"y"===w?Y.clientTop||0:Y.clientLeft||0:0,ne=t.modifiersData.offset?t.modifiersData.offset[t.placement][w]:0,re=x[w]+J-ne-K,ae=x[w]+X-ne;if(o){var se=_e(f?oe(S,re):S,P,f?ie(B,ae):B);x[w]=se,L[w]=se-P}if(s){var ce="x"===w?I:F,le="x"===w?N:M,ue=x[_],de=ue+v[ce],pe=ue-v[le],fe=_e(f?oe(de,re):de,ue,f?ie(pe,ae):pe);x[_]=fe,L[_]=fe-ue}}t.modifiersData[r]=L}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Z(n.placement),c=te(s),l=[F,M].indexOf(s)>=0?"height":"width";if(o&&a){var u=function(e,t){return ye("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:be(e,R))}(i.padding,n),d=k(o),p="y"===c?I:F,f="y"===c?N:M,h=n.rects.reference[l]+n.rects.reference[c]-a[c]-n.rects.popper[l],m=a[c]-n.rects.reference[c],v=D(o),g=v?"y"===c?v.clientHeight||0:v.clientWidth||0:0,y=h/2-m/2,b=u[p],w=g-d[l]-u[f],_=g/2-d[l]/2+y,x=_e(b,_,w),O=c;n.modifiersData[r]=((t={})[O]=x,t.centerOffset=x-_,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&he(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=we(t,{elementContext:"reference"}),s=we(t,{altBoundary:!0}),c=xe(a,r),l=xe(s,i,o),u=Oe(c),d=Oe(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}}]}),je="tippy-content",Le="tippy-backdrop",ke="tippy-arrow",Ce="tippy-svg-arrow",Ae={passive:!0,capture:!0};function Te(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function Pe(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function Se(e,t){return"function"==typeof e?e.apply(void 0,t):e}function De(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function Ie(e){return[].concat(e)}function Ne(e,t){-1===e.indexOf(t)&&e.push(t)}function Me(e){return e.split("-")[0]}function Fe(e){return[].slice.call(e)}function Be(){return document.createElement("div")}function Re(e){return["Element","Fragment"].some((function(t){return Pe(e,t)}))}function ze(e){return Pe(e,"MouseEvent")}function He(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function qe(e){return Re(e)?[e]:function(e){return Pe(e,"NodeList")}(e)?Fe(e):Array.isArray(e)?e:Fe(document.querySelectorAll(e))}function Ue(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function We(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function Qe(e){var t,n=Ie(e)[0];return(null==n||null==(t=n.ownerDocument)?void 0:t.body)?n.ownerDocument:document}function Ve(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}var Ge={isTouch:!1},$e=0;function Je(){Ge.isTouch||(Ge.isTouch=!0,window.performance&&document.addEventListener("mousemove",Xe))}function Xe(){var e=performance.now();e-$e<20&&(Ge.isTouch=!1,document.removeEventListener("mousemove",Xe)),$e=e}function Ye(){var e=document.activeElement;if(He(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var Ke="undefined"!=typeof window&&"undefined"!=typeof document?navigator.userAgent:"",Ze=/MSIE |Trident\//.test(Ke);var et={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},tt=Object.assign({appendTo:function(){return document.body},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},et,{},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),nt=Object.keys(tt);function rt(e){var t=(e.plugins||[]).reduce((function(t,n){var r=n.name,i=n.defaultValue;return r&&(t[r]=void 0!==e[r]?e[r]:i),t}),{});return Object.assign({},e,{},t)}function it(e,t){var n=Object.assign({},t,{content:Se(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(rt(Object.assign({},tt,{plugins:t}))):nt).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},tt.aria,{},n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function ot(e,t){e.innerHTML=t}function at(e){var t=Be();return!0===e?t.className=ke:(t.className=Ce,Re(e)?t.appendChild(e):ot(t,e)),t}function st(e,t){Re(t.content)?(ot(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?ot(e,t.content):e.textContent=t.content)}function ct(e){var t=e.firstElementChild,n=Fe(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(je)})),arrow:n.find((function(e){return e.classList.contains(ke)||e.classList.contains(Ce)})),backdrop:n.find((function(e){return e.classList.contains(Le)}))}}function lt(e){var t=Be(),n=Be();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Be();function i(n,r){var i=ct(t),o=i.box,a=i.content,s=i.arrow;r.theme?o.setAttribute("data-theme",r.theme):o.removeAttribute("data-theme"),"string"==typeof r.animation?o.setAttribute("data-animation",r.animation):o.removeAttribute("data-animation"),r.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?o.setAttribute("role",r.role):o.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||st(a,e.props),r.arrow?s?n.arrow!==r.arrow&&(o.removeChild(s),o.appendChild(at(r.arrow))):o.appendChild(at(r.arrow)):s&&o.removeChild(s)}return r.className=je,r.setAttribute("data-state","hidden"),st(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props),{popper:t,onUpdate:i}}lt.$$tippy=!0;var ut=1,dt=[],pt=[];function ft(e,t){var n,r,i,o,a,s,c,l,u,d=it(e,Object.assign({},tt,{},rt((n=t,Object.keys(n).reduce((function(e,t){return void 0!==n[t]&&(e[t]=n[t]),e}),{}))))),p=!1,f=!1,h=!1,m=!1,v=[],g=De($,d.interactiveDebounce),y=ut++,b=(u=d.plugins).filter((function(e,t){return u.indexOf(e)===t})),w={id:y,reference:e,popper:Be(),popperInstance:null,props:d,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:b,clearDelayTimeouts:function(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)},setProps:function(t){0;if(w.state.isDestroyed)return;I("onBeforeUpdate",[w,t]),V();var n=w.props,r=it(e,Object.assign({},w.props,{},t,{ignoreAttributes:!0}));w.props=r,Q(),n.interactiveDebounce!==r.interactiveDebounce&&(F(),g=De($,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?Ie(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");M(),D(),O&&O(n,r);w.popperInstance&&(K(),ee().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));I("onAfterUpdate",[w,t])},setContent:function(e){w.setProps({content:e})},show:function(){0;var e=w.state.isVisible,t=w.state.isDestroyed,n=!w.state.isEnabled,r=Ge.isTouch&&!w.props.touch,i=Te(w.props.duration,0,tt.duration);if(e||t||n||r)return;if(A().hasAttribute("disabled"))return;if(I("onShow",[w],!1),!1===w.props.onShow(w))return;w.state.isVisible=!0,C()&&(x.style.visibility="visible");D(),H(),w.state.isMounted||(x.style.transition="none");if(C()){var o=P(),a=o.box,s=o.content;Ue([a,s],0)}c=function(){var e;if(w.state.isVisible&&!m){if(m=!0,x.offsetHeight,x.style.transition=w.props.moveTransition,C()&&w.props.animation){var t=P(),n=t.box,r=t.content;Ue([n,r],i),We([n,r],"visible")}N(),M(),Ne(pt,w),null==(e=w.popperInstance)||e.forceUpdate(),w.state.isMounted=!0,I("onMount",[w]),w.props.animation&&C()&&function(e,t){U(e,t)}(i,(function(){w.state.isShown=!0,I("onShown",[w])}))}},function(){var e,t=w.props.appendTo,n=A();e=w.props.interactive&&t===tt.appendTo||"parent"===t?n.parentNode:Se(t,[n]);e.contains(x)||e.appendChild(x);K(),!1}()},hide:function(){0;var e=!w.state.isVisible,t=w.state.isDestroyed,n=!w.state.isEnabled,r=Te(w.props.duration,1,tt.duration);if(e||t||n)return;if(I("onHide",[w],!1),!1===w.props.onHide(w))return;w.state.isVisible=!1,w.state.isShown=!1,m=!1,p=!1,C()&&(x.style.visibility="hidden");if(F(),q(),D(),C()){var i=P(),o=i.box,a=i.content;w.props.animation&&(Ue([o,a],r),We([o,a],"hidden"))}N(),M(),w.props.animation?C()&&function(e,t){U(e,(function(){!w.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&t()}))}(r,w.unmount):w.unmount()},hideWithInteractivity:function(e){0;T().addEventListener("mousemove",g),Ne(dt,g),g(e)},enable:function(){w.state.isEnabled=!0},disable:function(){w.hide(),w.state.isEnabled=!1},unmount:function(){0;w.state.isVisible&&w.hide();if(!w.state.isMounted)return;Z(),ee().forEach((function(e){e._tippy.unmount()})),x.parentNode&&x.parentNode.removeChild(x);pt=pt.filter((function(e){return e!==w})),w.state.isMounted=!1,I("onHidden",[w])},destroy:function(){0;if(w.state.isDestroyed)return;w.clearDelayTimeouts(),w.unmount(),V(),delete e._tippy,w.state.isDestroyed=!0,I("onDestroy",[w])}};if(!d.render)return w;var _=d.render(w),x=_.popper,O=_.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+w.id,w.popper=x,e._tippy=w,x._tippy=w;var E=b.map((function(e){return e.fn(w)})),j=e.hasAttribute("aria-expanded");return Q(),M(),D(),I("onCreate",[w]),d.showOnCreate&&te(),x.addEventListener("mouseenter",(function(){w.props.interactive&&w.state.isVisible&&w.clearDelayTimeouts()})),x.addEventListener("mouseleave",(function(e){w.props.interactive&&w.props.trigger.indexOf("mouseenter")>=0&&(T().addEventListener("mousemove",g),g(e))})),w;function L(){var e=w.props.touch;return Array.isArray(e)?e:[e,0]}function k(){return"hold"===L()[0]}function C(){var e;return!!(null==(e=w.props.render)?void 0:e.$$tippy)}function A(){return l||e}function T(){var e=A().parentNode;return e?Qe(e):document}function P(){return ct(x)}function S(e){return w.state.isMounted&&!w.state.isVisible||Ge.isTouch||a&&"focus"===a.type?0:Te(w.props.delay,e?0:1,tt.delay)}function D(){x.style.pointerEvents=w.props.interactive&&w.state.isVisible?"":"none",x.style.zIndex=""+w.props.zIndex}function I(e,t,n){var r;(void 0===n&&(n=!0),E.forEach((function(n){n[e]&&n[e].apply(void 0,t)})),n)&&(r=w.props)[e].apply(r,t)}function N(){var t=w.props.aria;if(t.content){var n="aria-"+t.content,r=x.id;Ie(w.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(w.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var i=t&&t.replace(r,"").trim();i?e.setAttribute(n,i):e.removeAttribute(n)}}))}}function M(){!j&&w.props.aria.expanded&&Ie(w.props.triggerTarget||e).forEach((function(e){w.props.interactive?e.setAttribute("aria-expanded",w.state.isVisible&&e===A()?"true":"false"):e.removeAttribute("aria-expanded")}))}function F(){T().removeEventListener("mousemove",g),dt=dt.filter((function(e){return e!==g}))}function B(e){if(!(Ge.isTouch&&(h||"mousedown"===e.type)||w.props.interactive&&x.contains(e.target))){if(A().contains(e.target)){if(Ge.isTouch)return;if(w.state.isVisible&&w.props.trigger.indexOf("click")>=0)return}else I("onClickOutside",[w,e]);!0===w.props.hideOnClick&&(w.clearDelayTimeouts(),w.hide(),f=!0,setTimeout((function(){f=!1})),w.state.isMounted||q())}}function R(){h=!0}function z(){h=!1}function H(){var e=T();e.addEventListener("mousedown",B,!0),e.addEventListener("touchend",B,Ae),e.addEventListener("touchstart",z,Ae),e.addEventListener("touchmove",R,Ae)}function q(){var e=T();e.removeEventListener("mousedown",B,!0),e.removeEventListener("touchend",B,Ae),e.removeEventListener("touchstart",z,Ae),e.removeEventListener("touchmove",R,Ae)}function U(e,t){var n=P().box;function r(e){e.target===n&&(Ve(n,"remove",r),t())}if(0===e)return t();Ve(n,"remove",s),Ve(n,"add",r),s=r}function W(t,n,r){void 0===r&&(r=!1),Ie(w.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),v.push({node:e,eventType:t,handler:n,options:r})}))}function Q(){var e;k()&&(W("touchstart",G,{passive:!0}),W("touchend",J,{passive:!0})),(e=w.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(W(e,G),e){case"mouseenter":W("mouseleave",J);break;case"focus":W(Ze?"focusout":"blur",X);break;case"focusin":W("focusout",X)}}))}function V(){v.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,i=e.options;t.removeEventListener(n,r,i)})),v=[]}function G(e){var t,n=!1;if(w.state.isEnabled&&!Y(e)&&!f){var r="focus"===(null==(t=a)?void 0:t.type);a=e,l=e.currentTarget,M(),!w.state.isVisible&&ze(e)&&dt.forEach((function(t){return t(e)})),"click"===e.type&&(w.props.trigger.indexOf("mouseenter")<0||p)&&!1!==w.props.hideOnClick&&w.state.isVisible?n=!0:te(e),"click"===e.type&&(p=!n),n&&!r&&ne(e)}}function $(e){var t=e.target,n=A().contains(t)||x.contains(t);"mousemove"===e.type&&n||function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,i=e.popperState,o=e.props.interactiveBorder,a=Me(i.placement),s=i.modifiersData.offset;if(!s)return!0;var c="bottom"===a?s.top.y:0,l="top"===a?s.bottom.y:0,u="right"===a?s.left.x:0,d="left"===a?s.right.x:0,p=t.top-r+c>o,f=r-t.bottom-l>o,h=t.left-n+u>o,m=n-t.right-d>o;return p||f||h||m}))}(ee().concat(x).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:d}:null})).filter(Boolean),e)&&(F(),ne(e))}function J(e){Y(e)||w.props.trigger.indexOf("click")>=0&&p||(w.props.interactive?w.hideWithInteractivity(e):ne(e))}function X(e){w.props.trigger.indexOf("focusin")<0&&e.target!==A()||w.props.interactive&&e.relatedTarget&&x.contains(e.relatedTarget)||ne(e)}function Y(e){return!!Ge.isTouch&&k()!==e.type.indexOf("touch")>=0}function K(){Z();var t=w.props,n=t.popperOptions,r=t.placement,i=t.offset,o=t.getReferenceClientRect,a=t.moveTransition,s=C()?ct(x).arrow:null,l=o?{getBoundingClientRect:o,contextElement:o.contextElement||A()}:e,u=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(C()){var n=P().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}}];C()&&s&&u.push({name:"arrow",options:{element:s,padding:3}}),u.push.apply(u,(null==n?void 0:n.modifiers)||[]),w.popperInstance=Ee(l,x,Object.assign({},n,{placement:r,onFirstUpdate:c,modifiers:u}))}function Z(){w.popperInstance&&(w.popperInstance.destroy(),w.popperInstance=null)}function ee(){return Fe(x.querySelectorAll("[data-tippy-root]"))}function te(e){w.clearDelayTimeouts(),e&&I("onTrigger",[w,e]),H();var t=S(!0),n=L(),i=n[0],o=n[1];Ge.isTouch&&"hold"===i&&o&&(t=o),t?r=setTimeout((function(){w.show()}),t):w.show()}function ne(e){if(w.clearDelayTimeouts(),I("onUntrigger",[w,e]),w.state.isVisible){if(!(w.props.trigger.indexOf("mouseenter")>=0&&w.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&p)){var t=S(!1);t?i=setTimeout((function(){w.state.isVisible&&w.hide()}),t):o=requestAnimationFrame((function(){w.hide()}))}}else q()}}function ht(e,t){void 0===t&&(t={});var n=tt.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",Je,Ae),window.addEventListener("blur",Ye);var r=Object.assign({},t,{plugins:n}),i=qe(e).reduce((function(e,t){var n=t&&ft(t,r);return n&&e.push(n),e}),[]);return Re(e)?i[0]:i}ht.defaultProps=tt,ht.setDefaultProps=function(e){Object.keys(e).forEach((function(t){tt[t]=e[t]}))},ht.currentInput=Ge;Object.assign({},le,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}});ht.setDefaultProps({render:lt});var mt=ht,vt=n(4),gt=n.n(vt);var yt={controlled:null,bind(e){this.controlled=e,this.controlled.forEach((e=>{this._master(e)})),this._init()},_init(){this.controlled.forEach((e=>{this._checkUp(e)}))},_master(e){const t=JSON.parse(e.dataset.master);e.dataset.size&&(e.filesize=parseInt(e.dataset.size,10)),e.masters=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.masters.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.masters&&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.masters&&[...e.masters].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 i="off"!==r;e.checked===i&&e.value===r||(e.value=r,e.checked=i,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;0=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var _t,xt,Ot,Et,jt=n(5),Lt=n.n(jt);n(0),Lt()(console.error);_t={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},xt=["(","?"],Ot={")":["("],":":["?","?:"]},Et=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var kt={"!":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 Ct(e){var t=function(e){for(var t,n,r,i,o=[],a=[];t=e.match(Et);){for(n=t[0],(r=e.substr(0,t.index).trim())&&o.push(r);i=a.pop();){if(Ot[n]){if(Ot[n][0]===i){n=Ot[n][1]||n;break}}else if(xt.indexOf(i)>=0||_t[i]<_t[n]){a.push(i);break}o.push(i)}Ot[n]||a.push(n),e=e.substr(t.index+n.length)}return(e=e.trim())&&o.push(e),o.concat(a.reverse())}(e);return function(e){return function(e,t){var n,r,i,o,a,s,c=[];for(n=0;n3&&void 0!==arguments[3]?arguments[3]:10,a=e[t];if(Mt(n)&&Nt(r))if("function"==typeof i)if("number"==typeof o){var s={callback:i,priority:o,namespace:r};if(a[n]){var c,l=a[n].handlers;for(c=l.length;c>0&&!(o>=l[c-1].priority);c--);c===l.length?l[c]=s:l.splice(c,0,s),a.__current.forEach((function(e){e.name===n&&e.currentIndex>=c&&e.currentIndex++}))}else a[n]={handlers:[s],runs:0};"hookAdded"!==n&&e.doAction("hookAdded",n,r,i,o)}else console.error("If specified, the hook priority must be a number.");else console.error("The hook callback must be a function.")}};var Bt=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(r,i){var o=e[t];if(Mt(r)&&(n||Nt(i))){if(!o[r])return 0;var a=0;if(n)a=o[r].handlers.length,o[r]={runs:o[r].runs,handlers:[]};else for(var s=o[r].handlers,c=function(e){s[e].namespace===i&&(s.splice(e,1),a++,o.__current.forEach((function(t){t.name===r&&t.currentIndex>=e&&t.currentIndex--})))},l=s.length-1;l>=0;l--)c(l);return"hookRemoved"!==r&&e.doAction("hookRemoved",r,i),a}}};var Rt=function(e,t){return function(n,r){var i=e[t];return void 0!==r?n in i&&i[n].handlers.some((function(e){return e.namespace===r})):n in i}};function zt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]&&arguments[2];return function(r){var i=e[t];i[r]||(i[r]={handlers:[],runs:0}),i[r].runs++;var o=i[r].handlers;for(var a=arguments.length,s=new Array(a>1?a-1:0),c=1;c1&&void 0!==arguments[1]?arguments[1]:"default";r.data[t]=St(St(St({},Dt),r.data[t]),e),r.data[t][""]=St(St({},Dt[""]),r.data[t][""])},s=function(e,t){a(e,t),o()},c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;return r.data[e]||a(void 0,e),r.dcnpgettext(e,t,n,i,o)},l=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return e},u=function(e,t,r){var i=c(r,t,e);return n?(i=n.applyFilters("i18n.gettext_with_context",i,e,t,r),n.applyFilters("i18n.gettext_with_context_"+l(r),i,e,t,r)):i};if(e&&s(e,t),n){var d=function(e){It.test(e)&&o()};n.addAction("hookAdded","core/i18n",d),n.addAction("hookRemoved","core/i18n",d)}return{getLocaleData:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return r.data[e]},setLocaleData:s,resetLocaleData:function(e,t){r.data={},r.pluralForms={},s(e,t)},subscribe:function(e){return i.add(e),function(){return i.delete(e)}},__:function(e,t){var r=c(t,void 0,e);return n?(r=n.applyFilters("i18n.gettext",r,e,t),n.applyFilters("i18n.gettext_"+l(t),r,e,t)):r},_x:u,_n:function(e,t,r,i){var o=c(i,void 0,e,t,r);return n?(o=n.applyFilters("i18n.ngettext",o,e,t,r,i),n.applyFilters("i18n.ngettext_"+l(i),o,e,t,r,i)):o},_nx:function(e,t,r,i,o){var a=c(o,i,e,t,r);return n?(a=n.applyFilters("i18n.ngettext_with_context",a,e,t,r,i,o),n.applyFilters("i18n.ngettext_with_context_"+l(o),a,e,t,r,i,o)):a},isRTL:function(){return"rtl"===u("ltr","text direction")},hasTranslation:function(e,t,i){var o,a,s=t?t+""+e:e,c=!(null===(o=r.data)||void 0===o||null===(a=o[null!=i?i:"default"])||void 0===a||!a[s]);return n&&(c=n.applyFilters("i18n.has_translation",c,e,t,i),c=n.applyFilters("i18n.has_translation_"+l(i),c,e,t,i)),c}}}(void 0,void 0,Gt)),Jt=($t.getLocaleData.bind($t),$t.setLocaleData.bind($t),$t.resetLocaleData.bind($t),$t.subscribe.bind($t),$t.__.bind($t));$t._x.bind($t),$t._n.bind($t),$t._nx.bind($t),$t.isRTL.bind($t),$t.hasTranslation.bind($t);function Xt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yt(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function vn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;if(!t||!Object.keys(t).length)return e;var n=e,r=e.indexOf("?");return-1!==r&&(t=Object.assign(hn(e),t),n=n.substr(0,r)),n+"?"+gn(t)}function bn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wn(e){for(var t=1;t]+)>; rel="next"/);return t?{next:t[1]}:{}}(e.headers.get("link")).next},On=function(e){var t=!!e.path&&-1!==e.path.indexOf("per_page=-1"),n=!!e.url&&-1!==e.url.indexOf("per_page=-1");return t||n},En=function(){var e,t=(e=un.a.mark((function e(t,n){var r,i,o,a,s,c;return un.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!1!==t.parse){e.next=2;break}return e.abrupt("return",n(t));case 2:if(On(t)){e.next=4;break}return e.abrupt("return",n(t));case 4:return e.next=6,Wn(wn(wn({},(u={per_page:100},d=void 0,p=void 0,d=(l=t).path,p=l.url,wn(wn({},wt(l,["path","url"])),{},{url:p&&yn(p,u),path:d&&yn(d,u)}))),{},{parse:!1}));case 6:return r=e.sent,e.next=9,_n(r);case 9:if(i=e.sent,Array.isArray(i)){e.next=12;break}return e.abrupt("return",i);case 12:if(o=xn(r)){e.next=15;break}return e.abrupt("return",i);case 15:a=[].concat(i);case 16:if(!o){e.next=27;break}return e.next=19,Wn(wn(wn({},t),{},{path:void 0,url:o,parse:!1}));case 19:return s=e.sent,e.next=22,_n(s);case 22:c=e.sent,a=a.concat(c),o=xn(s),e.next=16;break;case 27:return e.abrupt("return",a);case 28:case"end":return e.stop()}var l,u,d,p}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){cn(o,r,i,a,s,"next",e)}function s(e){cn(o,r,i,a,s,"throw",e)}a(void 0)}))});return function(e,n){return t.apply(this,arguments)}}();function jn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ln(e){for(var t=1;t1&&void 0!==arguments[1])||arguments[1];return t?204===e.status?null:e.json?e.json():Promise.reject(e):e},Tn=function(e){var t={code:"invalid_json",message:Jt("The response is not a valid JSON response.")};if(!e||!e.json)throw t;return e.json().catch((function(){throw t}))},Pn=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Promise.resolve(An(e,t)).catch((function(e){return Sn(e,t)}))};function Sn(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!t)throw e;return Tn(e).then((function(e){var t={code:"unknown_error",message:Jt("An unknown error occurred.")};throw e||t}))}function Dn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function In(e){for(var t=1;t=500&&t.status<600&&n?r(n).catch((function(){return!1!==e.parse?Promise.reject({code:"post_process",message:Jt("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(t)})):Sn(t,e.parse)})).then((function(t){return Pn(t,e.parse)}))};function Mn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Fn(e){for(var t=1;t=200&&e.status<300)return e;throw e},qn=function(e){var t=e.url,n=e.path,r=e.data,i=e.parse,o=void 0===i||i,a=wt(e,["url","path","data","parse"]),s=e.body,c=e.headers;return c=Fn(Fn({},Bn),c),r&&(s=JSON.stringify(r),c["Content-Type"]="application/json"),window.fetch(t||n||window.location.href,Fn(Fn(Fn({},Rn),a),{},{body:s,headers:c})).then((function(e){return Promise.resolve(e).then(Hn).catch((function(e){return Sn(e,o)})).then((function(e){return Pn(e,o)}))}),(function(){throw{code:"fetch_error",message:Jt("You are probably offline.")}}))};function Un(e){return zn.reduceRight((function(e,t){return function(n){return t(n,e)}}),qn)(e).catch((function(t){return"rest_cookie_invalid_nonce"!==t.code?Promise.reject(t):window.fetch(Un.nonceEndpoint).then(Hn).then((function(e){return e.text()})).then((function(t){return Un.nonceMiddleware.nonce=t,Un(e)}))}))}Un.use=function(e){zn.unshift(e)},Un.setFetchHandler=function(e){qn=e},Un.createNonceMiddleware=Kt,Un.createPreloadingMiddleware=sn,Un.createRootURLMiddleware=on,Un.fetchAllMiddleware=En,Un.mediaUploadMiddleware=Nn;var Wn=Un;var Qn={cachePoints:{},spinners:{},init(e){if("undefined"!=typeof CLDCACHE){Wn.use(Wn.createNonceMiddleware(CLDCACHE.nonce));e.querySelectorAll("[data-cache-point]").forEach((e=>this._bind(e)))}},getCachePoint(e){return this.cachePoints["_"+e]?this.cachePoints["_"+e]:null},setCachePoint(e,t){const n=document.createElement("div"),r=this._getRow(),i=document.createElement("td");i.colSpan=2,i.className="cld-loading",r.appendChild(i);const o=document.getElementById(t.dataset.slug),a=document.getElementById(t.dataset.slug+"_search"),s=document.getElementById(t.dataset.slug+"_reload"),c=document.getElementById(t.dataset.browser),l=document.getElementById(t.dataset.apply);c.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)})),s.addEventListener("click",(t=>{this._load(e)})),a.addEventListener("keydown",(t=>{13===t.which&&(t.preventDefault(),t.stopPropagation(),this._load(e))})),n.className="cld-pagenav",l.cacheChanges={disable:[],enable:[],delete:[]},t.master=o,t.search=a,t.controller=c,t.viewer=t.parentNode.parentNode,t.loader=r,t.table=t.parentNode,t.apply=l,t.paginate=n,t.currentPage=1,t.viewer.appendChild(n),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.master.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),t.loaded||this._load(e)):(this.close(t.viewer),t.controller.checked=!1))},_load(e){const t=this.getCachePoint(e);this._clearChildren(t),t.appendChild(t.loader),this.open(t.loader),Wn({path:CLDCACHE.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-master]");yt.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){this.close(e.apply);const t=e.apply.cacheChanges;let n=!1;for(const e in t)t[e].length&&(n=!0);n&&this.open(e.apply)},_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])},_set_state(e,t,n){this._showSpinners(n),Wn({path:CLDCACHE.update_url,data:{state:t,ids:n},method:"POST"}).then((n=>{this._hideSpinners(n),n.forEach((n=>{this.close(e.apply),this._removeFromList(e,n,t),this._evaluateApply(e),e.apply.disabled=""})),"delete"===t&&this._load(e.dataset.cachePoint)}))},_purgeCache(e){Wn({path:CLDCACHE.purge_url,data:{cachePoint:e.dataset.cachePoint},method:"POST"}).then((()=>{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 i=!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"}),i=this._getFile(e,t,n);n.appendChild(i),n.appendChild(r),e.appendChild(n)}))},_buildNav(e,t){e.paginate.innerHTML="";const n=document.createElement("button"),r=document.createElement("button");if(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="left",e.paginate.appendChild(t),t.addEventListener("click",(t=>{confirm(wp.i18n.__("Purge entire cache point?","cloudinary"))&&this._purgeCache(e)}))}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 i=document.createElement("span");i.innerText=t.nav_text,i.className="cld-pagenav-text",e.paginate.appendChild(n),e.paginate.appendChild(i),e.paginate.appendChild(r)},_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},_getFile(e,t){const n=document.createElement("td"),r=document.createElement("label"),i=this._getDeleter(e,n,t);r.innerText=t.short_url,r.htmlFor=t.key,n.appendChild(i),n.appendChild(r);const o=document.createElement("span"),a="spinner_"+t.ID;return o.className="spinner",o.id=a,n.appendChild(o),this.spinners[a]=o,n},_getDeleter(e,t,n){const r=document.createElement("input"),i=[e.dataset.slug+"_deleter"],o=this._getListIndex(e,n.ID,"delete");return r.type="checkbox",r.value=n.ID,r.id=n.key,r.dataset.master=JSON.stringify(i),-1{t.style.opacity=1,t.style.textDecoration="",r.checked&&(t.style.opacity=.8,t.style.textDecoration="line-through");const o=new CustomEvent("CacheToggle",{detail:{checked:r.checked,states:{on:"delete",off:n.active?"enable":"disable"},item:n,cachePoint:e}});window.dispatchEvent(o)})),r},_getStateSwitch(e,t,n){const r=document.createElement("td"),i=document.createElement("label"),o=document.createElement("input"),a=document.createElement("span"),s=[e.dataset.slug+"_selector"],c=this._getListIndex(e,t.ID,"disable");return r.style.textAlign="right",i.className="cld-input-on-off-control mini",o.type="checkbox",o.value=t.ID,o.checked=!(-1{const i=new CustomEvent("CacheToggle",{detail:{checked:o.checked,states:n,item:t,cachePoint:e}});window.dispatchEvent(i)})),r.appendChild(i),r}};const Vn={bindings:{},parent_check_data:{},check_parents:{},_init(e){const t=e.querySelectorAll("[data-condition]"),n=e.querySelectorAll("[data-toggle]"),r=e.querySelectorAll("[data-for]"),i=e.querySelectorAll("[data-tooltip]"),o=e.querySelectorAll("[data-bind-trigger]"),a=e.querySelectorAll("[data-master]"),s=e.querySelectorAll("[data-file]"),c=e.querySelectorAll("[data-auto-suffix]"),l={};yt.bind(a),c.forEach((e=>this._autoSuffix(e))),o.forEach((e=>this._trigger(e))),n.forEach((e=>this._toggle(e))),t.forEach((e=>this._bind(e))),r.forEach((e=>this._alias(e))),s.forEach((e=>this._files(e,l))),mt(i,{theme:"cloudinary",arrow:!1,placement:"bottom-start",aria:{content:"auto",expanded:"auto"},content:t=>e.getElementById(t.getAttribute("data-tooltip")).innerHTML}),[...o].forEach((e=>{e.dispatchEvent(new Event("input"))})),Qn.init(e)},_autoSuffix(e){const t=e.dataset.autoSuffix;let n="";const r=[...t.split(";")].map((e=>0===e.indexOf("*")?(n=e.replace("*",""),n):e));e.addEventListener("change",(()=>{const t=e.value.replace(" ",""),i=t.replace(/[^0-9]/g,""),o=t.replace(/[0-9]/g,"").toLowerCase();i&&(-1===r.indexOf(o)?e.value=i+" "+n:e.value=i+" "+o)})),e.dispatchEvent(new Event("change"))},_files(e,t){const n=e.dataset.parent;n&&(this.check_parents[n]=document.getElementById(n),this.parent_check_data[n]||(this.parent_check_data[n]=this.check_parents[n].value?JSON.parse(this.check_parents[n].value):[]),e.addEventListener("change",(()=>{const r=this.parent_check_data[n].indexOf(e.value);e.checked?this.parent_check_data[n].push(e.value):this.parent_check_data[n].splice(r,1),t[n]&&clearTimeout(t[n]),t[n]=setTimeout((()=>{this._compileParent(n)}),10)})))},_compileParent(e){this.check_parents[e].value=JSON.stringify(this.parent_check_data[e]),this.check_parents[e].dispatchEvent(new Event("change"))},_bind(e){e.condition=JSON.parse(e.dataset.condition);for(const t in e.condition)this.bindings[t]&&this.bindings[t].elements.push(e)},_trigger(e){const t=e.dataset.bindTrigger,n=this;n.bindings[t]={input:e,value:e.value,checked:!0,elements:[]},e.addEventListener("change",(function(t){e.dispatchEvent(new Event("input"))})),e.addEventListener("input",(function(){n.bindings[t].value=e.value,"checkbox"!==e.type&&"radio"!==e.type||(n.bindings[t].checked=e.checked);for(const r in n.bindings[t].elements)n.toggle(n.bindings[t].elements[r],e)}))},_alias(e){e.addEventListener("click",(function(){document.getElementById(e.dataset.for).dispatchEvent(new Event("click"))}))},_toggle(e){const t=this;e.addEventListener("click",(function(n){n.stopPropagation();const r=document.querySelector('[data-wrap="'+e.dataset.toggle+'"]'),i=r.classList.contains("open")?"closed":"open";t.toggle(r,e,i)}))},toggle(e,t,n){if(!n){n="open";for(const t in e.condition){let r=this.bindings[t].value;const i=e.condition[t];"boolean"==typeof i&&(r=this.bindings[t].checked),i!==r&&(n="closed")}}const r=e.getElementsByClassName("cld-ui-input");"closed"===n?(e.classList.remove("open"),e.classList.add("closed"),t&&t.classList.contains("dashicons")&&(t.classList.remove("dashicons-arrow-up-alt2"),t.classList.add("dashicons-arrow-down-alt2")),[...r].forEach((function(e){e.dataset.disabled=!0}))):(e.classList.remove("closed"),e.classList.add("open"),t&&t.classList.contains("dashicons")&&(t.classList.remove("dashicons-arrow-down-alt2"),t.classList.add("dashicons-arrow-up-alt2")),[...r].forEach((function(e){e.dataset.disabled=!1})))}};window.addEventListener("load",Vn._init(document));var Gn=Vn;window.$=window.jQuery;const $n={UI:Gn,Settings:i.a,Widget:a.a,GlobalTransformations:c,TermsOrder:u,MediaLibrary:p,Notices:h}}]); \ No newline at end of file +!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=13)}([function(e,t,n){var r;!function(){"use strict";var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function o(e){return s(l(e),arguments)}function a(e,t){return o.apply(null,[e].concat(t||[]))}function s(e,t){var n,r,a,s,c,l,u,d,p,f=1,h=e.length,m="";for(r=0;r=0),s.type){case"b":n=parseInt(n,10).toString(2);break;case"c":n=String.fromCharCode(parseInt(n,10));break;case"d":case"i":n=parseInt(n,10);break;case"j":n=JSON.stringify(n,null,s.width?parseInt(s.width):0);break;case"e":n=s.precision?parseFloat(n).toExponential(s.precision):parseFloat(n).toExponential();break;case"f":n=s.precision?parseFloat(n).toFixed(s.precision):parseFloat(n);break;case"g":n=s.precision?String(Number(n.toPrecision(s.precision))):parseFloat(n);break;case"o":n=(parseInt(n,10)>>>0).toString(8);break;case"s":n=String(n),n=s.precision?n.substring(0,s.precision):n;break;case"t":n=String(!!n),n=s.precision?n.substring(0,s.precision):n;break;case"T":n=Object.prototype.toString.call(n).slice(8,-1).toLowerCase(),n=s.precision?n.substring(0,s.precision):n;break;case"u":n=parseInt(n,10)>>>0;break;case"v":n=n.valueOf(),n=s.precision?n.substring(0,s.precision):n;break;case"x":n=(parseInt(n,10)>>>0).toString(16);break;case"X":n=(parseInt(n,10)>>>0).toString(16).toUpperCase()}i.json.test(s.type)?m+=n:(!i.number.test(s.type)||d&&!s.sign?p="":(p=d?"+":"-",n=n.toString().replace(i.sign,"")),l=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",u=s.width-(p+n).length,c=s.width&&u>0?l.repeat(u):"",m+=s.align?p+n+c:"0"===l?p+c+n:c+p+n)}return m}var c=Object.create(null);function l(e){if(c[e])return c[e];for(var t,n=e,r=[],o=0;n;){if(null!==(t=i.text.exec(n)))r.push(t[0]);else if(null!==(t=i.modulo.exec(n)))r.push("%");else{if(null===(t=i.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(t[2]){o|=1;var a=[],s=t[2],l=[];if(null===(l=i.key.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(a.push(l[1]);""!==(s=s.substring(l[0].length));)if(null!==(l=i.key_access.exec(s)))a.push(l[1]);else{if(null===(l=i.index_access.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");a.push(l[1])}t[2]=a}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");r.push({placeholder:t[0],param_no:t[1],keys:t[2],sign:t[3],pad_char:t[4],align:t[5],width:t[6],precision:t[7],type:t[8]})}n=n.substring(t[0].length)}return c[e]=r}t.sprintf=o,t.vsprintf=a,"undefined"!=typeof window&&(window.sprintf=o,window.vsprintf=a,void 0===(r=function(){return{sprintf:o,vsprintf:a}}.call(t,n,t,e))||(e.exports=r))}()},function(e,t,n){e.exports=n(11)},function(e,t){!function(){const e=function(){const e=jQuery("#field-video_player").val(),t=jQuery("#field-video_controls").prop("checked"),n=jQuery('#field-video_autoplay_mode option[value="off"]');"cld"!==e||t?n.prop("disabled",!1):(n.prop("disabled",!0),n.prop("selected")&&n.next().prop("selected",!0))};e(),jQuery(document).on("change","#field-video_player",e),jQuery(document).on("change","#field-video_controls",e),jQuery(document).ready((function(e){e.isFunction(e.fn.wpColorPicker)&&e(".regular-color").wpColorPicker(),e(document).on("tabs.init",(function(){const t=e(".settings-tab-trigger"),n=e(".settings-tab-section");e(this).on("click",".settings-tab-trigger",(function(r){const i=e(this),o=e(i.attr("href"));r.preventDefault(),t.removeClass("active"),n.removeClass("active"),i.addClass("active"),o.addClass("active"),e(document).trigger("settings.tabbed",i)})),e(".cld-field").not('[data-condition="false"]').each((function(){const t=e(this),n=t.data("condition");for(const r in n){let i=e("#field-"+r);const o=n[r],a=t.closest("tr");i.length||(i=e(`[id^=field-${r}-]`));let s=!1;i.on("change init",(function(e,t=!1){if(s&&t)return;let n=this.value===o||this.checked;if(Array.isArray(o)&&2===o.length)switch(o[1]){case"neq":n=this.value!==o[0];break;case"gt":n=this.value>o[0];break;case"lt":n=this.value=0&&(e.metadata.cldoverwrite="true")})),wp.media.events.on("editor:image-update",(function(e){const t=e.image.className.split(" ");e.metadata.cldoverwrite&&-1===t.indexOf("cld-overwrite")?t.push("cld-overwrite"):!e.metadata.cldoverwrite&&t.indexOf("cld-overwrite")>=0&&delete t[t.indexOf("cld-overwrite")],e.image.className=t.join(" ")}));let e=null;const t=wp.media.string.props;wp.media.string.props=function(n,r){n.cldoverwrite&&(n.classes=["cld-overwrite"],e=!0);return t(n,r)},wp.media.post=function(t,n){if("send-attachment-to-editor"===t){const t=wp.media.editor.get().state().get("selection").get(n.attachment);t.attributes.transformations&&(n.attachment.transformations=t.attributes.transformations),(n.html.indexOf("cld-overwrite")>-1||!0===e)&&(n.attachment.cldoverwrite=!0,e=null)}return wp.ajax.post(t,n)};const n=wp.media.view.MediaFrame.Select,r=wp.media.view.MediaFrame.Post,i=wp.media.view.MediaFrame.ImageDetails,o=wp.media.view.MediaFrame.VideoDetails,a=wp.media.View.extend({tagName:"div",className:"cloudinary-widget",template:wp.template("cloudinary-dam"),active:!1,toolbar:null,frame:null,ready(){const e=this.controller,t=this.model.get("selection"),n=this.model.get("library"),r=wp.media.model.Attachment;if(CLDN.mloptions.multiple=e.options.multiple,this.cid!==this.active){if(CLDN.mloptions.inline_container="#cloudinary-dam-"+e.cid,1===t.length){const e=r.get(t.models[0].id);void 0!==e.attributes.public_id&&(CLDN.mloptions.asset={resource_id:e.attributes.public_id})}else CLDN.mloptions.asset=null;try{CLDN.mloptions.folder||(CLDN.mloptions.folder={path:""});const e=t.props.attributes.type;CLDN.mloptions.folder.resource_type=Array.isArray(e)?e[0]:e}catch(e){}window.ml=cloudinary.openMediaLibrary(CLDN.mloptions,{insertHandler(i){for(let o=0;o0;a--)s/=o;return s.toFixed(2)},r.human=function(e){var t=r.calculate(e);return t.fixed+r.spacer+t.suffix},r}},e.exports?e.exports=a():(i=[],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))},function(e,t,n){e.exports=function(e,t){var n,r,i=0;function o(){var o,a,s=n,c=arguments.length;e:for(;s;){if(s.args.length===arguments.length){for(a=0;a'+t),t=t.replace(/(?:\r\n|\r|\n|\t| )srcset=/g," data-lazy-srcset=").replace(/(?:\r\n|\r|\n|\t| )src=/g,' src="'+r+'" data-lazy-src='))),t}(e);t.firstChild;)o||!a||void 0===n||!t.firstChild.tagName||"img"!==t.firstChild.tagName.toLowerCase()&&"iframe"!==t.firstChild.tagName.toLowerCase()||n.observe(t.firstChild),e.parentNode.insertBefore(t.firstChild,e);e.parentNode.removeChild(e)}function l(){document.querySelectorAll("noscript.loading-lazy").forEach(c),void 0!==window.matchMedia&&window.matchMedia("print").addListener((function(e){e.matches&&document.querySelectorAll(i.lazyImage+"[data-lazy-src],"+i.lazyIframe+"[data-lazy-src]").forEach((function(e){s(e)}))}))}"undefined"!=typeof NodeList&&NodeList.prototype&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),"IntersectionObserver"in window&&(n=new IntersectionObserver((function(e,t){e.forEach((function(e){if(0!==e.intersectionRatio){var n=e.target;t.unobserve(n),s(n)}}))}),i)),r="requestAnimationFrame"in window?window.requestAnimationFrame:function(e){e()},/comp|inter/.test(document.readyState)?r(l):"addEventListener"in document?document.addEventListener("DOMContentLoaded",(function(){r(l)})):document.attachEvent("onreadystatechange",(function(){"complete"===document.readyState&&l()}))}()},function(e,t){const n=document.querySelector(".cloudinary-collapsible__toggle");n&&n.addEventListener("click",(function(){const e=document.querySelector(".cloudinary-collapsible__content"),t="none"===window.getComputedStyle(e,null).getPropertyValue("display"),n=document.querySelector(".cloudinary-collapsible__toggle button i");e.style.display=t?"block":"none";const r="dashicons-arrow-down-alt2",i="dashicons-arrow-up-alt2";n.classList.contains(r)?(n.classList.remove(r),n.classList.add(i)):(n.classList.remove(i),n.classList.add(r))}))},function(e,t,n){var r=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof v?t:v,o=Object.create(i.prototype),a=new C(r||[]);return o._invoke=function(e,t,n){var r=d;return function(i,o){if(r===f)throw new Error("Generator is already running");if(r===h){if("throw"===i)throw o;return T()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=j(a,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var c=u(e,t,n);if("normal"===c.type){if(r=n.done?h:p,c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=h,n.method="throw",n.arg=c.arg)}}}(e,n,a),o}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var d="suspendedStart",p="suspendedYield",f="executing",h="completed",m={};function v(){}function g(){}function y(){}var b={};b[o]=function(){return this};var w=Object.getPrototypeOf,_=w&&w(w(A([])));_&&_!==n&&r.call(_,o)&&(b=_);var x=y.prototype=v.prototype=Object.create(b);function O(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function n(i,o,a,s){var c=u(e[i],e,o);if("throw"!==c.type){var l=c.arg,d=l.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(d).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,s)}))}s(c.arg)}var i;this._invoke=function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}}function j(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,j(e,n),"throw"===n.method))return m;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var i=u(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function A(e){if(e){var n=e[o];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function n(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=r}catch(e){Function("r","regeneratorRuntime = r")(r)}},,function(e,t,n){"use strict";n.r(t),n.d(t,"cloudinary",(function(){return $n}));n(9),n(10);var r=n(2),i=n.n(r),o=n(3),a=n.n(o);const s={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_optimization"),video:document.getElementById("video_optimization")},error_container:document.getElementById("cld-preview-error"),activeItem:null,elements:{image:[],video:[]},_placeItem(e){null!==e&&(e.style.display="block",e.style.visibility="visible",e.style.position="absolute",e.style.top=e.parentElement.clientHeight/2-e.clientHeight/2+"px",e.style.left=e.parentElement.clientWidth/2-e.clientWidth/2+"px")},_setLoading(e){this.button[e].style.display="block",this._placeItem(this.button[e]),this.preview[e].style.opacity="0.1"},_build(e){this.sample[e].innerHTML="",this.elements[e]=[];for(const t of this.fields){if(e!==t.dataset.context||t.dataset.disabled&&"true"===t.dataset.disabled)continue;let n=t.value.trim();if(n.length){if("select-one"===t.type){if("none"===n||!1===this.optimization[e].checked)continue;n=t.dataset.meta+"_"+n}else e=t.dataset.context,t.dataset.meta&&(n=t.dataset.meta+"_"+n),t.dataset.suffix&&(n+=t.dataset.suffix),n=this._transformations(n,e,!0);n&&this.elements[e].push(n)}}let t="";this.elements[e].length&&(t="/"+this._getGlobalTransformationElements(e).replace(/ /g,"%20")),this.sample[e].textContent=t,this.sample[e].parentElement.href="https://res.cloudinary.com/demo/"+this.sample[e].parentElement.innerText.trim().replace("../","").replace(/ /g,"%20")},_clearLoading(e){this.spinner[e].style.visibility="hidden",this.activeItem=null,this.preview[e].style.opacity=1},_refresh(e,t){e&&e.preventDefault();const n=this,r=CLD_GLOBAL_TRANSFORMATIONS[t].preview_url+this._getGlobalTransformationElements(t)+CLD_GLOBAL_TRANSFORMATIONS[t].file;if(this.button[t].style.display="none",this._placeItem(this.spinner[t]),"image"===t){const e=new Image;e.onload=function(){n.preview[t].src=this.src,n._clearLoading(t),n.error_container&&(n.error_container.style.display="none"),e.remove()},e.onerror=function(){const e=n.elements[t].includes("f_mp4");n.error_container&&(n.error_container.style.display="block",e?(n.error_container.innerHTML=CLD_GLOBAL_TRANSFORMATIONS[t].warning.replace("%s","f_mp4"),n.error_container.classList.replace("settings-alert-error","settings-alert-warning")):(n.error_container.innerHTML=CLD_GLOBAL_TRANSFORMATIONS[t].error,n.error_container.classList.replace("settings-alert-warning","settings-alert-error"))),n._clearLoading(t)},e.src=r}else{const e=n._transformations(n._getGlobalTransformationElements(t),t);samplePlayer.source({publicId:"dog",transformation:e}),n._clearLoading(t)}},_getGlobalTransformationElements(e){let t=[];return t.push(this.elements[e].slice(0,2).join(",")),t.push(this.elements[e].slice(2).join(",")),t=t.filter((e=>e)).join("/"),t},_transformations(e,t,n=!1){const r=CLD_GLOBAL_TRANSFORMATIONS[t].valid_types;let i=null;const o=e.split("/"),a=[];for(let e=0;e{const r=!!n.length&&jQuery('[data-item="'+i+":"+n[0].id+'"]');r.length?r.remove():(jQuery(`.cld-tax-order-list-item:contains(${a})`).remove(),--e.startId),this.processTags(t)}))}),jQuery("body").on("change",".selectit input",(function(){const t=jQuery(this),n=t.val(),r=t.is(":checked"),i=t.parent().text().trim();!0===r?e.tags.find(`[data-item="category:${n}"]`).length||e._pushItem(`category:${n}`,i):e.tags.find(`[data-item="category:${n}"]`).remove()}))},_createItem(e,t){const n=jQuery("
  • "),r=jQuery(""),i=jQuery("");return n.addClass("cld-tax-order-list-item").attr("data-item",e),i.addClass("cld-tax-order-list-item-input").attr("type","hidden").attr("name","cld_tax_order[]").val(e),r.addClass("dashicons dashicons-menu cld-tax-order-list-item-handle"),n.append(r).append(t).append(i),n},_pushItem(e,t){const n=this._createItem(e,t);this.tags.append(n)},_sortable(){jQuery(".cld-tax-order-list").sortable({connectWith:".cld-tax-order",axis:"y",handle:".cld-tax-order-list-item-handle",placeholder:"cld-tax-order-list-item-placeholder",forcePlaceholderSize:!0,helper:"clone"})}};if(void 0!==window.CLDN&&(l._init(),jQuery("[data-wp-lists] .selectit input[checked]").each(((e,t)=>{jQuery(t).trigger("change")}))),wp.data&&wp.data.select("core/editor")){const e={};wp.data.subscribe((function(){const t=wp.data.select("core").getTaxonomies();if(t)for(const n in t){const r=wp.data.select("core/editor").getEditedPostAttribute(t[n].rest_base);e[t[n].slug]=r}}));const t=wp.element.createElement,n=n=>{class r extends n{constructor(e){super(e),this.currentItems=jQuery(".cld-tax-order-list-item").map(((e,t)=>jQuery(t).data("item"))).get()}makeItem(e){if(this.currentItems.includes(this.getId(e)))return;const t=this.makeElement(e);jQuery("#cld-tax-items").append(t)}removeItem(e){const t=jQuery(`[data-item="${this.getId(e)}"]`);t.length&&(t.remove(),this.currentItems=this.currentItems.filter((t=>t!==this.getId(e))))}findOrCreateTerm(e){return(e=super.findOrCreateTerm(e)).then((e=>this.makeItem(e))),e}onChange(t){super.onChange(t);const n=this.pickItem(t);n&&(e[this.props.slug].includes(n.id)?this.makeItem(n):this.removeItem(n))}pickItem(e){if("object"==typeof e){if(e.target){for(const t in this.state.availableTerms)if(this.state.availableTerms[t].id===parseInt(e.target.value))return this.state.availableTerms[t]}else if(Array.isArray(e)){let t=this.state.selectedTerms.filter((t=>!e.includes(t)))[0];return void 0===t&&(t=e.filter((e=>!this.state.selectedTerms.includes(e)))[0]),this.state.availableTerms.find((e=>e.name===t))}}else if("number"==typeof e){for(const t in this.state.availableTerms)if(this.state.availableTerms[t].id===e)return this.state.availableTerms[t]}else{let t;if(e.length>this.state.selectedTerms.length)for(const n in e)-1===this.state.selectedTerms.indexOf(e[n])&&(t=e[n]);else for(const n in this.state.selectedTerms)-1===e.indexOf(this.state.selectedTerms[n])&&(t=this.state.selectedTerms[n]);for(const e in this.state.availableTerms)if(this.state.availableTerms[e].name===t)return this.state.availableTerms[e]}}getId(e){return`${this.props.slug}:${e.id}`}makeElement(e){const t=jQuery("
  • "),n=jQuery(""),r=jQuery("");return t.addClass("cld-tax-order-list-item").attr("data-item",this.getId(e)),r.addClass("cld-tax-order-list-item-input").attr("type","hidden").attr("name","cld_tax_order[]").val(this.getId(e)),n.addClass("dashicons dashicons-menu cld-tax-order-list-item-handle"),t.append(n).append(e.name).append(r),t}}return e=>t(r,e)};wp.hooks.addFilter("editor.PostTaxonomyType","cld",n)}var u=l;const d={wpWrap:document.getElementById("wpwrap"),wpContent:document.getElementById("wpbody-content"),libraryWrap:document.getElementById("cloudinary-embed"),_init(){const e=this;"undefined"!=typeof CLD_ML&&(cloudinary.openMediaLibrary(CLD_ML.mloptions,{insertHandler(){alert("Import is not yet implemented.")}}),window.addEventListener("resize",(function(){e._resize()})),e._resize())},_resize(){const e=getComputedStyle(this.wpContent);this.libraryWrap.style.height=this.wpWrap.offsetHeight-parseInt(e.getPropertyValue("padding-bottom"))+"px"}};var p=d;d._init();const f={_init(){const e=this;if("undefined"!=typeof CLDIS){[...document.getElementsByClassName("cld-notice-box")].forEach((t=>{const n=t.getElementsByClassName("notice-dismiss");n.length&&n[0].addEventListener("click",(n=>{t.style.height=t.offsetHeight+"px",n.preventDefault(),setTimeout((function(){e._dismiss(t)}),5)}))}))}},_dismiss(e){const t=e.dataset.dismiss,n=parseInt(e.dataset.duration);e.classList.add("dismissed"),e.style.height="0px",setTimeout((function(){e.remove()}),400),0=0?e.ownerDocument.body:b(e)&&j(e)?e:A(C(e))}function T(e,t){var n;void 0===t&&(t=[]);var r=A(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=v(r),a=i?[o].concat(o.visualViewport||[],j(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(T(C(a)))}function P(e){return["table","td","th"].indexOf(_(e))>=0}function S(e){return b(e)&&"fixed"!==E(e).position?e.offsetParent:null}function D(e){for(var t=v(e),n=S(e);n&&P(n)&&"static"===E(n).position;)n=S(n);return n&&("html"===_(n)||"body"===_(n)&&"static"===E(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&b(e)&&"fixed"===E(e).position)return null;for(var n=C(e);b(n)&&["html","body"].indexOf(_(n))<0;){var r=E(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}var I="top",N="bottom",M="right",F="left",B="auto",R=[I,N,M,F],z="start",H="end",q="viewport",U="popper",W=R.reduce((function(e,t){return e.concat([t+"-"+z,t+"-"+H])}),[]),Q=[].concat(R,[B]).reduce((function(e,t){return e.concat([t,t+"-"+z,t+"-"+H])}),[]),V=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function G(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),r}var $={placement:"bottom",modifiers:[],strategy:"absolute"};function J(){for(var e=arguments.length,t=new Array(e),n=0;n=0?"x":"y"}function ne(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?Z(i):null,a=i?ee(i):null,s=n.x+n.width/2-r.width/2,c=n.y+n.height/2-r.height/2;switch(o){case I:t={x:s,y:n.y-r.height};break;case N:t={x:s,y:n.y+n.height};break;case M:t={x:n.x+n.width,y:c};break;case F:t={x:n.x-r.width,y:c};break;default:t={x:n.x,y:n.y}}var l=o?te(o):null;if(null!=l){var u="y"===l?"height":"width";switch(a){case z:t[l]=t[l]-(n[u]/2-r[u]/2);break;case H:t[l]=t[l]+(n[u]/2-r[u]/2)}}return t}var re={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=ne({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},ie=Math.max,oe=Math.min,ae=Math.round,se={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ce(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.offsets,a=e.position,s=e.gpuAcceleration,c=e.adaptive,l=e.roundOffsets,u=!0===l?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:ae(ae(t*r)/r)||0,y:ae(ae(n*r)/r)||0}}(o):"function"==typeof l?l(o):o,d=u.x,p=void 0===d?0:d,f=u.y,h=void 0===f?0:f,m=o.hasOwnProperty("x"),g=o.hasOwnProperty("y"),y=F,b=I,w=window;if(c){var _=D(n),O="clientHeight",j="clientWidth";_===v(n)&&"static"!==E(_=x(n)).position&&(O="scrollHeight",j="scrollWidth"),_=_,i===I&&(b=N,h-=_[O]-r.height,h*=s?1:-1),i===F&&(y=M,p-=_[j]-r.width,p*=s?1:-1)}var L,k=Object.assign({position:a},c&&se);return s?Object.assign({},k,((L={})[b]=g?"0":"",L[y]=m?"0":"",L.transform=(w.devicePixelRatio||1)<2?"translate("+p+"px, "+h+"px)":"translate3d("+p+"px, "+h+"px, 0)",L)):Object.assign({},k,((t={})[b]=g?h+"px":"",t[y]=m?p+"px":"",t.transform="",t))}var le={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];b(i)&&_(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],i=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});b(r)&&_(r)&&(Object.assign(r.style,o),Object.keys(i).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};var ue={left:"right",right:"left",bottom:"top",top:"bottom"};function de(e){return e.replace(/left|right|bottom|top/g,(function(e){return ue[e]}))}var pe={start:"end",end:"start"};function fe(e){return e.replace(/start|end/g,(function(e){return pe[e]}))}function he(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&w(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function me(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){return t===q?me(function(e){var t=v(e),n=x(e),r=t.visualViewport,i=n.clientWidth,o=n.clientHeight,a=0,s=0;return r&&(i=r.width,o=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,s=r.offsetTop)),{width:i,height:o,x:a+O(e),y:s}}(e)):b(t)?function(e){var t=m(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):me(function(e){var t,n=x(e),r=g(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=ie(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=ie(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+O(e),c=-r.scrollTop;return"rtl"===E(i||n).direction&&(s+=ie(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:c}}(x(e)))}function ge(e,t,n){var r="clippingParents"===t?function(e){var t=T(C(e)),n=["absolute","fixed"].indexOf(E(e).position)>=0&&b(e)?D(e):e;return y(n)?t.filter((function(e){return y(e)&&he(e,n)&&"body"!==_(e)})):[]}(e):[].concat(t),i=[].concat(r,[n]),o=i[0],a=i.reduce((function(t,n){var r=ve(e,n);return t.top=ie(r.top,t.top),t.right=oe(r.right,t.right),t.bottom=oe(r.bottom,t.bottom),t.left=ie(r.left,t.left),t}),ve(e,o));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ye(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function be(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function we(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=void 0===r?e.placement:r,o=n.boundary,a=void 0===o?"clippingParents":o,s=n.rootBoundary,c=void 0===s?q:s,l=n.elementContext,u=void 0===l?U:l,d=n.altBoundary,p=void 0!==d&&d,f=n.padding,h=void 0===f?0:f,v=ye("number"!=typeof h?h:be(h,R)),g=u===U?"reference":U,b=e.elements.reference,w=e.rects.popper,_=e.elements[p?g:u],O=ge(y(_)?_:_.contextElement||x(e.elements.popper),a,c),E=m(b),j=ne({reference:E,element:w,strategy:"absolute",placement:i}),L=me(Object.assign({},w,j)),k=u===U?L:E,C={top:O.top-k.top+v.top,bottom:k.bottom-O.bottom+v.bottom,left:O.left-k.left+v.left,right:k.right-O.right+v.right},A=e.modifiersData.offset;if(u===U&&A){var T=A[i];Object.keys(C).forEach((function(e){var t=[M,N].indexOf(e)>=0?1:-1,n=[I,N].indexOf(e)>=0?"y":"x";C[e]+=T[n]*t}))}return C}function _e(e,t,n){return ie(e,oe(t,n))}function xe(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Oe(e){return[I,M,N,F].some((function(t){return e[t]>=0}))}var Ee=X({defaultModifiers:[K,re,{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,a=void 0===o||o,s=n.roundOffsets,c=void 0===s||s,l={placement:Z(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,ce(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,ce(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},le,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=void 0===i?[0,0]:i,a=Q.reduce((function(e,n){return e[n]=function(e,t,n){var r=Z(e),i=[F,I].indexOf(r)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[F,M].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,o),e}),{}),s=a[t.placement],c=s.x,l=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=a}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0===a||a,c=n.fallbackPlacements,l=n.padding,u=n.boundary,d=n.rootBoundary,p=n.altBoundary,f=n.flipVariations,h=void 0===f||f,m=n.allowedAutoPlacements,v=t.options.placement,g=Z(v),y=c||(g===v||!h?[de(v)]:function(e){if(Z(e)===B)return[];var t=de(e);return[fe(e),t,fe(t)]}(v)),b=[v].concat(y).reduce((function(e,n){return e.concat(Z(n)===B?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,l=void 0===c?Q:c,u=ee(r),d=u?s?W:W.filter((function(e){return ee(e)===u})):R,p=d.filter((function(e){return l.indexOf(e)>=0}));0===p.length&&(p=d);var f=p.reduce((function(t,n){return t[n]=we(e,{placement:n,boundary:i,rootBoundary:o,padding:a})[Z(n)],t}),{});return Object.keys(f).sort((function(e,t){return f[e]-f[t]}))}(t,{placement:n,boundary:u,rootBoundary:d,padding:l,flipVariations:h,allowedAutoPlacements:m}):n)}),[]),w=t.rects.reference,_=t.rects.popper,x=new Map,O=!0,E=b[0],j=0;j=0,T=A?"width":"height",P=we(t,{placement:L,boundary:u,rootBoundary:d,altBoundary:p,padding:l}),S=A?C?M:F:C?N:I;w[T]>_[T]&&(S=de(S));var D=de(S),H=[];if(o&&H.push(P[k]<=0),s&&H.push(P[S]<=0,P[D]<=0),H.every((function(e){return e}))){E=L,O=!1;break}x.set(L,H)}if(O)for(var q=function(e){var t=b.find((function(t){var n=x.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return E=t,"break"},U=h?3:1;U>0;U--){if("break"===q(U))break}t.placement!==E&&(t.modifiersData[r]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0!==a&&a,c=n.boundary,l=n.rootBoundary,u=n.altBoundary,d=n.padding,p=n.tether,f=void 0===p||p,h=n.tetherOffset,m=void 0===h?0:h,v=we(t,{boundary:c,rootBoundary:l,padding:d,altBoundary:u}),g=Z(t.placement),y=ee(t.placement),b=!y,w=te(g),_="x"===w?"y":"x",x=t.modifiersData.popperOffsets,O=t.rects.reference,E=t.rects.popper,j="function"==typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,L={x:0,y:0};if(x){if(o||s){var C="y"===w?I:F,A="y"===w?N:M,T="y"===w?"height":"width",P=x[w],S=x[w]+v[C],B=x[w]-v[A],R=f?-E[T]/2:0,H=y===z?O[T]:E[T],q=y===z?-E[T]:-O[T],U=t.elements.arrow,W=f&&U?k(U):{width:0,height:0},Q=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},V=Q[C],G=Q[A],$=_e(0,O[T],W[T]),J=b?O[T]/2-R-$-V-j:H-$-V-j,X=b?-O[T]/2+R+$+G+j:q+$+G+j,Y=t.elements.arrow&&D(t.elements.arrow),K=Y?"y"===w?Y.clientTop||0:Y.clientLeft||0:0,ne=t.modifiersData.offset?t.modifiersData.offset[t.placement][w]:0,re=x[w]+J-ne-K,ae=x[w]+X-ne;if(o){var se=_e(f?oe(S,re):S,P,f?ie(B,ae):B);x[w]=se,L[w]=se-P}if(s){var ce="x"===w?I:F,le="x"===w?N:M,ue=x[_],de=ue+v[ce],pe=ue-v[le],fe=_e(f?oe(de,re):de,ue,f?ie(pe,ae):pe);x[_]=fe,L[_]=fe-ue}}t.modifiersData[r]=L}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Z(n.placement),c=te(s),l=[F,M].indexOf(s)>=0?"height":"width";if(o&&a){var u=function(e,t){return ye("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:be(e,R))}(i.padding,n),d=k(o),p="y"===c?I:F,f="y"===c?N:M,h=n.rects.reference[l]+n.rects.reference[c]-a[c]-n.rects.popper[l],m=a[c]-n.rects.reference[c],v=D(o),g=v?"y"===c?v.clientHeight||0:v.clientWidth||0:0,y=h/2-m/2,b=u[p],w=g-d[l]-u[f],_=g/2-d[l]/2+y,x=_e(b,_,w),O=c;n.modifiersData[r]=((t={})[O]=x,t.centerOffset=x-_,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&he(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=we(t,{elementContext:"reference"}),s=we(t,{altBoundary:!0}),c=xe(a,r),l=xe(s,i,o),u=Oe(c),d=Oe(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}}]}),je="tippy-content",Le="tippy-backdrop",ke="tippy-arrow",Ce="tippy-svg-arrow",Ae={passive:!0,capture:!0};function Te(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function Pe(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function Se(e,t){return"function"==typeof e?e.apply(void 0,t):e}function De(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function Ie(e){return[].concat(e)}function Ne(e,t){-1===e.indexOf(t)&&e.push(t)}function Me(e){return e.split("-")[0]}function Fe(e){return[].slice.call(e)}function Be(){return document.createElement("div")}function Re(e){return["Element","Fragment"].some((function(t){return Pe(e,t)}))}function ze(e){return Pe(e,"MouseEvent")}function He(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function qe(e){return Re(e)?[e]:function(e){return Pe(e,"NodeList")}(e)?Fe(e):Array.isArray(e)?e:Fe(document.querySelectorAll(e))}function Ue(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function We(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function Qe(e){var t,n=Ie(e)[0];return(null==n||null==(t=n.ownerDocument)?void 0:t.body)?n.ownerDocument:document}function Ve(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}var Ge={isTouch:!1},$e=0;function Je(){Ge.isTouch||(Ge.isTouch=!0,window.performance&&document.addEventListener("mousemove",Xe))}function Xe(){var e=performance.now();e-$e<20&&(Ge.isTouch=!1,document.removeEventListener("mousemove",Xe)),$e=e}function Ye(){var e=document.activeElement;if(He(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var Ke="undefined"!=typeof window&&"undefined"!=typeof document?navigator.userAgent:"",Ze=/MSIE |Trident\//.test(Ke);var et={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},tt=Object.assign({appendTo:function(){return document.body},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},et,{},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),nt=Object.keys(tt);function rt(e){var t=(e.plugins||[]).reduce((function(t,n){var r=n.name,i=n.defaultValue;return r&&(t[r]=void 0!==e[r]?e[r]:i),t}),{});return Object.assign({},e,{},t)}function it(e,t){var n=Object.assign({},t,{content:Se(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(rt(Object.assign({},tt,{plugins:t}))):nt).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},tt.aria,{},n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function ot(e,t){e.innerHTML=t}function at(e){var t=Be();return!0===e?t.className=ke:(t.className=Ce,Re(e)?t.appendChild(e):ot(t,e)),t}function st(e,t){Re(t.content)?(ot(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?ot(e,t.content):e.textContent=t.content)}function ct(e){var t=e.firstElementChild,n=Fe(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(je)})),arrow:n.find((function(e){return e.classList.contains(ke)||e.classList.contains(Ce)})),backdrop:n.find((function(e){return e.classList.contains(Le)}))}}function lt(e){var t=Be(),n=Be();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Be();function i(n,r){var i=ct(t),o=i.box,a=i.content,s=i.arrow;r.theme?o.setAttribute("data-theme",r.theme):o.removeAttribute("data-theme"),"string"==typeof r.animation?o.setAttribute("data-animation",r.animation):o.removeAttribute("data-animation"),r.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?o.setAttribute("role",r.role):o.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||st(a,e.props),r.arrow?s?n.arrow!==r.arrow&&(o.removeChild(s),o.appendChild(at(r.arrow))):o.appendChild(at(r.arrow)):s&&o.removeChild(s)}return r.className=je,r.setAttribute("data-state","hidden"),st(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props),{popper:t,onUpdate:i}}lt.$$tippy=!0;var ut=1,dt=[],pt=[];function ft(e,t){var n,r,i,o,a,s,c,l,u,d=it(e,Object.assign({},tt,{},rt((n=t,Object.keys(n).reduce((function(e,t){return void 0!==n[t]&&(e[t]=n[t]),e}),{}))))),p=!1,f=!1,h=!1,m=!1,v=[],g=De($,d.interactiveDebounce),y=ut++,b=(u=d.plugins).filter((function(e,t){return u.indexOf(e)===t})),w={id:y,reference:e,popper:Be(),popperInstance:null,props:d,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:b,clearDelayTimeouts:function(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)},setProps:function(t){0;if(w.state.isDestroyed)return;I("onBeforeUpdate",[w,t]),V();var n=w.props,r=it(e,Object.assign({},w.props,{},t,{ignoreAttributes:!0}));w.props=r,Q(),n.interactiveDebounce!==r.interactiveDebounce&&(F(),g=De($,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?Ie(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");M(),D(),O&&O(n,r);w.popperInstance&&(K(),ee().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));I("onAfterUpdate",[w,t])},setContent:function(e){w.setProps({content:e})},show:function(){0;var e=w.state.isVisible,t=w.state.isDestroyed,n=!w.state.isEnabled,r=Ge.isTouch&&!w.props.touch,i=Te(w.props.duration,0,tt.duration);if(e||t||n||r)return;if(A().hasAttribute("disabled"))return;if(I("onShow",[w],!1),!1===w.props.onShow(w))return;w.state.isVisible=!0,C()&&(x.style.visibility="visible");D(),H(),w.state.isMounted||(x.style.transition="none");if(C()){var o=P(),a=o.box,s=o.content;Ue([a,s],0)}c=function(){var e;if(w.state.isVisible&&!m){if(m=!0,x.offsetHeight,x.style.transition=w.props.moveTransition,C()&&w.props.animation){var t=P(),n=t.box,r=t.content;Ue([n,r],i),We([n,r],"visible")}N(),M(),Ne(pt,w),null==(e=w.popperInstance)||e.forceUpdate(),w.state.isMounted=!0,I("onMount",[w]),w.props.animation&&C()&&function(e,t){U(e,t)}(i,(function(){w.state.isShown=!0,I("onShown",[w])}))}},function(){var e,t=w.props.appendTo,n=A();e=w.props.interactive&&t===tt.appendTo||"parent"===t?n.parentNode:Se(t,[n]);e.contains(x)||e.appendChild(x);K(),!1}()},hide:function(){0;var e=!w.state.isVisible,t=w.state.isDestroyed,n=!w.state.isEnabled,r=Te(w.props.duration,1,tt.duration);if(e||t||n)return;if(I("onHide",[w],!1),!1===w.props.onHide(w))return;w.state.isVisible=!1,w.state.isShown=!1,m=!1,p=!1,C()&&(x.style.visibility="hidden");if(F(),q(),D(),C()){var i=P(),o=i.box,a=i.content;w.props.animation&&(Ue([o,a],r),We([o,a],"hidden"))}N(),M(),w.props.animation?C()&&function(e,t){U(e,(function(){!w.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&t()}))}(r,w.unmount):w.unmount()},hideWithInteractivity:function(e){0;T().addEventListener("mousemove",g),Ne(dt,g),g(e)},enable:function(){w.state.isEnabled=!0},disable:function(){w.hide(),w.state.isEnabled=!1},unmount:function(){0;w.state.isVisible&&w.hide();if(!w.state.isMounted)return;Z(),ee().forEach((function(e){e._tippy.unmount()})),x.parentNode&&x.parentNode.removeChild(x);pt=pt.filter((function(e){return e!==w})),w.state.isMounted=!1,I("onHidden",[w])},destroy:function(){0;if(w.state.isDestroyed)return;w.clearDelayTimeouts(),w.unmount(),V(),delete e._tippy,w.state.isDestroyed=!0,I("onDestroy",[w])}};if(!d.render)return w;var _=d.render(w),x=_.popper,O=_.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+w.id,w.popper=x,e._tippy=w,x._tippy=w;var E=b.map((function(e){return e.fn(w)})),j=e.hasAttribute("aria-expanded");return Q(),M(),D(),I("onCreate",[w]),d.showOnCreate&&te(),x.addEventListener("mouseenter",(function(){w.props.interactive&&w.state.isVisible&&w.clearDelayTimeouts()})),x.addEventListener("mouseleave",(function(e){w.props.interactive&&w.props.trigger.indexOf("mouseenter")>=0&&(T().addEventListener("mousemove",g),g(e))})),w;function L(){var e=w.props.touch;return Array.isArray(e)?e:[e,0]}function k(){return"hold"===L()[0]}function C(){var e;return!!(null==(e=w.props.render)?void 0:e.$$tippy)}function A(){return l||e}function T(){var e=A().parentNode;return e?Qe(e):document}function P(){return ct(x)}function S(e){return w.state.isMounted&&!w.state.isVisible||Ge.isTouch||a&&"focus"===a.type?0:Te(w.props.delay,e?0:1,tt.delay)}function D(){x.style.pointerEvents=w.props.interactive&&w.state.isVisible?"":"none",x.style.zIndex=""+w.props.zIndex}function I(e,t,n){var r;(void 0===n&&(n=!0),E.forEach((function(n){n[e]&&n[e].apply(void 0,t)})),n)&&(r=w.props)[e].apply(r,t)}function N(){var t=w.props.aria;if(t.content){var n="aria-"+t.content,r=x.id;Ie(w.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(w.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var i=t&&t.replace(r,"").trim();i?e.setAttribute(n,i):e.removeAttribute(n)}}))}}function M(){!j&&w.props.aria.expanded&&Ie(w.props.triggerTarget||e).forEach((function(e){w.props.interactive?e.setAttribute("aria-expanded",w.state.isVisible&&e===A()?"true":"false"):e.removeAttribute("aria-expanded")}))}function F(){T().removeEventListener("mousemove",g),dt=dt.filter((function(e){return e!==g}))}function B(e){if(!(Ge.isTouch&&(h||"mousedown"===e.type)||w.props.interactive&&x.contains(e.target))){if(A().contains(e.target)){if(Ge.isTouch)return;if(w.state.isVisible&&w.props.trigger.indexOf("click")>=0)return}else I("onClickOutside",[w,e]);!0===w.props.hideOnClick&&(w.clearDelayTimeouts(),w.hide(),f=!0,setTimeout((function(){f=!1})),w.state.isMounted||q())}}function R(){h=!0}function z(){h=!1}function H(){var e=T();e.addEventListener("mousedown",B,!0),e.addEventListener("touchend",B,Ae),e.addEventListener("touchstart",z,Ae),e.addEventListener("touchmove",R,Ae)}function q(){var e=T();e.removeEventListener("mousedown",B,!0),e.removeEventListener("touchend",B,Ae),e.removeEventListener("touchstart",z,Ae),e.removeEventListener("touchmove",R,Ae)}function U(e,t){var n=P().box;function r(e){e.target===n&&(Ve(n,"remove",r),t())}if(0===e)return t();Ve(n,"remove",s),Ve(n,"add",r),s=r}function W(t,n,r){void 0===r&&(r=!1),Ie(w.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),v.push({node:e,eventType:t,handler:n,options:r})}))}function Q(){var e;k()&&(W("touchstart",G,{passive:!0}),W("touchend",J,{passive:!0})),(e=w.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(W(e,G),e){case"mouseenter":W("mouseleave",J);break;case"focus":W(Ze?"focusout":"blur",X);break;case"focusin":W("focusout",X)}}))}function V(){v.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,i=e.options;t.removeEventListener(n,r,i)})),v=[]}function G(e){var t,n=!1;if(w.state.isEnabled&&!Y(e)&&!f){var r="focus"===(null==(t=a)?void 0:t.type);a=e,l=e.currentTarget,M(),!w.state.isVisible&&ze(e)&&dt.forEach((function(t){return t(e)})),"click"===e.type&&(w.props.trigger.indexOf("mouseenter")<0||p)&&!1!==w.props.hideOnClick&&w.state.isVisible?n=!0:te(e),"click"===e.type&&(p=!n),n&&!r&&ne(e)}}function $(e){var t=e.target,n=A().contains(t)||x.contains(t);"mousemove"===e.type&&n||function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,i=e.popperState,o=e.props.interactiveBorder,a=Me(i.placement),s=i.modifiersData.offset;if(!s)return!0;var c="bottom"===a?s.top.y:0,l="top"===a?s.bottom.y:0,u="right"===a?s.left.x:0,d="left"===a?s.right.x:0,p=t.top-r+c>o,f=r-t.bottom-l>o,h=t.left-n+u>o,m=n-t.right-d>o;return p||f||h||m}))}(ee().concat(x).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:d}:null})).filter(Boolean),e)&&(F(),ne(e))}function J(e){Y(e)||w.props.trigger.indexOf("click")>=0&&p||(w.props.interactive?w.hideWithInteractivity(e):ne(e))}function X(e){w.props.trigger.indexOf("focusin")<0&&e.target!==A()||w.props.interactive&&e.relatedTarget&&x.contains(e.relatedTarget)||ne(e)}function Y(e){return!!Ge.isTouch&&k()!==e.type.indexOf("touch")>=0}function K(){Z();var t=w.props,n=t.popperOptions,r=t.placement,i=t.offset,o=t.getReferenceClientRect,a=t.moveTransition,s=C()?ct(x).arrow:null,l=o?{getBoundingClientRect:o,contextElement:o.contextElement||A()}:e,u=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(C()){var n=P().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}}];C()&&s&&u.push({name:"arrow",options:{element:s,padding:3}}),u.push.apply(u,(null==n?void 0:n.modifiers)||[]),w.popperInstance=Ee(l,x,Object.assign({},n,{placement:r,onFirstUpdate:c,modifiers:u}))}function Z(){w.popperInstance&&(w.popperInstance.destroy(),w.popperInstance=null)}function ee(){return Fe(x.querySelectorAll("[data-tippy-root]"))}function te(e){w.clearDelayTimeouts(),e&&I("onTrigger",[w,e]),H();var t=S(!0),n=L(),i=n[0],o=n[1];Ge.isTouch&&"hold"===i&&o&&(t=o),t?r=setTimeout((function(){w.show()}),t):w.show()}function ne(e){if(w.clearDelayTimeouts(),I("onUntrigger",[w,e]),w.state.isVisible){if(!(w.props.trigger.indexOf("mouseenter")>=0&&w.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&p)){var t=S(!1);t?i=setTimeout((function(){w.state.isVisible&&w.hide()}),t):o=requestAnimationFrame((function(){w.hide()}))}}else q()}}function ht(e,t){void 0===t&&(t={});var n=tt.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",Je,Ae),window.addEventListener("blur",Ye);var r=Object.assign({},t,{plugins:n}),i=qe(e).reduce((function(e,t){var n=t&&ft(t,r);return n&&e.push(n),e}),[]);return Re(e)?i[0]:i}ht.defaultProps=tt,ht.setDefaultProps=function(e){Object.keys(e).forEach((function(t){tt[t]=e[t]}))},ht.currentInput=Ge;Object.assign({},le,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}});ht.setDefaultProps({render:lt});var mt=ht,vt=n(4),gt=n.n(vt);var yt={controlled:null,bind(e){this.controlled=e,this.controlled.forEach((e=>{this._master(e)})),this._init()},_init(){this.controlled.forEach((e=>{this._checkUp(e)}))},_master(e){const t=JSON.parse(e.dataset.master);e.dataset.size&&(e.filesize=parseInt(e.dataset.size,10)),e.masters=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.masters.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.masters&&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.masters&&[...e.masters].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 i="off"!==r;e.checked===i&&e.value===r||(e.value=r,e.checked=i,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;0=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var _t,xt,Ot,Et,jt=n(5),Lt=n.n(jt);n(0),Lt()(console.error);_t={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},xt=["(","?"],Ot={")":["("],":":["?","?:"]},Et=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var kt={"!":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 Ct(e){var t=function(e){for(var t,n,r,i,o=[],a=[];t=e.match(Et);){for(n=t[0],(r=e.substr(0,t.index).trim())&&o.push(r);i=a.pop();){if(Ot[n]){if(Ot[n][0]===i){n=Ot[n][1]||n;break}}else if(xt.indexOf(i)>=0||_t[i]<_t[n]){a.push(i);break}o.push(i)}Ot[n]||a.push(n),e=e.substr(t.index+n.length)}return(e=e.trim())&&o.push(e),o.concat(a.reverse())}(e);return function(e){return function(e,t){var n,r,i,o,a,s,c=[];for(n=0;n3&&void 0!==arguments[3]?arguments[3]:10,a=e[t];if(Mt(n)&&Nt(r))if("function"==typeof i)if("number"==typeof o){var s={callback:i,priority:o,namespace:r};if(a[n]){var c,l=a[n].handlers;for(c=l.length;c>0&&!(o>=l[c-1].priority);c--);c===l.length?l[c]=s:l.splice(c,0,s),a.__current.forEach((function(e){e.name===n&&e.currentIndex>=c&&e.currentIndex++}))}else a[n]={handlers:[s],runs:0};"hookAdded"!==n&&e.doAction("hookAdded",n,r,i,o)}else console.error("If specified, the hook priority must be a number.");else console.error("The hook callback must be a function.")}};var Bt=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(r,i){var o=e[t];if(Mt(r)&&(n||Nt(i))){if(!o[r])return 0;var a=0;if(n)a=o[r].handlers.length,o[r]={runs:o[r].runs,handlers:[]};else for(var s=o[r].handlers,c=function(e){s[e].namespace===i&&(s.splice(e,1),a++,o.__current.forEach((function(t){t.name===r&&t.currentIndex>=e&&t.currentIndex--})))},l=s.length-1;l>=0;l--)c(l);return"hookRemoved"!==r&&e.doAction("hookRemoved",r,i),a}}};var Rt=function(e,t){return function(n,r){var i=e[t];return void 0!==r?n in i&&i[n].handlers.some((function(e){return e.namespace===r})):n in i}};function zt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]&&arguments[2];return function(r){var i=e[t];i[r]||(i[r]={handlers:[],runs:0}),i[r].runs++;var o=i[r].handlers;for(var a=arguments.length,s=new Array(a>1?a-1:0),c=1;c1&&void 0!==arguments[1]?arguments[1]:"default";r.data[t]=St(St(St({},Dt),r.data[t]),e),r.data[t][""]=St(St({},Dt[""]),r.data[t][""])},s=function(e,t){a(e,t),o()},c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;return r.data[e]||a(void 0,e),r.dcnpgettext(e,t,n,i,o)},l=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return e},u=function(e,t,r){var i=c(r,t,e);return n?(i=n.applyFilters("i18n.gettext_with_context",i,e,t,r),n.applyFilters("i18n.gettext_with_context_"+l(r),i,e,t,r)):i};if(e&&s(e,t),n){var d=function(e){It.test(e)&&o()};n.addAction("hookAdded","core/i18n",d),n.addAction("hookRemoved","core/i18n",d)}return{getLocaleData:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return r.data[e]},setLocaleData:s,resetLocaleData:function(e,t){r.data={},r.pluralForms={},s(e,t)},subscribe:function(e){return i.add(e),function(){return i.delete(e)}},__:function(e,t){var r=c(t,void 0,e);return n?(r=n.applyFilters("i18n.gettext",r,e,t),n.applyFilters("i18n.gettext_"+l(t),r,e,t)):r},_x:u,_n:function(e,t,r,i){var o=c(i,void 0,e,t,r);return n?(o=n.applyFilters("i18n.ngettext",o,e,t,r,i),n.applyFilters("i18n.ngettext_"+l(i),o,e,t,r,i)):o},_nx:function(e,t,r,i,o){var a=c(o,i,e,t,r);return n?(a=n.applyFilters("i18n.ngettext_with_context",a,e,t,r,i,o),n.applyFilters("i18n.ngettext_with_context_"+l(o),a,e,t,r,i,o)):a},isRTL:function(){return"rtl"===u("ltr","text direction")},hasTranslation:function(e,t,i){var o,a,s=t?t+""+e:e,c=!(null===(o=r.data)||void 0===o||null===(a=o[null!=i?i:"default"])||void 0===a||!a[s]);return n&&(c=n.applyFilters("i18n.has_translation",c,e,t,i),c=n.applyFilters("i18n.has_translation_"+l(i),c,e,t,i)),c}}}(void 0,void 0,Gt)),Jt=($t.getLocaleData.bind($t),$t.setLocaleData.bind($t),$t.resetLocaleData.bind($t),$t.subscribe.bind($t),$t.__.bind($t));$t._x.bind($t),$t._n.bind($t),$t._nx.bind($t),$t.isRTL.bind($t),$t.hasTranslation.bind($t);function Xt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yt(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function vn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;if(!t||!Object.keys(t).length)return e;var n=e,r=e.indexOf("?");return-1!==r&&(t=Object.assign(hn(e),t),n=n.substr(0,r)),n+"?"+gn(t)}function bn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wn(e){for(var t=1;t]+)>; rel="next"/);return t?{next:t[1]}:{}}(e.headers.get("link")).next},On=function(e){var t=!!e.path&&-1!==e.path.indexOf("per_page=-1"),n=!!e.url&&-1!==e.url.indexOf("per_page=-1");return t||n},En=function(){var e,t=(e=un.a.mark((function e(t,n){var r,i,o,a,s,c;return un.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!1!==t.parse){e.next=2;break}return e.abrupt("return",n(t));case 2:if(On(t)){e.next=4;break}return e.abrupt("return",n(t));case 4:return e.next=6,Wn(wn(wn({},(u={per_page:100},d=void 0,p=void 0,d=(l=t).path,p=l.url,wn(wn({},wt(l,["path","url"])),{},{url:p&&yn(p,u),path:d&&yn(d,u)}))),{},{parse:!1}));case 6:return r=e.sent,e.next=9,_n(r);case 9:if(i=e.sent,Array.isArray(i)){e.next=12;break}return e.abrupt("return",i);case 12:if(o=xn(r)){e.next=15;break}return e.abrupt("return",i);case 15:a=[].concat(i);case 16:if(!o){e.next=27;break}return e.next=19,Wn(wn(wn({},t),{},{path:void 0,url:o,parse:!1}));case 19:return s=e.sent,e.next=22,_n(s);case 22:c=e.sent,a=a.concat(c),o=xn(s),e.next=16;break;case 27:return e.abrupt("return",a);case 28:case"end":return e.stop()}var l,u,d,p}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){cn(o,r,i,a,s,"next",e)}function s(e){cn(o,r,i,a,s,"throw",e)}a(void 0)}))});return function(e,n){return t.apply(this,arguments)}}();function jn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ln(e){for(var t=1;t1&&void 0!==arguments[1])||arguments[1];return t?204===e.status?null:e.json?e.json():Promise.reject(e):e},Tn=function(e){var t={code:"invalid_json",message:Jt("The response is not a valid JSON response.")};if(!e||!e.json)throw t;return e.json().catch((function(){throw t}))},Pn=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Promise.resolve(An(e,t)).catch((function(e){return Sn(e,t)}))};function Sn(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!t)throw e;return Tn(e).then((function(e){var t={code:"unknown_error",message:Jt("An unknown error occurred.")};throw e||t}))}function Dn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function In(e){for(var t=1;t=500&&t.status<600&&n?r(n).catch((function(){return!1!==e.parse?Promise.reject({code:"post_process",message:Jt("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(t)})):Sn(t,e.parse)})).then((function(t){return Pn(t,e.parse)}))};function Mn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Fn(e){for(var t=1;t=200&&e.status<300)return e;throw e},qn=function(e){var t=e.url,n=e.path,r=e.data,i=e.parse,o=void 0===i||i,a=wt(e,["url","path","data","parse"]),s=e.body,c=e.headers;return c=Fn(Fn({},Bn),c),r&&(s=JSON.stringify(r),c["Content-Type"]="application/json"),window.fetch(t||n||window.location.href,Fn(Fn(Fn({},Rn),a),{},{body:s,headers:c})).then((function(e){return Promise.resolve(e).then(Hn).catch((function(e){return Sn(e,o)})).then((function(e){return Pn(e,o)}))}),(function(){throw{code:"fetch_error",message:Jt("You are probably offline.")}}))};function Un(e){return zn.reduceRight((function(e,t){return function(n){return t(n,e)}}),qn)(e).catch((function(t){return"rest_cookie_invalid_nonce"!==t.code?Promise.reject(t):window.fetch(Un.nonceEndpoint).then(Hn).then((function(e){return e.text()})).then((function(t){return Un.nonceMiddleware.nonce=t,Un(e)}))}))}Un.use=function(e){zn.unshift(e)},Un.setFetchHandler=function(e){qn=e},Un.createNonceMiddleware=Kt,Un.createPreloadingMiddleware=sn,Un.createRootURLMiddleware=on,Un.fetchAllMiddleware=En,Un.mediaUploadMiddleware=Nn;var Wn=Un;var Qn={cachePoints:{},spinners:{},init(e){if("undefined"!=typeof CLDCACHE){Wn.use(Wn.createNonceMiddleware(CLDCACHE.nonce));e.querySelectorAll("[data-cache-point]").forEach((e=>this._bind(e)))}},getCachePoint(e){return this.cachePoints["_"+e]?this.cachePoints["_"+e]:null},setCachePoint(e,t){const n=document.createElement("div"),r=this._getRow(),i=document.createElement("td");i.colSpan=2,i.className="cld-loading",r.appendChild(i);const o=document.getElementById(t.dataset.slug),a=document.getElementById(t.dataset.slug+"_search"),s=document.getElementById(t.dataset.slug+"_reload"),c=document.getElementById(t.dataset.browser),l=document.getElementById(t.dataset.apply);c.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)})),s.addEventListener("click",(t=>{this._load(e)})),a.addEventListener("keydown",(t=>{13===t.which&&(t.preventDefault(),t.stopPropagation(),this._load(e))})),n.className="cld-pagenav",l.cacheChanges={disable:[],enable:[],delete:[]},t.master=o,t.search=a,t.controller=c,t.viewer=t.parentNode.parentNode,t.loader=r,t.table=t.parentNode,t.apply=l,t.paginate=n,t.currentPage=1,t.viewer.appendChild(n),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.master.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),t.loaded||this._load(e)):(this.close(t.viewer),t.controller.checked=!1))},_load(e){const t=this.getCachePoint(e);this._clearChildren(t),t.appendChild(t.loader),this.open(t.loader),Wn({path:CLDCACHE.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-master]");yt.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){this.close(e.apply);const t=e.apply.cacheChanges;let n=!1;for(const e in t)t[e].length&&(n=!0);n&&this.open(e.apply)},_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])},_set_state(e,t,n){this._showSpinners(n),Wn({path:CLDCACHE.update_url,data:{state:t,ids:n},method:"POST"}).then((n=>{this._hideSpinners(n),n.forEach((n=>{this.close(e.apply),this._removeFromList(e,n,t),this._evaluateApply(e),e.apply.disabled=""})),"delete"===t&&this._load(e.dataset.cachePoint)}))},_purgeCache(e){Wn({path:CLDCACHE.purge_url,data:{cachePoint:e.dataset.cachePoint},method:"POST"}).then((()=>{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 i=!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"}),i=this._getFile(e,t,n);n.appendChild(i),n.appendChild(r),e.appendChild(n)}))},_buildNav(e,t){e.paginate.innerHTML="";const n=document.createElement("button"),r=document.createElement("button");if(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="left",e.paginate.appendChild(t),t.addEventListener("click",(t=>{confirm(wp.i18n.__("Purge entire cache point?","cloudinary"))&&this._purgeCache(e)}))}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 i=document.createElement("span");i.innerText=t.nav_text,i.className="cld-pagenav-text",e.paginate.appendChild(n),e.paginate.appendChild(i),e.paginate.appendChild(r)},_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},_getFile(e,t){const n=document.createElement("td"),r=document.createElement("label"),i=this._getDeleter(e,n,t);r.innerText=t.short_url,r.htmlFor=t.key,n.appendChild(i),n.appendChild(r);const o=document.createElement("span"),a="spinner_"+t.ID;return o.className="spinner",o.id=a,n.appendChild(o),this.spinners[a]=o,n},_getDeleter(e,t,n){const r=document.createElement("input"),i=[e.dataset.slug+"_deleter"],o=this._getListIndex(e,n.ID,"delete");return r.type="checkbox",r.value=n.ID,r.id=n.key,r.dataset.master=JSON.stringify(i),-1{t.style.opacity=1,t.style.textDecoration="",r.checked&&(t.style.opacity=.8,t.style.textDecoration="line-through");const o=new CustomEvent("CacheToggle",{detail:{checked:r.checked,states:{on:"delete",off:n.active?"enable":"disable"},item:n,cachePoint:e}});window.dispatchEvent(o)})),r},_getStateSwitch(e,t,n){const r=document.createElement("td"),i=document.createElement("label"),o=document.createElement("input"),a=document.createElement("span"),s=[e.dataset.slug+"_selector"],c=this._getListIndex(e,t.ID,"disable");return r.style.textAlign="right",i.className="cld-input-on-off-control mini",o.type="checkbox",o.value=t.ID,o.checked=!(-1{const i=new CustomEvent("CacheToggle",{detail:{checked:o.checked,states:n,item:t,cachePoint:e}});window.dispatchEvent(i)})),r.appendChild(i),r}};const Vn={bindings:{},parent_check_data:{},check_parents:{},_init(e){const t=e.querySelectorAll("[data-condition]"),n=e.querySelectorAll("[data-toggle]"),r=e.querySelectorAll("[data-for]"),i=e.querySelectorAll("[data-tooltip]"),o=e.querySelectorAll("[data-bind-trigger]"),a=e.querySelectorAll("[data-master]"),s=e.querySelectorAll("[data-file]"),c=e.querySelectorAll("[data-auto-suffix]"),l={};yt.bind(a),c.forEach((e=>this._autoSuffix(e))),o.forEach((e=>this._trigger(e))),n.forEach((e=>this._toggle(e))),t.forEach((e=>this._bind(e))),r.forEach((e=>this._alias(e))),s.forEach((e=>this._files(e,l))),mt(i,{theme:"cloudinary",arrow:!1,placement:"bottom-start",aria:{content:"auto",expanded:"auto"},content:t=>e.getElementById(t.getAttribute("data-tooltip")).innerHTML}),[...o].forEach((e=>{e.dispatchEvent(new Event("input"))})),Qn.init(e)},_autoSuffix(e){const t=e.dataset.autoSuffix;let n="";const r=[...t.split(";")].map((e=>0===e.indexOf("*")?(n=e.replace("*",""),n):e));e.addEventListener("change",(()=>{const t=e.value.replace(" ",""),i=t.replace(/[^0-9]/g,""),o=t.replace(/[0-9]/g,"").toLowerCase();i&&(-1===r.indexOf(o)?e.value=i+n:e.value=i+o)})),e.dispatchEvent(new Event("change"))},_files(e,t){const n=e.dataset.parent;n&&(this.check_parents[n]=document.getElementById(n),this.parent_check_data[n]||(this.parent_check_data[n]=this.check_parents[n].value?JSON.parse(this.check_parents[n].value):[]),e.addEventListener("change",(()=>{const r=this.parent_check_data[n].indexOf(e.value);e.checked?this.parent_check_data[n].push(e.value):this.parent_check_data[n].splice(r,1),t[n]&&clearTimeout(t[n]),t[n]=setTimeout((()=>{this._compileParent(n)}),10)})))},_compileParent(e){this.check_parents[e].value=JSON.stringify(this.parent_check_data[e]),this.check_parents[e].dispatchEvent(new Event("change"))},_bind(e){e.condition=JSON.parse(e.dataset.condition);for(const t in e.condition)this.bindings[t]&&this.bindings[t].elements.push(e)},_trigger(e){const t=e.dataset.bindTrigger,n=this;n.bindings[t]={input:e,value:e.value,checked:!0,elements:[]},e.addEventListener("change",(function(t){e.dispatchEvent(new Event("input"))})),e.addEventListener("input",(function(){n.bindings[t].value=e.value,"checkbox"!==e.type&&"radio"!==e.type||(n.bindings[t].checked=e.checked);for(const r in n.bindings[t].elements)n.toggle(n.bindings[t].elements[r],e)}))},_alias(e){e.addEventListener("click",(function(){document.getElementById(e.dataset.for).dispatchEvent(new Event("click"))}))},_toggle(e){const t=this;e.addEventListener("click",(function(n){n.stopPropagation();const r=document.querySelector('[data-wrap="'+e.dataset.toggle+'"]'),i=r.classList.contains("open")?"closed":"open";t.toggle(r,e,i)}))},toggle(e,t,n){if(!n){n="open";for(const t in e.condition){let r=this.bindings[t].value;const i=e.condition[t];"boolean"==typeof i&&(r=this.bindings[t].checked),i!==r&&(n="closed")}}const r=e.getElementsByClassName("cld-ui-input");"closed"===n?(e.classList.remove("open"),e.classList.add("closed"),t&&t.classList.contains("dashicons")&&(t.classList.remove("dashicons-arrow-up-alt2"),t.classList.add("dashicons-arrow-down-alt2")),[...r].forEach((function(e){e.dataset.disabled=!0}))):(e.classList.remove("closed"),e.classList.add("open"),t&&t.classList.contains("dashicons")&&(t.classList.remove("dashicons-arrow-down-alt2"),t.classList.add("dashicons-arrow-up-alt2")),[...r].forEach((function(e){e.dataset.disabled=!1})))}};window.addEventListener("load",Vn._init(document));var Gn=Vn;window.$=window.jQuery;const $n={UI:Gn,Settings:i.a,Widget:a.a,GlobalTransformations:c,TermsOrder:u,MediaLibrary:p,Notices:h}}]); \ No newline at end of file diff --git a/js/src/components/ui.js b/js/src/components/ui.js index 3bbaef01b..94a7bfa4a 100644 --- a/js/src/components/ui.js +++ b/js/src/components/ui.js @@ -65,9 +65,9 @@ const UI = { const type = value.replace( /[0-9]/g, '' ).toLowerCase(); if ( number ) { if ( -1 === valid.indexOf( type ) ) { - input.value = number + ' ' + defaultSuffix; + input.value = number + defaultSuffix; } else { - input.value = number + ' ' + type; + input.value = number + type; } } } ); diff --git a/php/class-delivery.php b/php/class-delivery.php index c4e75d9d6..96a6c6a69 100644 --- a/php/class-delivery.php +++ b/php/class-delivery.php @@ -82,6 +82,7 @@ protected function setup_hooks() { add_filter( 'cloudinary_filter_out_local', '__return_false' ); add_action( 'update_option_cloudinary_media_display', array( $this, 'clear_cache' ) ); + add_action( 'cloudinary_flush_cache', array( $this, 'clear_cache' ) ); add_filter( 'cloudinary_current_post_id', array( $this, 'get_current_post_id' ) ); add_filter( 'the_content', array( $this, 'add_post_id' ) ); @@ -197,6 +198,9 @@ public function get_attachment_size_urls( $attachment_id ) { // Ignore getting 'original_image' since this isn't used in the front end. if ( ! empty( $meta['sizes'] ) ) { foreach ( $meta['sizes'] as $data ) { + if ( isset( $urls[ $base . $data['file'] ] ) ) { + continue; + } $urls[ $base . $data['file'] ] = $this->media->cloudinary_url( $attachment_id, array( diff --git a/php/class-lazy-load.php b/php/class-lazy-load.php index 6d14befe2..70d6ee8a1 100644 --- a/php/class-lazy-load.php +++ b/php/class-lazy-load.php @@ -140,36 +140,31 @@ public function add_features( $tag_element, $attachment_id, $original_tag ) { if ( ! $this->media->is_cloudinary_url( $src ) ) { $src = $this->media->cloudinary_url( $attachment_id ); } - $transformations = $this->media->get_transformations_from_string( $src ); - $placehold_transformations = $transformations; - $original_string = Api::generate_transformation_string( $transformations ); + $tag_element['atts']['data-src'] = $src; + $transformations = $this->media->get_transformations_from_string( $src ); + $placehold_transformations = $transformations; + $original_string = Api::generate_transformation_string( $transformations ); // placeholder. if ( 'off' !== $settings['lazy_placeholder'] ) { // Remove the optimize (last) transformation. array_pop( $placehold_transformations ); - $placehold_transformations = array_merge( $placehold_transformations, $this->get_placeholder_transformations( $settings['lazy_placeholder'] ) ); - $palcehold_str = Api::generate_transformation_string( $placehold_transformations ); - $placeholder = str_replace( $original_string, $palcehold_str, $src ); - - $tag_element['atts']['src'] = $placeholder; - if ( ! empty( $settings['lazy_preloader'] ) ) { - $tag_element['atts']['data-placeholder'] = $placeholder; - } + $placehold_transformations = array_merge( $placehold_transformations, $this->get_placeholder_transformations( $settings['lazy_placeholder'] ) ); + $palcehold_str = Api::generate_transformation_string( $placehold_transformations ); + $placeholder = str_replace( $original_string, $palcehold_str, $src ); + $tag_element['atts']['data-placeholder'] = $placeholder; } - if ( ! empty( $settings['lazy_preloader'] ) ) { - $color_str = $settings['lazy_custom_color']; - if ( 'on' === $settings['lazy_animate'] ) { - $colors = explode( ',', rtrim( substr( $settings['lazy_custom_color'], 5 ), ')' ) ); - $color1 = 'rgba(' . $colors[0] . ',' . $colors[1] . ',' . $colors[2] . ',' . $colors[3] . ')'; - $color2 = 'rgba(' . $colors[0] . ',' . $colors[1] . ',' . $colors[2] . ',0)'; - $color_str = $color1 . ';' . $color2 . ';' . $color1; - } - $svg = ''; - $tag_element['atts']['src'] = 'data:image/svg+xml;utf8,' . $svg; - $tag_element['atts']['data-type'] = $format; + $color_str = $settings['lazy_custom_color']; + if ( 'on' === $settings['lazy_animate'] ) { + $colors = explode( ',', rtrim( substr( $settings['lazy_custom_color'], 5 ), ')' ) ); + $color1 = 'rgba(' . $colors[0] . ',' . $colors[1] . ',' . $colors[2] . ',' . $colors[3] . ')'; + $color2 = 'rgba(' . $colors[0] . ',' . $colors[1] . ',' . $colors[2] . ',0)'; + $color_str = $color1 . ';' . $color2 . ';' . $color1; } + $svg = ''; + $tag_element['atts']['src'] = 'data:image/svg+xml;utf8,' . $svg; + $tag_element['atts']['data-type'] = $format; unset( $tag_element['atts']['loading'] ); $tag_element['atts']['decoding'] = 'async'; @@ -217,7 +212,7 @@ public function settings() { 'type' => 'on_off', 'description' => __( 'Enable lazy loading', 'cloudinary' ), 'slug' => 'use_lazy_loading', - 'default' => 'off', + 'default' => 'on', ), array( 'type' => 'group', @@ -234,8 +229,7 @@ public function settings() { ), 'data-auto-suffix' => '*px;em;rem;vw;vh', ), - - 'default' => '1000px', + 'default' => '1000px', ), array( 'type' => 'radio', @@ -252,32 +246,16 @@ public function settings() { ), ), array( - 'type' => 'checkbox', - 'title' => __( 'Initial preloader', 'cloudinary' ), - 'slug' => 'lazy_preloader', - - 'default' => 'on', - 'options' => array( - 'on' => __( 'Use an initial preloader', 'cloudinary' ), - ), - ), - array( - 'type' => 'color', - 'title' => __( 'Use custom color', 'cloudinary' ), - 'slug' => 'lazy_custom_color', - 'default' => 'rgba(153,153,153,0.5)', - 'condition' => array( - 'lazy_preloader' => true, - ), + 'type' => 'color', + 'title' => __( 'Use custom color', 'cloudinary' ), + 'slug' => 'lazy_custom_color', + 'default' => 'rgba(153,153,153,0.5)', ), array( - 'type' => 'on_off', - 'title' => __( 'Animate', 'cloudinary' ), - 'slug' => 'lazy_animate', - 'default' => 'on', - 'condition' => array( - 'lazy_preloader' => true, - ), + 'type' => 'on_off', + 'title' => __( 'Animate', 'cloudinary' ), + 'slug' => 'lazy_animate', + 'default' => 'on', ), ), ); From 81c24f759e78d1f45a010b51b3363bf9063b663b Mon Sep 17 00:00:00 2001 From: David Cramer Date: Thu, 8 Jul 2021 10:23:17 +0200 Subject: [PATCH 26/56] clean up legacy migrations --- php/class-media.php | 21 +++++++++-------- php/media/class-upgrade.php | 47 +++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 10 deletions(-) diff --git a/php/class-media.php b/php/class-media.php index caf3597e3..39c61e6de 100644 --- a/php/class-media.php +++ b/php/class-media.php @@ -1845,16 +1845,17 @@ public function get_post_meta( $post_id, $key = '', $single = false ) { $meta = get_post_meta( $post_id, Sync::META_KEYS['cloudinary'], true ); if ( empty( $meta ) ) { - $meta = array(); - $old_meta = wp_get_attachment_metadata( $post_id, true ); - if ( isset( $old_meta[ Sync::META_KEYS['cloudinary'] ] ) ) { - $meta = $old_meta[ Sync::META_KEYS['cloudinary'] ]; - // Add public ID. - $public_id = get_post_meta( $post_id, Sync::META_KEYS['public_id'], true ); - $meta[ Sync::META_KEYS['public_id'] ] = $public_id; - update_post_meta( $post_id, Sync::META_KEYS['cloudinary'], $meta ); - delete_post_meta( $post_id, Sync::META_KEYS['public_id'] ); - } + /** + * Filter the meta if not found, in order to migrate from a legacy plugin. + * + * @hook cloudinary_migrate_legacy_meta + * @since 2.7.5 + * + * @param $attachment_id {int} The attachment ID. + * + * @return array + */ + $meta = apply_filters( 'cloudinary_migrate_legacy_meta', $post_id ); } if ( '' !== $key ) { $meta = isset( $meta[ $key ] ) ? $meta[ $key ] : null; diff --git a/php/media/class-upgrade.php b/php/media/class-upgrade.php index a0289c832..e70ea727f 100644 --- a/php/media/class-upgrade.php +++ b/php/media/class-upgrade.php @@ -169,11 +169,58 @@ public function get_fetch_public_id( $path, $attachment_id ) { return ''; } + /** + * Migrate legacy meta data to new meta. + * + * @param int $attachment_id The attachment ID to migrate. + * + * @return array(); + */ + public function migrate_legacy_meta( $attachment_id ) { + $meta = array(); + $old_meta = wp_get_attachment_metadata( $attachment_id, true ); + if ( isset( $old_meta[ Sync::META_KEYS['cloudinary'] ] ) ) { + $meta = $old_meta[ Sync::META_KEYS['cloudinary'] ]; + // Add public ID. + $public_id = get_post_meta( $attachment_id, Sync::META_KEYS['public_id'], true ); + $meta[ Sync::META_KEYS['public_id'] ] = $public_id; + update_post_meta( $attachment_id, Sync::META_KEYS['cloudinary'], $meta ); + delete_post_meta( $attachment_id, Sync::META_KEYS['public_id'] ); + } else { + // Attempt old post meta. + $public_id = get_post_meta( $attachment_id, Sync::META_KEYS['public_id'], true ); + if ( isset( $public_id ) ) { + // Loop through all types and create new meta item. + $meta = array( + Sync::META_KEYS['public_id'] => $public_id, + ); + update_post_meta( $attachment_id, Sync::META_KEYS['cloudinary'], $meta ); + foreach ( Sync::META_KEYS as $meta_key ) { + if ( Sync::META_KEYS['cloudinary'] === $meta_key ) { + // Dont use the root as it will be an infinite loop. + continue; + } + $value = get_post_meta( $attachment_id, $meta_key, true ); + if ( ! empty( $value ) ) { + $meta[ $meta_key ] = $value; + $this->media->update_post_meta( $attachment_id, $meta_key, $value ); + } + } + } + } + + return $meta; + } + /** * Setup hooks for the filters. */ public function setup_hooks() { + // Add filter to manage legacy items. + // @todo: cleanup `convert_cloudinary_version` by v2 upgrades to here. + add_filter( 'cloudinary_migrate_legacy_meta', array( $this, 'migrate_legacy_meta' ) ); + // Add a redirection to the new plugin settings, from the old plugin. if ( is_admin() ) { add_action( From 13b8fe6601274bbffb7fe5dba21cff3766bb30d1 Mon Sep 17 00:00:00 2001 From: David Cramer Date: Thu, 8 Jul 2021 10:28:55 +0200 Subject: [PATCH 27/56] cleanup nested groups showing duplicate rules --- css/cloudinary.css | 2 +- css/src/components/_ui.scss | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/css/cloudinary.css b/css/cloudinary.css index 802d11857..e0a8e4cf8 100644 --- a/css/cloudinary.css +++ b/css/cloudinary.css @@ -1 +1 @@ -.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{background-color:#333;border-radius:4px;color:#fff;font-size:14px;line-height:1.4;outline:0;position:relative;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{border-top-color:initial;border-width:8px 8px 0;bottom:-7px;left:0;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:initial;border-width:0 8px 8px;left:0;top:-7px;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-left-color:initial;border-width:8px 0 8px 8px;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{border-right-color:initial;border-width:8px 8px 8px 0;left:-7px;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{color:#333;height:16px;width:16px}.tippy-arrow:before{border-color:transparent;border-style:solid;content:"";position:absolute}.tippy-content{padding:5px 9px;position:relative;z-index:1}@font-face{font-family:cloudinary;font-style:normal;font-weight:500;src:url(../css/fonts/cloudinary.7e6e75b25255a2b3b6e7ced1092c210c.eot);src:url(../css/fonts/cloudinary.7e6e75b25255a2b3b6e7ced1092c210c.eot#iefix) format("embedded-opentype"),url(../css/fonts/cloudinary.34cb260ad722325c597cdc3a3e7584d8.woff) format("woff"),url(../css/fonts/cloudinary.c2afda9d25532c03cd41beb20a1ce439.ttf) format("truetype"),url(../css/cloudinary.svg#cloudinary) format("svg")}.dashicons-cloudinary{speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-style:normal;font-variant:normal;font-weight:400;line-height:1;text-transform:none}.dashicons-cloudinary:before{content:"";font-family:cloudinary,monospace!important}.dashicons-cloudinary.success{color:#558b2f}.dashicons-cloudinary.error{color:#dd2c00}.dashicons-cloudinary.error:before{content:""}.dashicons-cloudinary.uploading{color:#fd9d2c}.dashicons-cloudinary.uploading:before{content:""}.dashicons-cloudinary.info{color:#0071ba}.dashicons-cloudinary.downloading:before{content:""}.dashicons-cloudinary.syncing:before{content:""}.column-cld_status{width:5.5em}.column-cld_status .dashicons-cloudinary{display:inline-block}.column-cld_status .dashicons-cloudinary:before{font-size:1.8rem}.form-field .error-notice,.form-table .error-notice{color:#dd2c00;display:none}.form-field input.cld-field:invalid,.form-table input.cld-field:invalid{border-color:#dd2c00}.form-field input.cld-field:invalid+.error-notice,.form-table input.cld-field:invalid+.error-notice{display:inline-block}.cloudinary-welcome{background-image:url(../css/logo.svg);background-position:top 12px right 20px;background-repeat:no-repeat;background-size:153px}.cloudinary-stats{display:inline-block;margin-left:25px}.cloudinary-stat{cursor:help}.cloudinary-percent{color:#0071ba;font-size:.8em;vertical-align:top}.settings-image{max-width:100%;padding-top:5px}.settings-tabs>li{display:inline-block}.settings-tabs>li a{padding:.6em}.settings-tabs>li a.active{background-color:#fff}.settings-tab-section{max-width:1030px;padding:20px 0 0;position:relative}.settings-tab-section.cloudinary-welcome .settings-tab-section-fields-dashboard{align-content:flex-start;align-items:flex-start;display:flex;margin-top:40px}.settings-tab-section.cloudinary-welcome .settings-tab-section-fields-dashboard-description{margin:0 auto 0 0;width:55%}.settings-tab-section.cloudinary-welcome .settings-tab-section-fields-dashboard-content{margin:0 auto;width:35%}.settings-tab-section.cloudinary-welcome .settings-tab-section-fields-dashboard-content .dashicons{color:#9ea3a8}.settings-tab-section.cloudinary-welcome .settings-tab-section-card{margin-top:0}.settings-tab-section-fields .field-heading th{color:#23282d;display:block;font-size:1.1em;margin:1em 0;width:auto}.settings-tab-section-fields .field-heading td{display:none;visibility:hidden}.settings-tab-section-fields .regular-textarea{height:60px;width:100%}.settings-tab-section-fields .dashicons{text-decoration:none;vertical-align:middle}.settings-tab-section-fields a .dashicons{color:#5f5f5f}.settings-tab-section-fields-dashboard-error{color:#5f5f5f;font-size:1.2em}.settings-tab-section-fields-dashboard-error.expanded{margin-bottom:25px;padding-top:40px}.settings-tab-section-fields-dashboard-error .dashicons{color:#ac0000}.settings-tab-section-fields-dashboard-error .button{font-size:1.1em;height:40px;line-height:40px;padding-left:40px;padding-right:40px}.settings-tab-section-fields-dashboard-success{color:#23282d;font-size:1.2em}.settings-tab-section-fields-dashboard-success.expanded{margin-bottom:25px;padding-top:40px}.settings-tab-section-fields-dashboard-success .dashicons{color:#4fb651}.settings-tab-section-fields-dashboard-success .button{font-size:1.1em;height:40px;line-height:40px;padding-left:40px;padding-right:40px}.settings-tab-section-fields-dashboard-success .description{color:#5f5f5f;font-weight:400;margin-top:12px}.settings-tab-section-card{background-color:#fff;border:1px solid #e5e5e5;box-shadow:0 1px 1px 0 rgba(0,0,0,.07);box-sizing:border-box;margin-top:12px;padding:20px 23px}.settings-tab-section-card .dashicons{font-size:1.4em}.settings-tab-section-card h2{font-size:1.8em;font-weight:400;margin-top:0}.settings-tab-section-card.pull-right{float:right;padding:12px;position:relative;width:450px;z-index:10}.settings-tab-section-card.pull-right img.settings-image{border:1px solid #979797;box-shadow:0 2px 4px 0 rgba(0,0,0,.5);margin-top:12px}.settings-tab-section-card.pull-right h3,.settings-tab-section-card.pull-right h4{margin-top:0}.settings-tab-section .field-row-cloudinary_url,.settings-tab-section .field-row-signup{display:block}.settings-tab-section .field-row-cloudinary_url td,.settings-tab-section .field-row-cloudinary_url th,.settings-tab-section .field-row-signup td,.settings-tab-section .field-row-signup th{display:block;padding:10px 0 0;width:auto}.settings-tab-section .field-row-cloudinary_url td .sign-up,.settings-tab-section .field-row-cloudinary_url th .sign-up,.settings-tab-section .field-row-signup td .sign-up,.settings-tab-section .field-row-signup th .sign-up{vertical-align:baseline}.settings-tab-section.connect .form-table{display:inline-block;max-width:580px;width:auto}.settings-valid{color:#558b2f;font-size:30px}.settings-valid-field{border-color:#558b2f!important}.settings-invalid-field{border-color:#dd2c00!important}.settings-alert{box-shadow:0 1px 1px rgba(0,0,0,.04);display:inline-block;padding:5px 7px}.settings-alert-info{background-color:#e9faff;border:1px solid #ccd0d4;border-left:4px solid #00a0d2}.settings-alert-warning{background-color:#fff5e9;border:1px solid #f6e7b6;border-left:4px solid #e3be38}.settings-alert-error{background-color:#ffe9e9;border:1px solid #d4cccc;border-left:4px solid #d20000}.field-radio input[type=radio].cld-field{margin:0 5px 0 0}.field-radio label{margin-right:10px}.settings-tab-section h2{margin:0}.cloudinary-collapsible{background-color:#fff;border:1px solid #ccd0d4;box-shadow:0 1px 1px rgba(0,0,0,.04);box-sizing:border-box;margin:20px 0;padding:10px;width:95%}.cloudinary-collapsible__toggle{cursor:pointer;display:flex;justify-content:space-between}.cloudinary-collapsible__toggle h2{margin:0!important}.cloudinary-collapsible__toggle button{background-color:inherit;border:none;cursor:pointer;margin:0;padding:0;width:auto}.cloudinary-deactivation .more{display:none}.cloudinary-deactivation input[type=radio]:checked~.more{color:#32373c;display:block;line-height:2;margin-left:2em;margin-top:.5em}.cloudinary-deactivation input[type=checkbox]~label{margin-left:.25em}.cloudinary-deactivation .modal-footer{background-color:#fcfcfc;border-top:1px solid #ddd;bottom:0;margin:0 -15px;padding:1em;position:absolute;width:calc(100% - 2em)}.cloudinary-deactivation .modal-footer .button-link{float:right}.cloudinary-deactivation .modal-footer .button-link:hover{background:transparent}.cloudinary-deactivation textarea{resize:none}.cloudinary-deactivation p{display:flex}.sync .spinner{display:inline-block;float:none;margin:0 5px 0 0;visibility:visible}.sync-media,.sync-media-progress{display:none}.sync-media-progress-outer{background-color:#e5e5e5;height:20px;margin:20px 0 10px;position:relative;width:500px}.sync-media-progress-outer .progress-bar{background-color:#558b2f;height:20px;transition:width .25s;width:0}.sync-media-progress-notice{color:#dd2c00}.sync-media-resource{display:inline-block;width:100px}.sync-media-error{color:#dd2c00}.sync-count{font-weight:700}.sync-details{margin-top:10px}.sync .button.start-sync,.sync .button.stop-sync{display:none;padding:0 16px}.sync .button.start-sync .dashicons,.sync .button.stop-sync .dashicons{line-height:2.2}.sync .progress-text{display:inline-block;font-weight:700;padding:12px 4px 12px 12px}.sync .completed{display:none;max-width:300px}.sync-status-disabled{color:#dd2c00}.sync-status-enabled{color:#558b2f}.sync-status-button.button{vertical-align:baseline}.cloudinary-widget{height:100%}.cloudinary-widget-wrapper{background-image:url(data:image/svg+xml;base64,PHN2ZyBjbGFzcz0ic3Bpbm5lciIgdmlld0JveD0iLTQgLTQgMTUxIDEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+PCFbQ0RBVEFbCiAgICAgIEBrZXlmcmFtZXMgY29sb3JzIHsKICAgICAgICAwJSB7IHN0cm9rZTogIzAwNzhGRjsgfQogICAgICAgICAgNTAlIHsgc3Ryb2tlOiAjMGUyZjVhOyB9CiAgICAgICAgICAxMDAlIHsgc3Ryb2tlOiAjMDA3OEZGOyB9CiAgICAgIH0KCiAgICAgIEBrZXlmcmFtZXMgZGFzaCB7CiAgICAgICAwJSB7IHN0cm9rZS1kYXNob2Zmc2V0OiA1NjA7IH0KICAgICAgIDUwJSB7CiAgICAgICAgICBzdHJva2UtZGFzaG9mZnNldDogMDsKICAgICAgIH0KICAgICAgIDEwMCUgeyAgIHN0cm9rZS1kYXNob2Zmc2V0OiA1NjA7IH0KICAgICAgfQogICAgICBALXdlYmtpdC1rZXlmcmFtZXMgY29sb3JzIHsKICAgICAgICAwJSB7IHN0cm9rZTogIzAwNzhmZjsgfQogICAgICAgICAgNTAlIHsgc3Ryb2tlOiAjMGUyZjVhOyB9CiAgICAgICAgICAxMDAlIHsgc3Ryb2tlOiAjMDA3OGZmOyB9CiAgICAgIH0KCiAgICAgIEAtd2Via2l0LWtleWZyYW1lcyBkYXNoIHsKICAgICAgIDAlIHsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDU2MDsgfQogICAgICAgNTAlIHsKICAgICAgICAgIHN0cm9rZS1kYXNob2Zmc2V0OiAwOwogICAgICAgfQogICAgICAgMTAwJSB7ICAgc3Ryb2tlLWRhc2hvZmZzZXQ6IDU2MDsKICAgICAgIH0KICAgICAgfQogICAgICAucGF0aCB7CiAgICAgICAgc3Ryb2tlLWRhc2hhcnJheTogMjgwOwogICAgICAgIHN0cm9rZS1kYXNob2Zmc2V0OiAwOwogICAgICAgIHRyYW5zZm9ybS1vcmlnaW46IGNlbnRlcjsKICAgICAgICAtd2Via2l0LWFuaW1hdGlvbjoKICAgICAgICAgIGRhc2ggMnMgZWFzZS1pbi1vdXQgaW5maW5pdGUsIGNvbG9ycyA4cyBlYXNlLWluLW91dCBpbmZpbml0ZTsKICAgICAgICBhbmltYXRpb246CiAgICAgICAgICBkYXNoIDJzIGVhc2UtaW4tb3V0IGluZmluaXRlLCBjb2xvcnMgOHMgZWFzZS1pbi1vdXQgaW5maW5pdGU7CiAgICAgIH0KICAgIF1dPjwvc3R5bGU+CiAgPHBhdGggY2xhc3M9InBhdGgiIGQ9Ik0xMjEuNjYzIDkwLjYzOGMtMS43OTYgMC05OS4zMy0uNDk4LTEwMS40NzQtMS40NzhDOC42ODUgODMuODc3IDEuMjUgNzIuMTk2IDEuMjUgNTkuMzk2YzAtMTYuNjU2IDEyLjc5Ny0zMC42MSAyOS4wNTItMzIuMzIzIDcuNDktMTUuNzA2IDIzLjE4Ni0yNS43MDcgNDAuNzE0LTI1LjcwNyAyMC45OCAwIDM5LjIxNSAxNC43NTIgNDMuOTQ1IDM0LjkwNyAxNS4wOS4yNDUgMjcuMjkgMTIuNjMgMjcuMjkgMjcuODIyIDAgMTEuOTY4LTcuNzM4IDIyLjU1LTE5LjI1NiAyNi4zMyIgc3Ryb2tlLXdpZHRoPSI5IiBzdHJva2UtbGluZWNhcD0icm91bmQiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPgo8L3N2Zz4K);background-position:50%;background-repeat:no-repeat;background-size:150px;height:100%;overflow:hidden}.attachment-actions .button.edit-attachment,.attachment-info .edit-attachment{display:none}.global-transformations-preview{max-width:600px;position:relative}.global-transformations-spinner{display:none}.global-transformations-button.button-primary{display:none;position:absolute;z-index:100}.global-transformations-url{margin-bottom:5px;margin-top:5px}.global-transformations-url-transformation{color:#51a3ff;max-width:100px;overflow:hidden;text-overflow:ellipsis}.global-transformations-url-file{color:#f2d864}.global-transformations-url-link{background-color:#262c35;border-radius:6px;color:#fff;display:block;overflow:hidden;padding:16px;text-decoration:none;text-overflow:ellipsis}.global-transformations-url-link:hover{color:#888;text-decoration:underline}.cld-tax-order-list-item{background-color:#fff;border:1px solid #efefef;margin:0 0 -1px;padding:4px}.cld-tax-order-list-item.no-items{color:#888;display:none;text-align:center}.cld-tax-order-list-item.no-items:last-child{display:block}.cld-tax-order-list-item.ui-sortable-helper{box-shadow:0 2px 5px rgba(0,0,0,.2)}.cld-tax-order-list-item-placeholder{background-color:#efefef;height:45px;margin:0}.cld-tax-order-list-item-handle{color:#999;cursor:grab;margin-right:4px}.cld-tax-order-list-type{display:inline-block;margin-right:8px}.cld-tax-order-list-type input{margin-right:4px!important}.cloudinary-media-library{margin-left:-20px;position:relative}@media screen and (max-width:782px){.cloudinary-media-library{margin-left:-10px}}.cld-pagenav{color:#555;line-height:2.4em;margin-top:5px;text-align:right}.cld-pagenav-text{margin:0 2em}.cld-delete{color:#dd2c00;cursor:pointer;float:right}.cld-apply-action{float:right}.cld-table thead tr th.cld-table-th{line-height:1.8em}.cld-loading{background-image:url(data:image/svg+xml;base64,PHN2ZyBjbGFzcz0ic3Bpbm5lciIgdmlld0JveD0iLTQgLTQgMTUxIDEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+PCFbQ0RBVEFbCiAgICAgIEBrZXlmcmFtZXMgY29sb3JzIHsKICAgICAgICAwJSB7IHN0cm9rZTogIzAwNzhGRjsgfQogICAgICAgICAgNTAlIHsgc3Ryb2tlOiAjMGUyZjVhOyB9CiAgICAgICAgICAxMDAlIHsgc3Ryb2tlOiAjMDA3OEZGOyB9CiAgICAgIH0KCiAgICAgIEBrZXlmcmFtZXMgZGFzaCB7CiAgICAgICAwJSB7IHN0cm9rZS1kYXNob2Zmc2V0OiA1NjA7IH0KICAgICAgIDUwJSB7CiAgICAgICAgICBzdHJva2UtZGFzaG9mZnNldDogMDsKICAgICAgIH0KICAgICAgIDEwMCUgeyAgIHN0cm9rZS1kYXNob2Zmc2V0OiA1NjA7IH0KICAgICAgfQogICAgICBALXdlYmtpdC1rZXlmcmFtZXMgY29sb3JzIHsKICAgICAgICAwJSB7IHN0cm9rZTogIzAwNzhmZjsgfQogICAgICAgICAgNTAlIHsgc3Ryb2tlOiAjMGUyZjVhOyB9CiAgICAgICAgICAxMDAlIHsgc3Ryb2tlOiAjMDA3OGZmOyB9CiAgICAgIH0KCiAgICAgIEAtd2Via2l0LWtleWZyYW1lcyBkYXNoIHsKICAgICAgIDAlIHsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDU2MDsgfQogICAgICAgNTAlIHsKICAgICAgICAgIHN0cm9rZS1kYXNob2Zmc2V0OiAwOwogICAgICAgfQogICAgICAgMTAwJSB7ICAgc3Ryb2tlLWRhc2hvZmZzZXQ6IDU2MDsKICAgICAgIH0KICAgICAgfQogICAgICAucGF0aCB7CiAgICAgICAgc3Ryb2tlLWRhc2hhcnJheTogMjgwOwogICAgICAgIHN0cm9rZS1kYXNob2Zmc2V0OiAwOwogICAgICAgIHRyYW5zZm9ybS1vcmlnaW46IGNlbnRlcjsKICAgICAgICAtd2Via2l0LWFuaW1hdGlvbjoKICAgICAgICAgIGRhc2ggMnMgZWFzZS1pbi1vdXQgaW5maW5pdGUsIGNvbG9ycyA4cyBlYXNlLWluLW91dCBpbmZpbml0ZTsKICAgICAgICBhbmltYXRpb246CiAgICAgICAgICBkYXNoIDJzIGVhc2UtaW4tb3V0IGluZmluaXRlLCBjb2xvcnMgOHMgZWFzZS1pbi1vdXQgaW5maW5pdGU7CiAgICAgIH0KICAgIF1dPjwvc3R5bGU+CiAgPHBhdGggY2xhc3M9InBhdGgiIGQ9Ik0xMjEuNjYzIDkwLjYzOGMtMS43OTYgMC05OS4zMy0uNDk4LTEwMS40NzQtMS40NzhDOC42ODUgODMuODc3IDEuMjUgNzIuMTk2IDEuMjUgNTkuMzk2YzAtMTYuNjU2IDEyLjc5Ny0zMC42MSAyOS4wNTItMzIuMzIzIDcuNDktMTUuNzA2IDIzLjE4Ni0yNS43MDcgNDAuNzE0LTI1LjcwNyAyMC45OCAwIDM5LjIxNSAxNC43NTIgNDMuOTQ1IDM0LjkwNyAxNS4wOS4yNDUgMjcuMjkgMTIuNjMgMjcuMjkgMjcuODIyIDAgMTEuOTY4LTcuNzM4IDIyLjU1LTE5LjI1NiAyNi4zMyIgc3Ryb2tlLXdpZHRoPSI5IiBzdHJva2UtbGluZWNhcD0icm91bmQiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPgo8L3N2Zz4K);background-position:50%;background-repeat:no-repeat;background-size:50px 50px;height:100px;width:auto}.cld-loading.tree-branch{background-position:25px;background-size:50px 50px}.cld-syncing{background:url(../css/loading.svg) no-repeat 50%;display:inline-block;height:20px;margin-left:12px;padding:4px;width:30px}.cld-footer{bottom:0;color:#555d66;left:0;padding:0;position:absolute;right:0}@media only screen and (min-width:783px){.cld-footer{margin-left:36px}}@media only screen and (min-width:960px){.cld-footer{margin-left:160px}}.cld-footer .cld-notice-box.is-success{background-color:#fff;border:0;color:#555;margin:0;padding:0}.cld-footer .cld-notice-box.is-success .cld-stars{margin-left:12px;text-decoration:none}.cld-footer .cld-notice-box.is-success .cld-stars .dashicons{color:#fd9d2c;position:inherit}.cld-footer .notice-dismiss:before{content:"";font-size:1.4rem;padding:6px 0 0}.cld-tooltip{font-size:1rem;margin-left:2px;margin-top:1px}.cld-notice-box{box-shadow:0 0 2px rgba(0,0,0,.1);margin-bottom:12px;margin-right:20px;position:relative}.cld-notice-box .cld-notice{padding:1rem 2.2rem .75rem 1.2rem}.cld-notice-box .cld-notice img.cld-ui-icon{height:100%}.cld-notice-box.is-dismissible{padding-right:38px}.cld-notice-box.has-icon{padding-left:38px}.cld-notice-box.is-created,.cld-notice-box.is-success,.cld-notice-box.is-updated{background-color:#ebf5ec;border-left:4px solid #42ad4f}.cld-notice-box.is-created .dashicons,.cld-notice-box.is-success .dashicons,.cld-notice-box.is-updated .dashicons{color:#2a0}.cld-notice-box.is-error{background-color:#f8e8e7;border-left:4px solid #cb3435}.cld-notice-box.is-error .dashicons{color:#dd2c00}.cld-notice-box.is-warning{background-color:#fff7e5;border-left:4px solid #f2ad4c}.cld-notice-box.is-warning .dashicons{color:#fd9d2c}.cld-notice-box.is-info{background-color:#e4f4f8;border-left:4px solid #2a95c3}.cld-notice-box.is-info .dashicons{color:#3273ab}.cld-notice-box.is-neutral{background-color:#fff;border-left:4px solid #ccd0d4}.cld-notice-box.is-neutral .dashicons{color:#90a0b3}.cld-notice-box.dismissed{overflow:hidden;transition:height .3s ease-out}.cld-notice-box .cld-ui-icon,.cld-notice-box .dashicons{left:19px;position:absolute;top:14px}.cld-ui-collapse{align-self:center;cursor:pointer;padding:0 .45rem}.cld-ui-title.collapsible{cursor:pointer}.cld-ui-conditional .closed,.cld-ui-wrap .closed{display:none}.cld-ui-wrap .cld-row{clear:both;margin:0 -1.75em}.cld-ui-wrap .cld-column{box-sizing:border-box;float:left;padding:0 1.75em;width:100%}@media only screen and (min-width:783px){.cld-ui-wrap .cld-column.column-45{width:45%}.cld-ui-wrap .cld-column.column-55{width:55%}}.cld-ui-wrap .cld-row:after{clear:both;content:"";display:table}.cld-image-preview,.cld-video-preview{background-color:hsla(0,0%,84.7%,.5);border-radius:5px;padding:7px}.cld-image-preview-wrapper,.cld-video-preview-wrapper{position:relative}.cld-image-preview .cld-ui-title,.cld-video-preview .cld-ui-title{font-weight:400;margin:0 0 .4rem}.cld-image-preview img,.cld-video-preview img{width:100%}.cld-page-header{align-items:center;margin-bottom:1em;padding:1.2rem}.cld-page-header,.cld-page-tabs{background-color:#fff;display:flex;margin-left:-20px}.cld-page-tabs{border-bottom:1px solid #e5e5e5;border-top:1px solid #e5e5e5;flex-wrap:wrap;margin-top:-1em;padding:0 1rem}.cld-page-tabs-tab{list-style:none;margin-bottom:0;text-indent:0}.cld-page-tabs-tab a{color:#000001;display:block;font-weight:500;padding:1rem 2rem;text-align:center;text-decoration:none;white-space:nowrap}.cld-page-tabs-tab.is-active a{border-bottom:2px solid #3273ab;color:#3273ab}.cld-group hr{border-top:1px solid #e5e5e5;clear:both;margin:1.5rem 0}.cld-group-heading{display:flex;justify-content:space-between}.cld-group-heading h3{font-size:.9rem}.cld-group-heading h3 .description{font-size:.7rem;font-weight:400;margin-left:.7em}.cld-input{display:block;margin-bottom:1.4rem}.cld-input-label{display:block;font-weight:700}.cld-input .regular-number,.cld-input .regular-text{border:1px solid #d0d0d0;border-radius:3px;padding:.1rem .5rem;width:100%}.cld-input .regular-number-small,.cld-input .regular-text-small{width:40%}.cld-input .prefixed{margin-left:6px;width:40%}.cld-input .suffixed{margin-right:6px;width:40%}.cld-input .regular-number{width:100px}.cld-input .regular-select{appearance:none;border:1px solid #d0d0d0;border-radius:3px;display:block;margin-top:.6rem;padding:.1rem .5rem;width:100%}.cld-input-on-off{align-items:center;display:inline-flex}.cld-input-on-off .description{margin:0}.cld-input-on-off .description.left{margin-left:0;margin-right:.4rem}.cld-input-on-off-control{display:inline-block;height:20px;margin-right:.4rem;position:relative;width:40px}.cld-input-on-off-control.disabled{opacity:.4}.cld-input-on-off-control input{height:0;opacity:0;width:0}.cld-input-on-off-control-slider{background-color:#90a0b3;border-radius:34px;bottom:0;cursor:pointer;left:0;position:absolute;right:0;top:0;transition:background-color .3s}input:checked+.cld-input-on-off-control-slider{background-color:#2a0!important}input:checked.partial+.cld-input-on-off-control-slider{background-color:#fd9d2c!important}input:checked.delete+.cld-input-on-off-control-slider{background-color:#dd2c00!important}.cld-input-on-off-control-slider:before{background-color:#fff;border-radius:50%;bottom:2px;content:"";display:block;height:16px;left:2px;position:absolute;transition:transform .2s;width:16px}input:checked+.cld-input-on-off-control-slider:before{transform:translateX(20px)}.mini input:checked+.cld-input-on-off-control-slider:before{transform:translateX(10px)}.cld-input-on-off-control.mini{height:10px;width:20px}.mini .cld-input-on-off-control-slider:before{bottom:1px;height:8px;left:1px;width:8px}.cld-input-icon-toggle{align-items:center;display:inline-flex}.cld-input-icon-toggle .description{margin:0 0 0 .4rem}.cld-input-icon-toggle .description.left{margin-left:0;margin-right:.4rem}.cld-input-icon-toggle-control{display:inline-block;position:relative}.cld-input-icon-toggle-control input{height:0;opacity:0;position:absolute;width:0}.cld-input-icon-toggle-control-slider .icon-on{display:none;visibility:hidden}.cld-input-icon-toggle-control-slider .icon-off,input:checked+.cld-input-icon-toggle-control-slider .icon-on{display:inline-block;visibility:visible}input:checked+.cld-input-icon-toggle-control-slider .icon-off{display:none;visibility:hidden}.cld-input-checkbox-label,.cld-input-radio-label{display:block;margin-bottom:.4rem}.cld-input-checkbox-label.list-inline,.cld-input-radio-label.list-inline{display:inline-block;margin-right:.4rem}.cld-info-box,.cld-panel,.cld-panel-short,.cld-submit,.cld-switch-cloud{background-color:#fff;border:1px solid #e5e5e5;margin-right:1rem;max-width:870px}.cld-info-box.full-width,.cld-panel-short.full-width,.cld-panel.full-width,.cld-submit.full-width,.cld-switch-cloud.full-width{max-width:100%}.cld-submit,.cld-switch-cloud{border-top:0;padding:1.2rem 1.75rem}.cld-info-box,.cld-panel,.cld-panel-short{margin-top:1rem;padding:2rem 1.75rem}.cld-info-box-inner,.cld-panel-inner,.cld-panel-short-inner{background-color:hsla(0,0%,86.3%,.2);border:1px solid #e5e5e5;margin:1em 0;padding:1.3rem}.cld-info-box-inner h2,.cld-panel-inner h2,.cld-panel-short-inner h2{color:#3273ab}.cld-info-box .cld-input-label,.cld-panel-short .cld-input-label,.cld-panel .cld-input-label{margin-bottom:.6rem}.cld-info-box.has-heading,.cld-panel-short.has-heading,.cld-panel.has-heading{border-top:0;margin-top:0}.cld-info-box-heading,.cld-panel-heading,.cld-panel-short-heading{display:flex;padding:.4rem 1.75rem .2rem;position:relative}.cld-info-box-heading.full-width,.cld-panel-heading.full-width,.cld-panel-short-heading.full-width{max-width:100%}.cld-info-box-heading img,.cld-panel-heading img,.cld-panel-short-heading img{margin-right:.6rem}.cld-info-box-heading.collapsible,.cld-panel-heading.collapsible,.cld-panel-short-heading.collapsible{cursor:pointer}.cld-info-box ul,.cld-panel-short ul,.cld-panel ul{list-style:initial;padding:0 3em}.cld-info-box .cld-plan,.cld-panel-short .cld-plan,.cld-panel .cld-plan{color:#3273ab;font-size:1.5em;font-weight:700}.cld-info-box .stat-boxes,.cld-panel-short .stat-boxes,.cld-panel .stat-boxes{border:1px solid #e5e5e5;font-size:1.2em}.cld-info-box .stat-boxes .box,.cld-panel-short .stat-boxes .box,.cld-panel .stat-boxes .box{border-bottom:1px solid #e5e5e5;padding:2rem;text-align:center}.cld-info-box .stat-boxes .box:last-of-type,.cld-panel-short .stat-boxes .box:last-of-type,.cld-panel .stat-boxes .box:last-of-type{border-bottom:none}.cld-info-box .stat-boxes .box .cld-ui-icon,.cld-panel-short .stat-boxes .box .cld-ui-icon,.cld-panel .stat-boxes .box .cld-ui-icon{height:35px;width:35px}.cld-info-box .stat-boxes .icon,.cld-panel-short .stat-boxes .icon,.cld-panel .stat-boxes .icon{height:50px;margin-right:.5em;width:50px}.cld-info-box .stat-boxes h3,.cld-panel-short .stat-boxes h3,.cld-panel .stat-boxes h3{margin-bottom:1.5rem;margin-top:2.4rem}.cld-info-box .stat-boxes .limit,.cld-panel-short .stat-boxes .limit,.cld-panel .stat-boxes .limit{font-size:2em;font-weight:700;margin-right:.5em;white-space:nowrap}.cld-info-box .stat-boxes .usage,.cld-panel-short .stat-boxes .usage,.cld-panel .stat-boxes .usage{color:#3273ab;font-size:1.5em;font-weight:400}@media only screen and (min-width:783px){.cld-info-box .stat-boxes,.cld-panel-short .stat-boxes,.cld-panel .stat-boxes{display:flex;flex-wrap:nowrap;font-size:1em}.cld-info-box .stat-boxes .box,.cld-panel-short .stat-boxes .box,.cld-panel .stat-boxes .box{border-bottom:none;border-right:1px solid #e5e5e5;flex-grow:1}.cld-info-box .stat-boxes .box:last-of-type,.cld-panel-short .stat-boxes .box:last-of-type,.cld-panel .stat-boxes .box:last-of-type{border-right:none}}@media only screen and (min-width:1200px){.cld-info-box .stat-boxes,.cld-panel-short .stat-boxes,.cld-panel .stat-boxes{font-size:1.2em}}.cld-info-box .img-connection-string,.cld-panel-short .img-connection-string,.cld-panel .img-connection-string{max-width:607px;width:100%}.cld-info-box .connection-string,.cld-panel-short .connection-string,.cld-panel .connection-string{max-width:40em;width:100%}.cld-info-box .media-status-box,.cld-info-box .stat-boxes,.cld-panel-short .media-status-box,.cld-panel-short .stat-boxes,.cld-panel .media-status-box,.cld-panel .stat-boxes{border:1px solid #e5e5e5}.cld-info-box .media-status-box,.cld-panel-short .media-status-box,.cld-panel .media-status-box{padding:2rem;text-align:center}.cld-info-box .media-status-box .status,.cld-panel-short .media-status-box .status,.cld-panel .media-status-box .status{font-size:2rem;font-weight:700;margin-right:.5em}.cld-info-box .media-status-box .cld-ui-icon,.cld-panel-short .media-status-box .cld-ui-icon,.cld-panel .media-status-box .cld-ui-icon{height:35px;width:35px}.cld-info-box .notification,.cld-panel-short .notification,.cld-panel .notification{display:inline-flex;font-weight:700;padding:1.5rem}.cld-info-box .notification-success,.cld-panel-short .notification-success,.cld-panel .notification-success{background-color:rgba(32,184,50,.2);border:2px solid #20b832}.cld-info-box .notification-success:before,.cld-panel-short .notification-success:before,.cld-panel .notification-success:before{color:#20b832}.cld-info-box .notification-syncing,.cld-panel-short .notification-syncing,.cld-panel .notification-syncing{background-color:rgba(50,115,171,.2);border:2px solid #3273ab;color:#444;text-decoration:none}.cld-info-box .notification-syncing:before,.cld-panel-short .notification-syncing:before,.cld-panel .notification-syncing:before{-webkit-animation:spin 1s infinite running;-moz-animation:spin 1s linear infinite;animation:spin 1s linear infinite;color:#3273ab}@keyframes spin{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.cld-info-box .notification:before,.cld-panel-short .notification:before,.cld-panel .notification:before{margin-right:.5em}.cld-info-box{display:flex;flex-direction:column}@media only screen and (min-width:783px){.cld-info-box{flex-direction:row}}.cld-info-box a.button,.cld-info-box img{align-self:center}.cld-info-box .cld-ui-body{margin:0 1.2rem}.cld-panel-short{display:inline-block;min-width:270px;width:auto}.cld-gallery-settings{box-sizing:border-box;display:flex;flex-wrap:wrap;padding:1rem 0;width:100%}@media only screen and (min-width:960px){.cld-gallery-settings{margin-left:-1rem;margin-right:-1rem}}.cld-gallery-settings__column{box-sizing:border-box;width:100%}@media only screen and (min-width:960px){.cld-gallery-settings__column{padding-left:1rem;padding-right:1rem;width:50%}}.components-base-control__field select{display:block;margin:1rem 0}.components-range-control__wrapper{margin:0!important}.components-range-control__root{flex-direction:row-reverse;margin:1rem 0}.components-input-control.components-number-control.components-range-control__number{margin-left:0!important;margin-right:16px}.components-panel{border:0!important}.components-panel__body:first-child{border-top:0!important}.components-panel__body:last-child{border-bottom:0!important}.components-textarea-control__input{display:block;margin:.5rem 0;width:100%}.tippy-box[data-theme~=cloudinary]{background-color:rgba(0,0,0,.8);color:#fff;font-size:.8em}table .cld-input{margin-bottom:0}tr .file-size.small{color:#a8a8a8;font-size:.8em;font-style:italic;letter-spacing:.4px;margin-left:6px;margin-right:6px}td.tree{color:#212529;line-height:1.5;padding-top:0;position:relative}td.tree ul.striped>:nth-child(odd){background-color:#f6f7f7}td.tree ul.striped>:nth-child(2n){background-color:#fff}td.tree .success{color:#20b832}td+td.tree{padding-top:0}td.tree .cld-input{margin-bottom:0;vertical-align:text-bottom}td.tree .cld-search{font-size:.9em;height:26px;margin-right:12px;min-height:20px;padding:4px 6px;vertical-align:initial}td.tree .file-size{color:#a8a8a8;font-size:.8em;font-style:italic;letter-spacing:.4px;margin-left:6px}td.tree .fa-folder,td.tree .fa-folder-open{color:#007bff}td.tree .fa-html5{color:#f21f10}td.tree ul{list-style:none;margin:0;padding-left:5px}td.tree ul li{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin-bottom:0;padding-bottom:5px;padding-left:25px;padding-top:5px;position:relative}td.tree ul li:before{height:1px;margin:auto;top:14px;width:20px}td.tree ul li:after,td.tree ul li:before{background-color:#666;content:"";left:0;position:absolute}td.tree ul li:after{bottom:0;height:100%;top:0;width:1px}td.tree ul li:after:nth-of-type(odd){background-color:#666}td.tree ul li:last-child:after{height:14px}td.tree ul a{cursor:pointer}td.tree ul a:hover{text-decoration:none} \ No newline at end of file +.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{background-color:#333;border-radius:4px;color:#fff;font-size:14px;line-height:1.4;outline:0;position:relative;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{border-top-color:initial;border-width:8px 8px 0;bottom:-7px;left:0;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:initial;border-width:0 8px 8px;left:0;top:-7px;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-left-color:initial;border-width:8px 0 8px 8px;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{border-right-color:initial;border-width:8px 8px 8px 0;left:-7px;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{color:#333;height:16px;width:16px}.tippy-arrow:before{border-color:transparent;border-style:solid;content:"";position:absolute}.tippy-content{padding:5px 9px;position:relative;z-index:1}@font-face{font-family:cloudinary;font-style:normal;font-weight:500;src:url(../css/fonts/cloudinary.7e6e75b25255a2b3b6e7ced1092c210c.eot);src:url(../css/fonts/cloudinary.7e6e75b25255a2b3b6e7ced1092c210c.eot#iefix) format("embedded-opentype"),url(../css/fonts/cloudinary.34cb260ad722325c597cdc3a3e7584d8.woff) format("woff"),url(../css/fonts/cloudinary.c2afda9d25532c03cd41beb20a1ce439.ttf) format("truetype"),url(../css/cloudinary.svg#cloudinary) format("svg")}.dashicons-cloudinary{speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-style:normal;font-variant:normal;font-weight:400;line-height:1;text-transform:none}.dashicons-cloudinary:before{content:"";font-family:cloudinary,monospace!important}.dashicons-cloudinary.success{color:#558b2f}.dashicons-cloudinary.error{color:#dd2c00}.dashicons-cloudinary.error:before{content:""}.dashicons-cloudinary.uploading{color:#fd9d2c}.dashicons-cloudinary.uploading:before{content:""}.dashicons-cloudinary.info{color:#0071ba}.dashicons-cloudinary.downloading:before{content:""}.dashicons-cloudinary.syncing:before{content:""}.column-cld_status{width:5.5em}.column-cld_status .dashicons-cloudinary{display:inline-block}.column-cld_status .dashicons-cloudinary:before{font-size:1.8rem}.form-field .error-notice,.form-table .error-notice{color:#dd2c00;display:none}.form-field input.cld-field:invalid,.form-table input.cld-field:invalid{border-color:#dd2c00}.form-field input.cld-field:invalid+.error-notice,.form-table input.cld-field:invalid+.error-notice{display:inline-block}.cloudinary-welcome{background-image:url(../css/logo.svg);background-position:top 12px right 20px;background-repeat:no-repeat;background-size:153px}.cloudinary-stats{display:inline-block;margin-left:25px}.cloudinary-stat{cursor:help}.cloudinary-percent{color:#0071ba;font-size:.8em;vertical-align:top}.settings-image{max-width:100%;padding-top:5px}.settings-tabs>li{display:inline-block}.settings-tabs>li a{padding:.6em}.settings-tabs>li a.active{background-color:#fff}.settings-tab-section{max-width:1030px;padding:20px 0 0;position:relative}.settings-tab-section.cloudinary-welcome .settings-tab-section-fields-dashboard{align-content:flex-start;align-items:flex-start;display:flex;margin-top:40px}.settings-tab-section.cloudinary-welcome .settings-tab-section-fields-dashboard-description{margin:0 auto 0 0;width:55%}.settings-tab-section.cloudinary-welcome .settings-tab-section-fields-dashboard-content{margin:0 auto;width:35%}.settings-tab-section.cloudinary-welcome .settings-tab-section-fields-dashboard-content .dashicons{color:#9ea3a8}.settings-tab-section.cloudinary-welcome .settings-tab-section-card{margin-top:0}.settings-tab-section-fields .field-heading th{color:#23282d;display:block;font-size:1.1em;margin:1em 0;width:auto}.settings-tab-section-fields .field-heading td{display:none;visibility:hidden}.settings-tab-section-fields .regular-textarea{height:60px;width:100%}.settings-tab-section-fields .dashicons{text-decoration:none;vertical-align:middle}.settings-tab-section-fields a .dashicons{color:#5f5f5f}.settings-tab-section-fields-dashboard-error{color:#5f5f5f;font-size:1.2em}.settings-tab-section-fields-dashboard-error.expanded{margin-bottom:25px;padding-top:40px}.settings-tab-section-fields-dashboard-error .dashicons{color:#ac0000}.settings-tab-section-fields-dashboard-error .button{font-size:1.1em;height:40px;line-height:40px;padding-left:40px;padding-right:40px}.settings-tab-section-fields-dashboard-success{color:#23282d;font-size:1.2em}.settings-tab-section-fields-dashboard-success.expanded{margin-bottom:25px;padding-top:40px}.settings-tab-section-fields-dashboard-success .dashicons{color:#4fb651}.settings-tab-section-fields-dashboard-success .button{font-size:1.1em;height:40px;line-height:40px;padding-left:40px;padding-right:40px}.settings-tab-section-fields-dashboard-success .description{color:#5f5f5f;font-weight:400;margin-top:12px}.settings-tab-section-card{background-color:#fff;border:1px solid #e5e5e5;box-shadow:0 1px 1px 0 rgba(0,0,0,.07);box-sizing:border-box;margin-top:12px;padding:20px 23px}.settings-tab-section-card .dashicons{font-size:1.4em}.settings-tab-section-card h2{font-size:1.8em;font-weight:400;margin-top:0}.settings-tab-section-card.pull-right{float:right;padding:12px;position:relative;width:450px;z-index:10}.settings-tab-section-card.pull-right img.settings-image{border:1px solid #979797;box-shadow:0 2px 4px 0 rgba(0,0,0,.5);margin-top:12px}.settings-tab-section-card.pull-right h3,.settings-tab-section-card.pull-right h4{margin-top:0}.settings-tab-section .field-row-cloudinary_url,.settings-tab-section .field-row-signup{display:block}.settings-tab-section .field-row-cloudinary_url td,.settings-tab-section .field-row-cloudinary_url th,.settings-tab-section .field-row-signup td,.settings-tab-section .field-row-signup th{display:block;padding:10px 0 0;width:auto}.settings-tab-section .field-row-cloudinary_url td .sign-up,.settings-tab-section .field-row-cloudinary_url th .sign-up,.settings-tab-section .field-row-signup td .sign-up,.settings-tab-section .field-row-signup th .sign-up{vertical-align:baseline}.settings-tab-section.connect .form-table{display:inline-block;max-width:580px;width:auto}.settings-valid{color:#558b2f;font-size:30px}.settings-valid-field{border-color:#558b2f!important}.settings-invalid-field{border-color:#dd2c00!important}.settings-alert{box-shadow:0 1px 1px rgba(0,0,0,.04);display:inline-block;padding:5px 7px}.settings-alert-info{background-color:#e9faff;border:1px solid #ccd0d4;border-left:4px solid #00a0d2}.settings-alert-warning{background-color:#fff5e9;border:1px solid #f6e7b6;border-left:4px solid #e3be38}.settings-alert-error{background-color:#ffe9e9;border:1px solid #d4cccc;border-left:4px solid #d20000}.field-radio input[type=radio].cld-field{margin:0 5px 0 0}.field-radio label{margin-right:10px}.settings-tab-section h2{margin:0}.cloudinary-collapsible{background-color:#fff;border:1px solid #ccd0d4;box-shadow:0 1px 1px rgba(0,0,0,.04);box-sizing:border-box;margin:20px 0;padding:10px;width:95%}.cloudinary-collapsible__toggle{cursor:pointer;display:flex;justify-content:space-between}.cloudinary-collapsible__toggle h2{margin:0!important}.cloudinary-collapsible__toggle button{background-color:inherit;border:none;cursor:pointer;margin:0;padding:0;width:auto}.cloudinary-deactivation .more{display:none}.cloudinary-deactivation input[type=radio]:checked~.more{color:#32373c;display:block;line-height:2;margin-left:2em;margin-top:.5em}.cloudinary-deactivation input[type=checkbox]~label{margin-left:.25em}.cloudinary-deactivation .modal-footer{background-color:#fcfcfc;border-top:1px solid #ddd;bottom:0;margin:0 -15px;padding:1em;position:absolute;width:calc(100% - 2em)}.cloudinary-deactivation .modal-footer .button-link{float:right}.cloudinary-deactivation .modal-footer .button-link:hover{background:transparent}.cloudinary-deactivation textarea{resize:none}.cloudinary-deactivation p{display:flex}.sync .spinner{display:inline-block;float:none;margin:0 5px 0 0;visibility:visible}.sync-media,.sync-media-progress{display:none}.sync-media-progress-outer{background-color:#e5e5e5;height:20px;margin:20px 0 10px;position:relative;width:500px}.sync-media-progress-outer .progress-bar{background-color:#558b2f;height:20px;transition:width .25s;width:0}.sync-media-progress-notice{color:#dd2c00}.sync-media-resource{display:inline-block;width:100px}.sync-media-error{color:#dd2c00}.sync-count{font-weight:700}.sync-details{margin-top:10px}.sync .button.start-sync,.sync .button.stop-sync{display:none;padding:0 16px}.sync .button.start-sync .dashicons,.sync .button.stop-sync .dashicons{line-height:2.2}.sync .progress-text{display:inline-block;font-weight:700;padding:12px 4px 12px 12px}.sync .completed{display:none;max-width:300px}.sync-status-disabled{color:#dd2c00}.sync-status-enabled{color:#558b2f}.sync-status-button.button{vertical-align:baseline}.cloudinary-widget{height:100%}.cloudinary-widget-wrapper{background-image:url(data:image/svg+xml;base64,PHN2ZyBjbGFzcz0ic3Bpbm5lciIgdmlld0JveD0iLTQgLTQgMTUxIDEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+PCFbQ0RBVEFbCiAgICAgIEBrZXlmcmFtZXMgY29sb3JzIHsKICAgICAgICAwJSB7IHN0cm9rZTogIzAwNzhGRjsgfQogICAgICAgICAgNTAlIHsgc3Ryb2tlOiAjMGUyZjVhOyB9CiAgICAgICAgICAxMDAlIHsgc3Ryb2tlOiAjMDA3OEZGOyB9CiAgICAgIH0KCiAgICAgIEBrZXlmcmFtZXMgZGFzaCB7CiAgICAgICAwJSB7IHN0cm9rZS1kYXNob2Zmc2V0OiA1NjA7IH0KICAgICAgIDUwJSB7CiAgICAgICAgICBzdHJva2UtZGFzaG9mZnNldDogMDsKICAgICAgIH0KICAgICAgIDEwMCUgeyAgIHN0cm9rZS1kYXNob2Zmc2V0OiA1NjA7IH0KICAgICAgfQogICAgICBALXdlYmtpdC1rZXlmcmFtZXMgY29sb3JzIHsKICAgICAgICAwJSB7IHN0cm9rZTogIzAwNzhmZjsgfQogICAgICAgICAgNTAlIHsgc3Ryb2tlOiAjMGUyZjVhOyB9CiAgICAgICAgICAxMDAlIHsgc3Ryb2tlOiAjMDA3OGZmOyB9CiAgICAgIH0KCiAgICAgIEAtd2Via2l0LWtleWZyYW1lcyBkYXNoIHsKICAgICAgIDAlIHsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDU2MDsgfQogICAgICAgNTAlIHsKICAgICAgICAgIHN0cm9rZS1kYXNob2Zmc2V0OiAwOwogICAgICAgfQogICAgICAgMTAwJSB7ICAgc3Ryb2tlLWRhc2hvZmZzZXQ6IDU2MDsKICAgICAgIH0KICAgICAgfQogICAgICAucGF0aCB7CiAgICAgICAgc3Ryb2tlLWRhc2hhcnJheTogMjgwOwogICAgICAgIHN0cm9rZS1kYXNob2Zmc2V0OiAwOwogICAgICAgIHRyYW5zZm9ybS1vcmlnaW46IGNlbnRlcjsKICAgICAgICAtd2Via2l0LWFuaW1hdGlvbjoKICAgICAgICAgIGRhc2ggMnMgZWFzZS1pbi1vdXQgaW5maW5pdGUsIGNvbG9ycyA4cyBlYXNlLWluLW91dCBpbmZpbml0ZTsKICAgICAgICBhbmltYXRpb246CiAgICAgICAgICBkYXNoIDJzIGVhc2UtaW4tb3V0IGluZmluaXRlLCBjb2xvcnMgOHMgZWFzZS1pbi1vdXQgaW5maW5pdGU7CiAgICAgIH0KICAgIF1dPjwvc3R5bGU+CiAgPHBhdGggY2xhc3M9InBhdGgiIGQ9Ik0xMjEuNjYzIDkwLjYzOGMtMS43OTYgMC05OS4zMy0uNDk4LTEwMS40NzQtMS40NzhDOC42ODUgODMuODc3IDEuMjUgNzIuMTk2IDEuMjUgNTkuMzk2YzAtMTYuNjU2IDEyLjc5Ny0zMC42MSAyOS4wNTItMzIuMzIzIDcuNDktMTUuNzA2IDIzLjE4Ni0yNS43MDcgNDAuNzE0LTI1LjcwNyAyMC45OCAwIDM5LjIxNSAxNC43NTIgNDMuOTQ1IDM0LjkwNyAxNS4wOS4yNDUgMjcuMjkgMTIuNjMgMjcuMjkgMjcuODIyIDAgMTEuOTY4LTcuNzM4IDIyLjU1LTE5LjI1NiAyNi4zMyIgc3Ryb2tlLXdpZHRoPSI5IiBzdHJva2UtbGluZWNhcD0icm91bmQiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPgo8L3N2Zz4K);background-position:50%;background-repeat:no-repeat;background-size:150px;height:100%;overflow:hidden}.attachment-actions .button.edit-attachment,.attachment-info .edit-attachment{display:none}.global-transformations-preview{max-width:600px;position:relative}.global-transformations-spinner{display:none}.global-transformations-button.button-primary{display:none;position:absolute;z-index:100}.global-transformations-url{margin-bottom:5px;margin-top:5px}.global-transformations-url-transformation{color:#51a3ff;max-width:100px;overflow:hidden;text-overflow:ellipsis}.global-transformations-url-file{color:#f2d864}.global-transformations-url-link{background-color:#262c35;border-radius:6px;color:#fff;display:block;overflow:hidden;padding:16px;text-decoration:none;text-overflow:ellipsis}.global-transformations-url-link:hover{color:#888;text-decoration:underline}.cld-tax-order-list-item{background-color:#fff;border:1px solid #efefef;margin:0 0 -1px;padding:4px}.cld-tax-order-list-item.no-items{color:#888;display:none;text-align:center}.cld-tax-order-list-item.no-items:last-child{display:block}.cld-tax-order-list-item.ui-sortable-helper{box-shadow:0 2px 5px rgba(0,0,0,.2)}.cld-tax-order-list-item-placeholder{background-color:#efefef;height:45px;margin:0}.cld-tax-order-list-item-handle{color:#999;cursor:grab;margin-right:4px}.cld-tax-order-list-type{display:inline-block;margin-right:8px}.cld-tax-order-list-type input{margin-right:4px!important}.cloudinary-media-library{margin-left:-20px;position:relative}@media screen and (max-width:782px){.cloudinary-media-library{margin-left:-10px}}.cld-pagenav{color:#555;line-height:2.4em;margin-top:5px;text-align:right}.cld-pagenav-text{margin:0 2em}.cld-delete{color:#dd2c00;cursor:pointer;float:right}.cld-apply-action{float:right}.cld-table thead tr th.cld-table-th{line-height:1.8em}.cld-loading{background-image:url(data:image/svg+xml;base64,PHN2ZyBjbGFzcz0ic3Bpbm5lciIgdmlld0JveD0iLTQgLTQgMTUxIDEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+PCFbQ0RBVEFbCiAgICAgIEBrZXlmcmFtZXMgY29sb3JzIHsKICAgICAgICAwJSB7IHN0cm9rZTogIzAwNzhGRjsgfQogICAgICAgICAgNTAlIHsgc3Ryb2tlOiAjMGUyZjVhOyB9CiAgICAgICAgICAxMDAlIHsgc3Ryb2tlOiAjMDA3OEZGOyB9CiAgICAgIH0KCiAgICAgIEBrZXlmcmFtZXMgZGFzaCB7CiAgICAgICAwJSB7IHN0cm9rZS1kYXNob2Zmc2V0OiA1NjA7IH0KICAgICAgIDUwJSB7CiAgICAgICAgICBzdHJva2UtZGFzaG9mZnNldDogMDsKICAgICAgIH0KICAgICAgIDEwMCUgeyAgIHN0cm9rZS1kYXNob2Zmc2V0OiA1NjA7IH0KICAgICAgfQogICAgICBALXdlYmtpdC1rZXlmcmFtZXMgY29sb3JzIHsKICAgICAgICAwJSB7IHN0cm9rZTogIzAwNzhmZjsgfQogICAgICAgICAgNTAlIHsgc3Ryb2tlOiAjMGUyZjVhOyB9CiAgICAgICAgICAxMDAlIHsgc3Ryb2tlOiAjMDA3OGZmOyB9CiAgICAgIH0KCiAgICAgIEAtd2Via2l0LWtleWZyYW1lcyBkYXNoIHsKICAgICAgIDAlIHsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDU2MDsgfQogICAgICAgNTAlIHsKICAgICAgICAgIHN0cm9rZS1kYXNob2Zmc2V0OiAwOwogICAgICAgfQogICAgICAgMTAwJSB7ICAgc3Ryb2tlLWRhc2hvZmZzZXQ6IDU2MDsKICAgICAgIH0KICAgICAgfQogICAgICAucGF0aCB7CiAgICAgICAgc3Ryb2tlLWRhc2hhcnJheTogMjgwOwogICAgICAgIHN0cm9rZS1kYXNob2Zmc2V0OiAwOwogICAgICAgIHRyYW5zZm9ybS1vcmlnaW46IGNlbnRlcjsKICAgICAgICAtd2Via2l0LWFuaW1hdGlvbjoKICAgICAgICAgIGRhc2ggMnMgZWFzZS1pbi1vdXQgaW5maW5pdGUsIGNvbG9ycyA4cyBlYXNlLWluLW91dCBpbmZpbml0ZTsKICAgICAgICBhbmltYXRpb246CiAgICAgICAgICBkYXNoIDJzIGVhc2UtaW4tb3V0IGluZmluaXRlLCBjb2xvcnMgOHMgZWFzZS1pbi1vdXQgaW5maW5pdGU7CiAgICAgIH0KICAgIF1dPjwvc3R5bGU+CiAgPHBhdGggY2xhc3M9InBhdGgiIGQ9Ik0xMjEuNjYzIDkwLjYzOGMtMS43OTYgMC05OS4zMy0uNDk4LTEwMS40NzQtMS40NzhDOC42ODUgODMuODc3IDEuMjUgNzIuMTk2IDEuMjUgNTkuMzk2YzAtMTYuNjU2IDEyLjc5Ny0zMC42MSAyOS4wNTItMzIuMzIzIDcuNDktMTUuNzA2IDIzLjE4Ni0yNS43MDcgNDAuNzE0LTI1LjcwNyAyMC45OCAwIDM5LjIxNSAxNC43NTIgNDMuOTQ1IDM0LjkwNyAxNS4wOS4yNDUgMjcuMjkgMTIuNjMgMjcuMjkgMjcuODIyIDAgMTEuOTY4LTcuNzM4IDIyLjU1LTE5LjI1NiAyNi4zMyIgc3Ryb2tlLXdpZHRoPSI5IiBzdHJva2UtbGluZWNhcD0icm91bmQiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPgo8L3N2Zz4K);background-position:50%;background-repeat:no-repeat;background-size:50px 50px;height:100px;width:auto}.cld-loading.tree-branch{background-position:25px;background-size:50px 50px}.cld-syncing{background:url(../css/loading.svg) no-repeat 50%;display:inline-block;height:20px;margin-left:12px;padding:4px;width:30px}.cld-footer{bottom:0;color:#555d66;left:0;padding:0;position:absolute;right:0}@media only screen and (min-width:783px){.cld-footer{margin-left:36px}}@media only screen and (min-width:960px){.cld-footer{margin-left:160px}}.cld-footer .cld-notice-box.is-success{background-color:#fff;border:0;color:#555;margin:0;padding:0}.cld-footer .cld-notice-box.is-success .cld-stars{margin-left:12px;text-decoration:none}.cld-footer .cld-notice-box.is-success .cld-stars .dashicons{color:#fd9d2c;position:inherit}.cld-footer .notice-dismiss:before{content:"";font-size:1.4rem;padding:6px 0 0}.cld-tooltip{font-size:1rem;margin-left:2px;margin-top:1px}.cld-notice-box{box-shadow:0 0 2px rgba(0,0,0,.1);margin-bottom:12px;margin-right:20px;position:relative}.cld-notice-box .cld-notice{padding:1rem 2.2rem .75rem 1.2rem}.cld-notice-box .cld-notice img.cld-ui-icon{height:100%}.cld-notice-box.is-dismissible{padding-right:38px}.cld-notice-box.has-icon{padding-left:38px}.cld-notice-box.is-created,.cld-notice-box.is-success,.cld-notice-box.is-updated{background-color:#ebf5ec;border-left:4px solid #42ad4f}.cld-notice-box.is-created .dashicons,.cld-notice-box.is-success .dashicons,.cld-notice-box.is-updated .dashicons{color:#2a0}.cld-notice-box.is-error{background-color:#f8e8e7;border-left:4px solid #cb3435}.cld-notice-box.is-error .dashicons{color:#dd2c00}.cld-notice-box.is-warning{background-color:#fff7e5;border-left:4px solid #f2ad4c}.cld-notice-box.is-warning .dashicons{color:#fd9d2c}.cld-notice-box.is-info{background-color:#e4f4f8;border-left:4px solid #2a95c3}.cld-notice-box.is-info .dashicons{color:#3273ab}.cld-notice-box.is-neutral{background-color:#fff;border-left:4px solid #ccd0d4}.cld-notice-box.is-neutral .dashicons{color:#90a0b3}.cld-notice-box.dismissed{overflow:hidden;transition:height .3s ease-out}.cld-notice-box .cld-ui-icon,.cld-notice-box .dashicons{left:19px;position:absolute;top:14px}.cld-ui-collapse{align-self:center;cursor:pointer;padding:0 .45rem}.cld-ui-title.collapsible{cursor:pointer}.cld-ui-conditional .closed,.cld-ui-wrap .closed{display:none}.cld-ui-wrap .cld-row{clear:both;margin:0 -1.75em}.cld-ui-wrap .cld-column{box-sizing:border-box;float:left;padding:0 1.75em;width:100%}@media only screen and (min-width:783px){.cld-ui-wrap .cld-column.column-45{width:45%}.cld-ui-wrap .cld-column.column-55{width:55%}}.cld-ui-wrap .cld-row:after{clear:both;content:"";display:table}.cld-image-preview,.cld-video-preview{background-color:hsla(0,0%,84.7%,.5);border-radius:5px;padding:7px}.cld-image-preview-wrapper,.cld-video-preview-wrapper{position:relative}.cld-image-preview .cld-ui-title,.cld-video-preview .cld-ui-title{font-weight:400;margin:0 0 .4rem}.cld-image-preview img,.cld-video-preview img{width:100%}.cld-page-header{align-items:center;margin-bottom:1em;padding:1.2rem}.cld-page-header,.cld-page-tabs{background-color:#fff;display:flex;margin-left:-20px}.cld-page-tabs{border-bottom:1px solid #e5e5e5;border-top:1px solid #e5e5e5;flex-wrap:wrap;margin-top:-1em;padding:0 1rem}.cld-page-tabs-tab{list-style:none;margin-bottom:0;text-indent:0}.cld-page-tabs-tab a{color:#000001;display:block;font-weight:500;padding:1rem 2rem;text-align:center;text-decoration:none;white-space:nowrap}.cld-page-tabs-tab.is-active a{border-bottom:2px solid #3273ab;color:#3273ab}.cld-group hr{border-top:1px solid #e5e5e5;clear:both;margin:1.5rem 0}.cld-group .cld-group .cld-group hr.cld-group{display:none}.cld-group-heading{display:flex;justify-content:space-between}.cld-group-heading h3{font-size:.9rem}.cld-group-heading h3 .description{font-size:.7rem;font-weight:400;margin-left:.7em}.cld-input{display:block;margin-bottom:1.4rem}.cld-input-label{display:block;font-weight:700}.cld-input .regular-number,.cld-input .regular-text{border:1px solid #d0d0d0;border-radius:3px;padding:.1rem .5rem;width:100%}.cld-input .regular-number-small,.cld-input .regular-text-small{width:40%}.cld-input .prefixed{margin-left:6px;width:40%}.cld-input .suffixed{margin-right:6px;width:40%}.cld-input .regular-number{width:100px}.cld-input .regular-select{appearance:none;border:1px solid #d0d0d0;border-radius:3px;display:block;margin-top:.6rem;padding:.1rem .5rem;width:100%}.cld-input-on-off{align-items:center;display:inline-flex}.cld-input-on-off .description{margin:0}.cld-input-on-off .description.left{margin-left:0;margin-right:.4rem}.cld-input-on-off-control{display:inline-block;height:20px;margin-right:.4rem;position:relative;width:40px}.cld-input-on-off-control.disabled{opacity:.4}.cld-input-on-off-control input{height:0;opacity:0;width:0}.cld-input-on-off-control-slider{background-color:#90a0b3;border-radius:34px;bottom:0;cursor:pointer;left:0;position:absolute;right:0;top:0;transition:background-color .3s}input:checked+.cld-input-on-off-control-slider{background-color:#2a0!important}input:checked.partial+.cld-input-on-off-control-slider{background-color:#fd9d2c!important}input:checked.delete+.cld-input-on-off-control-slider{background-color:#dd2c00!important}.cld-input-on-off-control-slider:before{background-color:#fff;border-radius:50%;bottom:2px;content:"";display:block;height:16px;left:2px;position:absolute;transition:transform .2s;width:16px}input:checked+.cld-input-on-off-control-slider:before{transform:translateX(20px)}.mini input:checked+.cld-input-on-off-control-slider:before{transform:translateX(10px)}.cld-input-on-off-control.mini{height:10px;width:20px}.mini .cld-input-on-off-control-slider:before{bottom:1px;height:8px;left:1px;width:8px}.cld-input-icon-toggle{align-items:center;display:inline-flex}.cld-input-icon-toggle .description{margin:0 0 0 .4rem}.cld-input-icon-toggle .description.left{margin-left:0;margin-right:.4rem}.cld-input-icon-toggle-control{display:inline-block;position:relative}.cld-input-icon-toggle-control input{height:0;opacity:0;position:absolute;width:0}.cld-input-icon-toggle-control-slider .icon-on{display:none;visibility:hidden}.cld-input-icon-toggle-control-slider .icon-off,input:checked+.cld-input-icon-toggle-control-slider .icon-on{display:inline-block;visibility:visible}input:checked+.cld-input-icon-toggle-control-slider .icon-off{display:none;visibility:hidden}.cld-input-checkbox-label,.cld-input-radio-label{display:block;margin-bottom:.4rem}.cld-input-checkbox-label.list-inline,.cld-input-radio-label.list-inline{display:inline-block;margin-right:.4rem}.cld-info-box,.cld-panel,.cld-panel-short,.cld-submit,.cld-switch-cloud{background-color:#fff;border:1px solid #e5e5e5;margin-right:1rem;max-width:870px}.cld-info-box.full-width,.cld-panel-short.full-width,.cld-panel.full-width,.cld-submit.full-width,.cld-switch-cloud.full-width{max-width:100%}.cld-submit,.cld-switch-cloud{border-top:0;padding:1.2rem 1.75rem}.cld-info-box,.cld-panel,.cld-panel-short{margin-top:1rem;padding:2rem 1.75rem}.cld-info-box-inner,.cld-panel-inner,.cld-panel-short-inner{background-color:hsla(0,0%,86.3%,.2);border:1px solid #e5e5e5;margin:1em 0;padding:1.3rem}.cld-info-box-inner h2,.cld-panel-inner h2,.cld-panel-short-inner h2{color:#3273ab}.cld-info-box .cld-input-label,.cld-panel-short .cld-input-label,.cld-panel .cld-input-label{margin-bottom:.6rem}.cld-info-box.has-heading,.cld-panel-short.has-heading,.cld-panel.has-heading{border-top:0;margin-top:0}.cld-info-box-heading,.cld-panel-heading,.cld-panel-short-heading{display:flex;padding:.4rem 1.75rem .2rem;position:relative}.cld-info-box-heading.full-width,.cld-panel-heading.full-width,.cld-panel-short-heading.full-width{max-width:100%}.cld-info-box-heading img,.cld-panel-heading img,.cld-panel-short-heading img{margin-right:.6rem}.cld-info-box-heading.collapsible,.cld-panel-heading.collapsible,.cld-panel-short-heading.collapsible{cursor:pointer}.cld-info-box ul,.cld-panel-short ul,.cld-panel ul{list-style:initial;padding:0 3em}.cld-info-box .cld-plan,.cld-panel-short .cld-plan,.cld-panel .cld-plan{color:#3273ab;font-size:1.5em;font-weight:700}.cld-info-box .stat-boxes,.cld-panel-short .stat-boxes,.cld-panel .stat-boxes{border:1px solid #e5e5e5;font-size:1.2em}.cld-info-box .stat-boxes .box,.cld-panel-short .stat-boxes .box,.cld-panel .stat-boxes .box{border-bottom:1px solid #e5e5e5;padding:2rem;text-align:center}.cld-info-box .stat-boxes .box:last-of-type,.cld-panel-short .stat-boxes .box:last-of-type,.cld-panel .stat-boxes .box:last-of-type{border-bottom:none}.cld-info-box .stat-boxes .box .cld-ui-icon,.cld-panel-short .stat-boxes .box .cld-ui-icon,.cld-panel .stat-boxes .box .cld-ui-icon{height:35px;width:35px}.cld-info-box .stat-boxes .icon,.cld-panel-short .stat-boxes .icon,.cld-panel .stat-boxes .icon{height:50px;margin-right:.5em;width:50px}.cld-info-box .stat-boxes h3,.cld-panel-short .stat-boxes h3,.cld-panel .stat-boxes h3{margin-bottom:1.5rem;margin-top:2.4rem}.cld-info-box .stat-boxes .limit,.cld-panel-short .stat-boxes .limit,.cld-panel .stat-boxes .limit{font-size:2em;font-weight:700;margin-right:.5em;white-space:nowrap}.cld-info-box .stat-boxes .usage,.cld-panel-short .stat-boxes .usage,.cld-panel .stat-boxes .usage{color:#3273ab;font-size:1.5em;font-weight:400}@media only screen and (min-width:783px){.cld-info-box .stat-boxes,.cld-panel-short .stat-boxes,.cld-panel .stat-boxes{display:flex;flex-wrap:nowrap;font-size:1em}.cld-info-box .stat-boxes .box,.cld-panel-short .stat-boxes .box,.cld-panel .stat-boxes .box{border-bottom:none;border-right:1px solid #e5e5e5;flex-grow:1}.cld-info-box .stat-boxes .box:last-of-type,.cld-panel-short .stat-boxes .box:last-of-type,.cld-panel .stat-boxes .box:last-of-type{border-right:none}}@media only screen and (min-width:1200px){.cld-info-box .stat-boxes,.cld-panel-short .stat-boxes,.cld-panel .stat-boxes{font-size:1.2em}}.cld-info-box .img-connection-string,.cld-panel-short .img-connection-string,.cld-panel .img-connection-string{max-width:607px;width:100%}.cld-info-box .connection-string,.cld-panel-short .connection-string,.cld-panel .connection-string{max-width:40em;width:100%}.cld-info-box .media-status-box,.cld-info-box .stat-boxes,.cld-panel-short .media-status-box,.cld-panel-short .stat-boxes,.cld-panel .media-status-box,.cld-panel .stat-boxes{border:1px solid #e5e5e5}.cld-info-box .media-status-box,.cld-panel-short .media-status-box,.cld-panel .media-status-box{padding:2rem;text-align:center}.cld-info-box .media-status-box .status,.cld-panel-short .media-status-box .status,.cld-panel .media-status-box .status{font-size:2rem;font-weight:700;margin-right:.5em}.cld-info-box .media-status-box .cld-ui-icon,.cld-panel-short .media-status-box .cld-ui-icon,.cld-panel .media-status-box .cld-ui-icon{height:35px;width:35px}.cld-info-box .notification,.cld-panel-short .notification,.cld-panel .notification{display:inline-flex;font-weight:700;padding:1.5rem}.cld-info-box .notification-success,.cld-panel-short .notification-success,.cld-panel .notification-success{background-color:rgba(32,184,50,.2);border:2px solid #20b832}.cld-info-box .notification-success:before,.cld-panel-short .notification-success:before,.cld-panel .notification-success:before{color:#20b832}.cld-info-box .notification-syncing,.cld-panel-short .notification-syncing,.cld-panel .notification-syncing{background-color:rgba(50,115,171,.2);border:2px solid #3273ab;color:#444;text-decoration:none}.cld-info-box .notification-syncing:before,.cld-panel-short .notification-syncing:before,.cld-panel .notification-syncing:before{-webkit-animation:spin 1s infinite running;-moz-animation:spin 1s linear infinite;animation:spin 1s linear infinite;color:#3273ab}@keyframes spin{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.cld-info-box .notification:before,.cld-panel-short .notification:before,.cld-panel .notification:before{margin-right:.5em}.cld-info-box{display:flex;flex-direction:column}@media only screen and (min-width:783px){.cld-info-box{flex-direction:row}}.cld-info-box a.button,.cld-info-box img{align-self:center}.cld-info-box .cld-ui-body{margin:0 1.2rem}.cld-panel-short{display:inline-block;min-width:270px;width:auto}.cld-gallery-settings{box-sizing:border-box;display:flex;flex-wrap:wrap;padding:1rem 0;width:100%}@media only screen and (min-width:960px){.cld-gallery-settings{margin-left:-1rem;margin-right:-1rem}}.cld-gallery-settings__column{box-sizing:border-box;width:100%}@media only screen and (min-width:960px){.cld-gallery-settings__column{padding-left:1rem;padding-right:1rem;width:50%}}.components-base-control__field select{display:block;margin:1rem 0}.components-range-control__wrapper{margin:0!important}.components-range-control__root{flex-direction:row-reverse;margin:1rem 0}.components-input-control.components-number-control.components-range-control__number{margin-left:0!important;margin-right:16px}.components-panel{border:0!important}.components-panel__body:first-child{border-top:0!important}.components-panel__body:last-child{border-bottom:0!important}.components-textarea-control__input{display:block;margin:.5rem 0;width:100%}.tippy-box[data-theme~=cloudinary]{background-color:rgba(0,0,0,.8);color:#fff;font-size:.8em}table .cld-input{margin-bottom:0}tr .file-size.small{color:#a8a8a8;font-size:.8em;font-style:italic;letter-spacing:.4px;margin-left:6px;margin-right:6px}td.tree{color:#212529;line-height:1.5;padding-top:0;position:relative}td.tree ul.striped>:nth-child(odd){background-color:#f6f7f7}td.tree ul.striped>:nth-child(2n){background-color:#fff}td.tree .success{color:#20b832}td+td.tree{padding-top:0}td.tree .cld-input{margin-bottom:0;vertical-align:text-bottom}td.tree .cld-search{font-size:.9em;height:26px;margin-right:12px;min-height:20px;padding:4px 6px;vertical-align:initial}td.tree .file-size{color:#a8a8a8;font-size:.8em;font-style:italic;letter-spacing:.4px;margin-left:6px}td.tree .fa-folder,td.tree .fa-folder-open{color:#007bff}td.tree .fa-html5{color:#f21f10}td.tree ul{list-style:none;margin:0;padding-left:5px}td.tree ul li{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin-bottom:0;padding-bottom:5px;padding-left:25px;padding-top:5px;position:relative}td.tree ul li:before{height:1px;margin:auto;top:14px;width:20px}td.tree ul li:after,td.tree ul li:before{background-color:#666;content:"";left:0;position:absolute}td.tree ul li:after{bottom:0;height:100%;top:0;width:1px}td.tree ul li:after:nth-of-type(odd){background-color:#666}td.tree ul li:last-child:after{height:14px}td.tree ul a{cursor:pointer}td.tree ul a:hover{text-decoration:none} \ No newline at end of file diff --git a/css/src/components/_ui.scss b/css/src/components/_ui.scss index 3c81bde9b..78a9b44f5 100644 --- a/css/src/components/_ui.scss +++ b/css/src/components/_ui.scss @@ -323,6 +323,10 @@ clear: both; } + .cld-group .cld-group hr.cld-group { + display: none; + } + &-heading { display: flex; justify-content: space-between; From 5bc3dd2a8b54860db9991811d556a75af22d5dad Mon Sep 17 00:00:00 2001 From: David Cramer Date: Thu, 8 Jul 2021 14:02:26 +0200 Subject: [PATCH 28/56] Fix CR issues --- css/cloudinary.css | 2 +- css/src/components/_ui.scss | 5 +- js/responsive-breakpoints.asset.php | 2 +- js/responsive-breakpoints.js | 2 +- js/src/responsive-breakpoints.js | 6 +- php/class-lazy-load.php | 43 +++++++++---- php/class-responsive-breakpoints.php | 3 + php/connect/class-api.php | 2 + ui-definitions/settings-image.php | 95 +++++++++++++++------------- 9 files changed, 97 insertions(+), 63 deletions(-) diff --git a/css/cloudinary.css b/css/cloudinary.css index e0a8e4cf8..97ce746a1 100644 --- a/css/cloudinary.css +++ b/css/cloudinary.css @@ -1 +1 @@ -.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{background-color:#333;border-radius:4px;color:#fff;font-size:14px;line-height:1.4;outline:0;position:relative;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{border-top-color:initial;border-width:8px 8px 0;bottom:-7px;left:0;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:initial;border-width:0 8px 8px;left:0;top:-7px;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-left-color:initial;border-width:8px 0 8px 8px;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{border-right-color:initial;border-width:8px 8px 8px 0;left:-7px;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{color:#333;height:16px;width:16px}.tippy-arrow:before{border-color:transparent;border-style:solid;content:"";position:absolute}.tippy-content{padding:5px 9px;position:relative;z-index:1}@font-face{font-family:cloudinary;font-style:normal;font-weight:500;src:url(../css/fonts/cloudinary.7e6e75b25255a2b3b6e7ced1092c210c.eot);src:url(../css/fonts/cloudinary.7e6e75b25255a2b3b6e7ced1092c210c.eot#iefix) format("embedded-opentype"),url(../css/fonts/cloudinary.34cb260ad722325c597cdc3a3e7584d8.woff) format("woff"),url(../css/fonts/cloudinary.c2afda9d25532c03cd41beb20a1ce439.ttf) format("truetype"),url(../css/cloudinary.svg#cloudinary) format("svg")}.dashicons-cloudinary{speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-style:normal;font-variant:normal;font-weight:400;line-height:1;text-transform:none}.dashicons-cloudinary:before{content:"";font-family:cloudinary,monospace!important}.dashicons-cloudinary.success{color:#558b2f}.dashicons-cloudinary.error{color:#dd2c00}.dashicons-cloudinary.error:before{content:""}.dashicons-cloudinary.uploading{color:#fd9d2c}.dashicons-cloudinary.uploading:before{content:""}.dashicons-cloudinary.info{color:#0071ba}.dashicons-cloudinary.downloading:before{content:""}.dashicons-cloudinary.syncing:before{content:""}.column-cld_status{width:5.5em}.column-cld_status .dashicons-cloudinary{display:inline-block}.column-cld_status .dashicons-cloudinary:before{font-size:1.8rem}.form-field .error-notice,.form-table .error-notice{color:#dd2c00;display:none}.form-field input.cld-field:invalid,.form-table input.cld-field:invalid{border-color:#dd2c00}.form-field input.cld-field:invalid+.error-notice,.form-table input.cld-field:invalid+.error-notice{display:inline-block}.cloudinary-welcome{background-image:url(../css/logo.svg);background-position:top 12px right 20px;background-repeat:no-repeat;background-size:153px}.cloudinary-stats{display:inline-block;margin-left:25px}.cloudinary-stat{cursor:help}.cloudinary-percent{color:#0071ba;font-size:.8em;vertical-align:top}.settings-image{max-width:100%;padding-top:5px}.settings-tabs>li{display:inline-block}.settings-tabs>li a{padding:.6em}.settings-tabs>li a.active{background-color:#fff}.settings-tab-section{max-width:1030px;padding:20px 0 0;position:relative}.settings-tab-section.cloudinary-welcome .settings-tab-section-fields-dashboard{align-content:flex-start;align-items:flex-start;display:flex;margin-top:40px}.settings-tab-section.cloudinary-welcome .settings-tab-section-fields-dashboard-description{margin:0 auto 0 0;width:55%}.settings-tab-section.cloudinary-welcome .settings-tab-section-fields-dashboard-content{margin:0 auto;width:35%}.settings-tab-section.cloudinary-welcome .settings-tab-section-fields-dashboard-content .dashicons{color:#9ea3a8}.settings-tab-section.cloudinary-welcome .settings-tab-section-card{margin-top:0}.settings-tab-section-fields .field-heading th{color:#23282d;display:block;font-size:1.1em;margin:1em 0;width:auto}.settings-tab-section-fields .field-heading td{display:none;visibility:hidden}.settings-tab-section-fields .regular-textarea{height:60px;width:100%}.settings-tab-section-fields .dashicons{text-decoration:none;vertical-align:middle}.settings-tab-section-fields a .dashicons{color:#5f5f5f}.settings-tab-section-fields-dashboard-error{color:#5f5f5f;font-size:1.2em}.settings-tab-section-fields-dashboard-error.expanded{margin-bottom:25px;padding-top:40px}.settings-tab-section-fields-dashboard-error .dashicons{color:#ac0000}.settings-tab-section-fields-dashboard-error .button{font-size:1.1em;height:40px;line-height:40px;padding-left:40px;padding-right:40px}.settings-tab-section-fields-dashboard-success{color:#23282d;font-size:1.2em}.settings-tab-section-fields-dashboard-success.expanded{margin-bottom:25px;padding-top:40px}.settings-tab-section-fields-dashboard-success .dashicons{color:#4fb651}.settings-tab-section-fields-dashboard-success .button{font-size:1.1em;height:40px;line-height:40px;padding-left:40px;padding-right:40px}.settings-tab-section-fields-dashboard-success .description{color:#5f5f5f;font-weight:400;margin-top:12px}.settings-tab-section-card{background-color:#fff;border:1px solid #e5e5e5;box-shadow:0 1px 1px 0 rgba(0,0,0,.07);box-sizing:border-box;margin-top:12px;padding:20px 23px}.settings-tab-section-card .dashicons{font-size:1.4em}.settings-tab-section-card h2{font-size:1.8em;font-weight:400;margin-top:0}.settings-tab-section-card.pull-right{float:right;padding:12px;position:relative;width:450px;z-index:10}.settings-tab-section-card.pull-right img.settings-image{border:1px solid #979797;box-shadow:0 2px 4px 0 rgba(0,0,0,.5);margin-top:12px}.settings-tab-section-card.pull-right h3,.settings-tab-section-card.pull-right h4{margin-top:0}.settings-tab-section .field-row-cloudinary_url,.settings-tab-section .field-row-signup{display:block}.settings-tab-section .field-row-cloudinary_url td,.settings-tab-section .field-row-cloudinary_url th,.settings-tab-section .field-row-signup td,.settings-tab-section .field-row-signup th{display:block;padding:10px 0 0;width:auto}.settings-tab-section .field-row-cloudinary_url td .sign-up,.settings-tab-section .field-row-cloudinary_url th .sign-up,.settings-tab-section .field-row-signup td .sign-up,.settings-tab-section .field-row-signup th .sign-up{vertical-align:baseline}.settings-tab-section.connect .form-table{display:inline-block;max-width:580px;width:auto}.settings-valid{color:#558b2f;font-size:30px}.settings-valid-field{border-color:#558b2f!important}.settings-invalid-field{border-color:#dd2c00!important}.settings-alert{box-shadow:0 1px 1px rgba(0,0,0,.04);display:inline-block;padding:5px 7px}.settings-alert-info{background-color:#e9faff;border:1px solid #ccd0d4;border-left:4px solid #00a0d2}.settings-alert-warning{background-color:#fff5e9;border:1px solid #f6e7b6;border-left:4px solid #e3be38}.settings-alert-error{background-color:#ffe9e9;border:1px solid #d4cccc;border-left:4px solid #d20000}.field-radio input[type=radio].cld-field{margin:0 5px 0 0}.field-radio label{margin-right:10px}.settings-tab-section h2{margin:0}.cloudinary-collapsible{background-color:#fff;border:1px solid #ccd0d4;box-shadow:0 1px 1px rgba(0,0,0,.04);box-sizing:border-box;margin:20px 0;padding:10px;width:95%}.cloudinary-collapsible__toggle{cursor:pointer;display:flex;justify-content:space-between}.cloudinary-collapsible__toggle h2{margin:0!important}.cloudinary-collapsible__toggle button{background-color:inherit;border:none;cursor:pointer;margin:0;padding:0;width:auto}.cloudinary-deactivation .more{display:none}.cloudinary-deactivation input[type=radio]:checked~.more{color:#32373c;display:block;line-height:2;margin-left:2em;margin-top:.5em}.cloudinary-deactivation input[type=checkbox]~label{margin-left:.25em}.cloudinary-deactivation .modal-footer{background-color:#fcfcfc;border-top:1px solid #ddd;bottom:0;margin:0 -15px;padding:1em;position:absolute;width:calc(100% - 2em)}.cloudinary-deactivation .modal-footer .button-link{float:right}.cloudinary-deactivation .modal-footer .button-link:hover{background:transparent}.cloudinary-deactivation textarea{resize:none}.cloudinary-deactivation p{display:flex}.sync .spinner{display:inline-block;float:none;margin:0 5px 0 0;visibility:visible}.sync-media,.sync-media-progress{display:none}.sync-media-progress-outer{background-color:#e5e5e5;height:20px;margin:20px 0 10px;position:relative;width:500px}.sync-media-progress-outer .progress-bar{background-color:#558b2f;height:20px;transition:width .25s;width:0}.sync-media-progress-notice{color:#dd2c00}.sync-media-resource{display:inline-block;width:100px}.sync-media-error{color:#dd2c00}.sync-count{font-weight:700}.sync-details{margin-top:10px}.sync .button.start-sync,.sync .button.stop-sync{display:none;padding:0 16px}.sync .button.start-sync .dashicons,.sync .button.stop-sync .dashicons{line-height:2.2}.sync .progress-text{display:inline-block;font-weight:700;padding:12px 4px 12px 12px}.sync .completed{display:none;max-width:300px}.sync-status-disabled{color:#dd2c00}.sync-status-enabled{color:#558b2f}.sync-status-button.button{vertical-align:baseline}.cloudinary-widget{height:100%}.cloudinary-widget-wrapper{background-image:url(data:image/svg+xml;base64,PHN2ZyBjbGFzcz0ic3Bpbm5lciIgdmlld0JveD0iLTQgLTQgMTUxIDEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+PCFbQ0RBVEFbCiAgICAgIEBrZXlmcmFtZXMgY29sb3JzIHsKICAgICAgICAwJSB7IHN0cm9rZTogIzAwNzhGRjsgfQogICAgICAgICAgNTAlIHsgc3Ryb2tlOiAjMGUyZjVhOyB9CiAgICAgICAgICAxMDAlIHsgc3Ryb2tlOiAjMDA3OEZGOyB9CiAgICAgIH0KCiAgICAgIEBrZXlmcmFtZXMgZGFzaCB7CiAgICAgICAwJSB7IHN0cm9rZS1kYXNob2Zmc2V0OiA1NjA7IH0KICAgICAgIDUwJSB7CiAgICAgICAgICBzdHJva2UtZGFzaG9mZnNldDogMDsKICAgICAgIH0KICAgICAgIDEwMCUgeyAgIHN0cm9rZS1kYXNob2Zmc2V0OiA1NjA7IH0KICAgICAgfQogICAgICBALXdlYmtpdC1rZXlmcmFtZXMgY29sb3JzIHsKICAgICAgICAwJSB7IHN0cm9rZTogIzAwNzhmZjsgfQogICAgICAgICAgNTAlIHsgc3Ryb2tlOiAjMGUyZjVhOyB9CiAgICAgICAgICAxMDAlIHsgc3Ryb2tlOiAjMDA3OGZmOyB9CiAgICAgIH0KCiAgICAgIEAtd2Via2l0LWtleWZyYW1lcyBkYXNoIHsKICAgICAgIDAlIHsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDU2MDsgfQogICAgICAgNTAlIHsKICAgICAgICAgIHN0cm9rZS1kYXNob2Zmc2V0OiAwOwogICAgICAgfQogICAgICAgMTAwJSB7ICAgc3Ryb2tlLWRhc2hvZmZzZXQ6IDU2MDsKICAgICAgIH0KICAgICAgfQogICAgICAucGF0aCB7CiAgICAgICAgc3Ryb2tlLWRhc2hhcnJheTogMjgwOwogICAgICAgIHN0cm9rZS1kYXNob2Zmc2V0OiAwOwogICAgICAgIHRyYW5zZm9ybS1vcmlnaW46IGNlbnRlcjsKICAgICAgICAtd2Via2l0LWFuaW1hdGlvbjoKICAgICAgICAgIGRhc2ggMnMgZWFzZS1pbi1vdXQgaW5maW5pdGUsIGNvbG9ycyA4cyBlYXNlLWluLW91dCBpbmZpbml0ZTsKICAgICAgICBhbmltYXRpb246CiAgICAgICAgICBkYXNoIDJzIGVhc2UtaW4tb3V0IGluZmluaXRlLCBjb2xvcnMgOHMgZWFzZS1pbi1vdXQgaW5maW5pdGU7CiAgICAgIH0KICAgIF1dPjwvc3R5bGU+CiAgPHBhdGggY2xhc3M9InBhdGgiIGQ9Ik0xMjEuNjYzIDkwLjYzOGMtMS43OTYgMC05OS4zMy0uNDk4LTEwMS40NzQtMS40NzhDOC42ODUgODMuODc3IDEuMjUgNzIuMTk2IDEuMjUgNTkuMzk2YzAtMTYuNjU2IDEyLjc5Ny0zMC42MSAyOS4wNTItMzIuMzIzIDcuNDktMTUuNzA2IDIzLjE4Ni0yNS43MDcgNDAuNzE0LTI1LjcwNyAyMC45OCAwIDM5LjIxNSAxNC43NTIgNDMuOTQ1IDM0LjkwNyAxNS4wOS4yNDUgMjcuMjkgMTIuNjMgMjcuMjkgMjcuODIyIDAgMTEuOTY4LTcuNzM4IDIyLjU1LTE5LjI1NiAyNi4zMyIgc3Ryb2tlLXdpZHRoPSI5IiBzdHJva2UtbGluZWNhcD0icm91bmQiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPgo8L3N2Zz4K);background-position:50%;background-repeat:no-repeat;background-size:150px;height:100%;overflow:hidden}.attachment-actions .button.edit-attachment,.attachment-info .edit-attachment{display:none}.global-transformations-preview{max-width:600px;position:relative}.global-transformations-spinner{display:none}.global-transformations-button.button-primary{display:none;position:absolute;z-index:100}.global-transformations-url{margin-bottom:5px;margin-top:5px}.global-transformations-url-transformation{color:#51a3ff;max-width:100px;overflow:hidden;text-overflow:ellipsis}.global-transformations-url-file{color:#f2d864}.global-transformations-url-link{background-color:#262c35;border-radius:6px;color:#fff;display:block;overflow:hidden;padding:16px;text-decoration:none;text-overflow:ellipsis}.global-transformations-url-link:hover{color:#888;text-decoration:underline}.cld-tax-order-list-item{background-color:#fff;border:1px solid #efefef;margin:0 0 -1px;padding:4px}.cld-tax-order-list-item.no-items{color:#888;display:none;text-align:center}.cld-tax-order-list-item.no-items:last-child{display:block}.cld-tax-order-list-item.ui-sortable-helper{box-shadow:0 2px 5px rgba(0,0,0,.2)}.cld-tax-order-list-item-placeholder{background-color:#efefef;height:45px;margin:0}.cld-tax-order-list-item-handle{color:#999;cursor:grab;margin-right:4px}.cld-tax-order-list-type{display:inline-block;margin-right:8px}.cld-tax-order-list-type input{margin-right:4px!important}.cloudinary-media-library{margin-left:-20px;position:relative}@media screen and (max-width:782px){.cloudinary-media-library{margin-left:-10px}}.cld-pagenav{color:#555;line-height:2.4em;margin-top:5px;text-align:right}.cld-pagenav-text{margin:0 2em}.cld-delete{color:#dd2c00;cursor:pointer;float:right}.cld-apply-action{float:right}.cld-table thead tr th.cld-table-th{line-height:1.8em}.cld-loading{background-image:url(data:image/svg+xml;base64,PHN2ZyBjbGFzcz0ic3Bpbm5lciIgdmlld0JveD0iLTQgLTQgMTUxIDEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+PCFbQ0RBVEFbCiAgICAgIEBrZXlmcmFtZXMgY29sb3JzIHsKICAgICAgICAwJSB7IHN0cm9rZTogIzAwNzhGRjsgfQogICAgICAgICAgNTAlIHsgc3Ryb2tlOiAjMGUyZjVhOyB9CiAgICAgICAgICAxMDAlIHsgc3Ryb2tlOiAjMDA3OEZGOyB9CiAgICAgIH0KCiAgICAgIEBrZXlmcmFtZXMgZGFzaCB7CiAgICAgICAwJSB7IHN0cm9rZS1kYXNob2Zmc2V0OiA1NjA7IH0KICAgICAgIDUwJSB7CiAgICAgICAgICBzdHJva2UtZGFzaG9mZnNldDogMDsKICAgICAgIH0KICAgICAgIDEwMCUgeyAgIHN0cm9rZS1kYXNob2Zmc2V0OiA1NjA7IH0KICAgICAgfQogICAgICBALXdlYmtpdC1rZXlmcmFtZXMgY29sb3JzIHsKICAgICAgICAwJSB7IHN0cm9rZTogIzAwNzhmZjsgfQogICAgICAgICAgNTAlIHsgc3Ryb2tlOiAjMGUyZjVhOyB9CiAgICAgICAgICAxMDAlIHsgc3Ryb2tlOiAjMDA3OGZmOyB9CiAgICAgIH0KCiAgICAgIEAtd2Via2l0LWtleWZyYW1lcyBkYXNoIHsKICAgICAgIDAlIHsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDU2MDsgfQogICAgICAgNTAlIHsKICAgICAgICAgIHN0cm9rZS1kYXNob2Zmc2V0OiAwOwogICAgICAgfQogICAgICAgMTAwJSB7ICAgc3Ryb2tlLWRhc2hvZmZzZXQ6IDU2MDsKICAgICAgIH0KICAgICAgfQogICAgICAucGF0aCB7CiAgICAgICAgc3Ryb2tlLWRhc2hhcnJheTogMjgwOwogICAgICAgIHN0cm9rZS1kYXNob2Zmc2V0OiAwOwogICAgICAgIHRyYW5zZm9ybS1vcmlnaW46IGNlbnRlcjsKICAgICAgICAtd2Via2l0LWFuaW1hdGlvbjoKICAgICAgICAgIGRhc2ggMnMgZWFzZS1pbi1vdXQgaW5maW5pdGUsIGNvbG9ycyA4cyBlYXNlLWluLW91dCBpbmZpbml0ZTsKICAgICAgICBhbmltYXRpb246CiAgICAgICAgICBkYXNoIDJzIGVhc2UtaW4tb3V0IGluZmluaXRlLCBjb2xvcnMgOHMgZWFzZS1pbi1vdXQgaW5maW5pdGU7CiAgICAgIH0KICAgIF1dPjwvc3R5bGU+CiAgPHBhdGggY2xhc3M9InBhdGgiIGQ9Ik0xMjEuNjYzIDkwLjYzOGMtMS43OTYgMC05OS4zMy0uNDk4LTEwMS40NzQtMS40NzhDOC42ODUgODMuODc3IDEuMjUgNzIuMTk2IDEuMjUgNTkuMzk2YzAtMTYuNjU2IDEyLjc5Ny0zMC42MSAyOS4wNTItMzIuMzIzIDcuNDktMTUuNzA2IDIzLjE4Ni0yNS43MDcgNDAuNzE0LTI1LjcwNyAyMC45OCAwIDM5LjIxNSAxNC43NTIgNDMuOTQ1IDM0LjkwNyAxNS4wOS4yNDUgMjcuMjkgMTIuNjMgMjcuMjkgMjcuODIyIDAgMTEuOTY4LTcuNzM4IDIyLjU1LTE5LjI1NiAyNi4zMyIgc3Ryb2tlLXdpZHRoPSI5IiBzdHJva2UtbGluZWNhcD0icm91bmQiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPgo8L3N2Zz4K);background-position:50%;background-repeat:no-repeat;background-size:50px 50px;height:100px;width:auto}.cld-loading.tree-branch{background-position:25px;background-size:50px 50px}.cld-syncing{background:url(../css/loading.svg) no-repeat 50%;display:inline-block;height:20px;margin-left:12px;padding:4px;width:30px}.cld-footer{bottom:0;color:#555d66;left:0;padding:0;position:absolute;right:0}@media only screen and (min-width:783px){.cld-footer{margin-left:36px}}@media only screen and (min-width:960px){.cld-footer{margin-left:160px}}.cld-footer .cld-notice-box.is-success{background-color:#fff;border:0;color:#555;margin:0;padding:0}.cld-footer .cld-notice-box.is-success .cld-stars{margin-left:12px;text-decoration:none}.cld-footer .cld-notice-box.is-success .cld-stars .dashicons{color:#fd9d2c;position:inherit}.cld-footer .notice-dismiss:before{content:"";font-size:1.4rem;padding:6px 0 0}.cld-tooltip{font-size:1rem;margin-left:2px;margin-top:1px}.cld-notice-box{box-shadow:0 0 2px rgba(0,0,0,.1);margin-bottom:12px;margin-right:20px;position:relative}.cld-notice-box .cld-notice{padding:1rem 2.2rem .75rem 1.2rem}.cld-notice-box .cld-notice img.cld-ui-icon{height:100%}.cld-notice-box.is-dismissible{padding-right:38px}.cld-notice-box.has-icon{padding-left:38px}.cld-notice-box.is-created,.cld-notice-box.is-success,.cld-notice-box.is-updated{background-color:#ebf5ec;border-left:4px solid #42ad4f}.cld-notice-box.is-created .dashicons,.cld-notice-box.is-success .dashicons,.cld-notice-box.is-updated .dashicons{color:#2a0}.cld-notice-box.is-error{background-color:#f8e8e7;border-left:4px solid #cb3435}.cld-notice-box.is-error .dashicons{color:#dd2c00}.cld-notice-box.is-warning{background-color:#fff7e5;border-left:4px solid #f2ad4c}.cld-notice-box.is-warning .dashicons{color:#fd9d2c}.cld-notice-box.is-info{background-color:#e4f4f8;border-left:4px solid #2a95c3}.cld-notice-box.is-info .dashicons{color:#3273ab}.cld-notice-box.is-neutral{background-color:#fff;border-left:4px solid #ccd0d4}.cld-notice-box.is-neutral .dashicons{color:#90a0b3}.cld-notice-box.dismissed{overflow:hidden;transition:height .3s ease-out}.cld-notice-box .cld-ui-icon,.cld-notice-box .dashicons{left:19px;position:absolute;top:14px}.cld-ui-collapse{align-self:center;cursor:pointer;padding:0 .45rem}.cld-ui-title.collapsible{cursor:pointer}.cld-ui-conditional .closed,.cld-ui-wrap .closed{display:none}.cld-ui-wrap .cld-row{clear:both;margin:0 -1.75em}.cld-ui-wrap .cld-column{box-sizing:border-box;float:left;padding:0 1.75em;width:100%}@media only screen and (min-width:783px){.cld-ui-wrap .cld-column.column-45{width:45%}.cld-ui-wrap .cld-column.column-55{width:55%}}.cld-ui-wrap .cld-row:after{clear:both;content:"";display:table}.cld-image-preview,.cld-video-preview{background-color:hsla(0,0%,84.7%,.5);border-radius:5px;padding:7px}.cld-image-preview-wrapper,.cld-video-preview-wrapper{position:relative}.cld-image-preview .cld-ui-title,.cld-video-preview .cld-ui-title{font-weight:400;margin:0 0 .4rem}.cld-image-preview img,.cld-video-preview img{width:100%}.cld-page-header{align-items:center;margin-bottom:1em;padding:1.2rem}.cld-page-header,.cld-page-tabs{background-color:#fff;display:flex;margin-left:-20px}.cld-page-tabs{border-bottom:1px solid #e5e5e5;border-top:1px solid #e5e5e5;flex-wrap:wrap;margin-top:-1em;padding:0 1rem}.cld-page-tabs-tab{list-style:none;margin-bottom:0;text-indent:0}.cld-page-tabs-tab a{color:#000001;display:block;font-weight:500;padding:1rem 2rem;text-align:center;text-decoration:none;white-space:nowrap}.cld-page-tabs-tab.is-active a{border-bottom:2px solid #3273ab;color:#3273ab}.cld-group hr{border-top:1px solid #e5e5e5;clear:both;margin:1.5rem 0}.cld-group .cld-group .cld-group hr.cld-group{display:none}.cld-group-heading{display:flex;justify-content:space-between}.cld-group-heading h3{font-size:.9rem}.cld-group-heading h3 .description{font-size:.7rem;font-weight:400;margin-left:.7em}.cld-input{display:block;margin-bottom:1.4rem}.cld-input-label{display:block;font-weight:700}.cld-input .regular-number,.cld-input .regular-text{border:1px solid #d0d0d0;border-radius:3px;padding:.1rem .5rem;width:100%}.cld-input .regular-number-small,.cld-input .regular-text-small{width:40%}.cld-input .prefixed{margin-left:6px;width:40%}.cld-input .suffixed{margin-right:6px;width:40%}.cld-input .regular-number{width:100px}.cld-input .regular-select{appearance:none;border:1px solid #d0d0d0;border-radius:3px;display:block;margin-top:.6rem;padding:.1rem .5rem;width:100%}.cld-input-on-off{align-items:center;display:inline-flex}.cld-input-on-off .description{margin:0}.cld-input-on-off .description.left{margin-left:0;margin-right:.4rem}.cld-input-on-off-control{display:inline-block;height:20px;margin-right:.4rem;position:relative;width:40px}.cld-input-on-off-control.disabled{opacity:.4}.cld-input-on-off-control input{height:0;opacity:0;width:0}.cld-input-on-off-control-slider{background-color:#90a0b3;border-radius:34px;bottom:0;cursor:pointer;left:0;position:absolute;right:0;top:0;transition:background-color .3s}input:checked+.cld-input-on-off-control-slider{background-color:#2a0!important}input:checked.partial+.cld-input-on-off-control-slider{background-color:#fd9d2c!important}input:checked.delete+.cld-input-on-off-control-slider{background-color:#dd2c00!important}.cld-input-on-off-control-slider:before{background-color:#fff;border-radius:50%;bottom:2px;content:"";display:block;height:16px;left:2px;position:absolute;transition:transform .2s;width:16px}input:checked+.cld-input-on-off-control-slider:before{transform:translateX(20px)}.mini input:checked+.cld-input-on-off-control-slider:before{transform:translateX(10px)}.cld-input-on-off-control.mini{height:10px;width:20px}.mini .cld-input-on-off-control-slider:before{bottom:1px;height:8px;left:1px;width:8px}.cld-input-icon-toggle{align-items:center;display:inline-flex}.cld-input-icon-toggle .description{margin:0 0 0 .4rem}.cld-input-icon-toggle .description.left{margin-left:0;margin-right:.4rem}.cld-input-icon-toggle-control{display:inline-block;position:relative}.cld-input-icon-toggle-control input{height:0;opacity:0;position:absolute;width:0}.cld-input-icon-toggle-control-slider .icon-on{display:none;visibility:hidden}.cld-input-icon-toggle-control-slider .icon-off,input:checked+.cld-input-icon-toggle-control-slider .icon-on{display:inline-block;visibility:visible}input:checked+.cld-input-icon-toggle-control-slider .icon-off{display:none;visibility:hidden}.cld-input-checkbox-label,.cld-input-radio-label{display:block;margin-bottom:.4rem}.cld-input-checkbox-label.list-inline,.cld-input-radio-label.list-inline{display:inline-block;margin-right:.4rem}.cld-info-box,.cld-panel,.cld-panel-short,.cld-submit,.cld-switch-cloud{background-color:#fff;border:1px solid #e5e5e5;margin-right:1rem;max-width:870px}.cld-info-box.full-width,.cld-panel-short.full-width,.cld-panel.full-width,.cld-submit.full-width,.cld-switch-cloud.full-width{max-width:100%}.cld-submit,.cld-switch-cloud{border-top:0;padding:1.2rem 1.75rem}.cld-info-box,.cld-panel,.cld-panel-short{margin-top:1rem;padding:2rem 1.75rem}.cld-info-box-inner,.cld-panel-inner,.cld-panel-short-inner{background-color:hsla(0,0%,86.3%,.2);border:1px solid #e5e5e5;margin:1em 0;padding:1.3rem}.cld-info-box-inner h2,.cld-panel-inner h2,.cld-panel-short-inner h2{color:#3273ab}.cld-info-box .cld-input-label,.cld-panel-short .cld-input-label,.cld-panel .cld-input-label{margin-bottom:.6rem}.cld-info-box.has-heading,.cld-panel-short.has-heading,.cld-panel.has-heading{border-top:0;margin-top:0}.cld-info-box-heading,.cld-panel-heading,.cld-panel-short-heading{display:flex;padding:.4rem 1.75rem .2rem;position:relative}.cld-info-box-heading.full-width,.cld-panel-heading.full-width,.cld-panel-short-heading.full-width{max-width:100%}.cld-info-box-heading img,.cld-panel-heading img,.cld-panel-short-heading img{margin-right:.6rem}.cld-info-box-heading.collapsible,.cld-panel-heading.collapsible,.cld-panel-short-heading.collapsible{cursor:pointer}.cld-info-box ul,.cld-panel-short ul,.cld-panel ul{list-style:initial;padding:0 3em}.cld-info-box .cld-plan,.cld-panel-short .cld-plan,.cld-panel .cld-plan{color:#3273ab;font-size:1.5em;font-weight:700}.cld-info-box .stat-boxes,.cld-panel-short .stat-boxes,.cld-panel .stat-boxes{border:1px solid #e5e5e5;font-size:1.2em}.cld-info-box .stat-boxes .box,.cld-panel-short .stat-boxes .box,.cld-panel .stat-boxes .box{border-bottom:1px solid #e5e5e5;padding:2rem;text-align:center}.cld-info-box .stat-boxes .box:last-of-type,.cld-panel-short .stat-boxes .box:last-of-type,.cld-panel .stat-boxes .box:last-of-type{border-bottom:none}.cld-info-box .stat-boxes .box .cld-ui-icon,.cld-panel-short .stat-boxes .box .cld-ui-icon,.cld-panel .stat-boxes .box .cld-ui-icon{height:35px;width:35px}.cld-info-box .stat-boxes .icon,.cld-panel-short .stat-boxes .icon,.cld-panel .stat-boxes .icon{height:50px;margin-right:.5em;width:50px}.cld-info-box .stat-boxes h3,.cld-panel-short .stat-boxes h3,.cld-panel .stat-boxes h3{margin-bottom:1.5rem;margin-top:2.4rem}.cld-info-box .stat-boxes .limit,.cld-panel-short .stat-boxes .limit,.cld-panel .stat-boxes .limit{font-size:2em;font-weight:700;margin-right:.5em;white-space:nowrap}.cld-info-box .stat-boxes .usage,.cld-panel-short .stat-boxes .usage,.cld-panel .stat-boxes .usage{color:#3273ab;font-size:1.5em;font-weight:400}@media only screen and (min-width:783px){.cld-info-box .stat-boxes,.cld-panel-short .stat-boxes,.cld-panel .stat-boxes{display:flex;flex-wrap:nowrap;font-size:1em}.cld-info-box .stat-boxes .box,.cld-panel-short .stat-boxes .box,.cld-panel .stat-boxes .box{border-bottom:none;border-right:1px solid #e5e5e5;flex-grow:1}.cld-info-box .stat-boxes .box:last-of-type,.cld-panel-short .stat-boxes .box:last-of-type,.cld-panel .stat-boxes .box:last-of-type{border-right:none}}@media only screen and (min-width:1200px){.cld-info-box .stat-boxes,.cld-panel-short .stat-boxes,.cld-panel .stat-boxes{font-size:1.2em}}.cld-info-box .img-connection-string,.cld-panel-short .img-connection-string,.cld-panel .img-connection-string{max-width:607px;width:100%}.cld-info-box .connection-string,.cld-panel-short .connection-string,.cld-panel .connection-string{max-width:40em;width:100%}.cld-info-box .media-status-box,.cld-info-box .stat-boxes,.cld-panel-short .media-status-box,.cld-panel-short .stat-boxes,.cld-panel .media-status-box,.cld-panel .stat-boxes{border:1px solid #e5e5e5}.cld-info-box .media-status-box,.cld-panel-short .media-status-box,.cld-panel .media-status-box{padding:2rem;text-align:center}.cld-info-box .media-status-box .status,.cld-panel-short .media-status-box .status,.cld-panel .media-status-box .status{font-size:2rem;font-weight:700;margin-right:.5em}.cld-info-box .media-status-box .cld-ui-icon,.cld-panel-short .media-status-box .cld-ui-icon,.cld-panel .media-status-box .cld-ui-icon{height:35px;width:35px}.cld-info-box .notification,.cld-panel-short .notification,.cld-panel .notification{display:inline-flex;font-weight:700;padding:1.5rem}.cld-info-box .notification-success,.cld-panel-short .notification-success,.cld-panel .notification-success{background-color:rgba(32,184,50,.2);border:2px solid #20b832}.cld-info-box .notification-success:before,.cld-panel-short .notification-success:before,.cld-panel .notification-success:before{color:#20b832}.cld-info-box .notification-syncing,.cld-panel-short .notification-syncing,.cld-panel .notification-syncing{background-color:rgba(50,115,171,.2);border:2px solid #3273ab;color:#444;text-decoration:none}.cld-info-box .notification-syncing:before,.cld-panel-short .notification-syncing:before,.cld-panel .notification-syncing:before{-webkit-animation:spin 1s infinite running;-moz-animation:spin 1s linear infinite;animation:spin 1s linear infinite;color:#3273ab}@keyframes spin{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.cld-info-box .notification:before,.cld-panel-short .notification:before,.cld-panel .notification:before{margin-right:.5em}.cld-info-box{display:flex;flex-direction:column}@media only screen and (min-width:783px){.cld-info-box{flex-direction:row}}.cld-info-box a.button,.cld-info-box img{align-self:center}.cld-info-box .cld-ui-body{margin:0 1.2rem}.cld-panel-short{display:inline-block;min-width:270px;width:auto}.cld-gallery-settings{box-sizing:border-box;display:flex;flex-wrap:wrap;padding:1rem 0;width:100%}@media only screen and (min-width:960px){.cld-gallery-settings{margin-left:-1rem;margin-right:-1rem}}.cld-gallery-settings__column{box-sizing:border-box;width:100%}@media only screen and (min-width:960px){.cld-gallery-settings__column{padding-left:1rem;padding-right:1rem;width:50%}}.components-base-control__field select{display:block;margin:1rem 0}.components-range-control__wrapper{margin:0!important}.components-range-control__root{flex-direction:row-reverse;margin:1rem 0}.components-input-control.components-number-control.components-range-control__number{margin-left:0!important;margin-right:16px}.components-panel{border:0!important}.components-panel__body:first-child{border-top:0!important}.components-panel__body:last-child{border-bottom:0!important}.components-textarea-control__input{display:block;margin:.5rem 0;width:100%}.tippy-box[data-theme~=cloudinary]{background-color:rgba(0,0,0,.8);color:#fff;font-size:.8em}table .cld-input{margin-bottom:0}tr .file-size.small{color:#a8a8a8;font-size:.8em;font-style:italic;letter-spacing:.4px;margin-left:6px;margin-right:6px}td.tree{color:#212529;line-height:1.5;padding-top:0;position:relative}td.tree ul.striped>:nth-child(odd){background-color:#f6f7f7}td.tree ul.striped>:nth-child(2n){background-color:#fff}td.tree .success{color:#20b832}td+td.tree{padding-top:0}td.tree .cld-input{margin-bottom:0;vertical-align:text-bottom}td.tree .cld-search{font-size:.9em;height:26px;margin-right:12px;min-height:20px;padding:4px 6px;vertical-align:initial}td.tree .file-size{color:#a8a8a8;font-size:.8em;font-style:italic;letter-spacing:.4px;margin-left:6px}td.tree .fa-folder,td.tree .fa-folder-open{color:#007bff}td.tree .fa-html5{color:#f21f10}td.tree ul{list-style:none;margin:0;padding-left:5px}td.tree ul li{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin-bottom:0;padding-bottom:5px;padding-left:25px;padding-top:5px;position:relative}td.tree ul li:before{height:1px;margin:auto;top:14px;width:20px}td.tree ul li:after,td.tree ul li:before{background-color:#666;content:"";left:0;position:absolute}td.tree ul li:after{bottom:0;height:100%;top:0;width:1px}td.tree ul li:after:nth-of-type(odd){background-color:#666}td.tree ul li:last-child:after{height:14px}td.tree ul a{cursor:pointer}td.tree ul a:hover{text-decoration:none} \ No newline at end of file +.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{background-color:#333;border-radius:4px;color:#fff;font-size:14px;line-height:1.4;outline:0;position:relative;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{border-top-color:initial;border-width:8px 8px 0;bottom:-7px;left:0;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:initial;border-width:0 8px 8px;left:0;top:-7px;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-left-color:initial;border-width:8px 0 8px 8px;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{border-right-color:initial;border-width:8px 8px 8px 0;left:-7px;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{color:#333;height:16px;width:16px}.tippy-arrow:before{border-color:transparent;border-style:solid;content:"";position:absolute}.tippy-content{padding:5px 9px;position:relative;z-index:1}@font-face{font-family:cloudinary;font-style:normal;font-weight:500;src:url(../css/fonts/cloudinary.7e6e75b25255a2b3b6e7ced1092c210c.eot);src:url(../css/fonts/cloudinary.7e6e75b25255a2b3b6e7ced1092c210c.eot#iefix) format("embedded-opentype"),url(../css/fonts/cloudinary.34cb260ad722325c597cdc3a3e7584d8.woff) format("woff"),url(../css/fonts/cloudinary.c2afda9d25532c03cd41beb20a1ce439.ttf) format("truetype"),url(../css/cloudinary.svg#cloudinary) format("svg")}.dashicons-cloudinary{speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-style:normal;font-variant:normal;font-weight:400;line-height:1;text-transform:none}.dashicons-cloudinary:before{content:"";font-family:cloudinary,monospace!important}.dashicons-cloudinary.success{color:#558b2f}.dashicons-cloudinary.error{color:#dd2c00}.dashicons-cloudinary.error:before{content:""}.dashicons-cloudinary.uploading{color:#fd9d2c}.dashicons-cloudinary.uploading:before{content:""}.dashicons-cloudinary.info{color:#0071ba}.dashicons-cloudinary.downloading:before{content:""}.dashicons-cloudinary.syncing:before{content:""}.column-cld_status{width:5.5em}.column-cld_status .dashicons-cloudinary{display:inline-block}.column-cld_status .dashicons-cloudinary:before{font-size:1.8rem}.form-field .error-notice,.form-table .error-notice{color:#dd2c00;display:none}.form-field input.cld-field:invalid,.form-table input.cld-field:invalid{border-color:#dd2c00}.form-field input.cld-field:invalid+.error-notice,.form-table input.cld-field:invalid+.error-notice{display:inline-block}.cloudinary-welcome{background-image:url(../css/logo.svg);background-position:top 12px right 20px;background-repeat:no-repeat;background-size:153px}.cloudinary-stats{display:inline-block;margin-left:25px}.cloudinary-stat{cursor:help}.cloudinary-percent{color:#0071ba;font-size:.8em;vertical-align:top}.settings-image{max-width:100%;padding-top:5px}.settings-tabs>li{display:inline-block}.settings-tabs>li a{padding:.6em}.settings-tabs>li a.active{background-color:#fff}.settings-tab-section{max-width:1030px;padding:20px 0 0;position:relative}.settings-tab-section.cloudinary-welcome .settings-tab-section-fields-dashboard{align-content:flex-start;align-items:flex-start;display:flex;margin-top:40px}.settings-tab-section.cloudinary-welcome .settings-tab-section-fields-dashboard-description{margin:0 auto 0 0;width:55%}.settings-tab-section.cloudinary-welcome .settings-tab-section-fields-dashboard-content{margin:0 auto;width:35%}.settings-tab-section.cloudinary-welcome .settings-tab-section-fields-dashboard-content .dashicons{color:#9ea3a8}.settings-tab-section.cloudinary-welcome .settings-tab-section-card{margin-top:0}.settings-tab-section-fields .field-heading th{color:#23282d;display:block;font-size:1.1em;margin:1em 0;width:auto}.settings-tab-section-fields .field-heading td{display:none;visibility:hidden}.settings-tab-section-fields .regular-textarea{height:60px;width:100%}.settings-tab-section-fields .dashicons{text-decoration:none;vertical-align:middle}.settings-tab-section-fields a .dashicons{color:#5f5f5f}.settings-tab-section-fields-dashboard-error{color:#5f5f5f;font-size:1.2em}.settings-tab-section-fields-dashboard-error.expanded{margin-bottom:25px;padding-top:40px}.settings-tab-section-fields-dashboard-error .dashicons{color:#ac0000}.settings-tab-section-fields-dashboard-error .button{font-size:1.1em;height:40px;line-height:40px;padding-left:40px;padding-right:40px}.settings-tab-section-fields-dashboard-success{color:#23282d;font-size:1.2em}.settings-tab-section-fields-dashboard-success.expanded{margin-bottom:25px;padding-top:40px}.settings-tab-section-fields-dashboard-success .dashicons{color:#4fb651}.settings-tab-section-fields-dashboard-success .button{font-size:1.1em;height:40px;line-height:40px;padding-left:40px;padding-right:40px}.settings-tab-section-fields-dashboard-success .description{color:#5f5f5f;font-weight:400;margin-top:12px}.settings-tab-section-card{background-color:#fff;border:1px solid #e5e5e5;box-shadow:0 1px 1px 0 rgba(0,0,0,.07);box-sizing:border-box;margin-top:12px;padding:20px 23px}.settings-tab-section-card .dashicons{font-size:1.4em}.settings-tab-section-card h2{font-size:1.8em;font-weight:400;margin-top:0}.settings-tab-section-card.pull-right{float:right;padding:12px;position:relative;width:450px;z-index:10}.settings-tab-section-card.pull-right img.settings-image{border:1px solid #979797;box-shadow:0 2px 4px 0 rgba(0,0,0,.5);margin-top:12px}.settings-tab-section-card.pull-right h3,.settings-tab-section-card.pull-right h4{margin-top:0}.settings-tab-section .field-row-cloudinary_url,.settings-tab-section .field-row-signup{display:block}.settings-tab-section .field-row-cloudinary_url td,.settings-tab-section .field-row-cloudinary_url th,.settings-tab-section .field-row-signup td,.settings-tab-section .field-row-signup th{display:block;padding:10px 0 0;width:auto}.settings-tab-section .field-row-cloudinary_url td .sign-up,.settings-tab-section .field-row-cloudinary_url th .sign-up,.settings-tab-section .field-row-signup td .sign-up,.settings-tab-section .field-row-signup th .sign-up{vertical-align:baseline}.settings-tab-section.connect .form-table{display:inline-block;max-width:580px;width:auto}.settings-valid{color:#558b2f;font-size:30px}.settings-valid-field{border-color:#558b2f!important}.settings-invalid-field{border-color:#dd2c00!important}.settings-alert{box-shadow:0 1px 1px rgba(0,0,0,.04);display:inline-block;padding:5px 7px}.settings-alert-info{background-color:#e9faff;border:1px solid #ccd0d4;border-left:4px solid #00a0d2}.settings-alert-warning{background-color:#fff5e9;border:1px solid #f6e7b6;border-left:4px solid #e3be38}.settings-alert-error{background-color:#ffe9e9;border:1px solid #d4cccc;border-left:4px solid #d20000}.field-radio input[type=radio].cld-field{margin:0 5px 0 0}.field-radio label{margin-right:10px}.settings-tab-section h2{margin:0}.cloudinary-collapsible{background-color:#fff;border:1px solid #ccd0d4;box-shadow:0 1px 1px rgba(0,0,0,.04);box-sizing:border-box;margin:20px 0;padding:10px;width:95%}.cloudinary-collapsible__toggle{cursor:pointer;display:flex;justify-content:space-between}.cloudinary-collapsible__toggle h2{margin:0!important}.cloudinary-collapsible__toggle button{background-color:inherit;border:none;cursor:pointer;margin:0;padding:0;width:auto}.cloudinary-deactivation .more{display:none}.cloudinary-deactivation input[type=radio]:checked~.more{color:#32373c;display:block;line-height:2;margin-left:2em;margin-top:.5em}.cloudinary-deactivation input[type=checkbox]~label{margin-left:.25em}.cloudinary-deactivation .modal-footer{background-color:#fcfcfc;border-top:1px solid #ddd;bottom:0;margin:0 -15px;padding:1em;position:absolute;width:calc(100% - 2em)}.cloudinary-deactivation .modal-footer .button-link{float:right}.cloudinary-deactivation .modal-footer .button-link:hover{background:transparent}.cloudinary-deactivation textarea{resize:none}.cloudinary-deactivation p{display:flex}.sync .spinner{display:inline-block;float:none;margin:0 5px 0 0;visibility:visible}.sync-media,.sync-media-progress{display:none}.sync-media-progress-outer{background-color:#e5e5e5;height:20px;margin:20px 0 10px;position:relative;width:500px}.sync-media-progress-outer .progress-bar{background-color:#558b2f;height:20px;transition:width .25s;width:0}.sync-media-progress-notice{color:#dd2c00}.sync-media-resource{display:inline-block;width:100px}.sync-media-error{color:#dd2c00}.sync-count{font-weight:700}.sync-details{margin-top:10px}.sync .button.start-sync,.sync .button.stop-sync{display:none;padding:0 16px}.sync .button.start-sync .dashicons,.sync .button.stop-sync .dashicons{line-height:2.2}.sync .progress-text{display:inline-block;font-weight:700;padding:12px 4px 12px 12px}.sync .completed{display:none;max-width:300px}.sync-status-disabled{color:#dd2c00}.sync-status-enabled{color:#558b2f}.sync-status-button.button{vertical-align:baseline}.cloudinary-widget{height:100%}.cloudinary-widget-wrapper{background-image:url(data:image/svg+xml;base64,PHN2ZyBjbGFzcz0ic3Bpbm5lciIgdmlld0JveD0iLTQgLTQgMTUxIDEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+PCFbQ0RBVEFbCiAgICAgIEBrZXlmcmFtZXMgY29sb3JzIHsKICAgICAgICAwJSB7IHN0cm9rZTogIzAwNzhGRjsgfQogICAgICAgICAgNTAlIHsgc3Ryb2tlOiAjMGUyZjVhOyB9CiAgICAgICAgICAxMDAlIHsgc3Ryb2tlOiAjMDA3OEZGOyB9CiAgICAgIH0KCiAgICAgIEBrZXlmcmFtZXMgZGFzaCB7CiAgICAgICAwJSB7IHN0cm9rZS1kYXNob2Zmc2V0OiA1NjA7IH0KICAgICAgIDUwJSB7CiAgICAgICAgICBzdHJva2UtZGFzaG9mZnNldDogMDsKICAgICAgIH0KICAgICAgIDEwMCUgeyAgIHN0cm9rZS1kYXNob2Zmc2V0OiA1NjA7IH0KICAgICAgfQogICAgICBALXdlYmtpdC1rZXlmcmFtZXMgY29sb3JzIHsKICAgICAgICAwJSB7IHN0cm9rZTogIzAwNzhmZjsgfQogICAgICAgICAgNTAlIHsgc3Ryb2tlOiAjMGUyZjVhOyB9CiAgICAgICAgICAxMDAlIHsgc3Ryb2tlOiAjMDA3OGZmOyB9CiAgICAgIH0KCiAgICAgIEAtd2Via2l0LWtleWZyYW1lcyBkYXNoIHsKICAgICAgIDAlIHsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDU2MDsgfQogICAgICAgNTAlIHsKICAgICAgICAgIHN0cm9rZS1kYXNob2Zmc2V0OiAwOwogICAgICAgfQogICAgICAgMTAwJSB7ICAgc3Ryb2tlLWRhc2hvZmZzZXQ6IDU2MDsKICAgICAgIH0KICAgICAgfQogICAgICAucGF0aCB7CiAgICAgICAgc3Ryb2tlLWRhc2hhcnJheTogMjgwOwogICAgICAgIHN0cm9rZS1kYXNob2Zmc2V0OiAwOwogICAgICAgIHRyYW5zZm9ybS1vcmlnaW46IGNlbnRlcjsKICAgICAgICAtd2Via2l0LWFuaW1hdGlvbjoKICAgICAgICAgIGRhc2ggMnMgZWFzZS1pbi1vdXQgaW5maW5pdGUsIGNvbG9ycyA4cyBlYXNlLWluLW91dCBpbmZpbml0ZTsKICAgICAgICBhbmltYXRpb246CiAgICAgICAgICBkYXNoIDJzIGVhc2UtaW4tb3V0IGluZmluaXRlLCBjb2xvcnMgOHMgZWFzZS1pbi1vdXQgaW5maW5pdGU7CiAgICAgIH0KICAgIF1dPjwvc3R5bGU+CiAgPHBhdGggY2xhc3M9InBhdGgiIGQ9Ik0xMjEuNjYzIDkwLjYzOGMtMS43OTYgMC05OS4zMy0uNDk4LTEwMS40NzQtMS40NzhDOC42ODUgODMuODc3IDEuMjUgNzIuMTk2IDEuMjUgNTkuMzk2YzAtMTYuNjU2IDEyLjc5Ny0zMC42MSAyOS4wNTItMzIuMzIzIDcuNDktMTUuNzA2IDIzLjE4Ni0yNS43MDcgNDAuNzE0LTI1LjcwNyAyMC45OCAwIDM5LjIxNSAxNC43NTIgNDMuOTQ1IDM0LjkwNyAxNS4wOS4yNDUgMjcuMjkgMTIuNjMgMjcuMjkgMjcuODIyIDAgMTEuOTY4LTcuNzM4IDIyLjU1LTE5LjI1NiAyNi4zMyIgc3Ryb2tlLXdpZHRoPSI5IiBzdHJva2UtbGluZWNhcD0icm91bmQiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPgo8L3N2Zz4K);background-position:50%;background-repeat:no-repeat;background-size:150px;height:100%;overflow:hidden}.attachment-actions .button.edit-attachment,.attachment-info .edit-attachment{display:none}.global-transformations-preview{max-width:600px;position:relative}.global-transformations-spinner{display:none}.global-transformations-button.button-primary{display:none;position:absolute;z-index:100}.global-transformations-url{margin-bottom:5px;margin-top:5px}.global-transformations-url-transformation{color:#51a3ff;max-width:100px;overflow:hidden;text-overflow:ellipsis}.global-transformations-url-file{color:#f2d864}.global-transformations-url-link{background-color:#262c35;border-radius:6px;color:#fff;display:block;overflow:hidden;padding:16px;text-decoration:none;text-overflow:ellipsis}.global-transformations-url-link:hover{color:#888;text-decoration:underline}.cld-tax-order-list-item{background-color:#fff;border:1px solid #efefef;margin:0 0 -1px;padding:4px}.cld-tax-order-list-item.no-items{color:#888;display:none;text-align:center}.cld-tax-order-list-item.no-items:last-child{display:block}.cld-tax-order-list-item.ui-sortable-helper{box-shadow:0 2px 5px rgba(0,0,0,.2)}.cld-tax-order-list-item-placeholder{background-color:#efefef;height:45px;margin:0}.cld-tax-order-list-item-handle{color:#999;cursor:grab;margin-right:4px}.cld-tax-order-list-type{display:inline-block;margin-right:8px}.cld-tax-order-list-type input{margin-right:4px!important}.cloudinary-media-library{margin-left:-20px;position:relative}@media screen and (max-width:782px){.cloudinary-media-library{margin-left:-10px}}.cld-pagenav{color:#555;line-height:2.4em;margin-top:5px;text-align:right}.cld-pagenav-text{margin:0 2em}.cld-delete{color:#dd2c00;cursor:pointer;float:right}.cld-apply-action{float:right}.cld-table thead tr th.cld-table-th{line-height:1.8em}.cld-loading{background-image:url(data:image/svg+xml;base64,PHN2ZyBjbGFzcz0ic3Bpbm5lciIgdmlld0JveD0iLTQgLTQgMTUxIDEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+PCFbQ0RBVEFbCiAgICAgIEBrZXlmcmFtZXMgY29sb3JzIHsKICAgICAgICAwJSB7IHN0cm9rZTogIzAwNzhGRjsgfQogICAgICAgICAgNTAlIHsgc3Ryb2tlOiAjMGUyZjVhOyB9CiAgICAgICAgICAxMDAlIHsgc3Ryb2tlOiAjMDA3OEZGOyB9CiAgICAgIH0KCiAgICAgIEBrZXlmcmFtZXMgZGFzaCB7CiAgICAgICAwJSB7IHN0cm9rZS1kYXNob2Zmc2V0OiA1NjA7IH0KICAgICAgIDUwJSB7CiAgICAgICAgICBzdHJva2UtZGFzaG9mZnNldDogMDsKICAgICAgIH0KICAgICAgIDEwMCUgeyAgIHN0cm9rZS1kYXNob2Zmc2V0OiA1NjA7IH0KICAgICAgfQogICAgICBALXdlYmtpdC1rZXlmcmFtZXMgY29sb3JzIHsKICAgICAgICAwJSB7IHN0cm9rZTogIzAwNzhmZjsgfQogICAgICAgICAgNTAlIHsgc3Ryb2tlOiAjMGUyZjVhOyB9CiAgICAgICAgICAxMDAlIHsgc3Ryb2tlOiAjMDA3OGZmOyB9CiAgICAgIH0KCiAgICAgIEAtd2Via2l0LWtleWZyYW1lcyBkYXNoIHsKICAgICAgIDAlIHsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDU2MDsgfQogICAgICAgNTAlIHsKICAgICAgICAgIHN0cm9rZS1kYXNob2Zmc2V0OiAwOwogICAgICAgfQogICAgICAgMTAwJSB7ICAgc3Ryb2tlLWRhc2hvZmZzZXQ6IDU2MDsKICAgICAgIH0KICAgICAgfQogICAgICAucGF0aCB7CiAgICAgICAgc3Ryb2tlLWRhc2hhcnJheTogMjgwOwogICAgICAgIHN0cm9rZS1kYXNob2Zmc2V0OiAwOwogICAgICAgIHRyYW5zZm9ybS1vcmlnaW46IGNlbnRlcjsKICAgICAgICAtd2Via2l0LWFuaW1hdGlvbjoKICAgICAgICAgIGRhc2ggMnMgZWFzZS1pbi1vdXQgaW5maW5pdGUsIGNvbG9ycyA4cyBlYXNlLWluLW91dCBpbmZpbml0ZTsKICAgICAgICBhbmltYXRpb246CiAgICAgICAgICBkYXNoIDJzIGVhc2UtaW4tb3V0IGluZmluaXRlLCBjb2xvcnMgOHMgZWFzZS1pbi1vdXQgaW5maW5pdGU7CiAgICAgIH0KICAgIF1dPjwvc3R5bGU+CiAgPHBhdGggY2xhc3M9InBhdGgiIGQ9Ik0xMjEuNjYzIDkwLjYzOGMtMS43OTYgMC05OS4zMy0uNDk4LTEwMS40NzQtMS40NzhDOC42ODUgODMuODc3IDEuMjUgNzIuMTk2IDEuMjUgNTkuMzk2YzAtMTYuNjU2IDEyLjc5Ny0zMC42MSAyOS4wNTItMzIuMzIzIDcuNDktMTUuNzA2IDIzLjE4Ni0yNS43MDcgNDAuNzE0LTI1LjcwNyAyMC45OCAwIDM5LjIxNSAxNC43NTIgNDMuOTQ1IDM0LjkwNyAxNS4wOS4yNDUgMjcuMjkgMTIuNjMgMjcuMjkgMjcuODIyIDAgMTEuOTY4LTcuNzM4IDIyLjU1LTE5LjI1NiAyNi4zMyIgc3Ryb2tlLXdpZHRoPSI5IiBzdHJva2UtbGluZWNhcD0icm91bmQiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPgo8L3N2Zz4K);background-position:50%;background-repeat:no-repeat;background-size:50px 50px;height:100px;width:auto}.cld-loading.tree-branch{background-position:25px;background-size:50px 50px}.cld-syncing{background:url(../css/loading.svg) no-repeat 50%;display:inline-block;height:20px;margin-left:12px;padding:4px;width:30px}.cld-footer{bottom:0;color:#555d66;left:0;padding:0;position:absolute;right:0}@media only screen and (min-width:783px){.cld-footer{margin-left:36px}}@media only screen and (min-width:960px){.cld-footer{margin-left:160px}}.cld-footer .cld-notice-box.is-success{background-color:#fff;border:0;color:#555;margin:0;padding:0}.cld-footer .cld-notice-box.is-success .cld-stars{margin-left:12px;text-decoration:none}.cld-footer .cld-notice-box.is-success .cld-stars .dashicons{color:#fd9d2c;position:inherit}.cld-footer .notice-dismiss:before{content:"";font-size:1.4rem;padding:6px 0 0}.cld-tooltip{font-size:1rem;margin-left:2px;margin-top:1px}.cld-notice-box{box-shadow:0 0 2px rgba(0,0,0,.1);margin-bottom:12px;margin-right:20px;position:relative}.cld-notice-box .cld-notice{padding:1rem 2.2rem .75rem 1.2rem}.cld-notice-box .cld-notice img.cld-ui-icon{height:100%}.cld-notice-box.is-dismissible{padding-right:38px}.cld-notice-box.has-icon{padding-left:38px}.cld-notice-box.is-created,.cld-notice-box.is-success,.cld-notice-box.is-updated{background-color:#ebf5ec;border-left:4px solid #42ad4f}.cld-notice-box.is-created .dashicons,.cld-notice-box.is-success .dashicons,.cld-notice-box.is-updated .dashicons{color:#2a0}.cld-notice-box.is-error{background-color:#f8e8e7;border-left:4px solid #cb3435}.cld-notice-box.is-error .dashicons{color:#dd2c00}.cld-notice-box.is-warning{background-color:#fff7e5;border-left:4px solid #f2ad4c}.cld-notice-box.is-warning .dashicons{color:#fd9d2c}.cld-notice-box.is-info{background-color:#e4f4f8;border-left:4px solid #2a95c3}.cld-notice-box.is-info .dashicons{color:#3273ab}.cld-notice-box.is-neutral{background-color:#fff;border-left:4px solid #ccd0d4}.cld-notice-box.is-neutral .dashicons{color:#90a0b3}.cld-notice-box.dismissed{overflow:hidden;transition:height .3s ease-out}.cld-notice-box .cld-ui-icon,.cld-notice-box .dashicons{left:19px;position:absolute;top:14px}.cld-ui-collapse{align-self:center;cursor:pointer;padding:0 .45rem}.cld-ui-title.collapsible{cursor:pointer}.cld-ui-conditional .closed,.cld-ui-wrap .closed{display:none}.cld-ui-wrap .cld-row{clear:both;margin:0 -1.75em}.cld-ui-wrap .cld-column{box-sizing:border-box;float:left;padding:0 1.75em;width:100%}@media only screen and (min-width:783px){.cld-ui-wrap .cld-column.column-45{width:45%}.cld-ui-wrap .cld-column.column-55{width:55%}}.cld-ui-wrap .cld-row:after{clear:both;content:"";display:table}.cld-image-preview,.cld-video-preview{background-color:hsla(0,0%,84.7%,.5);border-radius:5px;padding:7px}.cld-image-preview-wrapper,.cld-video-preview-wrapper{position:relative}.cld-image-preview .cld-ui-title,.cld-video-preview .cld-ui-title{font-weight:400;margin:0 0 .4rem}.cld-image-preview img,.cld-video-preview img{width:100%}.cld-page-header{align-items:center;margin-bottom:1em;padding:1.2rem}.cld-page-header,.cld-page-tabs{background-color:#fff;display:flex;margin-left:-20px}.cld-page-tabs{border-bottom:1px solid #e5e5e5;border-top:1px solid #e5e5e5;flex-wrap:wrap;margin-top:-1em;padding:0 1rem}.cld-page-tabs-tab{list-style:none;margin-bottom:0;text-indent:0}.cld-page-tabs-tab a{color:#000001;display:block;font-weight:500;padding:1rem 2rem;text-align:center;text-decoration:none;white-space:nowrap}.cld-page-tabs-tab.is-active a{border-bottom:2px solid #3273ab;color:#3273ab}.cld-group .cld-group .cld-group{padding-left:4px}.cld-group hr{border-top:1px solid #e5e5e5;clear:both;margin:1.5rem 0}.cld-group .cld-group .cld-group hr{display:none}.cld-group-heading{display:flex;justify-content:space-between}.cld-group-heading h3{font-size:.9rem}.cld-group-heading h3 .description{font-size:.7rem;font-weight:400;margin-left:.7em}.cld-input{display:block;margin-bottom:1.4rem}.cld-input-label{display:block;font-weight:700}.cld-input .regular-number,.cld-input .regular-text{border:1px solid #d0d0d0;border-radius:3px;padding:.1rem .5rem;width:100%}.cld-input .regular-number-small,.cld-input .regular-text-small{width:40%}.cld-input .prefixed{margin-left:6px;width:40%}.cld-input .suffixed{margin-right:6px;width:40%}.cld-input .regular-number{width:100px}.cld-input .regular-select{appearance:none;border:1px solid #d0d0d0;border-radius:3px;display:block;margin-top:.6rem;padding:.1rem .5rem;width:100%}.cld-input-on-off{align-items:center;display:inline-flex}.cld-input-on-off .description{margin:0}.cld-input-on-off .description.left{margin-left:0;margin-right:.4rem}.cld-input-on-off-control{display:inline-block;height:20px;margin-right:.4rem;position:relative;width:40px}.cld-input-on-off-control.disabled{opacity:.4}.cld-input-on-off-control input{height:0;opacity:0;width:0}.cld-input-on-off-control-slider{background-color:#90a0b3;border-radius:34px;bottom:0;cursor:pointer;left:0;position:absolute;right:0;top:0;transition:background-color .3s}input:checked+.cld-input-on-off-control-slider{background-color:#2a0!important}input:checked.partial+.cld-input-on-off-control-slider{background-color:#fd9d2c!important}input:checked.delete+.cld-input-on-off-control-slider{background-color:#dd2c00!important}.cld-input-on-off-control-slider:before{background-color:#fff;border-radius:50%;bottom:2px;content:"";display:block;height:16px;left:2px;position:absolute;transition:transform .2s;width:16px}input:checked+.cld-input-on-off-control-slider:before{transform:translateX(20px)}.mini input:checked+.cld-input-on-off-control-slider:before{transform:translateX(10px)}.cld-input-on-off-control.mini{height:10px;width:20px}.mini .cld-input-on-off-control-slider:before{bottom:1px;height:8px;left:1px;width:8px}.cld-input-icon-toggle{align-items:center;display:inline-flex}.cld-input-icon-toggle .description{margin:0 0 0 .4rem}.cld-input-icon-toggle .description.left{margin-left:0;margin-right:.4rem}.cld-input-icon-toggle-control{display:inline-block;position:relative}.cld-input-icon-toggle-control input{height:0;opacity:0;position:absolute;width:0}.cld-input-icon-toggle-control-slider .icon-on{display:none;visibility:hidden}.cld-input-icon-toggle-control-slider .icon-off,input:checked+.cld-input-icon-toggle-control-slider .icon-on{display:inline-block;visibility:visible}input:checked+.cld-input-icon-toggle-control-slider .icon-off{display:none;visibility:hidden}.cld-input-checkbox-label,.cld-input-radio-label{display:block;margin-bottom:.4rem}.cld-input-checkbox-label.list-inline,.cld-input-radio-label.list-inline{display:inline-block;margin-right:.4rem}.cld-info-box,.cld-panel,.cld-panel-short,.cld-submit,.cld-switch-cloud{background-color:#fff;border:1px solid #e5e5e5;margin-right:1rem;max-width:870px}.cld-info-box.full-width,.cld-panel-short.full-width,.cld-panel.full-width,.cld-submit.full-width,.cld-switch-cloud.full-width{max-width:100%}.cld-submit,.cld-switch-cloud{border-top:0;padding:1.2rem 1.75rem}.cld-info-box,.cld-panel,.cld-panel-short{margin-top:1rem;padding:2rem 1.75rem}.cld-info-box-inner,.cld-panel-inner,.cld-panel-short-inner{background-color:hsla(0,0%,86.3%,.2);border:1px solid #e5e5e5;margin:1em 0;padding:1.3rem}.cld-info-box-inner h2,.cld-panel-inner h2,.cld-panel-short-inner h2{color:#3273ab}.cld-info-box .cld-input-label,.cld-panel-short .cld-input-label,.cld-panel .cld-input-label{margin-bottom:.6rem}.cld-info-box.has-heading,.cld-panel-short.has-heading,.cld-panel.has-heading{border-top:0;margin-top:0}.cld-info-box-heading,.cld-panel-heading,.cld-panel-short-heading{display:flex;padding:.4rem 1.75rem .2rem;position:relative}.cld-info-box-heading.full-width,.cld-panel-heading.full-width,.cld-panel-short-heading.full-width{max-width:100%}.cld-info-box-heading img,.cld-panel-heading img,.cld-panel-short-heading img{margin-right:.6rem}.cld-info-box-heading.collapsible,.cld-panel-heading.collapsible,.cld-panel-short-heading.collapsible{cursor:pointer}.cld-info-box ul,.cld-panel-short ul,.cld-panel ul{list-style:initial;padding:0 3em}.cld-info-box .cld-plan,.cld-panel-short .cld-plan,.cld-panel .cld-plan{color:#3273ab;font-size:1.5em;font-weight:700}.cld-info-box .stat-boxes,.cld-panel-short .stat-boxes,.cld-panel .stat-boxes{border:1px solid #e5e5e5;font-size:1.2em}.cld-info-box .stat-boxes .box,.cld-panel-short .stat-boxes .box,.cld-panel .stat-boxes .box{border-bottom:1px solid #e5e5e5;padding:2rem;text-align:center}.cld-info-box .stat-boxes .box:last-of-type,.cld-panel-short .stat-boxes .box:last-of-type,.cld-panel .stat-boxes .box:last-of-type{border-bottom:none}.cld-info-box .stat-boxes .box .cld-ui-icon,.cld-panel-short .stat-boxes .box .cld-ui-icon,.cld-panel .stat-boxes .box .cld-ui-icon{height:35px;width:35px}.cld-info-box .stat-boxes .icon,.cld-panel-short .stat-boxes .icon,.cld-panel .stat-boxes .icon{height:50px;margin-right:.5em;width:50px}.cld-info-box .stat-boxes h3,.cld-panel-short .stat-boxes h3,.cld-panel .stat-boxes h3{margin-bottom:1.5rem;margin-top:2.4rem}.cld-info-box .stat-boxes .limit,.cld-panel-short .stat-boxes .limit,.cld-panel .stat-boxes .limit{font-size:2em;font-weight:700;margin-right:.5em;white-space:nowrap}.cld-info-box .stat-boxes .usage,.cld-panel-short .stat-boxes .usage,.cld-panel .stat-boxes .usage{color:#3273ab;font-size:1.5em;font-weight:400}@media only screen and (min-width:783px){.cld-info-box .stat-boxes,.cld-panel-short .stat-boxes,.cld-panel .stat-boxes{display:flex;flex-wrap:nowrap;font-size:1em}.cld-info-box .stat-boxes .box,.cld-panel-short .stat-boxes .box,.cld-panel .stat-boxes .box{border-bottom:none;border-right:1px solid #e5e5e5;flex-grow:1}.cld-info-box .stat-boxes .box:last-of-type,.cld-panel-short .stat-boxes .box:last-of-type,.cld-panel .stat-boxes .box:last-of-type{border-right:none}}@media only screen and (min-width:1200px){.cld-info-box .stat-boxes,.cld-panel-short .stat-boxes,.cld-panel .stat-boxes{font-size:1.2em}}.cld-info-box .img-connection-string,.cld-panel-short .img-connection-string,.cld-panel .img-connection-string{max-width:607px;width:100%}.cld-info-box .connection-string,.cld-panel-short .connection-string,.cld-panel .connection-string{max-width:40em;width:100%}.cld-info-box .media-status-box,.cld-info-box .stat-boxes,.cld-panel-short .media-status-box,.cld-panel-short .stat-boxes,.cld-panel .media-status-box,.cld-panel .stat-boxes{border:1px solid #e5e5e5}.cld-info-box .media-status-box,.cld-panel-short .media-status-box,.cld-panel .media-status-box{padding:2rem;text-align:center}.cld-info-box .media-status-box .status,.cld-panel-short .media-status-box .status,.cld-panel .media-status-box .status{font-size:2rem;font-weight:700;margin-right:.5em}.cld-info-box .media-status-box .cld-ui-icon,.cld-panel-short .media-status-box .cld-ui-icon,.cld-panel .media-status-box .cld-ui-icon{height:35px;width:35px}.cld-info-box .notification,.cld-panel-short .notification,.cld-panel .notification{display:inline-flex;font-weight:700;padding:1.5rem}.cld-info-box .notification-success,.cld-panel-short .notification-success,.cld-panel .notification-success{background-color:rgba(32,184,50,.2);border:2px solid #20b832}.cld-info-box .notification-success:before,.cld-panel-short .notification-success:before,.cld-panel .notification-success:before{color:#20b832}.cld-info-box .notification-syncing,.cld-panel-short .notification-syncing,.cld-panel .notification-syncing{background-color:rgba(50,115,171,.2);border:2px solid #3273ab;color:#444;text-decoration:none}.cld-info-box .notification-syncing:before,.cld-panel-short .notification-syncing:before,.cld-panel .notification-syncing:before{-webkit-animation:spin 1s infinite running;-moz-animation:spin 1s linear infinite;animation:spin 1s linear infinite;color:#3273ab}@keyframes spin{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.cld-info-box .notification:before,.cld-panel-short .notification:before,.cld-panel .notification:before{margin-right:.5em}.cld-info-box{display:flex;flex-direction:column}@media only screen and (min-width:783px){.cld-info-box{flex-direction:row}}.cld-info-box a.button,.cld-info-box img{align-self:center}.cld-info-box .cld-ui-body{margin:0 1.2rem}.cld-panel-short{display:inline-block;min-width:270px;width:auto}.cld-gallery-settings{box-sizing:border-box;display:flex;flex-wrap:wrap;padding:1rem 0;width:100%}@media only screen and (min-width:960px){.cld-gallery-settings{margin-left:-1rem;margin-right:-1rem}}.cld-gallery-settings__column{box-sizing:border-box;width:100%}@media only screen and (min-width:960px){.cld-gallery-settings__column{padding-left:1rem;padding-right:1rem;width:50%}}.components-base-control__field select{display:block;margin:1rem 0}.components-range-control__wrapper{margin:0!important}.components-range-control__root{flex-direction:row-reverse;margin:1rem 0}.components-input-control.components-number-control.components-range-control__number{margin-left:0!important;margin-right:16px}.components-panel{border:0!important}.components-panel__body:first-child{border-top:0!important}.components-panel__body:last-child{border-bottom:0!important}.components-textarea-control__input{display:block;margin:.5rem 0;width:100%}.tippy-box[data-theme~=cloudinary]{background-color:rgba(0,0,0,.8);color:#fff;font-size:.8em}table .cld-input{margin-bottom:0}tr .file-size.small{color:#a8a8a8;font-size:.8em;font-style:italic;letter-spacing:.4px;margin-left:6px;margin-right:6px}td.tree{color:#212529;line-height:1.5;padding-top:0;position:relative}td.tree ul.striped>:nth-child(odd){background-color:#f6f7f7}td.tree ul.striped>:nth-child(2n){background-color:#fff}td.tree .success{color:#20b832}td+td.tree{padding-top:0}td.tree .cld-input{margin-bottom:0;vertical-align:text-bottom}td.tree .cld-search{font-size:.9em;height:26px;margin-right:12px;min-height:20px;padding:4px 6px;vertical-align:initial}td.tree .file-size{color:#a8a8a8;font-size:.8em;font-style:italic;letter-spacing:.4px;margin-left:6px}td.tree .fa-folder,td.tree .fa-folder-open{color:#007bff}td.tree .fa-html5{color:#f21f10}td.tree ul{list-style:none;margin:0;padding-left:5px}td.tree ul li{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin-bottom:0;padding-bottom:5px;padding-left:25px;padding-top:5px;position:relative}td.tree ul li:before{height:1px;margin:auto;top:14px;width:20px}td.tree ul li:after,td.tree ul li:before{background-color:#666;content:"";left:0;position:absolute}td.tree ul li:after{bottom:0;height:100%;top:0;width:1px}td.tree ul li:after:nth-of-type(odd){background-color:#666}td.tree ul li:last-child:after{height:14px}td.tree ul a{cursor:pointer}td.tree ul a:hover{text-decoration:none} \ No newline at end of file diff --git a/css/src/components/_ui.scss b/css/src/components/_ui.scss index 78a9b44f5..963245f48 100644 --- a/css/src/components/_ui.scss +++ b/css/src/components/_ui.scss @@ -316,6 +316,9 @@ } &-group { + .cld-group .cld-group { + padding-left: 4px; + } hr { border-top: 1px solid $color-light-grey; @@ -323,7 +326,7 @@ clear: both; } - .cld-group .cld-group hr.cld-group { + .cld-group .cld-group hr { display: none; } diff --git a/js/responsive-breakpoints.asset.php b/js/responsive-breakpoints.asset.php index fdac4cce7..c250b9197 100644 --- a/js/responsive-breakpoints.asset.php +++ b/js/responsive-breakpoints.asset.php @@ -1 +1 @@ - array('wp-polyfill'), 'version' => '2e57412f751e461e197eb337dd1ce4bb'); \ No newline at end of file + array('wp-polyfill'), 'version' => '46fdb5ea26d8b2bbe02bc5006e568794'); \ No newline at end of file diff --git a/js/responsive-breakpoints.js b/js/responsive-breakpoints.js index b06ebfb6a..8e23e625b 100644 --- a/js/responsive-breakpoints.js +++ b/js/responsive-breakpoints.js @@ -1 +1 @@ -!function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);nMath.ceil(e)?e:t),t},_build:function(){var e=this;this.images.forEach((function(t){e.buildSize(t)}))},_shouldRebuild:function(e){var t=this.scaleSize(e.originalWidth,e.width,this.config.bytes_step),n=e.getBoundingClientRect(),i="auto"!==this.density?this._getDensity():1,o=window.innerHeight+parseInt(this.config.lazy_threshold,10);return n.tope.naturalWidth/i||!e.cld_loaded)},_shouldPlacehold:function(e){var t=this.scaleSize(e.originalWidth,e.width,this.config.bytes_step),n=e.getBoundingClientRect(),i="auto"!==this.density?this._getDensity():1,o=window.innerHeight+parseInt(this.config.lazy_threshold,10);return!e.cld_loaded&&n.top<2*o&&(t>e.naturalWidth/i||!e.cld_placehold)},getResponsiveSteps:function(e){return Math.ceil(e.dataset.breakpoints?e.originalWidth/e.dataset.breakpoints:this.responsiveStep)},getQuality:function(){var e="q_auto";switch(navigator&&navigator.connection?navigator.connection.effectiveType:"none"){case"none":break;case"4g":e="q_auto:good";break;case"3g":e="q_auto:eco";break;case"2g":case"slow-2g":e="q_auto:low";break;default:e="q_auto:best"}return e},scaleSize:function(e,t,n){var i=e-n*Math.floor((e-t)/n);return(i>e||this.config.max_widtht.length)&&(e=t.length);for(var n=0,r=new Array(e);nMath.ceil(t)?t:e),e},_build:function(){var t=this;this.images.forEach((function(e){t.buildSize(e)}))},_shouldRebuild:function(t){var e=this.scaleSize(t.originalWidth,t.width,this.config.bytes_step),n=t.getBoundingClientRect(),r="auto"!==this.density?this._getDensity():1,i=window.innerHeight+parseInt(this.config.lazy_threshold,10);return n.topt.naturalWidth/r||!t.cld_loaded)},_shouldPlacehold:function(t){var e=this.scaleSize(t.originalWidth,t.width,this.config.bytes_step),n=t.getBoundingClientRect(),r="auto"!==this.density?this._getDensity():1,i=window.innerHeight+parseInt(this.config.lazy_threshold,10);return!t.cld_loaded&&n.top<2*i&&(e>t.naturalWidth/r||!t.cld_placehold)},getResponsiveSteps:function(t){return Math.ceil(t.dataset.breakpoints?t.originalWidth/t.dataset.breakpoints:this.responsiveStep)},getQuality:function(){var t="q_auto";switch(navigator&&navigator.connection?navigator.connection.effectiveType:"none"){case"none":break;case"4g":t="q_auto:good";break;case"3g":t="q_auto:eco";break;case"2g":case"slow-2g":t="q_auto:low";break;default:t="q_auto:best"}return t},scaleSize:function(t,e,n){var r=t-n*Math.floor((t-e)/n);return(r>t||this.config.max_widthsettings->get_value(); - $meta = wp_get_attachment_metadata( $attachment_id, true ); + $meta = wp_get_attachment_metadata( $attachment_id, true ); + $size = array( + '100%', + '100%', + ); + if ( isset( $meta['width'] ) ) { + $size[0] = $meta['width']; + } + if ( isset( $meta['height'] ) ) { + $size[1] = $meta['height']; + } $format = $this->media->get_settings()->get_value( 'image_format' ); + if ( isset( $tag_element['atts']['srcset'] ) ) { + $tag_element['atts']['data-srcset'] = $tag_element['atts']['srcset']; + unset( $tag_element['atts']['srcset'] ); + } $src = $tag_element['atts']['src']; if ( ! $this->media->is_cloudinary_url( $src ) ) { $src = $this->media->cloudinary_url( $attachment_id ); @@ -162,13 +176,13 @@ public function add_features( $tag_element, $attachment_id, $original_tag ) { $color2 = 'rgba(' . $colors[0] . ',' . $colors[1] . ',' . $colors[2] . ',0)'; $color_str = $color1 . ';' . $color2 . ';' . $color1; } - $svg = ''; + $svg = ''; $tag_element['atts']['src'] = 'data:image/svg+xml;utf8,' . $svg; $tag_element['atts']['data-type'] = $format; unset( $tag_element['atts']['loading'] ); $tag_element['atts']['decoding'] = 'async'; - $tag_element['atts']['data-width'] = $meta['width']; + $tag_element['atts']['data-width'] = $size[0]; return $tag_element; } @@ -192,7 +206,7 @@ public function setup() { if ( ! is_admin() ) { $settings = $this->settings->get_value(); if ( isset( $settings['use_lazy_loading'] ) && 'on' === $settings['use_lazy_loading'] ) { - add_filter( 'cloudinary_pre_image_tag', array( $this, 'add_features' ), 10, 3 ); + add_filter( 'cloudinary_pre_image_tag', array( $this, 'add_features' ), 11, 3 ); } } } @@ -205,9 +219,10 @@ public function setup() { public function settings() { $args = array( - 'type' => 'group', - 'title' => __( 'Lazy Loading', 'cloudinary' ), - 'priority' => 9, + 'type' => 'group', + 'title' => __( 'Lazy Loading', 'cloudinary' ), + 'priority' => 9, + 'collapsible' => 'open', array( 'type' => 'on_off', 'description' => __( 'Enable lazy loading', 'cloudinary' ), @@ -232,12 +247,14 @@ public function settings() { 'default' => '1000px', ), array( - 'type' => 'radio', - 'title' => __( 'Placeholder generation', 'cloudinary' ), - 'slug' => 'lazy_placeholder', - 'description' => __( 'The placeholder', 'cloudinary' ), - 'default' => 'blur', - 'options' => array( + 'type' => 'radio', + 'title' => __( 'Placeholder generation', 'cloudinary' ), + 'slug' => 'lazy_placeholder', + 'default' => 'blur', + 'condition' => array( + 'enable_breakpoints' => true, + ), + 'options' => array( 'blur' => __( 'Blur', 'cloudinary' ), 'pixelate' => __( 'Pixelate', 'cloudinary' ), 'vectorize' => __( 'Vectorize', 'cloudinary' ), diff --git a/php/class-responsive-breakpoints.php b/php/class-responsive-breakpoints.php index e63debb85..70be31108 100644 --- a/php/class-responsive-breakpoints.php +++ b/php/class-responsive-breakpoints.php @@ -203,6 +203,9 @@ protected function register_settings() { 'title' => __( 'DPR settings', 'cloudinary' ), 'tooltip_text' => __( 'The distance from the original image for responsive breakpoints generation.', 'cloudinary' ), 'default' => 'auto', + 'condition' => array( + 'use_lazy_loading' => true, + ), 'options' => array( '0' => __( 'None', 'cloudinary' ), 'auto' => __( 'Auto', 'cloudinary' ), diff --git a/php/connect/class-api.php b/php/connect/class-api.php index 147412e11..78c8ea5c6 100644 --- a/php/connect/class-api.php +++ b/php/connect/class-api.php @@ -209,6 +209,8 @@ function ( $item ) use ( $transformation_index ) { $key = array_search( $type, $transformation_index, true ); if ( false !== $key ) { $transform[] = $key . '_' . $value; + } elseif ( '$' === $type[0] ) { + $transform[] = $type . '_' . $value; } } diff --git a/ui-definitions/settings-image.php b/ui-definitions/settings-image.php index 73e7b058c..5c04a6dfc 100644 --- a/ui-definitions/settings-image.php +++ b/ui-definitions/settings-image.php @@ -91,56 +91,61 @@ 'collapsible' => 'open', 'slug' => 'image_display', array( - 'type' => 'on_off', - 'slug' => 'enable_breakpoints', + 'type' => 'group', 'title' => __( 'Image breakpoints', 'cloudinary' ), - 'tooltip_text' => __( 'Automatically generate multiple sizes based on the configured breakpoints to enable your images to responsively adjust to different screen sizes. Note that your Cloudinary usage will increase when enabling responsive images.', 'cloudinary' ), - 'description' => __( 'Enable responsive images.', 'cloudinary' ), - 'default' => 'off', - ), - array( - 'type' => 'group', - 'title' => __( 'Image breakpoints', 'cloudinary' ), - 'slug' => 'image_breakpoints', - 'condition' => array( - 'enable_breakpoints' => true, - ), 'collapsible' => 'open', array( - 'type' => 'number', - 'slug' => 'breakpoints', - 'title' => __( 'Max breakpoints', 'cloudinary' ), - 'tooltip_text' => __( 'The maximum number of images to be generated when delivering responsive images. For some images, the responsive algorithm may determine that the ideal number of breakpoints is smaller than the value you specify.', 'cloudinary' ), - 'suffix' => __( 'Valid values: 3-200', 'cloudinary' ), - 'default' => 3, - 'attributes' => array( - 'min' => 3, - 'max' => 200, - ), - ), - array( - 'type' => 'number', - 'slug' => 'bytes_step', - 'title' => __( 'Byte step', 'cloudinary' ), - 'tooltip_text' => __( 'The minimum number of bytes between two consecutive breakpoints.', 'cloudinary' ), - 'suffix' => __( 'bytes', 'cloudinary' ), - 'default' => 200, + 'type' => 'on_off', + 'slug' => 'enable_breakpoints', + 'title' => __( 'Breakpoints', 'cloudinary' ), + 'tooltip_text' => __( 'Automatically generate multiple sizes based on the configured breakpoints to enable your images to responsively adjust to different screen sizes. Note that your Cloudinary usage will increase when enabling responsive images.', 'cloudinary' ), + 'description' => __( 'Enable responsive images.', 'cloudinary' ), + 'default' => 'off', ), array( - 'type' => 'number', - 'slug' => 'max_width', - 'title' => __( 'Image width limit', 'cloudinary' ), - 'tooltip_text' => __( 'The minimum and maximum width of an image created as a breakpoint. Leave max as empty to auto detect based on largest registered size in WordPress.', 'cloudinary' ), - 'prefix' => __( 'Max', 'cloudinary' ), - 'suffix' => __( 'px', 'cloudinary' ), - 'default' => $this->default_max_width(), - ), - array( - 'type' => 'number', - 'slug' => 'min_width', - 'prefix' => __( 'Min', 'cloudinary' ), - 'suffix' => __( 'px', 'cloudinary' ), - 'default' => 800, + 'type' => 'group', + 'title' => __( 'Image breakpoints', 'cloudinary' ), + 'slug' => 'image_breakpoints', + 'condition' => array( + 'enable_breakpoints' => true, + ), + 'collapsible' => 'open', + array( + 'type' => 'number', + 'slug' => 'breakpoints', + 'title' => __( 'Max breakpoints', 'cloudinary' ), + 'tooltip_text' => __( 'The maximum number of images to be generated when delivering responsive images. For some images, the responsive algorithm may determine that the ideal number of breakpoints is smaller than the value you specify.', 'cloudinary' ), + 'suffix' => __( 'Valid values: 3-200', 'cloudinary' ), + 'default' => 3, + 'attributes' => array( + 'min' => 3, + 'max' => 200, + ), + ), + array( + 'type' => 'number', + 'slug' => 'bytes_step', + 'title' => __( 'Byte step', 'cloudinary' ), + 'tooltip_text' => __( 'The minimum number of bytes between two consecutive breakpoints.', 'cloudinary' ), + 'suffix' => __( 'bytes', 'cloudinary' ), + 'default' => 200, + ), + array( + 'type' => 'number', + 'slug' => 'max_width', + 'title' => __( 'Image width limit', 'cloudinary' ), + 'tooltip_text' => __( 'The minimum and maximum width of an image created as a breakpoint. Leave max as empty to auto detect based on largest registered size in WordPress.', 'cloudinary' ), + 'prefix' => __( 'Max', 'cloudinary' ), + 'suffix' => __( 'px', 'cloudinary' ), + 'default' => $this->default_max_width(), + ), + array( + 'type' => 'number', + 'slug' => 'min_width', + 'prefix' => __( 'Min', 'cloudinary' ), + 'suffix' => __( 'px', 'cloudinary' ), + 'default' => 800, + ), ), ), ), From f60d2b1ba7fded18e4646645ab2a184220663745 Mon Sep 17 00:00:00 2001 From: Marco Pereirinha Date: Thu, 8 Jul 2021 17:32:01 +0100 Subject: [PATCH 29/56] Add Cloudidary analytics --- php/class-media.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/php/class-media.php b/php/class-media.php index 39c61e6de..382e209be 100644 --- a/php/class-media.php +++ b/php/class-media.php @@ -988,6 +988,14 @@ public function cloudinary_url( $attachment_id, $size = array(), $transformation $url = $this->convert_media_extension( $url ); } + // Add Cloudinary analytics. + $url = add_query_arg( + array( + '_i' => 'AA', + ), + $url + ); + /** * Filter the final Cloudinary URL. * From 23df59c4b6c9a0822a88e27b64d7451884ebb19b Mon Sep 17 00:00:00 2001 From: David Cramer Date: Fri, 9 Jul 2021 09:53:54 +0200 Subject: [PATCH 30/56] fix dpr setting and allow precision setting --- js/responsive-breakpoints.asset.php | 2 +- js/responsive-breakpoints.js | 2 +- js/src/responsive-breakpoints.js | 17 ++++++++++++----- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/js/responsive-breakpoints.asset.php b/js/responsive-breakpoints.asset.php index c250b9197..e284d3003 100644 --- a/js/responsive-breakpoints.asset.php +++ b/js/responsive-breakpoints.asset.php @@ -1 +1 @@ - array('wp-polyfill'), 'version' => '46fdb5ea26d8b2bbe02bc5006e568794'); \ No newline at end of file + array('wp-polyfill'), 'version' => '9787261c6b3e0d95726b2c8891403f31'); \ No newline at end of file diff --git a/js/responsive-breakpoints.js b/js/responsive-breakpoints.js index 8e23e625b..b7919a953 100644 --- a/js/responsive-breakpoints.js +++ b/js/responsive-breakpoints.js @@ -1 +1 @@ -!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=2)}([function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nMath.ceil(t)?t:e),e},_build:function(){var t=this;this.images.forEach((function(e){t.buildSize(e)}))},_shouldRebuild:function(t){var e=this.scaleSize(t.originalWidth,t.width,this.config.bytes_step),n=t.getBoundingClientRect(),r="auto"!==this.density?this._getDensity():1,i=window.innerHeight+parseInt(this.config.lazy_threshold,10);return n.topt.naturalWidth/r||!t.cld_loaded)},_shouldPlacehold:function(t){var e=this.scaleSize(t.originalWidth,t.width,this.config.bytes_step),n=t.getBoundingClientRect(),r="auto"!==this.density?this._getDensity():1,i=window.innerHeight+parseInt(this.config.lazy_threshold,10);return!t.cld_loaded&&n.top<2*i&&(e>t.naturalWidth/r||!t.cld_placehold)},getResponsiveSteps:function(t){return Math.ceil(t.dataset.breakpoints?t.originalWidth/t.dataset.breakpoints:this.responsiveStep)},getQuality:function(){var t="q_auto";switch(navigator&&navigator.connection?navigator.connection.effectiveType:"none"){case"none":break;case"4g":t="q_auto:good";break;case"3g":t="q_auto:eco";break;case"2g":case"slow-2g":t="q_auto:low";break;default:t="q_auto:best"}return t},scaleSize:function(t,e,n){var r=t-n*Math.floor((t-e)/n);return(r>t||this.config.max_widthe.length)&&(t=e.length);for(var n=0,r=new Array(t);nMath.ceil(e)?e:t),t},_build:function(){var e=this;this.images.forEach((function(t){e.buildSize(t)}))},_shouldRebuild:function(e){var t=this.scaleSize(e.originalWidth,e.width,this.config.bytes_step),n=e.getBoundingClientRect(),r="auto"!==this.density?this._getDensity():1,i=window.innerHeight+parseInt(this.config.lazy_threshold,10);return n.tope.naturalWidth/r||!e.cld_loaded)},_shouldPlacehold:function(e){var t=this.scaleSize(e.originalWidth,e.width,this.config.bytes_step),n=e.getBoundingClientRect(),r="auto"!==this.density?this._getDensity():1,i=window.innerHeight+parseInt(this.config.lazy_threshold,10);return!e.cld_loaded&&n.top<2*i&&(t>e.naturalWidth/r||!e.cld_placehold)},getResponsiveSteps:function(e){return Math.ceil(e.dataset.breakpoints?e.originalWidth/e.dataset.breakpoints:this.responsiveStep)},getQuality:function(){var e="q_auto";switch(navigator&&navigator.connection?navigator.connection.effectiveType:"none"){case"none":break;case"4g":e="q_auto:good";break;case"3g":e="q_auto:eco";break;case"2g":case"slow-2g":e="q_auto:low";break;default:e="q_auto:best"}return e},scaleSize:function(e,t,n){var r=e-n*Math.floor((e-t)/n);return(r>e||this.config.max_width Math.ceil( maxDensity ) ? maxDensity : deviceDensity; } + return deviceDensity; }, _build() { @@ -143,15 +147,18 @@ const ResponsiveBreakpoints = { image.width, this.config.bytes_step ); - const newSize = 'w_' + width + ',dpr_' + this._getDensity(); + const density = this._getDensity(); + let newSize = 'w_' + width; + if ( 1 !== density ) { + newSize += ',dpr_' + density; + } return image.dataset.src .replace( '--size--', newSize ) - .replace( '/--placehold--', '' ) .replace( /q_auto(?!:)/gi, this.getQuality() ); }, getPlaceholderURL( image ) { image.cld_placehold = true; - return image.dataset.placeholder; + return image.dataset.placeholder.replace( '/--size--', '/' ); }, }; // Init. From 2a268fa723d285d896f69bb155e0bd1d0eeab637 Mon Sep 17 00:00:00 2001 From: David Cramer Date: Fri, 9 Jul 2021 09:55:32 +0200 Subject: [PATCH 31/56] reorder hook registration and value resetting --- php/class-lazy-load.php | 27 +++++++++++++------ php/class-responsive-breakpoints.php | 40 +++++++++++++--------------- 2 files changed, 37 insertions(+), 30 deletions(-) diff --git a/php/class-lazy-load.php b/php/class-lazy-load.php index b959659ea..5bba2ddd9 100644 --- a/php/class-lazy-load.php +++ b/php/class-lazy-load.php @@ -7,6 +7,7 @@ namespace Cloudinary; +use Cloudinary\Component\Assets; use Cloudinary\Component\Setup; use Cloudinary\Connect\Api; use \Cloudinary\Settings\Setting; @@ -16,7 +17,7 @@ * * @package Cloudinary */ -class Lazy_Load implements Setup { +class Lazy_Load implements Setup, Assets { /** * Holds the plugin instance. @@ -187,6 +188,23 @@ public function add_features( $tag_element, $attachment_id, $original_tag ) { return $tag_element; } + /** + * Register front end hooks. + */ + public function register_assets() { + add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_assets' ) ); + } + + /** + * Apply front end filters on the enqueue_assets hook. + */ + public function enqueue_assets() { + $settings = $this->settings->get_value(); + if ( isset( $settings['use_lazy_loading'] ) && 'on' === $settings['use_lazy_loading'] ) { + add_filter( 'cloudinary_pre_image_tag', array( $this, 'add_features' ), 11, 3 ); + } + } + /** * Check if component is active. * @@ -201,14 +219,7 @@ public function is_active() { * Setup the class. */ public function setup() { - $this->register_settings(); - if ( ! is_admin() ) { - $settings = $this->settings->get_value(); - if ( isset( $settings['use_lazy_loading'] ) && 'on' === $settings['use_lazy_loading'] ) { - add_filter( 'cloudinary_pre_image_tag', array( $this, 'add_features' ), 11, 3 ); - } - } } /** diff --git a/php/class-responsive-breakpoints.php b/php/class-responsive-breakpoints.php index 70be31108..1b48e2ce2 100644 --- a/php/class-responsive-breakpoints.php +++ b/php/class-responsive-breakpoints.php @@ -10,6 +10,7 @@ use Cloudinary\Component\Assets; use Cloudinary\Component\Setup; use Cloudinary\Connect\Api; +use Cloudinary\Settings\Setting; /** * Class Responsive_Breakpoints @@ -51,7 +52,7 @@ class Responsive_Breakpoints implements Setup, Assets { /** * Holds the settings. * - * @var Settings + * @var Setting */ protected $settings; @@ -84,11 +85,10 @@ public function __construct( Plugin $plugin ) { */ public function add_features( $tag_element, $attachment_id, $original_tag ) { - $src = $tag_element['atts']['src']; - if ( ! $this->media->is_cloudinary_url( $src ) ) { - $src = $this->media->cloudinary_url( $attachment_id ); + if ( ! $this->media->is_cloudinary_url( $tag_element['atts']['src'] ) ) { + $tag_element['atts']['src'] = $this->media->cloudinary_url( $attachment_id ); } - $transformations = $this->media->get_transformations_from_string( $src ); + $transformations = $this->media->get_transformations_from_string( $tag_element['atts']['src'] ); $original_string = Api::generate_transformation_string( $transformations ); // Check if first is a size. @@ -96,9 +96,9 @@ public function add_features( $tag_element, $attachment_id, $original_tag ) { // remove the size. array_shift( $transformations ); } - $size_str = '--size--/' . Api::generate_transformation_string( $transformations ); - $data_url = str_replace( $original_string, $size_str, $src ); - $tag_element['atts']['data-src'] = $data_url; + $size_str = '--size--/' . Api::generate_transformation_string( $transformations ); + $data_url = str_replace( $original_string, $size_str, $tag_element['atts']['src'] ); + $tag_element['atts']['src'] = $data_url; if ( isset( $tag_element['atts']['srcset'] ) ) { unset( $tag_element['atts']['srcset'], $tag_element['atts']['sizes'] ); } @@ -107,7 +107,7 @@ public function add_features( $tag_element, $attachment_id, $original_tag ) { } /** - * Check if component is active.§ + * Check if component is active. * * @return bool */ @@ -120,11 +120,8 @@ public function is_active() { * Register assets to be used for the class. */ public function register_assets() { - wp_register_script( 'cld-responsive-breakpoints', $this->plugin->dir_url . 'js/responsive-breakpoints.js', null, $this->plugin->version, false ); - if ( ! is_admin() ) { - $this->enqueue_assets(); - } + add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_assets' ) ); } /** @@ -132,8 +129,11 @@ public function register_assets() { */ public function enqueue_assets() { wp_enqueue_script( 'cld-responsive-breakpoints' ); - $config = $this->media->get_settings()->get_value( 'image_display' ); + $config = $this->settings->get_value(); wp_add_inline_script( 'cld-responsive-breakpoints', 'var CLDLB = ' . wp_json_encode( $config ), 'before' ); + if ( isset( $config['use_lazy_loading'] ) && 'on' === $config['use_lazy_loading'] && 'on' === $config['enable_breakpoints'] ) { + add_filter( 'cloudinary_pre_image_tag', array( $this, 'add_features' ), 10, 3 ); + } } /** @@ -142,12 +142,6 @@ public function enqueue_assets() { public function setup() { $this->register_settings(); add_filter( 'cloudinary_sync_base_struct', array( $this, 'remove_legacy_breakpoints' ) ); - if ( ! is_admin() ) { - $settings = $this->settings->get_value(); - if ( isset( $settings['use_lazy_loading'] ) && 'on' === $settings['use_lazy_loading'] && 'on' === $settings['enable_breakpoints'] ) { - add_filter( 'cloudinary_pre_image_tag', array( $this, 'add_features' ), 10, 3 ); - } - } } /** @@ -203,11 +197,11 @@ protected function register_settings() { 'title' => __( 'DPR settings', 'cloudinary' ), 'tooltip_text' => __( 'The distance from the original image for responsive breakpoints generation.', 'cloudinary' ), 'default' => 'auto', - 'condition' => array( + 'condition' => array( 'use_lazy_loading' => true, ), 'options' => array( - '0' => __( 'None', 'cloudinary' ), + 'off' => __( 'None', 'cloudinary' ), 'auto' => __( 'Auto', 'cloudinary' ), '2' => __( '2X', 'cloudinary' ), '3' => __( '3X', 'cloudinary' ), @@ -215,6 +209,8 @@ protected function register_settings() { ), ); $image_breakpoints->create_setting( 'dpr', $params, $image_breakpoints )->get_value(); + // Reset the option parent. + $media_settings->get_option_parent()->set_value( null ); $this->settings = $media_settings; } From a7e4f6440549c6d2725e35aeaef735a02260a8fc Mon Sep 17 00:00:00 2001 From: David Cramer Date: Fri, 9 Jul 2021 13:40:16 +0200 Subject: [PATCH 32/56] rename js to lazy-load --- ...ive-breakpoints.asset.php => lazy-load.asset.php} | 2 +- js/lazy-load.js | 1 + js/responsive-breakpoints.js | 1 - js/src/{responsive-breakpoints.js => lazy-load.js} | 12 ++++++------ webpack.config.js | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) rename js/{responsive-breakpoints.asset.php => lazy-load.asset.php} (59%) create mode 100644 js/lazy-load.js delete mode 100644 js/responsive-breakpoints.js rename js/src/{responsive-breakpoints.js => lazy-load.js} (95%) diff --git a/js/responsive-breakpoints.asset.php b/js/lazy-load.asset.php similarity index 59% rename from js/responsive-breakpoints.asset.php rename to js/lazy-load.asset.php index e284d3003..7e2370bf7 100644 --- a/js/responsive-breakpoints.asset.php +++ b/js/lazy-load.asset.php @@ -1 +1 @@ - array('wp-polyfill'), 'version' => '9787261c6b3e0d95726b2c8891403f31'); \ No newline at end of file + array('wp-polyfill'), 'version' => 'a549847d7ae3b044ff97a918e0569120'); \ No newline at end of file diff --git a/js/lazy-load.js b/js/lazy-load.js new file mode 100644 index 000000000..789b570ad --- /dev/null +++ b/js/lazy-load.js @@ -0,0 +1 @@ +!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nMath.ceil(e)?e:t),t},_build:function(){var e=this;this.images.forEach((function(t){e.buildSize(t)}))},_shouldRebuild:function(e){var t=this.scaleSize(e.originalWidth,e.width,this.config.pixel_step),n=e.getBoundingClientRect(),r="auto"!==this.density?this._getDensity():1,i=window.innerHeight+parseInt(this.config.lazy_threshold,10);return n.tope.naturalWidth/r||!e.cld_loaded)},_shouldPlacehold:function(e){var t=this.scaleSize(e.originalWidth,e.width,this.config.pixel_step),n=e.getBoundingClientRect(),r="auto"!==this.density?this._getDensity():1,i=window.innerHeight+parseInt(this.config.lazy_threshold,10);return!e.cld_loaded&&n.top<2*i&&(t>e.naturalWidth/r||!e.cld_placehold)},getResponsiveSteps:function(e){return Math.ceil(e.dataset.breakpoints?e.originalWidth/e.dataset.breakpoints:this.responsiveStep)},getQuality:function(){var e="q_auto";switch(navigator&&navigator.connection?navigator.connection.effectiveType:"none"){case"none":break;case"4g":e="q_auto:good";break;case"3g":e="q_auto:eco";break;case"2g":case"slow-2g":e="q_auto:low";break;default:e="q_auto:best"}return e},scaleSize:function(e,t,n){var r=e-n*Math.floor((e-t)/n);return(r>e||this.config.max_widthe.length)&&(t=e.length);for(var n=0,r=new Array(t);nMath.ceil(e)?e:t),t},_build:function(){var e=this;this.images.forEach((function(t){e.buildSize(t)}))},_shouldRebuild:function(e){var t=this.scaleSize(e.originalWidth,e.width,this.config.bytes_step),n=e.getBoundingClientRect(),r="auto"!==this.density?this._getDensity():1,i=window.innerHeight+parseInt(this.config.lazy_threshold,10);return n.tope.naturalWidth/r||!e.cld_loaded)},_shouldPlacehold:function(e){var t=this.scaleSize(e.originalWidth,e.width,this.config.bytes_step),n=e.getBoundingClientRect(),r="auto"!==this.density?this._getDensity():1,i=window.innerHeight+parseInt(this.config.lazy_threshold,10);return!e.cld_loaded&&n.top<2*i&&(t>e.naturalWidth/r||!e.cld_placehold)},getResponsiveSteps:function(e){return Math.ceil(e.dataset.breakpoints?e.originalWidth/e.dataset.breakpoints:this.responsiveStep)},getQuality:function(){var e="q_auto";switch(navigator&&navigator.connection?navigator.connection.effectiveType:"none"){case"none":break;case"4g":e="q_auto:good";break;case"3g":e="q_auto:eco";break;case"2g":case"slow-2g":e="q_auto:low";break;default:e="q_auto:best"}return e},scaleSize:function(e,t,n){var r=e-n*Math.floor((e-t)/n);return(r>e||this.config.max_width { - ResponsiveBreakpoints._init(); + LazyLoad._init(); } ); diff --git a/webpack.config.js b/webpack.config.js index 404509b7b..0bdea27fc 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -197,11 +197,11 @@ const cldVideoInit = { }, }; -const cldResponsiveBreakpoints = { +const cldLazyLoad = { ...defaultConfig, ...sharedConfig, entry: { - 'responsive-breakpoints': './js/src/responsive-breakpoints.js', + 'lazy-load': './js/src/lazy-load.js', }, }; @@ -214,5 +214,5 @@ module.exports = [ cldVideoInit, cldSettingsGallery, cldGalleryUI, - cldResponsiveBreakpoints, + cldLazyLoad, ]; From 0a7e1ea9ad9115f60c498fecc9fcb0d63cb853bc Mon Sep 17 00:00:00 2001 From: David Cramer Date: Fri, 9 Jul 2021 13:42:30 +0200 Subject: [PATCH 33/56] refactor classes into an abstract --- php/class-beta.php | 2 +- php/class-delivery-feature.php | 188 ++++++++++++++++++ php/{ => delivery}/class-lazy-load.php | 75 ++----- .../class-responsive-breakpoints.php | 132 +++++------- 4 files changed, 258 insertions(+), 139 deletions(-) create mode 100644 php/class-delivery-feature.php rename php/{ => delivery}/class-lazy-load.php (83%) rename php/{ => delivery}/class-responsive-breakpoints.php (59%) diff --git a/php/class-beta.php b/php/class-beta.php index f49eb7801..6a3879733 100644 --- a/php/class-beta.php +++ b/php/class-beta.php @@ -41,7 +41,7 @@ public function __construct( Plugin $plugin ) { 'options' => array(), ), 'responsive_breakpoints' => array( - 'class' => array( 'Cloudinary\Lazy_Load', 'Cloudinary\Responsive_Breakpoints' ), + 'class' => array( 'Cloudinary\Delivery\Lazy_Load', 'Cloudinary\Delivery\Responsive_Breakpoints' ), 'name' => __( 'New Lazy Load and Responsive Breakpoints', 'cloudinary' ), 'options' => array(), 'deps' => array( 'delivery' ), diff --git a/php/class-delivery-feature.php b/php/class-delivery-feature.php new file mode 100644 index 000000000..d0374f929 --- /dev/null +++ b/php/class-delivery-feature.php @@ -0,0 +1,188 @@ +plugin = $plugin; + $this->media = $plugin->get_component( 'media' ); + + add_action( 'cloudinary_init_settings', array( $this, 'setup' ) ); + } + + /** + * Register hooks. + */ + public function init() { + $this->config = $this->settings->get_value(); + if ( $this->is_active() ) { + add_action( 'wp_enqueue_scripts', array( $this, 'maybe_enqueue_assets' ) ); + } + if ( $this->is_enabled() ) { + $this->setup_hooks(); + } + } + + /** + * Setup hooks used when enabled. + */ + protected function setup_hooks() { + + } + + /** + * Enqueue assets if active and enabled. + */ + public function maybe_enqueue_assets() { + if ( $this->is_enabled() ) { + // Add filter to add features. + add_filter( 'cloudinary_pre_image_tag', array( $this, 'add_features' ), $this->priority, 3 ); + $this->enqueue_assets(); + } + } + + /** + * Add features to a tag element set. + * + * @param array $tag_element The tag element set. + * @param int $attachment_id The attachment id. + * @param string $original_tag The original html tag. + * + * @return array + */ + public function add_features( $tag_element, $attachment_id, $original_tag ) { + return $tag_element; + } + + /** + * Check if component is active. + * + * @return bool + */ + public function is_active() { + return ! is_admin(); + } + + /** + * Register assets to be used for the class. + */ + public function register_assets() { + } + + /** + * Enqueue Assets. + */ + public function enqueue_assets() { + } + + /** + * Check to see if Breakpoints are enabled. + * + * @return bool + */ + public function is_enabled() { + return isset( $this->config[ $this->enable_slug ] ) && 'on' === $this->config[ $this->enable_slug ]; + } + + /** + * Create the settings. + */ + protected function create_settings() { + $this->settings = $this->plugin->settings->create_setting( $this->settings_slug, $this->settings() ); + } + + /** + * Setup the class. + */ + public function setup() { + $this->create_settings(); + $this->register_settings(); + $this->init(); + } + + /** + * Define the settings. + * + * @return array + */ + public function settings() { + return array(); + } + + /** + * Register the setting under media. + */ + protected function register_settings() { + } +} diff --git a/php/class-lazy-load.php b/php/delivery/class-lazy-load.php similarity index 83% rename from php/class-lazy-load.php rename to php/delivery/class-lazy-load.php index 5bba2ddd9..3a805ca34 100644 --- a/php/class-lazy-load.php +++ b/php/delivery/class-lazy-load.php @@ -5,35 +5,17 @@ * @package Cloudinary */ -namespace Cloudinary; +namespace Cloudinary\Delivery; -use Cloudinary\Component\Assets; -use Cloudinary\Component\Setup; +use Cloudinary\Delivery_Feature; use Cloudinary\Connect\Api; -use \Cloudinary\Settings\Setting; /** * Class Responsive_Breakpoints * * @package Cloudinary */ -class Lazy_Load implements Setup, Assets { - - /** - * Holds the plugin instance. - * - * @since 0.1 - * - * @var Plugin Instance of the global plugin. - */ - public $plugin; - - /** - * Holds the Media instance. - * - * @var Media - */ - protected $media; +class Lazy_Load extends Delivery_Feature { /** * Holds the settings slug. @@ -43,21 +25,11 @@ class Lazy_Load implements Setup, Assets { protected $settings_slug = 'lazy_load'; /** - * Holds the settings. - * - * @var Setting - */ - protected $settings; - - /** - * Responsive_Breakpoints constructor. + * Holds the enabler slug. * - * @param Plugin $plugin Instance of the plugin. + * @var string */ - public function __construct( Plugin $plugin ) { - $this->plugin = $plugin; - $this->media = $plugin->get_component( 'media' ); - } + protected $enable_slug = 'use_lazy_load'; /** * Get the placeholder generation transformations. @@ -172,7 +144,12 @@ public function add_features( $tag_element, $attachment_id, $original_tag ) { $color_str = $settings['lazy_custom_color']; if ( 'on' === $settings['lazy_animate'] ) { - $colors = explode( ',', rtrim( substr( $settings['lazy_custom_color'], 5 ), ')' ) ); + preg_match_all( '/[0-9.^]+/', $settings['lazy_custom_color'], $custom ); + $colors = array_shift( $custom ); + if ( ! isset( $colors[3] ) ) { + $colors[3] = 1; + } + $color1 = 'rgba(' . $colors[0] . ',' . $colors[1] . ',' . $colors[2] . ',' . $colors[3] . ')'; $color2 = 'rgba(' . $colors[0] . ',' . $colors[1] . ',' . $colors[2] . ',0)'; $color_str = $color1 . ';' . $color2 . ';' . $color1; @@ -192,17 +169,16 @@ public function add_features( $tag_element, $attachment_id, $original_tag ) { * Register front end hooks. */ public function register_assets() { - add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_assets' ) ); + wp_register_script( 'cld-lazy-load', $this->plugin->dir_url . 'js/lazy-load.js', null, $this->plugin->version, false ); } /** * Apply front end filters on the enqueue_assets hook. */ public function enqueue_assets() { - $settings = $this->settings->get_value(); - if ( isset( $settings['use_lazy_loading'] ) && 'on' === $settings['use_lazy_loading'] ) { - add_filter( 'cloudinary_pre_image_tag', array( $this, 'add_features' ), 11, 3 ); - } + wp_enqueue_script( 'cld-lazy-load' ); + $config = $this->settings->get_parent()->get_value(); // Get top most config. + wp_add_inline_script( 'cld-lazy-load', 'var CLDLB = ' . wp_json_encode( $config ), 'before' ); } /** @@ -215,13 +191,6 @@ public function is_active() { return ! is_admin(); } - /** - * Setup the class. - */ - public function setup() { - $this->register_settings(); - } - /** * Define the settings. * @@ -237,13 +206,13 @@ public function settings() { array( 'type' => 'on_off', 'description' => __( 'Enable lazy loading', 'cloudinary' ), - 'slug' => 'use_lazy_loading', + 'slug' => 'use_lazy_load', 'default' => 'on', ), array( 'type' => 'group', 'condition' => array( - 'use_lazy_loading' => true, + 'use_lazy_load' => true, ), array( 'type' => 'text', @@ -299,14 +268,14 @@ protected function register_settings() { // Move setting to media. $media_settings = $this->media->get_settings()->get_setting( 'image_display' ); - $settings_params = $this->settings(); - $this->settings = $media_settings->create_setting( $this->settings_slug, $settings_params, $media_settings ); + // Add to media. + $media_settings->add_setting( $this->settings ); // Reset the option parent. $this->settings->get_option_parent()->set_value( null ); $condition = array( - 'use_lazy_loading' => false, + 'use_lazy_load' => false, ); $bk = $media_settings->get_setting( 'breakpoints' ); $bk->set_param( 'condition', $condition ); @@ -315,7 +284,7 @@ protected function register_settings() { $image_breakpoints = $media_settings->get_setting( 'image_breakpoints' ); $bytes_step = $image_breakpoints->get_setting( 'bytes_step' ); $condition = array( - 'use_lazy_loading' => false, + 'use_lazy_load' => false, ); $bytes_step->set_param( 'condition', $condition ); $bytes_step->rebuild_component(); diff --git a/php/class-responsive-breakpoints.php b/php/delivery/class-responsive-breakpoints.php similarity index 59% rename from php/class-responsive-breakpoints.php rename to php/delivery/class-responsive-breakpoints.php index 1b48e2ce2..f92974d4c 100644 --- a/php/class-responsive-breakpoints.php +++ b/php/delivery/class-responsive-breakpoints.php @@ -5,35 +5,24 @@ * @package Cloudinary */ -namespace Cloudinary; +namespace Cloudinary\Delivery; -use Cloudinary\Component\Assets; -use Cloudinary\Component\Setup; +use Cloudinary\Delivery_Feature; use Cloudinary\Connect\Api; -use Cloudinary\Settings\Setting; /** * Class Responsive_Breakpoints * * @package Cloudinary */ -class Responsive_Breakpoints implements Setup, Assets { +class Responsive_Breakpoints extends Delivery_Feature { /** - * Holds the plugin instance. + * The feature application priority. * - * @since 0.1 - * - * @var Plugin Instance of the global plugin. - */ - public $plugin; - - /** - * Holds the Media instance. - * - * @var Media + * @var int */ - protected $media; + protected $priority = 9; /** * Holds the settings slug. @@ -43,35 +32,17 @@ class Responsive_Breakpoints implements Setup, Assets { protected $settings_slug = 'responsive_breakpoints'; /** - * Flag to determine if we're in the breakpoints change. + * Holds the enabler slug. * - * @var bool - */ - protected $doing_responsive = false; - - /** - * Holds the settings. - * - * @var Setting - */ - protected $settings; - - /** - * Holds the current post. - * - * @var int + * @var string */ - protected $current_post; + protected $enable_slug = 'enable_breakpoints'; /** - * Responsive_Breakpoints constructor. - * - * @param Plugin $plugin Instance of the plugin. + * Setup hooks used when enabled. */ - public function __construct( Plugin $plugin ) { - - $this->plugin = $plugin; - $this->media = $plugin->get_component( 'media' ); + protected function setup_hooks() { + add_action( 'cloudinary_init_delivery', array( $this, 'remove_srcset_filter' ) ); } /** @@ -96,9 +67,11 @@ public function add_features( $tag_element, $attachment_id, $original_tag ) { // remove the size. array_shift( $transformations ); } - $size_str = '--size--/' . Api::generate_transformation_string( $transformations ); - $data_url = str_replace( $original_string, $size_str, $tag_element['atts']['src'] ); - $tag_element['atts']['src'] = $data_url; + $size_str = '--size--'; + if ( ! empty( $transformations ) ) { + $size_str .= '/' . Api::generate_transformation_string( $transformations ); + } + $tag_element['atts']['src'] = str_replace( $original_string, $size_str, $tag_element['atts']['src'] ); if ( isset( $tag_element['atts']['srcset'] ) ) { unset( $tag_element['atts']['srcset'], $tag_element['atts']['sizes'] ); } @@ -107,64 +80,50 @@ public function add_features( $tag_element, $attachment_id, $original_tag ) { } /** - * Check if component is active. + * Remove the legacy breakpoints sync type and filters. * - * @return bool + * @param array $structs The sync types structure. + * + * @return array */ - public function is_active() { + public function remove_legacy_breakpoints( $structs ) { + unset( $structs['breakpoints'] ); - return ! is_admin(); + return $structs; } /** - * Register assets to be used for the class. + * Check to see if Breakpoints are enabled. + * + * @return bool */ - public function register_assets() { - wp_register_script( 'cld-responsive-breakpoints', $this->plugin->dir_url . 'js/responsive-breakpoints.js', null, $this->plugin->version, false ); - add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_assets' ) ); + public function is_enabled() { + $lazy = $this->plugin->get_component( 'lazy_load' ); + $lazy_enabled = $lazy->is_enabled(); + + return ! is_null( $lazy ) && $lazy->is_enabled() && parent::is_enabled(); } /** - * Enqueue Assets + * Remove the srcset filter. */ - public function enqueue_assets() { - wp_enqueue_script( 'cld-responsive-breakpoints' ); - $config = $this->settings->get_value(); - wp_add_inline_script( 'cld-responsive-breakpoints', 'var CLDLB = ' . wp_json_encode( $config ), 'before' ); - if ( isset( $config['use_lazy_loading'] ) && 'on' === $config['use_lazy_loading'] && 'on' === $config['enable_breakpoints'] ) { - add_filter( 'cloudinary_pre_image_tag', array( $this, 'add_features' ), 10, 3 ); - } + public function remove_srcset_filter() { + remove_filter( 'wp_calculate_image_srcset', array( $this->media, 'image_srcset' ), 10 ); } /** * Setup the class. */ public function setup() { - $this->register_settings(); + parent::setup(); add_filter( 'cloudinary_sync_base_struct', array( $this, 'remove_legacy_breakpoints' ) ); } /** - * Remove the legacy breakpoints sync type and filters. - * - * @param array $structs The sync types structure. - * - * @return array + * Create Settings. */ - public function remove_legacy_breakpoints( $structs ) { - unset( $structs['breakpoints'] ); - remove_filter( 'wp_calculate_image_srcset', array( $this->media, 'image_srcset' ), 10 ); - - return $structs; - } - - /** - * Define the settings. - * - * @return array - */ - public function settings() { - return array(); + protected function create_settings() { + $this->settings = $this->media->get_settings()->get_setting( 'image_display' ); } /** @@ -172,8 +131,7 @@ public function settings() { */ protected function register_settings() { - $media_settings = $this->media->get_settings()->get_setting( 'image_display' ); - $image_breakpoints = $media_settings->get_setting( 'image_breakpoints' ); + $image_breakpoints = $this->settings->get_setting( 'image_breakpoints' ); // Add pixel step. $params = array( 'type' => 'number', @@ -189,6 +147,7 @@ protected function register_settings() { ); $image_breakpoints->create_setting( 'pixel_step', $params, $image_breakpoints ); + $self = $this; // Add density. $params = array( 'type' => 'select', @@ -200,6 +159,11 @@ protected function register_settings() { 'condition' => array( 'use_lazy_loading' => true, ), + 'enabled' => function () use ( $self ) { + $settings = $self->settings->get_value(); + + return ! isset( $settings['dpr_precise'] ); + }, 'options' => array( 'off' => __( 'None', 'cloudinary' ), 'auto' => __( 'Auto', 'cloudinary' ), @@ -210,8 +174,6 @@ protected function register_settings() { ); $image_breakpoints->create_setting( 'dpr', $params, $image_breakpoints )->get_value(); // Reset the option parent. - $media_settings->get_option_parent()->set_value( null ); - - $this->settings = $media_settings; + $this->settings->get_option_parent()->set_value( null ); } } From 83af3f738ca48d169ad11cd3489bce49f43af5c4 Mon Sep 17 00:00:00 2001 From: David Cramer Date: Fri, 9 Jul 2021 13:43:26 +0200 Subject: [PATCH 34/56] introduce setting init action --- php/class-plugin.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/php/class-plugin.php b/php/class-plugin.php index ceef9098f..94b276208 100644 --- a/php/class-plugin.php +++ b/php/class-plugin.php @@ -212,6 +212,18 @@ public function setup_settings() { $connect_title = $connect->get_param( 'menu_title' ) . $count; $connect->set_param( 'menu_title', $connect_title ); } + + /** + * Action indicating that the Settings are initialised. + * + * @hook cloudinary_init_settings + * @since 2.7.5 + * + * @param $plugin {Plugin} The core plugin object. + * + * @return void + */ + do_action( 'cloudinary_init_settings', $this ); } /** From aeb63aec71e4b6d0183be380607ffae4f39c6575 Mon Sep 17 00:00:00 2001 From: David Cramer Date: Fri, 9 Jul 2021 13:45:22 +0200 Subject: [PATCH 35/56] introduce delivery init action and move old breackpoints to init_delivery --- php/class-delivery.php | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/php/class-delivery.php b/php/class-delivery.php index 96a6c6a69..6abf545ee 100644 --- a/php/class-delivery.php +++ b/php/class-delivery.php @@ -85,6 +85,7 @@ protected function setup_hooks() { add_action( 'cloudinary_flush_cache', array( $this, 'clear_cache' ) ); add_filter( 'cloudinary_current_post_id', array( $this, 'get_current_post_id' ) ); add_filter( 'the_content', array( $this, 'add_post_id' ) ); + add_filter( 'wp_img_tag_add_srcset_and_sizes_attr', '__return_false' ); // Clear cache on taxonomy update. $taxonomies = get_taxonomies( array( 'show_ui' => true ) ); @@ -142,12 +143,31 @@ public function setup() { $this->sync = $this->media->sync; // Add filters. - add_filter( 'wp_calculate_image_srcset', array( $this->media, 'image_srcset' ), 10, 5 ); add_action( 'save_post', array( $this, 'remove_replace_cache' ) ); add_action( 'cloudinary_string_replace', array( $this, 'catch_urls' ) ); add_filter( 'post_thumbnail_html', array( $this, 'process_featured_image' ), 100, 3 ); } + /** + * Init delivery. + */ + protected function init_delivery() { + + add_filter( 'wp_calculate_image_srcset', array( $this->media, 'image_srcset' ), 10, 5 ); + + /** + * Action indicating that the delivery is starting.s + * + * @hook cloudinary_pre_image_tag + * @since 2.7.5 + * + * @param $delivery {Delivery} The delivery object. + * + * @return void + */ + do_action( 'cloudinary_init_delivery', $this ); + } + /** * Add classes to the featured image tag. * From c0e33dc632e0296a31b0011dc3fd8ca29e392993 Mon Sep 17 00:00:00 2001 From: David Cramer Date: Fri, 9 Jul 2021 13:46:30 +0200 Subject: [PATCH 36/56] refactor rebuild_tag to do less work --- php/class-delivery.php | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/php/class-delivery.php b/php/class-delivery.php index 6abf545ee..b69b438c3 100644 --- a/php/class-delivery.php +++ b/php/class-delivery.php @@ -343,8 +343,12 @@ public function convert_tags( $content ) { */ public function rebuild_tag( $element, $attachment_id ) { + $image_meta = wp_get_attachment_metadata( $attachment_id ); // Check overwrite. - $overwrite = (bool) strpos( $element, 'cld-overwrite' ); + $image_meta['overwrite_transformations'] = (bool) strpos( $element, 'cld-overwrite' ); + + // Try add srcset if not present. + $element = wp_image_add_srcset_and_sizes( $element, $image_meta, $attachment_id ); // Get tag element. $tag_element = $this->parse_element( $element ); @@ -352,25 +356,12 @@ public function rebuild_tag( $element, $attachment_id ) { // Get size. $size = $this->get_size_from_atts( $tag_element['atts'] ); - // If no srcset, lets see if we can create them (ie, featured image etc...). - if ( ! isset( $tag_element['atts']['srcset'] ) && ! empty( $this->media->get_post_meta( $attachment_id, Sync::META_KEYS['breakpoints'] ) ) ) { - $image_meta = wp_get_attachment_metadata( $attachment_id ); - $srcset = $this->media->image_srcset( array(), $size, $tag_element['atts']['src'], $image_meta, $attachment_id ); - $srcset = array_map( - function ( $set ) { - return $set['url'] . ' ' . $set['value'] . $set['descriptor']; - }, - $srcset - ); - $tag_element['atts']['srcset'] = implode( ', ', $srcset ); - } // Get transformations if present. $transformations = $this->get_transformations_maybe( $tag_element['atts']['src'] ); // Get cloudinary URL, only if overwrite or has inline transformations. Catch all will replace standard urls. - if ( $overwrite || $transformations ) { - // Create new src url. - $tag_element['atts']['src'] = $this->media->cloudinary_url( $attachment_id, $size, $transformations, null, $overwrite ); + if ( $image_meta['overwrite_transformations'] || $transformations ) { + $tag_element['atts']['src'] = $this->media->cloudinary_url( $attachment_id, $size, $transformations, null, $image_meta['overwrite_transformations'] ); } /** @@ -465,7 +456,7 @@ protected function get_transformations_maybe( $url ) { * @param string $content The HTML to catch URLS from. */ public function catch_urls( $content ) { - + $this->init_delivery(); $known = $this->convert_tags( $content ); $urls = wp_extract_urls( $content ); $dirs = wp_get_upload_dir(); From ccd5ddd080af231b65fef2606350bb10afb0db5a Mon Sep 17 00:00:00 2001 From: David Cramer Date: Fri, 9 Jul 2021 14:54:45 +0200 Subject: [PATCH 37/56] add calcs for threshold unit --- js/lazy-load.asset.php | 2 +- js/lazy-load.js | 2 +- js/src/lazy-load.js | 45 +++++++++++++++++++++++++------- php/delivery/class-lazy-load.php | 2 +- 4 files changed, 39 insertions(+), 12 deletions(-) diff --git a/js/lazy-load.asset.php b/js/lazy-load.asset.php index 7e2370bf7..5ea78bc17 100644 --- a/js/lazy-load.asset.php +++ b/js/lazy-load.asset.php @@ -1 +1 @@ - array('wp-polyfill'), 'version' => 'a549847d7ae3b044ff97a918e0569120'); \ No newline at end of file + array('wp-polyfill'), 'version' => '65dd00356873d60cfc1f685aee91c0c1'); \ No newline at end of file diff --git a/js/lazy-load.js b/js/lazy-load.js index 789b570ad..b3efb51d3 100644 --- a/js/lazy-load.js +++ b/js/lazy-load.js @@ -1 +1 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nMath.ceil(e)?e:t),t},_build:function(){var e=this;this.images.forEach((function(t){e.buildSize(t)}))},_shouldRebuild:function(e){var t=this.scaleSize(e.originalWidth,e.width,this.config.pixel_step),n=e.getBoundingClientRect(),r="auto"!==this.density?this._getDensity():1,i=window.innerHeight+parseInt(this.config.lazy_threshold,10);return n.tope.naturalWidth/r||!e.cld_loaded)},_shouldPlacehold:function(e){var t=this.scaleSize(e.originalWidth,e.width,this.config.pixel_step),n=e.getBoundingClientRect(),r="auto"!==this.density?this._getDensity():1,i=window.innerHeight+parseInt(this.config.lazy_threshold,10);return!e.cld_loaded&&n.top<2*i&&(t>e.naturalWidth/r||!e.cld_placehold)},getResponsiveSteps:function(e){return Math.ceil(e.dataset.breakpoints?e.originalWidth/e.dataset.breakpoints:this.responsiveStep)},getQuality:function(){var e="q_auto";switch(navigator&&navigator.connection?navigator.connection.effectiveType:"none"){case"none":break;case"4g":e="q_auto:good";break;case"3g":e="q_auto:eco";break;case"2g":case"slow-2g":e="q_auto:low";break;default:e="q_auto:best"}return e},scaleSize:function(e,t,n){var r=e-n*Math.floor((e-t)/n);return(r>e||this.config.max_widthe.length)&&(t=e.length);for(var r=0,n=new Array(t);rMath.ceil(e)?e:t),t},_build:function(){var e=this;this.images.forEach((function(t){e.buildSize(t)}))},_shouldRebuild:function(e){var t=this.scaleSize(e.originalWidth,e.width,this.config.pixel_step),r=e.getBoundingClientRect(),n="auto"!==this.density?this._getDensity():1;return r.tope.naturalWidth/n||!e.cld_loaded)},_shouldPlacehold:function(e){var t=this.scaleSize(e.originalWidth,e.width,this.config.pixel_step),r=e.getBoundingClientRect(),n="auto"!==this.density?this._getDensity():1;return!e.cld_loaded&&r.top<2*this.lazyThreshold&&(t>e.naturalWidth/n||!e.cld_placehold)},getResponsiveSteps:function(e){return Math.ceil(e.dataset.breakpoints?e.originalWidth/e.dataset.breakpoints:this.responsiveStep)},getQuality:function(){var e="q_auto";switch(navigator&&navigator.connection?navigator.connection.effectiveType:"none"){case"none":break;case"4g":e="q_auto:good";break;case"3g":e="q_auto:eco";break;case"2g":case"slow-2g":e="q_auto:low";break;default:e="q_auto:best"}return e},scaleSize:function(e,t,r){var n=e-r*Math.floor((e-t)/r);return(n>e||this.config.max_width { if ( ! image.dataset.src ) { return; @@ -22,6 +24,32 @@ const LazyLoad = { // Build images. this._build(); }, + _calcThreshold() { + const number = this.config.lazy_threshold.replace( /[^0-9]/g, '' ); + const type = this.config.lazy_threshold + .replace( /[0-9]/g, '' ) + .toLowerCase(); + let unit = 0; + switch ( type ) { + case 'em': + unit = + parseFloat( getComputedStyle( document.body ).fontSize ) * + number; + break; + case 'rem': + unit = + parseFloat( + getComputedStyle( document.documentElement ).fontSize + ) * number; + break; + case 'vh': + unit = ( window.innerHeight / number ) * 100; + break; + default: + unit = number; + } + this.lazyThreshold = window.innerHeight + parseInt( unit, 10 ); + }, _debounceBuild() { if ( this.debounce ) { clearTimeout( this.debounce ); @@ -58,10 +86,8 @@ const LazyLoad = { ); const rect = image.getBoundingClientRect(); const density = 'auto' !== this.density ? this._getDensity() : 1; - const diff = - window.innerHeight + parseInt( this.config.lazy_threshold, 10 ); return ( - rect.top < diff && + rect.top < this.lazyThreshold && ( width > image.naturalWidth / density || ! image.cld_loaded ) ); }, @@ -73,11 +99,9 @@ const LazyLoad = { ); const rect = image.getBoundingClientRect(); const density = 'auto' !== this.density ? this._getDensity() : 1; - const diff = - window.innerHeight + parseInt( this.config.lazy_threshold, 10 ); return ( ! image.cld_loaded && - rect.top < diff * 2 && + rect.top < this.lazyThreshold * 2 && ( width > image.naturalWidth / density || ! image.cld_placehold ) ); }, @@ -148,9 +172,12 @@ const LazyLoad = { this.config.pixel_step ); const density = this._getDensity(); - let newSize = 'w_' + width; - if ( 1 !== density ) { - newSize += ',dpr_' + density; + let newSize = ''; + if ( width ) { + newSize += 'w_' + width; + if ( 1 !== density ) { + newSize += ',dpr_' + density; + } } return image.dataset.src .replace( '--size--', newSize ) diff --git a/php/delivery/class-lazy-load.php b/php/delivery/class-lazy-load.php index 3a805ca34..9e91f2424 100644 --- a/php/delivery/class-lazy-load.php +++ b/php/delivery/class-lazy-load.php @@ -222,7 +222,7 @@ public function settings() { 'style' => array( 'width:100px;display:block;', ), - 'data-auto-suffix' => '*px;em;rem;vw;vh', + 'data-auto-suffix' => '*px;em;rem;vh', ), 'default' => '1000px', ), From f3865cc1593c40c0c6e9ce701dcddf16bb808d6b Mon Sep 17 00:00:00 2001 From: David Cramer Date: Fri, 9 Jul 2021 15:02:22 +0200 Subject: [PATCH 38/56] stop errors from trying to get width on an svg --- 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 39c61e6de..23a6d1edd 100644 --- a/php/class-media.php +++ b/php/class-media.php @@ -1941,7 +1941,7 @@ public function get_breakpoint_options( $attachment_id ) { if ( empty( $meta ) ) { $meta = array(); $imagesize = getimagesize( get_attached_file( $attachment_id ) ); - $meta['width'] = $imagesize[0] ? $imagesize[0] : 0; + $meta['width'] = isset( $imagesize[0] ) ? $imagesize[0] : 0; } $max_width = $this->get_max_width(); // Add breakpoints request options. From ad42980080a7d66870b62fa659dd2b3e00d06c33 Mon Sep 17 00:00:00 2001 From: Marco Pereirinha Date: Fri, 9 Jul 2021 15:57:48 +0100 Subject: [PATCH 39/56] Prevent filtering analytics --- php/class-media.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/php/class-media.php b/php/class-media.php index 382e209be..e75d73106 100644 --- a/php/class-media.php +++ b/php/class-media.php @@ -988,14 +988,6 @@ public function cloudinary_url( $attachment_id, $size = array(), $transformation $url = $this->convert_media_extension( $url ); } - // Add Cloudinary analytics. - $url = add_query_arg( - array( - '_i' => 'AA', - ), - $url - ); - /** * Filter the final Cloudinary URL. * @@ -1005,7 +997,15 @@ public function cloudinary_url( $attachment_id, $size = array(), $transformation * * @return string */ - return apply_filters( 'cloudinary_converted_url', $url, $attachment_id, $pre_args ); + $url = apply_filters( 'cloudinary_converted_url', $url, $attachment_id, $pre_args ); + + // Add Cloudinary analytics. + return add_query_arg( + array( + '_i' => 'AA', + ), + $url + ); } /** From 8f4d3f7ad1b40ad29bf8155c488a5f1f9b38bd0f Mon Sep 17 00:00:00 2001 From: David Cramer Date: Fri, 9 Jul 2021 18:33:01 +0200 Subject: [PATCH 40/56] clean up dpr detection --- js/lazy-load.asset.php | 2 +- js/lazy-load.js | 2 +- js/src/lazy-load.js | 8 +++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/js/lazy-load.asset.php b/js/lazy-load.asset.php index 5ea78bc17..506a6dd72 100644 --- a/js/lazy-load.asset.php +++ b/js/lazy-load.asset.php @@ -1 +1 @@ - array('wp-polyfill'), 'version' => '65dd00356873d60cfc1f685aee91c0c1'); \ No newline at end of file + array('wp-polyfill'), 'version' => '4f54b160de748912ea5ea5d8ce80f326'); \ No newline at end of file diff --git a/js/lazy-load.js b/js/lazy-load.js index b3efb51d3..a59921968 100644 --- a/js/lazy-load.js +++ b/js/lazy-load.js @@ -1 +1 @@ -!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=2)}([function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);rMath.ceil(e)?e:t),t},_build:function(){var e=this;this.images.forEach((function(t){e.buildSize(t)}))},_shouldRebuild:function(e){var t=this.scaleSize(e.originalWidth,e.width,this.config.pixel_step),r=e.getBoundingClientRect(),n="auto"!==this.density?this._getDensity():1;return r.tope.naturalWidth/n||!e.cld_loaded)},_shouldPlacehold:function(e){var t=this.scaleSize(e.originalWidth,e.width,this.config.pixel_step),r=e.getBoundingClientRect(),n="auto"!==this.density?this._getDensity():1;return!e.cld_loaded&&r.top<2*this.lazyThreshold&&(t>e.naturalWidth/n||!e.cld_placehold)},getResponsiveSteps:function(e){return Math.ceil(e.dataset.breakpoints?e.originalWidth/e.dataset.breakpoints:this.responsiveStep)},getQuality:function(){var e="q_auto";switch(navigator&&navigator.connection?navigator.connection.effectiveType:"none"){case"none":break;case"4g":e="q_auto:good";break;case"3g":e="q_auto:eco";break;case"2g":case"slow-2g":e="q_auto:low";break;default:e="q_auto:best"}return e},scaleSize:function(e,t,r){var n=e-r*Math.floor((e-t)/r);return(n>e||this.config.max_widthe.length)&&(t=e.length);for(var o=0,r=new Array(t);oMath.ceil(e)?e:t,t},_build:function(){var e=this;this.images.forEach((function(t){e.buildSize(t)}))},_shouldRebuild:function(e){var t=this.scaleSize(e.originalWidth,e.width,this.config.pixel_step),o=e.getBoundingClientRect(),r="auto"!==this.density?this._getDensity():1;return o.tope.naturalWidth/r||!e.cld_loaded)},_shouldPlacehold:function(e){var t=this.scaleSize(e.originalWidth,e.width,this.config.pixel_step),o=e.getBoundingClientRect(),r="auto"!==this.density?this._getDensity():1;return!e.cld_loaded&&o.top<2*this.lazyThreshold&&(t>e.naturalWidth/r||!e.cld_placehold)},getResponsiveSteps:function(e){return Math.ceil(e.dataset.breakpoints?e.originalWidth/e.dataset.breakpoints:this.responsiveStep)},getQuality:function(){var e="q_auto";switch(navigator&&navigator.connection?navigator.connection.effectiveType:"none"){case"none":break;case"4g":e="q_auto:good";break;case"3g":e="q_auto:eco";break;case"2g":case"slow-2g":e="q_auto:low";break;default:e="q_auto:best"}return e},scaleSize:function(e,t,o){var r=e-o*Math.floor((e-t)/o);return(r>e||this.config.max_width Math.ceil( maxDensity ) ? maxDensity : deviceDensity; + } else if ( 'auto' === CLDLB.dpr && 'auto' !== deviceDensity ) { + deviceDensity = 'auto'; } return deviceDensity; From 34eb26aecd455aa9e38ce803244a72ae175c2a22 Mon Sep 17 00:00:00 2001 From: Marco Pereirinha Date: Mon, 12 Jul 2021 17:45:43 +0100 Subject: [PATCH 41/56] Remove analytics query arg before saving --- php/sync/class-storage.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/php/sync/class-storage.php b/php/sync/class-storage.php index c91d4b1c0..5b7de8ef4 100644 --- a/php/sync/class-storage.php +++ b/php/sync/class-storage.php @@ -189,7 +189,9 @@ public function sync( $attachment_id ) { switch ( $this->settings['offload'] ) { case 'cld': $this->remove_local_assets( $attachment_id ); - update_post_meta( $attachment_id, '_wp_attached_file', $this->media->cloudinary_url( $attachment_id ) ); + $url = $this->media->cloudinary_url( $attachment_id, false ); + $url = remove_query_arg( '_i', $url ); + update_post_meta( $attachment_id, '_wp_attached_file', $url ); break; case 'dual_low': $transformations = $this->media->get_transformation_from_meta( $attachment_id ); From 218ce8dfcb83b3ad88fbd66096e4d18cc5279f09 Mon Sep 17 00:00:00 2001 From: Marco Pereirinha Date: Tue, 13 Jul 2021 10:25:07 +0100 Subject: [PATCH 42/56] Bump plugin version --- .version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.version b/.version index a4dd9dba4..9a890d17d 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -2.7.4 +2.7.5-rc-1 From a0bc24654d054106a9ee6b56d4d9d3b495d79395 Mon Sep 17 00:00:00 2001 From: Marco Pereirinha Date: Tue, 13 Jul 2021 16:13:19 +0100 Subject: [PATCH 43/56] Ensure that attachment_metadata is created and updated --- php/sync/class-download-sync.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/php/sync/class-download-sync.php b/php/sync/class-download-sync.php index 77c05a37b..deb51803b 100644 --- a/php/sync/class-download-sync.php +++ b/php/sync/class-download-sync.php @@ -174,7 +174,8 @@ public function download_asset( $attachment_id, $source = null, $date = null ) { // Prepare the asset. update_attached_file( $attachment_id, $upload['file'] ); - wp_generate_attachment_metadata( $attachment_id, $upload['file'] ); + + wp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, $upload['file'] ) ); // Update the folder synced flag. $public_id = $this->media->get_public_id( $attachment_id ); From 9dbc20a363c760962e5b9f9b877967cc6383a2da Mon Sep 17 00:00:00 2001 From: Marco Pereirinha Date: Wed, 14 Jul 2021 09:51:38 +0100 Subject: [PATCH 44/56] Prevent variable polution --- php/sync/class-storage.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/php/sync/class-storage.php b/php/sync/class-storage.php index 5b7de8ef4..ece5f6a09 100644 --- a/php/sync/class-storage.php +++ b/php/sync/class-storage.php @@ -189,9 +189,9 @@ public function sync( $attachment_id ) { switch ( $this->settings['offload'] ) { case 'cld': $this->remove_local_assets( $attachment_id ); - $url = $this->media->cloudinary_url( $attachment_id, false ); - $url = remove_query_arg( '_i', $url ); - update_post_meta( $attachment_id, '_wp_attached_file', $url ); + $cloudinary_url = $this->media->cloudinary_url( $attachment_id, false ); + $cloudinary_url = remove_query_arg( '_i', $cloudinary_url ); + update_post_meta( $attachment_id, '_wp_attached_file', $cloudinary_url ); break; case 'dual_low': $transformations = $this->media->get_transformation_from_meta( $attachment_id ); From fa58ae3a2b7965c8763ccbe4113541b90cbd9c5a Mon Sep 17 00:00:00 2001 From: Marco Pereirinha Date: Wed, 14 Jul 2021 09:57:01 +0100 Subject: [PATCH 45/56] Remove analytics for the download --- php/sync/class-storage.php | 1 + 1 file changed, 1 insertion(+) diff --git a/php/sync/class-storage.php b/php/sync/class-storage.php index ece5f6a09..d288927a7 100644 --- a/php/sync/class-storage.php +++ b/php/sync/class-storage.php @@ -222,6 +222,7 @@ public function sync( $attachment_id ) { $this->remove_local_assets( $attachment_id ); } $date = get_post_datetime( $attachment_id ); + $url = remove_query_arg( '_i', $url ); $this->download->download_asset( $attachment_id, $url, $date->format( 'Y/m' ) ); } From d7b661be995d2e9f48515c5d2b4d05a94a9c4fd7 Mon Sep 17 00:00:00 2001 From: Marco Pereirinha Date: Wed, 14 Jul 2021 12:15:22 +0100 Subject: [PATCH 46/56] Force the recheck --- php/traits/trait-cli.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php/traits/trait-cli.php b/php/traits/trait-cli.php index 9a8180f98..656e014c0 100644 --- a/php/traits/trait-cli.php +++ b/php/traits/trait-cli.php @@ -199,7 +199,7 @@ protected function process_sync( $posts, $total ) { $filename = self::pad_name( basename( $file ), 20, ' ', '*' ); $bar->tick( 1, 'Syncing (' . ( $done ) . ' of ' . $total . ') : ' . $filename ); if ( - ! $this->plugin->get_component( 'sync' )->is_synced( $asset ) + ! $this->plugin->get_component( 'sync' )->is_synced( $asset, true ) && $this->plugin->get_component( 'media' )->is_local_media( $asset ) && $this->plugin->get_component( 'sync' )->is_syncable( $asset ) ) { @@ -248,7 +248,7 @@ protected function process_analyze( $posts, $total ) { ) { // Add a key. $key = '_cld_synced'; - if ( ! $this->plugin->get_component( 'sync' )->is_synced( $asset ) ) { + if ( ! $this->plugin->get_component( 'sync' )->is_synced( $asset, true ) ) { $key = '_cld_unsynced'; add_post_meta( $asset, $key, true, true ); } From 122c3dfd370ab7b94d1e736963deeaf025c144db Mon Sep 17 00:00:00 2001 From: Marco Pereirinha Date: Wed, 14 Jul 2021 17:17:31 +0100 Subject: [PATCH 47/56] Keep metas that allow getting the ID from given sync keys --- php/class-media.php | 6 ++++++ php/media/class-upgrade.php | 4 ++-- php/sync/class-upload-sync.php | 7 +++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/php/class-media.php b/php/class-media.php index 4fa67ad65..b3ae11f72 100644 --- a/php/class-media.php +++ b/php/class-media.php @@ -1508,6 +1508,12 @@ private function create_attachment( $asset, $public_id ) { $this->update_post_meta( $attachment_id, Sync::META_KEYS['transformation'], $asset['transformations'] ); } + // Create a trackable key in post meta to allow getting public id from URL with transformations. + update_post_meta( $attachment_id, '_' . md5( $sync_key ), true ); + + // Create a trackable key in post meta to allow getting public id from URL. + update_post_meta( $attachment_id, '_' . md5( 'base_' . $public_id ), true ); + // capture the delivery type. $this->update_post_meta( $attachment_id, Sync::META_KEYS['delivery'], $asset['type'] ); // Capture the ALT Text. diff --git a/php/media/class-upgrade.php b/php/media/class-upgrade.php index e70ea727f..f406225d4 100644 --- a/php/media/class-upgrade.php +++ b/php/media/class-upgrade.php @@ -142,8 +142,8 @@ public function convert_cloudinary_version( $attachment_id ) { if ( ! empty( $transformations ) ) { $sync_key .= wp_json_encode( $transformations ); } - delete_post_meta( $attachment_id, '_' . md5( $sync_key ), true ); - delete_post_meta( $attachment_id, '_' . md5( 'base_' . $public_id ), true ); + update_post_meta( $attachment_id, '_' . md5( $sync_key ), true ); + update_post_meta( $attachment_id, '_' . md5( 'base_' . $public_id ), true ); // Get a new uncached signature. $this->sync->get_signature( $attachment_id, true ); diff --git a/php/sync/class-upload-sync.php b/php/sync/class-upload-sync.php index d9362db4d..f32e06c97 100644 --- a/php/sync/class-upload-sync.php +++ b/php/sync/class-upload-sync.php @@ -282,6 +282,13 @@ function ( $is_synced, $post_id ) use ( $attachment_id ) { $this->media->update_post_meta( $attachment_id, Sync::META_KEYS['version'], $result['version'] ); // Set the delivery type. $this->media->update_post_meta( $attachment_id, Sync::META_KEYS['delivery'], $result['type'] ); + + // Create a trackable key in post meta to allow getting public id from URL with transformations. + update_post_meta( $attachment_id, '_' . md5( $options['public_id'] ), true ); + + // Create a trackable key in post meta to allow getting public id from URL. + update_post_meta( $attachment_id, '_' . md5( 'base_' . $options['public_id'] ), true ); + // Update signature for all that use the same method. $this->sync->sync_signature_by_type( $attachment_id, $type ); // Update options and public_id as well (full sync). From 58638e69a484308877995708a5ff360818fc63f5 Mon Sep 17 00:00:00 2001 From: Marco Pereirinha Date: Wed, 14 Jul 2021 17:25:01 +0100 Subject: [PATCH 48/56] Update comment --- php/class-media.php | 4 ++-- php/sync/class-upload-sync.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/php/class-media.php b/php/class-media.php index b3ae11f72..9cf197e53 100644 --- a/php/class-media.php +++ b/php/class-media.php @@ -1508,10 +1508,10 @@ private function create_attachment( $asset, $public_id ) { $this->update_post_meta( $attachment_id, Sync::META_KEYS['transformation'], $asset['transformations'] ); } - // Create a trackable key in post meta to allow getting public id from URL with transformations. + // Create a trackable key in post meta to allow getting the attachment id from URL with transformations. update_post_meta( $attachment_id, '_' . md5( $sync_key ), true ); - // Create a trackable key in post meta to allow getting public id from URL. + // Create a trackable key in post meta to allow getting the attachment id from URL. update_post_meta( $attachment_id, '_' . md5( 'base_' . $public_id ), true ); // capture the delivery type. diff --git a/php/sync/class-upload-sync.php b/php/sync/class-upload-sync.php index f32e06c97..d8683bcf8 100644 --- a/php/sync/class-upload-sync.php +++ b/php/sync/class-upload-sync.php @@ -283,10 +283,10 @@ function ( $is_synced, $post_id ) use ( $attachment_id ) { // Set the delivery type. $this->media->update_post_meta( $attachment_id, Sync::META_KEYS['delivery'], $result['type'] ); - // Create a trackable key in post meta to allow getting public id from URL with transformations. + // Create a trackable key in post meta to allow getting the attachment id from URL with transformations. update_post_meta( $attachment_id, '_' . md5( $options['public_id'] ), true ); - // Create a trackable key in post meta to allow getting public id from URL. + // Create a trackable key in post meta to allow getting the attachment id from URL. update_post_meta( $attachment_id, '_' . md5( 'base_' . $options['public_id'] ), true ); // Update signature for all that use the same method. From 36514330f2137b8d967b00249aedd766f431455c Mon Sep 17 00:00:00 2001 From: Marco Pereirinha Date: Thu, 15 Jul 2021 00:22:29 +0100 Subject: [PATCH 49/56] The GT override meta is not part of the Cloudinary key --- php/class-delivery.php | 2 +- php/class-media.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/php/class-delivery.php b/php/class-delivery.php index b69b438c3..a47cfb018 100644 --- a/php/class-delivery.php +++ b/php/class-delivery.php @@ -184,7 +184,7 @@ public function process_featured_image( $html, $post_id, $attachment_id ) { $tag_element['atts']['class'][] = 'wp-image-' . $attachment_id; $tag_element['atts']['class'][] = 'wp-post-' . $post_id; - if ( true === (bool) $this->media->get_post_meta( $post_id, Global_Transformations::META_FEATURED_IMAGE_KEY, true ) ) { + if ( true === (bool) get_post_meta( $post_id, Global_Transformations::META_FEATURED_IMAGE_KEY, true ) ) { $tag_element['atts']['class'][] = 'cld-overwrite'; } diff --git a/php/class-media.php b/php/class-media.php index 9cf197e53..58c9a1b6f 100644 --- a/php/class-media.php +++ b/php/class-media.php @@ -2107,7 +2107,7 @@ public function get_upload_options( $attachment_id ) { public function maybe_overwrite_featured_image( $attachment_id ) { $overwrite = false; if ( $this->doing_featured_image && $this->doing_featured_image === (int) $attachment_id ) { - $overwrite = (bool) $this->get_post_meta( get_the_ID(), Global_Transformations::META_FEATURED_IMAGE_KEY, true ); + $overwrite = (bool) get_post_meta( get_the_ID(), Global_Transformations::META_FEATURED_IMAGE_KEY, true ); } return $overwrite; From 74a786aa189d8e512d7bd3e39177cd79f74b4c90 Mon Sep 17 00:00:00 2001 From: David Cramer Date: Mon, 19 Jul 2021 13:55:21 +0200 Subject: [PATCH 50/56] remove suffix version check. clean suffix --- php/class-media.php | 9 +++++-- php/class-sync.php | 2 +- php/sync/class-upload-sync.php | 43 +++++++++++++--------------------- 3 files changed, 24 insertions(+), 30 deletions(-) diff --git a/php/class-media.php b/php/class-media.php index 4fa67ad65..8a457bc26 100644 --- a/php/class-media.php +++ b/php/class-media.php @@ -1106,8 +1106,13 @@ public function get_public_id( $attachment_id, $suffixed = false ) { if ( $this->is_folder_synced( $attachment_id ) ) { $public_id = $this->get_cloudinary_folder() . pathinfo( $public_id, PATHINFO_BASENAME ); } - if ( true === $suffixed ) { - $public_id .= $this->get_post_meta( $attachment_id, Sync::META_KEYS['suffix'], true ); + if ( true === $suffixed && ! empty( $this->get_post_meta( $attachment_id, Sync::META_KEYS['suffix'], true ) ) ) { + $suffix = $this->get_post_meta( $attachment_id, Sync::META_KEYS['suffix'], true ); + if ( false === strrpos( $public_id, $suffix ) ) { + $public_id .= $suffix; + $this->update_post_meta( $attachment_id, Sync::META_KEYS['public_id'], $public_id ); + } + $this->delete_post_meta( $attachment_id, Sync::META_KEYS['suffix'] ); } } else { $public_id = $this->sync->generate_public_id( $attachment_id ); diff --git a/php/class-sync.php b/php/class-sync.php index 81cf81a58..e58e9ec8d 100644 --- a/php/class-sync.php +++ b/php/class-sync.php @@ -203,7 +203,7 @@ public function log_sync_result( $attachment_id, $type, $result ) { } if ( isset( $log[ $type ] ) ) { - $log[ $type ][ time() ] = $result; + $log[ $type ][ '_' . time() ] = $result; if ( 5 < count( $log[ $type ] ) ) { array_shift( $log[ $type ] ); } diff --git a/php/sync/class-upload-sync.php b/php/sync/class-upload-sync.php index d9362db4d..57d971d31 100644 --- a/php/sync/class-upload-sync.php +++ b/php/sync/class-upload-sync.php @@ -163,17 +163,18 @@ public function handle_bulk_actions( $location, $action, $post_ids ) { // It's required to perform a new sync that Cloudinary and WordPress storage is set. if ( - 'dual_full' !== $this->plugin->settings->find_setting( 'offload' )->get_value() && - $this->plugin->components['sync']->is_synced( $post_id ) + 'dual_full' !== $this->plugin->settings->find_setting( 'offload' )->get_value() ) { continue; } // Clean up for previous syncs and start over. - $this->sync->delete_cloudinary_meta( $post_id ); - $this->sync->set_signature_item( $post_id, 'file', '' ); - $this->media->delete_post_meta( $post_id, Sync::META_KEYS['public_id'] ); - $this->sync->add_to_sync( $post_id ); + if ( ! $this->media->is_cloudinary_url( get_post_meta( $post_id, '_wp_attached_file', true ) ) ) { + $this->sync->delete_cloudinary_meta( $post_id ); + $this->sync->set_signature_item( $post_id, 'file', '' ); + $this->media->delete_post_meta( $post_id, Sync::META_KEYS['public_id'] ); + $this->sync->add_to_sync( $post_id ); + } } break; } @@ -218,11 +219,12 @@ public function setup() { /** * Upload an asset to Cloudinary. * - * @param int $attachment_id The attachment ID. + * @param int $attachment_id The attachment ID. + * @param string $suffix An optional suffix. * * @return array|\WP_Error */ - public function upload_asset( $attachment_id ) { + public function upload_asset( $attachment_id, $suffix = null ) { add_filter( 'cloudinary_doing_upload', '__return_true' ); @@ -241,17 +243,10 @@ function ( $is_synced, $post_id ) use ( $attachment_id ) { $type = $this->sync->get_sync_type( $attachment_id ); $options = $this->media->get_upload_options( $attachment_id ); - $public_id = $options['public_id']; $try_remote = 'cloud_name' !== $type; - // Add the suffix before uploading. - if ( $this->media->get_public_id( $attachment_id ) === $public_id ) { - // Only apply the saved suffix if the public_id is the same. This is to allow filtered ID's a change to have a suffix removed. - $options['public_id'] .= $this->media->get_post_meta( $attachment_id, Sync::META_KEYS['suffix'], true ); - } else { - // If the public_id has been changed, remove the saved suffix. - $this->media->delete_post_meta( $attachment_id, Sync::META_KEYS['suffix'] ); - } + // Add suffix. + $options['public_id'] .= $suffix; // Run the upload Call. $result = $this->connect->api->upload( $attachment_id, $options, array(), $try_remote ); @@ -262,16 +257,10 @@ function ( $is_synced, $post_id ) use ( $attachment_id ) { // Check that this wasn't an existing. if ( ! empty( $result['existing'] ) ) { - // Check to see if this is the same image. - $version = $this->media->get_cloudinary_version( $attachment_id ); - if ( $version !== $result['version'] ) { - // New image with the same name. - // Add a suffix and try again. - $suffix = '_' . $attachment_id . substr( strrev( uniqid() ), 0, 5 ); - $this->media->update_post_meta( $attachment_id, Sync::META_KEYS['suffix'], $suffix ); - - return $this->upload_asset( $attachment_id ); - } + // Add a suffix and try again. + $suffix = '_' . $attachment_id . substr( strrev( uniqid() ), 0, 5 ); + + return $this->upload_asset( $attachment_id, $suffix ); } // Set folder Synced. From 13e893efff12a058f0f540c8dffe2413574a42a3 Mon Sep 17 00:00:00 2001 From: Marco Pereirinha Date: Mon, 19 Jul 2021 14:51:34 +0100 Subject: [PATCH 51/56] Ensure that the key is set --- php/class-media.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/php/class-media.php b/php/class-media.php index 58c9a1b6f..6e5ca50ac 100644 --- a/php/class-media.php +++ b/php/class-media.php @@ -769,6 +769,9 @@ function ( $part ) { * @return array The array of found transformations within the string. */ public function get_transformations_from_string( $str, $type = 'image' ) { + if ( ! isset( Api::$transformation_index[ $type ] ) ) { + return array(); + } $params = Api::$transformation_index[ $type ]; From d7fbe8e39e6d6a46b495972b7f50f3be9309f39e Mon Sep 17 00:00:00 2001 From: Marco Pereirinha Date: Mon, 19 Jul 2021 18:48:06 +0100 Subject: [PATCH 52/56] Allow pushing to Cloudinary unsynced items on manual sync, regardless storage --- php/sync/class-upload-sync.php | 1 + 1 file changed, 1 insertion(+) diff --git a/php/sync/class-upload-sync.php b/php/sync/class-upload-sync.php index 57d971d31..37c5862f1 100644 --- a/php/sync/class-upload-sync.php +++ b/php/sync/class-upload-sync.php @@ -163,6 +163,7 @@ public function handle_bulk_actions( $location, $action, $post_ids ) { // It's required to perform a new sync that Cloudinary and WordPress storage is set. if ( + $this->plugin->components['sync']->is_synced( $post_id ) && 'dual_full' !== $this->plugin->settings->find_setting( 'offload' )->get_value() ) { continue; From 0e4b3f017357c376c973576063294cc86e92f8e0 Mon Sep 17 00:00:00 2001 From: Marco Pereirinha Date: Tue, 20 Jul 2021 00:28:17 +0100 Subject: [PATCH 53/56] Bump plugin version --- .version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.version b/.version index 9a890d17d..aa9cdb765 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -2.7.5-rc-1 +2.7.5-rc-2 From 565c96cb4792af1f6d4be52889240061e4f4aee8 Mon Sep 17 00:00:00 2001 From: Marco Pereirinha Date: Tue, 20 Jul 2021 15:02:40 +0100 Subject: [PATCH 54/56] Remove analytics from video shortcode --- php/media/class-video.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/media/class-video.php b/php/media/class-video.php index 443289503..3bed5ebed 100644 --- a/php/media/class-video.php +++ b/php/media/class-video.php @@ -162,7 +162,7 @@ public function filter_video_shortcode( $html, $attr ) { if ( empty( $attr['cloudinary'] ) ) { $video = wp_get_attachment_metadata( $attr['id'] ); $url = $this->media->cloudinary_url( $attr['id'] ); - $attr[ $video['fileformat'] ] = $url; + $attr[ $video['fileformat'] ] = strtok( $url, '?' ); $attr['cloudinary'] = true; // Flag Cloudinary to ensure we don't call it again. $html = wp_video_shortcode( $attr, $html ); } From 147f65f585b247e0b64ff02cfa380442c7b0971e Mon Sep 17 00:00:00 2001 From: Marco Pereirinha Date: Tue, 20 Jul 2021 15:03:02 +0100 Subject: [PATCH 55/56] Check instead if the asset has been synced before --- php/sync/class-upload-sync.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/sync/class-upload-sync.php b/php/sync/class-upload-sync.php index 42133e9c1..107099198 100644 --- a/php/sync/class-upload-sync.php +++ b/php/sync/class-upload-sync.php @@ -163,7 +163,7 @@ public function handle_bulk_actions( $location, $action, $post_ids ) { // It's required to perform a new sync that Cloudinary and WordPress storage is set. if ( - $this->plugin->components['sync']->is_synced( $post_id ) && + $this->plugin->components['sync']->been_synced( $post_id ) && 'dual_full' !== $this->plugin->settings->find_setting( 'offload' )->get_value() ) { continue; From dda25c927ee5b012b7a5c01918766cd903520c65 Mon Sep 17 00:00:00 2001 From: Marco Pereirinha Date: Tue, 20 Jul 2021 15:07:04 +0100 Subject: [PATCH 56/56] Bump plugin version --- .version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.version b/.version index aa9cdb765..24172f4d4 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -2.7.5-rc-2 +2.7.5-rc-3