PageSourceSearch

https://vapps-res.media.io/mediaai/_nuxt/search-DRdmDhgI.js

js media.io collected 2026-09-24 08:53:40 UTC 5,345 bytes, 1 lines download raw bytes

1import{Y as M,i as G,a as J,R as U,b as q,a1 as Q,c3 as Y,aQ as K,bf as X,d4 as Z,t as V,E as L,aB as I,d5 as ee,_ as ae,W as te}from"./BuQWImh-.js";import{C as re}from"./CustomWaterfall-BTfGr7tL.js";import oe from"./ReportDialog-Bm9dkCi7.js";import{S as se}from"./SampleItem-BYYs5A6L.js";import{s as w}from"./chunk-pinia-DfnRCC0j.js";import{d as B,r as p,j as ne,o as le,a as ie,w as P,y as k,z as n,A as m,B as _,J as T,f as g,L as u,D as r,R as b,E as ue}from"./chunk-vue-TRwxe8i9.js";import{H as ce}from"./HomeSkeleton-DUsdHZX0.js";import"./chunk-i18n-CEBPY5W3.js";import"./chunk-alioss-Co3x7qJ6.js";import"./chunk-fabric-NyCWrAO1.js";import"./color-thief-DF3QbzqH.js";import"./Like-CQZ7VGOE.js";import"./MoreButton-D31AFFjM.js";const pe={key:1,class:"w-full flex items-center gap-3"},me={class:"text-end"},_e={key:2,class:"h-8"},de=B({__name:"ExploreSearch",setup(D){M();const i=p(!1),c=p(null),s=G(),{isLogin:R}=w(J()),$=p(U.all),y=q(),{showReportDialogData:z,zoneList:N,triggerFrom:A,exploreSearch:l}=w(y),o=p({loading:!1,total:10,children:[]}),S=ne({itemGap:8,breakPoint:{2272:{rowPerView:7},1632:{rowPerView:6},1278:{rowPerView:5},916:{rowPerView:4},648:{rowPerView:s.value?2:3}}}),x=p(null),f=async(e,t)=>{if(i.value)return;let a=!1;t&&(a=!0,l.value=e||"",o.value.children=[]);const d=o.value?.children?.length??0;if(d>0&&d>=o.value?.total&&!a||!o.value&&!a)return;const h=20;i.value=!0;const v=await Z({per_page:h,page:Math.ceil(d/h)+1,order_by:l.value?1:2,keyword:l.value},"").catch(()=>{});t&&(o.value.children=[]),i.value=!1,o.value&&(x.value={search_term:l.value,search_context:"explore",template_search_algorithm_id:v?.track_info?.version||null,template_origin_entity:"mi"},o.value.total=v?.pagination?.total||0,V("miai_search_result_expose",{result_count:v?.pagination?.total||0,...x.value}),o.value.children=o.value.children.concat(v?.list??[]))},O=()=>{l.value=""},W=async e=>{e[0]?.isIntersecting&&await f()},C=new IntersectionObserver(W,{root:null,rootMargin:"0px",threshold:.1});le(()=>{c.value&&C.observe(c.value),f(l.value,!0)}),ie(()=>{c.value&&C.unobserve(c.value),o.value&&(i.value=!1)});const j=async()=>{A.value==="home"?await L({name:`${I.Home}`,query:{tab:"explore"}}):await L({name:`${I.Explore}`})},E=p([]);P(()=>o.value?.children,()=>{E.value=o.value?.children?.map(e=>{const t=JSON.parse(e?.related_info?.ext?.custom_param?.uni_fun_code||"{}");return{thumbnail:e?.thumbnail_url,preview:e?.preview_url_multi?.["720p"]?.url,width:e?.related_info?.ext?.custom_param?.cover_width,height:e?.related_info?.ext?.custom_param?.cover_height,uni_fun_code:t.uni_fun_code,fun_module:t.fun_module,id:e?.id,slug:e?.slug,author_extra:e?.author_extra,behavior_extra:e?.behavior_extra,behavior_stat:e?.behavior_stat,name:e?.title}})},{immediate:!0}),P(()=>R.value,e=>{e&&f(l.value,!0)});const{exploreTagList:F}=w(y),H=e=>{F.value.forEach(t=>{t.children.forEach(a=>{a.id===e?.sampleId&&(a.behavior_extra.liked_count=e?.likedCount,a.behavior_stat.is_liked=e?.isLiked)})}),N.value.forEach(t=>{ee(t.recommend_data)?.forEach(a=>{a&&a?.crc_id&&a?.crc_id===e.sampleId&&(a.crc_resource.behavior_stat.is_liked=e.isLiked,a.crc_resource.behavior_extra.liked_count=e.likedCount)})})};return(e,t)=>(n(),k("section",{class:u(["w-full h-full flex flex-col",{"overflow-hidden px-6":!r(s),"px-4":r(s)}])},[m("div",{class:u(["w-full flex",{"mt-6 mb-4":!r(s),"fixed pt-[82px] pb-2 top-0 left-0 z-[100] px-4 gap-2 bg-[--color-background-base]":r(s)}])},[g(r(Q),{name:"arrow_left",width:r(s)?28:24,height:r(s)?28:24,class:u([{" mr-[16px]":!r(s)},"text-[--color-text-dynamic-white-tertiary] flex items-center justify-center inner-icon cursor-pointer hover:text-[--color-text-dynamic-white-primary]"]),onClick:j},null,8,["width","height","class"]),g(Y,{class:"!w-[240px]",default:r(l),"in-search":!0,onSearch:t[0]||(t[0]=a=>f(a,!0)),onToggleExpand:O},null,8,["default"])],2),m("div",{class:u(["flex-2 h-full",{"overflow-auto":!r(s)}])},[o.value.children?.length?(n(),_(re,{key:0,ref:"templateWaterfall",class:u(r(s)?"mt-[72px]":"!pt-0"),list:E.value||[],gap:r(S).itemGap,breakpoints:r(S).breakPoint},{item:b(({item:a,index:d,changeIndex:h})=>[(n(),_(se,{key:a.id,sample:a,index:d,module:"explore_search_result_feed","track-info":x.value,onChangeIndex:h,onLikeChange:H},null,8,["sample","index","track-info","onChangeIndex"]))]),_:1},8,["class","list","gap","breakpoints"])):i.value?T("",!0):(n(),_(K,{key:1,"has-bg":!1,"show-title":!1,type:$.value,tips:e.$t("ai_video_generator.search_empty"),class:u(r(s)?"!mt-16":"")},null,8,["type","tips","class"])),m("div",{ref_key:"LoadingArea",ref:c,class:u(["loading-area pb-8",{"mt-[70px]":o.value?.children?.length===0,"-mt-[70px]":o.value?.children?.length>0}])},[i.value?(n(),_(r(X),{key:0})):o.value?.children?.length>(r(s)?8:20)?(n(),k("div",pe,[t[1]||(t[1]=m("div",{class:"end-guideline"},null,-1)),m("span",me,ue(e.$t("ai_video_generator.allDataTips")),1),t[2]||(t[2]=m("div",{class:"end-guideline"},null,-1))])):(n(),k("div",_e))],2)],2),r(z)!==null?(n(),_(oe,{key:0})):T("",!0)],2))}}),fe=Object.assign(ae(de,[["__scopeId","data-v-d9328192"]]),{__name:"ExploreSearch"}),Pe=B({__name:"search",setup(D){return V("miai_distribution_interface_expose",{interface_name:"explorepage"}),(i,c)=>{const s=te;return n(),_(s,null,{fallback:b(()=>[g(ce)]),default:b(()=>[g(fe)]),_:1})}}});
1export{Pe 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.