You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
31 KiB
2 lines
31 KiB
import{j as r}from"./markdown-vendor-DnN-_XEd.js";import{r as o,a as M,u as K}from"./data-vendor-DOiUz3Tw.js";import{g as G,s as Y,f as fe,S as pe}from"./swiper-vendor-Bs-UmCJ7.js";/* empty css */import{u as me,c as ge,d as xe,o as he,e as ae,b as re,a as _e,g as ve,R as Z,f as J}from"./index-BF-Ici5R.js";import{c as be}from"./imageDragTransfer-INFPNSr-.js";import{a as Se}from"./react-vendor-B8OyfHW2.js";import"./arco-vendor-Cm-ntj-q.js";function ye({swiper:e,extendParams:n,on:a,emit:t,params:i}){e.autoplay={running:!1,paused:!1,timeLeft:0},n({autoplay:{enabled:!1,delay:3e3,waitForTransition:!0,disableOnInteraction:!1,stopOnLastSlide:!1,reverseDirection:!1,pauseOnMouseEnter:!1}});let d,m,x=i&&i.autoplay?i.autoplay.delay:3e3,l=i&&i.autoplay?i.autoplay.delay:3e3,s,f=new Date().getTime(),g,j,N,O,y,u;function c(b){!e||e.destroyed||!e.wrapperEl||b.target===e.wrapperEl&&(e.wrapperEl.removeEventListener("transitionend",c),!(u||b.detail&&b.detail.bySwiperTouchMove)&&D())}const E=()=>{if(e.destroyed||!e.autoplay.running)return;e.autoplay.paused?g=!0:g&&(l=s,g=!1);const b=e.autoplay.paused?s:f+l-new Date().getTime();e.autoplay.timeLeft=b,t("autoplayTimeLeft",b,b/x),m=requestAnimationFrame(()=>{E()})},h=()=>{let b;return e.virtual&&e.params.virtual.enabled?b=e.slides.find(I=>I.classList.contains("swiper-slide-active")):b=e.slides[e.activeIndex],b?parseInt(b.getAttribute("data-swiper-autoplay"),10):void 0},S=()=>{let b=e.params.autoplay.delay;const v=h();return!Number.isNaN(v)&&v>0&&(b=v),b},P=b=>{if(e.destroyed||!e.autoplay.running)return;cancelAnimationFrame(m),E();let v=b;typeof v>"u"&&(v=S(),x=v,l=v),s=v;const I=e.params.speed,H=()=>{!e||e.destroyed||(e.params.autoplay.reverseDirection?!e.isBeginning||e.params.loop||e.params.rewind?(e.slidePrev(I,!0,!0),t("autoplay")):e.params.autoplay.stopOnLastSlide||(e.slideTo(e.slides.length-1,I,!0,!0),t("autoplay")):!e.isEnd||e.params.loop||e.params.rewind?(e.slideNext(I,!0,!0),t("autoplay")):e.params.autoplay.stopOnLastSlide||(e.slideTo(0,I,!0,!0),t("autoplay")),e.params.cssMode&&(f=new Date().getTime(),requestAnimationFrame(()=>{P()})))};return v>0?(clearTimeout(d),d=setTimeout(()=>{H()},v)):requestAnimationFrame(()=>{H()}),v},T=()=>{f=new Date().getTime(),e.autoplay.running=!0,P(),t("autoplayStart")},L=()=>{e.autoplay.running=!1,clearTimeout(d),cancelAnimationFrame(m),t("autoplayStop")},p=(b,v)=>{if(e.destroyed||!e.autoplay.running)return;clearTimeout(d),b||(y=!0);const I=()=>{t("autoplayPause"),e.params.autoplay.waitForTransition?e.wrapperEl.addEventListener("transitionend",c):D()};if(e.autoplay.paused=!0,v){I();return}s=(s||e.params.autoplay.delay)-(new Date().getTime()-f),!(e.isEnd&&s<0&&!e.params.loop)&&(s<0&&(s=0),I())},D=()=>{e.isEnd&&s<0&&!e.params.loop||e.destroyed||!e.autoplay.running||(f=new Date().getTime(),y?(y=!1,P(s)):P(),e.autoplay.paused=!1,t("autoplayResume"))},_=()=>{if(e.destroyed||!e.autoplay.running)return;const b=G();b.visibilityState==="hidden"&&(y=!0,p(!0)),b.visibilityState==="visible"&&D()},R=b=>{b.pointerType==="mouse"&&(y=!0,u=!0,!(e.animating||e.autoplay.paused)&&p(!0))},C=b=>{b.pointerType==="mouse"&&(u=!1,e.autoplay.paused&&D())},F=()=>{e.params.autoplay.pauseOnMouseEnter&&(e.el.addEventListener("pointerenter",R),e.el.addEventListener("pointerleave",C))},B=()=>{e.el&&typeof e.el!="string"&&(e.el.removeEventListener("pointerenter",R),e.el.removeEventListener("pointerleave",C))},A=()=>{G().addEventListener("visibilitychange",_)},w=()=>{G().removeEventListener("visibilitychange",_)};a("init",()=>{e.params.autoplay.enabled&&(F(),A(),T())}),a("destroy",()=>{B(),w(),e.autoplay.running&&L()}),a("_freeModeStaticRelease",()=>{(N||y)&&D()}),a("_freeModeNoMomentumRelease",()=>{e.params.autoplay.disableOnInteraction?L():p(!0,!0)}),a("beforeTransitionStart",(b,v,I)=>{e.destroyed||!e.autoplay.running||(I||!e.params.autoplay.disableOnInteraction?p(!0,!0):L())}),a("sliderFirstMove",()=>{if(!(e.destroyed||!e.autoplay.running)){if(e.params.autoplay.disableOnInteraction){L();return}j=!0,N=!1,y=!1,O=setTimeout(()=>{y=!0,N=!0,p(!0)},200)}}),a("touchEnd",()=>{if(!(e.destroyed||!e.autoplay.running||!j)){if(clearTimeout(O),clearTimeout(d),e.params.autoplay.disableOnInteraction){N=!1,j=!1;return}N&&e.params.cssMode&&D(),N=!1,j=!1}}),a("slideChange",()=>{e.destroyed||!e.autoplay.running||e.autoplay.paused&&(s=S(),x=S())}),Object.assign(e.autoplay,{start:T,stop:L,pause:p,resume:D})}const ne=["eventsPrefix","injectStyles","injectStylesUrls","modules","init","_direction","oneWayMovement","swiperElementNodeName","touchEventsTarget","initialSlide","_speed","cssMode","updateOnWindowResize","resizeObserver","nested","focusableElements","_enabled","_width","_height","preventInteractionOnTransition","userAgent","url","_edgeSwipeDetection","_edgeSwipeThreshold","_freeMode","_autoHeight","setWrapperSize","virtualTranslate","_effect","breakpoints","breakpointsBase","_spaceBetween","_slidesPerView","maxBackfaceHiddenSlides","_grid","_slidesPerGroup","_slidesPerGroupSkip","_slidesPerGroupAuto","_centeredSlides","_centeredSlidesBounds","_slidesOffsetBefore","_slidesOffsetAfter","normalizeSlideIndex","_centerInsufficientSlides","_snapToSlideEdge","_watchOverflow","roundLengths","touchRatio","touchAngle","simulateTouch","_shortSwipes","_longSwipes","longSwipesRatio","longSwipesMs","_followFinger","allowTouchMove","_threshold","touchMoveStopPropagation","touchStartPreventDefault","touchStartForcePreventDefault","touchReleaseOnEdges","uniqueNavElements","_resistance","_resistanceRatio","_watchSlidesProgress","_grabCursor","preventClicks","preventClicksPropagation","_slideToClickedSlide","_loop","loopAdditionalSlides","loopAddBlankSlides","loopPreventsSliding","_rewind","_allowSlidePrev","_allowSlideNext","_swipeHandler","_noSwiping","noSwipingClass","noSwipingSelector","passiveListeners","containerModifierClass","slideClass","slideActiveClass","slideVisibleClass","slideFullyVisibleClass","slideNextClass","slidePrevClass","slideBlankClass","wrapperClass","lazyPreloaderClass","lazyPreloadPrevNext","runCallbacksOnInit","observer","observeParents","observeSlideChildren","a11y","_autoplay","_controller","coverflowEffect","cubeEffect","fadeEffect","flipEffect","creativeEffect","cardsEffect","hashNavigation","history","keyboard","mousewheel","_navigation","_pagination","parallax","_scrollbar","_thumbs","virtual","zoom","control"];function U(e){return typeof e=="object"&&e!==null&&e.constructor&&Object.prototype.toString.call(e).slice(8,-1)==="Object"&&!e.__swiper__}function $(e,n){const a=["__proto__","constructor","prototype"];Object.keys(n).filter(t=>a.indexOf(t)<0).forEach(t=>{typeof e[t]>"u"?e[t]=n[t]:U(n[t])&&U(e[t])&&Object.keys(n[t]).length>0?n[t].__swiper__?e[t]=n[t]:$(e[t],n[t]):e[t]=n[t]})}function le(e={}){return e.navigation&&typeof e.navigation.nextEl>"u"&&typeof e.navigation.prevEl>"u"}function se(e={}){return e.pagination&&typeof e.pagination.el>"u"}function oe(e={}){return e.scrollbar&&typeof e.scrollbar.el>"u"}function ie(e=""){const n=e.split(" ").map(t=>t.trim()).filter(t=>!!t),a=[];return n.forEach(t=>{a.indexOf(t)<0&&a.push(t)}),a.join(" ")}function Ce(e=""){return e?e.includes("swiper-wrapper")?e:`swiper-wrapper ${e}`:"swiper-wrapper"}function Ne({swiper:e,slides:n,passedParams:a,changedParams:t,nextEl:i,prevEl:d,scrollbarEl:m,paginationEl:x}){const l=t.filter(p=>p!=="children"&&p!=="direction"&&p!=="wrapperClass"),{params:s,pagination:f,navigation:g,scrollbar:j,virtual:N,thumbs:O}=e;let y,u,c,E,h,S,P,T;t.includes("thumbs")&&a.thumbs&&a.thumbs.swiper&&!a.thumbs.swiper.destroyed&&s.thumbs&&(!s.thumbs.swiper||s.thumbs.swiper.destroyed)&&(y=!0),t.includes("controller")&&a.controller&&a.controller.control&&s.controller&&!s.controller.control&&(u=!0),t.includes("pagination")&&a.pagination&&(a.pagination.el||x)&&(s.pagination||s.pagination===!1)&&f&&!f.el&&(c=!0),t.includes("scrollbar")&&a.scrollbar&&(a.scrollbar.el||m)&&(s.scrollbar||s.scrollbar===!1)&&j&&!j.el&&(E=!0),t.includes("navigation")&&a.navigation&&(a.navigation.prevEl||d)&&(a.navigation.nextEl||i)&&(s.navigation||s.navigation===!1)&&g&&!g.prevEl&&!g.nextEl&&(h=!0);const L=p=>{e[p]&&(e[p].destroy(),p==="navigation"?(e.isElement&&(e[p].prevEl.remove(),e[p].nextEl.remove()),s[p].prevEl=void 0,s[p].nextEl=void 0,e[p].prevEl=void 0,e[p].nextEl=void 0):(e.isElement&&e[p].el.remove(),s[p].el=void 0,e[p].el=void 0))};t.includes("loop")&&e.isElement&&(s.loop&&!a.loop?S=!0:!s.loop&&a.loop?P=!0:T=!0),l.forEach(p=>{if(U(s[p])&&U(a[p]))Object.assign(s[p],a[p]),(p==="navigation"||p==="pagination"||p==="scrollbar")&&"enabled"in a[p]&&!a[p].enabled&&L(p);else{const D=a[p];(D===!0||D===!1)&&(p==="navigation"||p==="pagination"||p==="scrollbar")?D===!1&&L(p):s[p]=a[p]}}),l.includes("controller")&&!u&&e.controller&&e.controller.control&&s.controller&&s.controller.control&&(e.controller.control=s.controller.control),t.includes("children")&&n&&N&&s.virtual.enabled?(N.slides=n,N.update(!0)):t.includes("virtual")&&N&&s.virtual.enabled&&(n&&(N.slides=n),N.update(!0)),t.includes("children")&&n&&s.loop&&(T=!0),y&&O.init()&&O.update(!0),u&&(e.controller.control=s.controller.control),c&&(e.isElement&&(!x||typeof x=="string")&&(x=document.createElement("div"),x.classList.add("swiper-pagination"),x.part.add("pagination"),e.el.appendChild(x)),x&&(s.pagination.el=x),f.init(),f.render(),f.update()),E&&(e.isElement&&(!m||typeof m=="string")&&(m=document.createElement("div"),m.classList.add("swiper-scrollbar"),m.part.add("scrollbar"),e.el.appendChild(m)),m&&(s.scrollbar.el=m),j.init(),j.updateSize(),j.setTranslate()),h&&(e.isElement&&((!i||typeof i=="string")&&(i=document.createElement("div"),i.classList.add("swiper-button-next"),Y(i,e.navigation.arrowSvg),i.part.add("button-next"),e.el.appendChild(i)),(!d||typeof d=="string")&&(d=document.createElement("div"),d.classList.add("swiper-button-prev"),Y(d,e.navigation.arrowSvg),d.part.add("button-prev"),e.el.appendChild(d))),i&&(s.navigation.nextEl=i),d&&(s.navigation.prevEl=d),g.init(),g.update()),t.includes("allowSlideNext")&&(e.allowSlideNext=a.allowSlideNext),t.includes("allowSlidePrev")&&(e.allowSlidePrev=a.allowSlidePrev),t.includes("direction")&&e.changeDirection(a.direction,!1),(S||T)&&e.loopDestroy(),(P||T)&&e.loopCreate(),e.update()}function Ee(e={},n=!0){const a={on:{}},t={},i={};$(a,fe),a._emitClasses=!0,a.init=!1;const d={},m=ne.map(l=>l.replace(/_/,"")),x=Object.assign({},e);return Object.keys(x).forEach(l=>{typeof e[l]>"u"||(m.indexOf(l)>=0?U(e[l])?(a[l]={},i[l]={},$(a[l],e[l]),$(i[l],e[l])):(a[l]=e[l],i[l]=e[l]):l.search(/on[A-Z]/)===0&&typeof e[l]=="function"?n?t[`${l[2].toLowerCase()}${l.substr(3)}`]=e[l]:a.on[`${l[2].toLowerCase()}${l.substr(3)}`]=e[l]:d[l]=e[l])}),["navigation","pagination","scrollbar"].forEach(l=>{a[l]===!0&&(a[l]={}),a[l]===!1&&delete a[l]}),{params:a,passedParams:i,rest:d,events:t}}function je({el:e,nextEl:n,prevEl:a,paginationEl:t,scrollbarEl:i,swiper:d},m){le(m)&&n&&a&&(d.params.navigation.nextEl=n,d.originalParams.navigation.nextEl=n,d.params.navigation.prevEl=a,d.originalParams.navigation.prevEl=a),se(m)&&t&&(d.params.pagination.el=t,d.originalParams.pagination.el=t),oe(m)&&i&&(d.params.scrollbar.el=i,d.originalParams.scrollbar.el=i),d.init(e)}function Pe(e,n,a,t,i){const d=[];if(!n)return d;const m=l=>{d.indexOf(l)<0&&d.push(l)};if(a&&t){const l=t.map(i),s=a.map(i);l.join("")!==s.join("")&&m("children"),t.length!==a.length&&m("children")}return ne.filter(l=>l[0]==="_").map(l=>l.replace(/_/,"")).forEach(l=>{if(l in e&&l in n)if(U(e[l])&&U(n[l])){const s=Object.keys(e[l]),f=Object.keys(n[l]);s.length!==f.length?m(l):(s.forEach(g=>{e[l][g]!==n[l][g]&&m(l)}),f.forEach(g=>{e[l][g]!==n[l][g]&&m(l)}))}else e[l]!==n[l]&&m(l)}),d}const Te=e=>{!e||e.destroyed||!e.params.virtual||e.params.virtual&&!e.params.virtual.enabled||(e.updateSlides(),e.updateProgress(),e.updateSlidesClasses(),e.emit("_virtualUpdated"),e.parallax&&e.params.parallax&&e.params.parallax.enabled&&e.parallax.setTranslate())};function V(){return V=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var t in a)Object.prototype.hasOwnProperty.call(a,t)&&(e[t]=a[t])}return e},V.apply(this,arguments)}function ce(e){return e.type&&e.type.displayName&&e.type.displayName.includes("SwiperSlide")}function de(e){const n=[];return M.Children.toArray(e).forEach(a=>{ce(a)?n.push(a):a.props&&a.props.children&&de(a.props.children).forEach(t=>n.push(t))}),n}function Le(e){const n=[],a={"container-start":[],"container-end":[],"wrapper-start":[],"wrapper-end":[]};return M.Children.toArray(e).forEach(t=>{if(ce(t))n.push(t);else if(t.props&&t.props.slot&&a[t.props.slot])a[t.props.slot].push(t);else if(t.props&&t.props.children){const i=de(t.props.children);i.length>0?i.forEach(d=>n.push(d)):a["container-end"].push(t)}else a["container-end"].push(t)}),{slides:n,slots:a}}function Re(e,n,a){if(!a)return null;const t=f=>{let g=f;return f<0?g=n.length+f:g>=n.length&&(g=g-n.length),g},i=e.isHorizontal()?{[e.rtlTranslate?"right":"left"]:`${a.offset}px`}:{top:`${a.offset}px`},{from:d,to:m}=a,x=e.params.loop?-n.length:0,l=e.params.loop?n.length*2:n.length,s=[];for(let f=x;f<l;f+=1)f>=d&&f<=m&&s.push(n[t(f)]);return s.map((f,g)=>M.cloneElement(f,{swiper:e,style:i,key:f.props.virtualIndex||f.key||`slide-${g}`}))}function q(e,n){return typeof window>"u"?o.useEffect(e,n):o.useLayoutEffect(e,n)}const k=o.createContext(null),Ie=o.createContext(null),ue=o.forwardRef(({className:e,tag:n="div",wrapperTag:a="div",children:t,onSwiper:i,...d}={},m)=>{let x=!1;const[l,s]=o.useState("swiper"),[f,g]=o.useState(null),[j,N]=o.useState(!1),O=o.useRef(!1),y=o.useRef(null),u=o.useRef(null),c=o.useRef(null),E=o.useRef(null),h=o.useRef(null),S=o.useRef(null),P=o.useRef(null),T=o.useRef(null),{params:L,passedParams:p,rest:D,events:_}=Ee(d),{slides:R,slots:C}=Le(t),F=()=>{N(!j)};Object.assign(L.on,{_containerClasses(v,I){s(I)}});const B=()=>{Object.assign(L.on,_),x=!0;const v={...L};if(delete v.wrapperClass,u.current=new pe(v),u.current.virtual&&u.current.params.virtual.enabled){u.current.virtual.slides=R;const I={cache:!1,slides:R,renderExternal:g,renderExternalUpdate:!1};$(u.current.params.virtual,I),$(u.current.originalParams.virtual,I)}};y.current||B(),u.current&&u.current.on("_beforeBreakpoint",F);const A=()=>{x||!_||!u.current||Object.keys(_).forEach(v=>{u.current.on(v,_[v])})},w=()=>{!_||!u.current||Object.keys(_).forEach(v=>{u.current.off(v,_[v])})};o.useEffect(()=>()=>{u.current&&u.current.off("_beforeBreakpoint",F)}),o.useEffect(()=>{!O.current&&u.current&&(u.current.emitSlidesClasses(),O.current=!0)}),q(()=>{if(m&&(m.current=y.current),!!y.current)return u.current.destroyed&&B(),je({el:y.current,nextEl:h.current,prevEl:S.current,paginationEl:P.current,scrollbarEl:T.current,swiper:u.current},L),i&&!u.current.destroyed&&i(u.current),()=>{u.current&&!u.current.destroyed&&u.current.destroy(!0,!1)}},[]),q(()=>{A();const v=Pe(p,c.current,R,E.current,I=>I.key);return c.current=p,E.current=R,v.length&&u.current&&!u.current.destroyed&&Ne({swiper:u.current,slides:R,passedParams:p,changedParams:v,nextEl:h.current,prevEl:S.current,scrollbarEl:T.current,paginationEl:P.current}),()=>{w()}}),q(()=>{Te(u.current)},[f]);function b(){return L.virtual?Re(u.current,R,f):R.map((v,I)=>M.cloneElement(v,{swiper:u.current,swiperSlideIndex:I}))}return M.createElement(n,V({ref:y,className:ie(`${l}${e?` ${e}`:""}`)},D),M.createElement(Ie.Provider,{value:u.current},C["container-start"],M.createElement(a,{className:Ce(L.wrapperClass)},C["wrapper-start"],b(),C["wrapper-end"]),le(L)&&M.createElement(M.Fragment,null,M.createElement("div",{ref:S,className:"swiper-button-prev"}),M.createElement("div",{ref:h,className:"swiper-button-next"})),oe(L)&&M.createElement("div",{ref:T,className:"swiper-scrollbar"}),se(L)&&M.createElement("div",{ref:P,className:"swiper-pagination"}),C["container-end"]))});ue.displayName="Swiper";const W=o.forwardRef(({tag:e="div",children:n,className:a="",swiper:t,zoom:i,lazy:d,virtualIndex:m,swiperSlideIndex:x,...l}={},s)=>{const f=o.useRef(null),[g,j]=o.useState("swiper-slide"),[N,O]=o.useState(!1);function y(h,S,P){S===f.current&&j(P)}q(()=>{if(typeof x<"u"&&(f.current.swiperSlideIndex=x),s&&(s.current=f.current),!(!f.current||!t)){if(t.destroyed){g!=="swiper-slide"&&j("swiper-slide");return}return t.on("_slideClass",y),()=>{t&&t.off("_slideClass",y)}}}),q(()=>{t&&f.current&&!t.destroyed&&j(t.getSlideClasses(f.current))},[t]);const u={isActive:g.indexOf("swiper-slide-active")>=0,isVisible:g.indexOf("swiper-slide-visible")>=0,isPrev:g.indexOf("swiper-slide-prev")>=0,isNext:g.indexOf("swiper-slide-next")>=0},c=()=>typeof n=="function"?n(u):n,E=()=>{O(!0)};return M.createElement(e,V({ref:f,className:ie(`${g}${a?` ${a}`:""}`),"data-swiper-slide-index":m,onLoad:E},l),i&&M.createElement(k.Provider,{value:u},M.createElement("div",{className:"swiper-zoom-container","data-swiper-zoom":typeof i=="number"?i:void 0},c(),d&&!N&&M.createElement("div",{className:"swiper-lazy-preloader",ref:h=>{h&&(h.lazyPreloaderManaged=!0)}}))),!i&&M.createElement(k.Provider,{value:u},c(),d&&!N&&M.createElement("div",{className:"swiper-lazy-preloader",ref:h=>{h&&(h.lazyPreloaderManaged=!0)}})))});W.displayName="SwiperSlide";const Q=100;function X(e){return e<=400?1:e<=720?2:e<=1080?3:e<=1360?4:e<=1680?5:6}function ee(e){const a=e.type===2?e.cover:e.images?.[0];return typeof a=="string"?a:""}function z(e){const n=Number(e);return Number.isFinite(n)&&n>0?n:void 0}function Me(e){const n=e,a=z(n.width)??z(n.imageWidth)??z(n.coverWidth),t=z(n.height)??z(n.imageHeight)??z(n.coverHeight);return a!=null&&t!=null?t/a:e.type===2?1.2:1.55}function Oe(e,n){const a=Math.max(1,n),t=Array.from({length:a},()=>[]),i=Array.from({length:a},()=>0);for(const d of e){let m=0;for(let x=1;x<a;x+=1)i[x]<i[m]&&(m=x);t[m].push(d),i[m]+=Me(d.post)}return t}function De(e){let n=e?.parentElement??null;for(;n!=null;){const t=window.getComputedStyle(n).overflowY;if((t==="auto"||t==="scroll")&&n.scrollHeight>n.clientHeight)return n;n=n.parentElement}return null}function Ae(){const{t:e}=K(),n=me(_=>_.requestMakeSame),a=ge(_=>_.requestMakeSame),[t,i]=o.useState([]),[d,m]=o.useState(1),[x,l]=o.useState(!0),[s,f]=o.useState(!1),[g,j]=o.useState(!1),[N,O]=o.useState(null),[y,u]=o.useState(()=>typeof window>"u"?6:X(window.innerWidth)),c=o.useRef(!1),E=o.useRef(null),h=o.useRef(!1),S=o.useRef(new Set),P=o.useCallback(async(_,R)=>{if(!(R&&(h.current||S.current.has(_)))){R&&(h.current=!0),R?j(!0):(S.current.clear(),f(!0)),O(null);try{const C=await xe({page:_,pageSize:Q}),F=Array.isArray(C?.data?.list)?C.data.list:[],B=F.map((A,w)=>({key:`${String(A.id??"p")}-${_}-${w}`,post:A})).filter(({post:A})=>ee(A)!=="");i(A=>{if(!R)return B;const w=new Set(A.map(v=>v.key)),b=B.filter(v=>!w.has(v.key));return b.length===0?A:[...A,...b]}),l(F.length>=Q),m(_),S.current.add(_)}catch(C){const F=C instanceof Error?C.message:e("pages.explore.feed.loadFailed");O(F),R||i([]),l(!1)}finally{R?(h.current=!1,j(!1)):f(!1)}}},[e]);o.useEffect(()=>{c.current||(c.current=!0,P(1,!1))},[P]),o.useEffect(()=>{const _=()=>{u(X(window.innerWidth))};return window.addEventListener("resize",_),()=>{window.removeEventListener("resize",_)}},[]);const T=s||g,L=Oe(t,y);o.useEffect(()=>{if(!x||T)return;const _=E.current;if(_==null)return;const R=De(_),C=new IntersectionObserver(F=>{F.some(B=>B.isIntersecting)&&(h.current||P(d+1,!0))},{root:R,rootMargin:"1040px 0px",threshold:0});return C.observe(_),()=>C.disconnect()},[x,T,d,P]);const p=o.useCallback(_=>{he({assetId:_.id})},[]),D=o.useCallback(_=>{if(!(_.id==null||_.id==="")){if(_.type==4){a(_.id);return}n(_.id)}},[n,a]);return r.jsxs("div",{className:"explorePage__feedPanel",id:"explore-feed-panel-explore",role:"tabpanel","aria-labelledby":"explore-feed-tab-explore",children:[N!=null?r.jsx("p",{className:"explorePage__feedError",role:"alert",children:N}):null,s&&t.length===0?r.jsx("p",{className:"explorePage__feedLoading",children:e("common.loading")}):null,r.jsx("div",{className:"explorePage__feedGrid explorePage__feedGrid--masonry",children:L.map((_,R)=>r.jsx("div",{className:"explorePage__feedMasonryColumn",children:_.map(({post:C,key:F})=>{C.type;const B=ee(C);return r.jsxs("article",{className:"explorePage__feedCard",onClick:()=>p(C),children:[r.jsx("div",{className:"explorePage__feedCardMedia",children:r.jsx("img",{src:B,alt:"",loading:"lazy",decoding:"async"})}),r.jsxs("div",{className:"explorePage__feedCardBottom",children:[r.jsxs("div",{className:"explorePage__feedCardFooter explorePage__feedCardFooter--video",children:[r.jsxs("div",{className:"explorePage__feedCardUser",children:[r.jsx("div",{className:"explorePage__feedCardAvatar",children:C.userAvatar?r.jsx("img",{src:C.userAvatar,alt:""}):r.jsx("span",{className:"explorePage__feedCardAvatarPh","aria-hidden":!0})}),r.jsx("span",{className:"explorePage__feedCardName",children:C.userName})]}),r.jsxs("div",{className:"explorePage__feedCardStats",children:[r.jsxs("span",{className:"explorePage__feedCardStat",children:[r.jsx("img",{className:"explorePage__feedStatIcon",src:new URL("/assets/ic_look-B3mblBMS.png",import.meta.url).href,alt:""}),r.jsx("span",{className:"explorePage__feedCardStatNum",children:C.lookNum})]}),r.jsxs("span",{className:"explorePage__feedCardStat",children:[C.userLiked?r.jsx("img",{className:"explorePage__feedStatIcon",src:new URL("/assets/ic_like_active-C1GDW4GU.png",import.meta.url).href,alt:""}):r.jsx("img",{className:"explorePage__feedStatIcon",src:new URL("/assets/ic_like_white-DdFasbWY.png",import.meta.url).href,alt:""}),r.jsx("span",{className:"explorePage__feedCardStatNum",children:C.likeNum})]})]})]}),r.jsx("div",{className:"explorePage__feedCardCta",role:"presentation",onClick:A=>{A.stopPropagation(),A.preventDefault(),D(C)},children:e("pages.assetDetails.makeSame")})]})]},F)})},`col-${R}`))}),x&&t.length>0?r.jsx("div",{className:"explorePage__feedSentinel",ref:E,"aria-hidden":!0}):null,g?r.jsx("p",{className:"explorePage__feedLoading explorePage__feedLoading--more",children:e("pages.explore.feed.loadingMore")}):null]})}const te=50;function Fe(){const{t:e}=K(),n=ae(h=>h.requestTemplateSelect),[a,t]=o.useState([]),[i,d]=o.useState(1),[m,x]=o.useState(!0),[l,s]=o.useState(!1),[f,g]=o.useState(!1),[j,N]=o.useState(null),O=o.useRef(!1),y=o.useRef(null),u=o.useCallback(async(h,S)=>{S?g(!0):s(!0),N(null);try{const T=(await re({page:h,pageSize:te}))?.data?.list??[];t(L=>S?[...L,...T]:T),x(T.length>=te),d(h)}catch(P){const T=P instanceof Error?P.message:e("pages.explore.feed.loadFailed");N(T),S||t([]),x(!1)}finally{S?g(!1):s(!1)}},[e]);o.useEffect(()=>{O.current||(O.current=!0,u(1,!1))},[u]);const c=l||f,E=o.useCallback(h=>{const S=h?.id;S==null||S===""||n(S)},[n]);return o.useEffect(()=>{if(!m||c)return;const h=y.current;if(h==null)return;const S=new IntersectionObserver(P=>{P.some(T=>T.isIntersecting)&&u(i+1,!0)},{root:null,rootMargin:"240px",threshold:0});return S.observe(h),()=>S.disconnect()},[m,c,i,u]),r.jsxs("div",{className:"explorePage__feedPanel",id:"explore-feed-panel-template",role:"tabpanel","aria-labelledby":"explore-feed-tab-template",children:[j!=null?r.jsx("p",{className:"explorePage__feedError",role:"alert",children:j}):null,l&&a.length===0?r.jsx("p",{className:"explorePage__feedLoading",children:e("common.loading")}):null,r.jsx("div",{className:"explorePage__feedGrid",children:a.map(h=>r.jsxs("article",{className:"explorePage__tplCard",children:[r.jsx("div",{className:"explorePage__tplCardMedia",children:r.jsx("img",{src:h.coverUrl,alt:h.title,loading:"lazy",decoding:"async"})}),r.jsxs("div",{className:"explorePage__tplCardOverlay",children:[r.jsxs("div",{className:"explorePage__tplCardChip",children:[r.jsx("img",{className:"explorePage__tplCardChipIcon",src:new URL("/assets/ic_template_chip-CWZEuWV8.png",import.meta.url).href,alt:"",width:12,height:12}),r.jsx("p",{className:"explorePage__tplCardChipText",children:h.title})]}),r.jsx("div",{className:"explorePage__tplCardCtaRow",children:r.jsx("div",{className:"explorePage__tplCardCta",role:"button",tabIndex:0,onClick:()=>E(h),onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),E(h))},children:e("pages.create.inspiration.templateLibrary.useTemplate")})})]})]},h.id))}),m&&a.length>0?r.jsx("div",{className:"explorePage__feedSentinel",ref:y,"aria-hidden":!0}):null,f?r.jsx("p",{className:"explorePage__feedLoading explorePage__feedLoading--more",children:e("pages.explore.feed.loadingMore")}):null]})}function Ge(){const{t:e}=K(),n=ae(c=>c.requestTemplateSelect),a=Se(),[t,i]=o.useState([]),[d,m]=o.useState([]),[x,l]=o.useState("template"),[s,f]=o.useState(""),g=o.useMemo(()=>be(),[]);o.useEffect(()=>{_e({type:1,page:1,pageSize:9}).then(c=>{const E=c?.data?.list??c?.list??[];i(E.slice(0,9))}).catch(()=>{i([])})},[]),o.useEffect(()=>{re({page:1,pageSize:3}).then(c=>{m((c?.data?.list??[]).slice(0,3))}).catch(()=>{m([])})},[]),o.useEffect(()=>{ve().then(c=>{f(c?.systemConfig?.usageTutorialPageUrl??"")}).catch(()=>{f("")})},[]),o.useEffect(()=>{g.warmupPreviewImages(t.map(c=>c?.threeViewImage??c?.threeView))},[g,t]),o.useEffect(()=>()=>{g.dispose()},[g]);const j=t.slice(0,4),N=t.slice(4,9),O=()=>{l("explore"),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.getElementById("explore-feed-panel-explore")?.scrollIntoView({behavior:"smooth",block:"start"})})})},y=()=>{l("template"),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.getElementById("explore-feed-panel-template")?.scrollIntoView({behavior:"smooth",block:"start"})})})},u=(c,E)=>{g.startImageDrag({evt:c,dragUrl:E,previewUrl:E})};return r.jsxs("div",{className:"explorePage",children:[r.jsx("section",{className:"explorePage__hero",children:r.jsxs(ue,{className:"explorePage__heroSwiper",modules:[ye],slidesPerView:1,loop:!0,autoplay:{delay:1e5,disableOnInteraction:!1},children:[r.jsx(W,{className:"explorePage__heroSlide",children:r.jsxs("div",{className:"heroSlideItem1",style:{backgroundImage:`url(${new URL("/assets/hero-image1-CKYMumeE.png",import.meta.url).href})`},children:[r.jsx("img",{className:"heroSlideItem1Icon",src:new URL("/assets/heroTitleIcon1-BJUREaJu.png",import.meta.url).href,alt:""}),r.jsx("p",{className:"heroSlideItem1Desc",children:e("pages.explore.hero.banner1Desc")}),r.jsx("button",{className:"heroSlideItem1Btn",type:"button",onClick:()=>{s&&window.open(s,"_blank")},children:e("pages.explore.hero.watchTutorial")})]})}),r.jsx(W,{className:"explorePage__heroSlide",children:r.jsxs("div",{className:"heroSlideItem2",style:{backgroundImage:`url(${new URL("/assets/hero-image2-CxuiT-yq.png",import.meta.url).href})`},children:[r.jsx("img",{className:"heroSlideItem2Icon",src:new URL("/assets/heroTitleIcon2-CLoPUkJh.png",import.meta.url).href,alt:""}),r.jsx("p",{className:"heroSlideItem2Desc",children:e("pages.explore.hero.banner2Desc")}),r.jsx("div",{className:"flex items-center gap-5",children:r.jsx("button",{className:"heroSlideItem2Btn",type:"button",onClick:()=>{a(Z.CHARACTERS_CREATE)},children:e("index.hero.cta_create")})})]})})]})}),r.jsxs("section",{className:"explorePage__content",children:[r.jsxs("div",{className:"explorePage__leftColumn",children:[r.jsxs("div",{className:"explorePage__sectionHeader",children:[r.jsx("h2",{className:"explorePage__sectionTitle",children:e("pages.explore.sections.officialRoles")}),r.jsx("button",{className:"explorePage__moreBtn",type:"button",onClick:()=>a(Z.CHARACTERS),children:e("index.explore_more")})]}),r.jsxs("div",{className:"explorePage__officialTop",children:[r.jsx("article",{className:"explorePage__officialMainCard",children:r.jsx("img",{src:new URL("/assets/official-main-card-cBbbpmco.png",import.meta.url).href,alt:"",draggable:"true"})}),r.jsx("div",{className:"explorePage__officialTopGrid",children:j.map((c,E)=>r.jsxs("article",{className:"explorePage__roleCard",draggable:!0,onMouseEnter:()=>{g.ensurePreviewImage(c.threeViewImage)},onDragStart:h=>{u(h,c.threeViewImage)},onClick:()=>{J({id:c.id})},children:[r.jsx("img",{src:c.avatar,alt:"",draggable:!1}),r.jsx("div",{className:"explorePage__roleTag",title:c.title,children:c.title})]},c?.id??`top-${E}`))})]}),r.jsx("div",{className:"explorePage__officialBottomGrid",children:N.map((c,E)=>r.jsxs("article",{className:"explorePage__roleCard",draggable:!0,onMouseEnter:()=>{g.ensurePreviewImage(c.threeViewImage)},onDragStart:h=>{u(h,c.threeViewImage)},onClick:()=>{J({id:c.id})},children:[r.jsx("img",{src:c.avatar,alt:"",draggable:!1}),r.jsx("div",{className:"explorePage__roleTag",title:c.title,children:c.title})]},c?.id??`bottom-${E}`))})]}),r.jsxs("div",{className:"explorePage__rightColumn",children:[r.jsxs("div",{className:"explorePage__bannerGrid",children:[r.jsxs("section",{className:"explorePage__bannerGroup",children:[r.jsx("h2",{className:"explorePage__sectionTitle",children:e("pages.explore.sections.diyRole")}),r.jsx("article",{className:"explorePage__bannerCard",children:r.jsx("img",{src:new URL("/assets/diy-role-card-BoNp16Az.png",import.meta.url).href,alt:""})})]}),r.jsxs("section",{className:"explorePage__bannerGroup",children:[r.jsx("h2",{className:"explorePage__sectionTitle",children:e("pages.explore.sections.socialCases")}),r.jsx("article",{className:"explorePage__bannerCard",onClick:O,children:r.jsx("img",{src:new URL("/assets/social-media-card-CKmno838.png",import.meta.url).href,alt:""})})]})]}),r.jsxs("div",{className:"explorePage__sectionHeader explorePage__sectionHeader--templates",children:[r.jsx("h2",{className:"explorePage__sectionTitle",children:e("index.ai_template_section.title")}),r.jsx("button",{className:"explorePage__moreBtn",type:"button",onClick:y,children:e("index.explore_more")})]}),r.jsx("div",{className:"explorePage__templateList",children:d.map(c=>r.jsxs("article",{className:"explorePage__templateCard",children:[r.jsx("img",{className:"explorePage__templateThumb",src:c.coverUrl,alt:c.title}),r.jsxs("div",{className:"explorePage__templateBody",children:[r.jsx("h3",{className:"explorePage__templateTitle",children:c.title}),r.jsx("p",{className:"explorePage__templateDesc",title:c.desp,children:c.desp})]}),r.jsx("button",{className:"explorePage__templateAction",type:"button",onClick:()=>{n(c.id)},children:e("pages.explore.feed.makeNow")})]},c.id))})]})]}),r.jsxs("section",{className:"explorePage__feed","aria-label":e("pages.explore.feed.ariaSquare"),children:[r.jsxs("div",{className:"explorePage__feedTabs",role:"tablist",children:[r.jsx("button",{type:"button",role:"tab",id:"explore-feed-tab-template","aria-selected":x==="template","aria-controls":"explore-feed-panel-template",className:`explorePage__feedTab ${x==="template"?"explorePage__feedTab--active":""}`,onClick:()=>l("template"),children:e("pages.create.filters.template")}),r.jsx("button",{type:"button",role:"tab",id:"explore-feed-tab-explore","aria-selected":x==="explore","aria-controls":"explore-feed-panel-explore",className:`explorePage__feedTab ${x==="explore"?"explorePage__feedTab--active":""}`,onClick:()=>l("explore"),children:e("layout.nav.explore")})]}),r.jsxs("div",{className:"explorePage__feedTabPanels",children:[r.jsx("div",{className:"explorePage__feedTabPanel",hidden:x!=="explore",children:r.jsx(Ae,{})}),r.jsx("div",{className:"explorePage__feedTabPanel",hidden:x!=="template",children:r.jsx(Fe,{})})]})]})]})}export{Ge as default};
|
|
//# sourceMappingURL=index-CjjMkrpu.js.map
|
|
|