document.addEventListener("DOMContentLoaded",()=>{if(0!==$(".joe_index__banner .swiper-container").length){let e="horizontal";Joe.IS_MOBILE||2!==$(".joe_index__banner-recommend .item").length||(e="vertical"),new Swiper(".swiper-container",{keyboard:!1,direction:e,loop:!0,autoplay:!0,mousewheel:!0,pagination:{el:".swiper-pagination"},navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"}})}{const e=e=>"default"===e.mode?`\n
\n \n \n \n \n \n \n \n \n `:"single"===e.mode?`\n \n \n \n \n \n \n \n \n \n \n `:"multiple"===e.mode?`\n \n \n \n \n ${e.image.map((l,t)=>{if(t<3)return``}).join("")}\n \n \n \n `:`\n \n \n \n \n `;let l={page:1,pageSize:window.Joe.PAGE_SIZE,type:"created"};const t=()=>{$(".joe_index__list .joe_list").html(""),$(".joe_load").show();let e=$('.joe_index__title-title .item[data-type="'+l.type+'"]'),t=$(".joe_index__title-title .line");e.addClass("active").siblings().removeClass("active"),t.css({left:e.position().left,width:e.width()})},a=()=>new Promise((t,a)=>{$(".joe_load").attr("loading",!0),$(".joe_load").html("loading..."),$(".joe_index__list .joe_list__loading").show(),$.ajax({url:Joe.BASE_API,type:"POST",dataType:"json",data:{routeType:"publish_list",page:l.page,pageSize:l.pageSize,type:l.type},success(l){if(0===l.data.length)return $(".joe_load").removeAttr("loading"),$(".joe_load").html("查看更多"),$(".joe_load").hide(),$(".joe_index__list .joe_list__loading").hide(),Qmsg.warning("没有更多内容了");l.data.forEach(l=>$(".joe_index__list .joe_list").append(e(l))),$(".joe_load").removeAttr("loading"),$(".joe_load").html("查看更多"),$(".joe_index__list .joe_list__loading").hide(),t(l.data.length>0?l.data.length-1:0)}})});t(),a(),$(".joe_index__title-title .item").on("click",async function(){$(this).attr("data-type")!==l.type&&(l={page:1,pageSize:window.Joe.PAGE_SIZE,type:$(this).attr("data-type")},t(),a())}),$(".joe_load").on("click",async function(){if($(this).attr("loading"))return;l.page++;let e=await a();e=$(".joe_index__list .joe_list .joe_list__item").length-e;const t=`.joe_index__list .joe_list .joe_list__item:nth-child(${e})`,n=$(t).offset().top-$(".joe_header").height();window.scrollTo({top:n-15,behavior:"smooth"})})}{const e=$(".joe_index__list").attr("data-wow");"off"!==e&&e&&new WOW({boxClass:"wow",animateClass:`animated ${e}`,offset:0,mobile:!0,live:!0,scrollContainer:null}).init()}});