sqdkjqlsjdklqsjdlqskjd azjdjksqhvdjqskhdkqhsj zkhjdhqksldjqlskdjlqskjd zjhdjqlskdhqsljkhdsqd pages/font-library/page.php000064400000023061152427033270011707 0ustar00 $path ); if ( ! empty( $content_module ) ) { $route['content_module'] = $content_module; } if ( ! empty( $route_module ) ) { $route['route_module'] = $route_module; } $wp_font_library_routes[] = $route; } /** * Register a menu item for the font-library page. * * @param string $id Menu item ID. * @param string $label Display label. * @param string $to Route path to navigate to. * @param string $parent_id Optional. Parent menu item ID. * @param string $parent_type Optional. Parent type: 'drilldown' or 'dropdown'. */ function wp_register_font_library_menu_item( $id, $label, $to, $parent_id = '', $parent_type = '' ) { global $wp_font_library_menu_items; $menu_item = array( 'id' => $id, 'label' => $label, 'to' => $to, ); if ( ! empty( $parent_id ) ) { $menu_item['parent'] = $parent_id; } if ( ! empty( $parent_type ) && in_array( $parent_type, array( 'drilldown', 'dropdown' ), true ) ) { $menu_item['parent_type'] = $parent_type; } $wp_font_library_menu_items[] = $menu_item; } /** * Get all registered routes for the font-library page. * * @return array Array of route objects. */ function wp_get_font_library_routes() { global $wp_font_library_routes; return $wp_font_library_routes ?? array(); } /** * Get all registered menu items for the font-library page. * * @return array Array of menu item objects. */ function wp_get_font_library_menu_items() { global $wp_font_library_menu_items; return $wp_font_library_menu_items ?? array(); } /** * Preload REST API data for the font-library page. * Automatically called during page rendering. */ function wp_font_library_preload_data() { // Define paths to preload - same for all pages // This must exactly match the _fields list in packages/core-data/src/entities.js, // same fields in the same order, or the preload is never consumed. $preload_paths = array( '/?_fields=description,gmt_offset,home,image_max_bit_depth,image_sizes,image_size_threshold,image_strip_meta,name,site_icon,site_icon_url,site_logo,timezone_string,url,page_for_posts,page_on_front,show_on_front', array( '/wp/v2/settings', 'OPTIONS' ), ); // Use rest_preload_api_request to gather the preloaded data $preload_data = array_reduce( $preload_paths, 'rest_preload_api_request', array() ); // Register the preloading middleware with wp-api-fetch wp_add_inline_script( 'wp-api-fetch', sprintf( 'wp.apiFetch.use( wp.apiFetch.createPreloadingMiddleware( %s ) );', wp_json_encode( $preload_data ) ), 'after' ); } /** * Render the font-library page. * Call this function from add_menu_page or add_submenu_page. */ function wp_font_library_render_page() { // Load build constants $build_constants = require __DIR__ . '/../../constants.php'; // Set current screen set_current_screen(); // Remove unwanted deprecated handler remove_action( 'admin_head', 'wp_admin_bar_header' ); // Remove unwanted scripts and styles that were enqueued during `admin_init` foreach ( wp_scripts()->queue as $script ) { wp_dequeue_script( $script ); } foreach ( wp_styles()->queue as $style ) { wp_dequeue_style( $style ); } /** * Fires when the font-library page is initialized so extensions can register routes and menu items. */ do_action( 'font-library_init' ); // Enqueue command palette assets for boot-based pages if ( function_exists( 'wp_enqueue_command_palette_assets' ) ) { wp_enqueue_command_palette_assets(); } // Preload REST API data wp_font_library_preload_data(); // Get all registered routes and menu items $menu_items = wp_get_font_library_menu_items(); $routes = wp_get_font_library_routes(); // Get boot module asset file for dependencies $asset_file = ABSPATH . WPINC . '/js/dist/script-modules/boot/index.min.asset.php'; if ( file_exists( $asset_file ) ) { $asset = require $asset_file; // This script serves two purposes: // 1. It ensures all the globals that are made available to the modules are loaded. // 2. It initializes the boot module as an inline script. wp_register_script( 'font-library-prerequisites', '', $asset['dependencies'], $asset['version'], true ); // Add inline script to initialize the app $init_modules = []; wp_add_inline_script( 'font-library-prerequisites', sprintf( 'import("@wordpress/boot").then(mod => mod.init({mountId: "%s", menuItems: %s, routes: %s, initModules: %s, dashboardLink: "%s"}));', 'font-library-app', wp_json_encode( $menu_items, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), wp_json_encode( $routes, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), wp_json_encode( $init_modules, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), esc_url( admin_url( '/' ) ) ) ); // Register prerequisites style by filtering script dependencies to find registered styles $style_dependencies = array_filter( $asset['dependencies'], function ( $handle ) { return wp_style_is( $handle, 'registered' ); } ); wp_register_style( 'font-library-prerequisites', false, $style_dependencies, $asset['version'] ); // Build dependencies for font-library module $boot_dependencies = array( array( 'import' => 'static', 'id' => '@wordpress/boot', ), ); // Add init modules as static dependencies // No init modules configured // Add all registered routes as dependencies foreach ( $routes as $route ) { if ( isset( $route['route_module'] ) ) { $boot_dependencies[] = array( 'import' => 'static', 'id' => $route['route_module'], ); } if ( isset( $route['content_module'] ) ) { $boot_dependencies[] = array( 'import' => 'dynamic', 'id' => $route['content_module'], ); } } /** * Filters the boot script-module dependencies for the * font-library page. * * Surfaces extending this page can append entries to the boot * dependency list. Each entry is an array with 'import' (string * 'static' or 'dynamic') and 'id' (script-module handle) keys. * * @param array $boot_dependencies Boot dependencies for the page. */ $boot_dependencies = apply_filters( 'font-library_boot_dependencies', $boot_dependencies ); // Dummy script module to ensure dependencies are loaded wp_register_script_module( 'font-library', $build_constants['build_url'] . 'pages/font-library/loader.js', $boot_dependencies ); // Enqueue the boot scripts and styles wp_enqueue_script( 'font-library-prerequisites' ); wp_enqueue_script_module( 'font-library' ); wp_enqueue_style( 'font-library-prerequisites' ); } // Output the HTML ?> > <?php echo esc_html( get_admin_page_title() ); ?>
print_import_map(); print_footer_scripts(); wp_script_modules()->print_enqueued_script_modules(); wp_script_modules()->print_script_module_preloads(); wp_script_modules()->print_script_module_data(); /** This action is documented in wp-admin/admin-footer.php */ do_action( "admin_footer-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores // END see wp-admin/admin-footer.php ?> $path ); if ( ! empty( $content_module ) ) { $route['content_module'] = $content_module; } if ( ! empty( $route_module ) ) { $route['route_module'] = $route_module; } $wp_font_library_wp_admin_routes[] = $route; } /** * Register a menu item for the font-library-wp-admin page. * Note: Menu items are registered but not displayed in single-page mode. * * @param string $id Menu item ID. * @param string $label Display label. * @param string $to Route path to navigate to. * @param string $parent_id Optional. Parent menu item ID. */ function wp_register_font_library_wp_admin_menu_item( $id, $label, $to, $parent_id = '' ) { global $wp_font_library_wp_admin_menu_items; $menu_item = array( 'id' => $id, 'label' => $label, 'to' => $to, ); if ( ! empty( $parent_id ) ) { $menu_item['parent'] = $parent_id; } $wp_font_library_wp_admin_menu_items[] = $menu_item; } /** * Get all registered routes for the font-library-wp-admin page. * * @return array Array of route objects. */ function wp_get_font_library_wp_admin_routes() { global $wp_font_library_wp_admin_routes; return $wp_font_library_wp_admin_routes ?? array(); } /** * Get all registered menu items for the font-library-wp-admin page. * * @return array Array of menu item objects. */ function wp_get_font_library_wp_admin_menu_items() { global $wp_font_library_wp_admin_menu_items; return $wp_font_library_wp_admin_menu_items ?? array(); } /** * Preload REST API data for the font-library-wp-admin page. * Automatically called during page rendering. */ function wp_font_library_wp_admin_preload_data() { // Define paths to preload - same for all pages // This must exactly match the _fields list in packages/core-data/src/entities.js, // same fields in the same order, or the preload is never consumed. $preload_paths = array( '/?_fields=description,gmt_offset,home,image_max_bit_depth,image_sizes,image_size_threshold,image_strip_meta,name,site_icon,site_icon_url,site_logo,timezone_string,url,page_for_posts,page_on_front,show_on_front', array( '/wp/v2/settings', 'OPTIONS' ), ); // Use rest_preload_api_request to gather the preloaded data $preload_data = array_reduce( $preload_paths, 'rest_preload_api_request', array() ); // Register the preloading middleware with wp-api-fetch wp_add_inline_script( 'wp-api-fetch', sprintf( 'wp.apiFetch.use( wp.apiFetch.createPreloadingMiddleware( %s ) );', wp_json_encode( $preload_data ) ), 'after' ); } /** * Enqueue scripts and styles for the font-library-wp-admin page. * Hooked to admin_enqueue_scripts. * * @param string $hook_suffix The current admin page. */ function wp_font_library_wp_admin_enqueue_scripts( $hook_suffix ) { // Check all possible ways this page can be accessed: // 1. Menu page via admin.php?page=font-library-wp-admin (plugin) // 2. Direct file via font-library.php (Core) - screen ID will be 'font-library' $current_screen = get_current_screen(); $is_our_page = ( ( isset( $_GET['page'] ) && 'font-library-wp-admin' === $_GET['page'] ) || // phpcs:ignore WordPress.Security.NonceVerification.Recommended ( $current_screen && 'font-library' === $current_screen->id ) ); if ( ! $is_our_page ) { return; } // Load build constants $build_constants = require __DIR__ . '/../../constants.php'; /** * Fires when the font-library admin page is initialized so extensions can register routes and menu items. */ do_action( 'font-library-wp-admin_init' ); // Preload REST API data wp_font_library_wp_admin_preload_data(); // Get all registered routes $routes = wp_get_font_library_wp_admin_routes(); // Get boot module asset file for dependencies $asset_file = ABSPATH . WPINC . '/js/dist/script-modules/boot/index.min.asset.php'; if ( file_exists( $asset_file ) ) { $asset = require $asset_file; // This script serves two purposes: // 1. It ensures all the globals that are made available to the modules are loaded. // 2. It initializes the boot module as an inline script. wp_register_script( 'font-library-wp-admin-prerequisites', '', $asset['dependencies'], $asset['version'], true ); $init_modules = []; /* * Add inline script to initialize the app using initSinglePage (no menuItems). * The dynamic import is deferred until DOMContentLoaded so that all classic * script dependencies of @wordpress/boot (wp-private-apis, wp-components, * wp-theme, etc.) have finished parsing and executing before the boot module * evaluates. Otherwise, a modulepreloaded @wordpress/boot can win the race * against the classic-script-printing pass on fast CDN-fronted hosts in * Chrome, evaluating before wp.theme.privateApis is defined and throwing * "Cannot unlock an undefined object". See . */ $init_js_function = <<<'JS' ( mountId, routes, initModules ) => { const run = async () => { const mod = await import( "@wordpress/boot" ); mod.initSinglePage( { mountId, routes, initModules } ); }; if ( document.readyState === "loading" ) { document.addEventListener( "DOMContentLoaded", run ); } else { run(); } } JS; wp_add_inline_script( 'font-library-wp-admin-prerequisites', sprintf( '( %s )( %s, %s, %s );', $init_js_function, wp_json_encode( 'font-library-wp-admin-app', JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), wp_json_encode( $routes, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), wp_json_encode( $init_modules, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) ) ); // Register prerequisites style by filtering script dependencies to find registered styles $style_dependencies = array_filter( $asset['dependencies'], function ( $handle ) { return wp_style_is( $handle, 'registered' ); } ); wp_register_style( 'font-library-wp-admin-prerequisites', false, $style_dependencies, $asset['version'] ); // Build dependencies for font-library-wp-admin module $boot_dependencies = array( array( 'import' => 'static', 'id' => '@wordpress/boot', ), ); // Add init modules as static dependencies // No init modules configured // Add all registered routes as dependencies foreach ( $routes as $route ) { if ( isset( $route['route_module'] ) ) { $boot_dependencies[] = array( 'import' => 'static', 'id' => $route['route_module'], ); } if ( isset( $route['content_module'] ) ) { $boot_dependencies[] = array( 'import' => 'dynamic', 'id' => $route['content_module'], ); } } /** * Filters the boot script-module dependencies for the * font-library-wp-admin page. * * Surfaces extending this page can append entries to the boot * dependency list. Each entry is an array with 'import' (string * 'static' or 'dynamic') and 'id' (script-module handle) keys. * * @param array $boot_dependencies Boot dependencies for the page. */ $boot_dependencies = apply_filters( 'font-library-wp-admin_boot_dependencies', $boot_dependencies ); // Dummy script module to ensure dependencies are loaded wp_register_script_module( 'font-library-wp-admin', $build_constants['build_url'] . 'pages/font-library/loader.js', $boot_dependencies ); // Enqueue the boot scripts and styles wp_enqueue_script( 'font-library-wp-admin-prerequisites' ); wp_enqueue_script_module( 'font-library-wp-admin' ); wp_enqueue_style( 'font-library-wp-admin-prerequisites' ); } } /** * Render the font-library-wp-admin page. * Call this function from add_menu_page or add_submenu_page. * This renders within the normal WordPress admin interface. */ function wp_font_library_wp_admin_render_page() { ?>
$path ); if ( ! empty( $content_module ) ) { $route['content_module'] = $content_module; } if ( ! empty( $route_module ) ) { $route['route_module'] = $route_module; } $wp_options_connectors_routes[] = $route; } /** * Register a menu item for the options-connectors page. * * @param string $id Menu item ID. * @param string $label Display label. * @param string $to Route path to navigate to. * @param string $parent_id Optional. Parent menu item ID. * @param string $parent_type Optional. Parent type: 'drilldown' or 'dropdown'. */ function wp_register_options_connectors_menu_item( $id, $label, $to, $parent_id = '', $parent_type = '' ) { global $wp_options_connectors_menu_items; $menu_item = array( 'id' => $id, 'label' => $label, 'to' => $to, ); if ( ! empty( $parent_id ) ) { $menu_item['parent'] = $parent_id; } if ( ! empty( $parent_type ) && in_array( $parent_type, array( 'drilldown', 'dropdown' ), true ) ) { $menu_item['parent_type'] = $parent_type; } $wp_options_connectors_menu_items[] = $menu_item; } /** * Get all registered routes for the options-connectors page. * * @return array Array of route objects. */ function wp_get_options_connectors_routes() { global $wp_options_connectors_routes; return $wp_options_connectors_routes ?? array(); } /** * Get all registered menu items for the options-connectors page. * * @return array Array of menu item objects. */ function wp_get_options_connectors_menu_items() { global $wp_options_connectors_menu_items; return $wp_options_connectors_menu_items ?? array(); } /** * Preload REST API data for the options-connectors page. * Automatically called during page rendering. */ function wp_options_connectors_preload_data() { // Define paths to preload - same for all pages // This must exactly match the _fields list in packages/core-data/src/entities.js, // same fields in the same order, or the preload is never consumed. $preload_paths = array( '/?_fields=description,gmt_offset,home,image_max_bit_depth,image_sizes,image_size_threshold,image_strip_meta,name,site_icon,site_icon_url,site_logo,timezone_string,url,page_for_posts,page_on_front,show_on_front', array( '/wp/v2/settings', 'OPTIONS' ), ); // Use rest_preload_api_request to gather the preloaded data $preload_data = array_reduce( $preload_paths, 'rest_preload_api_request', array() ); // Register the preloading middleware with wp-api-fetch wp_add_inline_script( 'wp-api-fetch', sprintf( 'wp.apiFetch.use( wp.apiFetch.createPreloadingMiddleware( %s ) );', wp_json_encode( $preload_data ) ), 'after' ); } /** * Render the options-connectors page. * Call this function from add_menu_page or add_submenu_page. */ function wp_options_connectors_render_page() { // Load build constants $build_constants = require __DIR__ . '/../../constants.php'; // Set current screen set_current_screen(); // Remove unwanted deprecated handler remove_action( 'admin_head', 'wp_admin_bar_header' ); // Remove unwanted scripts and styles that were enqueued during `admin_init` foreach ( wp_scripts()->queue as $script ) { wp_dequeue_script( $script ); } foreach ( wp_styles()->queue as $style ) { wp_dequeue_style( $style ); } /** * Fires when the options-connectors page is initialized so extensions can register routes and menu items. */ do_action( 'options-connectors_init' ); // Enqueue command palette assets for boot-based pages if ( function_exists( 'wp_enqueue_command_palette_assets' ) ) { wp_enqueue_command_palette_assets(); } // Preload REST API data wp_options_connectors_preload_data(); // Get all registered routes and menu items $menu_items = wp_get_options_connectors_menu_items(); $routes = wp_get_options_connectors_routes(); // Get boot module asset file for dependencies $asset_file = ABSPATH . WPINC . '/js/dist/script-modules/boot/index.min.asset.php'; if ( file_exists( $asset_file ) ) { $asset = require $asset_file; // This script serves two purposes: // 1. It ensures all the globals that are made available to the modules are loaded. // 2. It initializes the boot module as an inline script. wp_register_script( 'options-connectors-prerequisites', '', $asset['dependencies'], $asset['version'], true ); // Add inline script to initialize the app $init_modules = []; wp_add_inline_script( 'options-connectors-prerequisites', sprintf( 'import("@wordpress/boot").then(mod => mod.init({mountId: "%s", menuItems: %s, routes: %s, initModules: %s, dashboardLink: "%s"}));', 'options-connectors-app', wp_json_encode( $menu_items, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), wp_json_encode( $routes, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), wp_json_encode( $init_modules, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), esc_url( admin_url( '/' ) ) ) ); // Register prerequisites style by filtering script dependencies to find registered styles $style_dependencies = array_filter( $asset['dependencies'], function ( $handle ) { return wp_style_is( $handle, 'registered' ); } ); wp_register_style( 'options-connectors-prerequisites', false, $style_dependencies, $asset['version'] ); // Build dependencies for options-connectors module $boot_dependencies = array( array( 'import' => 'static', 'id' => '@wordpress/boot', ), ); // Add init modules as static dependencies // No init modules configured // Add all registered routes as dependencies foreach ( $routes as $route ) { if ( isset( $route['route_module'] ) ) { $boot_dependencies[] = array( 'import' => 'static', 'id' => $route['route_module'], ); } if ( isset( $route['content_module'] ) ) { $boot_dependencies[] = array( 'import' => 'dynamic', 'id' => $route['content_module'], ); } } /** * Filters the boot script-module dependencies for the * options-connectors page. * * Surfaces extending this page can append entries to the boot * dependency list. Each entry is an array with 'import' (string * 'static' or 'dynamic') and 'id' (script-module handle) keys. * * @param array $boot_dependencies Boot dependencies for the page. */ $boot_dependencies = apply_filters( 'options-connectors_boot_dependencies', $boot_dependencies ); // Dummy script module to ensure dependencies are loaded wp_register_script_module( 'options-connectors', $build_constants['build_url'] . 'pages/options-connectors/loader.js', $boot_dependencies ); // Enqueue the boot scripts and styles wp_enqueue_script( 'options-connectors-prerequisites' ); wp_enqueue_script_module( 'options-connectors' ); wp_enqueue_style( 'options-connectors-prerequisites' ); } // Output the HTML ?> > <?php echo esc_html( get_admin_page_title() ); ?>
print_import_map(); print_footer_scripts(); wp_script_modules()->print_enqueued_script_modules(); wp_script_modules()->print_script_module_preloads(); wp_script_modules()->print_script_module_data(); /** This action is documented in wp-admin/admin-footer.php */ do_action( "admin_footer-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores // END see wp-admin/admin-footer.php ?> $path ); if ( ! empty( $content_module ) ) { $route['content_module'] = $content_module; } if ( ! empty( $route_module ) ) { $route['route_module'] = $route_module; } $wp_options_connectors_wp_admin_routes[] = $route; } /** * Register a menu item for the options-connectors-wp-admin page. * Note: Menu items are registered but not displayed in single-page mode. * * @param string $id Menu item ID. * @param string $label Display label. * @param string $to Route path to navigate to. * @param string $parent_id Optional. Parent menu item ID. */ function wp_register_options_connectors_wp_admin_menu_item( $id, $label, $to, $parent_id = '' ) { global $wp_options_connectors_wp_admin_menu_items; $menu_item = array( 'id' => $id, 'label' => $label, 'to' => $to, ); if ( ! empty( $parent_id ) ) { $menu_item['parent'] = $parent_id; } $wp_options_connectors_wp_admin_menu_items[] = $menu_item; } /** * Get all registered routes for the options-connectors-wp-admin page. * * @return array Array of route objects. */ function wp_get_options_connectors_wp_admin_routes() { global $wp_options_connectors_wp_admin_routes; return $wp_options_connectors_wp_admin_routes ?? array(); } /** * Get all registered menu items for the options-connectors-wp-admin page. * * @return array Array of menu item objects. */ function wp_get_options_connectors_wp_admin_menu_items() { global $wp_options_connectors_wp_admin_menu_items; return $wp_options_connectors_wp_admin_menu_items ?? array(); } /** * Preload REST API data for the options-connectors-wp-admin page. * Automatically called during page rendering. */ function wp_options_connectors_wp_admin_preload_data() { // Define paths to preload - same for all pages // This must exactly match the _fields list in packages/core-data/src/entities.js, // same fields in the same order, or the preload is never consumed. $preload_paths = array( '/?_fields=description,gmt_offset,home,image_max_bit_depth,image_sizes,image_size_threshold,image_strip_meta,name,site_icon,site_icon_url,site_logo,timezone_string,url,page_for_posts,page_on_front,show_on_front', array( '/wp/v2/settings', 'OPTIONS' ), ); // Use rest_preload_api_request to gather the preloaded data $preload_data = array_reduce( $preload_paths, 'rest_preload_api_request', array() ); // Register the preloading middleware with wp-api-fetch wp_add_inline_script( 'wp-api-fetch', sprintf( 'wp.apiFetch.use( wp.apiFetch.createPreloadingMiddleware( %s ) );', wp_json_encode( $preload_data ) ), 'after' ); } /** * Enqueue scripts and styles for the options-connectors-wp-admin page. * Hooked to admin_enqueue_scripts. * * @param string $hook_suffix The current admin page. */ function wp_options_connectors_wp_admin_enqueue_scripts( $hook_suffix ) { // Check all possible ways this page can be accessed: // 1. Menu page via admin.php?page=options-connectors-wp-admin (plugin) // 2. Direct file via options-connectors.php (Core) - screen ID will be 'options-connectors' $current_screen = get_current_screen(); $is_our_page = ( ( isset( $_GET['page'] ) && 'options-connectors-wp-admin' === $_GET['page'] ) || // phpcs:ignore WordPress.Security.NonceVerification.Recommended ( $current_screen && 'options-connectors' === $current_screen->id ) ); if ( ! $is_our_page ) { return; } // Load build constants $build_constants = require __DIR__ . '/../../constants.php'; /** * Fires when the options-connectors admin page is initialized so extensions can register routes and menu items. */ do_action( 'options-connectors-wp-admin_init' ); // Preload REST API data wp_options_connectors_wp_admin_preload_data(); // Get all registered routes $routes = wp_get_options_connectors_wp_admin_routes(); // Get boot module asset file for dependencies $asset_file = ABSPATH . WPINC . '/js/dist/script-modules/boot/index.min.asset.php'; if ( file_exists( $asset_file ) ) { $asset = require $asset_file; // This script serves two purposes: // 1. It ensures all the globals that are made available to the modules are loaded. // 2. It initializes the boot module as an inline script. wp_register_script( 'options-connectors-wp-admin-prerequisites', '', $asset['dependencies'], $asset['version'], true ); $init_modules = []; /* * Add inline script to initialize the app using initSinglePage (no menuItems). * The dynamic import is deferred until DOMContentLoaded so that all classic * script dependencies of @wordpress/boot (wp-private-apis, wp-components, * wp-theme, etc.) have finished parsing and executing before the boot module * evaluates. Otherwise, a modulepreloaded @wordpress/boot can win the race * against the classic-script-printing pass on fast CDN-fronted hosts in * Chrome, evaluating before wp.theme.privateApis is defined and throwing * "Cannot unlock an undefined object". See . */ $init_js_function = <<<'JS' ( mountId, routes, initModules ) => { const run = async () => { const mod = await import( "@wordpress/boot" ); mod.initSinglePage( { mountId, routes, initModules } ); }; if ( document.readyState === "loading" ) { document.addEventListener( "DOMContentLoaded", run ); } else { run(); } } JS; wp_add_inline_script( 'options-connectors-wp-admin-prerequisites', sprintf( '( %s )( %s, %s, %s );', $init_js_function, wp_json_encode( 'options-connectors-wp-admin-app', JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), wp_json_encode( $routes, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), wp_json_encode( $init_modules, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) ) ); // Register prerequisites style by filtering script dependencies to find registered styles $style_dependencies = array_filter( $asset['dependencies'], function ( $handle ) { return wp_style_is( $handle, 'registered' ); } ); wp_register_style( 'options-connectors-wp-admin-prerequisites', false, $style_dependencies, $asset['version'] ); // Build dependencies for options-connectors-wp-admin module $boot_dependencies = array( array( 'import' => 'static', 'id' => '@wordpress/boot', ), ); // Add init modules as static dependencies // No init modules configured // Add all registered routes as dependencies foreach ( $routes as $route ) { if ( isset( $route['route_module'] ) ) { $boot_dependencies[] = array( 'import' => 'static', 'id' => $route['route_module'], ); } if ( isset( $route['content_module'] ) ) { $boot_dependencies[] = array( 'import' => 'dynamic', 'id' => $route['content_module'], ); } } /** * Filters the boot script-module dependencies for the * options-connectors-wp-admin page. * * Surfaces extending this page can append entries to the boot * dependency list. Each entry is an array with 'import' (string * 'static' or 'dynamic') and 'id' (script-module handle) keys. * * @param array $boot_dependencies Boot dependencies for the page. */ $boot_dependencies = apply_filters( 'options-connectors-wp-admin_boot_dependencies', $boot_dependencies ); // Dummy script module to ensure dependencies are loaded wp_register_script_module( 'options-connectors-wp-admin', $build_constants['build_url'] . 'pages/options-connectors/loader.js', $boot_dependencies ); // Enqueue the boot scripts and styles wp_enqueue_script( 'options-connectors-wp-admin-prerequisites' ); wp_enqueue_script_module( 'options-connectors-wp-admin' ); wp_enqueue_style( 'options-connectors-wp-admin-prerequisites' ); } } /** * Render the options-connectors-wp-admin page. * Call this function from add_menu_page or add_submenu_page. * This renders within the normal WordPress admin interface. */ function wp_options_connectors_wp_admin_render_page() { ?>
typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var tt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),no=(e,t)=>{for(var r in t)Ca(e,r,{get:t[r],enumerable:!0})},sv=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of rv(t))!nv.call(e,n)&&n!==r&&Ca(e,n,{get:()=>t[n],enumerable:!(o=tv(t,n))||o.enumerable});return e};var h=(e,t,r)=>(r=e!=null?ev(ov(e)):{},sv(t||!e||!e.__esModule?Ca(r,"default",{value:e,enumerable:!0}):r,e));var Ce=tt((OE,_u)=>{_u.exports=window.wp.i18n});var Te=tt((kE,Pu)=>{Pu.exports=window.wp.element});var be=tt((FE,ku)=>{ku.exports=window.React});var Y=tt((VE,Lu)=>{Lu.exports=window.ReactJSXRuntime});var lo=tt((IT,nf)=>{nf.exports=window.ReactDOM});var md=tt(pd=>{"use strict";var dn=be();function i0(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var a0=typeof Object.is=="function"?Object.is:i0,l0=dn.useState,c0=dn.useEffect,u0=dn.useLayoutEffect,f0=dn.useDebugValue;function d0(e,t){var r=t(),o=l0({inst:{value:r,getSnapshot:t}}),n=o[0].inst,s=o[1];return u0(function(){n.value=r,n.getSnapshot=t,il(n)&&s({inst:n})},[e,r,t]),c0(function(){return il(n)&&s({inst:n}),e(function(){il(n)&&s({inst:n})})},[e]),f0(r),r}function il(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!a0(e,r)}catch{return!0}}function p0(e,t){return t()}var m0=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p0:d0;pd.useSyncExternalStore=dn.useSyncExternalStore!==void 0?dn.useSyncExternalStore:m0});var al=tt((xO,hd)=>{"use strict";hd.exports=md()});var yd=tt(gd=>{"use strict";var $s=be(),h0=al();function g0(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var y0=typeof Object.is=="function"?Object.is:g0,v0=h0.useSyncExternalStore,b0=$s.useRef,w0=$s.useEffect,x0=$s.useMemo,S0=$s.useDebugValue;gd.useSyncExternalStoreWithSelector=function(e,t,r,o,n){var s=b0(null);if(s.current===null){var i={hasValue:!1,value:null};s.current=i}else i=s.current;s=x0(function(){function u(g){if(!l){if(l=!0,c=g,g=o(g),n!==void 0&&i.hasValue){var d=i.value;if(n(d,g))return f=d}return f=g}if(d=f,y0(c,g))return d;var v=o(g);return n!==void 0&&n(d,v)?(c=g,d):(c=g,f=v)}var l=!1,c,f,m=r===void 0?null:r;return[function(){return u(t())},m===null?void 0:function(){return u(m())}]},[t,r,o,n]);var a=v0(e,s[0],s[1]);return w0(function(){i.hasValue=!0,i.value=a},[a]),S0(a),a}});var bd=tt((CO,vd)=>{"use strict";vd.exports=yd()});var Cn=tt((D3,Vp)=>{Vp.exports=window.wp.primitives});var Bo=tt((Q3,Bp)=>{Bp.exports=window.wp.compose});var Hp=tt((eA,jp)=>{jp.exports=window.wp.theme});var us=tt((tA,Up)=>{Up.exports=window.wp.privateApis});var ce=tt((t4,Cm)=>{Cm.exports=window.wp.components});var Am=tt((p4,Fm)=>{Fm.exports=window.wp.editor});var ar=tt((m4,Im)=>{Im.exports=window.wp.coreData});var Jt=tt((h4,Lm)=>{Lm.exports=window.wp.data});var Tn=tt((g4,Nm)=>{Nm.exports=window.wp.blocks});var Vt=tt((y4,Dm)=>{Dm.exports=window.wp.blockEditor});var Vm=tt((C4,Mm)=>{Mm.exports=window.wp.styleEngine});var Gm=tt((N4,Wm)=>{"use strict";Wm.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var o,n,s;if(Array.isArray(t)){if(o=t.length,o!=r.length)return!1;for(n=o;n--!==0;)if(!e(t[n],r[n]))return!1;return!0}if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(n of t.entries())if(!r.has(n[0]))return!1;for(n of t.entries())if(!e(n[1],r.get(n[0])))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(n of t.entries())if(!r.has(n[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(r)){if(o=t.length,o!=r.length)return!1;for(n=o;n--!==0;)if(t[n]!==r[n])return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(s=Object.keys(t),o=s.length,o!==Object.keys(r).length)return!1;for(n=o;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[n]))return!1;for(n=o;n--!==0;){var i=s[n];if(!e(t[i],r[i]))return!1}return!0}return t!==t&&r!==r}});var Xm=tt((M4,Zm)=>{"use strict";var W1=function(t){return G1(t)&&!Y1(t)};function G1(e){return!!e&&typeof e=="object"}function Y1(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||X1(e)}var q1=typeof Symbol=="function"&&Symbol.for,Z1=q1?Symbol.for("react.element"):60103;function X1(e){return e.$$typeof===Z1}function K1(e){return Array.isArray(e)?[]:{}}function hs(e,t){return t.clone!==!1&&t.isMergeableObject(e)?On(K1(e),e,t):e}function J1(e,t,r){return e.concat(t).map(function(o){return hs(o,r)})}function Q1(e,t){if(!t.customMerge)return On;var r=t.customMerge(e);return typeof r=="function"?r:On}function $1(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function Ym(e){return Object.keys(e).concat($1(e))}function qm(e,t){try{return t in e}catch{return!1}}function ew(e,t){return qm(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function tw(e,t,r){var o={};return r.isMergeableObject(e)&&Ym(e).forEach(function(n){o[n]=hs(e[n],r)}),Ym(t).forEach(function(n){ew(e,n)||(qm(e,n)&&r.isMergeableObject(t[n])?o[n]=Q1(n,r)(e[n],t[n],r):o[n]=hs(t[n],r))}),o}function On(e,t,r){r=r||{},r.arrayMerge=r.arrayMerge||J1,r.isMergeableObject=r.isMergeableObject||W1,r.cloneUnlessOtherwiseSpecified=hs;var o=Array.isArray(t),n=Array.isArray(e),s=o===n;return s?o?r.arrayMerge(e,t,r):tw(e,t,r):hs(t,r)}On.all=function(t,r){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(o,n){return On(o,n,r)},{})};var rw=On;Zm.exports=rw});var Mc=tt((RL,og)=>{og.exports=window.wp.keycodes});var ag=tt((DL,ig)=>{ig.exports=window.wp.apiFetch});var Ly=tt((oj,Iy)=>{Iy.exports=window.wp.date});function Ou(e){var t,r,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(t=0;te();function _e(e){let t=Tt(cv).current;return t.next=e,lv(t.effect),t.trampoline}function cv(){let e={next:void 0,callback:uv,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function uv(){}var Iu=h(be(),1),fv=()=>{},ge=typeof document<"u"?Iu.useLayoutEffect:fv;var As=h(be(),1),dv=As.createContext(void 0);function tn(){return As.useContext(dv)?.direction??"ltr"}function pv(e,t){return function(o,...n){let s=new URL(e);return s.searchParams.set("code",o.toString()),n.forEach(i=>s.searchParams.append("args[]",i)),`${t} error #${o}; visit ${s} for the full message.`}}var mv=pv("https://base-ui.com/production-error","Base UI"),Wt=mv;var _o=h(be(),1);function Ea(e,t,r,o){let n=Tt(Du).current;return hv(n,e,t,r,o)&&Mu(n,[e,t,r,o]),n.callback}function Nu(e){let t=Tt(Du).current;return gv(t,e)&&Mu(t,e),t.callback}function Du(){return{callback:null,cleanup:null,refs:[]}}function hv(e,t,r,o,n){return e.refs[0]!==t||e.refs[1]!==r||e.refs[2]!==o||e.refs[3]!==n}function gv(e,t){return e.refs.length!==t.length||e.refs.some((r,o)=>r!==t[o])}function Mu(e,t){if(e.refs=t,t.every(r=>r==null)){e.callback=null;return}e.callback=r=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),r!=null){let o=Array(t.length).fill(null);for(let n=0;n{for(let n=0;n=e}function Ta(e){if(!Bu.isValidElement(e))return null;let t=e,r=t.props;return(rn(19)?r?.ref:t.ref)??null}function Zn(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function so(){}var qE=Object.freeze([]),pt=Object.freeze({});function zu(e,t){let r={};for(let o in e){let n=e[o];if(t?.hasOwnProperty(o)){let s=t[o](n);s!=null&&Object.assign(r,s);continue}n===!0?r[`data-${o.toLowerCase()}`]="":n&&(r[`data-${o.toLowerCase()}`]=n.toString())}return r}function ju(e,t){return typeof e=="function"?e(t):e}function Hu(e,t){return typeof e=="function"?e(t):e}var _a={};function or(e,t,r,o,n){if(!r&&!o&&!n&&!e)return Is(t);let s=Is(e);return t&&(s=Xn(s,t)),r&&(s=Xn(s,r)),o&&(s=Xn(s,o)),n&&(s=Xn(s,n)),s}function Uu(e){if(e.length===0)return _a;if(e.length===1)return Is(e[0]);let t=Is(e[0]);for(let r=1;r=65&&n<=90&&(typeof t=="function"||typeof t>"u")}function Oa(e){return typeof e=="function"}function Gu(e,t){return Oa(e)?e(t):e??_a}function wv(e,t){return t?e?(...r)=>{let o=r[0];if(Zu(o)){let s=o;qu(s);let i=t(...r);return s.baseUIHandlerPrevented||e?.(...r),i}let n=t(...r);return e?.(...r),n}:Yu(t):e}function Yu(e){return e&&((...t)=>{let r=t[0];return Zu(r)&&qu(r),e(...t)})}function qu(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Pa(e,t){return t?e?t+" "+e:t:e}function Zu(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}var ka=h(be(),1);function Gt(e,t,r={}){let o=t.render,n=xv(t,r);if(r.enabled===!1)return null;let s=r.state??pt;return Rv(e,o,n,s)}function xv(e,t={}){let{className:r,style:o,render:n}=e,{state:s=pt,ref:i,props:a,stateAttributesMapping:u,enabled:l=!0}=t,c=l?ju(r,s):void 0,f=l?Hu(o,s):void 0,m=l?zu(s,u):pt,g=l&&a?Sv(a):void 0,d=l?Zn(m,g)??{}:pt;return typeof document<"u"&&(l?Array.isArray(i)?d.ref=Nu([d.ref,Ta(n),...i]):d.ref=Ea(d.ref,Ta(n),i):Ea(null,null)),l?(c!==void 0&&(d.className=Pa(d.className,c)),f!==void 0&&(d.style=Zn(d.style,f)),d):pt}function Sv(e){return Array.isArray(e)?Uu(e):or(void 0,e)}var Cv=Symbol.for("react.lazy");function Rv(e,t,r,o){if(t){if(typeof t=="function")return t(r,o);let n=or(r,t.props);n.ref=r.ref;let s=t;return s?.$$typeof===Cv&&(s=_o.Children.toArray(t)[0]),_o.cloneElement(s,n)}if(e&&typeof e=="string")return Ev(e,r);throw new Error(Wt(8))}function Ev(e,t){return e==="button"?(0,ka.createElement)("button",{type:"button",...t,key:t.key}):e==="img"?(0,ka.createElement)("img",{alt:"",...t,key:t.key}):_o.createElement(e,t)}var Ls=h(be(),1);var Xu=0;function Tv(e,t="mui"){let[r,o]=Ls.useState(e),n=e||r;return Ls.useEffect(()=>{r==null&&(Xu+=1,o(`${t}-${Xu}`))},[r,t]),n}var Ku=qn.useId;function io(e,t){if(Ku!==void 0){let r=Ku();return e??(t?`${t}-${r}`:r)}return Tv(e,t)}function Ju(e){return io(e,"base-ui")}var Oe={};no(Oe,{cancelOpen:()=>eb,chipRemovePress:()=>Dv,clearPress:()=>Nv,closePress:()=>Iv,closeWatcher:()=>qv,decrementPress:()=>Bv,disabled:()=>rb,drag:()=>Jv,escapeKey:()=>Yv,focusOut:()=>Gv,imperativeAction:()=>sb,incrementPress:()=>Vv,initial:()=>nb,inputBlur:()=>Hv,inputChange:()=>zv,inputClear:()=>jv,inputPaste:()=>Uv,inputPress:()=>Wv,itemPress:()=>Av,keyboard:()=>Xv,linkPress:()=>Lv,listNavigation:()=>Zv,missing:()=>ob,none:()=>_v,outsidePress:()=>Fv,pointer:()=>Kv,scrub:()=>$v,siblingOpen:()=>tb,swipe:()=>ib,trackPress:()=>Mv,triggerFocus:()=>kv,triggerHover:()=>Pv,triggerPress:()=>Ov,wheel:()=>Qv,windowResize:()=>ab});var _v="none",Ov="trigger-press",Pv="trigger-hover",kv="trigger-focus",Fv="outside-press",Av="item-press",Iv="close-press",Lv="link-press",Nv="clear-press",Dv="chip-remove-press",Mv="track-press",Vv="increment-press",Bv="decrement-press",zv="input-change",jv="input-clear",Hv="input-blur",Uv="input-paste",Wv="input-press",Gv="focus-out",Yv="escape-key",qv="close-watcher",Zv="list-navigation",Xv="keyboard",Kv="pointer",Jv="drag",Qv="wheel",$v="scrub",eb="cancel-open",tb="sibling-open",rb="disabled",ob="missing",nb="initial",sb="imperative-action",ib="swipe",ab="window-resize";function ze(e,t,r,o){let n=!1,s=!1,i=o??pt;return{reason:e,event:t??new Event("base-ui"),cancel(){n=!0},allowPropagation(){s=!0},get isCanceled(){return n},get isPropagationAllowed(){return s},trigger:r,...i}}var Aa=h(be(),1);var Qu=h(be(),1),lb=[];function on(e){Qu.useEffect(e,lb)}var Ns=null,wT=globalThis.requestAnimationFrame,Fa=class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;let r=this.callbacks,o=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,o>0)for(let n=0;n=this.callbacks.length||(this.callbacks[r]=null,this.callbacksCount-=1)}},Ds=new Fa,Or=class e{static create(){return new e}static request(t){return Ds.request(t)}static cancel(t){return Ds.cancel(t)}currentId=Ns;request(t){this.cancel(),this.currentId=Ds.request(()=>{this.currentId=Ns,t()})}cancel=()=>{this.currentId!==Ns&&(Ds.cancel(this.currentId),this.currentId=Ns)};disposeEffect=()=>this.cancel};function nn(){let e=Tt(Or.create).current;return on(e.disposeEffect),e}function $u(e,t=!1,r=!1){let[o,n]=Aa.useState(e&&t?"idle":void 0),[s,i]=Aa.useState(e);return e&&!s&&(i(!0),n("starting")),!e&&s&&o!=="ending"&&!r&&n("ending"),!e&&!s&&o==="ending"&&n(void 0),ge(()=>{if(!e&&s&&o!=="ending"&&r){let a=Or.request(()=>{n("ending")});return()=>{Or.cancel(a)}}},[e,s,o,r]),ge(()=>{if(!e||t)return;let a=Or.request(()=>{n(void 0)});return()=>{Or.cancel(a)}},[t,e]),ge(()=>{if(!e||!t)return;e&&s&&o!=="idle"&&n("starting");let a=Or.request(()=>{n("idle")});return()=>{Or.cancel(a)}},[t,e,s,o]),{mounted:s,setMounted:i,transitionStatus:o}}var Oo=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({}),cb={[Oo.startingStyle]:""},ub={[Oo.endingStyle]:""},ef={transitionStatus(e){return e==="starting"?cb:e==="ending"?ub:null}};function Ms(){return typeof window<"u"}function ko(e){return Vs(e)?(e.nodeName||"").toLowerCase():"#document"}function lt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function br(e){var t;return(t=(Vs(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Vs(e){return Ms()?e instanceof Node||e instanceof lt(e).Node:!1}function we(e){return Ms()?e instanceof Element||e instanceof lt(e).Element:!1}function St(e){return Ms()?e instanceof HTMLElement||e instanceof lt(e).HTMLElement:!1}function sn(e){return!Ms()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof lt(e).ShadowRoot}function an(e){let{overflow:t,overflowX:r,overflowY:o,display:n}=Pt(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+r)&&n!=="inline"&&n!=="contents"}function tf(e){return/^(table|td|th)$/.test(ko(e))}function Kn(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}var fb=/transform|translate|scale|rotate|perspective|filter/,db=/paint|layout|strict|content/,Po=e=>!!e&&e!=="none",Ia;function Bs(e){let t=we(e)?Pt(e):e;return Po(t.transform)||Po(t.translate)||Po(t.scale)||Po(t.rotate)||Po(t.perspective)||!zs()&&(Po(t.backdropFilter)||Po(t.filter))||fb.test(t.willChange||"")||db.test(t.contain||"")}function rf(e){let t=vr(e);for(;St(t)&&!wr(t);){if(Bs(t))return t;if(Kn(t))return null;t=vr(t)}return null}function zs(){return Ia==null&&(Ia=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ia}function wr(e){return/^(html|body|#document)$/.test(ko(e))}function Pt(e){return lt(e).getComputedStyle(e)}function Jn(e){return we(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function vr(e){if(ko(e)==="html")return e;let t=e.assignedSlot||e.parentNode||sn(e)&&e.host||br(e);return sn(t)?t.host:t}function of(e){let t=vr(e);return wr(t)?e.ownerDocument?e.ownerDocument.body:e.body:St(t)&&an(t)?t:of(t)}function ao(e,t,r){var o;t===void 0&&(t=[]),r===void 0&&(r=!0);let n=of(e),s=n===((o=e.ownerDocument)==null?void 0:o.body),i=lt(n);if(s){let a=js(i);return t.concat(i,i.visualViewport||[],an(n)?n:[],a&&r?ao(a):[])}else return t.concat(n,ao(n,[],r))}function js(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ye(e,t,r,o){return e.addEventListener(t,r,o),()=>{e.removeEventListener(t,r,o)}}function Yt(e){let t=Tt(pb,e).current;return t.next=e,ge(t.effect),t}function pb(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function Ct(e){return e?.ownerDocument||document}var lf=h(be(),1);var af=h(lo(),1);function sf(e){return e==null?e:"current"in e?e.current:e}function ln(e,t=!1,r=!0){let o=nn();return _e((n,s=null)=>{o.cancel();let i=sf(e);if(i==null)return;let a=i,u=()=>{af.flushSync(n)};if(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){n();return}function l(){Promise.all(a.getAnimations().map(c=>c.finished)).then(()=>{s?.aborted||u()}).catch(()=>{if(r){s?.aborted||u();return}let c=a.getAnimations();!s?.aborted&&c.length>0&&c.some(f=>f.pending||f.playState!=="finished")&&l()})}if(t){let c=Oo.startingStyle;if(!a.hasAttribute(c)){o.request(l);return}let f=new MutationObserver(()=>{a.hasAttribute(c)||(f.disconnect(),l())});f.observe(a,{attributes:!0,attributeFilter:[c]}),s?.addEventListener("abort",()=>f.disconnect(),{once:!0});return}o.request(l)})}function Hs(e){let{enabled:t=!0,open:r,ref:o,onComplete:n}=e,s=_e(n),i=ln(o,r,!1);lf.useEffect(()=>{if(!t)return;let a=new AbortController;return i(s,a.signal),()=>{a.abort()}},[t,r,s,i])}var cf=h(be(),1);function uf(e){let t=cf.useRef(!0);t.current&&(t.current=!1,e())}var Yr={};no(Yr,{engine:()=>Va,env:()=>za,os:()=>Da,screenReader:()=>Ba});var Da={};no(Da,{android:()=>pf,apple:()=>Na,ios:()=>La,linux:()=>vb,mac:()=>mf,windows:()=>yb});function mb(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:hb,platform:gb,maxTouchPoints:ff}=mb(),Fo=hb.toLowerCase(),Ao=gb.toLowerCase();var La=/^i(os$|p)/.test(Ao)||Ao==="macintel"&&ff>1,df="android",pf=Ao===df||Fo.includes(df),mf=!La&&Ao.startsWith("mac"),yb=Ao.startsWith("win"),vb=!pf&&/^(linux|chrome os)/.test(Ao),Na=mf||La;var Va={};no(Va,{blink:()=>wb,gecko:()=>bb,webkit:()=>Ma});var Ma=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none"),bb=!Ma&&Fo.includes("firefox"),wb=!Ma&&Fo.includes("chrom");var Ba={};no(Ba,{voiceOver:()=>xb});var xb=Na;var za={};no(za,{jsdom:()=>Sb});var Sb=/jsdom|happydom/.test(Fo);var Qn=0,nr=class e{static create(){return new e}currentId=Qn;start(t,r){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Qn,r()},t)}isStarted(){return this.currentId!==Qn}clear=()=>{this.currentId!==Qn&&(clearTimeout(this.currentId),this.currentId=Qn)};disposeEffect=()=>this.clear};function xr(){let e=Tt(nr.create).current;return on(e.disposeEffect),e}var kt=h(be(),1);function hf(e){return"nativeEvent"in e}function qr(e,t){let r=["mouse","pen"];return t||r.push("",void 0),r.includes(e)}function gf(e){let t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}var ja="data-base-ui-focusable";var Ha="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Us(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Ze(e,t){if(!e||!t)return!1;let r=t.getRootNode?.();if(e.contains(t))return!0;if(r&&sn(r)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Dt(e){return"composedPath"in e?e.composedPath()[0]:e.target}function co(e,t){if(!we(e))return!1;let r=e;if(t.hasElement(r))return!r.hasAttribute("data-trigger-disabled");for(let[,o]of t.entries())if(Ze(o,r))return!o.hasAttribute("data-trigger-disabled");return!1}function Ws(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);let r=e;return r.target!=null&&t.contains(r.target)}function yf(e){return e.matches("html,body")}function vf(e){return St(e)&&e.matches(Ha)}function Ua(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Ha}`)!=null}function bf(e){if(!e||Yr.env.jsdom)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Cb(e,t){return t!=null&&!qr(t)?0:typeof e=="function"?e():e}function Zr(e,t,r){let o=Cb(e,r);return typeof o=="number"?o:o?.[t]}function Wa(e){return typeof e=="function"?e():e}function Gs(e,t){return t||e==="click"||e==="mousedown"}function wf(e){return e?.includes("mouse")&&e!=="mousedown"}var xf=h(Y(),1),Sf=kt.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new nr,currentIdRef:{current:null},currentContextRef:{current:null}});function Rb(e,t){e.current=t.current}function Ga(e){let{children:t,delay:r,timeoutMs:o=0}=e,n=kt.useRef(r),s=kt.useRef(r),i=kt.useRef(null),a=kt.useRef(null),u=xr();return ge(()=>{if(s.current=r,!i.current){n.current=r;return}n.current={open:Zr(n.current,"open"),close:Zr(r,"close")}},[r,i,n,s]),(0,xf.jsx)(Sf.Provider,{value:kt.useMemo(()=>({hasProvider:!0,delayRef:n,initialDelayRef:s,currentIdRef:i,timeoutMs:o,currentContextRef:a,timeout:u}),[o,u]),children:t})}function Ya(e,t={open:!1}){let{open:r}=t,o="rootStore"in e?e.rootStore:e,n=o.useState("floatingId"),s=kt.useContext(Sf),{currentIdRef:i,delayRef:a,timeoutMs:u,initialDelayRef:l,currentContextRef:c,hasProvider:f,timeout:m}=s,[g,d]=kt.useState(!1),v=kt.useRef(r),S=kt.useRef(!1);return ge(()=>{v.current=r},[r]),ge(()=>()=>{S.current=!0},[]),ge(()=>{function C(){S.current||d(!1),c.current?.setIsInstantPhase(!1),i.current=null,c.current=null,a.current=l.current,m.clear()}if(i.current&&!r&&i.current===n){if(d(!1),u){let w=n;return m.start(u,()=>{o.select("open")||i.current&&i.current!==w||C()}),()=>{(v.current||i.current!==w)&&m.clear()}}C()}},[r,n,i,a,u,l,c,m,o]),ge(()=>{if(!r)return;let C=c.current,w=i.current;m.clear(),c.current={onOpenChange:o.setOpen,setIsInstantPhase:d},i.current=n,a.current={open:0,close:Zr(l.current,"close")},w!==null&&w!==n?(d(!0),C?.setIsInstantPhase(!0),C?.onOpenChange(!1,ze(Oe.none))):(d(!1),C?.setIsInstantPhase(!1))},[r,n,o,i,a,l,c,m]),ge(()=>()=>{if(i.current===n){if(c.current=null,!v.current)return;i.current=null,Rb(a,l),m.clear()}},[c,i,a,n,l,m]),kt.useMemo(()=>({hasProvider:f,delayRef:a,isInstantPhase:g}),[f,a,g])}function Sr(...e){return()=>{for(let t=0;t({x:e,y:e}),Eb={left:"right",right:"left",bottom:"top",top:"bottom"};function ts(e,t,r){return Mt(e,uo(t,r))}function Rr(e,t){return typeof e=="function"?e(t):e}function _t(e){return e.split("-")[0]}function Er(e){return e.split("-")[1]}function qs(e){return e==="x"?"y":"x"}function rs(e){return e==="y"?"height":"width"}function qt(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function os(e){return qs(qt(e))}function Tf(e,t,r){r===void 0&&(r=!1);let o=Er(e),n=os(e),s=rs(n),i=n==="x"?o===(r?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=$n(i)),[i,$n(i)]}function _f(e){let t=$n(e);return[Ys(e),t,Ys(t)]}function Ys(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var Cf=["left","right"],Rf=["right","left"],Tb=["top","bottom"],_b=["bottom","top"];function Ob(e,t,r){switch(e){case"top":case"bottom":return r?t?Rf:Cf:t?Cf:Rf;case"left":case"right":return t?Tb:_b;default:return[]}}function Of(e,t,r,o){let n=Er(e),s=Ob(_t(e),r==="start",o);return n&&(s=s.map(i=>i+"-"+n),t&&(s=s.concat(s.map(Ys)))),s}function $n(e){let t=_t(e);return Eb[t]+e.slice(t.length)}function Pb(e){return{top:0,right:0,bottom:0,left:0,...e}}function Zs(e){return typeof e!="number"?Pb(e):{top:e,right:e,bottom:e,left:e}}function Io(e){let{x:t,y:r,width:o,height:n}=e;return{width:o,height:n,top:r,left:t,right:t+o,bottom:r+n,x:t,y:r}}function Xr(e,t,r=!0){return e.filter(n=>n.parentId===t).flatMap(n=>[...!r||n.context?.open?[n]:[],...Xr(e,n.id,r)])}function cn(e){return`data-base-ui-${e}`}var sr=h(be(),1),Ff=h(lo(),1);var Pf={style:{transition:"none"}};var kb="data-base-ui-swipe-ignore",Fb="data-swipe-ignore",x_=`[${kb}]`,S_=`[${Fb}]`;var kf={fallbackAxisSide:"end"};var Af=h(Y(),1),Ab=sr.createContext(null),Ib=()=>sr.useContext(Ab),Lb=cn("portal");function qa(e={}){let{ref:t,container:r,componentProps:o=pt,elementProps:n}=e,s=io(),a=Ib()?.portalNode,[u,l]=sr.useState(null),[c,f]=sr.useState(null),m=_e(S=>{S!==null&&f(S)}),g=sr.useRef(null);ge(()=>{if(r===null){g.current&&(g.current=null,f(null),l(null));return}if(s==null)return;let S=(r&&(Vs(r)?r:r.current))??a??document.body;if(S==null){g.current&&(g.current=null,f(null),l(null));return}g.current!==S&&(g.current=S,f(null),l(S))},[r,a,s]);let d=Gt("div",o,{ref:[t,m],props:[{id:s,[Lb]:""},n]});return{portalNode:c,portalSubtree:u&&d?Ff.createPortal(d,u):null}}var Lo=h(be(),1);function If(){let e=new Map;return{emit(t,r){e.get(t)?.forEach(o=>o(r))},on(t,r){e.has(t)||e.set(t,new Set),e.get(t).add(r)},off(t,r){e.get(t)?.delete(r)}}}var Nb=h(Y(),1),Db=Lo.createContext(null),Mb=Lo.createContext(null),un=()=>Lo.useContext(Db)?.id||null,po=e=>{let t=Lo.useContext(Mb);return e??t};var Zt=h(be(),1);function Vb(e,t){let r=null,o=null,n=!1;return{contextElement:e||void 0,getBoundingClientRect(){let s=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},i=t.axis==="x"||t.axis==="both",a=t.axis==="y"||t.axis==="both",u=["mouseenter","mousemove"].includes(t.dataRef.current.openEvent?.type||"")&&t.pointerType!=="touch",l=s.width,c=s.height,f=s.x,m=s.y;return r==null&&t.x&&i&&(r=s.x-t.x),o==null&&t.y&&a&&(o=s.y-t.y),f-=r||0,m-=o||0,l=0,c=0,!n||u?(l=t.axis==="y"?s.width:0,c=t.axis==="x"?s.height:0,f=i&&t.x!=null?t.x:f,m=a&&t.y!=null?t.y:m):n&&!u&&(c=t.axis==="x"?s.height:c,l=t.axis==="y"?s.width:l),n=!0,{width:l,height:c,x:f,y:m,top:m,right:f+l,bottom:m+c,left:f}}}}function Lf(e){return e!=null&&e.clientX!=null}function Za(e,t={}){let{enabled:r=!0,axis:o="both"}=t,n="rootStore"in e?e.rootStore:e,s=n.useState("open"),i=n.useState("floatingElement"),a=n.useState("domReferenceElement"),u=n.context.dataRef,l=Zt.useRef(!1),c=Zt.useRef(null),[f,m]=Zt.useState(),[g,d]=Zt.useState([]),v=_e(R=>{n.set("positionReference",R)}),S=_e((R,k,T)=>{l.current||u.current.openEvent&&!Lf(u.current.openEvent)||n.set("positionReference",Vb(T??a,{x:R,y:k,axis:o,dataRef:u,pointerType:f}))}),C=_e(R=>{s?c.current||(S(R.clientX,R.clientY,R.currentTarget),d([])):S(R.clientX,R.clientY,R.currentTarget)}),w=qr(f)?i:s;Zt.useEffect(()=>{if(!r){v(a);return}if(!w)return;function R(){c.current?.(),c.current=null}let k=lt(i);function T(_){let A=Dt(_);Ze(i,A)?R():S(_.clientX,_.clientY)}return!u.current.openEvent||Lf(u.current.openEvent)?c.current=Ye(k,"mousemove",T):v(a),R},[w,r,i,u,a,n,S,v,g]),Zt.useEffect(()=>()=>{n.set("positionReference",null)},[n]),Zt.useEffect(()=>{r&&!i&&(l.current=!1)},[r,i]),Zt.useEffect(()=>{!r&&s&&(l.current=!0)},[r,s]);let b=Zt.useMemo(()=>{function R(k){m(k.pointerType)}return{onPointerDown:R,onPointerEnter:R,onMouseMove:C,onMouseEnter:C}},[C]);return Zt.useMemo(()=>r?{reference:b,trigger:b}:{},[r,b])}var Xt=h(be(),1);function Bb(){return!1}function zb(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function Xa(e,t={}){let{enabled:r=!0,escapeKey:o=!0,outsidePress:n=!0,outsidePressEvent:s="sloppy",referencePress:i=Bb,bubbles:a,externalTree:u}=t,l="rootStore"in e?e.rootStore:e,c=l.useState("open"),f=l.useState("floatingElement"),{dataRef:m}=l.context,g=po(u),d=_e(typeof n=="function"?n:()=>!1),v=typeof n=="function"?d:n,S=v!==!1,C=_e(()=>s),{escapeKey:w,outsidePress:b}=zb(a),R=Xt.useRef(!1),k=Xt.useRef(!1),T=Xt.useRef(!1),_=Xt.useRef(!1),A=Xt.useRef(""),N=Xt.useRef(null),q=xr(),U=xr(),x=_e(()=>{U.clear(),m.current.insideReactTree=!1}),I=_e(F=>{let Z=m.current.floatingContext?.nodeId;return(g?Xr(g.nodesRef.current,Z):[]).some(xe=>xe.context?.open&&!xe.context.dataRef.current[F])}),W=_e(F=>Ws(F,l.select("floatingElement"))||Ws(F,l.select("domReferenceElement"))),O=_e(F=>{i()&&l.setOpen(!1,ze(Oe.triggerPress,F.nativeEvent))}),D=_e(F=>{if(!c||!r||!o||F.key!=="Escape"||_.current||!w&&I("__escapeKeyBubbles"))return;let Z=hf(F)?F.nativeEvent:F,se=ze(Oe.escapeKey,Z);l.setOpen(!1,se),se.isCanceled||F.preventDefault(),!w&&!se.isPropagationAllowed&&F.stopPropagation()}),J=_e(()=>{m.current.insideReactTree=!0,U.start(0,x)}),M=_e(F=>{if(!c||!r||F.button!==0)return;let Z=Dt(F.nativeEvent);Ze(l.select("floatingElement"),Z)&&(R.current||(R.current=!0,k.current=!1))}),E=_e(F=>{!c||!r||(F.defaultPrevented||F.nativeEvent.defaultPrevented)&&R.current&&(k.current=!0)});Xt.useEffect(()=>{if(!c||!r)return;m.current.__escapeKeyBubbles=w,m.current.__outsidePressBubbles=b;let F=new nr,Z=new nr;function se(){F.clear(),_.current=!0}function xe(){F.start(Yr.engine.webkit?5:0,()=>{_.current=!1})}function ie(){T.current=!0,Z.start(0,()=>{T.current=!1})}function ye(){R.current=!1,k.current=!1}function Ee(){let V=A.current,re=V==="pen"||!V?"mouse":V,De=C(),Ue=typeof De=="function"?De():De;return typeof Ue=="string"?Ue:Ue[re]}function ee(V){let re=Ee();return re==="intentional"&&V.type!=="click"||re==="sloppy"&&V.type==="click"}function Ae(V){let re=m.current.floatingContext?.nodeId,De=g&&Xr(g.nodesRef.current,re).some(Ue=>Ws(V,Ue.context?.elements.floating));return W(V)||De}function Ie(V){if(ee(V)){V.type!=="click"&&!W(V)&&(Z.clear(),T.current=!1),x();return}if(m.current.insideReactTree){x();return}let re=Dt(V),De=`[${cn("inert")}]`,Ue=we(re)?re.getRootNode():null,ot=Array.from((sn(Ue)?Ue:Ct(l.select("floatingElement"))).querySelectorAll(De)),ut=l.context.triggerElements;if(re&&(ut.hasElement(re)||ut.hasMatchingElement(We=>Ze(We,re))))return;let je=we(re)?re:null;for(;je&&!wr(je);){let We=vr(je);if(wr(We)||!we(We))break;je=We}if(!(ot.length&&we(re)&&!yf(re)&&!Ze(re,l.select("floatingElement"))&&ot.every(We=>!Ze(je,We)))){if(St(re)&&!("touches"in V)){let We=wr(re),nt=Pt(re),ve=/auto|scroll/,_r=We||ve.test(nt.overflowX),gr=We||ve.test(nt.overflowY),$e=_r&&re.clientWidth>0&&re.scrollWidth>re.clientWidth,Hr=gr&&re.clientHeight>0&&re.scrollHeight>re.clientHeight,Et=nt.direction==="rtl",Ne=Hr&&(Et?V.offsetX<=re.offsetWidth-re.clientWidth:V.offsetX>re.clientWidth),qe=$e&&V.offsetY>re.clientHeight;if(Ne||qe)return}if(!Ae(V)){if(Ee()==="intentional"&&T.current){Z.clear(),T.current=!1;return}typeof v=="function"&&!v(V)||I("__outsidePressBubbles")||(l.setOpen(!1,ze(Oe.outsidePress,V)),x())}}}function ke(V){Ee()!=="sloppy"||V.pointerType==="touch"||!l.select("open")||!r||W(V)||Ie(V)}function He(V){if(Ee()!=="sloppy"||!l.select("open")||!r||W(V))return;let re=V.touches[0];re&&(N.current={startTime:Date.now(),startX:re.clientX,startY:re.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},q.start(1e3,()=>{N.current&&(N.current.dismissOnTouchEnd=!1,N.current.dismissOnMouseDown=!1)}))}function G(V,re){let De=Dt(V);if(!De)return;let Ue=Ye(De,V.type,()=>{re(V),Ue()})}function j(V){A.current="touch",G(V,He)}function X(V){q.clear(),V.type==="pointerdown"&&(A.current=V.pointerType),!(V.type==="mousedown"&&N.current&&!N.current.dismissOnMouseDown)&&G(V,re=>{re.type==="pointerdown"?ke(re):Ie(re)})}function H(V){if(!R.current)return;let re=k.current;if(ye(),Ee()==="intentional"){if(V.type==="pointercancel"){re&&ie();return}if(!Ae(V)){if(re){ie();return}typeof v=="function"&&!v(V)||(Z.clear(),T.current=!0,x())}}}function K(V){if(Ee()!=="sloppy"||!N.current||W(V))return;let re=V.touches[0];if(!re)return;let De=Math.abs(re.clientX-N.current.startX),Ue=Math.abs(re.clientY-N.current.startY),ot=Math.sqrt(De*De+Ue*Ue);ot>5&&(N.current.dismissOnTouchEnd=!0),ot>10&&(Ie(V),q.clear(),N.current=null)}function fe(V){G(V,K)}function ue(V){Ee()!=="sloppy"||!N.current||W(V)||(N.current.dismissOnTouchEnd&&Ie(V),q.clear(),N.current=null)}function de(V){G(V,ue)}let pe=Ct(f),me=Sr(o&&Sr(Ye(pe,"keydown",D),Ye(pe,"compositionstart",se),Ye(pe,"compositionend",xe)),S&&Sr(Ye(pe,"click",X,!0),Ye(pe,"pointerdown",X,!0),Ye(pe,"pointerup",H,!0),Ye(pe,"pointercancel",H,!0),Ye(pe,"mousedown",X,!0),Ye(pe,"mouseup",H,!0),Ye(pe,"touchstart",j,!0),Ye(pe,"touchmove",fe,!0),Ye(pe,"touchend",de,!0)));return()=>{me(),F.clear(),Z.clear(),ye(),T.current=!1}},[m,f,o,S,v,c,r,w,b,D,x,C,I,W,g,l,q]),Xt.useEffect(x,[v,x]);let L=Xt.useMemo(()=>({onKeyDown:D,onPointerDown:O,onClick:O}),[D,O]),$=Xt.useMemo(()=>({onKeyDown:D,onPointerDown:E,onMouseDown:E,onClickCapture:J,onMouseDownCapture(F){J(),M(F)},onPointerDownCapture(F){J(),M(F)},onMouseUpCapture:J,onTouchEndCapture:J,onTouchMoveCapture:J}),[D,J,M,E]);return Xt.useMemo(()=>r?{reference:L,floating:$,trigger:L}:{},[r,L,$])}var Ft=h(be(),1);function Nf(e,t,r){let{reference:o,floating:n}=e,s=qt(t),i=os(t),a=rs(i),u=_t(t),l=s==="y",c=o.x+o.width/2-n.width/2,f=o.y+o.height/2-n.height/2,m=o[a]/2-n[a]/2,g;switch(u){case"top":g={x:c,y:o.y-n.height};break;case"bottom":g={x:c,y:o.y+o.height};break;case"right":g={x:o.x+o.width,y:f};break;case"left":g={x:o.x-n.width,y:f};break;default:g={x:o.x,y:o.y}}switch(Er(t)){case"start":g[i]-=m*(r&&l?-1:1);break;case"end":g[i]+=m*(r&&l?-1:1);break}return g}async function Vf(e,t){var r;t===void 0&&(t={});let{x:o,y:n,platform:s,rects:i,elements:a,strategy:u}=e,{boundary:l="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:m=!1,padding:g=0}=Rr(t,e),d=Zs(g),S=a[m?f==="floating"?"reference":"floating":f],C=Io(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(S)))==null||r?S:S.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:c,strategy:u})),w=f==="floating"?{x:o,y:n,width:i.floating.width,height:i.floating.height}:i.reference,b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),R=await(s.isElement==null?void 0:s.isElement(b))?await(s.getScale==null?void 0:s.getScale(b))||{x:1,y:1}:{x:1,y:1},k=Io(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:b,strategy:u}):w);return{top:(C.top-k.top+d.top)/R.y,bottom:(k.bottom-C.bottom+d.bottom)/R.y,left:(C.left-k.left+d.left)/R.x,right:(k.right-C.right+d.right)/R.x}}var jb=50,Bf=async(e,t,r)=>{let{placement:o="bottom",strategy:n="absolute",middleware:s=[],platform:i}=r,a=i.detectOverflow?i:{...i,detectOverflow:Vf},u=await(i.isRTL==null?void 0:i.isRTL(t)),l=await i.getElementRects({reference:e,floating:t,strategy:n}),{x:c,y:f}=Nf(l,o,u),m=o,g=0,d={};for(let v=0;vW<=0)){var U,x;let W=(((U=s.flip)==null?void 0:U.index)||0)+1,O=_[W];if(O&&(!(f==="alignment"?w!==qt(O):!1)||q.every(M=>qt(M.placement)===w?M.overflows[0]>0:!0)))return{data:{index:W,overflows:q},reset:{placement:O}};let D=(x=q.filter(J=>J.overflows[0]<=0).sort((J,M)=>J.overflows[1]-M.overflows[1])[0])==null?void 0:x.placement;if(!D)switch(g){case"bestFit":{var I;let J=(I=q.filter(M=>{if(T){let E=qt(M.placement);return E===w||E==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(E=>E>0).reduce((E,L)=>E+L,0)]).sort((M,E)=>M[1]-E[1])[0])==null?void 0:I[0];J&&(D=J);break}case"initialPlacement":D=a;break}if(n!==D)return{reset:{placement:D}}}return{}}}};function Df(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Mf(e){return Ef.some(t=>e[t]>=0)}var jf=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){let{rects:r,platform:o}=t,{strategy:n="referenceHidden",...s}=Rr(e,t);switch(n){case"referenceHidden":{let i=await o.detectOverflow(t,{...s,elementContext:"reference"}),a=Df(i,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Mf(a)}}}case"escaped":{let i=await o.detectOverflow(t,{...s,altBoundary:!0}),a=Df(i,r.floating);return{data:{escapedOffsets:a,escaped:Mf(a)}}}default:return{}}}}};var Hf=new Set(["left","top"]);async function Hb(e,t){let{placement:r,platform:o,elements:n}=e,s=await(o.isRTL==null?void 0:o.isRTL(n.floating)),i=_t(r),a=Er(r),u=qt(r)==="y",l=Hf.has(i)?-1:1,c=s&&u?-1:1,f=Rr(t,e),{mainAxis:m,crossAxis:g,alignmentAxis:d}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof d=="number"&&(g=a==="end"?d*-1:d),u?{x:g*c,y:m*l}:{x:m*l,y:g*c}}var Uf=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,o;let{x:n,y:s,placement:i,middlewareData:a}=t,u=await Hb(t,e);return i===((r=a.offset)==null?void 0:r.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:n+u.x,y:s+u.y,data:{...u,placement:i}}}}},Wf=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:r,y:o,placement:n,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:u={fn:C=>{let{x:w,y:b}=C;return{x:w,y:b}}},...l}=Rr(e,t),c={x:r,y:o},f=await s.detectOverflow(t,l),m=qt(_t(n)),g=qs(m),d=c[g],v=c[m];if(i){let C=g==="y"?"top":"left",w=g==="y"?"bottom":"right",b=d+f[C],R=d-f[w];d=ts(b,d,R)}if(a){let C=m==="y"?"top":"left",w=m==="y"?"bottom":"right",b=v+f[C],R=v-f[w];v=ts(b,v,R)}let S=u.fn({...t,[g]:d,[m]:v});return{...S,data:{x:S.x-r,y:S.y-o,enabled:{[g]:i,[m]:a}}}}}},Gf=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:r,y:o,placement:n,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:u=!0,crossAxis:l=!0}=Rr(e,t),c={x:r,y:o},f=qt(n),m=qs(f),g=c[m],d=c[f],v=Rr(a,t),S=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(u){let b=m==="y"?"height":"width",R=s.reference[m]-s.floating[b]+S.mainAxis,k=s.reference[m]+s.reference[b]-S.mainAxis;gk&&(g=k)}if(l){var C,w;let b=m==="y"?"width":"height",R=Hf.has(_t(n)),k=s.reference[f]-s.floating[b]+(R&&((C=i.offset)==null?void 0:C[f])||0)+(R?0:S.crossAxis),T=s.reference[f]+s.reference[b]+(R?0:((w=i.offset)==null?void 0:w[f])||0)-(R?S.crossAxis:0);dT&&(d=T)}return{[m]:g,[f]:d}}}},Yf=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,o;let{placement:n,rects:s,platform:i,elements:a}=t,{apply:u=()=>{},...l}=Rr(e,t),c=await i.detectOverflow(t,l),f=_t(n),m=Er(n),g=qt(n)==="y",{width:d,height:v}=s.floating,S,C;f==="top"||f==="bottom"?(S=f,C=m===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(C=f,S=m==="end"?"top":"bottom");let w=v-c.top-c.bottom,b=d-c.left-c.right,R=uo(v-c[S],w),k=uo(d-c[C],b),T=!t.middlewareData.shift,_=R,A=k;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(A=b),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(_=w),T&&!m){let q=Mt(c.left,0),U=Mt(c.right,0),x=Mt(c.top,0),I=Mt(c.bottom,0);g?A=d-2*(q!==0||U!==0?q+U:Mt(c.left,c.right)):_=v-2*(x!==0||I!==0?x+I:Mt(c.top,c.bottom))}await u({...t,availableWidth:A,availableHeight:_});let N=await i.getDimensions(a.floating);return d!==N.width||v!==N.height?{reset:{rects:!0}}:{}}}};function Kf(e){let t=Pt(e),r=parseFloat(t.width)||0,o=parseFloat(t.height)||0,n=St(e),s=n?e.offsetWidth:r,i=n?e.offsetHeight:o,a=fo(r)!==s||fo(o)!==i;return a&&(r=s,o=i),{width:r,height:o,$:a}}function Ja(e){return we(e)?e:e.contextElement}function fn(e){let t=Ja(e);if(!St(t))return Cr(1);let r=t.getBoundingClientRect(),{width:o,height:n,$:s}=Kf(t),i=(s?fo(r.width):r.width)/o,a=(s?fo(r.height):r.height)/n;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}var Ub=Cr(0);function Jf(e){let t=lt(e);return!zs()||!t.visualViewport?Ub:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Wb(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==lt(e)?!1:t}function No(e,t,r,o){t===void 0&&(t=!1),r===void 0&&(r=!1);let n=e.getBoundingClientRect(),s=Ja(e),i=Cr(1);t&&(o?we(o)&&(i=fn(o)):i=fn(e));let a=Wb(s,r,o)?Jf(s):Cr(0),u=(n.left+a.x)/i.x,l=(n.top+a.y)/i.y,c=n.width/i.x,f=n.height/i.y;if(s){let m=lt(s),g=o&&we(o)?lt(o):o,d=m,v=js(d);for(;v&&o&&g!==d;){let S=fn(v),C=v.getBoundingClientRect(),w=Pt(v),b=C.left+(v.clientLeft+parseFloat(w.paddingLeft))*S.x,R=C.top+(v.clientTop+parseFloat(w.paddingTop))*S.y;u*=S.x,l*=S.y,c*=S.x,f*=S.y,u+=b,l+=R,d=lt(v),v=js(d)}}return Io({width:c,height:f,x:u,y:l})}function Xs(e,t){let r=Jn(e).scrollLeft;return t?t.left+r:No(br(e)).left+r}function Qf(e,t){let r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-Xs(e,r),n=r.top+t.scrollTop;return{x:o,y:n}}function Gb(e){let{elements:t,rect:r,offsetParent:o,strategy:n}=e,s=n==="fixed",i=br(o),a=t?Kn(t.floating):!1;if(o===i||a&&s)return r;let u={scrollLeft:0,scrollTop:0},l=Cr(1),c=Cr(0),f=St(o);if((f||!f&&!s)&&((ko(o)!=="body"||an(i))&&(u=Jn(o)),f)){let g=No(o);l=fn(o),c.x=g.x+o.clientLeft,c.y=g.y+o.clientTop}let m=i&&!f&&!s?Qf(i,u):Cr(0);return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-u.scrollLeft*l.x+c.x+m.x,y:r.y*l.y-u.scrollTop*l.y+c.y+m.y}}function Yb(e){return Array.from(e.getClientRects())}function qb(e){let t=br(e),r=Jn(e),o=e.ownerDocument.body,n=Mt(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=Mt(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight),i=-r.scrollLeft+Xs(e),a=-r.scrollTop;return Pt(o).direction==="rtl"&&(i+=Mt(t.clientWidth,o.clientWidth)-n),{width:n,height:s,x:i,y:a}}var qf=25;function Zb(e,t){let r=lt(e),o=br(e),n=r.visualViewport,s=o.clientWidth,i=o.clientHeight,a=0,u=0;if(n){s=n.width,i=n.height;let c=zs();(!c||c&&t==="fixed")&&(a=n.offsetLeft,u=n.offsetTop)}let l=Xs(o);if(l<=0){let c=o.ownerDocument,f=c.body,m=getComputedStyle(f),g=c.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,d=Math.abs(o.clientWidth-f.clientWidth-g);d<=qf&&(s-=d)}else l<=qf&&(s+=l);return{width:s,height:i,x:a,y:u}}function Xb(e,t){let r=No(e,!0,t==="fixed"),o=r.top+e.clientTop,n=r.left+e.clientLeft,s=St(e)?fn(e):Cr(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,u=n*s.x,l=o*s.y;return{width:i,height:a,x:u,y:l}}function Zf(e,t,r){let o;if(t==="viewport")o=Zb(e,r);else if(t==="document")o=qb(br(e));else if(we(t))o=Xb(t,r);else{let n=Jf(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Io(o)}function $f(e,t){let r=vr(e);return r===t||!we(r)||wr(r)?!1:Pt(r).position==="fixed"||$f(r,t)}function Kb(e,t){let r=t.get(e);if(r)return r;let o=ao(e,[],!1).filter(a=>we(a)&&ko(a)!=="body"),n=null,s=Pt(e).position==="fixed",i=s?vr(e):e;for(;we(i)&&!wr(i);){let a=Pt(i),u=Bs(i);!u&&a.position==="fixed"&&(n=null),(s?!u&&!n:!u&&a.position==="static"&&!!n&&(n.position==="absolute"||n.position==="fixed")||an(i)&&!u&&$f(e,i))?o=o.filter(c=>c!==i):n=a,i=vr(i)}return t.set(e,o),o}function Jb(e){let{element:t,boundary:r,rootBoundary:o,strategy:n}=e,i=[...r==="clippingAncestors"?Kn(t)?[]:Kb(t,this._c):[].concat(r),o],a=Zf(t,i[0],n),u=a.top,l=a.right,c=a.bottom,f=a.left;for(let m=1;m{i(!1,1e-7)},1e3)}_===1&&!td(l,e.getBoundingClientRect())&&i(),R=!1}try{r=new IntersectionObserver(k,{...b,root:n.ownerDocument})}catch{r=new IntersectionObserver(k,b)}r.observe(e)}return i(!0),s}function ns(e,t,r,o){o===void 0&&(o={});let{ancestorScroll:n=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:u=!1}=o,l=Ja(e),c=n||s?[...l?ao(l):[],...t?ao(t):[]]:[];c.forEach(C=>{n&&C.addEventListener("scroll",r,{passive:!0}),s&&C.addEventListener("resize",r)});let f=l&&a?r0(l,r):null,m=-1,g=null;i&&(g=new ResizeObserver(C=>{let[w]=C;w&&w.target===l&&g&&t&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var b;(b=g)==null||b.observe(t)})),r()}),l&&!u&&g.observe(l),t&&g.observe(t));let d,v=u?No(e):null;u&&S();function S(){let C=No(e);v&&!td(v,C)&&r(),v=C,d=requestAnimationFrame(S)}return r(),()=>{var C;c.forEach(w=>{n&&w.removeEventListener("scroll",r),s&&w.removeEventListener("resize",r)}),f?.(),(C=g)==null||C.disconnect(),g=null,u&&cancelAnimationFrame(d)}}var rd=Uf;var od=Wf,nd=zf,sd=Yf,id=jf;var ad=Gf,Ks=(e,t,r)=>{let o=new Map,n={platform:Qa,...r},s={...n.platform,_c:o};return Bf(e,t,{...n,platform:s})};var yt=h(be(),1),cd=h(be(),1),ud=h(lo(),1),n0=typeof document<"u",s0=function(){},Js=n0?cd.useLayoutEffect:s0;function Qs(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,o,n;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(o=r;o--!==0;)if(!Qs(e[o],t[o]))return!1;return!0}if(n=Object.keys(e),r=n.length,r!==Object.keys(t).length)return!1;for(o=r;o--!==0;)if(!{}.hasOwnProperty.call(t,n[o]))return!1;for(o=r;o--!==0;){let s=n[o];if(!(s==="_owner"&&e.$$typeof)&&!Qs(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function fd(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ld(e,t){let r=fd(e);return Math.round(t*r)/r}function $a(e){let t=yt.useRef(e);return Js(()=>{t.current=e}),t}function dd(e){e===void 0&&(e={});let{placement:t="bottom",strategy:r="absolute",middleware:o=[],platform:n,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:u,open:l}=e,[c,f]=yt.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=yt.useState(o);Qs(m,o)||g(o);let[d,v]=yt.useState(null),[S,C]=yt.useState(null),w=yt.useCallback(M=>{M!==T.current&&(T.current=M,v(M))},[]),b=yt.useCallback(M=>{M!==_.current&&(_.current=M,C(M))},[]),R=s||d,k=i||S,T=yt.useRef(null),_=yt.useRef(null),A=yt.useRef(c),N=u!=null,q=$a(u),U=$a(n),x=$a(l),I=yt.useCallback(()=>{if(!T.current||!_.current)return;let M={placement:t,strategy:r,middleware:m};U.current&&(M.platform=U.current),Ks(T.current,_.current,M).then(E=>{let L={...E,isPositioned:x.current!==!1};W.current&&!Qs(A.current,L)&&(A.current=L,ud.flushSync(()=>{f(L)}))})},[m,t,r,U,x]);Js(()=>{l===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,f(M=>({...M,isPositioned:!1})))},[l]);let W=yt.useRef(!1);Js(()=>(W.current=!0,()=>{W.current=!1}),[]),Js(()=>{if(R&&(T.current=R),k&&(_.current=k),R&&k){if(q.current)return q.current(R,k,I);I()}},[R,k,I,q,N]);let O=yt.useMemo(()=>({reference:T,floating:_,setReference:w,setFloating:b}),[w,b]),D=yt.useMemo(()=>({reference:R,floating:k}),[R,k]),J=yt.useMemo(()=>{let M={position:r,left:0,top:0};if(!D.floating)return M;let E=ld(D.floating,c.x),L=ld(D.floating,c.y);return a?{...M,transform:"translate("+E+"px, "+L+"px)",...fd(D.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:E,top:L}},[r,a,D.floating,c.x,c.y]);return yt.useMemo(()=>({...c,update:I,refs:O,elements:D,floatingStyles:J}),[c,I,O,D,J])}var el=(e,t)=>{let r=rd(e);return{name:r.name,fn:r.fn,options:[e,t]}},tl=(e,t)=>{let r=od(e);return{name:r.name,fn:r.fn,options:[e,t]}},rl=(e,t)=>({fn:ad(e).fn,options:[e,t]}),ol=(e,t)=>{let r=nd(e);return{name:r.name,fn:r.fn,options:[e,t]}},nl=(e,t)=>{let r=sd(e);return{name:r.name,fn:r.fn,options:[e,t]}};var sl=(e,t)=>{let r=id(e);return{name:r.name,fn:r.fn,options:[e,t]}};var mn=h(be(),1),Od=h(lo(),1);var Td=h(be(),1);var Me=(e,t,r,o,n,s,...i)=>{if(i.length>0)throw new Error(Wt(1));let a;if(e&&t&&r&&o&&n&&s)a=(u,l,c,f)=>{let m=e(u,l,c,f),g=t(u,l,c,f),d=r(u,l,c,f),v=o(u,l,c,f),S=n(u,l,c,f);return s(m,g,d,v,S,l,c,f)};else if(e&&t&&r&&o&&n)a=(u,l,c,f)=>{let m=e(u,l,c,f),g=t(u,l,c,f),d=r(u,l,c,f),v=o(u,l,c,f);return n(m,g,d,v,l,c,f)};else if(e&&t&&r&&o)a=(u,l,c,f)=>{let m=e(u,l,c,f),g=t(u,l,c,f),d=r(u,l,c,f);return o(m,g,d,l,c,f)};else if(e&&t&&r)a=(u,l,c,f)=>{let m=e(u,l,c,f),g=t(u,l,c,f);return r(m,g,l,c,f)};else if(e&&t)a=(u,l,c,f)=>{let m=e(u,l,c,f);return t(m,l,c,f)};else if(e)a=e;else throw new Error("Missing arguments");return a};var Rd=h(be(),1),fl=h(al(),1),Ed=h(bd(),1);var wd=h(be(),1);var ll=[],cl;function xd(){return cl}function Sd(e){ll.push(e)}function ul(e){let t=(r,o)=>{let n=Tt(C0).current,s;try{cl=n;for(let i of ll)i.before(n);s=e(r,o);for(let i of ll)i.after(n);n.didInitialize=!0}finally{cl=void 0}return s};return t.displayName=e.displayName||e.name,t}function Cd(e){return wd.forwardRef(ul(e))}function C0(){return{didInitialize:!1}}var R0=rn(19),E0=R0?_0:O0;function ei(e,t,r,o,n){return E0(e,t,r,o,n)}function T0(e,t,r,o,n){let s=Rd.useCallback(()=>t(e.getSnapshot(),r,o,n),[e,t,r,o,n]);return(0,fl.useSyncExternalStore)(e.subscribe,s,s)}Sd({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let r=0;r0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let r=new Set;for(let n of e.syncHooks)r.add(n.store);let o=[];for(let n of r)o.push(n.subscribe(t));return()=>{for(let n of o)n()}}),(0,fl.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function _0(e,t,r,o,n){let s=xd();if(!s)return T0(e,t,r,o,n);let i=s.syncIndex;s.syncIndex+=1;let a;return s.didInitialize?(a=s.syncHooks[i],(a.store!==e||a.selector!==t||!Object.is(a.a1,r)||!Object.is(a.a2,o)||!Object.is(a.a3,n))&&(a.store!==e&&(s.didChangeStore=!0),a.store=e,a.selector=t,a.a1=r,a.a2=o,a.a3=n,a.value=t(e.getSnapshot(),r,o,n))):(a={store:e,selector:t,a1:r,a2:o,a3:n,value:t(e.getSnapshot(),r,o,n)},s.syncHooks.push(a)),a.value}function O0(e,t,r,o,n){return(0,Ed.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,r,o,n))}var ti=class{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;let r=this.updateTick;for(let o of this.listeners){if(r!==this.updateTick)return;o(t)}}update(t){for(let r in t)if(!Object.is(this.state[r],t[r])){this.setState({...this.state,...t});return}}set(t,r){Object.is(this.state[t],r)||this.setState({...this.state,[t]:r})}notifyAll(){let t={...this.state};this.setState(t)}use(t,r,o,n){return ei(this,t,r,o,n)}};var Do=h(be(),1);var pn=class extends ti{constructor(t,r={},o){super(t),this.context=r,this.selectors=o}useSyncedValue(t,r){Do.useDebugValue(t);let o=this;ge(()=>{o.state[t]!==r&&o.set(t,r)},[o,t,r])}useSyncedValueWithCleanup(t,r){let o=this;ge(()=>(o.state[t]!==r&&o.set(t,r),()=>{o.set(t,void 0)}),[o,t,r])}useSyncedValues(t){let r=this,o=Object.values(t);ge(()=>{r.update(t)},[r,...o])}useControlledProp(t,r){Do.useDebugValue(t);let o=this,n=r!==void 0;ge(()=>{n&&!Object.is(o.state[t],r)&&o.setState({...o.state,[t]:r})},[o,t,r,n])}select(t,r,o,n){let s=this.selectors[t];return s(this.state,r,o,n)}useState(t,r,o,n){return Do.useDebugValue(t),ei(this,this.selectors[t],r,o,n)}useContextCallback(t,r){Do.useDebugValue(t);let o=_e(r??so);this.context[t]=o}useStateSetter(t){let r=Do.useRef(void 0);return r.current===void 0&&(r.current=o=>{this.set(t,o)}),r.current}observe(t,r){let o;typeof t=="function"?o=t:o=this.selectors[t];let n=o(this.state);return r(n,n,this),this.subscribe(s=>{let i=o(s);if(!Object.is(n,i)){let a=n;n=i,r(i,a,this)}})}};var P0={open:Me(e=>e.open),transitionStatus:Me(e=>e.transitionStatus),domReferenceElement:Me(e=>e.domReferenceElement),referenceElement:Me(e=>e.positionReference??e.referenceElement),floatingElement:Me(e=>e.floatingElement),floatingId:Me(e=>e.floatingId)},Pr=class extends pn{constructor(t){let{syncOnly:r,nested:o,onOpenChange:n,triggerElements:s,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:n,dataRef:{current:{}},events:If(),nested:o,triggerElements:s},P0),this.syncOnly=r}syncOpenEvent=(t,r)=>{(!t||!this.state.open||r!=null&&gf(r))&&(this.context.dataRef.current.openEvent=t?r:void 0)};dispatchOpenChange=(t,r)=>{this.syncOpenEvent(t,r.event);let o={open:t,reason:r.reason,nativeEvent:r.event,nested:this.context.nested,triggerElement:r.trigger};this.context.events.emit("openchange",o)};setOpen=(t,r)=>{if(this.syncOnly){this.context.onOpenChange?.(t,r);return}this.dispatchOpenChange(t,r),this.context.onOpenChange?.(t,r)}};function _d(e){let{popupStore:t,treatPopupAsFloatingElement:r=!1,floatingRootContext:o,floatingId:n,nested:s,onOpenChange:i}=e,a=t.useState("open"),u=t.useState("activeTriggerElement"),l=t.useState(r?"popupElement":"positionerElement"),c=t.context.triggerElements,f=i,m=Td.useRef(null);o===void 0&&m.current===null&&(m.current=new Pr({open:a,transitionStatus:void 0,referenceElement:u,floatingElement:l,triggerElements:c,onOpenChange:f,floatingId:n,syncOnly:!0,nested:s}));let g=o??m.current;return t.useSyncedValue("floatingId",n),ge(()=>{let d={open:a,floatingId:n,referenceElement:u,floatingElement:l};we(u)&&(d.domReferenceElement=u),g.state.positionReference===g.state.referenceElement&&(d.positionReference=u),g.update(d)},[a,n,u,l,g]),g.context.onOpenChange=f,g.context.nested=s,g}var Pd={tabIndex:-1,[ja]:""};function kd(e,t,r=!1){let o=io(),n=un()!=null,s=mn.useRef(null);e===void 0&&s.current===null&&(s.current=t(o,n));let i=e??s.current;return _d({popupStore:i,treatPopupAsFloatingElement:r,floatingRootContext:i.state.floatingRootContext,floatingId:o,nested:n,onOpenChange:i.setOpen}),{store:i,internalStore:s.current}}function k0(e,t){let r=mn.useRef(null),o=mn.useRef(null);return mn.useCallback(n=>{if(e===void 0)return;let s=!1;if(r.current!==null){let i=r.current,a=o.current,u=t.context.triggerElements.getById(i);a&&u===a&&(t.context.triggerElements.delete(i),s=!0),r.current=null,o.current=null}if(n!==null&&(r.current=e,o.current=n,t.context.triggerElements.add(e,n),s=!0),s){let i=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==i&&t.set("triggerCount",i)}},[t,e])}function F0(e,t,r,o=!1){t?e.preventUnmountingOnClose=!1:o&&(e.preventUnmountingOnClose=!0);let n=r?.id??null;(n||t)&&(e.activeTriggerId=n,e.activeTriggerElement=r??null)}function A0(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Fd(e,t,r,o={}){let n=r.reason,s=n===Oe.triggerHover,i=t&&n===Oe.triggerFocus,a=!t&&(n===Oe.triggerPress||n===Oe.escapeKey),u=A0(r);if(e.context.onOpenChange?.(t,r),r.isCanceled)return;o.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,r);let l=()=>{let c={...o.extraState,open:t};i?c.instantType="focus":a?c.instantType="dismiss":s&&(c.instantType=void 0),F0(c,t,r.trigger,u()),e.update(c)};s?Od.flushSync(l):l()}function Ad(e,t,r,o){uf(()=>{t===void 0&&e.state.open===!1&&r&&(e.state={...e.state,open:!0,activeTriggerId:o,preventUnmountingOnClose:!1})})}function Id(e,t,r,o){let n=r.useState("isMountedByTrigger",e),s=k0(e,r),i=_e(a=>{if(s(a),!a)return;let u=r.select("open"),l=r.select("activeTriggerId");if(l===e){r.update({activeTriggerElement:a,...u?o:null});return}l==null&&u&&r.update({activeTriggerId:e,activeTriggerElement:a,...o})});return ge(()=>{n&&r.update({activeTriggerElement:t.current,...o})},[n,r,t,...Object.values(o)]),{registerTrigger:i,isMountedByThisTrigger:n}}function Ld(e,t={}){let{closeOnActiveTriggerUnmount:r=!1}=t,o=e.useState("open"),n=e.useState("triggerCount");ge(()=>{if(!o){e.state.triggerCount!==0&&e.set("triggerCount",0);return}let s=e.context.triggerElements.size,i={};e.state.triggerCount!==s&&(i.triggerCount=s);let a=e.select("activeTriggerId"),u=null;if(a){let l=e.context.triggerElements.getById(a);l?l!==e.state.activeTriggerElement&&(i.activeTriggerElement=l):u=a}if(!u&&!a&&s===1){let l=e.context.triggerElements.entries().next();if(!l.done){let[c,f]=l.value;i.activeTriggerId=c,i.activeTriggerElement=f}}(i.triggerCount!==void 0||i.activeTriggerId!==void 0||i.activeTriggerElement!==void 0)&&e.update(i),u&&r&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===u&&!e.context.triggerElements.getById(u)){let l=ze(Oe.none);e.setOpen(!1,l),l.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[o,e,n,r])}function Nd(e,t,r){let{mounted:o,setMounted:n,transitionStatus:s}=$u(e),i=t.useState("preventUnmountingOnClose"),a=e?!1:i;t.useSyncedValues({mounted:o,transitionStatus:s,preventUnmountingOnClose:a});let u=_e(()=>{n(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),r?.(),t.context.onOpenChangeComplete?.(!1)});return Hs({enabled:o&&!e&&!a,open:e,ref:t.context.popupRef,onComplete(){e||u()}}),{forceUnmount:u,transitionStatus:s}}function Dd(e,t){e.useSyncedValues(t),ge(()=>()=>{e.update({activeTriggerProps:pt,inactiveTriggerProps:pt,popupProps:pt})},[e])}var mo=class{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,r){let o=this.idMap.get(t);o!==r&&(o!==void 0&&this.elementsSet.delete(o),this.elementsSet.add(r),this.idMap.set(t,r))}delete(t){let r=this.idMap.get(t);r&&(this.elementsSet.delete(r),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(let r of this.elementsSet)if(t(r))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}};function Md(){return new Pr({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new mo,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function Bd(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:Md(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:pt,inactiveTriggerProps:pt,popupProps:pt}}function zd(e,t,r=!1){return new Pr({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:r,onOpenChange:void 0})}var ss=Me(e=>e.triggerIdProp??e.activeTriggerId),dl=Me(e=>e.openProp??e.open),Vd=Me(e=>(e.popupElement?.id??e.floatingId)||void 0);function jd(e,t){return t!==void 0&&dl(e)&&ss(e)===t}function I0(e,t){return jd(e,t)?!0:t!==void 0&&dl(e)&&ss(e)==null&&e.triggerCount===1}var Hd={open:dl,mounted:Me(e=>e.mounted),transitionStatus:Me(e=>e.transitionStatus),floatingRootContext:Me(e=>e.floatingRootContext),triggerCount:Me(e=>e.triggerCount),preventUnmountingOnClose:Me(e=>e.preventUnmountingOnClose),payload:Me(e=>e.payload),activeTriggerId:ss,activeTriggerElement:Me(e=>e.mounted?e.activeTriggerElement:null),popupId:Vd,isTriggerActive:Me((e,t)=>t!==void 0&&ss(e)===t),isOpenedByTrigger:Me((e,t)=>jd(e,t)),isMountedByTrigger:Me((e,t)=>t!==void 0&&ss(e)===t&&e.mounted),triggerProps:Me((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),triggerPopupId:Me((e,t)=>I0(e,t)?Vd(e):void 0),popupProps:Me(e=>e.popupProps),popupElement:Me(e=>e.popupElement),positionerElement:Me(e=>e.positionerElement)};function Ud(e){let{open:t=!1,onOpenChange:r,elements:o={}}=e,n=io(),s=un()!=null,i=Tt(()=>new Pr({open:t,transitionStatus:void 0,onOpenChange:r,referenceElement:o.reference??null,floatingElement:o.floating??null,triggerElements:new mo,floatingId:n,syncOnly:!1,nested:s})).current;return ge(()=>{let a={open:t,floatingId:n};o.reference!==void 0&&(a.referenceElement=o.reference,a.domReferenceElement=we(o.reference)?o.reference:null),o.floating!==void 0&&(a.floatingElement=o.floating),i.update(a)},[t,n,o.reference,o.floating,i]),i.context.onOpenChange=r,i.context.nested=s,i}function pl(e={}){let{nodeId:t,externalTree:r}=e,o=Ud(e),n=e.rootContext||o,s=n.useState("referenceElement"),i=n.useState("floatingElement"),a=n.useState("domReferenceElement"),u=n.useState("open"),l=n.useState("floatingId"),[c,f]=Ft.useState(null),[m,g]=Ft.useState(void 0),[d,v]=Ft.useState(void 0),S=Ft.useRef(null),C=po(r),w=Ft.useMemo(()=>({reference:s,floating:i,domReference:a}),[s,i,a]),b=dd({...e,elements:{...w,...c&&{reference:c}}}),R=we(m)?m:null,k=d===void 0?n.state.floatingElement:d;n.useSyncedValue("referenceElement",m??null),n.useSyncedValue("domReferenceElement",m===void 0?a:R),n.useSyncedValue("floatingElement",k);let T=Ft.useCallback(x=>{let I=we(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),getClientRects:()=>x.getClientRects(),contextElement:x}:x;f(I),b.refs.setReference(I)},[b.refs]),_=Ft.useCallback(x=>{(we(x)||x===null)&&(S.current=x,g(x)),(we(b.refs.reference.current)||b.refs.reference.current===null||x!==null&&!we(x))&&b.refs.setReference(x)},[b.refs,g]),A=Ft.useCallback(x=>{v(x),b.refs.setFloating(x)},[b.refs]),N=Ft.useMemo(()=>({...b.refs,setReference:_,setFloating:A,setPositionReference:T,domReference:S}),[b.refs,_,A,T]),q=Ft.useMemo(()=>({...b.elements,domReference:a}),[b.elements,a]),U=Ft.useMemo(()=>({...b,dataRef:n.context.dataRef,open:u,onOpenChange:n.setOpen,events:n.context.events,floatingId:l,refs:N,elements:q,nodeId:t,rootStore:n}),[b,N,q,t,n,u,l]);return ge(()=>{a&&(S.current=a)},[a]),ge(()=>{n.context.dataRef.current.floatingContext=U;let x=C?.nodesRef.current.find(I=>I.id===t);x&&(x.context=U)}),Ft.useMemo(()=>({...b,context:U,refs:N,elements:q,rootStore:n}),[b,N,q,U,n])}var kr=h(be(),1);var ml=Yr.os.mac&&Yr.engine.webkit;function hl(e,t={}){let{enabled:r=!0,delay:o}=t,n="rootStore"in e?e.rootStore:e,{events:s,dataRef:i}=n.context,a=kr.useRef(!1),u=kr.useRef(null),l=kr.useRef(!0),c=xr();kr.useEffect(()=>{let m=n.select("domReferenceElement");if(!r)return;let g=lt(m);function d(){let C=n.select("domReferenceElement");!n.select("open")&&St(C)&&C===Us(Ct(C))&&(a.current=!0)}function v(){l.current=!0}function S(){l.current=!1}return Sr(Ye(g,"blur",d),ml&&Ye(g,"keydown",v,!0),ml&&Ye(g,"pointerdown",S,!0))},[n,r]),kr.useEffect(()=>{if(!r)return;function m(g){if(g.reason===Oe.triggerPress||g.reason===Oe.escapeKey){let d=n.select("domReferenceElement");we(d)&&(u.current=d,a.current=!0)}}return s.on("openchange",m),()=>{s.off("openchange",m)}},[s,r,n]);let f=kr.useMemo(()=>{function m(){a.current=!1,u.current=null}return{onMouseLeave(){m()},onFocus(g){let d=g.currentTarget;if(a.current){if(u.current===d)return;m()}let v=Dt(g.nativeEvent);if(we(v)){if(ml&&!g.relatedTarget){if(!l.current&&!vf(v))return}else if(!bf(v))return}let S=co(g.relatedTarget,n.context.triggerElements),{nativeEvent:C,currentTarget:w}=g,b=typeof o=="function"?o():o;if(n.select("open")&&S||b===0||b===void 0){n.setOpen(!0,ze(Oe.triggerFocus,C,w));return}c.start(b,()=>{a.current||n.setOpen(!0,ze(Oe.triggerFocus,C,w))})},onBlur(g){m();let d=g.relatedTarget,v=g.nativeEvent,S=we(d)&&d.hasAttribute(cn("focus-guard"))&&d.getAttribute("data-type")==="outside";c.start(0,()=>{let C=n.select("domReferenceElement"),w=Us(Ct(C));!d&&w===C||Ze(i.current.floatingContext?.refs.floating.current,w)||Ze(C,w)||S||co(d??w,n.context.triggerElements)||n.setOpen(!1,ze(Oe.triggerFocus,v))})}}},[i,o,n,c]);return kr.useMemo(()=>r?{reference:f,trigger:f}:{},[r,f])}var yl=h(be(),1);var gl=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new nr,this.restTimeout=new nr,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},ri=new WeakMap;function hn(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&ri.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),ri.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function oi(e,t){let{scopeElement:r,referenceElement:o,floatingElement:n}=t,s=ri.get(r);s&&s!==e&&hn(s),hn(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=r,e.pointerEventsReferenceElement=o,e.pointerEventsFloatingElement=n,ri.set(r,e),r.style.pointerEvents="none",o.style.pointerEvents="auto",n.style.pointerEvents="auto"}function gn(e){let t=e.context.dataRef.current,r=Tt(()=>t.hoverInteractionState??gl.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=r),on(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function vl(e,t={}){let{enabled:r=!0,closeDelay:o=0,nodeId:n}=t,s="rootStore"in e?e.rootStore:e,i=s.useState("open"),a=s.useState("floatingElement"),u=s.useState("domReferenceElement"),{dataRef:l}=s.context,c=po(),f=un(),m=gn(s),g=xr(),d=_e(()=>Gs(l.current.openEvent?.type,m.interactedInside)),v=_e(()=>wf(l.current.openEvent?.type)),S=_e(()=>{hn(m)});ge(()=>{i||(m.pointerType=void 0,m.restTimeoutPending=!1,m.interactedInside=!1,S())},[i,m,S]),yl.useEffect(()=>S,[S]),ge(()=>{if(r&&i&&m.handleCloseOptions?.blockPointerEvents&&v()&&we(u)&&a){let C=u,w=a,b=Ct(a),R=c?.nodesRef.current.find(A=>A.id===f)?.context?.elements.floating;R&&(R.style.pointerEvents="");let k=m.pointerEventsScopeElement!==w?m.pointerEventsScopeElement:null,T=R!==w?R:null,_=m.handleCloseOptions?.getScope?.()??k??T??C.closest("[data-rootownerid]")??b.body;return oi(m,{scopeElement:_,referenceElement:C,floatingElement:w}),()=>{S()}}},[r,i,u,a,m,v,c,f,S]),yl.useEffect(()=>{if(!r)return;function C(){return!!(c&&f&&Xr(c.nodesRef.current,f).length>0)}function w(A){let N=Zr(o,"close",m.pointerType),q=()=>{s.setOpen(!1,ze(Oe.triggerHover,A)),c?.events.emit("floating.closed",A)};N?m.openChangeTimeout.start(N,q):(m.openChangeTimeout.clear(),q())}function b(A){let N=Dt(A);if(!Ua(N)){m.interactedInside=!1;return}m.interactedInside=N?.closest("[aria-haspopup]")!=null}function R(){m.openChangeTimeout.clear(),g.clear(),c?.events.off("floating.closed",T),S()}function k(A){if(C()&&c){c.events.on("floating.closed",T);return}if(co(A.relatedTarget,s.context.triggerElements))return;let N=l.current.floatingContext?.nodeId??n,q=A.relatedTarget;if(!(c&&N&&we(q)&&Xr(c.nodesRef.current,N,!1).some(x=>Ze(x.context?.elements.floating,q)))){if(m.handler){m.handler(A);return}S(),v()&&!d()&&w(A)}}function T(A){!c||!f||C()||g.start(0,()=>{c.events.off("floating.closed",T),s.setOpen(!1,ze(Oe.triggerHover,A)),c.events.emit("floating.closed",A)})}let _=a;return Sr(_&&Ye(_,"mouseenter",R),_&&Ye(_,"mouseleave",k),_&&Ye(_,"pointerdown",b,!0),()=>{c?.events.off("floating.closed",T)})},[r,a,s,l,o,n,v,d,S,m,c,f,g])}var ho=h(be(),1),Wd=h(lo(),1);var L0={current:null};function bl(e,t={}){let{enabled:r=!0,delay:o=0,handleClose:n=null,mouseOnly:s=!1,restMs:i=0,move:a=!0,triggerElementRef:u=L0,externalTree:l,isActiveTrigger:c=!0,getHandleCloseContext:f,isClosing:m,shouldOpen:g}=t,d="rootStore"in e?e.rootStore:e,{dataRef:v,events:S}=d.context,C=po(l),w=gn(d),b=ho.useRef(!1),R=Yt(n),k=Yt(o),T=Yt(i),_=Yt(r),A=Yt(g),N=Yt(m),q=_e(()=>Gs(v.current.openEvent?.type,w.interactedInside)),U=_e(()=>A.current?.()!==!1),x=_e((O,D,J)=>{let M=d.context.triggerElements;if(M.hasElement(D))return!O||!Ze(O,D);if(!we(J))return!1;let E=J;return M.hasMatchingElement(L=>Ze(L,E))&&(!O||!Ze(O,E))}),I=_e(()=>{if(!w.handler)return;Ct(d.select("domReferenceElement")).removeEventListener("mousemove",w.handler),w.handler=void 0}),W=_e(()=>{hn(w)});return c&&(w.handleCloseOptions=R.current?.__options),ho.useEffect(()=>I,[I]),ho.useEffect(()=>{if(!r)return;function O(D){D.open?b.current=!1:(b.current=D.reason===Oe.triggerHover,I(),w.openChangeTimeout.clear(),w.restTimeout.clear(),w.blockMouseMove=!0,w.restTimeoutPending=!1)}return S.on("openchange",O),()=>{S.off("openchange",O)}},[r,S,w,I]),ho.useEffect(()=>{if(!r)return;function O(E,L=!0){let $=Zr(k.current,"close",w.pointerType);$?w.openChangeTimeout.start($,()=>{d.setOpen(!1,ze(Oe.triggerHover,E)),C?.events.emit("floating.closed",E)}):L&&(w.openChangeTimeout.clear(),d.setOpen(!1,ze(Oe.triggerHover,E)),C?.events.emit("floating.closed",E))}let D=u.current??(c?d.select("domReferenceElement"):null);if(!we(D))return;function J(E){if(w.openChangeTimeout.clear(),w.blockMouseMove=!1,s&&!qr(w.pointerType))return;let L=Wa(T.current),$=Zr(k.current,"open",w.pointerType),F=Dt(E),Z=E.currentTarget??null,se=d.select("domReferenceElement"),xe=Z;if(we(F)&&!d.context.triggerElements.hasElement(F)){for(let G of d.context.triggerElements.elements())if(Ze(G,F)){xe=G;break}}we(Z)&&we(se)&&!d.context.triggerElements.hasElement(Z)&&Ze(Z,se)&&(xe=se);let ie=xe==null?!1:x(se,xe,F),ye=d.select("open"),Ee=N.current?.()??d.select("transitionStatus")==="ending",ee=!ye&&Ee&&b.current,Ae=!ie&&we(xe)&&we(se)&&Ze(se,xe)&&ee,Ie=L>0&&!$,ke=ie&&(ye||ee)||Ae,He=!ye||ie;if(ke){U()&&d.setOpen(!0,ze(Oe.triggerHover,E,xe));return}Ie||($?w.openChangeTimeout.start($,()=>{He&&U()&&d.setOpen(!0,ze(Oe.triggerHover,E,xe))}):He&&U()&&d.setOpen(!0,ze(Oe.triggerHover,E,xe)))}function M(E){if(q()){W();return}I();let L=d.select("domReferenceElement"),$=Ct(L);w.restTimeout.clear(),w.restTimeoutPending=!1;let F=v.current.floatingContext??f?.();if(co(E.relatedTarget,d.context.triggerElements))return;if(R.current&&F){d.select("open")||w.openChangeTimeout.clear();let se=u.current;w.handler=R.current({...F,tree:C,x:E.clientX,y:E.clientY,onClose(){W(),I(),_.current&&!q()&&se===d.select("domReferenceElement")&&O(E,!0)}}),$.addEventListener("mousemove",w.handler),w.handler(E);return}(w.pointerType!=="touch"||!Ze(d.select("floatingElement"),E.relatedTarget))&&O(E)}return a?Sr(Ye(D,"mousemove",J,{once:!0}),Ye(D,"mouseenter",J),Ye(D,"mouseleave",M)):Sr(Ye(D,"mouseenter",J),Ye(D,"mouseleave",M))},[I,W,v,k,d,r,R,w,c,x,q,s,a,T,u,C,_,f,N,U]),ho.useMemo(()=>{if(!r)return;function O(D){w.pointerType=D.pointerType}return{onPointerDown:O,onPointerEnter:O,onMouseMove(D){let{nativeEvent:J}=D,M=D.currentTarget,E=d.select("domReferenceElement"),L=d.select("open"),$=x(E,M,D.target);if(s&&!qr(w.pointerType))return;if(L&&$&&w.handleCloseOptions?.blockPointerEvents){let se=d.select("floatingElement");if(se){let xe=w.handleCloseOptions?.getScope?.()??M.ownerDocument.body;oi(w,{scopeElement:xe,referenceElement:M,floatingElement:se})}}let F=Wa(T.current);if(L&&!$||F===0||!$&&w.restTimeoutPending&&D.movementX**2+D.movementY**2<2)return;w.restTimeout.clear();function Z(){if(w.restTimeoutPending=!1,q())return;let se=d.select("open");!w.blockMouseMove&&(!se||$)&&U()&&d.setOpen(!0,ze(Oe.triggerHover,J,M))}w.pointerType==="touch"?Wd.flushSync(()=>{Z()}):$&&L?Z():(w.restTimeoutPending=!0,w.restTimeout.start(F,Z))}}},[r,w,q,x,s,d,T,U])}var Gd=.1,N0=Gd*Gd,Ke=.5;function ni(e,t,r,o,n,s){return o>=t!=s>=t&&e<=(n-r)*(t-o)/(s-o)+r}function si(e,t,r,o,n,s,i,a,u,l){let c=!1;return ni(e,t,r,o,n,s)&&(c=!c),ni(e,t,n,s,i,a)&&(c=!c),ni(e,t,i,a,u,l)&&(c=!c),ni(e,t,u,l,r,o)&&(c=!c),c}function D0(e,t,r){return e>=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height}function ii(e,t,r,o,n,s){let i=Math.min(r,n),a=Math.max(r,n),u=Math.min(o,s),l=Math.max(o,s);return e>=i&&e<=a&&t>=u&&t<=l}function wl(e={}){let{blockPointerEvents:t=!1}=e,r=new nr,o=({x:n,y:s,placement:i,elements:a,onClose:u,nodeId:l,tree:c})=>{let f=i?.split("-")[0],m=!1,g=null,d=null,v=typeof performance<"u"?performance.now():0;function S(w,b){let R=performance.now(),k=R-v;if(g===null||d===null||k===0)return g=w,d=b,v=R,!1;let T=w-g,_=b-d,A=T*T+_*_,N=k*k*N0;return g=w,d=b,v=R,A0)}function I(){x()||C()}if(x())return;let W=R.getBoundingClientRect(),O=k.getBoundingClientRect(),D=n>O.right-O.width/2,J=s>O.bottom-O.height/2,M=O.width>W.width,E=O.height>W.height,L=(M?W:O).left,$=(M?W:O).right,F=(E?W:O).top,Z=(E?W:O).bottom;if(f==="top"&&s>=W.bottom-1||f==="bottom"&&s<=W.top+1||f==="left"&&n>=W.right-1||f==="right"&&n<=W.left+1){I();return}let se=!1;switch(f){case"top":se=ii(T,_,L,W.top+1,$,O.bottom-1);break;case"bottom":se=ii(T,_,L,O.top+1,$,W.bottom-1);break;case"left":se=ii(T,_,O.right-1,Z,W.left+1,F);break;case"right":se=ii(T,_,W.right-1,Z,O.left+1,F);break;default:}if(se)return;if(m&&!D0(T,_,W)){I();return}if(!N&&S(T,_)){I();return}let xe=!1;switch(f){case"top":{let ie=M?Ke/2:Ke*4,ye=M||D?n+ie:n-ie,Ee=M?n-ie:D?n+ie:n-ie,ee=s+Ke+1,Ae=D||M?O.bottom-Ke:O.top,Ie=D?M?O.bottom-Ke:O.top:O.bottom-Ke;xe=si(T,_,ye,ee,Ee,ee,O.left,Ae,O.right,Ie);break}case"bottom":{let ie=M?Ke/2:Ke*4,ye=M||D?n+ie:n-ie,Ee=M?n-ie:D?n+ie:n-ie,ee=s-Ke,Ae=D||M?O.top+Ke:O.bottom,Ie=D?M?O.top+Ke:O.bottom:O.top+Ke;xe=si(T,_,ye,ee,Ee,ee,O.left,Ae,O.right,Ie);break}case"left":{let ie=E?Ke/2:Ke*4,ye=E||J?s+ie:s-ie,Ee=E?s-ie:J?s+ie:s-ie,ee=n+Ke+1,Ae=J||E?O.right-Ke:O.left,Ie=J?E?O.right-Ke:O.left:O.right-Ke;xe=si(T,_,Ae,O.top,Ie,O.bottom,ee,ye,ee,Ee);break}case"right":{let ie=E?Ke/2:Ke*4,ye=E||J?s+ie:s-ie,Ee=E?s-ie:J?s+ie:s-ie,ee=n-Ke,Ae=J||E?O.left+Ke:O.right,Ie=J?E?O.left+Ke:O.right:O.left+Ke;xe=si(T,_,ee,ye,ee,Ee,Ae,O.top,Ie,O.bottom);break}default:}xe?m||r.start(40,I):I()}};return o.__options={...e,blockPointerEvents:t},o}var xl=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Oo.startingStyle]="startingStyle",e[e.endingStyle=Oo.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),is=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({}),M0={[is.popupOpen]:""},Bk={[is.popupOpen]:"",[is.pressed]:""},V0={[xl.open]:""},B0={[xl.closed]:""},z0={[xl.anchorHidden]:""},Yd={open(e){return e?M0:null}};var yn={open(e){return e?V0:B0},anchorHidden(e){return e?z0:null}};function qd(e){return rn(19)?e:e?"true":void 0}var ir=h(be(),1);var j0=e=>({name:"arrow",options:e,async fn(t){let{x:r,y:o,placement:n,rects:s,platform:i,elements:a,middlewareData:u}=t,{element:l,padding:c=0,offsetParent:f="real"}=Rr(e,t)||{};if(l==null)return{};let m=Zs(c),g={x:r,y:o},d=os(n),v=rs(d),S=await i.getDimensions(l),C=d==="y",w=C?"top":"left",b=C?"bottom":"right",R=C?"clientHeight":"clientWidth",k=s.reference[v]+s.reference[d]-g[d]-s.floating[v],T=g[d]-s.reference[d],_=f==="real"?await i.getOffsetParent?.(l):a.floating,A=a.floating[R]||s.floating[v];(!A||!await i.isElement?.(_))&&(A=a.floating[R]||s.floating[v]);let N=k/2-T/2,q=A/2-S[v]/2-1,U=Math.min(m[w],q),x=Math.min(m[b],q),I=U,W=A-S[v]-x,O=A/2-S[v]/2+N,D=ts(I,O,W),J=!u.arrow&&Er(n)!=null&&O!==D&&s.reference[v]/2-(O({...j0(e),options:[e,t]});var H0=sl().fn,Xd={name:"hide",async fn(e){let{width:t,height:r,x:o,y:n}=e.rects.reference,s=t===0&&r===0&&o===0&&n===0;return{data:{referenceHidden:(await H0(e)).data?.referenceHidden||s}}}};var as={sideX:"left",sideY:"top"},Kd={name:"adaptiveOrigin",async fn(e){let{x:t,y:r,rects:{floating:o},elements:{floating:n},platform:s,strategy:i,placement:a}=e,u=lt(n),l=u.getComputedStyle(n);if(!(l.transitionDuration!=="0s"&&l.transitionDuration!==""))return{x:t,y:r,data:as};let f=await s.getOffsetParent?.(n),m={width:0,height:0};if(i==="fixed"&&u?.visualViewport)m={width:u.visualViewport.width,height:u.visualViewport.height};else if(f===u){let w=Ct(n);m={width:w.documentElement.clientWidth,height:w.documentElement.clientHeight}}else await s.isElement?.(f)&&(m=await s.getDimensions(f));let g=_t(a),d=t,v=r;g==="left"&&(d=m.width-(t+o.width)),g==="top"&&(v=m.height-(r+o.height));let S=g==="left"?"right":as.sideX,C=g==="top"?"bottom":as.sideY;return{x:d,y:v,data:{sideX:S,sideY:C}}}};function $d(e,t,r){let o=e==="inline-start"||e==="inline-end";return{top:"top",right:o?r?"inline-start":"inline-end":"right",bottom:"bottom",left:o?r?"inline-end":"inline-start":"left"}[t]}function Jd(e,t,r){let{rects:o,placement:n}=e;return{side:$d(t,_t(n),r),align:Er(n)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function ep(e){let{anchor:t,positionMethod:r="absolute",side:o="bottom",sideOffset:n=0,align:s="center",alignOffset:i=0,collisionBoundary:a,collisionPadding:u=5,sticky:l=!1,arrowPadding:c=5,disableAnchorTracking:f=!1,inline:m,keepMounted:g=!1,floatingRootContext:d,mounted:v,collisionAvoidance:S,shiftCrossAxis:C=!1,nodeId:w,adaptiveOrigin:b,lazyFlip:R=!1,externalTree:k}=e,[T,_]=ir.useState(null);!v&&T!==null&&_(null);let A=S.side||"flip",N=S.align||"flip",q=S.fallbackAxisSide||"end",U=typeof t=="function"?t:void 0,x=_e(U),I=U?x:t,W=Yt(t),O=Yt(v),J=tn()==="rtl",M=T||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":J?"left":"right","inline-start":J?"right":"left"}[o],E=s==="center"?M:`${M}-${s}`,L=u,$=1,F=o==="bottom"?$:0,Z=o==="top"?$:0,se=o==="right"?$:0,xe=o==="left"?$:0;typeof L=="number"?L={top:L+F,right:L+xe,bottom:L+Z,left:L+se}:L&&(L={top:(L.top||0)+F,right:(L.right||0)+xe,bottom:(L.bottom||0)+Z,left:(L.left||0)+se});let ie={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:L},ye=ir.useRef(null),Ee=Yt(n),ee=Yt(i),Ae=typeof n!="function"?n:0,Ie=typeof i!="function"?i:0,ke=[];m&&ke.push(m),ke.push(el(Ne=>{let qe=Jd(Ne,o,J),P=typeof Ee.current=="function"?Ee.current(qe):Ee.current,Q=typeof ee.current=="function"?ee.current(qe):ee.current;return{mainAxis:P,crossAxis:Q,alignmentAxis:Q}},[Ae,Ie,J,o]));let He=N==="none"&&A!=="shift",G=!He&&(l||C||A==="shift"),j=A==="none"?null:ol({...ie,padding:{top:L.top+$,right:L.right+$,bottom:L.bottom+$,left:L.left+$},mainAxis:!C&&A==="flip",crossAxis:N==="flip"?"alignment":!1,fallbackAxisSideDirection:q}),X=He?null:tl(Ne=>{let qe=Ct(Ne.elements.floating).documentElement;return{...ie,rootBoundary:C?{x:0,y:0,width:qe.clientWidth,height:qe.clientHeight}:void 0,mainAxis:N!=="none",crossAxis:G,limiter:l||C?void 0:rl(P=>{if(!ye.current)return{};let{width:Q,height:y}=ye.current.getBoundingClientRect(),oe=qt(_t(P.placement)),Be=oe==="y"?Q:y,te=oe==="y"?L.left+L.right:L.top+L.bottom;return{offset:Be/2+te/2}})}},[ie,l,C,L,N]);A==="shift"||N==="shift"||s==="center"?ke.push(X,j):ke.push(j,X),ke.push(nl({...ie,apply({elements:{floating:Ne},availableWidth:qe,availableHeight:P,rects:Q}){if(!O.current)return;let y=Ne.style;y.setProperty("--available-width",`${qe}px`),y.setProperty("--available-height",`${P}px`);let oe=lt(Ne).devicePixelRatio||1,{x:Be,y:te,width:ht,height:ne}=Q.reference,Qe=(Math.round((Be+ht)*oe)-Math.round(Be*oe))/oe,B=(Math.round((te+ne)*oe)-Math.round(te*oe))/oe;y.setProperty("--anchor-width",`${Qe}px`),y.setProperty("--anchor-height",`${B}px`)}}),Zd(Ne=>({element:ye.current||Ct(Ne.elements.floating).createElement("div"),padding:c,offsetParent:"floating"}),[c]),{name:"transformOrigin",fn(Ne){let{elements:qe,middlewareData:P,placement:Q,rects:y,y:oe}=Ne,Be=_t(Q),te=qt(Be),ht=ye.current,ne=P.arrow?.x||0,Qe=P.arrow?.y||0,B=ht?.clientWidth||0,z=ht?.clientHeight||0,yr=ne+B/2,Ge=Qe+z/2,le=Math.abs(P.shift?.y||0),Ur=y.reference.height/2,tr=typeof n=="function"?n(Jd(Ne,o,J)):n,et=le>tr,Ve={top:`${yr}px calc(100% + ${tr}px)`,bottom:`${yr}px ${-tr}px`,left:`calc(100% + ${tr}px) ${Ge}px`,right:`${-tr}px ${Ge}px`}[Be],ft=`${yr}px ${y.reference.y+Ur-oe}px`;return qe.floating.style.setProperty("--transform-origin",G&&te==="y"&&et?ft:Ve),{}}},Xd,b),ge(()=>{!v&&d&&d.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[v,d]);let H=ir.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:K,elements:fe,x:ue,y:de,middlewareData:pe,update:me,placement:V,context:re,isPositioned:De,floatingStyles:Ue}=pl({rootContext:d,open:g?v:void 0,placement:E,middleware:ke,strategy:r,whileElementsMounted:g?void 0:(...Ne)=>ns(...Ne,H),nodeId:w,externalTree:k}),{sideX:ot,sideY:ut}=pe.adaptiveOrigin||as,je=De?r:"fixed",We=ir.useMemo(()=>{let Ne=b?{position:je,[ot]:ue,[ut]:de}:{position:je,...Ue};return De||(Ne.opacity=0),Ne},[b,je,ot,ue,ut,de,Ue,De]),nt=ir.useRef(null);ge(()=>{if(!v)return;let Ne=W.current,qe=typeof Ne=="function"?Ne():Ne,Q=(Qd(qe)?qe.current:qe)||null||null;Q!==nt.current&&(K.setPositionReference(Q),nt.current=Q)},[v,K,I,W]),ir.useEffect(()=>{if(!v)return;let Ne=W.current;typeof Ne!="function"&&Qd(Ne)&&Ne.current!==nt.current&&(K.setPositionReference(Ne.current),nt.current=Ne.current)},[v,K,I,W]),ir.useEffect(()=>{if(g&&v&&fe.reference&&fe.floating)return ns(fe.reference,fe.floating,me,H)},[g,v,fe,me,H]);let ve=_t(V),_r=$d(o,ve,J),gr=Er(V)||"center",$e=!!pe.hide?.referenceHidden;ge(()=>{R&&v&&De&&_(ve)},[R,v,De,ve]);let Hr=ir.useMemo(()=>({position:"absolute",top:pe.arrow?.y,left:pe.arrow?.x}),[pe.arrow]),Et=pe.arrow?.centerOffset!==0;return ir.useMemo(()=>({positionerStyles:We,arrowStyles:Hr,arrowRef:ye,arrowUncentered:Et,side:_r,align:gr,physicalSide:ve,anchorHidden:$e,refs:K,context:re,isPositioned:De,update:me}),[We,Hr,ye,Et,_r,gr,ve,$e,K,re,De,me])}function Qd(e){return e!=null&&"current"in e}function ai(e){return e==="starting"?Pf:pt}function tp(e,t,{styles:r,transitionStatus:o,props:n,refs:s,hidden:i,inert:a=!1}){let u={...r};return a&&(u.pointerEvents="none"),Gt("div",e,{state:t,ref:s,props:[{role:"presentation",hidden:i,style:u},ai(o),n],stateAttributesMapping:yn})}var At=h(be(),1),ap=h(lo(),1);var rp=h(be(),1);function op(e){let[t,r]=rp.useState({current:e,previous:null});return e!==t.current&&r({current:e,previous:t.current}),t.previous}var vn=h(be(),1);function Sl(e){let t=Pt(e),r=parseFloat(t.width)||0,o=parseFloat(t.height)||0,n=St(e),s=n?e.offsetWidth:r,i=n?e.offsetHeight:o;return(fo(r)!==s||fo(o)!==i)&&(r=s,o=i),{width:r,height:o}}function sp(e){let{popupElement:t,positionerElement:r,content:o,mounted:n,onMeasureLayout:s,onMeasureLayoutComplete:i,side:a,direction:u}=e,l=ln(t,!0,!1),c=nn(),f=vn.useRef(null),m=vn.useRef(!0),g=vn.useRef(so),d=_e(s),v=_e(i),S=vn.useMemo(()=>{let C=a==="top",w=a==="left";return u==="rtl"?(C=C||a==="inline-end",w=w||a==="inline-end"):(C=C||a==="inline-start",w=w||a==="inline-start"),C?{position:"absolute",[a==="top"?"bottom":"top"]:"0",[w?"right":"left"]:"0"}:pt},[a,u]);ge(()=>{if(!n){g.current=so,m.current=!0,f.current=null;return}if(!t||!r)return;g.current=np(t,S),Cl(t,"auto");let C=ci(t,"position","static"),w=ci(t,"transform","none"),b=ci(t,"scale","1"),R=np(r,{"--available-width":"max-content","--available-height":"max-content"});function k(){C(),w(),R()}function T(){k(),b()}if(d?.(),m.current||f.current===null){li(r,"max-content");let q=Sl(t);return f.current=q,li(r,q),T(),v?.(null,q),m.current=!1,()=>{g.current(),g.current=so}}li(r,"max-content");let _=f.current,A=Sl(t);f.current=A,Cl(t,_),T(),v?.(_,A),li(r,A);let N=new AbortController;return c.request(()=>{Cl(t,A),l(()=>{t.style.setProperty("--popup-width","auto"),t.style.setProperty("--popup-height","auto")},N.signal)}),()=>{N.abort(),c.cancel(),g.current(),g.current=so}},[o,t,r,l,c,n,d,v,S])}function ci(e,t,r){let o=e.style.getPropertyValue(t);return e.style.setProperty(t,r),()=>{e.style.setProperty(t,o)}}function np(e,t){let r=[];for(let[o,n]of Object.entries(t))r.push(ci(e,o,n));return r.length?()=>{r.forEach(o=>o())}:so}function Cl(e,t){let r=t==="auto"?"auto":`${t.width}px`,o=t==="auto"?"auto":`${t.height}px`;e.style.setProperty("--popup-width",r),e.style.setProperty("--popup-height",o)}function li(e,t){let r=t==="max-content"?"max-content":`${t.width}px`,o=t==="max-content"?"max-content":`${t.height}px`;e.style.setProperty("--positioner-width",r),e.style.setProperty("--positioner-height",o)}var bn=h(Y(),1);function lp(e){let{store:t,side:r,cssVars:o,children:n}=e,s=tn(),i=t.useState("activeTriggerElement"),a=t.useState("activeTriggerId"),u=t.useState("open"),l=t.useState("payload"),c=t.useState("mounted"),f=t.useState("popupElement"),m=t.useState("positionerElement"),g=op(u?i:null),d=G0(a,l),v=At.useRef(null),[S,C]=At.useState(null),[w,b]=At.useState(null),R=At.useRef(null),k=At.useRef(null),T=ln(R,!0,!1),_=nn(),[A,N]=At.useState(null),[q,U]=At.useState(!1);ge(()=>(t.set("hasViewport",!0),()=>{t.set("hasViewport",!1)}),[t]);let x=_e(()=>{R.current?.style.setProperty("animation","none"),R.current?.style.setProperty("transition","none"),k.current?.style.setProperty("display","none")}),I=_e(M=>{R.current?.style.removeProperty("animation"),R.current?.style.removeProperty("transition"),k.current?.style.removeProperty("display"),M&&N(M)}),W=At.useRef(null);ge(()=>{(!u||!c)&&(W.current=null)},[u,c]),ge(()=>{if(i&&g&&i!==g&&W.current!==i&&v.current){C(v.current),U(!0);let M=W0(g,i);b(M),_.request(()=>{ap.flushSync(()=>{U(!1)}),T(()=>{C(null),N(null),v.current=null})}),W.current=i}},[i,g,S,T,_]),ge(()=>{let M=R.current;if(!M)return;let E=Ct(M).createElement("div");for(let L of Array.from(M.childNodes))E.appendChild(L.cloneNode(!0));v.current=E});let O=S!=null,D;O?D=(0,bn.jsxs)(At.Fragment,{children:[(0,bn.jsx)("div",{"data-previous":!0,inert:qd(!0),ref:k,style:{...A?{[o.popupWidth]:`${A.width}px`,[o.popupHeight]:`${A.height}px`}:null,position:"absolute"},"data-ending-style":q?void 0:""},"previous"),(0,bn.jsx)("div",{"data-current":!0,ref:R,"data-starting-style":q?"":void 0,children:n},d)]}):D=(0,bn.jsx)("div",{"data-current":!0,ref:R,children:n},d),ge(()=>{let M=k.current;!M||!S||M.replaceChildren(...Array.from(S.childNodes))},[S]),sp({popupElement:f,positionerElement:m,mounted:c,content:l,onMeasureLayout:x,onMeasureLayoutComplete:I,side:r,direction:s});let J={activationDirection:U0(w),transitioning:O};return{children:D,state:J}}function U0(e){if(e)return`${ip(e.horizontal,5,"right","left")} ${ip(e.vertical,5,"down","up")}`}function ip(e,t,r,o){return e>t?r:e<-t?o:""}function W0(e,t){let r=e.getBoundingClientRect(),o=t.getBoundingClientRect(),n={x:r.left+r.width/2,y:r.top+r.height/2},s={x:o.left+o.width/2,y:o.top+o.height/2};return{horizontal:s.x-n.x,vertical:s.y-n.y}}function G0(e,t){let[r,o]=At.useState(0),n=At.useRef(e),s=At.useRef(t),i=At.useRef(!1);return ge(()=>{let a=n.current,u=s.current,l=e!==a,c=t!==u;l?(o(f=>f+1),i.current=!c):i.current&&c&&(o(f=>f+1),i.current=!1),n.current=e,s.current=t},[e,t]),`${e??"current"}-${r}`}var ui=h(be(),1),cp=h(lo(),1);var up=h(Y(),1),fp=ui.forwardRef(function(t,r){let{children:o,container:n,className:s,render:i,style:a,...u}=t,{portalNode:l,portalSubtree:c}=qa({container:n,ref:r,componentProps:t,elementProps:u});return!c&&!l?null:(0,up.jsxs)(ui.Fragment,{children:[c,l&&cp.createPortal(o,l)]})});var Kt={};no(Kt,{Arrow:()=>_p,Handle:()=>ls,Popup:()=>Ep,Portal:()=>xp,Positioner:()=>Cp,Provider:()=>Op,Root:()=>pp,Trigger:()=>vp,Viewport:()=>Fp,createHandle:()=>Ap});var Fr=h(be(),1);var fi=h(be(),1),Rl=fi.createContext(void 0);function cr(e){let t=fi.useContext(Rl);if(t===void 0&&!e)throw new Error(Wt(72));return t}var dp=h(be(),1);var Y0={...Hd,disabled:Me(e=>e.disabled),instantType:Me(e=>e.instantType),isInstantPhase:Me(e=>e.isInstantPhase),trackCursorAxis:Me(e=>e.trackCursorAxis),disableHoverablePopup:Me(e=>e.disableHoverablePopup),lastOpenChangeReason:Me(e=>e.openChangeReason),closeOnClick:Me(e=>e.closeOnClick),closeDelay:Me(e=>e.closeDelay),hasViewport:Me(e=>e.hasViewport)},wn=class e extends pn{constructor(t,r,o=!1){let n=new mo,s={...q0(),...t};s.floatingRootContext=zd(n,r,o),super(s,{popupRef:dp.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:n},Y0)}setOpen=(t,r)=>{Fd(this,t,r,{extraState:{openChangeReason:r.reason}})};cancelPendingOpen(t){this.state.floatingRootContext.dispatchOpenChange(!1,ze(Oe.triggerPress,t))}static useStore(t,r){return kd(t,(n,s)=>new e(r,n,s)).store}};function q0(){return{...Bd(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}var di=h(Y(),1),pp=ul(function(t){let{disabled:r=!1,defaultOpen:o=!1,open:n,disableHoverablePopup:s=!1,trackCursorAxis:i="none",actionsRef:a,onOpenChange:u,onOpenChangeComplete:l,handle:c,triggerId:f,defaultTriggerId:m=null,children:g}=t,d=wn.useStore(c?.store,{open:o,openProp:n,activeTriggerId:m,triggerIdProp:f});Ad(d,n,o,m),d.useControlledProp("openProp",n),d.useControlledProp("triggerIdProp",f),d.useContextCallback("onOpenChange",u),d.useContextCallback("onOpenChangeComplete",l);let v=d.useState("open"),S=!r&&v,C=d.useState("activeTriggerId"),w=d.useState("mounted"),b=d.useState("payload");d.useSyncedValues({trackCursorAxis:i,disableHoverablePopup:s}),d.useSyncedValue("disabled",r),Ld(d,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:R,transitionStatus:k}=Nd(S,d),T=d.useState("isInstantPhase"),_=d.useState("instantType"),A=d.useState("lastOpenChangeReason"),N=Fr.useRef(null);ge(()=>{v&&r&&d.setOpen(!1,ze(Oe.disabled))},[v,r,d]),ge(()=>{k==="ending"&&A===Oe.none||k!=="ending"&&T?(_!=="delay"&&(N.current=_),d.set("instantType","delay")):N.current!==null&&(d.set("instantType",N.current),N.current=null)},[k,T,A,_,d]),ge(()=>{S&&C==null&&d.set("payload",void 0)},[d,C,S]);let q=Fr.useCallback(()=>{d.setOpen(!1,ze(Oe.imperativeAction))},[d]);Fr.useImperativeHandle(a,()=>({unmount:R,close:q}),[R,q]);let U=S||w||!r&&i!=="none";return(0,di.jsxs)(Rl.Provider,{value:d,children:[U&&(0,di.jsx)(Z0,{store:d,disabled:r,trackCursorAxis:i}),typeof g=="function"?g({payload:b}):g]})});function Z0({store:e,disabled:t,trackCursorAxis:r}){let o=e.useState("floatingRootContext"),n=Xa(o,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),s=Za(o,{enabled:!t&&r!=="none",axis:r==="none"?void 0:r}),i=Fr.useMemo(()=>or(s.reference,n.reference),[s.reference,n.reference]),a=Fr.useMemo(()=>or(s.trigger,n.trigger),[s.trigger,n.trigger]),u=Fr.useMemo(()=>or(Pd,s.floating,n.floating),[s.floating,n.floating]);return Dd(e,{activeTriggerProps:i,inactiveTriggerProps:a,popupProps:u}),null}var mi=h(be(),1);var pi=h(be(),1),El=pi.createContext(void 0);function mp(){return pi.useContext(El)}var hp=(function(e){return e[e.popupOpen=is.popupOpen]="popupOpen",e.triggerDisabled="data-trigger-disabled",e})({});var yp="data-base-ui-tooltip-trigger";function gp(e){if("composedPath"in e){let r=e.composedPath();for(let o=0;ov.select("transitionStatus")==="ending",shouldOpen(){return!E.current}}),ie=hl(b,{enabled:!O}).reference,ye=ke=>{let He=E.current,G=gp(ke),j=se(G),X=R.current,H=X&&G&&Ze(X,G);if(j&&v.select("open")&&v.select("lastOpenChangeReason")===Oe.triggerHover){v.setOpen(!1,ze(Oe.triggerHover,ke));return}if(He&&!j&&H&&!D.current&&!v.select("open")&&X&&qr($.current)){let K=()=>{!E.current&&!D.current&&!v.select("open")&&v.setOpen(!0,ze(Oe.triggerHover,ke,X))},fe=F();fe===0?(L.clear(),K()):L.start(fe,K)}},Ee=v.useState("triggerProps",A);return Gt("button",t,{state:{open:w},ref:[r,_,R],props:[xe,ie,A||J!=="none"?Ee:void 0,{onMouseOver(ke){ye(ke.nativeEvent)},onFocus(ke){Z(gp(ke.nativeEvent))&&ke.preventBaseUIHandler()},onMouseLeave(){E.current=!1,L.clear(),$.current=void 0},onPointerEnter(ke){$.current=ke.pointerType},onPointerDown(ke){$.current=ke.pointerType,v.set("closeOnClick",c),c&&!v.select("open")&&v.cancelPendingOpen(ke.nativeEvent)},onClick(ke){c&&!v.select("open")&&v.cancelPendingOpen(ke.nativeEvent)},id:S,[hp.triggerDisabled]:O?"":void 0,[yp]:O?void 0:""},g],stateAttributesMapping:Yd})});var wp=h(be(),1);var hi=h(be(),1),Tl=hi.createContext(void 0);function bp(){let e=hi.useContext(Tl);if(e===void 0)throw new Error(Wt(70));return e}var _l=h(Y(),1),xp=wp.forwardRef(function(t,r){let{keepMounted:o=!1,...n}=t;return cr().useState("mounted")||o?(0,_l.jsx)(Tl.Provider,{value:o,children:(0,_l.jsx)(fp,{ref:r,...n})}):null});var yi=h(be(),1);var gi=h(be(),1),Ol=gi.createContext(void 0);function xn(){let e=gi.useContext(Ol);if(e===void 0)throw new Error(Wt(71));return e}var Sp=h(Y(),1),Cp=yi.forwardRef(function(t,r){let{render:o,className:n,anchor:s,positionMethod:i="absolute",side:a="top",align:u="center",sideOffset:l=0,alignOffset:c=0,collisionBoundary:f="clipping-ancestors",collisionPadding:m=5,arrowPadding:g=5,sticky:d=!1,disableAnchorTracking:v=!1,collisionAvoidance:S=kf,style:C,...w}=t,b=cr(),R=bp(),k=b.useState("open"),T=b.useState("mounted"),_=b.useState("trackCursorAxis"),A=b.useState("disableHoverablePopup"),N=b.useState("floatingRootContext"),q=b.useState("instantType"),U=b.useState("transitionStatus"),x=b.useState("hasViewport"),I=ep({anchor:s,positionMethod:i,floatingRootContext:N,mounted:T,side:a,sideOffset:l,align:u,alignOffset:c,collisionBoundary:f,collisionPadding:m,sticky:d,arrowPadding:g,disableAnchorTracking:v,keepMounted:R,collisionAvoidance:S,adaptiveOrigin:x?Kd:void 0}),W=yi.useMemo(()=>({open:k,side:I.side,align:I.align,anchorHidden:I.anchorHidden,instant:_!=="none"?"tracking-cursor":q}),[k,I.side,I.align,I.anchorHidden,_,q]),O=tp(t,W,{styles:I.positionerStyles,transitionStatus:U,props:w,refs:[r,b.useStateSetter("positionerElement")],hidden:!T,inert:!k||_==="both"||A});return(0,Sp.jsx)(Ol.Provider,{value:I,children:O})});var Rp=h(be(),1);var K0={...yn,...ef},Ep=Rp.forwardRef(function(t,r){let{render:o,className:n,style:s,...i}=t,a=cr(),{side:u,align:l}=xn(),c=a.useState("open"),f=a.useState("instantType"),m=a.useState("transitionStatus"),g=a.useState("popupProps"),d=a.useState("floatingRootContext"),v=a.useState("disabled"),S=a.useState("closeDelay");Hs({open:c,ref:a.context.popupRef,onComplete(){c&&a.context.onOpenChangeComplete?.(!0)}}),vl(d,{enabled:!v,closeDelay:S});let C=a.useStateSetter("popupElement");return Gt("div",t,{state:{open:c,side:u,align:l,instant:f,transitionStatus:m},ref:[r,a.context.popupRef,C],props:[g,ai(m),i],stateAttributesMapping:K0})});var Tp=h(be(),1);var _p=Tp.forwardRef(function(t,r){let{render:o,className:n,style:s,...i}=t,a=cr(),{arrowRef:u,side:l,align:c,arrowUncentered:f,arrowStyles:m}=xn(),g=a.useState("open"),d=a.useState("instantType");return Gt("div",t,{state:{open:g,side:l,align:c,uncentered:f,instant:d},ref:[r,u],props:[{style:m,"aria-hidden":!0},i],stateAttributesMapping:yn})});var Pl=h(be(),1);var kl=h(Y(),1),Op=function(t){let{delay:r,closeDelay:o,timeout:n=400}=t,s=Pl.useMemo(()=>({delay:r,closeDelay:o}),[r,o]),i=Pl.useMemo(()=>({open:r,close:o}),[r,o]);return(0,kl.jsx)(El.Provider,{value:s,children:(0,kl.jsx)(Ga,{delay:i,timeoutMs:n,children:t.children})})};var kp=h(be(),1);var Pp=(function(e){return e.popupWidth="--popup-width",e.popupHeight="--popup-height",e})({});var J0={activationDirection:e=>e?{"data-activation-direction":e}:null},Fp=kp.forwardRef(function(t,r){let{render:o,className:n,style:s,children:i,...a}=t,u=cr(),l=xn(),c=u.useState("instantType"),{children:f,state:m}=lp({store:u,side:l.side,cssVars:Pp,children:i}),g={activationDirection:m.activationDirection,transitioning:m.transitioning,instant:c};return Gt("div",t,{state:g,ref:r,props:[a,{children:f}],stateAttributesMapping:J0})});var ls=class{constructor(){this.store=new wn}open(t){let r=t?this.store.context.triggerElements.getById(t):void 0;if(t&&!r)throw new Error(Wt(81,t));this.store.setOpen(!0,ze(Oe.imperativeAction,void 0,r))}close(){this.store.setOpen(!1,ze(Oe.imperativeAction,void 0,void 0))}get isOpen(){return this.store.select("open")}};function Ap(){return new ls}function Sn(e){return Gt(e.defaultTagName??"div",e,e)}var Np=h(Te(),1),Fl="data-wp-hash";function Al(){let e=globalThis;return e.__wpStyleRuntime||(e.__wpStyleRuntime={documents:new Map,styles:new Map,injectedStyles:new WeakMap},typeof document<"u"&&$0(document)),e.__wpStyleRuntime}function Q0(e,t){if(!e.head)return!1;for(let r of e.head.querySelectorAll(`style[${Fl}]`))if(r.getAttribute(Fl)===t)return!0;return!1}function Dp(e,t,r){if(!e.head)return;let o=Al(),n=o.injectedStyles.get(e);if(n||(n=new Set,o.injectedStyles.set(e,n)),n.has(t))return;if(Q0(e,t)){n.add(t);return}let s=e.createElement("style");s.setAttribute(Fl,t),s.appendChild(e.createTextNode(r)),e.head.appendChild(s),n.add(t)}function $0(e){let t=Al();t.documents.set(e,(t.documents.get(e)??0)+1);for(let[r,o]of t.styles)Dp(e,r,o);return()=>{let r=t.documents.get(e);if(r!==void 0){if(r<=1){t.documents.delete(e);return}t.documents.set(e,r-1)}}}function Mp(e,t){let r=Al();r.styles.set(e,t);for(let o of r.documents.keys())Dp(o,e,t)}typeof process>"u",Mp("a495f9d138",'@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._83ed8a8da5dd50ea__text{margin:0}._14437cfb77831647__heading-2xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-p-line-height:var(--wpds-typography-line-height-2xl,40px);font-size:var(--wpds-typography-font-size-2xl,32px);line-height:var(--wpds-typography-line-height-2xl,40px)}._14437cfb77831647__heading-2xl,._3c78b7fa9b4072dd__heading-xl{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-emphasis,600)}._3c78b7fa9b4072dd__heading-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-md,24px)}.aa58f227716bcde2__heading-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-lg,15px)}.aa58f227716bcde2__heading-lg,.fc4da56d8dfe52c4__heading-md{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wpds-typography-line-height-sm,20px)}.fc4da56d8dfe52c4__heading-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px)}.a9b78c7c82e8dff7__heading-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wpds-typography-line-height-xs,16px);text-transform:uppercase}._305ff559e52180d5__body-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-xl,32px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-xl,32px)}._305ff559e52180d5__body-xl,.ca1aa3fc2029e958__body-lg{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-default,400)}.ca1aa3fc2029e958__body-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-lg,15px);line-height:var(--wpds-typography-line-height-md,24px)}._131101940be12424__body-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-sm,20px)}._0e8d87a42c1f75fa__body-sm,._131101940be12424__body-md{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-default,400)}._0e8d87a42c1f75fa__body-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}');var Ip={text:"_83ed8a8da5dd50ea__text","heading-2xl":"_14437cfb77831647__heading-2xl","heading-xl":"_3c78b7fa9b4072dd__heading-xl","heading-lg":"aa58f227716bcde2__heading-lg","heading-md":"fc4da56d8dfe52c4__heading-md","heading-sm":"a9b78c7c82e8dff7__heading-sm","body-xl":"_305ff559e52180d5__body-xl","body-lg":"ca1aa3fc2029e958__body-lg","body-md":"_131101940be12424__body-md","body-sm":"_0e8d87a42c1f75fa__body-sm"};typeof process>"u",Mp("af6d9984a6","._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}");var Lp={button:"_6defc79820e382c6__button",input:"d2cff2e5dea83bd1__input",textarea:"_547d86373d02e108__textarea",div:"_8c15fd0ed9f28ba4__div",p:"_43cec3e1eec1066d__p",heading:"e97669c6d9a38497__heading",a:"_2c0831b0499dbd6e__a"},vi=(0,Np.forwardRef)(function({variant:t="body-md",render:r,className:o,...n},s){return Sn({render:r,defaultTagName:"span",ref:s,props:or(n,{className:st(Ip.text,Lp.heading,Lp.p,Ip[t],o)})})});var bi=h(Te(),1),cs=(0,bi.forwardRef)(({icon:e,size:t=24,...r},o)=>(0,bi.cloneElement)(e,{width:t,height:t,...r,ref:o}));var wi=h(Cn(),1),Il=h(Y(),1),Mo=(0,Il.jsx)(wi.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,Il.jsx)(wi.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})});var xi=h(Cn(),1),Ll=h(Y(),1),Vo=(0,Ll.jsx)(xi.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,Ll.jsx)(xi.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})});var Si=h(Cn(),1),Nl=h(Y(),1),Dl=(0,Nl.jsx)(Si.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,Nl.jsx)(Si.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})});var Ci=h(Cn(),1),Ml=h(Y(),1),Ri=(0,Ml.jsx)(Ci.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,Ml.jsx)(Ci.Path,{d:"M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z"})});var Ei=h(Cn(),1),Vl=h(Y(),1),Ti=(0,Vl.jsx)(Ei.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,Vl.jsx)(Ei.Path,{d:"M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z"})});var zp=h(Te(),1);function Bl(e,t,r){return(0,zp.cloneElement)(e??t,{children:r})}var e1=h(Hp(),1);var Wp=h(us(),1),{lock:rA,unlock:Gp}=(0,Wp.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/ui");function t1(){let e=e1;if(e.ThemeProvider)return e.ThemeProvider;if(!e.privateApis)throw new Error("@wordpress/ui: @wordpress/theme must expose `ThemeProvider` or `privateApis.ThemeProvider`.");return Gp(e.privateApis).ThemeProvider}var Yp=t1();var qp=h(Te(),1),zl="data-wp-hash";function jl(){let e=globalThis;return e.__wpStyleRuntime||(e.__wpStyleRuntime={documents:new Map,styles:new Map,injectedStyles:new WeakMap},typeof document<"u"&&o1(document)),e.__wpStyleRuntime}function r1(e,t){if(!e.head)return!1;for(let r of e.head.querySelectorAll(`style[${zl}]`))if(r.getAttribute(zl)===t)return!0;return!1}function Zp(e,t,r){if(!e.head)return;let o=jl(),n=o.injectedStyles.get(e);if(n||(n=new Set,o.injectedStyles.set(e,n)),n.has(t))return;if(r1(e,t)){n.add(t);return}let s=e.createElement("style");s.setAttribute(zl,t),s.appendChild(e.createTextNode(r)),e.head.appendChild(s),n.add(t)}function o1(e){let t=jl();t.documents.set(e,(t.documents.get(e)??0)+1);for(let[r,o]of t.styles)Zp(e,r,o);return()=>{let r=t.documents.get(e);if(r!==void 0){if(r<=1){t.documents.delete(e);return}t.documents.set(e,r-1)}}}function n1(e,t){let r=jl();r.styles.set(e,t);for(let o of r.documents.keys())Zp(o,e,t)}typeof process>"u",n1("32aba35fe1","@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._19ce0419607e1896__stack{display:flex}}}");var s1={stack:"_19ce0419607e1896__stack"},i1={xs:"var(--wpds-dimension-gap-xs, 4px)",sm:"var(--wpds-dimension-gap-sm, 8px)",md:"var(--wpds-dimension-gap-md, 12px)",lg:"var(--wpds-dimension-gap-lg, 16px)",xl:"var(--wpds-dimension-gap-xl, 24px)","2xl":"var(--wpds-dimension-gap-2xl, 32px)","3xl":"var(--wpds-dimension-gap-3xl, 40px)"},Rn=(0,qp.forwardRef)(function({direction:t,gap:r,align:o,justify:n,wrap:s,render:i,...a},u){let l={gap:r&&i1[r],alignItems:o,justifyContent:n,flexDirection:t,flexWrap:s};return Sn({render:i,ref:u,props:or(a,{style:l,className:s1.stack})})});var En={};no(En,{Popup:()=>am,Portal:()=>_i,Positioner:()=>Oi,Provider:()=>mm,Root:()=>dm,Trigger:()=>um});var sm=h(Te(),1);var $p=h(Te(),1);var Ul="data-wp-hash";function Wl(){let e=globalThis;return e.__wpStyleRuntime||(e.__wpStyleRuntime={documents:new Map,styles:new Map,injectedStyles:new WeakMap},typeof document<"u"&&l1(document)),e.__wpStyleRuntime}function a1(e,t){if(!e.head)return!1;for(let r of e.head.querySelectorAll(`style[${Ul}]`))if(r.getAttribute(Ul)===t)return!0;return!1}function Kp(e,t,r){if(!e.head)return;let o=Wl(),n=o.injectedStyles.get(e);if(n||(n=new Set,o.injectedStyles.set(e,n)),n.has(t))return;if(a1(e,t)){n.add(t);return}let s=e.createElement("style");s.setAttribute(Ul,t),s.appendChild(e.createTextNode(r)),e.head.appendChild(s),n.add(t)}function l1(e){let t=Wl();t.documents.set(e,(t.documents.get(e)??0)+1);for(let[r,o]of t.styles)Kp(e,r,o);return()=>{let r=t.documents.get(e);if(r!==void 0){if(r<=1){t.documents.delete(e);return}t.documents.set(e,r-1)}}}function c1(e,t){let r=Wl();r.styles.set(e,t);for(let o of r.documents.keys())Kp(o,e,t)}typeof process>"u",c1("be37f31c1e","._11fc52b637ff8a7e__slot{inset:0;isolation:isolate;pointer-events:none;position:fixed;z-index:1000000003}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._11fc52b637ff8a7e__slot>*{pointer-events:auto}}}");var Xp={slot:"_11fc52b637ff8a7e__slot"},Jp="data-wp-compat-overlay-slot";function u1(){return typeof document>"u"?null:document}function f1(){let e;try{e=window.top?.wp}catch{}let t=e??window.wp;return typeof t?.components=="object"&&t.components!==null}var Ar=null;function Hl(e){return e.setAttribute("aria-hidden","false"),e}function d1(e){let t=e.createElement("div");return t.setAttribute(Jp,""),Xp.slot&&t.classList.add(Xp.slot),e.body.appendChild(t),t}function Qp(){if(typeof window>"u"||!f1()&&window.__wpUiCompatOverlaySlotEnabled!==!0)return;let e=u1();if(!e||!e.body)return;if(Ar&&Ar.ownerDocument===e&&Ar.isConnected)return Hl(Ar);let t=e.querySelector(`[${Jp}]`);return t instanceof HTMLDivElement?(Ar=Hl(t),Ar):(Ar?.isConnected&&Ar.remove(),Ar=Hl(d1(e)),Ar)}var em=h(Y(),1),_i=(0,$p.forwardRef)(function({container:t,...r},o){return(0,em.jsx)(Kt.Portal,{container:t??Qp(),...r,ref:o})});var tm=h(Te(),1),nm=h(Y(),1),Gl="data-wp-hash";function Yl(){let e=globalThis;return e.__wpStyleRuntime||(e.__wpStyleRuntime={documents:new Map,styles:new Map,injectedStyles:new WeakMap},typeof document<"u"&&m1(document)),e.__wpStyleRuntime}function p1(e,t){if(!e.head)return!1;for(let r of e.head.querySelectorAll(`style[${Gl}]`))if(r.getAttribute(Gl)===t)return!0;return!1}function rm(e,t,r){if(!e.head)return;let o=Yl(),n=o.injectedStyles.get(e);if(n||(n=new Set,o.injectedStyles.set(e,n)),n.has(t))return;if(p1(e,t)){n.add(t);return}let s=e.createElement("style");s.setAttribute(Gl,t),s.appendChild(e.createTextNode(r)),e.head.appendChild(s),n.add(t)}function m1(e){let t=Yl();t.documents.set(e,(t.documents.get(e)??0)+1);for(let[r,o]of t.styles)rm(e,r,o);return()=>{let r=t.documents.get(e);if(r!==void 0){if(r<=1){t.documents.delete(e);return}t.documents.set(e,r-1)}}}function om(e,t){let r=Yl();r.styles.set(e,t);for(let o of r.documents.keys())rm(o,e,t)}typeof process>"u",om("10f3806643","@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");var h1={"box-sizing":"_336cd3e4e743482f__box-sizing"};typeof process>"u",om("19fcc06039",'@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._480b748dd3510e64__positioner{z-index:var(--wp-ui-tooltip-z-index,initial)}._50096b232db7709d__popup{--_wp-ui-elevation-sm:0 1px 2px rgba(0,0,0,.05),0 2px 3px rgba(0,0,0,.04),0 6px 6px rgba(0,0,0,.03),0 8px 8px rgba(0,0,0,.02);background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-elevation-sm);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:1.4;padding:var(--wpds-dimension-padding-xs,4px) var(--wpds-dimension-padding-sm,8px);@media (forced-colors:active){border-bottom-color:CanvasText;border-bottom-style:solid;border-bottom-width:1px;border-left-color:CanvasText;border-left-style:solid;border-left-width:1px;border-right-color:CanvasText;border-right-style:solid;border-right-width:1px;border-top-color:CanvasText;border-top-style:solid;border-top-width:1px}}}}');var g1={positioner:"_480b748dd3510e64__positioner",popup:"_50096b232db7709d__popup"},Oi=(0,tm.forwardRef)(function({align:t="center",className:r,side:o="top",sideOffset:n=4,...s},i){return(0,nm.jsx)(Kt.Positioner,{ref:i,align:t,side:o,sideOffset:n,...s,className:st(h1["box-sizing"],g1.positioner,r)})});var fs=h(Y(),1),ql="data-wp-hash";function Zl(){let e=globalThis;return e.__wpStyleRuntime||(e.__wpStyleRuntime={documents:new Map,styles:new Map,injectedStyles:new WeakMap},typeof document<"u"&&v1(document)),e.__wpStyleRuntime}function y1(e,t){if(!e.head)return!1;for(let r of e.head.querySelectorAll(`style[${ql}]`))if(r.getAttribute(ql)===t)return!0;return!1}function im(e,t,r){if(!e.head)return;let o=Zl(),n=o.injectedStyles.get(e);if(n||(n=new Set,o.injectedStyles.set(e,n)),n.has(t))return;if(y1(e,t)){n.add(t);return}let s=e.createElement("style");s.setAttribute(ql,t),s.appendChild(e.createTextNode(r)),e.head.appendChild(s),n.add(t)}function v1(e){let t=Zl();t.documents.set(e,(t.documents.get(e)??0)+1);for(let[r,o]of t.styles)im(e,r,o);return()=>{let r=t.documents.get(e);if(r!==void 0){if(r<=1){t.documents.delete(e);return}t.documents.set(e,r-1)}}}function b1(e,t){let r=Zl();r.styles.set(e,t);for(let o of r.documents.keys())im(o,e,t)}typeof process>"u",b1("19fcc06039",'@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._480b748dd3510e64__positioner{z-index:var(--wp-ui-tooltip-z-index,initial)}._50096b232db7709d__popup{--_wp-ui-elevation-sm:0 1px 2px rgba(0,0,0,.05),0 2px 3px rgba(0,0,0,.04),0 6px 6px rgba(0,0,0,.03),0 8px 8px rgba(0,0,0,.02);background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-elevation-sm);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:1.4;padding:var(--wpds-dimension-padding-xs,4px) var(--wpds-dimension-padding-sm,8px);@media (forced-colors:active){border-bottom-color:CanvasText;border-bottom-style:solid;border-bottom-width:1px;border-left-color:CanvasText;border-left-style:solid;border-left-width:1px;border-right-color:CanvasText;border-right-style:solid;border-right-width:1px;border-top-color:CanvasText;border-top-style:solid;border-top-width:1px}}}}');var w1={positioner:"_480b748dd3510e64__positioner",popup:"_50096b232db7709d__popup"},x1={background:"#1e1e1e"},am=(0,sm.forwardRef)(function({portal:t,positioner:r,children:o,className:n,...s},i){let a=(0,fs.jsx)(Yp,{color:x1,children:(0,fs.jsx)(Kt.Popup,{ref:i,className:st(w1.popup,n),...s,children:o})}),u=Bl(r,(0,fs.jsx)(Oi,{}),a);return Bl(t,(0,fs.jsx)(_i,{}),u)});var lm=h(Te(),1),cm=h(Y(),1),um=(0,lm.forwardRef)(function(t,r){return(0,cm.jsx)(Kt.Trigger,{ref:r,...t})});var fm=h(Y(),1);function dm(e){return(0,fm.jsx)(Kt.Root,{...e})}var pm=h(Y(),1);function mm({...e}){return(0,pm.jsx)(Kt.Provider,{...e})}var gm=h(Te(),1),Xl="data-wp-hash";function Kl(){let e=globalThis;return e.__wpStyleRuntime||(e.__wpStyleRuntime={documents:new Map,styles:new Map,injectedStyles:new WeakMap},typeof document<"u"&&C1(document)),e.__wpStyleRuntime}function S1(e,t){if(!e.head)return!1;for(let r of e.head.querySelectorAll(`style[${Xl}]`))if(r.getAttribute(Xl)===t)return!0;return!1}function ym(e,t,r){if(!e.head)return;let o=Kl(),n=o.injectedStyles.get(e);if(n||(n=new Set,o.injectedStyles.set(e,n)),n.has(t))return;if(S1(e,t)){n.add(t);return}let s=e.createElement("style");s.setAttribute(Xl,t),s.appendChild(e.createTextNode(r)),e.head.appendChild(s),n.add(t)}function C1(e){let t=Kl();t.documents.set(e,(t.documents.get(e)??0)+1);for(let[r,o]of t.styles)ym(e,r,o);return()=>{let r=t.documents.get(e);if(r!==void 0){if(r<=1){t.documents.delete(e);return}t.documents.set(e,r-1)}}}function vm(e,t){let r=Kl();r.styles.set(e,t);for(let o of r.documents.keys())ym(o,e,t)}typeof process>"u",vm("10f3806643","@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");var R1={"box-sizing":"_336cd3e4e743482f__box-sizing"};typeof process>"u",vm("ed2c39ec90","@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.b20cc1690085c2f0__skeleton{background-color:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);display:block;@media (forced-colors:active){border:var(--wpds-border-width-xs,1px) solid CanvasText}}._9b143194fdb45f93__pulse{@media not (prefers-reduced-motion){animation:e2b9fe0690281bc8__skeleton-pulse 1.5s ease-in-out infinite}}@keyframes e2b9fe0690281bc8__skeleton-pulse{0%,to{opacity:1}50%{opacity:.4}}}}");var hm={skeleton:"b20cc1690085c2f0__skeleton",pulse:"_9b143194fdb45f93__pulse","skeleton-pulse":"e2b9fe0690281bc8__skeleton-pulse"},Jl=(0,gm.forwardRef)(function({render:t,...r},o){return Sn({render:t,ref:o,props:or({className:st(hm.skeleton,hm.pulse,R1["box-sizing"]),"aria-hidden":!0},r)})});var bm=h(Te(),1),wm=h(Y(),1),xm=(0,bm.forwardRef)(({children:e,className:t,ariaLabel:r,as:o="div",...n},s)=>(0,wm.jsx)(o,{ref:s,className:st("admin-ui-navigable-region",t),"aria-label":r,role:"region",tabIndex:"-1",...n,children:e}));xm.displayName="NavigableRegion";var Sm=xm;var Rm=h(ce(),1),{Fill:Em,Slot:Tm}=(0,Rm.createSlotFill)("SidebarToggle");var ur=h(Y(),1),Ql="data-wp-hash";function $l(){let e=globalThis;return e.__wpStyleRuntime||(e.__wpStyleRuntime={documents:new Map,styles:new Map,injectedStyles:new WeakMap},typeof document<"u"&&T1(document)),e.__wpStyleRuntime}function E1(e,t){if(!e.head)return!1;for(let r of e.head.querySelectorAll(`style[${Ql}]`))if(r.getAttribute(Ql)===t)return!0;return!1}function _m(e,t,r){if(!e.head)return;let o=$l(),n=o.injectedStyles.get(e);if(n||(n=new Set,o.injectedStyles.set(e,n)),n.has(t))return;if(E1(e,t)){n.add(t);return}let s=e.createElement("style");s.setAttribute(Ql,t),s.appendChild(e.createTextNode(r)),e.head.appendChild(s),n.add(t)}function T1(e){let t=$l();t.documents.set(e,(t.documents.get(e)??0)+1);for(let[r,o]of t.styles)_m(e,r,o);return()=>{let r=t.documents.get(e);if(r!==void 0){if(r<=1){t.documents.delete(e);return}t.documents.set(e,r-1)}}}function _1(e,t){let r=$l();r.styles.set(e,t);for(let o of r.documents.keys())_m(o,e,t)}typeof process>"u",_1("ddd9aab364","._956b6df0898efed0__page{text-wrap:pretty;background-color:var(--wpds-color-background-surface-neutral,#fcfcfc);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-flow:column;height:100%;position:relative;z-index:1}._0625b55e82a0d93d__header{background:var(--wpds-color-background-surface-neutral-strong,#fff);border-block-end:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);inset-block-start:0;padding:var(--wpds-dimension-padding-lg,16px) var(--wpds-dimension-padding-2xl,24px);position:sticky;z-index:1}.a43c44d5ae28b2e8__header-content{min-height:var(--wpds-dimension-size-md,32px)}.b7cb5b9daf3a3b25__header-actions{flex-shrink:0}._8113be94e7caf73c__header-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._9a776c7f70996f61__header-visual{display:grid;flex-shrink:0;grid-template-columns:1fr;grid-template-rows:1fr;height:var(--wpds-dimension-size-sm,24px);width:var(--wpds-dimension-size-sm,24px);>*{grid-column:1/-1;grid-row:1/-1;max-height:100%;max-width:100%}}.d5e0920cd15d35bc__sidebar-toggle-slot:empty{display:none}._60fea2f6bf5319cd__header-subtitle{color:var(--wpds-color-foreground-content-neutral-weak,#707070);padding-block-end:var(--wpds-dimension-padding-xs,4px)}.be5e57d029ec4036__content{display:flex;flex-direction:column;flex-grow:1;overflow:auto;&._128806d0b26e3a50__has-padding{padding:var(--wpds-dimension-padding-lg,16px) var(--wpds-dimension-padding-2xl,24px)}}");var zo={page:"_956b6df0898efed0__page",header:"_0625b55e82a0d93d__header","header-content":"a43c44d5ae28b2e8__header-content","header-actions":"b7cb5b9daf3a3b25__header-actions","header-title":"_8113be94e7caf73c__header-title","header-visual":"_9a776c7f70996f61__header-visual","sidebar-toggle-slot":"d5e0920cd15d35bc__sidebar-toggle-slot","header-subtitle":"_60fea2f6bf5319cd__header-subtitle",content:"be5e57d029ec4036__content","has-padding":"_128806d0b26e3a50__has-padding"};function Om({headingLevel:e=1,breadcrumbs:t,badges:r,visual:o,title:n,subTitle:s,actions:i,showSidebarToggle:a=!0}){let u=`h${e}`;return(0,ur.jsxs)(Rn,{direction:"column",className:zo.header,children:[(0,ur.jsxs)(Rn,{className:zo["header-content"],direction:"row",gap:"sm",justify:"space-between",children:[(0,ur.jsxs)(Rn,{direction:"row",gap:"sm",align:"center",justify:"start",children:[a&&(0,ur.jsx)(Tm,{bubblesVirtually:!0,className:zo["sidebar-toggle-slot"]}),o&&(0,ur.jsx)("div",{className:zo["header-visual"],"aria-hidden":"true",children:o}),n&&(0,ur.jsx)(vi,{className:zo["header-title"],render:(0,ur.jsx)(u,{}),variant:"heading-lg",children:n}),t,r]}),i&&(0,ur.jsx)(Rn,{align:"center",className:zo["header-actions"],direction:"row",gap:"sm",children:i})]}),s&&(0,ur.jsx)(vi,{render:(0,ur.jsx)("p",{}),variant:"body-md",className:zo["header-subtitle"],children:s})]})}var ds=h(Y(),1),tc="data-wp-hash";function rc(){let e=globalThis;return e.__wpStyleRuntime||(e.__wpStyleRuntime={documents:new Map,styles:new Map,injectedStyles:new WeakMap},typeof document<"u"&&P1(document)),e.__wpStyleRuntime}function O1(e,t){if(!e.head)return!1;for(let r of e.head.querySelectorAll(`style[${tc}]`))if(r.getAttribute(tc)===t)return!0;return!1}function Pm(e,t,r){if(!e.head)return;let o=rc(),n=o.injectedStyles.get(e);if(n||(n=new Set,o.injectedStyles.set(e,n)),n.has(t))return;if(O1(e,t)){n.add(t);return}let s=e.createElement("style");s.setAttribute(tc,t),s.appendChild(e.createTextNode(r)),e.head.appendChild(s),n.add(t)}function P1(e){let t=rc();t.documents.set(e,(t.documents.get(e)??0)+1);for(let[r,o]of t.styles)Pm(e,r,o);return()=>{let r=t.documents.get(e);if(r!==void 0){if(r<=1){t.documents.delete(e);return}t.documents.set(e,r-1)}}}function k1(e,t){let r=rc();r.styles.set(e,t);for(let o of r.documents.keys())Pm(o,e,t)}typeof process>"u",k1("ddd9aab364","._956b6df0898efed0__page{text-wrap:pretty;background-color:var(--wpds-color-background-surface-neutral,#fcfcfc);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-flow:column;height:100%;position:relative;z-index:1}._0625b55e82a0d93d__header{background:var(--wpds-color-background-surface-neutral-strong,#fff);border-block-end:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);inset-block-start:0;padding:var(--wpds-dimension-padding-lg,16px) var(--wpds-dimension-padding-2xl,24px);position:sticky;z-index:1}.a43c44d5ae28b2e8__header-content{min-height:var(--wpds-dimension-size-md,32px)}.b7cb5b9daf3a3b25__header-actions{flex-shrink:0}._8113be94e7caf73c__header-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._9a776c7f70996f61__header-visual{display:grid;flex-shrink:0;grid-template-columns:1fr;grid-template-rows:1fr;height:var(--wpds-dimension-size-sm,24px);width:var(--wpds-dimension-size-sm,24px);>*{grid-column:1/-1;grid-row:1/-1;max-height:100%;max-width:100%}}.d5e0920cd15d35bc__sidebar-toggle-slot:empty{display:none}._60fea2f6bf5319cd__header-subtitle{color:var(--wpds-color-foreground-content-neutral-weak,#707070);padding-block-end:var(--wpds-dimension-padding-xs,4px)}.be5e57d029ec4036__content{display:flex;flex-direction:column;flex-grow:1;overflow:auto;&._128806d0b26e3a50__has-padding{padding:var(--wpds-dimension-padding-lg,16px) var(--wpds-dimension-padding-2xl,24px)}}");var ec={page:"_956b6df0898efed0__page",header:"_0625b55e82a0d93d__header","header-content":"a43c44d5ae28b2e8__header-content","header-actions":"b7cb5b9daf3a3b25__header-actions","header-title":"_8113be94e7caf73c__header-title","header-visual":"_9a776c7f70996f61__header-visual","sidebar-toggle-slot":"d5e0920cd15d35bc__sidebar-toggle-slot","header-subtitle":"_60fea2f6bf5319cd__header-subtitle",content:"be5e57d029ec4036__content","has-padding":"_128806d0b26e3a50__has-padding"};function km({headingLevel:e,breadcrumbs:t,badges:r,visual:o,title:n,subTitle:s,children:i,className:a,actions:u,ariaLabel:l,hasPadding:c=!1,showSidebarToggle:f=!0}){let m=st(ec.page,a);return(0,ds.jsxs)(Sm,{className:m,ariaLabel:l??(typeof n=="string"?n:""),children:[(n||t||r||u||o)&&(0,ds.jsx)(Om,{headingLevel:e,breadcrumbs:t,badges:r,visual:o,title:n,subTitle:s,actions:u,showSidebarToggle:f}),c?(0,ds.jsx)("div",{className:st(ec.content,ec["has-padding"]),children:i}):i]})}km.SidebarToggleFill=Em;var oc=km;var Un=h(Ce()),Zy=h(ce()),Xy=h(Am()),ba=h(ar()),Ky=h(Jt()),Jy=h(Te());var Gy=h(ce(),1),Yy=h(Tn(),1),yE=h(Jt(),1),vE=h(Vt(),1),vu=h(Te(),1),bE=h(Bo(),1);function _n(e,t,r){t=Array.isArray(t)?[...t]:[t],e=Array.isArray(e)?[...e]:{...e};let o=t.pop(),n=e;for(let s of t){let i=n[s];n=n[s]=Array.isArray(i)?[...i]:{...i}}return n[o]=r,e}var vt=(e,t,r)=>{let o=Array.isArray(t)?t:t.split("."),n=e;return o.forEach(s=>{n=n?.[s]}),n??r};var F1=["appearanceTools","useRootPaddingAwareAlignments","background.backgroundImage","background.backgroundRepeat","background.backgroundSize","background.backgroundPosition","background.gradient","border.color","border.radius","border.radiusSizes","border.style","border.width","shadow.presets","shadow.defaultPresets","color.background","color.button","color.caption","color.custom","color.customDuotone","color.customGradient","color.defaultDuotone","color.defaultGradients","color.defaultPalette","color.duotone","color.gradients","color.heading","color.link","color.palette","color.text","custom","dimensions.aspectRatio","dimensions.height","dimensions.minHeight","dimensions.minWidth","dimensions.width","dimensions.dimensionSizes","layout.contentSize","layout.definitions","layout.wideSize","lightbox.enabled","lightbox.allowEditing","position.fixed","position.sticky","spacing.customSpacingSize","spacing.defaultSpacingSizes","spacing.spacingSizes","spacing.spacingScale","spacing.blockGap","spacing.margin","spacing.padding","spacing.units","typography.fluid","typography.customFontSize","typography.defaultFontSizes","typography.dropCap","typography.fontFamilies","typography.fontSizes","typography.fontStyle","typography.fontWeight","typography.letterSpacing","typography.lineHeight","typography.textAlign","typography.textColumns","typography.textDecoration","typography.textIndent","typography.textTransform","typography.writingMode","viewport.mobile","viewport.tablet"];function nc(e,t,r){let o=r?".blocks."+r:"",n=t?"."+t:"",s=`settings${o}${n}`,i=`settings${n}`;if(t)return vt(e,s)??vt(e,i);let a={};return F1.forEach(u=>{let l=vt(e,`settings${o}.${u}`)??vt(e,`settings.${u}`);l!==void 0&&(a=_n(a,u.split("."),l))}),a}function sc(e,t,r,o){let n=o?".blocks."+o:"",s=t?"."+t:"",i=`settings${n}${s}`;return _n(e,i.split("."),r)}var jm=h(Vm(),1);var A1="1600px",I1="320px",L1=1,N1=.25,D1=.75,M1="14px";function Bm({minimumFontSize:e,maximumFontSize:t,fontSize:r,minimumViewportWidth:o=I1,maximumViewportWidth:n=A1,scaleFactor:s=L1,minimumFontSizeLimit:i}){if(i=Ir(i)?i:M1,r){let b=Ir(r);if(!b?.unit||!b?.value)return null;let R=Ir(i,{coerceTo:b.unit});if(R?.value&&!e&&!t&&b?.value<=R?.value)return null;if(t||(t=`${b.value}${b.unit}`),!e){let k=b.unit==="px"?b.value:b.value*16,T=Math.min(Math.max(1-.075*Math.log2(k),N1),D1),_=ps(b.value*T,3);R?.value&&_0}function V1(e){let t=e?.typography??{},r=e?.layout,o=Ir(r?.wideSize)?r?.wideSize:null;return ic(t)&&o?{fluid:{maxViewportWidth:o,...typeof t.fluid=="object"?t.fluid:{}}}:{fluid:t?.fluid}}function zm(e,t){let{size:r}=e;if(!r||r==="0"||e?.fluid===!1||!ic(t?.typography)&&!ic(e))return r;let o=V1(t)?.fluid??{},n=Bm({minimumFontSize:typeof e?.fluid=="boolean"?void 0:e?.fluid?.min,maximumFontSize:typeof e?.fluid=="boolean"?void 0:e?.fluid?.max,fontSize:r,minimumFontSizeLimit:typeof o=="object"?o?.minFontSize:void 0,maximumViewportWidth:typeof o=="object"?o?.maxViewportWidth:void 0,minimumViewportWidth:typeof o=="object"?o?.minViewportWidth:void 0});return n||r}var B1=[{path:["color","palette"],valueKey:"color",cssVarInfix:"color",classes:[{classSuffix:"color",propertyName:"color"},{classSuffix:"background-color",propertyName:"background-color"},{classSuffix:"border-color",propertyName:"border-color"}]},{path:["color","gradients"],valueKey:"gradient",cssVarInfix:"gradient",classes:[{classSuffix:"gradient-background",propertyName:"background"}]},{path:["color","duotone"],valueKey:"colors",cssVarInfix:"duotone",valueFunc:({slug:e})=>`url( '#wp-duotone-${e}' )`,classes:[]},{path:["shadow","presets"],valueKey:"shadow",cssVarInfix:"shadow",classes:[]},{path:["typography","fontSizes"],valueFunc:(e,t)=>zm(e,t),valueKey:"size",cssVarInfix:"font-size",classes:[{classSuffix:"font-size",propertyName:"font-size"}]},{path:["typography","fontFamilies"],valueKey:"fontFamily",cssVarInfix:"font-family",classes:[{classSuffix:"font-family",propertyName:"font-family"}]},{path:["spacing","spacingSizes"],valueKey:"size",cssVarInfix:"spacing",valueFunc:({size:e})=>e,classes:[]},{path:["border","radiusSizes"],valueKey:"size",cssVarInfix:"border-radius",classes:[]},{path:["dimensions","dimensionSizes"],valueKey:"size",cssVarInfix:"dimension",classes:[]}];function z1(e,t){if(!e||!t)return e;if(typeof e=="object"&&"ref"in e&&e?.ref){let r=(0,jm.getCSSValueFromRawStyle)(vt(t,e.ref));return typeof r=="object"&&r!==null&&"ref"in r&&r?.ref?void 0:r===void 0?e:r}return e}function j1(e,t){if(!e||!t||!Array.isArray(t))return e;let r=t.find(o=>o?.name===e);return r?.href?r?.href:e}function Hm(e,t){if(!e||!t)return e;let r=z1(e,t);return typeof r=="object"&&r!==null&&"url"in r&&r?.url&&(r.url=j1(r.url,t?._links?.["wp:theme-file"])),r}function Um(e,t,r=[],o="slug",n){let s=[t?vt(e,["blocks",t,...r]):void 0,vt(e,r)].filter(Boolean);for(let i of s)if(i){let a=["custom","theme","default"];for(let u of a){let l=i[u];if(l){let c=l.find(f=>f[o]===n);if(c)return o==="slug"||Um(e,t,r,"slug",c.slug)[o]===c[o]?c:void 0}}}}function H1(e,t,r,[o,n]=[]){let s=B1.find(a=>a.cssVarInfix===o);if(!s||!e.settings)return r;let i=Um(e.settings,t,s.path,"slug",n);if(i){let{valueKey:a}=s,u=i[a];return Pi(e,t,u)}return r}function U1(e,t,r,o=[]){let n=(t?vt(e?.settings??{},["blocks",t,"custom",...o]):void 0)??vt(e?.settings??{},["custom",...o]);return n?Pi(e,t,n):r}function Pi(e,t,r){if(!r||typeof r!="string")if(typeof r=="object"&&r!==null&&"ref"in r&&typeof r.ref=="string"){let l=vt(e,r.ref);if(!l||typeof l=="object"&&"ref"in l)return l;r=l}else return r;let o="var:",n="var(--wp--",s=")",i;if(r.startsWith(o))i=r.slice(o.length).split("|");else if(r.startsWith(n)&&r.endsWith(s))i=r.slice(n.length,-s.length).split("--");else return r;let[a,...u]=i;return a==="preset"?H1(e,t,r,u):a==="custom"?U1(e,t,r,u):r}function ki(e,t,r,o=!0){let n=t?"."+t:"",s=r?`styles.blocks.${r}${n}`:`styles${n}`;if(!e)return;let i=vt(e,s),a=void 0;if(i===void 0&&a){let l=!0,c=e;for(let f of s.split(".")){if(!c||typeof c!="object"||!Object.hasOwn(c,f)){l=!1;break}c=c[f]}l||(i=vt(e,a))}return o?Pi(e,r,i):i}function ac(e,t,r,o){let n=t?"."+t:"",s=o?`styles.blocks.${o}${n}`:`styles${n}`;return _n(e,s.split("."),r)}var lc=h(Gm(),1);function ms(e,t){return typeof e!="object"||typeof t!="object"?e===t:(0,lc.default)(e?.styles,t?.styles)&&(0,lc.default)(e?.settings,t?.settings)}var Qm=h(Xm(),1);function Km(e){return Object.prototype.toString.call(e)==="[object Object]"}function Jm(e){var t,r;return Km(e)===!1?!1:(t=e.constructor,t===void 0?!0:(r=t.prototype,!(Km(r)===!1||r.hasOwnProperty("isPrototypeOf")===!1)))}function jo(e,t){return(0,Qm.default)(e,t,{isMergeableObject:Jm,customMerge:r=>{if(r==="backgroundImage")return(o,n)=>n??o}})}var ow={grad:.9,turn:360,rad:360/(2*Math.PI)},Kr=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},Rt=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=Math.pow(10,t)),Math.round(r*e)/r+0},fr=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=1),e>r?r:e>t?e:t},ih=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},$m=function(e){return{r:fr(e.r,0,255),g:fr(e.g,0,255),b:fr(e.b,0,255),a:fr(e.a)}},cc=function(e){return{r:Rt(e.r),g:Rt(e.g),b:Rt(e.b),a:Rt(e.a,3)}},nw=/^#([0-9a-f]{3,8})$/i,Fi=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},ah=function(e){var t=e.r,r=e.g,o=e.b,n=e.a,s=Math.max(t,r,o),i=s-Math.min(t,r,o),a=i?s===t?(r-o)/i:s===r?2+(o-t)/i:4+(t-r)/i:0;return{h:60*(a<0?a+6:a),s:s?i/s*100:0,v:s/255*100,a:n}},lh=function(e){var t=e.h,r=e.s,o=e.v,n=e.a;t=t/360*6,r/=100,o/=100;var s=Math.floor(t),i=o*(1-r),a=o*(1-(t-s)*r),u=o*(1-(1-t+s)*r),l=s%6;return{r:255*[o,a,i,i,u,o][l],g:255*[u,o,o,a,i,i][l],b:255*[i,i,u,o,o,a][l],a:n}},eh=function(e){return{h:ih(e.h),s:fr(e.s,0,100),l:fr(e.l,0,100),a:fr(e.a)}},th=function(e){return{h:Rt(e.h),s:Rt(e.s),l:Rt(e.l),a:Rt(e.a,3)}},rh=function(e){return lh((r=(t=e).s,{h:t.h,s:(r*=((o=t.l)<50?o:100-o)/100)>0?2*r/(o+r)*100:0,v:o+r,a:t.a}));var t,r,o},gs=function(e){return{h:(t=ah(e)).h,s:(n=(200-(r=t.s))*(o=t.v)/100)>0&&n<200?r*o/100/(n<=100?n:200-n)*100:0,l:n/2,a:t.a};var t,r,o,n},sw=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,iw=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,aw=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,lw=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,dc={string:[[function(e){var t=nw.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?Rt(parseInt(e[3]+e[3],16)/255,2):1}:e.length===6||e.length===8?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:e.length===8?Rt(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=aw.exec(e)||lw.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:$m({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=sw.exec(e)||iw.exec(e);if(!t)return null;var r,o,n=eh({h:(r=t[1],o=t[2],o===void 0&&(o="deg"),Number(r)*(ow[o]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return rh(n)},"hsl"]],object:[[function(e){var t=e.r,r=e.g,o=e.b,n=e.a,s=n===void 0?1:n;return Kr(t)&&Kr(r)&&Kr(o)?$m({r:Number(t),g:Number(r),b:Number(o),a:Number(s)}):null},"rgb"],[function(e){var t=e.h,r=e.s,o=e.l,n=e.a,s=n===void 0?1:n;if(!Kr(t)||!Kr(r)||!Kr(o))return null;var i=eh({h:Number(t),s:Number(r),l:Number(o),a:Number(s)});return rh(i)},"hsl"],[function(e){var t=e.h,r=e.s,o=e.v,n=e.a,s=n===void 0?1:n;if(!Kr(t)||!Kr(r)||!Kr(o))return null;var i=(function(a){return{h:ih(a.h),s:fr(a.s,0,100),v:fr(a.v,0,100),a:fr(a.a)}})({h:Number(t),s:Number(r),v:Number(o),a:Number(s)});return lh(i)},"hsv"]]},oh=function(e,t){for(var r=0;r=.5},e.prototype.toHex=function(){return t=cc(this.rgba),r=t.r,o=t.g,n=t.b,i=(s=t.a)<1?Fi(Rt(255*s)):"","#"+Fi(r)+Fi(o)+Fi(n)+i;var t,r,o,n,s,i},e.prototype.toRgb=function(){return cc(this.rgba)},e.prototype.toRgbString=function(){return t=cc(this.rgba),r=t.r,o=t.g,n=t.b,(s=t.a)<1?"rgba("+r+", "+o+", "+n+", "+s+")":"rgb("+r+", "+o+", "+n+")";var t,r,o,n,s},e.prototype.toHsl=function(){return th(gs(this.rgba))},e.prototype.toHslString=function(){return t=th(gs(this.rgba)),r=t.h,o=t.s,n=t.l,(s=t.a)<1?"hsla("+r+", "+o+"%, "+n+"%, "+s+")":"hsl("+r+", "+o+"%, "+n+"%)";var t,r,o,n,s},e.prototype.toHsv=function(){return t=ah(this.rgba),{h:Rt(t.h),s:Rt(t.s),v:Rt(t.v),a:Rt(t.a,3)};var t},e.prototype.invert=function(){return Lr({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},e.prototype.saturate=function(t){return t===void 0&&(t=.1),Lr(uc(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),Lr(uc(this.rgba,-t))},e.prototype.grayscale=function(){return Lr(uc(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),Lr(nh(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),Lr(nh(this.rgba,-t))},e.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},e.prototype.alpha=function(t){return typeof t=="number"?Lr({r:(r=this.rgba).r,g:r.g,b:r.b,a:t}):Rt(this.rgba.a,3);var r},e.prototype.hue=function(t){var r=gs(this.rgba);return typeof t=="number"?Lr({h:t,s:r.s,l:r.l,a:r.a}):Rt(r.h)},e.prototype.isEqual=function(t){return this.toHex()===Lr(t).toHex()},e})(),Lr=function(e){return e instanceof pc?e:new pc(e)},sh=[],ch=function(e){e.forEach(function(t){sh.indexOf(t)<0&&(t(pc,dc),sh.push(t))})};var uh={mobile:"480px",tablet:"782px"},fh=/^(\d+|\d*\.\d+)(px|em|rem)$/,uw=16;function fw(e){return"mobile"in e||"tablet"in e}function dw(e){return!e||typeof e!="object"?{}:fw(e)?e:e.settings?.viewport??{}}function pw(e){return typeof e=="string"&&fh.test(e.trim())}function mc(e){if(typeof e=="number")return e;if(typeof e!="string")return;let t=e.trim().match(fh);if(!t)return;let r=Number.parseFloat(t[1]);return t[2]==="px"?r:r*uw}function hc(e){let t=dw(e),r={},o={};Object.keys(uh).forEach(a=>{let u=a,l=t[u],c=mc(l);c!==void 0&&pw(l)&&(r[u]=l.trim(),o[u]=c)});let n=Object.keys(r);if(!n.length)return{...uh};if(n.length===1)return r;let s=r.mobile,i=r.tablet;return o.mobile>=o.tablet?{mobile:s}:{mobile:s,tablet:i}}function dh(e){let t=hc(e),r={};return t.mobile&&(r["@mobile"]=`@media (width <= ${t.mobile})`),t.tablet&&(r["@tablet"]=t.mobile?`@media (${t.mobile} < width <= ${t.tablet})`:`@media (width <= ${t.tablet})`),r}function Ai(e,t,r,{resolveRefs:o=!0}={}){if(!e?.styles?.blocks?.[t]?.variations?.[r])return;let n=i=>{Object.keys(i).forEach(a=>{let u=i[a];if(typeof u=="object"&&u!==null)if(u.ref!==void 0)if(typeof u.ref!="string"||u.ref.trim()==="")delete i[a];else{let l=vt(e,u.ref);l!=null?i[a]=l:delete i[a]}else n(u),Object.keys(u).length===0&&delete i[a]})},s=JSON.parse(JSON.stringify(e.styles.blocks[t].variations[r]));return o&&n(s),s}var vc="default";function gh(e){let t=e?.viewport,r=e?.pseudoState;return(!t||t===vc)&&(!r||r===vc)}function mw(e){return gh(e)?[]:[e.viewport,e.pseudoState].filter(t=>!!t&&t!==vc)}function hw(e,t){let r=mw(t);return r.length?vt(e,r):e}var gw=new Set(["blocks","variations","css"]),gc=Object.freeze({value:{},sources:{}}),yw={root:{layer:"root"},element:{layer:"element"},block:{layer:"block"},blockVariation:{layer:"blockVariation"}};function go(e){let t=yw[e];return t?{...t}:null}function yo(e,t){return!e||!t?null:{styles:e,source:t}}function vw(e){return e.join(".")}function bw(e){return{...e}}function yh(e){return e===""||e===null||typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0}function yc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&typeof e.ref=="string"}function vo(e){if(!e||typeof e!="object"||Array.isArray(e))return null;let t={};for(let r of Object.keys(e))if(!gw.has(r)){if(r==="elements"){e.elements&&typeof e.elements=="object"&&(t.elements=e.elements);continue}yh(e[r])||(t[r]=e[r])}return Object.keys(t).length===0?null:t}var ph=new Set(["backgroundImage"]);function vh(e,t,r,o,n,s=[]){if(!t||typeof t!="object"||Array.isArray(t))return e;for(let i of Object.keys(t)){let a=t[i];if(yh(a))continue;if(yc(a)){if(a.ref.trim()==="")continue;let l=vt(r,a.ref);if(l==null||yc(l))continue;a=l}let u=[...s,i];if(!ph.has(i)&&a!==null&&typeof a=="object"&&!Array.isArray(a)&&!yc(a)){let l=e[i]&&typeof e[i]=="object"&&!Array.isArray(e[i])?e[i]:{};e[i]=vh({...l},a,r,o,n,u)}else e[i]=ph.has(i)&&a!==null&&typeof a=="object"&&!Array.isArray(a)?{...a}:a,o&&n&&(n[vw(u)]=bw(o))}return e}function Ii(e,t){if(!e)return null;let r=hw(e,t);return r&&typeof r=="object"&&!Array.isArray(r)?r:null}var ww=["color.background","color.gradient","background","spacing","dimensions","border","shadow","filter"];function xw(e){return e.startsWith("elements.")?!1:ww.some(t=>e===t||e.startsWith(`${t}.`))}function bh(e,t){if(!e||typeof e!="object")return;let[r,...o]=t;if(o.length===0){delete e[r];return}let n=e[r];n&&typeof n=="object"&&(bh(n,o),Object.keys(n).length===0&&delete e[r])}function Sw(e,t){for(let r of Object.keys(t))t[r].layer==="root"&&xw(r)&&(bh(e,r.split(".")),delete t[r])}function Cw(e,t,r){let o=e?.background?.backgroundImage;if(!o)return;let n=Hm(o,{...t,_links:r??void 0});n!==void 0&&(e.background.backgroundImage=n)}function mh(e,{blockName:t,variationName:r=null,elements:o=null,viewport:n=null,pseudoState:s=null}={}){if(!e||!e.styles||!t)return gc;let i=e.styles,a={viewport:n,pseudoState:s},u=i,l=i.blocks?.[t]??null,c=(o??[]).map(S=>i.elements?.[S]??null).filter(S=>!!S),f=r?Ai(e,t,r)??null:null,m=[yo(vo(u),go("root")),...c.map(S=>yo(vo(S),go("element"))),l?yo(vo(l),go("block")):null,f?yo(vo(f),go("blockVariation")):null];gh(a)||m.push(yo(vo(Ii(u,a)),go("root")),...c.map(S=>yo(vo(Ii(S,a)),go("element"))),l?yo(vo(Ii(l,a)),go("block")):null,f?yo(vo(Ii(f,a)),go("blockVariation")):null);let g=m.filter(Boolean);if(g.length===0)return gc;let d={},v=g.reduce((S,C)=>vh(S,C.styles,e,C.source,d),{});return Sw(v,d),Cw(v,e,e._links??null),{value:v,sources:d}}var Rw={},hh=new WeakMap;function wh(e,t={}){let r=e?.styles;if(!r||typeof r!="object")return mh(e,t);let o=hh.get(r);o||(o=new WeakMap,hh.set(r,o));let n=e?._links??Rw,s=o.get(n);s||(s=new Map,o.set(n,s));let i=`${t.elements?.join(",")??""}:${t.viewport??""}:${t.pseudoState??""}`,a=(t.blockName||"")+""+(t.variationName||"")+""+i;if(s.has(a))return s.get(a);let u=mh(e,t);return s.set(a,u),u}var xh=h(us(),1),{lock:Sh,unlock:X4}=(0,xh.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/global-styles-engine");var Pn={};Sh(Pn,{getResponsiveMediaQueries:dh,getViewportBreakpoints:hc,getViewportBreakpointValueInPixels:mc,resolveStyle:wh,getVariationStyle:Ai});var bc=h(Te(),1);var Ch=h(Te(),1),Ot=(0,Ch.createContext)({user:{styles:{},settings:{}},base:{styles:{},settings:{}},merged:{styles:{},settings:{}},onChange:()=>{},fontLibraryEnabled:!1});var Rh=h(Y(),1);function ys({children:e,value:t,baseValue:r,onChange:o,fontLibraryEnabled:n}){let s=(0,bc.useMemo)(()=>jo(r,t),[r,t]),i=(0,bc.useMemo)(()=>({user:t,base:r,merged:s,onChange:o,fontLibraryEnabled:n}),[t,r,s,o,n]);return(0,Rh.jsx)(Ot.Provider,{value:i,children:e})}var Qr=h(ce(),1),jh=h(Ce(),1);var Vw=h(Jt(),1),Bw=h(ar(),1);var Eh=h(Y(),1);function wc({className:e,...t}){return(0,Eh.jsx)(cs,{className:st(e,"global-styles-ui-icon-with-current-color"),...t})}var bo=h(ce(),1);var Ho=h(Y(),1);function Ew({icon:e,children:t,...r}){return(0,Ho.jsxs)(bo.__experimentalItem,{...r,children:[e&&(0,Ho.jsxs)(bo.__experimentalHStack,{justify:"flex-start",children:[(0,Ho.jsx)(wc,{icon:e,size:24}),(0,Ho.jsx)(bo.FlexItem,{children:t})]}),!e&&t]})}function Nr(e){return(0,Ho.jsx)(bo.Navigator.Button,{as:Ew,...e})}var Ow=h(ce(),1);var Pw=h(Ce(),1),Ah=h(Vt(),1);var xc=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Sc=function(e){return .2126*xc(e.r)+.7152*xc(e.g)+.0722*xc(e.b)};function Th(e){e.prototype.luminance=function(){return t=Sc(this.rgba),(r=2)===void 0&&(r=0),o===void 0&&(o=Math.pow(10,r)),Math.round(o*t)/o+0;var t,r,o},e.prototype.contrast=function(t){t===void 0&&(t="#FFF");var r,o,n,s,i,a,u,l=t instanceof e?t:new e(t);return s=this.rgba,i=l.toRgb(),a=Sc(s),u=Sc(i),r=a>u?(a+.05)/(u+.05):(u+.05)/(a+.05),(o=2)===void 0&&(o=0),n===void 0&&(n=Math.pow(10,o)),Math.floor(n*r)/n+0},e.prototype.isReadable=function(t,r){return t===void 0&&(t="#FFF"),r===void 0&&(r={}),this.contrast(t)>=(a=(i=(o=r).size)===void 0?"normal":i,(s=(n=o.level)===void 0?"AA":n)==="AAA"&&a==="normal"?7:s==="AA"&&a==="large"?3:4.5);var o,n,s,i,a}}var Tr=h(Te(),1),kh=h(Jt(),1),Fh=h(ar(),1),Rc=h(Ce(),1);var mt=h(Ce(),1);var _h=h(us(),1),{lock:w5,unlock:Fe}=(0,_h.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/global-styles-ui");var{getViewportBreakpoints:R5}=Fe(Pn),E5={link:[{value:":link",label:(0,mt.__)("Link")},{value:":any-link",label:(0,mt.__)("Any Link")},{value:":visited",label:(0,mt.__)("Visited")},{value:":hover",label:(0,mt.__)("Hover")},{value:":focus",label:(0,mt.__)("Focus")},{value:":focus-visible",label:(0,mt.__)("Focus-visible")},{value:":active",label:(0,mt.__)("Active")}],button:[{value:":link",label:(0,mt.__)("Link")},{value:":any-link",label:(0,mt.__)("Any Link")},{value:":visited",label:(0,mt.__)("Visited")},{value:":hover",label:(0,mt.__)("Hover")},{value:":focus",label:(0,mt.__)("Focus")},{value:":focus-visible",label:(0,mt.__)("Focus-visible")},{value:":active",label:(0,mt.__)("Active")}]},T5={"core/button":[{value:":hover",label:(0,mt.__)("Hover")},{value:":focus",label:(0,mt.__)("Focus")},{value:":focus-visible",label:(0,mt.__)("Focus-visible")},{value:":active",label:(0,mt.__)("Active")}]},_5=[{value:"@tablet",label:(0,mt.__)("Tablet")},{value:"@mobile",label:(0,mt.__)("Mobile")}];function Cc(e,t){if(!t?.length||typeof e!="object"||!e||!Object.keys(e).length)return e;for(let r in e)t.includes(r)?delete e[r]:typeof e[r]=="object"&&Cc(e[r],t);return e}var Li=(e,t)=>{if(!e||!t?.length)return{};let r={};return Object.keys(e).forEach(o=>{if(t.includes(o))r[o]=e[o];else if(typeof e[o]=="object"){let n=Li(e[o],t);Object.keys(n).length&&(r[o]=n)}}),r};function vs(e,t){let r=Li(structuredClone(e),t);return ms(r,e)}function Oh(e,t){if(!Array.isArray(e)||!t)return null;let o=t.replace("var(","").replace(")","")?.split("--").slice(-1)[0];return e.find(n=>n.slug===o)}function Ph(e){let t=e?.settings?.typography?.fontFamilies?.theme,r=e?.settings?.typography?.fontFamilies?.custom,o=[];t&&r?o=[...t,...r]:t?o=t:r&&(o=r);let n=e?.styles?.typography?.fontFamily,s=Oh(o,n),i=e?.styles?.elements?.heading?.typography?.fontFamily,a;return i?a=Oh(o,e?.styles?.elements?.heading?.typography?.fontFamily):a=s,[s,a]}ch([Th]);function Xe(e,t,r="merged",o=!0,n){let{user:s,base:i,merged:a,onChange:u}=(0,Tr.useContext)(Ot),l=n?.split(".").filter(Boolean)??[],c=l.find(S=>S.startsWith(":")),f=l.filter(S=>!S.startsWith(":")).join("."),m=[e,f].filter(Boolean).join("."),g=a;r==="base"?g=i:r==="user"&&(g=s);let d=(0,Tr.useMemo)(()=>{let S=ki(g,m,t,o);return c?S?.[c]??{}:S},[g,m,t,o,c]),v=(0,Tr.useCallback)(S=>{let C=S;c&&(C={...ki(s,m,t,!1),[c]:S});let w=ac(s,m,C,t);u(w)},[s,u,m,t,c]);return[d,v]}function Je(e,t,r="merged"){let{user:o,base:n,merged:s,onChange:i}=(0,Tr.useContext)(Ot),a=s;r==="base"?a=n:r==="user"&&(a=o);let u=(0,Tr.useMemo)(()=>nc(a,e,t),[a,e,t]),l=(0,Tr.useCallback)(c=>{let f=sc(o,e,c,t);i(f)},[o,i,e,t]);return[u,l]}var Tw=[];function _w({title:e,settings:t,styles:r}){return e===(0,Rc.__)("Default")||Object.keys(t||{}).length>0||Object.keys(r||{}).length>0}function Ni(e=[]){let{variationsFromTheme:t}=(0,kh.useSelect)(o=>({variationsFromTheme:o(Fh.store).__experimentalGetCurrentThemeGlobalStylesVariations?.()||Tw}),[]),{user:r}=(0,Tr.useContext)(Ot);return(0,Tr.useMemo)(()=>{let o=structuredClone(r),n=Cc(o,e);n.title=(0,Rc.__)("Default");let s=t.filter(a=>vs(a,e)).map(a=>jo(n,a)),i=[n,...s];return i?.length?i.filter(_w):[]},[e,r,t])}var Ec=h(Y(),1),{useHasDimensionsPanel:V5,useHasTypographyPanel:B5,useHasColorPanel:z5,useSettingsForBlockElement:j5,useHasBackgroundPanel:H5}=Fe(Ah.privateApis);var Dr=h(ce(),1);function kn(){let[e="black"]=Xe("color.text"),[t="white"]=Xe("color.background"),[r=e]=Xe("elements.h1.color.text"),[o=r]=Xe("elements.link.color.text"),[n=o]=Xe("elements.button.color.background"),[s]=Je("color.palette.core")||[],[i]=Je("color.palette.theme")||[],[a]=Je("color.palette.custom")||[],u=(i??[]).concat(a??[]).concat(s??[]),l=u.filter(({color:m})=>m===e),c=u.filter(({color:m})=>m===n),f=l.concat(c).concat(u).filter(({color:m})=>m!==t).slice(0,2);return{paletteColors:u,highlightedColors:f}}var Nh=h(Te(),1),Dh=h(ce(),1),_c=h(Ce(),1);function kw(e,t){return t.length===0?null:(t.sort((r,o)=>Math.abs(e-r)-Math.abs(e-o)),t[0])}function Fw(e){let t=[];return e.forEach(r=>{let o=String(r.fontWeight).split(" ");if(o.length===2){let n=parseInt(o[0]),s=parseInt(o[1]);for(let i=n;i<=s;i+=100)t.push(i)}else o.length===1&&t.push(parseInt(o[0]))}),t}function Ih(e){let t=/^(?!generic\([ a-zA-Z\-]+\)$)(?!^[a-zA-Z\-]+$).+/,r=e.trim(),o=n=>(n=n.trim(),n.match(t)?(n=n.replace(/^["']|["']$/g,""),`"${n}"`):n);return r.includes(",")?r.split(",").map(o).filter(n=>n!=="").join(", "):o(r)}function Tc(e){if(!e)return"";let t=e.trim();return t.includes(",")&&(t=(t.split(",").find(r=>r.trim()!=="")??"").trim()),t=t.replace(/^["']|["']$/g,""),window.navigator.userAgent.toLowerCase().includes("firefox")&&(t=`"${t}"`),t}function Fn(e){let t={fontFamily:Ih(e.fontFamily)};if(!("fontFace"in e)||!Array.isArray(e.fontFace))return t.fontWeight="400",t.fontStyle="normal",t;if(e.fontFace){let r=e.fontFace.filter(o=>o?.fontStyle&&o.fontStyle.toLowerCase()==="normal");if(r.length>0){t.fontStyle="normal";let o=Fw(r),n=kw(400,o);t.fontWeight=String(n)||"400"}else t.fontStyle=e.fontFace.length&&e.fontFace[0].fontStyle||"normal",t.fontWeight=e.fontFace.length&&String(e.fontFace[0].fontWeight)||"400"}return t}function Lh(e){return{fontFamily:Ih(e.fontFamily),fontStyle:e.fontStyle||"normal",fontWeight:e.fontWeight||"400"}}var bs=h(Y(),1);function Di({fontSize:e,variation:t}){let{base:r}=(0,Nh.useContext)(Ot),o=r;t&&(o={...r,...t});let[n]=Xe("color.text"),[s,i]=Ph(o),a=s?Fn(s):{},u=i?Fn(i):{};return n&&(a.color=n,u.color=n),e&&(a.fontSize=e,u.fontSize=e),(0,bs.jsxs)(Dh.__unstableMotion.div,{animate:{scale:1,opacity:1},initial:{scale:.1,opacity:0},transition:{delay:.3,type:"tween"},style:{textAlign:"center",lineHeight:1},children:[(0,bs.jsx)("span",{style:u,children:(0,_c._x)("A","Uppercase letter A")}),(0,bs.jsx)("span",{style:a,children:(0,_c._x)("a","Lowercase letter A")})]})}var Mh=h(ce(),1);var Vh=h(Y(),1);function Bh({normalizedColorSwatchSize:e,ratio:t}){let{highlightedColors:r}=kn(),o=e*t;return r.map(({slug:n,color:s},i)=>(0,Vh.jsx)(Mh.__unstableMotion.div,{style:{height:o,width:o,background:s,borderRadius:o/2},animate:{scale:1,opacity:1},initial:{scale:.1,opacity:0},transition:{delay:i===1?.2:.1}},`${n}-${i}`))}var zh=h(ce(),1),An=h(Bo(),1),Uo=h(Te(),1);var Jr=h(Y(),1),Oc=248,Pc=152,Aw={leading:!0,trailing:!0};function Iw({children:e,label:t,isFocused:r,withHoverView:o}){let[n="white"]=Xe("color.background"),[s]=Xe("color.gradient"),i=(0,An.useReducedMotion)(),[a,u]=(0,Uo.useState)(!1),[l,{width:c}]=(0,An.useResizeObserver)(),[f,m]=(0,Uo.useState)(c),[g,d]=(0,Uo.useState)(),v=(0,An.useThrottle)(m,250,Aw);(0,Uo.useLayoutEffect)(()=>{c&&v(c)},[c,v]),(0,Uo.useLayoutEffect)(()=>{let b=f?f/Oc:1,R=b-(g||0);(Math.abs(R)>.1||!g)&&d(b)},[f,g]);let S=c?c/Oc:1,C=g||S,w=!!c;return(0,Jr.jsxs)(Jr.Fragment,{children:[(0,Jr.jsx)("div",{style:{position:"relative"},children:l}),!w&&(0,Jr.jsx)(Jl,{className:"global-styles-ui-preview__wrapper",style:{aspectRatio:Oc/Pc}}),w&&(0,Jr.jsx)("div",{className:st("global-styles-ui-preview__wrapper",{"is-hoverable":o}),style:{height:Pc*C},onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),tabIndex:-1,children:(0,Jr.jsx)(zh.__unstableMotion.div,{style:{height:Pc*C,width:"100%",background:s??n},initial:"start",animate:(a||r)&&!i&&t?"hover":"start",children:[].concat(e).map((b,R)=>b({ratio:C,key:R}))})})]})}var In=Iw;var Qt=h(Y(),1),Lw={start:{scale:1,opacity:1},hover:{scale:0,opacity:0}},Nw={hover:{opacity:1},start:{opacity:.5}},Dw={hover:{scale:1,opacity:1},start:{scale:0,opacity:0}};function Mw({label:e,isFocused:t,withHoverView:r,variation:o}){let[n]=Xe("typography.fontWeight"),[s="serif"]=Xe("typography.fontFamily"),[i=s]=Xe("elements.h1.typography.fontFamily"),[a=n]=Xe("elements.h1.typography.fontWeight"),[u="black"]=Xe("color.text"),[l=u]=Xe("elements.h1.color.text"),{paletteColors:c}=kn();return(0,Qt.jsxs)(In,{label:e,isFocused:t,withHoverView:r,children:[({ratio:f,key:m})=>(0,Qt.jsx)(Dr.__unstableMotion.div,{variants:Lw,style:{height:"100%",overflow:"hidden"},children:(0,Qt.jsxs)(Dr.__experimentalHStack,{spacing:10*f,justify:"center",style:{height:"100%",overflow:"hidden"},children:[(0,Qt.jsx)(Di,{fontSize:65*f,variation:o}),(0,Qt.jsx)(Dr.__experimentalVStack,{spacing:4*f,children:(0,Qt.jsx)(Bh,{normalizedColorSwatchSize:32,ratio:f})})]})},m),({key:f})=>(0,Qt.jsx)(Dr.__unstableMotion.div,{variants:r?Nw:void 0,style:{height:"100%",width:"100%",position:"absolute",top:0,overflow:"hidden",filter:"blur(60px)",opacity:.1},children:(0,Qt.jsx)(Dr.__experimentalHStack,{spacing:0,justify:"flex-start",style:{height:"100%",overflow:"hidden"},children:c.slice(0,4).map(({color:m},g)=>(0,Qt.jsx)("div",{style:{height:"100%",background:m,flexGrow:1}},g))})},f),({ratio:f,key:m})=>(0,Qt.jsx)(Dr.__unstableMotion.div,{variants:Dw,style:{height:"100%",width:"100%",overflow:"hidden",position:"absolute",top:0},children:(0,Qt.jsx)(Dr.__experimentalVStack,{spacing:3*f,justify:"center",style:{height:"100%",overflow:"hidden",padding:10*f,boxSizing:"border-box"},children:e&&(0,Qt.jsx)("div",{style:{fontSize:40*f,fontFamily:i,color:l,fontWeight:a,lineHeight:"1em",textAlign:"center"},children:e})})},m)]})}var kc=Mw;var Hh=h(Y(),1);var Ac=h(Tn(),1),Ln=h(Ce(),1),Go=h(ce(),1),Ic=h(Jt(),1),wo=h(Te(),1),Mi=h(Vt(),1),Zh=h(Bo(),1);import{speak as Uw}from"@wordpress/a11y";var Uh=h(Tn(),1),Wh=h(Jt(),1),zw=h(ce(),1);var jw=h(Y(),1);function Hw(e,t){return e?.filter(r=>r.source==="block"||t.includes(r.name))||[]}function Fc(e){let t=(0,Wh.useSelect)(n=>{let{getBlockStyles:s}=n(Uh.store);return s(e)},[e]),[r]=Xe("variations",e),o=Object.keys(r??{});return Hw(t,o)}var Wo=h(ce(),1),Gh=h(Ce(),1);var Yh=h(Vt(),1);var qh=h(Y(),1),{StateControl:wI,StateControlBadges:xI}=Fe(Yh.privateApis);var Mr=h(Y(),1),{useHasDimensionsPanel:Ww,useHasTypographyPanel:Gw,useHasBorderPanel:Yw,useSettingsForBlockElement:qw,useHasColorPanel:Zw,useHasBackgroundPanel:Xw}=Fe(Mi.privateApis);function Kw(){let e=(0,Ic.useSelect)(n=>n(Ac.store).getBlockTypes(),[]),t=(n,s)=>{let{core:i,noncore:a}=n;return(s.name.startsWith("core/")?i:a).push(s),n},{core:r,noncore:o}=e.reduce(t,{core:[],noncore:[]});return[...r,...o]}function Jw(e){let[t]=Je("",e),r=qw(t,e),o=Gw(r),n=Zw(r),s=Xw(r),i=Yw(r),a=Ww(r),u=i||a,l=!!Fc(e)?.length;return o||n||s||u||l}function Qw({block:e}){return Jw(e.name)?(0,Mr.jsx)(Nr,{path:"/blocks/"+encodeURIComponent(e.name),children:(0,Mr.jsxs)(Go.__experimentalHStack,{justify:"flex-start",children:[(0,Mr.jsx)(Mi.BlockIcon,{icon:e.icon}),(0,Mr.jsx)(Go.FlexItem,{children:e.title})]})}):null}function $w({filterValue:e}){let t=Kw(),r=(0,Zh.useDebounce)(Uw,500),{isMatchingSearchTerm:o}=(0,Ic.useSelect)(Ac.store),n=e?t.filter(i=>o(i,e)):t,s=(0,wo.useRef)(null);return(0,wo.useEffect)(()=>{if(!e)return;let i=s.current?.childElementCount||0,a=(0,Ln.sprintf)((0,Ln._n)("%d result found.","%d results found.",i),i);r(a,"polite")},[e,r]),(0,Mr.jsx)("div",{ref:s,className:"global-styles-ui-block-types-item-list",role:"list",children:n.length===0?(0,Mr.jsx)(Go.__experimentalText,{align:"center",as:"p",children:(0,Ln.__)("No blocks found.")}):n.map(i=>(0,Mr.jsx)(Qw,{block:i},"menu-itemblock-"+i.name))})}var PI=(0,wo.memo)($w);var nx=h(Tn(),1),Qh=h(Vt(),1),Lc=h(Te(),1),sx=h(Jt(),1),ix=h(ar(),1),Nc=h(ce(),1),$h=h(Ce(),1);var ex=h(Vt(),1),Xh=h(Tn(),1),tx=h(ce(),1),rx=h(Te(),1);var ox=h(Y(),1),{getViewportBreakpoints:DI,getViewportBreakpointValueInPixels:MI}=Fe(Pn);var Kh=h(ce(),1),Jh=h(Y(),1);function lr({children:e,level:t=2}){return(0,Jh.jsx)(Kh.__experimentalHeading,{className:"global-styles-ui-subtitle",level:t,children:e})}var Dc=h(Y(),1);var{useHasDimensionsPanel:QI,useHasTypographyPanel:$I,useHasBorderPanel:eL,useSettingsForBlockElement:tL,useHasColorPanel:rL,useHasFiltersPanel:oL,useHasImageSettingsPanel:nL,useHasBackgroundPanel:sL,BackgroundPanel:iL,BorderPanel:aL,ColorPanel:lL,TypographyPanel:cL,DimensionsPanel:uL,FiltersPanel:fL,ImageSettingsPanel:dL,AdvancedPanel:pL}=Fe(Qh.privateApis);var b2=h(Ce(),1),w2=h(ce(),1),x2=h(Te(),1);var ax=h(ce(),1);var lx=h(Y(),1);var cx=h(Ce(),1),Vi=h(ce(),1);var eg=h(Y(),1);var ji=h(ce(),1);var tg=h(ce(),1);var Bi=h(Y(),1),ux=({variation:e,isFocused:t,withHoverView:r})=>(0,Bi.jsx)(In,{label:e.title,isFocused:t,withHoverView:r,children:({ratio:o,key:n})=>(0,Bi.jsx)(tg.__experimentalHStack,{spacing:10*o,justify:"center",style:{height:"100%",overflow:"hidden"},children:(0,Bi.jsx)(Di,{variation:e,fontSize:85*o})},n)}),rg=ux;var Yo=h(Te(),1),ng=h(Mc(),1),zi=h(Ce(),1);var xo=h(Y(),1);function Nn({variation:e,children:t,isPill:r=!1,properties:o,showTooltip:n=!1}){let[s,i]=(0,Yo.useState)(!1),{base:a,user:u,onChange:l}=(0,Yo.useContext)(Ot),c=(0,Yo.useMemo)(()=>{let S=jo(a,e);return o&&(S=Li(S,o)),{user:e,base:a,merged:S,onChange:()=>{}}},[e,a,o]),f=()=>l(e),m=S=>{S.keyCode===ng.ENTER&&(S.preventDefault(),f())},g=(0,Yo.useMemo)(()=>ms(u,e),[u,e]),d=e?.title;e?.description&&(d=(0,zi.sprintf)((0,zi._x)("%1$s (%2$s)","variation label"),e?.title,e?.description));let v=(0,xo.jsx)("div",{className:st("global-styles-ui-variations_item",{"is-active":g}),role:"button",onClick:f,onKeyDown:m,tabIndex:0,"aria-label":d,"aria-current":g,onFocus:()=>i(!0),onBlur:()=>i(!1),children:(0,xo.jsx)("div",{className:st("global-styles-ui-variations_item-preview",{"is-pill":r}),children:t(s)})});return(0,xo.jsx)(Ot.Provider,{value:c,children:n?(0,xo.jsxs)(En.Root,{children:[(0,xo.jsx)(En.Trigger,{render:v}),(0,xo.jsx)(En.Popup,{children:e?.title})]}):v})}var qo=h(Y(),1),sg=["typography"];function Hi({title:e,gap:t=2}){let r=Ni(sg);return r?.length<=1?null:(0,qo.jsxs)(ji.__experimentalVStack,{spacing:3,children:[e&&(0,qo.jsx)(lr,{level:3,children:e}),(0,qo.jsx)(ji.__experimentalGrid,{columns:3,gap:t,className:"global-styles-ui-style-variations-container",children:r.map((o,n)=>(0,qo.jsx)(Nn,{variation:o,properties:sg,showTooltip:!0,children:()=>(0,qo.jsx)(rg,{variation:o})},n))})]})}var y2=h(Ce(),1),Ts=h(ce(),1);var v2=h(Te(),1);var $r=h(Te(),1),Eo=h(Jt(),1),Ro=h(ar(),1),jc=h(Ce(),1);var Vc=h(ag(),1),lg=h(ar(),1),cg="/wp/v2/font-families";function ug(e){let{receiveEntityRecords:t}=e.dispatch(lg.store);t("postType","wp_font_family",[],void 0,!0)}async function fg(e,t){let o=await(0,Vc.default)({path:cg,method:"POST",body:e});return ug(t),{id:o.id,...o.font_family_settings,fontFace:[]}}async function dg(e,t,r){let o={path:`${cg}/${e}/font-faces`,method:"POST",body:t},n=await(0,Vc.default)(o);return ug(r),{id:n.id,...n.font_face_settings}}var hg=h(ce(),1);var dr=h(Ce(),1),Bc=["otf","ttf","woff","woff2"],pg={100:(0,dr._x)("Thin","font weight"),200:(0,dr._x)("Extra-light","font weight"),300:(0,dr._x)("Light","font weight"),400:(0,dr._x)("Normal","font weight"),500:(0,dr._x)("Medium","font weight"),600:(0,dr._x)("Semi-bold","font weight"),700:(0,dr._x)("Bold","font weight"),800:(0,dr._x)("Extra-bold","font weight"),900:(0,dr._x)("Black","font weight")},mg={normal:(0,dr._x)("Normal","font style"),italic:(0,dr._x)("Italic","font style")};var{File:gg}=window,{kebabCase:fx}=Fe(hg.privateApis);function So(e,t={}){return!e.name&&(e.fontFamily||e.slug)&&(e.name=e.fontFamily||e.slug),{...e,...t}}function dx(e){return typeof e!="string"?!1:e!==decodeURIComponent(e)}function Ui(e){let t=pg[e.fontWeight??""]||e.fontWeight,r=e.fontStyle==="normal"?"":mg[e.fontStyle??""]||e.fontStyle;return`${t} ${r}`}function px(e=[],t=[]){let r=new Map;for(let o of e)r.set(`${o.fontWeight}${o.fontStyle}`,o);for(let o of t)r.set(`${o.fontWeight}${o.fontStyle}`,o);return Array.from(r.values())}function yg(e=[],t=[]){let r=new Map;for(let o of e)r.set(o.slug,{...o});for(let o of t)if(r.has(o.slug)){let{fontFace:n,...s}=o,i=r.get(o.slug),a=px(i.fontFace,n);r.set(o.slug,{...s,fontFace:a})}else r.set(o.slug,{...o});return Array.from(r.values())}async function Co(e,t,r="all"){let o;if(typeof t=="string")o=`url(${t})`;else if(t instanceof gg)o=await t.arrayBuffer();else return;let s=await new window.FontFace(Tc(e.fontFamily),o,{style:e.fontStyle,weight:String(e.fontWeight)}).load();if((r==="document"||r==="all")&&document.fonts.add(s),r==="iframe"||r==="all"){let i=document.querySelector('iframe[name="editor-canvas"]');i?.contentDocument&&i.contentDocument.fonts.add(s)}}function ws(e,t="all"){let r=o=>{o.forEach(n=>{n.family===Tc(e?.fontFamily)&&n.weight===e?.fontWeight&&n.style===e?.fontStyle&&o.delete(n)})};if((t==="document"||t==="all")&&r(document.fonts),t==="iframe"||t==="all"){let o=document.querySelector('iframe[name="editor-canvas"]');o?.contentDocument&&r(o.contentDocument.fonts)}}function Dn(e){if(!e)return;let t;if(Array.isArray(e)?t=e[0]:t=e,!t.startsWith("file:."))return dx(t)||(t=encodeURI(t)),t}function vg(e){let t=new FormData,{fontFace:r,category:o,...n}=e,s={...n,slug:fx(e.slug)};return t.append("font_family_settings",JSON.stringify(s)),t}function bg(e){return(e?.fontFace??[]).map((r,o)=>{let n={...r},s=new FormData;if(n.file){let i=Array.isArray(n.file)?n.file:[n.file],a=[];i.forEach((u,l)=>{let c=`file-${o}-${l}`;s.append(c,u,u.name),a.push(c)}),n.src=a.length===1?a[0]:a,delete n.file,s.append("font_face_settings",JSON.stringify(n))}else s.append("font_face_settings",JSON.stringify(n));return s})}async function wg(e,t,r){let o=[];for(let s of t)try{let i=await dg(e,s,r);o.push({status:"fulfilled",value:i})}catch(i){o.push({status:"rejected",reason:i})}let n={errors:[],successes:[]};return o.forEach((s,i)=>{if(s.status==="fulfilled"&&s.value){let a=s.value;n.successes.push(a)}else s.reason&&n.errors.push({data:t[i],message:s.reason.message})}),n}async function xg(e){e=Array.isArray(e)?e:[e];let t=await Promise.all(e.map(async r=>fetch(new Request(r)).then(o=>{if(!o.ok)throw new Error(`Error downloading font face asset from ${r}. Server responded with status: ${o.status}`);return o.blob()}).then(o=>{let n=r.split("/").pop();return new gg([o],n,{type:o.type})})));return t.length===1?t[0]:t}function zc(e,t){return t.findIndex(r=>r.fontWeight===e.fontWeight&&r.fontStyle===e.fontStyle)!==-1}function Sg(e,t,r){t=Array.isArray(t)?[...t]:[t],e=Array.isArray(e)?[...e]:{...e};let o=t.pop(),n=e;for(let s of t){let i=n[s];n=n[s]=Array.isArray(i)?[...i]:{...i}}return n[o]=r,e}function Wi(e,t,r=[]){let o=u=>u.slug===e.slug,n=u=>u.find(o),s=u=>u?r.filter(l=>!o(l)):[...r,e],i=u=>{let l=f=>f.fontWeight===t.fontWeight&&f.fontStyle===t.fontStyle;if(!u)return[...r,{...e,fontFace:[t]}];let c=u.fontFace||[];return c.find(l)?c=c.filter(f=>!l(f)):c=[...c,t],c.length===0?r.filter(f=>!o(f)):r.map(f=>o(f)?{...f,fontFace:c}:f)},a=n(r);return t?i(a):s(a)}var Cg=h(Y(),1),Bt=(0,$r.createContext)({});Bt.displayName="FontLibraryContext";function mx({children:e}){let t=(0,Eo.useRegistry)(),{saveEntityRecord:r,deleteEntityRecord:o}=(0,Eo.useDispatch)(Ro.store),{globalStylesId:n}=(0,Eo.useSelect)(E=>{let{__experimentalGetCurrentGlobalStylesId:L}=E(Ro.store);return{globalStylesId:L()}},[]),s=(0,Ro.useEntityRecord)("root","globalStyles",n),[i,a]=(0,$r.useState)(!1),{records:u=[],isResolving:l}=(0,Ro.useEntityRecords)("postType","wp_font_family",{_embed:!0}),c=(u||[]).map(E=>({id:E.id,...E.font_family_settings||{},fontFace:E?._embedded?.font_faces?.map(L=>L.font_face_settings)||[]}))||[],[f,m]=Je("typography.fontFamilies"),g=async E=>{if(!s.record)return;let L=s.record,$=Sg(L??{},["settings","typography","fontFamilies"],E);await r("root","globalStyles",$)},[d,v]=(0,$r.useState)(""),[S,C]=(0,$r.useState)(void 0),w=f?.theme?f.theme.map(E=>So(E,{source:"theme"})).sort((E,L)=>E.name.localeCompare(L.name)):[],b=f?.custom?f.custom.map(E=>So(E,{source:"custom"})).sort((E,L)=>E.name.localeCompare(L.name)):[],R=c?c.map(E=>So(E,{source:"custom"})).sort((E,L)=>E.name.localeCompare(L.name)):[];(0,$r.useEffect)(()=>{d||C(void 0)},[d]);let k=E=>{if(!E){C(void 0);return}let $=(E.source==="theme"?w:R).find(F=>F.slug===E.slug);C({...$||E,source:E.source})},[T]=(0,$r.useState)(new Set),_=E=>E.reduce(($,F)=>{let Z=F?.fontFace&&F.fontFace?.length>0?F?.fontFace.map(se=>`${se.fontStyle??""}${se.fontWeight??""}`):["normal400"];return $[F.slug]=Z,$},{}),A=E=>_(E==="theme"?w:b),N=(E,L,$,F)=>!L&&!$?!!A(F)[E]:!!A(F)[E]?.includes((L??"")+($??"")),q=(E,L)=>A(L)[E]||[];async function U(E){a(!0);try{let L=[],$=[];for(let Z of E){let se=!1,xe=await(0,Eo.resolveSelect)(Ro.store).getEntityRecords("postType","wp_font_family",{slug:Z.slug,per_page:1,_embed:!0}),ie=xe&&xe.length>0?xe[0]:null,ye=ie?{id:ie.id,...ie.font_family_settings,fontFace:(ie?._embedded?.font_faces??[]).map(Ie=>Ie.font_face_settings)||[]}:null;ye||(se=!0,ye=await fg(vg(Z),t));let Ee=ye.fontFace&&Z.fontFace?ye.fontFace.filter(Ie=>Ie&&Z.fontFace&&zc(Ie,Z.fontFace)):[];ye.fontFace&&Z.fontFace&&(Z.fontFace=Z.fontFace.filter(Ie=>!zc(Ie,ye.fontFace)));let ee=[],Ae=[];if(Z?.fontFace?.length??!1){let Ie=await wg(ye.id,bg(Z),t);ee=Ie?.successes,Ae=Ie?.errors}(ee?.length>0||Ee?.length>0)&&(ye.fontFace=[...ee],L.push(ye)),ye&&!Z?.fontFace?.length&&L.push(ye),se&&(Z?.fontFace?.length??0)>0&&ee?.length===0&&await o("postType","wp_font_family",ye.id,{force:!0}),$=$.concat(Ae)}let F=$.reduce((Z,se)=>Z.includes(se.message)?Z:[...Z,se.message],[]);if(L.length>0){let Z=W(L);await g(Z)}if(F.length>0){let Z=new Error((0,jc.__)("There was an error installing fonts."));throw Z.installationErrors=F,Z}}finally{a(!1)}}async function x(E){if(!E?.id)throw new Error((0,jc.__)("Font family to uninstall is not defined."));try{await o("postType","wp_font_family",E.id,{force:!0});let L=I(E);return await g(L),{deleted:!0}}catch(L){throw console.error("There was an error uninstalling the font family:",L),L}}let I=E=>{let $=(f?.[E.source??""]??[]).filter(Z=>Z.slug!==E.slug),F={...f,[E.source??""]:$};return m(F),E.fontFace&&E.fontFace.forEach(Z=>{ws(Z,"all")}),F},W=E=>{let L=O(E),$={...f,custom:yg(f?.custom,L)};return m($),D(L),$},O=E=>E.map(({id:L,fontFace:$,...F})=>({...F,...$&&$.length>0?{fontFace:$.map(({id:Z,...se})=>se)}:{}})),D=E=>{E.forEach(L=>{L.fontFace&&L.fontFace.forEach($=>{let F=Dn($?.src??"");F&&Co($,F,"all")})})},J=(E,L)=>{let $=f?.[E.source??""]??[],F=Wi(E,L,$);m({...f,[E.source??""]:F});let Z=N(E.slug,L?.fontStyle??"",L?.fontWeight??"",E.source??"custom");if(L&&Z)ws(L,"all");else{let se=Dn(L?.src??"");L&&se&&Co(L,se,"all")}},M=async E=>{if(!E.src)return;let L=Dn(E.src);!L||T.has(L)||(Co(E,L,"document"),T.add(L))};return(0,Cg.jsx)(Bt.Provider,{value:{libraryFontSelected:S,handleSetLibraryFontSelected:k,fontFamilies:f??{},baseCustomFonts:R,isFontActivated:N,getFontFacesActivated:q,loadFontFaceAsset:M,installFonts:U,uninstallFontFamily:x,toggleActivateFont:J,getAvailableFontsOutline:_,modalTabOpen:d,setModalTabOpen:v,saveFontFamilies:g,isResolvingLibrary:l,isInstalling:i},children:e})}var Gi=mx;var aa=h(Ce(),1),Yc=h(ce(),1),iy=h(ar(),1),h2=h(Jt(),1);var Le=h(ce(),1),Ss=h(ar(),1),Hc=h(Jt(),1),zr=h(Te(),1),it=h(Ce(),1);var Vn=h(Ce(),1),qi=h(Te(),1),pr=h(ce(),1);var Rg=h(ce(),1),Vr=h(Te(),1);var Yi=h(Y(),1);function hx(e){if(e.preview)return e.preview;if(e.src)return Array.isArray(e.src)?e.src[0]:e.src}function gx(e){return"fontStyle"in e&&e.fontStyle||"fontWeight"in e&&e.fontWeight?e:"fontFace"in e&&e.fontFace&&e.fontFace.length?e.fontFace.find(t=>t.fontStyle==="normal"&&t.fontWeight==="400")||e.fontFace[0]:{fontStyle:"normal",fontWeight:"400",fontFamily:e.fontFamily}}function yx({font:e,text:t}){let r=(0,Vr.useRef)(null),o=gx(e),n=Fn(e);t=t||("name"in e?e.name:"");let s=e.preview,[i,a]=(0,Vr.useState)(!1),[u,l]=(0,Vr.useState)(!1),{loadFontFaceAsset:c}=(0,Vr.useContext)(Bt),f=s??hx(o),m=f&&f.match(/\.(png|jpg|jpeg|gif|svg)$/i),g=Lh(o),d={fontSize:"18px",lineHeight:1,opacity:u?"1":"0",...n,...g};return(0,Vr.useEffect)(()=>{let v=new window.IntersectionObserver(([S])=>{a(S.isIntersecting)},{});return r.current&&v.observe(r.current),()=>v.disconnect()},[r]),(0,Vr.useEffect)(()=>{(async()=>i&&(!m&&o.src&&await c(o),l(!0)))()},[o,i,c,m]),(0,Yi.jsx)("div",{ref:r,children:m?(0,Yi.jsx)("img",{src:f,loading:"lazy",alt:t,className:"font-library__font-variant_demo-image"}):(0,Yi.jsx)(Rg.__experimentalText,{style:d,className:"font-library__font-variant_demo-text",children:t})})}var Mn=yx;var Br=h(Y(),1);function vx({font:e,onClick:t,variantsText:r,navigatorPath:o,shouldFocus:n}){let s=e.fontFace?.length||1,i={cursor:t?"pointer":"default"},a=(0,pr.useNavigator)(),u=(0,qi.useRef)(null);return(0,qi.useEffect)(()=>{n&&u.current?.focus()},[n]),(0,Br.jsx)(pr.Button,{ref:u,__next40pxDefaultSize:!0,onClick:()=>{t(),o&&a.goTo(o)},style:i,className:"font-library__font-card",children:(0,Br.jsxs)(pr.Flex,{justify:"space-between",wrap:!1,children:[(0,Br.jsx)(Mn,{font:e}),(0,Br.jsxs)(pr.Flex,{justify:"flex-end",children:[(0,Br.jsx)(pr.FlexItem,{children:(0,Br.jsx)(pr.__experimentalText,{className:"font-library__font-card__count",children:r||(0,Vn.sprintf)((0,Vn._n)("%d variant","%d variants",s),s)})}),(0,Br.jsx)(pr.FlexItem,{children:(0,Br.jsx)(cs,{icon:(0,Vn.isRTL)()?Mo:Vo})})]})]})})}var xs=vx;var Zi=h(Te(),1),Xi=h(ce(),1);var Zo=h(Y(),1);function bx({face:e,font:t}){let{isFontActivated:r,toggleActivateFont:o}=(0,Zi.useContext)(Bt),n=(t?.fontFace?.length??0)>0?r(t.slug,e.fontStyle,e.fontWeight,t.source):r(t.slug,void 0,void 0,t.source),s=()=>{if((t?.fontFace?.length??0)>0){o(t,e);return}o(t)},i=t.name+" "+Ui(e),a=(0,Zi.useId)();return(0,Zo.jsx)("div",{className:"font-library__font-card",children:(0,Zo.jsxs)(Xi.Flex,{justify:"flex-start",align:"center",gap:"1rem",children:[(0,Zo.jsx)(Xi.CheckboxControl,{checked:n,onChange:s,id:a}),(0,Zo.jsx)("label",{htmlFor:a,children:(0,Zo.jsx)(Mn,{font:e,text:i,onClick:s})})]})})}var Eg=bx;function Tg(e){switch(e){case"normal":return 400;case"bold":return 700;case"bolder":return 500;case"lighter":return 300;default:return parseInt(e,10)}}function Ki(e){return e.sort((t,r)=>t.fontStyle==="normal"&&r.fontStyle!=="normal"?-1:r.fontStyle==="normal"&&t.fontStyle!=="normal"?1:t.fontStyle===r.fontStyle?Tg(t.fontWeight?.toString()??"normal")-Tg(r.fontWeight?.toString()??"normal"):!t.fontStyle||!r.fontStyle?t.fontStyle?-1:1:t.fontStyle.localeCompare(r.fontStyle))}var Re=h(Y(),1);function _g(e){if(!e)return"";let t={};for(let r of Object.keys(e).sort())t[r]=(e[r]??[]).map(o=>({slug:o.slug,fontFace:(o.fontFace??[]).map(n=>`${n.fontStyle}-${n.fontWeight}`).sort()})).sort((o,n)=>o.slug.localeCompare(n.slug));return JSON.stringify(t)}function wx(){let{baseCustomFonts:e,libraryFontSelected:t,handleSetLibraryFontSelected:r,uninstallFontFamily:o,isResolvingLibrary:n,isInstalling:s,saveFontFamilies:i,getFontFacesActivated:a}=(0,zr.useContext)(Bt),[u,l]=Je("typography.fontFamilies"),[c,f]=(0,zr.useState)(void 0),[m,g]=(0,zr.useState)(!1),[d,v]=(0,zr.useState)(null),[S]=Je("typography.fontFamilies",void 0,"base"),C=(0,Hc.useSelect)(F=>{let{__experimentalGetCurrentGlobalStylesId:Z}=F(Ss.store);return Z()},[]),w=(0,Ss.useEntityRecord)("root","globalStyles",C),b=w?.edits?.settings?.typography?.fontFamilies,R=w?.record?.settings?.typography?.fontFamilies,k=(0,zr.useMemo)(()=>b===void 0?!1:_g(b)!==_g(R),[b,R]),T=u?.theme?u.theme.map(F=>So(F,{source:"theme"})).sort((F,Z)=>F.name.localeCompare(Z.name)):[],_=new Set(T.map(F=>F.slug)),A=S?.theme?T.concat(S.theme.filter(F=>!_.has(F.slug)).map(F=>So(F,{source:"theme"})).sort((F,Z)=>F.name.localeCompare(Z.name))):[],N=t?.source==="custom"&&t?.id,q=(0,Hc.useSelect)(F=>{let{canUser:Z}=F(Ss.store);return N&&Z("delete",{kind:"postType",name:"wp_font_family",id:N})},[N]),U=!!t&&t?.source!=="theme"&&q,x=()=>{g(!0)},I=async()=>{v(null);try{await i(u),v({type:"success",message:(0,it.__)("Font family updated successfully.")})}catch(F){v({type:"error",message:(0,it.sprintf)((0,it.__)("There was an error updating the font family. %s"),F.message)})}},W=F=>F?!F.fontFace||!F.fontFace.length?[{fontFamily:F.fontFamily,fontStyle:"normal",fontWeight:"400"}]:Ki(F.fontFace):[],O=F=>{let Z=F?.fontFace&&(F?.fontFace?.length??0)>0?F.fontFace.length:1,se=a(F.slug,F.source).length;return(0,it.sprintf)((0,it.__)("%1$d of %2$d active"),se,Z)};(0,zr.useEffect)(()=>{r(t)},[]);let D=t?a(t.slug,t.source).length:0,J=t?.fontFace?.length??(t?.fontFamily?1:0),M=D>0&&D!==J,E=D===J,L=()=>{if(!t||!t?.source)return;let F=u?.[t.source]?.filter(se=>se.slug!==t.slug)??[],Z=E?F:[...F,t];l({...u,[t.source]:Z}),t.fontFace&&t.fontFace.forEach(se=>{if(E)ws(se,"all");else{let xe=Dn(se?.src??"");xe&&Co(se,xe,"all")}})},$=A.length>0||e.length>0;return(0,Re.jsxs)("div",{className:"font-library__tabpanel-layout",children:[n&&(0,Re.jsx)("div",{className:"font-library__loading",children:(0,Re.jsx)(Le.ProgressBar,{})}),!n&&(0,Re.jsxs)(Re.Fragment,{children:[(0,Re.jsxs)(Le.Navigator,{initialPath:t?"/fontFamily":"/",children:[(0,Re.jsx)(Le.Navigator.Screen,{path:"/",children:(0,Re.jsxs)(Le.__experimentalVStack,{spacing:"8",children:[d&&(0,Re.jsx)(Le.Notice,{status:d.type,onRemove:()=>v(null),children:d.message}),!$&&(0,Re.jsx)(Le.__experimentalText,{as:"p",children:(0,it.__)("No fonts installed.")}),A.length>0&&(0,Re.jsxs)(Le.__experimentalVStack,{children:[(0,Re.jsx)("h2",{className:"font-library__fonts-title",children:(0,it._x)("Theme","font source")}),(0,Re.jsx)("ul",{role:"list",className:"font-library__fonts-list",children:A.map(F=>(0,Re.jsx)("li",{className:"font-library__fonts-list-item",children:(0,Re.jsx)(xs,{font:F,navigatorPath:"/fontFamily",variantsText:O(F),shouldFocus:F.slug===c,onClick:()=>{v(null),r(F)}})},F.slug))})]}),e.length>0&&(0,Re.jsxs)(Le.__experimentalVStack,{children:[(0,Re.jsx)("h2",{className:"font-library__fonts-title",children:(0,it._x)("Custom","font source")}),(0,Re.jsx)("ul",{role:"list",className:"font-library__fonts-list",children:e.map(F=>(0,Re.jsx)("li",{className:"font-library__fonts-list-item",children:(0,Re.jsx)(xs,{font:F,navigatorPath:"/fontFamily",variantsText:O(F),shouldFocus:F.slug===c,onClick:()=>{v(null),r(F)}})},F.slug))})]})]})}),(0,Re.jsxs)(Le.Navigator.Screen,{path:"/fontFamily",children:[t&&(0,Re.jsx)(xx,{font:t,isOpen:m,setIsOpen:g,setNotice:v,uninstallFontFamily:o,handleSetLibraryFontSelected:r}),(0,Re.jsxs)(Le.Flex,{justify:"flex-start",children:[(0,Re.jsx)(Le.Navigator.BackButton,{icon:(0,it.isRTL)()?Vo:Mo,size:"small",onClick:()=>{f(t?.slug),r(void 0),v(null)},label:(0,it.__)("Back")}),(0,Re.jsx)(Le.__experimentalHeading,{level:2,size:13,className:"global-styles-ui-header",children:t?.name})]}),d&&(0,Re.jsxs)(Re.Fragment,{children:[(0,Re.jsx)(Le.__experimentalSpacer,{margin:1}),(0,Re.jsx)(Le.Notice,{status:d.type,onRemove:()=>v(null),children:d.message}),(0,Re.jsx)(Le.__experimentalSpacer,{margin:1})]}),(0,Re.jsx)(Le.__experimentalSpacer,{margin:4}),(0,Re.jsx)(Le.__experimentalText,{children:(0,it.__)("Choose font variants. Keep in mind that too many variants could make your site slower.")}),(0,Re.jsx)(Le.__experimentalSpacer,{margin:4}),(0,Re.jsxs)(Le.__experimentalVStack,{spacing:0,children:[(0,Re.jsx)(Le.CheckboxControl,{className:"font-library__select-all",label:(0,it.__)("Select all"),checked:E,onChange:L,indeterminate:M}),(0,Re.jsx)(Le.__experimentalSpacer,{margin:8}),(0,Re.jsx)("ul",{role:"list",className:"font-library__fonts-list",children:t&&W(t).map((F,Z)=>(0,Re.jsx)("li",{className:"font-library__fonts-list-item",children:(0,Re.jsx)(Eg,{font:t,face:F},`face${Z}`)},`face${Z}`))})]})]})]}),(0,Re.jsxs)(Le.__experimentalHStack,{justify:"flex-end",className:"font-library__footer",children:[s&&(0,Re.jsx)(Le.ProgressBar,{}),U&&(0,Re.jsx)(Le.Button,{__next40pxDefaultSize:!0,isDestructive:!0,variant:"tertiary",onClick:x,children:(0,it.__)("Delete")}),(0,Re.jsx)(Le.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:I,disabled:!k,accessibleWhenDisabled:!0,children:(0,it.__)("Update")})]})]})]})}function xx({font:e,isOpen:t,setIsOpen:r,setNotice:o,uninstallFontFamily:n,handleSetLibraryFontSelected:s}){let i=(0,Le.useNavigator)(),a=async()=>{o(null),r(!1);try{await n(e),i.goBack(),s(void 0),o({type:"success",message:(0,it.__)("Font family uninstalled successfully.")})}catch(l){o({type:"error",message:(0,it.__)("There was an error uninstalling the font family.")+l.message})}},u=()=>{r(!1)};return(0,Re.jsx)(Le.__experimentalConfirmDialog,{isOpen:t,cancelButtonText:(0,it.__)("Cancel"),confirmButtonText:(0,it.__)("Delete"),onCancel:u,onConfirm:a,size:"medium",children:e&&(0,it.sprintf)((0,it.__)('Are you sure you want to delete "%s" font and all its variants and assets?'),e.name)})}var Ji=wx;var wt=h(Te(),1),Se=h(ce(),1),Ng=h(Bo(),1),rt=h(Ce(),1);var Dg=h(ar(),1);function Og(e,t){let{category:r,search:o}=t,n=e||[];return r&&r!=="all"&&(n=n.filter(s=>s.categories&&s.categories.indexOf(r)!==-1)),o&&(n=n.filter(s=>s.font_family_settings&&s.font_family_settings.name.toLowerCase().includes(o.toLowerCase()))),n}function Pg(e){return e.reduce((t,r)=>({...t,[r.slug]:(r?.fontFace||[]).reduce((o,n)=>({...o,[`${n.fontStyle}-${n.fontWeight}`]:!0}),{})}),{})}function kg(e,t,r){return t?!!r[e]?.[`${t.fontStyle}-${t.fontWeight}`]:!!r[e]}var Cs=h(Ce(),1),zt=h(ce(),1),mr=h(Y(),1);function Sx(){let e=()=>{window.localStorage.setItem("wp-font-library-google-fonts-permission","true"),window.dispatchEvent(new Event("storage"))};return(0,mr.jsx)("div",{className:"font-library__google-fonts-confirm",children:(0,mr.jsx)(zt.Card,{children:(0,mr.jsxs)(zt.CardBody,{children:[(0,mr.jsx)(zt.__experimentalHeading,{level:2,children:(0,Cs.__)("Connect to Google Fonts")}),(0,mr.jsx)(zt.__experimentalSpacer,{margin:6}),(0,mr.jsx)(zt.__experimentalText,{as:"p",children:(0,Cs.__)("To install fonts from Google you must give permission to connect directly to Google servers. The fonts you install will be downloaded from Google and stored on your site. Your site will then use these locally-hosted fonts.")}),(0,mr.jsx)(zt.__experimentalSpacer,{margin:3}),(0,mr.jsx)(zt.__experimentalText,{as:"p",children:(0,Cs.__)("You can alternatively upload files directly on the Upload tab.")}),(0,mr.jsx)(zt.__experimentalSpacer,{margin:6}),(0,mr.jsx)(zt.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:e,children:(0,Cs.__)("Allow access to Google Fonts")})]})})})}var Fg=Sx;var Ag=h(Te(),1),Qi=h(ce(),1);var Xo=h(Y(),1);function Cx({face:e,font:t,handleToggleVariant:r,selected:o}){let n=()=>{if(t?.fontFace){r(t,e);return}r(t)},s=t.name+" "+Ui(e),i=(0,Ag.useId)();return(0,Xo.jsx)("div",{className:"font-library__font-card",children:(0,Xo.jsxs)(Qi.Flex,{justify:"flex-start",align:"center",gap:"1rem",children:[(0,Xo.jsx)(Qi.CheckboxControl,{checked:o,onChange:n,id:i}),(0,Xo.jsx)("label",{htmlFor:i,children:(0,Xo.jsx)(Mn,{font:e,text:s,onClick:n})})]})})}var Ig=Cx;var he=h(Y(),1),Rx={slug:"all",name:(0,rt._x)("All","font categories")},Lg="wp-font-library-google-fonts-permission",Ex=500;function Tx({slug:e}){let t=e==="google-fonts",r=()=>window.localStorage.getItem(Lg)==="true",[o,n]=(0,wt.useState)(null),[s,i]=(0,wt.useState)(void 0),[a,u]=(0,wt.useState)(null),[l,c]=(0,wt.useState)([]),[f,m]=(0,wt.useState)(1),[g,d]=(0,wt.useState)({}),[v,S]=(0,wt.useState)(t&&!r()),{installFonts:C,isInstalling:w}=(0,wt.useContext)(Bt),{record:b,isResolving:R}=(0,Dg.useEntityRecord)("root","fontCollection",e);(0,wt.useEffect)(()=>{let ee=()=>{S(t&&!r())};return ee(),window.addEventListener("storage",ee),()=>window.removeEventListener("storage",ee)},[e,t]);let k=()=>{window.localStorage.setItem(Lg,"false"),window.dispatchEvent(new Event("storage"))};(0,wt.useEffect)(()=>{n(null)},[e]),(0,wt.useEffect)(()=>{c([])},[o]);let T=(0,wt.useMemo)(()=>b?.font_families??[],[b]),_=b?.categories??[],A=[Rx,..._],N=(0,wt.useMemo)(()=>Og(T,g),[T,g]),q=Math.max(window.innerHeight,Ex),U=Math.floor((q-417)/61),x=Math.ceil(N.length/U),I=(f-1)*U,W=f*U,O=N.slice(I,W),D=ee=>{d({...g,category:ee}),m(1)},M=(0,Ng.debounce)(ee=>{d({...g,search:ee}),m(1)},300),E=(ee,Ae)=>{let Ie=Wi(ee,Ae,l);c(Ie)},L=Pg(l),$=()=>{c([])},F=l.length>0?l[0]?.fontFace?.length??0:0,Z=F>0&&F!==o?.fontFace?.length,se=F===o?.fontFace?.length,xe=()=>{let ee=[];!se&&o&&ee.push(o),c(ee)},ie=async()=>{u(null);let ee=l[0];try{ee?.fontFace&&await Promise.all(ee.fontFace.map(async Ae=>{Ae.src&&(Ae.file=await xg(Ae.src))}))}catch{u({type:"error",message:(0,rt.__)("Error installing the fonts, could not be downloaded.")});return}try{await C([ee]),u({type:"success",message:(0,rt.__)("Fonts were installed successfully.")})}catch(Ae){u({type:"error",message:Ae.message})}$()},ye=ee=>ee?!ee.fontFace||!ee.fontFace.length?[{fontFamily:ee.fontFamily,fontStyle:"normal",fontWeight:"400"}]:Ki(ee.fontFace):[];if(v)return(0,he.jsx)(Fg,{});let Ee=e==="google-fonts"&&!v&&!o;return(0,he.jsxs)("div",{className:"font-library__tabpanel-layout",children:[R&&(0,he.jsx)("div",{className:"font-library__loading",children:(0,he.jsx)(Se.ProgressBar,{})}),!R&&b&&(0,he.jsxs)(he.Fragment,{children:[(0,he.jsxs)(Se.Navigator,{initialPath:"/",className:"font-library__tabpanel-layout",children:[(0,he.jsxs)(Se.Navigator.Screen,{path:"/",children:[(0,he.jsxs)(Se.__experimentalHStack,{justify:"space-between",children:[(0,he.jsxs)(Se.__experimentalVStack,{children:[(0,he.jsx)(Se.__experimentalHeading,{level:2,size:13,children:b.name}),(0,he.jsx)(Se.__experimentalText,{children:b.description})]}),Ee&&(0,he.jsx)(Se.DropdownMenu,{icon:Dl,label:(0,rt.__)("Actions"),popoverProps:{position:"bottom left"},controls:[{title:(0,rt.__)("Revoke access to Google Fonts"),onClick:k}]})]}),(0,he.jsx)(Se.__experimentalSpacer,{margin:4}),(0,he.jsxs)(Se.__experimentalHStack,{spacing:4,justify:"space-between",children:[(0,he.jsx)(Se.SearchControl,{value:g.search,placeholder:(0,rt.__)("Font name\u2026"),label:(0,rt.__)("Search"),onChange:M,hideLabelFromVision:!1}),(0,he.jsx)(Se.SelectControl,{label:(0,rt.__)("Category"),value:g.category,onChange:D,children:A&&A.map(ee=>(0,he.jsx)("option",{value:ee.slug,children:ee.name},ee.slug))})]}),(0,he.jsx)(Se.__experimentalSpacer,{margin:4}),!!b?.font_families?.length&&!N.length&&(0,he.jsx)(Se.__experimentalText,{children:(0,rt.__)("No fonts found. Try with a different search term.")}),(0,he.jsx)("div",{className:"font-library__fonts-grid__main",children:(0,he.jsx)("ul",{role:"list",className:"font-library__fonts-list",children:O.map(ee=>(0,he.jsx)("li",{className:"font-library__fonts-list-item",children:(0,he.jsx)(xs,{font:ee.font_family_settings,navigatorPath:"/fontFamily",shouldFocus:ee.font_family_settings.slug===s,onClick:()=>{n(ee.font_family_settings)}})},ee.font_family_settings.slug))})})]}),(0,he.jsxs)(Se.Navigator.Screen,{path:"/fontFamily",children:[(0,he.jsxs)(Se.Flex,{justify:"flex-start",children:[(0,he.jsx)(Se.Navigator.BackButton,{icon:(0,rt.isRTL)()?Vo:Mo,size:"small",onClick:()=>{i(o?.slug),n(null),u(null)},label:(0,rt.__)("Back")}),(0,he.jsx)(Se.__experimentalHeading,{level:2,size:13,className:"global-styles-ui-header",children:o?.name})]}),a&&(0,he.jsxs)(he.Fragment,{children:[(0,he.jsx)(Se.__experimentalSpacer,{margin:1}),(0,he.jsx)(Se.Notice,{status:a.type,onRemove:()=>u(null),children:a.message}),(0,he.jsx)(Se.__experimentalSpacer,{margin:1})]}),(0,he.jsx)(Se.__experimentalSpacer,{margin:4}),(0,he.jsx)(Se.__experimentalText,{children:(0,rt.__)("Select font variants to install.")}),(0,he.jsx)(Se.__experimentalSpacer,{margin:4}),(0,he.jsx)(Se.CheckboxControl,{className:"font-library__select-all",label:(0,rt.__)("Select all"),checked:se,onChange:xe,indeterminate:Z}),(0,he.jsx)(Se.__experimentalVStack,{spacing:0,children:(0,he.jsx)("ul",{role:"list",className:"font-library__fonts-list",children:o&&ye(o).map((ee,Ae)=>(0,he.jsx)("li",{className:"font-library__fonts-list-item",children:(0,he.jsx)(Ig,{font:o,face:ee,handleToggleVariant:E,selected:kg(o.slug,o.fontFace?ee:null,L)})},`face${Ae}`))})}),(0,he.jsx)(Se.__experimentalSpacer,{margin:16})]})]}),o&&(0,he.jsx)(Se.Flex,{justify:"flex-end",className:"font-library__footer",children:(0,he.jsx)(Se.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:ie,isBusy:w,disabled:l.length===0||w,accessibleWhenDisabled:!0,children:(0,rt.__)("Install")})}),!o&&(0,he.jsxs)(Se.__experimentalHStack,{expanded:!1,className:"font-library__footer",justify:"end",spacing:6,children:[(0,he.jsx)(Se.__experimentalHStack,{justify:"flex-start",expanded:!1,spacing:1,className:"font-library__page-selection",children:(0,wt.createInterpolateElement)((0,rt.sprintf)((0,rt._x)("
Page
%1$s
of %2$d
","paging"),"",x),{div:(0,he.jsx)("div",{"aria-hidden":!0}),CurrentPage:(0,he.jsx)(Se.SelectControl,{"aria-label":(0,rt.__)("Current page"),value:f.toString(),options:[...Array(x)].map((ee,Ae)=>({label:(Ae+1).toString(),value:(Ae+1).toString()})),onChange:ee=>m(parseInt(ee)),size:"small",variant:"minimal"})})}),(0,he.jsxs)(Se.__experimentalHStack,{expanded:!1,spacing:1,children:[(0,he.jsx)(Se.Button,{onClick:()=>m(f-1),disabled:f===1,accessibleWhenDisabled:!0,label:(0,rt.__)("Previous page"),icon:(0,rt.isRTL)()?Ri:Ti,showTooltip:!0,size:"compact",tooltipPosition:"top"}),(0,he.jsx)(Se.Button,{onClick:()=>m(f+1),disabled:f===x,accessibleWhenDisabled:!0,label:(0,rt.__)("Next page"),icon:(0,rt.isRTL)()?Ti:Ri,showTooltip:!0,size:"compact",tooltipPosition:"top"})]})]})]})]})}var $i=Tx;var Bn=h(Ce(),1),It=h(ce(),1),Es=h(Te(),1);var ea=(e=>typeof Ut<"u"?Ut:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof Ut<"u"?Ut:t)[r]}):e)(function(e){if(typeof Ut<"u")return Ut.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),Mg=(function(){var e,t,r;return(function(){function o(n,s,i){function a(c,f){if(!s[c]){if(!n[c]){var m=typeof ea=="function"&&ea;if(!f&&m)return m(c,!0);if(u)return u(c,!0);var g=new Error("Cannot find module '"+c+"'");throw g.code="MODULE_NOT_FOUND",g}var d=s[c]={exports:{}};n[c][0].call(d.exports,function(v){var S=n[c][1][v];return a(S||v)},d,d.exports,o,n,s,i)}return s[c].exports}for(var u=typeof ea=="function"&&ea,l=0;l0},c.prototype.readMoreInput=function(){if(!(this.bit_end_pos_>256))if(this.eos_){if(this.bit_pos_>this.bit_end_pos_)throw new Error("Unexpected end of input "+this.bit_pos_+" "+this.bit_end_pos_)}else{var f=this.buf_ptr_,m=this.input_.read(this.buf_,f,i);if(m<0)throw new Error("Unexpected end of input");if(m=8;)this.val_>>>=8,this.val_|=this.buf_[this.pos_&u]<<24,++this.pos_,this.bit_pos_=this.bit_pos_-8>>>0,this.bit_end_pos_=this.bit_end_pos_-8>>>0},c.prototype.readBits=function(f){32-this.bit_pos_>>this.bit_pos_&l[f];return this.bit_pos_+=f,m},n.exports=c},{}],2:[function(o,n,s){var i=0,a=1,u=2,l=3;s.lookup=new Uint8Array([0,0,0,0,0,0,0,0,0,4,4,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,12,16,12,12,20,12,16,24,28,12,12,32,12,36,12,44,44,44,44,44,44,44,44,44,44,32,32,24,40,28,12,12,48,52,52,52,48,52,52,52,48,52,52,52,52,52,48,52,52,52,52,52,48,52,52,52,52,52,24,12,28,12,12,12,56,60,60,60,56,60,60,60,56,60,60,60,60,60,56,60,60,60,60,60,56,60,60,60,60,60,24,12,28,12,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,0,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,56,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,9,10,10,10,10,11,11,11,11,12,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,22,22,22,22,23,23,23,23,24,24,24,24,25,25,25,25,26,26,26,26,27,27,27,27,28,28,28,28,29,29,29,29,30,30,30,30,31,31,31,31,32,32,32,32,33,33,33,33,34,34,34,34,35,35,35,35,36,36,36,36,37,37,37,37,38,38,38,38,39,39,39,39,40,40,40,40,41,41,41,41,42,42,42,42,43,43,43,43,44,44,44,44,45,45,45,45,46,46,46,46,47,47,47,47,48,48,48,48,49,49,49,49,50,50,50,50,51,51,51,51,52,52,52,52,53,53,53,53,54,54,54,54,55,55,55,55,56,56,56,56,57,57,57,57,58,58,58,58,59,59,59,59,60,60,60,60,61,61,61,61,62,62,62,62,63,63,63,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),s.lookupOffsets=new Uint16Array([1024,1536,1280,1536,0,256,768,512])},{}],3:[function(o,n,s){var i=o("./streams").BrotliInput,a=o("./streams").BrotliOutput,u=o("./bit_reader"),l=o("./dictionary"),c=o("./huffman").HuffmanCode,f=o("./huffman").BrotliBuildHuffmanTable,m=o("./context"),g=o("./prefix"),d=o("./transform"),v=8,S=16,C=256,w=704,b=26,R=6,k=2,T=8,_=255,A=1080,N=18,q=new Uint8Array([1,2,3,4,0,5,17,6,16,7,8,9,10,11,12,13,14,15]),U=16,x=new Uint8Array([3,2,1,0,3,3,3,3,3,3,2,2,2,2,2,2]),I=new Int8Array([0,0,0,0,-1,1,-2,2,-3,3,-1,1,-2,2,-3,3]),W=new Uint16Array([256,402,436,468,500,534,566,598,630,662,694,726,758,790,822,854,886,920,952,984,1016,1048,1080]);function O(G){var j;return G.readBits(1)===0?16:(j=G.readBits(3),j>0?17+j:(j=G.readBits(3),j>0?8+j:17))}function D(G){if(G.readBits(1)){var j=G.readBits(3);return j===0?1:G.readBits(j)+(1<1&&fe===0)throw new Error("Invalid size byte");j.meta_block_length|=fe<4&&ue===0)throw new Error("Invalid size nibble");j.meta_block_length|=ue<>>X.bit_pos_&_,K=G[j].bits-T,K>0&&(X.bit_pos_+=T,j+=G[j].value,j+=X.val_>>>X.bit_pos_&(1<0;){var re=0,De;if(H.readMoreInput(),H.fillBitWindow(),re+=H.val_>>>H.bit_pos_&31,H.bit_pos_+=me[re].bits,De=me[re].value&255,De>De);else{var Ue=De-14,ot,ut,je=0;if(De===S&&(je=fe),de!==je&&(ue=0,de=je),ot=ue,ue>0&&(ue-=2,ue<<=Ue),ue+=H.readBits(Ue)+3,ut=ue-ot,K+ut>j)throw new Error("[ReadHuffmanCodeLengths] symbol + repeat_delta > num_symbols");for(var We=0;We0;++de){var je=q[de],We=0,nt;H.fillBitWindow(),We+=H.val_>>>H.bit_pos_&15,H.bit_pos_+=ut[We].bits,nt=ut[We].value,De[je]=nt,nt!==0&&(Ue-=32>>nt,++ot)}if(!(ot===1||Ue===0))throw new Error("[ReadHuffmanCode] invalid num_codes or space");L(De,G,ue,H)}if(K=f(j,X,T,ue,G),K===0)throw new Error("[ReadHuffmanCode] BuildHuffmanTable failed: ");return K}function F(G,j,X){var H,K;return H=E(G,j,X),K=g.kBlockLengthPrefixCode[H].nbits,g.kBlockLengthPrefixCode[H].offset+X.readBits(K)}function Z(G,j,X){var H;return G>>5]),this.htrees=new Uint32Array(j)}ie.prototype.decode=function(G){var j,X,H=0;for(j=0;j=G)throw new Error("[DecodeContextMap] i >= context_map_size");pe[ue]=0,++ue}else pe[ue]=me-K,++ue}return j.readBits(1)&&xe(pe,G),X}function Ee(G,j,X,H,K,fe,ue){var de=X*2,pe=X,me=E(j,X*A,ue),V;me===0?V=K[de+(fe[pe]&1)]:me===1?V=K[de+(fe[pe]-1&1)]+1:V=me-2,V>=G&&(V-=G),H[X]=V,K[de+(fe[pe]&1)]=V,++fe[pe]}function ee(G,j,X,H,K,fe){var ue=K+1,de=X&K,pe=fe.pos_&u.IBUF_MASK,me;if(j<8||fe.bit_pos_+(j<<3)0;)fe.readMoreInput(),H[de++]=fe.readBits(8),de===ue&&(G.write(H,ue),de=0);return}if(fe.bit_end_pos_<32)throw new Error("[CopyUncompressedBlockToOutput] br.bit_end_pos_ < 32");for(;fe.bit_pos_<32;)H[de]=fe.val_>>>fe.bit_pos_,fe.bit_pos_+=8,++de,--j;if(me=fe.bit_end_pos_-fe.bit_pos_>>3,pe+me>u.IBUF_MASK){for(var V=u.IBUF_MASK+1-pe,re=0;re=ue){G.write(H,ue),de-=ue;for(var re=0;re=ue;){if(me=ue-de,fe.input_.read(H,de,me)j.buffer.length){var To=new Uint8Array(H+$e);To.set(j.buffer),j.buffer=To}if(K=Wr.input_end,Hr=Wr.is_uncompressed,Wr.is_metadata){for(Ae(ve);$e>0;--$e)ve.readMoreInput(),ve.readBits(8);continue}if($e!==0){if(Hr){ve.bit_pos_=ve.bit_pos_+7&-8,ee(j,$e,H,V,me,ve),H+=$e;continue}for(X=0;X<3;++X)qe[X]=D(ve)+1,qe[X]>=2&&($(qe[X]+2,We,X*A,ve),$(b,nt,X*A,ve),Et[X]=F(nt,X*A,ve),Q[X]=1);for(ve.readMoreInput(),y=ve.readBits(2),oe=U+(ve.readBits(4)<0;){var dt,Nt,jt,$o,wa,Ht,rr,Gr,Wn,en,Gn;for(ve.readMoreInput(),Et[1]===0&&(Ee(qe[1],We,1,Ne,P,Q,ve),Et[1]=F(nt,A,ve),xt=je[1].htrees[Ne[1]]),--Et[1],dt=E(je[1].codes,xt,ve),Nt=dt>>6,Nt>=2?(Nt-=2,rr=-1):rr=0,jt=g.kInsertRangeLut[Nt]+(dt>>3&7),$o=g.kCopyRangeLut[Nt]+(dt&7),wa=g.kInsertLengthPrefixCode[jt].offset+ve.readBits(g.kInsertLengthPrefixCode[jt].nbits),Ht=g.kCopyLengthPrefixCode[$o].offset+ve.readBits(g.kCopyLengthPrefixCode[$o].nbits),ot=V[H-1&me],ut=V[H-2&me],en=0;en4?3:Ht-2)&255,et=B[tr+Wn],rr=E(je[2].codes,je[2].htrees[et],ve),rr>=oe){var xa,Cu,Yn;rr-=oe,Cu=rr&Be,rr>>=y,xa=(rr>>1)+1,Yn=(2+(rr&1)<de)if(Ht>=l.minDictionaryWordLength&&Ht<=l.maxDictionaryWordLength){var Yn=l.offsetsByLength[Ht],Ru=Gr-de-1,Eu=l.sizeBitsByLength[Ht],Qy=(1<>Eu;if(Yn+=$y*Ht,Tu=re){j.write(V,pe);for(var Fs=0;Fs0&&(De[Ue&3]=Gr,++Ue),Ht>$e)throw new Error("Invalid backward reference. pos: "+H+" distance: "+Gr+" len: "+Ht+" bytes left: "+$e);for(en=0;en>=1;return(f&g-1)+g}function l(f,m,g,d,v){do d-=g,f[m+d]=new i(v.bits,v.value);while(d>0)}function c(f,m,g){for(var d=1<0;--x[w])C=new i(w&255,U[b++]&65535),l(f,m+R,k,N,C),R=u(R,w);for(_=q-1,T=-1,w=g+1,k=2;w<=a;++w,k<<=1)for(;x[w]>0;--x[w])(R&_)!==T&&(m+=N,A=c(x,w,g),N=1<>g),k,N,C),R=u(R,w);return q}},{}],8:[function(o,n,s){"use strict";s.byteLength=g,s.toByteArray=v,s.fromByteArray=w;for(var i=[],a=[],u=typeof Uint8Array<"u"?Uint8Array:Array,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=0,f=l.length;c0)throw new Error("Invalid string. Length must be a multiple of 4");var k=b.indexOf("=");k===-1&&(k=R);var T=k===R?0:4-k%4;return[k,T]}function g(b){var R=m(b),k=R[0],T=R[1];return(k+T)*3/4-T}function d(b,R,k){return(R+k)*3/4-k}function v(b){for(var R,k=m(b),T=k[0],_=k[1],A=new u(d(b,T,_)),N=0,q=_>0?T-4:T,U=0;U>16&255,A[N++]=R>>8&255,A[N++]=R&255;return _===2&&(R=a[b.charCodeAt(U)]<<2|a[b.charCodeAt(U+1)]>>4,A[N++]=R&255),_===1&&(R=a[b.charCodeAt(U)]<<10|a[b.charCodeAt(U+1)]<<4|a[b.charCodeAt(U+2)]>>2,A[N++]=R>>8&255,A[N++]=R&255),A}function S(b){return i[b>>18&63]+i[b>>12&63]+i[b>>6&63]+i[b&63]}function C(b,R,k){for(var T,_=[],A=R;Aq?q:N+A));return T===1?(R=b[k-1],_.push(i[R>>2]+i[R<<4&63]+"==")):T===2&&(R=(b[k-2]<<8)+b[k-1],_.push(i[R>>10]+i[R>>4&63]+i[R<<2&63]+"=")),_.join("")}},{}],9:[function(o,n,s){function i(a,u){this.offset=a,this.nbits=u}s.kBlockLengthPrefixCode=[new i(1,2),new i(5,2),new i(9,2),new i(13,2),new i(17,3),new i(25,3),new i(33,3),new i(41,3),new i(49,4),new i(65,4),new i(81,4),new i(97,4),new i(113,5),new i(145,5),new i(177,5),new i(209,5),new i(241,6),new i(305,6),new i(369,7),new i(497,8),new i(753,9),new i(1265,10),new i(2289,11),new i(4337,12),new i(8433,13),new i(16625,24)],s.kInsertLengthPrefixCode=[new i(0,0),new i(1,0),new i(2,0),new i(3,0),new i(4,0),new i(5,0),new i(6,1),new i(8,1),new i(10,2),new i(14,2),new i(18,3),new i(26,3),new i(34,4),new i(50,4),new i(66,5),new i(98,5),new i(130,6),new i(194,7),new i(322,8),new i(578,9),new i(1090,10),new i(2114,12),new i(6210,14),new i(22594,24)],s.kCopyLengthPrefixCode=[new i(2,0),new i(3,0),new i(4,0),new i(5,0),new i(6,0),new i(7,0),new i(8,0),new i(9,0),new i(10,1),new i(12,1),new i(14,2),new i(18,2),new i(22,3),new i(30,3),new i(38,4),new i(54,4),new i(70,5),new i(102,5),new i(134,6),new i(198,7),new i(326,8),new i(582,9),new i(1094,10),new i(2118,24)],s.kInsertRangeLut=[0,0,8,8,0,16,8,16,16],s.kCopyRangeLut=[0,8,0,8,16,0,16,8,16]},{}],10:[function(o,n,s){function i(u){this.buffer=u,this.pos=0}i.prototype.read=function(u,l,c){this.pos+c>this.buffer.length&&(c=this.buffer.length-this.pos);for(var f=0;fthis.buffer.length)throw new Error("Output buffer is not large enough");return this.buffer.set(u.subarray(0,l),this.pos),this.pos+=l,l},s.BrotliOutput=a},{}],11:[function(o,n,s){var i=o("./dictionary"),a=0,u=1,l=2,c=3,f=4,m=5,g=6,d=7,v=8,S=9,C=10,w=11,b=12,R=13,k=14,T=15,_=16,A=17,N=18,q=19,U=20;function x(O,D,J){this.prefix=new Uint8Array(O.length),this.transform=D,this.suffix=new Uint8Array(J.length);for(var M=0;M'),new x("",a,` `),new x("",c,""),new x("",a,"]"),new x("",a," for "),new x("",k,""),new x("",l,""),new x("",a," a "),new x("",a," that "),new x(" ",C,""),new x("",a,". "),new x(".",a,""),new x(" ",a,", "),new x("",T,""),new x("",a," with "),new x("",a,"'"),new x("",a," from "),new x("",a," by "),new x("",_,""),new x("",A,""),new x(" the ",a,""),new x("",f,""),new x("",a,". The "),new x("",w,""),new x("",a," on "),new x("",a," as "),new x("",a," is "),new x("",d,""),new x("",u,"ing "),new x("",a,` `),new x("",a,":"),new x(" ",a,". "),new x("",a,"ed "),new x("",U,""),new x("",N,""),new x("",g,""),new x("",a,"("),new x("",C,", "),new x("",v,""),new x("",a," at "),new x("",a,"ly "),new x(" the ",a," of "),new x("",m,""),new x("",S,""),new x(" ",C,", "),new x("",C,'"'),new x(".",a,"("),new x("",w," "),new x("",C,'">'),new x("",a,'="'),new x(" ",a,"."),new x(".com/",a,""),new x(" the ",a," of the "),new x("",C,"'"),new x("",a,". This "),new x("",a,","),new x(".",a," "),new x("",C,"("),new x("",C,"."),new x("",a," not "),new x(" ",a,'="'),new x("",a,"er "),new x(" ",w," "),new x("",a,"al "),new x(" ",w,""),new x("",a,"='"),new x("",w,'"'),new x("",C,". "),new x(" ",a,"("),new x("",a,"ful "),new x(" ",C,". "),new x("",a,"ive "),new x("",a,"less "),new x("",w,"'"),new x("",a,"est "),new x(" ",C,"."),new x("",w,'">'),new x(" ",a,"='"),new x("",C,","),new x("",a,"ize "),new x("",w,"."),new x("\xC2\xA0",a,""),new x(" ",a,","),new x("",C,'="'),new x("",w,'="'),new x("",a,"ous "),new x("",w,", "),new x("",C,"='"),new x(" ",C,","),new x(" ",w,'="'),new x(" ",w,", "),new x("",w,","),new x("",w,"("),new x("",w,". "),new x(" ",w,"."),new x("",w,"='"),new x(" ",w,". "),new x(" ",C,'="'),new x(" ",w,"='"),new x(" ",C,"='")];s.kTransforms=I,s.kNumTransforms=I.length;function W(O,D){return O[D]<192?(O[D]>=97&&O[D]<=122&&(O[D]^=32),1):O[D]<224?(O[D+1]^=32,2):(O[D+2]^=5,3)}s.transformDictionaryWord=function(O,D,J,M,E){var L=I[E].prefix,$=I[E].suffix,F=I[E].transform,Z=FM&&(Z=M);for(var ye=0;ye0;){var Ee=W(O,ie);ie+=Ee,M-=Ee}for(var ee=0;ee<$.length;)O[D++]=$[ee++];return D-xe}},{"./dictionary":6}],12:[function(o,n,s){n.exports=o("./dec/decode").BrotliDecompressBuffer},{"./dec/decode":3}]},{},[12])(12)})();var ta=(e=>typeof Ut<"u"?Ut:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof Ut<"u"?Ut:t)[r]}):e)(function(e){if(typeof Ut<"u")return Ut.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),Vg=(function(){var e,t,r;return(function(){function o(n,s,i){function a(c,f){if(!s[c]){if(!n[c]){var m=typeof ta=="function"&&ta;if(!f&&m)return m(c,!0);if(u)return u(c,!0);var g=new Error("Cannot find module '"+c+"'");throw g.code="MODULE_NOT_FOUND",g}var d=s[c]={exports:{}};n[c][0].call(d.exports,function(v){var S=n[c][1][v];return a(S||v)},d,d.exports,o,n,s,i)}return s[c].exports}for(var u=typeof ta=="function"&&ta,l=0;l=252?6:c>=248?5:c>=240?4:c>=224?3:c>=192?2:1;l[254]=l[254]=1,s.string2buf=function(m){var g,d,v,S,C,w=m.length,b=0;for(S=0;S>>6,g[C++]=128|d&63):d<65536?(g[C++]=224|d>>>12,g[C++]=128|d>>>6&63,g[C++]=128|d&63):(g[C++]=240|d>>>18,g[C++]=128|d>>>12&63,g[C++]=128|d>>>6&63,g[C++]=128|d&63);return g};function f(m,g){if(g<65534&&(m.subarray&&u||!m.subarray&&a))return String.fromCharCode.apply(null,i.shrinkBuf(m,g));for(var d="",v=0;v4){b[v++]=65533,d+=C-1;continue}for(S&=C===2?31:C===3?15:7;C>1&&d1){b[v++]=65533;continue}S<65536?b[v++]=S:(S-=65536,b[v++]=55296|S>>10&1023,b[v++]=56320|S&1023)}return f(b,v)},s.utf8border=function(m,g){var d;for(g=g||m.length,g>m.length&&(g=m.length),d=g-1;d>=0&&(m[d]&192)===128;)d--;return d<0||d===0?g:d+l[m[d]]>g?d:g}},{"./common":1}],3:[function(o,n,s){"use strict";function i(a,u,l,c){for(var f=a&65535|0,m=a>>>16&65535|0,g=0;l!==0;){g=l>2e3?2e3:l,l-=g;do f=f+u[c++]|0,m=m+f|0;while(--g);f%=65521,m%=65521}return f|m<<16|0}n.exports=i},{}],4:[function(o,n,s){"use strict";n.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],5:[function(o,n,s){"use strict";function i(){for(var l,c=[],f=0;f<256;f++){l=f;for(var m=0;m<8;m++)l=l&1?3988292384^l>>>1:l>>>1;c[f]=l}return c}var a=i();function u(l,c,f,m){var g=a,d=m+f;l^=-1;for(var v=m;v>>8^g[(l^c[v])&255];return l^-1}n.exports=u},{}],6:[function(o,n,s){"use strict";function i(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}n.exports=i},{}],7:[function(o,n,s){"use strict";var i=30,a=12;n.exports=function(l,c){var f,m,g,d,v,S,C,w,b,R,k,T,_,A,N,q,U,x,I,W,O,D,J,M,E;f=l.state,m=l.next_in,M=l.input,g=m+(l.avail_in-5),d=l.next_out,E=l.output,v=d-(c-l.avail_out),S=d+(l.avail_out-257),C=f.dmax,w=f.wsize,b=f.whave,R=f.wnext,k=f.window,T=f.hold,_=f.bits,A=f.lencode,N=f.distcode,q=(1<>>24,T>>>=I,_-=I,I=x>>>16&255,I===0)E[d++]=x&65535;else if(I&16){W=x&65535,I&=15,I&&(_>>=I,_-=I),_<15&&(T+=M[m++]<<_,_+=8,T+=M[m++]<<_,_+=8),x=N[T&U];r:for(;;){if(I=x>>>24,T>>>=I,_-=I,I=x>>>16&255,I&16){if(O=x&65535,I&=15,_C){l.msg="invalid distance too far back",f.mode=i;break e}if(T>>>=I,_-=I,I=d-v,O>I){if(I=O-I,I>b&&f.sane){l.msg="invalid distance too far back",f.mode=i;break e}if(D=0,J=k,R===0){if(D+=w-I,I2;)E[d++]=J[D++],E[d++]=J[D++],E[d++]=J[D++],W-=3;W&&(E[d++]=J[D++],W>1&&(E[d++]=J[D++]))}else{D=d-O;do E[d++]=E[D++],E[d++]=E[D++],E[d++]=E[D++],W-=3;while(W>2);W&&(E[d++]=E[D++],W>1&&(E[d++]=E[D++]))}}else if((I&64)===0){x=N[(x&65535)+(T&(1<>3,m-=W,_-=W<<3,T&=(1<<_)-1,l.next_in=m,l.next_out=d,l.avail_in=m>>24&255)+(P>>>8&65280)+((P&65280)<<8)+((P&255)<<24)}function De(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Ue(P){var Q;return!P||!P.state?R:(Q=P.state,P.total_in=P.total_out=Q.total=0,P.msg="",Q.wrap&&(P.adler=Q.wrap&1),Q.mode=N,Q.last=0,Q.havedict=0,Q.dmax=32768,Q.head=null,Q.hold=0,Q.bits=0,Q.lencode=Q.lendyn=new i.Buf32(de),Q.distcode=Q.distdyn=new i.Buf32(pe),Q.sane=1,Q.back=-1,C)}function ot(P){var Q;return!P||!P.state?R:(Q=P.state,Q.wsize=0,Q.whave=0,Q.wnext=0,Ue(P))}function ut(P,Q){var y,oe;return!P||!P.state||(oe=P.state,Q<0?(y=0,Q=-Q):(y=(Q>>4)+1,Q<48&&(Q&=15)),Q&&(Q<8||Q>15))?R:(oe.window!==null&&oe.wbits!==Q&&(oe.window=null),oe.wrap=y,oe.wbits=Q,ot(P))}function je(P,Q){var y,oe;return P?(oe=new De,P.state=oe,oe.window=null,y=ut(P,Q),y!==C&&(P.state=null),y):R}function We(P){return je(P,V)}var nt=!0,ve,_r;function gr(P){if(nt){var Q;for(ve=new i.Buf32(512),_r=new i.Buf32(32),Q=0;Q<144;)P.lens[Q++]=8;for(;Q<256;)P.lens[Q++]=9;for(;Q<280;)P.lens[Q++]=7;for(;Q<288;)P.lens[Q++]=8;for(c(m,P.lens,0,288,ve,0,P.work,{bits:9}),Q=0;Q<32;)P.lens[Q++]=5;c(g,P.lens,0,32,_r,0,P.work,{bits:5}),nt=!1}P.lencode=ve,P.lenbits=9,P.distcode=_r,P.distbits=5}function $e(P,Q,y,oe){var Be,te=P.state;return te.window===null&&(te.wsize=1<=te.wsize?(i.arraySet(te.window,Q,y-te.wsize,te.wsize,0),te.wnext=0,te.whave=te.wsize):(Be=te.wsize-te.wnext,Be>oe&&(Be=oe),i.arraySet(te.window,Q,y-oe,Be,te.wnext),oe-=Be,oe?(i.arraySet(te.window,Q,y-oe,oe,0),te.wnext=oe,te.whave=te.wsize):(te.wnext+=Be,te.wnext===te.wsize&&(te.wnext=0),te.whave>>8&255,y.check=u(y.check,dt,2,0),B=0,z=0,y.mode=q;break}if(y.flags=0,y.head&&(y.head.done=!1),!(y.wrap&1)||(((B&255)<<8)+(B>>8))%31){P.msg="incorrect header check",y.mode=K;break}if((B&15)!==A){P.msg="unknown compression method",y.mode=K;break}if(B>>>=4,z-=4,at=(B&15)+8,y.wbits===0)y.wbits=at;else if(at>y.wbits){P.msg="invalid window size",y.mode=K;break}y.dmax=1<>8&1),y.flags&512&&(dt[0]=B&255,dt[1]=B>>>8&255,y.check=u(y.check,dt,2,0)),B=0,z=0,y.mode=U;case U:for(;z<32;){if(ne===0)break e;ne--,B+=oe[te++]<>>8&255,dt[2]=B>>>16&255,dt[3]=B>>>24&255,y.check=u(y.check,dt,4,0)),B=0,z=0,y.mode=x;case x:for(;z<16;){if(ne===0)break e;ne--,B+=oe[te++]<>8),y.flags&512&&(dt[0]=B&255,dt[1]=B>>>8&255,y.check=u(y.check,dt,2,0)),B=0,z=0,y.mode=I;case I:if(y.flags&1024){for(;z<16;){if(ne===0)break e;ne--,B+=oe[te++]<>>8&255,y.check=u(y.check,dt,2,0)),B=0,z=0}else y.head&&(y.head.extra=null);y.mode=W;case W:if(y.flags&1024&&(le=y.length,le>ne&&(le=ne),le&&(y.head&&(at=y.head.extra_len-y.length,y.head.extra||(y.head.extra=new Array(y.head.extra_len)),i.arraySet(y.head.extra,oe,te,le,at)),y.flags&512&&(y.check=u(y.check,oe,le,te)),ne-=le,te+=le,y.length-=le),y.length))break e;y.length=0,y.mode=O;case O:if(y.flags&2048){if(ne===0)break e;le=0;do at=oe[te+le++],y.head&&at&&y.length<65536&&(y.head.name+=String.fromCharCode(at));while(at&&le>9&1,y.head.done=!0),P.adler=y.check=0,y.mode=L;break;case M:for(;z<32;){if(ne===0)break e;ne--,B+=oe[te++]<>>=z&7,z-=z&7,y.mode=j;break}for(;z<3;){if(ne===0)break e;ne--,B+=oe[te++]<>>=1,z-=1,B&3){case 0:y.mode=F;break;case 1:if(gr(y),y.mode=Ee,Q===S){B>>>=2,z-=2;break e}break;case 2:y.mode=xe;break;case 3:P.msg="invalid block type",y.mode=K}B>>>=2,z-=2;break;case F:for(B>>>=z&7,z-=z&7;z<32;){if(ne===0)break e;ne--,B+=oe[te++]<>>16^65535)){P.msg="invalid stored block lengths",y.mode=K;break}if(y.length=B&65535,B=0,z=0,y.mode=Z,Q===S)break e;case Z:y.mode=se;case se:if(le=y.length,le){if(le>ne&&(le=ne),le>Qe&&(le=Qe),le===0)break e;i.arraySet(Be,oe,te,le,ht),ne-=le,te+=le,Qe-=le,ht+=le,y.length-=le;break}y.mode=L;break;case xe:for(;z<14;){if(ne===0)break e;ne--,B+=oe[te++]<>>=5,z-=5,y.ndist=(B&31)+1,B>>>=5,z-=5,y.ncode=(B&15)+4,B>>>=4,z-=4,y.nlen>286||y.ndist>30){P.msg="too many length or distance symbols",y.mode=K;break}y.have=0,y.mode=ie;case ie:for(;y.have>>=3,z-=3}for(;y.have<19;)y.lens[$o[y.have++]]=0;if(y.lencode=y.lendyn,y.lenbits=7,Nt={bits:y.lenbits},Lt=c(f,y.lens,0,19,y.lencode,0,y.work,Nt),y.lenbits=Nt.bits,Lt){P.msg="invalid code lengths set",y.mode=K;break}y.have=0,y.mode=ye;case ye:for(;y.have>>24,ft=et>>>16&255,gt=et&65535,!(Ve<=z);){if(ne===0)break e;ne--,B+=oe[te++]<>>=Ve,z-=Ve,y.lens[y.have++]=gt;else{if(gt===16){for(jt=Ve+2;z>>=Ve,z-=Ve,y.have===0){P.msg="invalid bit length repeat",y.mode=K;break}at=y.lens[y.have-1],le=3+(B&3),B>>>=2,z-=2}else if(gt===17){for(jt=Ve+3;z>>=Ve,z-=Ve,at=0,le=3+(B&7),B>>>=3,z-=3}else{for(jt=Ve+7;z>>=Ve,z-=Ve,at=0,le=11+(B&127),B>>>=7,z-=7}if(y.have+le>y.nlen+y.ndist){P.msg="invalid bit length repeat",y.mode=K;break}for(;le--;)y.lens[y.have++]=at}}if(y.mode===K)break;if(y.lens[256]===0){P.msg="invalid code -- missing end-of-block",y.mode=K;break}if(y.lenbits=9,Nt={bits:y.lenbits},Lt=c(m,y.lens,0,y.nlen,y.lencode,0,y.work,Nt),y.lenbits=Nt.bits,Lt){P.msg="invalid literal/lengths set",y.mode=K;break}if(y.distbits=6,y.distcode=y.distdyn,Nt={bits:y.distbits},Lt=c(g,y.lens,y.nlen,y.ndist,y.distcode,0,y.work,Nt),y.distbits=Nt.bits,Lt){P.msg="invalid distances set",y.mode=K;break}if(y.mode=Ee,Q===S)break e;case Ee:y.mode=ee;case ee:if(ne>=6&&Qe>=258){P.next_out=ht,P.avail_out=Qe,P.next_in=te,P.avail_in=ne,y.hold=B,y.bits=z,l(P,Ge),ht=P.next_out,Be=P.output,Qe=P.avail_out,te=P.next_in,oe=P.input,ne=P.avail_in,B=y.hold,z=y.bits,y.mode===L&&(y.back=-1);break}for(y.back=0;et=y.lencode[B&(1<>>24,ft=et>>>16&255,gt=et&65535,!(Ve<=z);){if(ne===0)break e;ne--,B+=oe[te++]<>xt)],Ve=et>>>24,ft=et>>>16&255,gt=et&65535,!(xt+Ve<=z);){if(ne===0)break e;ne--,B+=oe[te++]<>>=xt,z-=xt,y.back+=xt}if(B>>>=Ve,z-=Ve,y.back+=Ve,y.length=gt,ft===0){y.mode=G;break}if(ft&32){y.back=-1,y.mode=L;break}if(ft&64){P.msg="invalid literal/length code",y.mode=K;break}y.extra=ft&15,y.mode=Ae;case Ae:if(y.extra){for(jt=y.extra;z>>=y.extra,z-=y.extra,y.back+=y.extra}y.was=y.length,y.mode=Ie;case Ie:for(;et=y.distcode[B&(1<>>24,ft=et>>>16&255,gt=et&65535,!(Ve<=z);){if(ne===0)break e;ne--,B+=oe[te++]<>xt)],Ve=et>>>24,ft=et>>>16&255,gt=et&65535,!(xt+Ve<=z);){if(ne===0)break e;ne--,B+=oe[te++]<>>=xt,z-=xt,y.back+=xt}if(B>>>=Ve,z-=Ve,y.back+=Ve,ft&64){P.msg="invalid distance code",y.mode=K;break}y.offset=gt,y.extra=ft&15,y.mode=ke;case ke:if(y.extra){for(jt=y.extra;z>>=y.extra,z-=y.extra,y.back+=y.extra}if(y.offset>y.dmax){P.msg="invalid distance too far back",y.mode=K;break}y.mode=He;case He:if(Qe===0)break e;if(le=Ge-Qe,y.offset>le){if(le=y.offset-le,le>y.whave&&y.sane){P.msg="invalid distance too far back",y.mode=K;break}le>y.wnext?(le-=y.wnext,Ur=y.wsize-le):Ur=y.wnext-le,le>y.length&&(le=y.length),tr=y.window}else tr=Be,Ur=ht-y.offset,le=y.length;le>Qe&&(le=Qe),Qe-=le,y.length-=le;do Be[ht++]=tr[Ur++];while(--le);y.length===0&&(y.mode=ee);break;case G:if(Qe===0)break e;Be[ht++]=y.length,Qe--,y.mode=ee;break;case j:if(y.wrap){for(;z<32;){if(ne===0)break e;ne--,B|=oe[te++]<=1&&ee[W]===0;W--);if(O>W&&(O=W),W===0)return T[_++]=1<<24|64<<16|0,T[_++]=1<<24|64<<16|0,N.bits=1,0;for(I=1;I0&&(w===c||W!==1))return-1;for(Ae[1]=0,U=1;Uu||w===m&&E>l)return 1;for(;;){He=U-J,A[x]Ee?(G=Ie[ke+A[x]],j=ie[ye+A[x]]):(G=96,j=0),$=1<>J)+F]=He<<24|G<<16|j|0;while(F!==0);for($=1<>=1;if($!==0?(L&=$-1,L+=$):L=0,x++,--ee[U]===0){if(U===W)break;U=b[R+A[x]]}if(U>O&&(L&se)!==Z){for(J===0&&(J=O),xe+=I,D=U-J,M=1<u||w===m&&E>l)return 1;Z=L&se,T[Z]=O<<24|D<<16|xe-_|0}}return L!==0&&(T[xe+L]=U-J<<24|64<<16|0),N.bits=O,0}},{"../utils/common":1}],10:[function(o,n,s){"use strict";n.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],11:[function(o,n,s){"use strict";function i(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}n.exports=i},{}],"/lib/inflate.js":[function(o,n,s){"use strict";var i=o("./zlib/inflate"),a=o("./utils/common"),u=o("./utils/strings"),l=o("./zlib/constants"),c=o("./zlib/messages"),f=o("./zlib/zstream"),m=o("./zlib/gzheader"),g=Object.prototype.toString;function d(C){if(!(this instanceof d))return new d(C);this.options=a.assign({chunkSize:16384,windowBits:0,to:""},C||{});var w=this.options;w.raw&&w.windowBits>=0&&w.windowBits<16&&(w.windowBits=-w.windowBits,w.windowBits===0&&(w.windowBits=-15)),w.windowBits>=0&&w.windowBits<16&&!(C&&C.windowBits)&&(w.windowBits+=32),w.windowBits>15&&w.windowBits<48&&(w.windowBits&15)===0&&(w.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var b=i.inflateInit2(this.strm,w.windowBits);if(b!==l.Z_OK)throw new Error(c[b]);if(this.header=new m,i.inflateGetHeader(this.strm,this.header),w.dictionary&&(typeof w.dictionary=="string"?w.dictionary=u.string2buf(w.dictionary):g.call(w.dictionary)==="[object ArrayBuffer]"&&(w.dictionary=new Uint8Array(w.dictionary)),w.raw&&(b=i.inflateSetDictionary(this.strm,w.dictionary),b!==l.Z_OK)))throw new Error(c[b])}d.prototype.push=function(C,w){var b=this.strm,R=this.options.chunkSize,k=this.options.dictionary,T,_,A,N,q,U=!1;if(this.ended)return!1;_=w===~~w?w:w===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof C=="string"?b.input=u.binstring2buf(C):g.call(C)==="[object ArrayBuffer]"?b.input=new Uint8Array(C):b.input=C,b.next_in=0,b.avail_in=b.input.length;do{if(b.avail_out===0&&(b.output=new a.Buf8(R),b.next_out=0,b.avail_out=R),T=i.inflate(b,l.Z_NO_FLUSH),T===l.Z_NEED_DICT&&k&&(T=i.inflateSetDictionary(this.strm,k)),T===l.Z_BUF_ERROR&&U===!0&&(T=l.Z_OK,U=!1),T!==l.Z_STREAM_END&&T!==l.Z_OK)return this.onEnd(T),this.ended=!0,!1;b.next_out&&(b.avail_out===0||T===l.Z_STREAM_END||b.avail_in===0&&(_===l.Z_FINISH||_===l.Z_SYNC_FLUSH))&&(this.options.to==="string"?(A=u.utf8border(b.output,b.next_out),N=b.next_out-A,q=u.buf2string(b.output,A),b.next_out=N,b.avail_out=R-N,N&&a.arraySet(b.output,b.output,A,N,0),this.onData(q)):this.onData(a.shrinkBuf(b.output,b.next_out))),b.avail_in===0&&b.avail_out===0&&(U=!0)}while((b.avail_in>0||b.avail_out===0)&&T!==l.Z_STREAM_END);return T===l.Z_STREAM_END&&(_=l.Z_FINISH),_===l.Z_FINISH?(T=i.inflateEnd(this.strm),this.onEnd(T),this.ended=!0,T===l.Z_OK):(_===l.Z_SYNC_FLUSH&&(this.onEnd(l.Z_OK),b.avail_out=0),!0)},d.prototype.onData=function(C){this.chunks.push(C)},d.prototype.onEnd=function(C){C===l.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=a.flattenChunks(this.chunks)),this.chunks=[],this.err=C,this.msg=this.strm.msg};function v(C,w){var b=new d(w);if(b.push(C,!0),b.err)throw b.msg||c[b.err];return b.result}function S(C,w){return w=w||{},w.raw=!0,v(C,w)}s.Inflate=d,s.inflate=v,s.inflateRaw=S,s.ungzip=v},{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js")})();var zN=globalThis.fetch,ra=class{constructor(e,t={},r){this.type=e,this.detail=t,this.msg=r,Object.defineProperty(this,"__mayPropagate",{enumerable:!1,writable:!0}),this.__mayPropagate=!0}preventDefault(){}stopPropagation(){this.__mayPropagate=!1}valueOf(){return this}toString(){return this.msg?`[${this.type} event]: ${this.msg}`:`[${this.type} event]`}},_x=class{constructor(){this.listeners={}}addEventListener(e,t,r){let o=this.listeners[e]||[];r?o.unshift(t):o.push(t),this.listeners[e]=o}removeEventListener(e,t){let r=this.listeners[e]||[],o=r.findIndex(n=>n===t);o>-1&&(r.splice(o,1),this.listeners[e]=r)}dispatch(e){let t=this.listeners[e.type];if(t)for(let r=0,o=t.length;rString.fromCharCode(t)).join("")}var kx=class{constructor(e,t,r){this.name=(r||e.tag||"").trim(),this.length=e.length,this.start=e.offset,this.offset=0,this.data=t,["getInt8","getUint8","getInt16","getUint16","getInt32","getUint32","getBigInt64","getBigUint64"].forEach(o=>{let n=o.replace(/get(Big)?/,"").toLowerCase(),s=parseInt(o.replace(/[^\d]/g,""))/8;Object.defineProperty(this,n,{get:()=>this.getValue(o,s)})})}get currentPosition(){return this.start+this.offset}set currentPosition(e){this.start=e,this.offset=0}skip(e=0,t=8){this.offset+=e*t/8}getValue(e,t){let r=this.start+this.offset;this.offset+=t;try{return this.data[e](r)}catch(o){throw console.error("parser",e,t,this),console.error("parser",this.start,this.offset),o}}flags(e){if(e===8||e===16||e===32||e===64)return this[`uint${e}`].toString(2).padStart(e,0).split("").map(t=>t==="1");console.error("Error parsing flags: flag types can only be 1, 2, 4, or 8 bytes long"),console.trace()}get tag(){let e=this.uint32;return Px([e>>24&255,e>>16&255,e>>8&255,e&255])}get fixed(){let e=this.int16,t=Math.round(1e3*this.uint16/65356);return e+t/1e3}get legacyFixed(){let e=this.uint16,t=this.uint16.toString(16).padStart(4,0);return parseFloat(`${e}.${t}`)}get uint24(){return(this.uint8<<16)+(this.uint8<<8)+this.uint8}get uint128(){let e=0;for(let t=0;t<5;t++){let r=this.uint8;if(e=e*128+(r&127),r<128)break}return e}get longdatetime(){return new Date(Ox+1e3*parseInt(this.int64.toString()))}get fword(){return this.int16}get ufword(){return this.uint16}get Offset16(){return this.uint16}get Offset32(){return this.uint32}get F2DOT14(){let e=p.uint16,t=[0,1,-2,-1][e>>14],r=e&16383;return t+r/16384}verifyLength(){this.offset!=this.length&&console.error(`unexpected parsed table size (${this.offset}) for "${this.name}" (expected ${this.length})`)}readBytes(e=0,t=0,r=8,o=!1){if(e=e||this.length,e===0)return[];t&&(this.currentPosition=t);let n=`${o?"":"u"}int${r}`,s=[];for(;e--;)s.push(this[n]);return s}},ct=class{constructor(e){Object.defineProperty(this,"parser",{enumerable:!1,get:()=>e});let r=e.currentPosition;Object.defineProperty(this,"start",{enumerable:!1,get:()=>r})}load(e){Object.keys(e).forEach(t=>{let r=Object.getOwnPropertyDescriptor(e,t);r.get?this[t]=r.get.bind(this):r.value!==void 0&&(this[t]=r.value)}),this.parser.length&&this.parser.verifyLength()}},Pe=class extends ct{constructor(e,t,r){let{parser:o,start:n}=super(new kx(e,t,r));Object.defineProperty(this,"p",{enumerable:!1,get:()=>o}),Object.defineProperty(this,"tableStart",{enumerable:!1,get:()=>n})}};function ae(e,t,r){let o;Object.defineProperty(e,t,{get:()=>o||(o=r(),o),enumerable:!0})}var Fx=class extends Pe{constructor(e,t,r){let{p:o}=super({offset:0,length:12},t,"sfnt");this.version=o.uint32,this.numTables=o.uint16,this.searchRange=o.uint16,this.entrySelector=o.uint16,this.rangeShift=o.uint16,o.verifyLength(),this.directory=[...new Array(this.numTables)].map(n=>new Ax(o)),this.tables={},this.directory.forEach(n=>{let s=()=>r(this.tables,{tag:n.tag,offset:n.offset,length:n.length},t);ae(this.tables,n.tag.trim(),s)})}},Ax=class{constructor(e){this.tag=e.tag,this.checksum=e.uint32,this.offset=e.uint32,this.length=e.uint32}},Bg=Vg.inflate||void 0,zg=void 0,Ix=class extends Pe{constructor(e,t,r){let{p:o}=super({offset:0,length:44},t,"woff");this.signature=o.tag,this.flavor=o.uint32,this.length=o.uint32,this.numTables=o.uint16,o.uint16,this.totalSfntSize=o.uint32,this.majorVersion=o.uint16,this.minorVersion=o.uint16,this.metaOffset=o.uint32,this.metaLength=o.uint32,this.metaOrigLength=o.uint32,this.privOffset=o.uint32,this.privLength=o.uint32,o.verifyLength(),this.directory=[...new Array(this.numTables)].map(n=>new Lx(o)),Nx(this,t,r)}},Lx=class{constructor(e){this.tag=e.tag,this.offset=e.uint32,this.compLength=e.uint32,this.origLength=e.uint32,this.origChecksum=e.uint32}};function Nx(e,t,r){e.tables={},e.directory.forEach(o=>{ae(e.tables,o.tag.trim(),()=>{let n=0,s=t;if(o.compLength!==o.origLength){let i=t.buffer.slice(o.offset,o.offset+o.compLength),a;if(Bg)a=Bg(new Uint8Array(i));else if(zg)a=zg(new Uint8Array(i));else{let u="no brotli decoder available to decode WOFF2 font";throw font.onerror&&font.onerror(u),new Error(u)}s=new DataView(a.buffer)}else n=o.offset;return r(e.tables,{tag:o.tag,offset:n,length:o.origLength},s)})})}var jg=Mg,Hg=void 0,Dx=class extends Pe{constructor(e,t,r){let{p:o}=super({offset:0,length:48},t,"woff2");this.signature=o.tag,this.flavor=o.uint32,this.length=o.uint32,this.numTables=o.uint16,o.uint16,this.totalSfntSize=o.uint32,this.totalCompressedSize=o.uint32,this.majorVersion=o.uint16,this.minorVersion=o.uint16,this.metaOffset=o.uint32,this.metaLength=o.uint32,this.metaOrigLength=o.uint32,this.privOffset=o.uint32,this.privLength=o.uint32,o.verifyLength(),this.directory=[...new Array(this.numTables)].map(a=>new Mx(o));let n=o.currentPosition;this.directory[0].offset=0,this.directory.forEach((a,u)=>{let l=this.directory[u+1];l&&(l.offset=a.offset+(a.transformLength!==void 0?a.transformLength:a.origLength))});let s,i=t.buffer.slice(n);if(jg)s=jg(new Uint8Array(i));else if(Hg)s=new Uint8Array(Hg(i));else{let a="no brotli decoder available to decode WOFF2 font";throw e.onerror&&e.onerror(a),new Error(a)}Vx(this,s,r)}},Mx=class{constructor(e){this.flags=e.uint8;let t=this.tagNumber=this.flags&63;t===63?this.tag=e.tag:this.tag=Bx(t);let o=(this.transformVersion=(this.flags&192)>>6)!==0;(this.tag==="glyf"||this.tag==="loca")&&(o=this.transformVersion!==3),this.origLength=e.uint128,o&&(this.transformLength=e.uint128)}};function Vx(e,t,r){e.tables={},e.directory.forEach(o=>{ae(e.tables,o.tag.trim(),()=>{let n=o.offset,s=n+(o.transformLength?o.transformLength:o.origLength),i=new DataView(t.slice(n,s).buffer);try{return r(e.tables,{tag:o.tag,offset:0,length:o.origLength},i)}catch(a){console.error(a)}})})}function Bx(e){return["cmap","head","hhea","hmtx","maxp","name","OS/2","post","cvt ","fpgm","glyf","loca","prep","CFF ","VORG","EBDT","EBLC","gasp","hdmx","kern","LTSH","PCLT","VDMX","vhea","vmtx","BASE","GDEF","GPOS","GSUB","EBSC","JSTF","MATH","CBDT","CBLC","COLR","CPAL","SVG ","sbix","acnt","avar","bdat","bloc","bsln","cvar","fdsc","feat","fmtx","fvar","gvar","hsty","just","lcar","mort","morx","opbd","prop","trak","Zapf","Silf","Glat","Gloc","Feat","Sill"][e&63]}var Xg={},Kg=!1;Promise.all([Promise.resolve().then(function(){return pS}),Promise.resolve().then(function(){return hS}),Promise.resolve().then(function(){return yS}),Promise.resolve().then(function(){return wS}),Promise.resolve().then(function(){return SS}),Promise.resolve().then(function(){return _S}),Promise.resolve().then(function(){return PS}),Promise.resolve().then(function(){return FS}),Promise.resolve().then(function(){return jS}),Promise.resolve().then(function(){return QS}),Promise.resolve().then(function(){return BC}),Promise.resolve().then(function(){return jC}),Promise.resolve().then(function(){return GC}),Promise.resolve().then(function(){return XC}),Promise.resolve().then(function(){return JC}),Promise.resolve().then(function(){return $C}),Promise.resolve().then(function(){return rR}),Promise.resolve().then(function(){return nR}),Promise.resolve().then(function(){return iR}),Promise.resolve().then(function(){return lR}),Promise.resolve().then(function(){return uR}),Promise.resolve().then(function(){return dR}),Promise.resolve().then(function(){return hR}),Promise.resolve().then(function(){return vR}),Promise.resolve().then(function(){return bR}),Promise.resolve().then(function(){return xR}),Promise.resolve().then(function(){return CR}),Promise.resolve().then(function(){return ER}),Promise.resolve().then(function(){return _R}),Promise.resolve().then(function(){return kR}),Promise.resolve().then(function(){return DR}),Promise.resolve().then(function(){return zR}),Promise.resolve().then(function(){return UR}),Promise.resolve().then(function(){return qR}),Promise.resolve().then(function(){return XR}),Promise.resolve().then(function(){return JR}),Promise.resolve().then(function(){return e2}),Promise.resolve().then(function(){return r2}),Promise.resolve().then(function(){return a2}),Promise.resolve().then(function(){return c2}),Promise.resolve().then(function(){return d2})]).then(e=>{e.forEach(t=>{let r=Object.keys(t)[0];Xg[r]=t[r]}),Kg=!0});function zx(e,t,r){let o=t.tag.replace(/[^\w\d]/g,""),n=Xg[o];return n?new n(t,r,e):(console.warn(`lib-font has no definition for ${o}. The table was skipped.`),{})}function jx(){let e=0;function t(r,o){if(!Kg)return e>10?o(new Error("loading took too long")):(e++,setTimeout(()=>t(r),250));r(zx)}return new Promise((r,o)=>t(r))}function Hx(e,t){let r=e.lastIndexOf("."),o=(e.substring(r+1)||"").toLowerCase(),n={ttf:"truetype",otf:"opentype",woff:"woff",woff2:"woff2"}[o];if(n)return n;let s={eot:"The .eot format is not supported: it died in January 12, 2016, when Microsoft retired all versions of IE that didn't already support WOFF.",svg:"The .svg format is not supported: SVG fonts (not to be confused with OpenType with embedded SVG) were so bad we took the entire fonts chapter out of the SVG specification again.",fon:"The .fon format is not supported: this is an ancient Windows bitmap font format.",ttc:"Based on the current CSS specification, font collections are not (yet?) supported."}[o];if(s||(s=`${e} is not a known webfont format.`),t)throw new Error(s);console.warn(`Could not load font: ${s}`)}async function Ux(e,t,r={}){if(!globalThis.document)return;let o=Hx(t,r.errorOnStyle);if(!o)return;let n=document.createElement("style");n.className="injected-by-Font-js";let s=[];return r.styleRules&&(s=Object.entries(r.styleRules).map(([i,a])=>`${i}: ${a};`)),n.textContent=` @font-face { font-family: "${e}"; ${s.join(` `)} src: url("${t}") format("${o}"); }`,globalThis.document.head.appendChild(n),n}var Wx=[0,1,0,0],Gx=[79,84,84,79],Yx=[119,79,70,70],qx=[119,79,70,50];function oa(e,t){if(e.length===t.length){for(let r=0;r(globalThis.document&&!this.options.skipStyleSheet&&await Ux(this.name,e,this.options),this.loadFont(e)))()}async loadFont(e,t){fetch(e).then(r=>Xx(r)&&r.arrayBuffer()).then(r=>this.fromDataBuffer(r,t||e)).catch(r=>{let o=new ra("error",r,`Failed to load font at ${t||e}`);this.dispatch(o),this.onerror&&this.onerror(o)})}async fromDataBuffer(e,t){this.fontData=new DataView(e);let r=Zx(this.fontData);if(!r)throw new Error(`${t} is either an unsupported font format, or not a font at all.`);await this.parseBasicData(r);let o=new ra("load",{font:this});this.dispatch(o),this.onload&&this.onload(o)}async parseBasicData(e){return jx().then(t=>(e==="SFNT"&&(this.opentype=new Fx(this,this.fontData,t)),e==="WOFF"&&(this.opentype=new Ix(this,this.fontData,t)),e==="WOFF2"&&(this.opentype=new Dx(this,this.fontData,t)),this.opentype))}getGlyphId(e){return this.opentype.tables.cmap.getGlyphId(e)}reverse(e){return this.opentype.tables.cmap.reverse(e)}supports(e){return this.getGlyphId(e)!==0}supportsVariation(e){return this.opentype.tables.cmap.supportsVariation(e)!==!1}measureText(e,t=16){if(this.__unloaded)throw new Error("Cannot measure text: font was unloaded. Please reload before calling measureText()");let r=document.createElement("div");r.textContent=e,r.style.fontFamily=this.name,r.style.fontSize=`${t}px`,r.style.color="transparent",r.style.background="transparent",r.style.top="0",r.style.left="0",r.style.position="absolute",document.body.appendChild(r);let o=r.getBoundingClientRect();document.body.removeChild(r);let n=this.opentype.tables["OS/2"];return o.fontSize=t,o.ascender=n.sTypoAscender,o.descender=n.sTypoDescender,o}unload(){if(this.styleElement.parentNode){this.styleElement.parentNode.removeElement(this.styleElement);let e=new ra("unload",{font:this});this.dispatch(e),this.onunload&&this.onunload(e)}this._unloaded=!0}load(){if(this.__unloaded){delete this.__unloaded,document.head.appendChild(this.styleElement);let e=new ra("load",{font:this});this.dispatch(e),this.onload&&this.onload(e)}}};globalThis.Font=sa;var eo=class extends ct{constructor(e,t,r){super(e),this.plaformID=t,this.encodingID=r}},Kx=class extends eo{constructor(e,t,r){super(e,t,r),this.format=0,this.length=e.uint16,this.language=e.uint16,this.glyphIdArray=[...new Array(256)].map(o=>e.uint8)}supports(e){return e.charCodeAt&&(e=-1,console.warn("supports(character) not implemented for cmap subtable format 0. only supports(id) is implemented.")),0<=e&&e<=255}reverse(e){return console.warn("reverse not implemented for cmap subtable format 0"),{}}getSupportedCharCodes(){return[{start:1,end:256}]}},Jx=class extends eo{constructor(e,t,r){super(e,t,r),this.format=2,this.length=e.uint16,this.language=e.uint16,this.subHeaderKeys=[...new Array(256)].map(i=>e.uint16);let o=Math.max(...this.subHeaderKeys),n=e.currentPosition;ae(this,"subHeaders",()=>(e.currentPosition=n,[...new Array(o)].map(i=>new Qx(e))));let s=n+o*8;ae(this,"glyphIndexArray",()=>(e.currentPosition=s,[...new Array(o)].map(i=>e.uint16)))}supports(e){e.charCodeAt&&(e=-1,console.warn("supports(character) not implemented for cmap subtable format 2. only supports(id) is implemented."));let t=e&&255,r=e&&65280,o=this.subHeaders[r],n=this.subHeaders[o],s=n.firstCode,i=s+n.entryCount;return s<=t&&t<=i}reverse(e){return console.warn("reverse not implemented for cmap subtable format 2"),{}}getSupportedCharCodes(e=!1){return e?this.subHeaders.map(t=>({firstCode:t.firstCode,lastCode:t.lastCode})):this.subHeaders.map(t=>({start:t.firstCode,end:t.lastCode}))}},Qx=class{constructor(e){this.firstCode=e.uint16,this.entryCount=e.uint16,this.lastCode=this.first+this.entryCount,this.idDelta=e.int16,this.idRangeOffset=e.uint16}},$x=class extends eo{constructor(e,t,r){super(e,t,r),this.format=4,this.length=e.uint16,this.language=e.uint16,this.segCountX2=e.uint16,this.segCount=this.segCountX2/2,this.searchRange=e.uint16,this.entrySelector=e.uint16,this.rangeShift=e.uint16;let o=e.currentPosition;ae(this,"endCode",()=>e.readBytes(this.segCount,o,16));let n=o+2+this.segCountX2;ae(this,"startCode",()=>e.readBytes(this.segCount,n,16));let s=n+this.segCountX2;ae(this,"idDelta",()=>e.readBytes(this.segCount,s,16,!0));let i=s+this.segCountX2;ae(this,"idRangeOffset",()=>e.readBytes(this.segCount,i,16));let a=i+this.segCountX2,u=this.length-(a-this.tableStart);ae(this,"glyphIdArray",()=>e.readBytes(u,a,16)),ae(this,"segments",()=>this.buildSegments(i,a,e))}buildSegments(e,t,r){let o=(n,s)=>{let i=this.startCode[s],a=this.endCode[s],u=this.idDelta[s],l=this.idRangeOffset[s],c=e+2*s,f=[];if(l===0)for(let m=i+u,g=a+u;m<=g;m++)f.push(m);else for(let m=0,g=a-i;m<=g;m++)r.currentPosition=c+l+m*2,f.push(r.uint16);return{startCode:i,endCode:a,idDelta:u,idRangeOffset:l,glyphIDs:f}};return[...new Array(this.segCount)].map(o)}reverse(e){let t=this.segments.find(o=>o.glyphIDs.includes(e));if(!t)return{};let r=t.startCode+t.glyphIDs.indexOf(e);return{code:r,unicode:String.fromCodePoint(r)}}getGlyphId(e){if(e.charCodeAt&&(e=e.charCodeAt(0)),55296<=e&&e<=57343||(e&65534)===65534||(e&65535)===65535)return 0;let t=this.segments.find(r=>r.startCode<=e&&e<=r.endCode);return t?t.glyphIDs[e-t.startCode]:0}supports(e){return this.getGlyphId(e)!==0}getSupportedCharCodes(e=!1){return e?this.segments:this.segments.map(t=>({start:t.startCode,end:t.endCode}))}},eS=class extends eo{constructor(e,t,r){super(e,t,r),this.format=6,this.length=e.uint16,this.language=e.uint16,this.firstCode=e.uint16,this.entryCount=e.uint16,this.lastCode=this.firstCode+this.entryCount-1,ae(this,"glyphIdArray",()=>[...new Array(this.entryCount)].map(n=>e.uint16))}supports(e){if(e.charCodeAt&&(e=-1,console.warn("supports(character) not implemented for cmap subtable format 6. only supports(id) is implemented.")),ethis.firstCode+this.entryCount)return{};let t=e-this.firstCode;return{code:t,unicode:String.fromCodePoint(t)}}reverse(e){let t=this.glyphIdArray.indexOf(e);if(t>-1)return this.firstCode+t}getSupportedCharCodes(e=!1){return e?[{firstCode:this.firstCode,lastCode:this.lastCode}]:[{start:this.firstCode,end:this.lastCode}]}},tS=class extends eo{constructor(e,t,r){super(e,t,r),this.format=8,e.uint16,this.length=e.uint32,this.language=e.uint32,this.is32=[...new Array(8192)].map(n=>e.uint8),this.numGroups=e.uint32,ae(this,"groups",()=>[...new Array(this.numGroups)].map(n=>new rS(e)))}supports(e){return e.charCodeAt&&(e=-1,console.warn("supports(character) not implemented for cmap subtable format 8. only supports(id) is implemented.")),this.groups.findIndex(t=>t.startcharCode<=e&&e<=t.endcharCode)!==-1}reverse(e){return console.warn("reverse not implemented for cmap subtable format 8"),{}}getSupportedCharCodes(e=!1){return e?this.groups:this.groups.map(t=>({start:t.startcharCode,end:t.endcharCode}))}},rS=class{constructor(e){this.startcharCode=e.uint32,this.endcharCode=e.uint32,this.startGlyphID=e.uint32}},oS=class extends eo{constructor(e,t,r){super(e,t,r),this.format=10,e.uint16,this.length=e.uint32,this.language=e.uint32,this.startCharCode=e.uint32,this.numChars=e.uint32,this.endCharCode=this.startCharCode+this.numChars,ae(this,"glyphs",()=>[...new Array(this.numChars)].map(n=>e.uint16))}supports(e){return e.charCodeAt&&(e=-1,console.warn("supports(character) not implemented for cmap subtable format 10. only supports(id) is implemented.")),ethis.startCharCode+this.numChars?!1:e-this.startCharCode}reverse(e){return console.warn("reverse not implemented for cmap subtable format 10"),{}}getSupportedCharCodes(e=!1){return e?[{startCharCode:this.startCharCode,endCharCode:this.endCharCode}]:[{start:this.startCharCode,end:this.endCharCode}]}},nS=class extends eo{constructor(e,t,r){super(e,t,r),this.format=12,e.uint16,this.length=e.uint32,this.language=e.uint32,this.numGroups=e.uint32,ae(this,"groups",()=>[...new Array(this.numGroups)].map(n=>new sS(e)))}supports(e){return e.charCodeAt&&(e=e.charCodeAt(0)),55296<=e&&e<=57343||(e&65534)===65534||(e&65535)===65535?0:this.groups.findIndex(t=>t.startCharCode<=e&&e<=t.endCharCode)!==-1}reverse(e){for(let t of this.groups){let r=t.startGlyphID;if(r>e)continue;if(r===e)return t.startCharCode;if(r+(t.endCharCode-t.startCharCode)({start:t.startCharCode,end:t.endCharCode}))}},sS=class{constructor(e){this.startCharCode=e.uint32,this.endCharCode=e.uint32,this.startGlyphID=e.uint32}},iS=class extends eo{constructor(e,t,r){super(e,t,r),this.format=13,e.uint16,this.length=e.uint32,this.language=e.uint32,this.numGroups=e.uint32;let o=[...new Array(this.numGroups)].map(n=>new aS(e));ae(this,"groups",o)}supports(e){return e.charCodeAt&&(e=e.charCodeAt(0)),this.groups.findIndex(t=>t.startCharCode<=e&&e<=t.endCharCode)!==-1}reverse(e){return console.warn("reverse not implemented for cmap subtable format 13"),{}}getSupportedCharCodes(e=!1){return e?this.groups:this.groups.map(t=>({start:t.startCharCode,end:t.endCharCode}))}},aS=class{constructor(e){this.startCharCode=e.uint32,this.endCharCode=e.uint32,this.glyphID=e.uint32}},lS=class extends eo{constructor(e,t,r){super(e,t,r),this.subTableStart=e.currentPosition,this.format=14,this.length=e.uint32,this.numVarSelectorRecords=e.uint32,ae(this,"varSelectors",()=>[...new Array(this.numVarSelectorRecords)].map(o=>new cS(e)))}supports(){return console.warn("supports not implemented for cmap subtable format 14"),0}getSupportedCharCodes(){return console.warn("getSupportedCharCodes not implemented for cmap subtable format 14"),[]}reverse(e){return console.warn("reverse not implemented for cmap subtable format 14"),{}}supportsVariation(e){let t=this.varSelector.find(r=>r.varSelector===e);return t||!1}getSupportedVariations(){return this.varSelectors.map(e=>e.varSelector)}},cS=class{constructor(e){this.varSelector=e.uint24,this.defaultUVSOffset=e.Offset32,this.nonDefaultUVSOffset=e.Offset32}};function uS(e,t,r){let o=e.uint16;return o===0?new Kx(e,t,r):o===2?new Jx(e,t,r):o===4?new $x(e,t,r):o===6?new eS(e,t,r):o===8?new tS(e,t,r):o===10?new oS(e,t,r):o===12?new nS(e,t,r):o===13?new iS(e,t,r):o===14?new lS(e,t,r):{}}var fS=class extends Pe{constructor(e,t){let{p:r}=super(e,t);this.version=r.uint16,this.numTables=r.uint16,this.encodingRecords=[...new Array(this.numTables)].map(o=>new dS(r,this.tableStart))}getSubTable(e){return this.encodingRecords[e].table}getSupportedEncodings(){return this.encodingRecords.map(e=>({platformID:e.platformID,encodingId:e.encodingID}))}getSupportedCharCodes(e,t){let r=this.encodingRecords.findIndex(n=>n.platformID===e&&n.encodingID===t);return r===-1?!1:this.getSubTable(r).getSupportedCharCodes()}reverse(e){for(let t=0;t{let n=this.getSubTable(o);return n.getGlyphId?(t=n.getGlyphId(e),t!==0):!1}),t}supports(e){return this.encodingRecords.some((t,r)=>{let o=this.getSubTable(r);return o.supports&&o.supports(e)!==!1})}supportsVariation(e){return this.encodingRecords.some((t,r)=>{let o=this.getSubTable(r);return o.supportsVariation&&o.supportsVariation(e)!==!1})}},dS=class{constructor(e,t){let r=this.platformID=e.uint16,o=this.encodingID=e.uint16,n=this.offset=e.Offset32;ae(this,"table",()=>(e.currentPosition=t+n,uS(e,r,o)))}},pS=Object.freeze({__proto__:null,cmap:fS}),mS=class extends Pe{constructor(e,t){let{p:r}=super(e,t);this.load({majorVersion:r.uint16,minorVersion:r.uint16,fontRevision:r.fixed,checkSumAdjustment:r.uint32,magicNumber:r.uint32,flags:r.flags(16),unitsPerEm:r.uint16,created:r.longdatetime,modified:r.longdatetime,xMin:r.int16,yMin:r.int16,xMax:r.int16,yMax:r.int16,macStyle:r.flags(16),lowestRecPPEM:r.uint16,fontDirectionHint:r.uint16,indexToLocFormat:r.uint16,glyphDataFormat:r.uint16})}},hS=Object.freeze({__proto__:null,head:mS}),gS=class extends Pe{constructor(e,t){let{p:r}=super(e,t);this.majorVersion=r.uint16,this.minorVersion=r.uint16,this.ascender=r.fword,this.descender=r.fword,this.lineGap=r.fword,this.advanceWidthMax=r.ufword,this.minLeftSideBearing=r.fword,this.minRightSideBearing=r.fword,this.xMaxExtent=r.fword,this.caretSlopeRise=r.int16,this.caretSlopeRun=r.int16,this.caretOffset=r.int16,r.int16,r.int16,r.int16,r.int16,this.metricDataFormat=r.int16,this.numberOfHMetrics=r.uint16,r.verifyLength()}},yS=Object.freeze({__proto__:null,hhea:gS}),vS=class extends Pe{constructor(e,t,r){let{p:o}=super(e,t),n=r.hhea.numberOfHMetrics,s=r.maxp.numGlyphs,i=o.currentPosition;if(ae(this,"hMetrics",()=>(o.currentPosition=i,[...new Array(n)].map(a=>new bS(o.uint16,o.int16)))),n(o.currentPosition=a,[...new Array(s-n)].map(u=>o.int16)))}}},bS=class{constructor(e,t){this.advanceWidth=e,this.lsb=t}},wS=Object.freeze({__proto__:null,hmtx:vS}),xS=class extends Pe{constructor(e,t){let{p:r}=super(e,t);this.version=r.legacyFixed,this.numGlyphs=r.uint16,this.version===1&&(this.maxPoints=r.uint16,this.maxContours=r.uint16,this.maxCompositePoints=r.uint16,this.maxCompositeContours=r.uint16,this.maxZones=r.uint16,this.maxTwilightPoints=r.uint16,this.maxStorage=r.uint16,this.maxFunctionDefs=r.uint16,this.maxInstructionDefs=r.uint16,this.maxStackElements=r.uint16,this.maxSizeOfInstructions=r.uint16,this.maxComponentElements=r.uint16,this.maxComponentDepth=r.uint16),r.verifyLength()}},SS=Object.freeze({__proto__:null,maxp:xS}),CS=class extends Pe{constructor(e,t){let{p:r}=super(e,t);this.format=r.uint16,this.count=r.uint16,this.stringOffset=r.Offset16,this.nameRecords=[...new Array(this.count)].map(o=>new ES(r,this)),this.format===1&&(this.langTagCount=r.uint16,this.langTagRecords=[...new Array(this.langTagCount)].map(o=>new RS(r.uint16,r.Offset16))),this.stringStart=this.tableStart+this.stringOffset}get(e){let t=this.nameRecords.find(r=>r.nameID===e);if(t)return t.string}},RS=class{constructor(e,t){this.length=e,this.offset=t}},ES=class{constructor(e,t){this.platformID=e.uint16,this.encodingID=e.uint16,this.languageID=e.uint16,this.nameID=e.uint16,this.length=e.uint16,this.offset=e.Offset16,ae(this,"string",()=>(e.currentPosition=t.stringStart+this.offset,TS(e,this)))}};function TS(e,t){let{platformID:r,length:o}=t;if(o===0)return"";if(r===0||r===3){let i=[];for(let a=0,u=o/2;ar.uint8),this.ulUnicodeRange1=r.flags(32),this.ulUnicodeRange2=r.flags(32),this.ulUnicodeRange3=r.flags(32),this.ulUnicodeRange4=r.flags(32),this.achVendID=r.tag,this.fsSelection=r.uint16,this.usFirstCharIndex=r.uint16,this.usLastCharIndex=r.uint16,this.sTypoAscender=r.int16,this.sTypoDescender=r.int16,this.sTypoLineGap=r.int16,this.usWinAscent=r.uint16,this.usWinDescent=r.uint16,this.version===0||(this.ulCodePageRange1=r.flags(32),this.ulCodePageRange2=r.flags(32),this.version===1)||(this.sxHeight=r.int16,this.sCapHeight=r.int16,this.usDefaultChar=r.uint16,this.usBreakChar=r.uint16,this.usMaxContext=r.uint16,this.version<=4)||(this.usLowerOpticalPointSize=r.uint16,this.usUpperOpticalPointSize=r.uint16,this.version===5))return r.verifyLength()}},PS=Object.freeze({__proto__:null,OS2:OS}),kS=class extends Pe{constructor(e,t){let{p:r}=super(e,t);if(this.version=r.legacyFixed,this.italicAngle=r.fixed,this.underlinePosition=r.fword,this.underlineThickness=r.fword,this.isFixedPitch=r.uint32,this.minMemType42=r.uint32,this.maxMemType42=r.uint32,this.minMemType1=r.uint32,this.maxMemType1=r.uint32,this.version===1||this.version===3)return r.verifyLength();if(this.numGlyphs=r.uint16,this.version===2){this.glyphNameIndex=[...new Array(this.numGlyphs)].map(o=>r.uint16),this.namesOffset=r.currentPosition,this.glyphNameOffsets=[1];for(let o=0;or.int8))}getGlyphName(e){if(this.version!==2)return console.warn(`post table version ${this.version} does not support glyph name lookups`),"";let t=this.glyphNameIndex[e];if(t<258)return Ug[t];let r=this.glyphNameOffsets[e],n=this.glyphNameOffsets[e+1]-r-1;return n===0?".notdef.":(this.parser.currentPosition=this.namesOffset+r,this.parser.readBytes(n,this.namesOffset+r,8,!0).map(i=>String.fromCharCode(i)).join(""))}},Ug=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"],FS=Object.freeze({__proto__:null,post:kS}),AS=class extends Pe{constructor(e,t){let{p:r}=super(e,t);this.majorVersion=r.uint16,this.minorVersion=r.uint16,this.horizAxisOffset=r.Offset16,this.vertAxisOffset=r.Offset16,ae(this,"horizAxis",()=>new Uc({offset:e.offset+this.horizAxisOffset},t)),ae(this,"vertAxis",()=>new Uc({offset:e.offset+this.vertAxisOffset},t)),this.majorVersion===1&&this.minorVersion===1&&(this.itemVarStoreOffset=r.Offset32,ae(this,"itemVarStore",()=>new Uc({offset:e.offset+this.itemVarStoreOffset},t)))}},Uc=class extends Pe{constructor(e,t){let{p:r}=super(e,t,"AxisTable");this.baseTagListOffset=r.Offset16,this.baseScriptListOffset=r.Offset16,ae(this,"baseTagList",()=>new IS({offset:e.offset+this.baseTagListOffset},t)),ae(this,"baseScriptList",()=>new LS({offset:e.offset+this.baseScriptListOffset},t))}},IS=class extends Pe{constructor(e,t){let{p:r}=super(e,t,"BaseTagListTable");this.baseTagCount=r.uint16,this.baselineTags=[...new Array(this.baseTagCount)].map(o=>r.tag)}},LS=class extends Pe{constructor(e,t){let{p:r}=super(e,t,"BaseScriptListTable");this.baseScriptCount=r.uint16;let o=r.currentPosition;ae(this,"baseScriptRecords",()=>(r.currentPosition=o,[...new Array(this.baseScriptCount)].map(n=>new NS(this.start,r))))}},NS=class{constructor(e,t){this.baseScriptTag=t.tag,this.baseScriptOffset=t.Offset16,ae(this,"baseScriptTable",()=>(t.currentPosition=e+this.baseScriptOffset,new DS(t)))}},DS=class{constructor(e){this.start=e.currentPosition,this.baseValuesOffset=e.Offset16,this.defaultMinMaxOffset=e.Offset16,this.baseLangSysCount=e.uint16,this.baseLangSysRecords=[...new Array(this.baseLangSysCount)].map(t=>new MS(this.start,e)),ae(this,"baseValues",()=>(e.currentPosition=this.start+this.baseValuesOffset,new VS(e))),ae(this,"defaultMinMax",()=>(e.currentPosition=this.start+this.defaultMinMaxOffset,new Jg(e)))}},MS=class{constructor(e,t){this.baseLangSysTag=t.tag,this.minMaxOffset=t.Offset16,ae(this,"minMax",()=>(t.currentPosition=e+this.minMaxOffset,new Jg(t)))}},VS=class{constructor(e){this.parser=e,this.start=e.currentPosition,this.defaultBaselineIndex=e.uint16,this.baseCoordCount=e.uint16,this.baseCoords=[...new Array(this.baseCoordCount)].map(t=>e.Offset16)}getTable(e){return this.parser.currentPosition=this.start+this.baseCoords[e],new zS(this.parser)}},Jg=class{constructor(e){this.minCoord=e.Offset16,this.maxCoord=e.Offset16,this.featMinMaxCount=e.uint16;let t=e.currentPosition;ae(this,"featMinMaxRecords",()=>(e.currentPosition=t,[...new Array(this.featMinMaxCount)].map(r=>new BS(e))))}},BS=class{constructor(e){this.featureTableTag=e.tag,this.minCoord=e.Offset16,this.maxCoord=e.Offset16}},zS=class{constructor(e){this.baseCoordFormat=e.uint16,this.coordinate=e.int16,this.baseCoordFormat===2&&(this.referenceGlyph=e.uint16,this.baseCoordPoint=e.uint16),this.baseCoordFormat===3&&(this.deviceTable=e.Offset16)}},jS=Object.freeze({__proto__:null,BASE:AS}),Wg=class{constructor(e){this.classFormat=e.uint16,this.classFormat===1&&(this.startGlyphID=e.uint16,this.glyphCount=e.uint16,this.classValueArray=[...new Array(this.glyphCount)].map(t=>e.uint16)),this.classFormat===2&&(this.classRangeCount=e.uint16,this.classRangeRecords=[...new Array(this.classRangeCount)].map(t=>new HS(e)))}},HS=class{constructor(e){this.startGlyphID=e.uint16,this.endGlyphID=e.uint16,this.class=e.uint16}},Rs=class extends ct{constructor(e){super(e),this.coverageFormat=e.uint16,this.coverageFormat===1&&(this.glyphCount=e.uint16,this.glyphArray=[...new Array(this.glyphCount)].map(t=>e.uint16)),this.coverageFormat===2&&(this.rangeCount=e.uint16,this.rangeRecords=[...new Array(this.rangeCount)].map(t=>new US(e)))}},US=class{constructor(e){this.startGlyphID=e.uint16,this.endGlyphID=e.uint16,this.startCoverageIndex=e.uint16}},WS=class{constructor(e,t){this.table=e,this.parser=t,this.start=t.currentPosition,this.format=t.uint16,this.variationRegionListOffset=t.Offset32,this.itemVariationDataCount=t.uint16,this.itemVariationDataOffsets=[...new Array(this.itemVariationDataCount)].map(r=>t.Offset32)}},GS=class extends Pe{constructor(e,t){let{p:r}=super(e,t);this.majorVersion=r.uint16,this.minorVersion=r.uint16,this.glyphClassDefOffset=r.Offset16,ae(this,"glyphClassDefs",()=>{if(this.glyphClassDefOffset!==0)return r.currentPosition=this.tableStart+this.glyphClassDefOffset,new Wg(r)}),this.attachListOffset=r.Offset16,ae(this,"attachList",()=>{if(this.attachListOffset!==0)return r.currentPosition=this.tableStart+this.attachListOffset,new YS(r)}),this.ligCaretListOffset=r.Offset16,ae(this,"ligCaretList",()=>{if(this.ligCaretListOffset!==0)return r.currentPosition=this.tableStart+this.ligCaretListOffset,new ZS(r)}),this.markAttachClassDefOffset=r.Offset16,ae(this,"markAttachClassDef",()=>{if(this.markAttachClassDefOffset!==0)return r.currentPosition=this.tableStart+this.markAttachClassDefOffset,new Wg(r)}),this.minorVersion>=2&&(this.markGlyphSetsDefOffset=r.Offset16,ae(this,"markGlyphSetsDef",()=>{if(this.markGlyphSetsDefOffset!==0)return r.currentPosition=this.tableStart+this.markGlyphSetsDefOffset,new JS(r)})),this.minorVersion===3&&(this.itemVarStoreOffset=r.Offset32,ae(this,"itemVarStore",()=>{if(this.itemVarStoreOffset!==0)return r.currentPosition=this.tableStart+this.itemVarStoreOffset,new WS(r)}))}},YS=class extends ct{constructor(e){super(e),this.coverageOffset=e.Offset16,this.glyphCount=e.uint16,this.attachPointOffsets=[...new Array(this.glyphCount)].map(t=>e.Offset16)}getPoint(e){return this.parser.currentPosition=this.start+this.attachPointOffsets[e],new qS(this.parser)}},qS=class{constructor(e){this.pointCount=e.uint16,this.pointIndices=[...new Array(this.pointCount)].map(t=>e.uint16)}},ZS=class extends ct{constructor(e){super(e),this.coverageOffset=e.Offset16,ae(this,"coverage",()=>(e.currentPosition=this.start+this.coverageOffset,new Rs(e))),this.ligGlyphCount=e.uint16,this.ligGlyphOffsets=[...new Array(this.ligGlyphCount)].map(t=>e.Offset16)}getLigGlyph(e){return this.parser.currentPosition=this.start+this.ligGlyphOffsets[e],new XS(this.parser)}},XS=class extends ct{constructor(e){super(e),this.caretCount=e.uint16,this.caretValueOffsets=[...new Array(this.caretCount)].map(t=>e.Offset16)}getCaretValue(e){return this.parser.currentPosition=this.start+this.caretValueOffsets[e],new KS(this.parser)}},KS=class{constructor(e){this.caretValueFormat=e.uint16,this.caretValueFormat===1&&(this.coordinate=e.int16),this.caretValueFormat===2&&(this.caretValuePointIndex=e.uint16),this.caretValueFormat===3&&(this.coordinate=e.int16,this.deviceOffset=e.Offset16)}},JS=class extends ct{constructor(e){super(e),this.markGlyphSetTableFormat=e.uint16,this.markGlyphSetCount=e.uint16,this.coverageOffsets=[...new Array(this.markGlyphSetCount)].map(t=>e.Offset32)}getMarkGlyphSet(e){return this.parser.currentPosition=this.start+this.coverageOffsets[e],new Rs(this.parser)}},QS=Object.freeze({__proto__:null,GDEF:GS}),Gg=class extends ct{static EMPTY={scriptCount:0,scriptRecords:[]};constructor(e){super(e),this.scriptCount=e.uint16,this.scriptRecords=[...new Array(this.scriptCount)].map(t=>new $S(e))}},$S=class{constructor(e){this.scriptTag=e.tag,this.scriptOffset=e.Offset16}},eC=class extends ct{constructor(e){super(e),this.defaultLangSys=e.Offset16,this.langSysCount=e.uint16,this.langSysRecords=[...new Array(this.langSysCount)].map(t=>new tC(e))}},tC=class{constructor(e){this.langSysTag=e.tag,this.langSysOffset=e.Offset16}},Yg=class{constructor(e){this.lookupOrder=e.Offset16,this.requiredFeatureIndex=e.uint16,this.featureIndexCount=e.uint16,this.featureIndices=[...new Array(this.featureIndexCount)].map(t=>e.uint16)}},qg=class extends ct{static EMPTY={featureCount:0,featureRecords:[]};constructor(e){super(e),this.featureCount=e.uint16,this.featureRecords=[...new Array(this.featureCount)].map(t=>new rC(e))}},rC=class{constructor(e){this.featureTag=e.tag,this.featureOffset=e.Offset16}},oC=class extends ct{constructor(e){super(e),this.featureParams=e.Offset16,this.lookupIndexCount=e.uint16,this.lookupListIndices=[...new Array(this.lookupIndexCount)].map(t=>e.uint16)}getFeatureParams(){if(this.featureParams>0){let e=this.parser;e.currentPosition=this.start+this.featureParams;let t=this.featureTag;if(t==="size")return new sC(e);if(t.startsWith("cc"))return new nC(e);if(t.startsWith("ss"))return new iC(e)}}},nC=class{constructor(e){this.format=e.uint16,this.featUiLabelNameId=e.uint16,this.featUiTooltipTextNameId=e.uint16,this.sampleTextNameId=e.uint16,this.numNamedParameters=e.uint16,this.firstParamUiLabelNameId=e.uint16,this.charCount=e.uint16,this.character=[...new Array(this.charCount)].map(t=>e.uint24)}},sC=class{constructor(e){this.designSize=e.uint16,this.subfamilyIdentifier=e.uint16,this.subfamilyNameID=e.uint16,this.smallEnd=e.uint16,this.largeEnd=e.uint16}},iC=class{constructor(e){this.version=e.uint16,this.UINameID=e.uint16}};function Qg(e){e.parser.currentPosition-=2,delete e.coverageOffset,delete e.getCoverageTable}var Ko=class extends ct{constructor(e){super(e),this.substFormat=e.uint16,this.coverageOffset=e.Offset16}getCoverageTable(){let e=this.parser;return e.currentPosition=this.start+this.coverageOffset,new Rs(e)}},Gc=class{constructor(e){this.glyphSequenceIndex=e.uint16,this.lookupListIndex=e.uint16}},aC=class extends Ko{constructor(e){super(e),this.deltaGlyphID=e.int16}},lC=class extends Ko{constructor(e){super(e),this.sequenceCount=e.uint16,this.sequenceOffsets=[...new Array(this.sequenceCount)].map(t=>e.Offset16)}getSequence(e){let t=this.parser;return t.currentPosition=this.start+this.sequenceOffsets[e],new cC(t)}},cC=class{constructor(e){this.glyphCount=e.uint16,this.substituteGlyphIDs=[...new Array(this.glyphCount)].map(t=>e.uint16)}},uC=class extends Ko{constructor(e){super(e),this.alternateSetCount=e.uint16,this.alternateSetOffsets=[...new Array(this.alternateSetCount)].map(t=>e.Offset16)}getAlternateSet(e){let t=this.parser;return t.currentPosition=this.start+this.alternateSetOffsets[e],new fC(t)}},fC=class{constructor(e){this.glyphCount=e.uint16,this.alternateGlyphIDs=[...new Array(this.glyphCount)].map(t=>e.uint16)}},dC=class extends Ko{constructor(e){super(e),this.ligatureSetCount=e.uint16,this.ligatureSetOffsets=[...new Array(this.ligatureSetCount)].map(t=>e.Offset16)}getLigatureSet(e){let t=this.parser;return t.currentPosition=this.start+this.ligatureSetOffsets[e],new pC(t)}},pC=class extends ct{constructor(e){super(e),this.ligatureCount=e.uint16,this.ligatureOffsets=[...new Array(this.ligatureCount)].map(t=>e.Offset16)}getLigature(e){let t=this.parser;return t.currentPosition=this.start+this.ligatureOffsets[e],new mC(t)}},mC=class{constructor(e){this.ligatureGlyph=e.uint16,this.componentCount=e.uint16,this.componentGlyphIDs=[...new Array(this.componentCount-1)].map(t=>e.uint16)}},hC=class extends Ko{constructor(e){super(e),this.substFormat===1&&(this.subRuleSetCount=e.uint16,this.subRuleSetOffsets=[...new Array(this.subRuleSetCount)].map(t=>e.Offset16)),this.substFormat===2&&(this.classDefOffset=e.Offset16,this.subClassSetCount=e.uint16,this.subClassSetOffsets=[...new Array(this.subClassSetCount)].map(t=>e.Offset16)),this.substFormat===3&&(Qg(this),this.glyphCount=e.uint16,this.substitutionCount=e.uint16,this.coverageOffsets=[...new Array(this.glyphCount)].map(t=>e.Offset16),this.substLookupRecords=[...new Array(this.substitutionCount)].map(t=>new Gc(e)))}getSubRuleSet(e){if(this.substFormat!==1)throw new Error(`lookup type 5.${this.substFormat} has no subrule sets.`);let t=this.parser;return t.currentPosition=this.start+this.subRuleSetOffsets[e],new gC(t)}getSubClassSet(e){if(this.substFormat!==2)throw new Error(`lookup type 5.${this.substFormat} has no subclass sets.`);let t=this.parser;return t.currentPosition=this.start+this.subClassSetOffsets[e],new yC(t)}getCoverageTable(e){if(this.substFormat!==3&&!e)return super.getCoverageTable();if(!e)throw new Error(`lookup type 5.${this.substFormat} requires an coverage table index.`);let t=this.parser;return t.currentPosition=this.start+this.coverageOffsets[e],new Rs(t)}},gC=class extends ct{constructor(e){super(e),this.subRuleCount=e.uint16,this.subRuleOffsets=[...new Array(this.subRuleCount)].map(t=>e.Offset16)}getSubRule(e){let t=this.parser;return t.currentPosition=this.start+this.subRuleOffsets[e],new $g(t)}},$g=class{constructor(e){this.glyphCount=e.uint16,this.substitutionCount=e.uint16,this.inputSequence=[...new Array(this.glyphCount-1)].map(t=>e.uint16),this.substLookupRecords=[...new Array(this.substitutionCount)].map(t=>new Gc(e))}},yC=class extends ct{constructor(e){super(e),this.subClassRuleCount=e.uint16,this.subClassRuleOffsets=[...new Array(this.subClassRuleCount)].map(t=>e.Offset16)}getSubClass(e){let t=this.parser;return t.currentPosition=this.start+this.subClassRuleOffsets[e],new vC(t)}},vC=class extends $g{constructor(e){super(e)}},bC=class extends Ko{constructor(e){super(e),this.substFormat===1&&(this.chainSubRuleSetCount=e.uint16,this.chainSubRuleSetOffsets=[...new Array(this.chainSubRuleSetCount)].map(t=>e.Offset16)),this.substFormat===2&&(this.backtrackClassDefOffset=e.Offset16,this.inputClassDefOffset=e.Offset16,this.lookaheadClassDefOffset=e.Offset16,this.chainSubClassSetCount=e.uint16,this.chainSubClassSetOffsets=[...new Array(this.chainSubClassSetCount)].map(t=>e.Offset16)),this.substFormat===3&&(Qg(this),this.backtrackGlyphCount=e.uint16,this.backtrackCoverageOffsets=[...new Array(this.backtrackGlyphCount)].map(t=>e.Offset16),this.inputGlyphCount=e.uint16,this.inputCoverageOffsets=[...new Array(this.inputGlyphCount)].map(t=>e.Offset16),this.lookaheadGlyphCount=e.uint16,this.lookaheadCoverageOffsets=[...new Array(this.lookaheadGlyphCount)].map(t=>e.Offset16),this.seqLookupCount=e.uint16,this.seqLookupRecords=[...new Array(this.substitutionCount)].map(t=>new ey(e)))}getChainSubRuleSet(e){if(this.substFormat!==1)throw new Error(`lookup type 6.${this.substFormat} has no chainsubrule sets.`);let t=this.parser;return t.currentPosition=this.start+this.chainSubRuleSetOffsets[e],new wC(t)}getChainSubClassSet(e){if(this.substFormat!==2)throw new Error(`lookup type 6.${this.substFormat} has no chainsubclass sets.`);let t=this.parser;return t.currentPosition=this.start+this.chainSubClassSetOffsets[e],new SC(t)}getCoverageFromOffset(e){if(this.substFormat!==3)throw new Error(`lookup type 6.${this.substFormat} does not use contextual coverage offsets.`);let t=this.parser;return t.currentPosition=this.start+e,new Rs(t)}},wC=class extends ct{constructor(e){super(e),this.chainSubRuleCount=e.uint16,this.chainSubRuleOffsets=[...new Array(this.chainSubRuleCount)].map(t=>e.Offset16)}getSubRule(e){let t=this.parser;return t.currentPosition=this.start+this.chainSubRuleOffsets[e],new xC(t)}},xC=class{constructor(e){this.backtrackGlyphCount=e.uint16,this.backtrackSequence=[...new Array(this.backtrackGlyphCount)].map(t=>e.uint16),this.inputGlyphCount=e.uint16,this.inputSequence=[...new Array(this.inputGlyphCount-1)].map(t=>e.uint16),this.lookaheadGlyphCount=e.uint16,this.lookAheadSequence=[...new Array(this.lookAheadGlyphCount)].map(t=>e.uint16),this.substitutionCount=e.uint16,this.substLookupRecords=[...new Array(this.SubstCount)].map(t=>new Gc(e))}},SC=class extends ct{constructor(e){super(e),this.chainSubClassRuleCount=e.uint16,this.chainSubClassRuleOffsets=[...new Array(this.chainSubClassRuleCount)].map(t=>e.Offset16)}getSubClass(e){let t=this.parser;return t.currentPosition=this.start+this.chainSubRuleOffsets[e],new CC(t)}},CC=class{constructor(e){this.backtrackGlyphCount=e.uint16,this.backtrackSequence=[...new Array(this.backtrackGlyphCount)].map(t=>e.uint16),this.inputGlyphCount=e.uint16,this.inputSequence=[...new Array(this.inputGlyphCount-1)].map(t=>e.uint16),this.lookaheadGlyphCount=e.uint16,this.lookAheadSequence=[...new Array(this.lookAheadGlyphCount)].map(t=>e.uint16),this.substitutionCount=e.uint16,this.substLookupRecords=[...new Array(this.substitutionCount)].map(t=>new ey(e))}},ey=class extends ct{constructor(e){super(e),this.sequenceIndex=e.uint16,this.lookupListIndex=e.uint16}},RC=class extends ct{constructor(e){super(e),this.substFormat=e.uint16,this.extensionLookupType=e.uint16,this.extensionOffset=e.Offset32}},EC=class extends Ko{constructor(e){super(e),this.backtrackGlyphCount=e.uint16,this.backtrackCoverageOffsets=[...new Array(this.backtrackGlyphCount)].map(t=>e.Offset16),this.lookaheadGlyphCount=e.uint16,this.lookaheadCoverageOffsets=[new Array(this.lookaheadGlyphCount)].map(t=>e.Offset16),this.glyphCount=e.uint16,this.substituteGlyphIDs=[...new Array(this.glyphCount)].map(t=>e.uint16)}},TC={buildSubtable:function(e,t){let r=new[void 0,aC,lC,uC,dC,hC,bC,RC,EC][e](t);return r.type=e,r}},to=class extends ct{constructor(e){super(e)}},_C=class extends to{constructor(e){super(e),console.log("lookup type 1")}},OC=class extends to{constructor(e){super(e),console.log("lookup type 2")}},PC=class extends to{constructor(e){super(e),console.log("lookup type 3")}},kC=class extends to{constructor(e){super(e),console.log("lookup type 4")}},FC=class extends to{constructor(e){super(e),console.log("lookup type 5")}},AC=class extends to{constructor(e){super(e),console.log("lookup type 6")}},IC=class extends to{constructor(e){super(e),console.log("lookup type 7")}},LC=class extends to{constructor(e){super(e),console.log("lookup type 8")}},NC=class extends to{constructor(e){super(e),console.log("lookup type 9")}},DC={buildSubtable:function(e,t){let r=new[void 0,_C,OC,PC,kC,FC,AC,IC,LC,NC][e](t);return r.type=e,r}},Zg=class extends ct{static EMPTY={lookupCount:0,lookups:[]};constructor(e){super(e),this.lookupCount=e.uint16,this.lookups=[...new Array(this.lookupCount)].map(t=>e.Offset16)}},MC=class extends ct{constructor(e,t){super(e),this.ctType=t,this.lookupType=e.uint16,this.lookupFlag=e.uint16,this.subTableCount=e.uint16,this.subtableOffsets=[...new Array(this.subTableCount)].map(r=>e.Offset16),this.markFilteringSet=e.uint16}get rightToLeft(){return this.lookupFlag&!0}get ignoreBaseGlyphs(){return this.lookupFlag&!0}get ignoreLigatures(){return this.lookupFlag&!0}get ignoreMarks(){return this.lookupFlag&!0}get useMarkFilteringSet(){return this.lookupFlag&!0}get markAttachmentType(){return this.lookupFlag&!0}getSubTable(e){let t=this.ctType==="GSUB"?TC:DC;return this.parser.currentPosition=this.start+this.subtableOffsets[e],t.buildSubtable(this.lookupType,this.parser)}},ty=class extends Pe{constructor(e,t,r){let{p:o,tableStart:n}=super(e,t,r);this.majorVersion=o.uint16,this.minorVersion=o.uint16,this.scriptListOffset=o.Offset16,this.featureListOffset=o.Offset16,this.lookupListOffset=o.Offset16,this.majorVersion===1&&this.minorVersion===1&&(this.featureVariationsOffset=o.Offset32);let s=!(this.scriptListOffset||this.featureListOffset||this.lookupListOffset);ae(this,"scriptList",()=>s?Gg.EMPTY:(o.currentPosition=n+this.scriptListOffset,new Gg(o))),ae(this,"featureList",()=>s?qg.EMPTY:(o.currentPosition=n+this.featureListOffset,new qg(o))),ae(this,"lookupList",()=>s?Zg.EMPTY:(o.currentPosition=n+this.lookupListOffset,new Zg(o))),this.featureVariationsOffset&&ae(this,"featureVariations",()=>s?FeatureVariations.EMPTY:(o.currentPosition=n+this.featureVariationsOffset,new FeatureVariations(o)))}getSupportedScripts(){return this.scriptList.scriptRecords.map(e=>e.scriptTag)}getScriptTable(e){let t=this.scriptList.scriptRecords.find(o=>o.scriptTag===e);this.parser.currentPosition=this.scriptList.start+t.scriptOffset;let r=new eC(this.parser);return r.scriptTag=e,r}ensureScriptTable(e){return typeof e=="string"?this.getScriptTable(e):e}getSupportedLangSys(e){e=this.ensureScriptTable(e);let t=e.defaultLangSys!==0,r=e.langSysRecords.map(o=>o.langSysTag);return t&&r.unshift("dflt"),r}getDefaultLangSysTable(e){e=this.ensureScriptTable(e);let t=e.defaultLangSys;if(t!==0){this.parser.currentPosition=e.start+t;let r=new Yg(this.parser);return r.langSysTag="",r.defaultForScript=e.scriptTag,r}}getLangSysTable(e,t="dflt"){if(t==="dflt")return this.getDefaultLangSysTable(e);e=this.ensureScriptTable(e);let r=e.langSysRecords.find(n=>n.langSysTag===t);this.parser.currentPosition=e.start+r.langSysOffset;let o=new Yg(this.parser);return o.langSysTag=t,o}getFeatures(e){return e.featureIndices.map(t=>this.getFeature(t))}getFeature(e){let t;if(parseInt(e)==e?t=this.featureList.featureRecords[e]:t=this.featureList.featureRecords.find(o=>o.featureTag===e),!t)return;this.parser.currentPosition=this.featureList.start+t.featureOffset;let r=new oC(this.parser);return r.featureTag=t.featureTag,r}getLookups(e){return e.lookupListIndices.map(t=>this.getLookup(t))}getLookup(e,t){let r=this.lookupList.lookups[e];return this.parser.currentPosition=this.lookupList.start+r,new MC(this.parser,t)}},VC=class extends ty{constructor(e,t){super(e,t,"GSUB")}getLookup(e){return super.getLookup(e,"GSUB")}},BC=Object.freeze({__proto__:null,GSUB:VC}),zC=class extends ty{constructor(e,t){super(e,t,"GPOS")}getLookup(e){return super.getLookup(e,"GPOS")}},jC=Object.freeze({__proto__:null,GPOS:zC}),HC=class extends Pe{constructor(e,t){let{p:r}=super(e,t);this.version=r.uint16,this.offsetToSVGDocumentList=r.Offset32,r.currentPosition=this.tableStart+this.offsetToSVGDocumentList,this.documentList=new UC(r)}},UC=class extends ct{constructor(e){super(e),this.numEntries=e.uint16,this.documentRecords=[...new Array(this.numEntries)].map(t=>new WC(e))}getDocument(e){let t=this.documentRecords[e];if(!t)return"";let r=this.start+t.svgDocOffset;return this.parser.currentPosition=r,this.parser.readBytes(t.svgDocLength)}getDocumentForGlyph(e){let t=this.documentRecords.findIndex(r=>r.startGlyphID<=e&&e<=r.endGlyphID);return t===-1?"":this.getDocument(t)}},WC=class{constructor(e){this.startGlyphID=e.uint16,this.endGlyphID=e.uint16,this.svgDocOffset=e.Offset32,this.svgDocLength=e.uint32}},GC=Object.freeze({__proto__:null,SVG:HC}),YC=class extends Pe{constructor(e,t){let{p:r}=super(e,t);this.majorVersion=r.uint16,this.minorVersion=r.uint16,this.axesArrayOffset=r.Offset16,r.uint16,this.axisCount=r.uint16,this.axisSize=r.uint16,this.instanceCount=r.uint16,this.instanceSize=r.uint16;let o=this.tableStart+this.axesArrayOffset;ae(this,"axes",()=>(r.currentPosition=o,[...new Array(this.axisCount)].map(s=>new qC(r))));let n=o+this.axisCount*this.axisSize;ae(this,"instances",()=>{let s=[];for(let i=0;ie.tag)}getAxis(e){return this.axes.find(t=>t.tag===e)}},qC=class{constructor(e){this.tag=e.tag,this.minValue=e.fixed,this.defaultValue=e.fixed,this.maxValue=e.fixed,this.flags=e.flags(16),this.axisNameID=e.uint16}},ZC=class{constructor(e,t,r){let o=e.currentPosition;this.subfamilyNameID=e.uint16,e.uint16,this.coordinates=[...new Array(t)].map(n=>e.fixed),e.currentPosition-o[...new Array(o)].map(n=>r.fword))}},JC=Object.freeze({__proto__:null,cvt:KC}),QC=class extends Pe{constructor(e,t){let{p:r}=super(e,t);ae(this,"instructions",()=>[...new Array(e.length)].map(o=>r.uint8))}},$C=Object.freeze({__proto__:null,fpgm:QC}),eR=class extends Pe{constructor(e,t){let{p:r}=super(e,t);this.version=r.uint16,this.numRanges=r.uint16,ae(this,"gaspRanges",()=>[...new Array(this.numRanges)].map(n=>new tR(r)))}},tR=class{constructor(e){this.rangeMaxPPEM=e.uint16,this.rangeGaspBehavior=e.uint16}},rR=Object.freeze({__proto__:null,gasp:eR}),oR=class extends Pe{constructor(e,t){super(e,t)}getGlyphData(e,t){return this.parser.currentPosition=this.tableStart+e,this.parser.readBytes(t)}},nR=Object.freeze({__proto__:null,glyf:oR}),sR=class extends Pe{constructor(e,t,r){let{p:o}=super(e,t),n=r.maxp.numGlyphs+1;r.head.indexToLocFormat===0?(this.x2=!0,ae(this,"offsets",()=>[...new Array(n)].map(s=>o.Offset16))):ae(this,"offsets",()=>[...new Array(n)].map(s=>o.Offset32))}getGlyphDataOffsetAndLength(e){let t=this.offsets[e]*this.x2?2:1,r=this.offsets[e+1]*this.x2?2:1;return{offset:t,length:r-t}}},iR=Object.freeze({__proto__:null,loca:sR}),aR=class extends Pe{constructor(e,t){let{p:r}=super(e,t);ae(this,"instructions",()=>[...new Array(e.length)].map(o=>r.uint8))}},lR=Object.freeze({__proto__:null,prep:aR}),cR=class extends Pe{constructor(e,t){let{p:r}=super(e,t);ae(this,"data",()=>r.readBytes())}},uR=Object.freeze({__proto__:null,CFF:cR}),fR=class extends Pe{constructor(e,t){let{p:r}=super(e,t);ae(this,"data",()=>r.readBytes())}},dR=Object.freeze({__proto__:null,CFF2:fR}),pR=class extends Pe{constructor(e,t){let{p:r}=super(e,t);this.majorVersion=r.uint16,this.minorVersion=r.uint16,this.defaultVertOriginY=r.int16,this.numVertOriginYMetrics=r.uint16,ae(this,"vertORiginYMetrics",()=>[...new Array(this.numVertOriginYMetrics)].map(o=>new mR(r)))}},mR=class{constructor(e){this.glyphIndex=e.uint16,this.vertOriginY=e.int16}},hR=Object.freeze({__proto__:null,VORG:pR}),gR=class{constructor(e){this.indexSubTableArrayOffset=e.Offset32,this.indexTablesSize=e.uint32,this.numberofIndexSubTables=e.uint32,this.colorRef=e.uint32,this.hori=new na(e),this.vert=new na(e),this.startGlyphIndex=e.uint16,this.endGlyphIndex=e.uint16,this.ppemX=e.uint8,this.ppemY=e.uint8,this.bitDepth=e.uint8,this.flags=e.int8}},yR=class{constructor(e){this.hori=new na(e),this.vert=new na(e),this.ppemX=e.uint8,this.ppemY=e.uint8,this.substitutePpemX=e.uint8,this.substitutePpemY=e.uint8}},na=class{constructor(e){this.ascender=e.int8,this.descender=e.int8,this.widthMax=e.uint8,this.caretSlopeNumerator=e.int8,this.caretSlopeDenominator=e.int8,this.caretOffset=e.int8,this.minOriginSB=e.int8,this.minAdvanceSB=e.int8,this.maxBeforeBL=e.int8,this.minAfterBL=e.int8,this.pad1=e.int8,this.pad2=e.int8}},ry=class extends Pe{constructor(e,t,r){let{p:o}=super(e,t,r);this.majorVersion=o.uint16,this.minorVersion=o.uint16,this.numSizes=o.uint32,ae(this,"bitMapSizes",()=>[...new Array(this.numSizes)].map(n=>new gR(o)))}},vR=Object.freeze({__proto__:null,EBLC:ry}),oy=class extends Pe{constructor(e,t,r){let{p:o}=super(e,t,r);this.majorVersion=o.uint16,this.minorVersion=o.uint16}},bR=Object.freeze({__proto__:null,EBDT:oy}),wR=class extends Pe{constructor(e,t){let{p:r}=super(e,t);this.majorVersion=r.uint16,this.minorVersion=r.uint16,this.numSizes=r.uint32,ae(this,"bitmapScales",()=>[...new Array(this.numSizes)].map(o=>new yR(r)))}},xR=Object.freeze({__proto__:null,EBSC:wR}),SR=class extends ry{constructor(e,t){super(e,t,"CBLC")}},CR=Object.freeze({__proto__:null,CBLC:SR}),RR=class extends oy{constructor(e,t){super(e,t,"CBDT")}},ER=Object.freeze({__proto__:null,CBDT:RR}),TR=class extends Pe{constructor(e,t){let{p:r}=super(e,t);this.version=r.uint16,this.flags=r.flags(16),this.numStrikes=r.uint32,ae(this,"strikeOffsets",()=>[...new Array(this.numStrikes)].map(o=>r.Offset32))}},_R=Object.freeze({__proto__:null,sbix:TR}),OR=class extends Pe{constructor(e,t){let{p:r}=super(e,t);this.version=r.uint16,this.numBaseGlyphRecords=r.uint16,this.baseGlyphRecordsOffset=r.Offset32,this.layerRecordsOffset=r.Offset32,this.numLayerRecords=r.uint16}getBaseGlyphRecord(e){let t=this.tableStart+this.baseGlyphRecordsOffset;this.parser.currentPosition=t;let r=new Wc(this.parser),o=r.gID,n=this.tableStart+this.layerRecordsOffset-6;this.parser.currentPosition=n;let s=new Wc(this.parser),i=s.gID;if(o===e)return r;if(i===e)return s;for(;t!==n;){let a=t+(n-t)/12;this.parser.currentPosition=a;let u=new Wc(this.parser),l=u.gID;if(l===e)return u;l>e?n=a:lnew PR(p))}},Wc=class{constructor(e){this.gID=e.uint16,this.firstLayerIndex=e.uint16,this.numLayers=e.uint16}},PR=class{constructor(e){this.gID=e.uint16,this.paletteIndex=e.uint16}},kR=Object.freeze({__proto__:null,COLR:OR}),FR=class extends Pe{constructor(e,t){let{p:r}=super(e,t);this.version=r.uint16,this.numPaletteEntries=r.uint16;let o=this.numPalettes=r.uint16;this.numColorRecords=r.uint16,this.offsetFirstColorRecord=r.Offset32,this.colorRecordIndices=[...new Array(this.numPalettes)].map(n=>r.uint16),ae(this,"colorRecords",()=>(r.currentPosition=this.tableStart+this.offsetFirstColorRecord,[...new Array(this.numColorRecords)].map(n=>new AR(r)))),this.version===1&&(this.offsetPaletteTypeArray=r.Offset32,this.offsetPaletteLabelArray=r.Offset32,this.offsetPaletteEntryLabelArray=r.Offset32,ae(this,"paletteTypeArray",()=>(r.currentPosition=this.tableStart+this.offsetPaletteTypeArray,new IR(r,o))),ae(this,"paletteLabelArray",()=>(r.currentPosition=this.tableStart+this.offsetPaletteLabelArray,new LR(r,o))),ae(this,"paletteEntryLabelArray",()=>(r.currentPosition=this.tableStart+this.offsetPaletteEntryLabelArray,new NR(r,o))))}},AR=class{constructor(e){this.blue=e.uint8,this.green=e.uint8,this.red=e.uint8,this.alpha=e.uint8}},IR=class{constructor(e,t){this.paletteTypes=[...new Array(t)].map(r=>e.uint32)}},LR=class{constructor(e,t){this.paletteLabels=[...new Array(t)].map(r=>e.uint16)}},NR=class{constructor(e,t){this.paletteEntryLabels=[...new Array(t)].map(r=>e.uint16)}},DR=Object.freeze({__proto__:null,CPAL:FR}),MR=class extends Pe{constructor(e,t){let{p:r}=super(e,t);this.version=r.uint32,this.numSignatures=r.uint16,this.flags=r.uint16,this.signatureRecords=[...new Array(this.numSignatures)].map(o=>new VR(r))}getData(e){let t=this.signatureRecords[e];return this.parser.currentPosition=this.tableStart+t.offset,new BR(this.parser)}},VR=class{constructor(e){this.format=e.uint32,this.length=e.uint32,this.offset=e.Offset32}},BR=class{constructor(e){e.uint16,e.uint16,this.signatureLength=e.uint32,this.signature=e.readBytes(this.signatureLength)}},zR=Object.freeze({__proto__:null,DSIG:MR}),jR=class extends Pe{constructor(e,t,r){let{p:o}=super(e,t),n=r.hmtx.numGlyphs;this.version=o.uint16,this.numRecords=o.int16,this.sizeDeviceRecord=o.int32,this.records=[...new Array(numRecords)].map(s=>new HR(o,n))}},HR=class{constructor(e,t){this.pixelSize=e.uint8,this.maxWidth=e.uint8,this.widths=e.readBytes(t)}},UR=Object.freeze({__proto__:null,hdmx:jR}),WR=class extends Pe{constructor(e,t){let{p:r}=super(e,t);this.version=r.uint16,this.nTables=r.uint16,ae(this,"tables",()=>{let o=this.tableStart+4,n=[];for(let s=0;s[...new Array(this.nPairs)].map(t=>new YR(e)))),this.format===2&&console.warn("Kern subtable format 2 is not supported: this parser currently only parses universal table data.")}get horizontal(){return this.coverage[0]}get minimum(){return this.coverage[1]}get crossstream(){return this.coverage[2]}get override(){return this.coverage[3]}},YR=class{constructor(e){this.left=e.uint16,this.right=e.uint16,this.value=e.fword}},qR=Object.freeze({__proto__:null,kern:WR}),ZR=class extends Pe{constructor(e,t){let{p:r}=super(e,t);this.version=r.uint16,this.numGlyphs=r.uint16,this.yPels=r.readBytes(this.numGlyphs)}},XR=Object.freeze({__proto__:null,LTSH:ZR}),KR=class extends Pe{constructor(e,t){let{p:r}=super(e,t);this.version=r.uint16,this.mergeClassCount=r.uint16,this.mergeDataOffset=r.Offset16,this.classDefCount=r.uint16,this.offsetToClassDefOffsets=r.Offset16,ae(this,"mergeEntryMatrix",()=>[...new Array(this.mergeClassCount)].map(o=>r.readBytes(this.mergeClassCount))),console.warn("Full MERG parsing is currently not supported."),console.warn("If you need this table parsed, please file an issue, or better yet, a PR.")}},JR=Object.freeze({__proto__:null,MERG:KR}),QR=class extends Pe{constructor(e,t){let{p:r}=super(e,t);this.version=r.uint32,this.flags=r.uint32,r.uint32,this.dataMapsCount=r.uint32,this.dataMaps=[...new Array(this.dataMapsCount)].map(o=>new $R(this.tableStart,r))}},$R=class{constructor(e,t){this.tableStart=e,this.parser=t,this.tag=t.tag,this.dataOffset=t.Offset32,this.dataLength=t.uint32}getData(){return this.parser.currentField=this.tableStart+this.dataOffset,this.parser.readBytes(this.dataLength)}},e2=Object.freeze({__proto__:null,meta:QR}),t2=class extends Pe{constructor(e,t){super(e,t),console.warn("This font uses a PCLT table, which is currently not supported by this parser."),console.warn("If you need this table parsed, please file an issue, or better yet, a PR.")}},r2=Object.freeze({__proto__:null,PCLT:t2}),o2=class extends Pe{constructor(e,t){let{p:r}=super(e,t);this.version=r.uint16,this.numRecs=r.uint16,this.numRatios=r.uint16,this.ratRanges=[...new Array(this.numRatios)].map(o=>new n2(r)),this.offsets=[...new Array(this.numRatios)].map(o=>r.Offset16),this.VDMXGroups=[...new Array(this.numRecs)].map(o=>new s2(r))}},n2=class{constructor(e){this.bCharSet=e.uint8,this.xRatio=e.uint8,this.yStartRatio=e.uint8,this.yEndRatio=e.uint8}},s2=class{constructor(e){this.recs=e.uint16,this.startsz=e.uint8,this.endsz=e.uint8,this.records=[...new Array(this.recs)].map(t=>new i2(e))}},i2=class{constructor(e){this.yPelHeight=e.uint16,this.yMax=e.int16,this.yMin=e.int16}},a2=Object.freeze({__proto__:null,VDMX:o2}),l2=class extends Pe{constructor(e,t){let{p:r}=super(e,t);this.version=r.fixed,this.ascent=this.vertTypoAscender=r.int16,this.descent=this.vertTypoDescender=r.int16,this.lineGap=this.vertTypoLineGap=r.int16,this.advanceHeightMax=r.int16,this.minTopSideBearing=r.int16,this.minBottomSideBearing=r.int16,this.yMaxExtent=r.int16,this.caretSlopeRise=r.int16,this.caretSlopeRun=r.int16,this.caretOffset=r.int16,this.reserved=r.int16,this.reserved=r.int16,this.reserved=r.int16,this.reserved=r.int16,this.metricDataFormat=r.int16,this.numOfLongVerMetrics=r.uint16,r.verifyLength()}},c2=Object.freeze({__proto__:null,vhea:l2}),u2=class extends Pe{constructor(e,t,r){super(e,t);let o=r.vhea.numOfLongVerMetrics,n=r.maxp.numGlyphs,s=p.currentPosition;if(lazy(this,"vMetrics",()=>(p.currentPosition=s,[...new Array(o)].map(i=>new f2(p.uint16,p.int16)))),o(p.currentPosition=i,[...new Array(n-o)].map(a=>p.int16)))}}},f2=class{constructor(e,t){this.advanceHeight=e,this.topSideBearing=t}},d2=Object.freeze({__proto__:null,vmtx:u2});var ny=h(ce(),1);var{kebabCase:p2}=Fe(ny.privateApis);function sy(e){let t=e.reduce((r,o)=>(r[o.fontFamily]||(r[o.fontFamily]={name:o.fontFamily,fontFamily:o.fontFamily,slug:p2(o.fontFamily.toLowerCase()),fontFace:[]}),r[o.fontFamily].fontFace.push(o),r),{});return Object.values(t)}var er=h(Y(),1);function m2(){let{installFonts:e}=(0,Es.useContext)(Bt),[t,r]=(0,Es.useState)(!1),[o,n]=(0,Es.useState)(null),s=g=>{a(g)},i=g=>{a(g.target.files)},a=async g=>{if(!g)return;n(null),r(!0);let d=new Set,v=[...g],S=!1,C=v.map(async b=>{if(!await l(b))return S=!0,null;if(d.has(b.name))return null;let k=(((b.name??"").split(".")??[]).pop()??"").toLowerCase();return Bc.includes(k)?(d.add(b.name),b):null}),w=(await Promise.all(C)).filter(b=>b!==null);if(w.length>0)u(w);else{let b=S?(0,Bn.__)("Sorry, you are not allowed to upload this file type."):(0,Bn.__)("No fonts found to install.");n({type:"error",message:b}),r(!1)}},u=async g=>{let d=await Promise.all(g.map(async v=>{let S=await f(v);return await Co(S,S.file,"all"),S}));m(d)};async function l(g){let d=new sa("Uploaded Font");try{let v=await c(g);return await d.fromDataBuffer(v,"font"),!0}catch{return!1}}async function c(g){return new Promise((d,v)=>{let S=new window.FileReader;S.readAsArrayBuffer(g),S.onload=()=>d(S.result),S.onerror=v})}let f=async g=>{let d=await c(g),v=new sa("Uploaded Font");v.fromDataBuffer(d,g.name);let C=(await new Promise(N=>v.onload=N)).detail.font,{name:w}=C.opentype.tables,b=w.get(16)||w.get(1),R=w.get(2).toLowerCase().includes("italic"),k=C.opentype.tables["OS/2"].usWeightClass||"normal",_=!!C.opentype.tables.fvar&&C.opentype.tables.fvar.axes.find(({tag:N})=>N==="wght"),A=_?`${_.minValue} ${_.maxValue}`:null;return{file:g,fontFamily:b,fontStyle:R?"italic":"normal",fontWeight:A||k}},m=async g=>{let d=sy(g);try{await e(d),n({type:"success",message:(0,Bn.__)("Fonts were installed successfully.")})}catch(v){let S=v;n({type:"error",message:S.message,errors:S?.installationErrors})}r(!1)};return(0,er.jsxs)("div",{className:"font-library__tabpanel-layout",children:[(0,er.jsx)(It.DropZone,{onFilesDrop:s}),(0,er.jsxs)(It.__experimentalVStack,{className:"font-library__local-fonts",justify:"start",children:[o&&(0,er.jsxs)(It.Notice,{status:o.type,__unstableHTML:!0,onRemove:()=>n(null),children:[o.message,o.errors&&(0,er.jsx)("ul",{children:o.errors.map((g,d)=>(0,er.jsx)("li",{children:g},d))})]}),t&&(0,er.jsx)(It.FlexItem,{children:(0,er.jsx)("div",{className:"font-library__upload-area",children:(0,er.jsx)(It.ProgressBar,{})})}),!t&&(0,er.jsx)(It.FormFileUpload,{accept:Bc.map(g=>`.${g}`).join(","),multiple:!0,onChange:i,render:({openFileDialog:g})=>(0,er.jsx)(It.Button,{__next40pxDefaultSize:!0,className:"font-library__upload-area",onClick:g,children:(0,Bn.__)("Upload font")})}),(0,er.jsx)(It.__experimentalText,{className:"font-library__upload-area__text",children:(0,Bn.__)("Uploaded fonts appear in your library and can be used in your theme. Supported formats: .ttf, .otf, .woff, and .woff2.")})]})]})}var ia=m2;var ay=h(Y(),1),{Tabs:oV}=Fe(Yc.privateApis),nV={id:"installed-fonts",title:(0,aa._x)("Library","Font library")},sV={id:"upload-fonts",title:(0,aa._x)("Upload","noun")};var ly=h(Ce(),1),qc=h(ce(),1),g2=h(Te(),1);var cy=h(Y(),1);var Zc=h(Y(),1);var uy=h(Ce(),1),la=h(ce(),1);var fy=h(Y(),1);var Kc=h(Y(),1);var hr=h(Ce(),1),Jc=h(ce(),1),R2=h(Te(),1);var dy=h(Vt(),1);var S2=h(Y(),1),{useSettingsForBlockElement:NV,TypographyPanel:DV}=Fe(dy.privateApis);var C2=h(Y(),1);var Qc=h(Y(),1),GV={text:{description:(0,hr.__)("Manage the fonts used on the site."),title:(0,hr.__)("Text")},link:{description:(0,hr.__)("Manage the fonts and typography used on the links."),title:(0,hr.__)("Links")},heading:{description:(0,hr.__)("Manage the fonts and typography used on headings."),title:(0,hr.__)("Headings")},caption:{description:(0,hr.__)("Manage the fonts and typography used on captions."),title:(0,hr.__)("Captions")},button:{description:(0,hr.__)("Manage the fonts and typography used on buttons."),title:(0,hr.__)("Buttons")}};var O2=h(Ce(),1),P2=h(ce(),1),my=h(Vt(),1);var zn=h(ce(),1),py=h(Ce(),1);var _2=h(Te(),1);var E2=h(ce(),1),T2=h(Y(),1);var $c=h(Y(),1);var eu=h(Y(),1),{useSettingsForBlockElement:aB,ColorPanel:lB}=Fe(my.privateApis);var D2=h(Ce(),1);var A2=h(Bo(),1),tu=h(ce(),1),I2=h(Ce(),1);var ua=h(ce(),1);var ca=h(ce(),1);var hy=h(Y(),1);function gy(){let{paletteColors:e}=kn();return e.slice(0,4).map(({slug:t,color:r},o)=>(0,hy.jsx)("div",{style:{flexGrow:1,height:"100%",background:r}},`${t}-${o}`))}var _s=h(Y(),1),k2={start:{scale:1,opacity:1},hover:{scale:0,opacity:0}},F2=({label:e,isFocused:t,withHoverView:r})=>(0,_s.jsx)(In,{label:e,isFocused:t,withHoverView:r,children:({key:o})=>(0,_s.jsx)(ca.__unstableMotion.div,{variants:k2,style:{height:"100%",overflow:"hidden"},children:(0,_s.jsx)(ca.__experimentalHStack,{spacing:0,justify:"center",style:{height:"100%",overflow:"hidden"},children:(0,_s.jsx)(gy,{})})},o)}),yy=F2;var Jo=h(Y(),1),vy=["color"];function fa({title:e,gap:t=2}){let r=Ni(vy);return r?.length<=1?null:(0,Jo.jsxs)(ua.__experimentalVStack,{spacing:3,children:[e&&(0,Jo.jsx)(lr,{level:3,children:e}),(0,Jo.jsx)(ua.__experimentalGrid,{gap:t,children:r.map((o,n)=>(0,Jo.jsx)(Nn,{variation:o,isPill:!0,properties:vy,showTooltip:!0,children:()=>(0,Jo.jsx)(yy,{})},n))})]})}var by=h(Y(),1);var L2=h(Bo(),1),da=h(ce(),1),N2=h(Ce(),1);var wy=h(Y(),1);var ru=h(Y(),1);var V2=h(Ce(),1),Sy=h(Vt(),1),B2=h(ce(),1);var xy=h(Vt(),1);var M2=h(Y(),1);var{BackgroundPanel:NB}=Fe(xy.privateApis);var ou=h(Y(),1),{useHasBackgroundPanel:HB}=Fe(Sy.privateApis);var Qo=h(ce(),1),nu=h(Ce(),1);var W2=h(Te(),1);var z2=h(ce(),1),j2=h(Ce(),1),H2=h(Y(),1);var su=h(Y(),1),{Menu:ez}=Fe(Qo.privateApis);var bt=h(ce(),1),Os=h(Ce(),1);var pa=h(Te(),1);var iu=h(Y(),1),{Menu:hz}=Fe(bt.privateApis),gz=[{label:(0,Os.__)("Rename"),action:"rename"},{label:(0,Os.__)("Delete"),action:"delete"}],yz=[{label:(0,Os.__)("Reset"),action:"reset"}];var G2=h(Y(),1);var Z2=h(Ce(),1),Ry=h(Vt(),1);var Cy=h(Vt(),1),Y2=h(Te(),1);var q2=h(Y(),1),{useSettingsForBlockElement:Tz,DimensionsPanel:_z}=Fe(Cy.privateApis);var au=h(Y(),1),{useHasDimensionsPanel:Lz,useSettingsForBlockElement:Nz}=Fe(Ry.privateApis);var ky=h(ce(),1),Q2=h(Ce(),1);var K2=h(Ce(),1),J2=h(ce(),1);var Ey=h(ar(),1),Ty=h(Jt(),1),ha=h(Te(),1),_y=h(ce(),1),Oy=h(Ce(),1);var ma=h(Y(),1);function X2({gap:e=2}){let{user:t}=(0,ha.useContext)(Ot),r=t?.styles,n=(0,Ty.useSelect)(i=>{let a=i(Ey.store).__experimentalGetCurrentThemeGlobalStylesVariations();return Array.isArray(a)?a:void 0},[])?.filter(i=>!vs(i,["color"])&&!vs(i,["typography","spacing"])),s=(0,ha.useMemo)(()=>[...[{title:(0,Oy.__)("Default"),settings:{},styles:{}},...n??[]].map(a=>{let u=a?.styles?.blocks?{...a.styles.blocks}:{};r?.blocks&&Object.keys(r.blocks).forEach(m=>{if(r.blocks?.[m]?.css){let g=u[m]||{},d={css:`${u[m]?.css||""} ${r.blocks?.[m]?.css?.trim()||""}`};u[m]={...g,...d}}});let l=r?.css||a.styles?.css?{css:`${a.styles?.css||""} ${r?.css||""}`}:{},c=Object.keys(u).length>0?{blocks:u}:{},f={...a.styles,...l,...c};return{...a,settings:a.settings??{},styles:f}})],[n,r?.blocks,r?.css]);return!n||n.length<1?null:(0,ma.jsx)(_y.__experimentalGrid,{columns:2,className:"global-styles-ui-style-variations-container",gap:e,children:s.map((i,a)=>(0,ma.jsx)(Nn,{variation:i,children:u=>(0,ma.jsx)(kc,{label:i?.title,withHoverView:!0,isFocused:u,variation:i})},a))})}var lu=X2;var Py=h(Y(),1);var cu=h(Y(),1);var $2=h(Ce(),1),eE=h(ce(),1),Fy=h(Vt(),1);var uu=h(Y(),1),{AdvancedPanel:$z}=Fe(Fy.privateApis);var By=h(Ce(),1),du=h(ce(),1),pu=h(Te(),1);var tE=h(Jt(),1),rE=h(ar(),1),Ay=h(Te(),1);var Ny=h(Ce(),1),ga=h(ce(),1),ya=h(Ly(),1),oE=h(ar(),1),nE=h(Jt(),1);var Dy=h(Mc(),1);var My=h(Y(),1),{Badge:sj}=Fe(ga.privateApis),ij=3600*1e3*24;var fu=h(ce(),1),Ps=h(Ce(),1);var Vy=h(Y(),1);var mu=h(Y(),1);var hu=h(Ce(),1),ro=h(ce(),1);var cE=h(Te(),1);var iE=h(ce(),1),aE=h(Ce(),1),lE=h(Y(),1);var gu=h(Y(),1),{Menu:_j}=Fe(ro.privateApis);var Uy=h(Ce(),1),jr=h(ce(),1);var Wy=h(Te(),1);var uE=h(Vt(),1),fE=h(Ce(),1);var dE=h(Y(),1);var pE=h(ce(),1),zy=h(Ce(),1),mE=h(Y(),1);var ks=h(ce(),1),hE=h(Ce(),1),gE=h(Te(),1),jy=h(Y(),1);var oo=h(ce(),1),Hy=h(Y(),1);var yu=h(Y(),1),{Menu:Gj}=Fe(jr.privateApis);var bu=h(Y(),1);var wu=h(Y(),1);function jn(e){return function({value:r,baseValue:o,onChange:n,...s}){return(0,wu.jsx)(ys,{value:r,baseValue:o,onChange:n,children:(0,wu.jsx)(e,{...s})})}}var wE=jn(lu);var xE=jn(fa);var SE=jn(Hi);var Hn=h(Y(),1);function xu({value:e,baseValue:t,onChange:r,activeTab:o="installed-fonts"}){let n;switch(o){case"upload-fonts":n=(0,Hn.jsx)(ia,{});break;case"installed-fonts":n=(0,Hn.jsx)(Ji,{});break;default:n=(0,Hn.jsx)($i,{slug:o})}return(0,Hn.jsx)(ys,{value:e,baseValue:t,onChange:r,children:(0,Hn.jsx)(Gi,{children:n})})}var qy=h(us()),{unlock:Su}=(0,qy.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/font-list-route");if(typeof document<"u"&&!document.head.querySelector("style[data-wp-hash='911f938962']")){let e=document.createElement("style");e.setAttribute("data-wp-hash","911f938962"),e.appendChild(document.createTextNode('@media (min-width:782px){.font-library-modal.font-library-modal{width:65vw}}.font-library-modal .components-modal__header{border-bottom:none}.font-library-modal .components-modal__content{margin-bottom:90px;padding:0}.font-library-modal .font-library__subtitle{font-size:11px;font-weight:var(--wpds-typography-font-weight-emphasis,600);text-transform:uppercase}.font-library-modal__tab-panel{height:calc(100% - 50px)}.font-library__tabpanel-layout{display:flex;flex-direction:column;height:100%}.font-library__tabpanel-layout>div{flex-grow:1}.font-library__tabpanel-layout .font-library__loading{align-items:center;box-sizing:border-box;display:flex;height:100%;justify-content:center;left:0;padding-top:124px;position:absolute;top:0;width:100%}.font-library__footer,.font-library__tabpanel-layout .components-navigator-screen{padding:24px;width:100%}.font-library__footer{background-color:#fff;border-top:1px solid #ddd;bottom:0;box-sizing:border-box;flex-grow:0!important;flex-shrink:0;height:90px;position:absolute}.font-library__page-selection{font-size:11px;font-weight:var(--wpds-typography-font-weight-emphasis,600);text-transform:uppercase}@media (min-width:600px){.font-library__page-selection .font-library__page-selection-trigger{font-size:11px!important;font-weight:var(--wpds-typography-font-weight-emphasis,600)}}.font-library__fonts-title{font-size:11px;font-weight:var(--wpds-typography-font-weight-emphasis,600);margin-bottom:0;margin-top:0;text-transform:uppercase}.font-library__fonts-list{list-style:none;margin-bottom:0;margin-top:0;padding:0}.font-library__fonts-list-item{margin-bottom:0}.font-library__font-card{border:1px solid #ddd;box-sizing:border-box;height:auto!important;margin-top:-1px;padding:16px;width:100%}.font-library__font-card:hover{background-color:#f0f0f0}.font-library__font-card:focus{position:relative}.font-library__font-card .font-library__font-card__name{font-weight:700}.font-library__font-card .font-library__font-card__count{color:#757575}.font-library__font-card .font-library__font-variant_demo-image{display:block;height:24px;width:auto}.font-library__font-card .font-library__font-variant_demo-text{flex-shrink:0;white-space:nowrap}@media not (prefers-reduced-motion){.font-library__font-card .font-library__font-variant_demo-text{transition:opacity .3s ease-in-out}}.font-library-modal__tablist-container{background:#fff;border-bottom:1px solid #ddd;position:sticky;top:0;z-index:1}.font-library__upload-area{align-items:center;display:flex;height:256px!important;justify-content:center;width:100%}button.font-library__upload-area{background-color:#f0f0f0}.font-library__local-fonts{margin:24px auto;width:80%}.font-library__local-fonts .font-library__upload-area__text{color:#757575}.font-library__google-fonts-confirm{align-items:center;display:flex;justify-content:center;margin-top:64px}.font-library__google-fonts-confirm p{line-height:1.4}.font-library__google-fonts-confirm h2{font-size:1.2rem;font-weight:400}.font-library__google-fonts-confirm .components-card{padding:16px;width:400px}.font-library__google-fonts-confirm .components-button{justify-content:center;width:100%}.font-library__select-all{padding:16px 16px 16px 17px}.font-library__select-all .components-checkbox-control__label{padding-left:16px}.global-styles-ui-pagination .components-button.is-tertiary{height:32px;justify-content:center;width:32px}.global-styles-ui-screen-revisions__revisions-list{flex-grow:1;list-style:none;margin:0 16px 16px}.global-styles-ui-screen-revisions__revisions-list li{margin-bottom:0}.global-styles-ui-screen-revisions__revision-item{cursor:var(--wpds-cursor-control,pointer);display:flex;flex-direction:column;position:relative}.global-styles-ui-screen-revisions__revision-item[role=option]:active,.global-styles-ui-screen-revisions__revision-item[role=option]:focus{box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);outline:2px solid transparent}.global-styles-ui-screen-revisions__revision-item:hover{background:rgba(var(--wp-admin-theme-color--rgb),.04)}.global-styles-ui-screen-revisions__revision-item:hover .global-styles-ui-screen-revisions__date{color:var(--wp-admin-theme-color)}.global-styles-ui-screen-revisions__revision-item:after,.global-styles-ui-screen-revisions__revision-item:before{content:"\\a";display:block;position:absolute}.global-styles-ui-screen-revisions__revision-item:before{background:#ddd;border:4px solid transparent;border-radius:50%;height:8px;left:17px;top:18px;transform:translate(-50%,-50%);width:8px;z-index:1}.global-styles-ui-screen-revisions__revision-item[aria-selected=true]{background:rgba(var(--wp-admin-theme-color--rgb),.04);border-radius:2px;color:var(--wp-admin-theme-color);outline:3px solid transparent;outline-offset:-2px}.global-styles-ui-screen-revisions__revision-item[aria-selected=true] .global-styles-ui-screen-revisions__date{color:var(--wp-admin-theme-color)}.global-styles-ui-screen-revisions__revision-item[aria-selected=true]:before{background:var(--wp-admin-theme-color)}.global-styles-ui-screen-revisions__revision-item[aria-selected=true] .global-styles-ui-screen-revisions__changes>li,.global-styles-ui-screen-revisions__revision-item[aria-selected=true] .global-styles-ui-screen-revisions__meta{color:#1e1e1e}.global-styles-ui-screen-revisions__revision-item:after{border:.5px solid #ddd;height:100%;left:16px;top:0;width:0}.global-styles-ui-screen-revisions__revision-item:first-child:after{top:18px}.global-styles-ui-screen-revisions__revision-item:last-child:after{height:18px}.global-styles-ui-screen-revisions__revision-item-wrapper{display:block;padding:12px 12px 4px 40px}.global-styles-ui-screen-revisions__active-badge,.global-styles-ui-screen-revisions__apply-button.is-primary{align-self:flex-start;margin:0 12px 12px 40px}.global-styles-ui-screen-revisions__changes,.global-styles-ui-screen-revisions__meta{color:#757575;font-size:12px}.global-styles-ui-screen-revisions__description{align-items:flex-start;display:flex;flex-direction:column;gap:8px}.global-styles-ui-screen-revisions__description .global-styles-ui-screen-revisions__date{font-size:12px;font-weight:var(--wpds-typography-font-weight-emphasis,600);text-transform:uppercase}.global-styles-ui-screen-revisions__meta{align-items:flex-start;display:flex;justify-content:start;margin-bottom:4px;text-align:left;width:100%}.global-styles-ui-screen-revisions__meta img{border-radius:100%;height:16px;margin-right:8px;width:16px}.global-styles-ui-screen-revisions__loading{margin:24px auto!important}.global-styles-ui-screen-revisions__changes{line-height:1.4;list-style:disc;margin-left:12px;text-align:left}.global-styles-ui-screen-revisions__changes li{margin-bottom:4px}.global-styles-ui-screen-revisions__pagination.global-styles-ui-screen-revisions__pagination{gap:2px;justify-content:space-between}.global-styles-ui-screen-revisions__pagination.global-styles-ui-screen-revisions__pagination .edit-site-pagination__total{height:1px;left:-1000px;margin:-1px;overflow:hidden;position:absolute}.global-styles-ui-screen-revisions__pagination.global-styles-ui-screen-revisions__pagination .components-text{font-size:12px;will-change:opacity}.global-styles-ui-screen-revisions__pagination.global-styles-ui-screen-revisions__pagination .components-button.is-tertiary{color:#1e1e1e}.global-styles-ui-screen-revisions__pagination.global-styles-ui-screen-revisions__pagination .components-button.is-tertiary:disabled,.global-styles-ui-screen-revisions__pagination.global-styles-ui-screen-revisions__pagination .components-button.is-tertiary[aria-disabled=true]{color:#949494}.global-styles-ui-screen-revisions__footer{background:#fff;border-top:1px solid #ddd;bottom:0;box-sizing:border-box;height:56px;min-width:100%;padding:12px;position:sticky;z-index:1}.global-styles-ui-variations_item{box-sizing:border-box;cursor:var(--wpds-cursor-control,pointer)}.global-styles-ui-variations_item .global-styles-ui-variations_item-preview{border-radius:2px;outline:1px solid rgba(0,0,0,.1);outline-offset:-1px;overflow:hidden;position:relative}@media not (prefers-reduced-motion){.global-styles-ui-variations_item .global-styles-ui-variations_item-preview{transition:outline .1s linear}}.global-styles-ui-variations_item .global-styles-ui-variations_item-preview.is-pill{height:32px}.global-styles-ui-variations_item .global-styles-ui-variations_item-preview.is-pill .block-editor-iframe__scale-container{overflow:hidden}.global-styles-ui-variations_item:not(.is-active):hover .global-styles-ui-variations_item-preview{outline-color:rgba(0,0,0,.3)}.global-styles-ui-variations_item.is-active .global-styles-ui-variations_item-preview,.global-styles-ui-variations_item:focus-visible .global-styles-ui-variations_item-preview{outline-color:#1e1e1e;outline-offset:1px;outline-width:var(--wp-admin-border-width-focus)}.global-styles-ui-variations_item:focus-visible .global-styles-ui-variations_item-preview{outline-color:var(--wp-admin-theme-color)}.global-styles-ui-preview__wrapper{display:block;max-width:100%;width:100%}.global-styles-ui-preview__wrapper.is-hoverable{cursor:var(--wpds-cursor-control,pointer)}.global-styles-ui-typography-preview{align-items:center;background:#f0f0f0;border-radius:2px;display:flex;justify-content:center;margin-bottom:20px;min-height:100px;overflow:hidden}.global-styles-ui-font-size__item{line-break:anywhere;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.global-styles-ui-font-size__item-value{color:#757575}.global-styles-ui-screen-typography__indicator{align-items:center;border-radius:2px;display:flex!important;font-size:14px;height:24px;justify-content:center;width:24px}.global-styles-ui-block-types-search{margin-bottom:10px;padding:0 16px}.global-styles-ui-screen-typography__font-variants-count{color:#757575}.global-styles-ui-font-families__manage-fonts{justify-content:center}.global-styles-ui-screen .color-block-support-panel{border-top:none;padding-left:0;padding-right:0;padding-top:0;row-gap:12px}.global-styles-ui-header{line-height:1.9!important;margin-bottom:0!important}.global-styles-ui-subtitle{font-size:11px!important;font-weight:var(--wpds-typography-font-weight-emphasis,600)!important;margin-bottom:0!important;text-transform:uppercase}.global-styles-ui-section-title{color:#2f2f2f;font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:1.2;margin:0;padding:16px 16px 0}.global-styles-ui-icon-with-current-color{fill:currentColor}.global-styles-ui__color-indicator-wrapper{flex-shrink:0;height:24px}.global-styles-ui__shadows-panel__options-container,.global-styles-ui__typography-panel__options-container{height:24px}.global-styles-ui__block-preview-panel{border:1px solid #ddd;border-radius:2px;overflow:hidden;position:relative;width:100%}.global-styles-ui__shadow-preview-panel{background-image:repeating-linear-gradient(45deg,#e0e0e0 25%,transparent 0,transparent 75%,#e0e0e0 0,#e0e0e0),repeating-linear-gradient(45deg,#e0e0e0 25%,transparent 0,transparent 75%,#e0e0e0 0,#e0e0e0);background-position:0 0,8px 8px;background-size:16px 16px;border:1px solid #ddd;border-radius:2px;height:144px;overflow:auto}.global-styles-ui__shadow-preview-panel .global-styles-ui__shadow-preview-block{background-color:#fff;border:1px solid #ddd;border-radius:2px;height:60px;width:60%}.global-styles-ui__shadow-editor__dropdown-content{width:280px}.global-styles-ui__shadow-editor-panel{margin-bottom:4px}.global-styles-ui__shadow-editor__dropdown{position:relative;width:100%}.global-styles-ui__shadow-editor__dropdown-toggle{border-radius:inherit;height:auto;padding-bottom:8px;padding-top:8px;text-align:left;width:100%}.global-styles-ui__shadow-editor__dropdown-toggle.is-open{background:#f0f0f0;color:var(--wp-admin-theme-color)}.global-styles-ui__shadow-editor__remove-button{opacity:0;position:absolute;right:8px;top:8px}.global-styles-ui__shadow-editor__remove-button.global-styles-ui__shadow-editor__remove-button{border:none}.global-styles-ui__shadow-editor__dropdown-toggle:hover+.global-styles-ui__shadow-editor__remove-button,.global-styles-ui__shadow-editor__remove-button:focus,.global-styles-ui__shadow-editor__remove-button:hover{opacity:1}@media (hover:none){.global-styles-ui__shadow-editor__remove-button{opacity:1}}.global-styles-ui-screen-css{display:flex;flex:1 1 auto;flex-direction:column;margin:16px}.global-styles-ui-screen-css .block-editor-global-styles-advanced-panel{flex:1 1 auto}.global-styles-ui-screen-css .block-editor-global-styles-advanced-panel__custom-css-input,.global-styles-ui-screen-css .block-editor-global-styles-advanced-panel__custom-css-input .components-base-control__field{display:flex;flex:1 1 auto;flex-direction:column}.global-styles-ui-screen-css .block-editor-global-styles-advanced-panel__custom-css-input textarea{flex:1 1 auto}.global-styles-ui-screen-css-help-link{display:inline-block;margin-top:8px}.global-styles-ui-screen-variations{border-top:1px solid #ddd;margin-top:16px}.global-styles-ui-screen-variations>*{margin:24px 16px}.global-styles-ui-sidebar__navigator-provider{height:100%}.global-styles-ui-sidebar__navigator-screen{display:flex;flex-direction:column;height:100%}.global-styles-ui-color-palette__tablist-container{border-bottom:1px solid #ddd}.global-styles-ui-color-palette__tablist{margin-bottom:-1px}.global-styles-ui-sidebar__navigator-screen .single-column{grid-column:span 1}.global-styles-ui-screen-root.global-styles-ui-screen-root,.global-styles-ui-screen-style-variations.global-styles-ui-screen-style-variations{background:unset;color:inherit}.global-styles-ui-sidebar__panel .block-editor-block-icon svg{fill:currentColor}.global-styles-ui-screen-root__active-style-tile.global-styles-ui-screen-root__active-style-tile,.global-styles-ui-screen-root__active-style-tile.global-styles-ui-screen-root__active-style-tile .global-styles-ui-screen-root__active-style-tile-preview{border-radius:2px}.global-styles-ui-screen-root__active-style-tile-preview{clip-path:border-box}.global-styles-ui-color-palette-panel,.global-styles-ui-gradient-palette-panel{padding:16px}.font-library-page__tablist{border-bottom:1px solid #f0f0f0;padding:0 24px}.font-library-page__tab-panel{flex-grow:1;max-height:calc(100% - 110px);overflow:auto}.font-library-page:has(.font-library__footer) .font-library-page__tab-panel{max-height:calc(100% - 198px)}')),document.head.appendChild(e)}var{Tabs:va}=Su(Zy.privateApis),{useGlobalStyles:CE}=Su(Xy.privateApis);function RE(){let{records:e=[]}=(0,ba.useEntityRecords)("root","fontCollection",{_fields:"slug,name,description"}),[t,r]=(0,Jy.useState)("installed-fonts"),{base:o,user:n,setUser:s,isReady:i}=CE(),a=(0,Ky.useSelect)(l=>l(ba.store).canUser("create",{kind:"postType",name:"wp_font_family"}),[]);if(!i)return null;let u=[{id:"installed-fonts",title:(0,Un._x)("Library","Font library")}];return a&&(u.push({id:"upload-fonts",title:(0,Un._x)("Upload","noun")}),u.push(...(e||[]).map(({slug:l,name:c})=>({id:l,title:e&&e.length===1&&l==="google-fonts"?(0,Un.__)("Install Fonts"):c})))),React.createElement(oc,{title:(0,Un.__)("Fonts"),className:"font-library-page"},React.createElement(va,{selectedTabId:t,onSelect:l=>r(l)},React.createElement("div",{className:"font-library-page__tablist"},React.createElement(va.TabList,null,u.map(({id:l,title:c})=>React.createElement(va.Tab,{key:l,tabId:l},c)))),u.map(({id:l})=>React.createElement(va.TabPanel,{key:l,tabId:l,focusable:!1,className:"font-library-page__tab-panel"},React.createElement(xu,{value:n,baseValue:o,onChange:s,activeTab:l})))))}function EE(){return React.createElement(RE,null)}var TE=EE;export{TE as stage}; /*! Bundled license information: use-sync-external-store/cjs/use-sync-external-store-shim.production.js: (** * @license React * use-sync-external-store-shim.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. *) use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js: (** * @license React * use-sync-external-store-shim/with-selector.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. *) is-plain-object/dist/is-plain-object.mjs: (*! * is-plain-object * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. *) */ routes/font-list/content.min.asset.php000064400000000772152427033270014102 0ustar00 array('react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-primitives', 'wp-private-apis', 'wp-style-engine', 'wp-theme'), 'module_dependencies' => array(array('id' => '@wordpress/a11y', 'import' => 'static'), array('id' => '@wordpress/route', 'import' => 'static')), 'version' => '94d7f535d3ed8ffb3a10');routes/font-list/content.js000064400003402630152427033270012031 0ustar00var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __require = /* @__PURE__ */ ((x2) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x2, { get: (a2, b2) => (typeof require !== "undefined" ? require : a2)[b2] }) : x2)(function(x2) { if (typeof require !== "undefined") return require.apply(this, arguments); throw Error('Dynamic require of "' + x2 + '" is not supported'); }); var __commonJS = (cb, mod) => function __require4() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all) => { for (var name2 in all) __defProp(target, name2, { get: all[name2], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); // package-external:@wordpress/i18n var require_i18n = __commonJS({ "package-external:@wordpress/i18n"(exports, module) { module.exports = window.wp.i18n; } }); // package-external:@wordpress/element var require_element = __commonJS({ "package-external:@wordpress/element"(exports, module) { module.exports = window.wp.element; } }); // vendor-external:react var require_react = __commonJS({ "vendor-external:react"(exports, module) { module.exports = window.React; } }); // vendor-external:react/jsx-runtime var require_jsx_runtime = __commonJS({ "vendor-external:react/jsx-runtime"(exports, module) { module.exports = window.ReactJSXRuntime; } }); // vendor-external:react-dom var require_react_dom = __commonJS({ "vendor-external:react-dom"(exports, module) { module.exports = window.ReactDOM; } }); // node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js var require_use_sync_external_store_shim_development = __commonJS({ "node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports) { "use strict"; (function() { function is(x2, y2) { return x2 === y2 && (0 !== x2 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2; } function useSyncExternalStore$2(subscribe, getSnapshot) { didWarnOld18Alpha || void 0 === React48.startTransition || (didWarnOld18Alpha = true, console.error( "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release." )); var value = getSnapshot(); if (!didWarnUncachedGetSnapshot) { var cachedValue = getSnapshot(); objectIs(value, cachedValue) || (console.error( "The result of getSnapshot should be cached to avoid an infinite loop" ), didWarnUncachedGetSnapshot = true); } cachedValue = useState29({ inst: { value, getSnapshot } }); var inst = cachedValue[0].inst, forceUpdate = cachedValue[1]; useLayoutEffect4( function() { inst.value = value; inst.getSnapshot = getSnapshot; checkIfSnapshotChanged(inst) && forceUpdate({ inst }); }, [subscribe, value, getSnapshot] ); useEffect20( function() { checkIfSnapshotChanged(inst) && forceUpdate({ inst }); return subscribe(function() { checkIfSnapshotChanged(inst) && forceUpdate({ inst }); }); }, [subscribe] ); useDebugValue2(value); return value; } function checkIfSnapshotChanged(inst) { var latestGetSnapshot = inst.getSnapshot; inst = inst.value; try { var nextValue = latestGetSnapshot(); return !objectIs(inst, nextValue); } catch (error) { return true; } } function useSyncExternalStore$1(subscribe, getSnapshot) { return getSnapshot(); } "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); var React48 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useState29 = React48.useState, useEffect20 = React48.useEffect, useLayoutEffect4 = React48.useLayoutEffect, useDebugValue2 = React48.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2; exports.useSyncExternalStore = void 0 !== React48.useSyncExternalStore ? React48.useSyncExternalStore : shim; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); })(); } }); // node_modules/use-sync-external-store/shim/index.js var require_shim = __commonJS({ "node_modules/use-sync-external-store/shim/index.js"(exports, module) { "use strict"; if (false) { module.exports = null; } else { module.exports = require_use_sync_external_store_shim_development(); } } }); // node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js var require_with_selector_development = __commonJS({ "node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js"(exports) { "use strict"; (function() { function is(x2, y2) { return x2 === y2 && (0 !== x2 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2; } "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); var React48 = require_react(), shim = require_shim(), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore2 = shim.useSyncExternalStore, useRef23 = React48.useRef, useEffect20 = React48.useEffect, useMemo29 = React48.useMemo, useDebugValue2 = React48.useDebugValue; exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) { var instRef = useRef23(null); if (null === instRef.current) { var inst = { hasValue: false, value: null }; instRef.current = inst; } else inst = instRef.current; instRef = useMemo29( function() { function memoizedSelector(nextSnapshot) { if (!hasMemo) { hasMemo = true; memoizedSnapshot = nextSnapshot; nextSnapshot = selector(nextSnapshot); if (void 0 !== isEqual && inst.hasValue) { var currentSelection = inst.value; if (isEqual(currentSelection, nextSnapshot)) return memoizedSelection = currentSelection; } return memoizedSelection = nextSnapshot; } currentSelection = memoizedSelection; if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection; var nextSelection = selector(nextSnapshot); if (void 0 !== isEqual && isEqual(currentSelection, nextSelection)) return memoizedSnapshot = nextSnapshot, currentSelection; memoizedSnapshot = nextSnapshot; return memoizedSelection = nextSelection; } var hasMemo = false, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot; return [ function() { return memoizedSelector(getSnapshot()); }, null === maybeGetServerSnapshot ? void 0 : function() { return memoizedSelector(maybeGetServerSnapshot()); } ]; }, [getSnapshot, getServerSnapshot, selector, isEqual] ); var value = useSyncExternalStore2(subscribe, instRef[0], instRef[1]); useEffect20( function() { inst.hasValue = true; inst.value = value; }, [value] ); useDebugValue2(value); return value; }; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); })(); } }); // node_modules/use-sync-external-store/shim/with-selector.js var require_with_selector = __commonJS({ "node_modules/use-sync-external-store/shim/with-selector.js"(exports, module) { "use strict"; if (false) { module.exports = null; } else { module.exports = require_with_selector_development(); } } }); // package-external:@wordpress/primitives var require_primitives = __commonJS({ "package-external:@wordpress/primitives"(exports, module) { module.exports = window.wp.primitives; } }); // package-external:@wordpress/compose var require_compose = __commonJS({ "package-external:@wordpress/compose"(exports, module) { module.exports = window.wp.compose; } }); // package-external:@wordpress/theme var require_theme = __commonJS({ "package-external:@wordpress/theme"(exports, module) { module.exports = window.wp.theme; } }); // package-external:@wordpress/private-apis var require_private_apis = __commonJS({ "package-external:@wordpress/private-apis"(exports, module) { module.exports = window.wp.privateApis; } }); // package-external:@wordpress/components var require_components = __commonJS({ "package-external:@wordpress/components"(exports, module) { module.exports = window.wp.components; } }); // package-external:@wordpress/editor var require_editor = __commonJS({ "package-external:@wordpress/editor"(exports, module) { module.exports = window.wp.editor; } }); // package-external:@wordpress/core-data var require_core_data = __commonJS({ "package-external:@wordpress/core-data"(exports, module) { module.exports = window.wp.coreData; } }); // package-external:@wordpress/data var require_data = __commonJS({ "package-external:@wordpress/data"(exports, module) { module.exports = window.wp.data; } }); // package-external:@wordpress/blocks var require_blocks = __commonJS({ "package-external:@wordpress/blocks"(exports, module) { module.exports = window.wp.blocks; } }); // package-external:@wordpress/block-editor var require_block_editor = __commonJS({ "package-external:@wordpress/block-editor"(exports, module) { module.exports = window.wp.blockEditor; } }); // package-external:@wordpress/style-engine var require_style_engine = __commonJS({ "package-external:@wordpress/style-engine"(exports, module) { module.exports = window.wp.styleEngine; } }); // node_modules/fast-deep-equal/es6/index.js var require_es6 = __commonJS({ "node_modules/fast-deep-equal/es6/index.js"(exports, module) { "use strict"; module.exports = function equal(a2, b2) { if (a2 === b2) return true; if (a2 && b2 && typeof a2 == "object" && typeof b2 == "object") { if (a2.constructor !== b2.constructor) return false; var length, i2, keys; if (Array.isArray(a2)) { length = a2.length; if (length != b2.length) return false; for (i2 = length; i2-- !== 0; ) if (!equal(a2[i2], b2[i2])) return false; return true; } if (a2 instanceof Map && b2 instanceof Map) { if (a2.size !== b2.size) return false; for (i2 of a2.entries()) if (!b2.has(i2[0])) return false; for (i2 of a2.entries()) if (!equal(i2[1], b2.get(i2[0]))) return false; return true; } if (a2 instanceof Set && b2 instanceof Set) { if (a2.size !== b2.size) return false; for (i2 of a2.entries()) if (!b2.has(i2[0])) return false; return true; } if (ArrayBuffer.isView(a2) && ArrayBuffer.isView(b2)) { length = a2.length; if (length != b2.length) return false; for (i2 = length; i2-- !== 0; ) if (a2[i2] !== b2[i2]) return false; return true; } if (a2.constructor === RegExp) return a2.source === b2.source && a2.flags === b2.flags; if (a2.valueOf !== Object.prototype.valueOf) return a2.valueOf() === b2.valueOf(); if (a2.toString !== Object.prototype.toString) return a2.toString() === b2.toString(); keys = Object.keys(a2); length = keys.length; if (length !== Object.keys(b2).length) return false; for (i2 = length; i2-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(b2, keys[i2])) return false; for (i2 = length; i2-- !== 0; ) { var key = keys[i2]; if (!equal(a2[key], b2[key])) return false; } return true; } return a2 !== a2 && b2 !== b2; }; } }); // node_modules/deepmerge/dist/cjs.js var require_cjs = __commonJS({ "node_modules/deepmerge/dist/cjs.js"(exports, module) { "use strict"; var isMergeableObject = function isMergeableObject2(value) { return isNonNullObject(value) && !isSpecial(value); }; function isNonNullObject(value) { return !!value && typeof value === "object"; } function isSpecial(value) { var stringValue = Object.prototype.toString.call(value); return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value); } var canUseSymbol = typeof Symbol === "function" && Symbol.for; var REACT_ELEMENT_TYPE = canUseSymbol ? /* @__PURE__ */ Symbol.for("react.element") : 60103; function isReactElement(value) { return value.$$typeof === REACT_ELEMENT_TYPE; } function emptyTarget(val) { return Array.isArray(val) ? [] : {}; } function cloneUnlessOtherwiseSpecified(value, options) { return options.clone !== false && options.isMergeableObject(value) ? deepmerge2(emptyTarget(value), value, options) : value; } function defaultArrayMerge(target, source, options) { return target.concat(source).map(function(element) { return cloneUnlessOtherwiseSpecified(element, options); }); } function getMergeFunction(key, options) { if (!options.customMerge) { return deepmerge2; } var customMerge = options.customMerge(key); return typeof customMerge === "function" ? customMerge : deepmerge2; } function getEnumerableOwnPropertySymbols(target) { return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) { return Object.propertyIsEnumerable.call(target, symbol); }) : []; } function getKeys(target) { return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target)); } function propertyIsOnObject(object, property) { try { return property in object; } catch (_) { return false; } } function propertyIsUnsafe(target, key) { return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key)); } function mergeObject(target, source, options) { var destination = {}; if (options.isMergeableObject(target)) { getKeys(target).forEach(function(key) { destination[key] = cloneUnlessOtherwiseSpecified(target[key], options); }); } getKeys(source).forEach(function(key) { if (propertyIsUnsafe(target, key)) { return; } if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) { destination[key] = getMergeFunction(key, options)(target[key], source[key], options); } else { destination[key] = cloneUnlessOtherwiseSpecified(source[key], options); } }); return destination; } function deepmerge2(target, source, options) { options = options || {}; options.arrayMerge = options.arrayMerge || defaultArrayMerge; options.isMergeableObject = options.isMergeableObject || isMergeableObject; options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified; var sourceIsArray = Array.isArray(source); var targetIsArray = Array.isArray(target); var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray; if (!sourceAndTargetTypesMatch) { return cloneUnlessOtherwiseSpecified(source, options); } else if (sourceIsArray) { return options.arrayMerge(target, source, options); } else { return mergeObject(target, source, options); } } deepmerge2.all = function deepmergeAll(array, options) { if (!Array.isArray(array)) { throw new Error("first argument should be an array"); } return array.reduce(function(prev, next) { return deepmerge2(prev, next, options); }, {}); }; var deepmerge_1 = deepmerge2; module.exports = deepmerge_1; } }); // package-external:@wordpress/keycodes var require_keycodes = __commonJS({ "package-external:@wordpress/keycodes"(exports, module) { module.exports = window.wp.keycodes; } }); // package-external:@wordpress/api-fetch var require_api_fetch = __commonJS({ "package-external:@wordpress/api-fetch"(exports, module) { module.exports = window.wp.apiFetch; } }); // package-external:@wordpress/date var require_date = __commonJS({ "package-external:@wordpress/date"(exports, module) { module.exports = window.wp.date; } }); // node_modules/clsx/dist/clsx.mjs function r(e2) { var t3, f2, n2 = ""; if ("string" == typeof e2 || "number" == typeof e2) n2 += e2; else if ("object" == typeof e2) if (Array.isArray(e2)) { var o3 = e2.length; for (t3 = 0; t3 < o3; t3++) e2[t3] && (f2 = r(e2[t3])) && (n2 && (n2 += " "), n2 += f2); } else for (f2 in e2) e2[f2] && (n2 && (n2 += " "), n2 += f2); return n2; } function clsx() { for (var e2, t3, f2 = 0, n2 = "", o3 = arguments.length; f2 < o3; f2++) (e2 = arguments[f2]) && (t3 = r(e2)) && (n2 && (n2 += " "), n2 += t3); return n2; } var clsx_default = clsx; // node_modules/@base-ui/utils/safeReact.mjs var React2 = __toESM(require_react(), 1); var SafeReact = { ...React2 }; // node_modules/@base-ui/utils/useRefWithInit.mjs var React3 = __toESM(require_react(), 1); var UNINITIALIZED = {}; function useRefWithInit(init, initArg) { const ref = React3.useRef(UNINITIALIZED); if (ref.current === UNINITIALIZED) { ref.current = init(initArg); } return ref; } // node_modules/@base-ui/utils/useStableCallback.mjs var useInsertionEffect = SafeReact.useInsertionEffect; var useSafeInsertionEffect = ( // React 17 doesn't have useInsertionEffect. useInsertionEffect && // Preact replaces useInsertionEffect with useLayoutEffect and fires too late. useInsertionEffect !== SafeReact.useLayoutEffect ? useInsertionEffect : (fn) => fn() ); function useStableCallback(callback) { const stable = useRefWithInit(createStableCallback).current; stable.next = callback; useSafeInsertionEffect(stable.effect); return stable.trampoline; } function createStableCallback() { const stable = { next: void 0, callback: assertNotCalled, trampoline: (...args) => stable.callback?.(...args), effect: () => { stable.callback = stable.next; } }; return stable; } function assertNotCalled() { if (true) { throw ( /* minify-error-disabled */ new Error("Base UI: Cannot call an event handler while rendering.") ); } } // node_modules/@base-ui/utils/useIsoLayoutEffect.mjs var React4 = __toESM(require_react(), 1); var noop = () => { }; var useIsoLayoutEffect = typeof document !== "undefined" ? React4.useLayoutEffect : noop; // node_modules/@base-ui/utils/warn.mjs var set; if (true) { set = /* @__PURE__ */ new Set(); } function warn(...messages) { if (true) { const messageKey = messages.join(" "); if (!set.has(messageKey)) { set.add(messageKey); console.warn(`Base UI: ${messageKey}`); } } } // node_modules/@base-ui/react/internals/direction-context/DirectionContext.mjs var React5 = __toESM(require_react(), 1); var DirectionContext = /* @__PURE__ */ React5.createContext(void 0); if (true) DirectionContext.displayName = "DirectionContext"; function useDirection() { const context = React5.useContext(DirectionContext); return context?.direction ?? "ltr"; } // node_modules/@base-ui/react/internals/useRenderElement.mjs var React8 = __toESM(require_react(), 1); // node_modules/@base-ui/utils/useMergedRefs.mjs function useMergedRefs(a2, b2, c2, d2) { const forkRef = useRefWithInit(createForkRef).current; if (didChange(forkRef, a2, b2, c2, d2)) { update(forkRef, [a2, b2, c2, d2]); } return forkRef.callback; } function useMergedRefsN(refs) { const forkRef = useRefWithInit(createForkRef).current; if (didChangeN(forkRef, refs)) { update(forkRef, refs); } return forkRef.callback; } function createForkRef() { return { callback: null, cleanup: null, refs: [] }; } function didChange(forkRef, a2, b2, c2, d2) { return forkRef.refs[0] !== a2 || forkRef.refs[1] !== b2 || forkRef.refs[2] !== c2 || forkRef.refs[3] !== d2; } function didChangeN(forkRef, newRefs) { return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index2) => ref !== newRefs[index2]); } function update(forkRef, refs) { forkRef.refs = refs; if (refs.every((ref) => ref == null)) { forkRef.callback = null; return; } forkRef.callback = (instance) => { if (forkRef.cleanup) { forkRef.cleanup(); forkRef.cleanup = null; } if (instance != null) { const cleanupCallbacks = Array(refs.length).fill(null); for (let i2 = 0; i2 < refs.length; i2 += 1) { const ref = refs[i2]; if (ref == null) { continue; } switch (typeof ref) { case "function": { const refCleanup = ref(instance); if (typeof refCleanup === "function") { cleanupCallbacks[i2] = refCleanup; } break; } case "object": { ref.current = instance; break; } default: } } forkRef.cleanup = () => { for (let i2 = 0; i2 < refs.length; i2 += 1) { const ref = refs[i2]; if (ref == null) { continue; } switch (typeof ref) { case "function": { const cleanupCallback = cleanupCallbacks[i2]; if (typeof cleanupCallback === "function") { cleanupCallback(); } else { ref(null); } break; } case "object": { ref.current = null; break; } default: } } }; } }; } // node_modules/@base-ui/utils/getReactElementRef.mjs var React7 = __toESM(require_react(), 1); // node_modules/@base-ui/utils/reactVersion.mjs var React6 = __toESM(require_react(), 1); var majorVersion = parseInt(React6.version, 10); function isReactVersionAtLeast(reactVersionToCheck) { return majorVersion >= reactVersionToCheck; } // node_modules/@base-ui/utils/getReactElementRef.mjs function getReactElementRef(element) { if (!/* @__PURE__ */ React7.isValidElement(element)) { return null; } const reactElement = element; const propsWithRef = reactElement.props; return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null; } // node_modules/@base-ui/utils/mergeObjects.mjs function mergeObjects(a2, b2) { if (a2 && !b2) { return a2; } if (!a2 && b2) { return b2; } if (a2 || b2) { return { ...a2, ...b2 }; } return void 0; } // node_modules/@base-ui/utils/empty.mjs function NOOP() { } var EMPTY_ARRAY = Object.freeze([]); var EMPTY_OBJECT = Object.freeze({}); // node_modules/@base-ui/react/internals/getStateAttributesProps.mjs function getStateAttributesProps(state, customMapping) { const props = {}; for (const key in state) { const value = state[key]; if (customMapping?.hasOwnProperty(key)) { const customProps = customMapping[key](value); if (customProps != null) { Object.assign(props, customProps); } continue; } if (value === true) { props[`data-${key.toLowerCase()}`] = ""; } else if (value) { props[`data-${key.toLowerCase()}`] = value.toString(); } } return props; } // node_modules/@base-ui/react/utils/resolveClassName.mjs function resolveClassName(className, state) { return typeof className === "function" ? className(state) : className; } // node_modules/@base-ui/react/utils/resolveStyle.mjs function resolveStyle(style, state) { return typeof style === "function" ? style(state) : style; } // node_modules/@base-ui/react/merge-props/mergeProps.mjs var EMPTY_PROPS = {}; function mergeProps(a2, b2, c2, d2, e2) { if (!c2 && !d2 && !e2 && !a2) { return createInitialMergedProps(b2); } let merged = createInitialMergedProps(a2); if (b2) { merged = mergeInto(merged, b2); } if (c2) { merged = mergeInto(merged, c2); } if (d2) { merged = mergeInto(merged, d2); } if (e2) { merged = mergeInto(merged, e2); } return merged; } function mergePropsN(props) { if (props.length === 0) { return EMPTY_PROPS; } if (props.length === 1) { return createInitialMergedProps(props[0]); } let merged = createInitialMergedProps(props[0]); for (let i2 = 1; i2 < props.length; i2 += 1) { merged = mergeInto(merged, props[i2]); } return merged; } function createInitialMergedProps(inputProps) { if (isPropsGetter(inputProps)) { return { ...resolvePropsGetter(inputProps, EMPTY_PROPS) }; } return copyInitialProps(inputProps); } function mergeInto(merged, inputProps) { if (isPropsGetter(inputProps)) { return resolvePropsGetter(inputProps, merged); } return mutablyMergeInto(merged, inputProps); } function copyInitialProps(inputProps) { const copiedProps = { ...inputProps }; for (const propName in copiedProps) { const propValue = copiedProps[propName]; if (isEventHandler(propName, propValue)) { copiedProps[propName] = wrapEventHandler(propValue); } } return copiedProps; } function mutablyMergeInto(mergedProps, externalProps) { if (!externalProps) { return mergedProps; } for (const propName in externalProps) { const externalPropValue = externalProps[propName]; switch (propName) { case "style": { mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue); break; } case "className": { mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue); break; } default: { if (isEventHandler(propName, externalPropValue)) { mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue); } else { mergedProps[propName] = externalPropValue; } } } } return mergedProps; } function isEventHandler(key, value) { const code0 = key.charCodeAt(0); const code1 = key.charCodeAt(1); const code2 = key.charCodeAt(2); return code0 === 111 && code1 === 110 && code2 >= 65 && code2 <= 90 && (typeof value === "function" || typeof value === "undefined"); } function isPropsGetter(inputProps) { return typeof inputProps === "function"; } function resolvePropsGetter(inputProps, previousProps) { if (isPropsGetter(inputProps)) { return inputProps(previousProps); } return inputProps ?? EMPTY_PROPS; } function mergeEventHandlers(ourHandler, theirHandler) { if (!theirHandler) { return ourHandler; } if (!ourHandler) { return wrapEventHandler(theirHandler); } return (...args) => { const event = args[0]; if (isSyntheticEvent(event)) { const baseUIEvent = event; makeEventPreventable(baseUIEvent); const result2 = theirHandler(...args); if (!baseUIEvent.baseUIHandlerPrevented) { ourHandler?.(...args); } return result2; } const result = theirHandler(...args); ourHandler?.(...args); return result; }; } function wrapEventHandler(handler) { if (!handler) { return handler; } return (...args) => { const event = args[0]; if (isSyntheticEvent(event)) { makeEventPreventable(event); } return handler(...args); }; } function makeEventPreventable(event) { event.preventBaseUIHandler = () => { event.baseUIHandlerPrevented = true; }; return event; } function mergeClassNames(ourClassName, theirClassName) { if (theirClassName) { if (ourClassName) { return theirClassName + " " + ourClassName; } return theirClassName; } return ourClassName; } function isSyntheticEvent(event) { return event != null && typeof event === "object" && "nativeEvent" in event; } // node_modules/@base-ui/react/internals/useRenderElement.mjs var import_react = __toESM(require_react(), 1); function useRenderElement(element, componentProps, params = {}) { const renderProp = componentProps.render; const outProps = useRenderElementProps(componentProps, params); if (params.enabled === false) { return null; } const state = params.state ?? EMPTY_OBJECT; return evaluateRenderProp(element, renderProp, outProps, state); } function useRenderElementProps(componentProps, params = {}) { const { className: classNameProp, style: styleProp, render: renderProp } = componentProps; const { state = EMPTY_OBJECT, ref, props, stateAttributesMapping: stateAttributesMapping3, enabled = true } = params; const className = enabled ? resolveClassName(classNameProp, state) : void 0; const style = enabled ? resolveStyle(styleProp, state) : void 0; const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping3) : EMPTY_OBJECT; const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : void 0; const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT; if (typeof document !== "undefined") { if (!enabled) { useMergedRefs(null, null); } else if (Array.isArray(ref)) { outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]); } else { outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref); } } if (!enabled) { return EMPTY_OBJECT; } if (className !== void 0) { outProps.className = mergeClassNames(outProps.className, className); } if (style !== void 0) { outProps.style = mergeObjects(outProps.style, style); } return outProps; } function resolveRenderFunctionProps(props) { if (Array.isArray(props)) { return mergePropsN(props); } return mergeProps(void 0, props); } var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"); var COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/; var LOWERCASE_CHARACTER_PATTERN = /[a-z]/; function evaluateRenderProp(element, render, props, state) { if (render) { if (typeof render === "function") { if (true) { warnIfRenderPropLooksLikeComponent(render); } return render(props, state); } const mergedProps = mergeProps(props, render.props); mergedProps.ref = props.ref; let newElement = render; if (newElement?.$$typeof === REACT_LAZY_TYPE) { const children = React8.Children.toArray(render); newElement = children[0]; } if (true) { if (!/* @__PURE__ */ React8.isValidElement(newElement)) { throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.", "A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.", "https://base-ui.com/r/invalid-render-prop"].join("\n")); } } return /* @__PURE__ */ React8.cloneElement(newElement, mergedProps); } if (element) { if (typeof element === "string") { return renderTag(element, props); } } throw new Error(true ? "Base UI: Render element or function are not defined." : formatErrorMessage_default(8)); } function warnIfRenderPropLooksLikeComponent(renderFn) { const functionName = renderFn.name; if (functionName.length === 0) { return; } if (!COMPONENT_IDENTIFIER_PATTERN.test(functionName)) { return; } if (!LOWERCASE_CHARACTER_PATTERN.test(functionName)) { return; } warn(`The \`render\` prop received a function named \`${functionName}\` that starts with an uppercase letter.`, "This usually means a React component was passed directly as `render={Component}`.", "Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.", "If this is an intentional render callback, rename it to start with a lowercase letter.", "Use `render={}` or `render={(props) => }` instead.", "https://base-ui.com/r/invalid-render-prop"); } function renderTag(Tag, props) { if (Tag === "button") { return /* @__PURE__ */ (0, import_react.createElement)("button", { type: "button", ...props, key: props.key }); } if (Tag === "img") { return /* @__PURE__ */ (0, import_react.createElement)("img", { alt: "", ...props, key: props.key }); } return /* @__PURE__ */ React8.createElement(Tag, props); } // node_modules/@base-ui/utils/useId.mjs var React9 = __toESM(require_react(), 1); var globalId = 0; function useGlobalId(idOverride, prefix = "mui") { const [defaultId, setDefaultId] = React9.useState(idOverride); const id = idOverride || defaultId; React9.useEffect(() => { if (defaultId == null) { globalId += 1; setDefaultId(`${prefix}-${globalId}`); } }, [defaultId, prefix]); return id; } var maybeReactUseId = SafeReact.useId; function useId(idOverride, prefix) { if (maybeReactUseId !== void 0) { const reactId = maybeReactUseId(); return idOverride ?? (prefix ? `${prefix}-${reactId}` : reactId); } return useGlobalId(idOverride, prefix); } // node_modules/@base-ui/react/internals/useBaseUiId.mjs function useBaseUiId(idOverride) { return useId(idOverride, "base-ui"); } // node_modules/@base-ui/react/internals/reason-parts.mjs var reason_parts_exports = {}; __export(reason_parts_exports, { cancelOpen: () => cancelOpen, chipRemovePress: () => chipRemovePress, clearPress: () => clearPress, closePress: () => closePress, closeWatcher: () => closeWatcher, decrementPress: () => decrementPress, disabled: () => disabled, drag: () => drag, escapeKey: () => escapeKey, focusOut: () => focusOut, imperativeAction: () => imperativeAction, incrementPress: () => incrementPress, initial: () => initial, inputBlur: () => inputBlur, inputChange: () => inputChange, inputClear: () => inputClear, inputPaste: () => inputPaste, inputPress: () => inputPress, itemPress: () => itemPress, keyboard: () => keyboard, linkPress: () => linkPress, listNavigation: () => listNavigation, missing: () => missing, none: () => none, outsidePress: () => outsidePress, pointer: () => pointer, scrub: () => scrub, siblingOpen: () => siblingOpen, swipe: () => swipe, trackPress: () => trackPress, triggerFocus: () => triggerFocus, triggerHover: () => triggerHover, triggerPress: () => triggerPress, wheel: () => wheel, windowResize: () => windowResize }); var none = "none"; var triggerPress = "trigger-press"; var triggerHover = "trigger-hover"; var triggerFocus = "trigger-focus"; var outsidePress = "outside-press"; var itemPress = "item-press"; var closePress = "close-press"; var linkPress = "link-press"; var clearPress = "clear-press"; var chipRemovePress = "chip-remove-press"; var trackPress = "track-press"; var incrementPress = "increment-press"; var decrementPress = "decrement-press"; var inputChange = "input-change"; var inputClear = "input-clear"; var inputBlur = "input-blur"; var inputPaste = "input-paste"; var inputPress = "input-press"; var focusOut = "focus-out"; var escapeKey = "escape-key"; var closeWatcher = "close-watcher"; var listNavigation = "list-navigation"; var keyboard = "keyboard"; var pointer = "pointer"; var drag = "drag"; var wheel = "wheel"; var scrub = "scrub"; var cancelOpen = "cancel-open"; var siblingOpen = "sibling-open"; var disabled = "disabled"; var missing = "missing"; var initial = "initial"; var imperativeAction = "imperative-action"; var swipe = "swipe"; var windowResize = "window-resize"; // node_modules/@base-ui/react/internals/createBaseUIEventDetails.mjs function createChangeEventDetails(reason, event, trigger, customProperties) { let canceled = false; let allowPropagation = false; const custom = customProperties ?? EMPTY_OBJECT; const details = { reason, event: event ?? new Event("base-ui"), cancel() { canceled = true; }, allowPropagation() { allowPropagation = true; }, get isCanceled() { return canceled; }, get isPropagationAllowed() { return allowPropagation; }, trigger, ...custom }; return details; } // node_modules/@base-ui/react/internals/useTransitionStatus.mjs var React11 = __toESM(require_react(), 1); // node_modules/@base-ui/utils/useOnMount.mjs var React10 = __toESM(require_react(), 1); var EMPTY = []; function useOnMount(fn) { React10.useEffect(fn, EMPTY); } // node_modules/@base-ui/utils/useAnimationFrame.mjs var EMPTY2 = null; var LAST_RAF = globalThis.requestAnimationFrame; var Scheduler = class { /* This implementation uses an array as a backing data-structure for frame callbacks. * It allows `O(1)` callback cancelling by inserting a `null` in the array, though it * never calls the native `cancelAnimationFrame` if there are no frames left. This can * be much more efficient if there is a call pattern that alterns as * "request-cancel-request-cancel-…". * But in the case of "request-request-…-cancel-cancel-…", it leaves the final animation * frame to run anyway. We turn that frame into a `O(1)` no-op via `callbacksCount`. */ callbacks = []; callbacksCount = 0; nextId = 1; startId = 1; isScheduled = false; tick = (timestamp) => { this.isScheduled = false; const currentCallbacks = this.callbacks; const currentCallbacksCount = this.callbacksCount; this.callbacks = []; this.callbacksCount = 0; this.startId = this.nextId; if (currentCallbacksCount > 0) { for (let i2 = 0; i2 < currentCallbacks.length; i2 += 1) { currentCallbacks[i2]?.(timestamp); } } }; request(fn) { const id = this.nextId; this.nextId += 1; this.callbacks.push(fn); this.callbacksCount += 1; const didRAFChange = LAST_RAF !== requestAnimationFrame && (LAST_RAF = requestAnimationFrame, true); if (!this.isScheduled || didRAFChange) { requestAnimationFrame(this.tick); this.isScheduled = true; } return id; } cancel(id) { const index2 = id - this.startId; if (index2 < 0 || index2 >= this.callbacks.length) { return; } this.callbacks[index2] = null; this.callbacksCount -= 1; } }; var scheduler = new Scheduler(); var AnimationFrame = class _AnimationFrame { static create() { return new _AnimationFrame(); } static request(fn) { return scheduler.request(fn); } static cancel(id) { return scheduler.cancel(id); } currentId = EMPTY2; /** * Executes `fn` after `delay`, clearing any previously scheduled call. */ request(fn) { this.cancel(); this.currentId = scheduler.request(() => { this.currentId = EMPTY2; fn(); }); } cancel = () => { if (this.currentId !== EMPTY2) { scheduler.cancel(this.currentId); this.currentId = EMPTY2; } }; disposeEffect = () => { return this.cancel; }; }; function useAnimationFrame() { const timeout = useRefWithInit(AnimationFrame.create).current; useOnMount(timeout.disposeEffect); return timeout; } // node_modules/@base-ui/react/internals/useTransitionStatus.mjs function useTransitionStatus(open, enableIdleState = false, deferEndingState = false) { const [transitionStatus, setTransitionStatus] = React11.useState(open && enableIdleState ? "idle" : void 0); const [mounted, setMounted] = React11.useState(open); if (open && !mounted) { setMounted(true); setTransitionStatus("starting"); } if (!open && mounted && transitionStatus !== "ending" && !deferEndingState) { setTransitionStatus("ending"); } if (!open && !mounted && transitionStatus === "ending") { setTransitionStatus(void 0); } useIsoLayoutEffect(() => { if (!open && mounted && transitionStatus !== "ending" && deferEndingState) { const frame = AnimationFrame.request(() => { setTransitionStatus("ending"); }); return () => { AnimationFrame.cancel(frame); }; } return void 0; }, [open, mounted, transitionStatus, deferEndingState]); useIsoLayoutEffect(() => { if (!open || enableIdleState) { return void 0; } const frame = AnimationFrame.request(() => { setTransitionStatus(void 0); }); return () => { AnimationFrame.cancel(frame); }; }, [enableIdleState, open]); useIsoLayoutEffect(() => { if (!open || !enableIdleState) { return void 0; } if (open && mounted && transitionStatus !== "idle") { setTransitionStatus("starting"); } const frame = AnimationFrame.request(() => { setTransitionStatus("idle"); }); return () => { AnimationFrame.cancel(frame); }; }, [enableIdleState, open, mounted, transitionStatus]); return { mounted, setMounted, transitionStatus }; } // node_modules/@base-ui/react/internals/stateAttributesMapping.mjs var TransitionStatusDataAttributes = /* @__PURE__ */ (function(TransitionStatusDataAttributes2) { TransitionStatusDataAttributes2["startingStyle"] = "data-starting-style"; TransitionStatusDataAttributes2["endingStyle"] = "data-ending-style"; return TransitionStatusDataAttributes2; })({}); var STARTING_HOOK = { [TransitionStatusDataAttributes.startingStyle]: "" }; var ENDING_HOOK = { [TransitionStatusDataAttributes.endingStyle]: "" }; var transitionStatusMapping = { transitionStatus(value) { if (value === "starting") { return STARTING_HOOK; } if (value === "ending") { return ENDING_HOOK; } return null; } }; // node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs function hasWindow() { return typeof window !== "undefined"; } function getNodeName(node) { if (isNode(node)) { return (node.nodeName || "").toLowerCase(); } return "#document"; } function getWindow(node) { var _node$ownerDocument; return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; } function getDocumentElement(node) { var _ref; return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement; } function isNode(value) { if (!hasWindow()) { return false; } return value instanceof Node || value instanceof getWindow(value).Node; } function isElement(value) { if (!hasWindow()) { return false; } return value instanceof Element || value instanceof getWindow(value).Element; } function isHTMLElement(value) { if (!hasWindow()) { return false; } return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement; } function isShadowRoot(value) { if (!hasWindow() || typeof ShadowRoot === "undefined") { return false; } return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot; } function isOverflowElement(element) { const { overflow, overflowX, overflowY, display } = getComputedStyle2(element); return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== "inline" && display !== "contents"; } function isTableElement(element) { return /^(table|td|th)$/.test(getNodeName(element)); } function isTopLayer(element) { try { if (element.matches(":popover-open")) { return true; } } catch (_e) { } try { return element.matches(":modal"); } catch (_e) { return false; } } var willChangeRe = /transform|translate|scale|rotate|perspective|filter/; var containRe = /paint|layout|strict|content/; var isNotNone = (value) => !!value && value !== "none"; var isWebKitValue; function isContainingBlock(elementOrCss) { const css = isElement(elementOrCss) ? getComputedStyle2(elementOrCss) : elementOrCss; return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || "") || containRe.test(css.contain || ""); } function getContainingBlock(element) { let currentNode = getParentNode(element); while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) { if (isContainingBlock(currentNode)) { return currentNode; } else if (isTopLayer(currentNode)) { return null; } currentNode = getParentNode(currentNode); } return null; } function isWebKit() { if (isWebKitValue == null) { isWebKitValue = typeof CSS !== "undefined" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none"); } return isWebKitValue; } function isLastTraversableNode(node) { return /^(html|body|#document)$/.test(getNodeName(node)); } function getComputedStyle2(element) { return getWindow(element).getComputedStyle(element); } function getNodeScroll(element) { if (isElement(element)) { return { scrollLeft: element.scrollLeft, scrollTop: element.scrollTop }; } return { scrollLeft: element.scrollX, scrollTop: element.scrollY }; } function getParentNode(node) { if (getNodeName(node) === "html") { return node; } const result = ( // Step into the shadow DOM of the parent of a slotted node. node.assignedSlot || // DOM Element detected. node.parentNode || // ShadowRoot detected. isShadowRoot(node) && node.host || // Fallback. getDocumentElement(node) ); return isShadowRoot(result) ? result.host : result; } function getNearestOverflowAncestor(node) { const parentNode = getParentNode(node); if (isLastTraversableNode(parentNode)) { return node.ownerDocument ? node.ownerDocument.body : node.body; } if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) { return parentNode; } return getNearestOverflowAncestor(parentNode); } function getOverflowAncestors(node, list, traverseIframes) { var _node$ownerDocument2; if (list === void 0) { list = []; } if (traverseIframes === void 0) { traverseIframes = true; } const scrollableAncestor = getNearestOverflowAncestor(node); const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body); const win = getWindow(scrollableAncestor); if (isBody) { const frameElement = getFrameElement(win); return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []); } else { return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes)); } } function getFrameElement(win) { return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null; } // node_modules/@base-ui/utils/addEventListener.mjs function addEventListener(target, type, listener, options) { target.addEventListener(type, listener, options); return () => { target.removeEventListener(type, listener, options); }; } // node_modules/@base-ui/utils/useValueAsRef.mjs function useValueAsRef(value) { const latest = useRefWithInit(createLatestRef, value).current; latest.next = value; useIsoLayoutEffect(latest.effect); return latest; } function createLatestRef(value) { const latest = { current: value, next: value, effect: () => { latest.current = latest.next; } }; return latest; } // node_modules/@base-ui/utils/owner.mjs function ownerDocument(node) { return node?.ownerDocument || document; } // node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs var React12 = __toESM(require_react(), 1); // node_modules/@base-ui/react/internals/useAnimationsFinished.mjs var ReactDOM = __toESM(require_react_dom(), 1); // node_modules/@base-ui/react/utils/resolveRef.mjs function resolveRef(maybeRef) { if (maybeRef == null) { return maybeRef; } return "current" in maybeRef ? maybeRef.current : maybeRef; } // node_modules/@base-ui/react/internals/useAnimationsFinished.mjs function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false, treatAbortedAsFinished = true) { const frame = useAnimationFrame(); return useStableCallback((fnToExecute, signal = null) => { frame.cancel(); const element = resolveRef(elementOrRef); if (element == null) { return; } const resolvedElement = element; const done = () => { ReactDOM.flushSync(fnToExecute); }; if (typeof resolvedElement.getAnimations !== "function" || globalThis.BASE_UI_ANIMATIONS_DISABLED) { fnToExecute(); return; } function exec() { Promise.all(resolvedElement.getAnimations().map((animation) => animation.finished)).then(() => { if (!signal?.aborted) { done(); } }).catch(() => { if (treatAbortedAsFinished) { if (!signal?.aborted) { done(); } return; } const currentAnimations = resolvedElement.getAnimations(); if (!signal?.aborted && currentAnimations.length > 0 && currentAnimations.some((animation) => animation.pending || animation.playState !== "finished")) { exec(); } }); } if (waitForStartingStyleRemoved) { const startingStyleAttribute = TransitionStatusDataAttributes.startingStyle; if (!resolvedElement.hasAttribute(startingStyleAttribute)) { frame.request(exec); return; } const attributeObserver = new MutationObserver(() => { if (!resolvedElement.hasAttribute(startingStyleAttribute)) { attributeObserver.disconnect(); exec(); } }); attributeObserver.observe(resolvedElement, { attributes: true, attributeFilter: [startingStyleAttribute] }); signal?.addEventListener("abort", () => attributeObserver.disconnect(), { once: true }); return; } frame.request(exec); }); } // node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs function useOpenChangeComplete(parameters) { const { enabled = true, open, ref, onComplete: onCompleteParam } = parameters; const onComplete = useStableCallback(onCompleteParam); const runOnceAnimationsFinish = useAnimationsFinished(ref, open, false); React12.useEffect(() => { if (!enabled) { return void 0; } const abortController = new AbortController(); runOnceAnimationsFinish(onComplete, abortController.signal); return () => { abortController.abort(); }; }, [enabled, open, onComplete, runOnceAnimationsFinish]); } // node_modules/@base-ui/utils/useOnFirstRender.mjs var React13 = __toESM(require_react(), 1); function useOnFirstRender(fn) { const ref = React13.useRef(true); if (ref.current) { ref.current = false; fn(); } } // node_modules/@base-ui/utils/platform/parts.mjs var parts_exports = {}; __export(parts_exports, { engine: () => engine_exports, env: () => env_exports, os: () => os_exports, screenReader: () => screen_reader_exports }); // node_modules/@base-ui/utils/platform/os.mjs var os_exports = {}; __export(os_exports, { android: () => android, apple: () => apple, ios: () => ios, linux: () => linux, mac: () => mac, windows: () => windows }); // node_modules/@base-ui/utils/platform/shared.mjs function readRawData() { if (typeof navigator === "undefined") { return { userAgent: "", platform: "", maxTouchPoints: 0 }; } if (true) { const uaData = navigator.userAgentData; if (uaData && Array.isArray(uaData.brands)) { return { userAgent: uaData.brands.map(({ brand, version: version2 }) => `${brand}/${version2}`).join(" "), platform: uaData.platform ?? navigator.platform ?? "", maxTouchPoints: navigator.maxTouchPoints ?? 0 }; } } return { userAgent: navigator.userAgent, platform: navigator.platform ?? "", maxTouchPoints: navigator.maxTouchPoints ?? 0 }; } var { userAgent, platform, maxTouchPoints } = readRawData(); var lowerUserAgent = userAgent.toLowerCase(); var lowerPlatform = platform.toLowerCase(); // node_modules/@base-ui/utils/platform/os.mjs var ios = /^i(os$|p)/.test(lowerPlatform) || lowerPlatform === "macintel" && maxTouchPoints > 1; var ANDROID_STRING = "android"; var android = lowerPlatform === ANDROID_STRING || lowerUserAgent.includes(ANDROID_STRING); var mac = !ios && lowerPlatform.startsWith("mac"); var windows = lowerPlatform.startsWith("win"); var linux = !android && /^(linux|chrome os)/.test(lowerPlatform); var apple = mac || ios; // node_modules/@base-ui/utils/platform/engine.mjs var engine_exports = {}; __export(engine_exports, { blink: () => blink, gecko: () => gecko, webkit: () => webkit }); var webkit = typeof CSS !== "undefined" && !!CSS.supports?.("-webkit-backdrop-filter:none"); var gecko = !webkit && lowerUserAgent.includes("firefox"); var blink = !webkit && lowerUserAgent.includes("chrom"); // node_modules/@base-ui/utils/platform/screen-reader.mjs var screen_reader_exports = {}; __export(screen_reader_exports, { voiceOver: () => voiceOver }); var voiceOver = apple; // node_modules/@base-ui/utils/platform/env.mjs var env_exports = {}; __export(env_exports, { jsdom: () => jsdom }); var jsdom = /jsdom|happydom/.test(lowerUserAgent); // node_modules/@base-ui/utils/useTimeout.mjs var EMPTY3 = 0; var Timeout = class _Timeout { static create() { return new _Timeout(); } currentId = EMPTY3; /** * Executes `fn` after `delay`, clearing any previously scheduled call. */ start(delay, fn) { this.clear(); this.currentId = setTimeout(() => { this.currentId = EMPTY3; fn(); }, delay); } isStarted() { return this.currentId !== EMPTY3; } clear = () => { if (this.currentId !== EMPTY3) { clearTimeout(this.currentId); this.currentId = EMPTY3; } }; disposeEffect = () => { return this.clear; }; }; function useTimeout() { const timeout = useRefWithInit(Timeout.create).current; useOnMount(timeout.disposeEffect); return timeout; } // node_modules/@base-ui/react/floating-ui-react/components/FloatingDelayGroup.mjs var React14 = __toESM(require_react(), 1); // node_modules/@base-ui/react/floating-ui-react/utils/event.mjs function isReactEvent(event) { return "nativeEvent" in event; } function isMouseLikePointerType(pointerType, strict) { const values = ["mouse", "pen"]; if (!strict) { values.push("", void 0); } return values.includes(pointerType); } function isClickLikeEvent(event) { const type = event.type; return type === "click" || type === "mousedown" || type === "keydown" || type === "keyup"; } // node_modules/@base-ui/react/floating-ui-react/utils/constants.mjs var FOCUSABLE_ATTRIBUTE = "data-base-ui-focusable"; var TYPEABLE_SELECTOR = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])"; // node_modules/@base-ui/react/internals/shadowDom.mjs function activeElement(doc) { let element = doc.activeElement; while (element?.shadowRoot?.activeElement != null) { element = element.shadowRoot.activeElement; } return element; } function contains(parent, child) { if (!parent || !child) { return false; } const rootNode = child.getRootNode?.(); if (parent.contains(child)) { return true; } if (rootNode && isShadowRoot(rootNode)) { let next = child; while (next) { if (parent === next) { return true; } next = next.parentNode || next.host; } } return false; } function getTarget(event) { if ("composedPath" in event) { return event.composedPath()[0]; } return event.target; } // node_modules/@base-ui/react/floating-ui-react/utils/element.mjs function isTargetInsideEnabledTrigger(target, triggerElements) { if (!isElement(target)) { return false; } const targetElement = target; if (triggerElements.hasElement(targetElement)) { return !targetElement.hasAttribute("data-trigger-disabled"); } for (const [, trigger] of triggerElements.entries()) { if (contains(trigger, targetElement)) { return !trigger.hasAttribute("data-trigger-disabled"); } } return false; } function isEventTargetWithin(event, node) { if (node == null) { return false; } if ("composedPath" in event) { return event.composedPath().includes(node); } const eventAgain = event; return eventAgain.target != null && node.contains(eventAgain.target); } function isRootElement(element) { return element.matches("html,body"); } function isTypeableElement(element) { return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR); } function isInteractiveElement(element) { return element?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${TYPEABLE_SELECTOR}`) != null; } function matchesFocusVisible(element) { if (!element || parts_exports.env.jsdom) { return true; } try { return element.matches(":focus-visible"); } catch (_e) { return true; } } // node_modules/@base-ui/react/floating-ui-react/hooks/useHoverShared.mjs function resolveValue(value, pointerType) { if (pointerType != null && !isMouseLikePointerType(pointerType)) { return 0; } if (typeof value === "function") { return value(); } return value; } function getDelay(value, prop, pointerType) { const result = resolveValue(value, pointerType); if (typeof result === "number") { return result; } return result?.[prop]; } function getRestMs(value) { if (typeof value === "function") { return value(); } return value; } function isClickLikeOpenEvent(openEventType, interactedInside) { return interactedInside || openEventType === "click" || openEventType === "mousedown"; } function isHoverOpenEvent(openEventType) { return openEventType?.includes("mouse") && openEventType !== "mousedown"; } // node_modules/@base-ui/react/floating-ui-react/components/FloatingDelayGroup.mjs var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); var FloatingDelayGroupContext = /* @__PURE__ */ React14.createContext({ hasProvider: false, timeoutMs: 0, delayRef: { current: 0 }, initialDelayRef: { current: 0 }, timeout: new Timeout(), currentIdRef: { current: null }, currentContextRef: { current: null } }); if (true) FloatingDelayGroupContext.displayName = "FloatingDelayGroupContext"; function resetDelayRef(delayRef, initialDelayRef) { delayRef.current = initialDelayRef.current; } function FloatingDelayGroup(props) { const { children, delay, timeoutMs = 0 } = props; const delayRef = React14.useRef(delay); const initialDelayRef = React14.useRef(delay); const currentIdRef = React14.useRef(null); const currentContextRef = React14.useRef(null); const timeout = useTimeout(); useIsoLayoutEffect(() => { initialDelayRef.current = delay; if (!currentIdRef.current) { delayRef.current = delay; return; } delayRef.current = { open: getDelay(delayRef.current, "open"), close: getDelay(delay, "close") }; }, [delay, currentIdRef, delayRef, initialDelayRef]); return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FloatingDelayGroupContext.Provider, { value: React14.useMemo(() => ({ hasProvider: true, delayRef, initialDelayRef, currentIdRef, timeoutMs, currentContextRef, timeout }), [timeoutMs, timeout]), children }); } function useDelayGroup(context, options = { open: false }) { const { open } = options; const store = "rootStore" in context ? context.rootStore : context; const floatingId = store.useState("floatingId"); const groupContext = React14.useContext(FloatingDelayGroupContext); const { currentIdRef, delayRef, timeoutMs, initialDelayRef, currentContextRef, hasProvider, timeout } = groupContext; const [isInstantPhase, setIsInstantPhase] = React14.useState(false); const openRef = React14.useRef(open); const isUnmountedRef = React14.useRef(false); useIsoLayoutEffect(() => { openRef.current = open; }, [open]); useIsoLayoutEffect(() => { return () => { isUnmountedRef.current = true; }; }, []); useIsoLayoutEffect(() => { function unset() { if (!isUnmountedRef.current) { setIsInstantPhase(false); } currentContextRef.current?.setIsInstantPhase(false); currentIdRef.current = null; currentContextRef.current = null; delayRef.current = initialDelayRef.current; timeout.clear(); } if (!currentIdRef.current) { return void 0; } if (!open && currentIdRef.current === floatingId) { setIsInstantPhase(false); if (timeoutMs) { const closingId = floatingId; timeout.start(timeoutMs, () => { if (store.select("open") || currentIdRef.current && currentIdRef.current !== closingId) { return; } unset(); }); return () => { if (openRef.current || currentIdRef.current !== closingId) { timeout.clear(); } }; } unset(); } return void 0; }, [open, floatingId, currentIdRef, delayRef, timeoutMs, initialDelayRef, currentContextRef, timeout, store]); useIsoLayoutEffect(() => { if (!open) { return; } const prevContext = currentContextRef.current; const prevId = currentIdRef.current; timeout.clear(); currentContextRef.current = { onOpenChange: store.setOpen, setIsInstantPhase }; currentIdRef.current = floatingId; delayRef.current = { open: 0, close: getDelay(initialDelayRef.current, "close") }; if (prevId !== null && prevId !== floatingId) { setIsInstantPhase(true); prevContext?.setIsInstantPhase(true); prevContext?.onOpenChange(false, createChangeEventDetails(reason_parts_exports.none)); } else { setIsInstantPhase(false); prevContext?.setIsInstantPhase(false); } }, [open, floatingId, store, currentIdRef, delayRef, initialDelayRef, currentContextRef, timeout]); useIsoLayoutEffect(() => { return () => { if (currentIdRef.current === floatingId) { currentContextRef.current = null; if (!openRef.current) { return; } currentIdRef.current = null; resetDelayRef(delayRef, initialDelayRef); timeout.clear(); } }; }, [currentContextRef, currentIdRef, delayRef, floatingId, initialDelayRef, timeout]); return React14.useMemo(() => ({ hasProvider, delayRef, isInstantPhase }), [hasProvider, delayRef, isInstantPhase]); } // node_modules/@base-ui/utils/mergeCleanups.mjs function mergeCleanups(...cleanups) { return () => { for (let i2 = 0; i2 < cleanups.length; i2 += 1) { const cleanup = cleanups[i2]; if (cleanup) { cleanup(); } } }; } // node_modules/@base-ui/react/utils/FocusGuard.mjs var React15 = __toESM(require_react(), 1); // node_modules/@base-ui/utils/visuallyHidden.mjs var visuallyHiddenBase = { clipPath: "inset(50%)", overflow: "hidden", whiteSpace: "nowrap", border: 0, padding: 0, width: 1, height: 1, margin: -1 }; var visuallyHidden = { ...visuallyHiddenBase, position: "fixed", top: 0, left: 0 }; var visuallyHiddenInput = { ...visuallyHiddenBase, position: "absolute" }; // node_modules/@base-ui/react/utils/FocusGuard.mjs var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); var FocusGuard = /* @__PURE__ */ React15.forwardRef(function FocusGuard2(props, ref) { const [role, setRole] = React15.useState(); useIsoLayoutEffect(() => { if (parts_exports.screenReader.voiceOver && parts_exports.engine.webkit) { setRole("button"); } }, []); const restProps = { tabIndex: 0, // Role is only for VoiceOver role }; return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { ...props, ref, style: visuallyHidden, "aria-hidden": role ? void 0 : true, ...restProps, "data-base-ui-focus-guard": "" }); }); if (true) FocusGuard.displayName = "FocusGuard"; // node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs var sides = ["top", "right", "bottom", "left"]; var min = Math.min; var max = Math.max; var round = Math.round; var floor = Math.floor; var createCoords = (v2) => ({ x: v2, y: v2 }); var oppositeSideMap = { left: "right", right: "left", bottom: "top", top: "bottom" }; function clamp(start, value, end) { return max(start, min(value, end)); } function evaluate(value, param) { return typeof value === "function" ? value(param) : value; } function getSide(placement) { return placement.split("-")[0]; } function getAlignment(placement) { return placement.split("-")[1]; } function getOppositeAxis(axis) { return axis === "x" ? "y" : "x"; } function getAxisLength(axis) { return axis === "y" ? "height" : "width"; } function getSideAxis(placement) { const firstChar = placement[0]; return firstChar === "t" || firstChar === "b" ? "y" : "x"; } function getAlignmentAxis(placement) { return getOppositeAxis(getSideAxis(placement)); } function getAlignmentSides(placement, rects, rtl) { if (rtl === void 0) { rtl = false; } const alignment = getAlignment(placement); const alignmentAxis = getAlignmentAxis(placement); const length = getAxisLength(alignmentAxis); let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top"; if (rects.reference[length] > rects.floating[length]) { mainAlignmentSide = getOppositePlacement(mainAlignmentSide); } return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)]; } function getExpandedPlacements(placement) { const oppositePlacement = getOppositePlacement(placement); return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)]; } function getOppositeAlignmentPlacement(placement) { return placement.includes("start") ? placement.replace("start", "end") : placement.replace("end", "start"); } var lrPlacement = ["left", "right"]; var rlPlacement = ["right", "left"]; var tbPlacement = ["top", "bottom"]; var btPlacement = ["bottom", "top"]; function getSideList(side, isStart, rtl) { switch (side) { case "top": case "bottom": if (rtl) return isStart ? rlPlacement : lrPlacement; return isStart ? lrPlacement : rlPlacement; case "left": case "right": return isStart ? tbPlacement : btPlacement; default: return []; } } function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) { const alignment = getAlignment(placement); let list = getSideList(getSide(placement), direction === "start", rtl); if (alignment) { list = list.map((side) => side + "-" + alignment); if (flipAlignment) { list = list.concat(list.map(getOppositeAlignmentPlacement)); } } return list; } function getOppositePlacement(placement) { const side = getSide(placement); return oppositeSideMap[side] + placement.slice(side.length); } function expandPaddingObject(padding) { return { top: 0, right: 0, bottom: 0, left: 0, ...padding }; } function getPaddingObject(padding) { return typeof padding !== "number" ? expandPaddingObject(padding) : { top: padding, right: padding, bottom: padding, left: padding }; } function rectToClientRect(rect) { const { x: x2, y: y2, width, height } = rect; return { width, height, top: y2, left: x2, right: x2 + width, bottom: y2 + height, x: x2, y: y2 }; } // node_modules/@base-ui/react/floating-ui-react/utils/composite.mjs function isHiddenByStyles(styles) { return styles.visibility === "hidden" || styles.visibility === "collapse"; } function isElementVisible(element, styles = element ? getComputedStyle2(element) : null) { if (!element || !element.isConnected || !styles || isHiddenByStyles(styles)) { return false; } if (typeof element.checkVisibility === "function") { return element.checkVisibility(); } return styles.display !== "none" && styles.display !== "contents"; } // node_modules/@base-ui/react/floating-ui-react/utils/tabbable.mjs var CANDIDATE_SELECTOR = 'a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]'; function getParentElement(element) { const assignedSlot = element.assignedSlot; if (assignedSlot) { return assignedSlot; } if (element.parentElement) { return element.parentElement; } const rootNode = element.getRootNode(); return isShadowRoot(rootNode) ? rootNode.host : null; } function getDetailsSummary(details) { for (const child of Array.from(details.children)) { if (getNodeName(child) === "summary") { return child; } } return null; } function isWithinOpenDetailsSummary(element, details) { const summary = getDetailsSummary(details); return !!summary && (element === summary || contains(summary, element)); } function isFocusableCandidate(element) { const nodeName = element ? getNodeName(element) : ""; return element != null && element.matches(CANDIDATE_SELECTOR) && (nodeName !== "summary" || element.parentElement != null && getNodeName(element.parentElement) === "details" && getDetailsSummary(element.parentElement) === element) && (nodeName !== "details" || getDetailsSummary(element) == null) && (nodeName !== "input" || element.type !== "hidden"); } function isFocusableElement(element) { if (!isFocusableCandidate(element) || !element.isConnected || element.matches(":disabled")) { return false; } for (let current = element; current; current = getParentElement(current)) { const isAncestor = current !== element; const isSlot = getNodeName(current) === "slot"; if (current.hasAttribute("inert")) { return false; } if (isAncestor && getNodeName(current) === "details" && !current.open && !isWithinOpenDetailsSummary(element, current) || current.hasAttribute("hidden") || !isSlot && !isVisibleInTabbableTree(current, isAncestor)) { return false; } } return true; } function isVisibleInTabbableTree(element, isAncestor) { const styles = getComputedStyle2(element); if (!isAncestor) { return isElementVisible(element, styles); } return styles.display !== "none"; } function getTabIndex(element) { const tabIndex = element.tabIndex; if (tabIndex < 0) { const nodeName = getNodeName(element); if (nodeName === "details" || nodeName === "audio" || nodeName === "video" || isHTMLElement(element) && element.isContentEditable) { return 0; } } return tabIndex; } function getNamedRadioInput(element) { if (getNodeName(element) !== "input") { return null; } const input = element; return input.type === "radio" && input.name !== "" ? input : null; } function isTabbableRadio(element, candidates) { const input = getNamedRadioInput(element); if (!input) { return true; } const checkedRadio = candidates.find((candidate) => { const radio = getNamedRadioInput(candidate); return radio?.name === input.name && radio.form === input.form && radio.checked; }); if (checkedRadio) { return checkedRadio === input; } return candidates.find((candidate) => { const radio = getNamedRadioInput(candidate); return radio?.name === input.name && radio.form === input.form; }) === input; } function getComposedChildren(container) { if (isHTMLElement(container) && getNodeName(container) === "slot") { const assignedElements = container.assignedElements({ flatten: true }); if (assignedElements.length > 0) { return assignedElements; } } if (isHTMLElement(container) && container.shadowRoot) { return Array.from(container.shadowRoot.children); } return Array.from(container.children); } function appendCandidates(container, list) { getComposedChildren(container).forEach((child) => { if (isFocusableCandidate(child)) { list.push(child); } appendCandidates(child, list); }); } function appendMatchingElements(container, selector, list) { getComposedChildren(container).forEach((child) => { if (isHTMLElement(child) && child.matches(selector)) { list.push(child); } appendMatchingElements(child, selector, list); }); } function focusable(container) { const candidates = []; appendCandidates(container, candidates); return candidates.filter(isFocusableElement); } function tabbable(container) { const candidates = focusable(container); return candidates.filter((element) => getTabIndex(element) >= 0 && isTabbableRadio(element, candidates)); } function getTabbableIn(container, dir) { const list = tabbable(container); const len = list.length; if (len === 0) { return void 0; } const active = activeElement(ownerDocument(container)); const index2 = list.indexOf(active); const nextIndex = index2 === -1 ? dir === 1 ? 0 : len - 1 : index2 + dir; return list[nextIndex]; } function getNextTabbable(referenceElement) { return getTabbableIn(ownerDocument(referenceElement).body, 1) || referenceElement; } function getPreviousTabbable(referenceElement) { return getTabbableIn(ownerDocument(referenceElement).body, -1) || referenceElement; } function isOutsideEvent(event, container) { const containerElement = container || event.currentTarget; const relatedTarget = event.relatedTarget; return !relatedTarget || !contains(containerElement, relatedTarget); } function disableFocusInside(container) { const tabbableElements = tabbable(container); tabbableElements.forEach((element) => { element.dataset.tabindex = element.getAttribute("tabindex") || ""; element.setAttribute("tabindex", "-1"); }); } function enableFocusInside(container) { const elements2 = []; appendMatchingElements(container, "[data-tabindex]", elements2); elements2.forEach((element) => { const tabindex = element.dataset.tabindex; delete element.dataset.tabindex; if (tabindex) { element.setAttribute("tabindex", tabindex); } else { element.removeAttribute("tabindex"); } }); } // node_modules/@base-ui/react/floating-ui-react/utils/nodes.mjs function getNodeChildren(nodes, id, onlyOpenChildren = true) { const directChildren = nodes.filter((node) => node.parentId === id); return directChildren.flatMap((child) => [...!onlyOpenChildren || child.context?.open ? [child] : [], ...getNodeChildren(nodes, child.id, onlyOpenChildren)]); } // node_modules/@base-ui/react/floating-ui-react/utils/createAttribute.mjs function createAttribute(name2) { return `data-base-ui-${name2}`; } // node_modules/@base-ui/react/floating-ui-react/components/FloatingPortal.mjs var React16 = __toESM(require_react(), 1); var ReactDOM2 = __toESM(require_react_dom(), 1); // node_modules/@base-ui/react/internals/constants.mjs var DISABLED_TRANSITIONS_STYLE = { style: { transition: "none" } }; var BASE_UI_SWIPE_IGNORE_ATTRIBUTE = "data-base-ui-swipe-ignore"; var LEGACY_SWIPE_IGNORE_ATTRIBUTE = "data-swipe-ignore"; var BASE_UI_SWIPE_IGNORE_SELECTOR = `[${BASE_UI_SWIPE_IGNORE_ATTRIBUTE}]`; var LEGACY_SWIPE_IGNORE_SELECTOR = `[${LEGACY_SWIPE_IGNORE_ATTRIBUTE}]`; var POPUP_COLLISION_AVOIDANCE = { fallbackAxisSide: "end" }; var ownerVisuallyHidden = { clipPath: "inset(50%)", position: "fixed", top: 0, left: 0 }; // node_modules/@base-ui/react/floating-ui-react/components/FloatingPortal.mjs var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1); var PortalContext = /* @__PURE__ */ React16.createContext(null); if (true) PortalContext.displayName = "PortalContext"; var usePortalContext = () => React16.useContext(PortalContext); var attr = createAttribute("portal"); function useFloatingPortalNode(props = {}) { const { ref, container: containerProp, componentProps = EMPTY_OBJECT, elementProps } = props; const uniqueId = useId(); const portalContext = usePortalContext(); const parentPortalNode = portalContext?.portalNode; const [containerElement, setContainerElement] = React16.useState(null); const [portalNode, setPortalNode] = React16.useState(null); const setPortalNodeRef = useStableCallback((node) => { if (node !== null) { setPortalNode(node); } }); const containerRef = React16.useRef(null); useIsoLayoutEffect(() => { if (containerProp === null) { if (containerRef.current) { containerRef.current = null; setPortalNode(null); setContainerElement(null); } return; } if (uniqueId == null) { return; } const resolvedContainer = (containerProp && (isNode(containerProp) ? containerProp : containerProp.current)) ?? parentPortalNode ?? document.body; if (resolvedContainer == null) { if (containerRef.current) { containerRef.current = null; setPortalNode(null); setContainerElement(null); } return; } if (containerRef.current !== resolvedContainer) { containerRef.current = resolvedContainer; setPortalNode(null); setContainerElement(resolvedContainer); } }, [containerProp, parentPortalNode, uniqueId]); const portalElement = useRenderElement("div", componentProps, { ref: [ref, setPortalNodeRef], props: [{ id: uniqueId, [attr]: "" }, elementProps] }); const portalSubtree = containerElement && portalElement ? /* @__PURE__ */ ReactDOM2.createPortal(portalElement, containerElement) : null; return { portalNode, portalSubtree }; } var FloatingPortal = /* @__PURE__ */ React16.forwardRef(function FloatingPortal2(componentProps, forwardedRef) { const { render, className, style, children, container, renderGuards, ...elementProps } = componentProps; const { portalNode, portalSubtree } = useFloatingPortalNode({ container, ref: forwardedRef, componentProps, elementProps }); const beforeOutsideRef = React16.useRef(null); const afterOutsideRef = React16.useRef(null); const beforeInsideRef = React16.useRef(null); const afterInsideRef = React16.useRef(null); const [focusManagerState, setFocusManagerState] = React16.useState(null); const focusInsideDisabledRef = React16.useRef(false); const modal = focusManagerState?.modal; const open = focusManagerState?.open; const shouldRenderGuards = typeof renderGuards === "boolean" ? renderGuards : !!focusManagerState && !focusManagerState.modal && focusManagerState.open && !!portalNode; React16.useEffect(() => { if (!portalNode || modal) { return void 0; } function onFocus(event) { if (portalNode && event.relatedTarget && isOutsideEvent(event)) { if (event.type === "focusin") { if (focusInsideDisabledRef.current) { enableFocusInside(portalNode); focusInsideDisabledRef.current = false; } } else { disableFocusInside(portalNode); focusInsideDisabledRef.current = true; } } } return mergeCleanups(addEventListener(portalNode, "focusin", onFocus, true), addEventListener(portalNode, "focusout", onFocus, true)); }, [portalNode, modal]); useIsoLayoutEffect(() => { if (!portalNode || open !== true || !focusInsideDisabledRef.current) { return; } enableFocusInside(portalNode); focusInsideDisabledRef.current = false; }, [open, portalNode]); const portalContextValue = React16.useMemo(() => ({ beforeOutsideRef, afterOutsideRef, beforeInsideRef, afterInsideRef, portalNode, setFocusManagerState }), [portalNode]); return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(React16.Fragment, { children: [portalSubtree, /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(PortalContext.Provider, { value: portalContextValue, children: [shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(FocusGuard, { "data-type": "outside", ref: beforeOutsideRef, onFocus: (event) => { if (isOutsideEvent(event, portalNode)) { beforeInsideRef.current?.focus(); } else { const domReference = focusManagerState ? focusManagerState.domReference : null; const prevTabbable = getPreviousTabbable(domReference); prevTabbable?.focus(); } } }), shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { "aria-owns": portalNode.id, style: ownerVisuallyHidden }), portalNode && /* @__PURE__ */ ReactDOM2.createPortal(children, portalNode), shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(FocusGuard, { "data-type": "outside", ref: afterOutsideRef, onFocus: (event) => { if (isOutsideEvent(event, portalNode)) { afterInsideRef.current?.focus(); } else { const domReference = focusManagerState ? focusManagerState.domReference : null; const nextTabbable = getNextTabbable(domReference); nextTabbable?.focus(); if (focusManagerState?.closeOnFocusOut) { focusManagerState?.onOpenChange(false, createChangeEventDetails(reason_parts_exports.focusOut, event.nativeEvent)); } } } })] })] }); }); if (true) FloatingPortal.displayName = "FloatingPortal"; // node_modules/@base-ui/react/floating-ui-react/components/FloatingTree.mjs var React17 = __toESM(require_react(), 1); // node_modules/@base-ui/react/floating-ui-react/utils/createEventEmitter.mjs function createEventEmitter() { const map = /* @__PURE__ */ new Map(); return { emit(event, data) { map.get(event)?.forEach((listener) => listener(data)); }, on(event, listener) { if (!map.has(event)) { map.set(event, /* @__PURE__ */ new Set()); } map.get(event).add(listener); }, off(event, listener) { map.get(event)?.delete(listener); } }; } // node_modules/@base-ui/react/floating-ui-react/components/FloatingTree.mjs var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1); var FloatingNodeContext = /* @__PURE__ */ React17.createContext(null); if (true) FloatingNodeContext.displayName = "FloatingNodeContext"; var FloatingTreeContext = /* @__PURE__ */ React17.createContext(null); if (true) FloatingTreeContext.displayName = "FloatingTreeContext"; var useFloatingParentNodeId = () => React17.useContext(FloatingNodeContext)?.id || null; var useFloatingTree = (externalTree) => { const contextTree = React17.useContext(FloatingTreeContext); return externalTree ?? contextTree; }; // node_modules/@base-ui/react/floating-ui-react/hooks/useClientPoint.mjs var React18 = __toESM(require_react(), 1); function createVirtualElement(domElement, data) { let offsetX = null; let offsetY = null; let isAutoUpdateEvent = false; return { contextElement: domElement || void 0, getBoundingClientRect() { const domRect = domElement?.getBoundingClientRect() || { width: 0, height: 0, x: 0, y: 0 }; const isXAxis = data.axis === "x" || data.axis === "both"; const isYAxis = data.axis === "y" || data.axis === "both"; const canTrackCursorOnAutoUpdate = ["mouseenter", "mousemove"].includes(data.dataRef.current.openEvent?.type || "") && data.pointerType !== "touch"; let width = domRect.width; let height = domRect.height; let x2 = domRect.x; let y2 = domRect.y; if (offsetX == null && data.x && isXAxis) { offsetX = domRect.x - data.x; } if (offsetY == null && data.y && isYAxis) { offsetY = domRect.y - data.y; } x2 -= offsetX || 0; y2 -= offsetY || 0; width = 0; height = 0; if (!isAutoUpdateEvent || canTrackCursorOnAutoUpdate) { width = data.axis === "y" ? domRect.width : 0; height = data.axis === "x" ? domRect.height : 0; x2 = isXAxis && data.x != null ? data.x : x2; y2 = isYAxis && data.y != null ? data.y : y2; } else if (isAutoUpdateEvent && !canTrackCursorOnAutoUpdate) { height = data.axis === "x" ? domRect.height : height; width = data.axis === "y" ? domRect.width : width; } isAutoUpdateEvent = true; return { width, height, x: x2, y: y2, top: y2, right: x2 + width, bottom: y2 + height, left: x2 }; } }; } function isMouseBasedEvent(event) { return event != null && event.clientX != null; } function useClientPoint(context, props = {}) { const { enabled = true, axis = "both" } = props; const store = "rootStore" in context ? context.rootStore : context; const open = store.useState("open"); const floating = store.useState("floatingElement"); const domReference = store.useState("domReferenceElement"); const dataRef = store.context.dataRef; const initialRef = React18.useRef(false); const cleanupListenerRef = React18.useRef(null); const [pointerType, setPointerType] = React18.useState(); const [reactive, setReactive] = React18.useState([]); const resetReference = useStableCallback((reference2) => { store.set("positionReference", reference2); }); const setReference = useStableCallback((newX, newY, referenceElement) => { if (initialRef.current) { return; } if (dataRef.current.openEvent && !isMouseBasedEvent(dataRef.current.openEvent)) { return; } store.set("positionReference", createVirtualElement(referenceElement ?? domReference, { x: newX, y: newY, axis, dataRef, pointerType })); }); const handleReferenceEnterOrMove = useStableCallback((event) => { if (!open) { setReference(event.clientX, event.clientY, event.currentTarget); } else if (!cleanupListenerRef.current) { setReference(event.clientX, event.clientY, event.currentTarget); setReactive([]); } }); const openCheck = isMouseLikePointerType(pointerType) ? floating : open; React18.useEffect(() => { if (!enabled) { resetReference(domReference); return void 0; } if (!openCheck) { return void 0; } function cleanupListener() { cleanupListenerRef.current?.(); cleanupListenerRef.current = null; } const win = getWindow(floating); function handleMouseMove(event) { const target = getTarget(event); if (!contains(floating, target)) { setReference(event.clientX, event.clientY); } else { cleanupListener(); } } if (!dataRef.current.openEvent || isMouseBasedEvent(dataRef.current.openEvent)) { cleanupListenerRef.current = addEventListener(win, "mousemove", handleMouseMove); } else { resetReference(domReference); } return cleanupListener; }, [openCheck, enabled, floating, dataRef, domReference, store, setReference, resetReference, reactive]); React18.useEffect(() => () => { store.set("positionReference", null); }, [store]); React18.useEffect(() => { if (enabled && !floating) { initialRef.current = false; } }, [enabled, floating]); React18.useEffect(() => { if (!enabled && open) { initialRef.current = true; } }, [enabled, open]); const reference = React18.useMemo(() => { function setPointerTypeRef(event) { setPointerType(event.pointerType); } return { onPointerDown: setPointerTypeRef, onPointerEnter: setPointerTypeRef, onMouseMove: handleReferenceEnterOrMove, onMouseEnter: handleReferenceEnterOrMove }; }, [handleReferenceEnterOrMove]); return React18.useMemo(() => enabled ? { reference, trigger: reference } : {}, [enabled, reference]); } // node_modules/@base-ui/react/floating-ui-react/hooks/useDismiss.mjs var React19 = __toESM(require_react(), 1); function alwaysFalse() { return false; } function normalizeProp(normalizable) { return { escapeKey: typeof normalizable === "boolean" ? normalizable : normalizable?.escapeKey ?? false, outsidePress: typeof normalizable === "boolean" ? normalizable : normalizable?.outsidePress ?? true }; } function useDismiss(context, props = {}) { const { enabled = true, escapeKey: escapeKey2 = true, outsidePress: outsidePressProp = true, outsidePressEvent = "sloppy", referencePress = alwaysFalse, bubbles, externalTree } = props; const store = "rootStore" in context ? context.rootStore : context; const open = store.useState("open"); const floatingElement = store.useState("floatingElement"); const { dataRef } = store.context; const tree = useFloatingTree(externalTree); const outsidePressFn = useStableCallback(typeof outsidePressProp === "function" ? outsidePressProp : () => false); const outsidePress2 = typeof outsidePressProp === "function" ? outsidePressFn : outsidePressProp; const outsidePressEnabled = outsidePress2 !== false; const getOutsidePressEventProp = useStableCallback(() => outsidePressEvent); const { escapeKey: escapeKeyBubbles, outsidePress: outsidePressBubbles } = normalizeProp(bubbles); const pressStartedInsideRef = React19.useRef(false); const pressStartPreventedRef = React19.useRef(false); const suppressNextOutsideClickRef = React19.useRef(false); const isComposingRef = React19.useRef(false); const currentPointerTypeRef = React19.useRef(""); const touchStateRef = React19.useRef(null); const cancelDismissOnEndTimeout = useTimeout(); const clearInsideReactTreeTimeout = useTimeout(); const clearInsideReactTree = useStableCallback(() => { clearInsideReactTreeTimeout.clear(); dataRef.current.insideReactTree = false; }); const hasBlockingChild = useStableCallback((bubbleKey) => { const nodeId = dataRef.current.floatingContext?.nodeId; const children = tree ? getNodeChildren(tree.nodesRef.current, nodeId) : []; return children.some((child) => child.context?.open && !child.context.dataRef.current[bubbleKey]); }); const isEventWithinOwnElements = useStableCallback((event) => { return isEventTargetWithin(event, store.select("floatingElement")) || isEventTargetWithin(event, store.select("domReferenceElement")); }); const closeOnReferencePress = useStableCallback((event) => { if (!referencePress()) { return; } store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerPress, event.nativeEvent)); }); const closeOnEscapeKeyDown = useStableCallback((event) => { if (!open || !enabled || !escapeKey2 || event.key !== "Escape") { return; } if (isComposingRef.current) { return; } if (!escapeKeyBubbles && hasBlockingChild("__escapeKeyBubbles")) { return; } const native = isReactEvent(event) ? event.nativeEvent : event; const eventDetails = createChangeEventDetails(reason_parts_exports.escapeKey, native); store.setOpen(false, eventDetails); if (!eventDetails.isCanceled) { event.preventDefault(); } if (!escapeKeyBubbles && !eventDetails.isPropagationAllowed) { event.stopPropagation(); } }); const markInsideReactTree = useStableCallback(() => { dataRef.current.insideReactTree = true; clearInsideReactTreeTimeout.start(0, clearInsideReactTree); }); const markPressStartedInsideReactTree = useStableCallback((event) => { if (!open || !enabled || event.button !== 0) { return; } const target = getTarget(event.nativeEvent); if (!contains(store.select("floatingElement"), target)) { return; } if (!pressStartedInsideRef.current) { pressStartedInsideRef.current = true; pressStartPreventedRef.current = false; } }); const markInsidePressStartPrevented = useStableCallback((event) => { if (!open || !enabled) { return; } if (!(event.defaultPrevented || event.nativeEvent.defaultPrevented)) { return; } if (pressStartedInsideRef.current) { pressStartPreventedRef.current = true; } }); React19.useEffect(() => { if (!open || !enabled) { return void 0; } dataRef.current.__escapeKeyBubbles = escapeKeyBubbles; dataRef.current.__outsidePressBubbles = outsidePressBubbles; const compositionTimeout = new Timeout(); const preventedPressSuppressionTimeout = new Timeout(); function handleCompositionStart() { compositionTimeout.clear(); isComposingRef.current = true; } function handleCompositionEnd() { compositionTimeout.start( // 0ms or 1ms don't work in Safari. 5ms appears to consistently work. // Only apply to WebKit for the test to remain 0ms. parts_exports.engine.webkit ? 5 : 0, () => { isComposingRef.current = false; } ); } function suppressImmediateOutsideClickAfterPreventedStart() { suppressNextOutsideClickRef.current = true; preventedPressSuppressionTimeout.start(0, () => { suppressNextOutsideClickRef.current = false; }); } function resetPressStartState() { pressStartedInsideRef.current = false; pressStartPreventedRef.current = false; } function getOutsidePressEvent() { const type = currentPointerTypeRef.current; const computedType = type === "pen" || !type ? "mouse" : type; const outsidePressEventValue = getOutsidePressEventProp(); const resolved = typeof outsidePressEventValue === "function" ? outsidePressEventValue() : outsidePressEventValue; if (typeof resolved === "string") { return resolved; } return resolved[computedType]; } function shouldIgnoreEvent(event) { const computedOutsidePressEvent = getOutsidePressEvent(); return computedOutsidePressEvent === "intentional" && event.type !== "click" || computedOutsidePressEvent === "sloppy" && event.type === "click"; } function isEventWithinFloatingTree(event) { const nodeId = dataRef.current.floatingContext?.nodeId; const targetIsInsideChildren = tree && getNodeChildren(tree.nodesRef.current, nodeId).some((node) => isEventTargetWithin(event, node.context?.elements.floating)); return isEventWithinOwnElements(event) || targetIsInsideChildren; } function closeOnPressOutside(event) { if (shouldIgnoreEvent(event)) { if (event.type !== "click" && !isEventWithinOwnElements(event)) { preventedPressSuppressionTimeout.clear(); suppressNextOutsideClickRef.current = false; } clearInsideReactTree(); return; } if (dataRef.current.insideReactTree) { clearInsideReactTree(); return; } const target = getTarget(event); const inertSelector = `[${createAttribute("inert")}]`; const targetRoot = isElement(target) ? target.getRootNode() : null; const markers = Array.from((isShadowRoot(targetRoot) ? targetRoot : ownerDocument(store.select("floatingElement"))).querySelectorAll(inertSelector)); const triggers = store.context.triggerElements; if (target && (triggers.hasElement(target) || triggers.hasMatchingElement((trigger) => contains(trigger, target)))) { return; } let targetRootAncestor = isElement(target) ? target : null; while (targetRootAncestor && !isLastTraversableNode(targetRootAncestor)) { const nextParent = getParentNode(targetRootAncestor); if (isLastTraversableNode(nextParent) || !isElement(nextParent)) { break; } targetRootAncestor = nextParent; } if (markers.length && isElement(target) && !isRootElement(target) && // Clicked on a direct ancestor (e.g. FloatingOverlay). !contains(target, store.select("floatingElement")) && // If the target root element contains none of the markers, then the // element was injected after the floating element rendered. markers.every((marker) => !contains(targetRootAncestor, marker))) { return; } if (isHTMLElement(target) && !("touches" in event)) { const lastTraversableNode = isLastTraversableNode(target); const style = getComputedStyle2(target); const scrollRe = /auto|scroll/; const isScrollableX = lastTraversableNode || scrollRe.test(style.overflowX); const isScrollableY = lastTraversableNode || scrollRe.test(style.overflowY); const canScrollX = isScrollableX && target.clientWidth > 0 && target.scrollWidth > target.clientWidth; const canScrollY = isScrollableY && target.clientHeight > 0 && target.scrollHeight > target.clientHeight; const isRTL12 = style.direction === "rtl"; const pressedVerticalScrollbar = canScrollY && (isRTL12 ? event.offsetX <= target.offsetWidth - target.clientWidth : event.offsetX > target.clientWidth); const pressedHorizontalScrollbar = canScrollX && event.offsetY > target.clientHeight; if (pressedVerticalScrollbar || pressedHorizontalScrollbar) { return; } } if (isEventWithinFloatingTree(event)) { return; } if (getOutsidePressEvent() === "intentional" && suppressNextOutsideClickRef.current) { preventedPressSuppressionTimeout.clear(); suppressNextOutsideClickRef.current = false; return; } if (typeof outsidePress2 === "function" && !outsidePress2(event)) { return; } if (hasBlockingChild("__outsidePressBubbles")) { return; } store.setOpen(false, createChangeEventDetails(reason_parts_exports.outsidePress, event)); clearInsideReactTree(); } function handlePointerDown(event) { if (getOutsidePressEvent() !== "sloppy" || event.pointerType === "touch" || !store.select("open") || !enabled || isEventWithinOwnElements(event)) { return; } closeOnPressOutside(event); } function handleTouchStart(event) { if (getOutsidePressEvent() !== "sloppy" || !store.select("open") || !enabled || isEventWithinOwnElements(event)) { return; } const touch = event.touches[0]; if (touch) { touchStateRef.current = { startTime: Date.now(), startX: touch.clientX, startY: touch.clientY, dismissOnTouchEnd: false, dismissOnMouseDown: true }; cancelDismissOnEndTimeout.start(1e3, () => { if (touchStateRef.current) { touchStateRef.current.dismissOnTouchEnd = false; touchStateRef.current.dismissOnMouseDown = false; } }); } } function addTargetEventListenerOnce(event, listener) { const target = getTarget(event); if (!target) { return; } const unsubscribe2 = addEventListener(target, event.type, () => { listener(event); unsubscribe2(); }); } function handleTouchStartCapture(event) { currentPointerTypeRef.current = "touch"; addTargetEventListenerOnce(event, handleTouchStart); } function closeOnPressOutsideCapture(event) { cancelDismissOnEndTimeout.clear(); if (event.type === "pointerdown") { currentPointerTypeRef.current = event.pointerType; } if (event.type === "mousedown" && touchStateRef.current && !touchStateRef.current.dismissOnMouseDown) { return; } addTargetEventListenerOnce(event, (targetEvent) => { if (targetEvent.type === "pointerdown") { handlePointerDown(targetEvent); } else { closeOnPressOutside(targetEvent); } }); } function handlePressEndCapture(event) { if (!pressStartedInsideRef.current) { return; } const pressStartedInsideDefaultPrevented = pressStartPreventedRef.current; resetPressStartState(); if (getOutsidePressEvent() !== "intentional") { return; } if (event.type === "pointercancel") { if (pressStartedInsideDefaultPrevented) { suppressImmediateOutsideClickAfterPreventedStart(); } return; } if (isEventWithinFloatingTree(event)) { return; } if (pressStartedInsideDefaultPrevented) { suppressImmediateOutsideClickAfterPreventedStart(); return; } if (typeof outsidePress2 === "function" && !outsidePress2(event)) { return; } preventedPressSuppressionTimeout.clear(); suppressNextOutsideClickRef.current = true; clearInsideReactTree(); } function handleTouchMove(event) { if (getOutsidePressEvent() !== "sloppy" || !touchStateRef.current || isEventWithinOwnElements(event)) { return; } const touch = event.touches[0]; if (!touch) { return; } const deltaX = Math.abs(touch.clientX - touchStateRef.current.startX); const deltaY = Math.abs(touch.clientY - touchStateRef.current.startY); const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY); if (distance > 5) { touchStateRef.current.dismissOnTouchEnd = true; } if (distance > 10) { closeOnPressOutside(event); cancelDismissOnEndTimeout.clear(); touchStateRef.current = null; } } function handleTouchMoveCapture(event) { addTargetEventListenerOnce(event, handleTouchMove); } function handleTouchEnd(event) { if (getOutsidePressEvent() !== "sloppy" || !touchStateRef.current || isEventWithinOwnElements(event)) { return; } if (touchStateRef.current.dismissOnTouchEnd) { closeOnPressOutside(event); } cancelDismissOnEndTimeout.clear(); touchStateRef.current = null; } function handleTouchEndCapture(event) { addTargetEventListenerOnce(event, handleTouchEnd); } const doc = ownerDocument(floatingElement); const unsubscribe = mergeCleanups(escapeKey2 && mergeCleanups(addEventListener(doc, "keydown", closeOnEscapeKeyDown), addEventListener(doc, "compositionstart", handleCompositionStart), addEventListener(doc, "compositionend", handleCompositionEnd)), outsidePressEnabled && mergeCleanups(addEventListener(doc, "click", closeOnPressOutsideCapture, true), addEventListener(doc, "pointerdown", closeOnPressOutsideCapture, true), addEventListener(doc, "pointerup", handlePressEndCapture, true), addEventListener(doc, "pointercancel", handlePressEndCapture, true), addEventListener(doc, "mousedown", closeOnPressOutsideCapture, true), addEventListener(doc, "mouseup", handlePressEndCapture, true), addEventListener(doc, "touchstart", handleTouchStartCapture, true), addEventListener(doc, "touchmove", handleTouchMoveCapture, true), addEventListener(doc, "touchend", handleTouchEndCapture, true))); return () => { unsubscribe(); compositionTimeout.clear(); preventedPressSuppressionTimeout.clear(); resetPressStartState(); suppressNextOutsideClickRef.current = false; }; }, [dataRef, floatingElement, escapeKey2, outsidePressEnabled, outsidePress2, open, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, clearInsideReactTree, getOutsidePressEventProp, hasBlockingChild, isEventWithinOwnElements, tree, store, cancelDismissOnEndTimeout]); React19.useEffect(clearInsideReactTree, [outsidePress2, clearInsideReactTree]); const reference = React19.useMemo(() => ({ onKeyDown: closeOnEscapeKeyDown, onPointerDown: closeOnReferencePress, onClick: closeOnReferencePress }), [closeOnEscapeKeyDown, closeOnReferencePress]); const floating = React19.useMemo(() => ({ onKeyDown: closeOnEscapeKeyDown, // `onMouseDown` may be blocked if `event.preventDefault()` is called in // `onPointerDown`, such as with . // See https://github.com/mui/base-ui/pull/3379 onPointerDown: markInsidePressStartPrevented, onMouseDown: markInsidePressStartPrevented, onClickCapture: markInsideReactTree, onMouseDownCapture(event) { markInsideReactTree(); markPressStartedInsideReactTree(event); }, onPointerDownCapture(event) { markInsideReactTree(); markPressStartedInsideReactTree(event); }, onMouseUpCapture: markInsideReactTree, onTouchEndCapture: markInsideReactTree, onTouchMoveCapture: markInsideReactTree }), [closeOnEscapeKeyDown, markInsideReactTree, markPressStartedInsideReactTree, markInsidePressStartPrevented]); return React19.useMemo(() => enabled ? { reference, floating, trigger: reference } : {}, [enabled, reference, floating]); } // node_modules/@base-ui/react/floating-ui-react/hooks/useFloating.mjs var React26 = __toESM(require_react(), 1); // node_modules/@floating-ui/core/dist/floating-ui.core.mjs function computeCoordsFromPlacement(_ref, placement, rtl) { let { reference, floating } = _ref; const sideAxis = getSideAxis(placement); const alignmentAxis = getAlignmentAxis(placement); const alignLength = getAxisLength(alignmentAxis); const side = getSide(placement); const isVertical = sideAxis === "y"; const commonX = reference.x + reference.width / 2 - floating.width / 2; const commonY = reference.y + reference.height / 2 - floating.height / 2; const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2; let coords; switch (side) { case "top": coords = { x: commonX, y: reference.y - floating.height }; break; case "bottom": coords = { x: commonX, y: reference.y + reference.height }; break; case "right": coords = { x: reference.x + reference.width, y: commonY }; break; case "left": coords = { x: reference.x - floating.width, y: commonY }; break; default: coords = { x: reference.x, y: reference.y }; } switch (getAlignment(placement)) { case "start": coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1); break; case "end": coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1); break; } return coords; } async function detectOverflow(state, options) { var _await$platform$isEle; if (options === void 0) { options = {}; } const { x: x2, y: y2, platform: platform3, rects, elements: elements2, strategy } = state; const { boundary = "clippingAncestors", rootBoundary = "viewport", elementContext = "floating", altBoundary = false, padding = 0 } = evaluate(options, state); const paddingObject = getPaddingObject(padding); const altContext = elementContext === "floating" ? "reference" : "floating"; const element = elements2[altBoundary ? altContext : elementContext]; const clippingClientRect = rectToClientRect(await platform3.getClippingRect({ element: ((_await$platform$isEle = await (platform3.isElement == null ? void 0 : platform3.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform3.getDocumentElement == null ? void 0 : platform3.getDocumentElement(elements2.floating)), boundary, rootBoundary, strategy })); const rect = elementContext === "floating" ? { x: x2, y: y2, width: rects.floating.width, height: rects.floating.height } : rects.reference; const offsetParent = await (platform3.getOffsetParent == null ? void 0 : platform3.getOffsetParent(elements2.floating)); const offsetScale = await (platform3.isElement == null ? void 0 : platform3.isElement(offsetParent)) ? await (platform3.getScale == null ? void 0 : platform3.getScale(offsetParent)) || { x: 1, y: 1 } : { x: 1, y: 1 }; const elementClientRect = rectToClientRect(platform3.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform3.convertOffsetParentRelativeRectToViewportRelativeRect({ elements: elements2, rect, offsetParent, strategy }) : rect); return { top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y, bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y, left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x, right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x }; } var MAX_RESET_COUNT = 50; var computePosition = async (reference, floating, config) => { const { placement = "bottom", strategy = "absolute", middleware = [], platform: platform3 } = config; const platformWithDetectOverflow = platform3.detectOverflow ? platform3 : { ...platform3, detectOverflow }; const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(floating)); let rects = await platform3.getElementRects({ reference, floating, strategy }); let { x: x2, y: y2 } = computeCoordsFromPlacement(rects, placement, rtl); let statefulPlacement = placement; let resetCount = 0; const middlewareData = {}; for (let i2 = 0; i2 < middleware.length; i2++) { const currentMiddleware = middleware[i2]; if (!currentMiddleware) { continue; } const { name: name2, fn } = currentMiddleware; const { x: nextX, y: nextY, data, reset } = await fn({ x: x2, y: y2, initialPlacement: placement, placement: statefulPlacement, strategy, middlewareData, rects, platform: platformWithDetectOverflow, elements: { reference, floating } }); x2 = nextX != null ? nextX : x2; y2 = nextY != null ? nextY : y2; middlewareData[name2] = { ...middlewareData[name2], ...data }; if (reset && resetCount < MAX_RESET_COUNT) { resetCount++; if (typeof reset === "object") { if (reset.placement) { statefulPlacement = reset.placement; } if (reset.rects) { rects = reset.rects === true ? await platform3.getElementRects({ reference, floating, strategy }) : reset.rects; } ({ x: x2, y: y2 } = computeCoordsFromPlacement(rects, statefulPlacement, rtl)); } i2 = -1; } } return { x: x2, y: y2, placement: statefulPlacement, strategy, middlewareData }; }; var flip = function(options) { if (options === void 0) { options = {}; } return { name: "flip", options, async fn(state) { var _middlewareData$arrow, _middlewareData$flip; const { placement, middlewareData, rects, initialPlacement, platform: platform3, elements: elements2 } = state; const { mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = true, fallbackPlacements: specifiedFallbackPlacements, fallbackStrategy = "bestFit", fallbackAxisSideDirection = "none", flipAlignment = true, ...detectOverflowOptions } = evaluate(options, state); if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { return {}; } const side = getSide(placement); const initialSideAxis = getSideAxis(initialPlacement); const isBasePlacement = getSide(initialPlacement) === initialPlacement; const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements2.floating)); const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement)); const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none"; if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) { fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl)); } const placements2 = [initialPlacement, ...fallbackPlacements]; const overflow = await platform3.detectOverflow(state, detectOverflowOptions); const overflows = []; let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || []; if (checkMainAxis) { overflows.push(overflow[side]); } if (checkCrossAxis) { const sides2 = getAlignmentSides(placement, rects, rtl); overflows.push(overflow[sides2[0]], overflow[sides2[1]]); } overflowsData = [...overflowsData, { placement, overflows }]; if (!overflows.every((side2) => side2 <= 0)) { var _middlewareData$flip2, _overflowsData$filter; const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1; const nextPlacement = placements2[nextIndex]; if (nextPlacement) { const ignoreCrossAxisOverflow = checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false; if (!ignoreCrossAxisOverflow || // We leave the current main axis only if every placement on that axis // overflows the main axis. overflowsData.every((d2) => getSideAxis(d2.placement) === initialSideAxis ? d2.overflows[0] > 0 : true)) { return { data: { index: nextIndex, overflows: overflowsData }, reset: { placement: nextPlacement } }; } } let resetPlacement = (_overflowsData$filter = overflowsData.filter((d2) => d2.overflows[0] <= 0).sort((a2, b2) => a2.overflows[1] - b2.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement; if (!resetPlacement) { switch (fallbackStrategy) { case "bestFit": { var _overflowsData$filter2; const placement2 = (_overflowsData$filter2 = overflowsData.filter((d2) => { if (hasFallbackAxisSideDirection) { const currentSideAxis = getSideAxis(d2.placement); return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal // reading directions favoring greater width. currentSideAxis === "y"; } return true; }).map((d2) => [d2.placement, d2.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a2, b2) => a2[1] - b2[1])[0]) == null ? void 0 : _overflowsData$filter2[0]; if (placement2) { resetPlacement = placement2; } break; } case "initialPlacement": resetPlacement = initialPlacement; break; } } if (placement !== resetPlacement) { return { reset: { placement: resetPlacement } }; } } return {}; } }; }; function getSideOffsets(overflow, rect) { return { top: overflow.top - rect.height, right: overflow.right - rect.width, bottom: overflow.bottom - rect.height, left: overflow.left - rect.width }; } function isAnySideFullyClipped(overflow) { return sides.some((side) => overflow[side] >= 0); } var hide = function(options) { if (options === void 0) { options = {}; } return { name: "hide", options, async fn(state) { const { rects, platform: platform3 } = state; const { strategy = "referenceHidden", ...detectOverflowOptions } = evaluate(options, state); switch (strategy) { case "referenceHidden": { const overflow = await platform3.detectOverflow(state, { ...detectOverflowOptions, elementContext: "reference" }); const offsets = getSideOffsets(overflow, rects.reference); return { data: { referenceHiddenOffsets: offsets, referenceHidden: isAnySideFullyClipped(offsets) } }; } case "escaped": { const overflow = await platform3.detectOverflow(state, { ...detectOverflowOptions, altBoundary: true }); const offsets = getSideOffsets(overflow, rects.floating); return { data: { escapedOffsets: offsets, escaped: isAnySideFullyClipped(offsets) } }; } default: { return {}; } } } }; }; var originSides = /* @__PURE__ */ new Set(["left", "top"]); async function convertValueToCoords(state, options) { const { placement, platform: platform3, elements: elements2 } = state; const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements2.floating)); const side = getSide(placement); const alignment = getAlignment(placement); const isVertical = getSideAxis(placement) === "y"; const mainAxisMulti = originSides.has(side) ? -1 : 1; const crossAxisMulti = rtl && isVertical ? -1 : 1; const rawValue = evaluate(options, state); let { mainAxis, crossAxis, alignmentAxis } = typeof rawValue === "number" ? { mainAxis: rawValue, crossAxis: 0, alignmentAxis: null } : { mainAxis: rawValue.mainAxis || 0, crossAxis: rawValue.crossAxis || 0, alignmentAxis: rawValue.alignmentAxis }; if (alignment && typeof alignmentAxis === "number") { crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis; } return isVertical ? { x: crossAxis * crossAxisMulti, y: mainAxis * mainAxisMulti } : { x: mainAxis * mainAxisMulti, y: crossAxis * crossAxisMulti }; } var offset = function(options) { if (options === void 0) { options = 0; } return { name: "offset", options, async fn(state) { var _middlewareData$offse, _middlewareData$arrow; const { x: x2, y: y2, placement, middlewareData } = state; const diffCoords = await convertValueToCoords(state, options); if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { return {}; } return { x: x2 + diffCoords.x, y: y2 + diffCoords.y, data: { ...diffCoords, placement } }; } }; }; var shift = function(options) { if (options === void 0) { options = {}; } return { name: "shift", options, async fn(state) { const { x: x2, y: y2, placement, platform: platform3 } = state; const { mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = false, limiter = { fn: (_ref) => { let { x: x3, y: y3 } = _ref; return { x: x3, y: y3 }; } }, ...detectOverflowOptions } = evaluate(options, state); const coords = { x: x2, y: y2 }; const overflow = await platform3.detectOverflow(state, detectOverflowOptions); const crossAxis = getSideAxis(getSide(placement)); const mainAxis = getOppositeAxis(crossAxis); let mainAxisCoord = coords[mainAxis]; let crossAxisCoord = coords[crossAxis]; if (checkMainAxis) { const minSide = mainAxis === "y" ? "top" : "left"; const maxSide = mainAxis === "y" ? "bottom" : "right"; const min2 = mainAxisCoord + overflow[minSide]; const max2 = mainAxisCoord - overflow[maxSide]; mainAxisCoord = clamp(min2, mainAxisCoord, max2); } if (checkCrossAxis) { const minSide = crossAxis === "y" ? "top" : "left"; const maxSide = crossAxis === "y" ? "bottom" : "right"; const min2 = crossAxisCoord + overflow[minSide]; const max2 = crossAxisCoord - overflow[maxSide]; crossAxisCoord = clamp(min2, crossAxisCoord, max2); } const limitedCoords = limiter.fn({ ...state, [mainAxis]: mainAxisCoord, [crossAxis]: crossAxisCoord }); return { ...limitedCoords, data: { x: limitedCoords.x - x2, y: limitedCoords.y - y2, enabled: { [mainAxis]: checkMainAxis, [crossAxis]: checkCrossAxis } } }; } }; }; var limitShift = function(options) { if (options === void 0) { options = {}; } return { options, fn(state) { const { x: x2, y: y2, placement, rects, middlewareData } = state; const { offset: offset4 = 0, mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = true } = evaluate(options, state); const coords = { x: x2, y: y2 }; const crossAxis = getSideAxis(placement); const mainAxis = getOppositeAxis(crossAxis); let mainAxisCoord = coords[mainAxis]; let crossAxisCoord = coords[crossAxis]; const rawOffset = evaluate(offset4, state); const computedOffset = typeof rawOffset === "number" ? { mainAxis: rawOffset, crossAxis: 0 } : { mainAxis: 0, crossAxis: 0, ...rawOffset }; if (checkMainAxis) { const len = mainAxis === "y" ? "height" : "width"; const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis; const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis; if (mainAxisCoord < limitMin) { mainAxisCoord = limitMin; } else if (mainAxisCoord > limitMax) { mainAxisCoord = limitMax; } } if (checkCrossAxis) { var _middlewareData$offse, _middlewareData$offse2; const len = mainAxis === "y" ? "width" : "height"; const isOriginSide = originSides.has(getSide(placement)); const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis); const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0); if (crossAxisCoord < limitMin) { crossAxisCoord = limitMin; } else if (crossAxisCoord > limitMax) { crossAxisCoord = limitMax; } } return { [mainAxis]: mainAxisCoord, [crossAxis]: crossAxisCoord }; } }; }; var size = function(options) { if (options === void 0) { options = {}; } return { name: "size", options, async fn(state) { var _state$middlewareData, _state$middlewareData2; const { placement, rects, platform: platform3, elements: elements2 } = state; const { apply = () => { }, ...detectOverflowOptions } = evaluate(options, state); const overflow = await platform3.detectOverflow(state, detectOverflowOptions); const side = getSide(placement); const alignment = getAlignment(placement); const isYAxis = getSideAxis(placement) === "y"; const { width, height } = rects.floating; let heightSide; let widthSide; if (side === "top" || side === "bottom") { heightSide = side; widthSide = alignment === (await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements2.floating)) ? "start" : "end") ? "left" : "right"; } else { widthSide = side; heightSide = alignment === "end" ? "top" : "bottom"; } const maximumClippingHeight = height - overflow.top - overflow.bottom; const maximumClippingWidth = width - overflow.left - overflow.right; const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight); const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth); const noShift = !state.middlewareData.shift; let availableHeight = overflowAvailableHeight; let availableWidth = overflowAvailableWidth; if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) { availableWidth = maximumClippingWidth; } if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) { availableHeight = maximumClippingHeight; } if (noShift && !alignment) { const xMin = max(overflow.left, 0); const xMax = max(overflow.right, 0); const yMin = max(overflow.top, 0); const yMax = max(overflow.bottom, 0); if (isYAxis) { availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right)); } else { availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom)); } } await apply({ ...state, availableWidth, availableHeight }); const nextDimensions = await platform3.getDimensions(elements2.floating); if (width !== nextDimensions.width || height !== nextDimensions.height) { return { reset: { rects: true } }; } return {}; } }; }; // node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs function getCssDimensions(element) { const css = getComputedStyle2(element); let width = parseFloat(css.width) || 0; let height = parseFloat(css.height) || 0; const hasOffset = isHTMLElement(element); const offsetWidth = hasOffset ? element.offsetWidth : width; const offsetHeight = hasOffset ? element.offsetHeight : height; const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight; if (shouldFallback) { width = offsetWidth; height = offsetHeight; } return { width, height, $: shouldFallback }; } function unwrapElement(element) { return !isElement(element) ? element.contextElement : element; } function getScale(element) { const domElement = unwrapElement(element); if (!isHTMLElement(domElement)) { return createCoords(1); } const rect = domElement.getBoundingClientRect(); const { width, height, $: $2 } = getCssDimensions(domElement); let x2 = ($2 ? round(rect.width) : rect.width) / width; let y2 = ($2 ? round(rect.height) : rect.height) / height; if (!x2 || !Number.isFinite(x2)) { x2 = 1; } if (!y2 || !Number.isFinite(y2)) { y2 = 1; } return { x: x2, y: y2 }; } var noOffsets = /* @__PURE__ */ createCoords(0); function getVisualOffsets(element) { const win = getWindow(element); if (!isWebKit() || !win.visualViewport) { return noOffsets; } return { x: win.visualViewport.offsetLeft, y: win.visualViewport.offsetTop }; } function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) { if (isFixed === void 0) { isFixed = false; } if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) { return false; } return isFixed; } function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) { if (includeScale === void 0) { includeScale = false; } if (isFixedStrategy === void 0) { isFixedStrategy = false; } const clientRect = element.getBoundingClientRect(); const domElement = unwrapElement(element); let scale = createCoords(1); if (includeScale) { if (offsetParent) { if (isElement(offsetParent)) { scale = getScale(offsetParent); } } else { scale = getScale(element); } } const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0); let x2 = (clientRect.left + visualOffsets.x) / scale.x; let y2 = (clientRect.top + visualOffsets.y) / scale.y; let width = clientRect.width / scale.x; let height = clientRect.height / scale.y; if (domElement) { const win = getWindow(domElement); const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent; let currentWin = win; let currentIFrame = getFrameElement(currentWin); while (currentIFrame && offsetParent && offsetWin !== currentWin) { const iframeScale = getScale(currentIFrame); const iframeRect = currentIFrame.getBoundingClientRect(); const css = getComputedStyle2(currentIFrame); const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x; const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y; x2 *= iframeScale.x; y2 *= iframeScale.y; width *= iframeScale.x; height *= iframeScale.y; x2 += left; y2 += top; currentWin = getWindow(currentIFrame); currentIFrame = getFrameElement(currentWin); } } return rectToClientRect({ width, height, x: x2, y: y2 }); } function getWindowScrollBarX(element, rect) { const leftScroll = getNodeScroll(element).scrollLeft; if (!rect) { return getBoundingClientRect(getDocumentElement(element)).left + leftScroll; } return rect.left + leftScroll; } function getHTMLOffset(documentElement, scroll) { const htmlRect = documentElement.getBoundingClientRect(); const x2 = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect); const y2 = htmlRect.top + scroll.scrollTop; return { x: x2, y: y2 }; } function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) { let { elements: elements2, rect, offsetParent, strategy } = _ref; const isFixed = strategy === "fixed"; const documentElement = getDocumentElement(offsetParent); const topLayer = elements2 ? isTopLayer(elements2.floating) : false; if (offsetParent === documentElement || topLayer && isFixed) { return rect; } let scroll = { scrollLeft: 0, scrollTop: 0 }; let scale = createCoords(1); const offsets = createCoords(0); const isOffsetParentAnElement = isHTMLElement(offsetParent); if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) { scroll = getNodeScroll(offsetParent); } if (isOffsetParentAnElement) { const offsetRect = getBoundingClientRect(offsetParent); scale = getScale(offsetParent); offsets.x = offsetRect.x + offsetParent.clientLeft; offsets.y = offsetRect.y + offsetParent.clientTop; } } const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); return { width: rect.width * scale.x, height: rect.height * scale.y, x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x, y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y }; } function getClientRects(element) { return Array.from(element.getClientRects()); } function getDocumentRect(element) { const html = getDocumentElement(element); const scroll = getNodeScroll(element); const body = element.ownerDocument.body; const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth); const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight); let x2 = -scroll.scrollLeft + getWindowScrollBarX(element); const y2 = -scroll.scrollTop; if (getComputedStyle2(body).direction === "rtl") { x2 += max(html.clientWidth, body.clientWidth) - width; } return { width, height, x: x2, y: y2 }; } var SCROLLBAR_MAX = 25; function getViewportRect(element, strategy) { const win = getWindow(element); const html = getDocumentElement(element); const visualViewport = win.visualViewport; let width = html.clientWidth; let height = html.clientHeight; let x2 = 0; let y2 = 0; if (visualViewport) { width = visualViewport.width; height = visualViewport.height; const visualViewportBased = isWebKit(); if (!visualViewportBased || visualViewportBased && strategy === "fixed") { x2 = visualViewport.offsetLeft; y2 = visualViewport.offsetTop; } } const windowScrollbarX = getWindowScrollBarX(html); if (windowScrollbarX <= 0) { const doc = html.ownerDocument; const body = doc.body; const bodyStyles = getComputedStyle(body); const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0; const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline); if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) { width -= clippingStableScrollbarWidth; } } else if (windowScrollbarX <= SCROLLBAR_MAX) { width += windowScrollbarX; } return { width, height, x: x2, y: y2 }; } function getInnerBoundingClientRect(element, strategy) { const clientRect = getBoundingClientRect(element, true, strategy === "fixed"); const top = clientRect.top + element.clientTop; const left = clientRect.left + element.clientLeft; const scale = isHTMLElement(element) ? getScale(element) : createCoords(1); const width = element.clientWidth * scale.x; const height = element.clientHeight * scale.y; const x2 = left * scale.x; const y2 = top * scale.y; return { width, height, x: x2, y: y2 }; } function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) { let rect; if (clippingAncestor === "viewport") { rect = getViewportRect(element, strategy); } else if (clippingAncestor === "document") { rect = getDocumentRect(getDocumentElement(element)); } else if (isElement(clippingAncestor)) { rect = getInnerBoundingClientRect(clippingAncestor, strategy); } else { const visualOffsets = getVisualOffsets(element); rect = { x: clippingAncestor.x - visualOffsets.x, y: clippingAncestor.y - visualOffsets.y, width: clippingAncestor.width, height: clippingAncestor.height }; } return rectToClientRect(rect); } function hasFixedPositionAncestor(element, stopNode) { const parentNode = getParentNode(element); if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) { return false; } return getComputedStyle2(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode); } function getClippingElementAncestors(element, cache) { const cachedResult = cache.get(element); if (cachedResult) { return cachedResult; } let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body"); let currentContainingBlockComputedStyle = null; const elementIsFixed = getComputedStyle2(element).position === "fixed"; let currentNode = elementIsFixed ? getParentNode(element) : element; while (isElement(currentNode) && !isLastTraversableNode(currentNode)) { const computedStyle = getComputedStyle2(currentNode); const currentNodeIsContaining = isContainingBlock(currentNode); if (!currentNodeIsContaining && computedStyle.position === "fixed") { currentContainingBlockComputedStyle = null; } const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && (currentContainingBlockComputedStyle.position === "absolute" || currentContainingBlockComputedStyle.position === "fixed") || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode); if (shouldDropCurrentNode) { result = result.filter((ancestor) => ancestor !== currentNode); } else { currentContainingBlockComputedStyle = computedStyle; } currentNode = getParentNode(currentNode); } cache.set(element, result); return result; } function getClippingRect(_ref) { let { element, boundary, rootBoundary, strategy } = _ref; const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary); const clippingAncestors = [...elementClippingAncestors, rootBoundary]; const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy); let top = firstRect.top; let right = firstRect.right; let bottom = firstRect.bottom; let left = firstRect.left; for (let i2 = 1; i2 < clippingAncestors.length; i2++) { const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i2], strategy); top = max(rect.top, top); right = min(rect.right, right); bottom = min(rect.bottom, bottom); left = max(rect.left, left); } return { width: right - left, height: bottom - top, x: left, y: top }; } function getDimensions(element) { const { width, height } = getCssDimensions(element); return { width, height }; } function getRectRelativeToOffsetParent(element, offsetParent, strategy) { const isOffsetParentAnElement = isHTMLElement(offsetParent); const documentElement = getDocumentElement(offsetParent); const isFixed = strategy === "fixed"; const rect = getBoundingClientRect(element, true, isFixed, offsetParent); let scroll = { scrollLeft: 0, scrollTop: 0 }; const offsets = createCoords(0); function setLeftRTLScrollbarOffset() { offsets.x = getWindowScrollBarX(documentElement); } if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) { scroll = getNodeScroll(offsetParent); } if (isOffsetParentAnElement) { const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent); offsets.x = offsetRect.x + offsetParent.clientLeft; offsets.y = offsetRect.y + offsetParent.clientTop; } else if (documentElement) { setLeftRTLScrollbarOffset(); } } if (isFixed && !isOffsetParentAnElement && documentElement) { setLeftRTLScrollbarOffset(); } const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); const x2 = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x; const y2 = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y; return { x: x2, y: y2, width: rect.width, height: rect.height }; } function isStaticPositioned(element) { return getComputedStyle2(element).position === "static"; } function getTrueOffsetParent(element, polyfill) { if (!isHTMLElement(element) || getComputedStyle2(element).position === "fixed") { return null; } if (polyfill) { return polyfill(element); } let rawOffsetParent = element.offsetParent; if (getDocumentElement(element) === rawOffsetParent) { rawOffsetParent = rawOffsetParent.ownerDocument.body; } return rawOffsetParent; } function getOffsetParent(element, polyfill) { const win = getWindow(element); if (isTopLayer(element)) { return win; } if (!isHTMLElement(element)) { let svgOffsetParent = getParentNode(element); while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) { if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) { return svgOffsetParent; } svgOffsetParent = getParentNode(svgOffsetParent); } return win; } let offsetParent = getTrueOffsetParent(element, polyfill); while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) { offsetParent = getTrueOffsetParent(offsetParent, polyfill); } if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) { return win; } return offsetParent || getContainingBlock(element) || win; } var getElementRects = async function(data) { const getOffsetParentFn = this.getOffsetParent || getOffsetParent; const getDimensionsFn = this.getDimensions; const floatingDimensions = await getDimensionsFn(data.floating); return { reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy), floating: { x: 0, y: 0, width: floatingDimensions.width, height: floatingDimensions.height } }; }; function isRTL(element) { return getComputedStyle2(element).direction === "rtl"; } var platform2 = { convertOffsetParentRelativeRectToViewportRelativeRect, getDocumentElement, getClippingRect, getOffsetParent, getElementRects, getClientRects, getDimensions, getScale, isElement, isRTL }; function rectsAreEqual(a2, b2) { return a2.x === b2.x && a2.y === b2.y && a2.width === b2.width && a2.height === b2.height; } function observeMove(element, onMove) { let io = null; let timeoutId; const root = getDocumentElement(element); function cleanup() { var _io; clearTimeout(timeoutId); (_io = io) == null || _io.disconnect(); io = null; } function refresh(skip, threshold) { if (skip === void 0) { skip = false; } if (threshold === void 0) { threshold = 1; } cleanup(); const elementRectForRootMargin = element.getBoundingClientRect(); const { left, top, width, height } = elementRectForRootMargin; if (!skip) { onMove(); } if (!width || !height) { return; } const insetTop = floor(top); const insetRight = floor(root.clientWidth - (left + width)); const insetBottom = floor(root.clientHeight - (top + height)); const insetLeft = floor(left); const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px"; const options = { rootMargin, threshold: max(0, min(1, threshold)) || 1 }; let isFirstUpdate = true; function handleObserve(entries) { const ratio = entries[0].intersectionRatio; if (ratio !== threshold) { if (!isFirstUpdate) { return refresh(); } if (!ratio) { timeoutId = setTimeout(() => { refresh(false, 1e-7); }, 1e3); } else { refresh(false, ratio); } } if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) { refresh(); } isFirstUpdate = false; } try { io = new IntersectionObserver(handleObserve, { ...options, // Handle