1import{a as q,D as U,b as Z,Y as J}from"./index.3531d3de.js";import{A as K}from"./BlogList.186f6af3.js";import{d as W,b as N,c as L,e as Q,a as D,f as X,g as ee}from"./blogUtils.6417a0df.js";import{r as b,D as E,o as j,c as n,e as c,i as T,u as w,ae as V,m as z,C as O,B as G,l as H,f as a,t as y,F as S,j as B,h as A,w as R,ag as te,ah as ae,ai as se,J as oe,ab as le,aj as ie,d as re,Z as ne,n as de,ak as ce}from"./vendor.73aed233.js";const ue={key:0,class:"flex justify-center items-center py-[120px]"},me={__name:"CategoryPage",props:{categoryId:String,tabName:String,homeView:Boolean},setup(p){const M=p,v=b([]),o=b([]),h=b(!0),k=b(1),_=b(!0),x=async g=>{try{const{posts:f}=await W(M.categoryId,{sticky:!0,per_page:100});console.log("置顶æç« æ°æ®:",f),f!=null&&f.data&&Array.isArray(f.data)&&(o.value=await Promise.all(f.data.map(async i=>{let s="";if(i.featured_media>0)try{const t=await N({mediaId:i.featured_media});t!=null&&t.source_url&&(s=t.source_url)}catch(t){console.error("Error fetching media:",t)}return s||(s=L(i.id)),{id:i.id,title:i.title.rendered,description:i.excerpt.rendered.replace(/\s*\[…\]/g,"."),date:new Date(i.date).toLocaleDateString(),imageUrl:s,isSticky:!0}}))),console.log("å¤çåç置顶æç« :",o.value);const{posts:P,totalPages:r}=await W(M.categoryId,{sticky:!1,page:g,per_page:10});let l=[];P!=null&&P.data&&Array.isArray(P.data)&&(l=await Promise.all(P.data.map(async i=>{let s="";if(i.featured_media>0)try{const t=await N({mediaId:i.featured_media});t!=null&&t.source_url&&(s=t.source_url)}catch(t){console.error("Error fetching media:",t)}return s||(s=L(i.id)),{id:i.id,title:i.title.rendered,description:i.excerpt.rendered.replace(/\s*\[…\]/g,"."),date:new Date(i.date).toLocaleDateString(),imageUrl:s,isSticky:!1}}))),v.value=[...o.value,...l],_.value=l.length>0&&g<r}catch(f){console.error("Error fetching posts:",f),_.value=!1}finally{h.value=!1}},$=()=>{k.value+=1};return E(()=>M.categoryId,()=>{v.value=[],o.value=[],k.value=1,_.value=!0,h.value=!0,x(1)}),E(k,g=>{g>1&&x(g)}),j(()=>{x(1)}),(g,f)=>(n(),c("div",null,[h.value?(n(),c("div",ue,[T(w(V))])):(n(),z(K,{key:1,"initial-data":v.value,"has-more":_.value,onLoadMore:$,loading:h.value,"tab-name":p.tabName,"category-id":p.categoryId,"home-view":p.homeView},null,8,["initial-data","has-more","loading","tab-name","category-id","home-view"]))]))}};const ge={key:0,class:"flex justify-center items-center h-screen"},pe={key:1},fe={class:"hidden md:block"},ve={key:0,class:"blog-featured mb-[clamp(2rem,4vw,4rem)]"},he={class:"blog-featured-main min-w-0"},_e=["src","alt"],be={class:"text-sm text-black mb-1 font-[Poppins-Regular]"},xe={class:"blog-featured-main-title font-[Poppins-Medium] font-medium mb-[4px] line-clamp-2"},ye=["innerHTML"],ke={class:"blog-featured-side min-w-0"},we=["onClick"],Pe={class:"blog-featured-side-img-wrap overflow-hidden rounded-xl"},Ce=["src","alt"],Ie={class:"mt-[clamp(0.75rem,1.5vw,1rem)]"},Te={class:"text-sm text-black mb-2 font-[Poppins-Regular]"},Me={class:"blog-featured-side-title font-[Poppins-Medium] font-medium line-clamp-2 mb-[4px]"},$e=["innerHTML"],Le={class:"block md:hidden"},De={class:"grid grid-cols-1 gap-5"},He={class:"relative"},Se={class:"custom-slick-arrow custom-slick-prev"},Be={class:"custom-slick-arrow custom-slick-next"},Ne=["onClick"],Ae=["src","alt"],Re={class:"text-sm text-black mb-[4px] font-[Poppins-Regular] font-normal"},Ee={class:"font-[Poppins-Medium] text-[18px] font-[600] mb-[8px] leading-[27px] flex-shrink-0 line-clamp-3"},je={class:"flex-grow overflow-hidden"},Ve=["innerHTML"],Fe={key:0,class:"latest font-[Poppins-SemiBold]"},Ye={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6"},Ue=["onClick"],We={class:"relative"},qe=["src","alt"],ze=["onClick"],Oe={class:"bg-[rgba(0,0,0,0.80)] py-1 px-2 rounded-[8px] text-[14px] font-[Poppins] text-[#fff]"},Ge={class:"md:flex justify-between items-center mt-[12px]"},Ze={class:"text-[--blog-text] text-[14px] font-[Poppins] font-normal"},Je={class:"big-title text-[#000] font-[600] md:font-medium mt-[4px] font-[Poppins-Medium] line-clamp-2 blog-latest-title"}
1,Ke=["innerHTML"],Qe={__name:"HomePage",props:{categoryId:String,tabName:String,homeView:Boolean},setup(p){const M=p,v=b(0),o=b([]),h=b([]),k=b(!0),_=O(),x=G(),$=H(()=>x.params.category),g=s=>s?le(s).format("MMMM DD, YYYY"):"",f=s=>{v.value=s},P=async()=>{var s;try{let t=[];const u=await Q({search:"Hot"});if((s=u[0])!=null&&s.id){const{posts:d}=await D({tags:u[0].id,sticky:!0,per_page:3,orderby:"date",order:"desc"});if(d&&d.length>0&&(t=[...d]),t.length<3){const{posts:e}=await D({tags:u[0].id,sticky:!1,per_page:3-t.length,orderby:"date",order:"desc",exclude:t.map(m=>m.id)});e&&e.length>0&&(t=[...t,...e])}}if(t.length<3){const{posts:d}=await D({per_page:3-t.length,orderby:"date",order:"desc",exclude:t.map(e=>e.id)});d&&d.length>0&&(t=[...t,...d])}const C=await Promise.all(t.map(async d=>{let e="";if(d.featured_media)try{e=(await N({mediaId:d.featured_media})).source_url}catch(m){console.error("Error fetching media:",m)}return{id:d.id,image:e,title:d.title.rendered,subtitle:d.excerpt.rendered.replace(/\s*\[…\]/g,"."),date:d.date,isSticky:d.sticky}}));o.value=C}catch(t){console.error("Error fetching featured posts:",t),ie.error("è·åæç« 失败")}},r=async()=>{try{const s=o.value.map(e=>e.id),{posts:t}=await D({sticky:!0,exclude:s,orderby:"date",order:"desc"}),{posts:u}=await D({sticky:!1,per_page:10+s.length,orderby:"date",order:"desc",exclude:s}),C=[...t,...u].filter(e=>!s.includes(e.id)).slice(0,6),d=await Promise.all(C.map(async e=>{var Y;let m="";if(e.featured_media)try{m=(await N({mediaId:e.featured_media})).source_url}catch(I){console.error("Error fetching media:",I)}let F="";if(((Y=e.tags)==null?void 0:Y.length)>0)try{const I=await X({id:e.tags[0]});F=(I==null?void 0:I.name)||""}catch(I){console.error("Error fetching tag:",I)}return{id:e.id,image:m,title:e.title.rendered,subtitle:e.excerpt.rendered.replace(/\s*\[…\]/g,"."),date:new Date(e.date).toLocaleDateString(),tag:F,tagId:e.tags[0],isSticky:e.sticky}}));h.value=d}catch(s){console.error("Error fetching latest posts:",s)}finally{k.value=!1}},l=(s,t,u)=>{const C=u.replace(/[^a-zA-Z0-9\s-]/g,"").replace(/\s+/g,"-");_.push({path:"/blog/".concat(C),query:{id:s,tab:t,title:u,categoryId:M.categoryId,category:$.value}})},i=(s,t)=>{_.push("/tagList?tag=".concat(s,"&tagId=").concat(t))};return j(()=>{k.value=!0,P().then(()=>{r()})}),(s,t)=>{var u,C,d;return n(),c("div",null,[k.value?(n(),c("div",ge,[T(w(V))])):(n(),c("div",pe,[a("div",fe,[o.value.length>=3?(n(),c("div",ve,[a("div",he,[a("div",{class:"blog-featured-main-img-wrap cursor-pointer overflow-hidden rounded-xl",onClick:t[0]||(t[0]=e=>l(o.value[0].id,p.tabName,o.value[0].title))},[a("img",{src:o.value[0].image||w(L)(o.value[0].id),alt:o.value[0].title,class:"w-full h-full object-cover"},null,8,_e)]),a("div",{class:"blog-featured-main-copy cursor-pointer mt-[clamp(0.75rem,1.5vw,1rem)]",onClick:t[1]||(t[1]=e=>l(o.value[0].id,p.tabName,o.value[0].title))},[a("div",be,y(g(o.value[0].date)),1),a("div",xe,y(o.value[0].title),1),a("div",{class:"text-black font-[Poppins-Regular] line-clamp-2 content-left blog-featured-main-excerpt",innerHTML:o.value[0].subtitle},null,8,ye)])]),a("div",ke,[(n(!0),c(S,null,B(o.value.slice(1,3),e=>(n(),c("div",{key:e.id,class:"blog-featured-side-article cursor-pointer min-w-0 flex flex-col",onClick:m=>l(e.id,p.tabName,e.title)},[a("div",Pe,[a("img",{src:e.image||w(L)(e.id),alt:e.title,class:"w-full h-full object-cover"},null,8,Ce)]),a("div",Ie,[a("div",Te,y(g(e.date)),1),a("div",Me,y(e.title),
11),a("div",{class:"text-black font-[Poppins-Regular] line-clamp-2 content-left blog-featured-side-excerpt",innerHTML:e.subtitle},null,8,$e)])],8,we))),128))])])):A("",!0)]),a("div",Le,[a("div",De,[a("div",He,[T(w(se),{arrows:"",autoplay:"","autoplay-speed":3e3,"after-change":f,class:"custom-carousel"},{prevArrow:R(()=>[a("div",Se,[T(w(te))])]),nextArrow:R(()=>[a("div",Be,[T(w(ae))])]),default:R(()=>[(n(!0),c(S,null,B(o.value,(e,m)=>(n(),c("div",{key:m,class:"w-full"},[a("div",{class:"blog-carousel-slide overflow-hidden rounded-xl cursor-pointer",onClick:()=>l(e.id,p.tabName,e.title)},[a("img",{class:"w-full h-full object-cover",loading:"lazy",src:e.image||w(L)(e.id),alt:"Slide ".concat(m+1)},null,8,Ae)],8,Ne)]))),128))]),_:1})]),a("div",{class:"cursor-pointer flex flex-col mb-[20px]",onClick:t[2]||(t[2]=e=>{var m;return l(o.value[v.value].id,p.tabName,(m=o.value[v.value])==null?void 0:m.title)})},[a("div",Re,y(g((u=o.value[v.value])==null?void 0:u.date)),1),a("div",Ee,y((C=o.value[v.value])==null?void 0:C.title),1),a("div",je,[a("div",{class:"text-black CarouselContent font-medium text-[16px] leading-[24px] font-[Poppins-Regular] line-clamp-5",innerHTML:(d=o.value[v.value])==null?void 0:d.subtitle},null,8,Ve)])])])]),h.value.length>0?(n(),c("div",Fe,[t[3]||(t[3]=a("div",{class:"blog-latest-heading font-semibold inline-block md:mb-[24px] mb-[18px]"}," Latest ",-1)),a("div",Ye,[(n(!0),c(S,null,B(h.value,e=>(n(),c("div",{key:e.id,class:"bg-white"},[a("div",{class:"cursor-pointer",onClick:m=>l(e.id,p.tabName,e.title)},[a("div",We,[a("img",{src:e.image||w(L)(e.id),alt:e.title,class:"w-full object-cover rounded-xl blog-latest-img"},null,8,qe),e.tag?(n(),c("div",{key:0,class:"absolute bottom-3 left-3.5",onClick:oe(m=>i(e.tag,e.tagId),["stop"])},[a("span",Oe,y(e.tag),1)],8,ze)):A("",!0)]),a("div",null,[a("div",Ge,[a("span",Ze,y(g(e.date)),1)]),a("div",Je,y(e.title),
11),a("div",{class:"home-content text-[--blog-content] font-normal mb-2 mt-2 font-[Poppins-Regular] line-clamp-5 blog-latest-excerpt",innerHTML:e.subtitle},null,8,Ke)])],8,Ue)]))),128))])])):A("",!0)]))])}}},Xe=q(Qe,[["__scopeId","data-v-bdbf22c7"]]),et={class:"tdsk-home-container blog-page-wrap md:mt-[58px] md:pb-[64px] pb-[34px]"},tt={key:0,class:"flex justify-center items-center h-screen"},at={key:1,class:"blog-page min-w-0"},st={class:"blog-page-title font-[Poppins-SemiBold] leading-[125%] md:mb-[34px] mb-[20px]"},ot={class:"relative"},lt={class:"flex items-center gap-[0] md:gap-[10px] md:mb-[34px] mb-[20px] overflow-x-auto [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none] whitespace-nowrap md:overflow-visible md:whitespace-normal"},it=["onClick"],rt=re({__name:"Index",props:{homeView:Boolean},setup(p){const M=O(),v=G(),o=b("the-tradesk-pulse"),h=b([]),k=b(!0),_=H(()=>v.params.category),x=H(()=>h.value.find(r=>r.id===o.value)),$=H(()=>{var l;const r=(l=x.value)==null?void 0:l.label;return r&&r!=="The Tradesk Pulse"?"".concat(r," | Tradesk Blog"):"Tradesk Blog | Market Insights & Investing News"}),g=H(()=>{var l;const r=(l=x.value)==null?void 0:l.label;return r&&r!=="The Tradesk Pulse"?"Browse ".concat(r," articles on the Tradesk blog. Market insights, investing strategies, and financial technology news."):"Explore the Tradesk blog for market insights, investing tips, product updates, and financial technology news."});ne({title:$,meta:[{name:"description",content:g},{property:"og:title",content:$},{property:"og:description",content:g},{property:"og:image",content:U},{name:"twitter:card",content:"summary_large_image"},{name:"twitter:title",content:$},{name:"twitter:description",content:g},{name:"twitter:image",content:U}]});const f=async()=>{try{const r=await ee(),l=[{id:"the-tradesk-pulse",label:"The Tradesk Pulse",slug:"the-tradesk-pulse"},...r.map(i=>({id:i.id.toString(),label:i.name,slug:i.slug}))];if(h.value=l,_.value){const i=l.find(s=>s.slug===_.value||s.label.toLowerCase()===_.value.toLowerCase());i&&(o.value=i.id)}else l.length>0&&(o.value=l[0].id)}catch(r){console.error("è·ååç±»æ°æ®é误:",r)}finally{k.value=!1}},P=r=>{o.value=r;const l=h.value.find(s=>s.id===r),i=l==null?void 0:l.slug;i&&M.push({path:"/blog/category/".concat(i),query:{...v.query}})};return j(f),E(_,f),(r,l)=>{var i,s,t;return n(),c("div",null,[T(Z),a("div",et,[k.value?(n(),c("div",tt,[T(w(V))])):(n(),c("div",at,[a("h1",st,y(((i=x.value)==null?void 0:i.label)||""),1),a("div",ot,[a("div",lt,[(n(!0),c(S,null,B(h.value,u=>(n(),c("div",{key:u.id,onClick:C=>P(u.id),class:de([{"font-semibold text-[16px] md:text-[16px] text-[--blog-text] font-[Poppins-SemiBold] leading-[48px] first:pl-0 px-[9px] md:px-[12px] text-[#64748B]":o.value===u.id,"text-[16px] md:text-[16px] font-medium text-[#64748B] font-[Poppins-Medium] leading-[27px] !m-[0] first:pl-0 px-[9px] md:px-[12px] hover:text-[#354764]":o.value!==u.id},"flex-shrink-0 px-3 py-1 cursor-pointer"])},y(u.label),11,it))),128))]),l[0]||(l[0]=a("div",{class:"md:hidden absolute inset-y-0 left-0 w-6 bg-gradient-to-r pointer-events-none"},null,-1)),l[1]||(l[1]=a("div",{class:"md:hidden absolute inset-y-0 right-0 w-6 bg-gradient-to-l pointer-events-none"},null,-1))]),(n(),z(ce(o.value==="the-tradesk-pulse"?Xe:me),{key:o.value,"tab-id":(s=x.value)==null?void 0:s.id,"tab-name":(t=x.value)==null?void 0:t.label,"Home-view":p.homeView,"category-id":o.value!=="the-tradesk-pulse"?o.value:void 0},null,8,["tab-id","tab-name","Home-view","category-id"]))]))]),T(J)])}}});const mt=q(rt,[["__scopeId","data-v-f0b13abd"]]);export{mt 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.