1import{r,T as y,j as e,Q as b,u as R,M as w,af as q}from"./vendor-Bw6D6moC.js";import{X as d,Y as B,h as j,B as f,o as p,Z as V,_ as k}from"./index-rPOepWfB.js";import{N as L}from"./index-DC6EzApR.js";import{f as M,a0 as G}from"./react-vendor-CwBzAdwS.js";import{f as $}from"./Math-D7fIj1XS.js";const I=(t,_)=>{const[c,h]=r.useState(!1),a=r.useRef(null),n=r.useRef(null),l=o=>{const[m]=o;h(m.isIntersecting)};return r.useEffect(()=>{const o=new IntersectionObserver(l,t);return a.current&&o.observe(a.current),()=>{a.current&&o.unobserve(a.current)}},[_]),{isVisible:c,observedRef:a,mobileCreateBtnWrapperRef:n}},W="_container_aq48h_246",P="_imageContainer_aq48h_261",z="_image_aq48h_261",O="_contentContainer_aq48h_276",Y="_info_aq48h_282",H="_title_aq48h_287",U="_des_aq48h_297",Z="_access_aq48h_311",F="_views_aq48h_318",Q="_tag_aq48h_328",s={container:W,imageContainer:P,image:z,contentContainer:O,info:Y,title:H,des:U,access:Z,views:F,tag:Q},N=({children:t})=>e.jsx("div",{className:s.tag,children:t}),X=({agentId:t,agentName:_,agentImageUrl:c,description:h,tokenName:a,mission:n,viewCount:l,isLoading:o})=>{const{pathname:m}=y();if(o)return e.jsx(D,{});const A=m.includes(d.MY_AI_AGENTS);return e.jsxs(b,{to:A?d.MY_AI_AGENT(t==null?void 0:t.toString()):d.AI_AGENT(t==null?void 0:t.toString()),className:s.container,children:[e.jsx("div",{className:s.imageContainer,children:e.jsx(B,{src:c,className:s.image})}),e.jsxs("div",{className:s.contentContainer,children:[e.jsxs("div",{className:s.info,children:[e.jsx("span",{className:s.title,children:_}),e.jsx("div",{className:s.des,children:h})]}),e.jsxs("div",{className:s.access,children:[a&&e.jsx(N,{children:e.jsxs("span",{children:["$",a]})}),(n==null?void 0:n.x)&&e.jsx(N,{children:e.jsx(M,{})}),(n==null?void 0:n.tiktok)&&e.jsx(N,{children:e.jsx(G,{})})]}),e.jsxs("div",{className:s.views,children:[$(l)," views"]})]})]})},D=()=>e.jsxs("div",{className:s.container,children:[e.jsx("div",{className:s.imageContainer,children:e.jsx(j,{className:s.image})}),e.jsxs("div",{className:s.contentContainer,children:[e.jsxs("div",{className:s.info,children:[e.jsx("span",{className:s.title,children:e.jsx(j,{height:24})}),e.jsx("div",{className:s.des,children:e.jsx(j,{height:16,width:"50%"})})]}),e.jsx("div",{className:s.access})]})]}),J="_container_1e0b9_246",K="_top_1e0b9_249",ee="_titleContainer_1e0b9_256",se="_title_1e0b9_256",te="_subTitle_1e0b9_268",ae="_list_1e0b9_279",ne="_disabled_1e0b9_285",ie="_mobileCreateBtnWrapper_1e0b9_289",re="_isVisible_1e0b9_344",i={container:J,top:K,titleContainer:ee,title:se,subTitle:te,list:ae,disabled:ne,mobileCreateBtnWrapper:ie,isVisible:re},v=20,he=()=>{const{t}=R(),_=w(),[c,h]=r.useState(!1),[a,n]=r.useState([]),[l,o]=r.useState(1),[m,A]=r.useState(!1),{isVisible:C,observedRef:T,mobileCreateBtnWrapperRef:E}=I({root:null,rootMargin:"0px",threshold:1});return r.useEffect(()=>{(async()=>{l===1&&h(!0);try{const x={pageNum:l,pageSize:v,scope:"user"},u=await k.getAiAgentList(x);n(S=>l===1?u.data.list:[...S,...u.data.list]),A(u.data.list.length===v)}catch(x){console.error("Error:",x)}finally{h(!1)}})()},[l]),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:i.container,children:[e.jsxs("div",{className:i.top,children:[e.jsxs("div",{className:i.titleContainer,children:[e.jsx("div",{className:i.title,children:t("page.myAiAgents.title")}),e.jsx("div",{className:i.subTitle,children:t("page.myAiAgents.subTitle")})]}),e.jsx(b,{to:d.CREATE_AI_AGENTS,onClick:()=>_(d.CREATE_AI_AGENTS),className:a.length?i.disabled:"",children:e.jsx(f,{size:p.S,disabled:!!a.length,children:t("page.myAiAgents.createAiAgent")})})]}),!c&&a.length===0?e.jsx(L,{title:t("page.aiAgents.noResult")}):e.jsx(q,{style:{overflow:"visible"},dataLength:a.length,next:()=>o(g=>g+1),hasMore:m,loader:e.jsx(V,{}),children:e.jsx("div",{className:i.list,children:(c?Array(6).fill(null):a).map((g,x)=>r.createElement(X,{...g||{},key:c?`skeleton-${x}`:g.agentId,isLoading:c}))})})]}),e.jsx("div",{ref:T}),e.jsx("div",{className:`${i.mobileCreateBtnWrapper} ${C?i.isVisible:""}`,ref:E,children:e.jsx(b,{to:d.CREATE_AI_AGENTS,onClick:()=>_(d.CREATE_AI_AGENTS),className:a.length?i.disabled:"",children:e.jsx(f,{size:p.S,disabled:!!a.length,children:t("page.myAiAgents.createAiAgent")})})})]})};export{he as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.