package cz.moneta.test.dsl.ufo.operations.client.clientDetail;

import cz.moneta.test.dsl.ufo.banka.pages.common.pages.TIS701_S004_ConfirmationOfAccountHolding;
import cz.moneta.test.dsl.ufo.banka.pages.main.client.settings.EVY701_S001_StatementsDistributionPage;
import cz.moneta.test.dsl.ufo.operations.client.NewProductsByNameUfoOps;
import cz.moneta.test.dsl.ufo.operations.client.NewProductsUfoOps;
import cz.moneta.test.dsl.ufo.operations.client.STO702_S002_ApproveAlreadyReadPage;
import cz.moneta.test.dsl.ufo.operations.client.product.ADC739_S001_IBSBPage;
import cz.moneta.test.dsl.ufo.operations.shared.topmenu.XXX702_SharedTopMenu;
import cz.moneta.test.dsl.ufo.operations.ufoOperations.*;
import cz.moneta.test.harness.context.StoreAccessor;
import cz.moneta.test.harness.endpoints.ufo.UfoEndpoint;
import cz.moneta.test.harness.support.web.*;
import org.junit.jupiter.api.Assertions;

import static cz.moneta.test.dsl.ufo.operations.client.clientDetail.STS701_S002_ClientDetailPage.*;
import static cz.moneta.test.dsl.ufo.operations.shared.SharedElements.LOAD_IMG_DIV_CLASS;

@Wait(LIST_OF_OFFERS)
@Wait(value = LIST_OF_PRODUCTS, by = Lookup.XPATH)
@Wait(value = {CLIENT_CIF_LABEL, CLIENT_RC_LABEL})
@Wait(value = APPLICATIONS_PANEL_XPATH, by = Lookup.XPATH)
@Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE, waitSecondsForElement = 80)
public interface STS701_S002_ClientDetailPage extends StoreAccessor, WebFlow<STS701_S002_ClientDetailPage>, XXX702_SharedTopMenu<STS701_S002_ClientDetailPage> {

    String CURRENT_ACCOUNT_NUMBER_KEY = "CURRENT_ACCOUNT_NUMBER";
    String ACTUAL_ADDRESS_KEY = "ACTUAL_ADDRESS";
    String CREATE_NEW_BUTTON = "STS701_S002_B001";
    String NEW_PRODUCT_GENERAL_XPATH = "//input[@value='%1$s']";
    String NEW_PRODUCT_BY_NAME_GENERAL_XPATH = "//table[@id='STS701_S002_G002_UfoTable']//td[text()='%1$s']";
    String LIST_OF_OFFERS = "STS701_S002_V002";
    String LIST_OF_PRODUCTS = "//fieldset[@id='STS701_S002_Y002']/legend[text()='Produkty']";
    String CHANGE_DISTRIBUTION_BUTTON = "STS701_S002_I058";
    String BACK_CHANGE_DISTRIBUTION_BUTTON = "EVY701_S001_B002";
    String ACCOUNT_LIST_XPATH = "//button[contains(@title, 'STS701_S002_I029')]";
    String CREDIT_CARD_LIST_XPATH = "//button[contains(@title, 'STS701_S002_I030')]";
    String CREDIT_CARD_CONTRACT_STATE_LABEL = "STS701_S002_L422";
    String ADC_PANEL_XPATH = "//button[contains(@title, 'STS701_S002_I187')]";
    String CLIENT_DETAIL_XPATH = "//button[contains(@title, 'STS701_S002_I009')]";
    String TREE_CREDIT_CARD_XPATH = "//span[contains(text(), 'Kredit')]";
    String FUTURE_OPPORTUNITY = "//button[contains(@title, '[STS701_S002_I003]')]";
    String OPPORTUNITY_TABLE = "STS701_S002_G011_clone";
    String RETENTION = "//button[contains(@title, '[STS701_S002_I004]')]";
    String RETENTION_TABLE = "STS701_S002_L019";
    String FRAUD_SUSPECTED = "//button[contains(@title, '[STS701_S002_I028]')]";
    String FRAUD_TABLE = "STS701_S002_G009_UfoTable";
    String COMMUNICATIONS_AND_REMINDERS = "//button[contains(@title, '[STS701_S002_I005]')]";
    String COMMUNICATIONS_AND_REMINDERS_TABLE = "STS701_S002_L544";
    String PRODUCT_LABEL = "STS701_S002_L089";
    String POST_SALES_CALLS_BUTTON = "STS701_S002_I123";
    String BLOCK_MK_BUTTON = "STS701_S002_B049";
    String STATUS_MK_LABEL = "STS701_S002_L847";
    String STATUS_IB_LABEL = "STS701_S002_L845";
    String IB_BLOCATION_COMBOBOX = "STS701_S002_C025";
    String BLOCK_IB_BUTTON = "STS701_S002_B047";
    String UNBLOCK_IB_BUTTON = "STS701_S002_P020-1";
    String PRINT_LETTERS_CIF_BUTTON = "STS701_S002_I034";
    String PRINT_LETTERS_ACCOUNT_BUTTON = "STS701_S002_I164";
    String TREE_ACCOUNT_XPATH = "//span[contains(text(), 'Běžný')]";
    String INSURANCE = "STS701_S002_I078";
    String TRANSACTIONS = "STS701_S002_I012";
    String CHANGE_BUTTON = "EVY701_S001_B001";
    String DEBIT_CARD_LIST = "//button[contains(@title, '[STS701_S002_I032]')]";
    String BLOCATION_DEBIT_BUTTON = "STS701_S002_I142";
    String CARD_ACTIVITIES_BUTTON = "STS701_S002_I150";
    String CARD_RENEVAL_BUTTON = "STS701_S002_I148";
    String PIN_ACTIVATION_BUTTON = "STS701_S002_I060";
    String STATEMENTS_BUTTON = "STS701_S002_I073";
    String DATA_CHANGES_BUTTON = "STS701_S002_I144";
    String PACKAGES_BUTTON = "STS701_S002_I069";
    String BLOCATION_CREDIT_BUTTON = "STS701_S002_I018";
    String CONTRACT_ACTIVITIES = "STS701_S002_I102";
    String BLOCATION_MENU_BUTTON = "STS701_S002_I145";
    String GENERATING_MENU = "STS701_S002_I138";
    String GENERATING_CREDIT_CARD_BUTTON = "STS701_S002_I015";
    String TRANSACTION_AND_STATEMENTS_BUTTON = "STS701_S002_I010";
    String ADVANTAGE_ON_CARD_BUTTON = "STS701_S002_I143";
    String TREE_LOAN_XPATH = "//span[contains(text(), 'Expres')]";
    String LOANS_BLOCKATION_TRANSACTION_MENU = "STS701_S002_I076";
    String LOANS_BLOCKATION_BUTTON = "STS701_S002_I077";
    String LETTERS_PRINTING_BUTTON = "STS701_S002_I089";
    String AMORTIZATION_TABLE_BUTTON = "STS701_S002_I089";
    String TREE_SAVING_ACCOUNT_XPATH = "//span[contains(text(), 'Spořící')]";
    String SAVING_ACCOUNT_TRANSACTIONS = "STS701_S002_I012";
    String CIF_MENU_BUTTON = "STS701_S002_I006";
    String CIF_DETAI_BUTTON = "STS701_S002_I013";
    String HISTORY_SMS_EMAILS = "STS701_S002_I183";
    String CARDS_LIST = "STS701_S002_I021";
    String CANCELED_ACCOUNTS = "STS701_S002_I019";
    String SENDING_OFFERS_MANUALS = "STS701_S002_I043";
    String CURRENT_ACCOUNT_NUMBER_DIV = "STS701_S002_L817";
    String CONTRACT_ID_DIV = "STS701_S002_L182";
    String PICK_NEW_DEBIT_CARD_COMBOBOX = "STS701_S002_C005";
    String NUMBER_OF_CARD_DIV = "STS701_S002_L110";
    String FIRST_CURRENT_ACCOUNT_COMBOBOX = "STS701_S002_C004";
    String CHECK_ACCOUNT_STATE = "STS701_S002_L174";
    String BANK_BACK_OFFICE_BUTTON = "STS701_S002_I017";
    String TRANSFER_TO_530 = "STS701_S002_I106";
    String TRANSFER_TO_535 = "STS701_S002_I108";
    String TRANSFER_TO_536 = "STS701_S002_I056";
    String TRANSFER_TO_730 = "STS701_S002_I193";
    String ACCOUNT_BENEFITS = "STS701_S002_I053";
    String INTERNET_BANK_SPAN = "//span[contains(text(), 'Internet')]";
    String INFO_SERVICE_SPAN = "//span[contains(text(), 'InfoServis')]";
    String BANK_CLIENT_SPAN = "//span[contains(text(), 'BankKlient')]";
    String SMART_BANK_SPAN = "//span[contains(text(), 'Smart Banka')]";
    String INTERNET_BANK_DISPO_XPATH_CLIENT_SPAN = "//span[contains(text(), 'Internet Banka heslo/MK - Dispomodel (Aktivní)')]";
    String INTERNET_BANK_DISPO_XPATH = "//*[@id=\"STS701_S002_T001\"]/div/div[3]/div[2]/div[1]/div/span/span";
    String SMART_BANK_DISPO_XPATH = "//*[@id=\"STS701_S002_T001\"]/div/div[3]/div[2]/div[2]/div/span/span";
    String DETAIL_OF_ADC_PRODUCT = "STS701_S002_B007";
    String PLACE_OF_BUSINESS = "STS701_S002_L093";
    String LOANS_BUTTON_XPATH = "//button[contains(@title, '[STS701_S002_I064]')]";
    String RC_OF_HOLDER_LABEL = "STS701_S002_L157";
    String NUMBER_OF_LOANS_ACCOUNT = "STS701_S002_L269";
    String COMPLAINT_BUTTON = "STS701_S002_I126";
    String COMPLAINTS_AND_OTHER_CLAIMS_BUTTON = "STS701_S002_I139";
    String PRINT_OF_LETTER = "STS701_S002_I049";
    String CONFIRMATION_ABOUT_ACCOUNT = "STS701_S002_I137";
    String ACCOUNT_BLOCKING_DIV = "STS701_S002_I156";
    String TRANSACTIONS_SETTINGS = "STS701_S002_I093";
    String PAYMENTS_THROUGH_MOTO_INTERNET_DIV = "STS701_S002_L145";
    String DEBIT_CARD_SENDING_ADDRESS_STREET_LABEL = "STS701_S002_L160";

    @Click(SENDING_OFFERS_MANUALS)
    ZAS701_S002_SendingOffersAndManualsPage clickSendingOffers();

    @Wait(value = LOAD_IMG_DIV_CLASS, until = Until.GONE, by = Lookup.CLASSNAME)
    @Click(CANCELED_ACCOUNTS)
    EXE706_S001_CanceledAccountsPage clickCanceledAccounts();

    @Wait(value = LOAD_IMG_DIV_CLASS, until = Until.GONE, by = Lookup.CLASSNAME)
    @Click(CARDS_LIST)
    OPK730_S001_CardsListPage clickCardsList();

    @Wait(value = LOAD_IMG_DIV_CLASS, until = Until.GONE, by = Lookup.CLASSNAME)
    @Click(HISTORY_SMS_EMAILS)
    SMS702_S002_SmsEmailHistoryPage clickSmsEmailHistory();

    @Wait(value = CIF_DETAI_BUTTON, until = Until.VISIBLE)
    @Click(CIF_DETAI_BUTTON)
    CIF731_S001_CifDetailPage clickCifDetailButton();

    @Wait(value = LOAD_IMG_DIV_CLASS, until = Until.GONE, by = Lookup.CLASSNAME)
    @Click(CIF_MENU_BUTTON)
    STS701_S002_ClientDetailPage clickCifMenu();

    @Wait(value = LOAD_IMG_DIV_CLASS, until = Until.GONE, by = Lookup.CLASSNAME)
    @Click(SAVING_ACCOUNT_TRANSACTIONS)
    TRA701_S001_Transactions clickSavingAccountTransactions();

    @Wait(value = LOAD_IMG_DIV_CLASS, until = Until.GONE, by = Lookup.CLASSNAME)
    @CustomAction
    default STS701_S002_ClientDetailPage clickSavingAccountTree() {
        UfoEndpoint endpoint = getEndpoint(UfoEndpoint.class);
        endpoint.click(() -> TREE_SAVING_ACCOUNT_XPATH, Lookup.XPATH);
        endpoint.doubleClick(() -> TREE_SAVING_ACCOUNT_XPATH, Lookup.XPATH);
        return null;
    }

    @Click(AMORTIZATION_TABLE_BUTTON)
    PSP701_S001_AmortizationPage clickAmortization();

    @Wait(value = LOAD_IMG_DIV_CLASS, until = Until.GONE, by = Lookup.CLASSNAME)
    @Click(LOANS_BLOCKATION_BUTTON)
    TRA701_S001_Transactions clickLoansBlockation();

    @Wait(value = LOAD_IMG_DIV_CLASS, until = Until.GONE, by = Lookup.CLASSNAME)
    @Click(LOANS_BLOCKATION_TRANSACTION_MENU)
    STS701_S002_ClientDetailPage clickLoansBlockMenu();

    @CustomAction
    default STS701_S002_ClientDetailPage clickLoanTree() {
        UfoEndpoint endpoint = getEndpoint(UfoEndpoint.class);
        endpoint.click(() -> TREE_LOAN_XPATH, Lookup.XPATH);
        endpoint.doubleClick(() -> TREE_LOAN_XPATH, Lookup.XPATH);
        return null;
    }

    @Click(ADVANTAGE_ON_CARD_BUTTON)
    RET705_S001_CardAdvatagePage clickAdvatageOnCardButton();

    @Wait(value = LOAD_IMG_DIV_CLASS, until = Until.GONE, by = Lookup.CLASSNAME)
    @Click(TRANSACTION_AND_STATEMENTS_BUTTON)
    OPK710_S001_TransactionAndStatementPage clickTransactStatementionsButton();

    @Wait(value = GENERATING_CREDIT_CARD_BUTTON, until = Until.VISIBLE)
    @Click(GENERATING_CREDIT_CARD_BUTTON)
    OPK712_S001_CreditCardGenerating clickCardGenerating();

    @Wait(value = LOAD_IMG_DIV_CLASS, until = Until.GONE, by = Lookup.CLASSNAME)
    @Click(GENERATING_MENU)
    STS701_S002_ClientDetailPage clickGeneratingMenu();

    @Wait(value = LOAD_IMG_DIV_CLASS, until = Until.GONE, by = Lookup.CLASSNAME)
    @Click(BLOCATION_MENU_BUTTON)
    STS701_S002_ClientDetailPage clickBlocationMenu();

    @Wait(value = LOAD_IMG_DIV_CLASS, until = Until.GONE, by = Lookup.CLASSNAME)
    @Click(CONTRACT_ACTIVITIES)
    OPK716_S001_ContractActivitiesPage clickContractActivitiesButton();

    @Wait(value = BLOCATION_CREDIT_BUTTON, until = Until.VISIBLE)
    @Click(BLOCATION_CREDIT_BUTTON)
    OPK713_S001_BlockationPage clickBlockationCreditCard();

    @Wait(value = LOAD_IMG_DIV_CLASS, until = Until.GONE, by = Lookup.CLASSNAME)
    @Click(PACKAGES_BUTTON)
    OPK746_S001_AddonPackagePage clickPackages();

    @Wait(value = LOAD_IMG_DIV_CLASS, until = Until.GONE, by = Lookup.CLASSNAME)
    @Click(DATA_CHANGES_BUTTON)
    PLK708_S001_DataChangesPage clickDataChangesButton();

    @Wait(value = LOAD_IMG_DIV_CLASS, until = Until.GONE, by = Lookup.CLASSNAME)
    @Click(STATEMENTS_BUTTON)
    TRA701_S001_Transactions clickStatementsButton();

    @Wait(value = LOAD_IMG_DIV_CLASS, until = Until.GONE, by = Lookup.CLASSNAME)
    @Click(PIN_ACTIVATION_BUTTON)
    PLK713_S001_PinAndActivationCodePage clickPinActivation();

    @Wait(value = LOAD_IMG_DIV_CLASS, until = Until.GONE, by = Lookup.CLASSNAME)
    @Click(CARD_RENEVAL_BUTTON)
    PLK709_S004_CardRenevalPage clickCardReneval();

    @Wait(value = LOAD_IMG_DIV_CLASS, until = Until.GONE, by = Lookup.CLASSNAME)
    @Click(CARD_ACTIVITIES_BUTTON)
    PLK716_S001_CardActivitiesPage clickCardActivities();

    @Wait(value = LOAD_IMG_DIV_CLASS, until = Until.GONE, by = Lookup.CLASSNAME)
    @Click(BLOCATION_DEBIT_BUTTON)
    PLK703_S002_DebitCardBlocationPage clickBlocation();

    @Click(value = DEBIT_CARD_LIST, by = Lookup.XPATH, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, until = Until.GONE, by = Lookup.CLASSNAME))
    STS701_S002_ClientDetailPage clickDebitCard();

    @Wait(value = CHANGE_BUTTON, until = Until.VISIBLE)
    @CheckElementPresent(CHANGE_BUTTON)
    STS701_S002_ClientDetailPage assertChangeDistribution();

    @Wait(value = LOAD_IMG_DIV_CLASS, until = Until.GONE, by = Lookup.CLASSNAME)
    @Click(TRANSACTIONS)
    TRA701_S001_Transactions clickTransactions();

    @Wait(value = LOAD_IMG_DIV_CLASS, until = Until.GONE, by = Lookup.CLASSNAME)
    @Click(INSURANCE)
    HPO740_S001_Insurance clickInsurance();

    @CustomAction
    default STS701_S002_ClientDetailPage storeAccountNumber() {
        UfoEndpoint endpoint = getEndpoint(UfoEndpoint.class);
        String accountNumber = endpoint.getText(TREE_ACCOUNT_XPATH, Lookup.XPATH).replaceAll(".*\\((\\d+);.*", "$1");
        this.store(CURRENT_ACCOUNT_NUMBER_KEY, accountNumber);
        return null;
    }

    @CustomAction
    default STS701_S002_ClientDetailPage clickAccountTree() {
        UfoEndpoint endpoint = getEndpoint(UfoEndpoint.class);
        endpoint.click(() -> TREE_ACCOUNT_XPATH, Lookup.XPATH);
        endpoint.jsDoubleClick(() -> TREE_ACCOUNT_XPATH, Lookup.XPATH);
        endpoint.waitForElementsToLoad(10, Lookup.CLASSNAME, Until.GONE, LOAD_IMG_DIV_CLASS);
        return null;
    }

    @CheckElementContent(CURRENT_ACCOUNT_NUMBER_DIV)
    STS701_S002_ClientDetailPage checkCurrentAccountNumber(String accountNumber);

    @Click(BLOCK_MK_BUTTON)
    STS701_S002_ClientDetailPage clickBlockMobileKey();

    @Click(BLOCK_IB_BUTTON)
    STS701_S002_ClientDetailPage clickBlockInternetBanka();

    @Click(UNBLOCK_IB_BUTTON)
    STS701_S002_ClientDetailPage clickUnblockInternetBanka();

    @CheckElementPresent(COMMUNICATIONS_AND_REMINDERS_TABLE)
    STS701_S002_ClientDetailPage assertCommunicationsRemindersTable();

    @CheckElementPresent(value = CREDIT_CARD_LIST_XPATH, by = Lookup.XPATH)
    STS701_S002_ClientDetailPage assertCreditCardsTab();

    @CheckElementPresent(FRAUD_TABLE)
    STS701_S002_ClientDetailPage assertFraudTable();

    @CheckElementPresent(CREDIT_CARD_CONTRACT_STATE_LABEL)
    STS701_S002_ClientDetailPage assertCreditCardContractState();

    @CheckElementPresent(RETENTION_TABLE)
    STS701_S002_ClientDetailPage assertRetentionTable();

    @CheckElementPresent(OPPORTUNITY_TABLE)
    STS701_S002_ClientDetailPage assertOpportunityTable();

    @Wait(explicitWaitSeconds = 30)
    @CheckElementContent(STATUS_MK_LABEL)
    STS701_S002_ClientDetailPage assertMobileKeyStatus(String mobileKeyStatus);

    @Wait(explicitWaitSeconds = 30)
    @CheckElementContent(STATUS_IB_LABEL)
    STS701_S002_ClientDetailPage assertInternetBankaStatus(String internetBankaStatus);

    @Wait(value = LOAD_IMG_DIV_CLASS, until = Until.GONE, by = Lookup.CLASSNAME)
    @CheckElementContent("STS701_S002_L421")
    STS701_S002_ClientDetailPage assertContractState(String contract);

    @Wait(value = LOAD_IMG_DIV_CLASS, until = Until.GONE, by = Lookup.CLASSNAME)
    @CheckElementContent(PRODUCT_LABEL)
    STS701_S002_ClientDetailPage assertAccountProduct(String accountProduct);

    @Wait(value = LOAD_IMG_DIV_CLASS, until = Until.GONE, by = Lookup.CLASSNAME)
    @CheckElementContent("STS701_S002_L833")
    STS701_S002_ClientDetailPage assertAdcProductList(String adcProductList);

    @CustomAction
    default STS701_S002_ClientDetailPage clickTreeCreditCard() {
        UfoEndpoint endpoint = getEndpoint(UfoEndpoint.class);
        endpoint.click(() -> TREE_CREDIT_CARD_XPATH, Lookup.XPATH);
        endpoint.doubleClick(() -> TREE_CREDIT_CARD_XPATH, Lookup.XPATH);
        return null;
    }

    @Click(PRINT_LETTERS_CIF_BUTTON)
    OTP701_S001_UniversalPrintProcessPage clickPrintLettersWithCif();

    @Click(PRINT_LETTERS_ACCOUNT_BUTTON)
    OTP701_S001_UniversalPrintProcessPage clickPrintLettersWithAccount();

    @Click(POST_SALES_CALLS_BUTTON)
    PSC701_S001_PostSalesCallsPage clickPostSalesCalls();

    @Click(value = COMMUNICATIONS_AND_REMINDERS, by = Lookup.XPATH)
    STS701_S002_ClientDetailPage clickCommunicationsReminders();

    @Click(value = FRAUD_SUSPECTED, by = Lookup.XPATH)
    STS701_S002_ClientDetailPage clickFraudSuspectedTable();

    @Click(value = RETENTION, by = Lookup.XPATH)
    STS701_S002_ClientDetailPage clickRetention();

    @Click(value = FUTURE_OPPORTUNITY, by = Lookup.XPATH)
    STS701_S002_ClientDetailPage clickFutureOpportunity();

    @Click(value = CLIENT_DETAIL_XPATH, by = Lookup.XPATH, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE))
    STS701_S002_ClientDetailPage clickClientDetailList();

    @Click(value = ADC_PANEL_XPATH, by = Lookup.XPATH, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE))
    STS701_S002_ClientDetailPage clickAdcList();

    @Wait(value = LOAD_IMG_DIV_CLASS, until = Until.GONE, by = Lookup.CLASSNAME)
    @Click(value = CREDIT_CARD_LIST_XPATH, by = Lookup.XPATH)
    STS701_S002_ClientDetailPage clickCreditCardList();

    @Click(value = ACCOUNT_LIST_XPATH, by = Lookup.XPATH, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE))
    STS701_S002_ClientDetailPage clickAccountList();

    @Click(value = NEW_PRODUCT_GENERAL_XPATH, by = Lookup.XPATH)
    STS701_S002_ClientDetailPage selectNewProductForActivation(NewProductsUfoOps newProduct);

    @Click(value = NEW_PRODUCT_BY_NAME_GENERAL_XPATH, by = Lookup.XPATH)
    STS701_S002_ClientDetailPage selectNewProductByNameForActivation(NewProductsByNameUfoOps newProduct);

    @Click(CREATE_NEW_BUTTON)
    STO702_S002_ApproveAlreadyReadPage confirmAddProduct();

    @Wait(value = LOAD_IMG_DIV_CLASS, until = Until.GONE, by = Lookup.CLASSNAME)
    @Click(CHANGE_DISTRIBUTION_BUTTON)
    STS701_S002_ClientDetailPage clickDistribution();

    @Wait(value = LOAD_IMG_DIV_CLASS, until = Until.GONE, by = Lookup.CLASSNAME)
    @Click(BACK_CHANGE_DISTRIBUTION_BUTTON)
    STS701_S002_ClientDetailPage clickBackDistribution();

    @Select(value = IB_BLOCATION_COMBOBOX, andWait = @Wait(explicitWaitSeconds = 10))
    STS701_S002_ClientDetailPage selectIBBlocationReason(String reason);

    @CustomAction
    default UKO720_S001_TaskPage closeSecondWindow() {
        UfoEndpoint endpoint = getEndpoint(UfoEndpoint.class);
        endpoint.closeCurrentWindow();
        endpoint.switchToOtherWindow(1, 1);
        return null;
    }

    @CheckElementContent(CONTRACT_ID_DIV)
    STS701_S002_ClientDetailPage checkContractID(String contractId);

    @Wait(value = PICK_NEW_DEBIT_CARD_COMBOBOX, until = Until.VISIBLE)
    @Select(value = PICK_NEW_DEBIT_CARD_COMBOBOX, selectByOrder = true)
    STS701_S002_ClientDetailPage selectPickNewDebitCardCombobox(int order);

    @CheckElementPresent(NUMBER_OF_CARD_DIV)
    STS701_S002_ClientDetailPage checkNumberOfCard();

    @Wait(value = FIRST_CURRENT_ACCOUNT_COMBOBOX, until = Until.CLICKABLE)
    @Select(value = FIRST_CURRENT_ACCOUNT_COMBOBOX, selectByOrder = true)
    STS701_S002_ClientDetailPage selectFirstCurrentAccCombobox(int acc);

    @Wait(value = CHECK_ACCOUNT_STATE, until = Until.VISIBLE)
    @CheckElementContent(CHECK_ACCOUNT_STATE)
    STS701_S002_ClientDetailPage checkAccountState(String state);

    @Wait(value = INTERNET_BANK_DISPO_XPATH, by = Lookup.XPATH, until = Until.CLICKABLE)
    @Click(value = INTERNET_BANK_DISPO_XPATH, by = Lookup.XPATH)
    STS701_S002_ClientDetailPage clickIB();

    @Click(DETAIL_OF_ADC_PRODUCT)
    ADC739_S001_IBSBPage clickDetailAdcProduct();

    @CheckElementContent(value = INTERNET_BANK_DISPO_XPATH, by = Lookup.XPATH)
    STS701_S002_ClientDetailPage checkInternetBankDispo(String name);

    @CheckElementContent(value = SMART_BANK_DISPO_XPATH, by = Lookup.XPATH)
    STS701_S002_ClientDetailPage checkSmartBankDispo(String name);

    @Click(value = BANK_BACK_OFFICE_BUTTON)
    @Click(value = TRANSFER_TO_530)
    BUF709_S002_TransferPage transferTo530();

    @Click(value = BANK_BACK_OFFICE_BUTTON)
    @Click(value = TRANSFER_TO_535)
    STS701_S002_ClientDetailPageTransitions transferTo535();

    @Click(value = BANK_BACK_OFFICE_BUTTON)
    @Click(value = TRANSFER_TO_536)
    BUF709_S002_TransferPage transferTo536();

    @Click(value = BANK_BACK_OFFICE_BUTTON)
    @Click(value = TRANSFER_TO_730)
    BUF709_S002_TransferPage transferTo730();

    @Click(value = BANK_BACK_OFFICE_BUTTON)
    @Click(value = ACCOUNT_BENEFITS)
    RET701_S003_AccountBenefits clickAccountBenefits();

    @AcceptAlert(waitSecondsForAlert = 10, expectedAlertText = "Uzavřený účet s debetním zůstatkem")
    STS701_S002_ClientDetailPage acceptAlert();

    @Click(CHANGE_DISTRIBUTION_BUTTON)
    EVY701_S001_StatementsDistributionPage clickDistributionButton();

    @CustomAction
    default UKO735_S001_ClaimsAndComplaints clickComplaint() {
        UfoEndpoint endpoint = getEndpoint(UfoEndpoint.class);
        endpoint.click(() -> COMPLAINT_BUTTON);
        endpoint.click(() -> COMPLAINTS_AND_OTHER_CLAIMS_BUTTON);
        endpoint.focusToNewPopup(10);
        return null;
    }

    @CustomAction
    default STS701_S002_AdcProductsPanel clickInternetBank() {
        UfoEndpoint endpoint = getEndpoint(UfoEndpoint.class);
        endpoint.click(() -> INTERNET_BANK_SPAN, Lookup.XPATH);
        endpoint.jsDoubleClick(() -> INTERNET_BANK_SPAN, Lookup.XPATH);
        endpoint.waitForElementsToLoad(10, Lookup.CLASSNAME, Until.GONE, LOAD_IMG_DIV_CLASS);
        return null;
    }

    @CustomAction
    default STS701_S002_AdcProductsPanel clickInfoService() {
        UfoEndpoint endpoint = getEndpoint(UfoEndpoint.class);
        endpoint.click(() -> INFO_SERVICE_SPAN, Lookup.XPATH);
        endpoint.jsDoubleClick(() -> INFO_SERVICE_SPAN, Lookup.XPATH);
        endpoint.waitForElementsToLoad(10, Lookup.CLASSNAME, Until.GONE, LOAD_IMG_DIV_CLASS);
        return null;
    }

    @CustomAction
    default STS701_S002_AdcProductsPanel clickBankClient() {
        UfoEndpoint endpoint = getEndpoint(UfoEndpoint.class);
        endpoint.click(() -> BANK_CLIENT_SPAN, Lookup.XPATH);
        endpoint.jsDoubleClick(() -> BANK_CLIENT_SPAN, Lookup.XPATH);
        endpoint.waitForElementsToLoad(10, Lookup.CLASSNAME, Until.GONE, LOAD_IMG_DIV_CLASS);
        return null;
    }

    @Click(value = LOANS_BUTTON_XPATH, by = Lookup.XPATH, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE))
    STS701_S002_ClientDetailPage clickLoans();

    @Wait(value = NUMBER_OF_LOANS_ACCOUNT, until = Until.VISIBLE)
    @ExecuteJavaScript("navigator.clipboard.writeText(document.getElementById('" + NUMBER_OF_LOANS_ACCOUNT + "').textContent)")
    STS701_S002_ClientDetailPage copyLoansNumberToClipboard();

    @CustomAction
    default STS701_S002_AdcProductsPanel clickSmartBank() {
        UfoEndpoint endpoint = getEndpoint(UfoEndpoint.class);
        endpoint.click(() -> SMART_BANK_SPAN, Lookup.XPATH);
        endpoint.jsDoubleClick(() -> SMART_BANK_SPAN, Lookup.XPATH);
        endpoint.waitForElementsToLoad(10, Lookup.CLASSNAME, Until.GONE, LOAD_IMG_DIV_CLASS);
        return null;
    }

    @CheckElementContent(PLACE_OF_BUSINESS)
    STS701_S002_ClientDetailPage checkPlaceOfBusiness(String place);

    @Click(value = INTERNET_BANK_DISPO_XPATH_CLIENT_SPAN, by = Lookup.XPATH)
    STS701_S002_ClientDetailPage clickInternetBankPasswordDispomodelInProductsTree();

    @Click(value = ADC_PANEL_XPATH, by = Lookup.XPATH, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE))
    ADC739_S001_IBSBPage clickAdcProducts();

    @Wait(value = RC_OF_HOLDER_LABEL, until = Until.VISIBLE)
    @CheckElementContent(RC_OF_HOLDER_LABEL)
    STS701_S002_ClientDetailPage checkRcOfHolder(String rc);

    @CheckElementPresent(value = LIST_OF_PRODUCTS, by = Lookup.XPATH)
    STS701_S002_ClientDetailPage checkListOfProducts();

    @CustomAction
    default TIS701_S004_ConfirmationOfAccountHolding clickConfirmationAboutAccount() {
        UfoEndpoint endpoint = getEndpoint(UfoEndpoint.class);
        endpoint.click(() -> BANK_BACK_OFFICE_BUTTON);
        endpoint.moveToElementAndClickToOtherElement(PRINT_OF_LETTER, CONFIRMATION_ABOUT_ACCOUNT);
        return null;
    }

    @CustomAction
    default STS701_S002_ClientDetailPage scrollToSendingOffersManuals() {
        UfoEndpoint endpoint = this.getEndpoint(UfoEndpoint.class);
        endpoint.scrollIntoView(SENDING_OFFERS_MANUALS);
        return null;
    }

    @CustomAction
    default STS701_S002_ClientDetailPage checkInfoServiceProductIsNotPresent() {
        UfoEndpoint endpoint = getEndpoint(UfoEndpoint.class);
        Assertions.assertFalse(endpoint.isElementPresent(INFO_SERVICE_SPAN, Lookup.XPATH), "Info Service product is present on page");
        return null;
    }

    @Click(value = ACCOUNT_BLOCKING_DIV, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE))
    TRA701_S001_Transactions clickAccountBlocking();

    @Wait(TRANSACTIONS_SETTINGS)
    @Click(TRANSACTIONS_SETTINGS)
    OPK745_S001_TransactionSettings clickTransactionsSettings();

    @Wait(PAYMENTS_THROUGH_MOTO_INTERNET_DIV)
    @CheckElementContent(PAYMENTS_THROUGH_MOTO_INTERNET_DIV)
    STS701_S002_ClientDetailPage checkPaymentsThroughMotoInternet(String text);

    @StoreElementContent(storeKey = ACTUAL_ADDRESS_KEY, value = DEBIT_CARD_SENDING_ADDRESS_STREET_LABEL)
    STS701_S002_ClientDetailPage storeDebitCardSendingAddressStreetLabel();

    @CheckElementContent(DEBIT_CARD_SENDING_ADDRESS_STREET_LABEL)
    STS701_S002_ClientDetailPage checkDebitCardSendingAddressStreetLabel(String expectedAddress);
}
