import{cl as x,cf as u,fZ as h,f_ as y,j as i,cw as m,cx as g,cy as f,eo as k,bp as j,bs as I,Y as v,fX as L,b7 as C}from"./app-BgLa5dit.js";import{L as N}from"./DUGw_22-.chunk.js";import{E as S,I as w,a as T}from"./Ib-esfrz.chunk.js";import{u as b}from"./oUIMm7ik.chunk.js";const B="_captionsBadge_1hxkj_1",G={captionsBadge:B};function R(e){var s,r,l,c,a,t;if(!e.video.description&&!((s=m.getCanBeConsumed(e.video))!=null&&s.canNavigate))return i.jsx("em",{children:m.getPrivacyReasoning(e.video,e.showSignIn)});const n=!!((c=(l=(r=e.video)==null?void 0:r.subtitles)==null?void 0:l.data)!=null&&c.length);return i.jsxs(i.Fragment,{children:[n&&i.jsx("span",{className:`d-inline-block align-middle ${G.captionsBadge}`,children:i.jsx(g,{type:f.Captions,data:(a=e.video)==null?void 0:a.subtitles})}),!!((t=e.video)!=null&&t.productionYear)&&i.jsxs("span",{className:"fw-semibold align-middle",children:[n?" • ":"",e.video.productionYear]}),!!e.video.description&&i.jsx("span",{className:"align-middle",dangerouslySetInnerHTML:{__html:`${e.video.productionYear||n?" • ":""}${N.linkifyText(e.video.description)}`}})]})}function Q(e){var r;const n=x(u.XS),s=!!h.getRestrictionByType((r=e.video)==null?void 0:r._restrictions,y.User);return n?i.jsx(i.Fragment,{}):s&&!e.hasStudentExperience&&!e.hasGuestExperience?i.jsx(i.Fragment,{}):i.jsx("div",{className:"position-relative overflow-hidden clamp-2",children:i.jsx("p",{className:"m-0",children:i.jsx(R,{video:e.video,showSignIn:e.showSignIn})})})}function _(e){return i.jsx(g,{type:f.Restriction,data:{restrictions:e.restrictions,yearGroups:e.yearGroups},inline:!0})}function H(e){var r;const n=h.hasRestrictions((r=e.video)==null?void 0:r._restrictions),{canConsume:s}=m.getCanBeConsumed(e.video);return!n||!e.yearGroups||!s?i.jsx(i.Fragment,{}):i.jsx(k,{className:e.className||"pt-1",children:i.jsx(_,{restrictions:e.video._restrictions,yearGroups:e.yearGroups})})}A.defaultProps={clampLevel:1};function A(e){var a,t;const{canNavigate:n}=m.getCanBeConsumed(e.video),s=m.getTitle(e.video),r={...e.analyticsData,id:(a=e.video)==null?void 0:a.id,name:(t=e.video)==null?void 0:t.name},l={...e.analyticsOptions,actionType:I.Click,descriptor:j.Title};function c(){return e.titleSize?e.titleSize:e.size==="md"?"h4":"h5"}return i.jsx(v,{className:e.linkClassName,appLink:n?e.appLink:null,onClick:n?e.onClickAppLink:null,analyticsOptions:l,analyticsData:r,children:i.jsx("div",{className:`clamp-${e.clampLevel} align-middle`,title:e.video.name??"",children:i.jsx(L,{video:e.video,title:s,yearGroups:e.yearGroups,lockSize:e.size,titleSize:c(),className:e.titleClassName,showNewVideoIndicator:e.showNewVideoIndicator,showPadlock:e.showPadlock})})})}const D="shared.interactiveItem";function M(e){const n=b();return typeof e=="number"?e:n===u.XS?3:n===u.SM?1:n===u.MD||n===u.LG?2:3}function P(e){var c;const n=M(e.totalToDisplay);if(!((c=e.timepoints)!=null&&c.length))return i.jsx(i.Fragment,{});const s=[];let r=0;e.timepoints.forEach(a=>{a==null||a.interactions.forEach(t=>{if(S[t.typeId]||r>=n)return;r++;const d=t.typeId===w.Annotation&&typeof t.data=="string"?JSON.parse(t.data):t.data,o={...t,data:{...d,appLink:e.appLink&&{...e.appLink,params:{t:Math.floor(a.visibleAt/1e3)}}}};s.push(o)})});const l=e.timepoints.reduce((a,t)=>{var o;const d=((o=t==null?void 0:t.interactions)==null?void 0:o.length)??0;return a+=d,a},0);return s.length?i.jsxs(i.Fragment,{children:[s.map((a,t)=>{var d,o;return i.jsx("div",{className:"d-flex align-items-center mb-1",children:i.jsx("div",{className:"clamp-1",children:i.jsx(T,{interaction:a,appLink:(d=a.data)==null?void 0:d.appLink,onClick:(o=a.data)!=null&&o.appLink?e.onClickAppLink:null,smallIcon:!0})})},t)}),i.jsx("div",{className:"mb-1 text-link",children:i.jsx(v,{className:"cursor-pointer hover-text-underline",appLink:e.previewAppLink,onClick:e.onClickAppLink,children:i.jsx(C,{namespace:D,phrase:"previewQuestions",options:{questionsShown:s.length,smartCount:l}})})})]}):i.jsx(i.Fragment,{})}export{P as I,A as V,Q as a,H as b};
//# sourceMappingURL=CXuN-bs8.chunk.js.map
