1import{b as E}from"./chunk-H3ZOHFO7.js";import"./chunk-CIKJJUSN.js";import"./chunk-RRZRS5BZ.js";import"./chunk-LY7WOQZN.js";import"./chunk-T3PLPHIG.js";import"./chunk-2JW6ZMWV.js";import"./chunk-NIP74ZKI.js";import"./chunk-QNUNLKYK.js";import{r as L}from"./chunk-RE4JJFV5.js";import"./chunk-COEKBYWO.js";import"./chunk-E2K2LIS4.js";import{a as T}from"./chunk-KJKRX6VS.js";import"./chunk-2CRWMDGS.js";import"./chunk-4WMDX4SQ.js";import"./chunk-IQLKO45Z.js";import"./chunk-V6KBZVCY.js";import"./chunk-6FQQM4CE.js";import"./chunk-VTTO24NQ.js";import"./chunk-Y5VOXWTF.js";import{n as w,q as k}from"./chunk-YWHNFDXQ.js";import"./chunk-FCTHY2PU.js";import"./chunk-DPVJW3LI.js";import{f as v,h as O,i as b}from"./chunk-GW33KQPR.js";import"./chunk-TUEKBDZZ.js";import"./chunk-RLPOKPIS.js";import"./chunk-TPES7EAS.js";import"./chunk-QXJM3TTT.js";import{F as P}from"./chunk-TMOIAHHX.js";import{Ib as o,Jb as S,Wa as l,Xa as p,ab as d,bb as t,cb as i,db as g,ga as a,kb as M,o as f,p as h,q as C,qb as _,r as x,sa as m,tb as s,za as y}from"./chunk-DJNWGYMM.js";import"./chunk-VOZAGDK7.js";import"./chunk-E5QWB6YB.js";function V(n,u){n&1&&(t(0,"div",3),g(1,"div",7),t(2,"h3"),o(3,"Preparing your SafeSport course\u2026"),i(),t(4,"p"),o(5,"We're getting everything ready. This usually takes just a few seconds."),i()())}function K(n,u){n&1&&o(0," Saving\u2026 ")}function B(n,u){n&1&&o(0," I Accept ")}function A(n,u){if(n&1){let e=M();t(0,"div",4)(1,"h3"),o(2,"SafeSport Terms & Conditions"),i(),t(3,"p",8),o(4,"Before you can start the course, SafeSport asks that you review and accept their terms."),i(),t(5,"div",9)(6,"pre"),o(7),i()(),t(8,"div",10)(9,"button",11),_("click",function(){f(e);let r=s();return h(r.declineTnc())}),o(10,"Cancel"),i(),t(11,"button",12),_("click",function(){f(e);let r=s();return h(r.acceptTnc())}),l(12,K,1,0)(13,B,1,0),i()()()}if(n&2){let e=s();a(7),S(e.tncText),a(2),d("disabled",e.acceptingTnc),a(2),d("disabled",e.acceptingTnc),a(),p(e.acceptingTnc?12:13)}}function H(n,u){if(n&1&&(t(0,"div",5),C(),t(1,"svg",13),g(2,"path",14),i(),x(),t(3,"h3"),o(4,"Your SafeSport course is open in a new tab"),i(),t(5,"p"),o(6,"Switch to that tab to take the course. You can close this page once you're done \u2014 your progress will update here automatically when you complete the course."),i(),t(7,"a",15),o(8,"\u2190 Back to course"),i()()),n&2){let e=s();a(7),d("routerLink",e.backToCourseUrl)}}function j(n,u){if(n&1){let e=M();t(0,"div",6),C(),t(1,"svg",16),g(2,"path",17),i(),x(),t(3,"h3"),o(4,"We couldn't open your course"),i(),t(5,"p"),o(6),i(),t(7,"div",18)(8,"a",15),o(9,"\u2190 Back to course"),i(),t(10,"button",19),_("click",function(){f(e);let r=s();return h(r.retryLaunch())}),o(11,"Try again"),i()()()}if(n&2){let e=s();a(6),S(e.errorMessage),a(2),d("routerLink",e.backToCourseUrl)}}var F=(()=>{class n{api;route;router;notify;state="preparing";errorMessage="";tncText="";acceptingTnc=!1;openingPlayer=!1;courseID="";moduleKey="";lectureKey="";constructor(e,c,r,I){this.api=e,this.route=c,this.router=r,this.notify=I,this.courseID=this.route.snapshot.paramMap.get("id")||"",this.moduleKey=this.route.snapshot.paramMap.get("moduleKey")||"",this.lectureKey=this.route.snapshot.paramMap.get("lectureKey")||""}ngOnInit(){this.requestLaunch()}get backToCourseUrl(){return`/pages/lms/course/${this.courseID}`}retryLaunch(){this.errorMessage="",this.state="preparing",this.requestLaunch()}requestLaunch(){this.openingPlayer=!0,this.api.post("LMS/safesport/launch",{courseKey:this.courseID,moduleKey:this.moduleKey,lectureKey:this.lectureKey}).subscribe({next:e=>{if(this.openingPlayer=!1,e?.requiresTncAcceptance){this.tncText=e.tncText||"Please review and accept the SafeSport terms before starting the course.",this.state="tnc";return}let c=e?.launchUrl;if(!c){this.showError("We couldn't open your SafeSport course right now. Please try again in a few minutes.");return}window.open(c,"_blank","noopener,noreferrer")?this.state="opened":this.state="opened"},error:()=>{this.openingPlayer=!1,this.showError("We couldn't reach SafeSport right now. Please try again in a few minutes.")}})}acceptTnc(){this.acceptingTnc=!0,this.api.post("LMS/safesport/accept-tnc",{}).subscribe({next:()=>{this.acceptingTnc=!1,this.state="preparing",this.requestLaunch()},error:()=>{this.acceptingTnc=!1,this.notify.openWarningModal("We couldn't save your acceptance. Please try again.")}})}declineTnc(){this.router.navigateByUrl(this.backToCourseUrl)}showError(e){this.errorMessage=e,this.state="error"}static \u0275fac=function(c){return new(c||n)(m(T),m(v),m(O),m(L))};static \u0275cmp=y({type:n,selectors:[["lms-safesport-lecture"]],decls:7,vars:5,consts:[[1,"page-layout","simple","fullwidth"],["title","SafeSport Course",3,"hideBanner"],[1,"content","safesport-lecture-container"],[1,"state-card"],[1,"state-card","tnc-card"],[1,"state-card","success-card"],[1,"state-card","error-card"],[1,"spinner"],[1,"tnc-intro"],[1,"tnc-text"],[1,"tnc-actions"],["mat-stroked-button","",3,"click","disabled"],["mat-flat-button","","color","primary",3,"click","disabled"],["viewBox","0 0 24 24","width","64","height","64","fill","currentColor",1,"success-icon"],["d","M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M11,16.5L18,9.5L16.59,8.09L11,13.67L7.91,10.59L6.5,12L11,16.5Z"],[1,"back-link",3,"routerLink"],["viewBox","0 0 24 24","width","64","height","64","fill","currentColor",1,"error-icon"],["d","M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"],[1,"actions"],["mat-flat-button","","color","primary",3,"click"]],template:function(c,r){c&1&&(t(0,"div",0),g(1,"page-header",1),t(2,"div",2),l(3,V,6,0,"div",3),l(4,A,14,4,"div",4),l(5,H,9,1,"div",5),l(6,j,12,2,"div",6),i()()),c&2&&(a(),d("hideBanner",!0),a(2),p(r.state==="preparing"?3:-1),a(),p(r.state==="tnc"?4:-1),a(),p(r.state==="opened"?5:-1),a(),p(r.state==="error"?6:-1))},dependencies:[P,b,k,w,E],styles:[".safesport-lecture-container[_ngcontent-%COMP%]{padding:16px}.safesport-lecture-container[_ngcontent-%COMP%] .state-card[_ngcontent-%COMP%]{max-width:720px;margin:32px auto;padding:32px;background:#fff;border-radius:12px;box-shadow:0 2px 8px #0000000f;text-align:center}.safesport-lecture-container[_ngcontent-%COMP%] .state-card[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:16px 0 8px;font-size:22px;font-weight:600;
1color:#1a1a1a}.safesport-lecture-container[_ngcontent-%COMP%] .state-card[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:#4a4a4a;line-height:1.5;margin:0 0 16px}.safesport-lecture-container[_ngcontent-%COMP%] .state-card[_ngcontent-%COMP%] .spinner[_ngcontent-%COMP%]{width:48px;height:48px;border:4px solid #e5e7eb;border-top-color:#b30202;border-radius:50%;animation:_ngcontent-%COMP%_spin .8s linear infinite;margin:0 auto 16px}.safesport-lecture-container[_ngcontent-%COMP%] .state-card[_ngcontent-%COMP%] .success-icon[_ngcontent-%COMP%]{color:#10b981}.safesport-lecture-container[_ngcontent-%COMP%] .state-card[_ngcontent-%COMP%] .error-icon[_ngcontent-%COMP%]{color:#ef4444}.safesport-lecture-container[_ngcontent-%COMP%] .state-card[_ngcontent-%COMP%] .back-link[_ngcontent-%COMP%]{display:inline-block;margin-top:8px;color:#113989;text-decoration:none;font-weight:500}.safesport-lecture-container[_ngcontent-%COMP%] .state-card[_ngcontent-%COMP%] .back-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.safesport-lecture-container[_ngcontent-%COMP%] .state-card[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:12px;align-items:center;justify-content:center;margin-top:16px}.safesport-lecture-container[_ngcontent-%COMP%] .tnc-card[_ngcontent-%COMP%], .safesport-lecture-container[_ngcontent-%COMP%] .tnc-card[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{text-align:left}.safesport-lecture-container[_ngcontent-%COMP%] .tnc-card[_ngcontent-%COMP%] .tnc-intro[_ngcontent-%COMP%]{color:#4a4a4a}.safesport-lecture-container[_ngcontent-%COMP%] .tnc-card[_ngcontent-%COMP%] .tnc-text[_ngcontent-%COMP%]{max-height:400px;overflow-y:auto;padding:16px;background:#f9fafb;border:1px solid #e5e7eb;border-radius:8px;margin:16px 0}.safesport-lecture-container[_ngcontent-%COMP%] .tnc-card[_ngcontent-%COMP%] .tnc-text[_ngcontent-%COMP%] pre[_ngcontent-%COMP%]{white-space:pre-wrap;word-wrap:break-word;font-family:inherit;font-size:14px;line-height:1.5;color:#1a1a1a;margin:0}.safesport-lecture-container[_ngcontent-%COMP%] .tnc-card[_ngcontent-%COMP%] .tnc-actions[_ngcontent-%COMP%]{display:flex;gap:12px;justify-content:flex-end}@keyframes _ngcontent-%COMP%_spin{to{transform:rotate(360deg)}}"]})}return n})();export{F as SafeSportLectureComponent};
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.