PageSourceSearch

https://www.dailybite.ai/assets/ArchiveSection-Dv6FQzqW.js

js dailybite.ai collected 2026-10-04 23:40:58 UTC 16,875 bytes, 5 lines download raw bytes

1
2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="490617e9-43f4-5d79-8f1e-ed573d39a331")}catch(e){}}();
3import{a as e,t}from"./jsx-runtime-CMgEUHpv.js";import{t as n}from"./dayjs.min-MGE5IyII.js";import{V as r,g as i,m as a}from"./dist-CAHjj65Z.js";import{t as o}from"./useTranslation-BymTnaHx.js";import{O as s,l as c,n as l}from"./components-B8bHjdou.js";import{t as u}from"./classnames-PxzWHlFm.js";import{t as d}from"./Typography-DJfjxaJy.js";import{i as f,o as p,t as m}from"./useWebThemeContext-BJu9VsBR.js";import{t as h}from"./ChevronRightIcon-CBCJUmns.js";import{n as g,t as _}from"./HeroChatIcon-DcqIDk36.js";import{t as v}from"./MagnifyingGlassIcon-BD1upgPH.js";import{t as y}from"./XMarkIcon-CtiWC60Y.js";import{t as b}from"./PostCardv3-C5or4sKe.js";import{t as x}from"./LockClosedIcon-nbfIsPgW.js";import{t as S}from"./useNonRevalidatingFetcher-DstApf5k.js";import{t as C}from"./Image-B1Otrzxn.js";import{t as w}from"./Button-DG1GtAKw.js";import{t as T}from"./useTypedLoaderData-p1j97aJ6.js";import{t as E}from"./relativeTime-y4ag7y6a.js";import{t as D}from"./useDebounce-DOET6Aiv.js";var O=e(r());function k({title:e,titleId:t,...n},r){return O.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?O.createElement(`title`,{id:t},e):null,O.createElement(`path`,{fillRule:`evenodd`,d:`M10.5 3.75a6.75 6.75 0 1 0 0 13.5 6.75 6.75 0 0 0 0-13.5ZM2.25 10.5a8.25 8.25 0 1 1 14.59 5.28l4.69 4.69a.75.75 0 1 1-1.06 1.06l-4.69-4.69A8.25 8.25 0 0 1 2.25 10.5Z`,clipRule:`evenodd`}))}var ee=O.forwardRef(k),A=e(u(),1),j=t(),M=(e,t,n,r)=>{let i=new URLSearchParams(r);i.delete(t),i.set(t,n.toString());let a=i.toString();return a?`${e}?${a}`:e},N=({to:e,disabled:t,rel:n,children:r,activePage:i,color:a,borderColor:o,isNewWebBuilder:s=!1,primaryColor:c,primaryTextColor:u})=>{let{classes:d}=m();return(0,j.jsx)(l,{to:e,className:(0,A.default)(d.radius,`flex items-center gap-2 border border-transparent px-3 py-1 transition duration-150 ease-in-out hover:border-wt-primary`,{"pointer-events-none cursor-not-allowed opacity-40":t,"bg-wt-primary text-wt-text-on-primary":i&&!s}),style:{color:s?u:a,border:o&&`1px solid ${o}`,backgroundColor:s?c:``},children:r})},P=`../archive`,F=8,I=`page`,L=({homePage:e,isNewWebBuilder:t=!1,buttonBGColor:n,buttonBorderColor:r,buttonTextColor:i})=>{let[a]=s(),{paginatedPosts:c}=T(),l=i,u=r,d=n,f=e?.posts_section.archive.button_active_bg_color||``,p=e?.posts_section.archive.button_active_text_color||``,m=Number.parseInt(a.get(`page`)||`1`,10),g=Math.max(1,m-Math.floor(F/2)),{t:_}=o(),v=Math.min(g+F-1,c.pagination.total_pages);return c.pagination.total_pages===1?null:(0,j.jsxs)(`div`,{className:`col-span-12 mx-auto mt-12 grid grid-cols-4 grid-rows-2 items-center gap-3 px-4 py-4 pb-8 sm:flex sm:justify-center`,children:[(0,j.jsxs)(`div`,{className:`wt-button-font order-2 col-span-2 flex justify-end gap-2`,children:[(0,j.jsx)(N,{to:M(P,I,1,a),disabled:m===1?!0:null,color:l,borderColor:u,primaryColor:d,primaryTextColor:l,isNewWebBuilder:t,children:_(`search.pagination.first`)}),(0,j.jsxs)(N,{to:M(P,I,m-1,a),rel:`prev`,disabled:m===1,color:l,primaryColor:d,primaryTextColor:l,borderColor:u,isNewWebBuilder:t,children:[(0,j.jsx)(h,{className:`rotate-180 transform`,height:`16px`}),_(`search.pagination.back`)]})]}),(0,j.jsx)(`div`,{className:`order-1 col-span-4 flex justify-center gap-3 sm:order-2`,children:Array.from({length:v-g+1},(e,n)=>{let r=g+n,i=m===r,o=i?f:d,s=i?p:l;return(0,j.jsx)(N,{to:M(P,I,r,a),activePage:i,color:s,borderColor:u,primaryColor:o,primaryTextColor:s,isNewWebBuilder:t,children:r},n)})}),(0,j.jsxs)(`div`,{className:`wt-button-font order-2 col-span-2 flex items-center gap-2`,children:[(0,j.jsxs)(N,{to:M(P,I,m+1,a),disabled:m===c.pagination.total_pages,rel:`next`,color:l,primaryColor:d,primaryTextColor:l,borderColor:u,isNewWebBuilder:t,children:[_(`search.pagination.next`),` `,(0,j.jsx)(h,{height:`16px`})]}),(0,j.jsx)(N,{to:M(P,I,c.pagination.total_pages,a),borderColor:u,primaryColor:d,primaryTextColor:l,disabled:m===c.pagination.total_pages?!0:null,color:l,isNewWebBuilder:t,children:_(`search.pagination.last`)})]})]})},R=e(n(),1),z=e(E(),1);R.default.extend(z.default);function B(e){let t=(0,R.default)().diff(e,`hour`);return t===0&&(t=1),t===1?`${t} hour ago`:t<24?`${t} hours ago`:e.locale(`en`).format(`MMM DD, YYYY`)}var te=({time:e,authors:t,fontFamily:n,textClassName:r,color:i})=>{let a=B((0,R.default)(e));return(0,j.jsxs)(d,{size:`sm`,fontFamily:n,className:(0,A.default)(`flex flex-col space-y-1 no-underline opacity-75`,r),color:i,weight:`regular`,children:[(0,j.jsx)(`span`,{className:`text-xs font-semibold`,children:t?.map(e=>e.name).join(`, `)}),(0,j.jsx)(`time`,{dateTime:e,className:`text-xs`,children:a})]})},ne={none:`hover:shadow-none`,xs:`hover:shadow-xs`,sm:`hover:shadow-sm`,md:`hover:shadow-md`,lg:`hover:shadow-lg`,xl:`hover:shadow-xl`},V=({count:e,children:t,className:n,color:r,fontFamily:i,onClick:a})=>(0,j.jsx)(`button`,{type:`button`,onClick:e=>{e.preventDefault(),e.stopPropagation(),a?.()},children:(0,j.jsxs)(d,{size:`sm`,as:`span`,fontFamily:i,className:(0,A.default)(n,`flex items-center space-x-1`),color:r,weight:`regular`,children:[t,e>0?(0,j.jsx)(`span`,{className:`mt-0.5 text-xs font-bold`,children:e}):null]})}),re=({post:e,likeCount:t,commentCount:n,color:r,fontFamily:a,commentsEnabled:o})=>{let s=i();return(0,j.jsxs)(`div`,{className:`z-20 flex w-full items-center space-x-8 opacity-100 transition-all group-hover:opacity-100 sm:opacity-0`,children:[(0,j.jsx)(V,{count:t,color:r,children:(0,j.jsx)(g,{className:`h-4 w-4`})}),o&&(0,j.jsx)(V,{count:n,className:`mt-[2px]`,color:r,onClick:()=>{s(`/p/${e.slug}?comments=true`)},children:(0,j.jsx)(_,{className:`h-4 w-4`})})]})},H=({alt:e,radiusClass:t,src:n})=>(0,j.jsx)(`div`,{className:(0,A.default)(`w-full overflow-hidden`,t||`rounded-wt`),children:(0,j.jsx)(C,{src:n,alt:e,maxWidth:800,loading:`eager`,aspectRatio:`social`})}),U=({slug:e,className:t,children:n,style:r})=>(0,j.jsx)(l,{style:r,to:`/p/${e}`,className:(0,A.default)(t),prefetch:`intent`,children:n}),W=({color:e,fontFamily:t})=>{let{t:n}=o();return(0,j.jsxs)(`div`,{className:`flex items-center space-x-1`,children:[(0,j.jsx)(x,{style:{color:e},className:`h-3 w-3`}),(0,j.jsx)(d,{as:`h2`,size:`xs`,fontFamily:t,weight:`bold`,color:e,children:n(`posts.premium`)})]})},G=({tags:e,fontFamily:t,bgColor:n,color:r})=>!e||e?.length===0?null:(0,j.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.map(e=>(0,j.jsx)(`div`,{style:{backgroundColor:n},className:`flex w-fit items-center space-x-1 rounded px-2 pb-0.5`,children:(0,j.jsx)(d,{as:`span`,size:`xs`,fontFamily:t,className:`text-xs font-medium`,color:r,children:(0,j.jsx)(`span`,{className:`text-xs`,children:e.display})})},e.id))}
3),K=({title:e,subtitle:t,titleSize:n,fontFamily:r,subtitleSize:i,titleColor:a,subtitleColor:o,textClassName:s,showSubtitle:c=!0})=>(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(d,{as:`h2`,size:n,fontFamily:r,weight:`bold`,color:a,className:(0,A.default)(`line-clamp-4 break-words`,s),children:e}),c&&(0,j.jsx)(d,{as:`p`,size:i,fontFamily:r,color:o,className:(0,A.default)(`line-clamp-2 break-words`,s),children:t})]}),q=({post:e,card:t,orientation:n=`vertical`})=>{let r=e.audience===`premium`,i=f[t?.border_radius||`none`],a=p[t?.shadow||`none`],o=ne[t?.hover_shadow||`none`],s=t.font,c=n===`vertical`,l=n===`horizontal`,u=e?.comment_count||0,d=e?.likes?.length||0;return(0,j.jsx)(`div`,{suppressHydrationWarning:!0,className:(0,A.default)(`group h-full overflow-hidden transition-all`,a,o,i),style:{backgroundColor:t.bg_color,borderColor:t.border_color},children:(0,j.jsxs)(U,{slug:e?.slug,style:{backgroundColor:t.bg_color,borderColor:t.border_color},className:(0,A.default)(`group flex h-full w-full border transition-all group-hover:brightness-110`,i,c&&`flex-col`,l&&`flex-col md:flex-row`),children:[(0,j.jsx)(`div`,{className:`w-full`,children:(0,j.jsx)(H,{alt:e.web_title,radiusClass:i,src:e.image_url})}),(0,j.jsxs)(`div`,{className:(0,A.default)(`flex h-full w-full flex-col justify-between space-y-6 p-4`),children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:`flex justify-between space-x-4`,children:(0,j.jsxs)(`div`,{className:`space-y-1`,children:[r&&(0,j.jsx)(W,{color:t.premium_text_color,fontFamily:t.font}),(0,j.jsx)(K,{title:e.web_title,subtitle:e?.web_subtitle,fontFamily:s,titleSize:`xl`,subtitleSize:`sm`,titleColor:t.text_color,subtitleColor:t.text_color,textClassName:t.hover_underline===`underline`?`group-hover:underline`:``})]})}),(0,j.jsx)(`div`,{className:`pt-6`,children:(0,j.jsx)(te,{authors:e.authors,time:e.override_scheduled_at,fontFamily:s,color:t.timestamp_text_color})})]}),t?.tags_enabled&&(0,j.jsx)(`div`,{className:`space-y-2`,children:(0,j.jsx)(G,{tags:e.content_tags,fontFamily:s,bgColor:t.tags_bg_color,color:t.tags_text_color})}),(0,j.jsx)(re,{post:e,likeCount:d,commentCount:u,commentsEnabled:e.comments_enabled,fontFamily:s,color:t.text_color})]})]})})},J=(e,t=[])=>{if(!e)return[];let n=t.reduce((e,t)=>(e[t.display]=t.id,e),{});try{return e.map(e=>n[e]||e)}catch{return[]}},Y=({initialPosts:e,initialPagination:t,publication:n})=>{let r=c(),i=t.total_pages,[a,o]=(0,O.useState)(e),[l,u]=(0,O.useState)(t.page),d=r?.data,[f]=s(),p=f.get(`q`),m=f.getAll(`content_tags`);return(0,O.useEffect)(()=>{a&&(u(1),o(e))},[e]),(0,O.useEffect)(()=>{d&&(u(l+1),o(a.concat(d?.posts)))},[d]),{postsToRender:a,showLoadMore:l+1<=i,isLoading:r?.state!==`idle`,postsFetcher:r,fetchPosts:()=>{let e=new URLSearchParams;e.append(`page`,String(l+1)),p&&e.append(`q`,p);for(let t of J(m,n.content_tags))e.append(`content_tags`,t);r.load(`/posts?${e.toString()}`)}}},X=({incomingPosts:e})=>{let t=S(),[n,r]=(0,O.useState)(!1);(0,O.useEffect)(()=>{let i=e?.map(e=>e.id)||[];i&&i.length>0&&!n&&(t.submit(JSON.stringify({post_ids:i}),{method:`post`,action:`/posts_insights`,encType:`application/json`}),r(!0))},[e,n,t]);let i=t.data;return{postsWithInsights:e?.map(e=>{let t=i?.find(t=>t.id===e.id);return{...e,likes:t?t.likes.filter(e=>e.liked):[],comment_count:t?t.comment_count:0}})}},Z=({title:e,description:t,fontFamily:n,accentColor:r,textColor:i,fontSize:a,isNewWebBuilder:o=!1})=>(0,j.jsxs)(`div`,{className:`flex flex-col space-y-0`,children:[(0,j.jsx)(d,{as:`h4`,size:o?a:`xl`,fontFamily:n,fontFamilyv2:o?n:void 0,color:r,weight:`bold`,children:e}),t&&(0,j.jsx)(d,{as:`p`,size:`lg`,fontFamily:n,fontFamilyv2:o?n:void 0,color:i,weight:`regular`,children:t})]}),ie=({color:e,tag:t,setIsSearching:n,bgColor:r,isNewWebBuilder:o,radiusClass:c})=>{let[l,u]=s(),d=l.getAll(`content_tags`),f=t.display,p=d.includes(f),m=i(),h=a();return(0,j.jsx)(`button`,{type:`button`,style:{borderColor:e,color:p?r:e,backgroundColor:p?e:`transparent`},onClick:()=>{let e=new URLSearchParams(l);if(p){e.delete(`content_tags`);for(let t of d)t!==f&&e.append(`content_tags`,t)}
3else e.append(`content_tags`,f);let t=e.toString();if(h.pathname.includes(`/archive`))n(!0),u(e);else{let e=`/archive`;m(t?`${e}?${t}`:e)}},className:(0,A.default)(c,`cursor-pointer border px-4 py-1.5 text-xs`),children:f})},Q=({setSearchTerm:e,color:t,classNames:n,showX:r})=>{let[i,a]=s(),c=i.has(`q`)||i.has(`content_tags`),{t:l}=o();return c?(0,j.jsxs)(`button`,{onClick:t=>{i.delete(`q`),i.delete(`content_tags`),e(``),a(i)},style:{borderColor:t,color:t},className:(0,A.default)(n,`flex items-center space-x-1 border px-4 py-1.5`),children:[r&&(0,j.jsx)(y,{className:`mr-1 h-3 w-3`}),l(`search.posts.clear_filters`)]}):null},ae=({searchTerm:e,setSearchTerm:t,isSearching:n,setIsSearching:r,isNewWebBuilder:i=!1})=>{let{classes:a}=m(),{t:s}=o(),{homePage:c,publication:l}=T(),u=c.general_section.theme.text_color,d=c.general_section.theme.bg_color,f=e=>{t(e.target.value),n||r(!0)};return(0,j.jsxs)(`div`,{className:`mb-8`,children:[(0,j.jsx)(`div`,{className:`relative w-full pb-4`,children:i?(0,j.jsxs)(`div`,{className:`group relative w-full transition-all`,children:[(0,j.jsx)(`div`,{className:`absolute left-2 top-1/2 -translate-y-1/2 transform`,children:(0,j.jsx)(v,{style:{color:u},className:`h-4 w-4`})}),(0,j.jsx)(`input`,{type:`text`,name:`q`,id:`q`,value:e,onChange:f,style:{color:`#111827`,border:`1px solid #F9FAFB`,backgroundColor:`#F9FAFB`},className:(0,A.default)(a.radius,`w-full max-w-none pl-8 sm:max-w-4xl`),placeholder:`${s(`search.posts.placeholder`)}...`||``})]}):(0,j.jsxs)(`div`,{className:`group relative w-full text-wt-text-on-background transition-all`,children:[(0,j.jsx)(`div`,{className:`absolute top-2.5`,children:(0,j.jsx)(v,{style:{color:u},className:`h-4 w-4`})}),(0,j.jsx)(`input`,{type:`text`,name:`q`,id:`q`,value:e,onChange:f,style:{color:u,borderBottomColor:u},className:`text-regular w-full rounded-none border-b border-transparent bg-transparent py-2 pl-6 text-sm outline-none transition-all focus:border-transparent focus:opacity-100`,placeholder:`${s(`search.posts.placeholder`)}...`||``})]})}),(0,j.jsx)(`div`,{className:`mb-2 flex flex-wrap gap-2`,children:l.content_tags?.map(e=>(0,j.jsx)(ie,{tag:e,color:u,bgColor:d,setIsSearching:r,isNewWebBuilder:i,radiusClass:a.radius},e.display))}),(0,j.jsx)(Q,{setSearchTerm:t,color:u,classNames:(0,A.default)(`px-2 py-1 text-xs`,a.radius),showX:!0})]})},$=()=>(0,j.jsx)(`div`,{className:`w-full rounded-md border-2 border-gray-600 p-4 opacity-50 shadow`,children:(0,j.jsxs)(`div`,{className:`flex animate-pulse space-x-4`,children:[(0,j.jsx)(`div`,{className:`h-36 w-36 rounded bg-gray-600`}),(0,j.jsx)(`div`,{className:`flex flex-1 flex-col justify-between py-1`,children:(0,j.jsxs)(`div`,{className:`felx flec-col space-y-6`,children:[(0,j.jsx)(`div`,{className:`h-2 rounded bg-gray-600`}),(0,j.jsx)(`div`,{className:`h-2 max-w-sm rounded bg-gray-600`}),(0,j.jsx)(`div`,{className:`h-2 max-w-xs rounded bg-gray-600`})]})})]})}),oe=()=>(0,j.jsxs)(`div`,{className:`min-h-screen w-full space-y-4 pt-4`,children:[(0,j.jsx)($,{}),(0,j.jsx)($,{}),(0,j.jsx)($,{}),(0,j.jsx)($,{})]}),se=({cardOrientation:e=`horizontal`,gridCols:t=`3`,isNewWebBuilder:n=!1})=>{let{t:r}=o(),{paginatedPosts:i,homePage:a,publication:s,cardStyles:c}=T(),l=a?.posts_section?.card,u=a.general_section.theme.text_color,f=a.general_section.theme.font,p=a.posts_section.archive.header_text_color??a.general_section.theme.accent_color,m=a?.posts_section?.archive.load_more_posts_type===`pagination`,h=a?.posts_section?.archive.header_text||`Archive`,g=a?.posts_section?.archive.show_archive_header||!1,_=a?.posts_section?.archive.font_size||`4xl`,{searchTerm:v,setSearchTerm:y,isSearching:x,setIsSearching:S}=D(500),{isLoading:C,fetchPosts:E,postsToRender:O,showLoadMore:k}=Y({initialPosts:i.posts,initialPagination:i.pagination,publication:s}),{postsWithInsights:M}=X({incomingPosts:O}),N=()=>(0,j.jsxs)(`div`,{className:`mt-12 flex w-full flex-col items-center justify-center gap-4`,children:[(0,j.jsx)(ee,{className:`h-8 w-8`}),(0,j.jsx)(d,{as:`p`,size:`xl`,fontFamily:l.font,fontFamilyv2:n?l.font:void 0,color:l.text_color,className:`text-xl font-semibold`,children:r(`search.posts.no_results`)}),(0,j.jsx)(Q,{setSearchTerm:y,color:u,classNames:`p-2 px-4 text-base`})]}),P=a?.posts_section.archive.button_text_color||``,F=a?.general_section.theme.border_color||``,I=a?.posts_section.archive.button_bg_color||``;return(0,j.jsxs)(`div`,{children:[n&&g&&(0,j.jsx)(`div`,{className:`mb-4`,children:(0,j.jsx)(Z,{title:h,fontFamily:f,accentColor:p,textColor:u,isNewWebBuilder:n,fontSize:_})}),(0,j.jsx)(ae,{publication:s,searchTerm:v,setSearchTerm:y,isSearching:x,setIsSearching:S,isNewWebBuilder:n}),x?(0,j.jsx)(oe,{}):(0,j.jsx)(j.Fragment,{children:M.length===0?(0,j.jsx)(`div`,{children:N()}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`div`,{className:(0,A.default)({"flex flex-col space-y-6":e===`horizontal`,"grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3":e===`vertical`&&t===`3`,"grid grid-cols-1 gap-6 md:grid-cols-2":e===`vertical`&&t===`2`}),children:M?.map((t,r)=>n?(0,j.jsx)(b,{post:t,cardStyles:c,orientation:e},t.id):(0,j.jsx)(q,{post:t,card:l,orientation:e},t.id))}),!m&&k&&(0,j.jsx)(`div`,{className:`mt-6 flex w-full justify-center`,children:(0,j.jsx)(w,{style:{backgroundColor:I,borderColor:F,color:P},className:(0,A.default)(`transition-all group-hover:brightness-110`),onClick:E,children:C?`${r(`shared.actions.loading`)}...`:r(`shared.cta.load_more`)})}),m&&(0,j.jsx)(L,{homePage:a,isNewWebBuilder:n,buttonBGColor:I,buttonBorderColor:F,buttonTextColor:P})]})})]})};export{K as a,H as c,q as i,Z as n,W as o,X as r,U as s,se as t};
4//# sourceMappingURL=ArchiveSection-Dv6FQzqW.js.map
5//# debugId=490617e9-43f4-5d79-8f1e-ed573d39a331

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.