1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2324],{446:(e,t,r)=>{"use strict";r.d(t,{E:()=>a,n:()=>s});let s=12,a=12},1064:(e,t,r)=>{"use strict";r.d(t,{default:()=>m});var s=r(5155),a=r(2115),o=r(6548),n=r(5704);let l=new o.A({accessToken:"JsNhwJ4uyEO3lDhJ9nXxOAtt",cache:{clear:"auto",type:"memory"}});function i(e){return{id:e.id,slug:e.slug,published_at:e.published_at,first_published_at:e.first_published_at,content:{title:e.content.title,summary:e.content.summary,published:e.content.published,featured_image:e.content.featured_image,blog_or_news:e.content.blog_or_news,categoryType:e.content.categoryType}}}let c=new Set(["newsOrHelpfulResources","featuredPosts","featuredMembers","faqs"]);class d{static async getBlogPosts(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:25;try{return(await l.get("cdn/stories",{starts_with:"blog-posts/",filter_query:{blog_or_news:{in:"blog"}},sort_by:"first_published_at:desc",page:e,per_page:t,version:"published"})).data}catch(e){throw console.error("Error fetching blog posts:",e),e}}static async getBlogPostsByCategory(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;try{return(await l.get("cdn/stories",{starts_with:"blog-posts/",filter_query:{blog_or_news:{in:"blog"},categoryType:{in_array:e}},sort_by:"first_published_at:desc",per_page:t,version:"published"})).data.stories}catch(t){return console.error("Error fetching blog posts for category ".concat(e,":"),t),[]}}static async getBlogPostsByCategoryPaginated(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3;try{let s,a=await l.get("cdn/stories",{starts_with:"blog-posts/",filter_query:{blog_or_news:{in:"blog"},categoryType:{in_array:e}},sort_by:"first_published_at:desc",page:t,per_page:r,excluding_fields:"body",version:"published"}),o=a.data.total;return s="number"==typeof o?t*r<o:a.data.stories.length===r,{posts:a.data.stories.map(i),hasMore:s,totalPosts:o}}catch(t){return console.error("Error fetching paginated blog posts for category ".concat(e,":"),t),{posts:[],hasMore:!1,totalPosts:0}}}static async getCategoryTypeMapping(){try{let e=new o.A({oauthToken:n.env.STORYBLOK_MANAGEMENT_TOKEN}),t=(await e.get("spaces/".concat(n.env.STORYBLOK_SPACE_ID,"/components"))).data.components.find(e=>"blogPost"===e.name||"blog_post"===e.name||"post"===e.name||"Blog Post"===e.name||e.name.toLowerCase().includes("blog"));if(t&&t.schema&&t.schema.categoryType){let e=t.schema.categoryType;if(e.options){let t={};return e.options.forEach(e=>{t[e.value]=e.name}),t}}throw console.warn("â ï¸ Could not find categoryType field in blog component schema"),Error("CategoryType field not found")}catch(e){return console.error("â Failed to fetch categoryType mappings from Storyblok:",e),console.error("Error details:",e),{}}}static async getAllCategories(){try{let e=new Map,t=1,r=!0;for(;r;){let s=await l.get("cdn/stories",{starts_with:"blog-posts/",filter_query:{blog_or_news:{in:"blog"}},per_page:100,page:t,version:"published"});if(!s.data||!s.data.stories){console.error("Invalid response from Storyblok:",s);break}s.data.stories.forEach(t=>{t.content&&t.content.categoryType&&Array.isArray(t.content.categoryType)&&t.content.categoryType.forEach(t=>{t&&t.trim().length>0&&e.set(t,(e.get(t)||0)+1)})});let a=s.data.total||0;if(r=100*t<a,++t>50){console.warn("Reached maximum page limit (50) when fetching categories");break}}return Array.from(e.entries()).sort((e,t)=>{let[,r]=e,[,s]=t;return s-r}).map(e=>{let[t]=e;return t}).filter(e=>"newsOrHelpfulResources"!==e)}catch(e){return console.error("Error fetching categories:",e),[]}}static async getFeaturedPosts(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:6;try{return(await l.get("cdn/stories",{starts_with:"blog-posts/",filter_query:{blog_or_news:{in:"blog"},categoryType:{in_array:"featuredPosts"}},sort_by:"first_published_at:desc",per_page:e,excluding_fields:"body",version:"published"})).data.stories.map(i)}catch(e){return console.error("Error fetching featured posts:",e),[]}}static async getBlogPostBySlug(e){try{let t=await l.get("cdn/stories",{starts_with:"blog-posts/",filter_query:{blog_or_news:{in:"blog"},slug:{in:e}},version:"published"});if(t.data.stories&&t.data.stories.length>0)return t.data.stories[0];return null}catch(t){return console.error("Error fetching blog post with slug ".concat(e,":"),t),null}}static async getNewsPosts(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12;try{let r,s=await l.get("cdn/stories",{starts_with:"blog-posts/",filter_query:{blog_or_news:{in:"news"}},sort_by:"content.published:desc",page:e,per_page:t,excluding_fields:"body",version:"published"}),a=s.data.total;return r="number"==typeof a?e*t<a:s.data.stories.length===t,{posts:s.data.stories.map(i),hasMore:r,totalPosts:a||0}}catch(e){return console.error("Error fetching news posts:",e),{posts:[],hasMore:!1,totalPosts:0}}}static async getRelatedPosts(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12,s="news"===e.content.blog_or_news?"news":"blog",a=(null!=(t=e.content.categoryType)?t:[]).find(e=>e&&!c.has(e)),o=async t=>{try{var a;return(null!=(a=(await l.get("cdn/stories",{starts_with:"blog-posts/",filter_query:{blog_or_news:{in:s},...t},sort_by:"first_published_at:desc",per_page:r+1,excluding_fields:"body",version:"published"})).data.stories)?a:[]).map(i)}catch(t){return console.error("Error fetching related posts for ".concat(e.slug,":"),t),[]}},[n,d]=await Promise.all([a?o({categoryType:{in_array:a}}):Promise.resolve([]),o({})]),h=new Set([e.slug]),u=[];for(let e of[...n,...d])if(!h.has(e.slug)&&(h.add(e.slug),u.push(e),u.length===r))break;return u}static async getAllPostCards(){let e=[];try{for(let r=1;r<=20;r+=1){var t;let s=null!=(t=(await l.get("cdn/stories",{starts_with:"blog-posts/",sort_by:"first_published_at:desc",page:r,per_page:100,excluding_fields:"body",version:"published"})).data.stories)?t:[];if(e.push(...s.filter(e=>{var t;
1return(null==(t=e.content)?void 0:t.title)&&e.slug}).map(i)),s.length<100)break}}catch(e){console.error("Error fetching all posts:",e)}return e}static async getNewsPostBySlug(e){try{let t=await l.get("cdn/stories",{starts_with:"blog-posts/",filter_query:{blog_or_news:{in:"news"},slug:{in:e}},version:"published"});if(t.data.stories&&t.data.stories.length>0)return t.data.stories[0];return null}catch(t){return console.error("Error fetching news post with slug ".concat(e,":"),t),null}}static groupPostsByCategory(e){let t={};return e.forEach(e=>{e.content.categoryType&&Array.isArray(e.content.categoryType)&&e.content.categoryType.forEach(r=>{r&&r.trim().length>0&&"newsOrHelpfulResources"!==r&&(t[r]||(t[r]=[]),t[r].push(e))})}),t}static selectRandomPostsPerCategory(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,r={};return Object.keys(e).forEach(s=>{let a=[...e[s]].sort(()=>.5-Math.random());r[s]=a.slice(0,t)}),r}}var h=r(3435),u=r(446);function g(e){let{post:t}=e,r=t.content.featured_image,a="";if("string"==typeof r&&r.trim())a=r.startsWith("http")?r:"https:".concat(r);else r&&"object"==typeof r&&null!==r&&"filename"in r&&"string"==typeof r.filename&&r.filename.trim().length>0&&(a=r.filename.startsWith("http")?r.filename:"https:".concat(r.filename));let o=new Date(t.content.published||t.published_at).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"});return(0,s.jsxs)("a",{href:"/post/".concat(t.slug,"?from=news"),className:"block bg-white rounded-lg shadow-lg overflow-hidden hover:shadow-xl transition-all duration-300 cursor-pointer group",children:[a&&(0,s.jsx)("div",{className:"aspect-video overflow-hidden",children:(0,s.jsx)("img",{src:a,alt:t.content.title,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-300"})}),(0,s.jsxs)("div",{className:"p-6",children:[(0,s.jsx)("div",{className:"text-sm text-gray-500 mb-2",children:o}),(0,s.jsx)("h3",{className:"text-xl font-bold text-gray-900 mb-3 line-clamp-2 group-hover:text-[#2B5C59] transition-colors",children:t.content.title}),(0,s.jsx)("p",{className:"text-gray-600 mb-4 line-clamp-3",children:t.content.summary}),(0,s.jsxs)("div",{className:"inline-flex items-center text-[#2B5C59] group-hover:text-[#1e4340] font-semibold transition-colors",children:["Read More",(0,s.jsx)("svg",{className:"ml-2 w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})]})]})}function m(e){let{initialPosts:t,initialHasMore:r}=e,[o,n]=(0,a.useState)(t),[l,i]=(0,a.useState)(0===t.length),[c,m]=(0,a.useState)(!1),[p,f]=(0,a.useState)(r),[y,b]=(0,a.useState)(1),[x,w]=(0,a.useState)(null);(0,a.useEffect)(()=>{0===t.length&&v()},[]);let v=async()=>{try{i(!0),w(null);let e=await d.getNewsPosts(1,u.E);n(e.posts),f(e.hasMore),b(1)}catch(e){console.error("Error loading news posts:",e),w("Failed to load news posts. Please try again later.")}finally{i(!1)}},_=async()=>{if(!c&&p)try{m(!0);let e=y+1,t=await d.getNewsPosts(e,u.E);n(e=>[...e,...t.posts]),f(t.hasMore),b(e)}catch(e){console.error("Error loading more news posts:",e),w("Failed to load more posts. Please try again.")}finally{m(!1)}};return l?(0,s.jsx)("main",{className:"pt-20",children:(0,s.jsx)("div",{className:"flex items-center justify-center min-h-[60vh]",children:(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-white mx-auto mb-4"}),(0,s.jsx)("p",{className:"text-white text-lg",children:"Loading news..."})]})})}):x?(0,s.jsx)("main",{className:"pt-20",children:(0,s.jsx)("div",{className:"flex items-center justify-center min-h-[60vh]",children:(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)("p",{className:"text-white text-lg mb-4",children:x}),(0,s.jsx)("button",{onClick:v,className:"bg-white text-[#2B5C59] px-6 py-3 rounded-lg font-semibold hover:bg-gray-100 transition-colors",children:"Try Again"})]})})}):(0,s.jsxs)("main",{children:[(0,s.jsx)("section",{className:"pb-16 px-4",children:(0,s.jsx)("div",{className:"max-w-6xl mx-auto",children:0===o.length?(0,s.jsx)("div",{className:"text-center py-16",children:(0,s.jsx)("p",{className:"text-white text-lg",children:"No news posts available at this time."})}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8 mb-12",children:o.map(e=>(0,s.jsx)(g,{post:e},e.id))}),p&&(0,s.jsx)("div",{className:"text-center",children:(0,s.jsx)("button",{onClick:_,disabled:c,
1className:"inline-flex items-center bg-white text-[#2B5C59] px-8 py-4 rounded-lg font-semibold hover:bg-gray-100 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:c?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-[#2B5C59] mr-2"}),"Loading..."]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("svg",{className:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})}),"Load older news stories"]})})})]})})}),(0,s.jsx)("section",{className:"py-16 px-4",style:{backgroundColor:"#1e4340"},children:(0,s.jsxs)("div",{className:"max-w-4xl mx-auto text-center",children:[(0,s.jsx)("h2",{className:"text-3xl font-bold text-white mb-4",children:"Ready to finish your work earlier each day?"}),(0,s.jsx)("p",{className:"text-xl text-white/90 mb-8",children:"Join thousands of professionals who use Sukha to achieve happier, more focused work."}),(0,s.jsx)("a",{href:h.l5,"data-cta":"closing",className:"inline-block bg-white text-[#2B5C59] hover:bg-gray-100 px-8 py-4 rounded-lg text-lg font-semibold transition-colors",children:"Claim Your Free 3-Day Trial"})]})})]})}},1182:(e,t,r)=>{"use strict";r.d(t,{default:()=>g});var s=r(5155),a=r(2115),o=r(2821),n=r(5889);let l=e=>{let{variant:t,size:r,className:s}=e;return function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,n.QP)((0,o.$)(t))}("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",(e=>{switch(e){case"destructive":return"bg-destructive text-destructive-foreground hover:bg-destructive/90";case"outline":return"border border-input bg-background hover:bg-accent hover:text-accent-foreground";case"secondary":return"bg-secondary text-secondary-foreground hover:bg-secondary/80";case"ghost":return"hover:bg-accent hover:text-accent-foreground";case"link":return"text-primary underline-offset-4 hover:underline";default:return"bg-primary text-primary-foreground hover:bg-primary/90"}})(t),(e=>{switch(e){case"sm":return"h-9 rounded-md px-3";case"lg":return"h-11 rounded-md px-8";case"icon":return"h-10 w-10";default:return"h-10 px-4 py-2"}})(r),s)},i=a.forwardRef((e,t)=>{let{className:r,variant:a,size:o,...n}=e;return(0,s.jsx)("button",{className:l({variant:a,size:o,className:r}),ref:t,...n})});i.displayName="Button";var c=r(2619),d=r.n(c),h=r(2973),u=r(3435);let g=e=>{let{delayMs:t=11e3}=e,[r,o]=(0,a.useState)(0===t);return(0,a.useEffect)(()=>{if(0===t)return;let e=setTimeout(()=>{o(!0)},t);return()=>clearTimeout(e)},[t]),(0,s.jsxs)("header",{className:"w-full px-4 py-3 flex justify-between items-center sticky top-0 z-50 transition-opacity duration-5000 ".concat(r?"opacity-100":"opacity-0"),children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-gradient-to-b from-black/50 via-black/30 to-transparent backdrop-blur-sm -z-10"}),(0,s.jsx)("div",{className:"flex items-center",children:(0,s.jsx)(d(),{href:"/",children:(0,s.jsx)("img",{src:"/assets/SukhaCircleS.webp",alt:"The Sukha Company",className:"h-14 w-auto"})})}),(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsx)("a",{href:u.oO,"data-cta":"header-login",className:"text-white hover:text-sukha",onClick:e=>{e.preventDefault(),(0,h.u4)("110a-uv_clicks_login_header",{location:"header"}),setTimeout(()=>{window.location.href=(0,u.wR)("header-login")},100)},children:"Login"}),(0,s.jsx)("a",{href:"https://calendly.com/steven-sukha/25min",className:l({className:"bg-[#FFBE58] hover:bg-[#e6ab4f] text-white rounded-md"}),children:"Book a 1:1 Demo"}),(0,s.jsx)(i,{className:"sukha-bg hover:bg-emerald-600 text-white rounded-md","data-cta":"header",onClick:()=>{(0,h.u4)("120a-uv_clicks_claim_trial_header",{location:"header"}),setTimeout(()=>
1{window.location.href=(0,u.wR)("header")},100)},children:"Claim your Free Trial"})]})]})}},7719:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,8706,23)),Promise.resolve().then(r.bind(r,1064)),Promise.resolve().then(r.bind(r,8455)),Promise.resolve().then(r.bind(r,1182))},8455:(e,t,r)=>{"use strict";r.d(t,{default:()=>o});var s=r(5155),a=r(2115);let o=e=>{let{delayMs:t=0}=e,[r,o]=(0,a.useState)(0===t);(0,a.useEffect)(()=>{if(0===t)return;let e=setTimeout(()=>o(!0),t);return()=>clearTimeout(e)},[t]);let n=new Date().getFullYear();return(0,s.jsxs)("footer",{className:"w-full py-6 text-white relative transition-opacity duration-5000 ".concat(r?"opacity-100":"opacity-0"),children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/50 via-black/30 to-transparent backdrop-blur-sm -z-10"}),(0,s.jsx)("div",{className:"container mx-auto px-4 max-w-6xl relative z-10",children:(0,s.jsxs)("div",{className:"flex flex-col md:flex-row justify-between items-center",children:[(0,s.jsx)("div",{className:"mb-4 md:mb-0",children:(0,s.jsxs)("p",{className:"text-sm",children:["\xa9 ",n," Sukha, Inc.\xa0\xa0",(0,s.jsx)("a",{href:"https://www.thesukha.co/terms",className:"text-sm",children:"Terms"}),"\xa0\xa0 ",(0,s.jsx)("a",{href:"https://www.thesukha.co/privacy",className:"text-sm",children:"Privacy"})]})}),(0,s.jsxs)("div",{className:"mb-4 md:mb-0",children:[(0,s.jsx)("a",{href:"https://www.thesukha.co/blog",className:"text-sm text-white",children:"The Sukha Blog"}),(0,s.jsx)("span",{className:"text-sm text-gray-400",children:"\xa0\xa0\xa0\xa0\xa0\xa0\xa0"}),(0,s.jsx)("a",{href:"https://www.thesukha.co/news",className:"text-sm text-white",children:"Industry News"}),(0,s.jsx)("span",{className:"text-sm text-gray-400",children:"\xa0\xa0\xa0\xa0\xa0\xa0\xa0"}),(0,s.jsx)("a",{href:"https://www.thesukha.co/blog/archive",className:"text-sm text-white",children:"All Posts"})]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-6",children:(0,s.jsx)("a",{href:"mailto:[email protected]",className:"text-sm hover:text-sukha",children:"Contact Us"})})]})})]})}}},e=>{e.O(0,[1058,2619,5521,2867,3435,8441,1255,7358],()=>e(e.s=7719)),_N_E=e.O()}]);
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.