1var Ue=Object.defineProperty;var ze=(t,i,n)=>i in t?Ue(t,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[i]=n;var Le=(t,i,n)=>ze(t,typeof i!="symbol"?i+"":i,n);import{i as Je,a as Ke,b as Ze,w as Qe}from"./shell-DwI4xSXw.js";/* empty css */import{c as We,G as Ae}from"./sensei-CgG5BHSn.js";import{a as He,i as Xe,b as et,s as tt,t as Te,c as it,d as qe,e as nt}from"./sticky-install-bar-CJWkUHQV.js";const Ce={settle:"#cdb0f7",breath:"#5fd4c0",body:"#9b7bf0",focus:"#e86fb5",nidra:"#6f7bf7",silence:"rgba(255,255,255,0.16)",move:"#f2c86b"},fe=[{id:"morning",title:"Morning routine",sub:"Ready when you wake. Longer today, new voice.",time:"7:12 AM",night:!1,steps:[{sensei:"Good morning, Maya. Your usual 10 minutes is ready.",g:"brighten"},{card:{kicker:"Made for this morning",title:"Morning Reset",mins:10,voice:"Dan",tag:"Awake ending",practices:[["Arrive","settle",1.5],["Breathing","breath",3],["Body scan","body",3.5],["Set your focus","focus",2]]}},{wait:1400},{you:"Can we make it 15 today? And a female voice this time."},{sensei:"Of course. Hereâs your 15 minutes with Courtney.",g:"affirm"},{edit:{mins:15,voice:"Courtney",practices:[1.5,4,6.5,3]}},{sensei:"I gave the extra time to the body scan. It helped you most last week.",g:"sway"},{begin:!0}]},{id:"night",title:"Awake at 3 a.m.",sub:"Back to sleep, with no wake-up at the end.",time:"3:04 AM",night:!0,steps:[{you:"Awake again. My mind keeps replaying tomorrow."},{sensei:"That happens. Letâs not fight it. Your body can go first, and your mind will follow.",g:"soften"},{card:{kicker:"For right now",title:"Back to Sleep",mins:20,voice:"Amaya",tag:"Sleep ending",practices:[["Long exhales","breath",5],["Body scan","body",7],["Yoga Nidra","nidra",8]]}},{wait:900},{you:"Please, no bell at the end. And make it a long one."},{sensei:"Of course. Itâs now 30 minutes, and it fades out so gently that nothing will wake you.",g:"affirm"},{edit:{mins:30,tag:"No bell, fades out",practices:[6,9,15]}},{wait:700},{you:"Can you add binaural beats and some nature sounds too?"},{sensei:"Sure. Iâve added 2 Hz binaural beats, the slow rhythm of deep sleep, with a quiet stream running underneath.",g:"nod"},{edit:{sounds:["2 Hz binaural beats","Water stream"]}},{begin:!0}]},{id:"call",title:"Big call soon",sub:"Five minutes, and less talking.",time:"10:48 AM",night:!1,steps:[{you:"Big pitch in 10 minutes and my heart is pounding."},{sensei:"Five minutes is enough. Steady breath, clear head, and you walk in awake.",g:"affirm"},{card:{kicker:"Before the call",title:"Steady and Sharp",mins:5,voice:"Asaf",tag:"Awake ending",practices:[["Slow breathing","breath",2],["Ground","settle",1.5],["Focus","focus",1.5]]}},{wait:900},{you:"Can you keep the talking to a minimum?"},{sensei:"Done. Fewer words, more breathing.",g:"nod"},{edit:{tag:"Light guidance",practices:[2.6,1,1.4]}},{begin:!0}]},{id:"first",title:"First time",sub:"Never meditated? Start right here.",time:"12:30 PM",night:!1,steps:[{sensei:"Hi, Iâm Sensei. Have you meditated before?",g:"incline"},{you:"Never. Honestly, I donât know where to start."},{sensei:"Perfect. Start here. Five minutes, and Iâll tell you what to do the whole way.",g:"nod"},{card:{kicker:"Your first session",title:"First Sit",mins:5,voice:"Courtney",tag:"Beginner",practices:[["Arrive","settle",1],["Breathing","breath",2],["Notice","body",2]]}},{wait:900},{you:"Can I do it at my desk?"},{sensei:"Yes. Stay in your chair. Eyes open is fine.",g:"affirm"},{edit:{tag:"At your desk"}},{begin:!0}]},{id:"practice",title:"Years of practice",sub:"Thirty minutes, mostly silence.",time:"6:05 AM",night:!1,steps:[{you:"Iâve sat for years. Give me 30 minutes, mostly silence."},{sensei:"Understood. A short settle, then long quiet stretches. Iâll bring you back gently.",g:"bow"},{card:{kicker:"For your practice",title:"Open Sitting",mins:30,voice:"Dan",tag:"Minimal guidance",practices:[["Settle","settle",3],["Silence","silence",12],["Breath","breath",1],["Silence","silence",12],["Return","body",2]]}},{begin:!0}]}],re=[{id:"evening",title:"Evening wind-down",sub:"Long exhales did it. Next time, more of them.",device:"Apple Watch",time:"9:40 PM",session:"Evening Wind-down",mins:10,rest:64,practices:[["Arrive","settle",1],["Long exhales","breath",3],["Body scan","body",4],["Rest","nidra",2]],hr:[82,82,81,81,80,78,75,73,72,71,70,69,68,67,66,65,64,63,62,62,61,60,60,59,60,60,61,61,62,62],signals:[[.03,"Started at 82 bpm, a little high for you"],[.2,"Dropping fastest during long exhales"],[.57,"Below your resting heart rate"],[.97,"Stayed there for the rest of the session"]],best:"Long exhales",learn:{say:["Your heart rate fell fastest during the long exhales.","Next time Iâll open with them and give them two more minutes."],chips:["Long exhales work for you","Evenings settle you fast","Court
1neyâs voice suits bedtime"],next:{title:"Evening Wind-down",practices:[1,5,3,1],delta:"+2 min long exhales"}}},{id:"run",title:"After a run",sub:"A racing heart takes longer. Sensei adjusts.",device:"WHOOP",time:"6:30 PM",session:"Cool Down",mins:12,rest:58,practices:[["Arrive","settle",1],["Slow breathing","breath",3],["Body scan","body",6],["Rest","nidra",2]],hr:[104,103,101,99,97,94,92,89,87,85,83,80,78,76,74,72,70,68,66,64,63,62,61,60,59,58,57,57,58,57],signals:[[.03,"Started at 104 bpm, straight from your run"],[.35,"Coming down steadily"],[.86,"Below your resting heart rate"],[.97,"Just in time"]],best:"Slow breathing",learn:{say:["After a run, your body needs more time to come down.","Next time youâve trained, Iâll start with five minutes of slow breathing."],chips:["Workouts need a longer settle","Slow breathing first after exercise"],next:{title:"Cool Down",practices:[1,6,4,1],delta:"+3 min slow breathing"}}},{id:"desk",title:"Midday at the desk",sub:"No recovery today, and thatâs useful too.",device:"AirPods Pro 3",time:"1:15 PM",session:"Desk Reset",mins:5,rest:66,practices:[["Arrive","settle",1],["Body scan","body",2.5],["Focus","focus",1.5]],hr:[76,76,75,75,75,74,74,73,73,72,72,72,71,71,70,70,70,69,69,69],signals:[[.05,"Started at 76 bpm"],[.5,"Body scan barely moved it"],[.95,"Ended 7 bpm lower, above your resting rate"]],best:"Focus",learn:{say:["Your heart rate stayed steady at your desk. Thatâs fine for a focus break.","Tomorrow Iâll swap the body scan for rhythmic breathing. It moved you more on Monday."],chips:["At your desk, breathing beats body scans","Short breaks work best at midday"],next:{title:"Desk Reset",practices:[1,2.5,1.5],labels:["Arrive","Rhythmic breathing","Focus"],colors:["settle","breath","focus"],delta:"Rhythmic breathing in"}}},{id:"bed",title:"Before bed",sub:"Yoga Nidra took you deepest. It stays.",device:"Fitbit",time:"10:55 PM",session:"Deep Rest",mins:20,rest:61,practices:[["Long exhales","breath",4],["Body scan","body",6],["Yoga Nidra","nidra",10]],hr:[72,71,71,70,69,68,68,67,66,65,64,63,62,61,60,59,58,57,56,56,55,55,55,54,55,55,54,55,55,56],signals:[[.03,"Started at 72 bpm"],[.47,"Below your resting heart rate"],[.6,"Deepest drop during Yoga Nidra"],[.97,"Still settling as it faded out"]],best:"Yoga Nidra",learn:{say:["Yoga Nidra took you deepest tonight.","Iâll keep it at the heart of your bedtime sessions."],chips:["Yoga Nidra helps you sleep","Bedtime sessions can run longer"],next:{title:"Deep Rest",practices:[3,5,12],delta:"+2 min Yoga Nidra"}}}];function e(t,i="",n={},...d){const f=document.createElement(t);i&&(f.className=i);for(const[r,h]of Object.entries(n))f.setAttribute(r,h);return f.append(...d),f}function X(t){const i=document.createElement("span");return i.className="dj-demo-ico",i.innerHTML=t,i}const ee={replay:'<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 12a9 9 0 1 0 3-6.7"/><path d="M3 3v6h6"/></svg>',send:'<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 19V5M5 12l7-7 7 7"/></svg>',mic:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="9" y="3" width="6" height="11" rx="3"/><path d="M5 11a7 7 0 0 0 14 0M12 18v3"/></svg>',play:'<svg width="10" height="10" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M7 4v16l13-8z"/></svg>',sound:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 12h2M6 8v8M10 5v14M14 8v8M18 10v4M22 12h0"/></svg>',heart:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20.8 4.6a5.5 5.5 0 0 0-7.8 0L12 5.7l-1-1.1a5.5 5.5 0 0 0-7.8 7.8L12 21.2l8.8-8.8a5.5 5.5 0 0 0 0-7.8z"/></svg>'},$e=()=>typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;class Oe{constructor(){Le(this,"token",0);Le(this,"timers",[])}start(){return this.stop(),++this.token}
1stop(){this.token++,this.timers.forEach(i=>window.clearTimeout(i)),this.timers=[]}live(i){return i===this.token}wait(i){return new Promise(n=>this.timers.push(window.setTimeout(n,i)))}}function Ge(t,i,n){let d=!1;const f=v=>{v!==d&&(d=v,(v?i:n)())};let r=!1;new IntersectionObserver(v=>{r=v.some(k=>k.isIntersecting),f(r&&document.visibilityState==="visible")},{threshold:.35}).observe(t),document.addEventListener("visibilitychange",()=>f(r&&document.visibilityState==="visible"))}function Ve(t,i,n){const d=i.map((r,h)=>{const v=e("span","dj-moment__prog"),k=e("button","dj-moment",{type:"button",role:"tab","aria-selected":"false","data-moment":r.id},e("span","dj-moment__top",{},e("span","dj-moment__title",{},r.title),e("span","dj-moment__meta",{},r.meta)),e("span","dj-moment__sub",{},r.sub),v);return k.addEventListener("click",()=>n(h)),{b:k,bar:v}});t.replaceChildren(...d.map(r=>r.b));let f=0;return{select(r){var v;f=r,d.forEach((k,D)=>{k.b.setAttribute("aria-selected",D===r?"true":"false"),k.bar.style.width="0%"});const h=(v=d[r])==null?void 0:v.b;h&&t.scrollWidth>t.clientWidth&&t.scrollTo({left:h.offsetLeft-16,behavior:$e()?"auto":"smooth"})},progress(r){const h=d[f];h&&(h.bar.style.width=`${Math.round(r*100)}%`)}}}const De={breathe:"Here for you",open:"Listening",consider:"Making your session",sway:"Talking",affirm:"On it",nod:"Got it",brighten:"Your session is ready",soften:"With you",bow:"With you",incline:"Asking"};function st(t,i={}){const n=t.querySelector("[data-demo-stage]"),d=t.querySelector("[data-demo-moments]");if(!n||!d||!fe.length)return;const f=We(),r=e("span","dm-time"),h=e("button","dm-replay",{type:"button","aria-label":"Replay this conversation"},X(ee.replay)),v=e("span"),k=e("div","dm-feed",{"aria-live":"polite"}),D=e("span"),pe=e("span","dm-caret"),te=e("span","dm-ph",{},"Tell Sensei how you feel"),R=e("div","dm-input",{},te),T=e("span","dm-send",{"aria-hidden":"true"},X(ee.send)),Y=e("div","dm",{},e("div","dm-bg",{"aria-hidden":"true"}),e("div","dm-shade",{"aria-hidden":"true"}),e("div","dm-head",{},r,h,e("div","dm-avatar",{},f.el),e("div","dm-name",{},"Sensei"),e("div","dm-status",{},e("span","dm-dot"),v)),k,e("div","dm-composer",{"aria-hidden":"true"},R,e("span","dm-mic",{},X(ee.mic)),T));n.replaceChildren(Y);const g=new Oe;let N=0,$=null,E=null;const P=(a,u)=>{f.set(a,u),v.textContent=De[a]??"Here for you",Ae[a]&&window.setTimeout(()=>{v.textContent=De.breathe},Ae[a])},ie=a=>{a?(D.textContent=a,R.replaceChildren(D,pe),T.classList.add("dm-send--on")):(R.replaceChildren(te),T.classList.remove("dm-send--on"))},q=(a,u=!1)=>{var w;const m=e("div",u?"dm-row dm-row--you":"dm-row",{},a);for(k.append(m);k.children.length>8;)(w=k.firstElementChild)==null||w.remove();return m},ne=a=>a.map(([u,m,w])=>({label:u,color:Ce[m]??m,w}));function se(a){const u=e("span","dm-kicker",{},a.kicker),m=e("span","dm-mins",{},String(a.mins),e("small","",{},"min")),w=e("div","dm-title",{},a.title),j=new Set,M=a.mods.map(s=>s.label).filter(s=>!j.has(s)&&!!j.add(s)),O=e("p","dm-steps",{},...M.flatMap((s,F)=>F?[e("span","dm-steps__sep",{"aria-hidden":"true"},"·"),s]:[s])),ge=e("span"),ae=e("p","dm-sounds",{},X(ee.sound),ge),U=s=>{ge.textContent=(s??[]).join(" · "),ae.hidden=!s||!s.length};U(a.sounds);const ce=e("span","",{},a.voice),ue=e("span","dm-ava",{},a.voice.charAt(0)),z=e("span","dm-voice",{},ue,ce,e("span","dm-wave",{"aria-hidden":"true"},e("b"),e("b"),e("b"),e("b"))),Z=e("span","dm-tag",{},a.tag),G=e("span","",{},"Begin"),C=e("span","dm-begin",{},e("span","dm-play",{},X(ee.play)),G),Q=e("div","dm-card",{},e("div","dm-card__top",{},u,m),w,O,ae,e("div","dm-foot",{},z,Z,C)),W=(s,F)=>{s.classList.remove(F),s.offsetWidth,s.classList.add(F)};return{el:Q,async edit(s,F){if($&&(s.voice&&($.voice=s.voice,ce.textContent=s.voice,ue.textContent=s.voice.charAt(0),W(z,"dm-voice--new")),s.tag&&($.tag=s.tag,Z.textContent=s.tag,W(Z,"dm-tag--new")),s.sounds&&($.sounds=s.sounds,U(s.sounds),W(ae,"dm-sounds--new")),s.mins&&s.mins!==$.mins)){W(m,"dm-mins--tick");for(let I=$.mins+1;I<=s.mins;I++){if(await g.wait(110),!g.live(F))return;m.firstChild.textContent=String(I)}$.mins=s.mins}},go(){C.classList.add("dm-begin--go"),G.textContent="Starting",Q.append(e("span","dm-bar"))}}}
1async function Se(a,u){if("wait"in a)return g.wait(a.wait);if("you"in a){P("open"),await g.wait(500);for(let m=1;m<=a.you.length;m++){if(!g.live(u))return;ie(a.you.slice(0,m));const w=a.you[m-1];await g.wait(w===" "?55:",.?!".includes(w)?180:26+Math.random()*38)}return await g.wait(420),g.live(u)?(ie(""),q(e("div","dm-you",{},a.you),!0),P("nod"),g.wait(700)):void 0}if("sensei"in a){P("consider");const m=q(e("div","dm-think",{"aria-label":"Sensei is typing"},e("span"),e("span"),e("span")));if(await g.wait(1100+Math.min(a.sensei.length*6,700)),!g.live(u))return;const w=e("div","dm-sensei");m.replaceChildren(w),P(a.g??"sway");const j=a.sensei.split(" ");for(let M=1;M<=j.length;M++){if(!g.live(u))return;w.textContent=j.slice(0,M).join(" "),await g.wait(70+Math.random()*50)}return Ae[a.g??"sway"]||P("breathe"),g.wait(650)}if("card"in a)return P("consider"),await g.wait(900),g.live(u)?($={...a.card,mods:ne(a.card.practices)},E=se($),q(E.el),P("brighten"),g.wait(1800)):void 0;if("edit"in a)return P("affirm"),await(E==null?void 0:E.edit(a.edit,u)),g.wait(1500);if("begin"in a)return await g.wait(500),g.live(u)?(E==null||E.go(),P("bow"),g.wait(2600)):void 0}function de(a){k.replaceChildren(),ie(""),$=null,E=null,r.textContent=a.time,Y.classList.toggle("dm-night",a.night),f.night(a.night),P("breathe")}function he(a){de(a);for(const u of a.steps)if("sensei"in u&&q(e("div","dm-sensei",{},u.sensei)),"you"in u&&q(e("div","dm-you",{},u.you),!0),"card"in u&&($={...u.card,mods:ne(u.card.practices)},E=se($),q(E.el)),"edit"in u&&E&&$){const m=u.edit,w=$;m.mins&&(w.mins=m.mins),m.voice&&(w.voice=m.voice),m.tag&&(w.tag=m.tag),m.sounds&&(w.sounds=m.sounds),m.practices&&(w.mods=w.mods.map((M,O)=>({...M,w:m.practices[O]??M.w})));const j=se(w);E.el.replaceWith(j.el),E=j}}const J=Ve(d,fe.map(a=>({id:a.id,title:a.title,sub:a.sub,meta:a.time})),a=>{N=a,K(!0)});async function K(a=!1){var w,j;const u=fe[N];J.select(N),(w=i.onMoment)==null||w.call(i,u),a&&t.dispatchEvent(new CustomEvent("demo:pick",{detail:u.id}));const m=g.start();if(de(u),$e()){he(u),J.progress(1);return}await g.wait(900);for(let M=0;M<u.steps.length;M++){if(!g.live(m))return;await Se(u.steps[M],m),J.progress((M+1)/u.steps.length)}g.live(m)&&((j=i.onComplete)==null||j.call(i,u),await g.wait(4200),g.live(m)&&(N=(N+1)%fe.length,K()))}h.addEventListener("click",()=>K(!0)),J.select(0),de(fe[0]),Ge(t,()=>K(),()=>g.stop())}const at="http://www.w3.org/2000/svg",ot=9e3,H=600,le=t=>{const i=Math.max(0,Math.round(t));return`${Math.floor(i/60)}:${String(i%60).padStart(2,"0")}`};function rt(t){if(!t.length)return"";let i=`M${t[0][0].toFixed(1)},${t[0][1].toFixed(1)}`;for(let n=0;n<t.length-1;n++){const d=t[Math.max(n-1,0)],f=t[n],r=t[n+1],h=t[Math.min(n+2,t.length-1)];i+=` C${(f[0]+(r[0]-d[0])/6).toFixed(1)},${(f[1]+(r[1]-d[1])/6).toFixed(1)} ${(r[0]-(h[0]-f[0])/6).toFixed(1)},${(r[1]-(h[1]-f[1])/6).toFixed(1)} ${r[0].toFixed(1)},${r[1].toFixed(1)}`}return i}const A=(t,i={})=>{const n=document.createElementNS(at,t);for(const[d,f]of Object.entries(i))n.setAttribute(d,f);return n};function Ye(t,i=1){const n=t.hr.length,d=t.mins*60,f=d/n;let r=0;for(let v=0;v<n;v++){const k=v/n;if(k>=i)break;t.hr[v]<t.rest&&(r+=Math.min(f,(i-k)*d))}const h=t.hr.findIndex(v=>v<t.rest);return{recovery:r,firstBelow:h>=0?h*f:-1,start:t.hr[0],lowest:Math.min(...t.hr),total:d}}function lt(t,i={}){var Re;const n=t.querySelector("[data-demo-stage]"),d=t.querySelector("[data-demo-moments]");if(!n||!d||!re.length)return;const f=e("span"),r=e("span","fb-dev",{},e("span","fb-dev__ico",{},X(ee.heart)),f,e("span","fb-dev__dot")),h=e("span"),v=e("span","fb-pill",{},e("span","fb-pill__dot"),h),k=e("button","fb-replay",{type:"button","aria-label":"Replay this session"},X(ee.replay)),D=e("span","fb-sess__name"),pe=e("span","fb-sess__meta"),te=(o,c="")=>{const l=e("div","fb-stat__k",{},o),p=e("div","fb-stat__v");return{el:e("div",`fb-stat ${c}`,{},l,p),key:l,val:p}},R=te("Heart rate"),T=te("Session"),Y=te("Deep recovery","fb-stat--rec"),g=A("svg",{viewBox:`0 0 ${H} 200`,preserveAspectRatio:"none","aria-hidden":"true"}),N="fbg"+Math.random().toString(36).slice(2,7),$=A("defs"),E=A("linearGradient",{id:`${N}l`,x1:"0",x2:"1",y1:"0",y2:"0"});E.append(A("stop",{offset:"0","stop-color":"#ff6b8b"}),A("stop",{offset:"1","stop-color":"#8c54ff"}));const P=A("clipPath",{id:`${N}a`}),ie=A("rect",{x:"-10",y:"-10",width:String(H+20),height:"0"});P.append(ie);const q=A("clipPath",{id:`${N}c`}),ne=A("rect",{x:"-10",y:"0",width:String(H+20),height:"0"});
1q.append(ne);const se=A("linearGradient",{id:`${N}f`,x1:"0",x2:"0",y1:"0",y2:"1"}),Se=A("stop",{offset:"0","stop-color":"#3fe0c8","stop-opacity":"0.55"}),de=A("stop",{offset:"1","stop-color":"#3fe0c8","stop-opacity":"0.14"});se.append(Se,de),$.append(E,P,q,se);const he=A("line",{class:"fb-grid",x1:"0",x2:String(H),"vector-effect":"non-scaling-stroke"}),J=A("line",{class:"fb-grid",x1:"0",x2:String(H),"vector-effect":"non-scaling-stroke"}),K=A("path",{class:"fb-fill",fill:`url(#${N}f)`,"clip-path":`url(#${N}c)`}),a=A("line",{class:"fb-rest",x1:"0",x2:String(H),"vector-effect":"non-scaling-stroke"}),u=A("path",{class:"fb-line",stroke:`url(#${N}l)`,"clip-path":`url(#${N}a)`,"vector-effect":"non-scaling-stroke"}),m=A("path",{class:"fb-line fb-line--below","clip-path":`url(#${N}c)`,"vector-effect":"non-scaling-stroke"});g.append($,he,J,K,a,u,m);const w=e("span","fb-restlabel"),j=e("div","fb-marks",{"aria-hidden":"true"}),M=e("span","fb-head",{"aria-hidden":"true"}),O=e("span","fb-low-pt",{"aria-hidden":"true"}),ge=e("div","fb-graph",{},g,w,j,M,O),ae=e("div","fb-rib",{"aria-hidden":"true"}),U=e("div","fb-log__list"),ce=e("div","fb-k"),ue=e("div","fb-log",{},ce,U),z=e("div","fb-learn"),Z=e("div","fb-low",{"aria-live":"polite"},ue),G=e("div","fb",{},e("div","fb-top",{},r,e("span","fb-top__r",{},v,k)),e("div","fb-sess",{},D,pe),e("div","fb-stats",{},R.el,T.el,Y.el),ge,ae,Z);n.replaceChildren(G);const C=new Oe;let Q=0,W=0,s=re[0],F=[],I=200,be=[],ve=0,we=0;const me=(o,c)=>{h.textContent=o,v.className=`fb-pill ${c}`};function Ee(){const o=Math.min(...s.hr,s.rest)-1.5,c=Math.max(...s.hr)+3,l=_=>8+(c-_)/(c-o)*(I-16),p=s.hr.length;F=s.hr.map((_,S)=>[S/(p-1)*H,l(_)]);const y=l(s.rest);g.setAttribute("viewBox",`0 0 ${H} ${I}`);for(const[_,S]of[[he,I*.25],[J,I*.75],[a,y]])_.setAttribute("y1",S.toFixed(1)),_.setAttribute("y2",S.toFixed(1));return we=y,ie.setAttribute("height",(y+10).toFixed(1)),ne.setAttribute("y",y.toFixed(1)),ne.setAttribute("height",String(I-y+10)),w.style.top=`${(y/I*100).toFixed(2)}%`,y}function Me(o){var V;const c=F.length,l=o*(c-1),p=Math.floor(l),y=l-p,_=F.slice(0,p+1);let S=F[Math.min(p,c-1)];if(p<c-1&&o>0){const B=F[p],ke=F[p+1];S=[B[0]+(ke[0]-B[0])*y,B[1]+(ke[1]-B[1])*y],_.push(S)}const L=o>0?rt(_):"";u.setAttribute("d",L),m.setAttribute("d",L),K.setAttribute("d",o>0?`${L} L${S[0].toFixed(1)},${we.toFixed(1)} L0,${we.toFixed(1)} Z`:""),M.classList.toggle("fb-head--below",S[1]>we),M.style.left=`${(S[0]/H*100).toFixed(2)}%`,M.style.top=`${(S[1]/I*100).toFixed(2)}%`;const b=p<c-1?s.hr[p]+(s.hr[p+1]-s.hr[p])*y:s.hr[c-1],x=Ye(s,o);for(R.val.replaceChildren(String(Math.round(b)),e("small","",{},"bpm")),T.val.textContent=le(o*x.total),Y.val.textContent=le(x.recovery),Y.el.classList.toggle("fb-stat--hot",x.recovery>0),me(`Live · ${le(o*x.total)}`,"fb-pill--live"),be.forEach(B=>B.el.classList.toggle("fb-seg--on",o>=B.a&&o<B.b||o>=1&&B.b>=1));ve<s.signals.length&&s.signals[ve][0]<=o;){const[B,ke]=s.signals[ve++],Pe=Math.round(B*(c-1)),_e=e("span","fb-mark");for(_e.style.left=`${(Pe/(c-1)*100).toFixed(2)}%`,_e.style.top=`${(F[Pe][1]/I*100).toFixed(2)}%`,j.append(_e),U.append(e("div","fb-log__row",{},e("span","fb-log__t",{},le(B*x.total)),e("span","",{},ke)));U.children.length>4;)(V=U.firstElementChild)==null||V.remove()}}function Fe(){const o=Ye(s);R.key.textContent="Heart rate",R.val.replaceChildren(`${o.start} â ${o.lowest}`,e("small","",{},"bpm")),T.key.textContent=o.firstBelow>=0?"Below resting at":"Resting rate",T.val.textContent=o.firstBelow>=0?le(o.firstBelow):"Stayed above",Y.val.textContent=o.recovery>0?le(o.recovery):"Not today",[R,T,Y].forEach(l=>{l.el.classList.remove("fb-stat--settle"),l.el.offsetWidth,l.el.classList.add("fb-stat--settle")}),be.forEach(l=>{l.el.classList.remove("fb-seg--on"),l.label===s.best&&(l.el.classList.add("fb-seg--best"),l.el.querySelector(".fb-seg__lab").textContent=`${l.label} · biggest drop`)}),M.hidden=!0;const c=s.hr.indexOf(o.lowest);c>=0&&o.lowest<s.rest&&F[c]&&(O.style.left=`${(F[c][0]/H*100).toFixed(2)}%`,O.style.top=`${(F[c][1]/I*100).toFixed(2)}%`,O.hidden=!1),me("Session complete","fb-pill--done")}function Be(o){s=o,cancelAnimationFrame(Q),G.classList.remove("fb--learn"),I=G.classList.contains("fb--compact")?150:200,Ee(),f.textContent=o.device,r.className="fb-dev fb-dev--pair",D.textContent=o.session,pe.textContent=`${o.mins} min · ${o.time}`,w.textContent=`Your resting heart rate · ${o.rest}`,R.key.textContent="Heart rate",T.key.textContent="Session",R.val.replaceChildren("--",e("small","",{},"bpm")),T.val.textContent="0:00",Y.val.textContent="0:00",[R,T,Y].forEach(p=>p.el.classList.remove("fb-stat--settle","fb-stat--hot")),j.replaceChildren(),U.replaceChildren(),ve=0,ce.textContent=`What your ${o.device} picked up`,Z.replaceChildren(ue),M.hidden=!1,O.hidden=!0;const c=o.practices.reduce((p,y)=>p+y[2],0)||1;let l=0;be=o.practices.map(([p,y,_])=>{const S=e("div","fb-seg__bar");S.style.background=Ce[y]??y;const L=e("div","fb-seg",{},S,e("div","fb-seg__lab",{},p));L.style.flexGrow=String(_);const b=l/c;return l+=_,{el:L,a:b,b:l/c,label:p}}),ae.replaceChildren(...be.map(p=>p.el)),me("Connecting",""),Me(0),R.val.replaceChildren("--",e("small","",{},"bpm")),me("Connecting","")}function Ne(o){const c=s.learn.next,l=b=>Ce[c.colors&&c.colors[b]||s.practices[b][1]],p=b=>e("div",b?"fb-mini fb-mini--old":"fb-mini",{},...s.practices.map((x,V)=>{const B=e("i");return B.style.flexGrow=String(b||!o?x[2]:c.practices[V]??x[2]),B.style.background=b?Ce[x[1]]:l(V),B})),y=new Set,_=e("div","fb-legend",{},...s.practices.map((b,x)=>({label:c.labels&&c.labels[x]||b[0],color:l(x)}
1)).filter(b=>!y.has(b.label)&&!!y.add(b.label)).map(b=>{const x=e("b");return x.style.background=b.color,e("span","",{},x,b.label)})),S=p(!1);return{el:e("div","fb-next",{},e("div","fb-next__top",{},e("div","",{},e("div","fb-k fb-k--accent",{},"Your next session"),e("div","fb-next__t",{},c.title)),e("span","fb-delta",{},c.delta)),e("div","fb-ribrow",{},e("span","",{},"Last time"),p(!0)),e("div","fb-ribrow",{},e("span","",{},"Next time"),S),_),grow(){[...S.children].forEach((b,x)=>{b.style.flexGrow=String(c.practices[x]??s.practices[x][2])})}}}async function je(o,c){G.classList.add("fb--learn"),I=G.classList.contains("fb--compact")?70:96,Ee(),Me(1),Fe(),me("Sensei is learning","fb-pill--learn");const l=We(),p=e("div","fb-bubbles"),y=e("div","fb-chips"),_=e("div","",{},e("div","fb-k",{},"What Sensei learned"),y);if(z.replaceChildren(e("div","fb-say",{},e("div","fb-sensei",{},l.el),p)),Z.replaceChildren(z),c){p.append(...s.learn.say.map(b=>e("div","fb-bubble",{},b))),y.append(...s.learn.chips.map(b=>e("span","fb-chip",{},b)));const L=Ne(!0);z.append(_,L.el);return}l.set("consider"),await C.wait(1300);for(let L=0;L<s.learn.say.length;L++){if(!C.live(o))return;l.set(L===0?"sway":"affirm");const b=e("div","fb-bubble");p.append(b);const x=s.learn.say[L].split(" ");for(let V=1;V<=x.length;V++){if(!C.live(o))return;b.textContent=x.slice(0,V).join(" "),await C.wait(65+Math.random()*45)}await C.wait(700)}l.set("nod"),z.append(_);for(const L of s.learn.chips){if(await C.wait(450),!C.live(o))return;y.append(e("span","fb-chip",{},L))}if(await C.wait(700),!C.live(o))return;const S=Ne(!1);z.append(S.el),l.set("brighten"),await C.wait(700),S.grow()}const oe=Ve(d,re.map(o=>({id:o.id,title:o.title,sub:o.sub,meta:o.device})),o=>{W=o,ye(!0)});async function ye(o=!1){var p,y;const c=re[W];oe.select(W),(p=i.onMoment)==null||p.call(i,c),o&&t.dispatchEvent(new CustomEvent("demo:pick",{detail:c.id}));const l=C.start();if(Be(c),$e()){r.className="fb-dev fb-dev--on",await je(l,!0),oe.progress(1);return}await C.wait(1500),C.live(l)&&(r.className="fb-dev fb-dev--on",await new Promise(_=>{const S=performance.now(),L=b=>{if(!C.live(l))return _();const x=Math.min(1,(b-S)/ot);Me(x),oe.progress(x*.55),x<1?Q=requestAnimationFrame(L):_()};Q=requestAnimationFrame(L)}),C.live(l)&&(Fe(),oe.progress(.6),await C.wait(2200),C.live(l)&&(await je(l,!1),C.live(l)&&(oe.progress(1),(y=i.onComplete)==null||y.call(i,c),await C.wait(5200),C.live(l)&&(W=(W+1)%re.length,ye())))))}const xe=window.matchMedia("(max-width: 43.75rem)"),Ie=()=>G.classList.toggle("fb--compact",xe.matches);Ie(),(Re=xe.addEventListener)==null||Re.call(xe,"change",Ie),k.addEventListener("click",()=>ye(!0)),oe.select(0),Be(re[0]),Ge(t,()=>ye(),()=>{C.stop(),cancelAnimationFrame(Q)})}function dt(t=window,i=document){var v;const n=i.querySelector(".dj-hero__video"),d=i.querySelector(".dj-video-toggle");if(!n)return;const f=t.matchMedia("(prefers-reduced-motion: reduce)").matches,r=((v=t.navigator.connection)==null?void 0:v.saveData)===!0;if(f||r)return;const h=()=>{const D=t.matchMedia("(max-width: 64rem)").matches&&n.dataset.srcMobile||n.dataset.src;D&&(n.src=D,n.addEventListener("canplay",()=>{n.play().then(()=>{n.classList.add("is-playing"),d&&(d.hidden=!1)}).catch(()=>{})},{once:!0}),n.addEventListener("error",()=>n.remove(),{once:!0}),n.addEventListener("ended",()=>{d&&(d.hidden=!0)}),n.load())};d==null||d.addEventListener("click",()=>{const k=n.paused;k?n.play():n.pause(),d.classList.toggle("is-paused",!k),d.setAttribute("aria-label",k?"Pause background video":"Play background video")}),i.addEventListener("visibilitychange",()=>{i.visibilityState!=="visible"||!n.isConnected||!n.src||d!=null&&d.classList.contains("is-paused")||n.paused&&!n.ended&&n.play().catch(()=>{})}),i.readyState==="complete"?t.setTimeout(h,300):t.addEventListener("load",()=>t.setTimeout(h,300),{once:!0})}He();Je();Xe();et(window,document);Ke();Ze();Qe(nt);tt(window,()=>{He(),qe(window,document)});function ct(t=document){const i=(n,d)=>{const f=t.querySelector(n==="creation"?"#how.dj-demo":"#recovery.dj-demo");if(!f)return;const r=f.querySelector("[data-demo-cta]");f.addEventListener("demo:pick",h=>Te("demo_moment_pick",{demo:n,moment:String(h.detail),page_path:window.location.pathname})),d(f,{onMoment(h){it(`demo_view_${n}`,{demo:n,page_path:window.location.pathname}),r&&r.dataset.afAd!==`demo_${h.id}`&&(r.dataset.afAd=`demo_${h.id}`,qe(window,t))},onComplete(h){Te("demo_moment_complete",{demo:n,moment:h.id,page_path:window.location.pathname})}})};i("creation",st),i("recovery",lt)}ct();dt();ut();function ut(){const t=document.querySelector(".dj-voices"),i=t==null?void 0:t.querySelector(".dj-voices__toggle");!t||!i||i.addEventListener("click",()=>{const n=t.classList.toggle("is-paused");i.classList.toggle("is-paused",n),i.setAttribute("aria-label",n?"Play moving reviews":"Pause moving reviews")})}
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.