{if $userinfo.logged != 1}

<html>

<head>
    <META HTTP-EQUIV=Refresh CONTENT="0; URL={" /"|encurl}">
</head>

<body>

    <body>

</html>

{else}




<!DOCTYPE html>
<html lang="ru">

{include file="account_header.tpl"}

<style>
    .chart-lk-main {
        padding-bottom: initial;
    }

    .scrollbar-external_wrapper .external-scroll_x {
        padding-left: 30px;
        padding-right: 30px;
        padding-bottom: 20px;
    }


    .ct-chart .ct-label {
        width: 55px !important;
    }

</style>

<body>



    <div class="flex page-lk-main">
        <div class="menu-lk">
            <div class="lk-burger">
                <div class="icon--lk-burger"></div>
            </div>
            <div class="menu-lk-inner">
                <a class="btn-link" href="/">
                    <div class="logo">
                        <img src="styles/assets/img/logo.svg">
                    </div>
                </a>
                <div class="flex">
                    <a class="btn-link" href="/">
                        <div class="btn-link__icon icon--lk-home"></div>
                        <div class="btn-link__text">Main</div>
                    </a>
                    {include file="multilang.tpl"}
                </div>
                {include file="token_price.tpl"}
                <div class="caption-wrapper">
                    <div class="caption">Menu</div>
                    <div class="caption-decor"></div>
                </div>
                {include file="account_menu.tpl"}
                <div class="caption-wrapper">
                    <div class="caption">Social media</div>
                    <div class="caption-decor"></div>
                </div>
                {include file="social_account.tpl"}
            </div>
        </div>


        <div class="content-lk">
            <div class="content-lk-inner">
                <div class="container">


                    <div class="complex-block-wrapper scrollbar-external_wrapper">
                        <div class="complex-block__bg"></div>
                        <div class="complex-block">
                            <div class="complex-block__caption">Daly profitability progress</div>
                            <div class="transact-chart">
                                <div class="ct-chart-wrapper stripe-highlight">
                                    <div class="ct-chart scrollbar-external"></div>
                                </div>
                            </div>
                        </div>
                        <div class="transact-chart__scroll">
                            <div class="external-scroll_x">
                                <div class="scroll-arrow scroll-arrow_less"><svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
                                        <path fill-rule="evenodd" clip-rule="evenodd" d="M20 3c9.389 0 17 7.611 17 17s-7.611 17-17 17S3 29.389 3 20 10.611 3 20 3Zm0-3c11.046 0 20 8.954 20 20s-8.954 20-20 20S0 31.046 0 20 8.954 0 20 0Z" fill="#fff" fill-opacity=".3" />
                                        <path d="m20 17.828 4.95 4.95 1.414-1.414L20 15l-6.364 6.364 1.414 1.414 4.95-4.95Z" fill="#fff" /></svg></div>
                                <div class="scroll-element_outer">
                                    <div class="scroll-element_size"></div>
                                    <div class="scroll-element_track"></div>
                                    <div class="scroll-bar"></div>
                                </div>
                                <div class="scroll-arrow scroll-arrow_more"><svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
                                        <path fill-rule="evenodd" clip-rule="evenodd" d="M20 3c9.389 0 17 7.611 17 17s-7.611 17-17 17S3 29.389 3 20 10.611 3 20 3Zm0-3c11.046 0 20 8.954 20 20s-8.954 20-20 20S0 31.046 0 20 8.954 0 20 0Z" fill="#fff" fill-opacity=".3" />
                                        <path d="m20 17.828 4.95 4.95 1.414-1.414L20 15l-6.364 6.364 1.414 1.414 4.95-4.95Z" fill="#fff" /></svg></div>
                            </div>
                        </div>
                    </div>
                    <div class="complex-block-mob-wrapper scrollbar-external_wrapper">
                        <div class="complex-block-mob-bg">
                            <div class="complex-block-mob__bg-left"></div>
                            <div class="complex-block-mob">
                                <div class="complex-block-mob__inner">
                                    <div class="complex-block__caption">Profitability progress</div>
                                    <div class="transact-chart"></div>
                                </div>
                            </div>
                            <div class="complex-block-mob__bg-left right"></div>
                        </div>
                        <div class="transact-chart__scroll"></div>
                    </div>
                    <div class="title-icon">
                        <div class="orange-icon">
                            <div class="icon--list-white"></div>
                        </div>
                        <div class="title-icon__title-wrapper">
                            <div class="title-icon__title1">Public report</div>
                            <div class="title-icon__title2">{$meta_title|default:$settings.site_name}'s deals</div>
                        </div>
                    </div>
                    <style>
                        .list-enter-active {
                            transition: all 1s;
                        }

                        .list-enter

                        /* .list-leave-active below version 2.1.8 */
                            {
                            opacity: 0;
                            transform: translateY(-30px);
                        }

                    </style>





                    <div class="block-reports" id="reportsApp">
                        {literal}
                        <div class="block-reports__item" v-for="(deals, week) in dealsByWeeksToDisplay" :key="week" :id="week.replaceAll(' ', '')">
                            <div class="block-reports__item-caption"><span class="notranslate" translate="no">${week}</span>
                                {/literal}
                                <div class="caption-decor"></div>
                            </div>
                            <div class="block-reports__item-inner">
                                <div class="block-reports__item-title slide-list-title">
                                    <div class="block-reports__item-name">{$meta_title|default:$settings.site_name}'s deals report</div>
                                    <div class="block-reports__item-stat flex middle">
                                        <div class="block-reports__item-stat__icon">
                                            <div class="icon--stat-detail"></div>
                                        </div>
                                        {literal}
                                        <div class="block-reports__item-stat__num notranslate" translate="no">+$${getWeekProfit(week)}</div>
                                        {/literal}
                                    </div>
                                    <div id="check_details" class="slide-control" onclick="toggleDetails()">
                                        <div class="slide-control__text">Details</div>
                                        <div class="slide-control__icon"></div>
                                    </div>
                                </div>
                                <div id="check_content" class="block-reports__item-content" style="display: block;">
                                    <div class="row-4 block-reports__item-content__info-wrapper">
                                        <div class="col">
                                            <div class="block-reports__item-content__info-block">
                                                <div class="block-reports__item-content__info-block__name">Deals concluded</div>
                                                {literal}
                                                <div class="block-reports__item-content__info-block__val notranslate" translate="no">${dealsByWeeks[week].length}</div>
                                                {/literal}
                                            </div>
                                        </div>
                                        <div class="col">
                                            <div class="block-reports__item-content__info-block">
                                                <div class="block-reports__item-content__info-block__name">Average profit</div>
                                                {literal}
                                                <div class="block-reports__item-content__info-block__val notranslate" translate="no">$${getAverageProfit(week)}</div>
                                                {/literal}
                                            </div>
                                        </div>
                                        <div class="col">
                                            <div class="block-reports__item-content__info-block">
                                                <div class="block-reports__item-content__info-block__name">{$meta_title|default:$settings.site_name}'s weekly profit</div>
                                                {literal}
                                                <div class="block-reports__item-content__info-block__val notranslate" translate="no">$${getWeekProfit(week)}</div>
                                                {/literal}
                                            </div>
                                        </div>
                                        <div class="col">
                                            <div class="block-reports__item-content__info-block">
                                                <div class="block-reports__item-content__info-block__name">Total earned by {$meta_title|default:$settings.site_name}</div>
                                                {literal}
                                                <div class="block-reports__item-content__info-block__val notranslate" translate="no">$${ totalProfit }</div>
                                                {/literal}
                                            </div>
                                        </div>
                                    </div>
                                    <div class="caption-wrapper">
                                        <div class="caption">List of arbitrage deals</div>
                                        <div class="caption-decor"></div>
                                    </div>
                                    <div class="lk-table lk-table-deals">
                                        <div class="lk-table__row-header">
                                            <div class="lk-table__col">Pair</div>
                                            <div class="lk-table__col">Exchange</div>
                                            <div class="lk-table__col">Date</div>
                                            <div class="lk-table__col">Purchase price</div>
                                            <div class="lk-table__col">Sale price</div>
                                            <div class="lk-table__col">Deal amount</div>
                                            <div class="lk-table__col">Profit</div>
                                            <div class="lk-table__col">Spread</div>
                                        </div>
                                        <div class="frame-line"></div>
                                        <div class="frame-inner">
                                            {literal}
                                            <transition-group name="list" tag="div">
                                                <div class="lk-table__row" v-for="deal in deals" :key="deal.time">
                                                    <div class="slide-list-title">
                                                        <div class="lk-table__col">
                                                            <div class="lk-table__col-caption">Pair</div>
                                                            <div class="lk-table__col-text notranslate" translate="no">${formatPairName(deal.pair)}</div>
                                                        </div>
                                                        <div class="lk-table__col">
                                                            <div class="lk-table__col-caption">Exchange</div>
                                                            <div class="flex middle">
                                                                <div :class="'lk-table__icon-market icon--' + deal.from.toLowerCase() + '-min'"></div>
                                                                <div class="icon-text c-green notranslate" translate="no">${deal.from}</div>
                                                                <div class="icon-arrow-table-deals"></div>
                                                                <div :class="'lk-table__icon-market icon--' + deal.to.toLowerCase() + '-min'"></div>
                                                                <div class="icon-text c-red notranslate" translate="no">${deal.to}</div>
                                                            </div>
                                                        </div>
                                                        <div class="lk-table__col notranslate" translate="no">${deal.date}</div>
                                                        <div class="lk-table__col">
                                                            <div class="lk-table__col-caption">Purchase price</div>
                                                            <div class="flex middle">
                                                                <div class="lk-table__icon-amount icon--lk-income"></div>
                                                                <div class="icon-text notranslate" translate="no">${deal.buy}</div>
                                                            </div>
                                                        </div>
                                                        <div class="lk-table__col">
                                                            <div class="lk-table__col-caption">Sale price</div>
                                                            <div class="flex middle">
                                                                <div class="lk-table__icon-amount icon--lk-withdraw"></div>
                                                                <div class="icon-text notranslate" translate="no">${deal.sold}</div>
                                                            </div>
                                                        </div>
                                                        <div class="lk-table__col">
                                                            <div class="lk-table__col-caption">Deal amount:</div>
                                                            <div class="lk-table__col-text notranslate" translate="no">$${deal.amount}</div>
                                                        </div>
                                                        <div class="lk-table__col">
                                                            <div class="lk-table__col-caption">Profit:</div>
                                                            <div class="lk-table__col-text c-green notranslate" translate="no">+$${deal.profit}</div>
                                                        </div>
                                                        <div class="lk-table__col">
                                                            <div class="lk-table__col-caption">Spread:</div>
                                                            <div class="lk-table__col-text notranslate" translate="no">${deal.spread}%</div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </transition-group>
                                            {/literal}
                                        </div>
                                        <div class="flex-center">
                                            <div class="pagination-wrapper">
                                                {literal}
                                                <a class="item notranslate" translate="no" v-show="currentPageByWeeks[week] > 1" @click="prevPage(week)"><</a>
                                                        <a class="item active notranslate" translate="no">${currentPageByWeeks[week]}</a>
                                                        <a class="item notranslate" translate="no" v-show="Math.ceil(dealsByWeeks[week].length / 20) > currentPageByWeeks[week]" @click="nextPage(week)">></a>
                                                        {/literal}
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>




                </div>
            </div>

            {include file="account_footer.tpl"}

        </div>
    </div>


    {include file="account_footer_scripts_report.tpl"}
    <script src="styles/assets/js/get_report.js"></script>
    {literal}
    <script>
        function writeScript(src) {
            document.write(`<script type='text/javascript' src='${src}?v=${Date.now()}'><\/script>`);
        }       
        writeScript('styles/assets/js/worker.js');
        writeScript('styles/assets/js/get_arbitration.js');
    </script>
    {/literal}
	
	

	

<script>
  function toggleDetails() {
    var content = $('.block-reports__item-content'); 
    var inner = $('.block-reports__item-inner'); 
    var title = $('.block-reports__item-title');
   
    content.slideToggle(200);
    
    inner.toggleClass('opened');
    title.toggleClass('expand');
  }
</script>

<script>
window.onload = function() {
        var checkContent = document.getElementById("check_content");
        if (checkContent) {
            checkContent.style.display = "block";
        }
    };
</script>




</body>

</html>

{/if}
