{#if openedUser} {#if userDetailLoading || !openedUserDetail}

{at("loading", {}, "Загрузка…")}

{:else}
{at("user_tab_subscription", {}, "Подписка")} {at("user_tab_activity", {}, "Активность")} {at("user_tab_logs", {}, "Логи")} {at("user_tab_actions", {}, "Действия")} {#if openedUserDetail.active_subscription}
  • {at("user_label_active_until", {}, "Активна до")}{fmtDate(openedUserDetail.active_subscription.end_date)}
  • {at("user_label_tariff", {}, "Тариф")}{subscriptionDisplayLabel(openedUserDetail.active_subscription)}
  • {at("user_label_auto_renew", {}, "Авто-продление")}{pretty(openedUserDetail.active_subscription.auto_renew_enabled)}
  • {at("user_label_provider", {}, "Провайдер")}{openedUserDetail.active_subscription.provider || "—"}
  • {at("user_label_hwid_devices", {}, "HWID-устройства")}{hwidLimitLabel(openedUserDetail.active_subscription)}
{#if openedUserDetail.active_subscription.premium_unlimited_override} {:else if Number(openedUserDetail.active_subscription.premium_limit_bytes || 0) > 0} {/if}
{:else}

{at("user_no_active_subscription", {}, "Активной подписки нет")}

{/if} {#if openedUserDetail?.trial}
  • {at("user_label_trial", {}, "Пробник / триал")}{trialSummaryText(openedUserDetail.trial)}
  • {#if openedUserDetail.trial.used && openedUserDetail.trial.latest_end_date}
  • {at("user_label_trial_until", {}, "Триал до")}{fmtDate(openedUserDetail.trial.latest_end_date)}
  • {/if} {#if Number(openedUserDetail.trial.count || 0) > 1}
  • {at("user_label_trial_count", {}, "Триалов")}{openedUserDetail.trial.count}
  • {/if} {#if openedUserDetail.trial.last_reset_at}
  • {at("user_label_trial_reset_at", {}, "Сброс триала")}{fmtDate(openedUserDetail.trial.last_reset_at)}
  • {/if}
{/if} {#if (openedUserDetail.subscriptions || []).length}
{at( "user_history_title", { count: openedUserDetail.subscriptions.length }, `История подписок · ${openedUserDetail.subscriptions.length}` )}
{#each openedUserDetail.subscriptions.slice(0, 8) as sub}
{subscriptionDisplayLabel(sub)} {at( "user_history_until", { date: fmtDate(sub.end_date) }, `до ${fmtDate(sub.end_date)}` )}
{#if sub.is_active} {at("user_history_active", {}, "Активна")} {:else} {sub.status_from_panel || at("user_history_status_panel", {}, "История")} {/if}
{/each}
{/if}
{at( "user_recent_payments_title", { count: (openedUserDetail.recent_payments || []).length }, `Последние платежи · ${(openedUserDetail.recent_payments || []).length}` )}
{#if (openedUserDetail.recent_payments || []).length}
{#each openedUserDetail.recent_payments.slice(0, 8) as payment}
{fmtMoney(payment.amount, payment.currency)} {payment.provider} · {fmtDateShort(payment.created_at)}
{payment.status}
{/each}
{:else}

{at("user_no_payments", {}, "Платежей нет")}

{/if}
{at("user_logs_section_title", {}, "Логи пользователя")}
{at("total", {}, "Всего")} {userLogsTotal} usersStore.loadUserLogs(userLogsPage)} title={at("refresh", {}, "Обновить")} > {at("refresh", {}, "Обновить")}
{#if userLogsLoading} {:else if !userLogs.length} {at("logs_empty", {}, "Записей нет")} {:else} {at("date", {}, "Дата")} {at("event", {}, "Событие")} {at("content", {}, "Контент")} {#each userLogs as entry (entry.log_id)} {fmtDate(entry.timestamp)} {entry.event_type || "—"} {#if entry.is_admin_event} {at("user_logs_admin_event", {}, "Админ")} {/if} {#if entry.target_user_id && entry.target_user_id !== openedUser?.user_id} → {entry.target_user_id} {/if} {entry.content || ""} {/each} {/if} {#if userLogsLoaded && userLogsTotal > userLogsPageSize} usersStore.setUserLogsPage(page)} /> {/if}
{at("user_btn_reset_trial", {}, "Сбросить триал")} {at("user_label_extend", {}, "Продлить подписку")}
{at("user_btn_extend", {}, "Продлить")}
{#if Number(openedUserDetail?.active_subscription?.extra_hwid_devices || 0) > 0} {/if}
{#if openedUserDetail?.active_subscription}
{at("user_premium_override_bonus", {}, "Доп. премиум-трафик, GB")} {at("user_premium_override_bonus_hint", {}, "")}
{at("user_regular_override_bonus", {}, "Доп. основной трафик, GB")} {at("user_regular_override_bonus_hint", {}, "")}
{at("user_hwid_limit_input", {}, "Лимит устройств")} {at( "user_hwid_limit_input_hint", {}, "Пусто — тариф/default; 0 или галочка — безлимит." )}
{at("user_traffic_grant_kind", {}, "Тип трафика")} usersStore.updateState({ grantTrafficKindDraft: v })} ariaLabel={at("user_traffic_grant_kind", {}, "Тип трафика")} /> {at("user_traffic_grant_gb", {}, "ГБ к выдаче")}
{at("user_traffic_grant_submit", {}, "Выдать")}
{/if} {at("user_label_telegram_msg", {}, "Сообщение в Telegram")} {at( "user_hint_telegram_msg", {}, "Поддерживается HTML-разметка Telegram" )}