import{M as h,ao as s,aq as c,a_ as u,aB as d,aO as g,aS as n,ap as r,aW as j,aD as v,ba as f,av as N,b5 as C,b6 as b,b7 as y}from"./app-k0jcl5PQ.js";import{f as A}from"./BojVbZw0.chunk.js";import{S as w}from"./UBCV9Jq8.chunk.js";import{U as S}from"./BFSC0Mx_.chunk.js";import{R as x}from"./BlKMjFEf.chunk.js";const I="sharev2.shareViewCount";function L(e){return[h.Playlist,h.Series].includes(e.share.objectTypeId)?s.jsx("span",{children:"-"}):s.jsx(c,{namespace:I,phrase:"viewCount",options:{smartCount:e.share.viewCount||0}})}function T(e){if([h.Playlist,h.Series].includes(e.share.objectTypeId))return s.jsx("span",{children:"-"});function a(){const i=e.share.accessCount||0;if(e.share.type===d.Open)return`${i}`;if(e.share.type===d.Classroom){const l=e.share.recipients.length;return`${i}/${l}`}return`${i}`}return s.jsxs("span",{className:"d-inline-flex flex-row gap-2 align-items-center",children:[s.jsx(u,{svg:S}),s.jsx("span",{children:a()})]})}const _="_shareListItem_15z8s_1",H="_visibleOnHover_15z8s_6",P="_shareAvatar_15z8s_12",k="_shareAvatarTitle_15z8s_15",o={shareListItem:_,visibleOnHover:H,shareAvatar:P,shareAvatarTitle:k},m="assign.previousAssignments";function O(e){return s.jsxs("div",{className:r("d-flex align-items-center justify-content-between",e.show&&"mb-3"),children:[s.jsx("h3",{className:"h6 m-0 p-0",children:s.jsx(c,{namespace:m,phrase:"heading",options:{count:e.count}})}),s.jsx(C,{svg:e.show?b:y,onClick:e.onToggle})]})}function z(){const e="d-flex align-items-end justify-content-start fw-medium";return s.jsx(g.Provider,{value:m,children:s.jsxs(x,{className:"gx-2 px-3 mb-2",children:[s.jsx(n,{xs:4,className:e,children:s.jsx(c,{phrase:"assignedTo"})}),s.jsx(n,{xs:2,className:e,children:s.jsx(c,{phrase:"views"})}),s.jsx(n,{xs:2,className:e,children:s.jsx(c,{phrase:"viewedBy"})}),s.jsx(n,{xs:4,className:e,children:s.jsx(c,{phrase:"dateCreated"})})]})})}function B(e){var i,l;const t=v.getClassroomForShare(e.share,e.classrooms),a=(i=e.getItemAnalytics)==null?void 0:i.call(e,e.share);return s.jsx(f,{appLink:e.getItemAppLink(e.share),analyticsData:a==null?void 0:a.data,analyticsOptions:a==null?void 0:a.options,className:r("d-block p-3 hover-bg-light-blue border border-top-0 no-hover-text-underline",o.shareListItem,e.className),children:s.jsxs(x,{className:"gx-2",children:[s.jsx(n,{xs:4,className:"d-flex align-items-center",children:s.jsx(w,{type:e.share.type,privacy:e.share.privacy,classroomName:t==null?void 0:t.name,svgSize:N.Small,openClassroomName:(l=e.share.options)==null?void 0:l.openClassroomName,className:r(o.shareAvatar),titleClassName:r("text-truncate",o.shareAvatarTitle),hideSubtitle:!0})}),s.jsx(n,{xs:2,className:"d-flex align-items-center justify-content-start",children:s.jsx(L,{share:e.share})}),s.jsx(n,{xs:2,className:"d-flex align-items-center justify-content-start",children:s.jsx(T,{share:e.share})}),s.jsx(n,{xs:4,lg:3,className:"d-flex align-items-center justify-content-start",children:s.jsx("span",{children:A(e.share.dateCreated)})}),s.jsx(n,{lg:1,className:"align-items-center justify-content-end d-none d-lg-flex",children:s.jsx("span",{className:r("cursor-pointer text-info hover-text-underline",o.visibleOnHover),children:s.jsx(c,{namespace:m,phrase:"view"})})})]})},e.share.shareId)}function M(e){return s.jsx("div",{className:r("d-flex flex-column border-top rounded-top overflow-hidden"),children:s.jsx(j,{autoHeight:!0,autoHeightMin:0,autoHeightMax:e.scrollHeightMax??215,autoHide:!0,children:e.assignments.map((t,a)=>s.jsx(B,{share:t,classrooms:e.classrooms,getItemAppLink:e.getItemAppLink,getItemAnalytics:i=>{var l;return(l=e.getItemAnalytics)==null?void 0:l.call(e,i,a)},className:r(a%2===0&&"bg-gray-100")},t.shareId))})})}function U(e){if(!e.assignments.length)return s.jsx(s.Fragment,{});const t=e.show&&e.assignments.length>3;return s.jsxs("div",{className:r("bg-white rounded-3 p-3",t&&"pb-0"),children:[s.jsx(O,{count:e.assignments.length,onToggle:e.onToggle,show:e.show}),e.show&&s.jsxs(s.Fragment,{children:[s.jsx(z,{}),s.jsx(M,{...e})]})]})}export{U as P,z as a,M as b};
//# sourceMappingURL=AeV4ZsCs.chunk.js.map
