1import ee from"./CzxuRKs5.js";import{d as te,an as oe,Q as se,a6 as ne,a as re,u as ae,b as ie,a4 as z,ak as ce,w as ue,n as le,ao as de,ap as ve,o as pe,e as me,i as c,j as m,t as x,l,k as C,m as T,F as S,z as M,B as b,bk as _e,h as i,q as fe,ah as be,ai as ge,A as I,p as we,a8 as he,_ as ye,al as xe}from"./CFKhmQVY.js";import{_ as Se}from"./CisBTIue.js";import{u as ke}from"./Cd9Lj95_.js";import{u as Ce}from"./CvIR3bpx.js";import"./CNzhN4ms.js";import"./C7oD2IVA.js";import"./DRPSW_bH.js";import"./C_zbRu-G.js";const Te={class:"p4 lg:p-8"},Me={class:"text-2xl font-bold mt-0 mb-6"},Ie={class:"tabs"},Le=["onClick"],Ne={key:0,class:"grid-container"},Ae=["data-id","data-type","data-name","onMouseenter","onClick"],$e=["src","alt","onError"],De={class:"btn-use btn-use_pc absolute bottom-4 px-4 py-2 hidden font-bold"},Ee={class:"temp-name mt-2 mb-0 text-center"},Pe=te({__name:"index",async setup(Ve){let g,L;const U=oe(),N=se().isMobile.value,A=_e(),q=ne(),R=re(),{t:u,locale:$}=ae(),G=ie(),H=z(),d=z(),w=b(0),k=b(new Set([0])),D=b(null),{setTempRef:Q,bindObserver:E}=ke(),h=b(new Set),y=b({});let v=null;ce().setSource("ai-hug");function P(e){w.value=e,k.value=new Set(k.value).add(e)}ue(()=>w.value,async()=>{await le(),E()});const J=()=>{if(A.query.category){let e=d.tabs.findIndex(t=>{const o=t?.name?.toLowerCase(),n=A.query.category?.toLowerCase();return o===n});e===-1&&(e=0),P(e)}};if(!d.tabs.length){const{data:e,status:t}=([g,L]=de(()=>Ce("categoryTemps",()=>d.getCategoryTemps({country:G.userInfo?.reg_country,locale:$.value}))),g=await g,L(),g);if(t.value==="success"){const o=(e.value||[]).map(n=>{const _=(n.temps||[]).map(a=>({...a,app_thumb:r(a.app_thumb)||r(a.cover),cover:r(a.cover),new_video:r(a.new_video)||r(a.video),video:r(a.video)}));return{...n,temps:_}});d.setTabs(o)}}J();function K(e){R.$PGsensors?.track("webMaterialClick",{premium_material_type:22,premium_material_categories:e.categories?.join(),premium_material:e.id,premium_material_name:e.title})}function V(){v||typeof IntersectionObserver>"u"||(v=new IntersectionObserver(e=>{e.forEach(t=>{if(!t.isIntersecting)return;const o=t.target.dataset.mediaId;if(!o)return;const n=new Set(h.value);n.add(o),h.value=n,v?.unobserve(t.target)})},{root:null,rootMargin:"0px",threshold:.01}))}function W(e,t){if(Q(e),!e||!(e instanceof HTMLElement))return;const o=String(t.id);e.dataset.mediaId=o,V(),!h.value.has(o)&&v?.observe(e)}function B(e){return h.value.has(String(e.id))}function r(e){if(typeof e!="string")return"";const t=e.trim();if(!t)return"";const o=t.toLowerCase();return o==="null"||o==="undefined"?"":t}function j(e){const t=r(e.app_thumb),o=r(e.cover),n=y.value[String(e.id)];return r(n)||t||o||""}function F(e){return r(e.new_video)||r(e.video)}function X(e,t){const o=t.target;if(!o)return;const n=r(e.cover),_=r(o.currentSrc||o.src);n&&_!==n&&(y.value={...y.value,[String(e.id)]:n},o.src=n)}function O(e){N||(D.value=e)}function Y(e){return F(e)?!N&&B(e)&&D.value===e.id:!1}ve({title:u("ai-video.title"),description:u("ai-video.desc"),ogTitle:u("ai-video.title"),ogDescription:u("ai-video.desc"),twitterTitle:u("ai-video.twitter-title"),twitterDescription:u("ai-video.twitter-desc"),ogImage:"https://pg-media.photogrid.app/v1/web/www/assets/poster/video-effects.webp",twitterImage:"https://pg-media.photogrid.app/v1/web/www/assets/poster/video-effects.webp"}),pe(()=>{U.setPremiumFeature("ai-video"),q.setSource("ai-hug"),V(),E(),H.getPointList()}),me(()=>{v?.disconnect(),v=null,y.value={}});const Z=e=>e?!isNaN(Number(e)):!1;return(e,t)=>{const o=ee,n=he,_=ye;return i(),c("div",Te,[m("h1",Me,x(l(u)("ai-video.nav.template")),1),m("div",Ie,[C(Se,{class:"tab-list px-4 -mx-4 lg:px-0 lg:mx-0"},{default:T(()=>[(i(!0),c(S,null,M(l(d).tabs,(a,f)=>(i(),c("button",{key:a.id,class:fe([{active:l(w)===f},"tab-button py-1 lg:py-2 px-4"]),onClick:s=>P(f)},x(a.name),11,Le))),128))]),_:1}),(i(!0),c(S,null,M(l(d).tabs,(a,f)=>(i(),c(S,{key:a.id},[l(k).has(f)?be((i(),c("div",Ne,[(i(!0),c(S,null,M(a.temps,s=>(i(),c("div",{key:s.id,class:"min-w-0"},[C(_,{to:`/${l($)}/video-effects/${s.cmsUrl}/`,rel:Z(s.cmsUrl)?"nofollow":void 0},{default:T(()=>[m("div",{ref_for:!0,ref:p=>W(p,s),class:"video-box","data-id":s.id,"data-type":s.categories?.join(),"data-name":s.title,onMouseenter:p=>O(s.id),onMouseleave:t[0]||(t[0]=p=>O(null)),onClick:p=>K(s)},[B(s)?(i(),c("img",{key:0,src:j(s),alt:s.title,decoding:"async",class:"poster-img absolute inset-[3px] rounded-xl overflow-hidden object-cover",onError:p=>X(s,p)},null,40,$e)):I("",!0),Y(s)?(i(),we(n,{key:1},{default:T(()=>[C(o,{video:F(s),poster:j(s),"hover-play":!1,"auto-play":!0,muted:"","cover-style":"object-cover",class:"absolute inset-[3px] rounded-xl overflow-hidden"},null,8,["video","poster"])]),_:2},1024)):I("",!0),t[1]||(t[1]=m("button",{class:"btn-use absolute bottom-2 px-4 py-1 lg:hidden font-bold"},"Create",-1)),m("button",De,x(l(u)("ai-video.try-now")),1)],40,Ae)]),_:2},1032,["to","rel"]),m("p",Ee,x(s.title),1)]))),128))],512)),[[ge,l(w)===f]]):I("",!0)],64))),128))])])}}}),Qe=xe(Pe,[["__scopeId","data-v-172972e2"]]);export{Qe 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.