1(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{"BMw/":function(e,t,r){"use strict";r.d(t,"a",(function(){return h}));var c=r("lJxs"),o=r("AytR"),n=r("fNSB"),i=r("G/YH"),s=r("fXoL"),a=r("kt0X"),d=r("sYmb"),f=r("ofXK"),l=r("wGjQ"),m=r("sDwb");function u(e,t){if(1&e&&(s.fc(0,"div"),s.Sc(1),s.rc(2,"translate"),s.ec()),2&e){const e=s.qc();s.Nb(1),s.Uc(" ",e.displayShipmentStateIfItsShippedState(e.order.shipment_state)?s.sc(2,1,"shipmentStates."+e.order.shipment_state):"-"," ")}}function p(e,t){1&e&&(s.fc(0,"div"),s.Sc(1),s.rc(2,"translate"),s.ec()),2&e&&(s.Nb(1),s.Uc(" ",s.sc(2,1,"none")," "))}const g=function(e){return{"text-warning":e}},b=["*"];let h=(()=>{class e{constructor(e,t){this.store=e,this.translateService=t,this.corporateView=!1,this.Order=i.b,this.currency=o.a.CURRENCY}ngOnInit(){this.setupCurrency()}ngOnDestroy(){this.currencySub.unsubscribe()}setupCurrency(){this.currencySub=this.store.select(n.g).pipe(Object(c.a)(e=>{this.currency=e})).subscribe()}getTotalItemQuantity(e){return e.line_items.reduce((e,t)=>e+t.quantity,0)}displayShipmentStateIfItsShippedState(e){return"shipped"===e}}return e.\u0275fac=function(t){return new(t||e)(s.Zb(a.h),s.Zb(d.e))},e.\u0275cmp=s.Tb({type:e,selectors:[["app-order-list-item"]],inputs:{order:"order",corporateView:"corporateView"},ngContentSelectors:b,decls:68,vars:50,consts:[[1,"row","mt-3"],[1,"col-3","card-order-height"],[1,"bg-card","h-100"],[1,"d-flex","flex-column","justify-content-between","align-items-center","py-3","h-100"],[1,"row","w-100","px-3"],[1,"col-12","p-0","h-sm","text-center"],[1,"row","text-primary","mt-3","w-100","h-100"],[1,"col","border-right"],[1,"d-flex","flex-column","justify-content-end","align-items-center","h-100"],[1,"text-center","d-flex","justify-content-center","align-items-center","font-weight-bold","font-size-md","h-100","text-nowrap"],[1,"h-xs"],[1,"col"],[1,"text-center","d-flex","justify-content-center","align-items-center","font-weight-bold","font-size-md","h-100"],[1,"w-100","font-size-sm","font-weight-bold","mt-3","px-3","d-flex","justify-content-center"],[1,"pl-0","pr-0","text-muted","opacity-50","d-flex","justify-content-end"],[1,"pr-0","pl-0","text-primary"],[1,"col-9"],[1,"row","h-100","w-100","p-0","m-0"],[1,"col-1","d-flex","justify-content-center","align-items-center","border-right"],[1,"text-vertical","text-center","letter-spacing-m"],[1,"col-11","d-flex","flex-column","justify-content-between","p-3"],[1,"d-flex","justify-content-between","w-100"],[1,"font-size-sm","font-weight-bold"],[1,"text-muted","opacity-50"],[1,"mt-3",3,"ngClass"],[4,"ngIf"]],template:function(e,t){1&e&&(s.vc(),s.fc(0,"div",0),s.fc(1,"div",1),s.fc(2,"div",2),s.fc(3,"div",3),s.fc(4,"div",4),s.fc(5,"div",5),s.Sc(6),s.rc(7,"translate"),s.ec(),s.ec(),s.fc(8,"div",6),s.fc(9,"div",7),s.fc(10,"div",8),s.fc(11,"div",9),s.Sc(12),s.rc(13,"currencyFormat"),s.rc(14,"float"),s.ec(),s.fc(15,"div",10),s.Sc(16),s.rc(17,"translate"),s.ec(),s.ec(),s.ec(),s.fc(18,"div",11),s.fc(19,"div",8),s.fc(20,"div",12),s.Sc(21),s.ec(),s.fc(22,"div",10),s.Sc(23,"Items"),s.ec(),s.ec(),s.ec(),s.ec(),s.fc(24,"div",13),s.fc(25,"span",14),s.Sc(26),s.rc(27,"translate"),s.ec(),s.fc(28,"span",15),s.Sc(29),s.ec(),s.ec(),s.ec(),s.ec(),s.ec(),s.fc(30,"div",16),s.fc(31,"div",2),s.fc(32,"div",17),s.fc(33,"div",18),s.fc(34,"div",19),s.Sc(35),s.rc(36,"translate"),s.ec(),s.ec(),s.fc(37,"div",20),s.fc(38,"div",21),s.fc(39,"div",22),s.fc(40,"div",23),s.Sc(41),s.rc(42,"translate"),s.ec(),s.fc(43,"div",24),s.Sc(44),s.rc(45,"date"),s.ec(),s.ec(),s.fc(46,"div",22),s.fc(47,"div",23),s.Sc(48),s.rc(49,"translate"),s.ec(),s.fc(50,"div",24),s.Sc(51),s.rc(52,"translate"),s.ec(),s.ec(),s.fc(53,"div",22),s.fc(54,"div",23),s.Sc(55),s.rc(56,"translate"),s.ec(),s.fc(57,"div",24),s.Sc(58),s.rc(59,"translate"),s.ec(),s.ec(),s.fc(60,"div",22),s.fc(61,"div",23),s.Sc(62),s.rc(63,"translate"),s.ec(),s.fc(64,"div",24),s.Qc(65,u,3,3,"div",25),s.Qc(66,p,3,3,"div",25),s.ec(),s.ec(),s.ec(),s.uc(67),s.ec(),s.ec(),s.ec(),s.ec(),s.ec()),2&e&&(s.Nb(6),s.Uc(" ",s.sc(7,20,"orderSummary")," "),s.Nb(6),s.Uc(" ",s.tc(13,22,s.sc(14,25,t.order.total),t.currency)," "),s.Nb(4),s.Tc(s.sc(17,27,"total")),s.Nb(5),s.Uc(" ",t.getTotalItemQuantity(t.order)," "),s.Nb(5),s.Uc(" ",s.sc(27,29,"orderID"),"\xa0 "),s.Nb(3),s.Uc(" ",t.order.number," "),s.Nb(6),s.Uc(" ",s.sc(36,31,"status")," "),s.Nb(6),s.Uc(" ",s.sc(42,33,"orderedOn")," "),s.Nb(2),s.wc("ngClass",s.Bc(48,g,!t.order.completed_at)),s.Nb(1),s.Uc(" ",t.order.completed_at?s.tc(45,35,t.order.completed_at,"medium"):"n/a"," "),s.Nb(4),s.Tc(s.sc(49,38,"order")),s.Nb(2),s.wc("ngClass",t.Order.orderStateClass(t.order)),s.Nb(1),s.Uc(" ",s.sc(52,40,"orderStates."+t.order.state)," "),s.Nb(4),s.Uc(" ",s.sc(56,42,"payment")," "),s.Nb(2),s.wc("ngClass",t.Order.paymentStateClass(t.order)),s.Nb(1),s.Uc(" ",s.sc(59,44,"paymentStates."+t.order.payment_state)," "),s.Nb(4),s.Uc(" ",s.sc(63,46,"shipment")," "),s.Nb(2),s.wc("ngClass",t.Order.shipmentStateClass(t.order)),s.Nb(1),s.wc("ngIf",t.order.shipment_state),s.Nb(1),s.wc("ngIf",!t.order.shipment_state))},directives:[f.q,f.t],pipes:[d.d,l.a,m.a,f.f],styles:[".card-order-height[_ngcontent-%COMP%]{max-height:17rem}"],changeDetection:0}),e})()},CcJ1:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var c=r("fXoL"),o=r("ofXK"),n=r("sYmb");function i(e,t){if(1&e&&(c.fc(0,"tr"),c.fc(1,"td",4),c.Sc(2),c.rc(3,"translate"),c.ec(),c.fc(4,"td",5),c.Sc(5),c.ec(),c.ec()),2&e){const e=t.$implicit;c.Nb(2),c.Uc(" ",c.sc(3,2,e.key)," "),c.Nb(3),c.Uc(" ",e.value," ")}}function s(e,t){if(1&e&&(c.fc(0,"table",1),c.fc(1,"div",2),c.Sc(2),c.ec(),c.Qc(3,i,6,4,"tr",3),c.rc(4,"keyvalue"),c.ec()),2&e){const e=c.qc();c.Nb(2),c.Tc(e.title),c.Nb(1),c.wc("ngForOf",c.sc(4,2,e.keyValueDetails))}}let a=(()=>{class e{constructor(){}ngOnInit(){}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=c.Tb({type:e,selectors:[["app-order-detail-line-items-table-view"]],inputs:{keyValueDetails:"keyValueDetails",title:"title"},decls:1,vars:1,consts:[["class","mt-3 table table-sm first-border-top-0 font-size-sm font-weight-bold",4,"ngIf"],[1,"mt-3","table","table-sm","first-border-top-0","font-size-sm","font-weight-bold"],[1,"font-weight-bold","text-primary"],[4,"ngFor","ngForOf"],[1,"text-muted","opacity-50"],[1,""]],template:function(e,t){1&e&&c.Qc(0,s,5,4,"table",0),2&e&&c.wc("ngIf",t.keyValueDetails)},directives:[o.t,o.s],pipes:[o.l,n.d],encapsulation:2}),e})()},N2dZ:function(e,t,r){"use strict";r.d(t,"a",(function(){return A}));var c=r("fXoL"),o=r("0lSd"),n=r("HW4V"),i=r("mKSP"),s=r("KUeB"),a=r("nSdy"),d=r("kt
10X"),f=r("sYmb"),l=r("ofXK"),m=r("EA6y"),u=r("HPQp");function p(e,t){1&e&&c.ac(0,"div")}function g(e,t){if(1&e){const e=c.gc();c.fc(0,"div",12),c.fc(1,"app-credit-card-form",13),c.nc("enterCreditCard",(function(t){return c.Ic(e),c.qc().createOrUpdateCreditCard(t)})),c.ec(),c.ec()}if(2&e){const e=c.qc();c.Nb(1),c.wc("creditCard",e.creditCard)("errors",e.creditCardErrors)}}function b(e,t){1&e&&c.ac(0,"div")}function h(e,t){if(1&e&&(c.fc(0,"div",16),c.ac(1,"app-credit-card-item",17),c.ec()),2&e){const e=c.qc(2);c.Nb(1),c.wc("creditCard",e.creditCard)("showVerification",!0)}}function v(e,t){1&e&&(c.fc(0,"div",18),c.Sc(1),c.rc(2,"translate"),c.ec()),2&e&&(c.Nb(1),c.Uc(" ",c.sc(2,1,"noCreditCardEntered")," "))}function w(e,t){if(1&e&&(c.Qc(0,b,1,0,"div",2),c.Qc(1,h,2,2,"ng-template",null,14,c.Rc),c.Qc(3,v,3,3,"ng-template",null,15,c.Rc)),2&e){const e=c.Gc(2),t=c.Gc(4),r=c.qc();c.wc("ngIf",r.creditCard)("ngIfThen",e)("ngIfElse",t)}}function C(e,t){if(1&e){const e=c.gc();c.fc(0,"div",19),c.fc(1,"div",20),c.fc(2,"button",21),c.nc("click",(function(){return c.Ic(e),c.qc().setEditingCreditCard(!0)})),c.Sc(3),c.ec(),c.ec(),c.ec()}if(2&e){const e=c.qc();c.Nb(3),c.Uc(" ",e.translateService.instant(e.creditCard?"updateCreditCard":"createCreditCard")," ")}}function y(e,t){1&e&&c.ac(0,"div")}function N(e,t){if(1&e){const e=c.gc();c.fc(0,"div",12),c.fc(1,"app-address-form",22),c.nc("createOrUpdateAddress",(function(t){return c.Ic(e),c.qc().createOrUpdateBillingAddress(t)})),c.ec(),c.ec()}if(2&e){const e=c.qc();c.Nb(1),c.wc("address",e.billAddress)("type",e.billType)("errors",e.billAddressErrors)("countries",e.countries)("cityTaxRates",e.cityTaxRates)("verbose",!0)}}function S(e,t){1&e&&c.ac(0,"div")}function _(e,t){if(1&e&&(c.fc(0,"div",16),c.ac(1,"app-address-item",25),c.ec()),2&e){const e=c.qc(2);c.Nb(1),c.wc("address",e.Address.createFromUnsaved(e.billAddress,e.countries))}}function U(e,t){1&e&&(c.fc(0,"div",18),c.Sc(1),c.rc(2,"translate"),c.ec()),2&e&&(c.Nb(1),c.Uc(" ",c.sc(2,1,"noBillingAddressEntered")," "))}function k(e,t){if(1&e&&(c.Qc(0,S,1,0,"div",2),c.Qc(1,_,2,1,"ng-template",null,23,c.Rc),c.Qc(3,U,3,3,"ng-template",null,24,c.Rc)),2&e){const e=c.Gc(2),t=c.Gc(4),r=c.qc();c.wc("ngIf",r.billAddress)("ngIfThen",e)("ngIfElse",t)}}function I(e,t){if(1&e){const e=c.gc();c.fc(0,"div",19),c.fc(1,"div",20),c.fc(2,"button",21),c.nc("click",(function(){return c.Ic(e),c.qc().setEditingBillingAddress(!0)})),c.Sc(3),c.ec(),c.ec(),c.ec()}if(2&e){const e=c.qc();c.Nb(3),c.Uc(" ",e.translateService.instant(e.billAddress?"updateBillingAddress":"createBillingAddress")," ")}}function q(e,t){if(1&e&&(c.fc(0,"div",26),c.fc(1,"p",27),c.Sc(2),c.ec(),c.ec()),2&e){const e=c.qc();c.Nb(2),c.Tc(e.errors)}}let A=(()=>{class e{constructor(e,t,r){this.store=e,this.userService=t,this.translateService=r,this.onCreateCorporateCreditCard=new c.r,this.creditCard=null,this.billType="billing",this.billAddress=null,this.editingCreditCard=!1,this.editingBillingAddress=!1,this.Address=o.a}ngOnInit(){this.corporateAccountSub=this.store.select(a.a).subscribe(e=>{this.corporateAccount=e})}ngOnDestroy(){this.corporateAccountSub.unsubscribe()}setEditingBillingAddress(e){this.editingBillingAddress=e}createOrUpdateBillingAddress(e){this.billAddress=e,this.setEditingBillingAddress(!1)}setEditingCreditCard(e){this.editingCreditCard=e}createOrUpdateCreditCard(e){this.creditCard=e,this.setEditingCreditCard(!1)}createCorporateCreditCard(){this.onCreateCorporateCreditCard.emit({corporate_account_id:this.corporateAccount.id,credit_card:this.creditCard,bill_address:this.billAddress})}}return e.\u0275fac=function(t){return new(t||e)(c.Zb(d.h),c.Zb(s.a),c.Zb(f.e))},e.\u0275cmp=c.Tb({type:e,selectors:[["app-corporate-credit-card-form"]],viewQuery:function(e,t){var r;1&e&&(c.Oc(i.a,!0),c.Oc(n.a,!0)),2&e&&(c.Fc(r=c.oc())&&(t.credit
1CardForm=r.first),c.Fc(r=c.oc())&&(t.addressForm=r.first))},inputs:{countries:"countries",cityTaxRates:"cityTaxRates",errors:"errors"},outputs:{onCreateCorporateCreditCard:"onCreateCorporateCreditCard"},decls:25,vars:19,consts:[[1,"py-3"],[1,"font-weight-bold","text-center","text-primary","w-100"],[4,"ngIf","ngIfThen","ngIfElse"],["showCreditCardForm",""],["showCreditCardDetails",""],["class","mt-3",4,"ngIf"],[1,"py-3","modal-border"],["showBillingAddressForm",""],["showBillingAddressDetails",""],[1,"d-flex","flex-column","align-items-center","modal-footer","pb-0"],["class","mb-3",4,"ngIf"],[1,"btn","btn-outline-primary","btn-action",3,"disabled","click"],[1,"pt-3"],[3,"creditCard","errors","enterCreditCard"],["CreditCardValues",""],["noCreditCard",""],[1,"pt-3","d-flex","justify-content-center"],[3,"creditCard","showVerification"],[1,"pt-3","text-center","text-muted"],[1,"mt-3"],[1,"d-flex","justify-content-center","mt-5"],[1,"btn","btn-outline-primary","btn-action",3,"click"],[3,"address","type","errors","countries","cityTaxRates","verbose","createOrUpdateAddress"],["billingAddressValues",""],["noBillingAddress",""],[3,"address"],[1,"mb-3"],[1,"invalid-feedback","d-block"]],template:function(e,t){if(1&e&&(c.fc(0,"div",0),c.fc(1,"h5",1),c.Sc(2),c.rc(3,"translate"),c.ec(),c.Qc(4,p,1,0,"div",2),c.Qc(5,g,2,2,"ng-template",null,3,c.Rc),c.Qc(7,w,5,3,"ng-template",null,4,c.Rc),c.Qc(9,C,4,1,"div",5),c.ec(),c.fc(10,"div",6),c.fc(11,"h5",1),c.Sc(12),c.rc(13,"translate"),c.ec(),c.Qc(14,y,1,0,"div",2),c.Qc(15,N,2,6,"ng-template",null,7,c.Rc),c.Qc(17,k,5,3,"ng-template",null,8,c.Rc),c.Qc(19,I,4,1,"div",5),c.ec(),c.fc(20,"div",9),c.Qc(21,q,3,1,"div",10),c.fc(22,"button",11),c.nc("click",(function(){return t.createCorporateCreditCard()})),c.Sc(23),c.rc(24,"translate"),c.ec(),c.ec()),2&e){const e=c.Gc(6),r=c.Gc(8),o=c.Gc(16),n=c.Gc(18);c.Nb(2),c.Uc(" ",c.sc(3,13,"creditCard")," "),c.Nb(2),c.wc("ngIf",t.editingCreditCard)("ngIfThen",e)("ngIfElse",r),c.Nb(5),c.wc("ngIf",!t.editingCreditCard),c.Nb(3),c.Uc(" ",c.sc(13,15,"billingAddress")," "),c.Nb(2),c.wc("ngIf",t.editingBillingAddress)("ngIfThen",o)("ngIfElse",n),c.Nb(5),c.wc("ngIf",!t.editingBillingAddress),c.Nb(2),c.wc("ngIf",t.errors),c.Nb(1),c.wc("disabled",!(t.creditCard&&t.billAddress)),c.Nb(1),c.Uc(" ",c.sc(24,17,"save")," ")}},directives:[l.t,i.a,m.a,n.a,u.a],pipes:[f.d],styles:[""]}),e})()},b3ru:function(e,t,r){"use strict";r.d(t,"a",(function(){return N}));var c=r("fXoL"),o=r("3Pt+"),n=(r("3nhm"),r("sYmb")),i=r("ofXK");const s=function(e){return{item:e}};function a(e,t){if(1&e&&(c.fc(0,"div"),c.fc(1,"p",16),c.Sc(2),c.rc(3,"translate"),c.ec(),c.ec()),2&e){const e=c.qc();c.Nb(2),c.Uc(" ",e.form.get("email").errors.msg||c.tc(3,1,"validation.valid",c.Bc(4,s,e.translateService.instant("email")))," ")}}const d=function(e){return{item:e,count:6}};function f(e,t){if(1&e&&(c.fc(0,"div"),c.fc(1,"p",16),c.Sc(2),c.rc(3,"translate"),c.ec(),c.ec()),2&e){const e=c.qc();c.Nb(2),c.Uc(" ",e.form.get("password").errors.msg||c.tc(3,1,"validation.minimumLength",c.Bc(4,d,e.translateService.instant("password")))," ")}}function l(e,t){if(1&e&&(c.fc(0,"div"),c.fc(1,"p",16),c.Sc(2),c.rc(3,"translate"),c.ec(),c.ec()),2&e){const e=c.qc();c.Nb(2),c.Uc(" ",c.tc(3,1,"validation.minimumLength",c.Bc(4,d,e.translateService.instant("password")))," ")}}function m(e,t){if(1&e&&(c.fc(0,"div"),c.fc(1,"p",16),c.Sc(2),c.rc(3,"translate"),c.ec(),c.ec()),2&e){const e=c.qc();c.Nb(2),c.Uc(" ",e.form.get("password_confirmation").errors.msg||c.tc(3,1,"validation.minimumLength",c.Bc(4,d,e.translateService.instant("password")))," ")}}function u(e,t){if(1&e&&(c.fc(0,"div"),c.fc(1,"p",16),c.Sc(2),c.rc(3,"translate"),c.ec(),c.ec()),2&e){const e=c.qc();c.Nb(2),c.Uc(" ",c.tc(3,1,"validation.minimumLength",c.Bc(4,d,e.translateService.instant("password")))," ")}}function p(e,t){if(1&e&&(c.fc(0,"div"),c.fc(1,"p",16),c.Sc(2),c.rc(3,"translate"),c.ec(),c.ec()),2&e){const e=c.qc();c.Nb(2),c.Uc(" ",c.tc(3,1,"validation.match",c.Bc(4,s,e.translateService.instant("passwordConfirmation")))," ")}}function g(e,t){if(1&e&&(c.fc(0,"div"),c.fc(1,"p",16),c.Sc(2),c.rc(3,"translate"),c.ec(),c.ec()),2&e){const e=c.qc();c.Nb(2),c.Uc(" ",c.tc(3,1,"validation.match",c.Bc(4,s,e.translateService.instant("passwordConfirmation")))," ")}}function b(e,t){if(1&e&&(c.fc(0,"div"),c.fc(1,"p",16),c.Sc(2),c.rc(3,"translate"),c.ec(),c.ec()),2&e){const e=c.qc();c.Nb(2),c.Uc(" ",e.form.get("doctor").errors.msg||c.tc(3,1,"validation.required",c.Bc(4,s,e.translateService.instant("name")))," ")}}function h(e,t){if(1&e&&(c.fc(0,"div"),c.fc(1,"p",16),c.Sc(2),c.rc(3,"translate"),c.ec(),c.ec()),2&e){const e=c.qc(2);c.Nb(2),c.Uc(" ",e.form.get("company_name").errors.msg||c.tc(3,1,"validation.required",c.Bc(4,s,e.translateService.instant("company name")))," ")}}const v=function(e){return{"has-error":e}};function w(e,t){if(1&e&&(c.fc(0,"div",1),c.fc(1,"label",17),c.Sc(2),c.rc(3,"translate"),c.ec(),c.fc(4,"div",3),c.ac(5,"input",18),c.Qc(6,h,4,6,"div",5),c.ec(),c.ec()),2&e){const e=c.qc();c.wc("ngClass",c.Bc(5,v,e.form.get("company_name")&&e.form.get("company_name").errors&&e.form.get("company_name").touched)),c.Nb(2),c.Uc(" ",c.sc(3,3,"companyName"),": "),c.Nb(4),c.wc("ngIf",e.form.get("company_name").errors&&e.form.get("company_name").touched)}}const C=[[["","cancel",""]]],y=["[cancel]"];let N=(()=>{class e{constructor(e,t,r){this.fb=e,this.cd=t,this.translateService=r,this.createOrUpdateUser=new c.r,this.isNew=!0,this.email="",this.form=this.fb.group({email:[""],password:[""],password_confirmation:[""],doctor:[""],company_name:[""]})}ngOnInit(){}ngOnChanges(e){e.user&&e.user.isFirstChange&&this.resetForm(),e.errors&&e.errors.currentValue&&Object.keys(this.form.value).forEach(e
1=>{this.errors[e]&&(this.form.controls[e].setErrors({msg:this.errors[e][0]}),this.form.controls[e].markAsTouched())})}ngOnDestroy(){}resetForm(){this.form.clearValidators(),this.form.get("email").clearValidators(),this.form.get("password").clearValidators(),this.form.get("password_confirmation").clearValidators(),this.form.get("doctor").clearValidators(),this.form.get("company_name").clearValidators(),null===this.user?(this.isNew=!0,this.email="",this.resetToBlank(),this.form.get("email").setValidators(o.E.compose([o.E.required,o.E.email])),this.form.get("password").setValidators(o.E.compose([o.E.required,o.E.minLength(6)])),this.form.get("password_confirmation").setValidators(o.E.compose([o.E.required,o.E.minLength(6)])),this.form.get("doctor").setValidators(o.E.required),this.form.setValidators(e=>{const t=e.get("password").value!==e.get("password_confirmation").value,r={};return t&&(r.createMismatchedPasswords=t),Object.keys(r).length>0?r:null})):(this.isNew=!1,this.email=this.user.email,this.toValidateOnlyIndividualUser(),this.resetToUser(),this.form.get("email").setValidators(o.E.compose([o.E.required,o.E.email])),this.form.get("doctor").setValidators(o.E.required),this.form.setValidators(e=>{const t=e.get("password").value,r=e.get("password_confirmation").value,c=t.length>0&&t.length<=6,o=r.length>0&&r.length<=6,n=t!==r,i={};return c&&(i.updatePasswordMinLength=c),o&&(i.updateConfirmPasswordMinLength=o),n&&(i.updateMismatchedPasswords=n),Object.keys(i).length>0?i:null}))}toValidateOnlyIndividualUser(){0===Object.entries(this.user).length||this.user.membership.corporate_account||this.form.get("company_name").setValidators(o.E.required)}onSubmit(){this.form.invalid||this.createOrUpdateUser.emit(this.form.value)}revert(){this.isNew?this.resetToBlank():this.resetToUser()}resetToBlank(){this.form.reset({email:"",password:"",password_confirmation:"",doctor:"",company_name:""})}resetToUser(){this.form.reset({email:this.user.email,password:"",password_confirmation:"",doctor:this.user.doctor,company_name:this.user.company_name})}}return e.\u0275fac=function(t){return new(t||e)(c.Zb(o.f),c.Zb(c.i),c.Zb(n.e))},e.\u0275cmp=c.Tb({type:e,selectors:[["app-user-form"]],inputs:{user:"user",errors:"errors"},outputs:{createOrUpdateUser:"createOrUpdateUser"},features:[c.Lb],ngContentSelectors:y,decls:41,vars:44,consts:[[1,"mt-3",3,"formGroup","ngSubmit"],[1,"form-group","row",3,"ngClass"],["for","email",1,"col-4","col-form-label","required"],[1,"col"],["id","email","type","text","formControlName","email","autocomplete","off",1,"form-control"],[4,"ngIf"],["for","password",1,"col-4","col-form-label",3,"ngClass"],["id","password","type","password","formControlName","password","autocomplete","off",1,"form-control",3,"ngClass"],["for","password_confirmation",1,"col-4","col-form-label",3,"ngClass"],["id","password_confirmation","type","password","formControlName","password_confirmation","autocomplete","off",1,"form-control",3,"ngClass"],["for","doctor",1,"col-4","col-form-label","required"],["id","doctor","type","text","formControlName","doctor","autocomplete","off",1,"form-control"],["class","form-group row",3,"ngClass",4,"ngIf"],[1,"d-flex","justify-content-center","mt-5"],["type","submit",1,"btn","btn-outline-primary","btn-action",3,"disabled"],["type","reset",1,"btn","btn-outline-warning","btn-action","ml-3",3,"disabled","click"],[1,"invalid-feedback","d-block"],["for","company_name",1,"col-4","col-form-label","required"],["id","company_name","type","text","formControlName","company_name","autocomplete","off",1,"form-control"]],template:function(e,t){1&e&&(c.vc(C),c.fc(0,"form",0),c.nc("ngSubmit",(function(){return t.onSubmit()})),c.fc(1,"div",1),c.fc(2,"label",2),c.Sc(3),c.rc(4,"translate"),c.ec(),c.fc(5,"div",3),c.ac(6,"input",4),c.Qc(7,a,4,6,"div",5),c.ec(),c.ec(),c.fc(8,"div",1),c.fc(9,"label",6),c.Sc(10),c.rc(11,"translate"),c.ec(),c.fc(12,"div",3),c.ac(13,"input",7),c.Qc(14,f,4,6,"div",5),c.Qc(15,l,4,6,"div",5),c.ec(),c.ec(),c.fc(16,"div",1),c.fc(17,"label",8),c.Sc(18),c.rc(19,"translate"),c.ec(),c.fc(20,"div",3),c.ac(21,"input",9),c.Qc(22,m,4,6,"div",5),c.Qc(23,u,4,6,"div",5),c.Qc(24,p,4,6,"div",5),c.Qc(25,g,4,6,"div",5),c.ec(),c.ec(),c.fc(26,"div",1),c.fc(27,"label",10),c.Sc(28),c.rc(29,"translate"),c.ec(),c.fc(30,"div",3),c.ac(31,"input",11),c.Qc(32,b,4,6,"div",5),c.ec(),c.ec(),c.Qc(33,
1w,7,7,"div",12),c.fc(34,"div",13),c.fc(35,"button",14),c.Sc(36),c.ec(),c.fc(37,"button",15),c.nc("click",(function(){return t.revert()})),c.Sc(38),c.rc(39,"translate"),c.ec(),c.uc(40),c.ec(),c.ec()),2&e&&(c.wc("formGroup",t.form),c.Nb(1),c.wc("ngClass",c.Bc(36,v,t.form.get("email")&&t.form.get("email").errors&&t.form.get("email").touched)),c.Nb(2),c.Uc(" ",c.sc(4,26,"email"),": "),c.Nb(4),c.wc("ngIf",t.form.get("email").errors&&t.form.get("email").touched),c.Nb(1),c.wc("ngClass",c.Bc(38,v,t.form.get("password")&&(t.form.get("password").errors||t.form.hasError("updatePasswordMinLength"))&&t.form.get("password").touched)),c.Nb(1),c.wc("ngClass",t.isNew?"required":""),c.Nb(1),c.Uc(" ",c.sc(11,28,"password"),": "),c.Nb(3),c.wc("ngClass",t.isNew?"required":""),c.Nb(1),c.wc("ngIf",t.form.get("password").errors&&t.form.get("password").touched),c.Nb(1),c.wc("ngIf",t.form.hasError("updatePasswordMinLength")&&t.form.get("password").touched),c.Nb(1),c.wc("ngClass",c.Bc(40,v,t.form.get("password_confirmation")&&(t.form.get("password_confirmation").errors||t.form.hasError("updateConfirmPasswordMinLength")||t.form.hasError("createMismatchedPasswords")||t.form.hasError("updateMismatchedPasswords"))&&t.form.get("password_confirmation").touched)),c.Nb(1),c.wc("ngClass",t.isNew?"required":""),c.Nb(1),c.Uc(" ",c.sc(19,30,"passwordConfirmation"),": "),c.Nb(3),c.wc("ngClass",t.isNew?"required":""),c.Nb(1),c.wc("ngIf",t.form.get("password_confirmation").errors&&t.form.get("password_confirmation").touched),c.Nb(1),c.wc("ngIf",t.form.hasError("updateConfirmPasswordMinLength")&&t.form.get("password_confirmation").touched),c.Nb(1),c.wc("ngIf",t.form.hasError("createMismatchedPasswords")&&t.form.get("password_confirmation").touched),c.Nb(1),c.wc("ngIf",t.form.hasError("updateMismatchedPasswords")&&t.form.get("password_confirmation").touched),c.Nb(1),c.wc("ngClass",c.Bc(42,v,t.form.get("doctor")&&t.form.get("doctor").errors&&t.form.get("doctor").touched)),c.Nb(2),c.Uc(" ",c.sc(29,32,"name"),": "),c.Nb(4),c.wc("ngIf",t.form.get("doctor").errors&&t.form.get("doctor").touched),c.Nb(1),c.wc("ngIf",!(null!=t.user&&null!=t.user.membership&&t.user.membership.corporate_account)),c.Nb(2),c.wc("disabled",t.form.invalid),c.Nb(1),c.Uc(" ",t.translateService.instant(t.isNew?"create":"update")," "),c.Nb(1),c.wc("disabled",t.form.pristine),c.Nb(1),c.Uc(" ",c.sc(39,34,"revert")," "))},directives:[o.G,o.r,o.k,i.q,o.c,o.q,o.i,i.t],pipes:[n.d],styles:[""],changeDetection:0}),e})()},oQbv:function(e,t,r){"use strict";r.d(t,"a",(function(){return N}));var c=r("fXoL"),o=r("AemD"),n=r("KUeB"),i=r("3Pt+"),s=r("tyNb"),a=r("sYmb"),d=r("ofXK");const f=function(e){return{item:e,count:6}};function l(e,t){if(1&e&&(c.fc(0,"div"),c.fc(1,"p",16),c.Sc(2),c.rc(3,"translate"),c.ec(),c.ec()),2&e){const e=c.qc();c.Nb(2),c.Uc(" ",e.form.get("corporate_token").errors.msg||c.tc(3,1,"validation.minimumLength",c.Bc(4,f,e.translateService.instant("companyPassword")))," ")}}function m(e,t){if(1&e&&(c.fc(0,"div"),c.fc(1,"p",16),c.Sc(2),c.rc(3,"translate"),c.ec(),c.ec()),2&e){const e=c.qc();c.Nb(2),c.Uc(" ",c.tc(3,1,"validation.minimumLength",c.Bc(4,f,e.translateService.instant("companyPassword")))," ")}}function u(e,t){if(1&e&&(c.fc(0,"div"),c.fc(1,"p",16),c.Sc(2),c.rc(3,"translate"),c.ec(),c.ec()),2&e){const e=c.qc();c.Nb(2),c.Uc(" ",e.form.get("corporate_token_confirmation").errors.msg||c.tc(3,1,"validation.minimumLength",c.Bc(4,f,e.translateService.instant("companyPassword")))," ")}}function p(e,t){if(1&e&&(c.fc(0,"div"),c.fc(1,"p",16),c.Sc(2),c.rc(3,"translate"),c.ec(),c.ec()),2&e){const e=c.qc();c.Nb(2),c.Uc(" ",c.tc(3,1,"validation.minimumLength",c.Bc(4,f,e.translateService.instant("companyPassword")))," ")}}const g=function(e){return{item:e}};function b(e,t){if(1&e&&(c.fc(0,"div"),c.fc(1,"p",16),c.Sc(2),c.rc(3,"translate"),c.ec(),c.ec()),2&e){const e=c.qc();c.Nb(2),c.Uc(" ",c.tc(3,1,"validation.match",c.Bc(4,g,e.translateService.instant("companyPassword")))," ")}}function h(e,t){if(1&e&&(c.fc(0,"label",4),c.Sc(1),c.rc(2,"translate"),c.ec()),2&e){const e=c.qc(2);c.Nb(1),c.Uc(" ",c.sc(2,1,e.getBillingTypeById(e.corporateAccount.billing_type).name)," ")}}function v(e,t){if(1&e&&(c.fc(0,"div",1),c.fc(1,"label",17),c.Sc(2),c.rc(3,"translate"),c.ec(),c.fc(4,"div",3),c.Qc(5,h,3,3,"label",18),c.ec(),c.ec()),2&e){const e=c.qc();c.Nb(2),c.Uc("",c.sc(3,2,"billingType"),":"),c.Nb(3),c.wc("ngIf",e.corporateAccount&&e.corporateAccount.billing_type)}}const w=[[["","title",""]]],C=function(e){return{"has-error":e}},y=["[title]"];let N=(()=>{class e{constructor(e,t,r,n,i){this.fb=e,this.router=t,this.userService=r,this.cd=n,this.translateService=i,this.updateCorporateAccount=new c.r,this.billing_types=o.a,this.form=this.fb.group({corporate_token:[""],corporate_token_confirmation:[""]},{validator:e=>{const t=e.get("corporate_token").value,r=e.get("corporate_token_confirmation").value,c=t.length>0&&t.length<=6,o=r.length>0&&r.length<=6,n=t!==r,i={};return c&&(i.updateCorporateTokenMinLength=c),o&&(i.updateConfirmCorporateTokenMinLength=o),n&&(i.updateMismatchedTokens=n),Object.keys(i).length>0?i:null}})}ngOnInit(){}ngOnChanges(e){e.corporateAccount&&e.corporateAccount.isFirstChange&&this.resetToCorporateAccount(),e.errors&&e.errors.currentValue&&(console.log("Applying errors to CorporateAccountForm..."+JSON.stringify(this.errors)),Object.keys(this.form.value).forEach(e
1=>{this.errors[e]&&(this.form.controls[e].setErrors({msg:this.errors[e][0]}),this.form.controls[e].markAsTouched())}))}ngOnDestroy(){}onSubmit(){this.form.invalid||this.updateCorporateAccount.emit(this.form.value)}revert(){this.resetToCorporateAccount()}getBillingTypeById(e){return this.billing_types.find(t=>t.id===e)}resetToCorporateAccount(){this.form.reset({corporate_token:"",corporate_token_confirmation:""})}}return e.\u0275fac=function(t){return new(t||e)(c.Zb(i.f),c.Zb(s.e),c.Zb(n.a),c.Zb(c.i),c.Zb(a.e))},e.\u0275cmp=c.Tb({type:e,selectors:[["app-corporate-account-form"]],inputs:{corporateAccount:"corporateAccount",errors:"errors"},outputs:{updateCorporateAccount:"updateCorporateAccount"},features:[c.Lb],ngContentSelectors:y,decls:41,vars:35,consts:[[1,"mt-3",3,"formGroup","ngSubmit"],[1,"form-group","row"],["for","company_id",1,"col-4","col-form-label","required"],[1,"col"],[1,"col-8","pt-2"],["for","company_name",1,"col-4","col-form-label","required"],[1,"form-group","row",3,"ngClass"],["for","corporate_token",1,"col-4","col-form-label"],["id","corporate_token","type","password","formControlName","corporate_token","autocomplete","off",1,"form-control"],[4,"ngIf"],["for","corporate_token_confirmation",1,"col-4","col-form-label"],["id","corporate_token_confirmation","type","password","formControlName","corporate_token_confirmation","autocomplete","off",1,"form-control"],["class","form-group row",4,"ngIf"],[1,"d-flex","justify-content-center","mt-5"],["type","submit",1,"btn","btn-outline-primary","btn-action",3,"disabled"],["type","reset",1,"btn","btn-outline-warning","btn-action","ml-3",3,"disabled","click"],[1,"invalid-feedback","d-block"],["for","billing_type",1,"col-4","col-form-label","required"],["class","col-8 pt-2",4,"ngIf"]],template:function(e,t){1&e&&(c.vc(w),c.uc(0),c.fc(1,"form",0),c.nc("ngSubmit",(function(){return t.onSubmit()})),c.fc(2,"div",1),c.fc(3,"label",2),c.Sc(4),c.rc(5,"translate"),c.ec(),c.fc(6,"div",3),c.fc(7,"label",4),c.Sc(8),c.ec(),c.ec(),c.ec(),c.fc(9,"div",1),c.fc(10,"label",5),c.Sc(11),c.rc(12,"translate"),c.ec(),c.fc(13,"div",3),c.fc(14,"label",4),c.Sc(15),c.ec(),c.ec(),c.ec(),c.fc(16,"div",6),c.fc(17,"label",7),c.Sc(18),c.rc(19,"translate"),c.ec(),c.fc(20,"div",3),c.ac(21,"input",8),c.Qc(22,l,4,6,"div",9),c.Qc(23,m,4,6,"div",9),c.ec(),c.ec(),c.fc(24,"div",6),c.fc(25,"label",10),c.Sc(26),c.rc(27,"translate"),c.ec(),c.fc(28,"div",3),c.ac(29,"input",11),c.Qc(30,u,4,6,"div",9),c.Qc(31,p,4,6,"div",9),c.Qc(32,b,4,6,"div",9),c.ec(),c.ec(),c.Qc(33,v,6,4,"div",12),c.fc(34,"div",13),c.fc(35,"button",14),c.Sc(36),c.rc(37,"translate"),c.ec(),c.fc(38,"button",15),c.nc("click",(function(){return t.revert()})),c.Sc(39),c.rc(40,"translate"),c.ec(),c.ec(),c.ec()),2&e&&(c.Nb(1),c.wc("formGroup",t.form),c.Nb(3),c.Uc("",c.sc(5,19,"companyID"),":"),c.Nb(4),c.Tc(t.corporateAccount.company_id),c.Nb(3),c.Uc("",c.sc(12,21,"companyName"),":"),c.Nb(4),c.Tc(t.corporateAccount.company_name),c.Nb(1),c.wc("ngClass",c.Bc(31,C,t.form.get("corporate_token")&&(t.form.get("corporate_token").errors||t.form.hasError("updateCorporateTokenMinLength"))&&t.form.get("corporate_token").touched)),c.Nb(2),c.Uc("",c.sc(19,23,"companyPassword"),":"),c.Nb(4),c.wc("ngIf",t.form.get("corporate_token").errors&&t.form.get("corporate_token").touched),c.Nb(1),c.wc("ngIf",t.form.hasError("updateCorporateTokenMinLength")&&t.form.get("corporate_token").touched),c.Nb(1),c.wc("ngClass",c.Bc(33,C,t.form.get("corporate_token_confirmation")&&(t.form.get("corporate_token_confirmation").errors||t.form.hasError("updateConfirmCorporateTokenMinLength")||t.form.hasError("updateMismatchedTokens"))&&t.form.get("corporate_token_confirmation").touched)),c.Nb(2),c.Uc("",c.sc(27,25,"companyPasswordConfirmation"),":"),c.Nb(4),c.wc("ngIf",t.form.get("corporate_token_confirmation").errors&&t.form.get("corporate_token_confirmation").touched),c.Nb(1),c.wc("ngIf",t.form.hasError("updateConfirmCorporateTokenMinLength")&&t.form.get("corporate_token_confirmation").touched),c.Nb(1),c.wc("ngIf",t.form.hasError("updateMismatchedTokens")&&t.form.get("corporate_token_confirmation").touched),c.Nb(1),c.wc("ngIf",!1),c.Nb(2),c.wc("disabled",t.form.invali
1d),c.Nb(1),c.Uc(" ",c.sc(37,27,"update")," "),c.Nb(2),c.wc("disabled",t.form.pristine),c.Nb(1),c.Uc(" ",c.sc(40,29,"revert")," "))},directives:[i.G,i.r,i.k,d.q,i.c,i.q,i.i,d.t],pipes:[a.d],styles:[""],changeDetection:0}),e})()}}]);
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.