(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1987],{5626:function(t,n,e){(window.__NEXT_P=window.__NEXT_P||[]).push(["/blog/wellness",function(){return e(72332)}])},73153:function(t,n,e){"use strict";e.d(n,{Z:function(){return d},C:function(){return p}});var s=e(85893),o=e(67294),r=e(4115),i=e(69925),a=e(45604),l=e(37429),_=e.n(l),u=e(94184),c=e.n(u);class d extends o.Component{sendEvent(t){(0,a.Ng)(t,this.props.id),this.props.onClick&&this.props.onClick()}static getDerivedStateFromProps(t,n){return t.toObj!==n.toObj?{toObj:n.toObj}:null}render(){let{children:t,className:n,to:e,toLegacySite:o,shadow:a,newWindow:l,id:u,toObj:d,onClick:p,autoTablet:g,variant:h,ariaLabel:m}=this.props,f=this.state.toObj?this.state.toObj:{...d},b=!!Object.keys(f).length,k=h?_()["buttonLink_".concat(h)]:_().buttonLink,L=c()(k,this.props.className);if(o)return(0,s.jsx)("a",{"aria-label":m,role:"link",id:u,href:e,className:L,target:l?"_blank":"_self",rel:"noreferrer",children:t});if(!b)return(0,s.jsx)(r.Z,{href:(0,i.E)(e),children:(0,s.jsx)("a",{"aria-label":m+"Open in new Window",role:"link",id:u,className:L,onClick:()=>this.sendEvent(e),target:l?"_blank":"_self",children:t})});if(b){let n=f.query&&f.query.handle?f.query.handle:"",e=f.as?f.as:"".concat(f.pathname,"/").concat(n);if(e){let{as:t,...n}={...f};f=n}return(0,s.jsx)(r.Z,{href:f,as:e,children:(0,s.jsx)("a",{"aria-label":m,role:"link",id:u,className:L,onClick:()=>this.sendEvent(e),children:t})})}return(0,s.jsx)(s.Fragment,{})}constructor(t){super(t),this.state={toObj:this.props.toObj},this.sendEvent=this.sendEvent.bind(this)}}var p=d},25662:function(t,n,e){"use strict";e.d(n,{x:function(){return u}});var s=e(85893),o=e(88317),r=e(73153),i=e(94184),a=e.n(i),l=e(85146),_=e.n(l);let u=t=>(0,s.jsx)(o._y,{src:t.imgMobile,alt:"",sources:[{mediaQuery:"(min-width: 600px)",src:t.imgDesktop}],className:_().container,children:(0,s.jsxs)("div",{className:a()("inner-paddings-x",_().hero_content),children:[t.subtext?(0,s.jsx)("p",{className:a()("light",_().subtext),children:t.subtext}):(0,s.jsx)(s.Fragment,{}),(0,s.jsx)("h1",{className:a()("light",_().heading),children:t.heading}),(0,s.jsx)("div",{className:_().hero_cta_c,children:(0,s.jsx)(r.Z,{variant:"white",to:t.href,className:_().hero_cta,children:"Read more"})})]})})},66159:function(t,n,e){"use strict";e.d(n,{S:function(){return v}});var s=e(85893),o=e(7297),r=e(17283),i=e(24145),a=e(46693),l=e(38067);function _(){let t=(0,o.Z)(["\n query GetAllPosts($after: String) {\n posts(first: 100, after: $after, where: { orderby: { field: DATE, order: DESC } }) {\n edges {\n node {\n id\n slug\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n }\n }\n }\n"]);return _=function(){return t},t}function u(){let t=(0,o.Z)(['\n {\n posts(first: 3, where: { orderby: { field: DATE, order: DESC }, nameIn: ["improved-sleep-quality", "optimal-sleeping-temperature", "accessing-a-deep-state-of-rest-with-nsdr"] }) {\n edges {\n node {\n id\n title\n slug\n featuredImage {\n node {\n altText\n sourceUrl\n }\n }\n date\n content(format: RENDERED)\n }\n }\n }\n }\n']);return u=function(){return t},t}function c(){let t=(0,o.Z)(['\n {\n posts(first: 3, where: { orderby: { field: DATE, order: DESC }, tagNotIn: "','", tagSlugIn: ["wellness", "sleep", "fitness", "science", "membership"] }) {\n edges {\n node {\n id\n title\n slug\n excerpt\n date\n featuredImage {\n node {\n altText\n sourceUrl\n }\n }\n content(format: RENDERED)\n }\n }\n }\n }\n']);return c=function(){return t},t}function d(){let t=(0,o.Z)(['\n query GetPostBySlug($slug: String) {\n postBy(slug: $slug) {\n id\n title\n slug\n excerpt\n featuredImage {\n node {\n altText\n sourceUrl\n }\n }\n date\n content(format: RENDERED)\n author {\n node {\n name\n slug\n posts(first: 4, where: { orderby: { field: DATE, order: DESC }, tagNotIn: "','", tagSlugIn: ["wellness", "sleep", "fitness", "science", "membership"] }) {\n edges {\n node {\n title\n slug\n excerpt\n date\n featuredImage {\n node {\n altText\n sourceUrl\n }\n }\n tags {\n edges {\n node {\n name\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n']);return d=function(){return t},t}function p(){let t=(0,o.Z)(['\n query GetLatestPostsByAuthor($author: String) {\n posts(first: 3, where: { authorName: $author, orderby: { field: DATE, order: DESC }, tagNotIn: "','", tagSlugIn: ["wellness", "sleep", "fitness", "science", "membership"] }) {\n edges {\n node {\n id\n slug\n title\n excerpt\n date\n featuredImage {\n node {\n altText\n sourceUrl\n }\n }\n }\n }\n }\n }\n']);return p=function(){return t},t}let g="dGVybToxMzc0",h=["wellness","sleep","fitness","science","membership"];(0,r.Ps)(_()),(0,r.Ps)(u()),(0,r.Ps)(c(),g),(0,r.Ps)(d(),g),(0,r.Ps)(p(),g),new i.f({ssrMode:!0,link:(0,a.L)({uri:"https://blog.eightsleep.com/graphql",credentials:"same-origin"}),cache:new l.h});var m=e(89728),f=e(41664),b=e.n(f),k=e(67294),L=e(484),x=e.n(L);let v=t=>{var n,e,o;let r=(0,k.useRef)(null),{post:i}=t;(0,k.useEffect)(()=>{if(r.current){var t;r.current.innerHTML=(null===(t=i.excerpt)||void 0===t?void 0:t.split("h.includes(t.node.name.toLowerCase()));return(0,s.jsxs)(b(),{href:"/blog/".concat(i.slug),className:x().post,style:t.style,children:[(0,s.jsx)("img",{className:x().img,src:(null===(e=i.featuredImage)||void 0===e?void 0:e.node.sourceUrl)||"https://repository-images.githubusercontent.com/410643287/8b3f76cf-81c8-4678-a1c1-5808c4ddcf79",alt:(null===(o=i.featuredImage)||void 0===o?void 0:o.node.altText)||"Empty image"}),(0,s.jsxs)("span",{children:[a&&a[0]?(0,s.jsx)("div",{className:x().tag,children:(0,s.jsx)("span",{children:a[0].node.name})}):(0,s.jsx)(s.Fragment,{}),(0,s.jsx)("h3",{className:x().h3,children:i.title}),i.excerpt?(0,s.jsx)("span",{className:x().excerpt,ref:r}):(0,s.jsx)(s.Fragment,{}),(0,s.jsx)("small",{className:x().date,children:(0,m.H)(i.date)})]})]},"post-".concat(i.id))}},72332:function(t,n,e){"use strict";e.r(n),e.d(n,{__N_SSG:function(){return d}});var s=e(85893);e(67294);var o=e(66508),r=e(25662),i=e(66159),a=e(94184),l=e.n(a),_=e(84398),u=e.n(_);let c=t=>(0,s.jsxs)(o.G,{children:[(0,s.jsx)(r.x,{href:"/blog/tips-on-stress-relief-for-good-sleep/",imgDesktop:"https://cdn.shopify.com/s/files/1/1354/6123/files/LgKUzY8zmDuTyHzegUJkl-transformed.jpg?v=1675432733",imgMobile:"https://cdn.shopify.com/s/files/1/1354/6123/files/LgKUzY8zmDuTyHzegUJkl-transformed.jpg?v=1675432733",heading:"Tips on Stress Relief for Good Sleep"}),(0,s.jsxs)("div",{className:"inner-paddings-x outer-margins-y",children:[(0,s.jsxs)("h2",{className:u().heading,children:["Latest posts from ",(0,s.jsx)("strong",{style:{color:"blue"},children:"Welness"})]}),(0,s.jsx)("div",{className:l()("grid","test",u().postslider),children:t.featured_posts.map((t,n)=>(0,s.jsx)(i.S,{post:t,style:{gridColumn:"".concat((4*n+1)%12," / span 4")}},"featured-post-".concat(n)))})]})]});var d=!0;n.default=c},89728:function(t,n,e){"use strict";e.d(n,{H:function(){return r},p:function(){return i}});var s=e(30381),o=e.n(s);let r=t=>{let n=new Date(t),e=o()(n).format("MMMM DD, YYYY");return e},i=(t,n,e,s)=>{let o=n?n.split(" 

","").replace(/(<([^>]+)>)/gi,"").split(".").slice(0,2).join(".")+".":"";return{title:t,meta:[{name:"description",content:o},{itemprop:"name",content:t},{itemprop:"description",content:o},{itemprop:"image",content:e},{property:"og:url",content:"https://www.eightsleep.com/blog/".concat(s)},{property:"og:type",content:"website"},{property:"og:title",content:t},{property:"og:description",content:o},{property:"og:image",content:e},{name:"twitter:card",content:"summary_large_image"},{name:"twitter:title",content:t},{name:"twitter:description",content:o},{name:"twitter:image",content:e}]}}},37429:function(t){t.exports={buttonLink:"ButtonLink_buttonLink__LdU96",buttonLink_transparent:"ButtonLink_buttonLink_transparent__OdN1k",buttonLink_transparent_blue:"ButtonLink_buttonLink_transparent_blue__KlLoD ButtonLink_buttonLink__LdU96",buttonLink_outline:"ButtonLink_buttonLink_outline__ge_qn ButtonLink_buttonLink__LdU96",buttonLink_outline_thin:"ButtonLink_buttonLink_outline_thin__HLzkQ ButtonLink_buttonLink__LdU96",buttonLink_block:"ButtonLink_buttonLink_block__4w0wg ButtonLink_buttonLink__LdU96",buttonLink_electricBlue:"ButtonLink_buttonLink_electricBlue__GsMet ButtonLink_buttonLink__LdU96",buttonLink_navbar:"ButtonLink_buttonLink_navbar__RLw_D ButtonLink_buttonLink__LdU96",buttonLink_nav_shop:"ButtonLink_buttonLink_nav_shop__VGOSf ButtonLink_buttonLink__LdU96",buttonLink_nav_shop_white:"ButtonLink_buttonLink_nav_shop_white__mNZGR ButtonLink_buttonLink_nav_shop__VGOSf ButtonLink_buttonLink__LdU96",buttonLink_white:"ButtonLink_buttonLink_white__AoEjS ButtonLink_buttonLink__LdU96",buttonLink_dark_red:"ButtonLink_buttonLink_dark_red__YWx9F ButtonLink_buttonLink__LdU96"}},85146:function(t){t.exports={container:"HomeHero_container__9AY__",hero_content:"HomeHero_hero_content__ZZ0OK",subtext:"HomeHero_subtext__w5_kG",heading:"HomeHero_heading__RZWrg",hero_cta_c:"HomeHero_hero_cta_c__9RoU6"}},484:function(t){t.exports={post:"Post_post__HGUDA",h3:"Post_h3__gOCzd",img:"Post_img__vzX8V",excerpt:"Post_excerpt__K1vpG",date:"Post_date__9vV_t",tag:"Post_tag__o4uGC",post_excerpt:"Post_post_excerpt__zP9lV",thumbnail_c:"Post_thumbnail_c__4RqD7",text:"Post_text__cLvqu",title:"Post_title__xIbPi",html:"Post_html__GSR2n"}},84398:function(t){t.exports={heading:"pagestyles_heading__BB_qn",posts:"pagestyles_posts__Jpo7X",post:"pagestyles_post__bePn1",img:"pagestyles_img__gHS5q",h3:"pagestyles_h3__4S_1w",postslider:"pagestyles_postslider__8qQc0",excerpts:"pagestyles_excerpts__pQGJq"}}},function(t){t.O(0,[4885,5174,9774,2888,179],function(){return t(t.s=5626)}),_N_E=t.O()}]);