PageSourceSearch

https://aimlcompanion.ai/assets/IdleCompanion-VJ_jIYXt.js

js aimlcompanion.ai collected 2026-10-05 12:52:45 UTC 41,306 bytes, 15 lines download raw bytes

1import{v as Re,A as C,B as Y,ap as ae,J as Te,aY as _e,j as u,a as _,u as Me,b as Oe,aZ as Ne}from"./index-CThNTRDP.js";import{c as s,u as ye}from"./vendor-i18n-5wc_S7sb.js";import{r as Ce}from"./index-CSiUaayt.js";import{a as Ye}from"./useTrackColor-DQN4-5G3.js";import{u as we}from"./useMediaQuery-BFdc-TdH.js";import{i as le}from"./mediaSignals-ChkotB6q.js";import{p as je,r as ce,u as Ae,a as H,D as ie,b as Le}from"./dotDoodle-xNs71Hm2.js";import{i as he,D as Pe,a as ge}from"./dotPrefs-B29xFDB4.js";import"./vendor-react-H8Xurm4u.js";const Ge=1200*1e3,ze=1500,Be=600*1e3,Fe=15*1e3,We=120*1e3,qe=2,$e=1440*60*1e3,Ue=10080*60*1e3,He=3,Ke=2,Qe=new Set([1,2,3,5,10,25,50,100]),ne=new Set,Je=30*1e3,Ve=15*1e3,Xe=5*1e3;function de(){if(le())return!0;if(typeof document>"u")return!1;if(document.fullscreenElement)return!0;const t=document.activeElement;return!!(t&&t.tagName==="IFRAME")}function q(){try{return JSON.parse(sessionStorage.getItem(ae.COMPANION_SESSION))||{}}catch{return{}}}function J(t){try{sessionStorage.setItem(ae.COMPANION_SESSION,JSON.stringify(t))}catch{}}function X(){return C.getJSON(Y.COMPANION_META,{})||{}}function se(t){C.set(Y.COMPANION_META,t)}function Ze({active:t,mod:e,track:o,done:l,streak:a,timeSpent:A,logEvent:E}){const[p,c]=s.useState(null),m=s.useRef("inactive"),w=s.useRef(0),y=s.useRef(0),v=s.useRef(null),P=s.useRef(null),M=s.useRef({});M.current={mod:e,track:o,done:l,streak:a,timeSpent:A,logEvent:E};const d=s.useCallback((n,r)=>{var h,f,k,R,j;const i=M.current;try{(k=i.logEvent)==null||k.call(i,n,((h=i.mod)==null?void 0:h.id)||null,((f=i.track)==null?void 0:f.id)||null,r||{})}catch{}Re(n,{module_id:(R=i.mod)==null?void 0:R.id,track_id:(j=i.track)==null?void 0:j.id,...r})},[]),b=s.useCallback(n=>{m.current=n,c(null)},[]),T=s.useCallback(()=>{const n=q();n.done=!0,J(n)},[]),I=s.useCallback(n=>{if(m.current!=="active"&&m.current!=="snoozed"||typeof document>"u"||document.visibilityState!=="visible"||de())return!1;const r=q();if(r.done)return!1;if(C.get(Y.COMPANION_DEBUG)==="1")return!0;const i=X();return!(i.enabled===!1||n<(i.suppressUntil||0)||n-(i.lastDismissAt||0)<$e||(i.sessions||0)<=Ke||(i.shownToday||0)>=qe||r.shown||n-(r.startedAt||n)<We)},[]),D=s.useCallback((n,r)=>{var oe;const i=Date.now(),{mod:h,track:f,done:k,streak:R,timeSpent:j}=M.current;if(!h||!f)return;const L=X(),F={moduleTitle:h.title||"this lesson",minutes:Math.round((((oe=j==null?void 0:j[h.id])==null?void 0:oe.total_seconds)||0)/60),streak:(R==null?void 0:R.current_streak)||0,doneInTrack:Array.isArray(f.modules)?f.modules.filter(S=>k==null?void 0:k[S.id]).length:0,trackTotal:Array.isArray(f.modules)?f.modules.length:0,trackId:f.id},W=je(n,F,L.recentCopyIds||[]),te=q();n!=="snooze"&&(te.shown=!0,J(te),L.shownToday=(L.shownToday||0)+1,L.recentCopyIds=[...L.recentCopyIds||[],W.id].slice(-8),se(L));const ue=Math.round((i-w.current)/6e4);m.current="shown",c({trigger:n,animate:r,copy:W,ctx:F,snoozeAllowed:n!=="snooze"&&!te.snoozeUsed}),d("companion_shown",{trigger:n,copyId:W.id,idleMinutes:ue})},[d]),B=s.useCallback(()=>{T();const n=X();n.consecutiveDismissals=0,se(n);const r=p==null?void 0:p.trigger;b("done"),d("companion_continue",{trigger:r})},[T,b,d,p]),O=s.useCallback(()=>{const n=q();n.snoozeUsed=!0,J(n);const r=C.get(Y.COMPANION_DEBUG)==="1";b("snoozed"),d("companion_snooze",{}),window.clearTimeout(P.current),P.current=window.setTimeout(()=>{if(m.current!=="snoozed")return;typeof document<"u"&&document.visibilityState==="visible"&&!de()&&!q().done?D("snooze",!0):(T(),m.current="done")},r?Ve:Be)},[T,b,d,D]),z=s.useCallback(()=>{T(),b("done"),d("companion_break",{})},[T,b,d]),G=s.useCallback(n=>{T();const r=Date.now(),i=X();i.lastDismissAt=r,i.consecutiveDismissals=(i.consecutiveDismissals||0)+1,i.consecutiveDismissals>=He&&(i.consecutiveDismissals=0,i.strikes=(i.strikes||0)+1,i.suppressUntil=r+Ue,i.strikes>=2&&(i.enabled=!1)),se(i),b("done"),d("companion_dismissed",{method:n})},[T,b,d]),K=s.useCallback((n,r,i,h)=>{(r||Qe.has(n))&&d("companion_poke",{count:n,milestone:r||null,page:i||null,kinds:h||null})},[d]),N=s.useCallback(n=>{if(ne.has(n))return;const r=q(),i=Array.isArray(r.dotPages)?r.dotPages:[];i.includes(n)||(r.dotPages=[...i,n].slice(-20),J(r),ne.add(n),d("dot_impression",{page:n}))},[d]),$=s.useCallback(n=>{ne.has("__intro")||(ne.add("__intro"),d("dot_intro_shown",{page:n}))},[d]),Q=s.useCallback((n,r)=>{d("dot_greeting_shown",{step:n,page:r||null})},[d]),U=s.useCallback(n=>{d("dot_daily_quote",n||{})},[d]),x=s.useCallback(n=>{T(),b("done"),d("companion_implicit_resume",{method:n})},[T,b,d]),g=e==null?void 0:e.id;return s.useEffect(()=>{if(!t||typeof document>"u"){m.current="inactive",c(null);return}const n=C.get(Y.COMPANION_DEBUG)==="1",r=n?Je:Ge,i=n?Xe:Fe,h=q();h.startedAt||(h.startedAt=Date.now());const f=X(),k=new Date().toLocaleDateString("en-CA");f.dateKey!==k&&(f.dateKey=k,f.shownToday=0),h.counted||(h.counted=!0,f.sessions=(f.sessions||0)+1),J(h),se(f),m.current="active",c(null),w.current=Date.now(),y.current=document.visibilityState==="hidden"?Date.now():0;const R=new AbortController,{signal:j}=R,L=S=>{const V=q();V.eligibleLogged||(V.eligibleLogged=!0,J(V),d("companion_eligible",{trigger:S}))},F=S=>!!(S&&typeof S.closest=="function"&&S.closest("[data-mlm-companion]")),W=S=>
1{if(m.current==="shown"){if(S.type==="keydown"&&S.key==="Escape"){G("escape");return}if(F(S.target)||S.type==="keydown")return;if(S.type==="scroll"){x("scroll");return}if(S.type==="click"){x("click_outside");return}return}w.current=Date.now()};["mousemove","keydown","scroll","touchstart","click","wheel","pointerdown"].forEach(S=>window.addEventListener(S,W,{passive:!0,capture:!0,signal:j}));const ue=()=>{const S=Date.now();if(document.visibilityState==="hidden"){y.current=S;return}const V=y.current?S-y.current:0;y.current=0,w.current=S,V>=r&&m.current==="active"&&(L("away"),window.clearTimeout(v.current),v.current=window.setTimeout(()=>{I(Date.now())&&D("away",!0)},ze))};document.addEventListener("visibilitychange",ue,{signal:j});const oe=window.setInterval(()=>{if(document.visibilityState!=="visible"||m.current!=="active")return;const S=Date.now();if(de()){w.current=S;return}S-w.current>=r&&(L("idle"),I(S)&&D("idle",!1))},i);return()=>{R.abort(),window.clearInterval(oe),window.clearTimeout(v.current),window.clearTimeout(P.current),m.current="inactive"}},[t,g,I,G,x,d,D]),{prompt:p,actions:{continueLearning:B,snooze:O,takeBreak:z,dismiss:G,poke:K,dotImpression:N,dotIntro:$,dotGreeting:Q,dotDailyQuote:U}}}const et=4e3,tt=10080*60*1e3,De=3,ot=3,nt=6e3;function st(t,e){const o=new Date(t),l=new Date(e);return o.getFullYear()===l.getFullYear()&&o.getMonth()===l.getMonth()&&o.getDate()===l.getDate()}function be({pokes:t,step:e,lastAt:o,now:l}){return t>=De||o&&st(o,l)?null:t>0?o&&l-o<tt?null:{anim:"mlmd-jump",wave:!0,say:!1,ms:1600}:{anim:"mlmd-arrive",wave:!1,say:e<ot,ms:1400}}function fe(){const t=C.getJSON(Y.DOT_GREET,{})||{},e=Number(t.step),o=Number(t.lastAt);return{step:Number.isFinite(e)&&e>0?e:0,lastAt:Number.isFinite(o)&&o>0?o:0}}function Ie(){const{step:t}=fe();C.set(Y.DOT_GREET,{step:t,lastAt:Date.now()})}function ve(){try{return sessionStorage.getItem(ae.DOT_GREETED)==="1"}catch{return!1}}function rt(){try{sessionStorage.setItem(ae.DOT_GREETED,"1")}catch{}}function it({enabled:t,page:e,onGreet:o}){const[l,a]=s.useState(null),A=s.useRef({});return A.current={onGreet:o,page:e},s.useEffect(()=>{if(!t||typeof window>"u"||ve()||ce()>=De||C.get(Y.DOT_INTRO_SEEN)!=="1")return;const{step:E,lastAt:p}=fe();if(!be({pokes:ce(),step:E,lastAt:p,now:Date.now()}))return;const c=[];return c.push(window.setTimeout(()=>{var v;if(document.visibilityState!=="visible"||document.readyState!=="complete"||le()||window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;const m=fe();if(m.step!==E||m.lastAt!==p||ve())return;const w=be({pokes:ce(),step:E,lastAt:p,now:Date.now()});if(!w)return;C.set(Y.DOT_GREET,{step:E+1,lastAt:Date.now()}),rt(),a({anim:w.anim,wave:w.wave,say:w.say});const y=A.current;try{(v=y.onGreet)==null||v.call(y,E+1,y.page||null)}catch{}c.push(window.setTimeout(()=>a(w.say?{anim:null,wave:!1,say:!0}:null),w.ms)),w.say&&c.push(window.setTimeout(()=>a(null),w.ms+nt))},et)),()=>{c.forEach(window.clearTimeout),a(null)}},[t,e]),l}const at=6e3,lt=8e3,ut="Poke me. I know things.",ct=900,dt=new Set(["home","module","blog","blog-post","curriculum","roadmap","cheatsheets","glossary","code-library","community","guide","mlintro","about","help"]);function mt({onPoke:t,onImpression:e,onIntro:o,onGreet:l,page:a,trackId:A,anchorRef:E,away:p=!1}){const{t:c}=ye("common"),m=we("(max-width: 640px)"),[w,y]=s.useState(!1),[v,P]=s.useState(he),M=s.useRef(null),[d,b]=s.useState(!1),T=s.useRef([]),I=s.useRef({});I.current={onImpression:e,onIntro:o,page:a};const{pokeAnim:D,special:B,line:O,poke:z,clearLine:G}=Ae(t,A,a),K=it({enabled:!H&&!v&&!!a,page:a,onGreet:l}),N=D?null:K,[$,Q]=s.useState(!1),U=!!(N!=null&&N.say)&&!$;s.useEffect(()=>{var h,f;H||v||!a||(f=(h=I.current).onImpression)==null||f.call(h,a)},[v,a]),s.useEffect(()=>{if(v||C.get(Y.DOT_INTRO_SEEN)==="1")return;const h=T.current;return h.push(window.setTimeout(()=>{var k;if(le())return;C.set(Y.DOT_INTRO_SEEN,"1"),Ie(),b(!0);const f=I.current;(k=f.onIntro)==null||k.call(f,f.page),h.push(window.setTimeout(()=>b(!1),lt))},at)),()=>{h.forEach(window.clearTimeout),T.current=[]}},[v]);const x=()=>b(!1),g=()=>{x(),Q(!0),z()};s.useEffect(()=>{if(!O&&!d&&!U)return;const h=new AbortController,f=k=>{M.current&&M.current.contains(k.target)||(G(),b(!1),Q(!0))};return["pointerdown","keydown"].forEach(k=>document.addEventListener(k,f,{capture:!0,signal:h.signal})),()=>h.abort()},[O,d,U,G]);const[n,r]=s.useState(!1);if(s.useEffect(()=>{if(!m||v||H)return;const h=new AbortController;let f=0;return document.addEventListener("scroll",()=>{r(!0),window.clearTimeout(f),f=window.setTimeout(()=>r(!1),ct)},{capture:!0,passive:!0,signal:h.signal}),()=>{h.abort(),window.clearTimeout(f),r(!1)}},[m,v]),s.useEffect(()=>{const h=new AbortController;return window.addEventListener(Pe,f=>{var k;return P(!!((k=f.detail)!=null&&k.hidden))},{signal:h.signal}),()=>h.abort()},[]),H||v)return null;const i=m&&!Te&&_e()?"calc(76px + env(safe-area-inset-bottom, 0px))":"calc(clamp(12px, 3vw, 20px) + env(safe-area-inset-bottom, 0px))";return u.jsxs("div",{ref:M,style:{position:"fixed",left:m?2:"clamp(10px, 2.5vw, 16px)",bottom:i,zIndex:900,contain:"layout style",display:"flex",alignItems:"flex-end",gap:"clamp(6px, 1.5vw, 8px)",opacity:p||n?0:1,transition:p?"none":"opacity 0.18s ease-out",pointerEvents:p||n?"none":void 0},children:[(O||d||U)&&u.jsx("div",{className:"mlmd-say",role:"status",style:{order:2,marginBottom:"clamp(4px, 1vw, 6px)",width:"max-content",maxWidth:"min(260px, calc(100vw - 84px))",background:_.card,border:`1px solid ${_.border}`,boxShadow:_.cardShadowMd,borderRadius:10,padding:"clamp(6px, 1.5vw, 8px) clamp(9px, 2.2vw, 11px)",color:_.text,fontSize:"clamp(11px, 2.6vw, 12px)",lineHeight:1.4,pointerEvents:"none"},children:O||ut}),u.jsx("button",{ref:E,type:"button",className:"mlmd-poke-btn",onClick:g,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),onFocus:()=>y(!0),onBlur:()=>y(!1),"aria-label":c("common_ui.dot_poke"),title:c("common_ui.dot_poke"),style:{minWidth:44,minHeight:44,opacity:w||D||d||N?1:.5,transform:w?"translateY(-2px)":"translateY(0)",transition:"opacity 0.2s ease-out, transform 0.2s ease-out",filter:"drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15))"},children:u.jsx("span",{className:D?`mlmd-poke ${D}`:N!=null&&N.anim?`mlmd-poke ${N.anim}`:d?"mlmd-poke mlmd-jump":"mlmd-poke",children:u.jsx(ie,{special:B,wave:d||!!(N!=null&&N.wave),size:m?30:40,sw:m?2.9:2.4})})})]})}const pe=["Aim to understand one thing better than you did yesterday. That is enough for today.","Confusion usually comes just before something clicks. Stay with it a little longer.","You remember what you build far better than what you only read.","Every expert you admire once searched for the basics.","If it feels hard, you're working at the edge of what you know. That is 
1where most learning happens.","Type the code yourself instead of copying it. You'll notice details that reading skips over.","Ask the simple question. Other people are often wondering the same thing.","Understanding builds up in layers, and each session adds one.","Explain it to yourself in plain words. Where you get stuck is exactly where to dig.","The concept that confused you last month is easy now. Today's will be too.","Mistakes in practice are cheap. They're how you avoid expensive ones later.","Re-reading a section is normal. It is how ideas settle in.","A bug you fixed yourself teaches more than ten you read about.","Notes in your own words beat notes you copied.","Learning something properly once is faster than learning it badly twice.","You rarely feel ready before you start. That feeling usually arrives once you're halfway in.","When a question interests you, follow it. Curiosity keeps you going longer than a checklist does.","The math looks scary until you work one example by hand.","A module that felt hard probably taught you more than one that felt easy.","You learn the most from the parts you'd rather skip.","Knowing why something works is worth more than knowing that it works.","Try drawing it. A quick sketch often makes an idea clear when more reading doesn't.","One worked example beats ten definitions.","When you're stuck, make the problem smaller.","Every model you train teaches you something, especially the bad ones.","Gradient descent reaches the minimum in many small steps. You will get there the same way.","Training runs for many epochs before the loss looks good. Give your own learning the same patience.","Your first model will be wrong. That's what the second one is for.","Don't argue about what might work. Try it and see.","Loss often falls slowly for a long time and then quickly. Learning a hard topic often feels the same.","Plateaus are normal for models and for learners. Both get past them by continuing.","An error is information about what to fix next.","Read the error message slowly. It's usually telling you exactly what's wrong.","The questions you work through today become the things you just know later.","Start with something small now. You can adjust the plan once you've begun.","Ten focused minutes today beat a perfect plan for tomorrow.","Getting started is usually the hardest part, and opening the app was the first step.","You don't need a free afternoon. You need the next fifteen minutes.","Motivation usually follows action. It rarely comes first.","Pick one thing and finish it before you choose the next.","Decide what you'll learn today in one sentence, then do that.","It's fine to begin badly. A first attempt is meant to be improved.","You won't feel like it every day. Show up anyway; the feeling often follows.","You don't need to plan the whole track. Plan the next module.","If today is busy, do the smallest possible version. It still counts.","Reading one page and working one example is a real day of learning.","Waiting for the right moment is the most common way to never start.","Open the editor and type the first line. Starting is usually the slowest part.","Progress is hard to see day to day. You usually notice it a few weeks later.","Slow progress still counts. What hurts is stopping completely.","Studying on a hard day does the most to build the habit.","Speed matters less than keeping going.","Many topics get easier soon after the point where people tend to quit.","The gap between beginner and skilled is mostly time spent practising.","Struggling with a topic is part of learning it.","Every skill you have now was once something you couldn't do.","On a bad day, do less, but do something.","A little study every day lasts longer than one long session a week.","Missing one day is fine. Try not to miss two in a row.","A streak is a record of the days you showed up. Add today to it.","The people who get good are the ones who didn't stop.","Persistence gets more people to the end of a course than talent does.","When it gets hard, that's usually where the useful part is.","Frustration means you care. Take a short break, then come back to it.","You will forget things. Review them, and they come back stronger.","Going slowly is fine, as long as you keep going.","You've solved hard things before. This one is next.","Each session now saves you time on every topic that builds on it later.","Every finished track started with one module.","Write down one thing you learned yesterday. Recalling it is a good warm-up.","Small wins add up. Get one today.","Review yesterday's notes for five minutes before starting something new.","Rest when you need to. Just come back.","Keep one tab and one topic open. Full attention makes hard material easier to follow.","Put your phone in another room for twenty minutes and see how much more you get done.","Understand one thing fully before collecting ten more.","Switching between tasks feels productive, but focusing on one gets more done.","Decide what you're learning in this session before you begin.","A short session with full focus beats a long one with half of it.","Close the other tabs. They'll still be there later.","Don't learn everything. Learn what moves you toward your goal.","If you've read the same line three times, take a short walk. Then come back.","Your attention is limited. Spend it on purpose.","Finish before you switch. Half-done things pile up fast.","Covering fewer topics in more depth usually beats skimming many.","Hard ideas tend to make sense during quiet, uninterrupted time.","Tools and trends change every year. The fundamentals stay useful much longer.","Twenty-five minutes of focus, five of rest. Try it once and see how far you get.","Compare yourself to who you were last month, not to anyone else.","Look back at something you found hard a month ago. It probably looks easier now.","A little every day turns into a lot every year.","Twenty minutes a day adds up to more than 120 hours a year.","Each topic you learn makes the next related one faster to pick up.","Learning works like compound interest. Early deposits feel small. Later they don't.","The work you do today is invisible now and obvious in six months.","A finished module is proof you can do the next one.","Each day you show up, the next day gets a little easier.","Progress doesn't need to be dramatic, just regular.","Momentum is easier to keep than to restart. Keep it today.","On a busy day, showing up at all is a good result.","Habits get built on ordinary days when you study anyway.","Studying at the same time each day makes the habit easier to keep.","What you repeat, you get good at. Choose what you repeat.","You are closer than you were yesterday.","If a topic looks too big, list its parts and start with the first one.","Little and often beats big and rare.","Small daily effort is how hard things become normal.","Progress 
1isn't a straight line. Keep moving and the trend goes up.","Skills compound. The ones you build now pay off for years.","Employers look at what you can build more than at certificates.","Build something small that works. Then make it bigger.","One finished project teaches more than three planned ones.","Success is mostly unglamorous work, done consistently.","The person who keeps learning eventually passes the person who stopped.","Tomorrow's tools don't exist yet. Learning how to learn is the skill that carries over.","You know you understand a topic when you can handle the follow-up questions too.","Make something today that you could show someone tomorrow.","There is no fixed schedule for learning this. Go at the pace that lets it stick.","It's never too late to learn this. People start at every age.","Everyone is a beginner at first. Staying curious is what moves you past it.","You don't need permission to become good at something.","Confidence comes from evidence. Every module you finish is evidence.","Doubt is normal. Keep studying while you have it.","Feeling like an impostor usually means you're in a room where you can grow.","Everyone is figuring it out as they go. You're allowed to as well.","The work you do when nobody's watching is what shows up later.","Build a first version, see what's wrong with it, and improve it.","A finished project you keep improving is worth more than a perfect one you never start.",`"I don't get it yet" is a complete and honest sentence.`,"Try explaining today's topic out loud in two minutes. Gaps show up fast.","Being wrong quickly is how you get it right sooner.","Treat every failed run as data, not as a judgement.","You're allowed to find this hard and still be good at it.","A hard topic usually means you're learning something new.","Be patient with yourself, the way you'd be patient with a friend learning this.","Celebrate small wins. They're the ones you get every day.","Asking questions is how understanding gets built.","Effort is never wasted, even when the result isn't what you hoped.","Your brain is a model too. It learns from every example you give it.","Test yourself before you look at the answer. Recall builds memory faster than re-reading.","Spaced review works: revisit a topic after a day, then again after a week.","Comparing yourself to others takes attention away from your own next step.","Start the session with the hardest item while your attention is fresh.","A tired mind learns slowly. Sleep is part of studying.","Breaks are part of the work. Ideas often land while you rest.","Every expert was once confused by exactly what's confusing you now.","Every discovery starts with someone not knowing something.","Whatever you learn today stays with you.","Pick one concept from today and write a two-line summary of it.","Even the biggest models started from random weights.","If a concept won't click, find a second explanation of it. A different angle often helps.","Read other people's code. You'll pick up patterns you wouldn't think of yourself.","Every great system was once a script that barely worked.","Clean code comes from messy first drafts.","Print the tensor shapes and check the data before you trust a result.","Most bugs come from small mistakes, so check the simple things first.","Start with a baseline. Then beat it.","Simple models first. Add complexity only when it earns its place.","Look at your data before you model it.","Your learning curve is supposed to be noisy. Watch the trend, not the dips.","Every expert's notebook is full of failed experiments.","Change one thing at a time, in code and in habits.","Good engineers still break things, and they learn something each time.","Read the docs, run the example, then change one thing and see what happens.","Reproduce it before you improve it.","Today's prototype is tomorrow's portfolio project.","If you can explain it to a beginner, you understand it.","Today is a good day to finish what you started.","Picking up where you left off is easier than starting something new.","Showing up today is the main thing. The rest can be small.","Pick one idea from today's module and try it in code.","Give today twenty honest minutes. That's enough.","Whatever you finish today, tomorrow you'll be glad you did.","Even ten minutes today keeps the topic fresh for tomorrow.","You came back today, and that matters more than a perfect week.","The habit is the hard part, and you're building it right now.","Write down what confused you today. Tomorrow, start there.","Everything big you'll learn is made of days like this one.","Set a small goal for this session and stop when you reach it.","What you practise today will feel easier tomorrow.","Keep your streak going, one day at a time.","Not every day will feel productive. Every day you show up still counts.","The question you're afraid to ask is the one that will teach you the most.","Learning often feels uncomfortable while it's happening. That's normal.","Mastery is the basics, practised until they're automatic.","Fundamentals first. Everything else builds on them.","Nobody rises to a big challenge overnight. You grow into it.","Goals set the direction. Daily habits do most of the work.","Hard problems become easy ones after enough honest attempts.","Write it down. Ideas you record are ideas you keep.","Teach what you learned today to someone, even an imaginary someone.","Patience means working steadily while the results catch up.","Most people who succeed felt unsure too. They kept going anyway.","Trying becomes learning when you ask what you'd do differently next time.","Protect a small block of time each day. It doesn't need to be long.","Learn in the order that works for you. It doesn't need to match anyone else's.","Rebuild something you followed in a tutorial without looking. That's where it really sinks in.","The work you avoid is usually the work that would help most.","You'll understand it more clearly once you try it.","A clear goal turns a busy day into a productive one.","Every chapter you finish makes the next one easier to read.","Big problems are small problems stacked together. Take one off the top.","You know more than you did when you started. Remember that on hard days.","Being stuck is temporary if you keep working on it.","Anyone can be consistent. It's a choice you make each day.","If you finish early, review rather than rushing into the next topic.","The learners who do well are usually the ones who keep coming back.","Note one thing you want to look up later, then get back to the lesson.","Five minutes of practice beats an hour of worrying about it.","Try one exercise without hints today. Then check your answer."];function ht(t){let e=t>>>0;return()=>{e=e+1831565813>>>0;let o=e;return o=Math.imul(o^o>>>15,o|1),o^=o+Math.imul(o^o>>>7,o|61),((o^o>>>14)>>>0)/4294967296}}const Z=new Map;function ft(t){if(Z.has(t))return Z.get(t);const e=pe.map((l,a)=>a),o=ht(t);for(let l=e.length-1;l>0;l-=1){const a=Math.floor(o()*(l+1));[e[l],e[a]]=[e[a],e[l]]}return Z.size>4&&Z.clear(),Z.set(t,e),e}function pt(t,e){const o=pe.length,l=Math.floor(Math.max(0,e)/o),a=ft(t+l*7919>>>0);return pe[a[Math.max(0,e)%o]]}function yt(t){const e=new Map;for(const o of Array.isArray(t)?t:[])for(const l of Array.isArray(o==null?void 0:o.modules)?o.modules:[])l!=null&&l.id&&e.set(l.id,{track:o,mod:l});return e}function wt({done:t,streak:e,resumeStates:o,tracks:l}){const a=yt(l);if(a.size===0)return null;const A=m=>!!(t!=null&&t[m]),E=Number(e==null?void 0:e.current_streak)||0;if(E>=2&&(e!=null&&e.needs_activity))return`${E}-day streak. One module today makes it ${E+1}.`;let p=null;for(const[m,w]of Object.entries(o||{})){const y=Date.parse((w==null?void 0:w.updatedAt)||"");!a.has(m)||!Number.isFinite(y)||(!p||y>p.at)&&(p={id:m,at:y})}if(p){const{track:m,mod:w}=a.get(p.id),y=m.modules.filter(v=>(v==null?void 0:v.id)&&!A(v.id)).length;if(m.title&&y>=1&&y<=3)return y===1?`One module left in ${m.title}. You're nearly there.`:`${y} modules left in ${m.title}. You're nearly there.`;if(!A(p.id)&&w.title)return`You stopped at ${w.title}. Pick up where you left off.`}let c=0;for(const m of a.keys())A(m)&&(c+=1);return c>=3?`${c} modules done so far. Today is a good day for one more.`:null}function gt({dayNumber:t,seed:e,qn:o,...l}){const a=t%2===0?wt(l):null;return{text:pt(e,o),note:a}}const bt=new Set(["home","curriculum"]),vt=1800,xt=1200,kt=3,St=10080*60*1e3,Et=3e3,Tt=350,_t=8e3,At=14e3,xe=680,Dt=260,It=300,Rt=220,Mt="cubic-bezier(0.22, 1, 0.36, 1)";function Ot(t){const e=String(t||"").trim().split(/\s+/).length;return Math.min(At,Math.max(_t,Et+e*Tt))}function re(t){const e=new Date(t);return`${e.getFullYear()}
1-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function Nt(t){const e=new Date(t);return Math.floor(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())/864e5)}function me(){const t=C.getJSON(Y.DOT_DAILY_QUOTE,{})||{},e=o=>Number.isFinite(Number(o))&&Number(o)>0?Number(o):0;return{lastDay:typeof t.lastDay=="string"?t.lastDay:"",lastAt:e(t.lastAt),quick:e(t.quick),qn:e(t.qn),seed:e(t.seed)}}function ke(){const t=C.getJSON(Y.DOT_GREET,{})||{},e=Number(t.lastAt);return Number.isFinite(e)&&e>0?e:0}function Se({meta:t,now:e,greetAt:o}){return!(t.lastDay===re(e)||o&&re(o)===re(e)||t.quick>=kt&&t.lastAt&&e-t.lastAt<St)}function Ct(t){const e=new Date(t).getHours();return e<5?"Up late":e<12?"Good morning":e<17?"Good afternoon":"Good evening"}function Yt(){try{return window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}function jt(){try{return!!document.querySelector('[aria-modal="true"], [data-consent-banner]')}catch{return!1}}function Ee(t){const e=t.getBoundingClientRect();return{x:e.left+e.width/2,y:e.top+e.height/2,w:e.width}}function Lt(t,e){const o=t==null?void 0:t.querySelector("svg"),l=e==null?void 0:e.querySelector("svg");if(!o||!l)return null;const a=Ee(o),A=Ee(l);return!a.w||!A.w?null:{dx:a.x-A.x,dy:a.y-A.y,s:a.w/A.w}}const ee=(t,e,o,l,a)=>`translate(${t}px, ${e}px) scale(${o}, ${l}) rotate(${a}deg)`;function Pt({dx:t,dy:e,s:o}){const l=o+(1-o)*.7;return[{transform:ee(t,e,o,o,-360),opacity:.5},{offset:.55,transform:ee(t*.6,e*.25,l,l,-110),opacity:1},{offset:.78,transform:ee(0,-10,1,1,0),opacity:1},{offset:.9,transform:ee(0,0,1.07,.93,0),opacity:1},{transform:ee(0,0,1,1,0),opacity:1}]}function Gt({enabled:t,page:e,anchorRef:o,progress:l,onAway:a,onEnd:A}){const{t:E}=ye("common"),p=we("(max-width: 640px)"),[c,m]=s.useState(null),[w,y]=s.useState(!1),v=s.useRef(l);v.current=l;const P=s.useRef({});P.current={onAway:a,onEnd:A,page:e};const M=s.useRef(null),d=s.useRef(null),b=s.useRef(null),T=s.useRef(null),I=s.useRef(null),D=s.useRef(null),B=s.useRef(0),O=s.useRef(!1),z=s.useRef([]),G=s.useRef(null);s.useEffect(()=>{if(!t||!bt.has(e)||typeof window>"u"||ge()||he()||C.get(Y.DOT_INTRO_SEEN)!=="1"||!Se({meta:me(),now:Date.now(),greetAt:ke()}))return;const x=window.setTimeout(()=>{if(document.visibilityState!=="visible"||document.readyState!=="complete"||le()||jt()||ge()||he())return;const g=Date.now(),n=me();if(!Se({meta:n,now:g,greetAt:ke()}))return;const r=Yt();if(!r&&!o.current)return;const i=n.seed||Math.floor(Math.random()*2147483646)+1,h=gt({dayNumber:Nt(g),seed:i,qn:n.qn,...v.current||{}});C.set(Y.DOT_DAILY_QUOTE,{lastDay:re(g),lastAt:g,quick:n.quick,qn:n.qn+1,seed:i}),Ie(),O.current=!1,G.current=null,B.current=0,y(!1),m({...h,reduce:r,hello:Ct(g),ms:Ot(`${h.text} ${h.note||""}`)})},vt);return()=>window.clearTimeout(x)},[t,e,o]);const K=()=>{var x,g,n;if(z.current=[],D.current=null,(g=(x=P.current).onAway)==null||g.call(x,!1),!(c!=null&&c.reduce))try{(n=o.current)==null||n.animate([{opacity:0},{opacity:1}],{duration:Rt,easing:"ease-out"})}catch{}m(null)},N=x=>{var R,j,L;if(O.current)return;O.current=!0;const g=B.current?Date.now()-B.current:0,n=x==="interaction"&&g<xt,r=me();C.set(Y.DOT_DAILY_QUOTE,{...r,quick:n?r.quick+1:0});const i=P.current;try{(R=i.onEnd)==null||R.call(i,{has_note:!!(c!=null&&c.note),reason:x,dwell_ms:g,quick:n,page:i.page||null})}catch{}try{(j=D.current)==null||j.pause()}catch{}const h=I.current;if(c!=null&&c.reduce||!h){K();return}[M.current,d.current].forEach(F=>{F==null||F.getAnimations().forEach(W=>{W.playState==="running"&&W.pause()})});const f=h.animate([{opacity:1,transform:"translateY(0) scale(1)"},{opacity:0,transform:"translateY(10px) scale(0.97)"}],{duration:Dt,easing:"ease-out",fill:"forwards"}),k=(L=b.current)==null?void 0:L.animate([{opacity:1},{opacity:0}],{duration:It,delay:40,easing:"ease-out",fill:"forwards"});z.current.push(f),k&&z.current.push(k),(k||f).onfinish=K},$=s.useRef(N);if($.current=N,s.useLayoutEffect(()=>{var i,h,f;if(!c)return;const x=()=>{var L;if(O.current)return;B.current=Date.now();const k=T.current;if(!k)return;const R=k.animate([{transform:"scaleX(1)"},{transform:"scaleX(0)"}],{duration:c.ms,easing:"linear",fill:"forwards"});D.current=R,z.current.push(R),R.onfinish=()=>$.current("timeout"),document.visibilityState!=="visible"&&R.pause();let j=!1;try{j=!!((L=I.current)!=null&&L.matches(":hover"))}catch{}j&&(R.pause(),y(!0))};if(c.reduce){x();return}(h=(i=P.current).onAway)==null||h.call(i,!0);const g=Lt(o.current,M.current),n=[];g&&(G.current=M.current.animate(Pt(g),{duration:xe,easing:Mt,fill:"both"}),n.push(G.current)),b.current&&n.push(b.current.animate([{opacity:0}
1,{opacity:1}],{duration:300,easing:"ease-out",fill:"both"}));const r=(f=d.current)==null?void 0:f.animate([{opacity:0,transform:"translateY(8px)"},{opacity:1,transform:"translateY(0)"}],{duration:260,delay:g?xe-140:0,easing:"ease-out",fill:"both"});r?(n.push(r),r.onfinish=x):x(),z.current.push(...n)},[c,o]),s.useEffect(()=>{if(!c)return;const x=new AbortController,g={capture:!0,passive:!0,signal:x.signal},n=()=>$.current("interaction");return["pointerdown","keydown","wheel","touchmove"].forEach(r=>document.addEventListener(r,n,g)),document.addEventListener("visibilitychange",()=>{const r=D.current;!r||O.current||(document.visibilityState==="visible"?r.play():r.pause())},{signal:x.signal}),()=>x.abort()},[c]),s.useEffect(()=>()=>{var x,g;z.current.forEach(n=>{try{n.cancel()}catch{}}),(g=(x=P.current).onAway)==null||g.call(x,!1)},[]),!c)return null;const Q=x=>{var g;x.pointerType!=="mouse"||O.current||((g=D.current)==null||g.pause(),y(!0))},U=x=>{var g;x.pointerType!=="mouse"||O.current||(y(!1),document.visibilityState==="visible"&&((g=D.current)==null||g.play()))};return u.jsxs("div",{style:{position:"fixed",inset:0,zIndex:980,pointerEvents:"auto",touchAction:"manipulation",contain:"layout style",display:"flex",alignItems:"center",justifyContent:"center",padding:"0 clamp(12px, 3.5vw, 16px)"},children:[u.jsx("div",{ref:b,"aria-hidden":"true",style:{position:"absolute",inset:0,background:`color-mix(in srgb, ${_.background} ${p?82:45}%, transparent)`,...p?null:{backdropFilter:"blur(6px)",WebkitBackdropFilter:"blur(6px)"}}}),u.jsxs("div",{ref:I,onPointerEnter:Q,onPointerLeave:U,style:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",gap:"clamp(8px, 2vw, 12px)",width:p?"min(320px, 100%)":"min(380px, 100%)",transformOrigin:"center center"},children:[u.jsx("div",{ref:M,style:{transformOrigin:"center center",filter:"drop-shadow(0 4px 10px rgba(0, 0, 0, 0.18))"},children:u.jsx(ie,{wave:!0,size:p?48:64,sw:2.1})}),u.jsxs("div",{ref:d,role:"status","aria-live":"polite",style:{width:"100%",boxSizing:"border-box",background:_.card,border:`1px solid ${_.border}`,boxShadow:_.cardShadowMd,borderRadius:14,padding:"clamp(14px, 3.5vw, 18px) clamp(14px, 4vw, 20px)",textAlign:"center",overflow:"hidden",position:"relative"},children:[u.jsx("div",{style:{color:_.textMuted,fontSize:"clamp(11px, 2.8vw, 12px)",fontWeight:600,letterSpacing:"0.04em",marginBottom:"clamp(6px, 1.5vw, 8px)"},children:w?E("common_ui.quote_paused"):c.hello}),u.jsx("p",{style:{margin:0,color:_.text,fontSize:p?"clamp(14px, 4vw, 15px)":"clamp(15px, 1.4vw, 17px)",fontWeight:500,lineHeight:1.45,textWrap:"balance"},children:c.text}),c.note&&u.jsx("div",{style:{marginTop:"clamp(8px, 2vw, 10px)",color:_.textSecondary,fontSize:"clamp(12px, 3vw, 13px)",lineHeight:1.45},children:c.note}),u.jsx("div",{ref:T,"aria-hidden":"true",style:{position:"absolute",left:0,right:0,bottom:0,height:2,background:_.textMuted,opacity:c.reduce?0:.18,transformOrigin:"left center"}})]})]})]})}const Vt=!0,zt=`
2${Le}
3@keyframes mlmc-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
4@keyframes mlmc-hop-k { 0% { transform: translateY(0); } 45% { transform: translateY(-4px); } 100% { transform: translateY(0); } }
5.mlmc-enter { animation: mlmc-rise 0.26s ease-out both; }
6.mlmc-hop { animation: mlmc-hop-k 0.25s ease-out 1; }
7.mlmc-ghost-btn { transition: background-color 0.2s ease-out, color 0.2s ease-out; }
8.mlmc-ghost-btn:hover { background-color: var(--bg-hover); color: var(--text-primary); }
9.mlmc-cta { transition: opacity 0.2s ease-out; }
10.mlmc-cta:hover { opacity: 0.9; }
11@media (prefers-reduced-motion: reduce) {
12  .mlmc-enter, .mlmc-hop { animation: none; }
13  .mlmc-ghost-btn, .mlmc-cta { transition: none; }
14}
15`;function Bt({prompt:t,track:e,actions:o,page:l}){const{t:a}=ye("common"),A=Ye(e==null?void 0:e.id),E=we("(max-width: 640px)"),[p,c]=s.useState(!1),[m,w]=s.useState(!1),y=s.useRef(null);s.useEffect(()=>()=>window.clearTimeout(y.current),[]);const{pokeAnim:v,special:P,poke:M}=Ae(o.poke,e==null?void 0:e.id,l),d=()=>{if(H){o.continueLearning();return}w(!0),y.current=window.setTimeout(()=>
15o.continueLearning(),240)},b=()=>{c(!0),y.current=window.setTimeout(()=>o.takeBreak(),1400)},{copy:T,ctx:I,snoozeAllowed:D,animate:B}=t,O=!p&&I.trackTotal>0&&I.doneInTrack>0,z=E&&!Te&&_e()?"calc(76px + env(safe-area-inset-bottom, 0px))":"calc(clamp(12px, 3vw, 20px) + env(safe-area-inset-bottom, 0px))",G={minHeight:44,padding:"0 clamp(10px, 2.5vw, 12px)",background:"transparent",color:_.textSecondary,border:"none",borderRadius:10,fontSize:"clamp(12px, 3vw, 13px)",fontWeight:500,cursor:"pointer",touchAction:"manipulation",whiteSpace:"nowrap"};return u.jsxs("div",{"data-mlm-companion":"true",role:"dialog","aria-label":a("common_ui.idle_aria"),className:B&&!H?"mlmc-enter":void 0,style:{position:"fixed",right:E?"clamp(10px, 3vw, 16px)":"clamp(14px, 3vw, 24px)",left:E?"clamp(10px, 3vw, 16px)":"auto",bottom:z,zIndex:990,width:E?"auto":"min(360px, calc(100vw - 28px))",contain:"layout style",background:_.card,border:`1px solid ${_.border}`,borderRadius:14,boxShadow:_.cardShadowMd,padding:"clamp(14px, 3.5vw, 16px)"},children:[u.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"clamp(10px, 2.5vw, 12px)"},children:[u.jsx("div",{className:m?"mlmc-hop":void 0,style:{flexShrink:0,marginTop:-4,marginLeft:-4},children:H?u.jsx(ie,{wave:!1,size:36,sw:2.4}):u.jsx("button",{type:"button",className:"mlmd-poke-btn",onClick:M,"aria-label":a("common_ui.dot_poke"),title:a("common_ui.dot_poke"),style:{minWidth:44,minHeight:44},children:u.jsx("span",{className:v?`mlmd-poke ${v}`:"mlmd-poke",children:u.jsx(ie,{wave:B,special:P,size:36,sw:2.4})})})}),u.jsxs("div",{style:{flex:1,minWidth:0,paddingTop:"clamp(2px, 0.5vw, 3px)"},children:[!p&&(e==null?void 0:e.title)&&u.jsx("div",{style:{color:_.textMuted,fontSize:"clamp(11px, 2.6vw, 12px)",fontWeight:500,marginBottom:"clamp(2px, 0.5vw, 4px)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.title}),u.jsx("p",{role:"status",style:{margin:0,color:_.text,fontSize:"clamp(13px, 3.2vw, 14px)",lineHeight:1.5},children:p?"Good call. See you later.":T.text})]}),!p&&u.jsx("button",{type:"button",className:"mlmc-ghost-btn",onClick:()=>
15o.dismiss("close_button"),"aria-label":a("common_ui.dismiss"),style:{flexShrink:0,margin:"-10px -10px 0 0",minWidth:44,minHeight:44,display:"flex",alignItems:"center",justifyContent:"center",background:"transparent",border:"none",borderRadius:10,cursor:"pointer",color:_.textMuted,fontSize:"clamp(13px, 3vw, 14px)",touchAction:"manipulation"},children:"✕"})]}),O&&u.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"clamp(8px, 2vw, 10px)",marginTop:"clamp(12px, 3vw, 14px)"},children:[u.jsx("div",{"aria-hidden":"true",style:{flex:1,height:3,borderRadius:2,background:_.backgroundAlt,overflow:"hidden"},children:u.jsx("div",{style:{height:"100%",width:`${Math.round(I.doneInTrack/I.trackTotal*100)}%`,background:A,borderRadius:2}})}),u.jsxs("div",{style:{color:_.textMuted,fontSize:"clamp(11px, 2.6vw, 12px)",whiteSpace:"nowrap",fontVariantNumeric:"tabular-nums"},children:[I.doneInTrack," of ",I.trackTotal," modules done"]})]}),!p&&u.jsxs("div",{style:{marginTop:"clamp(12px, 3vw, 14px)"},children:[u.jsx("button",{type:"button",className:"mlmc-cta",onClick:d,style:{width:"100%",minHeight:44,background:"var(--cta-invert-bg)",color:"var(--cta-invert-text)",border:"none",borderRadius:10,fontSize:"clamp(13px, 3vw, 14px)",fontWeight:600,cursor:"pointer",touchAction:"manipulation"},children:a("common_ui.idle_continue")}),u.jsxs("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"clamp(2px, 0.5vw, 4px)"},children:[D&&u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",className:"mlmc-ghost-btn",onClick:o.snooze,style:G,children:a("common_ui.idle_remind")}),u.jsx("span",{"aria-hidden":"true",style:{color:_.textMuted,opacity:.6},children:"·"})]}),u.jsx("button",{type:"button",className:"mlmc-ghost-btn",onClick:b,style:G,children:a("common_ui.idle_break")})]})]})]})}function Xt({page:t,track:e,mod:o,signedIn:l=!1,tracks:a}){const{logEvent:A}=Me(),{done:E,streak:p,resumeStates:c}=Oe(),{timeSpent:m}=Ne(),w=s.useRef(null),[y,v]=s.useState(!1),M=t==="module"&&!!(o!=null&&o.id)&&!!(e!=null&&e.id),{prompt:d,actions:b}=Ze({active:M,mod:o,track:e,done:E,streak:p,timeSpent:m,logEvent:A});if(typeof document>"u")return null;const T=dt.has(t)&&!d;return!d&&!T?null:Ce.createPortal(u.jsxs(u.Fragment,{children:[u.jsx("style",{children:zt}),d&&u.jsx(Bt,{prompt:d,track:e,actions:b,page:t}),T&&u.jsx(mt,{onPoke:b.poke,onImpression:b.dotImpression,onIntro:b.dotIntro,onGreet:b.dotGreeting,page:t,trackId:e==null?void 0:e.id,anchorRef:w,away:y}),T&&u.jsx(Gt,{enabled:l,page:t,anchorRef:w,progress:{done:E,streak:p,resumeStates:c,tracks:a},onAway:v,onEnd:b.dotDailyQuote})]}),document.body)}export{Vt as IDLE_COMPANION_ENABLED,Xt 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.