1"use strict";(self.webpackChunkangular=self.webpackChunkangular||[]).push([[786],{9339:(w,E,a)=>{var m;a.d(E,{W:()=>C});var A=a(9671),i=a(655),D=a(8954),L=a(5028),S=a(5507),U=a(6895),e=a(4650);function y(c,g){if(1&c){const u=e.EpF();e.TgZ(0,"app-select-course-languages",4),e.NdJ("languageGroupMapChange",function(l){e.CHM(u);const p=e.oxw();return e.KtG(p.languageGroupMap=l)})("onToggleDrawerOpen",function(){e.CHM(u);const l=e.oxw();return e.KtG(l.toggleAddToCourseListDrawerOpen())})("onSelectedAllLanguages",function(l){e.CHM(u);const p=e.oxw();return e.KtG(p.allLanguagesSelected(l))}),e.qZA()}if(2&c){const u=e.oxw();e.Q6J("courses",u.coursesInLanguageGroup)("nonLanguageGroupCourses",u.coursesToAddToList)("existingListData",u.existingListData)("groups",u.groups)("segmentFrom",u.segmentFrom)("languageGroupMap",u.languageGroupMap)}}function O(c,g){if(1&c){const u=e.EpF();e.TgZ(0,"app-add-to-list",5),e.NdJ("onToggleDrawerOpen",function(){e.CHM(u);const l=e.oxw();return e.KtG(l.toggleAddToCourseListDrawerOpen())})("onBackButtonSelected",function(){e.CHM(u);const l=e.oxw();return e.KtG(l.addToListBackButtonHit())}),e.qZA()}if(2&c){const u=e.oxw();e.Q6J("courses",u.coursesToAddToList)("groups",u.groups)("defaultListTitle",u.defaultListTitle)("defaultListDescription",u.defaultListDescription)("listCreationSource",u.listCreationSource)("listCreationSourceSessionId",u.listCreationSourceSessionId)("segmentFrom",u.segmentFrom)}}function _(c,g){if(1&c&&e._UZ(0,"og-scrim",6),2&c){const u=e.oxw();e.Q6J("open",!0)("className",!0===u.showScrim?u.classes.scrim:u.classes.inactiveScrim)}}var h=(()=>{return(c=h||(h={})).CreateList="createList",c.SelectList="selectList",h;var c})(),T=(()=>{return(c=T||(T={})).SelectLanguage="selectLanguage",c.AddToList="addToList",T;var c})();let C=((m=class{get ListPanel(){return h}get ListPage(){return T}constructor(g,u){this.addToCourseListDrawerService=g,this.document=u,this.addToCourseListDrawerOpen=!1,this.showScrim=!0,this.coursesInLanguageGroup=[],this.coursesToAddToList=[],this.languageGroupMap={},this.defaultListTitle="",this.defaultListDescription=""}ngOnInit(){var g=this;this.addToCourseListDrawerService.drawerPropsSubject.subscribe(function(){var u=(0,A.Z)(function*(r){yield g.initialize(r)});return function(r){return u.apply(this,arguments)}}())}ngOnDestroy(){this.courses=[],this.coursesInLanguageGroup=[],this.coursesToAddToList=[]}initialize(g){var u=this;return(0,A.Z)(function*(){u.showScrim=g.showScrim,u.courses=g.courses,u.groups=g.groups,u.segmentFrom=g.segmentFrom,u.defaultListTitle=g.defaultListTitle??"",u.defaultListDescription=g.defaultListDescription??"",u.listCreationSource=g.listCreationSource,u.listCreationSourceSessionId=g.listCreationSourceSessionId,u.existingListData={id:g.listData?.id,groupId:g.groupId,title:g.listData?.title},u.separateCoursesInLanguageGroup(),u.buildLanguageGroupMap(),u.setInitialPageDisplay(),u.toggleAddToCourseListDrawerOpen()})()}buildLanguageGroupMap(){this.courses.forEach(g=>{g.isLanguageGroupMember&&(g.selected=!0,g.languageCodes.forEach(u=>{const r=u.split("-")[0],l=S.db[r]??S.db[u];l&&(this.languageGroupMap[l]?this.languageGroupMap[l].push(g):this.languageGroupMap[l]=[g])}))})}setInitialPageDisplay(){this.pageDisplayed=this.coursesInLanguageGroup.length>0?T.SelectLanguage:T.AddToList}separateCoursesInLanguageGroup(){this.coursesInLanguageGroup=[],this.coursesToAddToList=[],this.courses.forEach(g=>{g.isLanguageGroupMember?this.coursesInLanguageGroup.push(g):this.coursesToAddToList.push(g)})}toggleAddToCourseListDrawerOpen(){this.addToCourseListDrawerOpen=!this.addToCourseListDrawerOpen,this.handleBodyScrollClass(),this.addToCourseListDrawerOpen||(this.languageGroupMap={},this.addToCourseListDrawerService.closingDrawer())}handleBodyScrollClass(){if(this.document.body){const g=this.document.body.classList;this.addToCourseListDrawerOpen?g.contains(this.classes.drawerOpen)||g.add(this.classes.drawerOpen):g.remove(this.classes.drawerOpen)}}allLanguagesSelected(g){this.existingListData.id?this.ngOnDestroy():(this.coursesToAddToList=[...this.coursesToAddToList,...g],this.pageDisplayed=T.AddToList)}addToListBackButtonHit(){this.coursesInLanguageGroup.length>0?(this.separateCoursesInLanguageGroup(),this.pageDisplayed=T.SelectLanguage):this.toggleAddToCourseListDrawerOpen()}}).\u0275fac=function(u){return new(u||m)(e.Y36(L.i),e.Y36(U.K0))},m.\u0275cmp=e.Xpm({type:m,selectors:[["app-add-to-course-list-drawer"]],decls:9,vars:5,consts:[["cdkTrapFocus","","anchor","right","variant","persistent",3,"className","open"],[3,"courses","nonLanguageGroupCourses","existingListData","groups","segmentFrom","languageGroupMap","languageGroupMapChange","onToggleDrawerOpen","onSelectedAllLanguages",4,"ngIf"],[3,"courses","groups","defaultListTitle","defaultListDescription","listCreationSource","listCreationSourceSessionId","segmentFrom","onToggleDrawerOpen","onBackButtonSelected",4,"ngIf"],[3,"open","className",4,"ngIf"],[3,"courses","nonLanguageGroupCourses","existingListData","groups","segmentFrom","languageGroupMap","languageGroupMapChange","onToggleDrawerOpen","onSelectedAllLanguages"],[3,"courses","groups","defaultListTitle","defaultListDescription","listCreationSource","listCreationSourceSessionId","segmentFrom","onToggleDrawerOpen","onBackButtonSelected"],[3,"open","className"]],template:function(u,r){1&u&&(e.TgZ(0,"og-drawer",0),e._uU(1,"\n "),e.YNc(2,y,1,6,"app-select-course-languages",1),e._uU(3,"\n "),e.YNc(4,O,1,7,"app-add-to-list",2),e._uU(5,"\n"),e.qZA(),e._uU(6,"\n"),e.YNc(7,_,1,2,"og-scrim",3),e._uU(8,"\n")),2&u&&(e.Q6J("className",r.classes.drawer)("open",r.addToCourseListDrawerOpen),e.xp6(2),e.Q6J("ngIf",r.pageDisplayed===r.ListPage.SelectLanguage),e.xp6(2),e.Q6J("ngIf",r.pageDisplayed===r.ListPage.AddToList),e.xp6(3),e.Q6J("ngIf",r.addToCourseListDrawerOpen))},encapsulation:2}),m);C=(0,i.gn)([(0,D.ozS)(c=>(0,D.kcS)({drawer:{padding:4*c.spacing.unit,paddingTop:2*c.spacing.unit,width:"70vw",maxWidth:1200,zIndex:1000001,right:"-70vw","&.open":{transform:"translate3d(-70vw, 0, 0)"},backgroundColor:c.palette.grey[50]},scrim:{zIndex:1e6},inactiveScrim:{zIndex:1e6,opacity:.1},drawerOpen:{position:"fixed !important",width:"100%"}})),(0,i.w6)("design:paramtypes",[L.i,Object])],C)},4786:(w,E,a)=>{var M,N;a.d(E,{y:()=>pe});var A=a(9339),i=a(8954),D=a(3260),L=a(6895),S=a(5028),U=a(5570),e=a(4650),y=a(9671),O=a(655),_=a(4006),h=a(8592),x=(a(7164),a(757)),C=a(6448),m=a(3454),c=a(8018),g=a(9098),u=a(100),r=a(587),l=a(992),p=a(8935),f=a(1651),v=a(4265),Z=a(7650);function B(n,t){if(1&n&&(e.TgZ(0,"div",17),e._uU(1,"\n "),e.TgZ(2,"og-typography",25),e._uU(3),e.qZA(),e._uU(4,"\n "),e._UZ(5,"og-circular-progress",17),e._uU(6,"\n "),e.qZA()),2&n){const o=e.oxw();e.Q6J("className",o.classes.processingSpinnerContainer),e.xp6(3),e.Oqu(o.listActionText),e.xp6(2),e.Q6J("className",o.classes.processingSpinner)}}function R(n,t){if(1&n&&(e.TgZ(0,"div",17),e._uU(1,"\n "),e.TgZ(2,"og-typography",26),e._uU(3,"Retrieving your lists..."),e.qZA(),e._uU(4,"\n "),e._UZ(5,"og-circular-progress",17),e._uU(6,"\n "),e.qZA()),2&n){const o=e.oxw();e.Q6J("className",o.classes.loadingContainer),e.xp6(5),e.Q6J("className",o.classes.loading)}}function W(n,t){if(1&n){const o=e.EpF();e.TgZ(0,"div",17),e._uU(1,"\n "),e.TgZ(2,"og-typography",27),e._uU(3,"Oh dear?"),e.qZA(),e._uU(4,"\n "),e.TgZ(5,"og-typography",28),e._uU(6,"Something went a little sideways."),e.qZA(),e._uU(7,"\n "),e.TgZ(8,"og-typography",28),e._uU(9,"\n Please try again, and if the problem continues,\n "),e.qZA(),e._uU(10,"\n "),e.TgZ(11,"a",29),e._uU(12,"contact support."),e.qZA(),e._uU(13,"\n "),e.TgZ(14,"og-button",30),e.NdJ("click",function(){e.CHM(o);const d=e.oxw();return e.KtG(d.grabAllLists())}),e._uU(15,"\n Try Again\n "),e.qZA(),e._uU(16,"\n "),e.qZA()}if(2&n){const o=e.oxw();e.Q6J("className",o.classes.listStateContainer),e.xp6(2),e.Q6J("className",o.classes.errorTitle),e.xp6(12),e.Q6J("className",o.classes.retryButton)("disabled",o.loadingLists)}}function q(n,t){if(1&n&&(e.TgZ(0,"div",17),e._uU(1,"\n "),e.TgZ(2,"og-typography",32),e._uU(3,"So fresh, so clean!"),e.qZA(),e._uU(4,"\n "),e.TgZ(5,"og-typography",12),e._uU(6,"\n It looks like you are creating your first List. This is very exciting!\n "),e.qZA(),e._uU(7,"\n "),e.TgZ(8,"og-typography",12),e._uU(9,"Please use the panel at left to get started."),e.qZA(),e._uU(10,"\n "),e.qZA()),2&n){const o=e.oxw(2);e.Q6J("className",o.classes.listStateContainer)}}function k(n,t){if(1&n&&(e.TgZ(0,"og-icon",36),e._uU(1,"check"),e.qZA()),2&n){const o=e.oxw(3);e.Q6J("className",o.classes.selectedListIcon)}}function K(n,t){if(1&n){const o=e.EpF();e.TgZ(0,"div"),e._uU(1,"\n "),e.TgZ(2,"og-flex",33),e.NdJ("click",function(){const I=e.CHM(o).$implicit,J=e.oxw(2);return e.KtG(J.selectList(I.id))}),e._uU(3,"\n "),e.YNc(4,k,2,1,"og-icon",34),e._uU(5,"\n "),e.TgZ(6,"div",17),e._uU(7,"\n "),e.TgZ(8,"og-typography",35),e._uU(9),e.qZA(),e._uU(10,"\n "),e.qZA(),e._uU(11,"\n "),e.qZA(),e._uU(12,"\n "),e.qZA()}if(2&n){const o=t.$implicit,s=e.oxw(2);e.xp6(2),e.Q6J("className",s.selectedListId===o.id?s.classes.selectedListItem:s.classes.listItem),e.xp6(2),e.Q6J("ngIf",s.selectedListId===o.id),e.xp6(2),e.Q6J("className",s.classes.existingList),e.xp6(2),e.Q6J("className",s.classes.existingList),e.xp6(1),e.Oqu(o.title)}}function j(n,t){if(1&n&&(e.TgZ(0,"div",17),e._uU(1,"\n "),e.YNc(2,q,11,1,"div",1),e._uU(3,"\n "),e.YNc(4,K,13,5,"div",31),e._uU(5,"\n "),e.qZA()),2&n){const o=e.oxw();e.Q6J("className",o.classes.listSelectionPanel),e.xp6(2),e.Q6J("ngIf",0===o.userLists.length),e.xp6(2),e.Q6J("ngForOf",o.filteredLists)}}const F=function(n){return[n]};var b=(()=>{return(n=b||(b={})).CreateList="createList",n.SelectList="selectList",b;var n})();let G=((M=class{get ListPanel(){return b}constructor(t,o){this.listService=t,this.drawerService=o,this.defaultListTitle="",this.defaultListDescription="",this.onBackButtonSelected=new e.vpe,this.onToggleDrawerOpen=new e.vpe,this.disableAddToListButton=!0,this.filteredLists=[],this.getAllListError=!1,this.listActionText="",this.loadingLists=!0,this.processing=!1,this.searchFilter="",this.searchFocused=!1,this.userLists=[]}ngOnInit(){var t=this;return(0,y.Z)(function*(){t.addCreateListForm=new _.nJ({listSelector:new _.p4(b.CreateList,[_.kI.required]),listTitle:new _.p4(t.defaultListTitle),listDescription:new _.p4(t.defaultListDescription)}),t.refreshCreateListPanel(),yield t.grabAllLists()})()}ngOnChanges(){this.addCreateListForm&&this.refreshCreateListPanel()}grabAllLists(){var t=this;return(0,y.Z)(function*(){try{t.loadingLists=!0,t.userLists=yield t.listService.getAllLists(null,{[h.GV.canEdit]:!0}),t.filteredLists=t.userLists,t.loadingLists=!1,t.getAllListError=!1,t.searchFilter=""}
1catch(o){t.loadingLists=!1,t.getAllListError=!0,console.error("Error occurred attempting to grab all user lists; Error: ",o)}})()}ngOnDestroy(){}addCoursesToList(){const t=this.addCreateListForm.get("listSelector").value;t===b.SelectList?this.addCoursesToAnExistingList():t===b.CreateList?this.createNewList():console.error("List Panel radio in odd state, currently set to: ",t)}createNewList(){var t=this;return(0,y.Z)(function*(){const o=t.addCreateListForm.get("listTitle").value;t.processing=!0,t.listActionText="Adding to your new list...";const s=t.buildListData(o),d=yield t.drawerService.createList(s);t.processing=!1,d&&(t.toggleDrawerOpen(),t.clearAndResetForm())})()}addCoursesToAnExistingList(){var t=this;return(0,y.Z)(function*(){const o=t.userLists.filter(d=>d.id===t.selectedListId)[0].title;t.processing=!0,t.listActionText="Adding to your list...";const s=yield t.drawerService.addCoursesToExistingList(t.buildListData(o,t.selectedListId));t.processing=!1,s&&(t.toggleDrawerOpen(),t.clearAndResetForm())})()}buildListData(t,o){return{courses:this.courses,...this.groups?{groups:this.groups}:{},...o?{listId:o}:{},listTitle:t,segmentFrom:this.segmentFrom,description:this.addCreateListForm.get("listDescription").value,listCreationSource:this.listCreationSource,listCreationSourceSessionId:this.listCreationSourceSessionId}}selectList(t){t===this.selectedListId?(this.selectedListId=null,this.disableAddToList()):(this.selectedListId=t,this.disableAddToListButton=!1),this.addCreateListForm.get("listSelector").setValue(b.SelectList)}disableAddToList(){this.disableAddToListButton=!0}onSelectCreateNewListPanel(){this.selectedListId=void 0,this.addCreateListForm.get("listSelector").setValue(b.CreateList),this.disableAddToListButton=""===this.addCreateListForm.get("listTitle").value}onTitleUpdate(t){this.disableAddToListButton=""===t.target.value}toggleDrawerOpen(){this.clearAndResetForm(),this.onToggleDrawerOpen.emit()}goBack(){this.onBackButtonSelected.emit()}filterLists(t){this.searchFilter=t,""===t?this.clearListFilter():this.filteredLists=this.userLists.filter(o=>o.title.includes(t))}clearListFilter(){this.filteredLists=this.userLists}clearAndResetForm(){this.addCreateListForm.get("listSelector").setValue(b.CreateList),this.addCreateListForm.get("listTitle").setValue(""),this.addCreateListForm.get("listDescription").setValue(""),this.selectedListId=void 0,this.searchFilter="",this.disableAddToListButton=!0,this.clearListFilter()}isAddToListInactive(){return!this.getAllListError&&!this.loadingLists&&0===this.userLists.length&&(this.addCreateListForm.get("listSelector").setValue(b.CreateList),!0)}refreshCreateListPanel(){this.addCreateListForm.get("listSelector").setValue(b.CreateList),this.addCreateListForm.get("listTitle").setValue(this.defaultListTitle),this.addCreateListForm.get("listDescription").setValue(this.defaultListDescription),this.selectedListId=void 0,this.disableAddToListButton=""===this.defaultListTitle,this.courseCount=this.courses?.length?this.drawerService.getTotalListCourseCount(this.courses):0}}).\u0275fac=function(o){return new(o||M)(e.Y36(h.XN),e.Y36(S.i))},M.\u0275cmp=e.Xpm({type:M,selectors:[["app-add-to-list"]],inputs:{courses:"courses",groups:"groups",segmentFrom:"segmentFrom",defaultListTitle:"defaultListTitle",defaultListDescription:"defaultListDescription",listCreationSource:"listCreationSource",listCreationSourceSessionId:"listCreationSourceSessionId"},outputs:{onBackButtonSelected:"onBackButtonSelected",onToggleDrawerOpen:"onToggleDrawerOpen"},features:[e.TTD],decls:96,vars:35,consts:[["flexDirection","column",3,"className"],[3,"className",4,"ngIf"],[3,"className","formGroup","ngSubmit"],["justifyContent","spaceBetween",3,"className"],["color","textPrimary","fontWeight","regular","variant","h4"],["color","primary","fontSize","md","popperTrigger","hover","popperPlacement","bottom",3,"popper","popperApplyClass"],["toolTip",""],["variant","h6",3,"className"],["variant","h1",3,"className"],["color","inherit","icon","close",3,"click"],[3,"ngClass","className"],["alignItems","baseline","justifyContent","spaceBetween"],["fontWeight","regular","variant","h5"],["startIcon","arrow_back","variant","text",3,"click"],["color","primary","startIcon","add","buttonType","submit","variant","contained","ngClass","e2e-add-to-list-submit-button",3,"disabled"],["flex","1",3,"className"],["gap","20px",3,"className"],[3,"className"],["alignItems","center",3,"className"],["formControlName","listSelector","name","listSelector","type","radio",3,"ngClass","value","click"],["element","h4","fontWeight","semiBold","variant","h5"],["formControlName","listTitle","name","list-title","placeholder","Title",3,"click","keyup"],["formControlName","listDescription","name","description","placeholder","Description",3,"click"],["alignItems","center",3,"ngClass","className"],["placeholder","Filter this list",3,"value","className","clearSearch","input","onFocus","onBlur"],["variant","h5"],["fontWeight","semiBold","variant","h6"],["element","h1","fontWeight","bold","variant","h2",3,"className"],["element","h4","fontWeight","regular","variant","h5"],["target","new","href","https://support.opensesame.com/hc/en-us"],["startIcon","refresh",3,"className","disabled","click"],[4,"ngFor","ngForOf"],["fontWeight","bold","variant","h2"],["ngClass","e2e-existing-list-item","alignItems","center",3,"className","click"],["color","primary",3,"className",4,"ngIf"],["fontWeight","regular","variant","h5",3,"className"],["color","primary",3,"className"]],template:function(o,s){if(1&o&&(e.TgZ(0,"og-flex",0),e._uU(1,"\n "),e.YNc(2,B,7,3,"div",1),e._uU(3,"\n "),e.TgZ(4,"form",2),e.NdJ("ngSubmit",function(){return s.addCoursesToList()}),e._uU(5,"\n "),e.TgZ(6,"og-flex",3),e._uU(7,"\n "),e.TgZ(8,"div"),e._uU(9,"\n "),e.TgZ(10,"og-typography",4),e._uU(11,"\n Total courses to be added:\n "),e.TgZ(12,"og-icon",5),e._uU(13,"\n help_outline\n "),e.qZA(),e._uU(14,"\n "),e.qZA(),e._uU(15,"\n "),e.TgZ(16,"popper-content",null,6),e._uU(18,"\n "),e.TgZ(19,"og-typography",7),e._uU(20,"Individual courses + language set courses"),e.qZA(),e._uU(21,"\n "),e.qZA(),e._uU(22,"\n "),e.TgZ(23,"og-typography",8),e._uU(24),e.qZA(),e._uU(25,"\n "),e.qZA(),e._uU(26,"\n "),e.TgZ(27,"og-icon-button",9),e.NdJ("click",function(){return s.toggleDrawerOpen()}),e.qZA(),e._uU(28,"\n "),e.qZA(),e._uU(29,"\n "),e.TgZ(30,"div",10),e._uU(31,"\n "),e.TgZ(32,"og-flex",11),e._uU(33,"\n "),e.TgZ(34,"og-typography",12),e._uU(35,"Select a List"),e.qZA(),e._uU(36,"\n "),e.TgZ(37,"div"),e._uU(38,"\n "),e.TgZ(39,"og-button",13),e.NdJ("click",function(){return s.goBack()}),e._uU(40,"Back"),e.qZA(),e._uU(41,"\n "),e.TgZ(42,"og-button",14),e._uU(43,"\n Add To List\n "),e.qZA(),e._uU(44,"\n "),e.qZA(),e._uU(45,"\n "),e.qZA(),e._uU(46,"\n "),e.TgZ(47,"og-flex-child",15),e._uU(48,"\n "),e.TgZ(49,"og-flex",16),e._uU(50,"\n "),e.TgZ(51,"og-flex-child",17),e._uU(52,"\n "),e.TgZ(53,"og-paper",17),e._uU(54,"\n "),e.TgZ(55,"og-flex",18),e._uU(56,"\n "),e.TgZ(57,"input",19),e.NdJ("click",function(){return s.onSelectCreateNewListPanel()}),e.qZA(),e._uU(58,"\n "),e.TgZ(59,"og-typography",20),e._uU(60,"Create a new List"),e.qZA(),e._uU(61,"\n "),e.qZA(),e._uU(62,"\n "),e.TgZ(63,"app-form-input",21),e.NdJ("click",function(){return s.onSelectCreateNewListPanel()})("keyup",function(I){return s.onTitleUpdate(I)}),e.qZA(),e._uU(64,"\n "),e.TgZ(65,"app-form-textarea",22),e.NdJ("click",function(){return s.onSelectCreateNewListPanel()}),e.qZA(),e._uU(66,"\n "),e.qZA(),e._uU(67,"\n "),e.qZA(),e._uU(68,"\n "),e.TgZ(69,"og-flex-child",15),e._uU(70,"\n "),e.TgZ(71,"og-paper",17),e._uU(72,"\n "),e.TgZ(73,"og-flex",23),e._uU(74,"\n "),e.TgZ(75,"input",19),e.NdJ("click",function(){return s.disableAddToList()}),e.qZA(),e._uU(76,"\n "),e.TgZ(77,"og-typography",20),e._uU(78,"Add to existing List"),e.qZA(),e._uU(79,"\n "),e.TgZ(80,"app-form-search",24),e.NdJ("clearSearch",function(){return s.clearListFilter()})("input",function(I){return s.filterLists(I.target.value)})("onFocus",function(){return s.searchFocused=!0})("onBlur",function(){return s.searchFocused=!1}),e.qZA(),e._uU(81,"\n "),e.qZA(),e._uU(82,"\n "),e.YNc(83,R,7,2,"div",1),e._uU(84,"\n "),e.YNc(85,W,17,4,"div",1),e._uU(86,"\n "),e.YNc(87,j,6,3,"div",1),e._uU(88,"\n "),e.qZA(),e._uU(89,"\n "),e.qZA(),e._uU(90,"\n "),e.qZA(),e._uU(91,"\n "),e.qZA(),e._uU(92,"\n "),e.qZA(),e._uU(93,"\n "),e.qZA(),e._uU(94,"\n"),e.qZA(),e._uU(95,"\n")),2&o){const d=e.MAs(17);e.Q6J("className",s.classes.drawerContent),e.xp6(2),e.Q6J("ngIf",s.processing),e.xp6(2),e.Q6J("className",s.classes.fullHeight)("formGroup",s.addCreateListForm),e.xp6(2),e.Q6J("className",s.classes.drawerTitle),e.xp6(6),e.Q6J("popper",d)("popperApplyClass",s.classes.popperTooltip),e.xp6(7),e.Q6J("className",s.classes.popperText),e.xp6(4),e.Q6J("className",s.classes.totalCourseCount),e.xp6(1),e.Oqu(s.courseCount),e.xp6(6),e.Q6J("ngClass",s.processing?s.classes.processingOpaque:"")("className",s.classes.activityContainer),e.xp6(12),e.Q6J("disabled",s.disableAddToListButton),e.xp6(
15),e.Q6J("className",s.classes.panelContainer),e.xp6(2),e.Q6J("className",s.classes.fullHeight),e.xp6(2),e.Q6J("className",s.classes.fullHeight),e.xp6(2),e.Q6J("className",s.classes.paper),e.xp6(2),e.Q6J("className",s.classes.newListHeader),e.xp6(2),e.Q6J("ngClass",e.VKq(31,F,s.classes.radioButton+" e2e-radio-create-new-list"))("value",s.ListPanel.CreateList),e.xp6(12),e.Q6J("className",s.classes.fullHeight),e.xp6(2),e.Q6J("className",s.classes.paper),e.xp6(2),e.Q6J("ngClass",s.isAddToListInactive()?s.classes.inactive:"")("className",s.classes.existingListHeader),e.xp6(2),e.Q6J("ngClass",e.VKq(33,F,s.classes.radioButton+" e2e-radio-add-to-existing-list"))("value",s.ListPanel.SelectList),e.xp6(5),e.Q6J("value",s.searchFilter)("className",s.classes.listSearchBar),e.xp6(3),e.Q6J("ngIf",s.loadingLists),e.xp6(2),e.Q6J("ngIf",s.getAllListError&&!s.loadingLists),e.xp6(2),e.Q6J("ngIf",!s.getAllListError&&!s.loadingLists)}},dependencies:[x.r0,L.mk,L.sg,L.O5,C.Ue,m.wy,c.s,g.d,u.F,r.oJ,l.r2,p.QE,_._Y,_.Fj,_._,_.JJ,_.JL,_.sg,_.u,f.lo,v.Bq,Z.Ml,Z.XS],encapsulation:2}),M);G=(0,O.gn)([(0,i.ozS)(n=>(0,i.kcS)({drawerContent:{height:"100%",paddingTop:2*n.spacing.unit},panelContainer:{marginTop:2*n.spacing.unit,height:"96%"},drawerTitle:{marginBottom:3*n.spacing.unit},fullHeight:{height:"100%"},radioButton:{marginRight:n.spacing.unit},paper:{borderRadius:3*n.spacing.unit,padding:2*n.spacing.unit,paddingLeft:3*n.spacing.unit,minWidth:400,maxWidth:715,height:"100%",boxShadow:"0px 0px 8px rgba(136, 135, 153, 0.20)",display:"flex",flexDirection:"column","& > app-form-input .form-wrapper":{margin:10},"& > app-form-textarea .form-wrapper":{margin:10}},newListHeader:{marginTop:2*n.spacing.unit,marginBottom:3*n.spacing.unit},existingListHeader:{marginBottom:3*n.spacing.unit},existingList:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},listSearchBar:{marginLeft:2*n.spacing.unit},listItem:{cursor:"pointer",padding:2*n.spacing.unit,"&:hover":{backgroundColor:n.palette.grey[300],borderRadius:10*n.spacing.unit}},selectedListIcon:{fontSize:n.typography.variants.h3.fontSize+" !important",paddingRight:4*n.spacing.unit},selectedListItem:{backgroundColor:"#fef5ef",borderRadius:10*n.spacing.unit,cursor:"pointer",padding:2*n.spacing.unit},errorTitle:{marginBottom:3*n.spacing.unit,fontSize:4*n.spacing.unit},listStateContainer:{textAlign:"center",display:"flex",justifyContent:"center",flexDirection:"column",height:"100%"},retryButton:{marginTop:2*n.spacing.unit},loadingContainer:{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",height:"80%"},loading:{marginTop:2*n.spacing.unit},processingOpaque:{opacity:.1,pointerEvents:"none"},inactive:{"& > div":{opacity:.5,pointerEvents:"none"}},activityContainer:{height:"92%",display:"flex",flexDirection:"column"},processingSpinnerContainer:{position:"relative",top:125,marginBottom:-82,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},processingSpinner:{marginTop:2*n.spacing.unit},listSelectionPanel:{display:"flex",flexDirection:"column",height:"100%",overflowX:"hidden"},totalCourseCount:{fontWeight:600},popperTooltip:{backgroundColor:`${n.palette.common.black} ! important`,borderRadius:"5px ! important",maxWidth:"400px ! important","& > .ngxp__arrow":{borderBottomColor:`${n.palette.common.black} ! important`,borderWidth:"0px 12px 10px ! important",top:"-8px ! important"}},popperText:{color:`${n.palette.common.white} ! important`,fontWeight:400}})),(0,O.w6)("design:paramtypes",[h.XN,S.i])],G);var Y=a(5507),z=a(8087),Q=a(7590),V=a(5299),X=a(2178),$=a(4132),ee=a(5436);function te(n,t){if(1&n&&(e.TgZ(0,"div",17),e._uU(1,"\n "),e.TgZ(2,"og-typography",24),e._uU(3,"Adding to your list..."),e.qZA(),e._uU(4,"\n "),e._UZ(5,"og-circular-progress",17),e._uU(6,"\n "),e.qZA()),2&n){const o=e.oxw();e.Q6J("className",o.classes.processingSpinnerContainer),e.xp6(5),e.Q6J("className",o.classes.processingSpinner)}}function se(n,t){1&n&&(e.TgZ(0,"og-icon"),e._uU(1,"chevron_right"),e.qZA())}function ne(n,t){if(1&n){const o=e.EpF();e.TgZ(0,"div"),e._uU(1,"\n "),e.TgZ(2,"og-flex",25),e._uU(3,"\n "),e.TgZ(4,"app-form-checkbox",26),e.NdJ("checkChange",function(d){e.CHM(o);const I=e.oxw();return e.KtG(I.toggleLanguageSelection(d))}),e.qZA(),e._uU(5,"\n "),e.TgZ(6,"og-flex-child",27),e.NdJ("click",function(){const I=e.CHM(o).$implicit,J=e.oxw();return e.KtG(J.displayCoursesForLanguage(I))}),e._uU(7,"\n "),e.TgZ(8,"div",28),e._uU(9,"\n "),e.TgZ(10,"og-typography"),e._uU(11),e.qZA(),e._uU(12,"\n "),e.TgZ(13,"og-flex",25),e._uU(14,"\n "),e.TgZ(15,"og-typography",29),e._uU(16),e.qZA(),e._uU(17,"\n "),e.YNc(18,se,2,0,"og-icon",23),e._uU(19,"\n "),e.qZA(),e._uU(20,"\n "),e.qZA(),e._uU(21,"\n "),e.qZA(),e._uU(22,"\n "),e.qZA(),e._uU(23,"\n "),e.qZA()}if(2&n){const o=t.$implicit,s=e.oxw();e.xp6(4),e.s9C("formControlName",o),e.Q6J("indeterminate",s.shouldBeIndeterminate(o))("value",o)("wrapperClasses",s.classes.checkboxWrapper),e.xp6(4),e.Q6J("className",s.classes.languageItem)("ngClass",s.isLanguageSelected(o)?s.classes.selectedLanguageItem:""),e.xp6(3),e.Oqu(o),e.xp6(
15),e.hij("\n ",s.languageCoursesSelectedCount(o),"\n "),e.xp6(2),e.Q6J("ngIf",s.isLanguageSelected(o))}}const oe=function(n,t){return{language:n,index:t}};function ie(n,t){if(1&n){const o=e.EpF();e.TgZ(0,"og-flex",31),e._uU(1,"\n "),e.TgZ(2,"app-form-checkbox",32),e.NdJ("checkChange",function(d){e.CHM(o);const I=e.oxw(2);return e.KtG(I.toggleSingleCourseSelection(d))}),e.qZA(),e._uU(3,"\n "),e.TgZ(4,"og-flex-child",33),e._uU(5,"\n "),e.TgZ(6,"og-typography"),e._uU(7),e.qZA(),e._uU(8,"\n "),e.TgZ(9,"og-typography",34),e._uU(10),e.qZA(),e._uU(11,"\n "),e.qZA(),e._uU(12,"\n "),e.qZA()}if(2&n){const o=t.$implicit,s=t.index,d=e.oxw(2);e.xp6(2),e.Q6J("checked",o.selected)("value",e.WLB(6,oe,d.selectedRightLanguage,s)),e.xp6(2),e.Q6J("className",d.classes.languageGroupCourse),e.xp6(3),e.Oqu(o.title),e.xp6(3),e.AsE("",o.publisher," - ",d.CourseLanguages[o.languageCodes],"")}}function ae(n,t){if(1&n&&(e.ynx(0),e._uU(1,"\n "),e.YNc(2,ie,13,9,"og-flex",30),e._uU(3,"\n "),e.BQk()),2&n){const o=e.oxw();e.xp6(2),e.Q6J("ngForOf",o.languageGroupMap[o.selectedRightLanguage])}}function re(n,t){if(1&n&&(e.TgZ(0,"og-flex",31),e._uU(1,"\n "),e.TgZ(2,"og-flex-child",33),e._uU(3,"\n "),e.TgZ(4,"og-typography"),e._uU(5),e.qZA(),e._uU(6,"\n "),e.TgZ(7,"og-typography",34),e._uU(8),e.qZA(),e._uU(9,"\n "),e.qZA(),e._uU(10,"\n "),e.qZA()),2&n){const o=t.$implicit,s=e.oxw(2);e.xp6(2),e.Q6J("className",s.classes.languageGroupCourse),e.xp6(3),e.Oqu(o.title),e.xp6(3),e.Oqu(o.publisher)}}function le(n,t){if(1&n&&(e.ynx(0),e._uU(1,"\n "),e.YNc(2,re,11,3,"og-flex",30),e._uU(3,"\n "),e.BQk()),2&n){const o=e.oxw();e.xp6(2),e.Q6J("ngForOf",o.unavailableLanguageGroupMap[o.selectedRightLanguage])}}let P=((N=class{get CourseLanguages(){return Y.db}constructor(t,o){this.addToCourseListDrawerService=t,this.activeSession=o,this.languageGroupMap={},this.nonLanguageGroupCourses=[],this.languageGroupMapChange=new e.vpe,this.onSelectedAllLanguages=new e.vpe,this.onToggleDrawerOpen=new e.vpe,this.showDeselectAll=!0,this.numberOfLanguageGroupCoursesSelected=0,this.processing=!1,this.selectedRightLanguage="",this.selectedTab=0,this.unavailableLanguageGroupMap={}}ngOnInit(){this.languages=Object.keys(this.languageGroupMap),this.setCourseCounts(),this.languageSelectionForm=new _.nJ({}),this.buildSelectionFormControls(),this.selectedRightLanguage=this.languages[0],this.buildUnavailableLanguageGroupMap()}ngOnDestroy(){this.clearState()}ngOnChanges(t){!t.courses?.isFirstChange()&&t.courses&&t.courses.previousValue!==t.courses.currentValue&&this.ngOnInit()}get languageSetIconSource(){return`${this.activeSession.session.mediaServiceUrl}${z.x}`}setCourseCounts(){const t=this.addToCourseListDrawerService.getTotalListCourseCount(this.nonLanguageGroupCourses);
1this.languages.forEach(o=>{this.numberOfLanguageGroupCoursesSelected+=this.languageGroupMap[o].filter(s=>s.selected).length}),this.totalCourseCount=t+this.numberOfLanguageGroupCoursesSelected}buildSelectionFormControls(){this.languages.forEach(t=>{this.languageGroupMap[t].every(o=>o.selected)?this.languageSelectionForm.addControl(t,new _.p4(!0)):this.languageSelectionForm.addControl(t,new _.p4(this.shouldBeIndeterminate(t)))})}buildUnavailableLanguageGroupMap(){this.languages.forEach(t=>{this.unavailableLanguageGroupMap[t]=[]}),this.courses.forEach(t=>{this.languages.forEach(o=>{const s=this.isCoursePartOfGroup(this.languageGroupMap[o],t),d=this.isCoursePartOfGroup(this.unavailableLanguageGroupMap[o],t);!s&&!d&&this.unavailableLanguageGroupMap[o].push(t)})})}isCoursePartOfGroup(t,o){for(const s of t)if(s.generatedGroupId===o.generatedGroupId)return!0;return!1}onSubmitLanguageSelectionForm(){var t=this;return(0,y.Z)(function*(){const o=Object.values(t.languageGroupMap).flat().filter(s=>s.selected);if(t.existingListData.id){t.processing=!0;const s=yield t.addToCourseListDrawerService.addCoursesToExistingList({courses:[...o,...t.nonLanguageGroupCourses],listId:t.existingListData.id,groupId:t.existingListData.groupId,...void 0===t.existingListData.groupId&&t.groups?{groups:t.groups}:{},segmentFrom:t.segmentFrom,listTitle:t.existingListData.title});return t.processing=!1,void(s&&(t.toggleDrawerOpen(),t.onSelectedAllLanguages.emit(o)))}t.onSelectedAllLanguages.emit(o)})()}toggleDrawerOpen(){this.onToggleDrawerOpen.emit(),this.ngOnDestroy()}displayCoursesForLanguage(t){this.selectedRightLanguage=t,this.selectedTab=0}isLanguageSelected(t){return this.selectedRightLanguage===t}tabSelected(t){this.selectedTab=t.activeTab}toggleLanguageSelection(t,o=!0){this.languageGroupMap[t.value].forEach(t.checked?s=>{this.totalCourseCount++,this.numberOfLanguageGroupCoursesSelected++,s.selected=!0}:s=>{s.selected&&(this.totalCourseCount--,this.numberOfLanguageGroupCoursesSelected--,s.selected=!1)}),o&&this.checkAndSetShowDeselectAll(),this.languageGroupMapChange.emit(this.languageGroupMap)}
1toggleAllLanguageSelections(t){this.languages.forEach(o=>{t?this.languageGroupMap[o].some(s=>s.selected)||(this.toggleLanguageSelection({checked:!0,value:o},!1),this.languageSelectionForm.get(o).setValue(!0)):this.languageGroupMap[o].some(s=>s.selected)&&(this.toggleLanguageSelection({checked:!1,value:o},!1),this.languageSelectionForm.get(o).setValue(!1))}),this.checkAndSetShowDeselectAll()}clearState(){this.unavailableLanguageGroupMap={},this.languages=[],this.selectedRightLanguage="",this.selectedTab=0,this.numberOfLanguageGroupCoursesSelected=0}courseMapLength(t,o){return t[o]?` (${t[o].length})`:""}languageCoursesSelectedCount(t){if(this.languageGroupMap[t]){const o=this.languageGroupMap[t].filter(s=>s.selected).length;return o>0?`${o} selected`:""}return""}toggleSingleCourseSelection(t){t.checked?(this.languageGroupMap[t.value.language][t.value.index].selected=!0,this.languageSelectionForm.get(t.value.language).setValue(!0),this.totalCourseCount++,this.numberOfLanguageGroupCoursesSelected++):(this.languageGroupMap[t.value.language][t.value.index].selected=!1,this.totalCourseCount--,this.numberOfLanguageGroupCoursesSelected--,this.languageGroupMap[t.value.language].every(o=>!o.selected)?this.languageSelectionForm.get(t.value.language).setValue(!1):this.languageSelectionForm.get(t.value.language).setValue(!0)),this.checkAndSetShowDeselectAll(),this.languageGroupMapChange.emit(this.languageGroupMap)}shouldDisableSelectAListButton(){return Object.values(this.languageGroupMap).flat().every(t=>!t.selected)}shouldBeIndeterminate(t){if(this.languageGroupMap[t]){const o=this.languageGroupMap[t].filter(s=>s.selected).length;return o>0&&o<this.languageGroupMap[t].length}return!1}checkAndSetShowDeselectAll(){for(const t of this.languages)if(this.languageGroupMap[t].some(o=>o.selected))return void(this.showDeselectAll=!0);this.showDeselectAll=!1}}).\u0275fac=function(o){return new(o||N)(e.Y36(S.i),e.Y36(Q.V))},N.\u0275cmp=e.Xpm({type:N,selectors:[["app-select-course-languages"]],inputs:{courses:"courses",existingListData:"existingListData",groups:"groups",languageGroupMap:"languageGroupMap",nonLanguageGroupCourses:"nonLanguageGroupCourses",segmentFrom:"segmentFrom"},outputs:{languageGroupMapChange:"languageGroupMapChange",onSelectedAllLanguages:"onSelectedAllLanguages",onToggleDrawerOpen:"onToggleDrawerOpen"},features:[e.TTD],decls:103,vars:39,consts:[["flexDirection","column",3,"className"],[3,"className",4,"ngIf"],[3,"className","formGroup","ngSubmit"],["justifyContent","spaceBetween",3,"className"],["color","textPrimary","fontWeight","regular","variant","h4"],["color","primary","fontSize","md","popperTrigger","hover","popperPlacement","bottom",3,"popper","popperApplyClass"],["toolTip",""],["variant","h6",3,"className"],["variant","h1",3,"className"],["color","inherit","icon","close",3,"click"],[3,"ngClass","className"],["alignItems","baseline","justifyContent","spaceBetween"],["fontWeight","regular","variant","h5"],[3,"className","icon"],["color","primary","startIcon","add","buttonType","submit","variant","outlined",3,"className","disabled"],["flex","1",3,"className"],["gap","20px",3,"className"],[3,"className"],[4,"ngFor","ngForOf"],["variant","text",3,"className","click"],["element","h3","fontWeight","semiBold","variant","h3",3,"className"],[3,"activeTab","className","tabClick"],["size","sm"],[4,"ngIf"],["variant","h5"],["alignItems","center"],[3,"indeterminate","formControlName","value","wrapperClasses","checkChange"],["flexGrow","1",3,"click"],[3,"className","ngClass"],["fontWeight","regular","variant","h6",1,"selectedAmount"],["alignItems","baseline",4,"ngFor","ngForOf"],["alignItems","baseline"],[3,"checked","value","checkChange"],["flexGrow","1",3,"className"],["fontWeight","light"]],template:function(o,s){if(1&o&&(e.TgZ(0,"og-flex",0),e._uU(1,"\n "),e.YNc(2,te,7,2,"div",1),e._uU(3,"\n "),e.TgZ(4,"form",2),e.NdJ("ngSubmit",function(){return s.onSubmitLanguageSelectionForm()}),e._uU(5,"\n "),e.TgZ(6,"og-flex",3),e._uU(7,"\n "),e.TgZ(8,"div"),e._uU(9,"\n "),e.TgZ(10,"og-typography",4),e._uU(11,"\n Total courses to be added:\n "),e.TgZ(12,"og-icon",5),e._uU(13,"\n help_outline\n "),e.qZA(),e._uU(14,"\n "),e.qZA(),e._uU(15,"\n "),e.TgZ(16,"popper-content",null,6),e._uU(18,"\n "),e.TgZ(19,"og-typography",7),e._uU(20,"Individual courses + language set courses"),e.qZA(),e._uU(21,"\n "),e.qZA(),e._uU(22,"\n "),e.TgZ(23,"og-typography",8),e._uU(24),e.qZA(),e._uU(25,"\n "),e.qZA(),e._uU(26,"\n "),e.TgZ(27,"og-icon-button",9),e.NdJ("click",function(){return s.toggleDrawerOpen()}),e.qZA(),e._uU(28,"\n "),e.qZA(),e._uU(29,"\n "),e.TgZ(30,"div",10),e._uU(31,"\n "),e.TgZ(32,"og-flex",11),e._uU(33,"\n "),e.TgZ(34,"og-typography",12),e._uU(35,"\n "),e._UZ(36,"og-svg-icon",13),e._uU(37,"\n Select courses by language\n "),e.TgZ(38,"span"),e._uU(39),e.qZA(),e._uU(40,"\n "),e.qZA(),e._uU(41,"\n "),e.TgZ(42,"div"),e._uU(43,"\n "),e.TgZ(44,"og-button",14),e._uU(45),e.qZA(),e._uU(46,"\n "),e.qZA(),e._uU(47,"\n "),e.qZA(),e._uU(48,"\n "),e.TgZ(49,"og-flex-child",15),e._uU(50,"\n "),e.TgZ(51,"og-flex",16),e._uU(52,"\n "),e.TgZ(53,"og-flex-child",17),e._uU(54,"\n "),e.TgZ(55,"og-paper",17),e._uU(56,"\n "),e.TgZ(57,"div",17),e._uU(58,"\n "),e.YNc(59,ne,24,9,"div",18),e._uU(60,"\n "),e.qZA(),e._uU(61,"\n "),e.TgZ(62,"og-button",19),e.NdJ("click",function(){return s.toggleAllLanguageSelections(!s.showDeselectAll)}),e._uU(63),e.qZA(),e._uU(64,"\n "),e.qZA(),e._uU(65,"\n "),e.qZA(),e._uU(66,"\n "),e.TgZ(67,"og-flex-child",15),e._uU(68,"\n "),e.TgZ(69,"og-paper",17),e._uU(70,"\n "),e.TgZ(71,"div"),e._uU(72,"\n "),e.TgZ(73,"og-typography",20),e._uU(74),e.qZA(),e._uU(75,"\n "),e.TgZ(76,"og-flex"),e._uU(77,"\n "),e.TgZ(78,"og-tabs",21),e.NdJ("tabClick",function(I){return s.tabSelected(I)}),e._uU(79,"\n "),e.TgZ(80,"og-tab",22),e._uU(81),e.qZA(),e._uU(82,"\n "),e.TgZ(83,"og-tab",22),e._uU(84),e.qZA(),e._uU(85,"\n "),e.qZA(),e._uU(86,"\n "),e.qZA(),e._uU(87,"\n "),e.qZA(),e._uU(88,"\n "),e.TgZ(89,"div",17),e._uU(90,"\n "),e.YNc(91,ae,4,1,"ng-container",23),e._uU(92,"\n "),e.YNc(93,le,4,1,"ng-container",23),e._uU(94,"\n "),e.qZA(),e._uU(95,"\n "),e.qZA(),e._uU(96,"\n "),e.qZA(),e._uU(97,"\n "),e.qZA(),e._uU(98,"\n "),e.qZA(),e._uU(99,"\n "),e.qZA(),e._uU(100,"\n "),e.qZA(),e._uU(101,"\n"),e.qZA(),e._uU(102,"\n")),2&o){const d=e.MAs(17);e.Q6J("className",s.classes.drawerContent),e.xp6(2),e.Q6J("ngIf",s.processing),e.xp6(2),e.Q6J("className",s.classes.fullHeight)("formGroup",s.languageSelectionForm),e.xp6(2),e.Q6J("className",s.classes.drawerTitle),e.xp6(6),e.Q6J("popper",d)("popperApplyClass",s.classes.popperTooltip),e.xp6(7),e.Q6J("className",s.classes.popperText),e.xp6(4),e.Q6J("className",s.classes.totalCourseCount),e.xp6(1),e.Oqu(s.totalCourseCount),e.xp6(6),e.Q6J("ngClass",s.processing?s.classes.processingOpaque:"")("className",s.classes.activityContainer),e.xp6(6),e.Q6J("className",s.classes.languageSetIcon)("icon",s.languageSetIconSource),e.xp6(2),e.Tol(s.classes.languageGroupCourseCount),e.xp6(1),e.hij("(",s.numberOfLanguageGroupCoursesSelected,")"),e.xp6(5),e.Q6J("className","e2e-select-a-list")("disabled",s.shouldDisableSelectAListButton()),e.xp6(1),e.hij("\n ",s.existingListData.groupId?"Add to List":"Select A List","\n "),e.xp6(4),e.Q6J("className",s.classes.panelContainer),e.xp6(2),e.Q6J("className",s.classes.fullHeight),e.xp6(2),e.Q6J("className",s.classes.fullHeight),e.xp6(2),e.Q6J("className",s.classes.paper),e.xp6(2),e.Q6J("className",s.classes.languageSelectorPanel),e.xp6(2),e.Q6J("ngForOf",s.languages),e.xp6(3),e.Q6J("className",s.classes.showDeselectAllButton),e.xp6(1),e.hij("\n ",s.showDeselectAll?"Deselect All":"Select All","\n "),e.xp6(4),e.Q6J("className",s.classes.fullHeight),e.xp6(2),e.Q6J("className",s.classes.paper+" "+s.classes.thickerPaper),e.xp6(4),e.Q6J("className",s.classes.languageGroupTitle),e.xp6(1),e.hij("\n ",s.selectedRightLanguage,"\n "),e.xp6(4),e.Q6J("activeTab",s.selectedTab)("className",s.classes.languageGroupTabs),e.xp6(3),e.hij("Available",s.courseMapLength(s.languageGroupMap,s.selectedRightLanguage),""),e.xp6(3),e.hij("Unavailable",s.courseMapLength(s.unavailableLanguageGroupMap,s.selectedRightLanguage),""),e.xp6(5),e.Q6J("className",s.classes.courseSelectionContainer),e.xp6(2),e.Q6J("ngIf",0===s.selectedTab),e.xp6(2),e.Q6J("ngIf",1===s.selectedTab)}},dependencies:[x.r0,L.mk,L.sg,L.O5,C.Ue,m.wy,V.a,r.oJ,l.r2,p.QE,_._Y,_.JJ,_.JL,_.sg,_.u,X.bk,f.lo,$.n4,ee.id,v.Bq,Z.Ml,Z.XS],encapsulation:2}),N);P=(0,O.gn)([(0,i.ozS)(n=>(0,i.kcS)({drawerContent:{height:"100%",paddingTop:2*n.spacing.unit},panelContainer:{marginTop:2*n.spacing.unit,height:"96%"},drawerTitle:{marginBottom:3*n.spacing.unit},fullHeight:{height:"100%"},radioButton:{marginRight:n.spacing.unit},paper:{borderRadius:3*n.spacing.unit,padding:3*n.spacing.unit,paddingBottom:n.spacing.unit,minWidth:400,height:"100%",display:"flex",flexDirection:"column",boxShadow:"0px 0px 8px rgba(136, 135, 153, 0.20)"},thickerPaper:{paddingTop:4*n.spacing.unit,paddingBottom:4*n.spacing.unit},languageSelectorPanel:{height:"100%",overflowX:"hidden"},popperTooltip:{backgroundColor:`${n.palette.common.black} ! important`,borderRadius:"5px ! important",maxWidth:"400px ! important","& > .ngxp__arrow":{borderBottomColor:`${n.palette.common.black} ! important`,borderWidth:"0px 12px 10px ! important",top:"-8px ! important"}},popperText:{color:`${n.palette.common.white} ! important`,fontWeight:400},newListHeader:{marginTop:2*n.spacing.unit},paperHeader:{marginBottom:3*n.spacing.unit},courseSelectionContainer:{display:"flex",flexDirection:"column",overflowX:"hidden"},existingList:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},listSearchBar:{marginLeft:2*n.spacing.unit},listItem:{cursor:"pointer",padding:2*n.spacing.unit,"&:hover":{backgroundColor:n.palette.grey[300],borderRadius:10*n.spacing.unit}},selectedListIcon:{fontSize:"21px !important",paddingRight:4*n.spacing.unit},selectedListItem:{backgroundColor:n.palette.primary.light,borderRadius:10*n.spacing.unit,cursor:"pointer",padding:2*n.spacing.unit},languageItem:{alignItems:"center",display:"flex",justifyContent:"space-between",paddingBottom:12,paddingLeft:2*n.spacing.unit,paddingRight:2*n.spacing.unit,paddingTop:12,"&:hover":{backgroundColor:n.palette.grey[300],borderRadius:10*n.spacing.unit},"& .og-typography-h6":{fontSize:12}},checkboxWrapper:{"& label.checkbox input[type=checkbox]":{position:"relative"},"& label.checkbox":{display:"flex",paddingTop:n.spacing.unit,paddingBottom:11}},selectedLanguageItem:{background:n.palette.primary.light,color:n.palette.primary.main,borderRadius:10*n.spacing.unit,"&:hover":{background:n.palette.primary.light,borderRadius:10*n.spacing.unit},"& .og-typography-h6":{fontSize:12,color:n.palette.primary.main}},languageGroupTitle:{fontWeight:600,marginBottom:2*n.spacing.unit},languageGroupTabs:{marginBottom:3*n.spacing.unit},languageGroupCourse:{marginLeft:n.spacing.unit,paddingBottom:n.spacing.unit},processingOpaque:{opacity:.1,pointerEvents:"none"},activityContainer:{height:"92%",display:"flex",flexDirection:"column"},processingSpinnerContainer:{position:"relative",top:125,marginBottom:-82,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},processingSpinner:{marginTop:2*n.spacing.unit},languageSetIcon:{fill:n.palette.common.black,fontSize:"2em",verticalAlign:"middle"},languageGroupCourseCount:{fontWeight:600},totalCourseCount:{fontWeight:600},showDeselectAllButton:{float:"right",paddingRight:"10px",paddingLeft:"10px",fontSize:"14px"}})),(0,O.w6)("design:paramtypes",[S.i,Q.V])],P);var ge=a(499),ce=a(9935);let pe=(()=>{const t=class{};let n=t;return t.\u0275fac=function(d){return new(d||t)},t.\u0275mod=e.oAB({type:t}),t.\u0275inj=e.cJS({providers:[S.i],imports:[D.d,L.ez,i.sx_,i.oB3,U.rt]}),n})();e.B6R(A.W,[G,P,L.O5,ge.hg,ce.PM,U.mK],[])},5028:(w,E,a)=>{a.d(E,{i:()=>m});var A=a(9671),i=a(8929),D=a(7164),L=a(5325),S=a(8592),U=a(94),e=a(5856),y=a(2437),O=a(4855),_=a(350),h=a(4650),T=a(7753),x=a(7590),C=a(6405);let m=(()=>{const g=class{constructor(r,l,p,f,v,Z){this.listService=r,this.notificationService=l,this.router=p,this.segmentService=f,this.activeSession=v,this.modalHostService=Z,this.drawerPropsSubject=ne
1w i.xQ,this.coursesAddedSubject=new i.xQ,this.closingDrawerSubject=new i.xQ}openDrawer(r){var l=this;return(0,A.Z)(function*(){if(l.activeSession.session.isLoggedIn)r.segmentFrom===D.XX.ListGroupCoursesModal&&r.courses.every(p=>!p.isLanguageGroupMember)?yield l.addCoursesToExistingList({courses:r.courses,listId:r.listData.id,groupId:r.groupId,segmentFrom:r.segmentFrom,listTitle:r.listData.title}):l.drawerPropsSubject.next(r);else{const p=l.getTotalListCourseCount(r.courses);l.modalHostService.showModal(O.X,{message:`add ${y.m.formatPlural(p,"this course","these courses")} to a list`})}})()}addCoursesToExistingList(r){var l=this;return(0,A.Z)(function*(){try{const{allItems:p,groups:f,ungroupedItems:v}=l.prepareListContents(r);return f&&(yield l.listService.createGroups(r.listId,{groups:f,reuseExistingGroups:!0})),v.length&&(yield l.listService.addItems(r.listId,v,!0)),l.coursesAddedSubject.next({listId:r.listId,requiresListReload:Boolean(f)}),l.addedCoursesToListSuccessNotification(r),l.addSegment(r,p),!0}catch(p){console.error(p);const f=(0,_.gm)(p)?_.hi:L.n.ListErrorText;return l.notificationService.publishNotification(f,"error"),!1}})()}createList(r){var l=this;return(0,A.Z)(function*(){try{const{allItems:p,groups:f,ungroupedItems:v}=l.prepareListContents(r),Z=yield l.listService.createListPromise(l.buildCreateListOptions(r,v,f));return l.coursesAddedSubject.next({listId:Z.id}),l.notificationService.publishNotification(L.n.ListCreatedText,"success","View List",()=>l.router.navigate(["/lists","detail",Z.id])),r.listId=Z.id,l.addSegment(r,p),!0}catch(p){console.error(p);const f=(0,_.KU)(p)||L.j.ListCreateErrorText(p.message);return l.notificationService.publishNotification(f,"error"),!1}})()}generateListItemsToAdd(r){const l=[];return r.courses.forEach(p=>{const f={itemId:p.nid.toString(),productType:p.productType};r.groupId&&(f.groupId=r.groupId),l.push(f)}),l}filterListGroupsToSelectedCourses(r,l){if(!r?.length)return;const p=new Set(l.map(v=>v.nid.toString())),f=r.map(v=>({...v,courses:v.courses?.filter(Z=>p.has(Z.itemId))??[]})).filter(v=>v.courses.length>0);return f.length?f:void 0}prepareListContents(r){const l=this.generateListItemsToAdd(r),p=r.groupId?void 0:this.filterListGroupsToSelectedCourses(r.groups,r.courses);if(!p)return{allItems:l,ungroupedItems:l};const f=new Set(p.flatMap(Z=>Z.courses?.map(B=>B.itemId)??[])),v=r.courses.filter(Z=>!f.has(Z.nid.toString()));return{allItems:l,groups:p,ungroupedItems:this.generateListItemsToAdd({...r,courses:v})}}buildCreateListOptions(r,l,p){return{title:r.listTitle,description:r.description,items:l,...r.listCreationSource?{source:r.listCreationSource}:{},...r.listCreationSourceSessionId?{aiAssistantSessionId:r.listCreationSourceSessionId}:{},...p?{groups:p}:{}}}addedCoursesToListSuccessNotification(r){const l=this.getTotalListCourseCount(r.courses),p=l.toString()+" "+y.m.formatPlural(l,"item has","items have")+" been added to your list";r.groupId?this.notificationService.publishNotification(p,"success"):this.notificationService.publishNotification(p,"success","View List",()=>this.router.navigate(["/lists","detail",r.listId]))}addSegment(r,l){const p={additions:l,listTitle:r.listTitle,addedFrom:r.segmentFrom,listId:r.listId};try{this.segmentService.trackListAdditions(p)}catch(f){console.log(`Error occurred attempting to send segment tracking data for these list additions: ${p}; error: ${f}`)}}closingDrawer(){this.closingDrawerSubject.next()}getTotalListCourseCount(r){return r.map(l=>l.courseCount).reduce((l,p)=>l+p,0)}};let c=g;return g.\u0275fac=function(l){return new(l||g)(h.LFG(S.XN),h.LFG(U.g),h.LFG(T.F0),h.LFG(e.B),h.LFG(x.V),h.LFG(C.z))},g.\u0275prov=h.Yz7({token:g,factory:g.\u0275fac,providedIn:"root"}),c})()},3260:(w,E,a)=>{a.d(E,{d:()=>O});var A=a(6895),i=a(8954),D=a(4006),L=a(8018),S=a(4482),U=a(100),e=a(7650),y=a(4650);let O=(()=>{const h=class{};let _=h;return h.\u0275fac=function(C){return new(C||h)},h.\u0275mod=y.oAB({type:h}),h.\u0275inj=y.cJS({imports:[i.hJ1,A.ez,i.sx_,i.BxM,i.aeS,L.Y,S.T,U.K,i.QX1,i.vRE,i.ugV,i.rSX,i.eIS,D.UX,i.oB3,i.Yql,i.Zi,i.P4_,i.IQz,
1i.eSL,e.jz]}),_})()},350:(w,E,a)=>{a.d(E,{KU:()=>L,gm:()=>S,hi:()=>A});const A="Your group title can only use plain text. Please pick a new title.",i="Your list title can only use plain text. Please pick a new title.",D="Your list description can only use plain text. Please update it.";function L(U){const e=U&&U.error&&U.error.message;return e===A||e===i||e===D?e:null}function S(U){return L(U)===A}},4855:(w,E,a)=>{a.d(E,{X:()=>h});var A=a(9671),i=a(4650),D=a(3702),L=a(7753),S=a(7590),U=a(6895),e=a(757);const y=["modal"];function O(T,x){if(1&T){const C=i.EpF();i.TgZ(0,"og-button",7),i.NdJ("click",function(){i.CHM(C);const c=i.oxw();return i.KtG(c.register())}),i._uU(1),i.qZA()}if(2&T){const C=i.oxw();i.xp6(1),i.hij("\n ",C.registerButton.title,"\n ")}}function _(T,x){if(1&T){const C=i.EpF();i.TgZ(0,"og-button",6),i.NdJ("click",function(){i.CHM(C);const c=i.oxw();return i.KtG(c.login())}),i._uU(1),i.qZA()}if(2&T){const C=i.oxw();i.xp6(1),i.Oqu(C.loginButton.title)}}let h=(()=>{const x=class{constructor(m,c){this.router=m,this.activeSession=c,this.onSubmit=new i.vpe}get modalTitle(){return this.registerButton?this.registerButton.title:this.loginButton?this.loginButton.title:""}get registerButton(){return void 0!==this.session.registerButton?this.session.registerButton:null}get loginButton(){return void 0!==this.session.logInButton?this.session.logInButton:null}get session(){return this.activeSession.session}ngOnInit(){}register(){this.hide(),this.navigateToRoute(this.registerButton.route)}login(){this.hide(),this.navigateToRoute(this.loginButton.route)}show(m){this.currentQueryParams=m.queryParams,this.subHeadline=this.registerButton?"Create an OpenSesame account or log in to "+m.message:"Log in to "+m.message,this.modal.show()}hide(){this.modal.hide()}navigateToRoute(m){var c=this;return(0,A.Z)(function*(){const g=c.applyCurrentQueryParams(c.router.url);yield c.router.navigate([m],{queryParams:{destination:g}}),c.onSubmit.emit()})()}applyCurrentQueryParams(m){if(!this.currentQueryParams)return m;const c=this.router.parseUrl(m);return c.queryParams={...this.currentQueryParams,...c.queryParams},this.router.serializeUrl(c)}};let T=x;return x.\u0275fac=function(c){return new(c||x)(i.Y36(L.F0),i.Y36(S.V))},x.\u0275cmp=i.Xpm({type:x,selectors:[["app-login-modal"]],viewQuery:function(c,g){if(1&c&&i.Gf(y,7),2&c){let u;i.iGM(u=i.CRH())&&(g.modal=u.first)}},outputs:{onSubmit:"onSubmit"},decls:17,vars:4,consts:[["googleIconImageName","add_circle",3,"headline","subHeadline"],["modal",""],[1,"pt-20"],["color","primary","size","sm","variant","contained",3,"click",4,"ngIf"],["size","sm",3,"click",4,"ngIf"],[1,"text-left","pt-20"],["size","sm",3,"click"],["color","primary","size","sm","variant","contained",3,"click"]],template:function(c,g){1&c&&(i.TgZ(0,"app-modal",0,1),i._uU(2,"\n "),i.TgZ(3,"div",2),i._uU(4,"\n "),i.YNc(5,O,2,1,"og-button",3),i._uU(6,"\n "),i.YNc(7,_,2,1,"og-button",4),i._uU(8,"\n "),i.qZA(),i._uU(9,"\n "),i.TgZ(10,"div",5),i._uU(11,"\n "),i.TgZ(12,"og-button",6),i.NdJ("click",function(){return g.hide()}),i._uU(13,"Cancel"),i.qZA(),i._uU(14,"\n "),i.qZA(),i._uU(15,"\n"),i.qZA(),i._uU(16,"\n")),2&c&&(i.Q6J("headline",g.modalTitle)("subHeadline",g.subHeadline),i.xp6(5),i.Q6J("ngIf",g.registerButton),i.xp6(2),i.Q6J("ngIf",g.loginButton))},dependencies:[U.O5,D.z,e.r0]}),T})()}}]);
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.