import{F as t,j as e,r as v}from"./vendor-CT-JknSv.chunk.js";import{i as V,a5 as w,ac as j,ab as M,r as l,bb as S,X as E,aC as F,j as m,l as N,v as W,C as Y,aA as _,u as $,c as x,B as q,f as D,k as T,aD as c,b8 as H,cP as P,L as R}from"./index-DDZqnj79.js";import{q as z,V as O,t as b,H as d,M as g,L as p,v as h}from"./NebulaLessonPlayer-C2l8O21i.chunk.js";function K({className:n,children:i,image:s,title:r}){return t("div",{className:n,css:{display:"flex",position:"relative",overflow:"hidden",backgroundColor:V.systemBackground},children:[e(w,{image:s,css:{[w.fallbackSelector]:{width:"100vw"},alignSelf:"center"},widthDefinition:`${j} 100vw, ${M} 100vw, 960px`,name:`${r} thumbnail`}),i]})}function y({title:n,thumbnail:i,duration:s,children:r,className:o}){const{videoSizeCSS:a}=z({ignoreTheaterMode:!0});return e(Y,{css:[a,{padding:0,[l]:{padding:0},[S]:{marginTop:0}}],className:o,children:t(K,{image:i!=null?i:void 0,css:[a,{zIndex:1}],className:o,title:n!=null?n:"",children:[e(E,{children:"Video length:"}),s?e(F,{value:s,css:{background:m.neutral1000_80,borderRadius:"4px",bottom:"8px",color:m.neutral0,fontSize:"12px",fontWeight:N.weight.semibold,padding:"0 4px",pointerEvents:"none",position:"absolute",right:"8px",[W]:{display:"none"},[l]:{display:"none"}}}):null,r]})})}function ee({title:n,duration:i,thumbnail:s,redeemFreeSampleOnVideo:r,className:o}){const a=x();return e(y,{title:n,duration:i,thumbnail:s,className:o,children:t(b,{children:[e(p,{}),e(d,{children:"The first one is on us"}),t(g,{children:["Enjoy this video, then"," ",e(T,{to:{pathname:"/join",state:{returnTo:a}},theme:"nebulaBlue",css:{padding:0,color:m.blue400},children:"sign up"})," ","or"," ",e(T,{theme:"nebulaBlue",to:{pathname:"/login",state:{returnTo:a}},css:{padding:0,color:m.blue400},children:"sign in"})," ","to support the creators."]}),e(c,{theme:"primary",css:{marginTop:16},onClick:()=>{H(),r()},children:"Play this video"}),e(g,{children:e(T,{theme:"nebulaBlue",css:{textAlign:"center",display:"block",marginTop:26,[l]:{marginTop:15}},to:"/",children:"Learn more about supporting creators on Nebula."})}),e(h,{})]})})}function ne({title:n,duration:i,thumbnail:s,className:r}){const o=x();return e(y,{title:n,duration:i,thumbnail:s,className:r,children:t(b,{children:[e(p,{}),e(d,{children:"You must be signed in to watch videos"}),e(c,{theme:"primary",to:{pathname:"/login",state:{returnTo:o}},css:{marginTop:16,minWidth:140},children:"Sign in"}),t(g,{css:{marginTop:24,[l]:{marginTop:16}},children:[e("span",{css:{display:"block"},children:"Don’t have an account?"}),e(T,{to:{pathname:"/join",state:{returnTo:o}},theme:"nebulaBlue",css:{display:"inline-block",padding:0,marginTop:12,[l]:{marginTop:8}},children:"Sign up"})]}),e(h,{})]})})}function ie({title:n,duration:i,thumbnail:s,className:r}){return e(y,{title:n,duration:i,thumbnail:s,className:r,children:t(b,{children:[e(p,{}),e(d,{children:"You need an active subscription to watch videos"}),e(g,{children:"You may need to update your payment info as well."}),e(c,{theme:"primary",css:{marginTop:16},to:"/settings/subscription",children:"Account Settings"}),e(h,{})]})})}const G=460,A=R+1,Q=`(max-width: ${P}px), (min-width: ${A}px) and (max-width: ${Math.max(P+G,A)}px)`;function se({title:n,duration:i,thumbnail:s,cls:r,className:o}){const{user:a,isInitialLoading:k}=_(),B=$(),f=x(),{data:u}=q(r),{matches:C}=D(Q),L=u!=null&&u.progress_percentage?(u==null?void 0:u.progress_percentage)>0:null;if(k)return e(O,{isProxy:!0,className:o});const I=a==null?void 0:a.is_subscribed,U=B?I?t(v.Fragment,{children:[e(p,{}),e(d,{children:L?"Upgrade your subscription to continue this class":"Upgrade your subscription to view this class"}),e(c,{theme:"primary",css:{marginTop:16},to:"/settings/subscription",children:"Get Nebula Classes"}),e(h,{})]}):t(v.Fragment,{children:[e(p,{}),e(d,{children:"A Nebula subscription is required to view this class"}),e(c,{theme:"primary",css:{marginTop:16},to:"/settings/subscription",children:"Subscribe to Nebula"}),e(h,{})]}):t(v.Fragment,{children:[e(p,{}),e(d,{children:"A Nebula subscription is required to view this class"}),e(c,{to:{pathname:"/join",state:{returnTo:f}},theme:"primary",css:{marginTop:16,minWidth:140},children:"Sign Up"}),t(g,{css:{marginTop:24,[l]:{marginTop:16}},children:[e("span",{css:{display:"block"},children:"Already have an account?"}),e(c,{theme:"borderless",to:{pathname:"/login",state:{returnTo:f}},css:{color:m.blue400,display:"inline-block",padding:"0",marginTop:12,[l]:{marginTop:8}},children:"Sign in"})]}),e(h,{})]});return e(y,{title:n,duration:i,thumbnail:s,className:o,css:{[S]:{marginTop:0}},children:e(b,{blurred:C,children:U})})}function re({title:n,duration:i,thumbnail:s,className:r}){return e(y,{title:n,duration:i,thumbnail:s,className:r,children:t(b,{children:[e(d,{children:"Video playback in this browser is not supported"}),e(g,{children:"You may need to install H.264 video codecs."})]})})}export{se as C,ee as F,ie as I,re as U,ne as Y};