1import{a as Re,b as qe,c as $e,d as Ue,e as je}from"./chunk-HTCLTJ5C.js";import{a as Le}from"./chunk-F3G5R5SN.js";import{a as Ne}from"./chunk-O3AB7NIS.js";import{a as Fe}from"./chunk-OWKN33XV.js";import"./chunk-GAX33WGZ.js";import"./chunk-DP5WGZUE.js";import"./chunk-PPF4CICK.js";import{a as Ge}from"./chunk-56O74KCJ.js";import{m as Me}from"./chunk-PSH5TAI2.js";import{a as H}from"./chunk-W3NUKB7B.js";import"./chunk-KJJHSOFJ.js";import"./chunk-USN3IUD3.js";import"./chunk-AZUCPPFK.js";import"./chunk-SGQORKKV.js";import"./chunk-ZBQW7NJG.js";import"./chunk-C6O6I5LW.js";import"./chunk-O2P25Q5F.js";import{A as be,B as xe,C as De,D as ye,E as Se,I as Ae,K as ke,O as Be,P as we,Q as Pe,R as Te,S as Oe,T as Ee,d as se,g as de,h as le,i as ce,j as pe,ja as Ie,k as me,l as ge,m as ue,ma as Ve,o as _e,p as fe,pa as G,r as P,s as he,t as Ce,x as ve}from"./chunk-TPCL2XMH.js";import{a as X}from"./chunk-WRBQWUEI.js";import{k as re,n as Q,o as ae}from"./chunk-KSTBAVB4.js";import{$c as ie,Ab as r,Ac as S,Bb as n,Cb as f,D as k,Dc as B,Ec as C,Fc as W,Lb as b,Nb as h,P as R,Pb as d,Ra as a,Wb as $,Xb as U,Z as w,ac as s,bc as E,bd as F,cc as x,da as p,dc as K,ea as m,eb as A,ja as Y,kb as Z,oc as te,pa as M,qa as N,qd as ne,sb as g,sc as v,sd as oe,tc as j,ub as u,uc as y,wb as ee,xb as T,yb as O,zb as _}from"./chunk-P2OBJROK.js";import"./chunk-IZQOVDKO.js";import{a as I,b as V}from"./chunk-6IZLXKZM.js";function We(){return t=>{let c=t.value;if(!c)return null;let e=P.email(t);if(e)return e;var i=c.split("@")[1];return i.indexOf(".")===-1?{customEmail:'Email must contain a full stop after "@"'}:null}}var Xe=(t,c)=>c.id;function Ye(t,c){if(t&1&&(r(0,"option",21),s(1),n()),t&2){let e=c.$implicit;_("ngValue",e.id),a(),x(" ",e.displayName," ")}}function Ze(t,c){if(t&1&&(r(0,"div",2)(1,"div",3)(2,"label",19),s(3,"Delegate Type"),n(),r(4,"select",20)(5,"option",21),s(6,"Please select..."),n(),T(7,Ye,2,2,"option",21,Xe),n()()()),t&2){let e=d();a(5),_("ngValue",null),a(2),O(e.variants())}}function et(t,c){if(t&1&&(r(0,"div",22)(1,"h5",24),s(2,"CPD Modules"),n(),r(3,"h5",25),s(4),v(5,"currency"),n(),r(6,"p",26),f(7,"img",27),n(),r(8,"div",28),f(9,"input",29),r(10,"label",30),s(11,"Add "),n()(),r(12,"p",31),s(13,"Earn CPD accreditation at your own pace"),n()()),t&2){let e=d(2);a(4),x(" Only ",y(5,1,e.getAddOnPrice(e.addOnPricing().cpdModules),"GBP")," ")}}function tt(t,c){if(t&1&&(r(0,"div",22)(1,"h5",24),s(2,"Safeguarding"),n(),r(3,"h5",25),s(4),v(5,"currency"),n(),r(6,"p",26),f(7,"img",32),n(),r(8,"div",28),f(9,"input",33),r(10,"label",34),s(11,"Add"),n()(),r(12,"p",31),s(13," Why not try the NB Medical Safeguarding and Child Protection Course? "),n()()),t&2){let e=d(2);a(4),x(" Only ",y(5,1,e.getAddOnPrice(e.addOnPricing().safeguarding),"GBP")," ")}}function it(t,c){if(t&1&&(r(0,"div",23)(1,"h5",24),s(2,"Basic Life Support"),n(),r(3,"h5",25),s(4),v(5,"currency"),n(),r(6,"p",26),f(7,"img",35),n(),r(8,"div",28),f(9,"input",36),r(10,"label",37),s(11,"Add"),n()(),r(12,"p",31),s(13," Why not try the NB Medical Basic Life Support Refresher Course? "),n()()),t&2){let e=d(2);a(4),x(" Only ",y(5,1,e.getAddOnPrice(e.addOnPricing().basicLifeSupport),"GBP")," ")}}function nt(t,c){if(t&1&&(r(0,"div",3)(1,"div",10),g(2,et,14,4,"div",22),g(3,tt,14,4,"div",22),g(4,it,14,4,"div",23),n()()),t&2){let e=d();a(2),u(e.addOnPricing().cpdModules?2:-1),a(),u(e.addOnPricing().safeguarding?3:-1),a(),u(e.addOnPricing().basicLifeSupport?4:-1)}}var z=(()=>{class t{constructor(){this.formBuilder=w(Ae),this.destroyRef=w(Y),this.variants=C(void 0),this.statusChanged=B(),this.addOnPricing=C(void 0),this.initForm(),N(()=>{let e=this.variants();e?.length===1&&this.addDelegateForm.patchValue({productVariantId:e[0].id},{emitEvent:!1})})}get value(){return this.addDelegateForm.value}reset(){let e=this.variants();this.addDelegateForm.reset({firstName:"",lastName:"",email:"",productVariantId:e?.length===1?e[0].id:null,includeNBPlus:!1,includeCPDModules:!1,includeSafeguarding:!1,includeBasicLifeSupport:!1})}initForm(){this.addDelegateForm=this.formBuilder.group({firstName:["",[P.required,P.minLength(1)]],lastName:["",[P.required,P.minLength(1)]],email:["",[P.required,We()]],productVariantId:[null,[P.required]],includeNBPlus:[!1,[]],includeCPDModules:[!1,[]],includeSafeguarding:[!1,[]],includeBasicLifeSupport:[!1,[]]}),this.addDelegateForm.statusChanges.pipe(ne(this.destroyRef)).subscribe(e=>{this.statusChanged.emit(e)})}getAddOnPrice(e){let i=this.variants().find(l=>l.id===this.addDelegateForm?.value.productVariantId);if(!i)return e.variants[0].price;let o=e.variants.find(l=>l.persona===i.persona);return o?o.price:e.variants[0].price}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=A({type:t,selectors:[["nbm-add-delegate-form"]],inputs:{variants:[1,"variants"],addOnPricing:[1,"addOnPricing"]},outputs:{statusChanged:"statusChanged"},decls:29,vars:3,consts:[[3,"formGroup"],[1,"row","p-3"],[1,"col-md-6"],[1,"mb-3"],["for","firstName"],["id","firstName","type","text","formControlName","firstName",1,"form-control"],["for","lastName"],["id","lastName","type","text","formControlName","lastName",1,"form-control"],["for","email"],["id","email","type","text","formControlName","email",1,"form-control"],[1,"row","justify-content-center"],[1,"col-lg-11","mb-3"],["ngbAccordion","","activeIds","addons-panel"],["ngbAccordionItem","",3,"ngbAccordionItem"],["ngbAccordionHeader",""],["ngbAccordionButton","",1,"text-center","bg-light-blue","text-dark","py-3","align-items-center","d-flex","justify-content-center","w-100","border-0","h5","mb-0"],[1,"icon-exclamation-circle","me-3","icon-2x","text-dark"],["ngbAccordionCollapse",""],["ngbAccordionBody",""],["for","productVariantId"],["id","productVariantId","formControlName","productVariantId",1,"form-select"],[3,"ngValue"],[1,"col-6","col-lg-4"],[1,"col-lg-4"],[1,"text-center","h2","text-dark"],[1,"text-center","h4","text-dark"],[1,"text-center"],["src","https://api.nbmedical.com/image/0225df15-1412-474a-8a31-b532d73c839a/show?crop=Wide&width=500&height=500","alt","Hot Topics GP Update",1,"border-light-blue","border-5","border","mb-3","w-75"],[1,"custom-control","custom-checkbox","text-center"],["type","checkbox","id","cpdModules","formControlName","includeCPDModules",1,"custom-control-input","me-3"],["for","cpdModules",1,"custom-control-label","h4"],[1,"text-center","mt-lg-3","lead","text-dark"],["src","https://api.nbmedical.com/image/5834bcd4-d63e-4e6c-a5c6-3a3b562e2c09/show?width=500&height=500&crop=Wide","alt","Safeguarding",1,"border-light-blue","border-5","border","mb-3","w-75"],["type","checkbox","id","safeguarding","formControlName","includeSafeguarding",1,"custom-control-input","me-3"],["for","safeguarding",1,"custom-control-label","h4"],["src","https://api.nbmedical.com/image/d9d78781-dbd0-48f8-8cce-46cdebc2a3b0/show?width=500&height=500&crop=Wide","alt","Basic Life Support",1,"border-light-blue","border-5","border","mb-3","w-75"],["type","checkbox","id","basicLifeSupport","formControlName","includeBasicLifeSupport",1,"custom-control-input","me-3"],["for","basicLifeSupport",1,"custom-control-label","h4"]],template:function(i,o){i&1&&(r(0,"form",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"label",4),s(5,"First name"),n(),f(6,"input",5),n()(),r(7,"div",2)(8,"div",3)(9,"label",6),s(10,"Last name"),n(),f(11,"input",7),n()(),r(12,"div",2)(13,"div",3)(14,"label",8),s(15,"Email"),n(),f(16,"input",9),n()(),g(17,Ze,9,1,"div",2),n(),r(18,"div",10)(19,"div",11)(20,"div",12)(21,"div",13)(22,"div",14)(23,"button",15),f(24,"span",16),s(25,"Enhance your learning with exclusive Add-ons from NB Medical "),n()(),r(26,"div",17)(27,"div",18),Z(28,nt,5,3,"ng-template"),n()()()()()()()),i&2&&(_("formGroup",o.addDelegateForm),a(17),u(o.variants().length>1?17:-1),a(4),_("ngbAccordionItem","addons-panel"))},dependencies:[ke,ve,ye,Se,fe,_e,De,he,Ce,xe,be,ue,ce,ge,me,pe,de,le,F],encapsulation:2})}}return t})();function ot(t,c){if(t&1){let e=b();r(0,"h4"),s(1,"Work Address"),n(),r(2,"div",7),s(3," We need to gather the work address so that your organisation can confirm the delegate's attendance on the course. "),n(),r(4,"nbm-practice-address-form",8),h("statusChanged",function(o){p(e);let l=d();return m(l.practiceAddressStatusChanged(o))})("addressChanged",function(o){p(e);let l=d();return m(l.practiceAddressChanged(o))}),n()}if(t&2){let e=d();a(4),_("address",e.practiceAddress)("ukAndIrelandOnly",!0)}}function rt(t,c){t&1&&(r(0,"div",3),s(1,"Please enter values for all of the required fields above"),n())}var J=(()=>{class t{constructor(){this.processing=C(void 0),this.product=C(void 0),this.addOnPricing=C(void 0),this.delegateForm=W(z),this.delegateInfoStatus="",this.practiceAddressStatus="",this.practiceAddress=this.getNewPracticeAddress(),this.addDelegate=B()}get delegateFormValid(){return this.delegateInfoStatus==="VALID"}get practiceAddressFormValid(){return this.practiceAddressStatus==="VALID"}resetInfo(){this.delegateForm()?.reset(),this.practiceAddress=this.getNewPracticeAddress()}getNewPracticeAddress(){return{address1:"",address2:"",city:"",country:"",county:"",postcode:""}}get formValid(){return this.isCCG?this.practiceAddressFormValid&&this.delegateFormValid:this.delegateFormValid}onAddDelegate(){this.formValid?this.addDelegate.emit([this.delegateForm().value,this.practiceAddress]):this.showError=!0}delegateInfoStatusChanged(e){this.delegateInfoStatus=e,this.formValid&&(this.showError=!1)}practiceAddressChanged(e){this.practiceAddress=e}practiceAddressStatusChanged(e){this.practiceAddressStatus=e,this.formValid&&(this.showError=!1)}get isCCG(){let e=this.product();return e.productType===X.CCGCourse||e.productType===X.CCGWebinar}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=A({type:t,selectors:[["nbm-add-delegate"]],viewQuery:function(i,o){i&1&&$(o.delegateForm,z,5),i&2&&U()},inputs:{processing:[1,"processing"],product:[1,"product"],addOnPricing:[1,"addOnPricing"]},outputs:{addDelegate:"addDelegate"},decls:10,vars:6,consts:[[1,"p-3","border","mb-3"],[1,"text-center"],[3,"statusChanged","addOnPricing","variants"],[1,"alert","alert-danger"],[1,"text-end","addForm"],[1,"btn","btn-primary",3,"click","nbmProcessingButton"],[3,"step"],[1,"alert","alert-info"],[3,"statusChanged","addressChanged","address","ukAndIrelandOnly"]],template:function(i,o){i&1&&(r(0,"div",0)(1,"h6",1),s(2,"Please complete the following information for each delegate in your booking"),n(),r(3,"nbm-add-delegate-form",2),h("statusChanged",function(q){return o.delegateInfoStatusChanged(q)}),n(),g(4,ot,5,2),g(5,rt,2,0,"div",3),r(6,"div",4)(7,"button",5),h("click",function(){return o.onAddDelegate()}),s(8,"Add to order"),n()(),f(9,"nbm-checkout-step-on-show",6),n()),i&2&&(a(3),_("addOnPricing",o.addOnPricing())("variants",o.product().variants),a(),u(o.isCCG?4:-1),a(),u(o.showError?5:-1),a(2),_("nbmProcessingButton",o.processing()),a(2),_("step",3))},dependencies:[H,Fe,Ne,z],encapsulation:2})}}return t})();var Qe=(t,c)=>
1c.type;function at(t,c){if(t&1){let e=b();r(0,"li",20),s(1),v(2,"currency"),r(3,"button",21),h("click",function(){let o=p(e).$implicit,l=d(2);return m(l.onRemoveAddOn(o.type))}),s(4," Remove "),n()()}if(t&2){let e=c.$implicit,i=d(2);a(),K(" ",e.type," - ",y(2,3,e.price.price,"GBP")," "),a(2),_("nbmProcessingButton",i.processing())}}function st(t,c){if(t&1&&(r(0,"ul",12),T(1,at,5,6,"li",20,Qe),n()),t&2){let e=d();a(),O(e.delegate().addOns)}}function dt(t,c){if(t&1){let e=b();r(0,"button",25),h("click",function(){let o=p(e).$implicit,l=d(2);return m(l.onAddAddOn(o.type))}),s(1),v(2,"currency"),n()}if(t&2){let e=c.$implicit;a(),K(" ",e.type," - ",y(2,2,e.price,"GBP")," ")}}function lt(t,c){if(t&1&&(r(0,"div",13)(1,"button",22),s(2),n(),r(3,"div",23),T(4,dt,3,5,"button",24,Qe),n()()),t&2){let e=d();a(),_("nbmProcessingButton",e.processing())("originalText","Select add-ons for "+e.delegate().name),a(),x(" Select add-ons for ",e.delegate().name," "),a(2),O(e.delegate().addOnsAvailable(e.addOnPricing()))}}function ct(t,c){if(t&1&&(r(0,"li"),s(1),n()),t&2){let e=c.$implicit;a(),E(e)}}function pt(t,c){if(t&1&&(r(0,"div",14)(1,"ul",26),T(2,ct,2,1,"li",null,ee),n()()),t&2){let e=d();a(2),O(e.delegate().validationErrors)}}function mt(t,c){t&1&&(r(0,"p",16),f(1,"span",27),s(2," NB Account"),n())}function gt(t,c){t&1&&(r(0,"p",17),f(1,"span",28),s(2," NB Account "),n())}var He=(()=>{class t{constructor(){this.delegate=C(void 0),this.processing=C(void 0),this.addOnPricing=C(void 0),this.removeDelegate=B(),this.removeDelegateAddOn=B(),this.addDelegateAddOn=B()}onRemoveDelegate(){this.removeDelegate.emit(this.delegate())}onRemoveAddOn(e){this.removeDelegateAddOn.emit({delegate:this.delegate(),addOn:e})}onAddAddOn(e){this.addDelegateAddOn.emit({delegate:this.delegate(),addOn:e})}getPrice(e){return this.addOnPricing().getPrice(e,this.delegate().personaName)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=A({type:t,selectors:[["nbm-delegate-list-item"]],inputs:{delegate:[1,"delegate"],processing:[1,"processing"],addOnPricing:[1,"addOnPricing"]},outputs:{removeDelegate:"removeDelegate",removeDelegateAddOn:"removeDelegateAddOn",addDelegateAddOn:"addDelegateAddOn"},decls:29,vars:12,consts:[[1,"border","shadow","mb-3"],[1,"row"],[1,"col-lg-12"],[1,"card-header","bg-dark","text-white"],["aria-hidden","true",1,"icon-user","me-3"],[1,"col-8"],[1,"ms-3","mt-2","mb-0"],["aria-hidden","true",1,"icon-envelope","me-2"],[1,"col-4"],[1,"text-end","mt-2","me-2","mb-2"],[1,"col-lg-12","mb-2","mb-lg-0"],[1,"ms-2","mb-2"],[1,"list-group","mb-2","me-2"],["ngbDropdown","","placement","top-end",1,"d-inline-block"],[1,"alert","alert-danger","my-3"],[1,"row","align-items-center"],[1,"badge","bg-success","p-2","ms-2","mb-0"],[1,"badge","badge","p-2","ms-2","mb-0","text-darken"],[1,"text-end","me-2","mb-2"],["type","button",1,"btn","p-0","icon-trash","text-danger","icon-2x","mt-2",3,"click"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"btn","btn-sm","btn-outline-danger",3,"click","nbmProcessingButton"],["ngbDropdownToggle","",1,"btn","btn-sm","btn-outline-primary",3,"nbmProcessingButton","originalText"],["ngbDropdownMenu","","aria-labelledby","dropdownBasic1"],["ngbDropdownItem",""],["ngbDropdownItem","",3,"click"],[1,"list-unstyled","mb-0"],["aria-hidden","true",1,"icon-check"],["aria-hidden","true",1,"icon-times"]],template:function(i,o){i&1&&(r(0,"div",0)(1,"div",1)(2,"div",2)(3,"p",3),f(4,"span",4),r(5,"strong"),s(6),v(7,"uppercase"),n()(),r(8,"div",1)(9,"div",5)(10,"p",6),f(11,"i",7),s(12),n()(),r(13,"div",8)(14,"h5",9),s(15),v(16,"currency"),n()()()(),r(17,"div",10)(18,"div",11),g(19,st,3,0,"ul",12),g(20,lt,6,3,"div",13),n()()(),g(21,pt,4,0,"div",14),r(22,"div",15)(23,"div",5),g(24,mt,3,0,"p",16)(25,gt,3,0,"p",17),n(),r(26,"div",8)(27,"div",18)(28,"button",19),h("click",function(){return o.onRemoveDelegate()}),n()()()()()),i&2&&(a(6),x("",j(7,7,o.delegate().name)," "),a(6),E(o.delegate().email),a(3),x(" ",y(16,9,o.delegate().subtotal.price,"GBP")," "),a(4),u(o.delegate().hasAnyAddons?19:-1),a(),u(o.addOnPricing()&&o.delegate().canAddAnyAddOns(o.addOnPricing())?20:-1),a(),u(o.delegate().isValid?-1:21),a(3),u(o.delegate().hasNBMedicalAccount?24:25))},dependencies:[Ee,Oe,Te,Pe,Be,we,H,F,ie],encapsulation:2})}}return t})();var ut=(t,c)=>c.id;function _t(t,c){if(t&1){let e=b();r(0,"nbm-delegate-list-item",6),h("removeDelegate",function(o){p(e);let l=d(2);return m(l.onRemoveDelegate(o))})("removeDelegateAddOn",function(o){p(e);let l=d(2);return m(l.onRemoveAddOn(o))})("addDelegateAddOn",function(o){p(e);let l=d(2);return m(l.onAddAddOn(o))}),n()}if(t&2){let e=c.$implicit,i=d(2);_("delegate",e)("processing",i.processing()[e.id])("addOnPricing",i.addOnPricing())}}function ft(t,c){if(t&1){let e=b();r(0,"div",4)(1,"div",7)(2,"button",8),h("click",function(){p(e);let o=d(2);return m(o.goToCheckout())}),s(3,"Proceed to checkout"),n()()()}}
1function ht(t,c){if(t&1&&(r(0,"div",2),T(1,_t,1,3,"nbm-delegate-list-item",3,ut),n(),g(3,ft,4,0,"div",4),r(4,"p",5)(5,"small"),s(6," Delegates require a free NB Medical dashboard account to access course materials. If the delegate does not have a NB Medical account, they will be emailed with instructions on how to register. "),n()()),t&2){let e=d();a(),O(e.delegates()),a(2),u(e.canProceed()?3:-1)}}function Ct(t,c){t&1&&(r(0,"div",1),s(1,"Add at least 1 delegate to proceed"),n())}var ze=(()=>{class t{constructor(){this.delegates=C(void 0),this.addOnPricing=C(void 0),this.processing=C(void 0),this.canProceed=C(void 0),this.removeDelegate=B(),this.removeDelegateAddOn=B(),this.addDelegateAddOn=B(),this.proceed=B()}get anyDelegates(){return this.delegates().length>0}onRemoveDelegate(e){this.removeDelegate.emit(e)}onRemoveAddOn(e){this.removeDelegateAddOn.emit(e)}onAddAddOn(e){this.addDelegateAddOn.emit(e)}goToCheckout(){this.proceed.emit(!0)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=A({type:t,selectors:[["nbm-delegate-list"]],inputs:{delegates:[1,"delegates"],addOnPricing:[1,"addOnPricing"],processing:[1,"processing"],canProceed:[1,"canProceed"]},outputs:{removeDelegate:"removeDelegate",removeDelegateAddOn:"removeDelegateAddOn",addDelegateAddOn:"addDelegateAddOn",proceed:"proceed"},decls:5,vars:1,consts:[[1,"p-3","border"],[1,"alert","alert-info"],[1,"row","row-eq-height","mt-lg-3"],[1,"col-lg-6",3,"delegate","processing","addOnPricing"],[1,"row","mt-4"],[1,"mt-5","text-center"],[1,"col-lg-6",3,"removeDelegate","removeDelegateAddOn","addDelegateAddOn","delegate","processing","addOnPricing"],[1,"col","text-end"],[1,"btn","btn-primary",3,"click"]],template:function(i,o){i&1&&(r(0,"div",0)(1,"h3"),s(2,"Delegates"),n(),g(3,ht,7,1)(4,Ct,2,0,"div",1),n()),i&2&&(a(3),u(o.anyDelegates?3:4))},dependencies:[He],encapsulation:2})}}return t})();var vt=()=>["/basket"];function bt(t,c){if(t&1&&(r(0,"li",3)(1,"div",4)(2,"span",5)(3,"strong")(4,"i"),s(5,"Discount Total"),n()()(),r(6,"small",6),s(7),v(8,"currency"),n()()()),t&2){let e=d();a(7),x(" ",y(8,1,e.basket().subtotalDiscount.price,"GBP")," ")}}function xt(t,c){if(t&1&&(r(0,"li",3)(1,"div",4)(2,"span",5)(3,"strong")(4,"i"),s(5,"Shipping Total"),n()()(),r(6,"small",6),s(7),v(8,"currency"),n()()()),t&2){let e=d();a(7),x(" ",y(8,1,e.basket().shippingTotal.price,"GBP")," ")}}function Dt(t,c){if(t&1&&(r(0,"li",3)(1,"div",10)(2,"span",5),s(3,"Total"),n(),r(4,"span"),s(5),v(6,"currency"),n()()(),r(7,"li",3)(8,"div",4)(9,"span",5),s(10,"Store Credit"),n(),r(11,"span"),s(12),v(13,"currency"),n()()(),r(14,"li",7)(15,"div",11)(16,"span",5),s(17,"Balance to Pay "),n(),r(18,"span"),s(19),v(20,"currency"),n()()()),t&2){let e=d();a(5),E(y(6,3,e.basket().total.price,"GBP")),a(7),E(y(13,6,-e.basket().storeCredit,"GBP")),a(7),E(y(20,9,e.basket().balanceToPay,"GBP"))}}function yt(t,c){if(t&1&&(r(0,"li",7)(1,"div",11)(2,"span",5),s(3,"Total"),n(),r(4,"span"),s(5),v(6,"currency"),n()()()),t&2){let e=d();a(5),E(y(6,1,e.basket().total.price,"GBP"))}}var Je=(()=>{class t{constructor(){this.basket=C(void 0)}get anyCredit(){return this.basket().storeCredit!==0}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=A({type:t,selectors:[["nbm-group-booking-summary"]],inputs:{basket:[1,"basket"]},decls:34,vars:11,consts:[[1,"card","m-3"],[1,"h5","mb-3","bg-dark","p-3","text-white"],[1,"list-group","list-group-flush"],[1,"list-group-item"],[1,"d-flex","w-100","justify-content-between","align-items-center"],[1,"m-0"],[1,"ms-2","text-end"],[1,"list-group-item","p-0"],[1,"text-center"],[3,"routerLink"],[1,"d-flex","w-100","justify-content-between","align-items-center","fw-bold"],[1,"d-flex","w-100","justify-content-between","align-items-center","fw-bold","card-header"]],template:function(i,o){i&1&&(r(0,"div",0)(1,"div",1),s(2,"Order Summary"),n(),r(3,"ul",2)(4,"li",3)(5,"div",4)(6,"span",5),s(7,"Total Delegates"),n(),r(8,"small",6),s(9),n()()(),r(10,"li",3)(11,"div",4)(12,"span",5),s(13,"Total Add-on Purchases"),n(),r(14,"small",6),s(15),n()()(),r(16,"li",3)(17,"div",4)(18,"span",5)(19,"strong")(20,"i"),s(21,"Subtotal"),n()()(),r(22,"small",6),s(23),v(24,"currency"),n()()(),g(25,bt,9,4,"li",3),g(26,xt,9,4,"li",3),g(27,Dt,21,12)(28,yt,7,4,"li",7),n()(),r(29,"p",8),s(30," This page is for group bookings only. If you are only booking for yourself, please use our "),r(31,"a",9),s(32,"Basket"),n(),s(33,` instead 2`),n()),i&2&&(a(9),x(" ",o.basket().delegateCount," "),a(6),x(" ",o.basket().addOnCount," "),a(8),x(" ",y(24,7,o.basket().subtotalPreDiscount.price,"GBP")," "),a(2),u(o.basket().hasSubtotalDiscount?25:-1),a(),u(o.basket().requiresShipping?26:-1),a(),u(o.anyCredit?27:28),a(4),_("routerLink",te(10,vt)))},dependencies:[ae,F],encapsulation:2})}}return t})();function St(t,c){if(t&1&&s(0),t&2){let e=d(2);x(" (",e.basket().delegateCount,") ")}}function At(t,c){if(t&1){let e=b();r(0,"button",15),h("click",function(){p(e);let o=d(2);return m(o.goToDelegateInformation())}),s(1,"Edit"),n()}}function kt(t,c){if(t&1){let e=b();r(0,"div",9)(1,"nbm-add-delegate",16,0),h("addDelegate",function(o){p(e);let l=d(2);return m(l.addDelegate(o))}),n(),r(3,"nbm-delegate-list",17),h("removeDelegate",function(o){p(e);let l=d(2);return m(l.onRemoveDelegate(o))})("removeDelegateAddOn",function(o){p(e);let l=d(2);return m(l.onRemoveDelegateAddOn(o))})("addDelegateAddOn",function(o){p(e);let l=d(2);return m(l.onAddDelegateAddOn(o))})("proceed",function(){p(e);let o=d(2);return m(o.goToBillingAddress())}),n()()}if(t&2){let e=d(2);a(),_("product",e.product())("processing",e.processingAdd())("addOnPricing",e.basket().addOnPricing),a(2),_("delegates",e.basket().delegates)("canProceed",e.canGoToBillingAddress())("processing",e.processingDelegate())("addOnPricing",e.basket().addOnPricing)}}function Bt(t,c){if(t&1){let e=b();r(0,"button",15),h("click",function(){p(e);let o=d(2);return m(o.goToBillingAddress())}),s(1,"Edit"),n()}}function wt(t,c){if(t&1){let e=b();r(0,"div",9)(1,"nbm-billing-address",18),h("billingAddressSet",function(o){p(e);let l=d(2);return m(l.onBillingAddressSet(o))}),n()()}if(t&2){let e=d(2);a(),_("address",e.basket().billingAddress)("processing",e.processingBilling())}}function Pt(t,c){if(t&1){let e=b();r(0,"button",15),h("click",function(){p(e);let o=d(3);return m(o.goToShippingAddress())}),s(1,"Edit"),n()}}function Tt(t,c){if(t&1){let e=b();r(0,"div",9)(1,"nbm-shipping-address",19),h("shippingAddressSet",function(o){p(e);let l=d(3);return m(l.onShippingAddressSet(o))}),n()()}if(t&2){let e=d(3);a(),_("billingExists",e.basket().billingAddress!==null)("shippingSameAsBilling",e.basket().shippingAddressSameAsBillingAddress)("address",e.basket().shippingAddress)("processing",e.processingShipping())}}function Ot(t,c){if(t&1&&(r(0,"div",4)(1,"div",5)(2,"div",6)(3,"h4",7),s(4,"Shipping Address"),n(),g(5,Pt,2,0,"button",8),n()(),g(6,Tt,2,4,"div",9),n()),t&2){let e=d(2);a(5),u(e.isShippingBackwardStep()&&e.canGoToShippingAddress()?5:-1),a(),u(e.isShippingAddress()?6:-1)}}function Et(t,c){if(t&1){let e=b();r(0,"div",10)(1,"nbm-payment-form",20),h("contactPreferencesSet",function(o){p(e);let l=d(2);return m(l.onContactPreferencesSet(o))})("selectPaymentMethod",function(o){p(e);let l=d(2);return m(l.onSelectPaymentMethod(o))})("registerSetupIntent",function(){p(e);let o=d(2);return m(o.onRegisterSetupIntent())})("resetTransaction",function(){p(e);let o=d(2);return m(o.onResetTransaction())})("completeOrder",function(){p(e);let o=d(2);return m(o.onCompleteOrder())})("completeInvoiceOrder",function(o){p(e);let l=d(2);return m(l.onCompleteInvoiceOrder(o))})("completeOfflineOrder",function(o){p(e);let l=d(2);return m(l.onCompleteOfflineOrder(o))})("chooseAnotherMethod",function(){p(e);let o=d(2);return m(o.onChooseAnotherMethod())})("paymentSuccess",function(o){p(e);let l=d(2);return m(l.onPaymentSuccess(o))})("paymentFailure",function(o){p(e);let l=d(2);return m(l.onPaymentFailure(o))})("sendInvoice",function(o){p(e);let l=d(2);return m(l.onSendInvoice(o))})("createStripeInvoiceForUserBasket",function(o){p(e);let l=d(2);return m(l.onCreateStripeInvoiceForUserBasket(o))})("createOfflinePaymentInvoice",function(o){p(e);let l=d(2);return m(l.onCreateOfflinePaymentInvoice(o))}),n()()}if(t&2){let e=d(2);a(),_("basket",e.basket())("redirectUrl",e.redirectUrl)("processing",e.processingPayment())}}function It(t,c){if(t&1&&(r(0,"ul",14)(1,"li",21),f(2,"nbm-discount-form",22),n()()),t&2){let e=d(2);a(2),_("basket",e.basket())("groupBookingProductId",e.product().id)}}function Vt(t,c){if(t&1){let e=b();r(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"div",5)(5,"div",6)(6,"h4",7),s(7," Delegate Information "),g(8,St,1,1),n(),g(9,At,2,0,"button",8),n()(),g(10,kt,4,7,"div",9),n(),r(11,"div",4)(12,"div",5)(13,"div",6)(14,"h4",7),s(15,"Billing Address"),n(),g(16,Bt,2,0,"button",8),n()(),g(17,wt,2,2,"div",9),n(),g(18,Ot,7,2,"div",4),r(19,"div",4)(20,"div",5)(21,"div",6)(22,"h4",7),s(23,"Payment Details"),n()()(),g(24,Et,2,3,"div",10),n()()(),r(25,"div",11),f(26,"nbm-group-booking-summary",12),r(27,"nbm-discount-display",13),h("deleteDiscount",function(o){p(e);let l=d();return m(l.removeDiscount(o))}),n(),g(28,It,3,2,"ul",14),n()()}if(t&2){let e=d();a(8),u(e.basket().anyDelegates?8:-1),a(),u(e.isDelegateInfoBackwardStep()&&e.canGoToDelegateInformation()?9:-1),a(),u(e.isDelegateInformation()?10:-1),a(6),u(e.isBillingBackwardStep()&&e.canGoToBillingAddress()?16:-1),a(),u(e.isBillingAddress()?17:-1),a(),u(e.basket().requiresShipping?18:-1),a(6),u(e.isPaymentDetails()?24:-1),a(2),_("basket",e.basket()),a(),_("basket",e.basket()),a(),u(e.basket().isPaying?-1:28)}}function Mt(t,c){t&1&&f(0,"nbm-loading")}var D=(function(t){return t[t.DelegateInformation=0]="DelegateInformation",t[t.BillingAddress=1]="BillingAddress",t[t.ShippingAddress=2]="ShippingAddress",t[t.PaymentDetails=3]="PaymentDetails",t})(D||{}),Ke=(()=>{class t{get redirectUrl(){return`${window.origin}${this.router.url}/complete`}constructor(){this.groupBookingService=w(Ue),this.toastService=w(se),this.subscriptionManagementService=w(Ve),this.router=w(Q),this.product=C(void 0),this.basket=S(()=>{let i=this.product();return i?this.groupBookingService.getBasket(i.id)():null}),this.processingAdd=M(!1),this.processingDelegate=M({}),this.processingBilling=M(!1),this.processingShipping=M(!1),this.processingPayment=M(!1),this.state=M(D.DelegateInformation),this.isDelegateInformation=S(()=>this.state()===D.DelegateInformation),this.isBillingAddress=S(()=>this.state()===D.BillingAddress),this.isShippingAddress=S(()=>this.state()===D.ShippingAddress),this.isPaymentDetails=S(()=>this.state()===D.PaymentDetails),this.isShippingBackwardStep=S(()=>this.state()===D.PaymentDetails),this.isBillingBackwardStep=S(()=>this.state()===D.PaymentDetails||this.state()===D.ShippingAddress),this.isDelegateInfoBackwardStep=S(()=>this.state()!==D.DelegateInformation),this.canGoToDelegateInformation=S(()=>
2!this.isDelegateInformation()&&!this.basket()?.isPaying),this.canGoToBillingAddress=S(()=>{let i=this.basket();return i?.anyDelegates&&i?.isValid&&!this.isBillingAddress()&&!i?.isPaying}),this.canGoToShippingAddress=S(()=>{let i=this.basket();return!this.isShippingAddress()&&i?.isValid&&!!i?.billingAddress&&!i?.isPaying}),this.canGoToPaymentDetails=S(()=>!this.isPaymentDetails()&&!!this.basket()?.isInPaymentStage),this.addNew=W(J);let e=!1;N(()=>{let i=this.basket();i&&!e&&(e=!0,this.state.set(this.getInitialState(i)))})}getInitialState(e){switch(e.state){case G.RequiresShippingAddress:return D.ShippingAddress;case G.ReadyToPay:case G.TermsAndConditionsRequired:case G.ChoosePaymentMethod:case G.CanComplete:case G.Paying:return D.PaymentDetails;default:return D.DelegateInformation}}goToDelegateInformation(){this.canGoToDelegateInformation()&&this.state.set(D.DelegateInformation)}goToBillingAddress(){this.canGoToBillingAddress()&&this.state.set(D.BillingAddress)}goToShippingAddress(){this.canGoToShippingAddress()&&this.state.set(D.ShippingAddress)}goToPaymentDetails(){this.canGoToPaymentDetails()&&this.state.set(D.PaymentDetails)}addDelegate(e){this.processingAdd.set(!0);let[i,o]=e;this.groupBookingService.addDelegate(this.product().id,i,o).pipe(R(()=>{this.processingAdd.set(!1)})).subscribe(l=>{l.success?(this.addNew()?.resetInfo(),this.toastService.showSuccessMessage("Delegate added")):this.toastService.showErrorMessage(l.message)})}onRemoveDelegate(e){this.processingDelegate.update(i=>V(I({},i),{[e.id]:!0})),this.groupBookingService.removeDelegate(this.product().id,e.id).pipe(R(()=>{this.processingDelegate.update(i=>V(I({},i),{[e.id]:!1}))})).subscribe(i=>{i.success?this.toastService.showSuccessMessage(`${e.name} removed`):this.toastService.showErrorMessage(i.message)})}onRemoveDelegateAddOn(e){this.processingDelegate.update(i=>V(I({},i),{[e.delegate.id]:!0})),this.groupBookingService.removeDelegateAddOn(this.product().id,e.delegate.id,e.addOn).pipe(R(()=>{this.processingDelegate.update(i=>V(I({},i),{[e.delegate.id]:!1}))})).subscribe(i=>{i.success?this.toastService.showSuccessMessage(`${e.addOn} removed for ${e.delegate.name}`):this.toastService.showErrorMessage(i.message)})}onAddDelegateAddOn(e){this.processingDelegate.update(i=>V(I({},i),{[e.delegate.id]:!0})),this.groupBookingService.addDelegateAddOn(this.product().id,e.delegate.id,e.addOn).pipe(R(()=>{this.processingDelegate.update(i=>V(I({},i),{[e.delegate.id]:!1}))})).subscribe(i=>{i.success?this.toastService.showSuccessMessage(`${e.addOn} added for ${e.delegate.name}`):this.toastService.showErrorMessage(i.message)})}onBillingAddressSet(e){this.processingBilling.set(!0),this.groupBookingService.setBillingAddress(this.product().id,e).subscribe(()=>{this.basket()?.requiresShipping&&this.canGoToShippingAddress()?this.goToShippingAddress():this.canGoToPaymentDetails()&&this.goToPaymentDetails(),this.processingBilling.set(!1)})}onShippingAddressSet(e){this.processingShipping.set(!0),this.groupBookingService.setShippingAddress(this.product().id,e===!0,e===!0?null:e).subscribe(()=>{this.canGoToPaymentDetails()&&this.goToPaymentDetails(),this.processingShipping.set(!1)})}onContactPreferencesSet(e){this.processingPayment.set(!0),this.groupBookingService.acceptTermsAndConditions(this.product().id,e).pipe(k(1)).subscribe(()=>{this.processingPayment.set(!1)})}toOrderComplete(e){this.subscriptionManagementService.getSubscriptionStatusFromServer().subscribe(),this.groupBookingService.removeBasket(this.product().id),this.router.navigate(["/order-complete"],{queryParams:{id:e}})}onPaymentSuccess(e){this.toOrderComplete(e)}onPaymentFailure(e){this.toastService.showErrorMessage(e),this.groupBookingService.cancellationReceived(this.product().id).pipe(k(1)).subscribe(()=>{this.processingPayment.set(!1)})}onChooseAnotherMethod(){this.processingPayment.set(!0),this.groupBookingService.chooseAnotherMethod(this.product().id).pipe(k(1)).subscribe(()=>{this.processingPayment.set(!1)})}onSelectPaymentMethod(e){this.processingPayment.set(!0),this.groupBookingService.selectPaymentMethod(this.product().id,e).pipe(k(1)).subscribe(()=>{this.processingPayment.set(!1)})}onRegisterSetupIntent(){this.processingPayment.set(!0),this.groupBookingService.registerPayment(this.product().id).pipe(k(1)).subscribe(()=>{this.processingPayment.set(!1)})}onResetTransaction(){this.processingPayment.set(!0),this.groupBookingService.resetTransaction(this.product().id).pipe(k(1)).subscribe(()=>{this.processingPayment.set(!1)})}onCompleteOrder(){this.processingPayment.set(!0),this.groupBookingService.completeOrder(this.product().id).pipe(k(1)).subscribe(e=>{e.success?this.toOrderComplete(e.message):this.toastService.showErrorMessage(e.message)})}onCompleteInvoiceOrder(e){this.processingPayment.set(!0),this.groupBookingService.completeInvoiceOrder(this.product().id,e).pipe(k(1)).subscribe(i=>{i.success?this.toOrderComplete(i.message):this.toastService.showErrorMessage(i.message)})}onCompleteOfflineOrder(e){this.processingPayment.set(!0),this.groupBookingService.completeOfflineOrder(this.product().id,e).pipe(k(1)).subscribe(i=>{i.success?this.toOrderComplete(i.message):(this.toastService.showErrorMessage(i.message),this.processingPayment.set(!1))})}removeDiscount(e){this.groupBookingService.removeDiscountCode(this.product().id,e.code).subscribe()}onSendInvoice(e){this.processingPayment.set(!0),this.groupBookingService.sendInvoiceToCustomer(this.product().id,e?.customFields).pipe(k(1)).subscribe(i=>{i?(this.toastService.showSuccessMessage("Invoice sent to customer successfully"),this.router.navigate(["/invoice-success"],{queryParams:{id:i.id}})):this.toastService.showErrorMessage("An error occurred while sending the invoice. If error persists, please contact IT"),this.processingPayment.set(!1)})}onCreateOfflinePaymentInvoice(e){this.processingPayment.set(!0),this.groupBookingService.createAndMarkStripeInvoiceAsPaidOffline(this.product().id,e.note,e.customFields).pipe(k(1)).subscribe(i=>{i?(this.toastService.showSuccessMessage("Invoice created and marked as paid successfully"),this.router.navigate(["/invoice-success"],{queryParams:{id:i.id,wasSentViaEmail:!0}})):this.toastService.showErrorMessage("An error occurred while creating the invoice. If error persists, please contact IT"),this.processingPayment.set(!1)})}onCreateStripeInvoiceForUserBasket(e){this.processingPayment.set(!0),this.groupBookingService.createStripeInvoiceForUserBasket(this.product().id,e?.customFields).pipe(k(1)).subscribe(i=>{i?(this.toastService.showSuccessMessage("Invoice created successfully"),this.router.navigate(["/invoice-success"],{queryParams:{id:i.id}})):this.toastService.showErrorMessage("An error occurred while sending the invoice. If error persists, please contact IT"),this.processingPayment.set(!1)})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=A({type:t,selectors:[["nbm-group-booking-display"]],viewQuery:function(i,o){i&1&&$(o.addNew,J,5),i&2&&U()},inputs:{product:[1,"product"]}
2,decls:2,vars:1,consts:[["addNew",""],[1,"row","px-lg-5"],[1,"col-md-8"],[1,"accordion","mb-3"],[1,"card"],[1,"card-header"],[1,"d-flex","justify-content-between","align-items-center"],[1,"m-0"],[1,"btn","btn-secondary","btn-sm"],[1,"card-body"],[1,"card-body","p-0"],[1,"col-md-4"],[3,"basket"],[3,"deleteDiscount","basket"],[1,"list-group","m-3"],[1,"btn","btn-secondary","btn-sm",3,"click"],[3,"addDelegate","product","processing","addOnPricing"],[3,"removeDelegate","removeDelegateAddOn","addDelegateAddOn","proceed","delegates","canProceed","processing","addOnPricing"],[3,"billingAddressSet","address","processing"],[3,"shippingAddressSet","billingExists","shippingSameAsBilling","address","processing"],[3,"contactPreferencesSet","selectPaymentMethod","registerSetupIntent","resetTransaction","completeOrder","completeInvoiceOrder","completeOfflineOrder","chooseAnotherMethod","paymentSuccess","paymentFailure","sendInvoice","createStripeInvoiceForUserBasket","createOfflinePaymentInvoice","basket","redirectUrl","processing"],[1,"list-group-item"],[3,"basket","groupBookingProductId"]],template:function(i,o){i&1&&g(0,Vt,29,10,"div",1)(1,Mt,1,0,"nbm-loading"),i&2&&u(o.basket()?0:1)},dependencies:[Ie,J,ze,Je,Le,Re,qe,$e,je],encapsulation:2})}}return t})();function Gt(t,c){t&1&&f(0,"nbm-group-booking-display",1),t&2&&_("product",c)}var Wi=(()=>{class t{constructor(){this.route=w(re),this.router=w(Q),this.routeData=oe(this.route.data),this.product=S(()=>{let e=this.routeData();if(e)return e.course??e.webinar??e.book??void 0}),this.title=S(()=>`${this.product()?.name} - Group Booking`),N(()=>{let e=this.product();e===void 0&&this.routeData()?this.router.navigateByUrl("/"):e?.disableGroupBooking&&this.router.navigate([".."],{relativeTo:this.route})})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=A({type:t,selectors:[["nbm-group-booking"]],decls:3,vars:7,consts:[["titleTextClass","text-white",3,"titleBgClass","placeHolderTitle","title","fullWidth"],[3,"product"]],template:function(i,o){if(i&1&&(r(0,"nbm-site-page",0),v(1,"contentTypeSlug"),g(2,Gt,1,1,"nbm-group-booking-display",1),n()),i&2){let l,q;_("titleBgClass","bg-gradient bg-"+j(1,5,o.product()))("placeHolderTitle",(l=o.product())==null?null:l.name)("title",o.title())("fullWidth",!0),a(2),u((q=o.product())?2:-1,q)}},dependencies:[Me,Ke,Ge],encapsulation:2})}}return t})();export{Wi as GroupBookingComponent};
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.