1import{b as Ie,c as De,d as we,e as Ae,f as Te}from"./chunk-LWBWK2N5.js";import{a as be}from"./chunk-YIKU2A2G.js";import{a as xe}from"./chunk-4CVZBQNN.js";import{a as he}from"./chunk-JKMNVQUA.js";import{b as Se}from"./chunk-4D5SN44G.js";import"./chunk-6Q5DDO7R.js";import"./chunk-U22BTVEZ.js";import{$b as X,Ce as ie,Gb as J,Hd as te,Kb as _e,Mb as K,Wc as Z,kd as ee,kh as ye,lb as Ce,mb as H}from"./chunk-X5J6QTCG.js";import{$ as O,$a as g,Ad as le,Fa as c,Gb as W,H as ce,Ib as e,Jb as M,Ka as S,Kb as R,Ma as D,Mb as me,Na as B,Qb as z,Rb as Y,Sb as G,Th as ge,U as h,_ as $,ba as j,bb as f,cc as w,d as k,db as y,di as fe,eb as b,fa as p,fb as I,fi as Q,ga as v,gb as C,hb as r,ib as a,jb as m,k as E,lc as ue,mc as pe,pj as q,q as P,qb as _,sb as x,tb as d,u as V,wd as ve,xb as U,ya as de,yb as L,zb as N}from"./chunk-SMW7PHYX.js";import{a as ae}from"./chunk-BMIYOSOG.js";var Ee=(()=>{let o=class o{};o.\u0275fac=function(n){return new(n||o)},o.\u0275cmp=D({type:o,selectors:[["ng-component"]],standalone:!1,decls:1,vars:0,template:function(n,s){n&1&&m(0,"router-outlet")},dependencies:[ve],encapsulation:2});let t=o;return t})();var ne=class{};var F=(function(t){return t[t.PROGRAM=1]="PROGRAM",t[t.DEFAULT=2]="DEFAULT",t[t.CUSTOM=3]="CUSTOM",t})(F||{});var oe=(()=>{let o=class o{constructor(i){this.webAPI=i,this.baseUrl="admin/invoicing/revenue-categories"}getRevenueCategoryGroups(){return this.webAPI.getData(`${this.baseUrl}/groups`)}getRevenueCategoryMetadata(){return this.webAPI.getData(`${this.baseUrl}/metadata`)}getRevenueCategory(i){return this.webAPI.getData(`${this.baseUrl}/${i}`)}saveRevenueCategory(i){return i.invoiceRevenueCategoryID?this.webAPI.putData(`${this.baseUrl}/${i.invoiceRevenueCategoryID}`,i):this.webAPI.postData(`${this.baseUrl}`,i)}deleteRevenueCategory(i){return this.webAPI.deleteData(`${this.baseUrl}/${i}`)}};o.\u0275fac=function(n){return new(n||o)(j(Q))},o.\u0275prov=$({token:o,factory:o.\u0275fac});let t=o;return t})();var Qe=["optionsMenu"],qe=()=>({width:"auto"}),Me=()=>[1,2,3];function He(t,o){if(t&1&&(e(0,` 2 `),r(1,"div",8),ue(2,"safeHtml"),e(3,` 3 `),a(),e(4,` 4 `)),t&2){let l=d().$implicit;c(),C("innerHtml",pe(2,1,l.descriptionText),de)}}function Je(t,o){if(t&1){let l=_();e(0,` 5 `),r(1,"div",12),e(2,` 6 `),r(3,"button",13),x("click",function(n){p(l);let s=d().$implicit,u=d(4);return v(u.toggleOptionsMenu(s,n))}),e(4,` 7 `),m(5,"i",14),e(6,` 8 `),r(7,"div",15),e(8,"Options"),a(),e(9,` 9 `),a(),e(10,` 10 `),a(),e(11,` 11 `)}}function Ke(t,o){if(t&1&&(e(0,` 12 `),r(1,"li",10),e(2,` 13 `),r(3,"div",11),e(4,` 14 `),r(5,"div"),e(6),a(),e(7,` 15 `),g(8,Je,12,0),a(),e(9,` 16 `),a(),e(10,` 17 `)),t&2){let l=o.$implicit,i=d(2).$implicit,n=d(2);c(6),R(` 18 `,l.name,` 19 `),c(2),f(i.invoiceRevenueCategoryGroupID===n.InvoiceRevenueCategoryGroup.CUSTOM&&l.clubID===n.clubID?8:-1)}}function Xe(t,o){if(t&1&&(e(0,` 20 `),r(1,"ul",9),e(2,` 21 `),b(3,Ke,11,2,null,null,y),a(),e(5,` 22 `)),t&2){let l=d().$implicit;c(3),I(l.invoiceRevenueCategories)}}function Ze(t,o){if(t&1&&(e(0,` 23 `),r(1,"app-inline-alert",16),e(2,` 24 `),r(3,"span",17),e(4),a(),e(5,` 25 `),a(),e(6,` 26 `)),t&2){let l=d(2).$implicit;c(),C("isInline",!0),c(3),R(` 27 `,l.missingCategoryText,` 28 `)}}function et(t,o){if(t&1&&(e(0,` 29 `),g(1,Ze,7,2)),t&2){let l=d().$implicit;c(),f(l.missingCategoryText?1:-1)}}function tt(t,o){if(t&1&&(e(0,` 30 `),r(1,"div",7),e(2,` 31 `),r(3,"h3"),e(4),a(),e(5,` 32 `),g(6,He,5,3),g(7,Xe,6,0)(8,et,2,1),a(),e(9,` 33 `)),t&2){let l=o.$implicit;c(4),M(l.label),c(2),f(l.descriptionText?6:-1),c(),f(l.invoiceRevenueCategories!=null&&l.invoiceRevenueCategories.length?7:8)}}function it(t,o){if(t&1){let l=_();e(0,` 34 `),b(1,tt,10,3,null,null,y),r(3,"div",5),e(4,` 35 `),r(5,"button",6),x("click",function(){p(l);let n=d();return v(n.editCustomCategory())}),e(6,` 36 Add Custom Category 37 `),a(),e(7,` 38 `),a(),e(8,` 39 `)}if(t&2){let l=d();c(),I(l.categories)}}function nt(t,o){t&1&&(e(0,` 40 `),r(1,"div",19),e(2,` 41 `),m(3,"app-skeleton-template",20),e(4,` 42 `),a(),e(5,` 43 `))}function ot(t,o){t&1&&(e(0,` 44 `),r(1,"div",7),e(2,` 45 `),r(3,"div",2),e(4,` 46 `),m(5,"app-skeleton-template",18),e(6,` 47 `),a(),e(7,` 48 `),b(8,nt,6,0,null,null,y),a(),e(10,` 49 `)),t&2&&(c(8),I(w(0,Me)))}function st(t,o){t&1&&(e(0,` 50 `),b(1,ot,11,1,null,null,y)),t&2&&(c(),I(w(0,Me)))}
50function rt(t,o){if(t&1){let l=_();e(0,` 51 `),r(1,"app-dynamic-form",21),x("onCancel",function(){p(l);let n=d();return v(n.showCategoryDialog=!1)})("onSubmit",function(n){p(l);let s=d();return v(s.saveCustomCategory(n))}),e(2,` 52 `),m(3,"app-dynamic-form-field",22),e(4,` 53 `),a(),e(5,` 54 `)}if(t&2){let l=d();c(),C("fields",l.fields)("entity",l.category)("horizontalForm",!1)("contentFieldsMode",!0)("showSaveAndAddButton",!1)}}function at(t,o){t&1&&(e(0,` 55 `),m(1,"app-skeleton-template",23),e(2,` 56 `),m(3,"app-skeleton-template",24),e(4,` 57 `))}function lt(t,o){if(t&1){let l=_();e(0,` 58 `),r(1,"app-yes-no-modal",25),x("onYesSelect",function(){p(l);let n=d();return v(n.deleteCustomCategory())})("onNoSelect",function(){p(l);let n=d();return v(n.showDeleteDialog=!1)}),e(2,` 59 `),r(3,"div",26),e(4,` 60 `),r(5,"app-inline-alert",27),e(6,` 61 Are you sure you want to delete this revenue category? 62 `),a(),e(7,` 63 `),a(),e(8,` 64 `),a(),e(9,` 65 `)}if(t&2){let l=d();c(),C("showModalText",!1)("loading",l.loading),c(4),C("isInline",!0)}}var Re=(()=>{let o=class o{constructor(i,n,s,u){this.siteDataService=i,this.revenueCategoryService=n,this.formService=s,this.authService=u,this.loading=!0,this.showCategoryDialog=!1,this.loadingCategory=!0,this.options=[],this.showDeleteDialog=!1,this.deleting=!1,this.InvoiceRevenueCategoryGroup=F,this.unsubcribe$=new k}ngOnInit(){this.authService.getUser().pipe(ce(1)).subscribe(i=>{this.clubID=+i.clubID}),this.siteDataService.hideSiteLoader(),this.revenueCategoryService.getRevenueCategoryGroups().pipe(h(this.unsubcribe$)).subscribe({next:i=>{this.categories=i,this.loading=!1},error:()=>{this.siteDataService.showSiteErrorAlertDefaultGET()}})}editCustomCategory(){this.showCategoryDialog=!0,(!this.fields||!this.category)&&(this.loadingCategory=!0);let i=this.editingInvoiceRevenueCategory?E(this.editingInvoiceRevenueCategory):E(new ne),n=this.fields?E(this.fields):this.revenueCategoryService.getRevenueCategoryMetadata().pipe(P(s=>s.fields));V({category:i,fields:n}).pipe(h(this.unsubcribe$)).subscribe({next:s=>{this.category=s.category,this.fields=s.fields,this.loadingCategory=!1}})}saveCustomCategory(i){i.invoiceRevenueCategoryID=this.invoiceRevenueCategoryID,this.revenueCategoryService.saveRevenueCategory(i).pipe(h(this.unsubcribe$)).subscribe({next:n=>{let s=this.categories.find(u=>u.invoiceRevenueCategoryGroupID===F.CUSTOM);n?(s.invoiceRevenueCategories||(s.invoiceRevenueCategories=[]),s.invoiceRevenueCategories.push(n)):this.editingInvoiceRevenueCategory&&(this.editingInvoiceRevenueCategory.name=i.name),s.invoiceRevenueCategories.sort((u,re)=>u.name.toLowerCase()<re.name.toLowerCase()?-1:1),this.siteDataService.showSiteSuccessAlert("Revenue category saved successfully"),this.formService.hideFormLoader(),this.showCategoryDialog=!1},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem saving this revenue category"),this.formService.hideFormLoader()}})}deleteCustomCategory(){this.deleting=!0,this.revenueCategoryService.deleteRevenueCategory(this.invoiceRevenueCategoryID).pipe(h(this.unsubcribe$)).subscribe({next:()=>{this.siteDataService.showSiteSuccessAlert("Revenue category deleted successfully");let i=this.categories.find(s=>s.invoiceRevenueCategoryGroupID===F.CUSTOM),n=i.invoiceRevenueCategories.findIndex(s=>s.invoiceRevenueCategoryID===this.invoiceRevenueCategoryID);i.invoiceRevenueCategories.splice(n,1),this.showDeleteDialog=!1,this.deleting=!1},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem deleting this revenue category"),this.deleting=!1}})}toggleOptionsMenu(i,n){this.editingInvoiceRevenueCategory=i,this.invoiceRevenueCategoryID=i.invoiceRevenueCategoryID;let s=[];s.push({label:"Edit Category",icon:"fa fa-pencil",command:()=>{this.editCustomCategory()}}),i.usageCount||s.push({label:"Delete Category",icon:"fa fa-trash-alt",command:()=>{this.showDeleteDialog=!0}}),this.options=[{label:"Options",items:s}],this.optionsMenu.toggle(n)}ngOnDestroy(){this.unsubcribe$.next(),this.unsubcribe$.complete()}};o.\u0275fac=function(n){return new(n||o)(S(q),S(oe),S(X),S(fe))}
65,o.\u0275cmp=D({type:o,selectors:[["app-invoice-revenue-category"]],viewQuery:function(n,s){if(n&1&&U(Qe,5),n&2){let u;L(u=N())&&(s.optionsMenu=u.first)}},standalone:!1,decls:21,vars:14,consts:[["optionsMenu",""],[1,"card","settings-card"],[1,"text-medium","mb-3"],[3,"visibleChange","visible","header","closable","modal","draggable","styleClass"],["appendTo","body",3,"model","popup"],[1,""],["type","button",1,"btn","btn-naked","btn-icon-plus",3,"click"],[1,"mb-3","border-top"],[1,"text-medium","mb-3",3,"innerHtml"],[1,"no-bullets"],[1,"bg-grey-lt","py-2","px-3"],[1,"d-flex","align-items-center"],[1,"d-flex","justify-content-end","ml-auto"],["type","button",1,"btn","btn-sm","btn-tertiary","ml-3",3,"click"],[1,"fa-solid","fa-ellipsis"],[1,"sr-only"],["alertType","info",3,"isInline"],[1,"text-small"],["height","4rem"],[1,"mb-1"],["height","2rem"],["submitButtonText","Save","formID","category-form",3,"onCancel","onSubmit","fields","entity","horizontalForm","contentFieldsMode","showSaveAndAddButton"],["fieldName","name","formID","category-form"],["skeletonType","form-single-text-input"],["skeletonType","form-buttons-only"],["headerText","Delete Custom Category","dialogClass","standardWidthDialog","yesButtonText","Yes, Delete","yesButtonLoadingText","Deleting...","noButtonText","No, Cancel",3,"onYesSelect","onNoSelect","showModalText","loading"],[1,"text-medium","fw-600"],["alertType","warning",3,"isInline"]],template:function(n,s){if(n&1){let u=_();r(0,"div",1),e(1,` 66 `),r(2,"h2"),e(3,"Revenue Categories"),a(),e(4,` 67 `),r(5,"div",2),e(6,` 68 When creating a new item, it is required to designate a revenue category in which the item will be grouped 69 within financial reporting. The Program Categories are available by default to select on each item and Custom 70 Categories can be added below. Once added, Custom Categories will be available to select if an item does not 71 pertain to a program. 72 `),a(),e(7,` 73 `),g(8,it,9,0)(9,st,3,1),a(),e(10,` 74 75`),r(11,"p-dialog",3),G("visibleChange",function(A){return p(u),Y(s.showCategoryDialog,A)||(s.showCategoryDialog=A),v(A)}),e(12,` 76 `),g(13,rt,6,5)(14,at,5,0),a(),e(15,` 77 78`),g(16,lt,10,3),e(17,`> 79 80 `),r(18,"p-menu",4,0),e(20,` 81 `),a()}n&2&&(c(8),f(s.loading?9:8),c(3),z("visible",s.showCategoryDialog),C("header",s.category!=null&&s.category.invoiceRevenueCategoryID?"Edit Custom Category":"Add Custom Category")("closable",!1)("modal",!0)("draggable",!1)("styleClass","shortWidthDialog"),c(2),f(!s.loadingCategory&&s.fields&&s.category?13:14),c(3),f(s.showDeleteDialog?16:-1),c(2),W(w(13,qe)),C("model",s.options)("popup",!0))},dependencies:[te,ee,Z,K,ie,J,H,Ce],styles:[".settings-card[_ngcontent-%COMP%] .row[_ngcontent-%COMP%] .club-logo[_ngcontent-%COMP%]{max-height:4rem;display:block}.settings-card[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], .settings-card[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font-size:var(--text-large)}"]});let t=o;return t})();var se=(()=>{let o=class o{constructor(i){this.webAPI=i,this.baseUrl="admin/invoicing/invoice-settings"}getInvoiceSettingsMetadata(){return this.webAPI.getData(`${this.baseUrl}/metadata`)}getInvoiceSettings(){return this.webAPI.getData(`${this.baseUrl}`)}saveInvoiceSettings(i){return i.invoiceSettingsID?this.webAPI.putData(`${this.baseUrl}`,i):this.webAPI.postData(`${this.baseUrl}`,i)}};o.\u0275fac=function(n){return new(n||o)(j(Q))},o.\u0275prov=$({token:o,factory:o.\u0275fac});let t=o;return t})();var mt=["addressMenu"],ut=()=>({width:"auto"}),Fe=()=>[1,2];function pt(t,o){if(t&1&&(e(0,` 82 `),r(1,"div"),e(2),a(),e(3,` 83 `)),t&2){let l=d().$implicit;c(2),M(l.addressLine2)}}function vt(t,o){t&1&&(e(0,` 84 `),m(1,"app-pill",16),e(2,` 85 `))}function gt(t,o){t&1&&(e(0,` 86 `),m(1,"app-pill",17),e(2,` 87 `))}function ft(t,o){if(t&1){let l=_();e(0,` 88 `),r(1,"button",18),x("click",function(n){p(l);let s=d().$implicit,u=d(2);return v(u.toggleAddressMenu(s,n))}),e(2,` 89 `),m(3,"i",19),e(4,` 90 `),r(5,"div",20),e(6,"Options"),a(),e(7,` 91 `),a(),e(8,` 92 `)}}function Ct(t,o){if(t&1&&(e(0,` 93 `),r(1,"li",10),e(2,` 94 `),r(3,"div",11),e(4,` 95 `),r(5,"div",14),e(6,` 96 `),r(7,"div")(8,"strong"),e(9),a()(),e(10,` 97 `),r(11,"div"),e(12),a(),e(13,` 98 `),g(14,pt,4,1),r(15,"div"),e(16),a(),e(17,` 99 `),a(),e(18,` 100 `),r(19,"div",12),e(20,` 101 `),r(21,"div",15),e(22,` 102 `),g(23,vt,3,0),g(24,gt,3,0),a(),e(25,` 103 `),g(26,ft,9,0),a(),e(27,` 104 `),a(),e(28,` 105 `),a(),e(29,` 106 `)),t&2){let l=o.$implicit,i=d(2);c(9),M(i.clubSettings.club.name),c(3),M(l.addressLine1),c(2),f(l.addressLine2?14:-1),c(2),me(` 107 `,l.city,", ",l.state," ",l.zip,` 108 `),c(7),f(l.isClubAddress?23:-1),c(),f(l.isDefault?24:-1),c(2),f(!l.usageCount&&!l.isClubAddress||!l.isDefault?26:-1)}}function _t(t,o){if(t&1){let l=_();e(0,` 109 `),r(1,"div",5),e(2,` 110 `),r(3,"h3"),e(4,"Invoice Address"),a(),e(5,` 111 `),r(6,"div",2),e(7,` 112 The address listed below is provided in the Club Profile settings of this site and will be used as the 113 default address for invoices. Select + Add Address below to set a different address as the default or to 114 use as an alternate option when sending invoices. 115 `),a(),e(8,` 116 `),r(9,"ul",6),e(10,` 117 `),b(11,Ct,30,9,null,null,y),a(),e(13,` 118 `),r(14,"div",7),e(15,` 119 `),r(16,"button",8),x("click",function(){p(l);let n=d();return v(n.editInvoiceAddress())}),e(17,` 120 Add Address 121 `),a(),e(18,` 122 `),a(),e(19,` 123 `),a(),e(20,` 124 `),r(21,"div",9),e(22,` 125 `),r(23,"h3"),e(24,"Due Date"),a(),e(25,` 126 `),r(26,"div",2),e(27,` 127 Due date options for invoices are due upon receipt or a specific date. The due date below sets the 128 default number of days when choosing a specific date on an invoice. 129 `),a(),e(28,` 130 `),r(29,"ul",6),e(30,` 131 `),r(31,"li",10),e(32,` 132 `),r(33,"div",11),e(34,` 133 `),r(35,"span"),e(36,` 134 Due Date 135 `),a(),e(37,` 136 `),r(38,"span",12),e(39),a(),e(40,` 137 `),a(),e(41,` 138 `),a(),e(42,` 139 `),a(),e(43,` 140 `),r(44,"div",7),e(45,` 141 `),r(46,"button",13),x("click",function(){p(l);let n=d();return v(n.editInvoiceSettings())}),e(47,` 142 Edit Due Date 143 `),a(),e(48,` 144 `),a(),e(49,` 145 `),a(),e(50,` 146 `)}if(t&2){let l=d();c(11),I(l.addresses),c(28),R(` 147 `,l.invoiceSettings.dueDateDefaultDays,` days 148 `)}}function xt(t,o){t&1&&(e(0,` 149 `),r(1,"div",22),e(2,` 150 `),m(3,"app-skeleton-template",23),e(4,` 151 `),a(),e(5,` 152 `))}function ht(t,o){t&1&&(e(0,` 153 `),r(1,"div",5),e(2,` 154 `),r(3,"div",2),e(4,` 155 `),m(5,"app-skeleton-template",21),e(6,` 156 `),a(),e(7,` 157 `),b(8,xt,6,0,null,null,y),a(),e(10,` 158 `)),t&2&&(c(8),I(w(0,Fe)))}function St(t,o){t&1&&(e(0,` 159 `),b(1,ht,11,1,null,null,y)),t&2&&(c(),I(w(0,Fe)))}function yt(t,o){if(t&1){let l=_();e(0,` 160 `),r(1,"app-dynamic-form",24),x("onCancel",function(){p(l);let n=d();return v(n.showEditInvoiceSettings=!1)})("onSubmit",function(n){p(l);let s=d();return v(s.saveInvoiceSettings(n))}),e(2,` 161 `),m(3,"app-dynamic-form-field",25),e(4,` 162 `),a(),e(5,` 163 `)}if(t&2){let l=d();c(),C("fields",l.invoiceSettingsFields)("entity",l.invoiceSettings)("horizontalForm",!1)("contentFieldsMode",!0)("showSaveAndAddButton",!1)}}function bt(t,o){t&1&&(e(0,` 164 `),m(1,"app-skeleton-template",26),e(2,` 165 `),m(3,"app-skeleton-template",27),e(4,` 166 `))}function It(t,o){if(t&1){let l=_();e(0,` 167 `),r(1,"app-invoice-address-edit",28),x("cancel",function(){p(l);let n=d();return n.showEditInvoiceAddress=!1,v(n.invoiceAddress=null)})("save",function(n){p(l);let s=d();return v(s.saveInvoiceAddress(n))}),a(),e(2,` 168`)}if(t&2){let l=d();c(),C("invoiceAddress",l.invoiceAddress)}}function Dt(t,o){if(t&1){let l=_();e(0,` 169 `),r(1,"app-yes-no-modal",29),x("onYesSelect",function(){p(l);let n=d();return v(n.deleteInvoiceAddress())})("onNoSelect",function(){p(l);let n=d();return v(n.showDeleteAddressDialog=!1)}),e(2,` 170 `),r(3,"div",30),e(4,` 171 `),r(5,"app-inline-alert",31),e(6,` 172 Are you sure you want to delete this address? 173 `),a(),e(7,` 174 `),a(),e(8,` 175 `),a(),e(9,` 176`)}if(t&2){let l=d();c(),C("showModalText",!1)("loading",l.loading),c(4),C("isInline",!0)}}var ke=(()=>{let o=class o{constructor(i,n,s,u){this.siteDataService=i,this.invoiceSettingsService=n,this.invoiceAddressService=s,this.formService=u,this.showEditInvoiceSettings=!1,this.loadingInvoiceSettings=!1,this.showEditInvoiceAddress=!1,this.loadingInvoiceAddress=!1,this.showDeleteAddressDialog=!1,this.loading=!0,this.unsubcribe$=new k}
176ngOnInit(){this.siteDataService.hideSiteLoader(),V({clubSettings:this.siteDataService.getClubSettings(),invoiceSettings:this.invoiceSettingsService.getInvoiceSettings(),addresses:this.invoiceAddressService.getInvoiceAddresses()}).pipe(h(this.unsubcribe$)).subscribe(i=>{this.clubSettings=i.clubSettings,this.invoiceSettings=i.invoiceSettings,this.addresses=i.addresses,this.loading=!1})}editInvoiceSettings(){this.loadingInvoiceSettings=!0,this.showEditInvoiceSettings=!0,(this.invoiceSettingsFields?E(this.invoiceSettingsFields):this.invoiceSettingsService.getInvoiceSettingsMetadata().pipe(P(n=>n.fields))).pipe(h(this.unsubcribe$)).subscribe({next:n=>{this.invoiceSettingsFields=n,this.loadingInvoiceSettings=!1},error:()=>{this.siteDataService.showSiteErrorAlertDefaultGET()}})}saveInvoiceSettings(i){i.invoiceSettingsID=this.invoiceSettings.invoiceSettingsID,this.invoiceSettingsService.saveInvoiceSettings(i).pipe(h(this.unsubcribe$)).subscribe({next:n=>{this.siteDataService.showSiteSuccessAlert("Invoice settings saved successfully"),this.invoiceSettings=ae({},i),n&&(this.invoiceSettings.invoiceSettingsID=n.invoiceSettingsID),this.showEditInvoiceSettings=!1,this.formService.hideFormLoader()},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem saving invoice settings"),this.formService.hideFormLoader()}})}editInvoiceAddress(i=!0){this.showEditInvoiceAddress=!0,(!this.invoiceAddress||i)&&(this.invoiceAddress=new be)}saveInvoiceAddress(i){i.isDefault&&this.addresses.forEach(s=>s.isDefault=!1);let n=this.addresses.findIndex(s=>s.invoiceAddressID===i.invoiceAddressID);n>-1?this.addresses[n]=ae({},i):this.addresses.push(i),this.showEditInvoiceAddress=!1}setAddressAsDefault(){(this.invoiceAddress.isClubAddress?this.invoiceAddressService.removeInvoiceAddressDefault():this.invoiceAddressService.setInvoiceAddressAsDefault(this.invoiceAddress.invoiceAddressID)).pipe(h(this.unsubcribe$)).subscribe({next:()=>{this.siteDataService.showSiteSuccessAlert("Invoice address saved successfully"),this.addresses.forEach(s=>s.isDefault=!1);let n=this.addresses.findIndex(s=>s.invoiceAddressID===this.invoiceAddress.invoiceAddressID);this.addresses[n].isDefault=!0,this.invoiceAddress=null},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem saving this invoice address")}})}deleteInvoiceAddress(){this.invoiceAddressService.deleteInvoiceAddressDefault(this.invoiceAddress.invoiceAddressID).pipe(h(this.unsubcribe$)).subscribe({next:()=>{this.siteDataService.showSiteSuccessAlert("Invoice address deleted successfully");let i=this.addresses.findIndex(n=>n.invoiceAddressID===this.invoiceAddress.invoiceAddressID);this.addresses.splice(i,1),this.addresses.some(n=>n.isDefault)||(this.addresses[0].isDefault=!0),this.invoiceAddress=null,this.showDeleteAddressDialog=!1},error:()=>{this.siteDataService.showSiteErrorAlert("There was a problem deleting this invoice address")}})}toggleAddressMenu(i,n){this.invoiceAddress=i;let s=[];!i.usageCount&&!i.isClubAddress&&s.push({label:"Edit Address",icon:"fa fa-pencil",command:()=>{this.editInvoiceAddress(!1)}}),i.isDefault||s.push({label:"Set as Default",icon:"fas fa-map-pin",command:()=>{this.setAddressAsDefault()}}),!i.usageCount&&!i.isClubAddress&&s.push({label:"Delete Address",icon:"fa fa-trash-alt",command:()=>{this.showDeleteAddressDialog=!0}}),this.addressMenuItems=[{label:"Options",items:s}],this.addressMenu.toggle(n)}ngOnDestroy(){this.unsubcribe$.next(),this.unsubcribe$.complete()}};o.\u0275fac=function(n){return new(n||o)(S(q),S(se),S(Ie),S(X))},o.\u0275cmp=D({type:o,selectors:[["app-invoice-default-settings"]],viewQuery:function(n,s){if(n&1&&U(mt,5),n&2){let u;L(u=N())&&(s.addressMenu=u.first)}},standalone:!1,decls:21,vars:14,consts:[["addressMenu",""],[1,"card","settings-card"],[1,"text-medium","mb-3"],["header","Edit Due Date",3,"visibleChange","visible","closable","modal","draggable","styleClass"],["appendTo","body",3,"model","popup"],[1,"mb-3","border-top"],[1,"no-bullets"],[1,"mt-3"],["type","button",1,"btn","btn-naked","btn-icon-plus",3,"click"],[1,"border-top"],[1,"bg-grey-lt","py-2","px-3"],[1,"d-flex","align-items-center"],[1,"d-flex","justify-content-end","ml-auto"],["type","button",1,"btn","btn-naked","btn-icon-pencil",3,"click"],[1,"line-height-2"],[1,""],["text","Club Address","status","primary"],["text","Default","status","success"],["type","button",1,"btn","btn-sm","btn-tertiary","ml-3",3,"click"],[1,"fa-solid","fa-ellipsis"],[1,"sr-only"],["height","4rem"],[1,"mb-1"],["height","2rem"],["submitButtonText","Save","formID","settings-form",3,"onCancel","onSubmit","fields","entity","horizontalForm","contentFieldsMode","showSaveAndAddButton"],["fieldName","dueDateDefaultDays","formID","settings-form"],["skeletonType","form-single-text-input"],["skeletonType","form-buttons-only"],[3,"cancel","save","invoiceAddress"],["headerText","Delete Address","dialogClass","standardWidthDialog","yesButtonText","Yes, Delete","yesButtonLoadingText","Deleting...","noButtonText","No, Cancel",3,"onYesSelect","onNoSelect","showModalText","loading"],[1,"text-medium","fw-600"],["alertType","warning",3,"isInline"]],template:function(n,s){if(n&1){let u=_();r(0,"div",1),e(1,` 177 `),r(2,"h2"),e(3,"Default Settings"),a(),e(4,` 178 `),r(5,"div",2),e(6,` 179 New invoices will default to these settings but can be changed on individual invoices. 180 `),a(),e(7,` 181 `),g(8,_t,51,1)(9,St,3,1),a(),e(10,` 182 183`),r(11,"p-dialog",3),G("visibleChange",function(A){return p(u),Y(s.showEditInvoiceSettings,A)||(s.showEditInvoiceSettings=A),v(A)}),e(12,` 184 `),g(13,yt,6,5)(14,bt,5,0),a(),e(15,` 185 186`),g(16,It,3,1),g(17,Dt,10,3),r(18,"p-menu",4,0),e(20,` 187`),a()}n&2&&(c(8),f(s.loading?9:8),c(3),z("visible",s.showEditInvoiceSettings),C("closable",!1)("modal",!0)("draggable",!1)("styleClass","shortWidthDialog"),c(2),f(!s.loadingInvoiceSettings&&s.invoiceSettingsFields&&s.invoiceSettings?13:14),c(3),f(s.showEditInvoiceAddress?16:-1),c(),f(s.showDeleteAddressDialog?17:-1),c(),W(w(13,ut)),C("model",s.addressMenuItems)("popup",!0))},dependencies:[te,ee,_e,Z,K,ie,J,H,De],styles:[".settings-card[_ngcontent-%COMP%] .row[_ngcontent-%COMP%] .club-logo[_ngcontent-%COMP%]{max-height:4rem;display:block}.settings-card[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], .settings-card[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font-size:var(--text-large)}"]}
187);let t=o;return t})();var Pe=(()=>{let o=class o{};o.\u0275fac=function(n){return new(n||o)},o.\u0275cmp=D({type:o,selectors:[["ng-component"]],standalone:!1,decls:14,vars:0,consts:[[1,"row"],[1,"col-6"]],template:function(n,s){n&1&&(m(0,"app-invoicing-navigation"),e(1,` 188`),r(2,"div",0),e(3,` 189 `),r(4,"div",1),e(5,` 190 `),m(6,"app-invoice-default-settings"),e(7,` 191 `),a(),e(8,` 192 `),r(9,"div",1),e(10,` 193 `),m(11,"app-invoice-revenue-category"),e(12,` 194 `),a(),e(13,` 195`),a())},dependencies:[we,Re,ke],styles:[".settings-card[_ngcontent-%COMP%] .row[_ngcontent-%COMP%] .club-logo[_ngcontent-%COMP%]{max-height:4rem;display:block}.settings-card[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], .settings-card[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font-size:var(--text-large)}"]});let t=o;return t})();var Ve=(()=>{let o=class o{};o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=B({type:o}),o.\u0275inj=O({imports:[le.forChild([{path:"",component:Ee,children:[{path:"",canActivate:[xe,Se,he],component:Pe,data:{permissions:[ge.InvoiceSettings],metaTitle:"Invoice Settings"}}]}]),le]});let t=o;return t})();var Ei=(()=>{let o=class o{};o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=B({type:o}),o.\u0275inj=O({providers:[oe,se],imports:[ye,Ve,Ae,Te]});let t=o;return t})();export{Ei as InvoiceSettingsModule};
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.