Changeset 3772619
- Timestamp:
- 10/29/2026 10:16:10 AM (4 weeks ago)
- Location:
- cf7-telegram
- Files:
-
- 28 edited
- 1 copied
-
tags/1.2.1 (copied) (copied from cf7-telegram/trunk )
-
tags/1.2.1/cf7-telegram.php (modified) (2 diffs)
-
tags/1.2.1/lib/Bot.php (modified) (4 diffs)
-
tags/1.2.1/lib/Channel.php (modified) (3 diffs)
-
tags/1.2.1/lib/Chat.php (modified) (5 diffs)
-
tags/1.2.1/lib/Controllers/RestApi/ChatController.php (modified) (3 diffs)
-
tags/1.2.1/lib/Migrations/LegacyImporter.php (modified) (1 diff)
-
tags/1.2.1/lib/RestBotUpdates.php (modified) (1 diff)
-
tags/1.2.1/lib/Settings.php (modified) (1 diff)
-
tags/1.2.1/lib/Util.php (modified) (4 diffs)
-
tags/1.2.1/react/build/main-rtl.css (modified) (1 diff)
-
tags/1.2.1/react/build/static/css/main.css (modified) (1 diff)
-
tags/1.2.1/react/build/static/js/main.asset.php (modified) (1 diff)
-
tags/1.2.1/react/build/static/js/main.js (modified) (1 diff)
-
tags/1.2.1/readme.txt (modified) (3 diffs)
-
trunk/cf7-telegram.php (modified) (2 diffs)
-
trunk/lib/Bot.php (modified) (4 diffs)
-
trunk/lib/Channel.php (modified) (3 diffs)
-
trunk/lib/Chat.php (modified) (5 diffs)
-
trunk/lib/Controllers/RestApi/ChatController.php (modified) (3 diffs)
-
trunk/lib/Migrations/LegacyImporter.php (modified) (1 diff)
-
trunk/lib/RestBotUpdates.php (modified) (1 diff)
-
trunk/lib/Settings.php (modified) (1 diff)
-
trunk/lib/Util.php (modified) (4 diffs)
-
trunk/react/build/main-rtl.css (modified) (1 diff)
-
trunk/react/build/static/css/main.css (modified) (1 diff)
-
trunk/react/build/static/js/main.asset.php (modified) (1 diff)
-
trunk/react/build/static/js/main.js (modified) (1 diff)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cf7-telegram/tags/1.2.1/cf7-telegram.php
r3744804 r3772619 4 4 * Description: Sends CF7 messages to Telegram-chat 5 5 * Author: Hokku 6 * Version: 1.2. 06 * Version: 1.2.1 7 7 * License: GPL v2 or later 8 8 * License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 23 23 define( 'WPCF7TG_PLUGIN_NAME', plugin_basename( __FILE__ ) ); 24 24 25 const WPCF7TG_VERSION = '1.2. 0';25 const WPCF7TG_VERSION = '1.2.1'; 26 26 const WPCF7TG_FILE = __FILE__; 27 27 -
cf7-telegram/tags/1.2.1/lib/Bot.php
r3676902 r3772619 377 377 $results = []; 378 378 $mode = TelegramMessageFormatter::normalizeMode( $mode ); 379 $messageThreadID = $chat->getMessageThreadID(); 379 380 380 381 foreach ( TelegramMessageFormatter::chunks( $message ) as $chunkIndex => $chunk ) { … … 382 383 [ 383 384 'chat_id' => $chat->getChatID(), 385 'message_thread_id' => $messageThreadID, 384 386 'text' => $chunk, 385 387 'parse_mode' => $mode, … … 607 609 private function processUpdate( array $update, RestBotUpdates $result, array &$processedChatIDs ): void { 608 610 $message = is_array( $update['message'] ?? null ) ? $update['message'] : []; 611 $topicEvent = $message['forum_topic_edited'] ?? $message['forum_topic_created'] ?? null; 612 if ( is_array( $topicEvent ) ) { 613 $name = Util::sanitizeTelegramText( $topicEvent['name'] ?? null ); 614 $chatID = Util::sanitizeTelegramChatID( $message['chat']['id'] ?? '' ); 615 $rawThreadID = $message['message_thread_id'] ?? ( isset( $message['forum_topic_created'] ) ? ( $message['message_id'] ?? null ) : null ); 616 try { 617 $threadID = Util::normalizeMessageThreadID( $rawThreadID ); 618 } catch ( \InvalidArgumentException $exception ) { 619 return; 620 } 621 if ( '' !== $name && null !== $threadID && 'supergroup' === ( $message['chat']['type'] ?? null ) && preg_match( '/^-?[1-9][0-9]*$/', $chatID ) ) { 622 $chat = Util::getChatByTelegramID( $chatID, $threadID ); 623 if ( $chat && $this->getChats()->contains( $chat ) && $chat->getTelegramTopicName() !== $name ) { 624 $chat->setTelegramTopicName( $name )->savePost(); 625 $result->hasUpdatedChats = true; 626 } 627 } 628 return; 629 } 609 630 610 631 if ( empty( $message ) || ! $this->messageHasBotCommand( $message ) ) { … … 616 637 } 617 638 618 $tgChatID = Util::sanitizeTelegramChatID( $message['chat']['id'] ?? '' ); 619 if ( '' === $tgChatID ) { 620 throw new \UnexpectedValueException( 'Telegram chat ID is empty after sanitization.' ); 621 } 622 623 if ( isset( $processedChatIDs[ $tgChatID ] ) ) { 639 if ( array_key_exists( 'direct_messages_topic', $message ) || ( is_array( $message['chat'] ?? null ) && array_key_exists( 'is_direct_messages', $message['chat'] ) ) ) { 624 640 return; 625 641 } 626 642 627 $processedChatIDs[ $tgChatID ] = true; 628 $chat = Util::getChatByTelegramID( $tgChatID ); 643 if ( true === ( $message['is_topic_message'] ?? false ) && 'private' === ( $message['chat']['type'] ?? null ) ) { 644 if ( ! array_key_exists( 'message_thread_id', $message ) || null === $message['message_thread_id'] ) { 645 throw new \InvalidArgumentException( 'Invalid Telegram topic ID.' ); 646 } 647 Util::normalizeMessageThreadID( $message['message_thread_id'] ); 648 return; 649 } 650 651 $rawChatID = $message['chat']['id'] ?? null; 652 if ( ! ( is_int( $rawChatID ) || is_string( $rawChatID ) ) || ! preg_match( '/^-?[1-9][0-9]*$/', (string) $rawChatID ) ) { 653 throw new \UnexpectedValueException( 'Invalid Telegram chat ID.' ); 654 } 655 $tgChatID = (string) $rawChatID; 656 $messageThreadID = Util::messageThreadIDFromUpdate( $message ); 657 $destination = $tgChatID . ':' . ( $messageThreadID ?? 0 ); 658 659 if ( isset( $processedChatIDs[ $destination ] ) ) { 660 return; 661 } 662 663 $processedChatIDs[ $destination ] = true; 664 $chat = Util::getChatByTelegramID( $tgChatID, $messageThreadID ); 629 665 630 666 if ( ! $chat ) { 631 $chat = Util::createChatFromArray( is_array( $message['chat'] ?? null ) ? $message['chat'] : [] );667 $chat = Util::createChatFromArray( is_array( $message['chat'] ?? null ) ? $message['chat'] : [], $messageThreadID ); 632 668 $result->hasNewChats = true; 633 669 } else { -
cf7-telegram/tags/1.2.1/lib/Channel.php
r3675011 r3772619 10 10 use iTRON\cf7Telegram\Telegram\TelegramDeliveryResult; 11 11 use iTRON\wpConnections\Abstracts\Connection; 12 use iTRON\wpConnections\Exceptions\ConnectionNotFound; 12 13 use iTRON\wpConnections\Exceptions\ConnectionWrongData; 13 14 use iTRON\wpConnections\Exceptions\MissingParameters; … … 228 229 /** @var Chat $chat */ 229 230 try { 231 if ( Chat::STATUS_ACTIVE !== $chat->getBotConnectionStatus( $bot ) ) { 232 continue; 233 } 234 } catch ( ConnectionNotFound $exception ) { 235 continue; 236 } 237 238 $messageThreadID = null; 239 try { 240 $messageThreadID = $chat->getMessageThreadID(); 230 241 $results = $bot->sendMessage( 231 242 $chat, … … 247 258 $deliveries[] = [ 248 259 'chatID' => $chat->getChatID(), 260 'messageThreadID' => $messageThreadID, 249 261 'chatPostID' => $chat->getPost()->ID, 250 262 'results' => $results, -
cf7-telegram/tags/1.2.1/lib/Chat.php
r3676902 r3772619 26 26 public const CUSTOM_NAME_PARAM = 'customName'; 27 27 public const TELEGRAM_TITLE_PARAM = 'telegramTitle'; 28 public const TELEGRAM_TOPIC_NAME_PARAM = 'telegramTopicName'; 28 29 29 30 /** … … 46 47 } 47 48 49 public function setMessageThreadID( $threadID ): Chat { 50 $this->setParam( 'messageThreadID', Util::normalizeMessageThreadID( $threadID ) ); 51 return $this; 52 } 53 54 public function getMessageThreadID(): ?int { 55 $threadID = Util::normalizeMessageThreadID( $this->getParam( 'messageThreadID' ) ); 56 if ( null !== $threadID && 'supergroup' !== $this->getChatType() ) { 57 throw new \InvalidArgumentException( 'Unsupported Telegram topic destination.' ); 58 } 59 return $threadID; 60 } 61 48 62 public function setChatType( string $chatType ): Chat { 49 63 $this->setParam( 'chatType', Util::sanitizeTelegramChatType( $chatType ) ); … … 89 103 public function getTelegramTitle(): string { 90 104 return Util::sanitizeTelegramText( $this->getParam( self::TELEGRAM_TITLE_PARAM ) ); 105 } 106 107 public function setTelegramTopicName( string $name ): Chat { 108 $this->setParam( self::TELEGRAM_TOPIC_NAME_PARAM, Util::sanitizeTelegramText( $name ) ); 109 return $this; 110 } 111 112 public function getTelegramTopicName(): string { 113 return Util::sanitizeTelegramText( $this->getParam( self::TELEGRAM_TOPIC_NAME_PARAM ) ); 91 114 } 92 115 … … 230 253 private function setChannelConnectionStatus( Channel $channel, string $status ): Chat { 231 254 $connection = $this->getChannelConnection( $channel ); 232 $connection->meta ->where( 'key', self::STATUS_KEY )->clear();255 $connection->meta = $connection->meta->filter( static fn( Meta $meta ): bool => self::STATUS_KEY !== $meta->getKey() ); 233 256 $connection->meta->add( new Meta( self::STATUS_KEY, $status ) ); 234 257 $connection->update(); … … 243 266 private function setBotConnectionStatus( Bot $bot, string $status ): Chat { 244 267 $connection = $this->getBotConnection( $bot ); 245 $connection->meta ->where( 'key', self::STATUS_KEY )->clear();268 $connection->meta = $connection->meta->filter( static fn( Meta $meta ): bool => self::STATUS_KEY !== $meta->getKey() ); 246 269 $connection->meta->add( new Meta( self::STATUS_KEY, $status ) ); 247 270 $connection->update(); -
cf7-telegram/tags/1.2.1/lib/Controllers/RestApi/ChatController.php
r3676902 r3772619 123 123 124 124 try { 125 $result = $bot->getAPI()->getChat( $chat->getChatID() ); 126 127 if ( ! $result->ok || ! is_array( $result->result ) ) { 128 return $this->error( 'rest_chat_name_restore_failed', 'Telegram chat could not be loaded.', 502 ); 125 if ( null === $chat->getMessageThreadID() ) { 126 $result = $bot->getAPI()->getChat( $chat->getChatID() ); 127 128 if ( ! $result->ok || ! is_array( $result->result ) ) { 129 return $this->error( 'rest_chat_name_restore_failed', 'Telegram chat could not be loaded.', 502 ); 130 } 131 132 $chat->setTelegramData( $result->result ); 129 133 } 130 131 $chat->setTelegramData( $result->result );132 134 $chat->restoreTelegramName(); 133 135 $chat->savePost(); … … 147 149 $data['customName'] = $chat->getCustomName(); 148 150 $data['telegramName'] = $chat->getTelegramName(); 151 $data['telegramTopicName'] = $chat->getTelegramTopicName(); 152 $data['messageThreadID'] = $chat->getMessageThreadID(); 149 153 $response->set_data( $data ); 150 154 … … 199 203 private function checkNameAvailability( Chat $chat, Bot $bot ): ?WP_Error { 200 204 try { 201 if ( Chat::STATUS_PENDING === $chat->getBotConnectionStatus( $bot ) ) { 205 $status = $chat->getBotConnectionStatus( $bot ); 206 if ( null === $chat->getMessageThreadID() && Chat::STATUS_PENDING === $status ) { 202 207 return $this->error( 'rest_chat_name_pending', 'Pending chats cannot be renamed.', 409 ); 203 208 } -
cf7-telegram/tags/1.2.1/lib/Migrations/LegacyImporter.php
r3675011 r3772619 418 418 foreach ( $this->getPostIDs( Client::CPT_CHAT ) as $postID ) { 419 419 $postData = $this->getPostData( $postID ); 420 if ( $chatID === $this->normalizeToken( $postData['chatID'] ?? '' ) ) { 421 return new Chat( $postID ); 422 } 420 if ( $chatID !== $this->normalizeToken( $postData['chatID'] ?? '' ) ) { 421 continue; 422 } 423 try { 424 if ( null !== Util::normalizeMessageThreadID( $postData['messageThreadID'] ?? null ) ) { 425 continue; 426 } 427 } catch ( \InvalidArgumentException $exception ) { 428 continue; 429 } 430 return new Chat( $postID ); 423 431 } 424 432 -
cf7-telegram/tags/1.2.1/lib/RestBotUpdates.php
r3675011 r3772619 8 8 public bool $hasNewChats = false; 9 9 public bool $hasNewConnections = false; 10 public bool $hasUpdatedChats = false; 10 11 public bool $hasWebhookConflict = false; 11 12 public ?array $webhookInfo = null; -
cf7-telegram/tags/1.2.1/lib/Settings.php
r3744804 r3772619 66 66 $asset = self::getReactBuildAsset(); 67 67 68 wp_enqueue_style( 'cf7-telegram-admin-styles', self::pluginUrl() . '/react/build/static/css/main.css', [ ], $asset['version'] );68 wp_enqueue_style( 'cf7-telegram-admin-styles', self::pluginUrl() . '/react/build/static/css/main.css', [ 'dashicons' ], $asset['version'] ); 69 69 wp_enqueue_style( 'gf-styles', 'https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap', null, WPCF7TG_VERSION ); 70 70 wp_enqueue_script( 'cf7-telegram-admin', self::pluginUrl() . '/react/build/static/js/main.js', $asset['dependencies'], $asset['version'], true ); -
cf7-telegram/tags/1.2.1/lib/Util.php
r3676902 r3772619 96 96 } 97 97 98 static function normalizeMessageThreadID( $threadID ): ?int { 99 if ( null === $threadID ) { 100 return null; 101 } 102 103 if ( ! is_int( $threadID ) && ! is_string( $threadID ) ) { 104 throw new \InvalidArgumentException( 'Invalid Telegram topic ID.' ); 105 } 106 107 $value = (string) $threadID; 108 if ( ! preg_match( '/^[1-9][0-9]*$/', $value ) || (string) (int) $value !== $value ) { 109 throw new \InvalidArgumentException( 'Invalid Telegram topic ID.' ); 110 } 111 112 return 1 === (int) $value ? null : (int) $value; 113 } 114 115 static function messageThreadIDFromUpdate( array $message ): ?int { 116 $isTopic = $message['is_topic_message'] ?? false; 117 if ( ! is_bool( $isTopic ) ) { 118 throw new \InvalidArgumentException( 'Invalid Telegram topic flag.' ); 119 } 120 121 if ( ! $isTopic ) { 122 return null; 123 } 124 125 if ( 'supergroup' !== ( $message['chat']['type'] ?? null ) || ! array_key_exists( 'message_thread_id', $message ) || null === $message['message_thread_id'] ) { 126 throw new \InvalidArgumentException( 'Unsupported Telegram topic message.' ); 127 } 128 129 return self::normalizeMessageThreadID( $message['message_thread_id'] ); 130 } 131 98 132 /** 99 133 * @throws wppaLoadPostException 100 134 * @throws wppaCreatePostException 101 135 */ 102 static function getChatByTelegramID( $chatID ): ?Chat { 136 static function getChatByTelegramID( $chatID, ?int $messageThreadID = null ): ?Chat { 137 $messageThreadID = self::normalizeMessageThreadID( $messageThreadID ); 103 138 $chats = get_posts( [ 104 139 'post_type' => Client::CPT_CHAT, … … 110 145 foreach ( $chats as $postID ) { 111 146 $chat = new Chat( $postID ); 112 if ( $chat->getChatID() == $chatID ) {147 if ( (string) $chat->getChatID() === (string) $chatID && $chat->getMessageThreadID() === $messageThreadID ) { 113 148 return $chat; 114 149 } … … 121 156 * @throws wppaSavePostException 122 157 */ 123 static function createChat( $tg_chat ): Chat {158 static function createChat( $tg_chat, ?int $messageThreadID = null ): Chat { 124 159 $chat = new Chat(); 125 $chat->setTelegramData( $tg_chat )-> publish();160 $chat->setTelegramData( $tg_chat )->setMessageThreadID( $messageThreadID )->publish(); 126 161 127 162 return $chat; … … 131 166 * @throws wppaSavePostException 132 167 */ 133 static function createChatFromArray( array $tg_chat ): Chat {134 return self::createChat( $tg_chat );168 static function createChatFromArray( array $tg_chat, ?int $messageThreadID = null ): Chat { 169 return self::createChat( $tg_chat, $messageThreadID ); 135 170 } 136 171 -
cf7-telegram/tags/1.2.1/react/build/main-rtl.css
r3676902 r3772619 1 body[class*=page_wpcf7_tg],body[class*=page_wpcf7_tg] #wpbody,body[class*=page_wpcf7_tg] #wpbody-content,body[class*=page_wpcf7_tg] #wpcontent,body[class*=page_wpcf7_tg] #wpwrap{background-color:#0e1621}body[class*=page_wpcf7_tg] #wpbody-content>.error:not(.cf7t-notice),body[class*=page_wpcf7_tg] #wpbody-content>.notice:not(.cf7t-notice),body[class*=page_wpcf7_tg] #wpbody-content>.update-nag:not(.cf7t-notice),body[class*=page_wpcf7_tg] #wpbody-content>.updated:not(.cf7t-notice){display:none!important}body[class*=page_wpcf7_tg] ul#adminmenu a.wp-has-current-submenu:after,body[class*=page_wpcf7_tg] ul#adminmenu>li.current>a.current:after{border-left-color:#0e1621}#cf7-telegram-container{background-color:#0e1621;box-sizing:border-box;min-height:100vh;padding:1px 0 20px 20px}#cf7-telegram-container h1,#cf7-telegram-container h2,#cf7-telegram-container h3,#cf7-telegram-container h4,#cf7-telegram-container h5,#cf7-telegram-container h6{color:#b5b5b5}#cf7-telegram-container #settings-content{color:#fff;font-family:Open Sans}.cf7-tg-container{display:flex;flex-direction:column;gap:32px;width:100%}@media(min-width:1440px){.cf7-tg-container{flex-direction:row}}.cf7-tg-container .main-container{display:flex;flex:3 1;flex-direction:column;gap:32px}@media(min-width:1120px){.cf7-tg-container .main-container{flex-direction:row}}.cf7-tg-container .list-container{display:flex;flex-direction:column;gap:20px}.cf7-tg-container .title-container{align-items:start;display:flex;flex-direction:column;padding:15px 0}.cf7-tg-container .title-container .title{margin:0}.cf7-tg-container .title-container .title-description{box-sizing:border-box;color:#656565;font-size:12px;height:72px;line-height:1.45;margin:6px 0 10px;max-width:460px;overflow-wrap:break-word}.cf7-tg-container .title-container .title-description a{color:#0c87b3}.cf7-tg-container .title-container .title-description a:hover{color:#0c88b4}.cf7-tg-container .title-container .add-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;margin:0;padding:0;text-align:center}.cf7-tg-container .title-container .add-button:hover{color:#0c87b3}.cf7-tg-container .entity-container{border-radius:12px;border-style:dashed;border-width:4px;flex-basis:500px;flex-shrink:0;transition:all .4s ease}.cf7-tg-container .entity-container.saving{opacity:.5}.cf7-tg-container .entity-container .entity-wrapper{display:flex;flex-direction:column;gap:0}.cf7-tg-container .entity-container .columns{display:flex;flex-direction:row;gap:10px}.cf7-tg-container .entity-container .columns .column{align-items:center;border-radius:5px;display:flex;flex-basis:100%;flex-grow:1;justify-content:center}.cf7-tg-container .entity-container .add-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .entity-container .add-button:hover{color:#0c87b3}.cf7-tg-container .frame{padding:10px 15px;position:relative}.cf7-tg-container .bots-container{width:375px}.cf7-tg-container .bots-container .bot-list{display:flex;flex-wrap:wrap;gap:10px}.cf7-tg-container .bots-container .bot-list .bot{border-color:#0c88b417;box-sizing:border-box;flex-basis:unset;width:100%}.cf7-tg-container .bots-container .bot-list .bot.offline{border-color:#9d6262}.cf7-tg-container .bots-container .bot-list .bot.online{border-color:#0c88b4}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary{align-items:center;display:flex; justify-content:space-between;position:relative}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title{display:flex;flex-direction:column;font-family:monospace}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name{border:solid #082d3b;border-top-right-radius:5px;border-top-left-radius:5px;border-width:1px 1px 0;color:#7499b3;font-size:15px;font-weight:100;margin:0;max-width:190px;padding:2px 8px;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name.offline{color:#9d6262!important}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name a,.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name a:active,.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name a:focus,.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name a:visited{color:inherit;outline:none!important;text-decoration:none;-webkit-tap-highlight-color:rgba(0,0,0,0);box-shadow:0 0 0 2px #0003}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-command{background-color:#112747;border:1px solid #112747;border-bottom-right-radius:5px;border-bottom-left-radius:5px;border-top:0 solid #112747;color:#7499b3;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token{color:#465b79;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .show-token{cursor:pointer;font-family:monospace}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .show-token.const{cursor:default}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .php-const-hint{cursor:pointer;font-size:10px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .edit-token,.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .token-value{background-color:#09090c;font-family:Monospace,serif;padding:2px 5px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .edit-token{border:1px solid rgba(12,136,180,.278);box-shadow:none;color:inherit;height:45px;right:50%;line-height:100%;padding:0 10px;position:absolute;text-align:inherit;top:50%;transform:translate(50%,-50%);width:98%}.cf7-tg-container .bots-container .bot-list .bot-wrapper.offline .bot-name{color:#9d6262!important}.cf7-tg-container .bots-container .bot-list .bot-wrapper.online .bot-name{box-shadow:0 0 20px 0 rgba(12,136,180,.322)}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot h5{color:#375885;font-size:11px;margin:0;text-align:center;text-transform:uppercase}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot ul{margin:0}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item{align-items:center;display:flex;justify-content:start}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .chat-name{box-sizing:border-box;overflow-wrap:anywhere;text-align:left;width:120px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .edit-chat-name{background:#0000;border:1px solid rgba(12,136,180,.278);box-shadow:none;color:inherit;font-family:inherit;font-size:inherit;line-height:inherit;min-height:24px;padding:0 5px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item.active{color:#35894c}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item.pending{color:#898735}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item.muted{color:#893535}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item span{cursor:pointer;padding:0 5px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item span.action{color:#656565;text-align:center;text-transform:uppercase}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item span.action:hover{color:#873d3d}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .no-chats-found{color:#0c88b4;font-size:12px;font-style:italic;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .offline-bot-sad-message{color:#9d6262;font-size:12px;font-style:italic;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .unknown-bot-status-message{color:#0c88b4;font-size:12px;font-style:italic;opacity:.25;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar{align-items:center;display:flex;justify-content:space-between}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .remove-bot-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .remove-bot-button:hover{color:#873d3d}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .bot-status{font-size:12px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .bot-status.online{color:#0c88b4}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .bot-status.offline{color:#9d6262}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .bot-status.unknown{color:#b5b5b5}.cf7-tg-container .channels-container{flex:1;max-width:508px}@media(min-width:1880px){.cf7-tg-container .channels-container{max-width:1026px}}.cf7-tg-container .channels-container .channel-list{display:flex;flex-wrap:wrap;gap:10px}.cf7-tg-container .channels-container .channel-list .channel{border-color:#656565;color:#656565;display:flex;flex-direction:column}.cf7-tg-container .channels-container .channel-list .channel.has-bot-online.has-active-chats.has-forms{border-color:#69ad7a;box-shadow:inset 0 0 12px 0 #2f4f37;color:#69ad7a}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper{flex-grow:1}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper{box-sizing:border-box;color:inherit;display:flex;flex-direction:column;font-size:17px;font-weight:500;justify-content:center;line-height:17px;min-height:60px;text-align:center}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper .channel-title{color:inherit;cursor:pointer;line-height:inherit;margin:0;text-align:inherit}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper input.edit-title{background:#0000;border:none;box-shadow:none;color:inherit;font-family:inherit;font-size:1em;font-weight:inherit;height:100%;right:0;line-height:inherit;margin:0;outline:none;padding:0;position:relative;text-align:inherit;text-shadow:none;text-transform:none;top:0;width:100%}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper .bot-for-channel{align-items:center;border:1px dashed #0c88b4;border-radius:5px;color:#0c88b4;display:inline-flex;gap:10px;justify-content:space-between;padding:7px 11px}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper .bot-for-channel.offline{border-color:#9d6262;color:#9d6262}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper .bot-for-channel span{font-family:monospace}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__indicator-separator{background-color:#2b365954}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__control{background-color:#0e1621;border-color:#656565;border-style:dashed;box-shadow:none;cursor:pointer;font-size:13px;min-width:180px}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__menu{border-color:#2b365954;border-width:1px}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__menu,.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__option{background-color:#0e1621;color:#707070;cursor:pointer;font-size:13px}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__menu--is-focused,.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__option--is-focused{background-color:#061215}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .status-bar{align-items:center;display:flex;justify-content:space-between;margin-top:auto}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .status-bar .remove-channel-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .status-bar .remove-channel-button:hover{color:#873d3d}.cf7-tg-container .channels-container .channel-list .channel .chats{align-items:center;border-color:#505145;box-sizing:border-box;display:flex;gap:5px;margin:0;min-height:65px}.cf7-tg-container .channels-container .channel-list .channel .chats .chat{border:1px dashed #898735;border-radius:5px;color:#898735;cursor:pointer;display:inline;margin:0;padding:5px 10px}.cf7-tg-container .channels-container .channel-list .channel .chats .chat.active{border-color:#487d44;color:#487d44}.cf7-tg-container .channels-container .channel-list .channel .chats .chat.muted{border-color:#656565;color:#656565}.cf7-tg-container .channels-container .channel-list .channel .chats .chat.active .chat-username{color:#487d44}.cf7-tg-container .channels-container .channel-list .channel .chats .chat .chat-toggle-status{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .channels-container .channel-list .channel .chats .chat .chat-toggle-status:hover{color:#873d3d}.cf7-tg-container .channels-container .channel-list .channel .chats .no-chats-found{color:#656565;display:block;text-align:center;width:100%}.cf7-tg-container .channels-container .channel-list .channel .forms{border-color:#797083;box-sizing:border-box;min-height:75px}.cf7-tg-container .channels-container .channel-list .channel .forms .add-button{display:block}.cf7-tg-container .channels-container .channel-list .channel .forms .form-list{align-items:center;display:inline-flex;gap:8px}.cf7-tg-container .channels-container .channel-list .channel .forms .form-list.show-selector{opacity:.1}.cf7-tg-container .channels-container .channel-list .channel .forms .form-list li{align-items:center;border:1px dashed #2f4f37;border-radius:5px;color:#487d44;display:inline-flex;gap:8px;padding:5px 10px}.cf7-tg-container .channels-container .channel-list .channel .forms .form-picker{right:15px;position:absolute;top:35px;z-index:5}.cf7-tg-container .channels-container .channel-list .channel .forms .no-forms-found{color:#656565;display:block;text-align:center;width:100%}.cf7-tg-container .channels-container .channel-list .channel .detach-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux{height:20px;position:relative;width:20px}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:after,.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:before{background-color:#1f3047;content:"";display:block;height:1px;position:absolute;top:50%;transition:all .2s ease;width:20px}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:before{transform:rotate(-45deg)}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:after{transform:rotate(45deg)}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:hover:after,.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:hover:before{background-color:#873d3d}.cf7-tg-container .channels-container .channel-list .channel .detach-button:hover{color:#873d3d}.cf7-tg-container .copyable{cursor:pointer;display:inline-block;position:relative}.cf7-tg-container .copyable:after{background-color:#333;border-radius:4px;bottom:120%;color:#fff;content:"Copied!";font-size:12px;right:50%;opacity:0;padding:4px 8px;pointer-events:none;position:absolute;transform:translateX(50%);transition:opacity .3s;white-space:nowrap}.cf7-tg-container .copyable.copied:after{opacity:1}#cf7-telegram-container .cf7-tg-load-status{padding-bottom:10px}#cf7-telegram-container .resource-error{color:#b32d2e}#cf7-telegram-container .resource-loading{color:#656565}#cf7-telegram-container .cf7-tg-error-boundary{padding:20px}1 body[class*=page_wpcf7_tg],body[class*=page_wpcf7_tg] #wpbody,body[class*=page_wpcf7_tg] #wpbody-content,body[class*=page_wpcf7_tg] #wpcontent,body[class*=page_wpcf7_tg] #wpwrap{background-color:#0e1621}body[class*=page_wpcf7_tg] #wpbody-content>.error:not(.cf7t-notice),body[class*=page_wpcf7_tg] #wpbody-content>.notice:not(.cf7t-notice),body[class*=page_wpcf7_tg] #wpbody-content>.update-nag:not(.cf7t-notice),body[class*=page_wpcf7_tg] #wpbody-content>.updated:not(.cf7t-notice){display:none!important}body[class*=page_wpcf7_tg] ul#adminmenu a.wp-has-current-submenu:after,body[class*=page_wpcf7_tg] ul#adminmenu>li.current>a.current:after{border-left-color:#0e1621}#cf7-telegram-container{background-color:#0e1621;box-sizing:border-box;min-height:100vh;padding:1px 0 20px 20px}#cf7-telegram-container h1,#cf7-telegram-container h2,#cf7-telegram-container h3,#cf7-telegram-container h4,#cf7-telegram-container h5,#cf7-telegram-container h6{color:#b5b5b5}#cf7-telegram-container #settings-content{color:#fff;font-family:Open Sans}.cf7-tg-container{display:flex;flex-direction:column;gap:32px;width:100%}@media(min-width:1440px){.cf7-tg-container{flex-direction:row}}.cf7-tg-container .main-container{display:flex;flex:3 1;flex-direction:column;gap:32px}@media(min-width:1120px){.cf7-tg-container .main-container{flex-direction:row}}.cf7-tg-container .list-container{display:flex;flex-direction:column;gap:20px}.cf7-tg-container .title-container{align-items:start;display:flex;flex-direction:column;padding:15px 0}.cf7-tg-container .title-container .title{margin:0}.cf7-tg-container .title-container .title-description{box-sizing:border-box;color:#656565;font-size:12px;height:72px;line-height:1.45;margin:6px 0 10px;max-width:460px;overflow-wrap:break-word}.cf7-tg-container .title-container .title-description a{color:#0c87b3}.cf7-tg-container .title-container .title-description a:hover{color:#0c88b4}.cf7-tg-container .title-container .add-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;margin:0;padding:0;text-align:center}.cf7-tg-container .title-container .add-button:hover{color:#0c87b3}.cf7-tg-container .entity-container{border-radius:12px;border-style:dashed;border-width:4px;flex-basis:500px;flex-shrink:0;transition:all .4s ease}.cf7-tg-container .entity-container.saving{opacity:.5}.cf7-tg-container .entity-container .entity-wrapper{display:flex;flex-direction:column;gap:0}.cf7-tg-container .entity-container .columns{display:flex;flex-direction:row;gap:10px}.cf7-tg-container .entity-container .columns .column{align-items:center;border-radius:5px;display:flex;flex-basis:100%;flex-grow:1;justify-content:center}.cf7-tg-container .entity-container .add-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .entity-container .add-button:hover{color:#0c87b3}.cf7-tg-container .frame{padding:10px 15px;position:relative}.cf7-tg-container .bots-container{width:375px}.cf7-tg-container .bots-container .bot-list{display:flex;flex-wrap:wrap;gap:10px}.cf7-tg-container .bots-container .bot-list .bot{border-color:#0c88b417;box-sizing:border-box;flex-basis:unset;width:100%}.cf7-tg-container .bots-container .bot-list .bot.offline{border-color:#9d6262}.cf7-tg-container .bots-container .bot-list .bot.online{border-color:#0c88b4}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary{align-items:center;display:flex;gap:8px;justify-content:space-between;position:relative}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title{display:flex;flex-direction:column;font-family:monospace;min-width:0}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name{border:solid #082d3b;border-top-right-radius:5px;border-top-left-radius:5px;border-width:1px 1px 0;color:#7499b3;font-size:15px;font-weight:100;margin:0;max-width:190px;padding:2px 8px;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name.offline{color:#9d6262!important}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name a,.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name a:active,.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name a:focus,.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name a:visited{color:inherit;outline:none!important;text-decoration:none;-webkit-tap-highlight-color:rgba(0,0,0,0);box-shadow:0 0 0 2px #0003}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-command{background-color:#112747;border:1px solid #112747;border-bottom-right-radius:5px;border-bottom-left-radius:5px;border-top:0 solid #112747;color:#7499b3;overflow-wrap:anywhere;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token{color:#465b79;flex-shrink:0;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .show-token{cursor:pointer;font-family:monospace}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .show-token.const{cursor:default}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .php-const-hint{cursor:pointer;font-size:10px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .edit-token,.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .token-value{background-color:#09090c;font-family:Monospace,serif;padding:2px 5px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .edit-token{border:1px solid rgba(12,136,180,.278);box-shadow:none;color:inherit;height:45px;right:50%;line-height:100%;padding:0 10px;position:absolute;text-align:inherit;top:50%;transform:translate(50%,-50%);width:98%}.cf7-tg-container .bots-container .bot-list .bot-wrapper.offline .bot-name{color:#9d6262!important}.cf7-tg-container .bots-container .bot-list .bot-wrapper.online .bot-name{box-shadow:0 0 20px 0 rgba(12,136,180,.322)}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot h5{color:#375885;font-size:11px;margin:0;text-align:center;text-transform:uppercase}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot ul{margin:0}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item{align-items:center;display:flex;justify-content:start}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .chat-name{box-sizing:border-box;overflow-wrap:anywhere;padding:0 5px;text-align:left;width:120px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .topic-identity{margin-right:4px;min-width:0;overflow-wrap:anywhere}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .edit-chat-name{background:#0000;border:1px solid rgba(12,136,180,.278);box-shadow:none;color:inherit;font-family:inherit;font-size:inherit;line-height:inherit;min-height:24px;padding:0 5px;width:120px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item.active{color:#35894c}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item.pending{color:#898735}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item.muted{color:#893535}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .chat-actions{display:flex;flex:0 0 auto;gap:2px;margin-right:auto}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .chat-actions .action{align-items:center;background:none;border:0;color:#656565;cursor:pointer;display:inline-flex;height:24px;justify-content:center;opacity:.25;padding:0;width:24px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .chat-actions .action:hover:not(:disabled){color:#873d3d;opacity:1}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .chat-actions .action:focus-visible{opacity:1;outline:2px solid #0c88b4;outline-offset:1px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .chat-actions .action:disabled{cursor:default}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .no-chats-found{color:#0c88b4;font-size:12px;font-style:italic;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .offline-bot-sad-message{color:#9d6262;font-size:12px;font-style:italic;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .unknown-bot-status-message{color:#0c88b4;font-size:12px;font-style:italic;opacity:.25;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar{align-items:center;display:flex;justify-content:space-between}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .remove-bot-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .remove-bot-button:hover{color:#873d3d}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .bot-status{font-size:12px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .bot-status.online{color:#0c88b4}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .bot-status.offline{color:#9d6262}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .bot-status.unknown{color:#b5b5b5}.cf7-tg-container .channels-container{flex:1;max-width:508px}@media(min-width:1880px){.cf7-tg-container .channels-container{max-width:1026px}}.cf7-tg-container .channels-container .channel-list{display:flex;flex-wrap:wrap;gap:10px}.cf7-tg-container .channels-container .channel-list .channel{border-color:#656565;color:#656565;display:flex;flex-direction:column}.cf7-tg-container .channels-container .channel-list .channel.has-bot-online.has-active-chats.has-forms{border-color:#69ad7a;box-shadow:inset 0 0 12px 0 #2f4f37;color:#69ad7a}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper{flex-grow:1}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper{box-sizing:border-box;color:inherit;display:flex;flex-direction:column;font-size:17px;font-weight:500;justify-content:center;line-height:17px;min-height:60px;text-align:center}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper .channel-title{color:inherit;cursor:pointer;line-height:inherit;margin:0;text-align:inherit}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper input.edit-title{background:#0000;border:none;box-shadow:none;color:inherit;font-family:inherit;font-size:1em;font-weight:inherit;height:100%;right:0;line-height:inherit;margin:0;outline:none;padding:0;position:relative;text-align:inherit;text-shadow:none;text-transform:none;top:0;width:100%}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper .bot-for-channel{align-items:center;border:1px dashed #0c88b4;border-radius:5px;color:#0c88b4;display:inline-flex;gap:10px;justify-content:space-between;padding:7px 11px}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper .bot-for-channel.offline{border-color:#9d6262;color:#9d6262}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper .bot-for-channel span{font-family:monospace}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__indicator-separator{background-color:#2b365954}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__control{background-color:#0e1621;border-color:#656565;border-style:dashed;box-shadow:none;cursor:pointer;font-size:13px;min-width:180px}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__menu{border-color:#2b365954;border-width:1px}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__menu,.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__option{background-color:#0e1621;color:#707070;cursor:pointer;font-size:13px}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__menu--is-focused,.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__option--is-focused{background-color:#061215}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .status-bar{align-items:center;display:flex;justify-content:space-between;margin-top:auto}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .status-bar .remove-channel-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .status-bar .remove-channel-button:hover{color:#873d3d}.cf7-tg-container .channels-container .channel-list .channel .chats{align-items:center;border-color:#505145;box-sizing:border-box;display:flex;gap:5px;margin:0;min-height:65px}.cf7-tg-container .channels-container .channel-list .channel .chats .chat{border:1px dashed #898735;border-radius:5px;color:#898735;cursor:pointer;display:inline;margin:0;padding:5px 10px}.cf7-tg-container .channels-container .channel-list .channel .chats .chat.active{border-color:#487d44;color:#487d44}.cf7-tg-container .channels-container .channel-list .channel .chats .chat.muted{border-color:#656565;color:#656565}.cf7-tg-container .channels-container .channel-list .channel .chats .chat.active .chat-username{color:#487d44}.cf7-tg-container .channels-container .channel-list .channel .chats .chat .chat-toggle-status{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .channels-container .channel-list .channel .chats .chat .chat-toggle-status:hover{color:#873d3d}.cf7-tg-container .channels-container .channel-list .channel .chats .no-chats-found{color:#656565;display:block;text-align:center;width:100%}.cf7-tg-container .channels-container .channel-list .channel .forms{border-color:#797083;box-sizing:border-box;min-height:75px}.cf7-tg-container .channels-container .channel-list .channel .forms .add-button{display:block}.cf7-tg-container .channels-container .channel-list .channel .forms .form-list{align-items:start;display:grid;gap:8px;grid-template-columns:repeat(4,minmax(0,1fr));max-width:624px}.cf7-tg-container .channels-container .channel-list .channel .forms .form-list.show-selector{opacity:.1}.cf7-tg-container .channels-container .channel-list .channel .forms .form-list li{align-items:flex-start;border:1px dashed #2f4f37;border-radius:5px;box-sizing:border-box;color:#487d44;display:inline-flex;gap:8px;max-width:150px;min-width:0;overflow-wrap:anywhere;padding:5px 10px}.cf7-tg-container .channels-container .channel-list .channel .forms .form-list li .detach-button{flex-shrink:0}.cf7-tg-container .channels-container .channel-list .channel .forms .form-picker{right:15px;position:absolute;top:35px;z-index:5}.cf7-tg-container .channels-container .channel-list .channel .forms .no-forms-found{color:#656565;display:block;text-align:center;width:100%}.cf7-tg-container .channels-container .channel-list .channel .detach-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux{height:20px;position:relative;width:20px}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:after,.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:before{background-color:#1f3047;content:"";display:block;height:1px;position:absolute;top:50%;transition:all .2s ease;width:20px}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:before{transform:rotate(-45deg)}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:after{transform:rotate(45deg)}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:hover:after,.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:hover:before{background-color:#873d3d}.cf7-tg-container .channels-container .channel-list .channel .detach-button:hover{color:#873d3d}.cf7-tg-container .copyable{cursor:pointer;display:inline-block;position:relative}.cf7-tg-container .copyable:after{background-color:#333;border-radius:4px;bottom:120%;color:#fff;content:"Copied!";font-size:12px;right:50%;opacity:0;padding:4px 8px;pointer-events:none;position:absolute;transform:translateX(50%);transition:opacity .3s;white-space:nowrap}.cf7-tg-container .copyable.copied:after{opacity:1}#cf7-telegram-container .cf7-tg-load-status{padding-bottom:10px}#cf7-telegram-container .resource-error{color:#b32d2e}#cf7-telegram-container .resource-loading{color:#656565}#cf7-telegram-container .cf7-tg-error-boundary{padding:20px} -
cf7-telegram/tags/1.2.1/react/build/static/css/main.css
r3676902 r3772619 1 body[class*=page_wpcf7_tg],body[class*=page_wpcf7_tg] #wpbody,body[class*=page_wpcf7_tg] #wpbody-content,body[class*=page_wpcf7_tg] #wpcontent,body[class*=page_wpcf7_tg] #wpwrap{background-color:#0e1621}body[class*=page_wpcf7_tg] #wpbody-content>.error:not(.cf7t-notice),body[class*=page_wpcf7_tg] #wpbody-content>.notice:not(.cf7t-notice),body[class*=page_wpcf7_tg] #wpbody-content>.update-nag:not(.cf7t-notice),body[class*=page_wpcf7_tg] #wpbody-content>.updated:not(.cf7t-notice){display:none!important}body[class*=page_wpcf7_tg] ul#adminmenu a.wp-has-current-submenu:after,body[class*=page_wpcf7_tg] ul#adminmenu>li.current>a.current:after{border-right-color:#0e1621}#cf7-telegram-container{background-color:#0e1621;box-sizing:border-box;min-height:100vh;padding:1px 20px 20px 0}#cf7-telegram-container h1,#cf7-telegram-container h2,#cf7-telegram-container h3,#cf7-telegram-container h4,#cf7-telegram-container h5,#cf7-telegram-container h6{color:#b5b5b5}#cf7-telegram-container #settings-content{color:#fff;font-family:Open Sans}.cf7-tg-container{display:flex;flex-direction:column;gap:32px;width:100%}@media(min-width:1440px){.cf7-tg-container{flex-direction:row}}.cf7-tg-container .main-container{display:flex;flex:3 1;flex-direction:column;gap:32px}@media(min-width:1120px){.cf7-tg-container .main-container{flex-direction:row}}.cf7-tg-container .list-container{display:flex;flex-direction:column;gap:20px}.cf7-tg-container .title-container{align-items:start;display:flex;flex-direction:column;padding:15px 0}.cf7-tg-container .title-container .title{margin:0}.cf7-tg-container .title-container .title-description{box-sizing:border-box;color:#656565;font-size:12px;height:72px;line-height:1.45;margin:6px 0 10px;max-width:460px;overflow-wrap:break-word}.cf7-tg-container .title-container .title-description a{color:#0c87b3}.cf7-tg-container .title-container .title-description a:hover{color:#0c88b4}.cf7-tg-container .title-container .add-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;margin:0;padding:0;text-align:center}.cf7-tg-container .title-container .add-button:hover{color:#0c87b3}.cf7-tg-container .entity-container{border-radius:12px;border-style:dashed;border-width:4px;flex-basis:500px;flex-shrink:0;transition:all .4s ease}.cf7-tg-container .entity-container.saving{opacity:.5}.cf7-tg-container .entity-container .entity-wrapper{display:flex;flex-direction:column;gap:0}.cf7-tg-container .entity-container .columns{display:flex;flex-direction:row;gap:10px}.cf7-tg-container .entity-container .columns .column{align-items:center;border-radius:5px;display:flex;flex-basis:100%;flex-grow:1;justify-content:center}.cf7-tg-container .entity-container .add-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .entity-container .add-button:hover{color:#0c87b3}.cf7-tg-container .frame{padding:10px 15px;position:relative}.cf7-tg-container .bots-container{width:375px}.cf7-tg-container .bots-container .bot-list{display:flex;flex-wrap:wrap;gap:10px}.cf7-tg-container .bots-container .bot-list .bot{border-color:#0c88b417;box-sizing:border-box;flex-basis:unset;width:100%}.cf7-tg-container .bots-container .bot-list .bot.offline{border-color:#9d6262}.cf7-tg-container .bots-container .bot-list .bot.online{border-color:#0c88b4}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary{align-items:center;display:flex; justify-content:space-between;position:relative}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title{display:flex;flex-direction:column;font-family:monospace}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name{border:solid #082d3b;border-top-left-radius:5px;border-top-right-radius:5px;border-width:1px 1px 0;color:#7499b3;font-size:15px;font-weight:100;margin:0;max-width:190px;padding:2px 8px;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name.offline{color:#9d6262!important}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name a,.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name a:active,.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name a:focus,.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name a:visited{color:inherit;outline:none!important;text-decoration:none;-webkit-tap-highlight-color:rgba(0,0,0,0);box-shadow:0 0 0 2px #0003}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-command{background-color:#112747;border:1px solid #112747;border-bottom-left-radius:5px;border-bottom-right-radius:5px;border-top:0 solid #112747;color:#7499b3;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token{color:#465b79;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .show-token{cursor:pointer;font-family:monospace}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .show-token.const{cursor:default}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .php-const-hint{cursor:pointer;font-size:10px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .edit-token,.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .token-value{background-color:#09090c;font-family:Monospace,serif;padding:2px 5px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .edit-token{border:1px solid rgba(12,136,180,.278);box-shadow:none;color:inherit;height:45px;left:50%;line-height:100%;padding:0 10px;position:absolute;text-align:inherit;top:50%;transform:translate(-50%,-50%);width:98%}.cf7-tg-container .bots-container .bot-list .bot-wrapper.offline .bot-name{color:#9d6262!important}.cf7-tg-container .bots-container .bot-list .bot-wrapper.online .bot-name{box-shadow:0 0 20px 0 rgba(12,136,180,.322)}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot h5{color:#375885;font-size:11px;margin:0;text-align:center;text-transform:uppercase}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot ul{margin:0}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item{align-items:center;display:flex;justify-content:start}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .chat-name{box-sizing:border-box;overflow-wrap:anywhere;text-align:right;width:120px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .edit-chat-name{background:#0000;border:1px solid rgba(12,136,180,.278);box-shadow:none;color:inherit;font-family:inherit;font-size:inherit;line-height:inherit;min-height:24px;padding:0 5px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item.active{color:#35894c}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item.pending{color:#898735}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item.muted{color:#893535}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item span{cursor:pointer;padding:0 5px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item span.action{color:#656565;text-align:center;text-transform:uppercase}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item span.action:hover{color:#873d3d}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .no-chats-found{color:#0c88b4;font-size:12px;font-style:italic;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .offline-bot-sad-message{color:#9d6262;font-size:12px;font-style:italic;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .unknown-bot-status-message{color:#0c88b4;font-size:12px;font-style:italic;opacity:.25;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar{align-items:center;display:flex;justify-content:space-between}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .remove-bot-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .remove-bot-button:hover{color:#873d3d}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .bot-status{font-size:12px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .bot-status.online{color:#0c88b4}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .bot-status.offline{color:#9d6262}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .bot-status.unknown{color:#b5b5b5}.cf7-tg-container .channels-container{flex:1;max-width:508px}@media(min-width:1880px){.cf7-tg-container .channels-container{max-width:1026px}}.cf7-tg-container .channels-container .channel-list{display:flex;flex-wrap:wrap;gap:10px}.cf7-tg-container .channels-container .channel-list .channel{border-color:#656565;color:#656565;display:flex;flex-direction:column}.cf7-tg-container .channels-container .channel-list .channel.has-bot-online.has-active-chats.has-forms{border-color:#69ad7a;box-shadow:inset 0 0 12px 0 #2f4f37;color:#69ad7a}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper{flex-grow:1}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper{box-sizing:border-box;color:inherit;display:flex;flex-direction:column;font-size:17px;font-weight:500;justify-content:center;line-height:17px;min-height:60px;text-align:center}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper .channel-title{color:inherit;cursor:pointer;line-height:inherit;margin:0;text-align:inherit}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper input.edit-title{background:#0000;border:none;box-shadow:none;color:inherit;font-family:inherit;font-size:1em;font-weight:inherit;height:100%;left:0;line-height:inherit;margin:0;outline:none;padding:0;position:relative;text-align:inherit;text-shadow:none;text-transform:none;top:0;width:100%}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper .bot-for-channel{align-items:center;border:1px dashed #0c88b4;border-radius:5px;color:#0c88b4;display:inline-flex;gap:10px;justify-content:space-between;padding:7px 11px}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper .bot-for-channel.offline{border-color:#9d6262;color:#9d6262}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper .bot-for-channel span{font-family:monospace}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__indicator-separator{background-color:#2b365954}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__control{background-color:#0e1621;border-color:#656565;border-style:dashed;box-shadow:none;cursor:pointer;font-size:13px;min-width:180px}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__menu{border-color:#2b365954;border-width:1px}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__menu,.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__option{background-color:#0e1621;color:#707070;cursor:pointer;font-size:13px}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__menu--is-focused,.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__option--is-focused{background-color:#061215}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .status-bar{align-items:center;display:flex;justify-content:space-between;margin-top:auto}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .status-bar .remove-channel-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .status-bar .remove-channel-button:hover{color:#873d3d}.cf7-tg-container .channels-container .channel-list .channel .chats{align-items:center;border-color:#505145;box-sizing:border-box;display:flex;gap:5px;margin:0;min-height:65px}.cf7-tg-container .channels-container .channel-list .channel .chats .chat{border:1px dashed #898735;border-radius:5px;color:#898735;cursor:pointer;display:inline;margin:0;padding:5px 10px}.cf7-tg-container .channels-container .channel-list .channel .chats .chat.active{border-color:#487d44;color:#487d44}.cf7-tg-container .channels-container .channel-list .channel .chats .chat.muted{border-color:#656565;color:#656565}.cf7-tg-container .channels-container .channel-list .channel .chats .chat.active .chat-username{color:#487d44}.cf7-tg-container .channels-container .channel-list .channel .chats .chat .chat-toggle-status{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .channels-container .channel-list .channel .chats .chat .chat-toggle-status:hover{color:#873d3d}.cf7-tg-container .channels-container .channel-list .channel .chats .no-chats-found{color:#656565;display:block;text-align:center;width:100%}.cf7-tg-container .channels-container .channel-list .channel .forms{border-color:#797083;box-sizing:border-box;min-height:75px}.cf7-tg-container .channels-container .channel-list .channel .forms .add-button{display:block}.cf7-tg-container .channels-container .channel-list .channel .forms .form-list{align-items:center;display:inline-flex;gap:8px}.cf7-tg-container .channels-container .channel-list .channel .forms .form-list.show-selector{opacity:.1}.cf7-tg-container .channels-container .channel-list .channel .forms .form-list li{align-items:center;border:1px dashed #2f4f37;border-radius:5px;color:#487d44;display:inline-flex;gap:8px;padding:5px 10px}.cf7-tg-container .channels-container .channel-list .channel .forms .form-picker{left:15px;position:absolute;top:35px;z-index:5}.cf7-tg-container .channels-container .channel-list .channel .forms .no-forms-found{color:#656565;display:block;text-align:center;width:100%}.cf7-tg-container .channels-container .channel-list .channel .detach-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux{height:20px;position:relative;width:20px}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:after,.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:before{background-color:#1f3047;content:"";display:block;height:1px;position:absolute;top:50%;transition:all .2s ease;width:20px}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:before{transform:rotate(45deg)}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:after{transform:rotate(-45deg)}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:hover:after,.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:hover:before{background-color:#873d3d}.cf7-tg-container .channels-container .channel-list .channel .detach-button:hover{color:#873d3d}.cf7-tg-container .copyable{cursor:pointer;display:inline-block;position:relative}.cf7-tg-container .copyable:after{background-color:#333;border-radius:4px;bottom:120%;color:#fff;content:"Copied!";font-size:12px;left:50%;opacity:0;padding:4px 8px;pointer-events:none;position:absolute;transform:translateX(-50%);transition:opacity .3s;white-space:nowrap}.cf7-tg-container .copyable.copied:after{opacity:1}#cf7-telegram-container .cf7-tg-load-status{padding-bottom:10px}#cf7-telegram-container .resource-error{color:#b32d2e}#cf7-telegram-container .resource-loading{color:#656565}#cf7-telegram-container .cf7-tg-error-boundary{padding:20px}1 body[class*=page_wpcf7_tg],body[class*=page_wpcf7_tg] #wpbody,body[class*=page_wpcf7_tg] #wpbody-content,body[class*=page_wpcf7_tg] #wpcontent,body[class*=page_wpcf7_tg] #wpwrap{background-color:#0e1621}body[class*=page_wpcf7_tg] #wpbody-content>.error:not(.cf7t-notice),body[class*=page_wpcf7_tg] #wpbody-content>.notice:not(.cf7t-notice),body[class*=page_wpcf7_tg] #wpbody-content>.update-nag:not(.cf7t-notice),body[class*=page_wpcf7_tg] #wpbody-content>.updated:not(.cf7t-notice){display:none!important}body[class*=page_wpcf7_tg] ul#adminmenu a.wp-has-current-submenu:after,body[class*=page_wpcf7_tg] ul#adminmenu>li.current>a.current:after{border-right-color:#0e1621}#cf7-telegram-container{background-color:#0e1621;box-sizing:border-box;min-height:100vh;padding:1px 20px 20px 0}#cf7-telegram-container h1,#cf7-telegram-container h2,#cf7-telegram-container h3,#cf7-telegram-container h4,#cf7-telegram-container h5,#cf7-telegram-container h6{color:#b5b5b5}#cf7-telegram-container #settings-content{color:#fff;font-family:Open Sans}.cf7-tg-container{display:flex;flex-direction:column;gap:32px;width:100%}@media(min-width:1440px){.cf7-tg-container{flex-direction:row}}.cf7-tg-container .main-container{display:flex;flex:3 1;flex-direction:column;gap:32px}@media(min-width:1120px){.cf7-tg-container .main-container{flex-direction:row}}.cf7-tg-container .list-container{display:flex;flex-direction:column;gap:20px}.cf7-tg-container .title-container{align-items:start;display:flex;flex-direction:column;padding:15px 0}.cf7-tg-container .title-container .title{margin:0}.cf7-tg-container .title-container .title-description{box-sizing:border-box;color:#656565;font-size:12px;height:72px;line-height:1.45;margin:6px 0 10px;max-width:460px;overflow-wrap:break-word}.cf7-tg-container .title-container .title-description a{color:#0c87b3}.cf7-tg-container .title-container .title-description a:hover{color:#0c88b4}.cf7-tg-container .title-container .add-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;margin:0;padding:0;text-align:center}.cf7-tg-container .title-container .add-button:hover{color:#0c87b3}.cf7-tg-container .entity-container{border-radius:12px;border-style:dashed;border-width:4px;flex-basis:500px;flex-shrink:0;transition:all .4s ease}.cf7-tg-container .entity-container.saving{opacity:.5}.cf7-tg-container .entity-container .entity-wrapper{display:flex;flex-direction:column;gap:0}.cf7-tg-container .entity-container .columns{display:flex;flex-direction:row;gap:10px}.cf7-tg-container .entity-container .columns .column{align-items:center;border-radius:5px;display:flex;flex-basis:100%;flex-grow:1;justify-content:center}.cf7-tg-container .entity-container .add-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .entity-container .add-button:hover{color:#0c87b3}.cf7-tg-container .frame{padding:10px 15px;position:relative}.cf7-tg-container .bots-container{width:375px}.cf7-tg-container .bots-container .bot-list{display:flex;flex-wrap:wrap;gap:10px}.cf7-tg-container .bots-container .bot-list .bot{border-color:#0c88b417;box-sizing:border-box;flex-basis:unset;width:100%}.cf7-tg-container .bots-container .bot-list .bot.offline{border-color:#9d6262}.cf7-tg-container .bots-container .bot-list .bot.online{border-color:#0c88b4}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary{align-items:center;display:flex;gap:8px;justify-content:space-between;position:relative}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title{display:flex;flex-direction:column;font-family:monospace;min-width:0}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name{border:solid #082d3b;border-top-left-radius:5px;border-top-right-radius:5px;border-width:1px 1px 0;color:#7499b3;font-size:15px;font-weight:100;margin:0;max-width:190px;padding:2px 8px;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name.offline{color:#9d6262!important}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name a,.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name a:active,.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name a:focus,.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name a:visited{color:inherit;outline:none!important;text-decoration:none;-webkit-tap-highlight-color:rgba(0,0,0,0);box-shadow:0 0 0 2px #0003}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-command{background-color:#112747;border:1px solid #112747;border-bottom-left-radius:5px;border-bottom-right-radius:5px;border-top:0 solid #112747;color:#7499b3;overflow-wrap:anywhere;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token{color:#465b79;flex-shrink:0;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .show-token{cursor:pointer;font-family:monospace}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .show-token.const{cursor:default}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .php-const-hint{cursor:pointer;font-size:10px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .edit-token,.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .token-value{background-color:#09090c;font-family:Monospace,serif;padding:2px 5px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .edit-token{border:1px solid rgba(12,136,180,.278);box-shadow:none;color:inherit;height:45px;left:50%;line-height:100%;padding:0 10px;position:absolute;text-align:inherit;top:50%;transform:translate(-50%,-50%);width:98%}.cf7-tg-container .bots-container .bot-list .bot-wrapper.offline .bot-name{color:#9d6262!important}.cf7-tg-container .bots-container .bot-list .bot-wrapper.online .bot-name{box-shadow:0 0 20px 0 rgba(12,136,180,.322)}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot h5{color:#375885;font-size:11px;margin:0;text-align:center;text-transform:uppercase}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot ul{margin:0}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item{align-items:center;display:flex;justify-content:start}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .chat-name{box-sizing:border-box;overflow-wrap:anywhere;padding:0 5px;text-align:right;width:120px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .topic-identity{margin-left:4px;min-width:0;overflow-wrap:anywhere}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .edit-chat-name{background:#0000;border:1px solid rgba(12,136,180,.278);box-shadow:none;color:inherit;font-family:inherit;font-size:inherit;line-height:inherit;min-height:24px;padding:0 5px;width:120px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item.active{color:#35894c}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item.pending{color:#898735}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item.muted{color:#893535}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .chat-actions{display:flex;flex:0 0 auto;gap:2px;margin-left:auto}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .chat-actions .action{align-items:center;background:none;border:0;color:#656565;cursor:pointer;display:inline-flex;height:24px;justify-content:center;opacity:.25;padding:0;width:24px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .chat-actions .action:hover:not(:disabled){color:#873d3d;opacity:1}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .chat-actions .action:focus-visible{opacity:1;outline:2px solid #0c88b4;outline-offset:1px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .chat-actions .action:disabled{cursor:default}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .no-chats-found{color:#0c88b4;font-size:12px;font-style:italic;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .offline-bot-sad-message{color:#9d6262;font-size:12px;font-style:italic;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .unknown-bot-status-message{color:#0c88b4;font-size:12px;font-style:italic;opacity:.25;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar{align-items:center;display:flex;justify-content:space-between}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .remove-bot-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .remove-bot-button:hover{color:#873d3d}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .bot-status{font-size:12px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .bot-status.online{color:#0c88b4}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .bot-status.offline{color:#9d6262}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .bot-status.unknown{color:#b5b5b5}.cf7-tg-container .channels-container{flex:1;max-width:508px}@media(min-width:1880px){.cf7-tg-container .channels-container{max-width:1026px}}.cf7-tg-container .channels-container .channel-list{display:flex;flex-wrap:wrap;gap:10px}.cf7-tg-container .channels-container .channel-list .channel{border-color:#656565;color:#656565;display:flex;flex-direction:column}.cf7-tg-container .channels-container .channel-list .channel.has-bot-online.has-active-chats.has-forms{border-color:#69ad7a;box-shadow:inset 0 0 12px 0 #2f4f37;color:#69ad7a}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper{flex-grow:1}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper{box-sizing:border-box;color:inherit;display:flex;flex-direction:column;font-size:17px;font-weight:500;justify-content:center;line-height:17px;min-height:60px;text-align:center}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper .channel-title{color:inherit;cursor:pointer;line-height:inherit;margin:0;text-align:inherit}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper input.edit-title{background:#0000;border:none;box-shadow:none;color:inherit;font-family:inherit;font-size:1em;font-weight:inherit;height:100%;left:0;line-height:inherit;margin:0;outline:none;padding:0;position:relative;text-align:inherit;text-shadow:none;text-transform:none;top:0;width:100%}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper .bot-for-channel{align-items:center;border:1px dashed #0c88b4;border-radius:5px;color:#0c88b4;display:inline-flex;gap:10px;justify-content:space-between;padding:7px 11px}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper .bot-for-channel.offline{border-color:#9d6262;color:#9d6262}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper .bot-for-channel span{font-family:monospace}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__indicator-separator{background-color:#2b365954}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__control{background-color:#0e1621;border-color:#656565;border-style:dashed;box-shadow:none;cursor:pointer;font-size:13px;min-width:180px}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__menu{border-color:#2b365954;border-width:1px}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__menu,.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__option{background-color:#0e1621;color:#707070;cursor:pointer;font-size:13px}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__menu--is-focused,.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__option--is-focused{background-color:#061215}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .status-bar{align-items:center;display:flex;justify-content:space-between;margin-top:auto}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .status-bar .remove-channel-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .status-bar .remove-channel-button:hover{color:#873d3d}.cf7-tg-container .channels-container .channel-list .channel .chats{align-items:center;border-color:#505145;box-sizing:border-box;display:flex;gap:5px;margin:0;min-height:65px}.cf7-tg-container .channels-container .channel-list .channel .chats .chat{border:1px dashed #898735;border-radius:5px;color:#898735;cursor:pointer;display:inline;margin:0;padding:5px 10px}.cf7-tg-container .channels-container .channel-list .channel .chats .chat.active{border-color:#487d44;color:#487d44}.cf7-tg-container .channels-container .channel-list .channel .chats .chat.muted{border-color:#656565;color:#656565}.cf7-tg-container .channels-container .channel-list .channel .chats .chat.active .chat-username{color:#487d44}.cf7-tg-container .channels-container .channel-list .channel .chats .chat .chat-toggle-status{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .channels-container .channel-list .channel .chats .chat .chat-toggle-status:hover{color:#873d3d}.cf7-tg-container .channels-container .channel-list .channel .chats .no-chats-found{color:#656565;display:block;text-align:center;width:100%}.cf7-tg-container .channels-container .channel-list .channel .forms{border-color:#797083;box-sizing:border-box;min-height:75px}.cf7-tg-container .channels-container .channel-list .channel .forms .add-button{display:block}.cf7-tg-container .channels-container .channel-list .channel .forms .form-list{align-items:start;display:grid;gap:8px;grid-template-columns:repeat(4,minmax(0,1fr));max-width:624px}.cf7-tg-container .channels-container .channel-list .channel .forms .form-list.show-selector{opacity:.1}.cf7-tg-container .channels-container .channel-list .channel .forms .form-list li{align-items:flex-start;border:1px dashed #2f4f37;border-radius:5px;box-sizing:border-box;color:#487d44;display:inline-flex;gap:8px;max-width:150px;min-width:0;overflow-wrap:anywhere;padding:5px 10px}.cf7-tg-container .channels-container .channel-list .channel .forms .form-list li .detach-button{flex-shrink:0}.cf7-tg-container .channels-container .channel-list .channel .forms .form-picker{left:15px;position:absolute;top:35px;z-index:5}.cf7-tg-container .channels-container .channel-list .channel .forms .no-forms-found{color:#656565;display:block;text-align:center;width:100%}.cf7-tg-container .channels-container .channel-list .channel .detach-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux{height:20px;position:relative;width:20px}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:after,.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:before{background-color:#1f3047;content:"";display:block;height:1px;position:absolute;top:50%;transition:all .2s ease;width:20px}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:before{transform:rotate(45deg)}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:after{transform:rotate(-45deg)}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:hover:after,.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:hover:before{background-color:#873d3d}.cf7-tg-container .channels-container .channel-list .channel .detach-button:hover{color:#873d3d}.cf7-tg-container .copyable{cursor:pointer;display:inline-block;position:relative}.cf7-tg-container .copyable:after{background-color:#333;border-radius:4px;bottom:120%;color:#fff;content:"Copied!";font-size:12px;left:50%;opacity:0;padding:4px 8px;pointer-events:none;position:absolute;transform:translateX(-50%);transition:opacity .3s;white-space:nowrap}.cf7-tg-container .copyable.copied:after{opacity:1}#cf7-telegram-container .cf7-tg-load-status{padding-bottom:10px}#cf7-telegram-container .resource-error{color:#b32d2e}#cf7-telegram-container .resource-loading{color:#656565}#cf7-telegram-container .cf7-tg-error-boundary{padding:20px} -
cf7-telegram/tags/1.2.1/react/build/static/js/main.asset.php
r3676902 r3772619 1 <?php return array('dependencies' => array('react', 'react-dom', 'wp-element'), 'version' => ' 7211cba37053d02c9eaa');1 <?php return array('dependencies' => array('react', 'react-dom', 'wp-element'), 'version' => 'acebbb7527c24b9e8c4e'); -
cf7-telegram/tags/1.2.1/react/build/static/js/main.js
r3676902 r3772619 1 (()=>{"use strict";var e={72(e,t){var n="function"==typeof Symbol&&Symbol.for,a=n?Symbol.for("react.element"):60103,r=n?Symbol.for("react.portal"):60106,o=n?Symbol.for("react.fragment"):60107,i=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,m=n?Symbol.for("react.suspense_list"):60120,h=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.block"):60121,b=n?Symbol.for("react.fundamental"):60117,y=n?Symbol.for("react.responder"):60118,w=n?Symbol.for("react.scope"):60119;function C(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case a:switch(e=e.type){case u:case d:case o:case s:case i:case p:return e;default:switch(e=e&&e.$$typeof){case c:case f:case g:case h:case l:return e;default:return t}}case r:return t}}}function E(e){return C(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=l,t.Element=a,t.ForwardRef=f,t.Fragment=o,t.Lazy=g,t.Memo=h,t.Portal=r,t.Profiler=s,t.StrictMode=i,t.Suspense=p,t.isAsyncMode=function(e){return E(e)||C(e)===u},t.isConcurrentMode=E,t.isContextConsumer=function(e){return C(e)===c},t.isContextProvider=function(e){return C(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===a},t.isForwardRef=function(e){return C(e)===f},t.isFragment=function(e){return C(e)===o},t.isLazy=function(e){return C(e)===g},t.isMemo=function(e){return C(e)===h},t.isPortal=function(e){return C(e)===r},t.isProfiler=function(e){return C(e)===s},t.isStrictMode=function(e){return C(e)===i},t.isSuspense=function(e){return C(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===d||e===s||e===i||e===p||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===h||e.$$typeof===l||e.$$typeof===c||e.$$typeof===f||e.$$typeof===b||e.$$typeof===y||e.$$typeof===w||e.$$typeof===v)},t.typeOf=C},404(e,t,n){e.exports=n(72)}};const t={};function n(a){const r=t[a];if(void 0!==r)return r.exports;const o=t[a]={exports:{}};return e[a](o,o.exports,n),o.exports}n.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.cw=e=>{var t;return()=>{if(e){var n=e;e=0,t={exports:{}},n.call(t.exports,t,t.exports)}return t.exports}},(()=>{const e=Object.getPrototypeOf;let t;n.t=function(a,r){if(1&r&&(a=this(a)),8&r)return a;if("object"==typeof a&&a){if(4&r&&a.__esModule)return a;if(16&r&&"function"==typeof a.then)return a}const o=Object.create(null);n.r(o);const i={};t||=[null,e({}),e([]),e(e)];for(var s=2&r&&a;("object"==typeof s||"function"==typeof s)&&!~t.indexOf(s);s=e(s))Object.getOwnPropertyNames(s).forEach(e=>i[e]=()=>a[e]);return i.default=()=>a,n.d(o,i),o}})(),n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a=n.cw(function(e,t){var n= Ke(),a={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},i={};function s(e){return n.isMemo(e)?o:i[e.$$typeof]||a}i[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},i[n.Memo]=o;var l=Object.defineProperty,c=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,a){if("string"!=typeof n){if(p){var o=f(n);o&&o!==p&&e(t,o,a)}var i=c(n);u&&(i=i.concat(u(n)));for(var m=s(t),h=s(n),g=0;g<i.length;++g){var v=i[g];if(!(r[v]||a&&a[v]||h&&h[v]||m&&m[v])){var b=d(n,v);try{l(t,v,b)}catch(e){}}}}return t}}),r=()=>n(404);const o=window.React;var i=n.n(o);const s=window.wp.element;function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function c(e){var t=function(e){if("object"!=l(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==l(t)?t:t+""}function u(e,t,n){return(t=c(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach(function(t){u(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function m(e,t){if(e){if("string"==typeof e)return p(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(a=o.call(n)).done)&&(s.push(a.value),s.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw r}}return s}}(e,t)||m(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.includes(a))continue;n[a]=e[a]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var v=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function b(){return b=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},b.apply(null,arguments)}function y(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,c(a.key),a)}}function w(e,t){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},w(e,t)}function C(e){return C=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},C(e)}function E(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(E=function(){return!!e})()}function O(e){return function(e){if(Array.isArray(e))return p(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||m(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var S=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(e){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),this.tags=[],this.ctr=0},e}(),k=Math.abs,_=String.fromCharCode,x=Object.assign;function T(e){return e.trim()}function I(e,t,n){return e.replace(t,n)}function P(e,t){return e.indexOf(t)}function D(e,t){return 0|e.charCodeAt(t)}function M(e,t,n){return e.slice(t,n)}function F(e){return e.length}function V(e){return e.length}function R(e,t){return t.push(e),e}var N=1,L=1,A=0,$=0,B=0,H="";function j(e,t,n,a,r,o,i){return{value:e,root:t,parent:n,type:a,props:r,children:o,line:N,column:L,length:i,return:""}}function z(e,t){return x(j("",null,null,"",null,null,0),e,{length:-e.length},t)}function U(){return B=$>0?D(H,--$):0,L--,10===B&&(L=1,N--),B}function W(){return B=$<A?D(H,$++):0,L++,10===B&&(L=1,N++),B}function G(){return D(H,$)}function q(){return $}function K(e,t){return M(H,e,t)}function Y(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function X(e){return N=L=1,A=F(H=e),$=0,[]}function Z(e){return H="",e}function J(e){return T(K($-1,te(91===e?e+2:40===e?e+1:e)))}function Q(e){for(;(B=G())&&B<33;)W();return Y(e)>2||Y(B)>3?"":" "}function ee(e,t){for(;--t&&W()&&!(B<48||B>102||B>57&&B<65||B>70&&B<97););return K(e,q()+(t<6&&32==G()&&32==W()))}function te(e){for(;W();)switch(B){case e:return $;case 34:case 39:34!==e&&39!==e&&te(B);break;case 40:41===e&&te(e);break;case 92:W()}return $}function ne(e,t){for(;W()&&e+B!==57&&(e+B!==84||47!==G()););return"/*"+K(t,$-1)+"*"+_(47===e?e:W())}function ae(e){for(;!Y(G());)W();return K(e,$)}var re="-ms-",oe="-moz-",ie="-webkit-",se="comm",le="rule",ce="decl",ue="@keyframes";function de(e,t){for(var n="",a=V(e),r=0;r<a;r++)n+=t(e[r],r,e,t)||"";return n}function fe(e,t,n,a){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case ce:return e.return=e.return||e.value;case se:return"";case ue:return e.return=e.value+"{"+de(e.children,a)+"}";case le:e.value=e.props.join(",")}return F(n=de(e.children,a))?e.return=e.value+"{"+n+"}":""}function pe(e){return Z(me("",null,null,null,[""],e=X(e),0,[0],e))}function me(e,t,n,a,r,o,i,s,l){for(var c=0,u=0,d=i,f=0,p=0,m=0,h=1,g=1,v=1,b=0,y="",w=r,C=o,E=a,O=y;g;)switch(m=b,b=W()){case 40:if(108!=m&&58==D(O,d-1)){-1!=P(O+=I(J(b),"&","&\f"),"&\f")&&(v=-1);break}case 34:case 39:case 91:O+=J(b);break;case 9:case 10:case 13:case 32:O+=Q(m);break;case 92:O+=ee(q()-1,7);continue;case 47:switch(G()){case 42:case 47:R(ge(ne(W(),q()),t,n),l);break;default:O+="/"}break;case 123*h:s[c++]=F(O)*v;case 125*h:case 59:case 0:switch(b){case 0:case 125:g=0;case 59+u:-1==v&&(O=I(O,/\f/g,"")),p>0&&F(O)-d&&R(p>32?ve(O+";",a,n,d-1):ve(I(O," ","")+";",a,n,d-2),l);break;case 59:O+=";";default:if(R(E=he(O,t,n,c,u,r,s,y,w=[],C=[],d),o),123===b)if(0===u)me(O,t,E,E,w,o,d,s,C);else switch(99===f&&110===D(O,3)?100:f){case 100:case 108:case 109:case 115:me(e,E,E,a&&R(he(e,E,E,0,0,r,s,y,r,w=[],d),C),r,C,d,s,a?w:C);break;default:me(O,E,E,E,[""],C,0,s,C)}}c=u=p=0,h=v=1,y=O="",d=i;break;case 58:d=1+F(O),p=m;default:if(h<1)if(123==b)--h;else if(125==b&&0==h++&&125==U())continue;switch(O+=_(b),b*h){case 38:v=u>0?1:(O+="\f",-1);break;case 44:s[c++]=(F(O)-1)*v,v=1;break;case 64:45===G()&&(O+=J(W())),f=G(),u=d=F(y=O+=ae(q())),b++;break;case 45:45===m&&2==F(O)&&(h=0)}}return o}function he(e,t,n,a,r,o,i,s,l,c,u){for(var d=r-1,f=0===r?o:[""],p=V(f),m=0,h=0,g=0;m<a;++m)for(var v=0,b=M(e,d+1,d=k(h=i[m])),y=e;v<p;++v)(y=T(h>0?f[v]+" "+b:I(b,/&\f/g,f[v])))&&(l[g++]=y);return j(e,t,n,0===r?le:s,l,c,u)}function ge(e,t,n){return j(e,t,n,se,_(B),M(e,2,-2),0)}function ve(e,t,n,a){return j(e,t,n,ce,M(e,0,a),M(e,a+1,-1),a)}var be=function(e,t,n){for(var a=0,r=0;a=r,r=G(),38===a&&12===r&&(t[n]=1),!Y(r);)W();return K(e,$)},ye=new WeakMap,we=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,a=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||ye.get(n))&&!a){ye.set(e,!0);for(var r=[],o=function(e,t){return Z(function(e,t){var n=-1,a=44;do{switch(Y(a)){case 0:38===a&&12===G()&&(t[n]=1),e[n]+=be($-1,t,n);break;case 2:e[n]+=J(a);break;case 4:if(44===a){e[++n]=58===G()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=_(a)}}while(a=W());return e}(X(e),t))}(t,r),i=n.props,s=0,l=0;s<o.length;s++)for(var c=0;c<i.length;c++,l++)e.props[l]=r[s]?o[s].replace(/&\f/g,i[c]):i[c]+" "+o[s]}}},Ce=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function Ee(e,t){switch(function(e,t){return 45^D(e,0)?(((t<<2^D(e,0))<<2^D(e,1))<<2^D(e,2))<<2^D(e,3):0}(e,t)){case 5103:return ie+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return ie+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return ie+e+oe+e+re+e+e;case 6828:case 4268:return ie+e+re+e+e;case 6165:return ie+e+re+"flex-"+e+e;case 5187:return ie+e+I(e,/(\w+).+(:[^]+)/,ie+"box-$1$2"+re+"flex-$1$2")+e;case 5443:return ie+e+re+"flex-item-"+I(e,/flex-|-self/,"")+e;case 4675:return ie+e+re+"flex-line-pack"+I(e,/align-content|flex-|-self/,"")+e;case 5548:return ie+e+re+I(e,"shrink","negative")+e;case 5292:return ie+e+re+I(e,"basis","preferred-size")+e;case 6060:return ie+"box-"+I(e,"-grow","")+ie+e+re+I(e,"grow","positive")+e;case 4554:return ie+I(e,/([^-])(transform)/g,"$1"+ie+"$2")+e;case 6187:return I(I(I(e,/(zoom-|grab)/,ie+"$1"),/(image-set)/,ie+"$1"),e,"")+e;case 5495:case 3959:return I(e,/(image-set\([^]*)/,ie+"$1$`$1");case 4968:return I(I(e,/(.+:)(flex-)?(.*)/,ie+"box-pack:$3"+re+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+ie+e+e;case 4095:case 3583:case 4068:case 2532:return I(e,/(.+)-inline(.+)/,ie+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(F(e)-1-t>6)switch(D(e,t+1)){case 109:if(45!==D(e,t+4))break;case 102:return I(e,/(.+:)(.+)-([^]+)/,"$1"+ie+"$2-$3$1"+oe+(108==D(e,t+3)?"$3":"$2-$3"))+e;case 115:return~P(e,"stretch")?Ee(I(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==D(e,t+1))break;case 6444:switch(D(e,F(e)-3-(~P(e,"!important")&&10))){case 107:return I(e,":",":"+ie)+e;case 101:return I(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ie+(45===D(e,14)?"inline-":"")+"box$3$1"+ie+"$2$3$1"+re+"$2box$3")+e}break;case 5936:switch(D(e,t+11)){case 114:return ie+e+re+I(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ie+e+re+I(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ie+e+re+I(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return ie+e+re+e+e}return e}var Oe=[function(e,t,n,a){if(e.length>-1&&!e.return)switch(e.type){case ce:e.return=Ee(e.value,e.length);break;case ue:return de([z(e,{value:I(e.value,"@","@"+ie)})],a);case le:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,function(t){switch(function(e){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return de([z(e,{props:[I(t,/:(read-\w+)/,":-moz-$1")]})],a);case"::placeholder":return de([z(e,{props:[I(t,/:(plac\w+)/,":"+ie+"input-$1")]}),z(e,{props:[I(t,/:(plac\w+)/,":-moz-$1")]}),z(e,{props:[I(t,/:(plac\w+)/,re+"input-$1")]})],a)}return""})}}],Se=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var a,r,o=e.stylisPlugins||Oe,i={},s=[];a=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)i[t[n]]=!0;s.push(e)});var l,c,u,d,f=[fe,(d=function(e){l.insert(e)},function(e){e.root||(e=e.return)&&d(e)})],p=(c=[we,Ce].concat(o,f),u=V(c),function(e,t,n,a){for(var r="",o=0;o<u;o++)r+=c[o](e,t,n,a)||"";return r});r=function(e,t,n,a){l=n,de(pe(e?e+"{"+t.styles+"}":t.styles),p),a&&(m.inserted[t.name]=!0)};var m={key:t,sheet:new S({key:t,container:a,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:r};return m.sheet.hydrate(s),m},ke=function(e,t,n){var a=e.key+"-"+t.name;!1===n&&void 0===e.registered[a]&&(e.registered[a]=t.styles)},_e={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function xe(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var Te=/[A-Z]|^ms/g,Ie=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Pe=function(e){return 45===e.charCodeAt(1)},De=function(e){return null!=e&&"boolean"!=typeof e},Me=xe(function(e){return Pe(e)?e:e.replace(Te,"-$&").toLowerCase()}),Fe=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Ie,function(e,t,n){return Re={name:t,styles:n,next:Re},t})}return 1===_e[e]||Pe(e)||"number"!=typeof t||0===t?t:t+"px"};function Ve(e,t,n){if(null==n)return"";var a=n;if(void 0!==a.__emotion_styles)return a;switch(typeof n){case"boolean":return"";case"object":var r=n;if(1===r.anim)return Re={name:r.name,styles:r.styles,next:Re},r.name;var o=n;if(void 0!==o.styles){var i=o.next;if(void 0!==i)for(;void 0!==i;)Re={name:i.name,styles:i.styles,next:Re},i=i.next;return o.styles+";"}return function(e,t,n){var a="";if(Array.isArray(n))for(var r=0;r<n.length;r++)a+=Ve(e,t,n[r])+";";else for(var o in n){var i=n[o];if("object"!=typeof i){var s=i;null!=t&&void 0!==t[s]?a+=o+"{"+t[s]+"}":De(s)&&(a+=Me(o)+":"+Fe(o,s)+";")}else if(!Array.isArray(i)||"string"!=typeof i[0]||null!=t&&void 0!==t[i[0]]){var l=Ve(e,t,i);switch(o){case"animation":case"animationName":a+=Me(o)+":"+l+";";break;default:a+=o+"{"+l+"}"}}else for(var c=0;c<i.length;c++)De(i[c])&&(a+=Me(o)+":"+Fe(o,i[c])+";")}return a}(e,t,n);case"function":if(void 0!==e){var s=Re,l=n(e);return Re=s,Ve(e,t,l)}}var c=n;if(null==t)return c;var u=t[c];return void 0!==u?u:c}var Re,Ne=/label:\s*([^\s;{]+)\s*(;|$)/g;function Le(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var a=!0,r="";Re=void 0;var o=e[0];null==o||void 0===o.raw?(a=!1,r+=Ve(n,t,o)):r+=o[0];for(var i=1;i<e.length;i++)r+=Ve(n,t,e[i]),a&&(r+=o[i]);Ne.lastIndex=0;for(var s,l="";null!==(s=Ne.exec(r));)l+="-"+s[1];var c=function(e){for(var t,n=0,a=0,r=e.length;r>=4;++a,r-=4)t=1540483477*(65535&(t=255&e.charCodeAt(a)|(255&e.charCodeAt(++a))<<8|(255&e.charCodeAt(++a))<<16|(255&e.charCodeAt(++a))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(r){case 3:n^=(255&e.charCodeAt(a+2))<<16;case 2:n^=(255&e.charCodeAt(a+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(a)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(r)+l;return{name:c,styles:r,next:Re}}var Ae=!!o.useInsertionEffect&&o.useInsertionEffect,$e=Ae||function(e){return e()},Be=(Ae||o.useLayoutEffect,o.createContext("undefined"!=typeof HTMLElement?Se({key:"css"}):null)),He=(Be.Provider,function(e){return(0,o.forwardRef)(function(t,n){var a=(0,o.useContext)(Be);return e(t,a,n)})}),je=o.createContext({}),ze={}.hasOwnProperty,Ue="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",We=function(e){var t=e.cache,n=e.serialized,a=e.isStringTag;return ke(t,n,a),$e(function(){return function(e,t,n){ke(e,t,n);var a=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var r=t;do{e.insert(t===r?"."+a:"",r,e.sheet,!0),r=r.next}while(void 0!==r)}}(t,n,a)}),null},Ge=He(function(e,t,n){var a=e.css;"string"==typeof a&&void 0!==t.registered[a]&&(a=t.registered[a]);var r=e[Ue],i=[a],s="";"string"==typeof e.className?s=function(e,t,n){var a="";return n.split(" ").forEach(function(n){void 0!==e[n]?t.push(e[n]+";"):n&&(a+=n+" ")}),a}(t.registered,i,e.className):null!=e.className&&(s=e.className+" ");var l=Le(i,void 0,o.useContext(je));s+=t.key+"-"+l.name;var c={};for(var u in e)ze.call(e,u)&&"css"!==u&&u!==Ue&&(c[u]=e[u]);return c.className=s,n&&(c.ref=n),o.createElement(o.Fragment,null,o.createElement(We,{cache:t,serialized:l,isStringTag:"string"==typeof r}),o.createElement(r,c))}),qe=Ge;function Ke(){return Ke.c||(Ke.c=n.t(r(),2))}a();var Ye,Xe,Ze=function(e,t){var n=arguments;if(null==t||!ze.call(t,"css"))return o.createElement.apply(void 0,n);var a=n.length,r=new Array(a);r[0]=qe,r[1]=function(e,t){var n={};for(var a in t)ze.call(t,a)&&(n[a]=t[a]);return n[Ue]=e,n}(e,t);for(var i=2;i<a;i++)r[i]=n[i];return o.createElement.apply(null,r)};function Je(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Le(t)}Ye=Ze||(Ze={}),Xe||(Xe=Ye.JSX||(Ye.JSX={}));const Qe=window.ReactDOM,et=Math.min,tt=Math.max,nt=Math.round,at=Math.floor,rt=e=>({x:e,y:e});function ot(){return"undefined"!=typeof window}function it(e){return ct(e)?(e.nodeName||"").toLowerCase():"#document"}function st(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function lt(e){var t;return null==(t=(ct(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ct(e){return!!ot()&&(e instanceof Node||e instanceof st(e).Node)}function ut(e){return!!ot()&&(e instanceof Element||e instanceof st(e).Element)}function dt(e){return!!ot()&&(e instanceof HTMLElement||e instanceof st(e).HTMLElement)}function ft(e){return!(!ot()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof st(e).ShadowRoot)}function pt(e){const{overflow:t,overflowX:n,overflowY:a,display:r}=mt(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+n)&&!["inline","contents"].includes(r)}function mt(e){return st(e).getComputedStyle(e)}function ht(e){const t=function(e){if("html"===it(e))return e;const t=e.assignedSlot||e.parentNode||ft(e)&&e.host||lt(e);return ft(t)?t.host:t}(e);return function(e){return["html","body","#document"].includes(it(e))}(t)?e.ownerDocument?e.ownerDocument.body:e.body:dt(t)&&pt(t)?t:ht(t)}function gt(e,t,n){var a;void 0===t&&(t=[]),void 0===n&&(n=!0);const r=ht(e),o=r===(null==(a=e.ownerDocument)?void 0:a.body),i=st(r);if(o){const e=vt(i);return t.concat(i,i.visualViewport||[],pt(r)?r:[],e&&n?gt(e):[])}return t.concat(r,gt(r,[],n))}function vt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function bt(e){return ut(e)?e:e.contextElement}function yt(e){const t=bt(e);if(!dt(t))return rt(1);const n=t.getBoundingClientRect(),{width:a,height:r,$:o}=function(e){const t=mt(e);let n=parseFloat(t.width)||0,a=parseFloat(t.height)||0;const r=dt(e),o=r?e.offsetWidth:n,i=r?e.offsetHeight:a,s=nt(n)!==o||nt(a)!==i;return s&&(n=o,a=i),{width:n,height:a,$:s}}(t);let i=(o?nt(n.width):n.width)/a,s=(o?nt(n.height):n.height)/r;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const wt=rt(0);function Ct(e){const t=st(e);return"undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:wt}function Et(e,t,n,a){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),o=bt(e);let i=rt(1);t&&(a?ut(a)&&(i=yt(a)):i=yt(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==st(e))&&t}(o,n,a)?Ct(o):rt(0);let l=(r.left+s.x)/i.x,c=(r.top+s.y)/i.y,u=r.width/i.x,d=r.height/i.y;if(o){const e=st(o),t=a&&ut(a)?st(a):a;let n=e,r=vt(n);for(;r&&a&&t!==n;){const e=yt(r),t=r.getBoundingClientRect(),a=mt(r),o=t.left+(r.clientLeft+parseFloat(a.paddingLeft))*e.x,i=t.top+(r.clientTop+parseFloat(a.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=o,c+=i,n=st(r),r=vt(n)}}return function(e){const{x:t,y:n,width:a,height:r}=e;return{width:a,height:r,top:n,left:t,right:t+a,bottom:n+r,x:t,y:n}}({width:u,height:d,x:l,y:c})}function Ot(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}var St=o.useLayoutEffect,kt=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],_t=function(){};function xt(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}function Tt(e,t){for(var n=arguments.length,a=new Array(n>2?n-2:0),r=2;r<n;r++)a[r-2]=arguments[r];var o=[].concat(a);if(t&&e)for(var i in t)t.hasOwnProperty(i)&&t[i]&&o.push("".concat(xt(e,i)));return o.filter(function(e){return e}).map(function(e){return String(e).trim()}).join(" ")}var It=function(e){return t=e,Array.isArray(t)?e.filter(Boolean):"object"===l(e)&&null!==e?[e]:[];var t},Pt=function(e){return e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme,f({},g(e,kt))},Dt=function(e,t,n){var a=e.cx,r=e.getStyles,o=e.getClassNames,i=e.className;return{css:r(t,e),className:a(null!=n?n:{},o(t,e),i)}};function Mt(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function Ft(e){return Mt(e)?window.pageYOffset:e.scrollTop}function Vt(e,t){Mt(e)?window.scrollTo(0,t):e.scrollTop=t}function Rt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:_t,r=Ft(e),o=t-r,i=0;!function t(){var s,l=o*((s=(s=i+=10)/n-1)*s*s+1)+r;Vt(e,l),i<n?window.requestAnimationFrame(t):a(e)}()}function Nt(e,t){var n=e.getBoundingClientRect(),a=t.getBoundingClientRect(),r=t.offsetHeight/3;a.bottom+r>n.bottom?Vt(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+r,e.scrollHeight)):a.top-r<n.top&&Vt(e,Math.max(t.offsetTop-r,0))}function Lt(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}var At=!1,$t={get passive(){return At=!0}},Bt="undefined"!=typeof window?window:{};Bt.addEventListener&&Bt.removeEventListener&&(Bt.addEventListener("p",_t,$t),Bt.removeEventListener("p",_t,!1));var Ht=At;function jt(e){return null!=e}function zt(e,t,n){return e?t:n}var Ut=["children","innerProps"],Wt=["children","innerProps"];var Gt,qt,Kt,Yt=function(e){return"auto"===e?"bottom":e},Xt=(0,o.createContext)(null),Zt=function(e){var t=e.children,n=e.minMenuHeight,a=e.maxMenuHeight,r=e.menuPlacement,i=e.menuPosition,s=e.menuShouldScrollIntoView,l=e.theme,c=((0,o.useContext)(Xt)||{}).setPortalPlacement,u=(0,o.useRef)(null),d=h((0,o.useState)(a),2),p=d[0],m=d[1],g=h((0,o.useState)(null),2),v=g[0],b=g[1],y=l.spacing.controlHeight;return St(function(){var e=u.current;if(e){var t="fixed"===i,o=function(e){var t=e.maxHeight,n=e.menuEl,a=e.minHeight,r=e.placement,o=e.shouldScroll,i=e.isFixedPosition,s=e.controlHeight,l=function(e){var t=getComputedStyle(e),n="absolute"===t.position,a=/(auto|scroll)/;if("fixed"===t.position)return document.documentElement;for(var r=e;r=r.parentElement;)if(t=getComputedStyle(r),(!n||"static"!==t.position)&&a.test(t.overflow+t.overflowY+t.overflowX))return r;return document.documentElement}(n),c={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return c;var u,d=l.getBoundingClientRect().height,f=n.getBoundingClientRect(),p=f.bottom,m=f.height,h=f.top,g=n.offsetParent.getBoundingClientRect().top,v=i||Mt(u=l)?window.innerHeight:u.clientHeight,b=Ft(l),y=parseInt(getComputedStyle(n).marginBottom,10),w=parseInt(getComputedStyle(n).marginTop,10),C=g-w,E=v-h,O=C+b,S=d-b-h,k=p-v+b+y,_=b+h-w,x=160;switch(r){case"auto":case"bottom":if(E>=m)return{placement:"bottom",maxHeight:t};if(S>=m&&!i)return o&&Rt(l,k,x),{placement:"bottom",maxHeight:t};if(!i&&S>=a||i&&E>=a)return o&&Rt(l,k,x),{placement:"bottom",maxHeight:i?E-y:S-y};if("auto"===r||i){var T=t,I=i?C:O;return I>=a&&(T=Math.min(I-y-s,t)),{placement:"top",maxHeight:T}}if("bottom"===r)return o&&Vt(l,k),{placement:"bottom",maxHeight:t};break;case"top":if(C>=m)return{placement:"top",maxHeight:t};if(O>=m&&!i)return o&&Rt(l,_,x),{placement:"top",maxHeight:t};if(!i&&O>=a||i&&C>=a){var P=t;return(!i&&O>=a||i&&C>=a)&&(P=i?C-w:O-w),o&&Rt(l,_,x),{placement:"top",maxHeight:P}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(r,'".'))}return c}({maxHeight:a,menuEl:e,minHeight:n,placement:r,shouldScroll:s&&!t,isFixedPosition:t,controlHeight:y});m(o.maxHeight),b(o.placement),null==c||c(o.placement)}},[a,r,i,s,n,c,y]),t({ref:u,placerProps:f(f({},e),{},{placement:v||Yt(r),maxHeight:p})})},Jt=function(e,t){var n=e.theme,a=n.spacing.baseUnit,r=n.colors;return f({textAlign:"center"},t?{}:{color:r.neutral40,padding:"".concat(2*a,"px ").concat(3*a,"px")})},Qt=Jt,en=Jt,tn=["size"],nn=["innerProps","isRtl","size"],an={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},rn=function(e){var t=e.size,n=g(e,tn);return Ze("svg",b({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:an},n))},on=function(e){return Ze(rn,b({size:20},e),Ze("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},sn=function(e){return Ze(rn,b({size:20},e),Ze("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},ln=function(e,t){var n=e.isFocused,a=e.theme,r=a.spacing.baseUnit,o=a.colors;return f({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:n?o.neutral60:o.neutral20,padding:2*r,":hover":{color:n?o.neutral80:o.neutral40}})},cn=ln,un=ln,dn=function(){var e=Je.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}(Gt||(qt=["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"],Kt||(Kt=qt.slice(0)),Gt=Object.freeze(Object.defineProperties(qt,{raw:{value:Object.freeze(Kt)}})))),fn=function(e){var t=e.delay,n=e.offset;return Ze("span",{css:Je({animation:"".concat(dn," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},pn=["data"],mn=["innerRef","isDisabled","isHidden","inputClassName"],hn={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},gn={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":f({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},hn)},vn=function(e){return f({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},hn)},bn=function(e){var t=e.children,n=e.innerProps;return Ze("div",n,t)},yn={ClearIndicator:function(e){var t=e.children,n=e.innerProps;return Ze("div",b({},Dt(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),t||Ze(on,null))},Control:function(e){var t=e.children,n=e.isDisabled,a=e.isFocused,r=e.innerRef,o=e.innerProps,i=e.menuIsOpen;return Ze("div",b({ref:r},Dt(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":a,"control--menu-is-open":i}),o,{"aria-disabled":n||void 0}),t)},DropdownIndicator:function(e){var t=e.children,n=e.innerProps;return Ze("div",b({},Dt(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),t||Ze(sn,null))},DownChevron:sn,CrossIcon:on,Group:function(e){var t=e.children,n=e.cx,a=e.getStyles,r=e.getClassNames,o=e.Heading,i=e.headingProps,s=e.innerProps,l=e.label,c=e.theme,u=e.selectProps;return Ze("div",b({},Dt(e,"group",{group:!0}),s),Ze(o,b({},i,{selectProps:u,theme:c,getStyles:a,getClassNames:r,cx:n}),l),Ze("div",null,t))},GroupHeading:function(e){var t=Pt(e);t.data;var n=g(t,pn);return Ze("div",b({},Dt(e,"groupHeading",{"group-heading":!0}),n))},IndicatorsContainer:function(e){var t=e.children,n=e.innerProps;return Ze("div",b({},Dt(e,"indicatorsContainer",{indicators:!0}),n),t)},IndicatorSeparator:function(e){var t=e.innerProps;return Ze("span",b({},t,Dt(e,"indicatorSeparator",{"indicator-separator":!0})))},Input:function(e){var t=e.cx,n=e.value,a=Pt(e),r=a.innerRef,o=a.isDisabled,i=a.isHidden,s=a.inputClassName,l=g(a,mn);return Ze("div",b({},Dt(e,"input",{"input-container":!0}),{"data-value":n||""}),Ze("input",b({className:t({input:!0},s),ref:r,style:vn(i),disabled:o},l)))},LoadingIndicator:function(e){var t=e.innerProps,n=e.isRtl,a=e.size,r=void 0===a?4:a,o=g(e,nn);return Ze("div",b({},Dt(f(f({},o),{},{innerProps:t,isRtl:n,size:r}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),Ze(fn,{delay:0,offset:n}),Ze(fn,{delay:160,offset:!0}),Ze(fn,{delay:320,offset:!n}))},Menu:function(e){var t=e.children,n=e.innerRef,a=e.innerProps;return Ze("div",b({},Dt(e,"menu",{menu:!0}),{ref:n},a),t)},MenuList:function(e){var t=e.children,n=e.innerProps,a=e.innerRef,r=e.isMulti;return Ze("div",b({},Dt(e,"menuList",{"menu-list":!0,"menu-list--is-multi":r}),{ref:a},n),t)},MenuPortal:function(e){var t=e.appendTo,n=e.children,a=e.controlElement,r=e.innerProps,i=e.menuPlacement,s=e.menuPosition,l=(0,o.useRef)(null),c=(0,o.useRef)(null),u=h((0,o.useState)(Yt(i)),2),d=u[0],p=u[1],m=(0,o.useMemo)(function(){return{setPortalPlacement:p}},[]),g=h((0,o.useState)(null),2),v=g[0],y=g[1],w=(0,o.useCallback)(function(){if(a){var e=function(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}(a),t="fixed"===s?0:window.pageYOffset,n=e[d]+t;n===(null==v?void 0:v.offset)&&e.left===(null==v?void 0:v.rect.left)&&e.width===(null==v?void 0:v.rect.width)||y({offset:n,rect:e})}},[a,s,d,null==v?void 0:v.offset,null==v?void 0:v.rect.left,null==v?void 0:v.rect.width]);St(function(){w()},[w]);var C=(0,o.useCallback)(function(){"function"==typeof c.current&&(c.current(),c.current=null),a&&l.current&&(c.current=function(e,t,n,a){void 0===a&&(a={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=a,c=bt(e),u=r||o?[...c?gt(c):[],...gt(t)]:[];u.forEach(e=>{r&&e.addEventListener("scroll",n,{passive:!0}),o&&e.addEventListener("resize",n)});const d=c&&s?function(e,t){let n,a=null;const r=lt(e);function o(){var e;clearTimeout(n),null==(e=a)||e.disconnect(),a=null}return function i(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),o();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(s||t(),!f||!p)return;const m={rootMargin:-at(d)+"px "+-at(r.clientWidth-(u+f))+"px "+-at(r.clientHeight-(d+p))+"px "+-at(u)+"px",threshold:tt(0,et(1,l))||1};let h=!0;function g(t){const a=t[0].intersectionRatio;if(a!==l){if(!h)return i();a?i(!1,a):n=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==a||Ot(c,e.getBoundingClientRect())||i(),h=!1}try{a=new IntersectionObserver(g,{...m,root:r.ownerDocument})}catch(e){a=new IntersectionObserver(g,m)}a.observe(e)}(!0),o}(c,n):null;let f,p=-1,m=null;i&&(m=new ResizeObserver(e=>{let[a]=e;a&&a.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),n()}),c&&!l&&m.observe(c),m.observe(t));let h=l?Et(e):null;return l&&function t(){const a=Et(e);h&&!Ot(h,a)&&n(),h=a,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{r&&e.removeEventListener("scroll",n),o&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=m)||e.disconnect(),m=null,l&&cancelAnimationFrame(f)}}(a,l.current,w,{elementResize:"ResizeObserver"in window}))},[a,w]);St(function(){C()},[C]);var E=(0,o.useCallback)(function(e){l.current=e,C()},[C]);if(!t&&"fixed"!==s||!v)return null;var O=Ze("div",b({ref:E},Dt(f(f({},e),{},{offset:v.offset,position:s,rect:v.rect}),"menuPortal",{"menu-portal":!0}),r),n);return Ze(Xt.Provider,{value:m},t?(0,Qe.createPortal)(O,t):O)},LoadingMessage:function(e){var t=e.children,n=void 0===t?"Loading...":t,a=e.innerProps,r=g(e,Wt);return Ze("div",b({},Dt(f(f({},r),{},{children:n,innerProps:a}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),a),n)},NoOptionsMessage:function(e){var t=e.children,n=void 0===t?"No options":t,a=e.innerProps,r=g(e,Ut);return Ze("div",b({},Dt(f(f({},r),{},{children:n,innerProps:a}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),a),n)},MultiValue:function(e){var t=e.children,n=e.components,a=e.data,r=e.innerProps,o=e.isDisabled,i=e.removeProps,s=e.selectProps,l=n.Container,c=n.Label,u=n.Remove;return Ze(l,{data:a,innerProps:f(f({},Dt(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":o})),r),selectProps:s},Ze(c,{data:a,innerProps:f({},Dt(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:s},t),Ze(u,{data:a,innerProps:f(f({},Dt(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},i),selectProps:s}))},MultiValueContainer:bn,MultiValueLabel:bn,MultiValueRemove:function(e){var t=e.children,n=e.innerProps;return Ze("div",b({role:"button"},n),t||Ze(on,{size:14}))},Option:function(e){var t=e.children,n=e.isDisabled,a=e.isFocused,r=e.isSelected,o=e.innerRef,i=e.innerProps;return Ze("div",b({},Dt(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":a,"option--is-selected":r}),{ref:o,"aria-disabled":n},i),t)},Placeholder:function(e){var t=e.children,n=e.innerProps;return Ze("div",b({},Dt(e,"placeholder",{placeholder:!0}),n),t)},SelectContainer:function(e){var t=e.children,n=e.innerProps,a=e.isDisabled,r=e.isRtl;return Ze("div",b({},Dt(e,"container",{"--is-disabled":a,"--is-rtl":r}),n),t)},SingleValue:function(e){var t=e.children,n=e.isDisabled,a=e.innerProps;return Ze("div",b({},Dt(e,"singleValue",{"single-value":!0,"single-value--is-disabled":n}),a),t)},ValueContainer:function(e){var t=e.children,n=e.innerProps,a=e.isMulti,r=e.hasValue;return Ze("div",b({},Dt(e,"valueContainer",{"value-container":!0,"value-container--is-multi":a,"value-container--has-value":r}),n),t)}},wn=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function Cn(e,t){return e===t||!(!wn(e)||!wn(t))}function En(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Cn(e[n],t[n]))return!1;return!0}for(var On={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},Sn=function(e){return Ze("span",b({css:On},e))},kn={guidance:function(e){var t=e.isSearchable,n=e.isMulti,a=e.tabSelectsValue,r=e.context,o=e.isInitialFocus;switch(r){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(a?", press Tab to select the option and exit the menu":"",".");case"input":return o?"".concat(e["aria-label"]||"Select"," is focused ").concat(t?",type to refine list":"",", press Down to open the menu, ").concat(n?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var t=e.action,n=e.label,a=void 0===n?"":n,r=e.labels,o=e.isDisabled;switch(t){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(a,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(r.length>1?"s":""," ").concat(r.join(","),", selected.");case"select-option":return"option ".concat(a,o?" is disabled. Select another option.":", selected.");default:return""}},onFocus:function(e){var t=e.context,n=e.focused,a=e.options,r=e.label,o=void 0===r?"":r,i=e.selectValue,s=e.isDisabled,l=e.isSelected,c=e.isAppleDevice,u=function(e,t){return e&&e.length?"".concat(e.indexOf(t)+1," of ").concat(e.length):""};if("value"===t&&i)return"value ".concat(o," focused, ").concat(u(i,n),".");if("menu"===t&&c){var d=s?" disabled":"",f="".concat(l?" selected":"").concat(d);return"".concat(o).concat(f,", ").concat(u(a,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},xn=function(e){var t=e.ariaSelection,n=e.focusedOption,a=e.focusedValue,r=e.focusableOptions,i=e.isFocused,s=e.selectValue,l=e.selectProps,c=e.id,u=e.isAppleDevice,d=l.ariaLiveMessages,p=l.getOptionLabel,m=l.inputValue,h=l.isMulti,g=l.isOptionDisabled,v=l.isSearchable,b=l.menuIsOpen,y=l.options,w=l.screenReaderStatus,C=l.tabSelectsValue,E=l.isLoading,O=l["aria-label"],S=l["aria-live"],k=(0,o.useMemo)(function(){return f(f({},kn),d||{})},[d]),_=(0,o.useMemo)(function(){var e,n="";if(t&&k.onChange){var a=t.option,r=t.options,o=t.removedValue,i=t.removedValues,l=t.value,c=o||a||(e=l,Array.isArray(e)?null:e),u=c?p(c):"",d=r||i||void 0,m=d?d.map(p):[],h=f({isDisabled:c&&g(c,s),label:u,labels:m},t);n=k.onChange(h)}return n},[t,k,g,s,p]),x=(0,o.useMemo)(function(){var e="",t=n||a,o=!!(n&&s&&s.includes(n));if(t&&k.onFocus){var i={focused:t,label:p(t),isDisabled:g(t,s),isSelected:o,options:r,context:t===n?"menu":"value",selectValue:s,isAppleDevice:u};e=k.onFocus(i)}return e},[n,a,p,g,k,r,s,u]),T=(0,o.useMemo)(function(){var e="";if(b&&y.length&&!E&&k.onFilter){var t=w({count:r.length});e=k.onFilter({inputValue:m,resultsMessage:t})}return e},[r,m,b,k,y,w,E]),I="initial-input-focus"===(null==t?void 0:t.action),P=(0,o.useMemo)(function(){var e="";if(k.guidance){var t=a?"value":b?"menu":"input";e=k.guidance({"aria-label":O,context:t,isDisabled:n&&g(n,s),isMulti:h,isSearchable:v,tabSelectsValue:C,isInitialFocus:I})}return e},[O,n,a,h,g,v,b,k,s,C,I]),D=Ze(o.Fragment,null,Ze("span",{id:"aria-selection"},_),Ze("span",{id:"aria-focused"},x),Ze("span",{id:"aria-results"},T),Ze("span",{id:"aria-guidance"},P));return Ze(o.Fragment,null,Ze(Sn,{id:c},I&&D),Ze(Sn,{"aria-live":S,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},i&&!I&&D))},Tn=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],In=new RegExp("["+Tn.map(function(e){return e.letters}).join("")+"]","g"),Pn={},Dn=0;Dn<Tn.length;Dn++)for(var Mn=Tn[Dn],Fn=0;Fn<Mn.letters.length;Fn++)Pn[Mn.letters[Fn]]=Mn.base;var Vn=function(e){return e.replace(In,function(e){return Pn[e]})},Rn=function(e,t){void 0===t&&(t=En);var n=null;function a(){for(var a=[],r=0;r<arguments.length;r++)a[r]=arguments[r];if(n&&n.lastThis===this&&t(a,n.lastArgs))return n.lastResult;var o=e.apply(this,a);return n={lastResult:o,lastArgs:a,lastThis:this},o}return a.clear=function(){n=null},a}(Vn),Nn=function(e){return e.replace(/^\s+|\s+$/g,"")},Ln=function(e){return"".concat(e.label," ").concat(e.value)},An=["innerRef"];function $n(e){var t=e.innerRef,n=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];var r=Object.entries(e).filter(function(e){var t=h(e,1)[0];return!n.includes(t)});return r.reduce(function(e,t){var n=h(t,2),a=n[0],r=n[1];return e[a]=r,e},{})}(g(e,An),"onExited","in","enter","exit","appear");return Ze("input",b({ref:t},n,{css:Je({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var Bn=["boxSizing","height","overflow","paddingRight","position"],Hn={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function jn(e){e.cancelable&&e.preventDefault()}function zn(e){e.stopPropagation()}function Un(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;0===e?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function Wn(){return"ontouchstart"in window||navigator.maxTouchPoints}var Gn=!("undefined"==typeof window||!window.document||!window.document.createElement),qn=0,Kn={capture:!1,passive:!1},Yn=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},Xn={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function Zn(e){var t=e.children,n=e.lockEnabled,a=e.captureEnabled,r=function(e){var t=e.isEnabled,n=e.onBottomArrive,a=e.onBottomLeave,r=e.onTopArrive,i=e.onTopLeave,s=(0,o.useRef)(!1),l=(0,o.useRef)(!1),c=(0,o.useRef)(0),u=(0,o.useRef)(null),d=(0,o.useCallback)(function(e,t){if(null!==u.current){var o=u.current,c=o.scrollTop,d=o.scrollHeight,f=o.clientHeight,p=u.current,m=t>0,h=d-f-c,g=!1;h>t&&s.current&&(a&&a(e),s.current=!1),m&&l.current&&(i&&i(e),l.current=!1),m&&t>h?(n&&!s.current&&n(e),p.scrollTop=d,g=!0,s.current=!0):!m&&-t>c&&(r&&!l.current&&r(e),p.scrollTop=0,g=!0,l.current=!0),g&&function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()}(e)}},[n,a,r,i]),f=(0,o.useCallback)(function(e){d(e,e.deltaY)},[d]),p=(0,o.useCallback)(function(e){c.current=e.changedTouches[0].clientY},[]),m=(0,o.useCallback)(function(e){var t=c.current-e.changedTouches[0].clientY;d(e,t)},[d]),h=(0,o.useCallback)(function(e){if(e){var t=!!Ht&&{passive:!1};e.addEventListener("wheel",f,t),e.addEventListener("touchstart",p,t),e.addEventListener("touchmove",m,t)}},[m,p,f]),g=(0,o.useCallback)(function(e){e&&(e.removeEventListener("wheel",f,!1),e.removeEventListener("touchstart",p,!1),e.removeEventListener("touchmove",m,!1))},[m,p,f]);return(0,o.useEffect)(function(){if(t){var e=u.current;return h(e),function(){g(e)}}},[t,h,g]),function(e){u.current=e}}({isEnabled:void 0===a||a,onBottomArrive:e.onBottomArrive,onBottomLeave:e.onBottomLeave,onTopArrive:e.onTopArrive,onTopLeave:e.onTopLeave}),i=function(e){var t=e.isEnabled,n=e.accountForScrollbars,a=void 0===n||n,r=(0,o.useRef)({}),i=(0,o.useRef)(null),s=(0,o.useCallback)(function(e){if(Gn){var t=document.body,n=t&&t.style;if(a&&Bn.forEach(function(e){var t=n&&n[e];r.current[e]=t}),a&&qn<1){var o=parseInt(r.current.paddingRight,10)||0,i=document.body?document.body.clientWidth:0,s=window.innerWidth-i+o||0;Object.keys(Hn).forEach(function(e){var t=Hn[e];n&&(n[e]=t)}),n&&(n.paddingRight="".concat(s,"px"))}t&&Wn()&&(t.addEventListener("touchmove",jn,Kn),e&&(e.addEventListener("touchstart",Un,Kn),e.addEventListener("touchmove",zn,Kn))),qn+=1}},[a]),l=(0,o.useCallback)(function(e){if(Gn){var t=document.body,n=t&&t.style;qn=Math.max(qn-1,0),a&&qn<1&&Bn.forEach(function(e){var t=r.current[e];n&&(n[e]=t)}),t&&Wn()&&(t.removeEventListener("touchmove",jn,Kn),e&&(e.removeEventListener("touchstart",Un,Kn),e.removeEventListener("touchmove",zn,Kn)))}},[a]);return(0,o.useEffect)(function(){if(t){var e=i.current;return s(e),function(){l(e)}}},[t,s,l]),function(e){i.current=e}}({isEnabled:n});return Ze(o.Fragment,null,n&&Ze("div",{onClick:Yn,css:Xn}),t(function(e){r(e),i(e)}))}var Jn={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Qn=function(e){var t=e.name,n=e.onFocus;return Ze("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:n,css:Jn,value:"",onChange:function(){}})};function ea(e){var t;return"undefined"!=typeof window&&null!=window.navigator&&e.test((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.platform)||window.navigator.platform)}function ta(){return ea(/^Mac/i)}var na={clearIndicator:un,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},control:function(e,t){var n=e.isDisabled,a=e.isFocused,r=e.theme,o=r.colors,i=r.borderRadius;return f({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:r.spacing.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:n?o.neutral5:o.neutral0,borderColor:n?o.neutral10:a?o.primary:o.neutral20,borderRadius:i,borderStyle:"solid",borderWidth:1,boxShadow:a?"0 0 0 1px ".concat(o.primary):void 0,"&:hover":{borderColor:a?o.primary:o.neutral30}})},dropdownIndicator:cn,group:function(e,t){var n=e.theme.spacing;return t?{}:{paddingBottom:2*n.baseUnit,paddingTop:2*n.baseUnit}},groupHeading:function(e,t){var n=e.theme,a=n.colors,r=n.spacing;return f({label:"group",cursor:"default",display:"block"},t?{}:{color:a.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*r.baseUnit,paddingRight:3*r.baseUnit,textTransform:"uppercase"})},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e,t){var n=e.isDisabled,a=e.theme,r=a.spacing.baseUnit,o=a.colors;return f({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:n?o.neutral10:o.neutral20,marginBottom:2*r,marginTop:2*r})},input:function(e,t){var n=e.isDisabled,a=e.value,r=e.theme,o=r.spacing,i=r.colors;return f(f({visibility:n?"hidden":"visible",transform:a?"translateZ(0)":""},gn),t?{}:{margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,color:i.neutral80})},loadingIndicator:function(e,t){var n=e.isFocused,a=e.size,r=e.theme,o=r.colors,i=r.spacing.baseUnit;return f({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:a,lineHeight:1,marginRight:a,textAlign:"center",verticalAlign:"middle"},t?{}:{color:n?o.neutral60:o.neutral20,padding:2*i})},loadingMessage:en,menu:function(e,t){var n,a=e.placement,r=e.theme,o=r.borderRadius,i=r.spacing,s=r.colors;return f((u(n={label:"menu"},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(a),"100%"),u(n,"position","absolute"),u(n,"width","100%"),u(n,"zIndex",1),n),t?{}:{backgroundColor:s.neutral0,borderRadius:o,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:i.menuGutter,marginTop:i.menuGutter})},menuList:function(e,t){var n=e.maxHeight,a=e.theme.spacing.baseUnit;return f({maxHeight:n,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:a,paddingTop:a})},menuPortal:function(e){var t=e.rect,n=e.offset,a=e.position;return{left:t.left,position:a,top:n,width:t.width,zIndex:1}},multiValue:function(e,t){var n=e.theme,a=n.spacing,r=n.borderRadius,o=n.colors;return f({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:o.neutral10,borderRadius:r/2,margin:a.baseUnit/2})},multiValueLabel:function(e,t){var n=e.theme,a=n.borderRadius,r=n.colors,o=e.cropWithEllipsis;return f({overflow:"hidden",textOverflow:o||void 0===o?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:a/2,color:r.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},multiValueRemove:function(e,t){var n=e.theme,a=n.spacing,r=n.borderRadius,o=n.colors,i=e.isFocused;return f({alignItems:"center",display:"flex"},t?{}:{borderRadius:r/2,backgroundColor:i?o.dangerLight:void 0,paddingLeft:a.baseUnit,paddingRight:a.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}})},noOptionsMessage:Qt,option:function(e,t){var n=e.isDisabled,a=e.isFocused,r=e.isSelected,o=e.theme,i=o.spacing,s=o.colors;return f({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:r?s.primary:a?s.primary25:"transparent",color:n?s.neutral20:r?s.neutral0:"inherit",padding:"".concat(2*i.baseUnit,"px ").concat(3*i.baseUnit,"px"),":active":{backgroundColor:n?void 0:r?s.primary:s.primary50}})},placeholder:function(e,t){var n=e.theme,a=n.spacing,r=n.colors;return f({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:r.neutral50,marginLeft:a.baseUnit/2,marginRight:a.baseUnit/2})},singleValue:function(e,t){var n=e.isDisabled,a=e.theme,r=a.spacing,o=a.colors;return f({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:n?o.neutral40:o.neutral80,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},valueContainer:function(e,t){var n=e.theme.spacing,a=e.isMulti,r=e.hasValue,o=e.selectProps.controlShouldRenderValue;return f({alignItems:"center",display:a&&r&&o?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(n.baseUnit/2,"px ").concat(2*n.baseUnit,"px")})}},aa={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},ra={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Lt(),captureMenuScroll:!Lt(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var n=f({ignoreCase:!0,ignoreAccents:!0,stringify:Ln,trim:!0,matchFrom:"any"},void 0),a=n.ignoreCase,r=n.ignoreAccents,o=n.stringify,i=n.trim,s=n.matchFrom,l=i?Nn(t):t,c=i?Nn(o(e)):o(e);return a&&(l=l.toLowerCase(),c=c.toLowerCase()),r&&(l=Rn(l),c=Vn(c)),"start"===s?c.substr(0,l.length)===l:c.indexOf(l)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function oa(e,t,n,a){return{type:"option",data:t,isDisabled:pa(e,t,n),isSelected:ma(e,t,n),label:da(e,t),value:fa(e,t),index:a}}function ia(e,t){return e.options.map(function(n,a){if("options"in n){var r=n.options.map(function(n,a){return oa(e,n,t,a)}).filter(function(t){return ca(e,t)});return r.length>0?{type:"group",data:n,options:r,index:a}:void 0}var o=oa(e,n,t,a);return ca(e,o)?o:void 0}).filter(jt)}function sa(e){return e.reduce(function(e,t){return"group"===t.type?e.push.apply(e,O(t.options.map(function(e){return e.data}))):e.push(t.data),e},[])}function la(e,t){return e.reduce(function(e,n){return"group"===n.type?e.push.apply(e,O(n.options.map(function(e){return{data:e.data,id:"".concat(t,"-").concat(n.index,"-").concat(e.index)}}))):e.push({data:n.data,id:"".concat(t,"-").concat(n.index)}),e},[])}function ca(e,t){var n=e.inputValue,a=void 0===n?"":n,r=t.data,o=t.isSelected,i=t.label,s=t.value;return(!ga(e)||!o)&&ha(e,{label:i,value:s,data:r},a)}var ua=function(e,t){var n;return(null===(n=e.find(function(e){return e.data===t}))||void 0===n?void 0:n.id)||null},da=function(e,t){return e.getOptionLabel(t)},fa=function(e,t){return e.getOptionValue(t)};function pa(e,t,n){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,n)}function ma(e,t,n){if(n.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,n);var a=fa(e,t);return n.some(function(t){return fa(e,t)===a})}function ha(e,t,n){return!e.filterOption||e.filterOption(t,n)}var ga=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return void 0===t?n:t},va=1,ba=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&w(e,t)}(n,e);var t=function(e){var t=E();return function(){var n,a=C(e);if(t){var r=C(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return function(e,t){if(t&&("object"==l(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}(n);function n(e){var a;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(a=t.call(this,e)).state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},a.blockOptionHover=!1,a.isComposing=!1,a.commonProps=void 0,a.initialTouchX=0,a.initialTouchY=0,a.openAfterFocus=!1,a.scrollToFocusedOptionOnUpdate=!1,a.userIsDragging=void 0,a.isAppleDevice=ta()||ea(/^iPhone/i)||ea(/^iPad/i)||ta()&&navigator.maxTouchPoints>1,a.controlRef=null,a.getControlRef=function(e){a.controlRef=e},a.focusedOptionRef=null,a.getFocusedOptionRef=function(e){a.focusedOptionRef=e},a.menuListRef=null,a.getMenuListRef=function(e){a.menuListRef=e},a.inputRef=null,a.getInputRef=function(e){a.inputRef=e},a.focus=a.focusInput,a.blur=a.blurInput,a.onChange=function(e,t){var n=a.props,r=n.onChange,o=n.name;t.name=o,a.ariaOnChange(e,t),r(e,t)},a.setValue=function(e,t,n){var r=a.props,o=r.closeMenuOnSelect,i=r.isMulti,s=r.inputValue;a.onInputChange("",{action:"set-value",prevInputValue:s}),o&&(a.setState({inputIsHiddenAfterUpdate:!i}),a.onMenuClose()),a.setState({clearFocusValueOnUpdate:!0}),a.onChange(e,{action:t,option:n})},a.selectOption=function(e){var t=a.props,n=t.blurInputOnSelect,r=t.isMulti,o=t.name,i=a.state.selectValue,s=r&&a.isOptionSelected(e,i),l=a.isOptionDisabled(e,i);if(s){var c=a.getOptionValue(e);a.setValue(i.filter(function(e){return a.getOptionValue(e)!==c}),"deselect-option",e)}else{if(l)return void a.ariaOnChange(e,{action:"select-option",option:e,name:o});r?a.setValue([].concat(O(i),[e]),"select-option",e):a.setValue(e,"select-option")}n&&a.blurInput()},a.removeValue=function(e){var t=a.props.isMulti,n=a.state.selectValue,r=a.getOptionValue(e),o=n.filter(function(e){return a.getOptionValue(e)!==r}),i=zt(t,o,o[0]||null);a.onChange(i,{action:"remove-value",removedValue:e}),a.focusInput()},a.clearValue=function(){var e=a.state.selectValue;a.onChange(zt(a.props.isMulti,[],null),{action:"clear",removedValues:e})},a.popValue=function(){var e=a.props.isMulti,t=a.state.selectValue,n=t[t.length-1],r=t.slice(0,t.length-1),o=zt(e,r,r[0]||null);n&&a.onChange(o,{action:"pop-value",removedValue:n})},a.getFocusedOptionId=function(e){return ua(a.state.focusableOptionsWithIds,e)},a.getFocusableOptionsWithIds=function(){return la(ia(a.props,a.state.selectValue),a.getElementId("option"))},a.getValue=function(){return a.state.selectValue},a.cx=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Tt.apply(void 0,[a.props.classNamePrefix].concat(t))},a.getOptionLabel=function(e){return da(a.props,e)},a.getOptionValue=function(e){return fa(a.props,e)},a.getStyles=function(e,t){var n=a.props.unstyled,r=na[e](t,n);r.boxSizing="border-box";var o=a.props.styles[e];return o?o(r,t):r},a.getClassNames=function(e,t){var n,r;return null===(n=(r=a.props.classNames)[e])||void 0===n?void 0:n.call(r,t)},a.getElementId=function(e){return"".concat(a.state.instancePrefix,"-").concat(e)},a.getComponents=function(){return e=a.props,f(f({},yn),e.components);var e},a.buildCategorizedOptions=function(){return ia(a.props,a.state.selectValue)},a.getCategorizedOptions=function(){return a.props.menuIsOpen?a.buildCategorizedOptions():[]},a.buildFocusableOptions=function(){return sa(a.buildCategorizedOptions())},a.getFocusableOptions=function(){return a.props.menuIsOpen?a.buildFocusableOptions():[]},a.ariaOnChange=function(e,t){a.setState({ariaSelection:f({value:e},t)})},a.onMenuMouseDown=function(e){0===e.button&&(e.stopPropagation(),e.preventDefault(),a.focusInput())},a.onMenuMouseMove=function(e){a.blockOptionHover=!1},a.onControlMouseDown=function(e){if(!e.defaultPrevented){var t=a.props.openMenuOnClick;a.state.isFocused?a.props.menuIsOpen?"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&a.onMenuClose():t&&a.openMenu("first"):(t&&(a.openAfterFocus=!0),a.focusInput()),"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&e.preventDefault()}},a.onDropdownIndicatorMouseDown=function(e){if(!(e&&"mousedown"===e.type&&0!==e.button||a.props.isDisabled)){var t=a.props,n=t.isMulti,r=t.menuIsOpen;a.focusInput(),r?(a.setState({inputIsHiddenAfterUpdate:!n}),a.onMenuClose()):a.openMenu("first"),e.preventDefault()}},a.onClearIndicatorMouseDown=function(e){e&&"mousedown"===e.type&&0!==e.button||(a.clearValue(),e.preventDefault(),a.openAfterFocus=!1,"touchend"===e.type?a.focusInput():setTimeout(function(){return a.focusInput()}))},a.onScroll=function(e){"boolean"==typeof a.props.closeMenuOnScroll?e.target instanceof HTMLElement&&Mt(e.target)&&a.props.onMenuClose():"function"==typeof a.props.closeMenuOnScroll&&a.props.closeMenuOnScroll(e)&&a.props.onMenuClose()},a.onCompositionStart=function(){a.isComposing=!0},a.onCompositionEnd=function(){a.isComposing=!1},a.onTouchStart=function(e){var t=e.touches,n=t&&t.item(0);n&&(a.initialTouchX=n.clientX,a.initialTouchY=n.clientY,a.userIsDragging=!1)},a.onTouchMove=function(e){var t=e.touches,n=t&&t.item(0);if(n){var r=Math.abs(n.clientX-a.initialTouchX),o=Math.abs(n.clientY-a.initialTouchY);a.userIsDragging=r>5||o>5}},a.onTouchEnd=function(e){a.userIsDragging||(a.controlRef&&!a.controlRef.contains(e.target)&&a.menuListRef&&!a.menuListRef.contains(e.target)&&a.blurInput(),a.initialTouchX=0,a.initialTouchY=0)},a.onControlTouchEnd=function(e){a.userIsDragging||a.onControlMouseDown(e)},a.onClearIndicatorTouchEnd=function(e){a.userIsDragging||a.onClearIndicatorMouseDown(e)},a.onDropdownIndicatorTouchEnd=function(e){a.userIsDragging||a.onDropdownIndicatorMouseDown(e)},a.handleInputChange=function(e){var t=a.props.inputValue,n=e.currentTarget.value;a.setState({inputIsHiddenAfterUpdate:!1}),a.onInputChange(n,{action:"input-change",prevInputValue:t}),a.props.menuIsOpen||a.onMenuOpen()},a.onInputFocus=function(e){a.props.onFocus&&a.props.onFocus(e),a.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(a.openAfterFocus||a.props.openMenuOnFocus)&&a.openMenu("first"),a.openAfterFocus=!1},a.onInputBlur=function(e){var t=a.props.inputValue;a.menuListRef&&a.menuListRef.contains(document.activeElement)?a.inputRef.focus():(a.props.onBlur&&a.props.onBlur(e),a.onInputChange("",{action:"input-blur",prevInputValue:t}),a.onMenuClose(),a.setState({focusedValue:null,isFocused:!1}))},a.onOptionHover=function(e){if(!a.blockOptionHover&&a.state.focusedOption!==e){var t=a.getFocusableOptions().indexOf(e);a.setState({focusedOption:e,focusedOptionId:t>-1?a.getFocusedOptionId(e):null})}},a.shouldHideSelectedOptions=function(){return ga(a.props)},a.onValueInputFocus=function(e){e.preventDefault(),e.stopPropagation(),a.focus()},a.onKeyDown=function(e){var t=a.props,n=t.isMulti,r=t.backspaceRemovesValue,o=t.escapeClearsValue,i=t.inputValue,s=t.isClearable,l=t.isDisabled,c=t.menuIsOpen,u=t.onKeyDown,d=t.tabSelectsValue,f=t.openMenuOnFocus,p=a.state,m=p.focusedOption,h=p.focusedValue,g=p.selectValue;if(!(l||"function"==typeof u&&(u(e),e.defaultPrevented))){switch(a.blockOptionHover=!0,e.key){case"ArrowLeft":if(!n||i)return;a.focusValue("previous");break;case"ArrowRight":if(!n||i)return;a.focusValue("next");break;case"Delete":case"Backspace":if(i)return;if(h)a.removeValue(h);else{if(!r)return;n?a.popValue():s&&a.clearValue()}break;case"Tab":if(a.isComposing)return;if(e.shiftKey||!c||!d||!m||f&&a.isOptionSelected(m,g))return;a.selectOption(m);break;case"Enter":if(229===e.keyCode)break;if(c){if(!m)return;if(a.isComposing)return;a.selectOption(m);break}return;case"Escape":c?(a.setState({inputIsHiddenAfterUpdate:!1}),a.onInputChange("",{action:"menu-close",prevInputValue:i}),a.onMenuClose()):s&&o&&a.clearValue();break;case" ":if(i)return;if(!c){a.openMenu("first");break}if(!m)return;a.selectOption(m);break;case"ArrowUp":c?a.focusOption("up"):a.openMenu("last");break;case"ArrowDown":c?a.focusOption("down"):a.openMenu("first");break;case"PageUp":if(!c)return;a.focusOption("pageup");break;case"PageDown":if(!c)return;a.focusOption("pagedown");break;case"Home":if(!c)return;a.focusOption("first");break;case"End":if(!c)return;a.focusOption("last");break;default:return}e.preventDefault()}},a.state.instancePrefix="react-select-"+(a.props.instanceId||++va),a.state.selectValue=It(e.value),e.menuIsOpen&&a.state.selectValue.length){var r=a.getFocusableOptionsWithIds(),o=a.buildFocusableOptions(),i=o.indexOf(a.state.selectValue[0]);a.state.focusableOptionsWithIds=r,a.state.focusedOption=o[i],a.state.focusedOptionId=ua(r,o[i])}return a}return function(e,t,n){t&&y(e.prototype,t),n&&y(e,n),Object.defineProperty(e,"prototype",{writable:!1})}(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Nt(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.isDisabled,a=t.menuIsOpen,r=this.state.isFocused;(r&&!n&&e.isDisabled||r&&a&&!e.menuIsOpen)&&this.focusInput(),r&&n&&!e.isDisabled?this.setState({isFocused:!1},this.onMenuClose):r||n||!e.isDisabled||this.inputRef!==document.activeElement||this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Nt(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(e,t){this.props.onInputChange(e,t)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(e){var t=this,n=this.state,a=n.selectValue,r=n.isFocused,o=this.buildFocusableOptions(),i="first"===e?0:o.length-1;if(!this.props.isMulti){var s=o.indexOf(a[0]);s>-1&&(i=s)}this.scrollToFocusedOptionOnUpdate=!(r&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:o[i],focusedOptionId:this.getFocusedOptionId(o[i])},function(){return t.onMenuOpen()})}},{key:"focusValue",value:function(e){var t=this.state,n=t.selectValue,a=t.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var r=n.indexOf(a);a||(r=-1);var o=n.length-1,i=-1;if(n.length){switch(e){case"previous":i=0===r?0:-1===r?o:r-1;break;case"next":r>-1&&r<o&&(i=r+1)}this.setState({inputIsHidden:-1!==i,focusedValue:n[i]})}}}},{key:"focusOption",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,n=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var r=0,o=a.indexOf(n);n||(o=-1),"up"===e?r=o>0?o-1:a.length-1:"down"===e?r=(o+1)%a.length:"pageup"===e?(r=o-t)<0&&(r=0):"pagedown"===e?(r=o+t)>a.length-1&&(r=a.length-1):"last"===e&&(r=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[r],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[r])})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(aa):f(f({},aa),this.props.theme):aa}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,n=this.getStyles,a=this.getClassNames,r=this.getValue,o=this.selectOption,i=this.setValue,s=this.props,l=s.isMulti,c=s.isRtl,u=s.options;return{clearValue:e,cx:t,getStyles:n,getClassNames:a,getValue:r,hasValue:this.hasValue(),isMulti:l,isRtl:c,options:u,selectOption:o,selectProps:s,setValue:i,theme:this.getTheme()}}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return pa(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return ma(this.props,e,t)}},{key:"filterOption",value:function(e,t){return ha(this.props,e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:a})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,a=e.inputId,r=e.inputValue,i=e.tabIndex,s=e.form,l=e.menuIsOpen,c=e.required,u=this.getComponents().Input,d=this.state,p=d.inputIsHidden,m=d.ariaSelection,h=this.commonProps,g=a||this.getElementId("input"),v=f(f(f({"aria-autocomplete":"list","aria-expanded":l,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":c,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},l&&{"aria-controls":this.getElementId("listbox")}),!n&&{"aria-readonly":!0}),this.hasValue()?"initial-input-focus"===(null==m?void 0:m.action)&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return n?o.createElement(u,b({},h,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:g,innerRef:this.getInputRef,isDisabled:t,isHidden:p,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:i,form:s,type:"text",value:r},v)):o.createElement($n,b({id:g,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:_t,onFocus:this.onInputFocus,disabled:t,tabIndex:i,inputMode:"none",form:s,value:""},v))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.getComponents(),n=t.MultiValue,a=t.MultiValueContainer,r=t.MultiValueLabel,i=t.MultiValueRemove,s=t.SingleValue,l=t.Placeholder,c=this.commonProps,u=this.props,d=u.controlShouldRenderValue,f=u.isDisabled,p=u.isMulti,m=u.inputValue,h=u.placeholder,g=this.state,v=g.selectValue,y=g.focusedValue,w=g.isFocused;if(!this.hasValue()||!d)return m?null:o.createElement(l,b({},c,{key:"placeholder",isDisabled:f,isFocused:w,innerProps:{id:this.getElementId("placeholder")}}),h);if(p)return v.map(function(t,s){var l=t===y,u="".concat(e.getOptionLabel(t),"-").concat(e.getOptionValue(t));return o.createElement(n,b({},c,{components:{Container:a,Label:r,Remove:i},isFocused:l,isDisabled:f,key:u,index:s,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault()}},data:t}),e.formatOptionLabel(t,"value"))});if(m)return null;var C=v[0];return o.createElement(s,b({},c,{data:C,isDisabled:f}),this.formatOptionLabel(C,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.getComponents().ClearIndicator,t=this.commonProps,n=this.props,a=n.isDisabled,r=n.isLoading,i=this.state.isFocused;if(!this.isClearable()||!e||a||!this.hasValue()||r)return null;var s={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return o.createElement(e,b({},t,{innerProps:s,isFocused:i}))}},{key:"renderLoadingIndicator",value:function(){var e=this.getComponents().LoadingIndicator,t=this.commonProps,n=this.props,a=n.isDisabled,r=n.isLoading,i=this.state.isFocused;return e&&r?o.createElement(e,b({},t,{innerProps:{"aria-hidden":"true"},isDisabled:a,isFocused:i})):null}},{key:"renderIndicatorSeparator",value:function(){var e=this.getComponents(),t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var a=this.commonProps,r=this.props.isDisabled,i=this.state.isFocused;return o.createElement(n,b({},a,{isDisabled:r,isFocused:i}))}},{key:"renderDropdownIndicator",value:function(){var e=this.getComponents().DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,a=this.state.isFocused,r={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return o.createElement(e,b({},t,{innerProps:r,isDisabled:n,isFocused:a}))}},{key:"renderMenu",value:function(){var e=this,t=this.getComponents(),n=t.Group,a=t.GroupHeading,r=t.Menu,i=t.MenuList,s=t.MenuPortal,l=t.LoadingMessage,c=t.NoOptionsMessage,u=t.Option,d=this.commonProps,f=this.state.focusedOption,p=this.props,m=p.captureMenuScroll,h=p.inputValue,g=p.isLoading,v=p.loadingMessage,y=p.minMenuHeight,w=p.maxMenuHeight,C=p.menuIsOpen,E=p.menuPlacement,O=p.menuPosition,S=p.menuPortalTarget,k=p.menuShouldBlockScroll,_=p.menuShouldScrollIntoView,x=p.noOptionsMessage,T=p.onMenuScrollToTop,I=p.onMenuScrollToBottom;if(!C)return null;var P,D=function(t,n){var a=t.type,r=t.data,i=t.isDisabled,s=t.isSelected,l=t.label,c=t.value,p=f===r,m=i?void 0:function(){return e.onOptionHover(r)},h=i?void 0:function(){return e.selectOption(r)},g="".concat(e.getElementId("option"),"-").concat(n),v={id:g,onClick:h,onMouseMove:m,onMouseOver:m,tabIndex:-1,role:"option","aria-selected":e.isAppleDevice?void 0:s};return o.createElement(u,b({},d,{innerProps:v,data:r,isDisabled:i,isSelected:s,key:g,label:l,type:a,value:c,isFocused:p,innerRef:p?e.getFocusedOptionRef:void 0}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())P=this.getCategorizedOptions().map(function(t){if("group"===t.type){var r=t.data,i=t.options,s=t.index,l="".concat(e.getElementId("group"),"-").concat(s),c="".concat(l,"-heading");return o.createElement(n,b({},d,{key:l,data:r,options:i,Heading:a,headingProps:{id:c,data:t.data},label:e.formatGroupLabel(t.data)}),t.options.map(function(e){return D(e,"".concat(s,"-").concat(e.index))}))}if("option"===t.type)return D(t,"".concat(t.index))});else if(g){var M=v({inputValue:h});if(null===M)return null;P=o.createElement(l,d,M)}else{var F=x({inputValue:h});if(null===F)return null;P=o.createElement(c,d,F)}var V={minMenuHeight:y,maxMenuHeight:w,menuPlacement:E,menuPosition:O,menuShouldScrollIntoView:_},R=o.createElement(Zt,b({},d,V),function(t){var n=t.ref,a=t.placerProps,s=a.placement,l=a.maxHeight;return o.createElement(r,b({},d,V,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove},isLoading:g,placement:s}),o.createElement(Zn,{captureEnabled:m,onTopArrive:T,onBottomArrive:I,lockEnabled:k},function(t){return o.createElement(i,b({},d,{innerRef:function(n){e.getMenuListRef(n),t(n)},innerProps:{role:"listbox","aria-multiselectable":d.isMulti,id:e.getElementId("listbox")},isLoading:g,maxHeight:l,focusedOption:f}),P)}))});return S||"fixed"===O?o.createElement(s,b({},d,{appendTo:S,controlElement:this.controlRef,menuPlacement:E,menuPosition:O}),R):R}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,a=t.isDisabled,r=t.isMulti,i=t.name,s=t.required,l=this.state.selectValue;if(s&&!this.hasValue()&&!a)return o.createElement(Qn,{name:i,onFocus:this.onValueInputFocus});if(i&&!a){if(r){if(n){var c=l.map(function(t){return e.getOptionValue(t)}).join(n);return o.createElement("input",{name:i,type:"hidden",value:c})}var u=l.length>0?l.map(function(t,n){return o.createElement("input",{key:"i-".concat(n),name:i,type:"hidden",value:e.getOptionValue(t)})}):o.createElement("input",{name:i,type:"hidden",value:""});return o.createElement("div",null,u)}var d=l[0]?this.getOptionValue(l[0]):"";return o.createElement("input",{name:i,type:"hidden",value:d})}}},{key:"renderLiveRegion",value:function(){var e=this.commonProps,t=this.state,n=t.ariaSelection,a=t.focusedOption,r=t.focusedValue,i=t.isFocused,s=t.selectValue,l=this.getFocusableOptions();return o.createElement(xn,b({},e,{id:this.getElementId("live-region"),ariaSelection:n,focusedOption:a,focusedValue:r,isFocused:i,selectValue:s,focusableOptions:l,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var e=this.getComponents(),t=e.Control,n=e.IndicatorsContainer,a=e.SelectContainer,r=e.ValueContainer,i=this.props,s=i.className,l=i.id,c=i.isDisabled,u=i.menuIsOpen,d=this.state.isFocused,f=this.commonProps=this.getCommonProps();return o.createElement(a,b({},f,{className:s,innerProps:{id:l,onKeyDown:this.onKeyDown},isDisabled:c,isFocused:d}),this.renderLiveRegion(),o.createElement(t,b({},f,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:c,isFocused:d,menuIsOpen:u}),o.createElement(r,b({},f,{isDisabled:c}),this.renderPlaceholderOrValue(),this.renderInput()),o.createElement(n,b({},f,{isDisabled:c}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,a=t.clearFocusValueOnUpdate,r=t.inputIsHiddenAfterUpdate,o=t.ariaSelection,i=t.isFocused,s=t.prevWasFocused,l=t.instancePrefix,c=e.options,u=e.value,d=e.menuIsOpen,p=e.inputValue,m=e.isMulti,h=It(u),g={};if(n&&(u!==n.value||c!==n.options||d!==n.menuIsOpen||p!==n.inputValue)){var v=d?function(e,t){return sa(ia(e,t))}(e,h):[],b=d?la(ia(e,h),"".concat(l,"-option")):[],y=a?function(e,t){var n=e.focusedValue,a=e.selectValue.indexOf(n);if(a>-1){if(t.indexOf(n)>-1)return n;if(a<t.length)return t[a]}return null}(t,h):null,w=function(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}(t,v);g={selectValue:h,focusedOption:w,focusedOptionId:ua(b,w),focusableOptionsWithIds:b,focusedValue:y,clearFocusValueOnUpdate:!1}}var C=null!=r&&e!==n?{inputIsHidden:r,inputIsHiddenAfterUpdate:void 0}:{},E=o,O=i&&s;return i&&!O&&(E={value:zt(m,h,h[0]||null),options:h,action:"initial-input-focus"},O=!s),"initial-input-focus"===(null==o?void 0:o.action)&&(E=null),f(f(f({},g),C),{},{prevProps:e,ariaSelection:E,prevWasFocused:O})}}]),n}(o.Component);ba.defaultProps=ra;var ya=(0,o.forwardRef)(function(e,t){var n=function(e){var t=e.defaultInputValue,n=void 0===t?"":t,a=e.defaultMenuIsOpen,r=void 0!==a&&a,i=e.defaultValue,s=void 0===i?null:i,l=e.inputValue,c=e.menuIsOpen,u=e.onChange,d=e.onInputChange,p=e.onMenuClose,m=e.onMenuOpen,b=e.value,y=g(e,v),w=h((0,o.useState)(void 0!==l?l:n),2),C=w[0],E=w[1],O=h((0,o.useState)(void 0!==c?c:r),2),S=O[0],k=O[1],_=h((0,o.useState)(void 0!==b?b:s),2),x=_[0],T=_[1],I=(0,o.useCallback)(function(e,t){"function"==typeof u&&u(e,t),T(e)},[u]),P=(0,o.useCallback)(function(e,t){var n;"function"==typeof d&&(n=d(e,t)),E(void 0!==n?n:e)},[d]),D=(0,o.useCallback)(function(){"function"==typeof m&&m(),k(!0)},[m]),M=(0,o.useCallback)(function(){"function"==typeof p&&p(),k(!1)},[p]),F=void 0!==l?l:C,V=void 0!==c?c:S,R=void 0!==b?b:x;return f(f({},y),{},{inputValue:F,menuIsOpen:V,onChange:I,onInputChange:P,onMenuClose:M,onMenuOpen:D,value:R})}(e);return o.createElement(ba,b({ref:t},n))}),wa=ya;const Ca=({channel:e,titleValue:t,saving:n,error:a,handleTitleClick:r,handleTitleChange:o,handleKeyDown:s,handleCancelEdit:l,saveTitle:c,botForChannel:u,chatsForChannel:d=[],formsForChannel:f=[],availableForms:p=[],showFormSelector:m,handleAddForm:h,handleFormSelect:g,handleRemoveForm:v,availableBots:b=[],handleBotSelect:y,handleRemoveBot:w,bot2ChatConnections:C=[],handleToggleChat:E,deleteChannel:O,getToggleButtonLabel:S,dataAvailability:k={forms:"ready",bots:"ready",chats:"ready"},mutatingRelations:_=!1})=>{const x=(u?.chats||[]).map(e=>{const t=C.find(t=>t.data.from===u.id&&t.data.to===e.id),n=t?.data?.meta?.status?.[0]||null;if("pending"===n)return null;let a=d.some(t=>t.id===e.id)?"Active":"Paused";return"muted"===n&&(a="Muted"),{...e,status:a}}).filter(Boolean);return i().createElement("div",{className:"entity-container channel"+(()=>{let e="";return u?.online&&(e+=" has-bot-online"),x.some(e=>"Active"===e.status)&&(e+=" has-active-chats"),f.length>0&&(e+=" has-forms"),e})(),"data-testid":`cf7tg-channel-${e.id}`,key:e.id,id:`channel-${e.id}`},i().createElement("div",{className:"entity-wrapper channel-wrapper"},i().createElement("div",{className:"frame channel-title-wrapper"},i().createElement("div",{className:"columns"},i().createElement("div",{className:"column title-column"},i().createElement("input",{className:"edit-title","data-testid":`cf7tg-channel-title-input-${e.id}`,type:"text",value:t,onChange:o,onKeyDown:s,onBlur:c,disabled:n,autoFocus:!0})),i().createElement("div",{className:"column bot-column"},"error"===k.bots?i().createElement("span",{className:"resource-error"},wp.i18n.__("Bots are unavailable.","cf7-telegram")):"ready"!==k.bots?i().createElement("span",{className:"resource-loading"},wp.i18n.__("Loading bots...","cf7-telegram")):u?i().createElement("div",{"data-Bot-Id":u.id,"data-testid":`cf7tg-channel-${e.id}-bot-${u.id}`,className:"bot-for-channel "+(u?.online?"online":"offline")},i().createElement("span",null,u.title.rendered),i().createElement("button",{className:"detach-button detach-bot-button crux",onClick:w,disabled:_})):i().createElement(i().Fragment,null,b.length>0&&i().createElement(wa,{className:"select-picker bot-picker",classNamePrefix:"select-picker",inputId:`cf7tg-channel-bot-picker-${e.id}`,instanceId:`cf7tg-channel-bot-picker-${e.id}`,"data-testid":`cf7tg-channel-${e.id}-bot-picker`,options:b.map(e=>({value:e.id,label:e.title.rendered})),isSearchable:!1,placeholder:wp.i18n.__("Pick a bot","cf7-telegram"),onChange:e=>y({target:{value:e?.value}}),isClearable:!0,isDisabled:_}))))),i().createElement("div",{className:"frame chats"},"error"===k.chats?i().createElement("span",{className:"resource-error"},wp.i18n.__("Chat data is unavailable.","cf7-telegram")):"ready"!==k.chats?i().createElement("span",{className:"resource-loading"},wp.i18n.__("Loading chat data...","cf7-telegram")):x.length>0?i().createElement(i().Fragment,null,x.map(t=>i().createElement("div",{key:t.id,className:`chat chat-${t.id} ${t.status.toLowerCase()}`,"data-testid":`cf7tg-channel-${e.id}-chat-${t.id}`,onClick:()=>!_&&E(t.id,t.status),"aria-disabled":_,title:S(t.status)},i().createElement("span",{className:"chat-username"},t.title.rendered)))):i().createElement("span",{className:"no-chats-found"},"[",wp.i18n.__("No chats assigned to this bridge","cf7-telegram"),"]")),i().createElement("div",{className:"frame forms"},i().createElement("button",{className:"add-button add-form-button","data-testid":`cf7tg-channel-${e.id}-add-form`,onClick:h,disabled:"ready"!==k.forms||_},m?wp.i18n.__("Cancel","cf7-telegram"):wp.i18n.__("Add Form","cf7-telegram")),"error"===k.forms?i().createElement("span",{className:"resource-error"},wp.i18n.__("Forms are unavailable.","cf7-telegram")):"ready"!==k.forms?i().createElement("span",{className:"resource-loading"},wp.i18n.__("Loading forms...","cf7-telegram")):m&&i().createElement(wa,{className:"select-picker form-picker",classNamePrefix:"select-picker",inputId:`cf7tg-channel-form-picker-${e.id}`,instanceId:`cf7tg-channel-form-picker-${e.id}`,"data-testid":`cf7tg-channel-${e.id}-form-picker`,options:p.map(e=>({value:e.id,label:e.title})),isSearchable:!0,placeholder:wp.i18n.__("Pick a form","cf7-telegram"),onChange:e=>g({target:{value:e?.value}}),isClearable:!0,isDisabled:_}),"ready"===k.forms&&(f.length>0?i().createElement("ul",{className:"form-list "+(m?"show-selector":"")},f.map(t=>i().createElement("li",{key:t.id,"data-testid":`cf7tg-channel-${e.id}-form-${t.id}`},t.title,i().createElement("button",{className:"detach-button crux detach-form-button",onClick:()=>v(t.id),disabled:_})))):m||i().createElement("span",{className:"no-forms-found"},"[",wp.i18n.__("No forms assigned to this bridge","cf7-telegram"),"]"))),i().createElement("div",{className:"frame status-bar"},i().createElement("button",{className:"remove-channel-button","data-testid":`cf7tg-remove-channel-${e.id}`,onClick:O,disabled:n||_},wp.i18n.__("Remove Bridge","cf7-telegram")))))};class Ea extends Error{constructor(e,t={}){super(e),this.name="ApiError",this.status=t.status??0,this.code=t.code??"",this.category=t.category??"rest_transport",this.method=t.method??"GET",this.url=t.url??"",this.data=t.data??null}}const Oa=(e,t="")=>[401,403].includes(Number(e))||/forbidden|unauthorized|cannot_/i.test(t)?"rest_permission":Number(e)>=400?"rest_http":"rest_transport",Sa=e=>String(e).replace(/bot\d{5,}(:|%(?:25)*3a)[A-Za-z0-9_-]{8,}/gi,"bot[telegram-token]").replace(/\d{5,}(:|%(?:25)*3a)[A-Za-z0-9_-]{8,}/gi,"[telegram-token]").replace(/([?&][^=]*(?:nonce|token|secret|password|key)[^=]*=)[^&\s]*/gi,"$1[redacted]"),ka=e=>"string"==typeof e?Sa(e):e&&"object"==typeof e?Array.isArray(e)?e.map(ka):Object.entries(e).reduce((e,[t,n])=>({...e,[t]:/nonce|token|secret|password|key/i.test(t)?"[redacted]":ka(n)}),{}):e,_a=e=>{try{const t=new URL(e,"undefined"!=typeof window?window.location?.origin??"https://example.invalid":"https://example.invalid");for(const e of Array.from(t.searchParams.keys()))/nonce|token|secret|password|key/i.test(e)&&t.searchParams.set(e,"[redacted]");return`${t.pathname}${t.search}${t.hash}`}catch(t){return Sa(e)}},xa=(e,t)=>{const n=t.toString();return n?`${e}${e.includes("?")?"&":"?"}${n}`:e},Ta=(e,t)=>xa(`${e}${t}`,new URLSearchParams({force:"true"})),Ia=async(e,t,n,a={})=>{const r=e;let o={method:t=t??"GET",headers:{"Content-Type":"application/json","X-WP-Nonce":cf7TelegramData?.nonce}},i=new URLSearchParams;if("GET"===t||"HEAD"===t){if(n){for(const[e,t]of Object.entries(n))null!=t&&i.append(e,t);n=null}e=xa(e,i)}n&&(o.body=JSON.stringify(n));try{const n=await fetch(e,o);let r;try{r=await n.json()}catch(a){throw new Ea(n.ok?"The server returned an invalid response.":"The request could not be completed.",{status:n.status??0,category:n.ok?"rest_parse":Oa(n.status),method:t,url:_a(e)})}if(!n.ok)throw new Ea("The request could not be completed.",{status:n.status??r?.data?.status??0,code:r?.code??"",category:Oa(n.status??r?.data?.status,r?.code),method:t,url:_a(e),data:ka(r?.data??null)});return a.includeResponse?{data:r,response:n}:r}catch(e){throw e instanceof Ea||(e=new Ea(Sa(e?.message||"API request failed"),{category:"rest_transport",method:t,url:_a(r)})),console.error("API request error:",e),e}},Pa=(e,t)=>{const n=new Set(e.map(e=>e?.id));return e.concat(t.filter(e=>!e||void 0===e.id||!n.has(e.id)&&(n.add(e.id),!0)))},Da=e=>{const t=e.headers?.get?.("X-WP-TotalPages"),n=Number.parseInt(t,10);return Number.isFinite(n)&&n>0?n:null},Ma=async(e,t={})=>(async(e,t={},n={})=>{const a=n.perPage??100;let r=1,o=1,i=[];do{const{data:s,response:l}=await Ia(e,"GET",{...t,per_page:a,page:r},{includeResponse:!0});i=Pa(i,Array.isArray(s)?s:[]);const c=Da(l);o=null===c&&n.stopWhenTotalPagesHeaderMissing?r:c??r,r+=1}while(r<=o);return i})(e,{order:"asc",orderby:"id",...t}),Fa=async()=>await Ia(cf7TelegramData.routes.client),Va=async()=>await(async()=>{let e=0,t=[],n=!0;for(;n;){const a=await Ia(cf7TelegramData.routes.forms,"GET",{per_page:100,offset:e,order:"asc",orderby:"id"}),r=t.length,o=Array.isArray(a)?a:[];t=Pa(t,o),e+=o.length,n=o.length>=100&&t.length>r}return t})(),Ra=async()=>await Ma(cf7TelegramData.routes.bots),Na=async()=>await Ma(cf7TelegramData.routes.chats),La=async()=>await Ma(cf7TelegramData.routes.channels),Aa=async()=>await Ia(cf7TelegramData.routes.relations.form2channel),$a=async()=>await Ia(cf7TelegramData.routes.relations.bot2channel),Ba=async()=>await Ia(cf7TelegramData.routes.relations.bot2chat),Ha=async()=>await Ia(cf7TelegramData.routes.relations.chat2channel);function ja(e,t=null){const n=t??e.innerText,a=()=>{e.classList.add("copied"),setTimeout(()=>e.classList.remove("copied"),1500)};if(navigator.clipboard&&window.isSecureContext)return void navigator.clipboard.writeText(n).then(a).catch(e=>{console.error("Clipboard error:",e)});const r=document.createElement("textarea");r.value=n,r.style.position="fixed",r.style.opacity="0",document.body.appendChild(r),r.focus(),r.select();try{document.execCommand("copy"),a()}catch(e){console.error("Fallback copy failed:",e)}finally{document.body.removeChild(r)}}const za=async(e,t,n)=>{const a=await(async(e,t)=>await Ia(cf7TelegramData.routes.relations.chat2channel,"POST",{from:e,to:t}))(e,t);a&&n(e=>[...e,{data:a}])},Ua=({channel:e,forms:t,setChannels:n,form2ChannelConnections:a,setForm2ChannelConnections:r,bots:s,bot2ChannelConnections:l,setBot2ChannelConnections:c,chats:u,chat2ChannelConnections:d,setChat2ChannelConnections:f,bot2ChatConnections:p,dataAvailability:m={forms:"ready",bots:"ready",chats:"ready"}})=>{const[h,g]=(0,o.useState)(null),[v,b]=(0,o.useState)([]),[y,w]=(0,o.useState)([]),[C,E]=(0,o.useState)([]),[O,S]=(0,o.useState)(!1),[k,_]=(0,o.useState)([]),[x,T]=(0,o.useState)(!1),[I,P]=(0,o.useState)(e.title.rendered),[D,M]=(0,o.useState)(!1),[F,V]=(0,o.useState)(!1),[R,N]=(0,o.useState)(null);(0,o.useEffect)(()=>{if("ready"!==m.bots||"ready"!==m.chats)return;const t=l.find(t=>t.data.to===e.id);if(!t)return g(null);const n=s.find(e=>e.id===t.data.from);if(!n)return g(null);const a=p.filter(e=>e.data.from===n.id),r=u.map(t=>{const n=a.find(e=>e.data.to===t.id);if(!n)return null;const r=d.some(n=>n.data.from===t.id&&n.data.to===e.id);return{...t,muted:!!n.data.muted,status:r?"active":"paused"}}).filter(Boolean);g({...n,chats:r}),b(r.filter(e=>"active"===e.status))},[e.id,s,l,p,u,d,m.bots,m.chats]),(0,o.useEffect)(()=>{if("ready"!==m.forms)return;const n=a.filter(t=>t.data?.to===e.id).map(e=>e.data.from),r=t.filter(e=>n.includes(e.id)),o=t.filter(e=>!n.includes(e.id));w(r),E(o)},[t,a,e.id,m.forms]),(0,o.useEffect)(()=>{if("ready"!==m.bots)return;const t=l.find(t=>t.data.to===e.id),n=t?.data.from,a=s.filter(e=>e.id!==n);_(a)},[s,l,e.id,m.bots]);const L=()=>{P(e.title.rendered),T(!1),N(null)},A=async()=>{if(""!==I.trim()&&I!==e.title.rendered){M(!0),N(null);try{await(async(e,t)=>{let n={title:t};return await Ia(`${cf7TelegramData.routes.channels}${e}`,"POST",n)})(e.id,I),T(!1)}catch(e){console.error(e),N(wp.i18n.__("Failed to update title","cf7-telegram"))}finally{M(!1)}}else T(!1)};return i().createElement(Ca,{channel:e,titleValue:I,saving:D,error:R,handleTitleClick:()=>{N(null),T(!0)},handleTitleChange:e=>P(e.target.value),handleKeyDown:e=>{"Enter"===e.key&&A(),"Escape"===e.key&&L()},handleCancelEdit:L,saveTitle:A,botForChannel:h,chatsForChannel:v,formsForChannel:y,availableForms:C,showFormSelector:O,handleAddForm:()=>S(e=>!e),handleFormSelect:async t=>{const n=parseInt(t.target.value,10);if(Number.isInteger(n)&&!F){V(!0);try{await(async(e,t,n)=>{const a=await(async(e,t)=>await Ia(cf7TelegramData.routes.relations.form2channel,"POST",{from:e,to:t}))(e,t);a&&n(e=>[...e,{data:a}])})(n,e.id,r)}catch(e){console.error(e),alert(wp.i18n.__("Something went wrong while assigning the form","cf7-telegram"))}finally{S(!1),V(!1)}}},handleRemoveForm:async t=>{const n=a.find(n=>n.data.from===t&&n.data.to===e.id);if(!F&&n&&window.confirm(wp.i18n.__("Are you sure you want to remove this form from the bridge?","cf7-telegram"))){V(!0);try{await(async(e,t)=>{await(async e=>await Ia(`${cf7TelegramData.routes.relations.form2channel}${e}`,"DELETE"))(e)&&t(t=>t.filter(t=>t.data.id!==e))})(n.data.id,r)}catch(e){console.error(e),alert(wp.i18n.__("Failed to remove form","cf7-telegram"))}finally{V(!1)}}},availableBots:k,handleBotSelect:async t=>{const n=parseInt(t.target.value,10);if(Number.isInteger(n)&&!F){V(!0);try{await(async(e,t,n)=>{const a=await(async(e,t)=>await Ia(cf7TelegramData.routes.relations.bot2channel,"POST",{from:e,to:t}))(e,t);a&&n(e=>[...e,{data:a}])})(n,e.id,c)}catch(e){console.error(e),alert(wp.i18n.__("Failed to assign bot","cf7-telegram"))}finally{V(!1)}}},handleRemoveBot:async()=>{const t=l.find(t=>t.data.to===e.id);if(t&&!F){V(!0);try{await(async(e,t)=>{await(async e=>await Ia(`${cf7TelegramData.routes.relations.bot2channel}${e}`,"DELETE"))(e)&&t(t=>t.filter(t=>t.data.id!==e))})(t.data.id,c)}catch(e){console.error(e),alert(wp.i18n.__("Failed to remove bot","cf7-telegram"))}finally{V(!1)}}},bot2ChatConnections:p,handleToggleChat:async(t,n)=>{if(F||"muted"===n.toLowerCase())return;let a=d.find(n=>n.data.from===t&&n.data.to===e.id);V(!0);try{a?await(async(e,t)=>{await(async e=>await Ia(`${cf7TelegramData.routes.relations.chat2channel}${e}`,"DELETE"))(e)&&t(t=>t.filter(t=>t.data.id!==e))})(a.data.id,f):await za(t,e.id,f)}catch(e){console.error("Failed to update bridge chat",e),N(wp.i18n.__("Failed to update chat","cf7-telegram"))}finally{V(!1)}},deleteChannel:async()=>{if(!D&&!F&&window.confirm(wp.i18n.__("Are you sure you want to delete this bridge?","cf7-telegram"))){M(!0),N(null);try{await(async(e,t)=>{await(async e=>await Ia(Ta(cf7TelegramData.routes.channels,e),"DELETE"))(e)&&t(t=>t.filter(t=>t.id!==e))})(e.id,n)}catch(e){console.error(e),N(wp.i18n.__("Failed to delete bridge","cf7-telegram"))}finally{M(!1)}}},getToggleButtonLabel:e=>{switch(e.toLowerCase()){case"active":return wp.i18n.__("Pause","cf7-telegram");case"paused":return wp.i18n.__("Activate","cf7-telegram");case"muted":return wp.i18n.__("Muted by Bot","cf7-telegram");default:return""}},dataAvailability:m,mutatingRelations:F})},Wa=({bot:e,chatsForBot:t=[],bot2ChatConnections:n=[],updatingStatusIds:a=[],updatingNameIds:r=[],renamingChatId:o=null,chatNameValue:s="",isEditingToken:l,nameValue:c,isTokenEmpty:u,tokenValue:d,saving:f,error:p,handleEditToken:m,deleteBot:h,handleKeyDown:g,setTokenValue:v,handleToggleChatStatus:b,handleDisconnectChat:y,handleStartRenameChat:w=()=>{},handleRenameChatChange:C=()=>{},handleRenameChatKeyDown:E=()=>{},handleCancelRenameChat:O=()=>{},handleSaveChatName:S=()=>{},handleRestoreChatName:k=()=>{},online:_,chatDataStatus:x="ready"})=>{let T=!0===_?"online":!1===_?"offline":"unknown",I=c.slice(0,18);const P=`@${c}`,D=u?d:`***${d.slice(-4)}`;return i().createElement("div",{className:`entity-container bot ${T}`,"data-testid":`cf7tg-bot-${e.id}`,key:e.id,id:`bot-${e.id}`},i().createElement("div",{className:"entity-wrapper bot-wrapper "+(f?"saving":"")},i().createElement("div",{className:"frame bot-summary"},i().createElement("div",{className:"bot-title"},i().createElement("div",{className:`bot-name ${T} copyable`,onClick:e=>ja(e.currentTarget,P),title:wp.i18n.__("Click to copy bot name","cf7-telegram")},"@",I,I!==c&&"..."),i().createElement("div",{className:"bot-command copyable",onClick:e=>ja(e.currentTarget),title:wp.i18n.__("Click to copy bot command","cf7-telegram")},"/cf7tg_start")),i().createElement("div",{className:"bot-token"},i().createElement("div",{className:"show-token"+(e.isTokenDefinedByConst?" const":""),"data-testid":`cf7tg-bot-token-display-${e.id}`,onClick:m,title:e.isTokenDefinedByConst?wp.i18n.__("Defined by PHP constant","cf7-telegram"):wp.i18n.__("Click to edit token","cf7-telegram")},wp.i18n.__("token","cf7-telegram"),": ",i().createElement("span",{className:"token-value"},l?"":D)),!_&&u&&!e.isTokenDefinedByConst&&i().createElement("div",{className:"php-const-hint copyable",title:wp.i18n.__("Click to copy PHP code","cf7-telegram"),onClick:t=>ja(t.currentTarget,`const ${e.phpConst} = 'your_token';`)},wp.i18n.__("set by PHP const","cf7-telegram")),l&&i().createElement(i().Fragment,null,i().createElement("input",{className:"edit-token","data-testid":`cf7tg-bot-token-input-${e.id}`,type:"text",value:d,onChange:e=>v(e.target.value),onKeyDown:g,autoFocus:!0,disabled:f,spellCheck:"false",title:wp.i18n.__("Press Enter to save token, Esc to cancel.","cf7-telegram")})))),p&&i().createElement("p",{style:{color:"red"}},p),i().createElement("div",{className:"frame chats-for-bot"},"error"===x?i().createElement("span",{className:"offline-bot-sad-message"},wp.i18n.__("Chat data is unavailable.","cf7-telegram")):"ready"!==x?i().createElement("span",{className:"unknown-bot-status-message"},wp.i18n.__("Loading chat data...","cf7-telegram")):t.length>0?i().createElement("ul",null,t.map(t=>{const l=function(e,t,n=[]){const a=n.find(n=>n.data.from===e&&n.data.to===t),r=a?.data?.meta?.status?.[0];return"pending"===r?"Pending":"muted"===r?"Muted":"Active"}(e.id,t.id,n),c=a.includes(t.id),u=o===t.id,d=r.includes(t.id),f="pending"!==l.toLowerCase();return i().createElement("li",{key:t.id,className:`chat-item ${l.toLowerCase()}`,"data-testid":`cf7tg-bot-${e.id}-chat-${t.id}`},u?i().createElement("input",{className:"chat-name edit-chat-name","data-testid":`cf7tg-bot-${e.id}-chat-${t.id}-name-input`,type:"text",value:s,onChange:C,onKeyDown:e=>E(t.id,e),disabled:d,autoFocus:!0}):i().createElement("span",{className:"chat-name",title:String(l)},t.title.rendered),u?i().createElement(i().Fragment,null,i().createElement("span",{className:"action save-chat-name",onClick:()=>S(t.id),"aria-disabled":d},d?wp.i18n.__("Saving...","cf7-telegram"):wp.i18n.__("Save","cf7-telegram")),i().createElement("span",{className:"action restore-chat-name",onClick:()=>k(t.id),"aria-disabled":d},wp.i18n.__("Restore","cf7-telegram")),i().createElement("span",{className:"action cancel-chat-name",onClick:O,"aria-disabled":d},wp.i18n.__("Cancel","cf7-telegram"))):i().createElement(i().Fragment,null,i().createElement("span",{className:"action toggle-status",onClick:()=>b(t.id,l.toLowerCase()),"aria-disabled":c},c?wp.i18n.__("Updating...","cf7-telegram"):function(e){return["muted","pending"].includes(e.toLowerCase())?wp.i18n.__("Activate","cf7-telegram"):wp.i18n.__("Mute","cf7-telegram")}(l)),f&&i().createElement("span",{className:"action rename-chat",onClick:()=>w(t),"aria-disabled":d},wp.i18n.__("Rename","cf7-telegram")),i().createElement("span",{className:"action remove-chat",onClick:()=>y(t.id,e.id)},wp.i18n.__("Remove","cf7-telegram"))))})):"offline"===T?i().createElement("span",{className:"offline-bot-sad-message"},wp.i18n.__("Couldn't load chat list...","cf7-telegram")):"unknown"===T?i().createElement("span",{className:"unknown-bot-status-message"},wp.i18n.__("Trying to load chat list...","cf7-telegram")):i().createElement("span",{className:"no-chats-found"},wp.i18n.__("Waiting for chats to join...","cf7-telegram"))),i().createElement("div",{className:"frame status-bar"},i().createElement("button",{className:"remove-bot-button","data-testid":`cf7tg-remove-bot-${e.id}`,onClick:h,disabled:f},wp.i18n.__("Remove bot","cf7-telegram")),i().createElement("div",{className:`bot-status ${T}`},T))))},Ga=({bot:e,chats:t,setChats:n=()=>{},bot2ChatConnections:a,setBots:r,setBot2ChatConnections:s,bot2ChannelConnections:l,setBot2ChannelConnections:c,setChat2ChannelConnections:u,loadChatData:d,chatDataStatus:f="ready"})=>{const[p,m]=(0,o.useState)(!1),[h,g]=(0,o.useState)(e.title.rendered),[v,b]=(0,o.useState)(e.token),[y,w]=(0,o.useState)(e.isTokenEmpty),[C,E]=(0,o.useState)(!1),[O,S]=(0,o.useState)(null),[k,_]=(0,o.useState)([]),[x,T]=(0,o.useState)(null),[I,P]=(0,o.useState)(""),[D,M]=(0,o.useState)([]),F=a.filter(t=>t.data.from===e.id).map(e=>e.data.to),V=t.filter(e=>F.includes(e.id)),R=t=>{const n=a.find(n=>n.data.from===e.id&&n.data.to===t);return!!n&&"pending"!==n?.data?.meta?.status?.[0]},[N,L]=(0,o.useState)(null),[A,$]=(0,o.useState)(null),B=(0,o.useRef)(null),H=(0,o.useRef)(null),j=(0,o.useRef)(!1),z=(0,o.useRef)(!1),U=(0,o.useRef)(0);(0,o.useEffect)(()=>()=>{j.current=!0,B.current&&clearTimeout(B.current),H.current&&clearTimeout(H.current)},[]),(0,o.useEffect)(()=>{null===A&&Y()},[N]),(0,o.useEffect)(()=>(!1===A&&W(),()=>{B.current&&clearTimeout(B.current)}),[N]),(0,o.useEffect)(()=>{!0===A&&B.current&&clearTimeout(B.current)},[N]),(0,o.useEffect)(()=>(!0===A?H.current||K().then(()=>{G()}):H.current&&(clearTimeout(H.current),H.current=null),()=>{H.current&&clearTimeout(H.current)}),[A]);const W=()=>{B.current=setTimeout(()=>{Y()},cf7TelegramData.intervals.ping)},G=()=>{H.current=setTimeout(async()=>{await K(),j.current||!0!==A||G()},cf7TelegramData.intervals.bot_fetch)},q=()=>{U.current+=1,U.current>=3&&S(wp.i18n.__("Telegram updates could not be checked.","cf7-telegram"))},K=async()=>{if(!z.current){z.current=!0;try{let t=await(async e=>await Ia(`${cf7TelegramData.routes.bots}${e}/fetch_updates`,"POST"))(e.id);const n=(e=>{if(e?.hasWebhookConflict)return"webhook_conflict";const t=Array.isArray(e?.errors)?e.errors:[];return t.length&&t.every(e=>"transport"===e?.errorType)?"transient_update_error":t.length?"update_error":null})(t);if("webhook_conflict"===n)return U.current=0,void S(wp.i18n.__("Telegram webhook is active. Disable it before checking for new chats.","cf7-telegram"));if("transient_update_error"===n)return void q();if("update_error"===n)return U.current=0,void S(wp.i18n.__("Telegram updates could not be checked.","cf7-telegram"));U.current=0,S(null),(t.hasNewConnections||t.hasNewChats)&&await d()}catch(e){console.error("Fetch updates failed",e),"rest_transport"===e?.category?q():(U.current=0,S(wp.i18n.__("Telegram updates could not be checked.","cf7-telegram")))}finally{z.current=!1}}},Y=async({force:t=!1,skipEditingCheck:n=!1}={})=>{try{if(!n&&p)throw new Error("Token is being edited");if(!t&&!0===A)return!0;let a=await(async e=>await Ia(`${cf7TelegramData.routes.bots}${e}/ping`,"POST"))(e.id);if(j.current)return a.online;if($(a.online),a.online){g(a.botName);try{let t=await(async e=>await Ia(`${cf7TelegramData.routes.bots}${e}`))(e.id);r(n=>n.map(n=>n.id===e.id?{...n,title:t.title,online:!0}:n))}catch(e){console.error("Failed to refresh bot data",e)}}return a.online}catch(e){return console.error("Ping failed",e),j.current||$(!1),!1}finally{L(Date.now())}},X=()=>{b(e.token),w(e.isTokenEmpty),m(!1),S(null)},Z=async()=>{E(!0),S(null);try{const t=v.trim();await(async({botId:e,token:t,pingBot:n,bot2ChatConnections:a,setBot2ChatConnections:r,bot2ChannelConnections:o,setBot2ChannelConnections:i})=>{const s=await(async(e,t)=>await Ia(`${cf7TelegramData.routes.bots}${e}/token`,"POST",{token:t}))(e,t.trim());return await n({force:!0,skipEditingCheck:!0}),s.relationsReset&&(r(t=>t.filter(t=>t.data.from!==e)),i(t=>t.filter(t=>t.data.from!==e))),s})({botId:e.id,token:t,pingBot:Y,bot2ChatConnections:a,setBot2ChatConnections:s,bot2ChannelConnections:l,setBot2ChannelConnections:c}),b(t),w(!1),m(!1)}catch(e){console.error(e),S(wp.i18n.__("Failed to update bot","cf7-telegram"))}finally{E(!1)}},J=e=>{n(t=>t.map(t=>t.id===e.id?{...t,...e}:t))},Q=()=>{T(null),P(""),S(null)},ee=async n=>{const a=t.find(e=>e.id===n),r=I.trim();if(a&&!D.includes(n)&&R(n))if(""!==r&&r!==(a.title?.rendered??"")){M(e=>[...e,n]),S(null);try{const t=await(async(e,t,n)=>await Ia(`${cf7TelegramData.routes.chats}${e}/name`,"POST",{bot_id:t,name:n}))(n,e.id,r);J(t),T(null),P("")}catch(e){console.error("Failed to rename chat",e),S(wp.i18n.__("Failed to update chat name","cf7-telegram"))}finally{M(e=>e.filter(e=>e!==n))}}else Q()};return i().createElement(Wa,{bot:e,chatsForBot:V,bot2ChatConnections:a,updatingStatusIds:k,updatingNameIds:D,renamingChatId:x,chatNameValue:I,isEditingToken:p,nameValue:h,isTokenEmpty:y,tokenValue:v,saving:C,error:O,handleEditToken:()=>{e.isTokenDefinedByConst||A&&!window.confirm(wp.i18n.__("Changing the token to another Telegram bot will disconnect this bot from its chats and bridges. Continue?","cf7-telegram"))||(S(null),b(""),m(!0))},deleteBot:async()=>{if(window.confirm("Are you sure you want to delete this bot?")){E(!0),S(null);try{if(!await(async e=>await Ia(Ta(cf7TelegramData.routes.bots,e),"DELETE"))(e.id))return;r(t=>t.filter(t=>t.id!==e.id))}catch(e){console.error(e),S(wp.i18n.__("Failed to delete bot","cf7-telegram"))}finally{E(!1)}}},handleKeyDown:e=>{if("Enter"===e.key){if(""===v.trim())return void X();Z()}"Escape"===e.key&&X()},setTokenValue:b,handleToggleChatStatus:async(t,n)=>{if(k.includes(t))return;const r=a.findIndex(n=>n.data.from===e.id&&n.data.to===t);if(-1===r)return;const o=a[r];let i;if("active"===n)i="muted";else if("muted"===n)i="active";else{if("pending"!==n)return;i="active"}_(e=>[...e,t]);try{await(async({connectionId:e,newStatus:t,currentStatus:n,chatId:a,botId:r,bot2ChannelConnections:o,setBot2ChatConnections:i,setChat2ChannelConnections:s})=>{if(await(async(e,t,n)=>{const a=await(async(e,t)=>await Ia(`${cf7TelegramData.routes.relations.bot2chat}${e}/meta`,"PATCH",{meta:[{key:"status",value:t}]}))(e,t);return a&&n(n=>n.map(n=>n.data.id!==e?n:{...n,data:{...n.data,meta:{...n.data.meta,status:[t]}}})),a})(e,t,i),"pending"!==n)return;const l=o.filter(e=>e.data.from===r);for(const e of l)await za(a,e.data.to,s)})({connectionId:o.data.id,newStatus:i,currentStatus:n,chatId:t,botId:e.id,bot2ChannelConnections:l,setBot2ChatConnections:s,setChat2ChannelConnections:u})}catch(e){console.error("Failed to update chat status",e)}finally{_(e=>e.filter(e=>e!==t))}},handleDisconnectChat:async(e,t)=>{if(k.includes(e))return;const n=a.findIndex(n=>n.data.from===t&&n.data.to===e);if(-1===n||!window.confirm(wp.i18n.__("Are you sure you want to delete this chat?","cf7-telegram")))return;const r=a[n];_(t=>[...t,e]);try{await(async(e,t)=>{await(async e=>await Ia(`${cf7TelegramData.routes.relations.bot2chat}${e}`,"DELETE"))(e)&&t(t=>t.filter(t=>t.data.id!==e))})(r.data.id,s)}catch(e){console.error("Something went wrong while disconnecting chat",e)}finally{_(t=>t.filter(t=>t!==e))}},handleStartRenameChat:e=>{e&&!D.includes(e.id)&&R(e.id)&&(S(null),T(e.id),P(e.title?.rendered??""))},handleRenameChatChange:e=>{P(e.target.value)},handleRenameChatKeyDown:(e,t)=>{"Enter"===t.key&&ee(e),"Escape"===t.key&&Q()},handleCancelRenameChat:Q,handleSaveChatName:ee,handleRestoreChatName:async t=>{if(!D.includes(t)&&R(t)){M(e=>[...e,t]),S(null);try{const n=await(async(e,t)=>await Ia(`${cf7TelegramData.routes.chats}${e}/restore_name`,"POST",{bot_id:t}))(t,e.id);J(n),T(null),P("")}catch(e){console.error("Failed to restore chat name",e),S(wp.i18n.__("Failed to restore Telegram chat name","cf7-telegram"))}finally{M(e=>e.filter(e=>e!==t))}}},online:A,chatDataStatus:f})},qa=({setBots:e,disabled:t=!1})=>i().createElement("button",{className:"add-button add-bot-button","data-testid":"cf7tg-create-bot",onClick:async()=>{try{let t=await(async(e,t)=>{let n={title:wp.i18n.__("Bot Name","cf7-telegram"),status:"publish"};return t?.trim(),await Ia(cf7TelegramData.routes.bots,"POST",n)})();e(e=>[...e,t])}catch(e){console.error("Error creating bot:",e),alert(wp.i18n.__("Failed to create bot","cf7-telegram"))}},disabled:t},wp.i18n.__("Create Bot","cf7-telegram")),Ka=({setChannels:e,disabled:t=!1})=>i().createElement("button",{className:"add-button add-channel-button","data-testid":"cf7tg-create-channel",onClick:async()=>{try{await(async(e,t)=>{let n=await(async e=>await Ia(cf7TelegramData.routes.channels,"POST",{title:e,status:"publish"}))(e);n&&t(e=>[...e,n])})(wp.i18n.__("Bridge Name","cf7-telegram"),e)}catch(e){console.error("Error creating bridge:",e),alert(wp.i18n.__("Failed to create bridge","cf7-telegram"))}},disabled:t},wp.i18n.__("Create Bridge","cf7-telegram")),Ya=["client","forms","bots","chats","channels","form2ChannelConnections","bot2ChannelConnections","chat2ChannelConnections"],Xa=()=>Ya.reduce((e,t)=>({...e,[t]:{status:"idle",error:null}}),{});class Za extends i().Component{constructor(e){super(e),this.state={hasError:!1,retryKey:0}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(){console.error("CF7 Telegram settings failed to render.")}retry=()=>{this.setState(e=>({hasError:!1,retryKey:e.retryKey+1}))};render(){return this.state.hasError?i().createElement("div",{className:"cf7-tg-error-boundary",role:"alert"},i().createElement("p",null,wp.i18n.__("The settings screen could not be displayed.","cf7-telegram")),i().createElement("button",{type:"button",className:"button",onClick:this.retry},wp.i18n.__("Try again","cf7-telegram"))):i().createElement(i().Fragment,{key:this.state.retryKey},this.props.children)}}const Ja=()=>{const[e,t]=(0,o.useState)([]),[n,a]=(0,o.useState)([]),[r,s]=(0,o.useState)([]),[l,c]=(0,o.useState)([]),[u,d]=(0,o.useState)([]),[f,p]=(0,o.useState)([]),[m,h]=(0,o.useState)([]),[g,v]=(0,o.useState)([]),[b,y]=(0,o.useState)(Xa),w=(0,o.useCallback)(async(e,t,n)=>{y(t=>({...t,[e]:{status:"loading",error:null}}));try{const a=await t();return n(a),y(t=>({...t,[e]:{status:"success",error:null}})),a}catch(t){throw y(n=>({...n,[e]:{status:"error",error:t}})),t}},[]),C=(0,o.useCallback)(async()=>w("chats",async()=>{const[e,t]=await Promise.all([Ba(),Na()]);return{connections:e,loadedChats:t}},({connections:e,loadedChats:t})=>{v((e=>e.map(e=>{const t=e.data?.meta?.status?.[0];return{...e,data:{...e.data,muted:"muted"===t}}}))(e)),s(t)}),[w]),E=(0,o.useCallback)((e=Ya)=>Promise.allSettled(e.map(e=>{switch(e){case"client":return w(e,Fa,()=>{});case"forms":return w(e,Va,t);case"bots":return w(e,Ra,a);case"chats":return C();case"channels":return w(e,La,c);case"form2ChannelConnections":return w(e,Aa,d);case"bot2ChannelConnections":return w(e,$a,p);case"chat2ChannelConnections":return w(e,Ha,h);default:return Promise.resolve()}})),[C,w]);(0,o.useEffect)(()=>{E()},[E]);const O=e=>b[e]?.status??"idle",S=(...e)=>e.some(e=>"error"===O(e))?"error":e.every(e=>"success"===O(e))?"ready":"loading",k=Ya.filter(e=>"error"===O(e));if(!Ya.some(e=>["success","error"].includes(O(e))))return i().createElement("div",null,wp.i18n.__("Loading data...","cf7-telegram"));const _=cf7TelegramData?.migration?.status||{},x=Boolean(cf7TelegramData?.migration?.show_action_button),T=!1!==_.can_retry,I="migration_failed"===_.last_error?.category?_.last_error.message:null;return i().createElement(i().Fragment,null,i().createElement("h1",null,wp.i18n.__("Telegram notificator settings","cf7-telegram")),k.length>0&&i().createElement("div",{className:"notice notice-error cf7t-notice cf7-tg-load-status",role:"alert"},i().createElement("p",null,wp.i18n.__("Some settings data could not be loaded.","cf7-telegram")),i().createElement("button",{type:"button",className:"button",onClick:()=>E(k)},wp.i18n.__("Retry failed requests","cf7-telegram"))),i().createElement("div",{className:"cf7-tg-container"},i().createElement("div",{className:"main-container"},i().createElement("div",{className:"list-container bots-container"},i().createElement("div",{className:"title-container"},i().createElement("h3",{className:"title"},wp.i18n.__("Bots","cf7-telegram")),i().createElement("p",{className:"title-description"},wp.i18n.__("A Telegram bot is required to run the integration. Create at least one bot, then connect it here.","cf7-telegram")," ",i().createElement("a",{href:"https://core.telegram.org/bots#3-how-do-i-create-a-bot",target:"_blank",rel:"noreferrer"},wp.i18n.__("How to create a bot","cf7-telegram"))),i().createElement(qa,{setBots:a,disabled:"success"!==O("bots")})),i().createElement("div",{className:"bot-list"},"error"===O("bots")&&i().createElement("p",{className:"resource-error"},wp.i18n.__("Bots could not be loaded.","cf7-telegram")),n.map(e=>i().createElement(Ga,{key:e.id,bot:e,chats:r,setChats:s,bot2ChatConnections:g,setBots:a,setBot2ChatConnections:v,bot2ChannelConnections:f,setBot2ChannelConnections:p,setChat2ChannelConnections:h,loadChatData:C,chatDataStatus:S("chats")})))),i().createElement("div",{className:"list-container channels-container"},i().createElement("div",{className:"title-container"},i().createElement("h3",{className:"title"},wp.i18n.__("Bridges","cf7-telegram")),i().createElement("p",{className:"title-description"},wp.i18n.__("A bridge is required to run the integration. Create at least one bridge, and add more when different forms should send messages to different sets of Telegram recipients.","cf7-telegram")),i().createElement(Ka,{setChannels:c,disabled:"success"!==O("channels")})),i().createElement("div",{className:"channel-list"},"error"===O("channels")&&i().createElement("p",{className:"resource-error"},wp.i18n.__("Bridges could not be loaded.","cf7-telegram")),l.map(t=>i().createElement(Ua,{key:t.id,channel:t,forms:e,setChannels:c,form2ChannelConnections:u,setForm2ChannelConnections:d,bots:n,bot2ChannelConnections:f,setBot2ChannelConnections:p,chats:r,chat2ChannelConnections:m,setChat2ChannelConnections:h,bot2ChatConnections:g,dataAvailability:{forms:S("forms","form2ChannelConnections"),bots:S("bots","bot2ChannelConnections"),chats:S("chats","chat2ChannelConnections")}})))))),x&&i().createElement("div",{className:"cf7-tg-migration-action"},i().createElement("form",{method:"post",action:cf7TelegramData?.migration?.action_url},i().createElement("input",{type:"hidden",name:"action",value:"cf7tg_migration_action"}),i().createElement("input",{type:"hidden",name:"cf7tg_migration_nonce",value:cf7TelegramData?.migration?.nonce}),i().createElement("p",null,_.is_failed?wp.i18n.__("Data migration failed. You can retry it now.","cf7-telegram"):wp.i18n.__("We detected settings from an older version that couldn’t be migrated automatically. Click the button below to migrate them to the new version.","cf7-telegram")),I&&i().createElement("p",{className:"cf7-tg-migration-error"},I),i().createElement("button",{type:"submit",className:"button button-primary",disabled:!T},_.is_failed?wp.i18n.__("Retry migration","cf7-telegram"):wp.i18n.__("Run migration","cf7-telegram")))),i().createElement("style",null,".copyable::after { content: '"+wp.i18n.__("Copied!","cf7-telegram")+"' !important }"))},Qa=()=>i().createElement(Za,null,i().createElement(Ja,null));(0,s.render)(i().createElement(i().StrictMode,null,i().createElement(Qa,null)),document.getElementById("settings-content"))})();1 (()=>{"use strict";var e={72(e,t){var n="function"==typeof Symbol&&Symbol.for,a=n?Symbol.for("react.element"):60103,r=n?Symbol.for("react.portal"):60106,o=n?Symbol.for("react.fragment"):60107,i=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,m=n?Symbol.for("react.suspense_list"):60120,h=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.block"):60121,b=n?Symbol.for("react.fundamental"):60117,y=n?Symbol.for("react.responder"):60118,w=n?Symbol.for("react.scope"):60119;function C(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case a:switch(e=e.type){case u:case d:case o:case s:case i:case p:return e;default:switch(e=e&&e.$$typeof){case c:case f:case g:case h:case l:return e;default:return t}}case r:return t}}}function E(e){return C(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=l,t.Element=a,t.ForwardRef=f,t.Fragment=o,t.Lazy=g,t.Memo=h,t.Portal=r,t.Profiler=s,t.StrictMode=i,t.Suspense=p,t.isAsyncMode=function(e){return E(e)||C(e)===u},t.isConcurrentMode=E,t.isContextConsumer=function(e){return C(e)===c},t.isContextProvider=function(e){return C(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===a},t.isForwardRef=function(e){return C(e)===f},t.isFragment=function(e){return C(e)===o},t.isLazy=function(e){return C(e)===g},t.isMemo=function(e){return C(e)===h},t.isPortal=function(e){return C(e)===r},t.isProfiler=function(e){return C(e)===s},t.isStrictMode=function(e){return C(e)===i},t.isSuspense=function(e){return C(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===d||e===s||e===i||e===p||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===h||e.$$typeof===l||e.$$typeof===c||e.$$typeof===f||e.$$typeof===b||e.$$typeof===y||e.$$typeof===w||e.$$typeof===v)},t.typeOf=C},404(e,t,n){e.exports=n(72)}};const t={};function n(a){const r=t[a];if(void 0!==r)return r.exports;const o=t[a]={exports:{}};return e[a](o,o.exports,n),o.exports}n.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.cw=e=>{var t;return()=>{if(e){var n=e;e=0,t={exports:{}},n.call(t.exports,t,t.exports)}return t.exports}},(()=>{const e=Object.getPrototypeOf;let t;n.t=function(a,r){if(1&r&&(a=this(a)),8&r)return a;if("object"==typeof a&&a){if(4&r&&a.__esModule)return a;if(16&r&&"function"==typeof a.then)return a}const o=Object.create(null);n.r(o);const i={};t||=[null,e({}),e([]),e(e)];for(var s=2&r&&a;("object"==typeof s||"function"==typeof s)&&!~t.indexOf(s);s=e(s))Object.getOwnPropertyNames(s).forEach(e=>i[e]=()=>a[e]);return i.default=()=>a,n.d(o,i),o}})(),n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a=n.cw(function(e,t){var n=qe(),a={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},i={};function s(e){return n.isMemo(e)?o:i[e.$$typeof]||a}i[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},i[n.Memo]=o;var l=Object.defineProperty,c=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,a){if("string"!=typeof n){if(p){var o=f(n);o&&o!==p&&e(t,o,a)}var i=c(n);u&&(i=i.concat(u(n)));for(var m=s(t),h=s(n),g=0;g<i.length;++g){var v=i[g];if(!(r[v]||a&&a[v]||h&&h[v]||m&&m[v])){var b=d(n,v);try{l(t,v,b)}catch(e){}}}}return t}}),r=()=>n(404);const o=window.React;var i=n.n(o);const s=window.wp.element;function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function c(e){var t=function(e){if("object"!=l(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==l(t)?t:t+""}function u(e,t,n){return(t=c(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach(function(t){u(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function m(e,t){if(e){if("string"==typeof e)return p(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(a=o.call(n)).done)&&(s.push(a.value),s.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw r}}return s}}(e,t)||m(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.includes(a))continue;n[a]=e[a]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var v=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function b(){return b=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},b.apply(null,arguments)}function y(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,c(a.key),a)}}function w(e,t){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},w(e,t)}function C(e){return C=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},C(e)}function E(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(E=function(){return!!e})()}function O(e){return function(e){if(Array.isArray(e))return p(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||m(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var S=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(e){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),this.tags=[],this.ctr=0},e}(),k=Math.abs,_=String.fromCharCode,T=Object.assign;function x(e){return e.trim()}function I(e,t,n){return e.replace(t,n)}function D(e,t){return e.indexOf(t)}function P(e,t){return 0|e.charCodeAt(t)}function M(e,t,n){return e.slice(t,n)}function F(e){return e.length}function R(e){return e.length}function V(e,t){return t.push(e),e}var N=1,L=1,A=0,$=0,B=0,H="";function j(e,t,n,a,r,o,i){return{value:e,root:t,parent:n,type:a,props:r,children:o,line:N,column:L,length:i,return:""}}function U(e,t){return T(j("",null,null,"",null,null,0),e,{length:-e.length},t)}function z(){return B=$>0?P(H,--$):0,L--,10===B&&(L=1,N--),B}function W(){return B=$<A?P(H,$++):0,L++,10===B&&(L=1,N++),B}function G(){return P(H,$)}function K(){return $}function q(e,t){return M(H,e,t)}function Y(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function X(e){return N=L=1,A=F(H=e),$=0,[]}function Z(e){return H="",e}function J(e){return x(q($-1,te(91===e?e+2:40===e?e+1:e)))}function Q(e){for(;(B=G())&&B<33;)W();return Y(e)>2||Y(B)>3?"":" "}function ee(e,t){for(;--t&&W()&&!(B<48||B>102||B>57&&B<65||B>70&&B<97););return q(e,K()+(t<6&&32==G()&&32==W()))}function te(e){for(;W();)switch(B){case e:return $;case 34:case 39:34!==e&&39!==e&&te(B);break;case 40:41===e&&te(e);break;case 92:W()}return $}function ne(e,t){for(;W()&&e+B!==57&&(e+B!==84||47!==G()););return"/*"+q(t,$-1)+"*"+_(47===e?e:W())}function ae(e){for(;!Y(G());)W();return q(e,$)}var re="-ms-",oe="-moz-",ie="-webkit-",se="comm",le="rule",ce="decl",ue="@keyframes";function de(e,t){for(var n="",a=R(e),r=0;r<a;r++)n+=t(e[r],r,e,t)||"";return n}function fe(e,t,n,a){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case ce:return e.return=e.return||e.value;case se:return"";case ue:return e.return=e.value+"{"+de(e.children,a)+"}";case le:e.value=e.props.join(",")}return F(n=de(e.children,a))?e.return=e.value+"{"+n+"}":""}function pe(e){return Z(me("",null,null,null,[""],e=X(e),0,[0],e))}function me(e,t,n,a,r,o,i,s,l){for(var c=0,u=0,d=i,f=0,p=0,m=0,h=1,g=1,v=1,b=0,y="",w=r,C=o,E=a,O=y;g;)switch(m=b,b=W()){case 40:if(108!=m&&58==P(O,d-1)){-1!=D(O+=I(J(b),"&","&\f"),"&\f")&&(v=-1);break}case 34:case 39:case 91:O+=J(b);break;case 9:case 10:case 13:case 32:O+=Q(m);break;case 92:O+=ee(K()-1,7);continue;case 47:switch(G()){case 42:case 47:V(ge(ne(W(),K()),t,n),l);break;default:O+="/"}break;case 123*h:s[c++]=F(O)*v;case 125*h:case 59:case 0:switch(b){case 0:case 125:g=0;case 59+u:-1==v&&(O=I(O,/\f/g,"")),p>0&&F(O)-d&&V(p>32?ve(O+";",a,n,d-1):ve(I(O," ","")+";",a,n,d-2),l);break;case 59:O+=";";default:if(V(E=he(O,t,n,c,u,r,s,y,w=[],C=[],d),o),123===b)if(0===u)me(O,t,E,E,w,o,d,s,C);else switch(99===f&&110===P(O,3)?100:f){case 100:case 108:case 109:case 115:me(e,E,E,a&&V(he(e,E,E,0,0,r,s,y,r,w=[],d),C),r,C,d,s,a?w:C);break;default:me(O,E,E,E,[""],C,0,s,C)}}c=u=p=0,h=v=1,y=O="",d=i;break;case 58:d=1+F(O),p=m;default:if(h<1)if(123==b)--h;else if(125==b&&0==h++&&125==z())continue;switch(O+=_(b),b*h){case 38:v=u>0?1:(O+="\f",-1);break;case 44:s[c++]=(F(O)-1)*v,v=1;break;case 64:45===G()&&(O+=J(W())),f=G(),u=d=F(y=O+=ae(K())),b++;break;case 45:45===m&&2==F(O)&&(h=0)}}return o}function he(e,t,n,a,r,o,i,s,l,c,u){for(var d=r-1,f=0===r?o:[""],p=R(f),m=0,h=0,g=0;m<a;++m)for(var v=0,b=M(e,d+1,d=k(h=i[m])),y=e;v<p;++v)(y=x(h>0?f[v]+" "+b:I(b,/&\f/g,f[v])))&&(l[g++]=y);return j(e,t,n,0===r?le:s,l,c,u)}function ge(e,t,n){return j(e,t,n,se,_(B),M(e,2,-2),0)}function ve(e,t,n,a){return j(e,t,n,ce,M(e,0,a),M(e,a+1,-1),a)}var be=function(e,t,n){for(var a=0,r=0;a=r,r=G(),38===a&&12===r&&(t[n]=1),!Y(r);)W();return q(e,$)},ye=new WeakMap,we=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,a=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||ye.get(n))&&!a){ye.set(e,!0);for(var r=[],o=function(e,t){return Z(function(e,t){var n=-1,a=44;do{switch(Y(a)){case 0:38===a&&12===G()&&(t[n]=1),e[n]+=be($-1,t,n);break;case 2:e[n]+=J(a);break;case 4:if(44===a){e[++n]=58===G()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=_(a)}}while(a=W());return e}(X(e),t))}(t,r),i=n.props,s=0,l=0;s<o.length;s++)for(var c=0;c<i.length;c++,l++)e.props[l]=r[s]?o[s].replace(/&\f/g,i[c]):i[c]+" "+o[s]}}},Ce=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function Ee(e,t){switch(function(e,t){return 45^P(e,0)?(((t<<2^P(e,0))<<2^P(e,1))<<2^P(e,2))<<2^P(e,3):0}(e,t)){case 5103:return ie+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return ie+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return ie+e+oe+e+re+e+e;case 6828:case 4268:return ie+e+re+e+e;case 6165:return ie+e+re+"flex-"+e+e;case 5187:return ie+e+I(e,/(\w+).+(:[^]+)/,ie+"box-$1$2"+re+"flex-$1$2")+e;case 5443:return ie+e+re+"flex-item-"+I(e,/flex-|-self/,"")+e;case 4675:return ie+e+re+"flex-line-pack"+I(e,/align-content|flex-|-self/,"")+e;case 5548:return ie+e+re+I(e,"shrink","negative")+e;case 5292:return ie+e+re+I(e,"basis","preferred-size")+e;case 6060:return ie+"box-"+I(e,"-grow","")+ie+e+re+I(e,"grow","positive")+e;case 4554:return ie+I(e,/([^-])(transform)/g,"$1"+ie+"$2")+e;case 6187:return I(I(I(e,/(zoom-|grab)/,ie+"$1"),/(image-set)/,ie+"$1"),e,"")+e;case 5495:case 3959:return I(e,/(image-set\([^]*)/,ie+"$1$`$1");case 4968:return I(I(e,/(.+:)(flex-)?(.*)/,ie+"box-pack:$3"+re+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+ie+e+e;case 4095:case 3583:case 4068:case 2532:return I(e,/(.+)-inline(.+)/,ie+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(F(e)-1-t>6)switch(P(e,t+1)){case 109:if(45!==P(e,t+4))break;case 102:return I(e,/(.+:)(.+)-([^]+)/,"$1"+ie+"$2-$3$1"+oe+(108==P(e,t+3)?"$3":"$2-$3"))+e;case 115:return~D(e,"stretch")?Ee(I(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==P(e,t+1))break;case 6444:switch(P(e,F(e)-3-(~D(e,"!important")&&10))){case 107:return I(e,":",":"+ie)+e;case 101:return I(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ie+(45===P(e,14)?"inline-":"")+"box$3$1"+ie+"$2$3$1"+re+"$2box$3")+e}break;case 5936:switch(P(e,t+11)){case 114:return ie+e+re+I(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ie+e+re+I(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ie+e+re+I(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return ie+e+re+e+e}return e}var Oe=[function(e,t,n,a){if(e.length>-1&&!e.return)switch(e.type){case ce:e.return=Ee(e.value,e.length);break;case ue:return de([U(e,{value:I(e.value,"@","@"+ie)})],a);case le:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,function(t){switch(function(e){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return de([U(e,{props:[I(t,/:(read-\w+)/,":-moz-$1")]})],a);case"::placeholder":return de([U(e,{props:[I(t,/:(plac\w+)/,":"+ie+"input-$1")]}),U(e,{props:[I(t,/:(plac\w+)/,":-moz-$1")]}),U(e,{props:[I(t,/:(plac\w+)/,re+"input-$1")]})],a)}return""})}}],Se=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var a,r,o=e.stylisPlugins||Oe,i={},s=[];a=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)i[t[n]]=!0;s.push(e)});var l,c,u,d,f=[fe,(d=function(e){l.insert(e)},function(e){e.root||(e=e.return)&&d(e)})],p=(c=[we,Ce].concat(o,f),u=R(c),function(e,t,n,a){for(var r="",o=0;o<u;o++)r+=c[o](e,t,n,a)||"";return r});r=function(e,t,n,a){l=n,de(pe(e?e+"{"+t.styles+"}":t.styles),p),a&&(m.inserted[t.name]=!0)};var m={key:t,sheet:new S({key:t,container:a,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:r};return m.sheet.hydrate(s),m},ke=function(e,t,n){var a=e.key+"-"+t.name;!1===n&&void 0===e.registered[a]&&(e.registered[a]=t.styles)},_e={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function Te(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var xe=/[A-Z]|^ms/g,Ie=/_EMO_([^_]+?)_([^]*?)_EMO_/g,De=function(e){return 45===e.charCodeAt(1)},Pe=function(e){return null!=e&&"boolean"!=typeof e},Me=Te(function(e){return De(e)?e:e.replace(xe,"-$&").toLowerCase()}),Fe=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Ie,function(e,t,n){return Ve={name:t,styles:n,next:Ve},t})}return 1===_e[e]||De(e)||"number"!=typeof t||0===t?t:t+"px"};function Re(e,t,n){if(null==n)return"";var a=n;if(void 0!==a.__emotion_styles)return a;switch(typeof n){case"boolean":return"";case"object":var r=n;if(1===r.anim)return Ve={name:r.name,styles:r.styles,next:Ve},r.name;var o=n;if(void 0!==o.styles){var i=o.next;if(void 0!==i)for(;void 0!==i;)Ve={name:i.name,styles:i.styles,next:Ve},i=i.next;return o.styles+";"}return function(e,t,n){var a="";if(Array.isArray(n))for(var r=0;r<n.length;r++)a+=Re(e,t,n[r])+";";else for(var o in n){var i=n[o];if("object"!=typeof i){var s=i;null!=t&&void 0!==t[s]?a+=o+"{"+t[s]+"}":Pe(s)&&(a+=Me(o)+":"+Fe(o,s)+";")}else if(!Array.isArray(i)||"string"!=typeof i[0]||null!=t&&void 0!==t[i[0]]){var l=Re(e,t,i);switch(o){case"animation":case"animationName":a+=Me(o)+":"+l+";";break;default:a+=o+"{"+l+"}"}}else for(var c=0;c<i.length;c++)Pe(i[c])&&(a+=Me(o)+":"+Fe(o,i[c])+";")}return a}(e,t,n);case"function":if(void 0!==e){var s=Ve,l=n(e);return Ve=s,Re(e,t,l)}}var c=n;if(null==t)return c;var u=t[c];return void 0!==u?u:c}var Ve,Ne=/label:\s*([^\s;{]+)\s*(;|$)/g;function Le(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var a=!0,r="";Ve=void 0;var o=e[0];null==o||void 0===o.raw?(a=!1,r+=Re(n,t,o)):r+=o[0];for(var i=1;i<e.length;i++)r+=Re(n,t,e[i]),a&&(r+=o[i]);Ne.lastIndex=0;for(var s,l="";null!==(s=Ne.exec(r));)l+="-"+s[1];var c=function(e){for(var t,n=0,a=0,r=e.length;r>=4;++a,r-=4)t=1540483477*(65535&(t=255&e.charCodeAt(a)|(255&e.charCodeAt(++a))<<8|(255&e.charCodeAt(++a))<<16|(255&e.charCodeAt(++a))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(r){case 3:n^=(255&e.charCodeAt(a+2))<<16;case 2:n^=(255&e.charCodeAt(a+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(a)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(r)+l;return{name:c,styles:r,next:Ve}}var Ae=!!o.useInsertionEffect&&o.useInsertionEffect,$e=Ae||function(e){return e()},Be=(Ae||o.useLayoutEffect,o.createContext("undefined"!=typeof HTMLElement?Se({key:"css"}):null)),He=(Be.Provider,function(e){return(0,o.forwardRef)(function(t,n){var a=(0,o.useContext)(Be);return e(t,a,n)})}),je=o.createContext({}),Ue={}.hasOwnProperty,ze="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",We=function(e){var t=e.cache,n=e.serialized,a=e.isStringTag;return ke(t,n,a),$e(function(){return function(e,t,n){ke(e,t,n);var a=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var r=t;do{e.insert(t===r?"."+a:"",r,e.sheet,!0),r=r.next}while(void 0!==r)}}(t,n,a)}),null},Ge=He(function(e,t,n){var a=e.css;"string"==typeof a&&void 0!==t.registered[a]&&(a=t.registered[a]);var r=e[ze],i=[a],s="";"string"==typeof e.className?s=function(e,t,n){var a="";return n.split(" ").forEach(function(n){void 0!==e[n]?t.push(e[n]+";"):n&&(a+=n+" ")}),a}(t.registered,i,e.className):null!=e.className&&(s=e.className+" ");var l=Le(i,void 0,o.useContext(je));s+=t.key+"-"+l.name;var c={};for(var u in e)Ue.call(e,u)&&"css"!==u&&u!==ze&&(c[u]=e[u]);return c.className=s,n&&(c.ref=n),o.createElement(o.Fragment,null,o.createElement(We,{cache:t,serialized:l,isStringTag:"string"==typeof r}),o.createElement(r,c))}),Ke=Ge;function qe(){return qe.c||(qe.c=n.t(r(),2))}a();var Ye,Xe,Ze=function(e,t){var n=arguments;if(null==t||!Ue.call(t,"css"))return o.createElement.apply(void 0,n);var a=n.length,r=new Array(a);r[0]=Ke,r[1]=function(e,t){var n={};for(var a in t)Ue.call(t,a)&&(n[a]=t[a]);return n[ze]=e,n}(e,t);for(var i=2;i<a;i++)r[i]=n[i];return o.createElement.apply(null,r)};function Je(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Le(t)}Ye=Ze||(Ze={}),Xe||(Xe=Ye.JSX||(Ye.JSX={}));const Qe=window.ReactDOM,et=Math.min,tt=Math.max,nt=Math.round,at=Math.floor,rt=e=>({x:e,y:e});function ot(){return"undefined"!=typeof window}function it(e){return ct(e)?(e.nodeName||"").toLowerCase():"#document"}function st(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function lt(e){var t;return null==(t=(ct(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ct(e){return!!ot()&&(e instanceof Node||e instanceof st(e).Node)}function ut(e){return!!ot()&&(e instanceof Element||e instanceof st(e).Element)}function dt(e){return!!ot()&&(e instanceof HTMLElement||e instanceof st(e).HTMLElement)}function ft(e){return!(!ot()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof st(e).ShadowRoot)}function pt(e){const{overflow:t,overflowX:n,overflowY:a,display:r}=mt(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+n)&&!["inline","contents"].includes(r)}function mt(e){return st(e).getComputedStyle(e)}function ht(e){const t=function(e){if("html"===it(e))return e;const t=e.assignedSlot||e.parentNode||ft(e)&&e.host||lt(e);return ft(t)?t.host:t}(e);return function(e){return["html","body","#document"].includes(it(e))}(t)?e.ownerDocument?e.ownerDocument.body:e.body:dt(t)&&pt(t)?t:ht(t)}function gt(e,t,n){var a;void 0===t&&(t=[]),void 0===n&&(n=!0);const r=ht(e),o=r===(null==(a=e.ownerDocument)?void 0:a.body),i=st(r);if(o){const e=vt(i);return t.concat(i,i.visualViewport||[],pt(r)?r:[],e&&n?gt(e):[])}return t.concat(r,gt(r,[],n))}function vt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function bt(e){return ut(e)?e:e.contextElement}function yt(e){const t=bt(e);if(!dt(t))return rt(1);const n=t.getBoundingClientRect(),{width:a,height:r,$:o}=function(e){const t=mt(e);let n=parseFloat(t.width)||0,a=parseFloat(t.height)||0;const r=dt(e),o=r?e.offsetWidth:n,i=r?e.offsetHeight:a,s=nt(n)!==o||nt(a)!==i;return s&&(n=o,a=i),{width:n,height:a,$:s}}(t);let i=(o?nt(n.width):n.width)/a,s=(o?nt(n.height):n.height)/r;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const wt=rt(0);function Ct(e){const t=st(e);return"undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:wt}function Et(e,t,n,a){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),o=bt(e);let i=rt(1);t&&(a?ut(a)&&(i=yt(a)):i=yt(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==st(e))&&t}(o,n,a)?Ct(o):rt(0);let l=(r.left+s.x)/i.x,c=(r.top+s.y)/i.y,u=r.width/i.x,d=r.height/i.y;if(o){const e=st(o),t=a&&ut(a)?st(a):a;let n=e,r=vt(n);for(;r&&a&&t!==n;){const e=yt(r),t=r.getBoundingClientRect(),a=mt(r),o=t.left+(r.clientLeft+parseFloat(a.paddingLeft))*e.x,i=t.top+(r.clientTop+parseFloat(a.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=o,c+=i,n=st(r),r=vt(n)}}return function(e){const{x:t,y:n,width:a,height:r}=e;return{width:a,height:r,top:n,left:t,right:t+a,bottom:n+r,x:t,y:n}}({width:u,height:d,x:l,y:c})}function Ot(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}var St=o.useLayoutEffect,kt=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],_t=function(){};function Tt(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}function xt(e,t){for(var n=arguments.length,a=new Array(n>2?n-2:0),r=2;r<n;r++)a[r-2]=arguments[r];var o=[].concat(a);if(t&&e)for(var i in t)t.hasOwnProperty(i)&&t[i]&&o.push("".concat(Tt(e,i)));return o.filter(function(e){return e}).map(function(e){return String(e).trim()}).join(" ")}var It=function(e){return t=e,Array.isArray(t)?e.filter(Boolean):"object"===l(e)&&null!==e?[e]:[];var t},Dt=function(e){return e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme,f({},g(e,kt))},Pt=function(e,t,n){var a=e.cx,r=e.getStyles,o=e.getClassNames,i=e.className;return{css:r(t,e),className:a(null!=n?n:{},o(t,e),i)}};function Mt(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function Ft(e){return Mt(e)?window.pageYOffset:e.scrollTop}function Rt(e,t){Mt(e)?window.scrollTo(0,t):e.scrollTop=t}function Vt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:_t,r=Ft(e),o=t-r,i=0;!function t(){var s,l=o*((s=(s=i+=10)/n-1)*s*s+1)+r;Rt(e,l),i<n?window.requestAnimationFrame(t):a(e)}()}function Nt(e,t){var n=e.getBoundingClientRect(),a=t.getBoundingClientRect(),r=t.offsetHeight/3;a.bottom+r>n.bottom?Rt(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+r,e.scrollHeight)):a.top-r<n.top&&Rt(e,Math.max(t.offsetTop-r,0))}function Lt(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}var At=!1,$t={get passive(){return At=!0}},Bt="undefined"!=typeof window?window:{};Bt.addEventListener&&Bt.removeEventListener&&(Bt.addEventListener("p",_t,$t),Bt.removeEventListener("p",_t,!1));var Ht=At;function jt(e){return null!=e}function Ut(e,t,n){return e?t:n}var zt=["children","innerProps"],Wt=["children","innerProps"];var Gt,Kt,qt,Yt=function(e){return"auto"===e?"bottom":e},Xt=(0,o.createContext)(null),Zt=function(e){var t=e.children,n=e.minMenuHeight,a=e.maxMenuHeight,r=e.menuPlacement,i=e.menuPosition,s=e.menuShouldScrollIntoView,l=e.theme,c=((0,o.useContext)(Xt)||{}).setPortalPlacement,u=(0,o.useRef)(null),d=h((0,o.useState)(a),2),p=d[0],m=d[1],g=h((0,o.useState)(null),2),v=g[0],b=g[1],y=l.spacing.controlHeight;return St(function(){var e=u.current;if(e){var t="fixed"===i,o=function(e){var t=e.maxHeight,n=e.menuEl,a=e.minHeight,r=e.placement,o=e.shouldScroll,i=e.isFixedPosition,s=e.controlHeight,l=function(e){var t=getComputedStyle(e),n="absolute"===t.position,a=/(auto|scroll)/;if("fixed"===t.position)return document.documentElement;for(var r=e;r=r.parentElement;)if(t=getComputedStyle(r),(!n||"static"!==t.position)&&a.test(t.overflow+t.overflowY+t.overflowX))return r;return document.documentElement}(n),c={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return c;var u,d=l.getBoundingClientRect().height,f=n.getBoundingClientRect(),p=f.bottom,m=f.height,h=f.top,g=n.offsetParent.getBoundingClientRect().top,v=i||Mt(u=l)?window.innerHeight:u.clientHeight,b=Ft(l),y=parseInt(getComputedStyle(n).marginBottom,10),w=parseInt(getComputedStyle(n).marginTop,10),C=g-w,E=v-h,O=C+b,S=d-b-h,k=p-v+b+y,_=b+h-w,T=160;switch(r){case"auto":case"bottom":if(E>=m)return{placement:"bottom",maxHeight:t};if(S>=m&&!i)return o&&Vt(l,k,T),{placement:"bottom",maxHeight:t};if(!i&&S>=a||i&&E>=a)return o&&Vt(l,k,T),{placement:"bottom",maxHeight:i?E-y:S-y};if("auto"===r||i){var x=t,I=i?C:O;return I>=a&&(x=Math.min(I-y-s,t)),{placement:"top",maxHeight:x}}if("bottom"===r)return o&&Rt(l,k),{placement:"bottom",maxHeight:t};break;case"top":if(C>=m)return{placement:"top",maxHeight:t};if(O>=m&&!i)return o&&Vt(l,_,T),{placement:"top",maxHeight:t};if(!i&&O>=a||i&&C>=a){var D=t;return(!i&&O>=a||i&&C>=a)&&(D=i?C-w:O-w),o&&Vt(l,_,T),{placement:"top",maxHeight:D}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(r,'".'))}return c}({maxHeight:a,menuEl:e,minHeight:n,placement:r,shouldScroll:s&&!t,isFixedPosition:t,controlHeight:y});m(o.maxHeight),b(o.placement),null==c||c(o.placement)}},[a,r,i,s,n,c,y]),t({ref:u,placerProps:f(f({},e),{},{placement:v||Yt(r),maxHeight:p})})},Jt=function(e,t){var n=e.theme,a=n.spacing.baseUnit,r=n.colors;return f({textAlign:"center"},t?{}:{color:r.neutral40,padding:"".concat(2*a,"px ").concat(3*a,"px")})},Qt=Jt,en=Jt,tn=["size"],nn=["innerProps","isRtl","size"],an={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},rn=function(e){var t=e.size,n=g(e,tn);return Ze("svg",b({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:an},n))},on=function(e){return Ze(rn,b({size:20},e),Ze("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},sn=function(e){return Ze(rn,b({size:20},e),Ze("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},ln=function(e,t){var n=e.isFocused,a=e.theme,r=a.spacing.baseUnit,o=a.colors;return f({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:n?o.neutral60:o.neutral20,padding:2*r,":hover":{color:n?o.neutral80:o.neutral40}})},cn=ln,un=ln,dn=function(){var e=Je.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}(Gt||(Kt=["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"],qt||(qt=Kt.slice(0)),Gt=Object.freeze(Object.defineProperties(Kt,{raw:{value:Object.freeze(qt)}})))),fn=function(e){var t=e.delay,n=e.offset;return Ze("span",{css:Je({animation:"".concat(dn," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},pn=["data"],mn=["innerRef","isDisabled","isHidden","inputClassName"],hn={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},gn={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":f({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},hn)},vn=function(e){return f({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},hn)},bn=function(e){var t=e.children,n=e.innerProps;return Ze("div",n,t)},yn={ClearIndicator:function(e){var t=e.children,n=e.innerProps;return Ze("div",b({},Pt(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),t||Ze(on,null))},Control:function(e){var t=e.children,n=e.isDisabled,a=e.isFocused,r=e.innerRef,o=e.innerProps,i=e.menuIsOpen;return Ze("div",b({ref:r},Pt(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":a,"control--menu-is-open":i}),o,{"aria-disabled":n||void 0}),t)},DropdownIndicator:function(e){var t=e.children,n=e.innerProps;return Ze("div",b({},Pt(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),t||Ze(sn,null))},DownChevron:sn,CrossIcon:on,Group:function(e){var t=e.children,n=e.cx,a=e.getStyles,r=e.getClassNames,o=e.Heading,i=e.headingProps,s=e.innerProps,l=e.label,c=e.theme,u=e.selectProps;return Ze("div",b({},Pt(e,"group",{group:!0}),s),Ze(o,b({},i,{selectProps:u,theme:c,getStyles:a,getClassNames:r,cx:n}),l),Ze("div",null,t))},GroupHeading:function(e){var t=Dt(e);t.data;var n=g(t,pn);return Ze("div",b({},Pt(e,"groupHeading",{"group-heading":!0}),n))},IndicatorsContainer:function(e){var t=e.children,n=e.innerProps;return Ze("div",b({},Pt(e,"indicatorsContainer",{indicators:!0}),n),t)},IndicatorSeparator:function(e){var t=e.innerProps;return Ze("span",b({},t,Pt(e,"indicatorSeparator",{"indicator-separator":!0})))},Input:function(e){var t=e.cx,n=e.value,a=Dt(e),r=a.innerRef,o=a.isDisabled,i=a.isHidden,s=a.inputClassName,l=g(a,mn);return Ze("div",b({},Pt(e,"input",{"input-container":!0}),{"data-value":n||""}),Ze("input",b({className:t({input:!0},s),ref:r,style:vn(i),disabled:o},l)))},LoadingIndicator:function(e){var t=e.innerProps,n=e.isRtl,a=e.size,r=void 0===a?4:a,o=g(e,nn);return Ze("div",b({},Pt(f(f({},o),{},{innerProps:t,isRtl:n,size:r}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),Ze(fn,{delay:0,offset:n}),Ze(fn,{delay:160,offset:!0}),Ze(fn,{delay:320,offset:!n}))},Menu:function(e){var t=e.children,n=e.innerRef,a=e.innerProps;return Ze("div",b({},Pt(e,"menu",{menu:!0}),{ref:n},a),t)},MenuList:function(e){var t=e.children,n=e.innerProps,a=e.innerRef,r=e.isMulti;return Ze("div",b({},Pt(e,"menuList",{"menu-list":!0,"menu-list--is-multi":r}),{ref:a},n),t)},MenuPortal:function(e){var t=e.appendTo,n=e.children,a=e.controlElement,r=e.innerProps,i=e.menuPlacement,s=e.menuPosition,l=(0,o.useRef)(null),c=(0,o.useRef)(null),u=h((0,o.useState)(Yt(i)),2),d=u[0],p=u[1],m=(0,o.useMemo)(function(){return{setPortalPlacement:p}},[]),g=h((0,o.useState)(null),2),v=g[0],y=g[1],w=(0,o.useCallback)(function(){if(a){var e=function(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}(a),t="fixed"===s?0:window.pageYOffset,n=e[d]+t;n===(null==v?void 0:v.offset)&&e.left===(null==v?void 0:v.rect.left)&&e.width===(null==v?void 0:v.rect.width)||y({offset:n,rect:e})}},[a,s,d,null==v?void 0:v.offset,null==v?void 0:v.rect.left,null==v?void 0:v.rect.width]);St(function(){w()},[w]);var C=(0,o.useCallback)(function(){"function"==typeof c.current&&(c.current(),c.current=null),a&&l.current&&(c.current=function(e,t,n,a){void 0===a&&(a={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=a,c=bt(e),u=r||o?[...c?gt(c):[],...gt(t)]:[];u.forEach(e=>{r&&e.addEventListener("scroll",n,{passive:!0}),o&&e.addEventListener("resize",n)});const d=c&&s?function(e,t){let n,a=null;const r=lt(e);function o(){var e;clearTimeout(n),null==(e=a)||e.disconnect(),a=null}return function i(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),o();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(s||t(),!f||!p)return;const m={rootMargin:-at(d)+"px "+-at(r.clientWidth-(u+f))+"px "+-at(r.clientHeight-(d+p))+"px "+-at(u)+"px",threshold:tt(0,et(1,l))||1};let h=!0;function g(t){const a=t[0].intersectionRatio;if(a!==l){if(!h)return i();a?i(!1,a):n=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==a||Ot(c,e.getBoundingClientRect())||i(),h=!1}try{a=new IntersectionObserver(g,{...m,root:r.ownerDocument})}catch(e){a=new IntersectionObserver(g,m)}a.observe(e)}(!0),o}(c,n):null;let f,p=-1,m=null;i&&(m=new ResizeObserver(e=>{let[a]=e;a&&a.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),n()}),c&&!l&&m.observe(c),m.observe(t));let h=l?Et(e):null;return l&&function t(){const a=Et(e);h&&!Ot(h,a)&&n(),h=a,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{r&&e.removeEventListener("scroll",n),o&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=m)||e.disconnect(),m=null,l&&cancelAnimationFrame(f)}}(a,l.current,w,{elementResize:"ResizeObserver"in window}))},[a,w]);St(function(){C()},[C]);var E=(0,o.useCallback)(function(e){l.current=e,C()},[C]);if(!t&&"fixed"!==s||!v)return null;var O=Ze("div",b({ref:E},Pt(f(f({},e),{},{offset:v.offset,position:s,rect:v.rect}),"menuPortal",{"menu-portal":!0}),r),n);return Ze(Xt.Provider,{value:m},t?(0,Qe.createPortal)(O,t):O)},LoadingMessage:function(e){var t=e.children,n=void 0===t?"Loading...":t,a=e.innerProps,r=g(e,Wt);return Ze("div",b({},Pt(f(f({},r),{},{children:n,innerProps:a}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),a),n)},NoOptionsMessage:function(e){var t=e.children,n=void 0===t?"No options":t,a=e.innerProps,r=g(e,zt);return Ze("div",b({},Pt(f(f({},r),{},{children:n,innerProps:a}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),a),n)},MultiValue:function(e){var t=e.children,n=e.components,a=e.data,r=e.innerProps,o=e.isDisabled,i=e.removeProps,s=e.selectProps,l=n.Container,c=n.Label,u=n.Remove;return Ze(l,{data:a,innerProps:f(f({},Pt(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":o})),r),selectProps:s},Ze(c,{data:a,innerProps:f({},Pt(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:s},t),Ze(u,{data:a,innerProps:f(f({},Pt(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},i),selectProps:s}))},MultiValueContainer:bn,MultiValueLabel:bn,MultiValueRemove:function(e){var t=e.children,n=e.innerProps;return Ze("div",b({role:"button"},n),t||Ze(on,{size:14}))},Option:function(e){var t=e.children,n=e.isDisabled,a=e.isFocused,r=e.isSelected,o=e.innerRef,i=e.innerProps;return Ze("div",b({},Pt(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":a,"option--is-selected":r}),{ref:o,"aria-disabled":n},i),t)},Placeholder:function(e){var t=e.children,n=e.innerProps;return Ze("div",b({},Pt(e,"placeholder",{placeholder:!0}),n),t)},SelectContainer:function(e){var t=e.children,n=e.innerProps,a=e.isDisabled,r=e.isRtl;return Ze("div",b({},Pt(e,"container",{"--is-disabled":a,"--is-rtl":r}),n),t)},SingleValue:function(e){var t=e.children,n=e.isDisabled,a=e.innerProps;return Ze("div",b({},Pt(e,"singleValue",{"single-value":!0,"single-value--is-disabled":n}),a),t)},ValueContainer:function(e){var t=e.children,n=e.innerProps,a=e.isMulti,r=e.hasValue;return Ze("div",b({},Pt(e,"valueContainer",{"value-container":!0,"value-container--is-multi":a,"value-container--has-value":r}),n),t)}},wn=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function Cn(e,t){return e===t||!(!wn(e)||!wn(t))}function En(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Cn(e[n],t[n]))return!1;return!0}for(var On={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},Sn=function(e){return Ze("span",b({css:On},e))},kn={guidance:function(e){var t=e.isSearchable,n=e.isMulti,a=e.tabSelectsValue,r=e.context,o=e.isInitialFocus;switch(r){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(a?", press Tab to select the option and exit the menu":"",".");case"input":return o?"".concat(e["aria-label"]||"Select"," is focused ").concat(t?",type to refine list":"",", press Down to open the menu, ").concat(n?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var t=e.action,n=e.label,a=void 0===n?"":n,r=e.labels,o=e.isDisabled;switch(t){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(a,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(r.length>1?"s":""," ").concat(r.join(","),", selected.");case"select-option":return"option ".concat(a,o?" is disabled. Select another option.":", selected.");default:return""}},onFocus:function(e){var t=e.context,n=e.focused,a=e.options,r=e.label,o=void 0===r?"":r,i=e.selectValue,s=e.isDisabled,l=e.isSelected,c=e.isAppleDevice,u=function(e,t){return e&&e.length?"".concat(e.indexOf(t)+1," of ").concat(e.length):""};if("value"===t&&i)return"value ".concat(o," focused, ").concat(u(i,n),".");if("menu"===t&&c){var d=s?" disabled":"",f="".concat(l?" selected":"").concat(d);return"".concat(o).concat(f,", ").concat(u(a,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},Tn=function(e){var t=e.ariaSelection,n=e.focusedOption,a=e.focusedValue,r=e.focusableOptions,i=e.isFocused,s=e.selectValue,l=e.selectProps,c=e.id,u=e.isAppleDevice,d=l.ariaLiveMessages,p=l.getOptionLabel,m=l.inputValue,h=l.isMulti,g=l.isOptionDisabled,v=l.isSearchable,b=l.menuIsOpen,y=l.options,w=l.screenReaderStatus,C=l.tabSelectsValue,E=l.isLoading,O=l["aria-label"],S=l["aria-live"],k=(0,o.useMemo)(function(){return f(f({},kn),d||{})},[d]),_=(0,o.useMemo)(function(){var e,n="";if(t&&k.onChange){var a=t.option,r=t.options,o=t.removedValue,i=t.removedValues,l=t.value,c=o||a||(e=l,Array.isArray(e)?null:e),u=c?p(c):"",d=r||i||void 0,m=d?d.map(p):[],h=f({isDisabled:c&&g(c,s),label:u,labels:m},t);n=k.onChange(h)}return n},[t,k,g,s,p]),T=(0,o.useMemo)(function(){var e="",t=n||a,o=!!(n&&s&&s.includes(n));if(t&&k.onFocus){var i={focused:t,label:p(t),isDisabled:g(t,s),isSelected:o,options:r,context:t===n?"menu":"value",selectValue:s,isAppleDevice:u};e=k.onFocus(i)}return e},[n,a,p,g,k,r,s,u]),x=(0,o.useMemo)(function(){var e="";if(b&&y.length&&!E&&k.onFilter){var t=w({count:r.length});e=k.onFilter({inputValue:m,resultsMessage:t})}return e},[r,m,b,k,y,w,E]),I="initial-input-focus"===(null==t?void 0:t.action),D=(0,o.useMemo)(function(){var e="";if(k.guidance){var t=a?"value":b?"menu":"input";e=k.guidance({"aria-label":O,context:t,isDisabled:n&&g(n,s),isMulti:h,isSearchable:v,tabSelectsValue:C,isInitialFocus:I})}return e},[O,n,a,h,g,v,b,k,s,C,I]),P=Ze(o.Fragment,null,Ze("span",{id:"aria-selection"},_),Ze("span",{id:"aria-focused"},T),Ze("span",{id:"aria-results"},x),Ze("span",{id:"aria-guidance"},D));return Ze(o.Fragment,null,Ze(Sn,{id:c},I&&P),Ze(Sn,{"aria-live":S,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},i&&!I&&P))},xn=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],In=new RegExp("["+xn.map(function(e){return e.letters}).join("")+"]","g"),Dn={},Pn=0;Pn<xn.length;Pn++)for(var Mn=xn[Pn],Fn=0;Fn<Mn.letters.length;Fn++)Dn[Mn.letters[Fn]]=Mn.base;var Rn=function(e){return e.replace(In,function(e){return Dn[e]})},Vn=function(e,t){void 0===t&&(t=En);var n=null;function a(){for(var a=[],r=0;r<arguments.length;r++)a[r]=arguments[r];if(n&&n.lastThis===this&&t(a,n.lastArgs))return n.lastResult;var o=e.apply(this,a);return n={lastResult:o,lastArgs:a,lastThis:this},o}return a.clear=function(){n=null},a}(Rn),Nn=function(e){return e.replace(/^\s+|\s+$/g,"")},Ln=function(e){return"".concat(e.label," ").concat(e.value)},An=["innerRef"];function $n(e){var t=e.innerRef,n=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];var r=Object.entries(e).filter(function(e){var t=h(e,1)[0];return!n.includes(t)});return r.reduce(function(e,t){var n=h(t,2),a=n[0],r=n[1];return e[a]=r,e},{})}(g(e,An),"onExited","in","enter","exit","appear");return Ze("input",b({ref:t},n,{css:Je({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var Bn=["boxSizing","height","overflow","paddingRight","position"],Hn={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function jn(e){e.cancelable&&e.preventDefault()}function Un(e){e.stopPropagation()}function zn(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;0===e?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function Wn(){return"ontouchstart"in window||navigator.maxTouchPoints}var Gn=!("undefined"==typeof window||!window.document||!window.document.createElement),Kn=0,qn={capture:!1,passive:!1},Yn=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},Xn={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function Zn(e){var t=e.children,n=e.lockEnabled,a=e.captureEnabled,r=function(e){var t=e.isEnabled,n=e.onBottomArrive,a=e.onBottomLeave,r=e.onTopArrive,i=e.onTopLeave,s=(0,o.useRef)(!1),l=(0,o.useRef)(!1),c=(0,o.useRef)(0),u=(0,o.useRef)(null),d=(0,o.useCallback)(function(e,t){if(null!==u.current){var o=u.current,c=o.scrollTop,d=o.scrollHeight,f=o.clientHeight,p=u.current,m=t>0,h=d-f-c,g=!1;h>t&&s.current&&(a&&a(e),s.current=!1),m&&l.current&&(i&&i(e),l.current=!1),m&&t>h?(n&&!s.current&&n(e),p.scrollTop=d,g=!0,s.current=!0):!m&&-t>c&&(r&&!l.current&&r(e),p.scrollTop=0,g=!0,l.current=!0),g&&function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()}(e)}},[n,a,r,i]),f=(0,o.useCallback)(function(e){d(e,e.deltaY)},[d]),p=(0,o.useCallback)(function(e){c.current=e.changedTouches[0].clientY},[]),m=(0,o.useCallback)(function(e){var t=c.current-e.changedTouches[0].clientY;d(e,t)},[d]),h=(0,o.useCallback)(function(e){if(e){var t=!!Ht&&{passive:!1};e.addEventListener("wheel",f,t),e.addEventListener("touchstart",p,t),e.addEventListener("touchmove",m,t)}},[m,p,f]),g=(0,o.useCallback)(function(e){e&&(e.removeEventListener("wheel",f,!1),e.removeEventListener("touchstart",p,!1),e.removeEventListener("touchmove",m,!1))},[m,p,f]);return(0,o.useEffect)(function(){if(t){var e=u.current;return h(e),function(){g(e)}}},[t,h,g]),function(e){u.current=e}}({isEnabled:void 0===a||a,onBottomArrive:e.onBottomArrive,onBottomLeave:e.onBottomLeave,onTopArrive:e.onTopArrive,onTopLeave:e.onTopLeave}),i=function(e){var t=e.isEnabled,n=e.accountForScrollbars,a=void 0===n||n,r=(0,o.useRef)({}),i=(0,o.useRef)(null),s=(0,o.useCallback)(function(e){if(Gn){var t=document.body,n=t&&t.style;if(a&&Bn.forEach(function(e){var t=n&&n[e];r.current[e]=t}),a&&Kn<1){var o=parseInt(r.current.paddingRight,10)||0,i=document.body?document.body.clientWidth:0,s=window.innerWidth-i+o||0;Object.keys(Hn).forEach(function(e){var t=Hn[e];n&&(n[e]=t)}),n&&(n.paddingRight="".concat(s,"px"))}t&&Wn()&&(t.addEventListener("touchmove",jn,qn),e&&(e.addEventListener("touchstart",zn,qn),e.addEventListener("touchmove",Un,qn))),Kn+=1}},[a]),l=(0,o.useCallback)(function(e){if(Gn){var t=document.body,n=t&&t.style;Kn=Math.max(Kn-1,0),a&&Kn<1&&Bn.forEach(function(e){var t=r.current[e];n&&(n[e]=t)}),t&&Wn()&&(t.removeEventListener("touchmove",jn,qn),e&&(e.removeEventListener("touchstart",zn,qn),e.removeEventListener("touchmove",Un,qn)))}},[a]);return(0,o.useEffect)(function(){if(t){var e=i.current;return s(e),function(){l(e)}}},[t,s,l]),function(e){i.current=e}}({isEnabled:n});return Ze(o.Fragment,null,n&&Ze("div",{onClick:Yn,css:Xn}),t(function(e){r(e),i(e)}))}var Jn={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Qn=function(e){var t=e.name,n=e.onFocus;return Ze("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:n,css:Jn,value:"",onChange:function(){}})};function ea(e){var t;return"undefined"!=typeof window&&null!=window.navigator&&e.test((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.platform)||window.navigator.platform)}function ta(){return ea(/^Mac/i)}var na={clearIndicator:un,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},control:function(e,t){var n=e.isDisabled,a=e.isFocused,r=e.theme,o=r.colors,i=r.borderRadius;return f({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:r.spacing.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:n?o.neutral5:o.neutral0,borderColor:n?o.neutral10:a?o.primary:o.neutral20,borderRadius:i,borderStyle:"solid",borderWidth:1,boxShadow:a?"0 0 0 1px ".concat(o.primary):void 0,"&:hover":{borderColor:a?o.primary:o.neutral30}})},dropdownIndicator:cn,group:function(e,t){var n=e.theme.spacing;return t?{}:{paddingBottom:2*n.baseUnit,paddingTop:2*n.baseUnit}},groupHeading:function(e,t){var n=e.theme,a=n.colors,r=n.spacing;return f({label:"group",cursor:"default",display:"block"},t?{}:{color:a.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*r.baseUnit,paddingRight:3*r.baseUnit,textTransform:"uppercase"})},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e,t){var n=e.isDisabled,a=e.theme,r=a.spacing.baseUnit,o=a.colors;return f({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:n?o.neutral10:o.neutral20,marginBottom:2*r,marginTop:2*r})},input:function(e,t){var n=e.isDisabled,a=e.value,r=e.theme,o=r.spacing,i=r.colors;return f(f({visibility:n?"hidden":"visible",transform:a?"translateZ(0)":""},gn),t?{}:{margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,color:i.neutral80})},loadingIndicator:function(e,t){var n=e.isFocused,a=e.size,r=e.theme,o=r.colors,i=r.spacing.baseUnit;return f({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:a,lineHeight:1,marginRight:a,textAlign:"center",verticalAlign:"middle"},t?{}:{color:n?o.neutral60:o.neutral20,padding:2*i})},loadingMessage:en,menu:function(e,t){var n,a=e.placement,r=e.theme,o=r.borderRadius,i=r.spacing,s=r.colors;return f((u(n={label:"menu"},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(a),"100%"),u(n,"position","absolute"),u(n,"width","100%"),u(n,"zIndex",1),n),t?{}:{backgroundColor:s.neutral0,borderRadius:o,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:i.menuGutter,marginTop:i.menuGutter})},menuList:function(e,t){var n=e.maxHeight,a=e.theme.spacing.baseUnit;return f({maxHeight:n,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:a,paddingTop:a})},menuPortal:function(e){var t=e.rect,n=e.offset,a=e.position;return{left:t.left,position:a,top:n,width:t.width,zIndex:1}},multiValue:function(e,t){var n=e.theme,a=n.spacing,r=n.borderRadius,o=n.colors;return f({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:o.neutral10,borderRadius:r/2,margin:a.baseUnit/2})},multiValueLabel:function(e,t){var n=e.theme,a=n.borderRadius,r=n.colors,o=e.cropWithEllipsis;return f({overflow:"hidden",textOverflow:o||void 0===o?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:a/2,color:r.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},multiValueRemove:function(e,t){var n=e.theme,a=n.spacing,r=n.borderRadius,o=n.colors,i=e.isFocused;return f({alignItems:"center",display:"flex"},t?{}:{borderRadius:r/2,backgroundColor:i?o.dangerLight:void 0,paddingLeft:a.baseUnit,paddingRight:a.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}})},noOptionsMessage:Qt,option:function(e,t){var n=e.isDisabled,a=e.isFocused,r=e.isSelected,o=e.theme,i=o.spacing,s=o.colors;return f({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:r?s.primary:a?s.primary25:"transparent",color:n?s.neutral20:r?s.neutral0:"inherit",padding:"".concat(2*i.baseUnit,"px ").concat(3*i.baseUnit,"px"),":active":{backgroundColor:n?void 0:r?s.primary:s.primary50}})},placeholder:function(e,t){var n=e.theme,a=n.spacing,r=n.colors;return f({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:r.neutral50,marginLeft:a.baseUnit/2,marginRight:a.baseUnit/2})},singleValue:function(e,t){var n=e.isDisabled,a=e.theme,r=a.spacing,o=a.colors;return f({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:n?o.neutral40:o.neutral80,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},valueContainer:function(e,t){var n=e.theme.spacing,a=e.isMulti,r=e.hasValue,o=e.selectProps.controlShouldRenderValue;return f({alignItems:"center",display:a&&r&&o?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(n.baseUnit/2,"px ").concat(2*n.baseUnit,"px")})}},aa={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},ra={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Lt(),captureMenuScroll:!Lt(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var n=f({ignoreCase:!0,ignoreAccents:!0,stringify:Ln,trim:!0,matchFrom:"any"},void 0),a=n.ignoreCase,r=n.ignoreAccents,o=n.stringify,i=n.trim,s=n.matchFrom,l=i?Nn(t):t,c=i?Nn(o(e)):o(e);return a&&(l=l.toLowerCase(),c=c.toLowerCase()),r&&(l=Vn(l),c=Rn(c)),"start"===s?c.substr(0,l.length)===l:c.indexOf(l)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function oa(e,t,n,a){return{type:"option",data:t,isDisabled:pa(e,t,n),isSelected:ma(e,t,n),label:da(e,t),value:fa(e,t),index:a}}function ia(e,t){return e.options.map(function(n,a){if("options"in n){var r=n.options.map(function(n,a){return oa(e,n,t,a)}).filter(function(t){return ca(e,t)});return r.length>0?{type:"group",data:n,options:r,index:a}:void 0}var o=oa(e,n,t,a);return ca(e,o)?o:void 0}).filter(jt)}function sa(e){return e.reduce(function(e,t){return"group"===t.type?e.push.apply(e,O(t.options.map(function(e){return e.data}))):e.push(t.data),e},[])}function la(e,t){return e.reduce(function(e,n){return"group"===n.type?e.push.apply(e,O(n.options.map(function(e){return{data:e.data,id:"".concat(t,"-").concat(n.index,"-").concat(e.index)}}))):e.push({data:n.data,id:"".concat(t,"-").concat(n.index)}),e},[])}function ca(e,t){var n=e.inputValue,a=void 0===n?"":n,r=t.data,o=t.isSelected,i=t.label,s=t.value;return(!ga(e)||!o)&&ha(e,{label:i,value:s,data:r},a)}var ua=function(e,t){var n;return(null===(n=e.find(function(e){return e.data===t}))||void 0===n?void 0:n.id)||null},da=function(e,t){return e.getOptionLabel(t)},fa=function(e,t){return e.getOptionValue(t)};function pa(e,t,n){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,n)}function ma(e,t,n){if(n.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,n);var a=fa(e,t);return n.some(function(t){return fa(e,t)===a})}function ha(e,t,n){return!e.filterOption||e.filterOption(t,n)}var ga=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return void 0===t?n:t},va=1,ba=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&w(e,t)}(n,e);var t=function(e){var t=E();return function(){var n,a=C(e);if(t){var r=C(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return function(e,t){if(t&&("object"==l(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}(n);function n(e){var a;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(a=t.call(this,e)).state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},a.blockOptionHover=!1,a.isComposing=!1,a.commonProps=void 0,a.initialTouchX=0,a.initialTouchY=0,a.openAfterFocus=!1,a.scrollToFocusedOptionOnUpdate=!1,a.userIsDragging=void 0,a.isAppleDevice=ta()||ea(/^iPhone/i)||ea(/^iPad/i)||ta()&&navigator.maxTouchPoints>1,a.controlRef=null,a.getControlRef=function(e){a.controlRef=e},a.focusedOptionRef=null,a.getFocusedOptionRef=function(e){a.focusedOptionRef=e},a.menuListRef=null,a.getMenuListRef=function(e){a.menuListRef=e},a.inputRef=null,a.getInputRef=function(e){a.inputRef=e},a.focus=a.focusInput,a.blur=a.blurInput,a.onChange=function(e,t){var n=a.props,r=n.onChange,o=n.name;t.name=o,a.ariaOnChange(e,t),r(e,t)},a.setValue=function(e,t,n){var r=a.props,o=r.closeMenuOnSelect,i=r.isMulti,s=r.inputValue;a.onInputChange("",{action:"set-value",prevInputValue:s}),o&&(a.setState({inputIsHiddenAfterUpdate:!i}),a.onMenuClose()),a.setState({clearFocusValueOnUpdate:!0}),a.onChange(e,{action:t,option:n})},a.selectOption=function(e){var t=a.props,n=t.blurInputOnSelect,r=t.isMulti,o=t.name,i=a.state.selectValue,s=r&&a.isOptionSelected(e,i),l=a.isOptionDisabled(e,i);if(s){var c=a.getOptionValue(e);a.setValue(i.filter(function(e){return a.getOptionValue(e)!==c}),"deselect-option",e)}else{if(l)return void a.ariaOnChange(e,{action:"select-option",option:e,name:o});r?a.setValue([].concat(O(i),[e]),"select-option",e):a.setValue(e,"select-option")}n&&a.blurInput()},a.removeValue=function(e){var t=a.props.isMulti,n=a.state.selectValue,r=a.getOptionValue(e),o=n.filter(function(e){return a.getOptionValue(e)!==r}),i=Ut(t,o,o[0]||null);a.onChange(i,{action:"remove-value",removedValue:e}),a.focusInput()},a.clearValue=function(){var e=a.state.selectValue;a.onChange(Ut(a.props.isMulti,[],null),{action:"clear",removedValues:e})},a.popValue=function(){var e=a.props.isMulti,t=a.state.selectValue,n=t[t.length-1],r=t.slice(0,t.length-1),o=Ut(e,r,r[0]||null);n&&a.onChange(o,{action:"pop-value",removedValue:n})},a.getFocusedOptionId=function(e){return ua(a.state.focusableOptionsWithIds,e)},a.getFocusableOptionsWithIds=function(){return la(ia(a.props,a.state.selectValue),a.getElementId("option"))},a.getValue=function(){return a.state.selectValue},a.cx=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return xt.apply(void 0,[a.props.classNamePrefix].concat(t))},a.getOptionLabel=function(e){return da(a.props,e)},a.getOptionValue=function(e){return fa(a.props,e)},a.getStyles=function(e,t){var n=a.props.unstyled,r=na[e](t,n);r.boxSizing="border-box";var o=a.props.styles[e];return o?o(r,t):r},a.getClassNames=function(e,t){var n,r;return null===(n=(r=a.props.classNames)[e])||void 0===n?void 0:n.call(r,t)},a.getElementId=function(e){return"".concat(a.state.instancePrefix,"-").concat(e)},a.getComponents=function(){return e=a.props,f(f({},yn),e.components);var e},a.buildCategorizedOptions=function(){return ia(a.props,a.state.selectValue)},a.getCategorizedOptions=function(){return a.props.menuIsOpen?a.buildCategorizedOptions():[]},a.buildFocusableOptions=function(){return sa(a.buildCategorizedOptions())},a.getFocusableOptions=function(){return a.props.menuIsOpen?a.buildFocusableOptions():[]},a.ariaOnChange=function(e,t){a.setState({ariaSelection:f({value:e},t)})},a.onMenuMouseDown=function(e){0===e.button&&(e.stopPropagation(),e.preventDefault(),a.focusInput())},a.onMenuMouseMove=function(e){a.blockOptionHover=!1},a.onControlMouseDown=function(e){if(!e.defaultPrevented){var t=a.props.openMenuOnClick;a.state.isFocused?a.props.menuIsOpen?"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&a.onMenuClose():t&&a.openMenu("first"):(t&&(a.openAfterFocus=!0),a.focusInput()),"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&e.preventDefault()}},a.onDropdownIndicatorMouseDown=function(e){if(!(e&&"mousedown"===e.type&&0!==e.button||a.props.isDisabled)){var t=a.props,n=t.isMulti,r=t.menuIsOpen;a.focusInput(),r?(a.setState({inputIsHiddenAfterUpdate:!n}),a.onMenuClose()):a.openMenu("first"),e.preventDefault()}},a.onClearIndicatorMouseDown=function(e){e&&"mousedown"===e.type&&0!==e.button||(a.clearValue(),e.preventDefault(),a.openAfterFocus=!1,"touchend"===e.type?a.focusInput():setTimeout(function(){return a.focusInput()}))},a.onScroll=function(e){"boolean"==typeof a.props.closeMenuOnScroll?e.target instanceof HTMLElement&&Mt(e.target)&&a.props.onMenuClose():"function"==typeof a.props.closeMenuOnScroll&&a.props.closeMenuOnScroll(e)&&a.props.onMenuClose()},a.onCompositionStart=function(){a.isComposing=!0},a.onCompositionEnd=function(){a.isComposing=!1},a.onTouchStart=function(e){var t=e.touches,n=t&&t.item(0);n&&(a.initialTouchX=n.clientX,a.initialTouchY=n.clientY,a.userIsDragging=!1)},a.onTouchMove=function(e){var t=e.touches,n=t&&t.item(0);if(n){var r=Math.abs(n.clientX-a.initialTouchX),o=Math.abs(n.clientY-a.initialTouchY);a.userIsDragging=r>5||o>5}},a.onTouchEnd=function(e){a.userIsDragging||(a.controlRef&&!a.controlRef.contains(e.target)&&a.menuListRef&&!a.menuListRef.contains(e.target)&&a.blurInput(),a.initialTouchX=0,a.initialTouchY=0)},a.onControlTouchEnd=function(e){a.userIsDragging||a.onControlMouseDown(e)},a.onClearIndicatorTouchEnd=function(e){a.userIsDragging||a.onClearIndicatorMouseDown(e)},a.onDropdownIndicatorTouchEnd=function(e){a.userIsDragging||a.onDropdownIndicatorMouseDown(e)},a.handleInputChange=function(e){var t=a.props.inputValue,n=e.currentTarget.value;a.setState({inputIsHiddenAfterUpdate:!1}),a.onInputChange(n,{action:"input-change",prevInputValue:t}),a.props.menuIsOpen||a.onMenuOpen()},a.onInputFocus=function(e){a.props.onFocus&&a.props.onFocus(e),a.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(a.openAfterFocus||a.props.openMenuOnFocus)&&a.openMenu("first"),a.openAfterFocus=!1},a.onInputBlur=function(e){var t=a.props.inputValue;a.menuListRef&&a.menuListRef.contains(document.activeElement)?a.inputRef.focus():(a.props.onBlur&&a.props.onBlur(e),a.onInputChange("",{action:"input-blur",prevInputValue:t}),a.onMenuClose(),a.setState({focusedValue:null,isFocused:!1}))},a.onOptionHover=function(e){if(!a.blockOptionHover&&a.state.focusedOption!==e){var t=a.getFocusableOptions().indexOf(e);a.setState({focusedOption:e,focusedOptionId:t>-1?a.getFocusedOptionId(e):null})}},a.shouldHideSelectedOptions=function(){return ga(a.props)},a.onValueInputFocus=function(e){e.preventDefault(),e.stopPropagation(),a.focus()},a.onKeyDown=function(e){var t=a.props,n=t.isMulti,r=t.backspaceRemovesValue,o=t.escapeClearsValue,i=t.inputValue,s=t.isClearable,l=t.isDisabled,c=t.menuIsOpen,u=t.onKeyDown,d=t.tabSelectsValue,f=t.openMenuOnFocus,p=a.state,m=p.focusedOption,h=p.focusedValue,g=p.selectValue;if(!(l||"function"==typeof u&&(u(e),e.defaultPrevented))){switch(a.blockOptionHover=!0,e.key){case"ArrowLeft":if(!n||i)return;a.focusValue("previous");break;case"ArrowRight":if(!n||i)return;a.focusValue("next");break;case"Delete":case"Backspace":if(i)return;if(h)a.removeValue(h);else{if(!r)return;n?a.popValue():s&&a.clearValue()}break;case"Tab":if(a.isComposing)return;if(e.shiftKey||!c||!d||!m||f&&a.isOptionSelected(m,g))return;a.selectOption(m);break;case"Enter":if(229===e.keyCode)break;if(c){if(!m)return;if(a.isComposing)return;a.selectOption(m);break}return;case"Escape":c?(a.setState({inputIsHiddenAfterUpdate:!1}),a.onInputChange("",{action:"menu-close",prevInputValue:i}),a.onMenuClose()):s&&o&&a.clearValue();break;case" ":if(i)return;if(!c){a.openMenu("first");break}if(!m)return;a.selectOption(m);break;case"ArrowUp":c?a.focusOption("up"):a.openMenu("last");break;case"ArrowDown":c?a.focusOption("down"):a.openMenu("first");break;case"PageUp":if(!c)return;a.focusOption("pageup");break;case"PageDown":if(!c)return;a.focusOption("pagedown");break;case"Home":if(!c)return;a.focusOption("first");break;case"End":if(!c)return;a.focusOption("last");break;default:return}e.preventDefault()}},a.state.instancePrefix="react-select-"+(a.props.instanceId||++va),a.state.selectValue=It(e.value),e.menuIsOpen&&a.state.selectValue.length){var r=a.getFocusableOptionsWithIds(),o=a.buildFocusableOptions(),i=o.indexOf(a.state.selectValue[0]);a.state.focusableOptionsWithIds=r,a.state.focusedOption=o[i],a.state.focusedOptionId=ua(r,o[i])}return a}return function(e,t,n){t&&y(e.prototype,t),n&&y(e,n),Object.defineProperty(e,"prototype",{writable:!1})}(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Nt(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.isDisabled,a=t.menuIsOpen,r=this.state.isFocused;(r&&!n&&e.isDisabled||r&&a&&!e.menuIsOpen)&&this.focusInput(),r&&n&&!e.isDisabled?this.setState({isFocused:!1},this.onMenuClose):r||n||!e.isDisabled||this.inputRef!==document.activeElement||this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Nt(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(e,t){this.props.onInputChange(e,t)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(e){var t=this,n=this.state,a=n.selectValue,r=n.isFocused,o=this.buildFocusableOptions(),i="first"===e?0:o.length-1;if(!this.props.isMulti){var s=o.indexOf(a[0]);s>-1&&(i=s)}this.scrollToFocusedOptionOnUpdate=!(r&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:o[i],focusedOptionId:this.getFocusedOptionId(o[i])},function(){return t.onMenuOpen()})}},{key:"focusValue",value:function(e){var t=this.state,n=t.selectValue,a=t.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var r=n.indexOf(a);a||(r=-1);var o=n.length-1,i=-1;if(n.length){switch(e){case"previous":i=0===r?0:-1===r?o:r-1;break;case"next":r>-1&&r<o&&(i=r+1)}this.setState({inputIsHidden:-1!==i,focusedValue:n[i]})}}}},{key:"focusOption",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,n=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var r=0,o=a.indexOf(n);n||(o=-1),"up"===e?r=o>0?o-1:a.length-1:"down"===e?r=(o+1)%a.length:"pageup"===e?(r=o-t)<0&&(r=0):"pagedown"===e?(r=o+t)>a.length-1&&(r=a.length-1):"last"===e&&(r=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[r],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[r])})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(aa):f(f({},aa),this.props.theme):aa}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,n=this.getStyles,a=this.getClassNames,r=this.getValue,o=this.selectOption,i=this.setValue,s=this.props,l=s.isMulti,c=s.isRtl,u=s.options;return{clearValue:e,cx:t,getStyles:n,getClassNames:a,getValue:r,hasValue:this.hasValue(),isMulti:l,isRtl:c,options:u,selectOption:o,selectProps:s,setValue:i,theme:this.getTheme()}}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return pa(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return ma(this.props,e,t)}},{key:"filterOption",value:function(e,t){return ha(this.props,e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:a})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,a=e.inputId,r=e.inputValue,i=e.tabIndex,s=e.form,l=e.menuIsOpen,c=e.required,u=this.getComponents().Input,d=this.state,p=d.inputIsHidden,m=d.ariaSelection,h=this.commonProps,g=a||this.getElementId("input"),v=f(f(f({"aria-autocomplete":"list","aria-expanded":l,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":c,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},l&&{"aria-controls":this.getElementId("listbox")}),!n&&{"aria-readonly":!0}),this.hasValue()?"initial-input-focus"===(null==m?void 0:m.action)&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return n?o.createElement(u,b({},h,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:g,innerRef:this.getInputRef,isDisabled:t,isHidden:p,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:i,form:s,type:"text",value:r},v)):o.createElement($n,b({id:g,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:_t,onFocus:this.onInputFocus,disabled:t,tabIndex:i,inputMode:"none",form:s,value:""},v))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.getComponents(),n=t.MultiValue,a=t.MultiValueContainer,r=t.MultiValueLabel,i=t.MultiValueRemove,s=t.SingleValue,l=t.Placeholder,c=this.commonProps,u=this.props,d=u.controlShouldRenderValue,f=u.isDisabled,p=u.isMulti,m=u.inputValue,h=u.placeholder,g=this.state,v=g.selectValue,y=g.focusedValue,w=g.isFocused;if(!this.hasValue()||!d)return m?null:o.createElement(l,b({},c,{key:"placeholder",isDisabled:f,isFocused:w,innerProps:{id:this.getElementId("placeholder")}}),h);if(p)return v.map(function(t,s){var l=t===y,u="".concat(e.getOptionLabel(t),"-").concat(e.getOptionValue(t));return o.createElement(n,b({},c,{components:{Container:a,Label:r,Remove:i},isFocused:l,isDisabled:f,key:u,index:s,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault()}},data:t}),e.formatOptionLabel(t,"value"))});if(m)return null;var C=v[0];return o.createElement(s,b({},c,{data:C,isDisabled:f}),this.formatOptionLabel(C,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.getComponents().ClearIndicator,t=this.commonProps,n=this.props,a=n.isDisabled,r=n.isLoading,i=this.state.isFocused;if(!this.isClearable()||!e||a||!this.hasValue()||r)return null;var s={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return o.createElement(e,b({},t,{innerProps:s,isFocused:i}))}},{key:"renderLoadingIndicator",value:function(){var e=this.getComponents().LoadingIndicator,t=this.commonProps,n=this.props,a=n.isDisabled,r=n.isLoading,i=this.state.isFocused;return e&&r?o.createElement(e,b({},t,{innerProps:{"aria-hidden":"true"},isDisabled:a,isFocused:i})):null}},{key:"renderIndicatorSeparator",value:function(){var e=this.getComponents(),t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var a=this.commonProps,r=this.props.isDisabled,i=this.state.isFocused;return o.createElement(n,b({},a,{isDisabled:r,isFocused:i}))}},{key:"renderDropdownIndicator",value:function(){var e=this.getComponents().DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,a=this.state.isFocused,r={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return o.createElement(e,b({},t,{innerProps:r,isDisabled:n,isFocused:a}))}},{key:"renderMenu",value:function(){var e=this,t=this.getComponents(),n=t.Group,a=t.GroupHeading,r=t.Menu,i=t.MenuList,s=t.MenuPortal,l=t.LoadingMessage,c=t.NoOptionsMessage,u=t.Option,d=this.commonProps,f=this.state.focusedOption,p=this.props,m=p.captureMenuScroll,h=p.inputValue,g=p.isLoading,v=p.loadingMessage,y=p.minMenuHeight,w=p.maxMenuHeight,C=p.menuIsOpen,E=p.menuPlacement,O=p.menuPosition,S=p.menuPortalTarget,k=p.menuShouldBlockScroll,_=p.menuShouldScrollIntoView,T=p.noOptionsMessage,x=p.onMenuScrollToTop,I=p.onMenuScrollToBottom;if(!C)return null;var D,P=function(t,n){var a=t.type,r=t.data,i=t.isDisabled,s=t.isSelected,l=t.label,c=t.value,p=f===r,m=i?void 0:function(){return e.onOptionHover(r)},h=i?void 0:function(){return e.selectOption(r)},g="".concat(e.getElementId("option"),"-").concat(n),v={id:g,onClick:h,onMouseMove:m,onMouseOver:m,tabIndex:-1,role:"option","aria-selected":e.isAppleDevice?void 0:s};return o.createElement(u,b({},d,{innerProps:v,data:r,isDisabled:i,isSelected:s,key:g,label:l,type:a,value:c,isFocused:p,innerRef:p?e.getFocusedOptionRef:void 0}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())D=this.getCategorizedOptions().map(function(t){if("group"===t.type){var r=t.data,i=t.options,s=t.index,l="".concat(e.getElementId("group"),"-").concat(s),c="".concat(l,"-heading");return o.createElement(n,b({},d,{key:l,data:r,options:i,Heading:a,headingProps:{id:c,data:t.data},label:e.formatGroupLabel(t.data)}),t.options.map(function(e){return P(e,"".concat(s,"-").concat(e.index))}))}if("option"===t.type)return P(t,"".concat(t.index))});else if(g){var M=v({inputValue:h});if(null===M)return null;D=o.createElement(l,d,M)}else{var F=T({inputValue:h});if(null===F)return null;D=o.createElement(c,d,F)}var R={minMenuHeight:y,maxMenuHeight:w,menuPlacement:E,menuPosition:O,menuShouldScrollIntoView:_},V=o.createElement(Zt,b({},d,R),function(t){var n=t.ref,a=t.placerProps,s=a.placement,l=a.maxHeight;return o.createElement(r,b({},d,R,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove},isLoading:g,placement:s}),o.createElement(Zn,{captureEnabled:m,onTopArrive:x,onBottomArrive:I,lockEnabled:k},function(t){return o.createElement(i,b({},d,{innerRef:function(n){e.getMenuListRef(n),t(n)},innerProps:{role:"listbox","aria-multiselectable":d.isMulti,id:e.getElementId("listbox")},isLoading:g,maxHeight:l,focusedOption:f}),D)}))});return S||"fixed"===O?o.createElement(s,b({},d,{appendTo:S,controlElement:this.controlRef,menuPlacement:E,menuPosition:O}),V):V}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,a=t.isDisabled,r=t.isMulti,i=t.name,s=t.required,l=this.state.selectValue;if(s&&!this.hasValue()&&!a)return o.createElement(Qn,{name:i,onFocus:this.onValueInputFocus});if(i&&!a){if(r){if(n){var c=l.map(function(t){return e.getOptionValue(t)}).join(n);return o.createElement("input",{name:i,type:"hidden",value:c})}var u=l.length>0?l.map(function(t,n){return o.createElement("input",{key:"i-".concat(n),name:i,type:"hidden",value:e.getOptionValue(t)})}):o.createElement("input",{name:i,type:"hidden",value:""});return o.createElement("div",null,u)}var d=l[0]?this.getOptionValue(l[0]):"";return o.createElement("input",{name:i,type:"hidden",value:d})}}},{key:"renderLiveRegion",value:function(){var e=this.commonProps,t=this.state,n=t.ariaSelection,a=t.focusedOption,r=t.focusedValue,i=t.isFocused,s=t.selectValue,l=this.getFocusableOptions();return o.createElement(Tn,b({},e,{id:this.getElementId("live-region"),ariaSelection:n,focusedOption:a,focusedValue:r,isFocused:i,selectValue:s,focusableOptions:l,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var e=this.getComponents(),t=e.Control,n=e.IndicatorsContainer,a=e.SelectContainer,r=e.ValueContainer,i=this.props,s=i.className,l=i.id,c=i.isDisabled,u=i.menuIsOpen,d=this.state.isFocused,f=this.commonProps=this.getCommonProps();return o.createElement(a,b({},f,{className:s,innerProps:{id:l,onKeyDown:this.onKeyDown},isDisabled:c,isFocused:d}),this.renderLiveRegion(),o.createElement(t,b({},f,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:c,isFocused:d,menuIsOpen:u}),o.createElement(r,b({},f,{isDisabled:c}),this.renderPlaceholderOrValue(),this.renderInput()),o.createElement(n,b({},f,{isDisabled:c}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,a=t.clearFocusValueOnUpdate,r=t.inputIsHiddenAfterUpdate,o=t.ariaSelection,i=t.isFocused,s=t.prevWasFocused,l=t.instancePrefix,c=e.options,u=e.value,d=e.menuIsOpen,p=e.inputValue,m=e.isMulti,h=It(u),g={};if(n&&(u!==n.value||c!==n.options||d!==n.menuIsOpen||p!==n.inputValue)){var v=d?function(e,t){return sa(ia(e,t))}(e,h):[],b=d?la(ia(e,h),"".concat(l,"-option")):[],y=a?function(e,t){var n=e.focusedValue,a=e.selectValue.indexOf(n);if(a>-1){if(t.indexOf(n)>-1)return n;if(a<t.length)return t[a]}return null}(t,h):null,w=function(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}(t,v);g={selectValue:h,focusedOption:w,focusedOptionId:ua(b,w),focusableOptionsWithIds:b,focusedValue:y,clearFocusValueOnUpdate:!1}}var C=null!=r&&e!==n?{inputIsHidden:r,inputIsHiddenAfterUpdate:void 0}:{},E=o,O=i&&s;return i&&!O&&(E={value:Ut(m,h,h[0]||null),options:h,action:"initial-input-focus"},O=!s),"initial-input-focus"===(null==o?void 0:o.action)&&(E=null),f(f(f({},g),C),{},{prevProps:e,ariaSelection:E,prevWasFocused:O})}}]),n}(o.Component);ba.defaultProps=ra;var ya=(0,o.forwardRef)(function(e,t){var n=function(e){var t=e.defaultInputValue,n=void 0===t?"":t,a=e.defaultMenuIsOpen,r=void 0!==a&&a,i=e.defaultValue,s=void 0===i?null:i,l=e.inputValue,c=e.menuIsOpen,u=e.onChange,d=e.onInputChange,p=e.onMenuClose,m=e.onMenuOpen,b=e.value,y=g(e,v),w=h((0,o.useState)(void 0!==l?l:n),2),C=w[0],E=w[1],O=h((0,o.useState)(void 0!==c?c:r),2),S=O[0],k=O[1],_=h((0,o.useState)(void 0!==b?b:s),2),T=_[0],x=_[1],I=(0,o.useCallback)(function(e,t){"function"==typeof u&&u(e,t),x(e)},[u]),D=(0,o.useCallback)(function(e,t){var n;"function"==typeof d&&(n=d(e,t)),E(void 0!==n?n:e)},[d]),P=(0,o.useCallback)(function(){"function"==typeof m&&m(),k(!0)},[m]),M=(0,o.useCallback)(function(){"function"==typeof p&&p(),k(!1)},[p]),F=void 0!==l?l:C,R=void 0!==c?c:S,V=void 0!==b?b:T;return f(f({},y),{},{inputValue:F,menuIsOpen:R,onChange:I,onInputChange:D,onMenuClose:M,onMenuOpen:P,value:V})}(e);return o.createElement(ba,b({ref:t},n))}),wa=ya;const Ca=e=>e.customName||e.telegramTopicName||`${wp.i18n.__("Topic","cf7-telegram")} #${e.messageThreadID}`,Ea=({channel:e,titleValue:t,saving:n,error:a,handleTitleClick:r,handleTitleChange:o,handleKeyDown:s,handleCancelEdit:l,saveTitle:c,botForChannel:u,chatsForChannel:d=[],formsForChannel:f=[],availableForms:p=[],showFormSelector:m,handleAddForm:h,handleFormSelect:g,handleRemoveForm:v,availableBots:b=[],handleBotSelect:y,handleRemoveBot:w,bot2ChatConnections:C=[],handleToggleChat:E,deleteChannel:O,getToggleButtonLabel:S,dataAvailability:k={forms:"ready",bots:"ready",chats:"ready"},mutatingRelations:_=!1})=>{const T=(u?.chats||[]).map(e=>{const t=C.find(t=>t.data.from===u.id&&t.data.to===e.id),n=t?.data?.meta?.status?.[0]||null;if("pending"===n)return null;let a=d.some(t=>t.id===e.id)?"Active":"Paused";return"muted"===n&&(a="Muted"),{...e,status:a}}).filter(Boolean);return i().createElement("div",{className:"entity-container channel"+(()=>{let e="";return u?.online&&(e+=" has-bot-online"),T.some(e=>"Active"===e.status)&&(e+=" has-active-chats"),f.length>0&&(e+=" has-forms"),e})(),"data-testid":`cf7tg-channel-${e.id}`,key:e.id,id:`channel-${e.id}`},i().createElement("div",{className:"entity-wrapper channel-wrapper"},i().createElement("div",{className:"frame channel-title-wrapper"},i().createElement("div",{className:"columns"},i().createElement("div",{className:"column title-column"},i().createElement("input",{className:"edit-title","data-testid":`cf7tg-channel-title-input-${e.id}`,type:"text",value:t,onChange:o,onKeyDown:s,onBlur:c,disabled:n,autoFocus:!0})),i().createElement("div",{className:"column bot-column"},"error"===k.bots?i().createElement("span",{className:"resource-error"},wp.i18n.__("Bots are unavailable.","cf7-telegram")):"ready"!==k.bots?i().createElement("span",{className:"resource-loading"},wp.i18n.__("Loading bots...","cf7-telegram")):u?i().createElement("div",{"data-bot-id":u.id,"data-testid":`cf7tg-channel-${e.id}-bot-${u.id}`,className:"bot-for-channel "+(u?.online?"online":"offline")},i().createElement("span",null,u.title.rendered),i().createElement("button",{className:"detach-button detach-bot-button crux",onClick:w,disabled:_})):i().createElement(i().Fragment,null,b.length>0&&i().createElement(wa,{className:"select-picker bot-picker",classNamePrefix:"select-picker",inputId:`cf7tg-channel-bot-picker-${e.id}`,instanceId:`cf7tg-channel-bot-picker-${e.id}`,"data-testid":`cf7tg-channel-${e.id}-bot-picker`,options:b.map(e=>({value:e.id,label:e.title.rendered})),isSearchable:!1,placeholder:wp.i18n.__("Pick a bot","cf7-telegram"),onChange:e=>y({target:{value:e?.value}}),isClearable:!0,isDisabled:_}))))),i().createElement("div",{className:"frame chats"},"error"===k.chats?i().createElement("span",{className:"resource-error"},wp.i18n.__("Chat data is unavailable.","cf7-telegram")):"ready"!==k.chats?i().createElement("span",{className:"resource-loading"},wp.i18n.__("Loading chat data...","cf7-telegram")):T.length>0?i().createElement(i().Fragment,null,T.map(t=>i().createElement("div",{key:t.id,className:`chat chat-${t.id} ${t.status.toLowerCase()}`,"data-testid":`cf7tg-channel-${e.id}-chat-${t.id}`,onClick:()=>!_&&E(t.id,t.status),"aria-disabled":_,title:S(t.status)},i().createElement("span",{className:"chat-username"},null!=t.messageThreadID&&t.telegramName||t.title.rendered),null!=t.messageThreadID&&i().createElement("small",{className:"topic-identity",style:{marginLeft:4},title:`${wp.i18n.__("Topic","cf7-telegram")} #${t.messageThreadID}`},Ca(t))))):i().createElement("span",{className:"no-chats-found"},"[",wp.i18n.__("No chats assigned to this bridge","cf7-telegram"),"]")),i().createElement("div",{className:"frame forms"},i().createElement("button",{className:"add-button add-form-button","data-testid":`cf7tg-channel-${e.id}-add-form`,onClick:h,disabled:"ready"!==k.forms||_},m?wp.i18n.__("Cancel","cf7-telegram"):wp.i18n.__("Add Form","cf7-telegram")),"error"===k.forms?i().createElement("span",{className:"resource-error"},wp.i18n.__("Forms are unavailable.","cf7-telegram")):"ready"!==k.forms?i().createElement("span",{className:"resource-loading"},wp.i18n.__("Loading forms...","cf7-telegram")):m&&i().createElement(wa,{className:"select-picker form-picker",classNamePrefix:"select-picker",inputId:`cf7tg-channel-form-picker-${e.id}`,instanceId:`cf7tg-channel-form-picker-${e.id}`,"data-testid":`cf7tg-channel-${e.id}-form-picker`,options:p.map(e=>({value:e.id,label:e.title})),isSearchable:!0,placeholder:wp.i18n.__("Pick a form","cf7-telegram"),onChange:e=>g({target:{value:e?.value}}),isClearable:!0,isDisabled:_}),"ready"===k.forms&&(f.length>0?i().createElement("ul",{className:"form-list "+(m?"show-selector":"")},f.map(t=>i().createElement("li",{key:t.id,"data-testid":`cf7tg-channel-${e.id}-form-${t.id}`},t.title,i().createElement("button",{className:"detach-button crux detach-form-button",onClick:()=>v(t.id),disabled:_})))):m||i().createElement("span",{className:"no-forms-found"},"[",wp.i18n.__("No forms assigned to this bridge","cf7-telegram"),"]"))),i().createElement("div",{className:"frame status-bar"},i().createElement("button",{className:"remove-channel-button","data-testid":`cf7tg-remove-channel-${e.id}`,onClick:O,disabled:n||_},wp.i18n.__("Remove Bridge","cf7-telegram")))))};class Oa extends Error{constructor(e,t={}){super(e),this.name="ApiError",this.status=t.status??0,this.code=t.code??"",this.category=t.category??"rest_transport",this.method=t.method??"GET",this.url=t.url??"",this.data=t.data??null}}const Sa=(e,t="")=>[401,403].includes(Number(e))||/forbidden|unauthorized|cannot_/i.test(t)?"rest_permission":Number(e)>=400?"rest_http":"rest_transport",ka=e=>String(e).replace(/bot\d{5,}(:|%(?:25)*3a)[A-Za-z0-9_-]{8,}/gi,"bot[telegram-token]").replace(/\d{5,}(:|%(?:25)*3a)[A-Za-z0-9_-]{8,}/gi,"[telegram-token]").replace(/([?&][^=]*(?:nonce|token|secret|password|key)[^=]*=)[^&\s]*/gi,"$1[redacted]"),_a=e=>"string"==typeof e?ka(e):e&&"object"==typeof e?Array.isArray(e)?e.map(_a):Object.entries(e).reduce((e,[t,n])=>({...e,[t]:/nonce|token|secret|password|key/i.test(t)?"[redacted]":_a(n)}),{}):e,Ta=e=>{try{const t=new URL(e,"undefined"!=typeof window?window.location?.origin??"https://example.invalid":"https://example.invalid");for(const e of Array.from(t.searchParams.keys()))/nonce|token|secret|password|key/i.test(e)&&t.searchParams.set(e,"[redacted]");return`${t.pathname}${t.search}${t.hash}`}catch(t){return ka(e)}},xa=(e,t)=>{const n=t.toString();return n?`${e}${e.includes("?")?"&":"?"}${n}`:e},Ia=(e,t)=>xa(`${e}${t}`,new URLSearchParams({force:"true"})),Da=async(e,t,n,a={})=>{const r=e;let o={method:t=t??"GET",headers:{"Content-Type":"application/json","X-WP-Nonce":cf7TelegramData?.nonce}},i=new URLSearchParams;if("GET"===t||"HEAD"===t){if(n){for(const[e,t]of Object.entries(n))null!=t&&i.append(e,t);n=null}e=xa(e,i)}n&&(o.body=JSON.stringify(n));try{const n=await fetch(e,o);let r;try{r=await n.json()}catch(a){throw new Oa(n.ok?"The server returned an invalid response.":"The request could not be completed.",{status:n.status??0,category:n.ok?"rest_parse":Sa(n.status),method:t,url:Ta(e)})}if(!n.ok)throw new Oa("The request could not be completed.",{status:n.status??r?.data?.status??0,code:r?.code??"",category:Sa(n.status??r?.data?.status,r?.code),method:t,url:Ta(e),data:_a(r?.data??null)});return a.includeResponse?{data:r,response:n}:r}catch(e){throw e instanceof Oa||(e=new Oa(ka(e?.message||"API request failed"),{category:"rest_transport",method:t,url:Ta(r)})),console.error("API request error:",e),e}},Pa=(e,t)=>{const n=new Set(e.map(e=>e?.id));return e.concat(t.filter(e=>!e||void 0===e.id||!n.has(e.id)&&(n.add(e.id),!0)))},Ma=e=>{const t=e.headers?.get?.("X-WP-TotalPages"),n=Number.parseInt(t,10);return Number.isFinite(n)&&n>0?n:null},Fa=async(e,t={})=>(async(e,t={},n={})=>{const a=n.perPage??100;let r=1,o=1,i=[];do{const{data:s,response:l}=await Da(e,"GET",{...t,per_page:a,page:r},{includeResponse:!0});i=Pa(i,Array.isArray(s)?s:[]);const c=Ma(l);o=null===c&&n.stopWhenTotalPagesHeaderMissing?r:c??r,r+=1}while(r<=o);return i})(e,{order:"asc",orderby:"id",...t}),Ra=async()=>await Da(cf7TelegramData.routes.client),Va=async()=>await(async()=>{let e=0,t=[],n=!0;for(;n;){const a=await Da(cf7TelegramData.routes.forms,"GET",{per_page:100,offset:e,order:"asc",orderby:"id"}),r=t.length,o=Array.isArray(a)?a:[];t=Pa(t,o),e+=o.length,n=o.length>=100&&t.length>r}return t})(),Na=async()=>await Fa(cf7TelegramData.routes.bots),La=async()=>await Fa(cf7TelegramData.routes.chats),Aa=async()=>await Fa(cf7TelegramData.routes.channels),$a=async()=>await Da(cf7TelegramData.routes.relations.form2channel),Ba=async()=>await Da(cf7TelegramData.routes.relations.bot2channel),Ha=async()=>await Da(cf7TelegramData.routes.relations.bot2chat),ja=async()=>await Da(cf7TelegramData.routes.relations.chat2channel);function Ua(e,t=null){const n=t??e.innerText,a=()=>{e.classList.add("copied"),setTimeout(()=>e.classList.remove("copied"),1500)};if(navigator.clipboard&&window.isSecureContext)return void navigator.clipboard.writeText(n).then(a).catch(e=>{console.error("Clipboard error:",e)});const r=document.createElement("textarea");r.value=n,r.style.position="fixed",r.style.opacity="0",document.body.appendChild(r),r.focus(),r.select();try{document.execCommand("copy"),a()}catch(e){console.error("Fallback copy failed:",e)}finally{document.body.removeChild(r)}}const za=async(e,t,n)=>{const a=await(async(e,t)=>await Da(cf7TelegramData.routes.relations.chat2channel,"POST",{from:e,to:t}))(e,t);a&&n(e=>[...e,{data:a}])},Wa=({channel:e,forms:t,setChannels:n,form2ChannelConnections:a,setForm2ChannelConnections:r,bots:s,bot2ChannelConnections:l,setBot2ChannelConnections:c,chats:u,chat2ChannelConnections:d,setChat2ChannelConnections:f,bot2ChatConnections:p,dataAvailability:m={forms:"ready",bots:"ready",chats:"ready"}})=>{const[h,g]=(0,o.useState)(null),[v,b]=(0,o.useState)([]),[y,w]=(0,o.useState)([]),[C,E]=(0,o.useState)([]),[O,S]=(0,o.useState)(!1),[k,_]=(0,o.useState)([]),[T,x]=(0,o.useState)(!1),[I,D]=(0,o.useState)(e.title.rendered),[P,M]=(0,o.useState)(!1),[F,R]=(0,o.useState)(!1),[V,N]=(0,o.useState)(null);(0,o.useEffect)(()=>{if("ready"!==m.bots||"ready"!==m.chats)return;const t=l.find(t=>t.data.to===e.id);if(!t)return g(null);const n=s.find(e=>e.id===t.data.from);if(!n)return g(null);const a=p.filter(e=>e.data.from===n.id),r=u.map(t=>{const n=a.find(e=>e.data.to===t.id);if(!n)return null;const r=d.some(n=>n.data.from===t.id&&n.data.to===e.id);return{...t,muted:!!n.data.muted,status:r?"active":"paused"}}).filter(Boolean);g({...n,chats:r}),b(r.filter(e=>"active"===e.status))},[e.id,s,l,p,u,d,m.bots,m.chats]),(0,o.useEffect)(()=>{if("ready"!==m.forms)return;const n=a.filter(t=>t.data?.to===e.id).map(e=>e.data.from),r=t.filter(e=>n.includes(e.id)),o=t.filter(e=>!n.includes(e.id));w(r),E(o)},[t,a,e.id,m.forms]),(0,o.useEffect)(()=>{if("ready"!==m.bots)return;const t=l.find(t=>t.data.to===e.id),n=t?.data.from,a=s.filter(e=>e.id!==n);_(a)},[s,l,e.id,m.bots]);const L=()=>{D(e.title.rendered),x(!1),N(null)},A=async()=>{if(""!==I.trim()&&I!==e.title.rendered){M(!0),N(null);try{await(async(e,t)=>{let n={title:t};return await Da(`${cf7TelegramData.routes.channels}${e}`,"POST",n)})(e.id,I),x(!1)}catch(e){console.error(e),N(wp.i18n.__("Failed to update title","cf7-telegram"))}finally{M(!1)}}else x(!1)};return i().createElement(Ea,{channel:e,titleValue:I,saving:P,error:V,handleTitleClick:()=>{N(null),x(!0)},handleTitleChange:e=>D(e.target.value),handleKeyDown:e=>{"Enter"===e.key&&A(),"Escape"===e.key&&L()},handleCancelEdit:L,saveTitle:A,botForChannel:h,chatsForChannel:v,formsForChannel:y,availableForms:C,showFormSelector:O,handleAddForm:()=>S(e=>!e),handleFormSelect:async t=>{const n=parseInt(t.target.value,10);if(Number.isInteger(n)&&!F){R(!0);try{await(async(e,t,n)=>{const a=await(async(e,t)=>await Da(cf7TelegramData.routes.relations.form2channel,"POST",{from:e,to:t}))(e,t);a&&n(e=>[...e,{data:a}])})(n,e.id,r)}catch(e){console.error(e),alert(wp.i18n.__("Something went wrong while assigning the form","cf7-telegram"))}finally{S(!1),R(!1)}}},handleRemoveForm:async t=>{const n=a.find(n=>n.data.from===t&&n.data.to===e.id);if(!F&&n&&window.confirm(wp.i18n.__("Are you sure you want to remove this form from the bridge?","cf7-telegram"))){R(!0);try{await(async(e,t)=>{await(async e=>await Da(`${cf7TelegramData.routes.relations.form2channel}${e}`,"DELETE"))(e)&&t(t=>t.filter(t=>t.data.id!==e))})(n.data.id,r)}catch(e){console.error(e),alert(wp.i18n.__("Failed to remove form","cf7-telegram"))}finally{R(!1)}}},availableBots:k,handleBotSelect:async t=>{const n=parseInt(t.target.value,10);if(Number.isInteger(n)&&!F){R(!0);try{await(async(e,t,n)=>{const a=await(async(e,t)=>await Da(cf7TelegramData.routes.relations.bot2channel,"POST",{from:e,to:t}))(e,t);a&&n(e=>[...e,{data:a}])})(n,e.id,c)}catch(e){console.error(e),alert(wp.i18n.__("Failed to assign bot","cf7-telegram"))}finally{R(!1)}}},handleRemoveBot:async()=>{const t=l.find(t=>t.data.to===e.id);if(t&&!F){R(!0);try{await(async(e,t)=>{await(async e=>await Da(`${cf7TelegramData.routes.relations.bot2channel}${e}`,"DELETE"))(e)&&t(t=>t.filter(t=>t.data.id!==e))})(t.data.id,c)}catch(e){console.error(e),alert(wp.i18n.__("Failed to remove bot","cf7-telegram"))}finally{R(!1)}}},bot2ChatConnections:p,handleToggleChat:async(t,n)=>{if(F||"muted"===n.toLowerCase())return;let a=d.find(n=>n.data.from===t&&n.data.to===e.id);R(!0);try{a?await(async(e,t)=>{await(async e=>await Da(`${cf7TelegramData.routes.relations.chat2channel}${e}`,"DELETE"))(e)&&t(t=>t.filter(t=>t.data.id!==e))})(a.data.id,f):await za(t,e.id,f)}catch(e){console.error("Failed to update bridge chat",e),N(wp.i18n.__("Failed to update chat","cf7-telegram"))}finally{R(!1)}},deleteChannel:async()=>{if(!P&&!F&&window.confirm(wp.i18n.__("Are you sure you want to delete this bridge?","cf7-telegram"))){M(!0),N(null);try{await(async(e,t)=>{await(async e=>await Da(Ia(cf7TelegramData.routes.channels,e),"DELETE"))(e)&&t(t=>t.filter(t=>t.id!==e))})(e.id,n)}catch(e){console.error(e),N(wp.i18n.__("Failed to delete bridge","cf7-telegram"))}finally{M(!1)}}},getToggleButtonLabel:e=>{switch(e.toLowerCase()){case"active":return wp.i18n.__("Pause","cf7-telegram");case"paused":return wp.i18n.__("Activate","cf7-telegram");case"muted":return wp.i18n.__("Muted by Bot","cf7-telegram");default:return""}},dataAvailability:m,mutatingRelations:F})},Ga=({bot:e,chatsForBot:t=[],bot2ChatConnections:n=[],updatingStatusIds:a=[],updatingNameIds:r=[],renamingChatId:o=null,chatNameValue:s="",isEditingToken:l,nameValue:c,isTokenEmpty:u,tokenValue:d,saving:f,error:p,handleEditToken:m,deleteBot:h,handleKeyDown:g,setTokenValue:v,handleToggleChatStatus:b,handleDisconnectChat:y,handleStartRenameChat:w=()=>{},handleRenameChatChange:C=()=>{},handleRenameChatKeyDown:E=()=>{},handleCancelRenameChat:O=()=>{},handleSaveChatName:S=()=>{},handleRestoreChatName:k=()=>{},online:_,chatDataStatus:T="ready"})=>{let x=!0===_?"online":!1===_?"offline":"unknown",I=c.slice(0,18);const D=`@${c}`,P=u?d:`***${d.slice(-4)}`;return i().createElement("div",{className:`entity-container bot ${x}`,"data-testid":`cf7tg-bot-${e.id}`,key:e.id,id:`bot-${e.id}`},i().createElement("div",{className:"entity-wrapper bot-wrapper "+(f?"saving":"")},i().createElement("div",{className:"frame bot-summary"},i().createElement("div",{className:"bot-title"},i().createElement("div",{className:`bot-name ${x} copyable`,onClick:e=>Ua(e.currentTarget,D),title:wp.i18n.__("Click to copy bot name","cf7-telegram")},"@",I,I!==c&&"..."),i().createElement("div",{className:"bot-command copyable",onClick:e=>Ua(e.currentTarget,`/cf7tg_start@${c}`),title:wp.i18n.__("Click to copy bot command","cf7-telegram")},"/cf7tg_start@",c)),i().createElement("div",{className:"bot-token"},i().createElement("div",{className:"show-token"+(e.isTokenDefinedByConst?" const":""),"data-testid":`cf7tg-bot-token-display-${e.id}`,onClick:m,title:e.isTokenDefinedByConst?wp.i18n.__("Defined by PHP constant","cf7-telegram"):wp.i18n.__("Click to edit token","cf7-telegram")},wp.i18n.__("token","cf7-telegram"),": ",i().createElement("span",{className:"token-value"},l?"":P)),!_&&u&&!e.isTokenDefinedByConst&&i().createElement("div",{className:"php-const-hint copyable",title:wp.i18n.__("Click to copy PHP code","cf7-telegram"),onClick:t=>Ua(t.currentTarget,`const ${e.phpConst} = 'your_token';`)},wp.i18n.__("set by PHP const","cf7-telegram")),l&&i().createElement(i().Fragment,null,i().createElement("input",{className:"edit-token","data-testid":`cf7tg-bot-token-input-${e.id}`,type:"text",value:d,onChange:e=>v(e.target.value),onKeyDown:g,autoFocus:!0,disabled:f,spellCheck:"false",title:wp.i18n.__("Press Enter to save token, Esc to cancel.","cf7-telegram")})))),p&&i().createElement("p",{style:{color:"red"}},p),i().createElement("div",{className:"frame chats-for-bot"},"error"===T?i().createElement("span",{className:"offline-bot-sad-message"},wp.i18n.__("Chat data is unavailable.","cf7-telegram")):"ready"!==T?i().createElement("span",{className:"unknown-bot-status-message"},wp.i18n.__("Loading chat data...","cf7-telegram")):t.length>0?i().createElement("ul",null,t.map(t=>{const l=function(e,t,n=[]){const a=n.find(n=>n.data.from===e&&n.data.to===t),r=a?.data?.meta?.status?.[0];return"pending"===r?"Pending":"muted"===r?"Muted":"Active"}(e.id,t.id,n),c=a.includes(t.id),u=o===t.id,d=r.includes(t.id),f=null!=t.messageThreadID,p=f||"pending"!==l.toLowerCase(),m=c?wp.i18n.__("Updating...","cf7-telegram"):function(e){return["muted","pending"].includes(e.toLowerCase())?wp.i18n.__("Activate","cf7-telegram"):wp.i18n.__("Mute","cf7-telegram")}(l);return i().createElement("li",{key:t.id,className:`chat-item ${l.toLowerCase()}`,"data-testid":`cf7tg-bot-${e.id}-chat-${t.id}`},u&&!f?i().createElement("input",{className:"chat-name edit-chat-name","data-testid":`cf7tg-bot-${e.id}-chat-${t.id}-name-input`,type:"text",value:s,onChange:C,onKeyDown:e=>E(t.id,e),disabled:d,autoFocus:!0}):i().createElement("span",{className:"chat-name",title:String(l)},f&&t.telegramName||t.title.rendered),f&&(u?i().createElement("input",{className:"topic-identity edit-chat-name","data-testid":`cf7tg-bot-${e.id}-chat-${t.id}-name-input`,type:"text",value:s,onChange:C,onKeyDown:e=>E(t.id,e),disabled:d,autoFocus:!0}):i().createElement("small",{className:"topic-identity",title:`${wp.i18n.__("Topic","cf7-telegram")} #${t.messageThreadID}`},Ca(t))),i().createElement("div",{className:"chat-actions"},u?i().createElement(i().Fragment,null,i().createElement("button",{type:"button",className:"action save-chat-name",onClick:()=>S(t.id),disabled:d,title:d?wp.i18n.__("Saving...","cf7-telegram"):wp.i18n.__("Save","cf7-telegram"),"aria-label":d?wp.i18n.__("Saving...","cf7-telegram"):wp.i18n.__("Save","cf7-telegram")},i().createElement("span",{className:"dashicons dashicons-yes","aria-hidden":"true"})),i().createElement("button",{type:"button",className:"action restore-chat-name",onClick:()=>k(t.id),disabled:d,title:wp.i18n.__("Restore","cf7-telegram"),"aria-label":wp.i18n.__("Restore","cf7-telegram")},i().createElement("span",{className:"dashicons dashicons-undo","aria-hidden":"true"})),i().createElement("button",{type:"button",className:"action cancel-chat-name",onClick:O,disabled:d,title:wp.i18n.__("Cancel","cf7-telegram"),"aria-label":wp.i18n.__("Cancel","cf7-telegram")},i().createElement("span",{className:"dashicons dashicons-no","aria-hidden":"true"}))):i().createElement(i().Fragment,null,i().createElement("button",{type:"button",className:"action toggle-status",onClick:()=>b(t.id,l.toLowerCase()),disabled:c,title:m,"aria-label":m},i().createElement("span",{className:"dashicons "+("Active"===l?"dashicons-controls-pause":"dashicons-controls-play"),"aria-hidden":"true"})),p&&i().createElement("button",{type:"button",className:"action rename-chat",onClick:()=>w(t),disabled:d,title:wp.i18n.__("Rename","cf7-telegram"),"aria-label":wp.i18n.__("Rename","cf7-telegram")},i().createElement("span",{className:"dashicons dashicons-edit","aria-hidden":"true"})),i().createElement("button",{type:"button",className:"action remove-chat",onClick:()=>y(t.id,e.id),disabled:c,title:wp.i18n.__("Remove","cf7-telegram"),"aria-label":wp.i18n.__("Remove","cf7-telegram")},i().createElement("span",{className:"dashicons dashicons-trash","aria-hidden":"true"})))))})):"offline"===x?i().createElement("span",{className:"offline-bot-sad-message"},wp.i18n.__("Couldn't load chat list...","cf7-telegram")):"unknown"===x?i().createElement("span",{className:"unknown-bot-status-message"},wp.i18n.__("Trying to load chat list...","cf7-telegram")):i().createElement("span",{className:"no-chats-found"},wp.i18n.__("Waiting for chats to join...","cf7-telegram"))),i().createElement("div",{className:"frame status-bar"},i().createElement("button",{className:"remove-bot-button","data-testid":`cf7tg-remove-bot-${e.id}`,onClick:h,disabled:f},wp.i18n.__("Remove bot","cf7-telegram")),i().createElement("div",{className:`bot-status ${x}`},x))))},Ka=({bot:e,chats:t,setChats:n=()=>{},bot2ChatConnections:a,setBots:r,setBot2ChatConnections:s,bot2ChannelConnections:l,setBot2ChannelConnections:c,setChat2ChannelConnections:u,loadChatData:d,chatDataStatus:f="ready"})=>{const[p,m]=(0,o.useState)(!1),[h,g]=(0,o.useState)(e.title.rendered),[v,b]=(0,o.useState)(e.token),[y,w]=(0,o.useState)(e.isTokenEmpty),[C,E]=(0,o.useState)(!1),[O,S]=(0,o.useState)(null),[k,_]=(0,o.useState)([]),[T,x]=(0,o.useState)(null),[I,D]=(0,o.useState)(""),[P,M]=(0,o.useState)([]),F=a.filter(t=>t.data.from===e.id).map(e=>e.data.to),R=t.filter(e=>F.includes(e.id)),V=n=>{const r=a.find(t=>t.data.from===e.id&&t.data.to===n),o=t.find(e=>e.id===n);return!!r&&(null!=o?.messageThreadID||"pending"!==r?.data?.meta?.status?.[0])},[N,L]=(0,o.useState)(null),[A,$]=(0,o.useState)(null),B=(0,o.useRef)(null),H=(0,o.useRef)(null),j=(0,o.useRef)(!1),U=(0,o.useRef)(!1),z=(0,o.useRef)(0);(0,o.useEffect)(()=>()=>{j.current=!0,B.current&&clearTimeout(B.current),H.current&&clearTimeout(H.current)},[]),(0,o.useEffect)(()=>{null===A&&Y()},[N]),(0,o.useEffect)(()=>(!1===A&&W(),()=>{B.current&&clearTimeout(B.current)}),[N]),(0,o.useEffect)(()=>{!0===A&&B.current&&clearTimeout(B.current)},[N]),(0,o.useEffect)(()=>(!0===A?H.current||q().then(()=>{G()}):H.current&&(clearTimeout(H.current),H.current=null),()=>{H.current&&clearTimeout(H.current)}),[A]);const W=()=>{B.current=setTimeout(()=>{Y()},cf7TelegramData.intervals.ping)},G=()=>{H.current=setTimeout(async()=>{await q(),j.current||!0!==A||G()},cf7TelegramData.intervals.bot_fetch)},K=()=>{z.current+=1,z.current>=3&&S(wp.i18n.__("Telegram updates could not be checked.","cf7-telegram"))},q=async()=>{if(!U.current){U.current=!0;try{let t=await(async e=>await Da(`${cf7TelegramData.routes.bots}${e}/fetch_updates`,"POST"))(e.id);const n=(e=>{if(e?.hasWebhookConflict)return"webhook_conflict";const t=Array.isArray(e?.errors)?e.errors:[];return t.length&&t.every(e=>"transport"===e?.errorType)?"transient_update_error":t.length?"update_error":null})(t);if("webhook_conflict"===n)return z.current=0,void S(wp.i18n.__("Telegram webhook is active. Disable it before checking for new chats.","cf7-telegram"));if("transient_update_error"===n)return void K();if("update_error"===n)return z.current=0,void S(wp.i18n.__("Telegram updates could not be checked.","cf7-telegram"));z.current=0,S(null),(t.hasNewConnections||t.hasNewChats||t.hasUpdatedChats)&&await d()}catch(e){console.error("Fetch updates failed",e),"rest_transport"===e?.category?K():(z.current=0,S(wp.i18n.__("Telegram updates could not be checked.","cf7-telegram")))}finally{U.current=!1}}},Y=async({force:t=!1,skipEditingCheck:n=!1}={})=>{try{if(!n&&p)throw new Error("Token is being edited");if(!t&&!0===A)return!0;let a=await(async e=>await Da(`${cf7TelegramData.routes.bots}${e}/ping`,"POST"))(e.id);if(j.current)return a.online;if($(a.online),a.online){g(a.botName);try{let t=await(async e=>await Da(`${cf7TelegramData.routes.bots}${e}`))(e.id);r(n=>n.map(n=>n.id===e.id?{...n,title:t.title,online:!0}:n))}catch(e){console.error("Failed to refresh bot data",e)}}return a.online}catch(e){return console.error("Ping failed",e),j.current||$(!1),!1}finally{L(Date.now())}},X=()=>{b(e.token),w(e.isTokenEmpty),m(!1),S(null)},Z=async()=>{E(!0),S(null);try{const t=v.trim();await(async({botId:e,token:t,pingBot:n,bot2ChatConnections:a,setBot2ChatConnections:r,bot2ChannelConnections:o,setBot2ChannelConnections:i})=>{const s=await(async(e,t)=>await Da(`${cf7TelegramData.routes.bots}${e}/token`,"POST",{token:t}))(e,t.trim());return await n({force:!0,skipEditingCheck:!0}),s.relationsReset&&(r(t=>t.filter(t=>t.data.from!==e)),i(t=>t.filter(t=>t.data.from!==e))),s})({botId:e.id,token:t,pingBot:Y,bot2ChatConnections:a,setBot2ChatConnections:s,bot2ChannelConnections:l,setBot2ChannelConnections:c}),b(t),w(!1),m(!1)}catch(e){console.error(e),S(wp.i18n.__("Failed to update bot","cf7-telegram"))}finally{E(!1)}},J=e=>{n(t=>t.map(t=>t.id===e.id?{...t,...e}:t))},Q=()=>{x(null),D(""),S(null)},ee=async n=>{const a=t.find(e=>e.id===n),r=I.trim();if(!a||P.includes(n)||!V(n))return;const o=null!=a.messageThreadID?Ca(a):a.title?.rendered??"";if(""!==r&&r!==o){M(e=>[...e,n]),S(null);try{const t=await(async(e,t,n)=>await Da(`${cf7TelegramData.routes.chats}${e}/name`,"POST",{bot_id:t,name:n}))(n,e.id,r);J(t),x(null),D("")}catch(e){console.error("Failed to rename chat",e),S(wp.i18n.__("Failed to update chat name","cf7-telegram"))}finally{M(e=>e.filter(e=>e!==n))}}else Q()};return i().createElement(Ga,{bot:e,chatsForBot:R,bot2ChatConnections:a,updatingStatusIds:k,updatingNameIds:P,renamingChatId:T,chatNameValue:I,isEditingToken:p,nameValue:h,isTokenEmpty:y,tokenValue:v,saving:C,error:O,handleEditToken:()=>{e.isTokenDefinedByConst||A&&!window.confirm(wp.i18n.__("Changing the token to another Telegram bot will disconnect this bot from its chats and bridges. Continue?","cf7-telegram"))||(S(null),b(""),m(!0))},deleteBot:async()=>{if(window.confirm("Are you sure you want to delete this bot?")){E(!0),S(null);try{if(!await(async e=>await Da(Ia(cf7TelegramData.routes.bots,e),"DELETE"))(e.id))return;r(t=>t.filter(t=>t.id!==e.id))}catch(e){console.error(e),S(wp.i18n.__("Failed to delete bot","cf7-telegram"))}finally{E(!1)}}},handleKeyDown:e=>{if("Enter"===e.key){if(""===v.trim())return void X();Z()}"Escape"===e.key&&X()},setTokenValue:b,handleToggleChatStatus:async(n,r)=>{if(k.includes(n))return;const o=a.findIndex(t=>t.data.from===e.id&&t.data.to===n);if(-1===o)return;const i=a[o];let c;if("active"===r)c="muted";else if("muted"===r)c="active";else{if("pending"!==r)return;c="active"}_(e=>[...e,n]);try{await(async({connectionId:e,newStatus:t,currentStatus:n,chatId:a,messageThreadID:r,botId:o,bot2ChannelConnections:i,setBot2ChatConnections:s,setChat2ChannelConnections:l})=>{if(await(async(e,t,n)=>{const a=await(async(e,t)=>await Da(`${cf7TelegramData.routes.relations.bot2chat}${e}/meta`,"PATCH",{meta:[{key:"status",value:t}]}))(e,t);return a&&n(n=>n.map(n=>n.data.id!==e?n:{...n,data:{...n.data,meta:{...n.data.meta,status:[t]}}})),a})(e,t,s),"pending"!==n||null!=r)return;const c=i.filter(e=>e.data.from===o);for(const e of c)await za(a,e.data.to,l)})({connectionId:i.data.id,newStatus:c,currentStatus:r,chatId:n,messageThreadID:t.find(e=>e.id===n)?.messageThreadID,botId:e.id,bot2ChannelConnections:l,setBot2ChatConnections:s,setChat2ChannelConnections:u})}catch(e){console.error("Failed to update chat status",e)}finally{_(e=>e.filter(e=>e!==n))}},handleDisconnectChat:async(e,t)=>{if(k.includes(e))return;const n=a.findIndex(n=>n.data.from===t&&n.data.to===e);if(-1===n||!window.confirm(wp.i18n.__("Are you sure you want to delete this chat?","cf7-telegram")))return;const r=a[n];_(t=>[...t,e]);try{await(async(e,t)=>{await(async e=>await Da(`${cf7TelegramData.routes.relations.bot2chat}${e}`,"DELETE"))(e)&&t(t=>t.filter(t=>t.data.id!==e))})(r.data.id,s)}catch(e){console.error("Something went wrong while disconnecting chat",e)}finally{_(t=>t.filter(t=>t!==e))}},handleStartRenameChat:e=>{e&&!P.includes(e.id)&&V(e.id)&&(S(null),x(e.id),D(null!=e.messageThreadID?Ca(e):e.title?.rendered??""))},handleRenameChatChange:e=>{D(e.target.value)},handleRenameChatKeyDown:(e,t)=>{"Enter"===t.key&&ee(e),"Escape"===t.key&&Q()},handleCancelRenameChat:Q,handleSaveChatName:ee,handleRestoreChatName:async t=>{if(!P.includes(t)&&V(t)){M(e=>[...e,t]),S(null);try{const n=await(async(e,t)=>await Da(`${cf7TelegramData.routes.chats}${e}/restore_name`,"POST",{bot_id:t}))(t,e.id);J(n),x(null),D("")}catch(e){console.error("Failed to restore chat name",e),S(wp.i18n.__("Failed to restore Telegram chat name","cf7-telegram"))}finally{M(e=>e.filter(e=>e!==t))}}},online:A,chatDataStatus:f})},qa=({setBots:e,disabled:t=!1})=>i().createElement("button",{className:"add-button add-bot-button","data-testid":"cf7tg-create-bot",onClick:async()=>{try{let t=await(async(e,t)=>{let n={title:wp.i18n.__("Bot Name","cf7-telegram"),status:"publish"};return t?.trim(),await Da(cf7TelegramData.routes.bots,"POST",n)})();e(e=>[...e,t])}catch(e){console.error("Error creating bot:",e),alert(wp.i18n.__("Failed to create bot","cf7-telegram"))}},disabled:t},wp.i18n.__("Create Bot","cf7-telegram")),Ya=({setChannels:e,disabled:t=!1})=>i().createElement("button",{className:"add-button add-channel-button","data-testid":"cf7tg-create-channel",onClick:async()=>{try{await(async(e,t)=>{let n=await(async e=>await Da(cf7TelegramData.routes.channels,"POST",{title:e,status:"publish"}))(e);n&&t(e=>[...e,n])})(wp.i18n.__("Bridge Name","cf7-telegram"),e)}catch(e){console.error("Error creating bridge:",e),alert(wp.i18n.__("Failed to create bridge","cf7-telegram"))}},disabled:t},wp.i18n.__("Create Bridge","cf7-telegram")),Xa=["client","forms","bots","chats","channels","form2ChannelConnections","bot2ChannelConnections","chat2ChannelConnections"],Za=()=>Xa.reduce((e,t)=>({...e,[t]:{status:"idle",error:null}}),{});class Ja extends i().Component{constructor(e){super(e),this.state={hasError:!1,retryKey:0}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(){console.error("CF7 Telegram settings failed to render.")}retry=()=>{this.setState(e=>({hasError:!1,retryKey:e.retryKey+1}))};render(){return this.state.hasError?i().createElement("div",{className:"cf7-tg-error-boundary",role:"alert"},i().createElement("p",null,wp.i18n.__("The settings screen could not be displayed.","cf7-telegram")),i().createElement("button",{type:"button",className:"button",onClick:this.retry},wp.i18n.__("Try again","cf7-telegram"))):i().createElement(i().Fragment,{key:this.state.retryKey},this.props.children)}}const Qa=()=>{const[e,t]=(0,o.useState)([]),[n,a]=(0,o.useState)([]),[r,s]=(0,o.useState)([]),[l,c]=(0,o.useState)([]),[u,d]=(0,o.useState)([]),[f,p]=(0,o.useState)([]),[m,h]=(0,o.useState)([]),[g,v]=(0,o.useState)([]),[b,y]=(0,o.useState)(Za),w=(0,o.useCallback)(async(e,t,n)=>{y(t=>({...t,[e]:{status:"loading",error:null}}));try{const a=await t();return n(a),y(t=>({...t,[e]:{status:"success",error:null}})),a}catch(t){throw y(n=>({...n,[e]:{status:"error",error:t}})),t}},[]),C=(0,o.useCallback)(async()=>w("chats",async()=>{const[e,t]=await Promise.all([Ha(),La()]);return{connections:e,loadedChats:t}},({connections:e,loadedChats:t})=>{v((e=>e.map(e=>{const t=e.data?.meta?.status?.[0];return{...e,data:{...e.data,muted:"muted"===t}}}))(e)),s(t)}),[w]),E=(0,o.useCallback)((e=Xa)=>Promise.allSettled(e.map(e=>{switch(e){case"client":return w(e,Ra,()=>{});case"forms":return w(e,Va,t);case"bots":return w(e,Na,a);case"chats":return C();case"channels":return w(e,Aa,c);case"form2ChannelConnections":return w(e,$a,d);case"bot2ChannelConnections":return w(e,Ba,p);case"chat2ChannelConnections":return w(e,ja,h);default:return Promise.resolve()}})),[C,w]);(0,o.useEffect)(()=>{E()},[E]);const O=e=>b[e]?.status??"idle",S=(...e)=>e.some(e=>"error"===O(e))?"error":e.every(e=>"success"===O(e))?"ready":"loading",k=Xa.filter(e=>"error"===O(e));if(!Xa.some(e=>["success","error"].includes(O(e))))return i().createElement("div",null,wp.i18n.__("Loading data...","cf7-telegram"));const _=cf7TelegramData?.migration?.status||{},T=Boolean(cf7TelegramData?.migration?.show_action_button),x=!1!==_.can_retry,I="migration_failed"===_.last_error?.category?_.last_error.message:null;return i().createElement(i().Fragment,null,i().createElement("h1",null,wp.i18n.__("Telegram notificator settings","cf7-telegram")),k.length>0&&i().createElement("div",{className:"notice notice-error cf7t-notice cf7-tg-load-status",role:"alert"},i().createElement("p",null,wp.i18n.__("Some settings data could not be loaded.","cf7-telegram")),i().createElement("button",{type:"button",className:"button",onClick:()=>E(k)},wp.i18n.__("Retry failed requests","cf7-telegram"))),i().createElement("div",{className:"cf7-tg-container"},i().createElement("div",{className:"main-container"},i().createElement("div",{className:"list-container bots-container"},i().createElement("div",{className:"title-container"},i().createElement("h3",{className:"title"},wp.i18n.__("Bots","cf7-telegram")),i().createElement("p",{className:"title-description"},wp.i18n.__("A Telegram bot is required to run the integration. Create at least one bot, then connect it here.","cf7-telegram")," ",i().createElement("a",{href:"https://core.telegram.org/bots#3-how-do-i-create-a-bot",target:"_blank",rel:"noreferrer"},wp.i18n.__("How to create a bot","cf7-telegram"))),i().createElement(qa,{setBots:a,disabled:"success"!==O("bots")})),i().createElement("div",{className:"bot-list"},"error"===O("bots")&&i().createElement("p",{className:"resource-error"},wp.i18n.__("Bots could not be loaded.","cf7-telegram")),n.map(e=>i().createElement(Ka,{key:e.id,bot:e,chats:r,setChats:s,bot2ChatConnections:g,setBots:a,setBot2ChatConnections:v,bot2ChannelConnections:f,setBot2ChannelConnections:p,setChat2ChannelConnections:h,loadChatData:C,chatDataStatus:S("chats")})))),i().createElement("div",{className:"list-container channels-container"},i().createElement("div",{className:"title-container"},i().createElement("h3",{className:"title"},wp.i18n.__("Bridges","cf7-telegram")),i().createElement("p",{className:"title-description"},wp.i18n.__("A bridge is required to run the integration. Create at least one bridge, and add more when different forms should send messages to different sets of Telegram recipients.","cf7-telegram")),i().createElement(Ya,{setChannels:c,disabled:"success"!==O("channels")})),i().createElement("div",{className:"channel-list"},"error"===O("channels")&&i().createElement("p",{className:"resource-error"},wp.i18n.__("Bridges could not be loaded.","cf7-telegram")),l.map(t=>i().createElement(Wa,{key:t.id,channel:t,forms:e,setChannels:c,form2ChannelConnections:u,setForm2ChannelConnections:d,bots:n,bot2ChannelConnections:f,setBot2ChannelConnections:p,chats:r,chat2ChannelConnections:m,setChat2ChannelConnections:h,bot2ChatConnections:g,dataAvailability:{forms:S("forms","form2ChannelConnections"),bots:S("bots","bot2ChannelConnections"),chats:S("chats","chat2ChannelConnections")}})))))),T&&i().createElement("div",{className:"cf7-tg-migration-action"},i().createElement("form",{method:"post",action:cf7TelegramData?.migration?.action_url},i().createElement("input",{type:"hidden",name:"action",value:"cf7tg_migration_action"}),i().createElement("input",{type:"hidden",name:"cf7tg_migration_nonce",value:cf7TelegramData?.migration?.nonce}),i().createElement("p",null,_.is_failed?wp.i18n.__("Data migration failed. You can retry it now.","cf7-telegram"):wp.i18n.__("We detected settings from an older version that couldn’t be migrated automatically. Click the button below to migrate them to the new version.","cf7-telegram")),I&&i().createElement("p",{className:"cf7-tg-migration-error"},I),i().createElement("button",{type:"submit",className:"button button-primary",disabled:!x},_.is_failed?wp.i18n.__("Retry migration","cf7-telegram"):wp.i18n.__("Run migration","cf7-telegram")))),i().createElement("style",null,".copyable::after { content: '"+wp.i18n.__("Copied!","cf7-telegram")+"' !important }"))},er=()=>i().createElement(Ja,null,i().createElement(Qa,null));(0,s.render)(i().createElement(i().StrictMode,null,i().createElement(er,null)),document.getElementById("settings-content"))})(); -
cf7-telegram/tags/1.2.1/readme.txt
r3744804 r3772619 6 6 Tested up to: 7.1 7 7 Requires PHP: 8.0 8 Stable tag: 1.2. 08 Stable tag: 1.2.1 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 20 20 3. Paste the bot token into the bot form (PHP constants also available). 21 21 4. Create a bridge in the plugin UI. A bridge links Contact Form 7 forms, a Telegram bot, and one or more Telegram recipients. 22 5. Add users to the subscriber list by sending the <code>/cf7tg_start</code> command to your bot. To add a group, first add the bot to the group, then send <code>/cf7tg_start</code> in that group.23 6. Approve or decline subscription requests on the Contact Form 7 → CF7 Telegramsettings page.24 7. Configure the bridge: choose which forms it handles and which Telegram recipients should receive those messages. Create at least one bridge to run the integration, and add more when different forms should send messages to different sets of Telegram recipients.22 5. Keep the Contact Form 7 → CF7 Telegram settings page open while sending the bot's displayed <code>/cf7tg_start@BotName</code> command as a new standalone message. The page checks Telegram for new recipients. To add a group, first add the bot to the group, then send the command there. To add a forum topic, send it inside that topic. The <code>@BotName</code> suffix addresses the correct bot when Telegram group privacy mode is enabled. The short <code>/cf7tg_start</code> command is still supported when Telegram delivers it to the bot; editing an existing message does not register a recipient. 23 6. Approve or decline the subscription requests that appear on the settings page. 24 7. Configure the bridge: choose which forms it handles and which Telegram recipients should receive those messages. After approving a topic, select it in each desired bridge; approving it alone does not assign it to bridges. Create at least one bridge to run the integration, and add more when different forms should send messages to different sets of Telegram recipients. 25 25 26 26 **The integration is configured correctly when the bot panel is highlighted in blue and the bridge panel is highlighted in green.** … … 60 60 61 61 == Changelog == 62 63 = 1.2.1 = 64 - Send Contact Form 7 notifications to selected Telegram forum topics, with separate topic approval, bridge assignment, and delivery; preserve ordinary chat and General topic behavior. 65 - Show the bot-qualified discovery command and explain how to register a topic and assign it to bridges. 66 - Track Telegram topic names and let administrators set local recipient names or restore Telegram-provided names. 67 - Send notifications only to active recipients, and continue with other recipients when a topic delivery fails. 68 - Improve recipient actions with accessible icon buttons and keep bridge form choices in a top-aligned four-column layout. 62 69 63 70 = 1.2.0 = -
cf7-telegram/trunk/cf7-telegram.php
r3744804 r3772619 4 4 * Description: Sends CF7 messages to Telegram-chat 5 5 * Author: Hokku 6 * Version: 1.2. 06 * Version: 1.2.1 7 7 * License: GPL v2 or later 8 8 * License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 23 23 define( 'WPCF7TG_PLUGIN_NAME', plugin_basename( __FILE__ ) ); 24 24 25 const WPCF7TG_VERSION = '1.2. 0';25 const WPCF7TG_VERSION = '1.2.1'; 26 26 const WPCF7TG_FILE = __FILE__; 27 27 -
cf7-telegram/trunk/lib/Bot.php
r3676902 r3772619 377 377 $results = []; 378 378 $mode = TelegramMessageFormatter::normalizeMode( $mode ); 379 $messageThreadID = $chat->getMessageThreadID(); 379 380 380 381 foreach ( TelegramMessageFormatter::chunks( $message ) as $chunkIndex => $chunk ) { … … 382 383 [ 383 384 'chat_id' => $chat->getChatID(), 385 'message_thread_id' => $messageThreadID, 384 386 'text' => $chunk, 385 387 'parse_mode' => $mode, … … 607 609 private function processUpdate( array $update, RestBotUpdates $result, array &$processedChatIDs ): void { 608 610 $message = is_array( $update['message'] ?? null ) ? $update['message'] : []; 611 $topicEvent = $message['forum_topic_edited'] ?? $message['forum_topic_created'] ?? null; 612 if ( is_array( $topicEvent ) ) { 613 $name = Util::sanitizeTelegramText( $topicEvent['name'] ?? null ); 614 $chatID = Util::sanitizeTelegramChatID( $message['chat']['id'] ?? '' ); 615 $rawThreadID = $message['message_thread_id'] ?? ( isset( $message['forum_topic_created'] ) ? ( $message['message_id'] ?? null ) : null ); 616 try { 617 $threadID = Util::normalizeMessageThreadID( $rawThreadID ); 618 } catch ( \InvalidArgumentException $exception ) { 619 return; 620 } 621 if ( '' !== $name && null !== $threadID && 'supergroup' === ( $message['chat']['type'] ?? null ) && preg_match( '/^-?[1-9][0-9]*$/', $chatID ) ) { 622 $chat = Util::getChatByTelegramID( $chatID, $threadID ); 623 if ( $chat && $this->getChats()->contains( $chat ) && $chat->getTelegramTopicName() !== $name ) { 624 $chat->setTelegramTopicName( $name )->savePost(); 625 $result->hasUpdatedChats = true; 626 } 627 } 628 return; 629 } 609 630 610 631 if ( empty( $message ) || ! $this->messageHasBotCommand( $message ) ) { … … 616 637 } 617 638 618 $tgChatID = Util::sanitizeTelegramChatID( $message['chat']['id'] ?? '' ); 619 if ( '' === $tgChatID ) { 620 throw new \UnexpectedValueException( 'Telegram chat ID is empty after sanitization.' ); 621 } 622 623 if ( isset( $processedChatIDs[ $tgChatID ] ) ) { 639 if ( array_key_exists( 'direct_messages_topic', $message ) || ( is_array( $message['chat'] ?? null ) && array_key_exists( 'is_direct_messages', $message['chat'] ) ) ) { 624 640 return; 625 641 } 626 642 627 $processedChatIDs[ $tgChatID ] = true; 628 $chat = Util::getChatByTelegramID( $tgChatID ); 643 if ( true === ( $message['is_topic_message'] ?? false ) && 'private' === ( $message['chat']['type'] ?? null ) ) { 644 if ( ! array_key_exists( 'message_thread_id', $message ) || null === $message['message_thread_id'] ) { 645 throw new \InvalidArgumentException( 'Invalid Telegram topic ID.' ); 646 } 647 Util::normalizeMessageThreadID( $message['message_thread_id'] ); 648 return; 649 } 650 651 $rawChatID = $message['chat']['id'] ?? null; 652 if ( ! ( is_int( $rawChatID ) || is_string( $rawChatID ) ) || ! preg_match( '/^-?[1-9][0-9]*$/', (string) $rawChatID ) ) { 653 throw new \UnexpectedValueException( 'Invalid Telegram chat ID.' ); 654 } 655 $tgChatID = (string) $rawChatID; 656 $messageThreadID = Util::messageThreadIDFromUpdate( $message ); 657 $destination = $tgChatID . ':' . ( $messageThreadID ?? 0 ); 658 659 if ( isset( $processedChatIDs[ $destination ] ) ) { 660 return; 661 } 662 663 $processedChatIDs[ $destination ] = true; 664 $chat = Util::getChatByTelegramID( $tgChatID, $messageThreadID ); 629 665 630 666 if ( ! $chat ) { 631 $chat = Util::createChatFromArray( is_array( $message['chat'] ?? null ) ? $message['chat'] : [] );667 $chat = Util::createChatFromArray( is_array( $message['chat'] ?? null ) ? $message['chat'] : [], $messageThreadID ); 632 668 $result->hasNewChats = true; 633 669 } else { -
cf7-telegram/trunk/lib/Channel.php
r3675011 r3772619 10 10 use iTRON\cf7Telegram\Telegram\TelegramDeliveryResult; 11 11 use iTRON\wpConnections\Abstracts\Connection; 12 use iTRON\wpConnections\Exceptions\ConnectionNotFound; 12 13 use iTRON\wpConnections\Exceptions\ConnectionWrongData; 13 14 use iTRON\wpConnections\Exceptions\MissingParameters; … … 228 229 /** @var Chat $chat */ 229 230 try { 231 if ( Chat::STATUS_ACTIVE !== $chat->getBotConnectionStatus( $bot ) ) { 232 continue; 233 } 234 } catch ( ConnectionNotFound $exception ) { 235 continue; 236 } 237 238 $messageThreadID = null; 239 try { 240 $messageThreadID = $chat->getMessageThreadID(); 230 241 $results = $bot->sendMessage( 231 242 $chat, … … 247 258 $deliveries[] = [ 248 259 'chatID' => $chat->getChatID(), 260 'messageThreadID' => $messageThreadID, 249 261 'chatPostID' => $chat->getPost()->ID, 250 262 'results' => $results, -
cf7-telegram/trunk/lib/Chat.php
r3676902 r3772619 26 26 public const CUSTOM_NAME_PARAM = 'customName'; 27 27 public const TELEGRAM_TITLE_PARAM = 'telegramTitle'; 28 public const TELEGRAM_TOPIC_NAME_PARAM = 'telegramTopicName'; 28 29 29 30 /** … … 46 47 } 47 48 49 public function setMessageThreadID( $threadID ): Chat { 50 $this->setParam( 'messageThreadID', Util::normalizeMessageThreadID( $threadID ) ); 51 return $this; 52 } 53 54 public function getMessageThreadID(): ?int { 55 $threadID = Util::normalizeMessageThreadID( $this->getParam( 'messageThreadID' ) ); 56 if ( null !== $threadID && 'supergroup' !== $this->getChatType() ) { 57 throw new \InvalidArgumentException( 'Unsupported Telegram topic destination.' ); 58 } 59 return $threadID; 60 } 61 48 62 public function setChatType( string $chatType ): Chat { 49 63 $this->setParam( 'chatType', Util::sanitizeTelegramChatType( $chatType ) ); … … 89 103 public function getTelegramTitle(): string { 90 104 return Util::sanitizeTelegramText( $this->getParam( self::TELEGRAM_TITLE_PARAM ) ); 105 } 106 107 public function setTelegramTopicName( string $name ): Chat { 108 $this->setParam( self::TELEGRAM_TOPIC_NAME_PARAM, Util::sanitizeTelegramText( $name ) ); 109 return $this; 110 } 111 112 public function getTelegramTopicName(): string { 113 return Util::sanitizeTelegramText( $this->getParam( self::TELEGRAM_TOPIC_NAME_PARAM ) ); 91 114 } 92 115 … … 230 253 private function setChannelConnectionStatus( Channel $channel, string $status ): Chat { 231 254 $connection = $this->getChannelConnection( $channel ); 232 $connection->meta ->where( 'key', self::STATUS_KEY )->clear();255 $connection->meta = $connection->meta->filter( static fn( Meta $meta ): bool => self::STATUS_KEY !== $meta->getKey() ); 233 256 $connection->meta->add( new Meta( self::STATUS_KEY, $status ) ); 234 257 $connection->update(); … … 243 266 private function setBotConnectionStatus( Bot $bot, string $status ): Chat { 244 267 $connection = $this->getBotConnection( $bot ); 245 $connection->meta ->where( 'key', self::STATUS_KEY )->clear();268 $connection->meta = $connection->meta->filter( static fn( Meta $meta ): bool => self::STATUS_KEY !== $meta->getKey() ); 246 269 $connection->meta->add( new Meta( self::STATUS_KEY, $status ) ); 247 270 $connection->update(); -
cf7-telegram/trunk/lib/Controllers/RestApi/ChatController.php
r3676902 r3772619 123 123 124 124 try { 125 $result = $bot->getAPI()->getChat( $chat->getChatID() ); 126 127 if ( ! $result->ok || ! is_array( $result->result ) ) { 128 return $this->error( 'rest_chat_name_restore_failed', 'Telegram chat could not be loaded.', 502 ); 125 if ( null === $chat->getMessageThreadID() ) { 126 $result = $bot->getAPI()->getChat( $chat->getChatID() ); 127 128 if ( ! $result->ok || ! is_array( $result->result ) ) { 129 return $this->error( 'rest_chat_name_restore_failed', 'Telegram chat could not be loaded.', 502 ); 130 } 131 132 $chat->setTelegramData( $result->result ); 129 133 } 130 131 $chat->setTelegramData( $result->result );132 134 $chat->restoreTelegramName(); 133 135 $chat->savePost(); … … 147 149 $data['customName'] = $chat->getCustomName(); 148 150 $data['telegramName'] = $chat->getTelegramName(); 151 $data['telegramTopicName'] = $chat->getTelegramTopicName(); 152 $data['messageThreadID'] = $chat->getMessageThreadID(); 149 153 $response->set_data( $data ); 150 154 … … 199 203 private function checkNameAvailability( Chat $chat, Bot $bot ): ?WP_Error { 200 204 try { 201 if ( Chat::STATUS_PENDING === $chat->getBotConnectionStatus( $bot ) ) { 205 $status = $chat->getBotConnectionStatus( $bot ); 206 if ( null === $chat->getMessageThreadID() && Chat::STATUS_PENDING === $status ) { 202 207 return $this->error( 'rest_chat_name_pending', 'Pending chats cannot be renamed.', 409 ); 203 208 } -
cf7-telegram/trunk/lib/Migrations/LegacyImporter.php
r3675011 r3772619 418 418 foreach ( $this->getPostIDs( Client::CPT_CHAT ) as $postID ) { 419 419 $postData = $this->getPostData( $postID ); 420 if ( $chatID === $this->normalizeToken( $postData['chatID'] ?? '' ) ) { 421 return new Chat( $postID ); 422 } 420 if ( $chatID !== $this->normalizeToken( $postData['chatID'] ?? '' ) ) { 421 continue; 422 } 423 try { 424 if ( null !== Util::normalizeMessageThreadID( $postData['messageThreadID'] ?? null ) ) { 425 continue; 426 } 427 } catch ( \InvalidArgumentException $exception ) { 428 continue; 429 } 430 return new Chat( $postID ); 423 431 } 424 432 -
cf7-telegram/trunk/lib/RestBotUpdates.php
r3675011 r3772619 8 8 public bool $hasNewChats = false; 9 9 public bool $hasNewConnections = false; 10 public bool $hasUpdatedChats = false; 10 11 public bool $hasWebhookConflict = false; 11 12 public ?array $webhookInfo = null; -
cf7-telegram/trunk/lib/Settings.php
r3744804 r3772619 66 66 $asset = self::getReactBuildAsset(); 67 67 68 wp_enqueue_style( 'cf7-telegram-admin-styles', self::pluginUrl() . '/react/build/static/css/main.css', [ ], $asset['version'] );68 wp_enqueue_style( 'cf7-telegram-admin-styles', self::pluginUrl() . '/react/build/static/css/main.css', [ 'dashicons' ], $asset['version'] ); 69 69 wp_enqueue_style( 'gf-styles', 'https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap', null, WPCF7TG_VERSION ); 70 70 wp_enqueue_script( 'cf7-telegram-admin', self::pluginUrl() . '/react/build/static/js/main.js', $asset['dependencies'], $asset['version'], true ); -
cf7-telegram/trunk/lib/Util.php
r3676902 r3772619 96 96 } 97 97 98 static function normalizeMessageThreadID( $threadID ): ?int { 99 if ( null === $threadID ) { 100 return null; 101 } 102 103 if ( ! is_int( $threadID ) && ! is_string( $threadID ) ) { 104 throw new \InvalidArgumentException( 'Invalid Telegram topic ID.' ); 105 } 106 107 $value = (string) $threadID; 108 if ( ! preg_match( '/^[1-9][0-9]*$/', $value ) || (string) (int) $value !== $value ) { 109 throw new \InvalidArgumentException( 'Invalid Telegram topic ID.' ); 110 } 111 112 return 1 === (int) $value ? null : (int) $value; 113 } 114 115 static function messageThreadIDFromUpdate( array $message ): ?int { 116 $isTopic = $message['is_topic_message'] ?? false; 117 if ( ! is_bool( $isTopic ) ) { 118 throw new \InvalidArgumentException( 'Invalid Telegram topic flag.' ); 119 } 120 121 if ( ! $isTopic ) { 122 return null; 123 } 124 125 if ( 'supergroup' !== ( $message['chat']['type'] ?? null ) || ! array_key_exists( 'message_thread_id', $message ) || null === $message['message_thread_id'] ) { 126 throw new \InvalidArgumentException( 'Unsupported Telegram topic message.' ); 127 } 128 129 return self::normalizeMessageThreadID( $message['message_thread_id'] ); 130 } 131 98 132 /** 99 133 * @throws wppaLoadPostException 100 134 * @throws wppaCreatePostException 101 135 */ 102 static function getChatByTelegramID( $chatID ): ?Chat { 136 static function getChatByTelegramID( $chatID, ?int $messageThreadID = null ): ?Chat { 137 $messageThreadID = self::normalizeMessageThreadID( $messageThreadID ); 103 138 $chats = get_posts( [ 104 139 'post_type' => Client::CPT_CHAT, … … 110 145 foreach ( $chats as $postID ) { 111 146 $chat = new Chat( $postID ); 112 if ( $chat->getChatID() == $chatID ) {147 if ( (string) $chat->getChatID() === (string) $chatID && $chat->getMessageThreadID() === $messageThreadID ) { 113 148 return $chat; 114 149 } … … 121 156 * @throws wppaSavePostException 122 157 */ 123 static function createChat( $tg_chat ): Chat {158 static function createChat( $tg_chat, ?int $messageThreadID = null ): Chat { 124 159 $chat = new Chat(); 125 $chat->setTelegramData( $tg_chat )-> publish();160 $chat->setTelegramData( $tg_chat )->setMessageThreadID( $messageThreadID )->publish(); 126 161 127 162 return $chat; … … 131 166 * @throws wppaSavePostException 132 167 */ 133 static function createChatFromArray( array $tg_chat ): Chat {134 return self::createChat( $tg_chat );168 static function createChatFromArray( array $tg_chat, ?int $messageThreadID = null ): Chat { 169 return self::createChat( $tg_chat, $messageThreadID ); 135 170 } 136 171 -
cf7-telegram/trunk/react/build/main-rtl.css
r3676902 r3772619 1 body[class*=page_wpcf7_tg],body[class*=page_wpcf7_tg] #wpbody,body[class*=page_wpcf7_tg] #wpbody-content,body[class*=page_wpcf7_tg] #wpcontent,body[class*=page_wpcf7_tg] #wpwrap{background-color:#0e1621}body[class*=page_wpcf7_tg] #wpbody-content>.error:not(.cf7t-notice),body[class*=page_wpcf7_tg] #wpbody-content>.notice:not(.cf7t-notice),body[class*=page_wpcf7_tg] #wpbody-content>.update-nag:not(.cf7t-notice),body[class*=page_wpcf7_tg] #wpbody-content>.updated:not(.cf7t-notice){display:none!important}body[class*=page_wpcf7_tg] ul#adminmenu a.wp-has-current-submenu:after,body[class*=page_wpcf7_tg] ul#adminmenu>li.current>a.current:after{border-left-color:#0e1621}#cf7-telegram-container{background-color:#0e1621;box-sizing:border-box;min-height:100vh;padding:1px 0 20px 20px}#cf7-telegram-container h1,#cf7-telegram-container h2,#cf7-telegram-container h3,#cf7-telegram-container h4,#cf7-telegram-container h5,#cf7-telegram-container h6{color:#b5b5b5}#cf7-telegram-container #settings-content{color:#fff;font-family:Open Sans}.cf7-tg-container{display:flex;flex-direction:column;gap:32px;width:100%}@media(min-width:1440px){.cf7-tg-container{flex-direction:row}}.cf7-tg-container .main-container{display:flex;flex:3 1;flex-direction:column;gap:32px}@media(min-width:1120px){.cf7-tg-container .main-container{flex-direction:row}}.cf7-tg-container .list-container{display:flex;flex-direction:column;gap:20px}.cf7-tg-container .title-container{align-items:start;display:flex;flex-direction:column;padding:15px 0}.cf7-tg-container .title-container .title{margin:0}.cf7-tg-container .title-container .title-description{box-sizing:border-box;color:#656565;font-size:12px;height:72px;line-height:1.45;margin:6px 0 10px;max-width:460px;overflow-wrap:break-word}.cf7-tg-container .title-container .title-description a{color:#0c87b3}.cf7-tg-container .title-container .title-description a:hover{color:#0c88b4}.cf7-tg-container .title-container .add-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;margin:0;padding:0;text-align:center}.cf7-tg-container .title-container .add-button:hover{color:#0c87b3}.cf7-tg-container .entity-container{border-radius:12px;border-style:dashed;border-width:4px;flex-basis:500px;flex-shrink:0;transition:all .4s ease}.cf7-tg-container .entity-container.saving{opacity:.5}.cf7-tg-container .entity-container .entity-wrapper{display:flex;flex-direction:column;gap:0}.cf7-tg-container .entity-container .columns{display:flex;flex-direction:row;gap:10px}.cf7-tg-container .entity-container .columns .column{align-items:center;border-radius:5px;display:flex;flex-basis:100%;flex-grow:1;justify-content:center}.cf7-tg-container .entity-container .add-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .entity-container .add-button:hover{color:#0c87b3}.cf7-tg-container .frame{padding:10px 15px;position:relative}.cf7-tg-container .bots-container{width:375px}.cf7-tg-container .bots-container .bot-list{display:flex;flex-wrap:wrap;gap:10px}.cf7-tg-container .bots-container .bot-list .bot{border-color:#0c88b417;box-sizing:border-box;flex-basis:unset;width:100%}.cf7-tg-container .bots-container .bot-list .bot.offline{border-color:#9d6262}.cf7-tg-container .bots-container .bot-list .bot.online{border-color:#0c88b4}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary{align-items:center;display:flex; justify-content:space-between;position:relative}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title{display:flex;flex-direction:column;font-family:monospace}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name{border:solid #082d3b;border-top-right-radius:5px;border-top-left-radius:5px;border-width:1px 1px 0;color:#7499b3;font-size:15px;font-weight:100;margin:0;max-width:190px;padding:2px 8px;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name.offline{color:#9d6262!important}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name a,.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name a:active,.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name a:focus,.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name a:visited{color:inherit;outline:none!important;text-decoration:none;-webkit-tap-highlight-color:rgba(0,0,0,0);box-shadow:0 0 0 2px #0003}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-command{background-color:#112747;border:1px solid #112747;border-bottom-right-radius:5px;border-bottom-left-radius:5px;border-top:0 solid #112747;color:#7499b3;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token{color:#465b79;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .show-token{cursor:pointer;font-family:monospace}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .show-token.const{cursor:default}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .php-const-hint{cursor:pointer;font-size:10px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .edit-token,.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .token-value{background-color:#09090c;font-family:Monospace,serif;padding:2px 5px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .edit-token{border:1px solid rgba(12,136,180,.278);box-shadow:none;color:inherit;height:45px;right:50%;line-height:100%;padding:0 10px;position:absolute;text-align:inherit;top:50%;transform:translate(50%,-50%);width:98%}.cf7-tg-container .bots-container .bot-list .bot-wrapper.offline .bot-name{color:#9d6262!important}.cf7-tg-container .bots-container .bot-list .bot-wrapper.online .bot-name{box-shadow:0 0 20px 0 rgba(12,136,180,.322)}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot h5{color:#375885;font-size:11px;margin:0;text-align:center;text-transform:uppercase}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot ul{margin:0}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item{align-items:center;display:flex;justify-content:start}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .chat-name{box-sizing:border-box;overflow-wrap:anywhere;text-align:left;width:120px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .edit-chat-name{background:#0000;border:1px solid rgba(12,136,180,.278);box-shadow:none;color:inherit;font-family:inherit;font-size:inherit;line-height:inherit;min-height:24px;padding:0 5px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item.active{color:#35894c}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item.pending{color:#898735}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item.muted{color:#893535}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item span{cursor:pointer;padding:0 5px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item span.action{color:#656565;text-align:center;text-transform:uppercase}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item span.action:hover{color:#873d3d}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .no-chats-found{color:#0c88b4;font-size:12px;font-style:italic;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .offline-bot-sad-message{color:#9d6262;font-size:12px;font-style:italic;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .unknown-bot-status-message{color:#0c88b4;font-size:12px;font-style:italic;opacity:.25;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar{align-items:center;display:flex;justify-content:space-between}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .remove-bot-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .remove-bot-button:hover{color:#873d3d}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .bot-status{font-size:12px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .bot-status.online{color:#0c88b4}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .bot-status.offline{color:#9d6262}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .bot-status.unknown{color:#b5b5b5}.cf7-tg-container .channels-container{flex:1;max-width:508px}@media(min-width:1880px){.cf7-tg-container .channels-container{max-width:1026px}}.cf7-tg-container .channels-container .channel-list{display:flex;flex-wrap:wrap;gap:10px}.cf7-tg-container .channels-container .channel-list .channel{border-color:#656565;color:#656565;display:flex;flex-direction:column}.cf7-tg-container .channels-container .channel-list .channel.has-bot-online.has-active-chats.has-forms{border-color:#69ad7a;box-shadow:inset 0 0 12px 0 #2f4f37;color:#69ad7a}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper{flex-grow:1}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper{box-sizing:border-box;color:inherit;display:flex;flex-direction:column;font-size:17px;font-weight:500;justify-content:center;line-height:17px;min-height:60px;text-align:center}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper .channel-title{color:inherit;cursor:pointer;line-height:inherit;margin:0;text-align:inherit}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper input.edit-title{background:#0000;border:none;box-shadow:none;color:inherit;font-family:inherit;font-size:1em;font-weight:inherit;height:100%;right:0;line-height:inherit;margin:0;outline:none;padding:0;position:relative;text-align:inherit;text-shadow:none;text-transform:none;top:0;width:100%}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper .bot-for-channel{align-items:center;border:1px dashed #0c88b4;border-radius:5px;color:#0c88b4;display:inline-flex;gap:10px;justify-content:space-between;padding:7px 11px}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper .bot-for-channel.offline{border-color:#9d6262;color:#9d6262}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper .bot-for-channel span{font-family:monospace}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__indicator-separator{background-color:#2b365954}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__control{background-color:#0e1621;border-color:#656565;border-style:dashed;box-shadow:none;cursor:pointer;font-size:13px;min-width:180px}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__menu{border-color:#2b365954;border-width:1px}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__menu,.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__option{background-color:#0e1621;color:#707070;cursor:pointer;font-size:13px}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__menu--is-focused,.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__option--is-focused{background-color:#061215}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .status-bar{align-items:center;display:flex;justify-content:space-between;margin-top:auto}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .status-bar .remove-channel-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .status-bar .remove-channel-button:hover{color:#873d3d}.cf7-tg-container .channels-container .channel-list .channel .chats{align-items:center;border-color:#505145;box-sizing:border-box;display:flex;gap:5px;margin:0;min-height:65px}.cf7-tg-container .channels-container .channel-list .channel .chats .chat{border:1px dashed #898735;border-radius:5px;color:#898735;cursor:pointer;display:inline;margin:0;padding:5px 10px}.cf7-tg-container .channels-container .channel-list .channel .chats .chat.active{border-color:#487d44;color:#487d44}.cf7-tg-container .channels-container .channel-list .channel .chats .chat.muted{border-color:#656565;color:#656565}.cf7-tg-container .channels-container .channel-list .channel .chats .chat.active .chat-username{color:#487d44}.cf7-tg-container .channels-container .channel-list .channel .chats .chat .chat-toggle-status{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .channels-container .channel-list .channel .chats .chat .chat-toggle-status:hover{color:#873d3d}.cf7-tg-container .channels-container .channel-list .channel .chats .no-chats-found{color:#656565;display:block;text-align:center;width:100%}.cf7-tg-container .channels-container .channel-list .channel .forms{border-color:#797083;box-sizing:border-box;min-height:75px}.cf7-tg-container .channels-container .channel-list .channel .forms .add-button{display:block}.cf7-tg-container .channels-container .channel-list .channel .forms .form-list{align-items:center;display:inline-flex;gap:8px}.cf7-tg-container .channels-container .channel-list .channel .forms .form-list.show-selector{opacity:.1}.cf7-tg-container .channels-container .channel-list .channel .forms .form-list li{align-items:center;border:1px dashed #2f4f37;border-radius:5px;color:#487d44;display:inline-flex;gap:8px;padding:5px 10px}.cf7-tg-container .channels-container .channel-list .channel .forms .form-picker{right:15px;position:absolute;top:35px;z-index:5}.cf7-tg-container .channels-container .channel-list .channel .forms .no-forms-found{color:#656565;display:block;text-align:center;width:100%}.cf7-tg-container .channels-container .channel-list .channel .detach-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux{height:20px;position:relative;width:20px}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:after,.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:before{background-color:#1f3047;content:"";display:block;height:1px;position:absolute;top:50%;transition:all .2s ease;width:20px}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:before{transform:rotate(-45deg)}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:after{transform:rotate(45deg)}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:hover:after,.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:hover:before{background-color:#873d3d}.cf7-tg-container .channels-container .channel-list .channel .detach-button:hover{color:#873d3d}.cf7-tg-container .copyable{cursor:pointer;display:inline-block;position:relative}.cf7-tg-container .copyable:after{background-color:#333;border-radius:4px;bottom:120%;color:#fff;content:"Copied!";font-size:12px;right:50%;opacity:0;padding:4px 8px;pointer-events:none;position:absolute;transform:translateX(50%);transition:opacity .3s;white-space:nowrap}.cf7-tg-container .copyable.copied:after{opacity:1}#cf7-telegram-container .cf7-tg-load-status{padding-bottom:10px}#cf7-telegram-container .resource-error{color:#b32d2e}#cf7-telegram-container .resource-loading{color:#656565}#cf7-telegram-container .cf7-tg-error-boundary{padding:20px}1 body[class*=page_wpcf7_tg],body[class*=page_wpcf7_tg] #wpbody,body[class*=page_wpcf7_tg] #wpbody-content,body[class*=page_wpcf7_tg] #wpcontent,body[class*=page_wpcf7_tg] #wpwrap{background-color:#0e1621}body[class*=page_wpcf7_tg] #wpbody-content>.error:not(.cf7t-notice),body[class*=page_wpcf7_tg] #wpbody-content>.notice:not(.cf7t-notice),body[class*=page_wpcf7_tg] #wpbody-content>.update-nag:not(.cf7t-notice),body[class*=page_wpcf7_tg] #wpbody-content>.updated:not(.cf7t-notice){display:none!important}body[class*=page_wpcf7_tg] ul#adminmenu a.wp-has-current-submenu:after,body[class*=page_wpcf7_tg] ul#adminmenu>li.current>a.current:after{border-left-color:#0e1621}#cf7-telegram-container{background-color:#0e1621;box-sizing:border-box;min-height:100vh;padding:1px 0 20px 20px}#cf7-telegram-container h1,#cf7-telegram-container h2,#cf7-telegram-container h3,#cf7-telegram-container h4,#cf7-telegram-container h5,#cf7-telegram-container h6{color:#b5b5b5}#cf7-telegram-container #settings-content{color:#fff;font-family:Open Sans}.cf7-tg-container{display:flex;flex-direction:column;gap:32px;width:100%}@media(min-width:1440px){.cf7-tg-container{flex-direction:row}}.cf7-tg-container .main-container{display:flex;flex:3 1;flex-direction:column;gap:32px}@media(min-width:1120px){.cf7-tg-container .main-container{flex-direction:row}}.cf7-tg-container .list-container{display:flex;flex-direction:column;gap:20px}.cf7-tg-container .title-container{align-items:start;display:flex;flex-direction:column;padding:15px 0}.cf7-tg-container .title-container .title{margin:0}.cf7-tg-container .title-container .title-description{box-sizing:border-box;color:#656565;font-size:12px;height:72px;line-height:1.45;margin:6px 0 10px;max-width:460px;overflow-wrap:break-word}.cf7-tg-container .title-container .title-description a{color:#0c87b3}.cf7-tg-container .title-container .title-description a:hover{color:#0c88b4}.cf7-tg-container .title-container .add-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;margin:0;padding:0;text-align:center}.cf7-tg-container .title-container .add-button:hover{color:#0c87b3}.cf7-tg-container .entity-container{border-radius:12px;border-style:dashed;border-width:4px;flex-basis:500px;flex-shrink:0;transition:all .4s ease}.cf7-tg-container .entity-container.saving{opacity:.5}.cf7-tg-container .entity-container .entity-wrapper{display:flex;flex-direction:column;gap:0}.cf7-tg-container .entity-container .columns{display:flex;flex-direction:row;gap:10px}.cf7-tg-container .entity-container .columns .column{align-items:center;border-radius:5px;display:flex;flex-basis:100%;flex-grow:1;justify-content:center}.cf7-tg-container .entity-container .add-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .entity-container .add-button:hover{color:#0c87b3}.cf7-tg-container .frame{padding:10px 15px;position:relative}.cf7-tg-container .bots-container{width:375px}.cf7-tg-container .bots-container .bot-list{display:flex;flex-wrap:wrap;gap:10px}.cf7-tg-container .bots-container .bot-list .bot{border-color:#0c88b417;box-sizing:border-box;flex-basis:unset;width:100%}.cf7-tg-container .bots-container .bot-list .bot.offline{border-color:#9d6262}.cf7-tg-container .bots-container .bot-list .bot.online{border-color:#0c88b4}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary{align-items:center;display:flex;gap:8px;justify-content:space-between;position:relative}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title{display:flex;flex-direction:column;font-family:monospace;min-width:0}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name{border:solid #082d3b;border-top-right-radius:5px;border-top-left-radius:5px;border-width:1px 1px 0;color:#7499b3;font-size:15px;font-weight:100;margin:0;max-width:190px;padding:2px 8px;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name.offline{color:#9d6262!important}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name a,.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name a:active,.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name a:focus,.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name a:visited{color:inherit;outline:none!important;text-decoration:none;-webkit-tap-highlight-color:rgba(0,0,0,0);box-shadow:0 0 0 2px #0003}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-command{background-color:#112747;border:1px solid #112747;border-bottom-right-radius:5px;border-bottom-left-radius:5px;border-top:0 solid #112747;color:#7499b3;overflow-wrap:anywhere;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token{color:#465b79;flex-shrink:0;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .show-token{cursor:pointer;font-family:monospace}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .show-token.const{cursor:default}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .php-const-hint{cursor:pointer;font-size:10px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .edit-token,.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .token-value{background-color:#09090c;font-family:Monospace,serif;padding:2px 5px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .edit-token{border:1px solid rgba(12,136,180,.278);box-shadow:none;color:inherit;height:45px;right:50%;line-height:100%;padding:0 10px;position:absolute;text-align:inherit;top:50%;transform:translate(50%,-50%);width:98%}.cf7-tg-container .bots-container .bot-list .bot-wrapper.offline .bot-name{color:#9d6262!important}.cf7-tg-container .bots-container .bot-list .bot-wrapper.online .bot-name{box-shadow:0 0 20px 0 rgba(12,136,180,.322)}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot h5{color:#375885;font-size:11px;margin:0;text-align:center;text-transform:uppercase}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot ul{margin:0}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item{align-items:center;display:flex;justify-content:start}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .chat-name{box-sizing:border-box;overflow-wrap:anywhere;padding:0 5px;text-align:left;width:120px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .topic-identity{margin-right:4px;min-width:0;overflow-wrap:anywhere}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .edit-chat-name{background:#0000;border:1px solid rgba(12,136,180,.278);box-shadow:none;color:inherit;font-family:inherit;font-size:inherit;line-height:inherit;min-height:24px;padding:0 5px;width:120px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item.active{color:#35894c}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item.pending{color:#898735}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item.muted{color:#893535}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .chat-actions{display:flex;flex:0 0 auto;gap:2px;margin-right:auto}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .chat-actions .action{align-items:center;background:none;border:0;color:#656565;cursor:pointer;display:inline-flex;height:24px;justify-content:center;opacity:.25;padding:0;width:24px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .chat-actions .action:hover:not(:disabled){color:#873d3d;opacity:1}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .chat-actions .action:focus-visible{opacity:1;outline:2px solid #0c88b4;outline-offset:1px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .chat-actions .action:disabled{cursor:default}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .no-chats-found{color:#0c88b4;font-size:12px;font-style:italic;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .offline-bot-sad-message{color:#9d6262;font-size:12px;font-style:italic;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .unknown-bot-status-message{color:#0c88b4;font-size:12px;font-style:italic;opacity:.25;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar{align-items:center;display:flex;justify-content:space-between}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .remove-bot-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .remove-bot-button:hover{color:#873d3d}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .bot-status{font-size:12px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .bot-status.online{color:#0c88b4}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .bot-status.offline{color:#9d6262}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .bot-status.unknown{color:#b5b5b5}.cf7-tg-container .channels-container{flex:1;max-width:508px}@media(min-width:1880px){.cf7-tg-container .channels-container{max-width:1026px}}.cf7-tg-container .channels-container .channel-list{display:flex;flex-wrap:wrap;gap:10px}.cf7-tg-container .channels-container .channel-list .channel{border-color:#656565;color:#656565;display:flex;flex-direction:column}.cf7-tg-container .channels-container .channel-list .channel.has-bot-online.has-active-chats.has-forms{border-color:#69ad7a;box-shadow:inset 0 0 12px 0 #2f4f37;color:#69ad7a}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper{flex-grow:1}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper{box-sizing:border-box;color:inherit;display:flex;flex-direction:column;font-size:17px;font-weight:500;justify-content:center;line-height:17px;min-height:60px;text-align:center}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper .channel-title{color:inherit;cursor:pointer;line-height:inherit;margin:0;text-align:inherit}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper input.edit-title{background:#0000;border:none;box-shadow:none;color:inherit;font-family:inherit;font-size:1em;font-weight:inherit;height:100%;right:0;line-height:inherit;margin:0;outline:none;padding:0;position:relative;text-align:inherit;text-shadow:none;text-transform:none;top:0;width:100%}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper .bot-for-channel{align-items:center;border:1px dashed #0c88b4;border-radius:5px;color:#0c88b4;display:inline-flex;gap:10px;justify-content:space-between;padding:7px 11px}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper .bot-for-channel.offline{border-color:#9d6262;color:#9d6262}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper .bot-for-channel span{font-family:monospace}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__indicator-separator{background-color:#2b365954}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__control{background-color:#0e1621;border-color:#656565;border-style:dashed;box-shadow:none;cursor:pointer;font-size:13px;min-width:180px}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__menu{border-color:#2b365954;border-width:1px}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__menu,.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__option{background-color:#0e1621;color:#707070;cursor:pointer;font-size:13px}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__menu--is-focused,.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__option--is-focused{background-color:#061215}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .status-bar{align-items:center;display:flex;justify-content:space-between;margin-top:auto}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .status-bar .remove-channel-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .status-bar .remove-channel-button:hover{color:#873d3d}.cf7-tg-container .channels-container .channel-list .channel .chats{align-items:center;border-color:#505145;box-sizing:border-box;display:flex;gap:5px;margin:0;min-height:65px}.cf7-tg-container .channels-container .channel-list .channel .chats .chat{border:1px dashed #898735;border-radius:5px;color:#898735;cursor:pointer;display:inline;margin:0;padding:5px 10px}.cf7-tg-container .channels-container .channel-list .channel .chats .chat.active{border-color:#487d44;color:#487d44}.cf7-tg-container .channels-container .channel-list .channel .chats .chat.muted{border-color:#656565;color:#656565}.cf7-tg-container .channels-container .channel-list .channel .chats .chat.active .chat-username{color:#487d44}.cf7-tg-container .channels-container .channel-list .channel .chats .chat .chat-toggle-status{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .channels-container .channel-list .channel .chats .chat .chat-toggle-status:hover{color:#873d3d}.cf7-tg-container .channels-container .channel-list .channel .chats .no-chats-found{color:#656565;display:block;text-align:center;width:100%}.cf7-tg-container .channels-container .channel-list .channel .forms{border-color:#797083;box-sizing:border-box;min-height:75px}.cf7-tg-container .channels-container .channel-list .channel .forms .add-button{display:block}.cf7-tg-container .channels-container .channel-list .channel .forms .form-list{align-items:start;display:grid;gap:8px;grid-template-columns:repeat(4,minmax(0,1fr));max-width:624px}.cf7-tg-container .channels-container .channel-list .channel .forms .form-list.show-selector{opacity:.1}.cf7-tg-container .channels-container .channel-list .channel .forms .form-list li{align-items:flex-start;border:1px dashed #2f4f37;border-radius:5px;box-sizing:border-box;color:#487d44;display:inline-flex;gap:8px;max-width:150px;min-width:0;overflow-wrap:anywhere;padding:5px 10px}.cf7-tg-container .channels-container .channel-list .channel .forms .form-list li .detach-button{flex-shrink:0}.cf7-tg-container .channels-container .channel-list .channel .forms .form-picker{right:15px;position:absolute;top:35px;z-index:5}.cf7-tg-container .channels-container .channel-list .channel .forms .no-forms-found{color:#656565;display:block;text-align:center;width:100%}.cf7-tg-container .channels-container .channel-list .channel .detach-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux{height:20px;position:relative;width:20px}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:after,.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:before{background-color:#1f3047;content:"";display:block;height:1px;position:absolute;top:50%;transition:all .2s ease;width:20px}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:before{transform:rotate(-45deg)}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:after{transform:rotate(45deg)}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:hover:after,.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:hover:before{background-color:#873d3d}.cf7-tg-container .channels-container .channel-list .channel .detach-button:hover{color:#873d3d}.cf7-tg-container .copyable{cursor:pointer;display:inline-block;position:relative}.cf7-tg-container .copyable:after{background-color:#333;border-radius:4px;bottom:120%;color:#fff;content:"Copied!";font-size:12px;right:50%;opacity:0;padding:4px 8px;pointer-events:none;position:absolute;transform:translateX(50%);transition:opacity .3s;white-space:nowrap}.cf7-tg-container .copyable.copied:after{opacity:1}#cf7-telegram-container .cf7-tg-load-status{padding-bottom:10px}#cf7-telegram-container .resource-error{color:#b32d2e}#cf7-telegram-container .resource-loading{color:#656565}#cf7-telegram-container .cf7-tg-error-boundary{padding:20px} -
cf7-telegram/trunk/react/build/static/css/main.css
r3676902 r3772619 1 body[class*=page_wpcf7_tg],body[class*=page_wpcf7_tg] #wpbody,body[class*=page_wpcf7_tg] #wpbody-content,body[class*=page_wpcf7_tg] #wpcontent,body[class*=page_wpcf7_tg] #wpwrap{background-color:#0e1621}body[class*=page_wpcf7_tg] #wpbody-content>.error:not(.cf7t-notice),body[class*=page_wpcf7_tg] #wpbody-content>.notice:not(.cf7t-notice),body[class*=page_wpcf7_tg] #wpbody-content>.update-nag:not(.cf7t-notice),body[class*=page_wpcf7_tg] #wpbody-content>.updated:not(.cf7t-notice){display:none!important}body[class*=page_wpcf7_tg] ul#adminmenu a.wp-has-current-submenu:after,body[class*=page_wpcf7_tg] ul#adminmenu>li.current>a.current:after{border-right-color:#0e1621}#cf7-telegram-container{background-color:#0e1621;box-sizing:border-box;min-height:100vh;padding:1px 20px 20px 0}#cf7-telegram-container h1,#cf7-telegram-container h2,#cf7-telegram-container h3,#cf7-telegram-container h4,#cf7-telegram-container h5,#cf7-telegram-container h6{color:#b5b5b5}#cf7-telegram-container #settings-content{color:#fff;font-family:Open Sans}.cf7-tg-container{display:flex;flex-direction:column;gap:32px;width:100%}@media(min-width:1440px){.cf7-tg-container{flex-direction:row}}.cf7-tg-container .main-container{display:flex;flex:3 1;flex-direction:column;gap:32px}@media(min-width:1120px){.cf7-tg-container .main-container{flex-direction:row}}.cf7-tg-container .list-container{display:flex;flex-direction:column;gap:20px}.cf7-tg-container .title-container{align-items:start;display:flex;flex-direction:column;padding:15px 0}.cf7-tg-container .title-container .title{margin:0}.cf7-tg-container .title-container .title-description{box-sizing:border-box;color:#656565;font-size:12px;height:72px;line-height:1.45;margin:6px 0 10px;max-width:460px;overflow-wrap:break-word}.cf7-tg-container .title-container .title-description a{color:#0c87b3}.cf7-tg-container .title-container .title-description a:hover{color:#0c88b4}.cf7-tg-container .title-container .add-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;margin:0;padding:0;text-align:center}.cf7-tg-container .title-container .add-button:hover{color:#0c87b3}.cf7-tg-container .entity-container{border-radius:12px;border-style:dashed;border-width:4px;flex-basis:500px;flex-shrink:0;transition:all .4s ease}.cf7-tg-container .entity-container.saving{opacity:.5}.cf7-tg-container .entity-container .entity-wrapper{display:flex;flex-direction:column;gap:0}.cf7-tg-container .entity-container .columns{display:flex;flex-direction:row;gap:10px}.cf7-tg-container .entity-container .columns .column{align-items:center;border-radius:5px;display:flex;flex-basis:100%;flex-grow:1;justify-content:center}.cf7-tg-container .entity-container .add-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .entity-container .add-button:hover{color:#0c87b3}.cf7-tg-container .frame{padding:10px 15px;position:relative}.cf7-tg-container .bots-container{width:375px}.cf7-tg-container .bots-container .bot-list{display:flex;flex-wrap:wrap;gap:10px}.cf7-tg-container .bots-container .bot-list .bot{border-color:#0c88b417;box-sizing:border-box;flex-basis:unset;width:100%}.cf7-tg-container .bots-container .bot-list .bot.offline{border-color:#9d6262}.cf7-tg-container .bots-container .bot-list .bot.online{border-color:#0c88b4}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary{align-items:center;display:flex; justify-content:space-between;position:relative}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title{display:flex;flex-direction:column;font-family:monospace}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name{border:solid #082d3b;border-top-left-radius:5px;border-top-right-radius:5px;border-width:1px 1px 0;color:#7499b3;font-size:15px;font-weight:100;margin:0;max-width:190px;padding:2px 8px;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name.offline{color:#9d6262!important}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name a,.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name a:active,.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name a:focus,.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name a:visited{color:inherit;outline:none!important;text-decoration:none;-webkit-tap-highlight-color:rgba(0,0,0,0);box-shadow:0 0 0 2px #0003}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-command{background-color:#112747;border:1px solid #112747;border-bottom-left-radius:5px;border-bottom-right-radius:5px;border-top:0 solid #112747;color:#7499b3;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token{color:#465b79;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .show-token{cursor:pointer;font-family:monospace}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .show-token.const{cursor:default}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .php-const-hint{cursor:pointer;font-size:10px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .edit-token,.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .token-value{background-color:#09090c;font-family:Monospace,serif;padding:2px 5px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .edit-token{border:1px solid rgba(12,136,180,.278);box-shadow:none;color:inherit;height:45px;left:50%;line-height:100%;padding:0 10px;position:absolute;text-align:inherit;top:50%;transform:translate(-50%,-50%);width:98%}.cf7-tg-container .bots-container .bot-list .bot-wrapper.offline .bot-name{color:#9d6262!important}.cf7-tg-container .bots-container .bot-list .bot-wrapper.online .bot-name{box-shadow:0 0 20px 0 rgba(12,136,180,.322)}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot h5{color:#375885;font-size:11px;margin:0;text-align:center;text-transform:uppercase}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot ul{margin:0}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item{align-items:center;display:flex;justify-content:start}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .chat-name{box-sizing:border-box;overflow-wrap:anywhere;text-align:right;width:120px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .edit-chat-name{background:#0000;border:1px solid rgba(12,136,180,.278);box-shadow:none;color:inherit;font-family:inherit;font-size:inherit;line-height:inherit;min-height:24px;padding:0 5px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item.active{color:#35894c}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item.pending{color:#898735}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item.muted{color:#893535}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item span{cursor:pointer;padding:0 5px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item span.action{color:#656565;text-align:center;text-transform:uppercase}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item span.action:hover{color:#873d3d}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .no-chats-found{color:#0c88b4;font-size:12px;font-style:italic;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .offline-bot-sad-message{color:#9d6262;font-size:12px;font-style:italic;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .unknown-bot-status-message{color:#0c88b4;font-size:12px;font-style:italic;opacity:.25;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar{align-items:center;display:flex;justify-content:space-between}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .remove-bot-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .remove-bot-button:hover{color:#873d3d}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .bot-status{font-size:12px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .bot-status.online{color:#0c88b4}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .bot-status.offline{color:#9d6262}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .bot-status.unknown{color:#b5b5b5}.cf7-tg-container .channels-container{flex:1;max-width:508px}@media(min-width:1880px){.cf7-tg-container .channels-container{max-width:1026px}}.cf7-tg-container .channels-container .channel-list{display:flex;flex-wrap:wrap;gap:10px}.cf7-tg-container .channels-container .channel-list .channel{border-color:#656565;color:#656565;display:flex;flex-direction:column}.cf7-tg-container .channels-container .channel-list .channel.has-bot-online.has-active-chats.has-forms{border-color:#69ad7a;box-shadow:inset 0 0 12px 0 #2f4f37;color:#69ad7a}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper{flex-grow:1}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper{box-sizing:border-box;color:inherit;display:flex;flex-direction:column;font-size:17px;font-weight:500;justify-content:center;line-height:17px;min-height:60px;text-align:center}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper .channel-title{color:inherit;cursor:pointer;line-height:inherit;margin:0;text-align:inherit}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper input.edit-title{background:#0000;border:none;box-shadow:none;color:inherit;font-family:inherit;font-size:1em;font-weight:inherit;height:100%;left:0;line-height:inherit;margin:0;outline:none;padding:0;position:relative;text-align:inherit;text-shadow:none;text-transform:none;top:0;width:100%}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper .bot-for-channel{align-items:center;border:1px dashed #0c88b4;border-radius:5px;color:#0c88b4;display:inline-flex;gap:10px;justify-content:space-between;padding:7px 11px}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper .bot-for-channel.offline{border-color:#9d6262;color:#9d6262}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper .bot-for-channel span{font-family:monospace}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__indicator-separator{background-color:#2b365954}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__control{background-color:#0e1621;border-color:#656565;border-style:dashed;box-shadow:none;cursor:pointer;font-size:13px;min-width:180px}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__menu{border-color:#2b365954;border-width:1px}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__menu,.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__option{background-color:#0e1621;color:#707070;cursor:pointer;font-size:13px}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__menu--is-focused,.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__option--is-focused{background-color:#061215}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .status-bar{align-items:center;display:flex;justify-content:space-between;margin-top:auto}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .status-bar .remove-channel-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .status-bar .remove-channel-button:hover{color:#873d3d}.cf7-tg-container .channels-container .channel-list .channel .chats{align-items:center;border-color:#505145;box-sizing:border-box;display:flex;gap:5px;margin:0;min-height:65px}.cf7-tg-container .channels-container .channel-list .channel .chats .chat{border:1px dashed #898735;border-radius:5px;color:#898735;cursor:pointer;display:inline;margin:0;padding:5px 10px}.cf7-tg-container .channels-container .channel-list .channel .chats .chat.active{border-color:#487d44;color:#487d44}.cf7-tg-container .channels-container .channel-list .channel .chats .chat.muted{border-color:#656565;color:#656565}.cf7-tg-container .channels-container .channel-list .channel .chats .chat.active .chat-username{color:#487d44}.cf7-tg-container .channels-container .channel-list .channel .chats .chat .chat-toggle-status{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .channels-container .channel-list .channel .chats .chat .chat-toggle-status:hover{color:#873d3d}.cf7-tg-container .channels-container .channel-list .channel .chats .no-chats-found{color:#656565;display:block;text-align:center;width:100%}.cf7-tg-container .channels-container .channel-list .channel .forms{border-color:#797083;box-sizing:border-box;min-height:75px}.cf7-tg-container .channels-container .channel-list .channel .forms .add-button{display:block}.cf7-tg-container .channels-container .channel-list .channel .forms .form-list{align-items:center;display:inline-flex;gap:8px}.cf7-tg-container .channels-container .channel-list .channel .forms .form-list.show-selector{opacity:.1}.cf7-tg-container .channels-container .channel-list .channel .forms .form-list li{align-items:center;border:1px dashed #2f4f37;border-radius:5px;color:#487d44;display:inline-flex;gap:8px;padding:5px 10px}.cf7-tg-container .channels-container .channel-list .channel .forms .form-picker{left:15px;position:absolute;top:35px;z-index:5}.cf7-tg-container .channels-container .channel-list .channel .forms .no-forms-found{color:#656565;display:block;text-align:center;width:100%}.cf7-tg-container .channels-container .channel-list .channel .detach-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux{height:20px;position:relative;width:20px}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:after,.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:before{background-color:#1f3047;content:"";display:block;height:1px;position:absolute;top:50%;transition:all .2s ease;width:20px}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:before{transform:rotate(45deg)}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:after{transform:rotate(-45deg)}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:hover:after,.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:hover:before{background-color:#873d3d}.cf7-tg-container .channels-container .channel-list .channel .detach-button:hover{color:#873d3d}.cf7-tg-container .copyable{cursor:pointer;display:inline-block;position:relative}.cf7-tg-container .copyable:after{background-color:#333;border-radius:4px;bottom:120%;color:#fff;content:"Copied!";font-size:12px;left:50%;opacity:0;padding:4px 8px;pointer-events:none;position:absolute;transform:translateX(-50%);transition:opacity .3s;white-space:nowrap}.cf7-tg-container .copyable.copied:after{opacity:1}#cf7-telegram-container .cf7-tg-load-status{padding-bottom:10px}#cf7-telegram-container .resource-error{color:#b32d2e}#cf7-telegram-container .resource-loading{color:#656565}#cf7-telegram-container .cf7-tg-error-boundary{padding:20px}1 body[class*=page_wpcf7_tg],body[class*=page_wpcf7_tg] #wpbody,body[class*=page_wpcf7_tg] #wpbody-content,body[class*=page_wpcf7_tg] #wpcontent,body[class*=page_wpcf7_tg] #wpwrap{background-color:#0e1621}body[class*=page_wpcf7_tg] #wpbody-content>.error:not(.cf7t-notice),body[class*=page_wpcf7_tg] #wpbody-content>.notice:not(.cf7t-notice),body[class*=page_wpcf7_tg] #wpbody-content>.update-nag:not(.cf7t-notice),body[class*=page_wpcf7_tg] #wpbody-content>.updated:not(.cf7t-notice){display:none!important}body[class*=page_wpcf7_tg] ul#adminmenu a.wp-has-current-submenu:after,body[class*=page_wpcf7_tg] ul#adminmenu>li.current>a.current:after{border-right-color:#0e1621}#cf7-telegram-container{background-color:#0e1621;box-sizing:border-box;min-height:100vh;padding:1px 20px 20px 0}#cf7-telegram-container h1,#cf7-telegram-container h2,#cf7-telegram-container h3,#cf7-telegram-container h4,#cf7-telegram-container h5,#cf7-telegram-container h6{color:#b5b5b5}#cf7-telegram-container #settings-content{color:#fff;font-family:Open Sans}.cf7-tg-container{display:flex;flex-direction:column;gap:32px;width:100%}@media(min-width:1440px){.cf7-tg-container{flex-direction:row}}.cf7-tg-container .main-container{display:flex;flex:3 1;flex-direction:column;gap:32px}@media(min-width:1120px){.cf7-tg-container .main-container{flex-direction:row}}.cf7-tg-container .list-container{display:flex;flex-direction:column;gap:20px}.cf7-tg-container .title-container{align-items:start;display:flex;flex-direction:column;padding:15px 0}.cf7-tg-container .title-container .title{margin:0}.cf7-tg-container .title-container .title-description{box-sizing:border-box;color:#656565;font-size:12px;height:72px;line-height:1.45;margin:6px 0 10px;max-width:460px;overflow-wrap:break-word}.cf7-tg-container .title-container .title-description a{color:#0c87b3}.cf7-tg-container .title-container .title-description a:hover{color:#0c88b4}.cf7-tg-container .title-container .add-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;margin:0;padding:0;text-align:center}.cf7-tg-container .title-container .add-button:hover{color:#0c87b3}.cf7-tg-container .entity-container{border-radius:12px;border-style:dashed;border-width:4px;flex-basis:500px;flex-shrink:0;transition:all .4s ease}.cf7-tg-container .entity-container.saving{opacity:.5}.cf7-tg-container .entity-container .entity-wrapper{display:flex;flex-direction:column;gap:0}.cf7-tg-container .entity-container .columns{display:flex;flex-direction:row;gap:10px}.cf7-tg-container .entity-container .columns .column{align-items:center;border-radius:5px;display:flex;flex-basis:100%;flex-grow:1;justify-content:center}.cf7-tg-container .entity-container .add-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .entity-container .add-button:hover{color:#0c87b3}.cf7-tg-container .frame{padding:10px 15px;position:relative}.cf7-tg-container .bots-container{width:375px}.cf7-tg-container .bots-container .bot-list{display:flex;flex-wrap:wrap;gap:10px}.cf7-tg-container .bots-container .bot-list .bot{border-color:#0c88b417;box-sizing:border-box;flex-basis:unset;width:100%}.cf7-tg-container .bots-container .bot-list .bot.offline{border-color:#9d6262}.cf7-tg-container .bots-container .bot-list .bot.online{border-color:#0c88b4}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary{align-items:center;display:flex;gap:8px;justify-content:space-between;position:relative}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title{display:flex;flex-direction:column;font-family:monospace;min-width:0}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name{border:solid #082d3b;border-top-left-radius:5px;border-top-right-radius:5px;border-width:1px 1px 0;color:#7499b3;font-size:15px;font-weight:100;margin:0;max-width:190px;padding:2px 8px;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name.offline{color:#9d6262!important}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name a,.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name a:active,.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name a:focus,.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-name a:visited{color:inherit;outline:none!important;text-decoration:none;-webkit-tap-highlight-color:rgba(0,0,0,0);box-shadow:0 0 0 2px #0003}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-title .bot-command{background-color:#112747;border:1px solid #112747;border-bottom-left-radius:5px;border-bottom-right-radius:5px;border-top:0 solid #112747;color:#7499b3;overflow-wrap:anywhere;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token{color:#465b79;flex-shrink:0;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .show-token{cursor:pointer;font-family:monospace}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .show-token.const{cursor:default}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .php-const-hint{cursor:pointer;font-size:10px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .edit-token,.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .token-value{background-color:#09090c;font-family:Monospace,serif;padding:2px 5px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .bot-summary .bot-token .edit-token{border:1px solid rgba(12,136,180,.278);box-shadow:none;color:inherit;height:45px;left:50%;line-height:100%;padding:0 10px;position:absolute;text-align:inherit;top:50%;transform:translate(-50%,-50%);width:98%}.cf7-tg-container .bots-container .bot-list .bot-wrapper.offline .bot-name{color:#9d6262!important}.cf7-tg-container .bots-container .bot-list .bot-wrapper.online .bot-name{box-shadow:0 0 20px 0 rgba(12,136,180,.322)}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot h5{color:#375885;font-size:11px;margin:0;text-align:center;text-transform:uppercase}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot ul{margin:0}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item{align-items:center;display:flex;justify-content:start}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .chat-name{box-sizing:border-box;overflow-wrap:anywhere;padding:0 5px;text-align:right;width:120px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .topic-identity{margin-left:4px;min-width:0;overflow-wrap:anywhere}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .edit-chat-name{background:#0000;border:1px solid rgba(12,136,180,.278);box-shadow:none;color:inherit;font-family:inherit;font-size:inherit;line-height:inherit;min-height:24px;padding:0 5px;width:120px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item.active{color:#35894c}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item.pending{color:#898735}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item.muted{color:#893535}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .chat-actions{display:flex;flex:0 0 auto;gap:2px;margin-left:auto}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .chat-actions .action{align-items:center;background:none;border:0;color:#656565;cursor:pointer;display:inline-flex;height:24px;justify-content:center;opacity:.25;padding:0;width:24px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .chat-actions .action:hover:not(:disabled){color:#873d3d;opacity:1}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .chat-actions .action:focus-visible{opacity:1;outline:2px solid #0c88b4;outline-offset:1px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .chat-item .chat-actions .action:disabled{cursor:default}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .no-chats-found{color:#0c88b4;font-size:12px;font-style:italic;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .offline-bot-sad-message{color:#9d6262;font-size:12px;font-style:italic;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .chats-for-bot .unknown-bot-status-message{color:#0c88b4;font-size:12px;font-style:italic;opacity:.25;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar{align-items:center;display:flex;justify-content:space-between}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .remove-bot-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .remove-bot-button:hover{color:#873d3d}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .bot-status{font-size:12px}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .bot-status.online{color:#0c88b4}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .bot-status.offline{color:#9d6262}.cf7-tg-container .bots-container .bot-list .bot-wrapper .status-bar .bot-status.unknown{color:#b5b5b5}.cf7-tg-container .channels-container{flex:1;max-width:508px}@media(min-width:1880px){.cf7-tg-container .channels-container{max-width:1026px}}.cf7-tg-container .channels-container .channel-list{display:flex;flex-wrap:wrap;gap:10px}.cf7-tg-container .channels-container .channel-list .channel{border-color:#656565;color:#656565;display:flex;flex-direction:column}.cf7-tg-container .channels-container .channel-list .channel.has-bot-online.has-active-chats.has-forms{border-color:#69ad7a;box-shadow:inset 0 0 12px 0 #2f4f37;color:#69ad7a}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper{flex-grow:1}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper{box-sizing:border-box;color:inherit;display:flex;flex-direction:column;font-size:17px;font-weight:500;justify-content:center;line-height:17px;min-height:60px;text-align:center}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper .channel-title{color:inherit;cursor:pointer;line-height:inherit;margin:0;text-align:inherit}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper input.edit-title{background:#0000;border:none;box-shadow:none;color:inherit;font-family:inherit;font-size:1em;font-weight:inherit;height:100%;left:0;line-height:inherit;margin:0;outline:none;padding:0;position:relative;text-align:inherit;text-shadow:none;text-transform:none;top:0;width:100%}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper .bot-for-channel{align-items:center;border:1px dashed #0c88b4;border-radius:5px;color:#0c88b4;display:inline-flex;gap:10px;justify-content:space-between;padding:7px 11px}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper .bot-for-channel.offline{border-color:#9d6262;color:#9d6262}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .channel-title-wrapper .bot-for-channel span{font-family:monospace}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__indicator-separator{background-color:#2b365954}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__control{background-color:#0e1621;border-color:#656565;border-style:dashed;box-shadow:none;cursor:pointer;font-size:13px;min-width:180px}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__menu{border-color:#2b365954;border-width:1px}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__menu,.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__option{background-color:#0e1621;color:#707070;cursor:pointer;font-size:13px}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__menu--is-focused,.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .select-picker__option--is-focused{background-color:#061215}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .status-bar{align-items:center;display:flex;justify-content:space-between;margin-top:auto}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .status-bar .remove-channel-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .channels-container .channel-list .channel .channel-wrapper .status-bar .remove-channel-button:hover{color:#873d3d}.cf7-tg-container .channels-container .channel-list .channel .chats{align-items:center;border-color:#505145;box-sizing:border-box;display:flex;gap:5px;margin:0;min-height:65px}.cf7-tg-container .channels-container .channel-list .channel .chats .chat{border:1px dashed #898735;border-radius:5px;color:#898735;cursor:pointer;display:inline;margin:0;padding:5px 10px}.cf7-tg-container .channels-container .channel-list .channel .chats .chat.active{border-color:#487d44;color:#487d44}.cf7-tg-container .channels-container .channel-list .channel .chats .chat.muted{border-color:#656565;color:#656565}.cf7-tg-container .channels-container .channel-list .channel .chats .chat.active .chat-username{color:#487d44}.cf7-tg-container .channels-container .channel-list .channel .chats .chat .chat-toggle-status{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .channels-container .channel-list .channel .chats .chat .chat-toggle-status:hover{color:#873d3d}.cf7-tg-container .channels-container .channel-list .channel .chats .no-chats-found{color:#656565;display:block;text-align:center;width:100%}.cf7-tg-container .channels-container .channel-list .channel .forms{border-color:#797083;box-sizing:border-box;min-height:75px}.cf7-tg-container .channels-container .channel-list .channel .forms .add-button{display:block}.cf7-tg-container .channels-container .channel-list .channel .forms .form-list{align-items:start;display:grid;gap:8px;grid-template-columns:repeat(4,minmax(0,1fr));max-width:624px}.cf7-tg-container .channels-container .channel-list .channel .forms .form-list.show-selector{opacity:.1}.cf7-tg-container .channels-container .channel-list .channel .forms .form-list li{align-items:flex-start;border:1px dashed #2f4f37;border-radius:5px;box-sizing:border-box;color:#487d44;display:inline-flex;gap:8px;max-width:150px;min-width:0;overflow-wrap:anywhere;padding:5px 10px}.cf7-tg-container .channels-container .channel-list .channel .forms .form-list li .detach-button{flex-shrink:0}.cf7-tg-container .channels-container .channel-list .channel .forms .form-picker{left:15px;position:absolute;top:35px;z-index:5}.cf7-tg-container .channels-container .channel-list .channel .forms .no-forms-found{color:#656565;display:block;text-align:center;width:100%}.cf7-tg-container .channels-container .channel-list .channel .detach-button{background:none;border:none;border-radius:5px;color:#656565;cursor:pointer;font-size:12px;padding:0;text-align:center}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux{height:20px;position:relative;width:20px}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:after,.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:before{background-color:#1f3047;content:"";display:block;height:1px;position:absolute;top:50%;transition:all .2s ease;width:20px}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:before{transform:rotate(45deg)}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:after{transform:rotate(-45deg)}.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:hover:after,.cf7-tg-container .channels-container .channel-list .channel .detach-button.crux:hover:before{background-color:#873d3d}.cf7-tg-container .channels-container .channel-list .channel .detach-button:hover{color:#873d3d}.cf7-tg-container .copyable{cursor:pointer;display:inline-block;position:relative}.cf7-tg-container .copyable:after{background-color:#333;border-radius:4px;bottom:120%;color:#fff;content:"Copied!";font-size:12px;left:50%;opacity:0;padding:4px 8px;pointer-events:none;position:absolute;transform:translateX(-50%);transition:opacity .3s;white-space:nowrap}.cf7-tg-container .copyable.copied:after{opacity:1}#cf7-telegram-container .cf7-tg-load-status{padding-bottom:10px}#cf7-telegram-container .resource-error{color:#b32d2e}#cf7-telegram-container .resource-loading{color:#656565}#cf7-telegram-container .cf7-tg-error-boundary{padding:20px} -
cf7-telegram/trunk/react/build/static/js/main.asset.php
r3676902 r3772619 1 <?php return array('dependencies' => array('react', 'react-dom', 'wp-element'), 'version' => ' 7211cba37053d02c9eaa');1 <?php return array('dependencies' => array('react', 'react-dom', 'wp-element'), 'version' => 'acebbb7527c24b9e8c4e'); -
cf7-telegram/trunk/react/build/static/js/main.js
r3676902 r3772619 1 (()=>{"use strict";var e={72(e,t){var n="function"==typeof Symbol&&Symbol.for,a=n?Symbol.for("react.element"):60103,r=n?Symbol.for("react.portal"):60106,o=n?Symbol.for("react.fragment"):60107,i=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,m=n?Symbol.for("react.suspense_list"):60120,h=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.block"):60121,b=n?Symbol.for("react.fundamental"):60117,y=n?Symbol.for("react.responder"):60118,w=n?Symbol.for("react.scope"):60119;function C(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case a:switch(e=e.type){case u:case d:case o:case s:case i:case p:return e;default:switch(e=e&&e.$$typeof){case c:case f:case g:case h:case l:return e;default:return t}}case r:return t}}}function E(e){return C(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=l,t.Element=a,t.ForwardRef=f,t.Fragment=o,t.Lazy=g,t.Memo=h,t.Portal=r,t.Profiler=s,t.StrictMode=i,t.Suspense=p,t.isAsyncMode=function(e){return E(e)||C(e)===u},t.isConcurrentMode=E,t.isContextConsumer=function(e){return C(e)===c},t.isContextProvider=function(e){return C(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===a},t.isForwardRef=function(e){return C(e)===f},t.isFragment=function(e){return C(e)===o},t.isLazy=function(e){return C(e)===g},t.isMemo=function(e){return C(e)===h},t.isPortal=function(e){return C(e)===r},t.isProfiler=function(e){return C(e)===s},t.isStrictMode=function(e){return C(e)===i},t.isSuspense=function(e){return C(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===d||e===s||e===i||e===p||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===h||e.$$typeof===l||e.$$typeof===c||e.$$typeof===f||e.$$typeof===b||e.$$typeof===y||e.$$typeof===w||e.$$typeof===v)},t.typeOf=C},404(e,t,n){e.exports=n(72)}};const t={};function n(a){const r=t[a];if(void 0!==r)return r.exports;const o=t[a]={exports:{}};return e[a](o,o.exports,n),o.exports}n.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.cw=e=>{var t;return()=>{if(e){var n=e;e=0,t={exports:{}},n.call(t.exports,t,t.exports)}return t.exports}},(()=>{const e=Object.getPrototypeOf;let t;n.t=function(a,r){if(1&r&&(a=this(a)),8&r)return a;if("object"==typeof a&&a){if(4&r&&a.__esModule)return a;if(16&r&&"function"==typeof a.then)return a}const o=Object.create(null);n.r(o);const i={};t||=[null,e({}),e([]),e(e)];for(var s=2&r&&a;("object"==typeof s||"function"==typeof s)&&!~t.indexOf(s);s=e(s))Object.getOwnPropertyNames(s).forEach(e=>i[e]=()=>a[e]);return i.default=()=>a,n.d(o,i),o}})(),n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a=n.cw(function(e,t){var n= Ke(),a={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},i={};function s(e){return n.isMemo(e)?o:i[e.$$typeof]||a}i[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},i[n.Memo]=o;var l=Object.defineProperty,c=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,a){if("string"!=typeof n){if(p){var o=f(n);o&&o!==p&&e(t,o,a)}var i=c(n);u&&(i=i.concat(u(n)));for(var m=s(t),h=s(n),g=0;g<i.length;++g){var v=i[g];if(!(r[v]||a&&a[v]||h&&h[v]||m&&m[v])){var b=d(n,v);try{l(t,v,b)}catch(e){}}}}return t}}),r=()=>n(404);const o=window.React;var i=n.n(o);const s=window.wp.element;function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function c(e){var t=function(e){if("object"!=l(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==l(t)?t:t+""}function u(e,t,n){return(t=c(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach(function(t){u(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function m(e,t){if(e){if("string"==typeof e)return p(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(a=o.call(n)).done)&&(s.push(a.value),s.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw r}}return s}}(e,t)||m(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.includes(a))continue;n[a]=e[a]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var v=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function b(){return b=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},b.apply(null,arguments)}function y(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,c(a.key),a)}}function w(e,t){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},w(e,t)}function C(e){return C=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},C(e)}function E(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(E=function(){return!!e})()}function O(e){return function(e){if(Array.isArray(e))return p(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||m(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var S=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(e){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),this.tags=[],this.ctr=0},e}(),k=Math.abs,_=String.fromCharCode,x=Object.assign;function T(e){return e.trim()}function I(e,t,n){return e.replace(t,n)}function P(e,t){return e.indexOf(t)}function D(e,t){return 0|e.charCodeAt(t)}function M(e,t,n){return e.slice(t,n)}function F(e){return e.length}function V(e){return e.length}function R(e,t){return t.push(e),e}var N=1,L=1,A=0,$=0,B=0,H="";function j(e,t,n,a,r,o,i){return{value:e,root:t,parent:n,type:a,props:r,children:o,line:N,column:L,length:i,return:""}}function z(e,t){return x(j("",null,null,"",null,null,0),e,{length:-e.length},t)}function U(){return B=$>0?D(H,--$):0,L--,10===B&&(L=1,N--),B}function W(){return B=$<A?D(H,$++):0,L++,10===B&&(L=1,N++),B}function G(){return D(H,$)}function q(){return $}function K(e,t){return M(H,e,t)}function Y(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function X(e){return N=L=1,A=F(H=e),$=0,[]}function Z(e){return H="",e}function J(e){return T(K($-1,te(91===e?e+2:40===e?e+1:e)))}function Q(e){for(;(B=G())&&B<33;)W();return Y(e)>2||Y(B)>3?"":" "}function ee(e,t){for(;--t&&W()&&!(B<48||B>102||B>57&&B<65||B>70&&B<97););return K(e,q()+(t<6&&32==G()&&32==W()))}function te(e){for(;W();)switch(B){case e:return $;case 34:case 39:34!==e&&39!==e&&te(B);break;case 40:41===e&&te(e);break;case 92:W()}return $}function ne(e,t){for(;W()&&e+B!==57&&(e+B!==84||47!==G()););return"/*"+K(t,$-1)+"*"+_(47===e?e:W())}function ae(e){for(;!Y(G());)W();return K(e,$)}var re="-ms-",oe="-moz-",ie="-webkit-",se="comm",le="rule",ce="decl",ue="@keyframes";function de(e,t){for(var n="",a=V(e),r=0;r<a;r++)n+=t(e[r],r,e,t)||"";return n}function fe(e,t,n,a){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case ce:return e.return=e.return||e.value;case se:return"";case ue:return e.return=e.value+"{"+de(e.children,a)+"}";case le:e.value=e.props.join(",")}return F(n=de(e.children,a))?e.return=e.value+"{"+n+"}":""}function pe(e){return Z(me("",null,null,null,[""],e=X(e),0,[0],e))}function me(e,t,n,a,r,o,i,s,l){for(var c=0,u=0,d=i,f=0,p=0,m=0,h=1,g=1,v=1,b=0,y="",w=r,C=o,E=a,O=y;g;)switch(m=b,b=W()){case 40:if(108!=m&&58==D(O,d-1)){-1!=P(O+=I(J(b),"&","&\f"),"&\f")&&(v=-1);break}case 34:case 39:case 91:O+=J(b);break;case 9:case 10:case 13:case 32:O+=Q(m);break;case 92:O+=ee(q()-1,7);continue;case 47:switch(G()){case 42:case 47:R(ge(ne(W(),q()),t,n),l);break;default:O+="/"}break;case 123*h:s[c++]=F(O)*v;case 125*h:case 59:case 0:switch(b){case 0:case 125:g=0;case 59+u:-1==v&&(O=I(O,/\f/g,"")),p>0&&F(O)-d&&R(p>32?ve(O+";",a,n,d-1):ve(I(O," ","")+";",a,n,d-2),l);break;case 59:O+=";";default:if(R(E=he(O,t,n,c,u,r,s,y,w=[],C=[],d),o),123===b)if(0===u)me(O,t,E,E,w,o,d,s,C);else switch(99===f&&110===D(O,3)?100:f){case 100:case 108:case 109:case 115:me(e,E,E,a&&R(he(e,E,E,0,0,r,s,y,r,w=[],d),C),r,C,d,s,a?w:C);break;default:me(O,E,E,E,[""],C,0,s,C)}}c=u=p=0,h=v=1,y=O="",d=i;break;case 58:d=1+F(O),p=m;default:if(h<1)if(123==b)--h;else if(125==b&&0==h++&&125==U())continue;switch(O+=_(b),b*h){case 38:v=u>0?1:(O+="\f",-1);break;case 44:s[c++]=(F(O)-1)*v,v=1;break;case 64:45===G()&&(O+=J(W())),f=G(),u=d=F(y=O+=ae(q())),b++;break;case 45:45===m&&2==F(O)&&(h=0)}}return o}function he(e,t,n,a,r,o,i,s,l,c,u){for(var d=r-1,f=0===r?o:[""],p=V(f),m=0,h=0,g=0;m<a;++m)for(var v=0,b=M(e,d+1,d=k(h=i[m])),y=e;v<p;++v)(y=T(h>0?f[v]+" "+b:I(b,/&\f/g,f[v])))&&(l[g++]=y);return j(e,t,n,0===r?le:s,l,c,u)}function ge(e,t,n){return j(e,t,n,se,_(B),M(e,2,-2),0)}function ve(e,t,n,a){return j(e,t,n,ce,M(e,0,a),M(e,a+1,-1),a)}var be=function(e,t,n){for(var a=0,r=0;a=r,r=G(),38===a&&12===r&&(t[n]=1),!Y(r);)W();return K(e,$)},ye=new WeakMap,we=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,a=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||ye.get(n))&&!a){ye.set(e,!0);for(var r=[],o=function(e,t){return Z(function(e,t){var n=-1,a=44;do{switch(Y(a)){case 0:38===a&&12===G()&&(t[n]=1),e[n]+=be($-1,t,n);break;case 2:e[n]+=J(a);break;case 4:if(44===a){e[++n]=58===G()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=_(a)}}while(a=W());return e}(X(e),t))}(t,r),i=n.props,s=0,l=0;s<o.length;s++)for(var c=0;c<i.length;c++,l++)e.props[l]=r[s]?o[s].replace(/&\f/g,i[c]):i[c]+" "+o[s]}}},Ce=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function Ee(e,t){switch(function(e,t){return 45^D(e,0)?(((t<<2^D(e,0))<<2^D(e,1))<<2^D(e,2))<<2^D(e,3):0}(e,t)){case 5103:return ie+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return ie+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return ie+e+oe+e+re+e+e;case 6828:case 4268:return ie+e+re+e+e;case 6165:return ie+e+re+"flex-"+e+e;case 5187:return ie+e+I(e,/(\w+).+(:[^]+)/,ie+"box-$1$2"+re+"flex-$1$2")+e;case 5443:return ie+e+re+"flex-item-"+I(e,/flex-|-self/,"")+e;case 4675:return ie+e+re+"flex-line-pack"+I(e,/align-content|flex-|-self/,"")+e;case 5548:return ie+e+re+I(e,"shrink","negative")+e;case 5292:return ie+e+re+I(e,"basis","preferred-size")+e;case 6060:return ie+"box-"+I(e,"-grow","")+ie+e+re+I(e,"grow","positive")+e;case 4554:return ie+I(e,/([^-])(transform)/g,"$1"+ie+"$2")+e;case 6187:return I(I(I(e,/(zoom-|grab)/,ie+"$1"),/(image-set)/,ie+"$1"),e,"")+e;case 5495:case 3959:return I(e,/(image-set\([^]*)/,ie+"$1$`$1");case 4968:return I(I(e,/(.+:)(flex-)?(.*)/,ie+"box-pack:$3"+re+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+ie+e+e;case 4095:case 3583:case 4068:case 2532:return I(e,/(.+)-inline(.+)/,ie+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(F(e)-1-t>6)switch(D(e,t+1)){case 109:if(45!==D(e,t+4))break;case 102:return I(e,/(.+:)(.+)-([^]+)/,"$1"+ie+"$2-$3$1"+oe+(108==D(e,t+3)?"$3":"$2-$3"))+e;case 115:return~P(e,"stretch")?Ee(I(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==D(e,t+1))break;case 6444:switch(D(e,F(e)-3-(~P(e,"!important")&&10))){case 107:return I(e,":",":"+ie)+e;case 101:return I(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ie+(45===D(e,14)?"inline-":"")+"box$3$1"+ie+"$2$3$1"+re+"$2box$3")+e}break;case 5936:switch(D(e,t+11)){case 114:return ie+e+re+I(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ie+e+re+I(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ie+e+re+I(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return ie+e+re+e+e}return e}var Oe=[function(e,t,n,a){if(e.length>-1&&!e.return)switch(e.type){case ce:e.return=Ee(e.value,e.length);break;case ue:return de([z(e,{value:I(e.value,"@","@"+ie)})],a);case le:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,function(t){switch(function(e){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return de([z(e,{props:[I(t,/:(read-\w+)/,":-moz-$1")]})],a);case"::placeholder":return de([z(e,{props:[I(t,/:(plac\w+)/,":"+ie+"input-$1")]}),z(e,{props:[I(t,/:(plac\w+)/,":-moz-$1")]}),z(e,{props:[I(t,/:(plac\w+)/,re+"input-$1")]})],a)}return""})}}],Se=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var a,r,o=e.stylisPlugins||Oe,i={},s=[];a=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)i[t[n]]=!0;s.push(e)});var l,c,u,d,f=[fe,(d=function(e){l.insert(e)},function(e){e.root||(e=e.return)&&d(e)})],p=(c=[we,Ce].concat(o,f),u=V(c),function(e,t,n,a){for(var r="",o=0;o<u;o++)r+=c[o](e,t,n,a)||"";return r});r=function(e,t,n,a){l=n,de(pe(e?e+"{"+t.styles+"}":t.styles),p),a&&(m.inserted[t.name]=!0)};var m={key:t,sheet:new S({key:t,container:a,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:r};return m.sheet.hydrate(s),m},ke=function(e,t,n){var a=e.key+"-"+t.name;!1===n&&void 0===e.registered[a]&&(e.registered[a]=t.styles)},_e={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function xe(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var Te=/[A-Z]|^ms/g,Ie=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Pe=function(e){return 45===e.charCodeAt(1)},De=function(e){return null!=e&&"boolean"!=typeof e},Me=xe(function(e){return Pe(e)?e:e.replace(Te,"-$&").toLowerCase()}),Fe=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Ie,function(e,t,n){return Re={name:t,styles:n,next:Re},t})}return 1===_e[e]||Pe(e)||"number"!=typeof t||0===t?t:t+"px"};function Ve(e,t,n){if(null==n)return"";var a=n;if(void 0!==a.__emotion_styles)return a;switch(typeof n){case"boolean":return"";case"object":var r=n;if(1===r.anim)return Re={name:r.name,styles:r.styles,next:Re},r.name;var o=n;if(void 0!==o.styles){var i=o.next;if(void 0!==i)for(;void 0!==i;)Re={name:i.name,styles:i.styles,next:Re},i=i.next;return o.styles+";"}return function(e,t,n){var a="";if(Array.isArray(n))for(var r=0;r<n.length;r++)a+=Ve(e,t,n[r])+";";else for(var o in n){var i=n[o];if("object"!=typeof i){var s=i;null!=t&&void 0!==t[s]?a+=o+"{"+t[s]+"}":De(s)&&(a+=Me(o)+":"+Fe(o,s)+";")}else if(!Array.isArray(i)||"string"!=typeof i[0]||null!=t&&void 0!==t[i[0]]){var l=Ve(e,t,i);switch(o){case"animation":case"animationName":a+=Me(o)+":"+l+";";break;default:a+=o+"{"+l+"}"}}else for(var c=0;c<i.length;c++)De(i[c])&&(a+=Me(o)+":"+Fe(o,i[c])+";")}return a}(e,t,n);case"function":if(void 0!==e){var s=Re,l=n(e);return Re=s,Ve(e,t,l)}}var c=n;if(null==t)return c;var u=t[c];return void 0!==u?u:c}var Re,Ne=/label:\s*([^\s;{]+)\s*(;|$)/g;function Le(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var a=!0,r="";Re=void 0;var o=e[0];null==o||void 0===o.raw?(a=!1,r+=Ve(n,t,o)):r+=o[0];for(var i=1;i<e.length;i++)r+=Ve(n,t,e[i]),a&&(r+=o[i]);Ne.lastIndex=0;for(var s,l="";null!==(s=Ne.exec(r));)l+="-"+s[1];var c=function(e){for(var t,n=0,a=0,r=e.length;r>=4;++a,r-=4)t=1540483477*(65535&(t=255&e.charCodeAt(a)|(255&e.charCodeAt(++a))<<8|(255&e.charCodeAt(++a))<<16|(255&e.charCodeAt(++a))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(r){case 3:n^=(255&e.charCodeAt(a+2))<<16;case 2:n^=(255&e.charCodeAt(a+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(a)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(r)+l;return{name:c,styles:r,next:Re}}var Ae=!!o.useInsertionEffect&&o.useInsertionEffect,$e=Ae||function(e){return e()},Be=(Ae||o.useLayoutEffect,o.createContext("undefined"!=typeof HTMLElement?Se({key:"css"}):null)),He=(Be.Provider,function(e){return(0,o.forwardRef)(function(t,n){var a=(0,o.useContext)(Be);return e(t,a,n)})}),je=o.createContext({}),ze={}.hasOwnProperty,Ue="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",We=function(e){var t=e.cache,n=e.serialized,a=e.isStringTag;return ke(t,n,a),$e(function(){return function(e,t,n){ke(e,t,n);var a=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var r=t;do{e.insert(t===r?"."+a:"",r,e.sheet,!0),r=r.next}while(void 0!==r)}}(t,n,a)}),null},Ge=He(function(e,t,n){var a=e.css;"string"==typeof a&&void 0!==t.registered[a]&&(a=t.registered[a]);var r=e[Ue],i=[a],s="";"string"==typeof e.className?s=function(e,t,n){var a="";return n.split(" ").forEach(function(n){void 0!==e[n]?t.push(e[n]+";"):n&&(a+=n+" ")}),a}(t.registered,i,e.className):null!=e.className&&(s=e.className+" ");var l=Le(i,void 0,o.useContext(je));s+=t.key+"-"+l.name;var c={};for(var u in e)ze.call(e,u)&&"css"!==u&&u!==Ue&&(c[u]=e[u]);return c.className=s,n&&(c.ref=n),o.createElement(o.Fragment,null,o.createElement(We,{cache:t,serialized:l,isStringTag:"string"==typeof r}),o.createElement(r,c))}),qe=Ge;function Ke(){return Ke.c||(Ke.c=n.t(r(),2))}a();var Ye,Xe,Ze=function(e,t){var n=arguments;if(null==t||!ze.call(t,"css"))return o.createElement.apply(void 0,n);var a=n.length,r=new Array(a);r[0]=qe,r[1]=function(e,t){var n={};for(var a in t)ze.call(t,a)&&(n[a]=t[a]);return n[Ue]=e,n}(e,t);for(var i=2;i<a;i++)r[i]=n[i];return o.createElement.apply(null,r)};function Je(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Le(t)}Ye=Ze||(Ze={}),Xe||(Xe=Ye.JSX||(Ye.JSX={}));const Qe=window.ReactDOM,et=Math.min,tt=Math.max,nt=Math.round,at=Math.floor,rt=e=>({x:e,y:e});function ot(){return"undefined"!=typeof window}function it(e){return ct(e)?(e.nodeName||"").toLowerCase():"#document"}function st(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function lt(e){var t;return null==(t=(ct(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ct(e){return!!ot()&&(e instanceof Node||e instanceof st(e).Node)}function ut(e){return!!ot()&&(e instanceof Element||e instanceof st(e).Element)}function dt(e){return!!ot()&&(e instanceof HTMLElement||e instanceof st(e).HTMLElement)}function ft(e){return!(!ot()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof st(e).ShadowRoot)}function pt(e){const{overflow:t,overflowX:n,overflowY:a,display:r}=mt(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+n)&&!["inline","contents"].includes(r)}function mt(e){return st(e).getComputedStyle(e)}function ht(e){const t=function(e){if("html"===it(e))return e;const t=e.assignedSlot||e.parentNode||ft(e)&&e.host||lt(e);return ft(t)?t.host:t}(e);return function(e){return["html","body","#document"].includes(it(e))}(t)?e.ownerDocument?e.ownerDocument.body:e.body:dt(t)&&pt(t)?t:ht(t)}function gt(e,t,n){var a;void 0===t&&(t=[]),void 0===n&&(n=!0);const r=ht(e),o=r===(null==(a=e.ownerDocument)?void 0:a.body),i=st(r);if(o){const e=vt(i);return t.concat(i,i.visualViewport||[],pt(r)?r:[],e&&n?gt(e):[])}return t.concat(r,gt(r,[],n))}function vt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function bt(e){return ut(e)?e:e.contextElement}function yt(e){const t=bt(e);if(!dt(t))return rt(1);const n=t.getBoundingClientRect(),{width:a,height:r,$:o}=function(e){const t=mt(e);let n=parseFloat(t.width)||0,a=parseFloat(t.height)||0;const r=dt(e),o=r?e.offsetWidth:n,i=r?e.offsetHeight:a,s=nt(n)!==o||nt(a)!==i;return s&&(n=o,a=i),{width:n,height:a,$:s}}(t);let i=(o?nt(n.width):n.width)/a,s=(o?nt(n.height):n.height)/r;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const wt=rt(0);function Ct(e){const t=st(e);return"undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:wt}function Et(e,t,n,a){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),o=bt(e);let i=rt(1);t&&(a?ut(a)&&(i=yt(a)):i=yt(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==st(e))&&t}(o,n,a)?Ct(o):rt(0);let l=(r.left+s.x)/i.x,c=(r.top+s.y)/i.y,u=r.width/i.x,d=r.height/i.y;if(o){const e=st(o),t=a&&ut(a)?st(a):a;let n=e,r=vt(n);for(;r&&a&&t!==n;){const e=yt(r),t=r.getBoundingClientRect(),a=mt(r),o=t.left+(r.clientLeft+parseFloat(a.paddingLeft))*e.x,i=t.top+(r.clientTop+parseFloat(a.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=o,c+=i,n=st(r),r=vt(n)}}return function(e){const{x:t,y:n,width:a,height:r}=e;return{width:a,height:r,top:n,left:t,right:t+a,bottom:n+r,x:t,y:n}}({width:u,height:d,x:l,y:c})}function Ot(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}var St=o.useLayoutEffect,kt=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],_t=function(){};function xt(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}function Tt(e,t){for(var n=arguments.length,a=new Array(n>2?n-2:0),r=2;r<n;r++)a[r-2]=arguments[r];var o=[].concat(a);if(t&&e)for(var i in t)t.hasOwnProperty(i)&&t[i]&&o.push("".concat(xt(e,i)));return o.filter(function(e){return e}).map(function(e){return String(e).trim()}).join(" ")}var It=function(e){return t=e,Array.isArray(t)?e.filter(Boolean):"object"===l(e)&&null!==e?[e]:[];var t},Pt=function(e){return e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme,f({},g(e,kt))},Dt=function(e,t,n){var a=e.cx,r=e.getStyles,o=e.getClassNames,i=e.className;return{css:r(t,e),className:a(null!=n?n:{},o(t,e),i)}};function Mt(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function Ft(e){return Mt(e)?window.pageYOffset:e.scrollTop}function Vt(e,t){Mt(e)?window.scrollTo(0,t):e.scrollTop=t}function Rt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:_t,r=Ft(e),o=t-r,i=0;!function t(){var s,l=o*((s=(s=i+=10)/n-1)*s*s+1)+r;Vt(e,l),i<n?window.requestAnimationFrame(t):a(e)}()}function Nt(e,t){var n=e.getBoundingClientRect(),a=t.getBoundingClientRect(),r=t.offsetHeight/3;a.bottom+r>n.bottom?Vt(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+r,e.scrollHeight)):a.top-r<n.top&&Vt(e,Math.max(t.offsetTop-r,0))}function Lt(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}var At=!1,$t={get passive(){return At=!0}},Bt="undefined"!=typeof window?window:{};Bt.addEventListener&&Bt.removeEventListener&&(Bt.addEventListener("p",_t,$t),Bt.removeEventListener("p",_t,!1));var Ht=At;function jt(e){return null!=e}function zt(e,t,n){return e?t:n}var Ut=["children","innerProps"],Wt=["children","innerProps"];var Gt,qt,Kt,Yt=function(e){return"auto"===e?"bottom":e},Xt=(0,o.createContext)(null),Zt=function(e){var t=e.children,n=e.minMenuHeight,a=e.maxMenuHeight,r=e.menuPlacement,i=e.menuPosition,s=e.menuShouldScrollIntoView,l=e.theme,c=((0,o.useContext)(Xt)||{}).setPortalPlacement,u=(0,o.useRef)(null),d=h((0,o.useState)(a),2),p=d[0],m=d[1],g=h((0,o.useState)(null),2),v=g[0],b=g[1],y=l.spacing.controlHeight;return St(function(){var e=u.current;if(e){var t="fixed"===i,o=function(e){var t=e.maxHeight,n=e.menuEl,a=e.minHeight,r=e.placement,o=e.shouldScroll,i=e.isFixedPosition,s=e.controlHeight,l=function(e){var t=getComputedStyle(e),n="absolute"===t.position,a=/(auto|scroll)/;if("fixed"===t.position)return document.documentElement;for(var r=e;r=r.parentElement;)if(t=getComputedStyle(r),(!n||"static"!==t.position)&&a.test(t.overflow+t.overflowY+t.overflowX))return r;return document.documentElement}(n),c={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return c;var u,d=l.getBoundingClientRect().height,f=n.getBoundingClientRect(),p=f.bottom,m=f.height,h=f.top,g=n.offsetParent.getBoundingClientRect().top,v=i||Mt(u=l)?window.innerHeight:u.clientHeight,b=Ft(l),y=parseInt(getComputedStyle(n).marginBottom,10),w=parseInt(getComputedStyle(n).marginTop,10),C=g-w,E=v-h,O=C+b,S=d-b-h,k=p-v+b+y,_=b+h-w,x=160;switch(r){case"auto":case"bottom":if(E>=m)return{placement:"bottom",maxHeight:t};if(S>=m&&!i)return o&&Rt(l,k,x),{placement:"bottom",maxHeight:t};if(!i&&S>=a||i&&E>=a)return o&&Rt(l,k,x),{placement:"bottom",maxHeight:i?E-y:S-y};if("auto"===r||i){var T=t,I=i?C:O;return I>=a&&(T=Math.min(I-y-s,t)),{placement:"top",maxHeight:T}}if("bottom"===r)return o&&Vt(l,k),{placement:"bottom",maxHeight:t};break;case"top":if(C>=m)return{placement:"top",maxHeight:t};if(O>=m&&!i)return o&&Rt(l,_,x),{placement:"top",maxHeight:t};if(!i&&O>=a||i&&C>=a){var P=t;return(!i&&O>=a||i&&C>=a)&&(P=i?C-w:O-w),o&&Rt(l,_,x),{placement:"top",maxHeight:P}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(r,'".'))}return c}({maxHeight:a,menuEl:e,minHeight:n,placement:r,shouldScroll:s&&!t,isFixedPosition:t,controlHeight:y});m(o.maxHeight),b(o.placement),null==c||c(o.placement)}},[a,r,i,s,n,c,y]),t({ref:u,placerProps:f(f({},e),{},{placement:v||Yt(r),maxHeight:p})})},Jt=function(e,t){var n=e.theme,a=n.spacing.baseUnit,r=n.colors;return f({textAlign:"center"},t?{}:{color:r.neutral40,padding:"".concat(2*a,"px ").concat(3*a,"px")})},Qt=Jt,en=Jt,tn=["size"],nn=["innerProps","isRtl","size"],an={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},rn=function(e){var t=e.size,n=g(e,tn);return Ze("svg",b({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:an},n))},on=function(e){return Ze(rn,b({size:20},e),Ze("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},sn=function(e){return Ze(rn,b({size:20},e),Ze("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},ln=function(e,t){var n=e.isFocused,a=e.theme,r=a.spacing.baseUnit,o=a.colors;return f({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:n?o.neutral60:o.neutral20,padding:2*r,":hover":{color:n?o.neutral80:o.neutral40}})},cn=ln,un=ln,dn=function(){var e=Je.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}(Gt||(qt=["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"],Kt||(Kt=qt.slice(0)),Gt=Object.freeze(Object.defineProperties(qt,{raw:{value:Object.freeze(Kt)}})))),fn=function(e){var t=e.delay,n=e.offset;return Ze("span",{css:Je({animation:"".concat(dn," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},pn=["data"],mn=["innerRef","isDisabled","isHidden","inputClassName"],hn={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},gn={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":f({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},hn)},vn=function(e){return f({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},hn)},bn=function(e){var t=e.children,n=e.innerProps;return Ze("div",n,t)},yn={ClearIndicator:function(e){var t=e.children,n=e.innerProps;return Ze("div",b({},Dt(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),t||Ze(on,null))},Control:function(e){var t=e.children,n=e.isDisabled,a=e.isFocused,r=e.innerRef,o=e.innerProps,i=e.menuIsOpen;return Ze("div",b({ref:r},Dt(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":a,"control--menu-is-open":i}),o,{"aria-disabled":n||void 0}),t)},DropdownIndicator:function(e){var t=e.children,n=e.innerProps;return Ze("div",b({},Dt(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),t||Ze(sn,null))},DownChevron:sn,CrossIcon:on,Group:function(e){var t=e.children,n=e.cx,a=e.getStyles,r=e.getClassNames,o=e.Heading,i=e.headingProps,s=e.innerProps,l=e.label,c=e.theme,u=e.selectProps;return Ze("div",b({},Dt(e,"group",{group:!0}),s),Ze(o,b({},i,{selectProps:u,theme:c,getStyles:a,getClassNames:r,cx:n}),l),Ze("div",null,t))},GroupHeading:function(e){var t=Pt(e);t.data;var n=g(t,pn);return Ze("div",b({},Dt(e,"groupHeading",{"group-heading":!0}),n))},IndicatorsContainer:function(e){var t=e.children,n=e.innerProps;return Ze("div",b({},Dt(e,"indicatorsContainer",{indicators:!0}),n),t)},IndicatorSeparator:function(e){var t=e.innerProps;return Ze("span",b({},t,Dt(e,"indicatorSeparator",{"indicator-separator":!0})))},Input:function(e){var t=e.cx,n=e.value,a=Pt(e),r=a.innerRef,o=a.isDisabled,i=a.isHidden,s=a.inputClassName,l=g(a,mn);return Ze("div",b({},Dt(e,"input",{"input-container":!0}),{"data-value":n||""}),Ze("input",b({className:t({input:!0},s),ref:r,style:vn(i),disabled:o},l)))},LoadingIndicator:function(e){var t=e.innerProps,n=e.isRtl,a=e.size,r=void 0===a?4:a,o=g(e,nn);return Ze("div",b({},Dt(f(f({},o),{},{innerProps:t,isRtl:n,size:r}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),Ze(fn,{delay:0,offset:n}),Ze(fn,{delay:160,offset:!0}),Ze(fn,{delay:320,offset:!n}))},Menu:function(e){var t=e.children,n=e.innerRef,a=e.innerProps;return Ze("div",b({},Dt(e,"menu",{menu:!0}),{ref:n},a),t)},MenuList:function(e){var t=e.children,n=e.innerProps,a=e.innerRef,r=e.isMulti;return Ze("div",b({},Dt(e,"menuList",{"menu-list":!0,"menu-list--is-multi":r}),{ref:a},n),t)},MenuPortal:function(e){var t=e.appendTo,n=e.children,a=e.controlElement,r=e.innerProps,i=e.menuPlacement,s=e.menuPosition,l=(0,o.useRef)(null),c=(0,o.useRef)(null),u=h((0,o.useState)(Yt(i)),2),d=u[0],p=u[1],m=(0,o.useMemo)(function(){return{setPortalPlacement:p}},[]),g=h((0,o.useState)(null),2),v=g[0],y=g[1],w=(0,o.useCallback)(function(){if(a){var e=function(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}(a),t="fixed"===s?0:window.pageYOffset,n=e[d]+t;n===(null==v?void 0:v.offset)&&e.left===(null==v?void 0:v.rect.left)&&e.width===(null==v?void 0:v.rect.width)||y({offset:n,rect:e})}},[a,s,d,null==v?void 0:v.offset,null==v?void 0:v.rect.left,null==v?void 0:v.rect.width]);St(function(){w()},[w]);var C=(0,o.useCallback)(function(){"function"==typeof c.current&&(c.current(),c.current=null),a&&l.current&&(c.current=function(e,t,n,a){void 0===a&&(a={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=a,c=bt(e),u=r||o?[...c?gt(c):[],...gt(t)]:[];u.forEach(e=>{r&&e.addEventListener("scroll",n,{passive:!0}),o&&e.addEventListener("resize",n)});const d=c&&s?function(e,t){let n,a=null;const r=lt(e);function o(){var e;clearTimeout(n),null==(e=a)||e.disconnect(),a=null}return function i(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),o();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(s||t(),!f||!p)return;const m={rootMargin:-at(d)+"px "+-at(r.clientWidth-(u+f))+"px "+-at(r.clientHeight-(d+p))+"px "+-at(u)+"px",threshold:tt(0,et(1,l))||1};let h=!0;function g(t){const a=t[0].intersectionRatio;if(a!==l){if(!h)return i();a?i(!1,a):n=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==a||Ot(c,e.getBoundingClientRect())||i(),h=!1}try{a=new IntersectionObserver(g,{...m,root:r.ownerDocument})}catch(e){a=new IntersectionObserver(g,m)}a.observe(e)}(!0),o}(c,n):null;let f,p=-1,m=null;i&&(m=new ResizeObserver(e=>{let[a]=e;a&&a.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),n()}),c&&!l&&m.observe(c),m.observe(t));let h=l?Et(e):null;return l&&function t(){const a=Et(e);h&&!Ot(h,a)&&n(),h=a,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{r&&e.removeEventListener("scroll",n),o&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=m)||e.disconnect(),m=null,l&&cancelAnimationFrame(f)}}(a,l.current,w,{elementResize:"ResizeObserver"in window}))},[a,w]);St(function(){C()},[C]);var E=(0,o.useCallback)(function(e){l.current=e,C()},[C]);if(!t&&"fixed"!==s||!v)return null;var O=Ze("div",b({ref:E},Dt(f(f({},e),{},{offset:v.offset,position:s,rect:v.rect}),"menuPortal",{"menu-portal":!0}),r),n);return Ze(Xt.Provider,{value:m},t?(0,Qe.createPortal)(O,t):O)},LoadingMessage:function(e){var t=e.children,n=void 0===t?"Loading...":t,a=e.innerProps,r=g(e,Wt);return Ze("div",b({},Dt(f(f({},r),{},{children:n,innerProps:a}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),a),n)},NoOptionsMessage:function(e){var t=e.children,n=void 0===t?"No options":t,a=e.innerProps,r=g(e,Ut);return Ze("div",b({},Dt(f(f({},r),{},{children:n,innerProps:a}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),a),n)},MultiValue:function(e){var t=e.children,n=e.components,a=e.data,r=e.innerProps,o=e.isDisabled,i=e.removeProps,s=e.selectProps,l=n.Container,c=n.Label,u=n.Remove;return Ze(l,{data:a,innerProps:f(f({},Dt(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":o})),r),selectProps:s},Ze(c,{data:a,innerProps:f({},Dt(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:s},t),Ze(u,{data:a,innerProps:f(f({},Dt(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},i),selectProps:s}))},MultiValueContainer:bn,MultiValueLabel:bn,MultiValueRemove:function(e){var t=e.children,n=e.innerProps;return Ze("div",b({role:"button"},n),t||Ze(on,{size:14}))},Option:function(e){var t=e.children,n=e.isDisabled,a=e.isFocused,r=e.isSelected,o=e.innerRef,i=e.innerProps;return Ze("div",b({},Dt(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":a,"option--is-selected":r}),{ref:o,"aria-disabled":n},i),t)},Placeholder:function(e){var t=e.children,n=e.innerProps;return Ze("div",b({},Dt(e,"placeholder",{placeholder:!0}),n),t)},SelectContainer:function(e){var t=e.children,n=e.innerProps,a=e.isDisabled,r=e.isRtl;return Ze("div",b({},Dt(e,"container",{"--is-disabled":a,"--is-rtl":r}),n),t)},SingleValue:function(e){var t=e.children,n=e.isDisabled,a=e.innerProps;return Ze("div",b({},Dt(e,"singleValue",{"single-value":!0,"single-value--is-disabled":n}),a),t)},ValueContainer:function(e){var t=e.children,n=e.innerProps,a=e.isMulti,r=e.hasValue;return Ze("div",b({},Dt(e,"valueContainer",{"value-container":!0,"value-container--is-multi":a,"value-container--has-value":r}),n),t)}},wn=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function Cn(e,t){return e===t||!(!wn(e)||!wn(t))}function En(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Cn(e[n],t[n]))return!1;return!0}for(var On={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},Sn=function(e){return Ze("span",b({css:On},e))},kn={guidance:function(e){var t=e.isSearchable,n=e.isMulti,a=e.tabSelectsValue,r=e.context,o=e.isInitialFocus;switch(r){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(a?", press Tab to select the option and exit the menu":"",".");case"input":return o?"".concat(e["aria-label"]||"Select"," is focused ").concat(t?",type to refine list":"",", press Down to open the menu, ").concat(n?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var t=e.action,n=e.label,a=void 0===n?"":n,r=e.labels,o=e.isDisabled;switch(t){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(a,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(r.length>1?"s":""," ").concat(r.join(","),", selected.");case"select-option":return"option ".concat(a,o?" is disabled. Select another option.":", selected.");default:return""}},onFocus:function(e){var t=e.context,n=e.focused,a=e.options,r=e.label,o=void 0===r?"":r,i=e.selectValue,s=e.isDisabled,l=e.isSelected,c=e.isAppleDevice,u=function(e,t){return e&&e.length?"".concat(e.indexOf(t)+1," of ").concat(e.length):""};if("value"===t&&i)return"value ".concat(o," focused, ").concat(u(i,n),".");if("menu"===t&&c){var d=s?" disabled":"",f="".concat(l?" selected":"").concat(d);return"".concat(o).concat(f,", ").concat(u(a,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},xn=function(e){var t=e.ariaSelection,n=e.focusedOption,a=e.focusedValue,r=e.focusableOptions,i=e.isFocused,s=e.selectValue,l=e.selectProps,c=e.id,u=e.isAppleDevice,d=l.ariaLiveMessages,p=l.getOptionLabel,m=l.inputValue,h=l.isMulti,g=l.isOptionDisabled,v=l.isSearchable,b=l.menuIsOpen,y=l.options,w=l.screenReaderStatus,C=l.tabSelectsValue,E=l.isLoading,O=l["aria-label"],S=l["aria-live"],k=(0,o.useMemo)(function(){return f(f({},kn),d||{})},[d]),_=(0,o.useMemo)(function(){var e,n="";if(t&&k.onChange){var a=t.option,r=t.options,o=t.removedValue,i=t.removedValues,l=t.value,c=o||a||(e=l,Array.isArray(e)?null:e),u=c?p(c):"",d=r||i||void 0,m=d?d.map(p):[],h=f({isDisabled:c&&g(c,s),label:u,labels:m},t);n=k.onChange(h)}return n},[t,k,g,s,p]),x=(0,o.useMemo)(function(){var e="",t=n||a,o=!!(n&&s&&s.includes(n));if(t&&k.onFocus){var i={focused:t,label:p(t),isDisabled:g(t,s),isSelected:o,options:r,context:t===n?"menu":"value",selectValue:s,isAppleDevice:u};e=k.onFocus(i)}return e},[n,a,p,g,k,r,s,u]),T=(0,o.useMemo)(function(){var e="";if(b&&y.length&&!E&&k.onFilter){var t=w({count:r.length});e=k.onFilter({inputValue:m,resultsMessage:t})}return e},[r,m,b,k,y,w,E]),I="initial-input-focus"===(null==t?void 0:t.action),P=(0,o.useMemo)(function(){var e="";if(k.guidance){var t=a?"value":b?"menu":"input";e=k.guidance({"aria-label":O,context:t,isDisabled:n&&g(n,s),isMulti:h,isSearchable:v,tabSelectsValue:C,isInitialFocus:I})}return e},[O,n,a,h,g,v,b,k,s,C,I]),D=Ze(o.Fragment,null,Ze("span",{id:"aria-selection"},_),Ze("span",{id:"aria-focused"},x),Ze("span",{id:"aria-results"},T),Ze("span",{id:"aria-guidance"},P));return Ze(o.Fragment,null,Ze(Sn,{id:c},I&&D),Ze(Sn,{"aria-live":S,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},i&&!I&&D))},Tn=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],In=new RegExp("["+Tn.map(function(e){return e.letters}).join("")+"]","g"),Pn={},Dn=0;Dn<Tn.length;Dn++)for(var Mn=Tn[Dn],Fn=0;Fn<Mn.letters.length;Fn++)Pn[Mn.letters[Fn]]=Mn.base;var Vn=function(e){return e.replace(In,function(e){return Pn[e]})},Rn=function(e,t){void 0===t&&(t=En);var n=null;function a(){for(var a=[],r=0;r<arguments.length;r++)a[r]=arguments[r];if(n&&n.lastThis===this&&t(a,n.lastArgs))return n.lastResult;var o=e.apply(this,a);return n={lastResult:o,lastArgs:a,lastThis:this},o}return a.clear=function(){n=null},a}(Vn),Nn=function(e){return e.replace(/^\s+|\s+$/g,"")},Ln=function(e){return"".concat(e.label," ").concat(e.value)},An=["innerRef"];function $n(e){var t=e.innerRef,n=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];var r=Object.entries(e).filter(function(e){var t=h(e,1)[0];return!n.includes(t)});return r.reduce(function(e,t){var n=h(t,2),a=n[0],r=n[1];return e[a]=r,e},{})}(g(e,An),"onExited","in","enter","exit","appear");return Ze("input",b({ref:t},n,{css:Je({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var Bn=["boxSizing","height","overflow","paddingRight","position"],Hn={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function jn(e){e.cancelable&&e.preventDefault()}function zn(e){e.stopPropagation()}function Un(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;0===e?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function Wn(){return"ontouchstart"in window||navigator.maxTouchPoints}var Gn=!("undefined"==typeof window||!window.document||!window.document.createElement),qn=0,Kn={capture:!1,passive:!1},Yn=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},Xn={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function Zn(e){var t=e.children,n=e.lockEnabled,a=e.captureEnabled,r=function(e){var t=e.isEnabled,n=e.onBottomArrive,a=e.onBottomLeave,r=e.onTopArrive,i=e.onTopLeave,s=(0,o.useRef)(!1),l=(0,o.useRef)(!1),c=(0,o.useRef)(0),u=(0,o.useRef)(null),d=(0,o.useCallback)(function(e,t){if(null!==u.current){var o=u.current,c=o.scrollTop,d=o.scrollHeight,f=o.clientHeight,p=u.current,m=t>0,h=d-f-c,g=!1;h>t&&s.current&&(a&&a(e),s.current=!1),m&&l.current&&(i&&i(e),l.current=!1),m&&t>h?(n&&!s.current&&n(e),p.scrollTop=d,g=!0,s.current=!0):!m&&-t>c&&(r&&!l.current&&r(e),p.scrollTop=0,g=!0,l.current=!0),g&&function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()}(e)}},[n,a,r,i]),f=(0,o.useCallback)(function(e){d(e,e.deltaY)},[d]),p=(0,o.useCallback)(function(e){c.current=e.changedTouches[0].clientY},[]),m=(0,o.useCallback)(function(e){var t=c.current-e.changedTouches[0].clientY;d(e,t)},[d]),h=(0,o.useCallback)(function(e){if(e){var t=!!Ht&&{passive:!1};e.addEventListener("wheel",f,t),e.addEventListener("touchstart",p,t),e.addEventListener("touchmove",m,t)}},[m,p,f]),g=(0,o.useCallback)(function(e){e&&(e.removeEventListener("wheel",f,!1),e.removeEventListener("touchstart",p,!1),e.removeEventListener("touchmove",m,!1))},[m,p,f]);return(0,o.useEffect)(function(){if(t){var e=u.current;return h(e),function(){g(e)}}},[t,h,g]),function(e){u.current=e}}({isEnabled:void 0===a||a,onBottomArrive:e.onBottomArrive,onBottomLeave:e.onBottomLeave,onTopArrive:e.onTopArrive,onTopLeave:e.onTopLeave}),i=function(e){var t=e.isEnabled,n=e.accountForScrollbars,a=void 0===n||n,r=(0,o.useRef)({}),i=(0,o.useRef)(null),s=(0,o.useCallback)(function(e){if(Gn){var t=document.body,n=t&&t.style;if(a&&Bn.forEach(function(e){var t=n&&n[e];r.current[e]=t}),a&&qn<1){var o=parseInt(r.current.paddingRight,10)||0,i=document.body?document.body.clientWidth:0,s=window.innerWidth-i+o||0;Object.keys(Hn).forEach(function(e){var t=Hn[e];n&&(n[e]=t)}),n&&(n.paddingRight="".concat(s,"px"))}t&&Wn()&&(t.addEventListener("touchmove",jn,Kn),e&&(e.addEventListener("touchstart",Un,Kn),e.addEventListener("touchmove",zn,Kn))),qn+=1}},[a]),l=(0,o.useCallback)(function(e){if(Gn){var t=document.body,n=t&&t.style;qn=Math.max(qn-1,0),a&&qn<1&&Bn.forEach(function(e){var t=r.current[e];n&&(n[e]=t)}),t&&Wn()&&(t.removeEventListener("touchmove",jn,Kn),e&&(e.removeEventListener("touchstart",Un,Kn),e.removeEventListener("touchmove",zn,Kn)))}},[a]);return(0,o.useEffect)(function(){if(t){var e=i.current;return s(e),function(){l(e)}}},[t,s,l]),function(e){i.current=e}}({isEnabled:n});return Ze(o.Fragment,null,n&&Ze("div",{onClick:Yn,css:Xn}),t(function(e){r(e),i(e)}))}var Jn={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Qn=function(e){var t=e.name,n=e.onFocus;return Ze("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:n,css:Jn,value:"",onChange:function(){}})};function ea(e){var t;return"undefined"!=typeof window&&null!=window.navigator&&e.test((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.platform)||window.navigator.platform)}function ta(){return ea(/^Mac/i)}var na={clearIndicator:un,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},control:function(e,t){var n=e.isDisabled,a=e.isFocused,r=e.theme,o=r.colors,i=r.borderRadius;return f({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:r.spacing.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:n?o.neutral5:o.neutral0,borderColor:n?o.neutral10:a?o.primary:o.neutral20,borderRadius:i,borderStyle:"solid",borderWidth:1,boxShadow:a?"0 0 0 1px ".concat(o.primary):void 0,"&:hover":{borderColor:a?o.primary:o.neutral30}})},dropdownIndicator:cn,group:function(e,t){var n=e.theme.spacing;return t?{}:{paddingBottom:2*n.baseUnit,paddingTop:2*n.baseUnit}},groupHeading:function(e,t){var n=e.theme,a=n.colors,r=n.spacing;return f({label:"group",cursor:"default",display:"block"},t?{}:{color:a.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*r.baseUnit,paddingRight:3*r.baseUnit,textTransform:"uppercase"})},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e,t){var n=e.isDisabled,a=e.theme,r=a.spacing.baseUnit,o=a.colors;return f({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:n?o.neutral10:o.neutral20,marginBottom:2*r,marginTop:2*r})},input:function(e,t){var n=e.isDisabled,a=e.value,r=e.theme,o=r.spacing,i=r.colors;return f(f({visibility:n?"hidden":"visible",transform:a?"translateZ(0)":""},gn),t?{}:{margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,color:i.neutral80})},loadingIndicator:function(e,t){var n=e.isFocused,a=e.size,r=e.theme,o=r.colors,i=r.spacing.baseUnit;return f({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:a,lineHeight:1,marginRight:a,textAlign:"center",verticalAlign:"middle"},t?{}:{color:n?o.neutral60:o.neutral20,padding:2*i})},loadingMessage:en,menu:function(e,t){var n,a=e.placement,r=e.theme,o=r.borderRadius,i=r.spacing,s=r.colors;return f((u(n={label:"menu"},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(a),"100%"),u(n,"position","absolute"),u(n,"width","100%"),u(n,"zIndex",1),n),t?{}:{backgroundColor:s.neutral0,borderRadius:o,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:i.menuGutter,marginTop:i.menuGutter})},menuList:function(e,t){var n=e.maxHeight,a=e.theme.spacing.baseUnit;return f({maxHeight:n,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:a,paddingTop:a})},menuPortal:function(e){var t=e.rect,n=e.offset,a=e.position;return{left:t.left,position:a,top:n,width:t.width,zIndex:1}},multiValue:function(e,t){var n=e.theme,a=n.spacing,r=n.borderRadius,o=n.colors;return f({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:o.neutral10,borderRadius:r/2,margin:a.baseUnit/2})},multiValueLabel:function(e,t){var n=e.theme,a=n.borderRadius,r=n.colors,o=e.cropWithEllipsis;return f({overflow:"hidden",textOverflow:o||void 0===o?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:a/2,color:r.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},multiValueRemove:function(e,t){var n=e.theme,a=n.spacing,r=n.borderRadius,o=n.colors,i=e.isFocused;return f({alignItems:"center",display:"flex"},t?{}:{borderRadius:r/2,backgroundColor:i?o.dangerLight:void 0,paddingLeft:a.baseUnit,paddingRight:a.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}})},noOptionsMessage:Qt,option:function(e,t){var n=e.isDisabled,a=e.isFocused,r=e.isSelected,o=e.theme,i=o.spacing,s=o.colors;return f({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:r?s.primary:a?s.primary25:"transparent",color:n?s.neutral20:r?s.neutral0:"inherit",padding:"".concat(2*i.baseUnit,"px ").concat(3*i.baseUnit,"px"),":active":{backgroundColor:n?void 0:r?s.primary:s.primary50}})},placeholder:function(e,t){var n=e.theme,a=n.spacing,r=n.colors;return f({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:r.neutral50,marginLeft:a.baseUnit/2,marginRight:a.baseUnit/2})},singleValue:function(e,t){var n=e.isDisabled,a=e.theme,r=a.spacing,o=a.colors;return f({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:n?o.neutral40:o.neutral80,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},valueContainer:function(e,t){var n=e.theme.spacing,a=e.isMulti,r=e.hasValue,o=e.selectProps.controlShouldRenderValue;return f({alignItems:"center",display:a&&r&&o?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(n.baseUnit/2,"px ").concat(2*n.baseUnit,"px")})}},aa={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},ra={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Lt(),captureMenuScroll:!Lt(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var n=f({ignoreCase:!0,ignoreAccents:!0,stringify:Ln,trim:!0,matchFrom:"any"},void 0),a=n.ignoreCase,r=n.ignoreAccents,o=n.stringify,i=n.trim,s=n.matchFrom,l=i?Nn(t):t,c=i?Nn(o(e)):o(e);return a&&(l=l.toLowerCase(),c=c.toLowerCase()),r&&(l=Rn(l),c=Vn(c)),"start"===s?c.substr(0,l.length)===l:c.indexOf(l)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function oa(e,t,n,a){return{type:"option",data:t,isDisabled:pa(e,t,n),isSelected:ma(e,t,n),label:da(e,t),value:fa(e,t),index:a}}function ia(e,t){return e.options.map(function(n,a){if("options"in n){var r=n.options.map(function(n,a){return oa(e,n,t,a)}).filter(function(t){return ca(e,t)});return r.length>0?{type:"group",data:n,options:r,index:a}:void 0}var o=oa(e,n,t,a);return ca(e,o)?o:void 0}).filter(jt)}function sa(e){return e.reduce(function(e,t){return"group"===t.type?e.push.apply(e,O(t.options.map(function(e){return e.data}))):e.push(t.data),e},[])}function la(e,t){return e.reduce(function(e,n){return"group"===n.type?e.push.apply(e,O(n.options.map(function(e){return{data:e.data,id:"".concat(t,"-").concat(n.index,"-").concat(e.index)}}))):e.push({data:n.data,id:"".concat(t,"-").concat(n.index)}),e},[])}function ca(e,t){var n=e.inputValue,a=void 0===n?"":n,r=t.data,o=t.isSelected,i=t.label,s=t.value;return(!ga(e)||!o)&&ha(e,{label:i,value:s,data:r},a)}var ua=function(e,t){var n;return(null===(n=e.find(function(e){return e.data===t}))||void 0===n?void 0:n.id)||null},da=function(e,t){return e.getOptionLabel(t)},fa=function(e,t){return e.getOptionValue(t)};function pa(e,t,n){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,n)}function ma(e,t,n){if(n.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,n);var a=fa(e,t);return n.some(function(t){return fa(e,t)===a})}function ha(e,t,n){return!e.filterOption||e.filterOption(t,n)}var ga=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return void 0===t?n:t},va=1,ba=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&w(e,t)}(n,e);var t=function(e){var t=E();return function(){var n,a=C(e);if(t){var r=C(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return function(e,t){if(t&&("object"==l(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}(n);function n(e){var a;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(a=t.call(this,e)).state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},a.blockOptionHover=!1,a.isComposing=!1,a.commonProps=void 0,a.initialTouchX=0,a.initialTouchY=0,a.openAfterFocus=!1,a.scrollToFocusedOptionOnUpdate=!1,a.userIsDragging=void 0,a.isAppleDevice=ta()||ea(/^iPhone/i)||ea(/^iPad/i)||ta()&&navigator.maxTouchPoints>1,a.controlRef=null,a.getControlRef=function(e){a.controlRef=e},a.focusedOptionRef=null,a.getFocusedOptionRef=function(e){a.focusedOptionRef=e},a.menuListRef=null,a.getMenuListRef=function(e){a.menuListRef=e},a.inputRef=null,a.getInputRef=function(e){a.inputRef=e},a.focus=a.focusInput,a.blur=a.blurInput,a.onChange=function(e,t){var n=a.props,r=n.onChange,o=n.name;t.name=o,a.ariaOnChange(e,t),r(e,t)},a.setValue=function(e,t,n){var r=a.props,o=r.closeMenuOnSelect,i=r.isMulti,s=r.inputValue;a.onInputChange("",{action:"set-value",prevInputValue:s}),o&&(a.setState({inputIsHiddenAfterUpdate:!i}),a.onMenuClose()),a.setState({clearFocusValueOnUpdate:!0}),a.onChange(e,{action:t,option:n})},a.selectOption=function(e){var t=a.props,n=t.blurInputOnSelect,r=t.isMulti,o=t.name,i=a.state.selectValue,s=r&&a.isOptionSelected(e,i),l=a.isOptionDisabled(e,i);if(s){var c=a.getOptionValue(e);a.setValue(i.filter(function(e){return a.getOptionValue(e)!==c}),"deselect-option",e)}else{if(l)return void a.ariaOnChange(e,{action:"select-option",option:e,name:o});r?a.setValue([].concat(O(i),[e]),"select-option",e):a.setValue(e,"select-option")}n&&a.blurInput()},a.removeValue=function(e){var t=a.props.isMulti,n=a.state.selectValue,r=a.getOptionValue(e),o=n.filter(function(e){return a.getOptionValue(e)!==r}),i=zt(t,o,o[0]||null);a.onChange(i,{action:"remove-value",removedValue:e}),a.focusInput()},a.clearValue=function(){var e=a.state.selectValue;a.onChange(zt(a.props.isMulti,[],null),{action:"clear",removedValues:e})},a.popValue=function(){var e=a.props.isMulti,t=a.state.selectValue,n=t[t.length-1],r=t.slice(0,t.length-1),o=zt(e,r,r[0]||null);n&&a.onChange(o,{action:"pop-value",removedValue:n})},a.getFocusedOptionId=function(e){return ua(a.state.focusableOptionsWithIds,e)},a.getFocusableOptionsWithIds=function(){return la(ia(a.props,a.state.selectValue),a.getElementId("option"))},a.getValue=function(){return a.state.selectValue},a.cx=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Tt.apply(void 0,[a.props.classNamePrefix].concat(t))},a.getOptionLabel=function(e){return da(a.props,e)},a.getOptionValue=function(e){return fa(a.props,e)},a.getStyles=function(e,t){var n=a.props.unstyled,r=na[e](t,n);r.boxSizing="border-box";var o=a.props.styles[e];return o?o(r,t):r},a.getClassNames=function(e,t){var n,r;return null===(n=(r=a.props.classNames)[e])||void 0===n?void 0:n.call(r,t)},a.getElementId=function(e){return"".concat(a.state.instancePrefix,"-").concat(e)},a.getComponents=function(){return e=a.props,f(f({},yn),e.components);var e},a.buildCategorizedOptions=function(){return ia(a.props,a.state.selectValue)},a.getCategorizedOptions=function(){return a.props.menuIsOpen?a.buildCategorizedOptions():[]},a.buildFocusableOptions=function(){return sa(a.buildCategorizedOptions())},a.getFocusableOptions=function(){return a.props.menuIsOpen?a.buildFocusableOptions():[]},a.ariaOnChange=function(e,t){a.setState({ariaSelection:f({value:e},t)})},a.onMenuMouseDown=function(e){0===e.button&&(e.stopPropagation(),e.preventDefault(),a.focusInput())},a.onMenuMouseMove=function(e){a.blockOptionHover=!1},a.onControlMouseDown=function(e){if(!e.defaultPrevented){var t=a.props.openMenuOnClick;a.state.isFocused?a.props.menuIsOpen?"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&a.onMenuClose():t&&a.openMenu("first"):(t&&(a.openAfterFocus=!0),a.focusInput()),"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&e.preventDefault()}},a.onDropdownIndicatorMouseDown=function(e){if(!(e&&"mousedown"===e.type&&0!==e.button||a.props.isDisabled)){var t=a.props,n=t.isMulti,r=t.menuIsOpen;a.focusInput(),r?(a.setState({inputIsHiddenAfterUpdate:!n}),a.onMenuClose()):a.openMenu("first"),e.preventDefault()}},a.onClearIndicatorMouseDown=function(e){e&&"mousedown"===e.type&&0!==e.button||(a.clearValue(),e.preventDefault(),a.openAfterFocus=!1,"touchend"===e.type?a.focusInput():setTimeout(function(){return a.focusInput()}))},a.onScroll=function(e){"boolean"==typeof a.props.closeMenuOnScroll?e.target instanceof HTMLElement&&Mt(e.target)&&a.props.onMenuClose():"function"==typeof a.props.closeMenuOnScroll&&a.props.closeMenuOnScroll(e)&&a.props.onMenuClose()},a.onCompositionStart=function(){a.isComposing=!0},a.onCompositionEnd=function(){a.isComposing=!1},a.onTouchStart=function(e){var t=e.touches,n=t&&t.item(0);n&&(a.initialTouchX=n.clientX,a.initialTouchY=n.clientY,a.userIsDragging=!1)},a.onTouchMove=function(e){var t=e.touches,n=t&&t.item(0);if(n){var r=Math.abs(n.clientX-a.initialTouchX),o=Math.abs(n.clientY-a.initialTouchY);a.userIsDragging=r>5||o>5}},a.onTouchEnd=function(e){a.userIsDragging||(a.controlRef&&!a.controlRef.contains(e.target)&&a.menuListRef&&!a.menuListRef.contains(e.target)&&a.blurInput(),a.initialTouchX=0,a.initialTouchY=0)},a.onControlTouchEnd=function(e){a.userIsDragging||a.onControlMouseDown(e)},a.onClearIndicatorTouchEnd=function(e){a.userIsDragging||a.onClearIndicatorMouseDown(e)},a.onDropdownIndicatorTouchEnd=function(e){a.userIsDragging||a.onDropdownIndicatorMouseDown(e)},a.handleInputChange=function(e){var t=a.props.inputValue,n=e.currentTarget.value;a.setState({inputIsHiddenAfterUpdate:!1}),a.onInputChange(n,{action:"input-change",prevInputValue:t}),a.props.menuIsOpen||a.onMenuOpen()},a.onInputFocus=function(e){a.props.onFocus&&a.props.onFocus(e),a.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(a.openAfterFocus||a.props.openMenuOnFocus)&&a.openMenu("first"),a.openAfterFocus=!1},a.onInputBlur=function(e){var t=a.props.inputValue;a.menuListRef&&a.menuListRef.contains(document.activeElement)?a.inputRef.focus():(a.props.onBlur&&a.props.onBlur(e),a.onInputChange("",{action:"input-blur",prevInputValue:t}),a.onMenuClose(),a.setState({focusedValue:null,isFocused:!1}))},a.onOptionHover=function(e){if(!a.blockOptionHover&&a.state.focusedOption!==e){var t=a.getFocusableOptions().indexOf(e);a.setState({focusedOption:e,focusedOptionId:t>-1?a.getFocusedOptionId(e):null})}},a.shouldHideSelectedOptions=function(){return ga(a.props)},a.onValueInputFocus=function(e){e.preventDefault(),e.stopPropagation(),a.focus()},a.onKeyDown=function(e){var t=a.props,n=t.isMulti,r=t.backspaceRemovesValue,o=t.escapeClearsValue,i=t.inputValue,s=t.isClearable,l=t.isDisabled,c=t.menuIsOpen,u=t.onKeyDown,d=t.tabSelectsValue,f=t.openMenuOnFocus,p=a.state,m=p.focusedOption,h=p.focusedValue,g=p.selectValue;if(!(l||"function"==typeof u&&(u(e),e.defaultPrevented))){switch(a.blockOptionHover=!0,e.key){case"ArrowLeft":if(!n||i)return;a.focusValue("previous");break;case"ArrowRight":if(!n||i)return;a.focusValue("next");break;case"Delete":case"Backspace":if(i)return;if(h)a.removeValue(h);else{if(!r)return;n?a.popValue():s&&a.clearValue()}break;case"Tab":if(a.isComposing)return;if(e.shiftKey||!c||!d||!m||f&&a.isOptionSelected(m,g))return;a.selectOption(m);break;case"Enter":if(229===e.keyCode)break;if(c){if(!m)return;if(a.isComposing)return;a.selectOption(m);break}return;case"Escape":c?(a.setState({inputIsHiddenAfterUpdate:!1}),a.onInputChange("",{action:"menu-close",prevInputValue:i}),a.onMenuClose()):s&&o&&a.clearValue();break;case" ":if(i)return;if(!c){a.openMenu("first");break}if(!m)return;a.selectOption(m);break;case"ArrowUp":c?a.focusOption("up"):a.openMenu("last");break;case"ArrowDown":c?a.focusOption("down"):a.openMenu("first");break;case"PageUp":if(!c)return;a.focusOption("pageup");break;case"PageDown":if(!c)return;a.focusOption("pagedown");break;case"Home":if(!c)return;a.focusOption("first");break;case"End":if(!c)return;a.focusOption("last");break;default:return}e.preventDefault()}},a.state.instancePrefix="react-select-"+(a.props.instanceId||++va),a.state.selectValue=It(e.value),e.menuIsOpen&&a.state.selectValue.length){var r=a.getFocusableOptionsWithIds(),o=a.buildFocusableOptions(),i=o.indexOf(a.state.selectValue[0]);a.state.focusableOptionsWithIds=r,a.state.focusedOption=o[i],a.state.focusedOptionId=ua(r,o[i])}return a}return function(e,t,n){t&&y(e.prototype,t),n&&y(e,n),Object.defineProperty(e,"prototype",{writable:!1})}(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Nt(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.isDisabled,a=t.menuIsOpen,r=this.state.isFocused;(r&&!n&&e.isDisabled||r&&a&&!e.menuIsOpen)&&this.focusInput(),r&&n&&!e.isDisabled?this.setState({isFocused:!1},this.onMenuClose):r||n||!e.isDisabled||this.inputRef!==document.activeElement||this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Nt(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(e,t){this.props.onInputChange(e,t)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(e){var t=this,n=this.state,a=n.selectValue,r=n.isFocused,o=this.buildFocusableOptions(),i="first"===e?0:o.length-1;if(!this.props.isMulti){var s=o.indexOf(a[0]);s>-1&&(i=s)}this.scrollToFocusedOptionOnUpdate=!(r&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:o[i],focusedOptionId:this.getFocusedOptionId(o[i])},function(){return t.onMenuOpen()})}},{key:"focusValue",value:function(e){var t=this.state,n=t.selectValue,a=t.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var r=n.indexOf(a);a||(r=-1);var o=n.length-1,i=-1;if(n.length){switch(e){case"previous":i=0===r?0:-1===r?o:r-1;break;case"next":r>-1&&r<o&&(i=r+1)}this.setState({inputIsHidden:-1!==i,focusedValue:n[i]})}}}},{key:"focusOption",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,n=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var r=0,o=a.indexOf(n);n||(o=-1),"up"===e?r=o>0?o-1:a.length-1:"down"===e?r=(o+1)%a.length:"pageup"===e?(r=o-t)<0&&(r=0):"pagedown"===e?(r=o+t)>a.length-1&&(r=a.length-1):"last"===e&&(r=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[r],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[r])})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(aa):f(f({},aa),this.props.theme):aa}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,n=this.getStyles,a=this.getClassNames,r=this.getValue,o=this.selectOption,i=this.setValue,s=this.props,l=s.isMulti,c=s.isRtl,u=s.options;return{clearValue:e,cx:t,getStyles:n,getClassNames:a,getValue:r,hasValue:this.hasValue(),isMulti:l,isRtl:c,options:u,selectOption:o,selectProps:s,setValue:i,theme:this.getTheme()}}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return pa(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return ma(this.props,e,t)}},{key:"filterOption",value:function(e,t){return ha(this.props,e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:a})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,a=e.inputId,r=e.inputValue,i=e.tabIndex,s=e.form,l=e.menuIsOpen,c=e.required,u=this.getComponents().Input,d=this.state,p=d.inputIsHidden,m=d.ariaSelection,h=this.commonProps,g=a||this.getElementId("input"),v=f(f(f({"aria-autocomplete":"list","aria-expanded":l,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":c,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},l&&{"aria-controls":this.getElementId("listbox")}),!n&&{"aria-readonly":!0}),this.hasValue()?"initial-input-focus"===(null==m?void 0:m.action)&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return n?o.createElement(u,b({},h,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:g,innerRef:this.getInputRef,isDisabled:t,isHidden:p,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:i,form:s,type:"text",value:r},v)):o.createElement($n,b({id:g,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:_t,onFocus:this.onInputFocus,disabled:t,tabIndex:i,inputMode:"none",form:s,value:""},v))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.getComponents(),n=t.MultiValue,a=t.MultiValueContainer,r=t.MultiValueLabel,i=t.MultiValueRemove,s=t.SingleValue,l=t.Placeholder,c=this.commonProps,u=this.props,d=u.controlShouldRenderValue,f=u.isDisabled,p=u.isMulti,m=u.inputValue,h=u.placeholder,g=this.state,v=g.selectValue,y=g.focusedValue,w=g.isFocused;if(!this.hasValue()||!d)return m?null:o.createElement(l,b({},c,{key:"placeholder",isDisabled:f,isFocused:w,innerProps:{id:this.getElementId("placeholder")}}),h);if(p)return v.map(function(t,s){var l=t===y,u="".concat(e.getOptionLabel(t),"-").concat(e.getOptionValue(t));return o.createElement(n,b({},c,{components:{Container:a,Label:r,Remove:i},isFocused:l,isDisabled:f,key:u,index:s,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault()}},data:t}),e.formatOptionLabel(t,"value"))});if(m)return null;var C=v[0];return o.createElement(s,b({},c,{data:C,isDisabled:f}),this.formatOptionLabel(C,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.getComponents().ClearIndicator,t=this.commonProps,n=this.props,a=n.isDisabled,r=n.isLoading,i=this.state.isFocused;if(!this.isClearable()||!e||a||!this.hasValue()||r)return null;var s={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return o.createElement(e,b({},t,{innerProps:s,isFocused:i}))}},{key:"renderLoadingIndicator",value:function(){var e=this.getComponents().LoadingIndicator,t=this.commonProps,n=this.props,a=n.isDisabled,r=n.isLoading,i=this.state.isFocused;return e&&r?o.createElement(e,b({},t,{innerProps:{"aria-hidden":"true"},isDisabled:a,isFocused:i})):null}},{key:"renderIndicatorSeparator",value:function(){var e=this.getComponents(),t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var a=this.commonProps,r=this.props.isDisabled,i=this.state.isFocused;return o.createElement(n,b({},a,{isDisabled:r,isFocused:i}))}},{key:"renderDropdownIndicator",value:function(){var e=this.getComponents().DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,a=this.state.isFocused,r={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return o.createElement(e,b({},t,{innerProps:r,isDisabled:n,isFocused:a}))}},{key:"renderMenu",value:function(){var e=this,t=this.getComponents(),n=t.Group,a=t.GroupHeading,r=t.Menu,i=t.MenuList,s=t.MenuPortal,l=t.LoadingMessage,c=t.NoOptionsMessage,u=t.Option,d=this.commonProps,f=this.state.focusedOption,p=this.props,m=p.captureMenuScroll,h=p.inputValue,g=p.isLoading,v=p.loadingMessage,y=p.minMenuHeight,w=p.maxMenuHeight,C=p.menuIsOpen,E=p.menuPlacement,O=p.menuPosition,S=p.menuPortalTarget,k=p.menuShouldBlockScroll,_=p.menuShouldScrollIntoView,x=p.noOptionsMessage,T=p.onMenuScrollToTop,I=p.onMenuScrollToBottom;if(!C)return null;var P,D=function(t,n){var a=t.type,r=t.data,i=t.isDisabled,s=t.isSelected,l=t.label,c=t.value,p=f===r,m=i?void 0:function(){return e.onOptionHover(r)},h=i?void 0:function(){return e.selectOption(r)},g="".concat(e.getElementId("option"),"-").concat(n),v={id:g,onClick:h,onMouseMove:m,onMouseOver:m,tabIndex:-1,role:"option","aria-selected":e.isAppleDevice?void 0:s};return o.createElement(u,b({},d,{innerProps:v,data:r,isDisabled:i,isSelected:s,key:g,label:l,type:a,value:c,isFocused:p,innerRef:p?e.getFocusedOptionRef:void 0}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())P=this.getCategorizedOptions().map(function(t){if("group"===t.type){var r=t.data,i=t.options,s=t.index,l="".concat(e.getElementId("group"),"-").concat(s),c="".concat(l,"-heading");return o.createElement(n,b({},d,{key:l,data:r,options:i,Heading:a,headingProps:{id:c,data:t.data},label:e.formatGroupLabel(t.data)}),t.options.map(function(e){return D(e,"".concat(s,"-").concat(e.index))}))}if("option"===t.type)return D(t,"".concat(t.index))});else if(g){var M=v({inputValue:h});if(null===M)return null;P=o.createElement(l,d,M)}else{var F=x({inputValue:h});if(null===F)return null;P=o.createElement(c,d,F)}var V={minMenuHeight:y,maxMenuHeight:w,menuPlacement:E,menuPosition:O,menuShouldScrollIntoView:_},R=o.createElement(Zt,b({},d,V),function(t){var n=t.ref,a=t.placerProps,s=a.placement,l=a.maxHeight;return o.createElement(r,b({},d,V,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove},isLoading:g,placement:s}),o.createElement(Zn,{captureEnabled:m,onTopArrive:T,onBottomArrive:I,lockEnabled:k},function(t){return o.createElement(i,b({},d,{innerRef:function(n){e.getMenuListRef(n),t(n)},innerProps:{role:"listbox","aria-multiselectable":d.isMulti,id:e.getElementId("listbox")},isLoading:g,maxHeight:l,focusedOption:f}),P)}))});return S||"fixed"===O?o.createElement(s,b({},d,{appendTo:S,controlElement:this.controlRef,menuPlacement:E,menuPosition:O}),R):R}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,a=t.isDisabled,r=t.isMulti,i=t.name,s=t.required,l=this.state.selectValue;if(s&&!this.hasValue()&&!a)return o.createElement(Qn,{name:i,onFocus:this.onValueInputFocus});if(i&&!a){if(r){if(n){var c=l.map(function(t){return e.getOptionValue(t)}).join(n);return o.createElement("input",{name:i,type:"hidden",value:c})}var u=l.length>0?l.map(function(t,n){return o.createElement("input",{key:"i-".concat(n),name:i,type:"hidden",value:e.getOptionValue(t)})}):o.createElement("input",{name:i,type:"hidden",value:""});return o.createElement("div",null,u)}var d=l[0]?this.getOptionValue(l[0]):"";return o.createElement("input",{name:i,type:"hidden",value:d})}}},{key:"renderLiveRegion",value:function(){var e=this.commonProps,t=this.state,n=t.ariaSelection,a=t.focusedOption,r=t.focusedValue,i=t.isFocused,s=t.selectValue,l=this.getFocusableOptions();return o.createElement(xn,b({},e,{id:this.getElementId("live-region"),ariaSelection:n,focusedOption:a,focusedValue:r,isFocused:i,selectValue:s,focusableOptions:l,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var e=this.getComponents(),t=e.Control,n=e.IndicatorsContainer,a=e.SelectContainer,r=e.ValueContainer,i=this.props,s=i.className,l=i.id,c=i.isDisabled,u=i.menuIsOpen,d=this.state.isFocused,f=this.commonProps=this.getCommonProps();return o.createElement(a,b({},f,{className:s,innerProps:{id:l,onKeyDown:this.onKeyDown},isDisabled:c,isFocused:d}),this.renderLiveRegion(),o.createElement(t,b({},f,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:c,isFocused:d,menuIsOpen:u}),o.createElement(r,b({},f,{isDisabled:c}),this.renderPlaceholderOrValue(),this.renderInput()),o.createElement(n,b({},f,{isDisabled:c}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,a=t.clearFocusValueOnUpdate,r=t.inputIsHiddenAfterUpdate,o=t.ariaSelection,i=t.isFocused,s=t.prevWasFocused,l=t.instancePrefix,c=e.options,u=e.value,d=e.menuIsOpen,p=e.inputValue,m=e.isMulti,h=It(u),g={};if(n&&(u!==n.value||c!==n.options||d!==n.menuIsOpen||p!==n.inputValue)){var v=d?function(e,t){return sa(ia(e,t))}(e,h):[],b=d?la(ia(e,h),"".concat(l,"-option")):[],y=a?function(e,t){var n=e.focusedValue,a=e.selectValue.indexOf(n);if(a>-1){if(t.indexOf(n)>-1)return n;if(a<t.length)return t[a]}return null}(t,h):null,w=function(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}(t,v);g={selectValue:h,focusedOption:w,focusedOptionId:ua(b,w),focusableOptionsWithIds:b,focusedValue:y,clearFocusValueOnUpdate:!1}}var C=null!=r&&e!==n?{inputIsHidden:r,inputIsHiddenAfterUpdate:void 0}:{},E=o,O=i&&s;return i&&!O&&(E={value:zt(m,h,h[0]||null),options:h,action:"initial-input-focus"},O=!s),"initial-input-focus"===(null==o?void 0:o.action)&&(E=null),f(f(f({},g),C),{},{prevProps:e,ariaSelection:E,prevWasFocused:O})}}]),n}(o.Component);ba.defaultProps=ra;var ya=(0,o.forwardRef)(function(e,t){var n=function(e){var t=e.defaultInputValue,n=void 0===t?"":t,a=e.defaultMenuIsOpen,r=void 0!==a&&a,i=e.defaultValue,s=void 0===i?null:i,l=e.inputValue,c=e.menuIsOpen,u=e.onChange,d=e.onInputChange,p=e.onMenuClose,m=e.onMenuOpen,b=e.value,y=g(e,v),w=h((0,o.useState)(void 0!==l?l:n),2),C=w[0],E=w[1],O=h((0,o.useState)(void 0!==c?c:r),2),S=O[0],k=O[1],_=h((0,o.useState)(void 0!==b?b:s),2),x=_[0],T=_[1],I=(0,o.useCallback)(function(e,t){"function"==typeof u&&u(e,t),T(e)},[u]),P=(0,o.useCallback)(function(e,t){var n;"function"==typeof d&&(n=d(e,t)),E(void 0!==n?n:e)},[d]),D=(0,o.useCallback)(function(){"function"==typeof m&&m(),k(!0)},[m]),M=(0,o.useCallback)(function(){"function"==typeof p&&p(),k(!1)},[p]),F=void 0!==l?l:C,V=void 0!==c?c:S,R=void 0!==b?b:x;return f(f({},y),{},{inputValue:F,menuIsOpen:V,onChange:I,onInputChange:P,onMenuClose:M,onMenuOpen:D,value:R})}(e);return o.createElement(ba,b({ref:t},n))}),wa=ya;const Ca=({channel:e,titleValue:t,saving:n,error:a,handleTitleClick:r,handleTitleChange:o,handleKeyDown:s,handleCancelEdit:l,saveTitle:c,botForChannel:u,chatsForChannel:d=[],formsForChannel:f=[],availableForms:p=[],showFormSelector:m,handleAddForm:h,handleFormSelect:g,handleRemoveForm:v,availableBots:b=[],handleBotSelect:y,handleRemoveBot:w,bot2ChatConnections:C=[],handleToggleChat:E,deleteChannel:O,getToggleButtonLabel:S,dataAvailability:k={forms:"ready",bots:"ready",chats:"ready"},mutatingRelations:_=!1})=>{const x=(u?.chats||[]).map(e=>{const t=C.find(t=>t.data.from===u.id&&t.data.to===e.id),n=t?.data?.meta?.status?.[0]||null;if("pending"===n)return null;let a=d.some(t=>t.id===e.id)?"Active":"Paused";return"muted"===n&&(a="Muted"),{...e,status:a}}).filter(Boolean);return i().createElement("div",{className:"entity-container channel"+(()=>{let e="";return u?.online&&(e+=" has-bot-online"),x.some(e=>"Active"===e.status)&&(e+=" has-active-chats"),f.length>0&&(e+=" has-forms"),e})(),"data-testid":`cf7tg-channel-${e.id}`,key:e.id,id:`channel-${e.id}`},i().createElement("div",{className:"entity-wrapper channel-wrapper"},i().createElement("div",{className:"frame channel-title-wrapper"},i().createElement("div",{className:"columns"},i().createElement("div",{className:"column title-column"},i().createElement("input",{className:"edit-title","data-testid":`cf7tg-channel-title-input-${e.id}`,type:"text",value:t,onChange:o,onKeyDown:s,onBlur:c,disabled:n,autoFocus:!0})),i().createElement("div",{className:"column bot-column"},"error"===k.bots?i().createElement("span",{className:"resource-error"},wp.i18n.__("Bots are unavailable.","cf7-telegram")):"ready"!==k.bots?i().createElement("span",{className:"resource-loading"},wp.i18n.__("Loading bots...","cf7-telegram")):u?i().createElement("div",{"data-Bot-Id":u.id,"data-testid":`cf7tg-channel-${e.id}-bot-${u.id}`,className:"bot-for-channel "+(u?.online?"online":"offline")},i().createElement("span",null,u.title.rendered),i().createElement("button",{className:"detach-button detach-bot-button crux",onClick:w,disabled:_})):i().createElement(i().Fragment,null,b.length>0&&i().createElement(wa,{className:"select-picker bot-picker",classNamePrefix:"select-picker",inputId:`cf7tg-channel-bot-picker-${e.id}`,instanceId:`cf7tg-channel-bot-picker-${e.id}`,"data-testid":`cf7tg-channel-${e.id}-bot-picker`,options:b.map(e=>({value:e.id,label:e.title.rendered})),isSearchable:!1,placeholder:wp.i18n.__("Pick a bot","cf7-telegram"),onChange:e=>y({target:{value:e?.value}}),isClearable:!0,isDisabled:_}))))),i().createElement("div",{className:"frame chats"},"error"===k.chats?i().createElement("span",{className:"resource-error"},wp.i18n.__("Chat data is unavailable.","cf7-telegram")):"ready"!==k.chats?i().createElement("span",{className:"resource-loading"},wp.i18n.__("Loading chat data...","cf7-telegram")):x.length>0?i().createElement(i().Fragment,null,x.map(t=>i().createElement("div",{key:t.id,className:`chat chat-${t.id} ${t.status.toLowerCase()}`,"data-testid":`cf7tg-channel-${e.id}-chat-${t.id}`,onClick:()=>!_&&E(t.id,t.status),"aria-disabled":_,title:S(t.status)},i().createElement("span",{className:"chat-username"},t.title.rendered)))):i().createElement("span",{className:"no-chats-found"},"[",wp.i18n.__("No chats assigned to this bridge","cf7-telegram"),"]")),i().createElement("div",{className:"frame forms"},i().createElement("button",{className:"add-button add-form-button","data-testid":`cf7tg-channel-${e.id}-add-form`,onClick:h,disabled:"ready"!==k.forms||_},m?wp.i18n.__("Cancel","cf7-telegram"):wp.i18n.__("Add Form","cf7-telegram")),"error"===k.forms?i().createElement("span",{className:"resource-error"},wp.i18n.__("Forms are unavailable.","cf7-telegram")):"ready"!==k.forms?i().createElement("span",{className:"resource-loading"},wp.i18n.__("Loading forms...","cf7-telegram")):m&&i().createElement(wa,{className:"select-picker form-picker",classNamePrefix:"select-picker",inputId:`cf7tg-channel-form-picker-${e.id}`,instanceId:`cf7tg-channel-form-picker-${e.id}`,"data-testid":`cf7tg-channel-${e.id}-form-picker`,options:p.map(e=>({value:e.id,label:e.title})),isSearchable:!0,placeholder:wp.i18n.__("Pick a form","cf7-telegram"),onChange:e=>g({target:{value:e?.value}}),isClearable:!0,isDisabled:_}),"ready"===k.forms&&(f.length>0?i().createElement("ul",{className:"form-list "+(m?"show-selector":"")},f.map(t=>i().createElement("li",{key:t.id,"data-testid":`cf7tg-channel-${e.id}-form-${t.id}`},t.title,i().createElement("button",{className:"detach-button crux detach-form-button",onClick:()=>v(t.id),disabled:_})))):m||i().createElement("span",{className:"no-forms-found"},"[",wp.i18n.__("No forms assigned to this bridge","cf7-telegram"),"]"))),i().createElement("div",{className:"frame status-bar"},i().createElement("button",{className:"remove-channel-button","data-testid":`cf7tg-remove-channel-${e.id}`,onClick:O,disabled:n||_},wp.i18n.__("Remove Bridge","cf7-telegram")))))};class Ea extends Error{constructor(e,t={}){super(e),this.name="ApiError",this.status=t.status??0,this.code=t.code??"",this.category=t.category??"rest_transport",this.method=t.method??"GET",this.url=t.url??"",this.data=t.data??null}}const Oa=(e,t="")=>[401,403].includes(Number(e))||/forbidden|unauthorized|cannot_/i.test(t)?"rest_permission":Number(e)>=400?"rest_http":"rest_transport",Sa=e=>String(e).replace(/bot\d{5,}(:|%(?:25)*3a)[A-Za-z0-9_-]{8,}/gi,"bot[telegram-token]").replace(/\d{5,}(:|%(?:25)*3a)[A-Za-z0-9_-]{8,}/gi,"[telegram-token]").replace(/([?&][^=]*(?:nonce|token|secret|password|key)[^=]*=)[^&\s]*/gi,"$1[redacted]"),ka=e=>"string"==typeof e?Sa(e):e&&"object"==typeof e?Array.isArray(e)?e.map(ka):Object.entries(e).reduce((e,[t,n])=>({...e,[t]:/nonce|token|secret|password|key/i.test(t)?"[redacted]":ka(n)}),{}):e,_a=e=>{try{const t=new URL(e,"undefined"!=typeof window?window.location?.origin??"https://example.invalid":"https://example.invalid");for(const e of Array.from(t.searchParams.keys()))/nonce|token|secret|password|key/i.test(e)&&t.searchParams.set(e,"[redacted]");return`${t.pathname}${t.search}${t.hash}`}catch(t){return Sa(e)}},xa=(e,t)=>{const n=t.toString();return n?`${e}${e.includes("?")?"&":"?"}${n}`:e},Ta=(e,t)=>xa(`${e}${t}`,new URLSearchParams({force:"true"})),Ia=async(e,t,n,a={})=>{const r=e;let o={method:t=t??"GET",headers:{"Content-Type":"application/json","X-WP-Nonce":cf7TelegramData?.nonce}},i=new URLSearchParams;if("GET"===t||"HEAD"===t){if(n){for(const[e,t]of Object.entries(n))null!=t&&i.append(e,t);n=null}e=xa(e,i)}n&&(o.body=JSON.stringify(n));try{const n=await fetch(e,o);let r;try{r=await n.json()}catch(a){throw new Ea(n.ok?"The server returned an invalid response.":"The request could not be completed.",{status:n.status??0,category:n.ok?"rest_parse":Oa(n.status),method:t,url:_a(e)})}if(!n.ok)throw new Ea("The request could not be completed.",{status:n.status??r?.data?.status??0,code:r?.code??"",category:Oa(n.status??r?.data?.status,r?.code),method:t,url:_a(e),data:ka(r?.data??null)});return a.includeResponse?{data:r,response:n}:r}catch(e){throw e instanceof Ea||(e=new Ea(Sa(e?.message||"API request failed"),{category:"rest_transport",method:t,url:_a(r)})),console.error("API request error:",e),e}},Pa=(e,t)=>{const n=new Set(e.map(e=>e?.id));return e.concat(t.filter(e=>!e||void 0===e.id||!n.has(e.id)&&(n.add(e.id),!0)))},Da=e=>{const t=e.headers?.get?.("X-WP-TotalPages"),n=Number.parseInt(t,10);return Number.isFinite(n)&&n>0?n:null},Ma=async(e,t={})=>(async(e,t={},n={})=>{const a=n.perPage??100;let r=1,o=1,i=[];do{const{data:s,response:l}=await Ia(e,"GET",{...t,per_page:a,page:r},{includeResponse:!0});i=Pa(i,Array.isArray(s)?s:[]);const c=Da(l);o=null===c&&n.stopWhenTotalPagesHeaderMissing?r:c??r,r+=1}while(r<=o);return i})(e,{order:"asc",orderby:"id",...t}),Fa=async()=>await Ia(cf7TelegramData.routes.client),Va=async()=>await(async()=>{let e=0,t=[],n=!0;for(;n;){const a=await Ia(cf7TelegramData.routes.forms,"GET",{per_page:100,offset:e,order:"asc",orderby:"id"}),r=t.length,o=Array.isArray(a)?a:[];t=Pa(t,o),e+=o.length,n=o.length>=100&&t.length>r}return t})(),Ra=async()=>await Ma(cf7TelegramData.routes.bots),Na=async()=>await Ma(cf7TelegramData.routes.chats),La=async()=>await Ma(cf7TelegramData.routes.channels),Aa=async()=>await Ia(cf7TelegramData.routes.relations.form2channel),$a=async()=>await Ia(cf7TelegramData.routes.relations.bot2channel),Ba=async()=>await Ia(cf7TelegramData.routes.relations.bot2chat),Ha=async()=>await Ia(cf7TelegramData.routes.relations.chat2channel);function ja(e,t=null){const n=t??e.innerText,a=()=>{e.classList.add("copied"),setTimeout(()=>e.classList.remove("copied"),1500)};if(navigator.clipboard&&window.isSecureContext)return void navigator.clipboard.writeText(n).then(a).catch(e=>{console.error("Clipboard error:",e)});const r=document.createElement("textarea");r.value=n,r.style.position="fixed",r.style.opacity="0",document.body.appendChild(r),r.focus(),r.select();try{document.execCommand("copy"),a()}catch(e){console.error("Fallback copy failed:",e)}finally{document.body.removeChild(r)}}const za=async(e,t,n)=>{const a=await(async(e,t)=>await Ia(cf7TelegramData.routes.relations.chat2channel,"POST",{from:e,to:t}))(e,t);a&&n(e=>[...e,{data:a}])},Ua=({channel:e,forms:t,setChannels:n,form2ChannelConnections:a,setForm2ChannelConnections:r,bots:s,bot2ChannelConnections:l,setBot2ChannelConnections:c,chats:u,chat2ChannelConnections:d,setChat2ChannelConnections:f,bot2ChatConnections:p,dataAvailability:m={forms:"ready",bots:"ready",chats:"ready"}})=>{const[h,g]=(0,o.useState)(null),[v,b]=(0,o.useState)([]),[y,w]=(0,o.useState)([]),[C,E]=(0,o.useState)([]),[O,S]=(0,o.useState)(!1),[k,_]=(0,o.useState)([]),[x,T]=(0,o.useState)(!1),[I,P]=(0,o.useState)(e.title.rendered),[D,M]=(0,o.useState)(!1),[F,V]=(0,o.useState)(!1),[R,N]=(0,o.useState)(null);(0,o.useEffect)(()=>{if("ready"!==m.bots||"ready"!==m.chats)return;const t=l.find(t=>t.data.to===e.id);if(!t)return g(null);const n=s.find(e=>e.id===t.data.from);if(!n)return g(null);const a=p.filter(e=>e.data.from===n.id),r=u.map(t=>{const n=a.find(e=>e.data.to===t.id);if(!n)return null;const r=d.some(n=>n.data.from===t.id&&n.data.to===e.id);return{...t,muted:!!n.data.muted,status:r?"active":"paused"}}).filter(Boolean);g({...n,chats:r}),b(r.filter(e=>"active"===e.status))},[e.id,s,l,p,u,d,m.bots,m.chats]),(0,o.useEffect)(()=>{if("ready"!==m.forms)return;const n=a.filter(t=>t.data?.to===e.id).map(e=>e.data.from),r=t.filter(e=>n.includes(e.id)),o=t.filter(e=>!n.includes(e.id));w(r),E(o)},[t,a,e.id,m.forms]),(0,o.useEffect)(()=>{if("ready"!==m.bots)return;const t=l.find(t=>t.data.to===e.id),n=t?.data.from,a=s.filter(e=>e.id!==n);_(a)},[s,l,e.id,m.bots]);const L=()=>{P(e.title.rendered),T(!1),N(null)},A=async()=>{if(""!==I.trim()&&I!==e.title.rendered){M(!0),N(null);try{await(async(e,t)=>{let n={title:t};return await Ia(`${cf7TelegramData.routes.channels}${e}`,"POST",n)})(e.id,I),T(!1)}catch(e){console.error(e),N(wp.i18n.__("Failed to update title","cf7-telegram"))}finally{M(!1)}}else T(!1)};return i().createElement(Ca,{channel:e,titleValue:I,saving:D,error:R,handleTitleClick:()=>{N(null),T(!0)},handleTitleChange:e=>P(e.target.value),handleKeyDown:e=>{"Enter"===e.key&&A(),"Escape"===e.key&&L()},handleCancelEdit:L,saveTitle:A,botForChannel:h,chatsForChannel:v,formsForChannel:y,availableForms:C,showFormSelector:O,handleAddForm:()=>S(e=>!e),handleFormSelect:async t=>{const n=parseInt(t.target.value,10);if(Number.isInteger(n)&&!F){V(!0);try{await(async(e,t,n)=>{const a=await(async(e,t)=>await Ia(cf7TelegramData.routes.relations.form2channel,"POST",{from:e,to:t}))(e,t);a&&n(e=>[...e,{data:a}])})(n,e.id,r)}catch(e){console.error(e),alert(wp.i18n.__("Something went wrong while assigning the form","cf7-telegram"))}finally{S(!1),V(!1)}}},handleRemoveForm:async t=>{const n=a.find(n=>n.data.from===t&&n.data.to===e.id);if(!F&&n&&window.confirm(wp.i18n.__("Are you sure you want to remove this form from the bridge?","cf7-telegram"))){V(!0);try{await(async(e,t)=>{await(async e=>await Ia(`${cf7TelegramData.routes.relations.form2channel}${e}`,"DELETE"))(e)&&t(t=>t.filter(t=>t.data.id!==e))})(n.data.id,r)}catch(e){console.error(e),alert(wp.i18n.__("Failed to remove form","cf7-telegram"))}finally{V(!1)}}},availableBots:k,handleBotSelect:async t=>{const n=parseInt(t.target.value,10);if(Number.isInteger(n)&&!F){V(!0);try{await(async(e,t,n)=>{const a=await(async(e,t)=>await Ia(cf7TelegramData.routes.relations.bot2channel,"POST",{from:e,to:t}))(e,t);a&&n(e=>[...e,{data:a}])})(n,e.id,c)}catch(e){console.error(e),alert(wp.i18n.__("Failed to assign bot","cf7-telegram"))}finally{V(!1)}}},handleRemoveBot:async()=>{const t=l.find(t=>t.data.to===e.id);if(t&&!F){V(!0);try{await(async(e,t)=>{await(async e=>await Ia(`${cf7TelegramData.routes.relations.bot2channel}${e}`,"DELETE"))(e)&&t(t=>t.filter(t=>t.data.id!==e))})(t.data.id,c)}catch(e){console.error(e),alert(wp.i18n.__("Failed to remove bot","cf7-telegram"))}finally{V(!1)}}},bot2ChatConnections:p,handleToggleChat:async(t,n)=>{if(F||"muted"===n.toLowerCase())return;let a=d.find(n=>n.data.from===t&&n.data.to===e.id);V(!0);try{a?await(async(e,t)=>{await(async e=>await Ia(`${cf7TelegramData.routes.relations.chat2channel}${e}`,"DELETE"))(e)&&t(t=>t.filter(t=>t.data.id!==e))})(a.data.id,f):await za(t,e.id,f)}catch(e){console.error("Failed to update bridge chat",e),N(wp.i18n.__("Failed to update chat","cf7-telegram"))}finally{V(!1)}},deleteChannel:async()=>{if(!D&&!F&&window.confirm(wp.i18n.__("Are you sure you want to delete this bridge?","cf7-telegram"))){M(!0),N(null);try{await(async(e,t)=>{await(async e=>await Ia(Ta(cf7TelegramData.routes.channels,e),"DELETE"))(e)&&t(t=>t.filter(t=>t.id!==e))})(e.id,n)}catch(e){console.error(e),N(wp.i18n.__("Failed to delete bridge","cf7-telegram"))}finally{M(!1)}}},getToggleButtonLabel:e=>{switch(e.toLowerCase()){case"active":return wp.i18n.__("Pause","cf7-telegram");case"paused":return wp.i18n.__("Activate","cf7-telegram");case"muted":return wp.i18n.__("Muted by Bot","cf7-telegram");default:return""}},dataAvailability:m,mutatingRelations:F})},Wa=({bot:e,chatsForBot:t=[],bot2ChatConnections:n=[],updatingStatusIds:a=[],updatingNameIds:r=[],renamingChatId:o=null,chatNameValue:s="",isEditingToken:l,nameValue:c,isTokenEmpty:u,tokenValue:d,saving:f,error:p,handleEditToken:m,deleteBot:h,handleKeyDown:g,setTokenValue:v,handleToggleChatStatus:b,handleDisconnectChat:y,handleStartRenameChat:w=()=>{},handleRenameChatChange:C=()=>{},handleRenameChatKeyDown:E=()=>{},handleCancelRenameChat:O=()=>{},handleSaveChatName:S=()=>{},handleRestoreChatName:k=()=>{},online:_,chatDataStatus:x="ready"})=>{let T=!0===_?"online":!1===_?"offline":"unknown",I=c.slice(0,18);const P=`@${c}`,D=u?d:`***${d.slice(-4)}`;return i().createElement("div",{className:`entity-container bot ${T}`,"data-testid":`cf7tg-bot-${e.id}`,key:e.id,id:`bot-${e.id}`},i().createElement("div",{className:"entity-wrapper bot-wrapper "+(f?"saving":"")},i().createElement("div",{className:"frame bot-summary"},i().createElement("div",{className:"bot-title"},i().createElement("div",{className:`bot-name ${T} copyable`,onClick:e=>ja(e.currentTarget,P),title:wp.i18n.__("Click to copy bot name","cf7-telegram")},"@",I,I!==c&&"..."),i().createElement("div",{className:"bot-command copyable",onClick:e=>ja(e.currentTarget),title:wp.i18n.__("Click to copy bot command","cf7-telegram")},"/cf7tg_start")),i().createElement("div",{className:"bot-token"},i().createElement("div",{className:"show-token"+(e.isTokenDefinedByConst?" const":""),"data-testid":`cf7tg-bot-token-display-${e.id}`,onClick:m,title:e.isTokenDefinedByConst?wp.i18n.__("Defined by PHP constant","cf7-telegram"):wp.i18n.__("Click to edit token","cf7-telegram")},wp.i18n.__("token","cf7-telegram"),": ",i().createElement("span",{className:"token-value"},l?"":D)),!_&&u&&!e.isTokenDefinedByConst&&i().createElement("div",{className:"php-const-hint copyable",title:wp.i18n.__("Click to copy PHP code","cf7-telegram"),onClick:t=>ja(t.currentTarget,`const ${e.phpConst} = 'your_token';`)},wp.i18n.__("set by PHP const","cf7-telegram")),l&&i().createElement(i().Fragment,null,i().createElement("input",{className:"edit-token","data-testid":`cf7tg-bot-token-input-${e.id}`,type:"text",value:d,onChange:e=>v(e.target.value),onKeyDown:g,autoFocus:!0,disabled:f,spellCheck:"false",title:wp.i18n.__("Press Enter to save token, Esc to cancel.","cf7-telegram")})))),p&&i().createElement("p",{style:{color:"red"}},p),i().createElement("div",{className:"frame chats-for-bot"},"error"===x?i().createElement("span",{className:"offline-bot-sad-message"},wp.i18n.__("Chat data is unavailable.","cf7-telegram")):"ready"!==x?i().createElement("span",{className:"unknown-bot-status-message"},wp.i18n.__("Loading chat data...","cf7-telegram")):t.length>0?i().createElement("ul",null,t.map(t=>{const l=function(e,t,n=[]){const a=n.find(n=>n.data.from===e&&n.data.to===t),r=a?.data?.meta?.status?.[0];return"pending"===r?"Pending":"muted"===r?"Muted":"Active"}(e.id,t.id,n),c=a.includes(t.id),u=o===t.id,d=r.includes(t.id),f="pending"!==l.toLowerCase();return i().createElement("li",{key:t.id,className:`chat-item ${l.toLowerCase()}`,"data-testid":`cf7tg-bot-${e.id}-chat-${t.id}`},u?i().createElement("input",{className:"chat-name edit-chat-name","data-testid":`cf7tg-bot-${e.id}-chat-${t.id}-name-input`,type:"text",value:s,onChange:C,onKeyDown:e=>E(t.id,e),disabled:d,autoFocus:!0}):i().createElement("span",{className:"chat-name",title:String(l)},t.title.rendered),u?i().createElement(i().Fragment,null,i().createElement("span",{className:"action save-chat-name",onClick:()=>S(t.id),"aria-disabled":d},d?wp.i18n.__("Saving...","cf7-telegram"):wp.i18n.__("Save","cf7-telegram")),i().createElement("span",{className:"action restore-chat-name",onClick:()=>k(t.id),"aria-disabled":d},wp.i18n.__("Restore","cf7-telegram")),i().createElement("span",{className:"action cancel-chat-name",onClick:O,"aria-disabled":d},wp.i18n.__("Cancel","cf7-telegram"))):i().createElement(i().Fragment,null,i().createElement("span",{className:"action toggle-status",onClick:()=>b(t.id,l.toLowerCase()),"aria-disabled":c},c?wp.i18n.__("Updating...","cf7-telegram"):function(e){return["muted","pending"].includes(e.toLowerCase())?wp.i18n.__("Activate","cf7-telegram"):wp.i18n.__("Mute","cf7-telegram")}(l)),f&&i().createElement("span",{className:"action rename-chat",onClick:()=>w(t),"aria-disabled":d},wp.i18n.__("Rename","cf7-telegram")),i().createElement("span",{className:"action remove-chat",onClick:()=>y(t.id,e.id)},wp.i18n.__("Remove","cf7-telegram"))))})):"offline"===T?i().createElement("span",{className:"offline-bot-sad-message"},wp.i18n.__("Couldn't load chat list...","cf7-telegram")):"unknown"===T?i().createElement("span",{className:"unknown-bot-status-message"},wp.i18n.__("Trying to load chat list...","cf7-telegram")):i().createElement("span",{className:"no-chats-found"},wp.i18n.__("Waiting for chats to join...","cf7-telegram"))),i().createElement("div",{className:"frame status-bar"},i().createElement("button",{className:"remove-bot-button","data-testid":`cf7tg-remove-bot-${e.id}`,onClick:h,disabled:f},wp.i18n.__("Remove bot","cf7-telegram")),i().createElement("div",{className:`bot-status ${T}`},T))))},Ga=({bot:e,chats:t,setChats:n=()=>{},bot2ChatConnections:a,setBots:r,setBot2ChatConnections:s,bot2ChannelConnections:l,setBot2ChannelConnections:c,setChat2ChannelConnections:u,loadChatData:d,chatDataStatus:f="ready"})=>{const[p,m]=(0,o.useState)(!1),[h,g]=(0,o.useState)(e.title.rendered),[v,b]=(0,o.useState)(e.token),[y,w]=(0,o.useState)(e.isTokenEmpty),[C,E]=(0,o.useState)(!1),[O,S]=(0,o.useState)(null),[k,_]=(0,o.useState)([]),[x,T]=(0,o.useState)(null),[I,P]=(0,o.useState)(""),[D,M]=(0,o.useState)([]),F=a.filter(t=>t.data.from===e.id).map(e=>e.data.to),V=t.filter(e=>F.includes(e.id)),R=t=>{const n=a.find(n=>n.data.from===e.id&&n.data.to===t);return!!n&&"pending"!==n?.data?.meta?.status?.[0]},[N,L]=(0,o.useState)(null),[A,$]=(0,o.useState)(null),B=(0,o.useRef)(null),H=(0,o.useRef)(null),j=(0,o.useRef)(!1),z=(0,o.useRef)(!1),U=(0,o.useRef)(0);(0,o.useEffect)(()=>()=>{j.current=!0,B.current&&clearTimeout(B.current),H.current&&clearTimeout(H.current)},[]),(0,o.useEffect)(()=>{null===A&&Y()},[N]),(0,o.useEffect)(()=>(!1===A&&W(),()=>{B.current&&clearTimeout(B.current)}),[N]),(0,o.useEffect)(()=>{!0===A&&B.current&&clearTimeout(B.current)},[N]),(0,o.useEffect)(()=>(!0===A?H.current||K().then(()=>{G()}):H.current&&(clearTimeout(H.current),H.current=null),()=>{H.current&&clearTimeout(H.current)}),[A]);const W=()=>{B.current=setTimeout(()=>{Y()},cf7TelegramData.intervals.ping)},G=()=>{H.current=setTimeout(async()=>{await K(),j.current||!0!==A||G()},cf7TelegramData.intervals.bot_fetch)},q=()=>{U.current+=1,U.current>=3&&S(wp.i18n.__("Telegram updates could not be checked.","cf7-telegram"))},K=async()=>{if(!z.current){z.current=!0;try{let t=await(async e=>await Ia(`${cf7TelegramData.routes.bots}${e}/fetch_updates`,"POST"))(e.id);const n=(e=>{if(e?.hasWebhookConflict)return"webhook_conflict";const t=Array.isArray(e?.errors)?e.errors:[];return t.length&&t.every(e=>"transport"===e?.errorType)?"transient_update_error":t.length?"update_error":null})(t);if("webhook_conflict"===n)return U.current=0,void S(wp.i18n.__("Telegram webhook is active. Disable it before checking for new chats.","cf7-telegram"));if("transient_update_error"===n)return void q();if("update_error"===n)return U.current=0,void S(wp.i18n.__("Telegram updates could not be checked.","cf7-telegram"));U.current=0,S(null),(t.hasNewConnections||t.hasNewChats)&&await d()}catch(e){console.error("Fetch updates failed",e),"rest_transport"===e?.category?q():(U.current=0,S(wp.i18n.__("Telegram updates could not be checked.","cf7-telegram")))}finally{z.current=!1}}},Y=async({force:t=!1,skipEditingCheck:n=!1}={})=>{try{if(!n&&p)throw new Error("Token is being edited");if(!t&&!0===A)return!0;let a=await(async e=>await Ia(`${cf7TelegramData.routes.bots}${e}/ping`,"POST"))(e.id);if(j.current)return a.online;if($(a.online),a.online){g(a.botName);try{let t=await(async e=>await Ia(`${cf7TelegramData.routes.bots}${e}`))(e.id);r(n=>n.map(n=>n.id===e.id?{...n,title:t.title,online:!0}:n))}catch(e){console.error("Failed to refresh bot data",e)}}return a.online}catch(e){return console.error("Ping failed",e),j.current||$(!1),!1}finally{L(Date.now())}},X=()=>{b(e.token),w(e.isTokenEmpty),m(!1),S(null)},Z=async()=>{E(!0),S(null);try{const t=v.trim();await(async({botId:e,token:t,pingBot:n,bot2ChatConnections:a,setBot2ChatConnections:r,bot2ChannelConnections:o,setBot2ChannelConnections:i})=>{const s=await(async(e,t)=>await Ia(`${cf7TelegramData.routes.bots}${e}/token`,"POST",{token:t}))(e,t.trim());return await n({force:!0,skipEditingCheck:!0}),s.relationsReset&&(r(t=>t.filter(t=>t.data.from!==e)),i(t=>t.filter(t=>t.data.from!==e))),s})({botId:e.id,token:t,pingBot:Y,bot2ChatConnections:a,setBot2ChatConnections:s,bot2ChannelConnections:l,setBot2ChannelConnections:c}),b(t),w(!1),m(!1)}catch(e){console.error(e),S(wp.i18n.__("Failed to update bot","cf7-telegram"))}finally{E(!1)}},J=e=>{n(t=>t.map(t=>t.id===e.id?{...t,...e}:t))},Q=()=>{T(null),P(""),S(null)},ee=async n=>{const a=t.find(e=>e.id===n),r=I.trim();if(a&&!D.includes(n)&&R(n))if(""!==r&&r!==(a.title?.rendered??"")){M(e=>[...e,n]),S(null);try{const t=await(async(e,t,n)=>await Ia(`${cf7TelegramData.routes.chats}${e}/name`,"POST",{bot_id:t,name:n}))(n,e.id,r);J(t),T(null),P("")}catch(e){console.error("Failed to rename chat",e),S(wp.i18n.__("Failed to update chat name","cf7-telegram"))}finally{M(e=>e.filter(e=>e!==n))}}else Q()};return i().createElement(Wa,{bot:e,chatsForBot:V,bot2ChatConnections:a,updatingStatusIds:k,updatingNameIds:D,renamingChatId:x,chatNameValue:I,isEditingToken:p,nameValue:h,isTokenEmpty:y,tokenValue:v,saving:C,error:O,handleEditToken:()=>{e.isTokenDefinedByConst||A&&!window.confirm(wp.i18n.__("Changing the token to another Telegram bot will disconnect this bot from its chats and bridges. Continue?","cf7-telegram"))||(S(null),b(""),m(!0))},deleteBot:async()=>{if(window.confirm("Are you sure you want to delete this bot?")){E(!0),S(null);try{if(!await(async e=>await Ia(Ta(cf7TelegramData.routes.bots,e),"DELETE"))(e.id))return;r(t=>t.filter(t=>t.id!==e.id))}catch(e){console.error(e),S(wp.i18n.__("Failed to delete bot","cf7-telegram"))}finally{E(!1)}}},handleKeyDown:e=>{if("Enter"===e.key){if(""===v.trim())return void X();Z()}"Escape"===e.key&&X()},setTokenValue:b,handleToggleChatStatus:async(t,n)=>{if(k.includes(t))return;const r=a.findIndex(n=>n.data.from===e.id&&n.data.to===t);if(-1===r)return;const o=a[r];let i;if("active"===n)i="muted";else if("muted"===n)i="active";else{if("pending"!==n)return;i="active"}_(e=>[...e,t]);try{await(async({connectionId:e,newStatus:t,currentStatus:n,chatId:a,botId:r,bot2ChannelConnections:o,setBot2ChatConnections:i,setChat2ChannelConnections:s})=>{if(await(async(e,t,n)=>{const a=await(async(e,t)=>await Ia(`${cf7TelegramData.routes.relations.bot2chat}${e}/meta`,"PATCH",{meta:[{key:"status",value:t}]}))(e,t);return a&&n(n=>n.map(n=>n.data.id!==e?n:{...n,data:{...n.data,meta:{...n.data.meta,status:[t]}}})),a})(e,t,i),"pending"!==n)return;const l=o.filter(e=>e.data.from===r);for(const e of l)await za(a,e.data.to,s)})({connectionId:o.data.id,newStatus:i,currentStatus:n,chatId:t,botId:e.id,bot2ChannelConnections:l,setBot2ChatConnections:s,setChat2ChannelConnections:u})}catch(e){console.error("Failed to update chat status",e)}finally{_(e=>e.filter(e=>e!==t))}},handleDisconnectChat:async(e,t)=>{if(k.includes(e))return;const n=a.findIndex(n=>n.data.from===t&&n.data.to===e);if(-1===n||!window.confirm(wp.i18n.__("Are you sure you want to delete this chat?","cf7-telegram")))return;const r=a[n];_(t=>[...t,e]);try{await(async(e,t)=>{await(async e=>await Ia(`${cf7TelegramData.routes.relations.bot2chat}${e}`,"DELETE"))(e)&&t(t=>t.filter(t=>t.data.id!==e))})(r.data.id,s)}catch(e){console.error("Something went wrong while disconnecting chat",e)}finally{_(t=>t.filter(t=>t!==e))}},handleStartRenameChat:e=>{e&&!D.includes(e.id)&&R(e.id)&&(S(null),T(e.id),P(e.title?.rendered??""))},handleRenameChatChange:e=>{P(e.target.value)},handleRenameChatKeyDown:(e,t)=>{"Enter"===t.key&&ee(e),"Escape"===t.key&&Q()},handleCancelRenameChat:Q,handleSaveChatName:ee,handleRestoreChatName:async t=>{if(!D.includes(t)&&R(t)){M(e=>[...e,t]),S(null);try{const n=await(async(e,t)=>await Ia(`${cf7TelegramData.routes.chats}${e}/restore_name`,"POST",{bot_id:t}))(t,e.id);J(n),T(null),P("")}catch(e){console.error("Failed to restore chat name",e),S(wp.i18n.__("Failed to restore Telegram chat name","cf7-telegram"))}finally{M(e=>e.filter(e=>e!==t))}}},online:A,chatDataStatus:f})},qa=({setBots:e,disabled:t=!1})=>i().createElement("button",{className:"add-button add-bot-button","data-testid":"cf7tg-create-bot",onClick:async()=>{try{let t=await(async(e,t)=>{let n={title:wp.i18n.__("Bot Name","cf7-telegram"),status:"publish"};return t?.trim(),await Ia(cf7TelegramData.routes.bots,"POST",n)})();e(e=>[...e,t])}catch(e){console.error("Error creating bot:",e),alert(wp.i18n.__("Failed to create bot","cf7-telegram"))}},disabled:t},wp.i18n.__("Create Bot","cf7-telegram")),Ka=({setChannels:e,disabled:t=!1})=>i().createElement("button",{className:"add-button add-channel-button","data-testid":"cf7tg-create-channel",onClick:async()=>{try{await(async(e,t)=>{let n=await(async e=>await Ia(cf7TelegramData.routes.channels,"POST",{title:e,status:"publish"}))(e);n&&t(e=>[...e,n])})(wp.i18n.__("Bridge Name","cf7-telegram"),e)}catch(e){console.error("Error creating bridge:",e),alert(wp.i18n.__("Failed to create bridge","cf7-telegram"))}},disabled:t},wp.i18n.__("Create Bridge","cf7-telegram")),Ya=["client","forms","bots","chats","channels","form2ChannelConnections","bot2ChannelConnections","chat2ChannelConnections"],Xa=()=>Ya.reduce((e,t)=>({...e,[t]:{status:"idle",error:null}}),{});class Za extends i().Component{constructor(e){super(e),this.state={hasError:!1,retryKey:0}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(){console.error("CF7 Telegram settings failed to render.")}retry=()=>{this.setState(e=>({hasError:!1,retryKey:e.retryKey+1}))};render(){return this.state.hasError?i().createElement("div",{className:"cf7-tg-error-boundary",role:"alert"},i().createElement("p",null,wp.i18n.__("The settings screen could not be displayed.","cf7-telegram")),i().createElement("button",{type:"button",className:"button",onClick:this.retry},wp.i18n.__("Try again","cf7-telegram"))):i().createElement(i().Fragment,{key:this.state.retryKey},this.props.children)}}const Ja=()=>{const[e,t]=(0,o.useState)([]),[n,a]=(0,o.useState)([]),[r,s]=(0,o.useState)([]),[l,c]=(0,o.useState)([]),[u,d]=(0,o.useState)([]),[f,p]=(0,o.useState)([]),[m,h]=(0,o.useState)([]),[g,v]=(0,o.useState)([]),[b,y]=(0,o.useState)(Xa),w=(0,o.useCallback)(async(e,t,n)=>{y(t=>({...t,[e]:{status:"loading",error:null}}));try{const a=await t();return n(a),y(t=>({...t,[e]:{status:"success",error:null}})),a}catch(t){throw y(n=>({...n,[e]:{status:"error",error:t}})),t}},[]),C=(0,o.useCallback)(async()=>w("chats",async()=>{const[e,t]=await Promise.all([Ba(),Na()]);return{connections:e,loadedChats:t}},({connections:e,loadedChats:t})=>{v((e=>e.map(e=>{const t=e.data?.meta?.status?.[0];return{...e,data:{...e.data,muted:"muted"===t}}}))(e)),s(t)}),[w]),E=(0,o.useCallback)((e=Ya)=>Promise.allSettled(e.map(e=>{switch(e){case"client":return w(e,Fa,()=>{});case"forms":return w(e,Va,t);case"bots":return w(e,Ra,a);case"chats":return C();case"channels":return w(e,La,c);case"form2ChannelConnections":return w(e,Aa,d);case"bot2ChannelConnections":return w(e,$a,p);case"chat2ChannelConnections":return w(e,Ha,h);default:return Promise.resolve()}})),[C,w]);(0,o.useEffect)(()=>{E()},[E]);const O=e=>b[e]?.status??"idle",S=(...e)=>e.some(e=>"error"===O(e))?"error":e.every(e=>"success"===O(e))?"ready":"loading",k=Ya.filter(e=>"error"===O(e));if(!Ya.some(e=>["success","error"].includes(O(e))))return i().createElement("div",null,wp.i18n.__("Loading data...","cf7-telegram"));const _=cf7TelegramData?.migration?.status||{},x=Boolean(cf7TelegramData?.migration?.show_action_button),T=!1!==_.can_retry,I="migration_failed"===_.last_error?.category?_.last_error.message:null;return i().createElement(i().Fragment,null,i().createElement("h1",null,wp.i18n.__("Telegram notificator settings","cf7-telegram")),k.length>0&&i().createElement("div",{className:"notice notice-error cf7t-notice cf7-tg-load-status",role:"alert"},i().createElement("p",null,wp.i18n.__("Some settings data could not be loaded.","cf7-telegram")),i().createElement("button",{type:"button",className:"button",onClick:()=>E(k)},wp.i18n.__("Retry failed requests","cf7-telegram"))),i().createElement("div",{className:"cf7-tg-container"},i().createElement("div",{className:"main-container"},i().createElement("div",{className:"list-container bots-container"},i().createElement("div",{className:"title-container"},i().createElement("h3",{className:"title"},wp.i18n.__("Bots","cf7-telegram")),i().createElement("p",{className:"title-description"},wp.i18n.__("A Telegram bot is required to run the integration. Create at least one bot, then connect it here.","cf7-telegram")," ",i().createElement("a",{href:"https://core.telegram.org/bots#3-how-do-i-create-a-bot",target:"_blank",rel:"noreferrer"},wp.i18n.__("How to create a bot","cf7-telegram"))),i().createElement(qa,{setBots:a,disabled:"success"!==O("bots")})),i().createElement("div",{className:"bot-list"},"error"===O("bots")&&i().createElement("p",{className:"resource-error"},wp.i18n.__("Bots could not be loaded.","cf7-telegram")),n.map(e=>i().createElement(Ga,{key:e.id,bot:e,chats:r,setChats:s,bot2ChatConnections:g,setBots:a,setBot2ChatConnections:v,bot2ChannelConnections:f,setBot2ChannelConnections:p,setChat2ChannelConnections:h,loadChatData:C,chatDataStatus:S("chats")})))),i().createElement("div",{className:"list-container channels-container"},i().createElement("div",{className:"title-container"},i().createElement("h3",{className:"title"},wp.i18n.__("Bridges","cf7-telegram")),i().createElement("p",{className:"title-description"},wp.i18n.__("A bridge is required to run the integration. Create at least one bridge, and add more when different forms should send messages to different sets of Telegram recipients.","cf7-telegram")),i().createElement(Ka,{setChannels:c,disabled:"success"!==O("channels")})),i().createElement("div",{className:"channel-list"},"error"===O("channels")&&i().createElement("p",{className:"resource-error"},wp.i18n.__("Bridges could not be loaded.","cf7-telegram")),l.map(t=>i().createElement(Ua,{key:t.id,channel:t,forms:e,setChannels:c,form2ChannelConnections:u,setForm2ChannelConnections:d,bots:n,bot2ChannelConnections:f,setBot2ChannelConnections:p,chats:r,chat2ChannelConnections:m,setChat2ChannelConnections:h,bot2ChatConnections:g,dataAvailability:{forms:S("forms","form2ChannelConnections"),bots:S("bots","bot2ChannelConnections"),chats:S("chats","chat2ChannelConnections")}})))))),x&&i().createElement("div",{className:"cf7-tg-migration-action"},i().createElement("form",{method:"post",action:cf7TelegramData?.migration?.action_url},i().createElement("input",{type:"hidden",name:"action",value:"cf7tg_migration_action"}),i().createElement("input",{type:"hidden",name:"cf7tg_migration_nonce",value:cf7TelegramData?.migration?.nonce}),i().createElement("p",null,_.is_failed?wp.i18n.__("Data migration failed. You can retry it now.","cf7-telegram"):wp.i18n.__("We detected settings from an older version that couldn’t be migrated automatically. Click the button below to migrate them to the new version.","cf7-telegram")),I&&i().createElement("p",{className:"cf7-tg-migration-error"},I),i().createElement("button",{type:"submit",className:"button button-primary",disabled:!T},_.is_failed?wp.i18n.__("Retry migration","cf7-telegram"):wp.i18n.__("Run migration","cf7-telegram")))),i().createElement("style",null,".copyable::after { content: '"+wp.i18n.__("Copied!","cf7-telegram")+"' !important }"))},Qa=()=>i().createElement(Za,null,i().createElement(Ja,null));(0,s.render)(i().createElement(i().StrictMode,null,i().createElement(Qa,null)),document.getElementById("settings-content"))})();1 (()=>{"use strict";var e={72(e,t){var n="function"==typeof Symbol&&Symbol.for,a=n?Symbol.for("react.element"):60103,r=n?Symbol.for("react.portal"):60106,o=n?Symbol.for("react.fragment"):60107,i=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,m=n?Symbol.for("react.suspense_list"):60120,h=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.block"):60121,b=n?Symbol.for("react.fundamental"):60117,y=n?Symbol.for("react.responder"):60118,w=n?Symbol.for("react.scope"):60119;function C(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case a:switch(e=e.type){case u:case d:case o:case s:case i:case p:return e;default:switch(e=e&&e.$$typeof){case c:case f:case g:case h:case l:return e;default:return t}}case r:return t}}}function E(e){return C(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=l,t.Element=a,t.ForwardRef=f,t.Fragment=o,t.Lazy=g,t.Memo=h,t.Portal=r,t.Profiler=s,t.StrictMode=i,t.Suspense=p,t.isAsyncMode=function(e){return E(e)||C(e)===u},t.isConcurrentMode=E,t.isContextConsumer=function(e){return C(e)===c},t.isContextProvider=function(e){return C(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===a},t.isForwardRef=function(e){return C(e)===f},t.isFragment=function(e){return C(e)===o},t.isLazy=function(e){return C(e)===g},t.isMemo=function(e){return C(e)===h},t.isPortal=function(e){return C(e)===r},t.isProfiler=function(e){return C(e)===s},t.isStrictMode=function(e){return C(e)===i},t.isSuspense=function(e){return C(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===d||e===s||e===i||e===p||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===h||e.$$typeof===l||e.$$typeof===c||e.$$typeof===f||e.$$typeof===b||e.$$typeof===y||e.$$typeof===w||e.$$typeof===v)},t.typeOf=C},404(e,t,n){e.exports=n(72)}};const t={};function n(a){const r=t[a];if(void 0!==r)return r.exports;const o=t[a]={exports:{}};return e[a](o,o.exports,n),o.exports}n.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.cw=e=>{var t;return()=>{if(e){var n=e;e=0,t={exports:{}},n.call(t.exports,t,t.exports)}return t.exports}},(()=>{const e=Object.getPrototypeOf;let t;n.t=function(a,r){if(1&r&&(a=this(a)),8&r)return a;if("object"==typeof a&&a){if(4&r&&a.__esModule)return a;if(16&r&&"function"==typeof a.then)return a}const o=Object.create(null);n.r(o);const i={};t||=[null,e({}),e([]),e(e)];for(var s=2&r&&a;("object"==typeof s||"function"==typeof s)&&!~t.indexOf(s);s=e(s))Object.getOwnPropertyNames(s).forEach(e=>i[e]=()=>a[e]);return i.default=()=>a,n.d(o,i),o}})(),n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a=n.cw(function(e,t){var n=qe(),a={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},i={};function s(e){return n.isMemo(e)?o:i[e.$$typeof]||a}i[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},i[n.Memo]=o;var l=Object.defineProperty,c=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,a){if("string"!=typeof n){if(p){var o=f(n);o&&o!==p&&e(t,o,a)}var i=c(n);u&&(i=i.concat(u(n)));for(var m=s(t),h=s(n),g=0;g<i.length;++g){var v=i[g];if(!(r[v]||a&&a[v]||h&&h[v]||m&&m[v])){var b=d(n,v);try{l(t,v,b)}catch(e){}}}}return t}}),r=()=>n(404);const o=window.React;var i=n.n(o);const s=window.wp.element;function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function c(e){var t=function(e){if("object"!=l(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==l(t)?t:t+""}function u(e,t,n){return(t=c(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach(function(t){u(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function m(e,t){if(e){if("string"==typeof e)return p(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(a=o.call(n)).done)&&(s.push(a.value),s.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw r}}return s}}(e,t)||m(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.includes(a))continue;n[a]=e[a]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var v=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function b(){return b=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},b.apply(null,arguments)}function y(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,c(a.key),a)}}function w(e,t){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},w(e,t)}function C(e){return C=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},C(e)}function E(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(E=function(){return!!e})()}function O(e){return function(e){if(Array.isArray(e))return p(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||m(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var S=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(e){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),this.tags=[],this.ctr=0},e}(),k=Math.abs,_=String.fromCharCode,T=Object.assign;function x(e){return e.trim()}function I(e,t,n){return e.replace(t,n)}function D(e,t){return e.indexOf(t)}function P(e,t){return 0|e.charCodeAt(t)}function M(e,t,n){return e.slice(t,n)}function F(e){return e.length}function R(e){return e.length}function V(e,t){return t.push(e),e}var N=1,L=1,A=0,$=0,B=0,H="";function j(e,t,n,a,r,o,i){return{value:e,root:t,parent:n,type:a,props:r,children:o,line:N,column:L,length:i,return:""}}function U(e,t){return T(j("",null,null,"",null,null,0),e,{length:-e.length},t)}function z(){return B=$>0?P(H,--$):0,L--,10===B&&(L=1,N--),B}function W(){return B=$<A?P(H,$++):0,L++,10===B&&(L=1,N++),B}function G(){return P(H,$)}function K(){return $}function q(e,t){return M(H,e,t)}function Y(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function X(e){return N=L=1,A=F(H=e),$=0,[]}function Z(e){return H="",e}function J(e){return x(q($-1,te(91===e?e+2:40===e?e+1:e)))}function Q(e){for(;(B=G())&&B<33;)W();return Y(e)>2||Y(B)>3?"":" "}function ee(e,t){for(;--t&&W()&&!(B<48||B>102||B>57&&B<65||B>70&&B<97););return q(e,K()+(t<6&&32==G()&&32==W()))}function te(e){for(;W();)switch(B){case e:return $;case 34:case 39:34!==e&&39!==e&&te(B);break;case 40:41===e&&te(e);break;case 92:W()}return $}function ne(e,t){for(;W()&&e+B!==57&&(e+B!==84||47!==G()););return"/*"+q(t,$-1)+"*"+_(47===e?e:W())}function ae(e){for(;!Y(G());)W();return q(e,$)}var re="-ms-",oe="-moz-",ie="-webkit-",se="comm",le="rule",ce="decl",ue="@keyframes";function de(e,t){for(var n="",a=R(e),r=0;r<a;r++)n+=t(e[r],r,e,t)||"";return n}function fe(e,t,n,a){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case ce:return e.return=e.return||e.value;case se:return"";case ue:return e.return=e.value+"{"+de(e.children,a)+"}";case le:e.value=e.props.join(",")}return F(n=de(e.children,a))?e.return=e.value+"{"+n+"}":""}function pe(e){return Z(me("",null,null,null,[""],e=X(e),0,[0],e))}function me(e,t,n,a,r,o,i,s,l){for(var c=0,u=0,d=i,f=0,p=0,m=0,h=1,g=1,v=1,b=0,y="",w=r,C=o,E=a,O=y;g;)switch(m=b,b=W()){case 40:if(108!=m&&58==P(O,d-1)){-1!=D(O+=I(J(b),"&","&\f"),"&\f")&&(v=-1);break}case 34:case 39:case 91:O+=J(b);break;case 9:case 10:case 13:case 32:O+=Q(m);break;case 92:O+=ee(K()-1,7);continue;case 47:switch(G()){case 42:case 47:V(ge(ne(W(),K()),t,n),l);break;default:O+="/"}break;case 123*h:s[c++]=F(O)*v;case 125*h:case 59:case 0:switch(b){case 0:case 125:g=0;case 59+u:-1==v&&(O=I(O,/\f/g,"")),p>0&&F(O)-d&&V(p>32?ve(O+";",a,n,d-1):ve(I(O," ","")+";",a,n,d-2),l);break;case 59:O+=";";default:if(V(E=he(O,t,n,c,u,r,s,y,w=[],C=[],d),o),123===b)if(0===u)me(O,t,E,E,w,o,d,s,C);else switch(99===f&&110===P(O,3)?100:f){case 100:case 108:case 109:case 115:me(e,E,E,a&&V(he(e,E,E,0,0,r,s,y,r,w=[],d),C),r,C,d,s,a?w:C);break;default:me(O,E,E,E,[""],C,0,s,C)}}c=u=p=0,h=v=1,y=O="",d=i;break;case 58:d=1+F(O),p=m;default:if(h<1)if(123==b)--h;else if(125==b&&0==h++&&125==z())continue;switch(O+=_(b),b*h){case 38:v=u>0?1:(O+="\f",-1);break;case 44:s[c++]=(F(O)-1)*v,v=1;break;case 64:45===G()&&(O+=J(W())),f=G(),u=d=F(y=O+=ae(K())),b++;break;case 45:45===m&&2==F(O)&&(h=0)}}return o}function he(e,t,n,a,r,o,i,s,l,c,u){for(var d=r-1,f=0===r?o:[""],p=R(f),m=0,h=0,g=0;m<a;++m)for(var v=0,b=M(e,d+1,d=k(h=i[m])),y=e;v<p;++v)(y=x(h>0?f[v]+" "+b:I(b,/&\f/g,f[v])))&&(l[g++]=y);return j(e,t,n,0===r?le:s,l,c,u)}function ge(e,t,n){return j(e,t,n,se,_(B),M(e,2,-2),0)}function ve(e,t,n,a){return j(e,t,n,ce,M(e,0,a),M(e,a+1,-1),a)}var be=function(e,t,n){for(var a=0,r=0;a=r,r=G(),38===a&&12===r&&(t[n]=1),!Y(r);)W();return q(e,$)},ye=new WeakMap,we=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,a=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||ye.get(n))&&!a){ye.set(e,!0);for(var r=[],o=function(e,t){return Z(function(e,t){var n=-1,a=44;do{switch(Y(a)){case 0:38===a&&12===G()&&(t[n]=1),e[n]+=be($-1,t,n);break;case 2:e[n]+=J(a);break;case 4:if(44===a){e[++n]=58===G()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=_(a)}}while(a=W());return e}(X(e),t))}(t,r),i=n.props,s=0,l=0;s<o.length;s++)for(var c=0;c<i.length;c++,l++)e.props[l]=r[s]?o[s].replace(/&\f/g,i[c]):i[c]+" "+o[s]}}},Ce=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function Ee(e,t){switch(function(e,t){return 45^P(e,0)?(((t<<2^P(e,0))<<2^P(e,1))<<2^P(e,2))<<2^P(e,3):0}(e,t)){case 5103:return ie+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return ie+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return ie+e+oe+e+re+e+e;case 6828:case 4268:return ie+e+re+e+e;case 6165:return ie+e+re+"flex-"+e+e;case 5187:return ie+e+I(e,/(\w+).+(:[^]+)/,ie+"box-$1$2"+re+"flex-$1$2")+e;case 5443:return ie+e+re+"flex-item-"+I(e,/flex-|-self/,"")+e;case 4675:return ie+e+re+"flex-line-pack"+I(e,/align-content|flex-|-self/,"")+e;case 5548:return ie+e+re+I(e,"shrink","negative")+e;case 5292:return ie+e+re+I(e,"basis","preferred-size")+e;case 6060:return ie+"box-"+I(e,"-grow","")+ie+e+re+I(e,"grow","positive")+e;case 4554:return ie+I(e,/([^-])(transform)/g,"$1"+ie+"$2")+e;case 6187:return I(I(I(e,/(zoom-|grab)/,ie+"$1"),/(image-set)/,ie+"$1"),e,"")+e;case 5495:case 3959:return I(e,/(image-set\([^]*)/,ie+"$1$`$1");case 4968:return I(I(e,/(.+:)(flex-)?(.*)/,ie+"box-pack:$3"+re+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+ie+e+e;case 4095:case 3583:case 4068:case 2532:return I(e,/(.+)-inline(.+)/,ie+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(F(e)-1-t>6)switch(P(e,t+1)){case 109:if(45!==P(e,t+4))break;case 102:return I(e,/(.+:)(.+)-([^]+)/,"$1"+ie+"$2-$3$1"+oe+(108==P(e,t+3)?"$3":"$2-$3"))+e;case 115:return~D(e,"stretch")?Ee(I(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==P(e,t+1))break;case 6444:switch(P(e,F(e)-3-(~D(e,"!important")&&10))){case 107:return I(e,":",":"+ie)+e;case 101:return I(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ie+(45===P(e,14)?"inline-":"")+"box$3$1"+ie+"$2$3$1"+re+"$2box$3")+e}break;case 5936:switch(P(e,t+11)){case 114:return ie+e+re+I(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ie+e+re+I(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ie+e+re+I(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return ie+e+re+e+e}return e}var Oe=[function(e,t,n,a){if(e.length>-1&&!e.return)switch(e.type){case ce:e.return=Ee(e.value,e.length);break;case ue:return de([U(e,{value:I(e.value,"@","@"+ie)})],a);case le:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,function(t){switch(function(e){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return de([U(e,{props:[I(t,/:(read-\w+)/,":-moz-$1")]})],a);case"::placeholder":return de([U(e,{props:[I(t,/:(plac\w+)/,":"+ie+"input-$1")]}),U(e,{props:[I(t,/:(plac\w+)/,":-moz-$1")]}),U(e,{props:[I(t,/:(plac\w+)/,re+"input-$1")]})],a)}return""})}}],Se=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var a,r,o=e.stylisPlugins||Oe,i={},s=[];a=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)i[t[n]]=!0;s.push(e)});var l,c,u,d,f=[fe,(d=function(e){l.insert(e)},function(e){e.root||(e=e.return)&&d(e)})],p=(c=[we,Ce].concat(o,f),u=R(c),function(e,t,n,a){for(var r="",o=0;o<u;o++)r+=c[o](e,t,n,a)||"";return r});r=function(e,t,n,a){l=n,de(pe(e?e+"{"+t.styles+"}":t.styles),p),a&&(m.inserted[t.name]=!0)};var m={key:t,sheet:new S({key:t,container:a,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:r};return m.sheet.hydrate(s),m},ke=function(e,t,n){var a=e.key+"-"+t.name;!1===n&&void 0===e.registered[a]&&(e.registered[a]=t.styles)},_e={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function Te(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var xe=/[A-Z]|^ms/g,Ie=/_EMO_([^_]+?)_([^]*?)_EMO_/g,De=function(e){return 45===e.charCodeAt(1)},Pe=function(e){return null!=e&&"boolean"!=typeof e},Me=Te(function(e){return De(e)?e:e.replace(xe,"-$&").toLowerCase()}),Fe=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Ie,function(e,t,n){return Ve={name:t,styles:n,next:Ve},t})}return 1===_e[e]||De(e)||"number"!=typeof t||0===t?t:t+"px"};function Re(e,t,n){if(null==n)return"";var a=n;if(void 0!==a.__emotion_styles)return a;switch(typeof n){case"boolean":return"";case"object":var r=n;if(1===r.anim)return Ve={name:r.name,styles:r.styles,next:Ve},r.name;var o=n;if(void 0!==o.styles){var i=o.next;if(void 0!==i)for(;void 0!==i;)Ve={name:i.name,styles:i.styles,next:Ve},i=i.next;return o.styles+";"}return function(e,t,n){var a="";if(Array.isArray(n))for(var r=0;r<n.length;r++)a+=Re(e,t,n[r])+";";else for(var o in n){var i=n[o];if("object"!=typeof i){var s=i;null!=t&&void 0!==t[s]?a+=o+"{"+t[s]+"}":Pe(s)&&(a+=Me(o)+":"+Fe(o,s)+";")}else if(!Array.isArray(i)||"string"!=typeof i[0]||null!=t&&void 0!==t[i[0]]){var l=Re(e,t,i);switch(o){case"animation":case"animationName":a+=Me(o)+":"+l+";";break;default:a+=o+"{"+l+"}"}}else for(var c=0;c<i.length;c++)Pe(i[c])&&(a+=Me(o)+":"+Fe(o,i[c])+";")}return a}(e,t,n);case"function":if(void 0!==e){var s=Ve,l=n(e);return Ve=s,Re(e,t,l)}}var c=n;if(null==t)return c;var u=t[c];return void 0!==u?u:c}var Ve,Ne=/label:\s*([^\s;{]+)\s*(;|$)/g;function Le(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var a=!0,r="";Ve=void 0;var o=e[0];null==o||void 0===o.raw?(a=!1,r+=Re(n,t,o)):r+=o[0];for(var i=1;i<e.length;i++)r+=Re(n,t,e[i]),a&&(r+=o[i]);Ne.lastIndex=0;for(var s,l="";null!==(s=Ne.exec(r));)l+="-"+s[1];var c=function(e){for(var t,n=0,a=0,r=e.length;r>=4;++a,r-=4)t=1540483477*(65535&(t=255&e.charCodeAt(a)|(255&e.charCodeAt(++a))<<8|(255&e.charCodeAt(++a))<<16|(255&e.charCodeAt(++a))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(r){case 3:n^=(255&e.charCodeAt(a+2))<<16;case 2:n^=(255&e.charCodeAt(a+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(a)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(r)+l;return{name:c,styles:r,next:Ve}}var Ae=!!o.useInsertionEffect&&o.useInsertionEffect,$e=Ae||function(e){return e()},Be=(Ae||o.useLayoutEffect,o.createContext("undefined"!=typeof HTMLElement?Se({key:"css"}):null)),He=(Be.Provider,function(e){return(0,o.forwardRef)(function(t,n){var a=(0,o.useContext)(Be);return e(t,a,n)})}),je=o.createContext({}),Ue={}.hasOwnProperty,ze="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",We=function(e){var t=e.cache,n=e.serialized,a=e.isStringTag;return ke(t,n,a),$e(function(){return function(e,t,n){ke(e,t,n);var a=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var r=t;do{e.insert(t===r?"."+a:"",r,e.sheet,!0),r=r.next}while(void 0!==r)}}(t,n,a)}),null},Ge=He(function(e,t,n){var a=e.css;"string"==typeof a&&void 0!==t.registered[a]&&(a=t.registered[a]);var r=e[ze],i=[a],s="";"string"==typeof e.className?s=function(e,t,n){var a="";return n.split(" ").forEach(function(n){void 0!==e[n]?t.push(e[n]+";"):n&&(a+=n+" ")}),a}(t.registered,i,e.className):null!=e.className&&(s=e.className+" ");var l=Le(i,void 0,o.useContext(je));s+=t.key+"-"+l.name;var c={};for(var u in e)Ue.call(e,u)&&"css"!==u&&u!==ze&&(c[u]=e[u]);return c.className=s,n&&(c.ref=n),o.createElement(o.Fragment,null,o.createElement(We,{cache:t,serialized:l,isStringTag:"string"==typeof r}),o.createElement(r,c))}),Ke=Ge;function qe(){return qe.c||(qe.c=n.t(r(),2))}a();var Ye,Xe,Ze=function(e,t){var n=arguments;if(null==t||!Ue.call(t,"css"))return o.createElement.apply(void 0,n);var a=n.length,r=new Array(a);r[0]=Ke,r[1]=function(e,t){var n={};for(var a in t)Ue.call(t,a)&&(n[a]=t[a]);return n[ze]=e,n}(e,t);for(var i=2;i<a;i++)r[i]=n[i];return o.createElement.apply(null,r)};function Je(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Le(t)}Ye=Ze||(Ze={}),Xe||(Xe=Ye.JSX||(Ye.JSX={}));const Qe=window.ReactDOM,et=Math.min,tt=Math.max,nt=Math.round,at=Math.floor,rt=e=>({x:e,y:e});function ot(){return"undefined"!=typeof window}function it(e){return ct(e)?(e.nodeName||"").toLowerCase():"#document"}function st(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function lt(e){var t;return null==(t=(ct(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ct(e){return!!ot()&&(e instanceof Node||e instanceof st(e).Node)}function ut(e){return!!ot()&&(e instanceof Element||e instanceof st(e).Element)}function dt(e){return!!ot()&&(e instanceof HTMLElement||e instanceof st(e).HTMLElement)}function ft(e){return!(!ot()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof st(e).ShadowRoot)}function pt(e){const{overflow:t,overflowX:n,overflowY:a,display:r}=mt(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+n)&&!["inline","contents"].includes(r)}function mt(e){return st(e).getComputedStyle(e)}function ht(e){const t=function(e){if("html"===it(e))return e;const t=e.assignedSlot||e.parentNode||ft(e)&&e.host||lt(e);return ft(t)?t.host:t}(e);return function(e){return["html","body","#document"].includes(it(e))}(t)?e.ownerDocument?e.ownerDocument.body:e.body:dt(t)&&pt(t)?t:ht(t)}function gt(e,t,n){var a;void 0===t&&(t=[]),void 0===n&&(n=!0);const r=ht(e),o=r===(null==(a=e.ownerDocument)?void 0:a.body),i=st(r);if(o){const e=vt(i);return t.concat(i,i.visualViewport||[],pt(r)?r:[],e&&n?gt(e):[])}return t.concat(r,gt(r,[],n))}function vt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function bt(e){return ut(e)?e:e.contextElement}function yt(e){const t=bt(e);if(!dt(t))return rt(1);const n=t.getBoundingClientRect(),{width:a,height:r,$:o}=function(e){const t=mt(e);let n=parseFloat(t.width)||0,a=parseFloat(t.height)||0;const r=dt(e),o=r?e.offsetWidth:n,i=r?e.offsetHeight:a,s=nt(n)!==o||nt(a)!==i;return s&&(n=o,a=i),{width:n,height:a,$:s}}(t);let i=(o?nt(n.width):n.width)/a,s=(o?nt(n.height):n.height)/r;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const wt=rt(0);function Ct(e){const t=st(e);return"undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:wt}function Et(e,t,n,a){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),o=bt(e);let i=rt(1);t&&(a?ut(a)&&(i=yt(a)):i=yt(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==st(e))&&t}(o,n,a)?Ct(o):rt(0);let l=(r.left+s.x)/i.x,c=(r.top+s.y)/i.y,u=r.width/i.x,d=r.height/i.y;if(o){const e=st(o),t=a&&ut(a)?st(a):a;let n=e,r=vt(n);for(;r&&a&&t!==n;){const e=yt(r),t=r.getBoundingClientRect(),a=mt(r),o=t.left+(r.clientLeft+parseFloat(a.paddingLeft))*e.x,i=t.top+(r.clientTop+parseFloat(a.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=o,c+=i,n=st(r),r=vt(n)}}return function(e){const{x:t,y:n,width:a,height:r}=e;return{width:a,height:r,top:n,left:t,right:t+a,bottom:n+r,x:t,y:n}}({width:u,height:d,x:l,y:c})}function Ot(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}var St=o.useLayoutEffect,kt=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],_t=function(){};function Tt(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}function xt(e,t){for(var n=arguments.length,a=new Array(n>2?n-2:0),r=2;r<n;r++)a[r-2]=arguments[r];var o=[].concat(a);if(t&&e)for(var i in t)t.hasOwnProperty(i)&&t[i]&&o.push("".concat(Tt(e,i)));return o.filter(function(e){return e}).map(function(e){return String(e).trim()}).join(" ")}var It=function(e){return t=e,Array.isArray(t)?e.filter(Boolean):"object"===l(e)&&null!==e?[e]:[];var t},Dt=function(e){return e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme,f({},g(e,kt))},Pt=function(e,t,n){var a=e.cx,r=e.getStyles,o=e.getClassNames,i=e.className;return{css:r(t,e),className:a(null!=n?n:{},o(t,e),i)}};function Mt(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function Ft(e){return Mt(e)?window.pageYOffset:e.scrollTop}function Rt(e,t){Mt(e)?window.scrollTo(0,t):e.scrollTop=t}function Vt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:_t,r=Ft(e),o=t-r,i=0;!function t(){var s,l=o*((s=(s=i+=10)/n-1)*s*s+1)+r;Rt(e,l),i<n?window.requestAnimationFrame(t):a(e)}()}function Nt(e,t){var n=e.getBoundingClientRect(),a=t.getBoundingClientRect(),r=t.offsetHeight/3;a.bottom+r>n.bottom?Rt(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+r,e.scrollHeight)):a.top-r<n.top&&Rt(e,Math.max(t.offsetTop-r,0))}function Lt(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}var At=!1,$t={get passive(){return At=!0}},Bt="undefined"!=typeof window?window:{};Bt.addEventListener&&Bt.removeEventListener&&(Bt.addEventListener("p",_t,$t),Bt.removeEventListener("p",_t,!1));var Ht=At;function jt(e){return null!=e}function Ut(e,t,n){return e?t:n}var zt=["children","innerProps"],Wt=["children","innerProps"];var Gt,Kt,qt,Yt=function(e){return"auto"===e?"bottom":e},Xt=(0,o.createContext)(null),Zt=function(e){var t=e.children,n=e.minMenuHeight,a=e.maxMenuHeight,r=e.menuPlacement,i=e.menuPosition,s=e.menuShouldScrollIntoView,l=e.theme,c=((0,o.useContext)(Xt)||{}).setPortalPlacement,u=(0,o.useRef)(null),d=h((0,o.useState)(a),2),p=d[0],m=d[1],g=h((0,o.useState)(null),2),v=g[0],b=g[1],y=l.spacing.controlHeight;return St(function(){var e=u.current;if(e){var t="fixed"===i,o=function(e){var t=e.maxHeight,n=e.menuEl,a=e.minHeight,r=e.placement,o=e.shouldScroll,i=e.isFixedPosition,s=e.controlHeight,l=function(e){var t=getComputedStyle(e),n="absolute"===t.position,a=/(auto|scroll)/;if("fixed"===t.position)return document.documentElement;for(var r=e;r=r.parentElement;)if(t=getComputedStyle(r),(!n||"static"!==t.position)&&a.test(t.overflow+t.overflowY+t.overflowX))return r;return document.documentElement}(n),c={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return c;var u,d=l.getBoundingClientRect().height,f=n.getBoundingClientRect(),p=f.bottom,m=f.height,h=f.top,g=n.offsetParent.getBoundingClientRect().top,v=i||Mt(u=l)?window.innerHeight:u.clientHeight,b=Ft(l),y=parseInt(getComputedStyle(n).marginBottom,10),w=parseInt(getComputedStyle(n).marginTop,10),C=g-w,E=v-h,O=C+b,S=d-b-h,k=p-v+b+y,_=b+h-w,T=160;switch(r){case"auto":case"bottom":if(E>=m)return{placement:"bottom",maxHeight:t};if(S>=m&&!i)return o&&Vt(l,k,T),{placement:"bottom",maxHeight:t};if(!i&&S>=a||i&&E>=a)return o&&Vt(l,k,T),{placement:"bottom",maxHeight:i?E-y:S-y};if("auto"===r||i){var x=t,I=i?C:O;return I>=a&&(x=Math.min(I-y-s,t)),{placement:"top",maxHeight:x}}if("bottom"===r)return o&&Rt(l,k),{placement:"bottom",maxHeight:t};break;case"top":if(C>=m)return{placement:"top",maxHeight:t};if(O>=m&&!i)return o&&Vt(l,_,T),{placement:"top",maxHeight:t};if(!i&&O>=a||i&&C>=a){var D=t;return(!i&&O>=a||i&&C>=a)&&(D=i?C-w:O-w),o&&Vt(l,_,T),{placement:"top",maxHeight:D}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(r,'".'))}return c}({maxHeight:a,menuEl:e,minHeight:n,placement:r,shouldScroll:s&&!t,isFixedPosition:t,controlHeight:y});m(o.maxHeight),b(o.placement),null==c||c(o.placement)}},[a,r,i,s,n,c,y]),t({ref:u,placerProps:f(f({},e),{},{placement:v||Yt(r),maxHeight:p})})},Jt=function(e,t){var n=e.theme,a=n.spacing.baseUnit,r=n.colors;return f({textAlign:"center"},t?{}:{color:r.neutral40,padding:"".concat(2*a,"px ").concat(3*a,"px")})},Qt=Jt,en=Jt,tn=["size"],nn=["innerProps","isRtl","size"],an={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},rn=function(e){var t=e.size,n=g(e,tn);return Ze("svg",b({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:an},n))},on=function(e){return Ze(rn,b({size:20},e),Ze("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},sn=function(e){return Ze(rn,b({size:20},e),Ze("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},ln=function(e,t){var n=e.isFocused,a=e.theme,r=a.spacing.baseUnit,o=a.colors;return f({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:n?o.neutral60:o.neutral20,padding:2*r,":hover":{color:n?o.neutral80:o.neutral40}})},cn=ln,un=ln,dn=function(){var e=Je.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}(Gt||(Kt=["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"],qt||(qt=Kt.slice(0)),Gt=Object.freeze(Object.defineProperties(Kt,{raw:{value:Object.freeze(qt)}})))),fn=function(e){var t=e.delay,n=e.offset;return Ze("span",{css:Je({animation:"".concat(dn," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},pn=["data"],mn=["innerRef","isDisabled","isHidden","inputClassName"],hn={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},gn={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":f({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},hn)},vn=function(e){return f({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},hn)},bn=function(e){var t=e.children,n=e.innerProps;return Ze("div",n,t)},yn={ClearIndicator:function(e){var t=e.children,n=e.innerProps;return Ze("div",b({},Pt(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),t||Ze(on,null))},Control:function(e){var t=e.children,n=e.isDisabled,a=e.isFocused,r=e.innerRef,o=e.innerProps,i=e.menuIsOpen;return Ze("div",b({ref:r},Pt(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":a,"control--menu-is-open":i}),o,{"aria-disabled":n||void 0}),t)},DropdownIndicator:function(e){var t=e.children,n=e.innerProps;return Ze("div",b({},Pt(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),t||Ze(sn,null))},DownChevron:sn,CrossIcon:on,Group:function(e){var t=e.children,n=e.cx,a=e.getStyles,r=e.getClassNames,o=e.Heading,i=e.headingProps,s=e.innerProps,l=e.label,c=e.theme,u=e.selectProps;return Ze("div",b({},Pt(e,"group",{group:!0}),s),Ze(o,b({},i,{selectProps:u,theme:c,getStyles:a,getClassNames:r,cx:n}),l),Ze("div",null,t))},GroupHeading:function(e){var t=Dt(e);t.data;var n=g(t,pn);return Ze("div",b({},Pt(e,"groupHeading",{"group-heading":!0}),n))},IndicatorsContainer:function(e){var t=e.children,n=e.innerProps;return Ze("div",b({},Pt(e,"indicatorsContainer",{indicators:!0}),n),t)},IndicatorSeparator:function(e){var t=e.innerProps;return Ze("span",b({},t,Pt(e,"indicatorSeparator",{"indicator-separator":!0})))},Input:function(e){var t=e.cx,n=e.value,a=Dt(e),r=a.innerRef,o=a.isDisabled,i=a.isHidden,s=a.inputClassName,l=g(a,mn);return Ze("div",b({},Pt(e,"input",{"input-container":!0}),{"data-value":n||""}),Ze("input",b({className:t({input:!0},s),ref:r,style:vn(i),disabled:o},l)))},LoadingIndicator:function(e){var t=e.innerProps,n=e.isRtl,a=e.size,r=void 0===a?4:a,o=g(e,nn);return Ze("div",b({},Pt(f(f({},o),{},{innerProps:t,isRtl:n,size:r}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),Ze(fn,{delay:0,offset:n}),Ze(fn,{delay:160,offset:!0}),Ze(fn,{delay:320,offset:!n}))},Menu:function(e){var t=e.children,n=e.innerRef,a=e.innerProps;return Ze("div",b({},Pt(e,"menu",{menu:!0}),{ref:n},a),t)},MenuList:function(e){var t=e.children,n=e.innerProps,a=e.innerRef,r=e.isMulti;return Ze("div",b({},Pt(e,"menuList",{"menu-list":!0,"menu-list--is-multi":r}),{ref:a},n),t)},MenuPortal:function(e){var t=e.appendTo,n=e.children,a=e.controlElement,r=e.innerProps,i=e.menuPlacement,s=e.menuPosition,l=(0,o.useRef)(null),c=(0,o.useRef)(null),u=h((0,o.useState)(Yt(i)),2),d=u[0],p=u[1],m=(0,o.useMemo)(function(){return{setPortalPlacement:p}},[]),g=h((0,o.useState)(null),2),v=g[0],y=g[1],w=(0,o.useCallback)(function(){if(a){var e=function(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}(a),t="fixed"===s?0:window.pageYOffset,n=e[d]+t;n===(null==v?void 0:v.offset)&&e.left===(null==v?void 0:v.rect.left)&&e.width===(null==v?void 0:v.rect.width)||y({offset:n,rect:e})}},[a,s,d,null==v?void 0:v.offset,null==v?void 0:v.rect.left,null==v?void 0:v.rect.width]);St(function(){w()},[w]);var C=(0,o.useCallback)(function(){"function"==typeof c.current&&(c.current(),c.current=null),a&&l.current&&(c.current=function(e,t,n,a){void 0===a&&(a={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=a,c=bt(e),u=r||o?[...c?gt(c):[],...gt(t)]:[];u.forEach(e=>{r&&e.addEventListener("scroll",n,{passive:!0}),o&&e.addEventListener("resize",n)});const d=c&&s?function(e,t){let n,a=null;const r=lt(e);function o(){var e;clearTimeout(n),null==(e=a)||e.disconnect(),a=null}return function i(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),o();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(s||t(),!f||!p)return;const m={rootMargin:-at(d)+"px "+-at(r.clientWidth-(u+f))+"px "+-at(r.clientHeight-(d+p))+"px "+-at(u)+"px",threshold:tt(0,et(1,l))||1};let h=!0;function g(t){const a=t[0].intersectionRatio;if(a!==l){if(!h)return i();a?i(!1,a):n=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==a||Ot(c,e.getBoundingClientRect())||i(),h=!1}try{a=new IntersectionObserver(g,{...m,root:r.ownerDocument})}catch(e){a=new IntersectionObserver(g,m)}a.observe(e)}(!0),o}(c,n):null;let f,p=-1,m=null;i&&(m=new ResizeObserver(e=>{let[a]=e;a&&a.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),n()}),c&&!l&&m.observe(c),m.observe(t));let h=l?Et(e):null;return l&&function t(){const a=Et(e);h&&!Ot(h,a)&&n(),h=a,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{r&&e.removeEventListener("scroll",n),o&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=m)||e.disconnect(),m=null,l&&cancelAnimationFrame(f)}}(a,l.current,w,{elementResize:"ResizeObserver"in window}))},[a,w]);St(function(){C()},[C]);var E=(0,o.useCallback)(function(e){l.current=e,C()},[C]);if(!t&&"fixed"!==s||!v)return null;var O=Ze("div",b({ref:E},Pt(f(f({},e),{},{offset:v.offset,position:s,rect:v.rect}),"menuPortal",{"menu-portal":!0}),r),n);return Ze(Xt.Provider,{value:m},t?(0,Qe.createPortal)(O,t):O)},LoadingMessage:function(e){var t=e.children,n=void 0===t?"Loading...":t,a=e.innerProps,r=g(e,Wt);return Ze("div",b({},Pt(f(f({},r),{},{children:n,innerProps:a}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),a),n)},NoOptionsMessage:function(e){var t=e.children,n=void 0===t?"No options":t,a=e.innerProps,r=g(e,zt);return Ze("div",b({},Pt(f(f({},r),{},{children:n,innerProps:a}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),a),n)},MultiValue:function(e){var t=e.children,n=e.components,a=e.data,r=e.innerProps,o=e.isDisabled,i=e.removeProps,s=e.selectProps,l=n.Container,c=n.Label,u=n.Remove;return Ze(l,{data:a,innerProps:f(f({},Pt(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":o})),r),selectProps:s},Ze(c,{data:a,innerProps:f({},Pt(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:s},t),Ze(u,{data:a,innerProps:f(f({},Pt(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},i),selectProps:s}))},MultiValueContainer:bn,MultiValueLabel:bn,MultiValueRemove:function(e){var t=e.children,n=e.innerProps;return Ze("div",b({role:"button"},n),t||Ze(on,{size:14}))},Option:function(e){var t=e.children,n=e.isDisabled,a=e.isFocused,r=e.isSelected,o=e.innerRef,i=e.innerProps;return Ze("div",b({},Pt(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":a,"option--is-selected":r}),{ref:o,"aria-disabled":n},i),t)},Placeholder:function(e){var t=e.children,n=e.innerProps;return Ze("div",b({},Pt(e,"placeholder",{placeholder:!0}),n),t)},SelectContainer:function(e){var t=e.children,n=e.innerProps,a=e.isDisabled,r=e.isRtl;return Ze("div",b({},Pt(e,"container",{"--is-disabled":a,"--is-rtl":r}),n),t)},SingleValue:function(e){var t=e.children,n=e.isDisabled,a=e.innerProps;return Ze("div",b({},Pt(e,"singleValue",{"single-value":!0,"single-value--is-disabled":n}),a),t)},ValueContainer:function(e){var t=e.children,n=e.innerProps,a=e.isMulti,r=e.hasValue;return Ze("div",b({},Pt(e,"valueContainer",{"value-container":!0,"value-container--is-multi":a,"value-container--has-value":r}),n),t)}},wn=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function Cn(e,t){return e===t||!(!wn(e)||!wn(t))}function En(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Cn(e[n],t[n]))return!1;return!0}for(var On={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},Sn=function(e){return Ze("span",b({css:On},e))},kn={guidance:function(e){var t=e.isSearchable,n=e.isMulti,a=e.tabSelectsValue,r=e.context,o=e.isInitialFocus;switch(r){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(a?", press Tab to select the option and exit the menu":"",".");case"input":return o?"".concat(e["aria-label"]||"Select"," is focused ").concat(t?",type to refine list":"",", press Down to open the menu, ").concat(n?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var t=e.action,n=e.label,a=void 0===n?"":n,r=e.labels,o=e.isDisabled;switch(t){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(a,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(r.length>1?"s":""," ").concat(r.join(","),", selected.");case"select-option":return"option ".concat(a,o?" is disabled. Select another option.":", selected.");default:return""}},onFocus:function(e){var t=e.context,n=e.focused,a=e.options,r=e.label,o=void 0===r?"":r,i=e.selectValue,s=e.isDisabled,l=e.isSelected,c=e.isAppleDevice,u=function(e,t){return e&&e.length?"".concat(e.indexOf(t)+1," of ").concat(e.length):""};if("value"===t&&i)return"value ".concat(o," focused, ").concat(u(i,n),".");if("menu"===t&&c){var d=s?" disabled":"",f="".concat(l?" selected":"").concat(d);return"".concat(o).concat(f,", ").concat(u(a,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},Tn=function(e){var t=e.ariaSelection,n=e.focusedOption,a=e.focusedValue,r=e.focusableOptions,i=e.isFocused,s=e.selectValue,l=e.selectProps,c=e.id,u=e.isAppleDevice,d=l.ariaLiveMessages,p=l.getOptionLabel,m=l.inputValue,h=l.isMulti,g=l.isOptionDisabled,v=l.isSearchable,b=l.menuIsOpen,y=l.options,w=l.screenReaderStatus,C=l.tabSelectsValue,E=l.isLoading,O=l["aria-label"],S=l["aria-live"],k=(0,o.useMemo)(function(){return f(f({},kn),d||{})},[d]),_=(0,o.useMemo)(function(){var e,n="";if(t&&k.onChange){var a=t.option,r=t.options,o=t.removedValue,i=t.removedValues,l=t.value,c=o||a||(e=l,Array.isArray(e)?null:e),u=c?p(c):"",d=r||i||void 0,m=d?d.map(p):[],h=f({isDisabled:c&&g(c,s),label:u,labels:m},t);n=k.onChange(h)}return n},[t,k,g,s,p]),T=(0,o.useMemo)(function(){var e="",t=n||a,o=!!(n&&s&&s.includes(n));if(t&&k.onFocus){var i={focused:t,label:p(t),isDisabled:g(t,s),isSelected:o,options:r,context:t===n?"menu":"value",selectValue:s,isAppleDevice:u};e=k.onFocus(i)}return e},[n,a,p,g,k,r,s,u]),x=(0,o.useMemo)(function(){var e="";if(b&&y.length&&!E&&k.onFilter){var t=w({count:r.length});e=k.onFilter({inputValue:m,resultsMessage:t})}return e},[r,m,b,k,y,w,E]),I="initial-input-focus"===(null==t?void 0:t.action),D=(0,o.useMemo)(function(){var e="";if(k.guidance){var t=a?"value":b?"menu":"input";e=k.guidance({"aria-label":O,context:t,isDisabled:n&&g(n,s),isMulti:h,isSearchable:v,tabSelectsValue:C,isInitialFocus:I})}return e},[O,n,a,h,g,v,b,k,s,C,I]),P=Ze(o.Fragment,null,Ze("span",{id:"aria-selection"},_),Ze("span",{id:"aria-focused"},T),Ze("span",{id:"aria-results"},x),Ze("span",{id:"aria-guidance"},D));return Ze(o.Fragment,null,Ze(Sn,{id:c},I&&P),Ze(Sn,{"aria-live":S,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},i&&!I&&P))},xn=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],In=new RegExp("["+xn.map(function(e){return e.letters}).join("")+"]","g"),Dn={},Pn=0;Pn<xn.length;Pn++)for(var Mn=xn[Pn],Fn=0;Fn<Mn.letters.length;Fn++)Dn[Mn.letters[Fn]]=Mn.base;var Rn=function(e){return e.replace(In,function(e){return Dn[e]})},Vn=function(e,t){void 0===t&&(t=En);var n=null;function a(){for(var a=[],r=0;r<arguments.length;r++)a[r]=arguments[r];if(n&&n.lastThis===this&&t(a,n.lastArgs))return n.lastResult;var o=e.apply(this,a);return n={lastResult:o,lastArgs:a,lastThis:this},o}return a.clear=function(){n=null},a}(Rn),Nn=function(e){return e.replace(/^\s+|\s+$/g,"")},Ln=function(e){return"".concat(e.label," ").concat(e.value)},An=["innerRef"];function $n(e){var t=e.innerRef,n=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];var r=Object.entries(e).filter(function(e){var t=h(e,1)[0];return!n.includes(t)});return r.reduce(function(e,t){var n=h(t,2),a=n[0],r=n[1];return e[a]=r,e},{})}(g(e,An),"onExited","in","enter","exit","appear");return Ze("input",b({ref:t},n,{css:Je({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var Bn=["boxSizing","height","overflow","paddingRight","position"],Hn={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function jn(e){e.cancelable&&e.preventDefault()}function Un(e){e.stopPropagation()}function zn(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;0===e?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function Wn(){return"ontouchstart"in window||navigator.maxTouchPoints}var Gn=!("undefined"==typeof window||!window.document||!window.document.createElement),Kn=0,qn={capture:!1,passive:!1},Yn=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},Xn={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function Zn(e){var t=e.children,n=e.lockEnabled,a=e.captureEnabled,r=function(e){var t=e.isEnabled,n=e.onBottomArrive,a=e.onBottomLeave,r=e.onTopArrive,i=e.onTopLeave,s=(0,o.useRef)(!1),l=(0,o.useRef)(!1),c=(0,o.useRef)(0),u=(0,o.useRef)(null),d=(0,o.useCallback)(function(e,t){if(null!==u.current){var o=u.current,c=o.scrollTop,d=o.scrollHeight,f=o.clientHeight,p=u.current,m=t>0,h=d-f-c,g=!1;h>t&&s.current&&(a&&a(e),s.current=!1),m&&l.current&&(i&&i(e),l.current=!1),m&&t>h?(n&&!s.current&&n(e),p.scrollTop=d,g=!0,s.current=!0):!m&&-t>c&&(r&&!l.current&&r(e),p.scrollTop=0,g=!0,l.current=!0),g&&function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()}(e)}},[n,a,r,i]),f=(0,o.useCallback)(function(e){d(e,e.deltaY)},[d]),p=(0,o.useCallback)(function(e){c.current=e.changedTouches[0].clientY},[]),m=(0,o.useCallback)(function(e){var t=c.current-e.changedTouches[0].clientY;d(e,t)},[d]),h=(0,o.useCallback)(function(e){if(e){var t=!!Ht&&{passive:!1};e.addEventListener("wheel",f,t),e.addEventListener("touchstart",p,t),e.addEventListener("touchmove",m,t)}},[m,p,f]),g=(0,o.useCallback)(function(e){e&&(e.removeEventListener("wheel",f,!1),e.removeEventListener("touchstart",p,!1),e.removeEventListener("touchmove",m,!1))},[m,p,f]);return(0,o.useEffect)(function(){if(t){var e=u.current;return h(e),function(){g(e)}}},[t,h,g]),function(e){u.current=e}}({isEnabled:void 0===a||a,onBottomArrive:e.onBottomArrive,onBottomLeave:e.onBottomLeave,onTopArrive:e.onTopArrive,onTopLeave:e.onTopLeave}),i=function(e){var t=e.isEnabled,n=e.accountForScrollbars,a=void 0===n||n,r=(0,o.useRef)({}),i=(0,o.useRef)(null),s=(0,o.useCallback)(function(e){if(Gn){var t=document.body,n=t&&t.style;if(a&&Bn.forEach(function(e){var t=n&&n[e];r.current[e]=t}),a&&Kn<1){var o=parseInt(r.current.paddingRight,10)||0,i=document.body?document.body.clientWidth:0,s=window.innerWidth-i+o||0;Object.keys(Hn).forEach(function(e){var t=Hn[e];n&&(n[e]=t)}),n&&(n.paddingRight="".concat(s,"px"))}t&&Wn()&&(t.addEventListener("touchmove",jn,qn),e&&(e.addEventListener("touchstart",zn,qn),e.addEventListener("touchmove",Un,qn))),Kn+=1}},[a]),l=(0,o.useCallback)(function(e){if(Gn){var t=document.body,n=t&&t.style;Kn=Math.max(Kn-1,0),a&&Kn<1&&Bn.forEach(function(e){var t=r.current[e];n&&(n[e]=t)}),t&&Wn()&&(t.removeEventListener("touchmove",jn,qn),e&&(e.removeEventListener("touchstart",zn,qn),e.removeEventListener("touchmove",Un,qn)))}},[a]);return(0,o.useEffect)(function(){if(t){var e=i.current;return s(e),function(){l(e)}}},[t,s,l]),function(e){i.current=e}}({isEnabled:n});return Ze(o.Fragment,null,n&&Ze("div",{onClick:Yn,css:Xn}),t(function(e){r(e),i(e)}))}var Jn={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Qn=function(e){var t=e.name,n=e.onFocus;return Ze("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:n,css:Jn,value:"",onChange:function(){}})};function ea(e){var t;return"undefined"!=typeof window&&null!=window.navigator&&e.test((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.platform)||window.navigator.platform)}function ta(){return ea(/^Mac/i)}var na={clearIndicator:un,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},control:function(e,t){var n=e.isDisabled,a=e.isFocused,r=e.theme,o=r.colors,i=r.borderRadius;return f({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:r.spacing.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:n?o.neutral5:o.neutral0,borderColor:n?o.neutral10:a?o.primary:o.neutral20,borderRadius:i,borderStyle:"solid",borderWidth:1,boxShadow:a?"0 0 0 1px ".concat(o.primary):void 0,"&:hover":{borderColor:a?o.primary:o.neutral30}})},dropdownIndicator:cn,group:function(e,t){var n=e.theme.spacing;return t?{}:{paddingBottom:2*n.baseUnit,paddingTop:2*n.baseUnit}},groupHeading:function(e,t){var n=e.theme,a=n.colors,r=n.spacing;return f({label:"group",cursor:"default",display:"block"},t?{}:{color:a.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*r.baseUnit,paddingRight:3*r.baseUnit,textTransform:"uppercase"})},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e,t){var n=e.isDisabled,a=e.theme,r=a.spacing.baseUnit,o=a.colors;return f({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:n?o.neutral10:o.neutral20,marginBottom:2*r,marginTop:2*r})},input:function(e,t){var n=e.isDisabled,a=e.value,r=e.theme,o=r.spacing,i=r.colors;return f(f({visibility:n?"hidden":"visible",transform:a?"translateZ(0)":""},gn),t?{}:{margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,color:i.neutral80})},loadingIndicator:function(e,t){var n=e.isFocused,a=e.size,r=e.theme,o=r.colors,i=r.spacing.baseUnit;return f({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:a,lineHeight:1,marginRight:a,textAlign:"center",verticalAlign:"middle"},t?{}:{color:n?o.neutral60:o.neutral20,padding:2*i})},loadingMessage:en,menu:function(e,t){var n,a=e.placement,r=e.theme,o=r.borderRadius,i=r.spacing,s=r.colors;return f((u(n={label:"menu"},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(a),"100%"),u(n,"position","absolute"),u(n,"width","100%"),u(n,"zIndex",1),n),t?{}:{backgroundColor:s.neutral0,borderRadius:o,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:i.menuGutter,marginTop:i.menuGutter})},menuList:function(e,t){var n=e.maxHeight,a=e.theme.spacing.baseUnit;return f({maxHeight:n,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:a,paddingTop:a})},menuPortal:function(e){var t=e.rect,n=e.offset,a=e.position;return{left:t.left,position:a,top:n,width:t.width,zIndex:1}},multiValue:function(e,t){var n=e.theme,a=n.spacing,r=n.borderRadius,o=n.colors;return f({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:o.neutral10,borderRadius:r/2,margin:a.baseUnit/2})},multiValueLabel:function(e,t){var n=e.theme,a=n.borderRadius,r=n.colors,o=e.cropWithEllipsis;return f({overflow:"hidden",textOverflow:o||void 0===o?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:a/2,color:r.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},multiValueRemove:function(e,t){var n=e.theme,a=n.spacing,r=n.borderRadius,o=n.colors,i=e.isFocused;return f({alignItems:"center",display:"flex"},t?{}:{borderRadius:r/2,backgroundColor:i?o.dangerLight:void 0,paddingLeft:a.baseUnit,paddingRight:a.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}})},noOptionsMessage:Qt,option:function(e,t){var n=e.isDisabled,a=e.isFocused,r=e.isSelected,o=e.theme,i=o.spacing,s=o.colors;return f({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:r?s.primary:a?s.primary25:"transparent",color:n?s.neutral20:r?s.neutral0:"inherit",padding:"".concat(2*i.baseUnit,"px ").concat(3*i.baseUnit,"px"),":active":{backgroundColor:n?void 0:r?s.primary:s.primary50}})},placeholder:function(e,t){var n=e.theme,a=n.spacing,r=n.colors;return f({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:r.neutral50,marginLeft:a.baseUnit/2,marginRight:a.baseUnit/2})},singleValue:function(e,t){var n=e.isDisabled,a=e.theme,r=a.spacing,o=a.colors;return f({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:n?o.neutral40:o.neutral80,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},valueContainer:function(e,t){var n=e.theme.spacing,a=e.isMulti,r=e.hasValue,o=e.selectProps.controlShouldRenderValue;return f({alignItems:"center",display:a&&r&&o?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(n.baseUnit/2,"px ").concat(2*n.baseUnit,"px")})}},aa={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},ra={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Lt(),captureMenuScroll:!Lt(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var n=f({ignoreCase:!0,ignoreAccents:!0,stringify:Ln,trim:!0,matchFrom:"any"},void 0),a=n.ignoreCase,r=n.ignoreAccents,o=n.stringify,i=n.trim,s=n.matchFrom,l=i?Nn(t):t,c=i?Nn(o(e)):o(e);return a&&(l=l.toLowerCase(),c=c.toLowerCase()),r&&(l=Vn(l),c=Rn(c)),"start"===s?c.substr(0,l.length)===l:c.indexOf(l)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function oa(e,t,n,a){return{type:"option",data:t,isDisabled:pa(e,t,n),isSelected:ma(e,t,n),label:da(e,t),value:fa(e,t),index:a}}function ia(e,t){return e.options.map(function(n,a){if("options"in n){var r=n.options.map(function(n,a){return oa(e,n,t,a)}).filter(function(t){return ca(e,t)});return r.length>0?{type:"group",data:n,options:r,index:a}:void 0}var o=oa(e,n,t,a);return ca(e,o)?o:void 0}).filter(jt)}function sa(e){return e.reduce(function(e,t){return"group"===t.type?e.push.apply(e,O(t.options.map(function(e){return e.data}))):e.push(t.data),e},[])}function la(e,t){return e.reduce(function(e,n){return"group"===n.type?e.push.apply(e,O(n.options.map(function(e){return{data:e.data,id:"".concat(t,"-").concat(n.index,"-").concat(e.index)}}))):e.push({data:n.data,id:"".concat(t,"-").concat(n.index)}),e},[])}function ca(e,t){var n=e.inputValue,a=void 0===n?"":n,r=t.data,o=t.isSelected,i=t.label,s=t.value;return(!ga(e)||!o)&&ha(e,{label:i,value:s,data:r},a)}var ua=function(e,t){var n;return(null===(n=e.find(function(e){return e.data===t}))||void 0===n?void 0:n.id)||null},da=function(e,t){return e.getOptionLabel(t)},fa=function(e,t){return e.getOptionValue(t)};function pa(e,t,n){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,n)}function ma(e,t,n){if(n.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,n);var a=fa(e,t);return n.some(function(t){return fa(e,t)===a})}function ha(e,t,n){return!e.filterOption||e.filterOption(t,n)}var ga=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return void 0===t?n:t},va=1,ba=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&w(e,t)}(n,e);var t=function(e){var t=E();return function(){var n,a=C(e);if(t){var r=C(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return function(e,t){if(t&&("object"==l(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}(n);function n(e){var a;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(a=t.call(this,e)).state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},a.blockOptionHover=!1,a.isComposing=!1,a.commonProps=void 0,a.initialTouchX=0,a.initialTouchY=0,a.openAfterFocus=!1,a.scrollToFocusedOptionOnUpdate=!1,a.userIsDragging=void 0,a.isAppleDevice=ta()||ea(/^iPhone/i)||ea(/^iPad/i)||ta()&&navigator.maxTouchPoints>1,a.controlRef=null,a.getControlRef=function(e){a.controlRef=e},a.focusedOptionRef=null,a.getFocusedOptionRef=function(e){a.focusedOptionRef=e},a.menuListRef=null,a.getMenuListRef=function(e){a.menuListRef=e},a.inputRef=null,a.getInputRef=function(e){a.inputRef=e},a.focus=a.focusInput,a.blur=a.blurInput,a.onChange=function(e,t){var n=a.props,r=n.onChange,o=n.name;t.name=o,a.ariaOnChange(e,t),r(e,t)},a.setValue=function(e,t,n){var r=a.props,o=r.closeMenuOnSelect,i=r.isMulti,s=r.inputValue;a.onInputChange("",{action:"set-value",prevInputValue:s}),o&&(a.setState({inputIsHiddenAfterUpdate:!i}),a.onMenuClose()),a.setState({clearFocusValueOnUpdate:!0}),a.onChange(e,{action:t,option:n})},a.selectOption=function(e){var t=a.props,n=t.blurInputOnSelect,r=t.isMulti,o=t.name,i=a.state.selectValue,s=r&&a.isOptionSelected(e,i),l=a.isOptionDisabled(e,i);if(s){var c=a.getOptionValue(e);a.setValue(i.filter(function(e){return a.getOptionValue(e)!==c}),"deselect-option",e)}else{if(l)return void a.ariaOnChange(e,{action:"select-option",option:e,name:o});r?a.setValue([].concat(O(i),[e]),"select-option",e):a.setValue(e,"select-option")}n&&a.blurInput()},a.removeValue=function(e){var t=a.props.isMulti,n=a.state.selectValue,r=a.getOptionValue(e),o=n.filter(function(e){return a.getOptionValue(e)!==r}),i=Ut(t,o,o[0]||null);a.onChange(i,{action:"remove-value",removedValue:e}),a.focusInput()},a.clearValue=function(){var e=a.state.selectValue;a.onChange(Ut(a.props.isMulti,[],null),{action:"clear",removedValues:e})},a.popValue=function(){var e=a.props.isMulti,t=a.state.selectValue,n=t[t.length-1],r=t.slice(0,t.length-1),o=Ut(e,r,r[0]||null);n&&a.onChange(o,{action:"pop-value",removedValue:n})},a.getFocusedOptionId=function(e){return ua(a.state.focusableOptionsWithIds,e)},a.getFocusableOptionsWithIds=function(){return la(ia(a.props,a.state.selectValue),a.getElementId("option"))},a.getValue=function(){return a.state.selectValue},a.cx=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return xt.apply(void 0,[a.props.classNamePrefix].concat(t))},a.getOptionLabel=function(e){return da(a.props,e)},a.getOptionValue=function(e){return fa(a.props,e)},a.getStyles=function(e,t){var n=a.props.unstyled,r=na[e](t,n);r.boxSizing="border-box";var o=a.props.styles[e];return o?o(r,t):r},a.getClassNames=function(e,t){var n,r;return null===(n=(r=a.props.classNames)[e])||void 0===n?void 0:n.call(r,t)},a.getElementId=function(e){return"".concat(a.state.instancePrefix,"-").concat(e)},a.getComponents=function(){return e=a.props,f(f({},yn),e.components);var e},a.buildCategorizedOptions=function(){return ia(a.props,a.state.selectValue)},a.getCategorizedOptions=function(){return a.props.menuIsOpen?a.buildCategorizedOptions():[]},a.buildFocusableOptions=function(){return sa(a.buildCategorizedOptions())},a.getFocusableOptions=function(){return a.props.menuIsOpen?a.buildFocusableOptions():[]},a.ariaOnChange=function(e,t){a.setState({ariaSelection:f({value:e},t)})},a.onMenuMouseDown=function(e){0===e.button&&(e.stopPropagation(),e.preventDefault(),a.focusInput())},a.onMenuMouseMove=function(e){a.blockOptionHover=!1},a.onControlMouseDown=function(e){if(!e.defaultPrevented){var t=a.props.openMenuOnClick;a.state.isFocused?a.props.menuIsOpen?"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&a.onMenuClose():t&&a.openMenu("first"):(t&&(a.openAfterFocus=!0),a.focusInput()),"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&e.preventDefault()}},a.onDropdownIndicatorMouseDown=function(e){if(!(e&&"mousedown"===e.type&&0!==e.button||a.props.isDisabled)){var t=a.props,n=t.isMulti,r=t.menuIsOpen;a.focusInput(),r?(a.setState({inputIsHiddenAfterUpdate:!n}),a.onMenuClose()):a.openMenu("first"),e.preventDefault()}},a.onClearIndicatorMouseDown=function(e){e&&"mousedown"===e.type&&0!==e.button||(a.clearValue(),e.preventDefault(),a.openAfterFocus=!1,"touchend"===e.type?a.focusInput():setTimeout(function(){return a.focusInput()}))},a.onScroll=function(e){"boolean"==typeof a.props.closeMenuOnScroll?e.target instanceof HTMLElement&&Mt(e.target)&&a.props.onMenuClose():"function"==typeof a.props.closeMenuOnScroll&&a.props.closeMenuOnScroll(e)&&a.props.onMenuClose()},a.onCompositionStart=function(){a.isComposing=!0},a.onCompositionEnd=function(){a.isComposing=!1},a.onTouchStart=function(e){var t=e.touches,n=t&&t.item(0);n&&(a.initialTouchX=n.clientX,a.initialTouchY=n.clientY,a.userIsDragging=!1)},a.onTouchMove=function(e){var t=e.touches,n=t&&t.item(0);if(n){var r=Math.abs(n.clientX-a.initialTouchX),o=Math.abs(n.clientY-a.initialTouchY);a.userIsDragging=r>5||o>5}},a.onTouchEnd=function(e){a.userIsDragging||(a.controlRef&&!a.controlRef.contains(e.target)&&a.menuListRef&&!a.menuListRef.contains(e.target)&&a.blurInput(),a.initialTouchX=0,a.initialTouchY=0)},a.onControlTouchEnd=function(e){a.userIsDragging||a.onControlMouseDown(e)},a.onClearIndicatorTouchEnd=function(e){a.userIsDragging||a.onClearIndicatorMouseDown(e)},a.onDropdownIndicatorTouchEnd=function(e){a.userIsDragging||a.onDropdownIndicatorMouseDown(e)},a.handleInputChange=function(e){var t=a.props.inputValue,n=e.currentTarget.value;a.setState({inputIsHiddenAfterUpdate:!1}),a.onInputChange(n,{action:"input-change",prevInputValue:t}),a.props.menuIsOpen||a.onMenuOpen()},a.onInputFocus=function(e){a.props.onFocus&&a.props.onFocus(e),a.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(a.openAfterFocus||a.props.openMenuOnFocus)&&a.openMenu("first"),a.openAfterFocus=!1},a.onInputBlur=function(e){var t=a.props.inputValue;a.menuListRef&&a.menuListRef.contains(document.activeElement)?a.inputRef.focus():(a.props.onBlur&&a.props.onBlur(e),a.onInputChange("",{action:"input-blur",prevInputValue:t}),a.onMenuClose(),a.setState({focusedValue:null,isFocused:!1}))},a.onOptionHover=function(e){if(!a.blockOptionHover&&a.state.focusedOption!==e){var t=a.getFocusableOptions().indexOf(e);a.setState({focusedOption:e,focusedOptionId:t>-1?a.getFocusedOptionId(e):null})}},a.shouldHideSelectedOptions=function(){return ga(a.props)},a.onValueInputFocus=function(e){e.preventDefault(),e.stopPropagation(),a.focus()},a.onKeyDown=function(e){var t=a.props,n=t.isMulti,r=t.backspaceRemovesValue,o=t.escapeClearsValue,i=t.inputValue,s=t.isClearable,l=t.isDisabled,c=t.menuIsOpen,u=t.onKeyDown,d=t.tabSelectsValue,f=t.openMenuOnFocus,p=a.state,m=p.focusedOption,h=p.focusedValue,g=p.selectValue;if(!(l||"function"==typeof u&&(u(e),e.defaultPrevented))){switch(a.blockOptionHover=!0,e.key){case"ArrowLeft":if(!n||i)return;a.focusValue("previous");break;case"ArrowRight":if(!n||i)return;a.focusValue("next");break;case"Delete":case"Backspace":if(i)return;if(h)a.removeValue(h);else{if(!r)return;n?a.popValue():s&&a.clearValue()}break;case"Tab":if(a.isComposing)return;if(e.shiftKey||!c||!d||!m||f&&a.isOptionSelected(m,g))return;a.selectOption(m);break;case"Enter":if(229===e.keyCode)break;if(c){if(!m)return;if(a.isComposing)return;a.selectOption(m);break}return;case"Escape":c?(a.setState({inputIsHiddenAfterUpdate:!1}),a.onInputChange("",{action:"menu-close",prevInputValue:i}),a.onMenuClose()):s&&o&&a.clearValue();break;case" ":if(i)return;if(!c){a.openMenu("first");break}if(!m)return;a.selectOption(m);break;case"ArrowUp":c?a.focusOption("up"):a.openMenu("last");break;case"ArrowDown":c?a.focusOption("down"):a.openMenu("first");break;case"PageUp":if(!c)return;a.focusOption("pageup");break;case"PageDown":if(!c)return;a.focusOption("pagedown");break;case"Home":if(!c)return;a.focusOption("first");break;case"End":if(!c)return;a.focusOption("last");break;default:return}e.preventDefault()}},a.state.instancePrefix="react-select-"+(a.props.instanceId||++va),a.state.selectValue=It(e.value),e.menuIsOpen&&a.state.selectValue.length){var r=a.getFocusableOptionsWithIds(),o=a.buildFocusableOptions(),i=o.indexOf(a.state.selectValue[0]);a.state.focusableOptionsWithIds=r,a.state.focusedOption=o[i],a.state.focusedOptionId=ua(r,o[i])}return a}return function(e,t,n){t&&y(e.prototype,t),n&&y(e,n),Object.defineProperty(e,"prototype",{writable:!1})}(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Nt(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.isDisabled,a=t.menuIsOpen,r=this.state.isFocused;(r&&!n&&e.isDisabled||r&&a&&!e.menuIsOpen)&&this.focusInput(),r&&n&&!e.isDisabled?this.setState({isFocused:!1},this.onMenuClose):r||n||!e.isDisabled||this.inputRef!==document.activeElement||this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Nt(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(e,t){this.props.onInputChange(e,t)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(e){var t=this,n=this.state,a=n.selectValue,r=n.isFocused,o=this.buildFocusableOptions(),i="first"===e?0:o.length-1;if(!this.props.isMulti){var s=o.indexOf(a[0]);s>-1&&(i=s)}this.scrollToFocusedOptionOnUpdate=!(r&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:o[i],focusedOptionId:this.getFocusedOptionId(o[i])},function(){return t.onMenuOpen()})}},{key:"focusValue",value:function(e){var t=this.state,n=t.selectValue,a=t.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var r=n.indexOf(a);a||(r=-1);var o=n.length-1,i=-1;if(n.length){switch(e){case"previous":i=0===r?0:-1===r?o:r-1;break;case"next":r>-1&&r<o&&(i=r+1)}this.setState({inputIsHidden:-1!==i,focusedValue:n[i]})}}}},{key:"focusOption",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,n=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var r=0,o=a.indexOf(n);n||(o=-1),"up"===e?r=o>0?o-1:a.length-1:"down"===e?r=(o+1)%a.length:"pageup"===e?(r=o-t)<0&&(r=0):"pagedown"===e?(r=o+t)>a.length-1&&(r=a.length-1):"last"===e&&(r=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[r],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[r])})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(aa):f(f({},aa),this.props.theme):aa}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,n=this.getStyles,a=this.getClassNames,r=this.getValue,o=this.selectOption,i=this.setValue,s=this.props,l=s.isMulti,c=s.isRtl,u=s.options;return{clearValue:e,cx:t,getStyles:n,getClassNames:a,getValue:r,hasValue:this.hasValue(),isMulti:l,isRtl:c,options:u,selectOption:o,selectProps:s,setValue:i,theme:this.getTheme()}}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return pa(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return ma(this.props,e,t)}},{key:"filterOption",value:function(e,t){return ha(this.props,e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:a})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,a=e.inputId,r=e.inputValue,i=e.tabIndex,s=e.form,l=e.menuIsOpen,c=e.required,u=this.getComponents().Input,d=this.state,p=d.inputIsHidden,m=d.ariaSelection,h=this.commonProps,g=a||this.getElementId("input"),v=f(f(f({"aria-autocomplete":"list","aria-expanded":l,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":c,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},l&&{"aria-controls":this.getElementId("listbox")}),!n&&{"aria-readonly":!0}),this.hasValue()?"initial-input-focus"===(null==m?void 0:m.action)&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return n?o.createElement(u,b({},h,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:g,innerRef:this.getInputRef,isDisabled:t,isHidden:p,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:i,form:s,type:"text",value:r},v)):o.createElement($n,b({id:g,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:_t,onFocus:this.onInputFocus,disabled:t,tabIndex:i,inputMode:"none",form:s,value:""},v))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.getComponents(),n=t.MultiValue,a=t.MultiValueContainer,r=t.MultiValueLabel,i=t.MultiValueRemove,s=t.SingleValue,l=t.Placeholder,c=this.commonProps,u=this.props,d=u.controlShouldRenderValue,f=u.isDisabled,p=u.isMulti,m=u.inputValue,h=u.placeholder,g=this.state,v=g.selectValue,y=g.focusedValue,w=g.isFocused;if(!this.hasValue()||!d)return m?null:o.createElement(l,b({},c,{key:"placeholder",isDisabled:f,isFocused:w,innerProps:{id:this.getElementId("placeholder")}}),h);if(p)return v.map(function(t,s){var l=t===y,u="".concat(e.getOptionLabel(t),"-").concat(e.getOptionValue(t));return o.createElement(n,b({},c,{components:{Container:a,Label:r,Remove:i},isFocused:l,isDisabled:f,key:u,index:s,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault()}},data:t}),e.formatOptionLabel(t,"value"))});if(m)return null;var C=v[0];return o.createElement(s,b({},c,{data:C,isDisabled:f}),this.formatOptionLabel(C,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.getComponents().ClearIndicator,t=this.commonProps,n=this.props,a=n.isDisabled,r=n.isLoading,i=this.state.isFocused;if(!this.isClearable()||!e||a||!this.hasValue()||r)return null;var s={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return o.createElement(e,b({},t,{innerProps:s,isFocused:i}))}},{key:"renderLoadingIndicator",value:function(){var e=this.getComponents().LoadingIndicator,t=this.commonProps,n=this.props,a=n.isDisabled,r=n.isLoading,i=this.state.isFocused;return e&&r?o.createElement(e,b({},t,{innerProps:{"aria-hidden":"true"},isDisabled:a,isFocused:i})):null}},{key:"renderIndicatorSeparator",value:function(){var e=this.getComponents(),t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var a=this.commonProps,r=this.props.isDisabled,i=this.state.isFocused;return o.createElement(n,b({},a,{isDisabled:r,isFocused:i}))}},{key:"renderDropdownIndicator",value:function(){var e=this.getComponents().DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,a=this.state.isFocused,r={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return o.createElement(e,b({},t,{innerProps:r,isDisabled:n,isFocused:a}))}},{key:"renderMenu",value:function(){var e=this,t=this.getComponents(),n=t.Group,a=t.GroupHeading,r=t.Menu,i=t.MenuList,s=t.MenuPortal,l=t.LoadingMessage,c=t.NoOptionsMessage,u=t.Option,d=this.commonProps,f=this.state.focusedOption,p=this.props,m=p.captureMenuScroll,h=p.inputValue,g=p.isLoading,v=p.loadingMessage,y=p.minMenuHeight,w=p.maxMenuHeight,C=p.menuIsOpen,E=p.menuPlacement,O=p.menuPosition,S=p.menuPortalTarget,k=p.menuShouldBlockScroll,_=p.menuShouldScrollIntoView,T=p.noOptionsMessage,x=p.onMenuScrollToTop,I=p.onMenuScrollToBottom;if(!C)return null;var D,P=function(t,n){var a=t.type,r=t.data,i=t.isDisabled,s=t.isSelected,l=t.label,c=t.value,p=f===r,m=i?void 0:function(){return e.onOptionHover(r)},h=i?void 0:function(){return e.selectOption(r)},g="".concat(e.getElementId("option"),"-").concat(n),v={id:g,onClick:h,onMouseMove:m,onMouseOver:m,tabIndex:-1,role:"option","aria-selected":e.isAppleDevice?void 0:s};return o.createElement(u,b({},d,{innerProps:v,data:r,isDisabled:i,isSelected:s,key:g,label:l,type:a,value:c,isFocused:p,innerRef:p?e.getFocusedOptionRef:void 0}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())D=this.getCategorizedOptions().map(function(t){if("group"===t.type){var r=t.data,i=t.options,s=t.index,l="".concat(e.getElementId("group"),"-").concat(s),c="".concat(l,"-heading");return o.createElement(n,b({},d,{key:l,data:r,options:i,Heading:a,headingProps:{id:c,data:t.data},label:e.formatGroupLabel(t.data)}),t.options.map(function(e){return P(e,"".concat(s,"-").concat(e.index))}))}if("option"===t.type)return P(t,"".concat(t.index))});else if(g){var M=v({inputValue:h});if(null===M)return null;D=o.createElement(l,d,M)}else{var F=T({inputValue:h});if(null===F)return null;D=o.createElement(c,d,F)}var R={minMenuHeight:y,maxMenuHeight:w,menuPlacement:E,menuPosition:O,menuShouldScrollIntoView:_},V=o.createElement(Zt,b({},d,R),function(t){var n=t.ref,a=t.placerProps,s=a.placement,l=a.maxHeight;return o.createElement(r,b({},d,R,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove},isLoading:g,placement:s}),o.createElement(Zn,{captureEnabled:m,onTopArrive:x,onBottomArrive:I,lockEnabled:k},function(t){return o.createElement(i,b({},d,{innerRef:function(n){e.getMenuListRef(n),t(n)},innerProps:{role:"listbox","aria-multiselectable":d.isMulti,id:e.getElementId("listbox")},isLoading:g,maxHeight:l,focusedOption:f}),D)}))});return S||"fixed"===O?o.createElement(s,b({},d,{appendTo:S,controlElement:this.controlRef,menuPlacement:E,menuPosition:O}),V):V}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,a=t.isDisabled,r=t.isMulti,i=t.name,s=t.required,l=this.state.selectValue;if(s&&!this.hasValue()&&!a)return o.createElement(Qn,{name:i,onFocus:this.onValueInputFocus});if(i&&!a){if(r){if(n){var c=l.map(function(t){return e.getOptionValue(t)}).join(n);return o.createElement("input",{name:i,type:"hidden",value:c})}var u=l.length>0?l.map(function(t,n){return o.createElement("input",{key:"i-".concat(n),name:i,type:"hidden",value:e.getOptionValue(t)})}):o.createElement("input",{name:i,type:"hidden",value:""});return o.createElement("div",null,u)}var d=l[0]?this.getOptionValue(l[0]):"";return o.createElement("input",{name:i,type:"hidden",value:d})}}},{key:"renderLiveRegion",value:function(){var e=this.commonProps,t=this.state,n=t.ariaSelection,a=t.focusedOption,r=t.focusedValue,i=t.isFocused,s=t.selectValue,l=this.getFocusableOptions();return o.createElement(Tn,b({},e,{id:this.getElementId("live-region"),ariaSelection:n,focusedOption:a,focusedValue:r,isFocused:i,selectValue:s,focusableOptions:l,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var e=this.getComponents(),t=e.Control,n=e.IndicatorsContainer,a=e.SelectContainer,r=e.ValueContainer,i=this.props,s=i.className,l=i.id,c=i.isDisabled,u=i.menuIsOpen,d=this.state.isFocused,f=this.commonProps=this.getCommonProps();return o.createElement(a,b({},f,{className:s,innerProps:{id:l,onKeyDown:this.onKeyDown},isDisabled:c,isFocused:d}),this.renderLiveRegion(),o.createElement(t,b({},f,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:c,isFocused:d,menuIsOpen:u}),o.createElement(r,b({},f,{isDisabled:c}),this.renderPlaceholderOrValue(),this.renderInput()),o.createElement(n,b({},f,{isDisabled:c}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,a=t.clearFocusValueOnUpdate,r=t.inputIsHiddenAfterUpdate,o=t.ariaSelection,i=t.isFocused,s=t.prevWasFocused,l=t.instancePrefix,c=e.options,u=e.value,d=e.menuIsOpen,p=e.inputValue,m=e.isMulti,h=It(u),g={};if(n&&(u!==n.value||c!==n.options||d!==n.menuIsOpen||p!==n.inputValue)){var v=d?function(e,t){return sa(ia(e,t))}(e,h):[],b=d?la(ia(e,h),"".concat(l,"-option")):[],y=a?function(e,t){var n=e.focusedValue,a=e.selectValue.indexOf(n);if(a>-1){if(t.indexOf(n)>-1)return n;if(a<t.length)return t[a]}return null}(t,h):null,w=function(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}(t,v);g={selectValue:h,focusedOption:w,focusedOptionId:ua(b,w),focusableOptionsWithIds:b,focusedValue:y,clearFocusValueOnUpdate:!1}}var C=null!=r&&e!==n?{inputIsHidden:r,inputIsHiddenAfterUpdate:void 0}:{},E=o,O=i&&s;return i&&!O&&(E={value:Ut(m,h,h[0]||null),options:h,action:"initial-input-focus"},O=!s),"initial-input-focus"===(null==o?void 0:o.action)&&(E=null),f(f(f({},g),C),{},{prevProps:e,ariaSelection:E,prevWasFocused:O})}}]),n}(o.Component);ba.defaultProps=ra;var ya=(0,o.forwardRef)(function(e,t){var n=function(e){var t=e.defaultInputValue,n=void 0===t?"":t,a=e.defaultMenuIsOpen,r=void 0!==a&&a,i=e.defaultValue,s=void 0===i?null:i,l=e.inputValue,c=e.menuIsOpen,u=e.onChange,d=e.onInputChange,p=e.onMenuClose,m=e.onMenuOpen,b=e.value,y=g(e,v),w=h((0,o.useState)(void 0!==l?l:n),2),C=w[0],E=w[1],O=h((0,o.useState)(void 0!==c?c:r),2),S=O[0],k=O[1],_=h((0,o.useState)(void 0!==b?b:s),2),T=_[0],x=_[1],I=(0,o.useCallback)(function(e,t){"function"==typeof u&&u(e,t),x(e)},[u]),D=(0,o.useCallback)(function(e,t){var n;"function"==typeof d&&(n=d(e,t)),E(void 0!==n?n:e)},[d]),P=(0,o.useCallback)(function(){"function"==typeof m&&m(),k(!0)},[m]),M=(0,o.useCallback)(function(){"function"==typeof p&&p(),k(!1)},[p]),F=void 0!==l?l:C,R=void 0!==c?c:S,V=void 0!==b?b:T;return f(f({},y),{},{inputValue:F,menuIsOpen:R,onChange:I,onInputChange:D,onMenuClose:M,onMenuOpen:P,value:V})}(e);return o.createElement(ba,b({ref:t},n))}),wa=ya;const Ca=e=>e.customName||e.telegramTopicName||`${wp.i18n.__("Topic","cf7-telegram")} #${e.messageThreadID}`,Ea=({channel:e,titleValue:t,saving:n,error:a,handleTitleClick:r,handleTitleChange:o,handleKeyDown:s,handleCancelEdit:l,saveTitle:c,botForChannel:u,chatsForChannel:d=[],formsForChannel:f=[],availableForms:p=[],showFormSelector:m,handleAddForm:h,handleFormSelect:g,handleRemoveForm:v,availableBots:b=[],handleBotSelect:y,handleRemoveBot:w,bot2ChatConnections:C=[],handleToggleChat:E,deleteChannel:O,getToggleButtonLabel:S,dataAvailability:k={forms:"ready",bots:"ready",chats:"ready"},mutatingRelations:_=!1})=>{const T=(u?.chats||[]).map(e=>{const t=C.find(t=>t.data.from===u.id&&t.data.to===e.id),n=t?.data?.meta?.status?.[0]||null;if("pending"===n)return null;let a=d.some(t=>t.id===e.id)?"Active":"Paused";return"muted"===n&&(a="Muted"),{...e,status:a}}).filter(Boolean);return i().createElement("div",{className:"entity-container channel"+(()=>{let e="";return u?.online&&(e+=" has-bot-online"),T.some(e=>"Active"===e.status)&&(e+=" has-active-chats"),f.length>0&&(e+=" has-forms"),e})(),"data-testid":`cf7tg-channel-${e.id}`,key:e.id,id:`channel-${e.id}`},i().createElement("div",{className:"entity-wrapper channel-wrapper"},i().createElement("div",{className:"frame channel-title-wrapper"},i().createElement("div",{className:"columns"},i().createElement("div",{className:"column title-column"},i().createElement("input",{className:"edit-title","data-testid":`cf7tg-channel-title-input-${e.id}`,type:"text",value:t,onChange:o,onKeyDown:s,onBlur:c,disabled:n,autoFocus:!0})),i().createElement("div",{className:"column bot-column"},"error"===k.bots?i().createElement("span",{className:"resource-error"},wp.i18n.__("Bots are unavailable.","cf7-telegram")):"ready"!==k.bots?i().createElement("span",{className:"resource-loading"},wp.i18n.__("Loading bots...","cf7-telegram")):u?i().createElement("div",{"data-bot-id":u.id,"data-testid":`cf7tg-channel-${e.id}-bot-${u.id}`,className:"bot-for-channel "+(u?.online?"online":"offline")},i().createElement("span",null,u.title.rendered),i().createElement("button",{className:"detach-button detach-bot-button crux",onClick:w,disabled:_})):i().createElement(i().Fragment,null,b.length>0&&i().createElement(wa,{className:"select-picker bot-picker",classNamePrefix:"select-picker",inputId:`cf7tg-channel-bot-picker-${e.id}`,instanceId:`cf7tg-channel-bot-picker-${e.id}`,"data-testid":`cf7tg-channel-${e.id}-bot-picker`,options:b.map(e=>({value:e.id,label:e.title.rendered})),isSearchable:!1,placeholder:wp.i18n.__("Pick a bot","cf7-telegram"),onChange:e=>y({target:{value:e?.value}}),isClearable:!0,isDisabled:_}))))),i().createElement("div",{className:"frame chats"},"error"===k.chats?i().createElement("span",{className:"resource-error"},wp.i18n.__("Chat data is unavailable.","cf7-telegram")):"ready"!==k.chats?i().createElement("span",{className:"resource-loading"},wp.i18n.__("Loading chat data...","cf7-telegram")):T.length>0?i().createElement(i().Fragment,null,T.map(t=>i().createElement("div",{key:t.id,className:`chat chat-${t.id} ${t.status.toLowerCase()}`,"data-testid":`cf7tg-channel-${e.id}-chat-${t.id}`,onClick:()=>!_&&E(t.id,t.status),"aria-disabled":_,title:S(t.status)},i().createElement("span",{className:"chat-username"},null!=t.messageThreadID&&t.telegramName||t.title.rendered),null!=t.messageThreadID&&i().createElement("small",{className:"topic-identity",style:{marginLeft:4},title:`${wp.i18n.__("Topic","cf7-telegram")} #${t.messageThreadID}`},Ca(t))))):i().createElement("span",{className:"no-chats-found"},"[",wp.i18n.__("No chats assigned to this bridge","cf7-telegram"),"]")),i().createElement("div",{className:"frame forms"},i().createElement("button",{className:"add-button add-form-button","data-testid":`cf7tg-channel-${e.id}-add-form`,onClick:h,disabled:"ready"!==k.forms||_},m?wp.i18n.__("Cancel","cf7-telegram"):wp.i18n.__("Add Form","cf7-telegram")),"error"===k.forms?i().createElement("span",{className:"resource-error"},wp.i18n.__("Forms are unavailable.","cf7-telegram")):"ready"!==k.forms?i().createElement("span",{className:"resource-loading"},wp.i18n.__("Loading forms...","cf7-telegram")):m&&i().createElement(wa,{className:"select-picker form-picker",classNamePrefix:"select-picker",inputId:`cf7tg-channel-form-picker-${e.id}`,instanceId:`cf7tg-channel-form-picker-${e.id}`,"data-testid":`cf7tg-channel-${e.id}-form-picker`,options:p.map(e=>({value:e.id,label:e.title})),isSearchable:!0,placeholder:wp.i18n.__("Pick a form","cf7-telegram"),onChange:e=>g({target:{value:e?.value}}),isClearable:!0,isDisabled:_}),"ready"===k.forms&&(f.length>0?i().createElement("ul",{className:"form-list "+(m?"show-selector":"")},f.map(t=>i().createElement("li",{key:t.id,"data-testid":`cf7tg-channel-${e.id}-form-${t.id}`},t.title,i().createElement("button",{className:"detach-button crux detach-form-button",onClick:()=>v(t.id),disabled:_})))):m||i().createElement("span",{className:"no-forms-found"},"[",wp.i18n.__("No forms assigned to this bridge","cf7-telegram"),"]"))),i().createElement("div",{className:"frame status-bar"},i().createElement("button",{className:"remove-channel-button","data-testid":`cf7tg-remove-channel-${e.id}`,onClick:O,disabled:n||_},wp.i18n.__("Remove Bridge","cf7-telegram")))))};class Oa extends Error{constructor(e,t={}){super(e),this.name="ApiError",this.status=t.status??0,this.code=t.code??"",this.category=t.category??"rest_transport",this.method=t.method??"GET",this.url=t.url??"",this.data=t.data??null}}const Sa=(e,t="")=>[401,403].includes(Number(e))||/forbidden|unauthorized|cannot_/i.test(t)?"rest_permission":Number(e)>=400?"rest_http":"rest_transport",ka=e=>String(e).replace(/bot\d{5,}(:|%(?:25)*3a)[A-Za-z0-9_-]{8,}/gi,"bot[telegram-token]").replace(/\d{5,}(:|%(?:25)*3a)[A-Za-z0-9_-]{8,}/gi,"[telegram-token]").replace(/([?&][^=]*(?:nonce|token|secret|password|key)[^=]*=)[^&\s]*/gi,"$1[redacted]"),_a=e=>"string"==typeof e?ka(e):e&&"object"==typeof e?Array.isArray(e)?e.map(_a):Object.entries(e).reduce((e,[t,n])=>({...e,[t]:/nonce|token|secret|password|key/i.test(t)?"[redacted]":_a(n)}),{}):e,Ta=e=>{try{const t=new URL(e,"undefined"!=typeof window?window.location?.origin??"https://example.invalid":"https://example.invalid");for(const e of Array.from(t.searchParams.keys()))/nonce|token|secret|password|key/i.test(e)&&t.searchParams.set(e,"[redacted]");return`${t.pathname}${t.search}${t.hash}`}catch(t){return ka(e)}},xa=(e,t)=>{const n=t.toString();return n?`${e}${e.includes("?")?"&":"?"}${n}`:e},Ia=(e,t)=>xa(`${e}${t}`,new URLSearchParams({force:"true"})),Da=async(e,t,n,a={})=>{const r=e;let o={method:t=t??"GET",headers:{"Content-Type":"application/json","X-WP-Nonce":cf7TelegramData?.nonce}},i=new URLSearchParams;if("GET"===t||"HEAD"===t){if(n){for(const[e,t]of Object.entries(n))null!=t&&i.append(e,t);n=null}e=xa(e,i)}n&&(o.body=JSON.stringify(n));try{const n=await fetch(e,o);let r;try{r=await n.json()}catch(a){throw new Oa(n.ok?"The server returned an invalid response.":"The request could not be completed.",{status:n.status??0,category:n.ok?"rest_parse":Sa(n.status),method:t,url:Ta(e)})}if(!n.ok)throw new Oa("The request could not be completed.",{status:n.status??r?.data?.status??0,code:r?.code??"",category:Sa(n.status??r?.data?.status,r?.code),method:t,url:Ta(e),data:_a(r?.data??null)});return a.includeResponse?{data:r,response:n}:r}catch(e){throw e instanceof Oa||(e=new Oa(ka(e?.message||"API request failed"),{category:"rest_transport",method:t,url:Ta(r)})),console.error("API request error:",e),e}},Pa=(e,t)=>{const n=new Set(e.map(e=>e?.id));return e.concat(t.filter(e=>!e||void 0===e.id||!n.has(e.id)&&(n.add(e.id),!0)))},Ma=e=>{const t=e.headers?.get?.("X-WP-TotalPages"),n=Number.parseInt(t,10);return Number.isFinite(n)&&n>0?n:null},Fa=async(e,t={})=>(async(e,t={},n={})=>{const a=n.perPage??100;let r=1,o=1,i=[];do{const{data:s,response:l}=await Da(e,"GET",{...t,per_page:a,page:r},{includeResponse:!0});i=Pa(i,Array.isArray(s)?s:[]);const c=Ma(l);o=null===c&&n.stopWhenTotalPagesHeaderMissing?r:c??r,r+=1}while(r<=o);return i})(e,{order:"asc",orderby:"id",...t}),Ra=async()=>await Da(cf7TelegramData.routes.client),Va=async()=>await(async()=>{let e=0,t=[],n=!0;for(;n;){const a=await Da(cf7TelegramData.routes.forms,"GET",{per_page:100,offset:e,order:"asc",orderby:"id"}),r=t.length,o=Array.isArray(a)?a:[];t=Pa(t,o),e+=o.length,n=o.length>=100&&t.length>r}return t})(),Na=async()=>await Fa(cf7TelegramData.routes.bots),La=async()=>await Fa(cf7TelegramData.routes.chats),Aa=async()=>await Fa(cf7TelegramData.routes.channels),$a=async()=>await Da(cf7TelegramData.routes.relations.form2channel),Ba=async()=>await Da(cf7TelegramData.routes.relations.bot2channel),Ha=async()=>await Da(cf7TelegramData.routes.relations.bot2chat),ja=async()=>await Da(cf7TelegramData.routes.relations.chat2channel);function Ua(e,t=null){const n=t??e.innerText,a=()=>{e.classList.add("copied"),setTimeout(()=>e.classList.remove("copied"),1500)};if(navigator.clipboard&&window.isSecureContext)return void navigator.clipboard.writeText(n).then(a).catch(e=>{console.error("Clipboard error:",e)});const r=document.createElement("textarea");r.value=n,r.style.position="fixed",r.style.opacity="0",document.body.appendChild(r),r.focus(),r.select();try{document.execCommand("copy"),a()}catch(e){console.error("Fallback copy failed:",e)}finally{document.body.removeChild(r)}}const za=async(e,t,n)=>{const a=await(async(e,t)=>await Da(cf7TelegramData.routes.relations.chat2channel,"POST",{from:e,to:t}))(e,t);a&&n(e=>[...e,{data:a}])},Wa=({channel:e,forms:t,setChannels:n,form2ChannelConnections:a,setForm2ChannelConnections:r,bots:s,bot2ChannelConnections:l,setBot2ChannelConnections:c,chats:u,chat2ChannelConnections:d,setChat2ChannelConnections:f,bot2ChatConnections:p,dataAvailability:m={forms:"ready",bots:"ready",chats:"ready"}})=>{const[h,g]=(0,o.useState)(null),[v,b]=(0,o.useState)([]),[y,w]=(0,o.useState)([]),[C,E]=(0,o.useState)([]),[O,S]=(0,o.useState)(!1),[k,_]=(0,o.useState)([]),[T,x]=(0,o.useState)(!1),[I,D]=(0,o.useState)(e.title.rendered),[P,M]=(0,o.useState)(!1),[F,R]=(0,o.useState)(!1),[V,N]=(0,o.useState)(null);(0,o.useEffect)(()=>{if("ready"!==m.bots||"ready"!==m.chats)return;const t=l.find(t=>t.data.to===e.id);if(!t)return g(null);const n=s.find(e=>e.id===t.data.from);if(!n)return g(null);const a=p.filter(e=>e.data.from===n.id),r=u.map(t=>{const n=a.find(e=>e.data.to===t.id);if(!n)return null;const r=d.some(n=>n.data.from===t.id&&n.data.to===e.id);return{...t,muted:!!n.data.muted,status:r?"active":"paused"}}).filter(Boolean);g({...n,chats:r}),b(r.filter(e=>"active"===e.status))},[e.id,s,l,p,u,d,m.bots,m.chats]),(0,o.useEffect)(()=>{if("ready"!==m.forms)return;const n=a.filter(t=>t.data?.to===e.id).map(e=>e.data.from),r=t.filter(e=>n.includes(e.id)),o=t.filter(e=>!n.includes(e.id));w(r),E(o)},[t,a,e.id,m.forms]),(0,o.useEffect)(()=>{if("ready"!==m.bots)return;const t=l.find(t=>t.data.to===e.id),n=t?.data.from,a=s.filter(e=>e.id!==n);_(a)},[s,l,e.id,m.bots]);const L=()=>{D(e.title.rendered),x(!1),N(null)},A=async()=>{if(""!==I.trim()&&I!==e.title.rendered){M(!0),N(null);try{await(async(e,t)=>{let n={title:t};return await Da(`${cf7TelegramData.routes.channels}${e}`,"POST",n)})(e.id,I),x(!1)}catch(e){console.error(e),N(wp.i18n.__("Failed to update title","cf7-telegram"))}finally{M(!1)}}else x(!1)};return i().createElement(Ea,{channel:e,titleValue:I,saving:P,error:V,handleTitleClick:()=>{N(null),x(!0)},handleTitleChange:e=>D(e.target.value),handleKeyDown:e=>{"Enter"===e.key&&A(),"Escape"===e.key&&L()},handleCancelEdit:L,saveTitle:A,botForChannel:h,chatsForChannel:v,formsForChannel:y,availableForms:C,showFormSelector:O,handleAddForm:()=>S(e=>!e),handleFormSelect:async t=>{const n=parseInt(t.target.value,10);if(Number.isInteger(n)&&!F){R(!0);try{await(async(e,t,n)=>{const a=await(async(e,t)=>await Da(cf7TelegramData.routes.relations.form2channel,"POST",{from:e,to:t}))(e,t);a&&n(e=>[...e,{data:a}])})(n,e.id,r)}catch(e){console.error(e),alert(wp.i18n.__("Something went wrong while assigning the form","cf7-telegram"))}finally{S(!1),R(!1)}}},handleRemoveForm:async t=>{const n=a.find(n=>n.data.from===t&&n.data.to===e.id);if(!F&&n&&window.confirm(wp.i18n.__("Are you sure you want to remove this form from the bridge?","cf7-telegram"))){R(!0);try{await(async(e,t)=>{await(async e=>await Da(`${cf7TelegramData.routes.relations.form2channel}${e}`,"DELETE"))(e)&&t(t=>t.filter(t=>t.data.id!==e))})(n.data.id,r)}catch(e){console.error(e),alert(wp.i18n.__("Failed to remove form","cf7-telegram"))}finally{R(!1)}}},availableBots:k,handleBotSelect:async t=>{const n=parseInt(t.target.value,10);if(Number.isInteger(n)&&!F){R(!0);try{await(async(e,t,n)=>{const a=await(async(e,t)=>await Da(cf7TelegramData.routes.relations.bot2channel,"POST",{from:e,to:t}))(e,t);a&&n(e=>[...e,{data:a}])})(n,e.id,c)}catch(e){console.error(e),alert(wp.i18n.__("Failed to assign bot","cf7-telegram"))}finally{R(!1)}}},handleRemoveBot:async()=>{const t=l.find(t=>t.data.to===e.id);if(t&&!F){R(!0);try{await(async(e,t)=>{await(async e=>await Da(`${cf7TelegramData.routes.relations.bot2channel}${e}`,"DELETE"))(e)&&t(t=>t.filter(t=>t.data.id!==e))})(t.data.id,c)}catch(e){console.error(e),alert(wp.i18n.__("Failed to remove bot","cf7-telegram"))}finally{R(!1)}}},bot2ChatConnections:p,handleToggleChat:async(t,n)=>{if(F||"muted"===n.toLowerCase())return;let a=d.find(n=>n.data.from===t&&n.data.to===e.id);R(!0);try{a?await(async(e,t)=>{await(async e=>await Da(`${cf7TelegramData.routes.relations.chat2channel}${e}`,"DELETE"))(e)&&t(t=>t.filter(t=>t.data.id!==e))})(a.data.id,f):await za(t,e.id,f)}catch(e){console.error("Failed to update bridge chat",e),N(wp.i18n.__("Failed to update chat","cf7-telegram"))}finally{R(!1)}},deleteChannel:async()=>{if(!P&&!F&&window.confirm(wp.i18n.__("Are you sure you want to delete this bridge?","cf7-telegram"))){M(!0),N(null);try{await(async(e,t)=>{await(async e=>await Da(Ia(cf7TelegramData.routes.channels,e),"DELETE"))(e)&&t(t=>t.filter(t=>t.id!==e))})(e.id,n)}catch(e){console.error(e),N(wp.i18n.__("Failed to delete bridge","cf7-telegram"))}finally{M(!1)}}},getToggleButtonLabel:e=>{switch(e.toLowerCase()){case"active":return wp.i18n.__("Pause","cf7-telegram");case"paused":return wp.i18n.__("Activate","cf7-telegram");case"muted":return wp.i18n.__("Muted by Bot","cf7-telegram");default:return""}},dataAvailability:m,mutatingRelations:F})},Ga=({bot:e,chatsForBot:t=[],bot2ChatConnections:n=[],updatingStatusIds:a=[],updatingNameIds:r=[],renamingChatId:o=null,chatNameValue:s="",isEditingToken:l,nameValue:c,isTokenEmpty:u,tokenValue:d,saving:f,error:p,handleEditToken:m,deleteBot:h,handleKeyDown:g,setTokenValue:v,handleToggleChatStatus:b,handleDisconnectChat:y,handleStartRenameChat:w=()=>{},handleRenameChatChange:C=()=>{},handleRenameChatKeyDown:E=()=>{},handleCancelRenameChat:O=()=>{},handleSaveChatName:S=()=>{},handleRestoreChatName:k=()=>{},online:_,chatDataStatus:T="ready"})=>{let x=!0===_?"online":!1===_?"offline":"unknown",I=c.slice(0,18);const D=`@${c}`,P=u?d:`***${d.slice(-4)}`;return i().createElement("div",{className:`entity-container bot ${x}`,"data-testid":`cf7tg-bot-${e.id}`,key:e.id,id:`bot-${e.id}`},i().createElement("div",{className:"entity-wrapper bot-wrapper "+(f?"saving":"")},i().createElement("div",{className:"frame bot-summary"},i().createElement("div",{className:"bot-title"},i().createElement("div",{className:`bot-name ${x} copyable`,onClick:e=>Ua(e.currentTarget,D),title:wp.i18n.__("Click to copy bot name","cf7-telegram")},"@",I,I!==c&&"..."),i().createElement("div",{className:"bot-command copyable",onClick:e=>Ua(e.currentTarget,`/cf7tg_start@${c}`),title:wp.i18n.__("Click to copy bot command","cf7-telegram")},"/cf7tg_start@",c)),i().createElement("div",{className:"bot-token"},i().createElement("div",{className:"show-token"+(e.isTokenDefinedByConst?" const":""),"data-testid":`cf7tg-bot-token-display-${e.id}`,onClick:m,title:e.isTokenDefinedByConst?wp.i18n.__("Defined by PHP constant","cf7-telegram"):wp.i18n.__("Click to edit token","cf7-telegram")},wp.i18n.__("token","cf7-telegram"),": ",i().createElement("span",{className:"token-value"},l?"":P)),!_&&u&&!e.isTokenDefinedByConst&&i().createElement("div",{className:"php-const-hint copyable",title:wp.i18n.__("Click to copy PHP code","cf7-telegram"),onClick:t=>Ua(t.currentTarget,`const ${e.phpConst} = 'your_token';`)},wp.i18n.__("set by PHP const","cf7-telegram")),l&&i().createElement(i().Fragment,null,i().createElement("input",{className:"edit-token","data-testid":`cf7tg-bot-token-input-${e.id}`,type:"text",value:d,onChange:e=>v(e.target.value),onKeyDown:g,autoFocus:!0,disabled:f,spellCheck:"false",title:wp.i18n.__("Press Enter to save token, Esc to cancel.","cf7-telegram")})))),p&&i().createElement("p",{style:{color:"red"}},p),i().createElement("div",{className:"frame chats-for-bot"},"error"===T?i().createElement("span",{className:"offline-bot-sad-message"},wp.i18n.__("Chat data is unavailable.","cf7-telegram")):"ready"!==T?i().createElement("span",{className:"unknown-bot-status-message"},wp.i18n.__("Loading chat data...","cf7-telegram")):t.length>0?i().createElement("ul",null,t.map(t=>{const l=function(e,t,n=[]){const a=n.find(n=>n.data.from===e&&n.data.to===t),r=a?.data?.meta?.status?.[0];return"pending"===r?"Pending":"muted"===r?"Muted":"Active"}(e.id,t.id,n),c=a.includes(t.id),u=o===t.id,d=r.includes(t.id),f=null!=t.messageThreadID,p=f||"pending"!==l.toLowerCase(),m=c?wp.i18n.__("Updating...","cf7-telegram"):function(e){return["muted","pending"].includes(e.toLowerCase())?wp.i18n.__("Activate","cf7-telegram"):wp.i18n.__("Mute","cf7-telegram")}(l);return i().createElement("li",{key:t.id,className:`chat-item ${l.toLowerCase()}`,"data-testid":`cf7tg-bot-${e.id}-chat-${t.id}`},u&&!f?i().createElement("input",{className:"chat-name edit-chat-name","data-testid":`cf7tg-bot-${e.id}-chat-${t.id}-name-input`,type:"text",value:s,onChange:C,onKeyDown:e=>E(t.id,e),disabled:d,autoFocus:!0}):i().createElement("span",{className:"chat-name",title:String(l)},f&&t.telegramName||t.title.rendered),f&&(u?i().createElement("input",{className:"topic-identity edit-chat-name","data-testid":`cf7tg-bot-${e.id}-chat-${t.id}-name-input`,type:"text",value:s,onChange:C,onKeyDown:e=>E(t.id,e),disabled:d,autoFocus:!0}):i().createElement("small",{className:"topic-identity",title:`${wp.i18n.__("Topic","cf7-telegram")} #${t.messageThreadID}`},Ca(t))),i().createElement("div",{className:"chat-actions"},u?i().createElement(i().Fragment,null,i().createElement("button",{type:"button",className:"action save-chat-name",onClick:()=>S(t.id),disabled:d,title:d?wp.i18n.__("Saving...","cf7-telegram"):wp.i18n.__("Save","cf7-telegram"),"aria-label":d?wp.i18n.__("Saving...","cf7-telegram"):wp.i18n.__("Save","cf7-telegram")},i().createElement("span",{className:"dashicons dashicons-yes","aria-hidden":"true"})),i().createElement("button",{type:"button",className:"action restore-chat-name",onClick:()=>k(t.id),disabled:d,title:wp.i18n.__("Restore","cf7-telegram"),"aria-label":wp.i18n.__("Restore","cf7-telegram")},i().createElement("span",{className:"dashicons dashicons-undo","aria-hidden":"true"})),i().createElement("button",{type:"button",className:"action cancel-chat-name",onClick:O,disabled:d,title:wp.i18n.__("Cancel","cf7-telegram"),"aria-label":wp.i18n.__("Cancel","cf7-telegram")},i().createElement("span",{className:"dashicons dashicons-no","aria-hidden":"true"}))):i().createElement(i().Fragment,null,i().createElement("button",{type:"button",className:"action toggle-status",onClick:()=>b(t.id,l.toLowerCase()),disabled:c,title:m,"aria-label":m},i().createElement("span",{className:"dashicons "+("Active"===l?"dashicons-controls-pause":"dashicons-controls-play"),"aria-hidden":"true"})),p&&i().createElement("button",{type:"button",className:"action rename-chat",onClick:()=>w(t),disabled:d,title:wp.i18n.__("Rename","cf7-telegram"),"aria-label":wp.i18n.__("Rename","cf7-telegram")},i().createElement("span",{className:"dashicons dashicons-edit","aria-hidden":"true"})),i().createElement("button",{type:"button",className:"action remove-chat",onClick:()=>y(t.id,e.id),disabled:c,title:wp.i18n.__("Remove","cf7-telegram"),"aria-label":wp.i18n.__("Remove","cf7-telegram")},i().createElement("span",{className:"dashicons dashicons-trash","aria-hidden":"true"})))))})):"offline"===x?i().createElement("span",{className:"offline-bot-sad-message"},wp.i18n.__("Couldn't load chat list...","cf7-telegram")):"unknown"===x?i().createElement("span",{className:"unknown-bot-status-message"},wp.i18n.__("Trying to load chat list...","cf7-telegram")):i().createElement("span",{className:"no-chats-found"},wp.i18n.__("Waiting for chats to join...","cf7-telegram"))),i().createElement("div",{className:"frame status-bar"},i().createElement("button",{className:"remove-bot-button","data-testid":`cf7tg-remove-bot-${e.id}`,onClick:h,disabled:f},wp.i18n.__("Remove bot","cf7-telegram")),i().createElement("div",{className:`bot-status ${x}`},x))))},Ka=({bot:e,chats:t,setChats:n=()=>{},bot2ChatConnections:a,setBots:r,setBot2ChatConnections:s,bot2ChannelConnections:l,setBot2ChannelConnections:c,setChat2ChannelConnections:u,loadChatData:d,chatDataStatus:f="ready"})=>{const[p,m]=(0,o.useState)(!1),[h,g]=(0,o.useState)(e.title.rendered),[v,b]=(0,o.useState)(e.token),[y,w]=(0,o.useState)(e.isTokenEmpty),[C,E]=(0,o.useState)(!1),[O,S]=(0,o.useState)(null),[k,_]=(0,o.useState)([]),[T,x]=(0,o.useState)(null),[I,D]=(0,o.useState)(""),[P,M]=(0,o.useState)([]),F=a.filter(t=>t.data.from===e.id).map(e=>e.data.to),R=t.filter(e=>F.includes(e.id)),V=n=>{const r=a.find(t=>t.data.from===e.id&&t.data.to===n),o=t.find(e=>e.id===n);return!!r&&(null!=o?.messageThreadID||"pending"!==r?.data?.meta?.status?.[0])},[N,L]=(0,o.useState)(null),[A,$]=(0,o.useState)(null),B=(0,o.useRef)(null),H=(0,o.useRef)(null),j=(0,o.useRef)(!1),U=(0,o.useRef)(!1),z=(0,o.useRef)(0);(0,o.useEffect)(()=>()=>{j.current=!0,B.current&&clearTimeout(B.current),H.current&&clearTimeout(H.current)},[]),(0,o.useEffect)(()=>{null===A&&Y()},[N]),(0,o.useEffect)(()=>(!1===A&&W(),()=>{B.current&&clearTimeout(B.current)}),[N]),(0,o.useEffect)(()=>{!0===A&&B.current&&clearTimeout(B.current)},[N]),(0,o.useEffect)(()=>(!0===A?H.current||q().then(()=>{G()}):H.current&&(clearTimeout(H.current),H.current=null),()=>{H.current&&clearTimeout(H.current)}),[A]);const W=()=>{B.current=setTimeout(()=>{Y()},cf7TelegramData.intervals.ping)},G=()=>{H.current=setTimeout(async()=>{await q(),j.current||!0!==A||G()},cf7TelegramData.intervals.bot_fetch)},K=()=>{z.current+=1,z.current>=3&&S(wp.i18n.__("Telegram updates could not be checked.","cf7-telegram"))},q=async()=>{if(!U.current){U.current=!0;try{let t=await(async e=>await Da(`${cf7TelegramData.routes.bots}${e}/fetch_updates`,"POST"))(e.id);const n=(e=>{if(e?.hasWebhookConflict)return"webhook_conflict";const t=Array.isArray(e?.errors)?e.errors:[];return t.length&&t.every(e=>"transport"===e?.errorType)?"transient_update_error":t.length?"update_error":null})(t);if("webhook_conflict"===n)return z.current=0,void S(wp.i18n.__("Telegram webhook is active. Disable it before checking for new chats.","cf7-telegram"));if("transient_update_error"===n)return void K();if("update_error"===n)return z.current=0,void S(wp.i18n.__("Telegram updates could not be checked.","cf7-telegram"));z.current=0,S(null),(t.hasNewConnections||t.hasNewChats||t.hasUpdatedChats)&&await d()}catch(e){console.error("Fetch updates failed",e),"rest_transport"===e?.category?K():(z.current=0,S(wp.i18n.__("Telegram updates could not be checked.","cf7-telegram")))}finally{U.current=!1}}},Y=async({force:t=!1,skipEditingCheck:n=!1}={})=>{try{if(!n&&p)throw new Error("Token is being edited");if(!t&&!0===A)return!0;let a=await(async e=>await Da(`${cf7TelegramData.routes.bots}${e}/ping`,"POST"))(e.id);if(j.current)return a.online;if($(a.online),a.online){g(a.botName);try{let t=await(async e=>await Da(`${cf7TelegramData.routes.bots}${e}`))(e.id);r(n=>n.map(n=>n.id===e.id?{...n,title:t.title,online:!0}:n))}catch(e){console.error("Failed to refresh bot data",e)}}return a.online}catch(e){return console.error("Ping failed",e),j.current||$(!1),!1}finally{L(Date.now())}},X=()=>{b(e.token),w(e.isTokenEmpty),m(!1),S(null)},Z=async()=>{E(!0),S(null);try{const t=v.trim();await(async({botId:e,token:t,pingBot:n,bot2ChatConnections:a,setBot2ChatConnections:r,bot2ChannelConnections:o,setBot2ChannelConnections:i})=>{const s=await(async(e,t)=>await Da(`${cf7TelegramData.routes.bots}${e}/token`,"POST",{token:t}))(e,t.trim());return await n({force:!0,skipEditingCheck:!0}),s.relationsReset&&(r(t=>t.filter(t=>t.data.from!==e)),i(t=>t.filter(t=>t.data.from!==e))),s})({botId:e.id,token:t,pingBot:Y,bot2ChatConnections:a,setBot2ChatConnections:s,bot2ChannelConnections:l,setBot2ChannelConnections:c}),b(t),w(!1),m(!1)}catch(e){console.error(e),S(wp.i18n.__("Failed to update bot","cf7-telegram"))}finally{E(!1)}},J=e=>{n(t=>t.map(t=>t.id===e.id?{...t,...e}:t))},Q=()=>{x(null),D(""),S(null)},ee=async n=>{const a=t.find(e=>e.id===n),r=I.trim();if(!a||P.includes(n)||!V(n))return;const o=null!=a.messageThreadID?Ca(a):a.title?.rendered??"";if(""!==r&&r!==o){M(e=>[...e,n]),S(null);try{const t=await(async(e,t,n)=>await Da(`${cf7TelegramData.routes.chats}${e}/name`,"POST",{bot_id:t,name:n}))(n,e.id,r);J(t),x(null),D("")}catch(e){console.error("Failed to rename chat",e),S(wp.i18n.__("Failed to update chat name","cf7-telegram"))}finally{M(e=>e.filter(e=>e!==n))}}else Q()};return i().createElement(Ga,{bot:e,chatsForBot:R,bot2ChatConnections:a,updatingStatusIds:k,updatingNameIds:P,renamingChatId:T,chatNameValue:I,isEditingToken:p,nameValue:h,isTokenEmpty:y,tokenValue:v,saving:C,error:O,handleEditToken:()=>{e.isTokenDefinedByConst||A&&!window.confirm(wp.i18n.__("Changing the token to another Telegram bot will disconnect this bot from its chats and bridges. Continue?","cf7-telegram"))||(S(null),b(""),m(!0))},deleteBot:async()=>{if(window.confirm("Are you sure you want to delete this bot?")){E(!0),S(null);try{if(!await(async e=>await Da(Ia(cf7TelegramData.routes.bots,e),"DELETE"))(e.id))return;r(t=>t.filter(t=>t.id!==e.id))}catch(e){console.error(e),S(wp.i18n.__("Failed to delete bot","cf7-telegram"))}finally{E(!1)}}},handleKeyDown:e=>{if("Enter"===e.key){if(""===v.trim())return void X();Z()}"Escape"===e.key&&X()},setTokenValue:b,handleToggleChatStatus:async(n,r)=>{if(k.includes(n))return;const o=a.findIndex(t=>t.data.from===e.id&&t.data.to===n);if(-1===o)return;const i=a[o];let c;if("active"===r)c="muted";else if("muted"===r)c="active";else{if("pending"!==r)return;c="active"}_(e=>[...e,n]);try{await(async({connectionId:e,newStatus:t,currentStatus:n,chatId:a,messageThreadID:r,botId:o,bot2ChannelConnections:i,setBot2ChatConnections:s,setChat2ChannelConnections:l})=>{if(await(async(e,t,n)=>{const a=await(async(e,t)=>await Da(`${cf7TelegramData.routes.relations.bot2chat}${e}/meta`,"PATCH",{meta:[{key:"status",value:t}]}))(e,t);return a&&n(n=>n.map(n=>n.data.id!==e?n:{...n,data:{...n.data,meta:{...n.data.meta,status:[t]}}})),a})(e,t,s),"pending"!==n||null!=r)return;const c=i.filter(e=>e.data.from===o);for(const e of c)await za(a,e.data.to,l)})({connectionId:i.data.id,newStatus:c,currentStatus:r,chatId:n,messageThreadID:t.find(e=>e.id===n)?.messageThreadID,botId:e.id,bot2ChannelConnections:l,setBot2ChatConnections:s,setChat2ChannelConnections:u})}catch(e){console.error("Failed to update chat status",e)}finally{_(e=>e.filter(e=>e!==n))}},handleDisconnectChat:async(e,t)=>{if(k.includes(e))return;const n=a.findIndex(n=>n.data.from===t&&n.data.to===e);if(-1===n||!window.confirm(wp.i18n.__("Are you sure you want to delete this chat?","cf7-telegram")))return;const r=a[n];_(t=>[...t,e]);try{await(async(e,t)=>{await(async e=>await Da(`${cf7TelegramData.routes.relations.bot2chat}${e}`,"DELETE"))(e)&&t(t=>t.filter(t=>t.data.id!==e))})(r.data.id,s)}catch(e){console.error("Something went wrong while disconnecting chat",e)}finally{_(t=>t.filter(t=>t!==e))}},handleStartRenameChat:e=>{e&&!P.includes(e.id)&&V(e.id)&&(S(null),x(e.id),D(null!=e.messageThreadID?Ca(e):e.title?.rendered??""))},handleRenameChatChange:e=>{D(e.target.value)},handleRenameChatKeyDown:(e,t)=>{"Enter"===t.key&&ee(e),"Escape"===t.key&&Q()},handleCancelRenameChat:Q,handleSaveChatName:ee,handleRestoreChatName:async t=>{if(!P.includes(t)&&V(t)){M(e=>[...e,t]),S(null);try{const n=await(async(e,t)=>await Da(`${cf7TelegramData.routes.chats}${e}/restore_name`,"POST",{bot_id:t}))(t,e.id);J(n),x(null),D("")}catch(e){console.error("Failed to restore chat name",e),S(wp.i18n.__("Failed to restore Telegram chat name","cf7-telegram"))}finally{M(e=>e.filter(e=>e!==t))}}},online:A,chatDataStatus:f})},qa=({setBots:e,disabled:t=!1})=>i().createElement("button",{className:"add-button add-bot-button","data-testid":"cf7tg-create-bot",onClick:async()=>{try{let t=await(async(e,t)=>{let n={title:wp.i18n.__("Bot Name","cf7-telegram"),status:"publish"};return t?.trim(),await Da(cf7TelegramData.routes.bots,"POST",n)})();e(e=>[...e,t])}catch(e){console.error("Error creating bot:",e),alert(wp.i18n.__("Failed to create bot","cf7-telegram"))}},disabled:t},wp.i18n.__("Create Bot","cf7-telegram")),Ya=({setChannels:e,disabled:t=!1})=>i().createElement("button",{className:"add-button add-channel-button","data-testid":"cf7tg-create-channel",onClick:async()=>{try{await(async(e,t)=>{let n=await(async e=>await Da(cf7TelegramData.routes.channels,"POST",{title:e,status:"publish"}))(e);n&&t(e=>[...e,n])})(wp.i18n.__("Bridge Name","cf7-telegram"),e)}catch(e){console.error("Error creating bridge:",e),alert(wp.i18n.__("Failed to create bridge","cf7-telegram"))}},disabled:t},wp.i18n.__("Create Bridge","cf7-telegram")),Xa=["client","forms","bots","chats","channels","form2ChannelConnections","bot2ChannelConnections","chat2ChannelConnections"],Za=()=>Xa.reduce((e,t)=>({...e,[t]:{status:"idle",error:null}}),{});class Ja extends i().Component{constructor(e){super(e),this.state={hasError:!1,retryKey:0}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(){console.error("CF7 Telegram settings failed to render.")}retry=()=>{this.setState(e=>({hasError:!1,retryKey:e.retryKey+1}))};render(){return this.state.hasError?i().createElement("div",{className:"cf7-tg-error-boundary",role:"alert"},i().createElement("p",null,wp.i18n.__("The settings screen could not be displayed.","cf7-telegram")),i().createElement("button",{type:"button",className:"button",onClick:this.retry},wp.i18n.__("Try again","cf7-telegram"))):i().createElement(i().Fragment,{key:this.state.retryKey},this.props.children)}}const Qa=()=>{const[e,t]=(0,o.useState)([]),[n,a]=(0,o.useState)([]),[r,s]=(0,o.useState)([]),[l,c]=(0,o.useState)([]),[u,d]=(0,o.useState)([]),[f,p]=(0,o.useState)([]),[m,h]=(0,o.useState)([]),[g,v]=(0,o.useState)([]),[b,y]=(0,o.useState)(Za),w=(0,o.useCallback)(async(e,t,n)=>{y(t=>({...t,[e]:{status:"loading",error:null}}));try{const a=await t();return n(a),y(t=>({...t,[e]:{status:"success",error:null}})),a}catch(t){throw y(n=>({...n,[e]:{status:"error",error:t}})),t}},[]),C=(0,o.useCallback)(async()=>w("chats",async()=>{const[e,t]=await Promise.all([Ha(),La()]);return{connections:e,loadedChats:t}},({connections:e,loadedChats:t})=>{v((e=>e.map(e=>{const t=e.data?.meta?.status?.[0];return{...e,data:{...e.data,muted:"muted"===t}}}))(e)),s(t)}),[w]),E=(0,o.useCallback)((e=Xa)=>Promise.allSettled(e.map(e=>{switch(e){case"client":return w(e,Ra,()=>{});case"forms":return w(e,Va,t);case"bots":return w(e,Na,a);case"chats":return C();case"channels":return w(e,Aa,c);case"form2ChannelConnections":return w(e,$a,d);case"bot2ChannelConnections":return w(e,Ba,p);case"chat2ChannelConnections":return w(e,ja,h);default:return Promise.resolve()}})),[C,w]);(0,o.useEffect)(()=>{E()},[E]);const O=e=>b[e]?.status??"idle",S=(...e)=>e.some(e=>"error"===O(e))?"error":e.every(e=>"success"===O(e))?"ready":"loading",k=Xa.filter(e=>"error"===O(e));if(!Xa.some(e=>["success","error"].includes(O(e))))return i().createElement("div",null,wp.i18n.__("Loading data...","cf7-telegram"));const _=cf7TelegramData?.migration?.status||{},T=Boolean(cf7TelegramData?.migration?.show_action_button),x=!1!==_.can_retry,I="migration_failed"===_.last_error?.category?_.last_error.message:null;return i().createElement(i().Fragment,null,i().createElement("h1",null,wp.i18n.__("Telegram notificator settings","cf7-telegram")),k.length>0&&i().createElement("div",{className:"notice notice-error cf7t-notice cf7-tg-load-status",role:"alert"},i().createElement("p",null,wp.i18n.__("Some settings data could not be loaded.","cf7-telegram")),i().createElement("button",{type:"button",className:"button",onClick:()=>E(k)},wp.i18n.__("Retry failed requests","cf7-telegram"))),i().createElement("div",{className:"cf7-tg-container"},i().createElement("div",{className:"main-container"},i().createElement("div",{className:"list-container bots-container"},i().createElement("div",{className:"title-container"},i().createElement("h3",{className:"title"},wp.i18n.__("Bots","cf7-telegram")),i().createElement("p",{className:"title-description"},wp.i18n.__("A Telegram bot is required to run the integration. Create at least one bot, then connect it here.","cf7-telegram")," ",i().createElement("a",{href:"https://core.telegram.org/bots#3-how-do-i-create-a-bot",target:"_blank",rel:"noreferrer"},wp.i18n.__("How to create a bot","cf7-telegram"))),i().createElement(qa,{setBots:a,disabled:"success"!==O("bots")})),i().createElement("div",{className:"bot-list"},"error"===O("bots")&&i().createElement("p",{className:"resource-error"},wp.i18n.__("Bots could not be loaded.","cf7-telegram")),n.map(e=>i().createElement(Ka,{key:e.id,bot:e,chats:r,setChats:s,bot2ChatConnections:g,setBots:a,setBot2ChatConnections:v,bot2ChannelConnections:f,setBot2ChannelConnections:p,setChat2ChannelConnections:h,loadChatData:C,chatDataStatus:S("chats")})))),i().createElement("div",{className:"list-container channels-container"},i().createElement("div",{className:"title-container"},i().createElement("h3",{className:"title"},wp.i18n.__("Bridges","cf7-telegram")),i().createElement("p",{className:"title-description"},wp.i18n.__("A bridge is required to run the integration. Create at least one bridge, and add more when different forms should send messages to different sets of Telegram recipients.","cf7-telegram")),i().createElement(Ya,{setChannels:c,disabled:"success"!==O("channels")})),i().createElement("div",{className:"channel-list"},"error"===O("channels")&&i().createElement("p",{className:"resource-error"},wp.i18n.__("Bridges could not be loaded.","cf7-telegram")),l.map(t=>i().createElement(Wa,{key:t.id,channel:t,forms:e,setChannels:c,form2ChannelConnections:u,setForm2ChannelConnections:d,bots:n,bot2ChannelConnections:f,setBot2ChannelConnections:p,chats:r,chat2ChannelConnections:m,setChat2ChannelConnections:h,bot2ChatConnections:g,dataAvailability:{forms:S("forms","form2ChannelConnections"),bots:S("bots","bot2ChannelConnections"),chats:S("chats","chat2ChannelConnections")}})))))),T&&i().createElement("div",{className:"cf7-tg-migration-action"},i().createElement("form",{method:"post",action:cf7TelegramData?.migration?.action_url},i().createElement("input",{type:"hidden",name:"action",value:"cf7tg_migration_action"}),i().createElement("input",{type:"hidden",name:"cf7tg_migration_nonce",value:cf7TelegramData?.migration?.nonce}),i().createElement("p",null,_.is_failed?wp.i18n.__("Data migration failed. You can retry it now.","cf7-telegram"):wp.i18n.__("We detected settings from an older version that couldn’t be migrated automatically. Click the button below to migrate them to the new version.","cf7-telegram")),I&&i().createElement("p",{className:"cf7-tg-migration-error"},I),i().createElement("button",{type:"submit",className:"button button-primary",disabled:!x},_.is_failed?wp.i18n.__("Retry migration","cf7-telegram"):wp.i18n.__("Run migration","cf7-telegram")))),i().createElement("style",null,".copyable::after { content: '"+wp.i18n.__("Copied!","cf7-telegram")+"' !important }"))},er=()=>i().createElement(Ja,null,i().createElement(Qa,null));(0,s.render)(i().createElement(i().StrictMode,null,i().createElement(er,null)),document.getElementById("settings-content"))})(); -
cf7-telegram/trunk/readme.txt
r3744804 r3772619 6 6 Tested up to: 7.1 7 7 Requires PHP: 8.0 8 Stable tag: 1.2. 08 Stable tag: 1.2.1 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 20 20 3. Paste the bot token into the bot form (PHP constants also available). 21 21 4. Create a bridge in the plugin UI. A bridge links Contact Form 7 forms, a Telegram bot, and one or more Telegram recipients. 22 5. Add users to the subscriber list by sending the <code>/cf7tg_start</code> command to your bot. To add a group, first add the bot to the group, then send <code>/cf7tg_start</code> in that group.23 6. Approve or decline subscription requests on the Contact Form 7 → CF7 Telegramsettings page.24 7. Configure the bridge: choose which forms it handles and which Telegram recipients should receive those messages. Create at least one bridge to run the integration, and add more when different forms should send messages to different sets of Telegram recipients.22 5. Keep the Contact Form 7 → CF7 Telegram settings page open while sending the bot's displayed <code>/cf7tg_start@BotName</code> command as a new standalone message. The page checks Telegram for new recipients. To add a group, first add the bot to the group, then send the command there. To add a forum topic, send it inside that topic. The <code>@BotName</code> suffix addresses the correct bot when Telegram group privacy mode is enabled. The short <code>/cf7tg_start</code> command is still supported when Telegram delivers it to the bot; editing an existing message does not register a recipient. 23 6. Approve or decline the subscription requests that appear on the settings page. 24 7. Configure the bridge: choose which forms it handles and which Telegram recipients should receive those messages. After approving a topic, select it in each desired bridge; approving it alone does not assign it to bridges. Create at least one bridge to run the integration, and add more when different forms should send messages to different sets of Telegram recipients. 25 25 26 26 **The integration is configured correctly when the bot panel is highlighted in blue and the bridge panel is highlighted in green.** … … 60 60 61 61 == Changelog == 62 63 = 1.2.1 = 64 - Send Contact Form 7 notifications to selected Telegram forum topics, with separate topic approval, bridge assignment, and delivery; preserve ordinary chat and General topic behavior. 65 - Show the bot-qualified discovery command and explain how to register a topic and assign it to bridges. 66 - Track Telegram topic names and let administrators set local recipient names or restore Telegram-provided names. 67 - Send notifications only to active recipients, and continue with other recipients when a topic delivery fails. 68 - Improve recipient actions with accessible icon buttons and keep bridge form choices in a top-aligned four-column layout. 62 69 63 70 = 1.2.0 =
Note:
See TracChangeset
for help on using the changeset viewer.