dealposbooks 1.9.8 → 5.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/3rdpartylicenses.txt +52 -52
  2. package/assets/scss/style.scss +8 -1
  3. package/{chunk-V4IY7RIP.js → chunk-253IFSMV.js} +1 -1
  4. package/chunk-2BCAGP7R.js +1 -0
  5. package/chunk-2FU3LWGL.js +1 -0
  6. package/{chunk-27P5HOS3.js → chunk-2KB4NNVP.js} +1 -1
  7. package/{chunk-H6BPUKCW.js → chunk-33PMTNWY.js} +1 -1
  8. package/chunk-33YEAYJV.js +1 -0
  9. package/{chunk-JO3SI6HU.js → chunk-3LDYJV3L.js} +1 -1
  10. package/chunk-3WD3CTYC.js +1 -0
  11. package/{chunk-WWWY3VE7.js → chunk-42UIGXWH.js} +1 -1
  12. package/chunk-4ANXHXE3.js +7 -0
  13. package/{chunk-W4KTL6Y6.js → chunk-4LGDNQMZ.js} +1 -1
  14. package/chunk-56GDP75Z.js +1 -0
  15. package/{chunk-7IPVVF6Y.js → chunk-5R3XKSDM.js} +1 -1
  16. package/chunk-63YXSI43.js +1 -0
  17. package/{chunk-LMI4DLB5.js → chunk-67VPWIWW.js} +51 -51
  18. package/chunk-6ACYDH2N.js +1 -0
  19. package/{chunk-AZWJMXL6.js → chunk-6DRYMDZA.js} +1 -1
  20. package/{chunk-NR3EHEG3.js → chunk-6LENP6AB.js} +1 -1
  21. package/{chunk-3RM5CDGW.js → chunk-6NGIQJIP.js} +2 -2
  22. package/chunk-6OQPMZXU.js +1 -0
  23. package/{chunk-L66QS3IX.js → chunk-6UGXXSQ3.js} +1 -1
  24. package/chunk-74MJ3NFN.js +1 -0
  25. package/chunk-7EJVMM7V.js +252 -0
  26. package/chunk-7EZGTYA2.js +1 -0
  27. package/chunk-7VQQO4OE.js +1 -0
  28. package/{chunk-XAH4P23E.js → chunk-A7EGGUJQ.js} +1 -1
  29. package/{chunk-DXIZC3FM.js → chunk-ABBBWSSO.js} +1 -1
  30. package/{chunk-OXGCSUUS.js → chunk-AIZN44RL.js} +2 -2
  31. package/{chunk-DJAICZNR.js → chunk-AZUQDRJU.js} +1 -1
  32. package/chunk-B5JORMF2.js +1 -0
  33. package/{chunk-DAQCANBV.js → chunk-B63BKC6F.js} +2 -2
  34. package/{chunk-6PS3NJ62.js → chunk-B7WHT2EP.js} +1 -1
  35. package/{chunk-W6LBFCQQ.js → chunk-BHV2HCJY.js} +1 -1
  36. package/{chunk-4V5YFD3N.js → chunk-BLJMNWUM.js} +1 -1
  37. package/{chunk-TLLNQB5C.js → chunk-BMBVCXB4.js} +2 -2
  38. package/chunk-BQXWTZHK.js +129 -0
  39. package/{chunk-XYU65DNE.js → chunk-BTDW4G2F.js} +1 -1
  40. package/chunk-C2GO6SPF.js +1 -0
  41. package/{chunk-YJ3CWPO4.js → chunk-C6U3U6SW.js} +1 -1
  42. package/{chunk-BX74ZLQG.js → chunk-C7LM5UCK.js} +1 -1
  43. package/{chunk-RSGEQTNJ.js → chunk-EDCDR4RJ.js} +1 -1
  44. package/{chunk-CEZEYAWZ.js → chunk-EW3R2HAB.js} +1 -1
  45. package/{chunk-SH4ALZVS.js → chunk-F5XF3NTF.js} +1 -1
  46. package/{chunk-4PK4TO7C.js → chunk-F5Z3IX4J.js} +1 -1
  47. package/{chunk-U75O34AW.js → chunk-FBEBMNVC.js} +1 -1
  48. package/{chunk-3GHEXAAZ.js → chunk-FMVCTBCQ.js} +1 -1
  49. package/{chunk-BDJHC5O6.js → chunk-GH5Z5SPB.js} +1 -1
  50. package/chunk-GORMHEMA.js +1 -0
  51. package/{chunk-4MEPU7FI.js → chunk-HAZ77TED.js} +1 -1
  52. package/{chunk-6332DY2I.js → chunk-HHDFSN55.js} +1 -1
  53. package/{chunk-TIX3GAPF.js → chunk-HHJMN4BS.js} +1 -1
  54. package/chunk-INXSCWN3.js +1 -0
  55. package/chunk-IU2PF53V.js +1 -0
  56. package/{chunk-CNLYDNON.js → chunk-J4XRJAME.js} +1 -1
  57. package/{chunk-FTI2QPWV.js → chunk-JBSIAXM5.js} +1 -1
  58. package/{chunk-WCXWWANV.js → chunk-JP6RBSB3.js} +3 -3
  59. package/chunk-JPP5O2O5.js +1 -0
  60. package/{chunk-KANHSSLO.js → chunk-KJ6CKUEI.js} +3 -3
  61. package/chunk-L725MUU2.js +160 -0
  62. package/{chunk-HFUW7PYZ.js → chunk-LRRVQSMI.js} +1 -1
  63. package/{chunk-7ET5CSOO.js → chunk-M4Z3FI3C.js} +1 -1
  64. package/{chunk-RLR2HFSC.js → chunk-MDH73MG3.js} +1 -1
  65. package/chunk-MFH4UZ6J.js +1 -0
  66. package/{chunk-77BBQI2T.js → chunk-MWDWM2EU.js} +1 -1
  67. package/chunk-MXBBJHYA.js +202 -0
  68. package/{chunk-35ER6BC7.js → chunk-NA5YXAMJ.js} +1 -1
  69. package/{chunk-CZWWMQFD.js → chunk-O4QM64EH.js} +1 -1
  70. package/{chunk-YVGWGEPX.js → chunk-OLOVFS3Y.js} +1 -1
  71. package/{chunk-MYLHWS7O.js → chunk-OYHHWU2W.js} +1 -1
  72. package/chunk-P3V7Z3A6.js +1 -0
  73. package/{chunk-RNOSD5RO.js → chunk-PKN47FQE.js} +2 -2
  74. package/chunk-PV3NLUKC.js +1 -0
  75. package/chunk-Q33XIUDN.js +1 -0
  76. package/chunk-QCLAOAVG.js +1 -0
  77. package/chunk-QLUQTLSH.js +1 -0
  78. package/{chunk-LFVBO7JG.js → chunk-QSWSGP4B.js} +1 -1
  79. package/{chunk-J6H5UCJR.js → chunk-QYXQYPHB.js} +1 -1
  80. package/chunk-RBTNUVT5.js +130 -0
  81. package/chunk-REXWFSN3.js +1 -0
  82. package/chunk-RMRYZWCP.js +1 -0
  83. package/chunk-SEGRH6C4.js +1 -0
  84. package/chunk-TT745CJN.js +1 -0
  85. package/{chunk-JZTK7BS7.js → chunk-TVNXFJII.js} +1 -1
  86. package/chunk-UWNAF5OL.js +1 -0
  87. package/{chunk-RYHNURUZ.js → chunk-UYC454VQ.js} +1 -1
  88. package/{chunk-BPFL7VRT.js → chunk-VAXEGESW.js} +1 -1
  89. package/{chunk-TDMJ2M6W.js → chunk-VFEEFGWW.js} +1 -1
  90. package/chunk-VVHTNAHQ.js +1 -0
  91. package/{chunk-KHP7E7JG.js → chunk-VYK2CQ72.js} +1 -1
  92. package/{chunk-R6XNFCQM.js → chunk-W24I5WPW.js} +1 -1
  93. package/{chunk-CLVUILX2.js → chunk-W4SAEISC.js} +12 -12
  94. package/chunk-WSZ5MU6V.js +1 -0
  95. package/{chunk-BOVEGMBL.js → chunk-XILGARZ5.js} +1 -1
  96. package/chunk-XJEZJFWN.js +1 -0
  97. package/chunk-XKCLERWG.js +1 -0
  98. package/chunk-XKI7WLHE.js +1 -0
  99. package/chunk-YDEVG4CR.js +1 -0
  100. package/{chunk-VJLO7GNT.js → chunk-YO23YVSC.js} +1 -1
  101. package/{chunk-Z3SHAW6W.js → chunk-YOUPD27G.js} +1 -1
  102. package/{chunk-ZHU3HOWQ.js → chunk-YRCXWYJC.js} +1 -1
  103. package/chunk-ZNIFAG4O.js +1 -0
  104. package/index.html +4 -4
  105. package/main-OTYR5DFR.js +1 -0
  106. package/package.json +1 -1
  107. package/{styles-XXVTW56A.css → styles-TTHIY3OR.css} +1 -1
  108. package/chunk-2QWAAI3V.js +0 -1
  109. package/chunk-3OJSEDLY.js +0 -1
  110. package/chunk-46XJU64Z.js +0 -1
  111. package/chunk-5RRPJBLN.js +0 -1
  112. package/chunk-7JGGV5FX.js +0 -1
  113. package/chunk-7TOJMYLE.js +0 -1
  114. package/chunk-C3N6HRIE.js +0 -1
  115. package/chunk-CGUMUBB7.js +0 -1
  116. package/chunk-DCKLQNGL.js +0 -1
  117. package/chunk-EJCLRSB2.js +0 -1
  118. package/chunk-I3BTHUK3.js +0 -160
  119. package/chunk-IL6G454L.js +0 -1
  120. package/chunk-IY6KCAQ4.js +0 -1
  121. package/chunk-K4ALA724.js +0 -1
  122. package/chunk-LRI7YFKN.js +0 -1
  123. package/chunk-MPHC4J2R.js +0 -1
  124. package/chunk-NHEN24Y3.js +0 -1
  125. package/chunk-NOZEL54G.js +0 -1
  126. package/chunk-NRULEUE7.js +0 -1
  127. package/chunk-ONMFMNUN.js +0 -129
  128. package/chunk-PDNXU4MC.js +0 -1
  129. package/chunk-R6NK3ROE.js +0 -1
  130. package/chunk-RQ52IUQY.js +0 -130
  131. package/chunk-SRNYKRLK.js +0 -1
  132. package/chunk-TOYTUB2K.js +0 -1
  133. package/chunk-U4SERSDK.js +0 -1
  134. package/chunk-UNWDCLFZ.js +0 -1
  135. package/chunk-UUZOSCEV.js +0 -7
  136. package/chunk-UWWFSGE7.js +0 -1
  137. package/chunk-VDBXI7BY.js +0 -1
  138. package/chunk-VJVWTOYU.js +0 -1
  139. package/chunk-WUPQR4WU.js +0 -1
  140. package/chunk-X26YDRRO.js +0 -1
  141. package/main-LKLXHNSP.js +0 -1
package/chunk-I3BTHUK3.js DELETED
@@ -1,160 +0,0 @@
1
- import{a as Pn,b as Mn}from"./chunk-DXIZC3FM.js";import{a as st}from"./chunk-XYU65DNE.js";import{a as Nn}from"./chunk-NRULEUE7.js";import{a as Fn,b as we,c as Ae}from"./chunk-KANHSSLO.js";import{a as kn,b as On}from"./chunk-ZHU3HOWQ.js";import"./chunk-Z3SHAW6W.js";import{a as Vn,b as Ln}from"./chunk-JZTK7BS7.js";import{a as Dn}from"./chunk-DCKLQNGL.js";import{a as En}from"./chunk-VJLO7GNT.js";import"./chunk-DJAICZNR.js";import{a as nt,b as it}from"./chunk-CZWWMQFD.js";import{a as rt,b as at,c as vn,d as Sn,i as Tn,j as wn,k as An}from"./chunk-CEZEYAWZ.js";import"./chunk-YVGWGEPX.js";import"./chunk-PDNXU4MC.js";import{a as Z}from"./chunk-YJ3CWPO4.js";import{a as E}from"./chunk-C3N6HRIE.js";import{b as fn}from"./chunk-W4KTL6Y6.js";import{a as un}from"./chunk-RNOSD5RO.js";import{a as bn,b as ot}from"./chunk-HFUW7PYZ.js";import"./chunk-WWWY3VE7.js";import"./chunk-35ER6BC7.js";import"./chunk-V4IY7RIP.js";import"./chunk-J6H5UCJR.js";import"./chunk-U75O34AW.js";import"./chunk-3RM5CDGW.js";import{a as tt,b as K}from"./chunk-7IPVVF6Y.js";import{f as yn,h as $}from"./chunk-RYHNURUZ.js";import{b as et,c as fe}from"./chunk-BX74ZLQG.js";import{a as re,b as ae}from"./chunk-CNLYDNON.js";import{a as W,b as gn,c as hn,e as xn,f as Cn,g as In}from"./chunk-FTI2QPWV.js";import{c as Qe,d as Wt,f as Yt}from"./chunk-BDJHC5O6.js";import{a as Ct,f as It,n as Xe,o as Je,p as dn,t as _n,u as yt,w as ie,x as oe}from"./chunk-LMI4DLB5.js";import"./chunk-W6LBFCQQ.js";import{$ as nn,Ba as sn,E as ft,Ea as ln,J as Xt,Ja as cn,L as Jt,Ma as Te,N as en,Na as Ne,Pa as mn,R as We,S as Ye,Va as pn,X as tn,Y as _t,b as te,c as de,e as U,ea as on,f as Ce,g as jt,ha as rn,i as L,j as je,k as Qt,l as Ie,la as an,o as ye,oa as gt,ra as ne,v as be,wa as ht,x as ve,xa as xt,y as Se}from"./chunk-3GHEXAAZ.js";import{a as Zt}from"./chunk-R6NK3ROE.js";import"./chunk-TDMJ2M6W.js";import{C as J,E as ee,F as B,M as V,c as Q,e as Ze,f as R,g as pt,h as Gt,l as Ut,m as N,n as ke}from"./chunk-DAQCANBV.js";import{c as ut,d as dt,f as Oe,h as Fe}from"./chunk-F2X3VGZZ.js";import{Ab as Pe,Ac as w,Bc as Kt,Cb as d,D as Be,Ga as b,J as $e,Jb as P,Jc as qt,Kb as l,Kc as zt,L as Nt,Mc as y,Nb as le,O as Vt,Ob as Me,Ub as a,Vb as r,Vc as ue,Wb as h,Wc as xe,X as D,Xb as ce,Yb as me,Yc as j,Z as S,Zc as Ht,_b as T,aa as Lt,ba as Ke,bb as Ee,c as Re,ca as Dt,cb as Rt,dc as v,ec as c,gb as m,ha as x,jc as ze,kc as pe,lc as H,mb as mt,mc as G,pa as _,pc as X,qa as g,qc as p,rc as A,s as z,sc as ge,t as Ft,ta as qe,uc as $t,vc as He,wb as O,wc as Ge,xb as Bt,xc as Ue,yc as he,za as Y,zc as F}from"./chunk-WCXWWANV.js";import{a as C,b as I}from"./chunk-YQFG5XE2.js";var Qn=["class","page"],Wn=n=>({id:n}),Yn=n=>["fa-solid",n];function Xn(n,s){if(n&1){let e=T();a(0,"div",4)(1,"a",5),p(2,"Cancel"),r(),a(3,"a",6),h(4,"i",7),p(5," Edit"),r(),a(6,"p-button",8),v("onClick",function(){_(e);let i=c();return g(i.onDelete())}),r(),a(7,"a",9),p(8,"Ledger"),r()()}if(n&2){let e,t=c();m(7),l("queryParams",w(1,Wn,(e=t.COAInfo())==null?null:e.id))}}function Jn(n,s){if(n&1&&h(0,"i",18),n&2){let e=s.checked;l("ngClass",w(1,Yn,e?"fa-check":"fa-xmark"))}}function ei(n,s){if(n&1){let e=T();a(0,"div",11)(1,"div",12)(2,"p-card")(3,"div",13)(4,"div",14)(5,"div",15),p(6,"Name"),r(),a(7,"div",16),p(8),r()(),a(9,"div",14)(10,"div",15),p(11,"Code"),r(),a(12,"div",16),p(13),r()(),a(14,"div",14)(15,"div",15),p(16,"Category"),r(),a(17,"div",16),p(18),r()(),a(19,"div",14)(20,"div",15),p(21,"Note"),r(),a(22,"div",16),p(23),r()(),a(24,"div",14)(25,"div",15),p(26,"Outlet"),r(),a(27,"div",16),p(28),r()(),a(29,"div",14)(30,"div",15),p(31,"Discontinued"),r(),a(32,"div",16)(33,"p-toggleswitch",17),v("onChange",function(i){_(e);let o=c(2);return g(o.onDiscontinued(i))}),d(34,Jn,1,3,"ng-template",null,2,y),r()()()()()()()}if(n&2){let e,t,i,o,u,f=c(2);m(8),A((e=f.COAInfo().name)!==null&&e!==void 0?e:"-"),m(5),A((t=f.COAInfo().code)!==null&&t!==void 0?t:"-"),m(5),A((i=f.COAInfo().category)!==null&&i!==void 0?i:"-"),m(5),A((o=f.COAInfo().note)!==null&&o!==void 0?o:"-"),m(5),A((u=f.COAInfo().outletName)!==null&&u!==void 0?u:"-"),m(5),l("ngModel",f.COAInfo().bin)}}function ti(n,s){if(n&1&&d(0,ei,36,6,"div",10),n&2){let e=c();l("ngIf",e.COAInfo())}}var Rn=(()=>{class n{constructor(){this.#e=x(Z),this.#t=x(J),this.router=x(ee),this.COAInfo=b(null),this.checked=b(!1)}#e;#t;ngOnInit(){this.#t.paramMap.pipe(E("params"),D(e=>this.#e.getChartAccountById(e.get("id"))),S(e=>this.COAInfo.set(e)),E("response")).subscribe()}onDelete(){if(!confirm("Are you sure you want to delete this Chart of Accounts?"))return;let t=[this.#t.snapshot.paramMap.get("id")];this.#e.deleteChartAccount(t).pipe(S(()=>{this.router.navigate(["/pages/chart-of-account/account"])})).subscribe()}onDiscontinued(e){this.#e.discountedChartAccounts(this.#t.snapshot.paramMap.get("id"),{Discontinued:e.checked}).subscribe()}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=O({type:n,selectors:[["app-coa-account-info",8,"page"]],attrs:Qn,decls:5,vars:0,consts:[["actionButton",""],["content",""],["handle",""],["pageTitle","Chart of Account Details"],[1,"d-flex","gap-2"],["routerLink","/pages/chart-of-account/account",1,"p-button","p-button-secondary","p-button-outlined"],["routerLink","edit",1,"p-button","p-button-secondary","p-button-outlined"],[1,"fa-solid","fa-pen-to-square"],["label","Delete","icon","fa-solid fa-trash","severity","secondary","variant","outlined",3,"onClick"],["routerLink","/pages/report/general-ledger",1,"p-button",3,"queryParams"],["class","row justify-content-center mt-3",4,"ngIf"],[1,"row","justify-content-center","mt-3"],[1,"col","col-lg-8"],[1,"d-flex","flex-column","row-gap-4"],[1,"row"],[1,"col","col-lg-3"],[1,"col"],[3,"onChange","ngModel"],[3,"ngClass"]],template:function(t,i){t&1&&(a(0,"app-main-panel",3),d(1,Xn,9,3,"ng-template",null,0,y)(3,ti,1,1,"ng-template",null,1,y),r())},dependencies:[N,Q,R,ve,U,je,Qe,V,B,$,K,tt,oe,ie,vn,En],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return n})();var se=(()=>{class n{constructor(){this.httpService=x(Zt)}fetchCOACategories(){return this.httpService.get("","api/ChartOfAccount/Category")}getCOACategoryByID(e){let t={params:e};return this.httpService.get("","api/ChartOfAccount/CategoryInfo",t)}renameCategory(e,t){return this.httpService.put("",`api/ChartOfAccount/RenameCategory/${e}`,t)}updateParentCategory(e,t){return this.httpService.put("",`api/ChartOfAccount/UpdateParentCategory/${e}`,t).pipe()}deleteCategory(e){return this.httpService.delete("",`api/ChartOfAccount/Category/${e}`)}submitCategory(e,t={}){return this.httpService.post("","api/ChartOfAccount/SubmitCategory",e,t)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=Ke({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var vt=n=>n?n.reduce((s,e)=>(s.push({label:e.label,data:e.data,key:e.key}),e.children&&e.children.length?s.push(...vt(e.children)):s.push({label:`${e.label} (no children)`,data:e.data,key:`${e.key}-no-children`}),s),[]):[];var St=(n,s,e)=>{let t=Math.ceil(e/s),i=(n-1)*s+1,o=Math.min(n*s,e);return{start:i,end:o,totalRecords:e,totalPages:t}};var ni={filter:{RowCount:20,PageNumber:1,CategoryID:"",Text:"",listOutletID:[],Discontinued:2},options:{entities:[],categories:[]},data:[],count:0,perPages:[{key:20,value:"20 per page"},{key:40,value:"40 per page"},{key:60,value:"60 per page"},{key:80,value:"80 per page"},{key:100,value:"100 per page"}]},Tt=gn(Cn(ni),In("ChartOfAccount"),hn(n=>({isAllChecked:j(()=>n.data().every(s=>s.checked)),checkedItems:j(()=>n.data().filter(s=>s.checked)),IDsChecked:j(()=>n.data().filter(s=>s.checked).map(s=>s.id)),categories:j(()=>vt(n.options.categories())),first:j(()=>{let{start:s}=St(n.filter().PageNumber,n.filter().RowCount,n.count());return s}),last:j(()=>{let{end:s}=St(n.filter().PageNumber,n.filter().RowCount,n.count());return s})})),xn(n=>{let s=x(Z),e=x(se),t={updateFilter(i){W(n,{filter:C({},i)})},checkedItem(i){if(Array.isArray(i))i.forEach(o=>{let u=n.data().map(f=>f.id===o.id?I(C({},f),{checked:!o.checked}):f);W(n,{data:u})});else{let o=i,u=n.data().map(f=>f.id===o.id?I(C({},f),{checked:!o.checked}):f);W(n,{data:u})}},checkAllCheckbox(){let i=n.data().map(o=>I(C({},o),{checked:!o.checked}));W(n,{data:i})},fetchChartOfAccount:nt(Re(Be(()=>!!n.filter()),Nt(300),Vt(),D(i=>s.getPaginatedChartAccounts(i).pipe(z(o=>I(C({},o),{data:o.data.map(u=>I(C({},u),{checked:!1}))})),it({next:o=>W(n,{data:o.data,count:o.count}),error:o=>{W(n,{data:[],count:0}),console.error(o)}}))))),fetchLoader:nt(Re(D(()=>s.getChartOfAccountLoader().pipe(it({next:i=>{W(n,{filter:I(C({},n.filter()),{RowCount:i.filter.rowCount,PageNumber:1,CategoryID:i.filter.categoryID||null,Text:"",listOutletID:[]}),options:i.options}),t.fetchChartOfAccount(n.filter)},error:i=>{console.error(i)}}))))),getCategories:nt(Re($e(()=>e.fetchCOACategories().pipe(it({next:i=>{W(n,{options:{entities:n.options.entities(),categories:i}})},error:i=>{console.error(i)}})))))};return t}));var ri=["class","page"],ai=()=>({height:"calc(100vh - 70px)"}),si=n=>["../account/",n],li=()=>["/pages/report/general-ledger"],ci=n=>({id:n}),mi=()=>({width:"100%"}),pi=()=>({scrollHeight:"200px"});function ui(n,s){if(n&1){let e=T();a(0,"p-button",14),v("onClick",function(){_(e);let i=c(2);return g(i.deleteCOA())}),r()}}function di(n,s){if(n&1){let e=T();a(0,"div",8),d(1,ui,1,0,"p-button",9),a(2,"p-button-group"),h(3,"p-button",10),a(4,"p-button",11),v("onClick",function(){_(e);let i=c();return g(i.onExport())}),r()(),a(5,"a",12),h(6,"i",13),p(7," Add"),r()()}if(n&2){let e=c();m(),l("ngIf",e.store.checkedItems().length)}}function fi(n,s){n&1&&(a(0,"tr")(1,"th",16),h(2,"p-tableHeaderCheckbox"),r(),a(3,"th"),p(4,"Code"),r(),a(5,"th"),p(6,"Name"),r(),a(7,"th"),p(8,"Category"),r(),a(9,"th"),p(10,"Outlet"),r(),a(11,"th",17),p(12,"Balance"),r()())}function _i(n,s){if(n&1&&(a(0,"tr")(1,"td"),h(2,"p-tableCheckbox",18),r(),a(3,"td"),p(4),r(),a(5,"td")(6,"a",19),p(7),r()(),a(8,"td"),p(9),r(),a(10,"td"),p(11),r(),a(12,"td",17)(13,"a",20),p(14),qt(15,"number"),r()()()),n&2){let e,t=s.$implicit;m(2),l("value",t),m(2),A(t.code),m(2),l("routerLink",w(11,si,t.id)),m(),A(t.name),m(2),A(t.category),m(2),A(t.outletName),m(2),l("routerLink",F(13,li))("queryParams",w(14,ci,t.id)),m(),A(zt(15,9,(e=t.balance)!==null&&e!==void 0?e:0))}}function gi(n,s){if(n&1&&p(0),n&2){let e=c(2);$t(" Showing ",e.store.first()," to ",e.store.last()," of ",e.store.count()," entries ")}}function hi(n,s){n&1&&(a(0,"tr")(1,"td",21)(2,"span"),p(3,"No records found."),r()()())}function xi(n,s){if(n&1){let e=T();a(0,"p-panel")(1,"p-table",15),v("onLazyLoad",function(i){_(e);let o=c();return g(o.loadData(i))})("onRowSelect",function(i){_(e);let o=c();return g(o.onRowSelect(i))})("onRowUnselect",function(i){_(e);let o=c();return g(o.onRowUnselect(i))})("onHeaderCheckboxToggle",function(i){_(e);let o=c();return g(o.onSelectAll(i))})("onPage",function(i){_(e);let o=c();return g(o.onPageChange(i))}),d(2,fi,13,0,"ng-template",null,3,y)(4,_i,16,16,"ng-template",null,4,y)(6,gi,1,3,"ng-template",null,5,y)(8,hi,4,0,"ng-template",null,6,y),r()()}if(n&2){let e=c();le(F(9,ai)),m(),l("lazy",!0)("value",e.store.data())("paginator",!0)("rows",e.store.filter().RowCount)("totalRecords",e.store.count())("scrollable",!0)("scrollHeight","calc(100vh - 142px)")}}function Ci(n,s){if(n&1){let e=T();a(0,"form",23)(1,"div",24)(2,"label",25),p(3,"Outlet"),r(),h(4,"p-multiselect",26),r(),a(5,"div",24)(6,"label",25),p(7,"Category"),r(),a(8,"p-treeselect",27),v("onFocus",function(){_(e);let i=c(2);return g(i.onCategoryFocus())}),r()(),a(9,"div",28)(10,"label",25),p(11,"Page Size"),r(),h(12,"input",29),r(),a(13,"div",28)(14,"label",25),p(15,"Discontinued"),r(),a(16,"div",30)(17,"div",31),h(18,"p-radiobutton",32),a(19,"label",33),p(20,"No"),r()(),a(21,"div",31),h(22,"p-radiobutton",34),a(23,"label",35),p(24,"Yes"),r()(),a(25,"div",31),h(26,"p-radiobutton",34),a(27,"label",35),p(28,"All"),r()()()()()}if(n&2){let e=c(2);l("formGroup",e.formFilter),m(4),l("showClear",!0)("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.options().entities),m(4),le(F(15,mi)),l("showClear",!0)("virtualScroll",!0)("virtualScrollItemSize",50)("virtualScrollOptions",F(16,pi))("options",e.categoryNodes()),m(10),l("value",0),m(4),l("value",1),m(4),l("value",2)}}function Ii(n,s){if(n&1&&d(0,Ci,29,17,"form",22),n&2){let e=c();l("ngIf",e.formFilter)}}var $n=(()=>{class n{ngOnInit(){this.store.fetchLoader(),console.log(this.store.filter().RowCount),this.generateFilterForm()}#e;constructor(){this.routeInfo=Kn,this.store=x(Tt),this.#e=x(Z),this.modalService=x(Wt),this.dialogVisible=b(!1),this.categoryNodes=b([]),this.fb=x(be),this.isDialogFilterVisible=b(!1),this.generateFilterForm()}generateFilterForm(){this.formFilter=this.fb.group({outletID:this.fb.control([]),categoryID:this.fb.control(null),pageSize:this.fb.control(this.store.filter().RowCount),discontinued:this.fb.control(2)})}onPageChange(e){console.log("Page changed to: ",e),this.store.updateFilter(I(C({},this.store.filter()),{PageNumber:e.first/e.rows+1}))}onCategoryFocus(){this.#e.getCachedCategoriesOptions().pipe(S(e=>this.categoryNodes.set(e))).subscribe()}onRowSelect(e){console.log("Row select event: ",e),this.store.checkedItem(e.data)}onRowUnselect(e){console.log("Row unselect event: ",e),this.store.checkedItem(e.data)}onSelectAll(e){console.log("Select all event: ",e),this.store.checkAllCheckbox()}loadData(e){console.log("Lazy load event: ",e)}onSearch(e){console.log("Search text: ",e),this.store.updateFilter(I(C({},this.store.filter()),{Text:e}))}updateFilter(e,t){this.store.updateFilter(I(C({},this.store.filter()),{[e]:t}))}checkAllCheckBox(){this.store.checkAllCheckbox()}checkedItem(e){this.store.checkedItem(e)}deleteCOA(){confirm("Are you sure you want to delete selected Chart of Accounts?")&&this.#e.deleteChartAccount(this.store.IDsChecked()).pipe(E("response"),S(e=>{console.log("Delete COA Response: ",e),this.store.updateFilter(C({},this.store.filter()))})).subscribe()}onSearchEvent(e){this.store.updateFilter(I(C({},this.store.filter()),{Text:e.trim()}))}onFilterEvent(){this.dialogVisible.update(e=>!e)}onFilterOKEvent(){let{categoryID:e,pageSize:t,outletID:i,discontinued:o}=this.formFilter.value;this.store.updateFilter(I(C({},this.store.filter()),{listOutletID:i,CategoryID:e?e.key:"",RowCount:+t,Discontinued:o})),this.isDialogFilterVisible.update(u=>!u)}onExport(){let e=I(C({},this.store.filter()),{ExportPageNumber:1,ExportRowCount:1e4});this.#e.exportChartOfAccounts(e).pipe(S(t=>{let i=t.headers;console.log("All headers:",i.keys());let o=i.get("Content-Disposition"),u=i.get("content-disposition"),f=o??u,M="download.csv";if(f){let q=f.match(/filename\*?=(?:UTF-8'')?"?([^;\r\n"]+)/i);q&&q[1]&&(M=decodeURIComponent(q[1].replace(/"/g,"")))}let k=t.body;Nn(k,M,k.type)})).subscribe()}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=O({type:n,selectors:[["app-cash-of-account",8,"page"]],features:[he([Tt])],attrs:ri,decls:7,vars:3,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Chart of Account",3,"search","isDialogFilterVisibleChange","filterEmitted","filterConfirmed","isSearchableInput","isDialogFilterVisible","isFilterable"],[1,"d-flex","gap-2"],["icon","fa-solid fa-trash","label","Delete","severity","danger",3,"onClick",4,"ngIf"],["routerLink","import","severity","secondary","outlined","","label","Import","icon","fa-solid fa-download"],["outlined","","severity","secondary","label","Export","icon","fa-solid fa-upload",3,"onClick"],["routerLink","add",1,"p-button"],[1,"fa-solid","fa-plus"],["icon","fa-solid fa-trash","label","Delete","severity","danger",3,"onClick"],["dataKey","id","styleClass","d-flex flex-column justify-content-between h-100",1,"",3,"onLazyLoad","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","onPage","lazy","value","paginator","rows","totalRecords","scrollable","scrollHeight"],[2,"width","4rem"],[1,"text-end"],[3,"value"],[1,"link-primary",3,"routerLink"],[1,"link","link-primary",3,"routerLink","queryParams"],["colspan","6"],["class","d-flex flex-column row-gap-3",3,"formGroup",4,"ngIf"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column","position-relative"],["for",""],["appendTo","body","formControlName","outletID","optionLabel","name","optionValue","id","placeholder","Select an Outlet",3,"showClear","virtualScroll","virtualScrollItemSize","options"],["containerStyleClass","w-100","filter","","filterBy","label","appendTo","body","formControlName","categoryID","optionLabel","label","optionValue","key","placeholder","Select a Category",1,"w-100",3,"onFocus","showClear","virtualScroll","virtualScrollItemSize","virtualScrollOptions","options"],[1,"d-flex","flex-column"],["formControlName","pageSize","type","text","pInputText",""],[1,"d-flex","flex-wrap","gap-4"],[1,"d-flex","align-items-center","gap-2"],["name","discontinued","formControlName","discontinued","inputId","ingredient1",3,"value"],["for","ingredient1",1,"m-0"],["name","discontinued","formControlName","discontinued","inputId","ingredient2",3,"value"],["for","ingredient2",1,"m-0"]],template:function(t,i){if(t&1){let o=T();a(0,"app-main-panel",7),v("search",function(f){return _(o),g(i.onSearchEvent(f))}),Ue("isDialogFilterVisibleChange",function(f){return _(o),Ge(i.isDialogFilterVisible,f)||(i.isDialogFilterVisible=f),g(f)}),v("filterEmitted",function(){return _(o),g(i.onFilterEvent())})("filterConfirmed",function(){return _(o),g(i.onFilterOKEvent())}),d(1,di,8,1,"ng-template",null,0,y)(3,xi,10,10,"ng-template",null,1,y)(5,Ii,1,1,"ng-template",null,2,y),r()}t&2&&(l("isSearchableInput",!0),He("isDialogFilterVisible",i.isDialogFilterVisible),l("isFilterable",!0))},dependencies:[N,R,Ut,$,Yt,Mn,Pn,st,ve,Qt,te,U,Ce,V,B,Se,Ie,ye,Qe,An,Sn,Tn,wn,K,yn,oe,ie,ot,Je,Xe,fe,On,kn,Ae,we,ae,re,at,rt],styles:[".p-card{height:100%} .p-card .p-card-body{height:inherit} .p-card .p-card-body .p-card-content{height:inherit}"],changeDetection:0})}}return n})();var bi=["class","page"],vi=()=>["../../"],At=n=>({"ng-invalid ng-dirty":n}),Si=n=>({"ng-dirty ng-invalid":n});function Ti(n,s){if(n&1){let e=T();a(0,"div",5)(1,"a",6),p(2,"Cancel"),r(),a(3,"p-button",7),v("onClick",function(){_(e);let i=c();return g(i.onSubmit())}),r()()}n&2&&(m(),l("routerLink",F(1,vi)))}function wi(n,s){n&1&&(a(0,"div",27),p(1," Name is required "),r())}function Ai(n,s){if(n&1&&(a(0,"div"),d(1,wi,2,0,"div",26),r()),n&2){let e=c(2);m(),l("ngIf",e.form.controls.Name.errors.required)}}function Ei(n,s){n&1&&(a(0,"div",28)(1,"p"),p(2," If you assign an outlet for this product, it is only visible for users who has access to that outlet. "),r()())}function Pi(n,s){if(n&1&&(a(0,"span",29),p(1),r()),n&2){let e=s.$implicit;l("pTooltip",e.name),m(),ge(" ",e.name," ")}}function Mi(n,s){n&1&&(a(0,"div",27),p(1," Code is required "),r())}function ki(n,s){if(n&1&&(a(0,"div"),d(1,Mi,2,0,"div",26),r()),n&2){let e=c(2);m(),l("ngIf",e.form.controls.Code.errors.required)}}function Oi(n,s){if(n&1&&p(0),n&2){let e=s.$implicit;ge(" ",(e==null?null:e.fullLabel)||(e==null?null:e.label)||"Select a category"," ")}}function Fi(n,s){n&1&&(a(0,"div",27),p(1," Category is required "),r())}function Ni(n,s){if(n&1&&(a(0,"div"),d(1,Fi,2,0,"div",26),r()),n&2){let e=c(2);m(),l("ngIf",e.form.controls.Category.errors.required)}}function Vi(n,s){n&1&&(a(0,"div",27),p(1," Note is required "),r())}function Li(n,s){if(n&1&&(a(0,"div"),d(1,Vi,2,0,"div",26),r()),n&2){let e=c(2);m(),l("ngIf",e.form.controls.Note.errors.required)}}function Di(n,s){n&1&&(a(0,"div",27),p(1," Note is required "),r())}function Ri(n,s){if(n&1&&(a(0,"div"),d(1,Di,2,0,"div",26),r()),n&2){let e=c(3);m(),l("ngIf",e.form.controls.Note.errors.required)}}function Bi(n,s){if(n&1&&(a(0,"div",12)(1,"div",13)(2,"label",14),p(3,"Discontinued"),r(),a(4,"div",30)(5,"div",31),h(6,"p-radiobutton",32),a(7,"label",33),p(8,"No"),r()(),a(9,"div",31),h(10,"p-radiobutton",34),a(11,"label",35),p(12,"Yes"),r()()(),d(13,Ri,2,1,"div",16),r()()),n&2){let e=c(2);m(6),l("value",!1),m(4),l("value",!0),m(3),l("ngIf",e.form.controls.Note.errors)}}function $i(n,s){if(n&1&&(a(0,"p-panel",8)(1,"div",9)(2,"div",10)(3,"div",11)(4,"div",12)(5,"div",13)(6,"label",14),p(7,"Name"),r(),h(8,"input",15),d(9,Ai,2,1,"div",16),r()(),a(10,"div",12)(11,"div",13)(12,"div")(13,"label",14),p(14,"Outlet"),r(),h(15,"p-button",17),d(16,Ei,3,0,"ng-template",null,2,y),r(),a(18,"p-select",18),d(19,Pi,2,2,"ng-template",null,3,y),r()()(),a(21,"div",12)(22,"div",13)(23,"label",14),p(24,"Code"),r(),h(25,"input",19),d(26,ki,2,1,"div",16),r()(),a(27,"div",20)(28,"div",21)(29,"label",14),p(30,"Category"),r(),a(31,"p-treeselect",22),d(32,Oi,1,1,"ng-template",23),r(),d(33,Ni,2,1,"div",16),r()(),a(34,"div",12)(35,"div",13)(36,"label",14),p(37,"Note"),r(),h(38,"textarea",24),d(39,Li,2,1,"div",16),r()(),d(40,Bi,14,3,"div",25),r()()()()),n&2){let e=X(17),t=c();m(),l("formGroup",t.form),m(7),l("ngClass",w(15,At,t.form.controls.Name.invalid&&(t.form.controls.Name.dirty||t.form.controls.Name.touched))),m(),l("ngIf",t.form.controls.Name.invalid&&(t.form.controls.Name.dirty||t.form.controls.Name.touched)),m(6),l("pTooltip",e)("rounded",!0)("text",!0),m(3),l("options",t.outlets()),m(7),l("ngClass",w(17,At,t.form.controls.Code.invalid&&(t.form.controls.Code.dirty||t.form.controls.Code.touched))),m(),l("ngIf",t.form.controls.Code.invalid&&(t.form.controls.Code.dirty||t.form.controls.Code.touched)),m(5),l("options",t.categoryOptions())("ngClass",w(19,Si,t.form.controls.Category.invalid&&(t.form.controls.Category.dirty||t.form.controls.Category.touched))),m(2),l("ngIf",t.form.controls.Category.invalid&&(t.form.controls.Category.dirty||t.form.controls.Category.touched)),m(5),l("ngClass",w(21,At,t.form.controls.Note.invalid&&(t.form.controls.Note.dirty||t.form.controls.Note.touched))),m(),l("ngIf",t.form.controls.Note.errors),m(),l("ngIf",t.hasIdParam&&!t.coa_info().form.bin)}}var Et=(()=>{class n{constructor(){this.route=x(J),this.coa_service=x(Z),this.coa_info=b(null),this.fb=x(be),this.isEdit=b(!1),this.categoryOptions=b([]),this.router=x(ee),this.outlets=j(()=>this.coa_info()?this.coa_info().options.entities:[])}findParenChilds(e,t){function i(o,u=null){for(let f of o){if(f.key===t)return{parent:u,child:f};if(f.children){let M=i(f.children,f);if(M)return M}}return null}return i(e)}generateForm(e){this.form=this.fb.group({ID:new L(e.id||""),Name:new L(e.name||"",[de.required]),Code:new L(e.code||"",[de.required]),Note:new L(e.note||"",[]),Balance:new L(e.balance||0),Outlet:new L(e.outletID||""),AccessType:new L(e.accessTypeID||0),Category:new L(null,[de.required]),Bin:new L(e.bin||!1)})}ngOnInit(){this.generateForm({id:"",name:"",code:"",note:"",balance:0,outletID:"",accessTypeID:0,categoryID:null,bin:!1}),this.fetchLoader(),this.fetchCategoryOptions()}fetchLoader(){this.route.paramMap.pipe($e(e=>{if(e.has("id")){this.isEdit.set(!0);let t=e.get("id");return this.coa_service.getChartAccountFormById(t)}else return this.coa_service.getChartAccountForm()}),E("response"),z(e=>I(C({},e),{form:I(C({},e.form),{categoryID:e.form.categoryID==="00000000-0000-0000-0000-000000000000"?"":e.form.categoryID})})),S(e=>{this.coa_info.set(e),this.generateForm(e.form)})).subscribe()}get hasIdParam(){return this.route.snapshot.paramMap.has("id")}onSubmit(){if(this.form.invalid){this.form.markAllAsTouched();return}let{AccessType:e,Balance:t,Category:i,Code:o,Name:u,Note:f,Outlet:M}=this.form.value,k;this.hasIdParam?k={id:this.coa_info().form.id,categoryID:i.key,name:u,bin:this.form.value.Bin||!1,code:o,note:f,outletID:M||null,balance:t,accessTypeID:e}:k={id:this.coa_info().form.id,categoryID:i.key,bin:this.form.value.Bin||!1,name:u,code:o,note:f,outletID:M||null,balance:t,accessTypeID:e},this.hasIdParam?this.coa_service.submitChartAccount(k).pipe(E("submitChartAccount"),S(()=>{this.form.reset(),this.router.navigate(["/pages/chart-of-account/account"])})).subscribe():this.coa_service.submitChartAccount(k).pipe(E("submitChartAccount"),S(()=>{this.form.reset(),this.router.navigate(["/pages/chart-of-account/account"])})).subscribe()}fetchCategoryOptions(){this.coa_service.fetchCategoryOptions().pipe(E("response"),S(e=>{this.categoryOptions.set(e);let t=this.findParenChilds(this.categoryOptions(),this.coa_info()?.form?.categoryID);this.form.controls.Category.setValue(t?.child)})).subscribe()}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=O({type:n,selectors:[["app-coa-account-form",8,"page"]],attrs:bi,decls:5,vars:1,consts:[["actionButton",""],["content",""],["tooltipContent",""],["item",""],["pageTitle","Chart Of Account Form",3,"hasMainWrapperPadding"],[1,"d-flex","gap-2"],["type","button",1,"p-button","p-button-secondary","p-button-outlined",3,"routerLink"],["label","Submit",3,"onClick"],["styleClass","rounded-2"],[1,"row","justify-content-center",3,"formGroup"],[1,"col"],[1,"row","row-gap-2"],[1,"col","col-lg-6"],[1,"d-flex","flex-column"],["for",""],["size","small","formControlName","Name","type","text","pInputText","",3,"ngClass"],[4,"ngIf"],["icon","fa-solid fa-circle-info",3,"pTooltip","rounded","text"],["appendTo","body","formControlName","Outlet","optionLabel","name","optionValue","id","placeholder","Select Outlet",3,"options"],["size","small","formControlName","Code","type","text","pInputText","",3,"ngClass"],[1,"co","col-lg-6"],[1,"form-group","d-flex","flex-column"],["formControlName","Category","containerStyleClass","w-full","placeholder","Select a Category",1,"w-full",3,"options","ngClass"],["pTemplate","value"],["pSize","small","rows","5","cols","30","pTextarea","","formControlName","Note",3,"ngClass"],["class","col col-lg-6",4,"ngIf"],["class","invalid-feedback text-danger d-block",4,"ngIf"],[1,"invalid-feedback","text-danger","d-block"],[1,"flex","items-center"],[1,"d-inline-block","text-truncate",2,"max-width","200px",3,"pTooltip"],[1,"d-flex","flex-wrap","gap-4"],[1,"d-flex","align-items-center","gap-2"],["name","Bin","formControlName","Bin","inputId","ingredient1",3,"value"],["for","ingredient1",1,"m-0"],["name","Bin","formControlName","Bin","inputId","ingredient2",3,"value"],["for","ingredient2",1,"m-0"]],template:function(t,i){t&1&&(a(0,"app-main-panel",4),d(1,Ti,4,2,"ng-template",null,0,y)(3,$i,41,23,"ng-template",null,1,y),r()),t&2&&l("hasMainWrapperPadding",!0)},dependencies:[$,Se,te,U,Ce,Ie,ye,st,N,Q,R,V,B,Ae,we,Te,K,Je,Xe,Ln,Vn,ot,bn,fe,et,oe,ie,ae,re,at,rt],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .p-treeselect{width:100%!important}"],changeDetection:0})}}return n})();var Ki=["sublist"],qi=(n,s)=>({"p-contextmenu-submenu":n,"p-contextmenu-root-list":s}),zi=()=>({"p-contextmenu-item-link":!0}),Hn=()=>({class:"p-contextmenu-submenu-icon"}),Hi=()=>({exact:!1}),Gi=n=>({"p-contextmenu-item-link":!0,"p-disabled":n}),Ui=n=>({$implicit:n});function Zi(n,s){if(n&1&&h(0,"li",8),n&2){let e=c().$implicit,t=c(2);le(t.getItemProp(e,"style")),l("ngClass",t.getSeparatorItemClass(e)),P("id",t.getItemId(e))("data-pc-section","separator")}}function ji(n,s){if(n&1&&h(0,"span",19),n&2){let e=c(4).$implicit,t=c(2);l("ngClass",t.getItemProp(e,"icon"))("ngStyle",t.getItemProp(e,"iconStyle")),P("data-pc-section","icon")("aria-hidden",!0)("tabindex",-1)}}function Qi(n,s){if(n&1&&(a(0,"span",20),p(1),r()),n&2){let e=c(4).$implicit,t=c(2);P("data-pc-section","label"),m(),ge(" ",t.getItemLabel(e)," ")}}function Wi(n,s){if(n&1&&h(0,"span",21),n&2){let e=c(4).$implicit,t=c(2);l("innerHTML",t.getItemLabel(e),Ee),P("data-pc-section","label")}}function Yi(n,s){if(n&1&&h(0,"p-badge",22),n&2){let e=c(4).$implicit,t=c(2);l("styleClass",t.getItemProp(e,"badgeStyleClass"))("value",t.getItemProp(e,"badge"))}}function Xi(n,s){n&1&&h(0,"AngleRightIcon"),n&2&&(Me("p-contextmenu-submenu-icon"),P("data-pc-section","submenuicon")("aria-hidden",!0))}function Ji(n,s){}function eo(n,s){n&1&&d(0,Ji,0,0,"ng-template",25),n&2&&l("data-pc-section","submenuicon")("aria-hidden",!0)}function to(n,s){if(n&1&&(ce(0),d(1,Xi,1,4,"AngleRightIcon",23)(2,eo,1,2,null,24),me()),n&2){let e=c(6);m(),l("ngIf",!e.contextMenu.submenuIconTemplate&&!e.contextMenu._submenuIconTemplate),m(),l("ngTemplateOutlet",e.contextMenu.submenuIconTemplate||e.contextMenu._submenuIconTemplate)("ngTemplateOutletContext",F(3,Hn))}}function no(n,s){if(n&1&&(a(0,"a",15),d(1,ji,1,5,"span",16)(2,Qi,2,2,"span",17)(3,Wi,1,2,"ng-template",null,2,y)(5,Yi,1,2,"p-badge",18)(6,to,3,4,"ng-container",11),r()),n&2){let e=X(4),t=c(3).$implicit,i=c(2);l("target",i.getItemProp(t,"target"))("ngClass",F(12,zi)),P("href",i.getItemProp(t,"url"),Rt)("aria-hidden",!0)("data-automationid",i.getItemProp(t,"automationId"))("data-pc-section","action")("tabindex",-1),m(),l("ngIf",i.getItemProp(t,"icon")),m(),l("ngIf",i.getItemProp(t,"escape"))("ngIfElse",e),m(3),l("ngIf",i.getItemProp(t,"badge")),m(),l("ngIf",i.isItemGroup(t))}}function io(n,s){if(n&1&&h(0,"span",19),n&2){let e=c(4).$implicit,t=c(2);l("ngClass",t.getItemProp(e,"icon"))("ngStyle",t.getItemProp(e,"iconStyle")),P("data-pc-section","icon")("aria-hidden",!0)("tabindex",-1)}}function oo(n,s){if(n&1&&(a(0,"span",20),p(1),r()),n&2){let e=c(4).$implicit,t=c(2);P("data-pc-section","label"),m(),ge(" ",t.getItemLabel(e)," ")}}function ro(n,s){if(n&1&&h(0,"span",21),n&2){let e=c(4).$implicit,t=c(2);l("innerHTML",t.getItemLabel(e),Ee),P("data-pc-section","label")}}function ao(n,s){if(n&1&&h(0,"p-badge",22),n&2){let e=c(4).$implicit,t=c(2);l("styleClass",t.getItemProp(e,"badgeStyleClass"))("value",t.getItemProp(e,"badge"))}}function so(n,s){n&1&&h(0,"AngleRightIcon"),n&2&&(Me("p-contextmenu-submenu-icon"),P("data-pc-section","submenuicon")("aria-hidden",!0))}function lo(n,s){}function co(n,s){n&1&&d(0,lo,0,0,"ng-template",25),n&2&&l("data-pc-section","submenuicon")("aria-hidden",!0)}function mo(n,s){if(n&1&&(ce(0),d(1,so,1,4,"AngleRightIcon",23)(2,co,1,2,null,24),me()),n&2){let e=c(6);m(),l("ngIf",!e.contextMenu.submenuIconTemplate&&!e.contextMenu._submenuIconTemplate),m(),l("ngTemplateOutlet",!e.contextMenu.submenuIconTemplate||!e.contextMenu._submenuIconTemplate)("ngTemplateOutletContext",F(3,Hn))}}function po(n,s){if(n&1&&(a(0,"a",26),d(1,io,1,5,"span",16)(2,oo,2,2,"span",17)(3,ro,1,2,"ng-template",null,2,y)(5,ao,1,2,"p-badge",18)(6,mo,3,4,"ng-container",11),r()),n&2){let e=X(4),t=c(3).$implicit,i=c(2);l("routerLink",i.getItemProp(t,"routerLink"))("queryParams",i.getItemProp(t,"queryParams"))("routerLinkActiveOptions",i.getItemProp(t,"routerLinkActiveOptions")||F(20,Hi))("target",i.getItemProp(t,"target"))("ngClass",w(21,Gi,i.getItemProp(t,"disabled")))("fragment",i.getItemProp(t,"fragment"))("queryParamsHandling",i.getItemProp(t,"queryParamsHandling"))("preserveFragment",i.getItemProp(t,"preserveFragment"))("skipLocationChange",i.getItemProp(t,"skipLocationChange"))("replaceUrl",i.getItemProp(t,"replaceUrl"))("state",i.getItemProp(t,"state")),P("data-automationid",i.getItemProp(t,"automationId"))("tabindex",-1)("aria-hidden",!0)("data-pc-section","action"),m(),l("ngIf",i.getItemProp(t,"icon")),m(),l("ngIf",i.getItemProp(t,"escape"))("ngIfElse",e),m(3),l("ngIf",i.getItemProp(t,"badge")),m(),l("ngIf",i.isItemGroup(t))}}function uo(n,s){if(n&1&&(ce(0),d(1,no,7,13,"a",13)(2,po,7,23,"a",14),me()),n&2){let e=c(2).$implicit,t=c(2);m(),l("ngIf",!t.getItemProp(e,"routerLink")),m(),l("ngIf",t.getItemProp(e,"routerLink"))}}function fo(n,s){}function _o(n,s){n&1&&d(0,fo,0,0,"ng-template")}function go(n,s){if(n&1&&(ce(0),d(1,_o,1,0,null,24),me()),n&2){let e=c(2).$implicit,t=c(2);m(),l("ngTemplateOutlet",t.itemTemplate)("ngTemplateOutletContext",w(2,Ui,e.item))}}function ho(n,s){if(n&1){let e=T();a(0,"p-contextmenu-sub",27),v("itemClick",function(i){_(e);let o=c(4);return g(o.itemClick.emit(i))})("itemMouseEnter",function(i){_(e);let o=c(4);return g(o.onItemMouseEnter(i))}),r()}if(n&2){let e=c(2).$implicit,t=c(2);l("items",e.items)("itemTemplate",t.itemTemplate)("menuId",t.menuId)("visible",t.isItemActive(e)&&t.isItemGroup(e))("activeItemPath",t.activeItemPath)("focusedItemId",t.focusedItemId)("level",t.level+1)}}function xo(n,s){if(n&1){let e=T();a(0,"li",9,1)(2,"div",10),v("click",function(i){_(e);let o=c().$implicit,u=c(2);return g(u.onItemClick(i,o))})("mouseenter",function(i){_(e);let o=c().$implicit,u=c(2);return g(u.onItemMouseEnter({$event:i,processedItem:o}))}),d(3,uo,3,2,"ng-container",11)(4,go,2,4,"ng-container",11),r(),d(5,ho,1,7,"p-contextmenu-sub",12),r()}if(n&2){let e=c(),t=e.$implicit,i=e.index,o=c(2);Me(o.getItemProp(t,"styleClass")),l("ngStyle",o.getItemProp(t,"style"))("ngClass",o.getItemClass(t))("tooltipOptions",o.getItemProp(t,"tooltipOptions")),P("id",o.getItemId(t))("data-pc-section","menuitem")("data-p-highlight",o.isItemActive(t))("data-p-focused",o.isItemFocused(t))("data-p-disabled",o.isItemDisabled(t))("aria-label",o.getItemLabel(t))("aria-disabled",o.isItemDisabled(t)||void 0)("aria-haspopup",o.isItemGroup(t)&&!o.getItemProp(t,"to")?"menu":void 0)("aria-expanded",o.isItemGroup(t)?o.isItemActive(t):void 0)("aria-level",o.level+1)("aria-setsize",o.getAriaSetSize())("aria-posinset",o.getAriaPosInset(i)),m(2),P("data-pc-section","content"),m(),l("ngIf",!o.itemTemplate),m(),l("ngIf",o.itemTemplate),m(),l("ngIf",o.isItemVisible(t)&&o.isItemGroup(t))}}function Co(n,s){if(n&1&&d(0,Zi,1,5,"li",6)(1,xo,6,21,"li",7),n&2){let e=s.$implicit,t=c(2);l("ngIf",t.isItemVisible(e)&&t.getItemProp(e,"separator")),m(),l("ngIf",t.isItemVisible(e)&&!t.getItemProp(e,"separator"))}}function Io(n,s){if(n&1){let e=T();a(0,"ul",4,0),v("@overlayAnimation.start",function(i){_(e);let o=X(1),u=c();return g(u.onEnter(i,o))})("keydown",function(i){_(e);let o=c();return g(o.menuKeydown.emit(i))})("focus",function(i){_(e);let o=c();return g(o.menuFocus.emit(i))})("blur",function(i){_(e);let o=c();return g(o.menuBlur.emit(i))}),d(2,Co,2,2,"ng-template",5),r()}if(n&2){let e=c();l("ngClass",Kt(10,qi,!e.root,e.root))("@overlayAnimation",e.visible)("tabindex",e.tabindex),P("id",e.menuId+"_list")("aria-label",e.ariaLabel)("aria-labelledBy",e.ariaLabelledBy)("aria-activedescendant",e.focusedItemId)("aria-orientation","vertical")("data-pc-section","menu"),m(2),l("ngForOf",e.items)}}var yo=["item"],bo=["submenuicon"],vo=["rootmenu"],So=["container"],To=n=>({"p-contextmenu p-component":!0,"p-contextmenu-mobile":n}),wo=()=>({value:"visible"});function Ao(n,s){if(n&1){let e=T();a(0,"div",3,0),v("@overlayAnimation.start",function(i){_(e);let o=c();return g(o.onOverlayAnimationStart(i))})("@overlayAnimation.done",function(i){_(e);let o=c();return g(o.onOverlayAnimationEnd(i))}),a(2,"p-contextmenu-sub",4,1),v("itemClick",function(i){_(e);let o=c();return g(o.onItemClick(i))})("menuFocus",function(i){_(e);let o=c();return g(o.onMenuFocus(i))})("menuBlur",function(i){_(e);let o=c();return g(o.onMenuBlur(i))})("menuKeydown",function(i){_(e);let o=c();return g(o.onKeyDown(i))})("itemMouseEnter",function(i){_(e);let o=c();return g(o.onItemMouseEnter(i))}),r()()}if(n&2){let e=c();Me(e.styleClass),l("ngClass",w(20,To,e.queryMatches))("ngStyle",e.style)("@overlayAnimation",F(22,wo)),P("data-pc-section","root")("data-pc-name","contextmenu")("id",e.id),m(2),l("root",!0)("items",e.processedItems)("itemTemplate",e.itemTemplate||e._itemTemplate)("menuId",e.id)("tabindex",e.disabled?-1:e.tabindex)("ariaLabel",e.ariaLabel)("ariaLabelledBy",e.ariaLabelledBy)("baseZIndex",e.baseZIndex)("autoZIndex",e.autoZIndex)("visible",e.submenuVisible())("focusedItemId",e.focused?e.focusedItemId:void 0)("activeItemPath",e.activeItemPath())}}var Eo=({dt:n})=>`
2
- .p-contextmenu {
3
- position: absolute;
4
- background: ${n("contextmenu.background")};
5
- color: ${n("contextmenu.color")};
6
- border: 1px solid ${n("contextmenu.border.color")};
7
- border-radius: ${n("contextmenu.border.radius")};
8
- box-shadow: ${n("contextmenu.shadow")};
9
- min-width: 12.5rem;
10
- }
11
-
12
- .p-contextmenu-root-list,
13
- .p-contextmenu-submenu {
14
- margin: 0;
15
- padding: ${n("contextmenu.list.padding")};
16
- list-style: none;
17
- outline: 0 none;
18
- display: flex;
19
- flex-direction: column;
20
- gap: ${n("contextmenu.list.gap")};
21
- }
22
-
23
- .p-contextmenu-submenu {
24
- position: absolute;
25
- display: flex;
26
- flex-direction: column;
27
- min-width: 100%;
28
- z-index: 1;
29
- background: ${n("contextmenu.background")};
30
- color: ${n("contextmenu.color")};
31
- border: 1px solid ${n("contextmenu.border.color")};
32
- border-radius: ${n("contextmenu.border.radius")};
33
- box-shadow: ${n("contextmenu.shadow")};
34
- }
35
-
36
- .p-contextmenu-item {
37
- position: relative;
38
- }
39
-
40
- .p-contextmenu-item-content {
41
- transition: background ${n("contextmenu.transition.duration")}, color ${n("contextmenu.transition.duration")};
42
- border-radius: ${n("contextmenu.item.border.radius")};
43
- color: ${n("contextmenu.item.color")};
44
- }
45
-
46
- .p-contextmenu-item-link {
47
- cursor: pointer;
48
- display: flex;
49
- align-items: center;
50
- text-decoration: none;
51
- overflow: hidden;
52
- position: relative;
53
- color: inherit;
54
- padding: ${n("contextmenu.item.padding")};
55
- gap: ${n("contextmenu.item.gap")};
56
- user-select: none;
57
- }
58
-
59
- .p-contextmenu-item-label {
60
- line-height: 1;
61
- }
62
-
63
- .p-contextmenu-item-icon {
64
- color: ${n("contextmenu.item.icon.color")};
65
- }
66
-
67
- .p-contextmenu-submenu-icon {
68
- color: ${n("contextmenu.submenu.icon.color")};
69
- margin-left: auto;
70
- font-size: ${n("contextmenu.submenu.icon.size")};
71
- width: ${n("contextmenu.submenu.icon.size")};
72
- height: ${n("contextmenu.submenu.icon.size")};
73
- }
74
-
75
- .p-contextmenu-submenu-icon:dir(rtl) {
76
- margin-left: 0;
77
- margin-right: auto;
78
- }
79
-
80
- .p-contextmenu-item.p-focus > .p-contextmenu-item-content {
81
- color: ${n("contextmenu.item.focus.color")};
82
- background: ${n("contextmenu.item.focus.background")};
83
- }
84
-
85
- .p-contextmenu-item.p-focus > .p-contextmenu-item-content .p-contextmenu-item-icon {
86
- color: ${n("contextmenu.item.icon.focus.color")};
87
- }
88
-
89
- .p-contextmenu-item.p-focus > .p-contextmenu-item-content .p-contextmenu-submenu-icon {
90
- color: ${n("contextmenu.submenu.icon.focus.color")};
91
- }
92
-
93
- .p-contextmenu-item:not(.p-disabled) > .p-contextmenu-item-content:hover {
94
- color: ${n("contextmenu.item.focus.color")};
95
- background: ${n("contextmenu.item.focus.background")};
96
- }
97
-
98
- .p-contextmenu-item:not(.p-disabled) > .p-contextmenu-item-content:hover .p-contextmenu-item-icon {
99
- color: ${n("contextmenu.item.icon.focus.color")};
100
- }
101
-
102
- .p-contextmenu-item:not(.p-disabled) > .p-contextmenu-item-content:hover .p-contextmenu-submenu-icon {
103
- color: ${n("contextmenu.submenu.icon.focus.color")};
104
- }
105
-
106
- .p-contextmenu-item-active > .p-contextmenu-item-content {
107
- color: ${n("contextmenu.item.active.color")};
108
- background: ${n("contextmenu.item.active.background")};
109
- }
110
-
111
- .p-contextmenu-item-active > .p-contextmenu-item-content .p-contextmenu-item-icon {
112
- color: ${n("contextmenu.item.icon.active.color")};
113
- }
114
-
115
- .p-contextmenu-item-active > .p-contextmenu-item-content .p-contextmenu-submenu-icon {
116
- color: ${n("contextmenu.submenu.icon.active.color")};
117
- }
118
-
119
- .p-contextmenu-separator {
120
- border-top: 1px solid ${n("contextmenu.separator.border.color")};
121
- }
122
-
123
- .p-contextmenu-enter-from,
124
- .p-contextmenu-leave-active {
125
- opacity: 0;
126
- }
127
-
128
- .p-contextmenu-enter-active {
129
- transition: opacity 250ms;
130
- }
131
-
132
- .p-contextmenu-mobile .p-contextmenu-submenu {
133
- position: static;
134
- box-shadow: none;
135
- border: 0 none;
136
- padding-left: ${n("tieredmenu.submenu.mobile.indent")};
137
- padding-right: 0;
138
- }
139
-
140
- .p-contextmenu-mobile .p-contextmenu-submenu-icon {
141
- transition: transform 0.2s;
142
- transform: rotate(90deg);
143
- }
144
-
145
- .p-contextmenu-mobile .p-contextmenu-item-active > .p-contextmenu-item-content .p-contextmenu-submenu-icon {
146
- transform: rotate(-90deg);
147
- }
148
-
149
- /* For PrimeNG */
150
- .p-contextmenu-submenu-icon.p-iconwrapper {
151
- margin-left: auto;
152
- }
153
-
154
- .p-contextmenu-submenu-icon.p-iconwrapper:dir(rtl) {
155
- margin-left: 0;
156
- margin-right: auto;
157
- }
158
- `,Po={root:"p-contextmenu p-component",rootList:"p-contextmenu-root-list",item:({instance:n,processedItem:s})=>["p-contextmenu-item",{"p-contextmenu-item-active":n.isItemActive(s),"p-focus":n.isItemFocused(s),"p-disabled":n.isItemDisabled(s)}],itemContent:"p-contextmenu-item-content",itemLink:"p-contextmenu-item-link",itemIcon:"p-contextmenu-item-icon",itemLabel:"p-contextmenu-item-label",submenuIcon:"p-contextmenu-submenu-icon",submenu:"p-contextmenu-submenu",separator:"p-contextmenu-separator"},zn=(()=>{class n extends pn{name="contextmenu";theme=Eo;classes=Po;static \u0275fac=(()=>{let e;return function(i){return(e||(e=qe(n)))(i||n)}})();static \u0275prov=Ke({token:n,factory:n.\u0275fac})}return n})();var Mo=(()=>{class n extends Ct{contextMenu;visible=!1;items;itemTemplate;root=!1;autoZIndex=!0;baseZIndex=0;popup;menuId;ariaLabel;ariaLabelledBy;level=0;focusedItemId;activeItemPath;tabindex=0;itemClick=new Y;itemMouseEnter=new Y;menuFocus=new Y;menuBlur=new Y;menuKeydown=new Y;sublistViewChild;constructor(e){super(),this.contextMenu=e}getItemProp(e,t,i=null){return e&&e.item?xt(e.item[t],i):void 0}getItemId(e){return e.item&&e.item?.id?e.item.id:`${this.menuId}_${e.key}`}getItemKey(e){return this.getItemId(e)}getItemClass(e){return I(C({},this.getItemProp(e,"class")),{"p-contextmenu-item":!0,"p-contextmenu-item-active":this.isItemActive(e),"p-focus":this.isItemFocused(e),"p-disabled":this.isItemDisabled(e)})}getItemLabel(e){return this.getItemProp(e,"label")}getSeparatorItemClass(e){return I(C({},this.getItemProp(e,"class")),{"p-contextmenu-separator":!0})}getAriaSetSize(){return this.items.filter(e=>this.isItemVisible(e)&&!this.getItemProp(e,"separator")).length}getAriaPosInset(e){return e-this.items.slice(0,e).filter(t=>this.isItemVisible(t)&&this.getItemProp(t,"separator")).length+1}isItemVisible(e){return this.getItemProp(e,"visible")!==!1}isItemActive(e){if(this.activeItemPath)return this.activeItemPath.some(t=>t.key===e.key)}isItemDisabled(e){return this.getItemProp(e,"disabled")}isItemFocused(e){return this.focusedItemId===this.getItemId(e)}isItemGroup(e){return ne(e.items)}onItemMouseEnter(e){let{event:t,processedItem:i}=e;this.itemMouseEnter.emit({originalEvent:t,processedItem:i})}onItemClick(e,t){this.getItemProp(t,"command",{originalEvent:e,item:t.item}),this.itemClick.emit({originalEvent:e,processedItem:t,isFocus:!0})}onEnter(e,t){if(e.fromState==="void"&&e.toState){let i=e.element;this.position(i)}}position(e){let t=e.parentElement.parentElement,i=nn(e.parentElement.parentElement),o=ft(),u=e.offsetParent?e.offsetWidth:_t(e),f=Xt(t.children[0]);e.style.top="0px",parseInt(i.left,10)+f+u>o.width-en()?e.style.left=-1*u+"px":e.style.left=f+"px"}static \u0275fac=function(t){return new(t||n)(mt(Lt(()=>ct)))};static \u0275cmp=O({type:n,selectors:[["p-contextMenuSub"],["p-contextmenu-sub"]],viewQuery:function(t,i){if(t&1&&pe(Ki,5),t&2){let o;H(o=G())&&(i.sublistViewChild=o.first)}},inputs:{visible:[2,"visible","visible",ue],items:"items",itemTemplate:"itemTemplate",root:[2,"root","root",ue],autoZIndex:[2,"autoZIndex","autoZIndex",ue],baseZIndex:[2,"baseZIndex","baseZIndex",xe],popup:[2,"popup","popup",ue],menuId:"menuId",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",level:[2,"level","level",xe],focusedItemId:"focusedItemId",activeItemPath:"activeItemPath",tabindex:[2,"tabindex","tabindex",xe]},outputs:{itemClick:"itemClick",itemMouseEnter:"itemMouseEnter",menuFocus:"menuFocus",menuBlur:"menuBlur",menuKeydown:"menuKeydown"},features:[Pe],decls:1,vars:1,consts:[["sublist",""],["listItem",""],["htmlLabel",""],["role","menu",3,"ngClass","tabindex","keydown","focus","blur",4,"ngIf"],["role","menu",3,"keydown","focus","blur","ngClass","tabindex"],["ngFor","",3,"ngForOf"],["role","separator",3,"style","ngClass",4,"ngIf"],["role","menuitem","pTooltip","",3,"ngStyle","ngClass","class","tooltipOptions",4,"ngIf"],["role","separator",3,"ngClass"],["role","menuitem","pTooltip","",3,"ngStyle","ngClass","tooltipOptions"],[1,"p-contextmenu-item-content",3,"click","mouseenter"],[4,"ngIf"],[3,"items","itemTemplate","menuId","visible","activeItemPath","focusedItemId","level","itemClick","itemMouseEnter",4,"ngIf"],["pRipple","",3,"target","ngClass",4,"ngIf"],["pRipple","",3,"routerLink","queryParams","routerLinkActiveOptions","target","ngClass","fragment","queryParamsHandling","preserveFragment","skipLocationChange","replaceUrl","state",4,"ngIf"],["pRipple","",3,"target","ngClass"],["class","p-contextmenu-item-icon",3,"ngClass","ngStyle",4,"ngIf"],["class","p-contextmenu-item-label",4,"ngIf","ngIfElse"],[3,"styleClass","value",4,"ngIf"],[1,"p-contextmenu-item-icon",3,"ngClass","ngStyle"],[1,"p-contextmenu-item-label"],[1,"p-contextmenu-item-label",3,"innerHTML"],[3,"styleClass","value"],[3,"class",4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"data-pc-section","aria-hidden"],["pRipple","",3,"routerLink","queryParams","routerLinkActiveOptions","target","ngClass","fragment","queryParamsHandling","preserveFragment","skipLocationChange","replaceUrl","state"],[3,"itemClick","itemMouseEnter","items","itemTemplate","menuId","visible","activeItemPath","focusedItemId","level"]],template:function(t,i){t&1&&d(0,Io,3,13,"ul",3),t&2&&l("ngIf",i.root?!0:i.visible)},dependencies:[n,N,Q,Ze,R,Gt,pt,V,B,dn,fe,et,un,yt,_n,Ne],encapsulation:2,data:{animation:[ut("overlayAnimation",[Fe(":enter",[Oe({opacity:0})]),Fe(":leave",[Oe({opacity:0})])])]}})}return n})(),ct=(()=>{class n extends Ct{overlayService;set model(e){this._model=e,this._processedItems=this.createProcessedItems(this._model||[])}get model(){return this._model}triggerEvent="contextmenu";target;global;style;styleClass;appendTo;autoZIndex=!0;baseZIndex=0;id;breakpoint="960px";ariaLabel;ariaLabelledBy;pressDelay=500;onShow=new Y;onHide=new Y;rootmenu;containerViewChild;container;outsideClickListener;resizeListener;triggerEventListener;documentClickListener;documentTriggerListener;touchEndListener;pageX;pageY;visible=b(!1);relativeAlign;window;focused=!1;activeItemPath=b([]);focusedItemInfo=b({index:-1,level:0,parentKey:"",item:null});submenuVisible=b(!1);searchValue="";searchTimeout;_processedItems;_model;pressTimer;matchMediaListener;query;queryMatches;_componentStyle=x(zn);get visibleItems(){let e=this.activeItemPath().find(t=>t.key===this.focusedItemInfo().parentKey);return e?e.items:this.processedItems}get processedItems(){return(!this._processedItems||!this._processedItems.length)&&(this._processedItems=this.createProcessedItems(this.model||[])),this._processedItems}get focusedItemId(){let e=this.focusedItemInfo();return e.item&&e.item?.id?e.item.id:e.index!==-1?`${this.id}${ne(e.parentKey)?"_"+e.parentKey:""}_${e.index}`:null}constructor(e){super(),this.overlayService=e,Ht(()=>{let t=this.activeItemPath();ne(t)?this.bindGlobalListeners():this.visible()||this.unbindGlobalListeners()})}ngOnInit(){super.ngOnInit(),this.id=this.id||ln("pn_id_"),this.bindMatchMediaListener(),this.bindTriggerEventListener()}isMobile(){return rn()||on()}bindTriggerEventListener(){ke(this.platformId)&&(this.triggerEventListener||(this.isMobile()?this.global?(this.triggerEventListener=this.renderer.listen(this.document,"touchstart",this.onTouchStart.bind(this)),this.touchEndListener=this.renderer.listen(this.document,"touchend",this.onTouchEnd.bind(this))):this.target&&(this.triggerEventListener=this.renderer.listen(this.target,"touchstart",this.onTouchStart.bind(this)),this.touchEndListener=this.renderer.listen(this.target,"touchend",this.onTouchEnd.bind(this))):this.global?this.triggerEventListener=this.renderer.listen(this.document,this.triggerEvent,e=>{this.show(e)}):this.target&&(this.triggerEventListener=this.renderer.listen(this.target,this.triggerEvent,e=>{this.show(e)}))))}bindGlobalListeners(){if(ke(this.platformId)){if(!this.documentClickListener){let e=this.el?this.el.nativeElement.ownerDocument:"document";this.documentClickListener=this.renderer.listen(e,"click",t=>{this.containerViewChild.nativeElement.offsetParent&&this.isOutsideClicked(t)&&!t.ctrlKey&&t.button!==2&&this.triggerEvent!=="click"&&this.hide()}),this.documentTriggerListener=this.renderer.listen(e,this.triggerEvent,t=>{this.containerViewChild.nativeElement.offsetParent&&this.isOutsideClicked(t)&&this.hide()})}this.resizeListener||(this.resizeListener=this.renderer.listen(this.document.defaultView,"resize",e=>{this.hide()}))}}itemTemplate;submenuIconTemplate;templates;_submenuIconTemplate;_itemTemplate;ngAfterContentInit(){this.templates?.forEach(e=>{switch(e.getType()){case"submenuicon":this._submenuIconTemplate=e.template;break;case"item":this._itemTemplate=e.template;break;default:this._itemTemplate=e.template;break}})}createProcessedItems(e,t=0,i={},o=""){let u=[];return e&&e.forEach((f,M)=>{let k=(o!==""?o+"_":"")+M,q={item:f,index:M,level:t,key:k,parent:i,parentKey:o};q.items=this.createProcessedItems(f.items,t+1,q,k),u.push(q)}),u}bindMatchMediaListener(){if(ke(this.platformId)&&!this.matchMediaListener){let e=window.matchMedia(`(max-width: ${this.breakpoint})`);this.query=e,this.queryMatches=e.matches,this.matchMediaListener=()=>{this.queryMatches=e.matches},e.addEventListener("change",this.matchMediaListener)}}unbindMatchMediaListener(){this.matchMediaListener&&(this.query.removeEventListener("change",this.matchMediaListener),this.matchMediaListener=null)}getItemProp(e,t){return e?xt(e[t]):void 0}getProccessedItemLabel(e){return e?this.getItemLabel(e.item):void 0}getItemLabel(e){return this.getItemProp(e,"label")}isProcessedItemGroup(e){return e&&ne(e.items)}isSelected(e){return this.activeItemPath().some(t=>t.key===e.key)}isValidSelectedItem(e){return this.isValidItem(e)&&this.isSelected(e)}isValidItem(e){return!!e&&!this.isItemDisabled(e.item)&&!this.isItemSeparator(e.item)}isItemDisabled(e){return this.getItemProp(e,"disabled")}isItemSeparator(e){return this.getItemProp(e,"separator")}isItemMatched(e){return this.isValidItem(e)&&this.getProccessedItemLabel(e).toLocaleLowerCase().startsWith(this.searchValue.toLocaleLowerCase())}isProccessedItemGroup(e){return e&&ne(e.items)}onItemClick(e){let{processedItem:t}=e,i=this.isProcessedItemGroup(t);if(this.isSelected(t)){let{index:u,key:f,level:M,parentKey:k,item:q}=t;this.activeItemPath.set(this.activeItemPath().filter(De=>f!==De.key&&f.startsWith(De.key))),this.focusedItemInfo.set({index:u,level:M,parentKey:k,item:q}),Ye(this.rootmenu.sublistViewChild.nativeElement)}else i?this.onItemChange(e):this.hide()}onItemMouseEnter(e){this.onItemChange(e,"hover")}onKeyDown(e){let t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Space":this.onSpaceKey(e);break;case"Enter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"PageDown":case"PageUp":case"Backspace":case"ShiftLeft":case"ShiftRight":break;default:!t&&sn(e.key)&&this.searchItems(e,e.key);break}}onArrowDownKey(e){let t=this.focusedItemInfo().index!==-1?this.findNextItemIndex(this.focusedItemInfo().index):this.findFirstFocusedItemIndex();this.changeFocusedItemIndex(e,t),e.preventDefault()}onArrowRightKey(e){let t=this.visibleItems[this.focusedItemInfo().index];this.isProccessedItemGroup(t)&&(this.onItemChange({originalEvent:e,processedItem:t}),this.focusedItemInfo.set({index:-1,parentKey:t.key,item:t.item}),this.searchValue="",this.onArrowDownKey(e)),e.preventDefault()}onArrowUpKey(e){if(e.altKey){if(this.focusedItemInfo().index!==-1){let t=this.visibleItems[this.focusedItemInfo().index];!this.isProccessedItemGroup(t)&&this.onItemChange({originalEvent:e,processedItem:t})}this.hide(),e.preventDefault()}else{let t=this.focusedItemInfo().index!==-1?this.findPrevItemIndex(this.focusedItemInfo().index):this.findLastFocusedItemIndex();this.changeFocusedItemIndex(e,t),e.preventDefault()}}onArrowLeftKey(e){let t=this.visibleItems[this.focusedItemInfo().index],i=this.activeItemPath().find(f=>f.key===t.parentKey);gt(t.parent)||(this.focusedItemInfo.set({index:-1,parentKey:i?i.parentKey:"",item:t.item}),this.searchValue="",this.onArrowDownKey(e));let u=this.activeItemPath().filter(f=>f.parentKey!==this.focusedItemInfo().parentKey);this.activeItemPath.set(u),e.preventDefault()}onHomeKey(e){this.changeFocusedItemIndex(e,this.findFirstItemIndex()),e.preventDefault()}onEndKey(e){this.changeFocusedItemIndex(e,this.findLastItemIndex()),e.preventDefault()}onSpaceKey(e){this.onEnterKey(e)}onEscapeKey(e){this.hide();let t=this.findVisibleItem(this.findFirstFocusedItemIndex()),i=this.focusedItemInfo();this.focusedItemInfo.set(I(C({},i),{index:this.findFirstFocusedItemIndex(),item:t.item})),e.preventDefault()}onTabKey(e){if(this.focusedItemInfo().index!==-1){let t=this.visibleItems[this.focusedItemInfo().index];!this.isProccessedItemGroup(t)&&this.onItemChange({originalEvent:e,processedItem:t})}this.hide()}onEnterKey(e){if(this.focusedItemInfo().index!==-1){let t=We(this.rootmenu.el.nativeElement,`li[id="${`${this.focusedItemId}`}"]`),i=t&&We(t,'a[data-pc-section="action"]');i?i.click():t&&t.click();let o=this.visibleItems[this.focusedItemInfo().index];if(!this.isProccessedItemGroup(o)){let f=this.focusedItemInfo();this.focusedItemInfo.set(I(C({},f),{index:this.findFirstFocusedItemIndex()}))}}e.preventDefault()}onItemChange(e,t){let{processedItem:i,isFocus:o}=e;if(gt(i))return;let{index:u,key:f,level:M,parentKey:k,items:q}=i,De=ne(q),kt=this.activeItemPath().filter(Ot=>Ot.parentKey!==k&&Ot.parentKey!==f);De&&(kt.push(i),this.submenuVisible.set(!0)),this.focusedItemInfo.set({index:u,level:M,parentKey:k,item:i.item}),o&&Ye(this.rootmenu.sublistViewChild.nativeElement),!(t==="hover"&&this.queryMatches)&&this.activeItemPath.set(kt)}onMenuFocus(e){this.focused=!0;let t=this.focusedItemInfo().index!==-1?this.focusedItemInfo():{index:-1,level:0,parentKey:"",item:null};this.focusedItemInfo.set(t)}onMenuBlur(e){this.focused=!1,this.focusedItemInfo.set({index:-1,level:0,parentKey:"",item:null}),this.searchValue=""}onOverlayAnimationStart(e){switch(e.toState){case"visible":this.container=e.element,this.position(),this.moveOnTop(),this.appendOverlay(),this.bindGlobalListeners(),Ye(this.rootmenu.sublistViewChild.nativeElement);break}}onOverlayAnimationEnd(e){switch(e.toState){case"void":this.onOverlayHide();break}}appendOverlay(){this.appendTo&&(this.appendTo==="body"?this.renderer.appendChild(this.document.body,this.containerViewChild.nativeElement):Jt(this.appendTo,this.containerViewChild.nativeElement))}moveOnTop(){this.autoZIndex&&this.containerViewChild&&It.set("menu",this.containerViewChild.nativeElement,this.baseZIndex+this.config.zIndex.menu)}onOverlayHide(){this.unbindGlobalListeners(),this.cd.destroyed||(this.target=null),this.container&&this.autoZIndex&&It.clear(this.container),this.container=null}onTouchStart(e){this.pressTimer=setTimeout(()=>{this.show(e)},this.pressDelay)}onTouchEnd(){clearTimeout(this.pressTimer)}hide(){this.visible.set(!1),this.onHide.emit(),this.activeItemPath.set([]),this.focusedItemInfo.set({index:-1,level:0,parentKey:"",item:null})}toggle(e){this.visible()?this.hide():this.show(e)}show(e){this.activeItemPath.set([]),this.focusedItemInfo.set({index:-1,level:0,parentKey:"",item:null}),this.pageX=e.pageX,this.pageY=e.pageY,this.onShow.emit(),this.visible()?this.position():this.visible.set(!0),e.stopPropagation(),e.preventDefault()}position(){let e=this.pageX+1,t=this.pageY+1,i=this.containerViewChild.nativeElement.offsetParent?this.containerViewChild.nativeElement.offsetWidth:_t(this.containerViewChild.nativeElement),o=this.containerViewChild.nativeElement.offsetParent?this.containerViewChild.nativeElement.offsetHeight:tn(this.containerViewChild.nativeElement),u=ft();e+i-this.document.scrollingElement.scrollLeft>u.width&&(e-=i),t+o-this.document.scrollingElement.scrollTop>u.height&&(t-=o),e<this.document.scrollingElement.scrollLeft&&(e=this.document.scrollingElement.scrollLeft),t<this.document.scrollingElement.scrollTop&&(t=this.document.scrollingElement.scrollTop),this.containerViewChild.nativeElement.style.left=e+"px",this.containerViewChild.nativeElement.style.top=t+"px"}searchItems(e,t){this.searchValue=(this.searchValue||"")+t;let i=-1,o=!1;return this.focusedItemInfo().index!==-1?(i=this.visibleItems.slice(this.focusedItemInfo().index).findIndex(u=>this.isItemMatched(u)),i=i===-1?this.visibleItems.slice(0,this.focusedItemInfo().index).findIndex(u=>this.isItemMatched(u)):i+this.focusedItemInfo().index):i=this.visibleItems.findIndex(u=>this.isItemMatched(u)),i!==-1&&(o=!0),i===-1&&this.focusedItemInfo().index===-1&&(i=this.findFirstFocusedItemIndex()),i!==-1&&this.changeFocusedItemIndex(e,i),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.searchValue="",this.searchTimeout=null},500),o}findVisibleItem(e){return ne(this.visibleItems)?this.visibleItems[e]:null}findLastFocusedItemIndex(){let e=this.findSelectedItemIndex();return e<0?this.findLastItemIndex():e}findLastItemIndex(){return ht(this.visibleItems,e=>this.isValidItem(e))}findPrevItemIndex(e){let t=e>0?ht(this.visibleItems.slice(0,e),i=>this.isValidItem(i)):-1;return t>-1?t:e}findNextItemIndex(e){let t=e<this.visibleItems.length-1?this.visibleItems.slice(e+1).findIndex(i=>this.isValidItem(i)):-1;return t>-1?t+e+1:e}findFirstFocusedItemIndex(){let e=this.findSelectedItemIndex();return e<0?this.findFirstItemIndex():e}findFirstItemIndex(){return this.visibleItems.findIndex(e=>this.isValidItem(e))}findSelectedItemIndex(){return this.visibleItems.findIndex(e=>this.isValidSelectedItem(e))}changeFocusedItemIndex(e,t){let i=this.findVisibleItem(t),o=this.focusedItemInfo();o.index!==t&&(this.focusedItemInfo.set(I(C({},o),{index:t,item:i.item})),this.scrollInView())}scrollInView(e=-1){let t=e!==-1?`${this.id}_${e}`:this.focusedItemId,i=We(this.rootmenu.el.nativeElement,`li[id="${t}"]`);i&&i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"nearest"})}bindResizeListener(){ke(this.platformId)&&(this.resizeListener||(this.resizeListener=this.renderer.listen(this.document.defaultView,"resize",e=>{this.hide()})))}isOutsideClicked(e){return!(this.containerViewChild.nativeElement.isSameNode(e.target)||this.containerViewChild.nativeElement.contains(e.target))}unbindResizeListener(){this.resizeListener&&(this.resizeListener(),this.resizeListener=null)}unbindGlobalListeners(){this.documentClickListener&&(this.documentClickListener(),this.documentClickListener=null),this.documentTriggerListener&&(this.documentTriggerListener(),this.documentTriggerListener=null),this.resizeListener&&(this.resizeListener(),this.resizeListener=null),this.touchEndListener&&(this.touchEndListener(),this.touchEndListener=null)}unbindTriggerEventListener(){this.triggerEventListener&&(this.triggerEventListener(),this.triggerEventListener=null)}removeAppendedElements(){this.appendTo&&this.containerViewChild&&(this.appendTo==="body"?this.renderer.removeChild(this.document.body,this.containerViewChild.nativeElement):an(this.containerViewChild.nativeElement,this.appendTo))}ngOnDestroy(){this.unbindGlobalListeners(),this.unbindTriggerEventListener(),this.unbindMatchMediaListener(),this.removeAppendedElements(),super.ngOnDestroy()}static \u0275fac=function(t){return new(t||n)(mt(cn))};static \u0275cmp=O({type:n,selectors:[["p-contextMenu"],["p-contextmenu"],["p-context-menu"]],contentQueries:function(t,i,o){if(t&1&&(ze(o,yo,4),ze(o,bo,4),ze(o,Te,4)),t&2){let u;H(u=G())&&(i.itemTemplate=u.first),H(u=G())&&(i.submenuIconTemplate=u.first),H(u=G())&&(i.templates=u)}},viewQuery:function(t,i){if(t&1&&(pe(vo,5),pe(So,5)),t&2){let o;H(o=G())&&(i.rootmenu=o.first),H(o=G())&&(i.containerViewChild=o.first)}},inputs:{model:"model",triggerEvent:"triggerEvent",target:"target",global:[2,"global","global",ue],style:"style",styleClass:"styleClass",appendTo:"appendTo",autoZIndex:[2,"autoZIndex","autoZIndex",ue],baseZIndex:[2,"baseZIndex","baseZIndex",xe],id:"id",breakpoint:"breakpoint",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",pressDelay:[2,"pressDelay","pressDelay",xe]},outputs:{onShow:"onShow",onHide:"onHide"},features:[he([zn]),Pe],decls:1,vars:1,consts:[["container",""],["rootmenu",""],[3,"ngClass","class","ngStyle",4,"ngIf"],[3,"ngClass","ngStyle"],[3,"itemClick","menuFocus","menuBlur","menuKeydown","itemMouseEnter","root","items","itemTemplate","menuId","tabindex","ariaLabel","ariaLabelledBy","baseZIndex","autoZIndex","visible","focusedItemId","activeItemPath"]],template:function(t,i){t&1&&d(0,Ao,4,23,"div",2),t&2&&l("ngIf",i.visible())},dependencies:[N,Q,R,pt,Mo,V,fe,yt,Ne],encapsulation:2,data:{animation:[ut("overlayAnimation",[Fe(":enter",[Oe({opacity:0}),dt("250ms")]),Fe(":leave",[dt(".1s linear",Oe({opacity:0}))])])]},changeDetection:0})}return n})(),Gn=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Bt({type:n});static \u0275inj=Dt({imports:[ct,Ne,Ne]})}return n})();var Oo=["editInput"],Fo=["tree"],No=["class","page"],Vo=()=>({height:"calc(100vh - 70px)"});function Lo(n,s){n&1&&(a(0,"a",6),h(1,"i",7),p(2," Add"),r())}function Do(n,s){if(n&1){let e=T();a(0,"input",14,4),Ue("ngModelChange",function(i){let o=_(e).$implicit;return Ge(o.label,i)||(o.label=i),g(i)}),v("keydown",function(i){_(e);let o=c(2);return g(o.handleEditKeydown(i))})("blur",function(i){_(e);let o=c(2);return g(o.onNodeEditBlur(i))}),r()}if(n&2){let e=s.$implicit;He("ngModel",e.label)}}function Ro(n,s){if(n&1){let e=T();a(0,"div",8)(1,"div",9)(2,"p-panel",10)(3,"p-tree",11,2),v("onNodeContextMenuSelect",function(i){_(e);let o=c();return g(o.onNodeContextMenuSelect(i))})("onNodeSelect",function(i){_(e);let o=c();return g(o.onNodeSelect(i))})("onNodeUnselect",function(i){_(e);let o=c();return g(o.onNodeUnselect(i))})("onNodeDrop",function(i){_(e);let o=c();return g(o.onNodeDrop(i))}),d(5,Do,2,1,"ng-template",12),r(),h(6,"p-contextmenu",13,3),r()()()}if(n&2){let e=X(7),t=c();m(2),le(F(14,Vo)),l("showHeader",!1),m(),l("virtualScroll",!0)("virtualScrollItemSize",40)("scrollHeight","calc(100vh - 110px)")("value",t.categoryTree())("contextMenu",e)("selection",t.selectedCategory)("draggableNodes",!0)("droppableNodes",!0)("propagateSelectionUp",!1)("propagateSelectionDown",!1),m(3),l("model",t.contextMenuItems())}}var Un=(()=>{class n{constructor(){this._coaTypesService=x(se),this._router=x(ee),this.contextMenuItems=b([]),this.categoryTree=b([]),this.selectedCategory=null,this._shouldAutoFocus=b(!1)}ngOnInit(){this._loadCategories().subscribe(),this._initializeContextMenuItems(),this.expandAllNodes()}ngAfterViewChecked(){this.selectedCategory&&!this._shouldAutoFocus()&&this.editInputRef&&(this.editInputRef.nativeElement.focus(),this.editInputRef.nativeElement.select(),this._shouldAutoFocus.set(!0))}_loadCategories(){return this._coaTypesService.fetchCOACategories().pipe(E("COA Categories"),S(e=>{this.categoryTree.set(e),this.expandAllNodes()}))}_assignTreeIcons(e){return e.map(t=>{let i=!!t.children?.length;return I(C({},t),{icon:void 0,expandedIcon:i?"fa-solid fa-folder-open":void 0,collapsedIcon:i?"fa-solid fa-folder":"fa-solid fa-file",children:i?this._assignTreeIcons(t.children):[]})})}_initializeContextMenuItems(){this.contextMenuItems.set([{label:"Add",icon:"fa-light fa-plus",disabled:!1,command:()=>this._createChildCategory()},{label:"Edit",icon:"fa-light fa-pen-to-square",disabled:!1,command:()=>this._setSelectedNodeToEditMode()},{label:"Delete",icon:"fa-light fa-trash",disabled:!1,command:()=>this._deleteSelectedCategory()},{label:"Properties",icon:"fa-light fa-file",disabled:!1,command:()=>{this._router.navigate(["/pages/chart-of-account/coa-types/info"],{queryParams:{ID:this.selectedCategory?.key}})}}])}_findNodeByKey(e){return this.treeComponent.getNodeWithKey(e,this.categoryTree())??null}_setSelectedNodeToEditMode(){let e=this._findNodeByKey(this.selectedCategory?.key);e&&(this.selectedCategory=e,e.type="edit")}_createChildCategory(){this.selectedCategory?.parent?.key&&this._coaTypesService.submitCategory({Name:"New Child Node",ParentID:this.selectedCategory.key,Code:"",Note:""}).pipe(D(e=>this._loadCategories().pipe(z(()=>e))),S(e=>{let t=this._findNodeByKey(e.id);t&&(this.selectedCategory=t,this._shouldAutoFocus.set(!1),t.type="edit")}),E("Created COA Node")).subscribe()}_deleteSelectedCategory(){this.selectedCategory?.key&&this._coaTypesService.deleteCategory(this.selectedCategory.key).pipe(D(()=>this._loadCategories())).subscribe()}renameNode(e,t=this.selectedCategory){this._coaTypesService.renameCategory(t.key,{Name:e}).pipe(D(()=>this._loadCategories())).subscribe()}onNodeSelect(e){this.selectedCategory=e.node,this._shouldAutoFocus.set(!1),e.node.children?.length&&(e.node.icon="fa-solid fa-folder-open")}onNodeUnselect(e){e.node.children?.length&&(e.node.icon="fa-solid fa-folder")}onNodeContextMenuSelect(e){this.selectedCategory=e.node;let t=["Asset","Liability","Equity","Revenue","Expense"];e.node.parent?t.includes(e.node.label)?this.contextMenuItems.set(this.contextMenuItems().map(i=>["Edit","Delete"].includes(i.label)?I(C({},i),{disabled:!0}):I(C({},i),{disabled:!1}))):this.contextMenuItems.set(this.contextMenuItems().map(i=>I(C({},i),{disabled:!1}))):this.contextMenuItems.set(this.contextMenuItems().map(i=>i.label==="Add"?I(C({},i),{disabled:!0}):I(C({},i),{disabled:!1})))}onNodeDrop(e){let{dragNode:t,dropNode:i}=e;this._coaTypesService.updateParentCategory(t.key,{ParentID:i.key}).pipe(S(()=>this._loadCategories())).subscribe()}onNodeEditBlur(e){let t=e.target;this.renameNode(t.value);let i=this._findNodeByKey(this.selectedCategory?.key);i&&delete i.type}handleEditKeydown(e){let t=e.target;if([" ","Enter"].includes(e.key)&&e.stopPropagation(),e.key==="Enter"){this.renameNode(t.value);let i=this._findNodeByKey(this.selectedCategory?.key);i&&(delete i.type,this.treeComponent.updateSerializedValue?.())}}expandAllNodes(){this.categoryTree().forEach(e=>this._expandRecursive(e,!0))}collapseAllNodes(){this.categoryTree().forEach(e=>this._expandRecursive(e,!1))}_expandRecursive(e,t){e.expanded=t,e.children?.forEach(i=>this._expandRecursive(i,t))}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=O({type:n,selectors:[["app-coa-type",8,"page"]],viewQuery:function(t,i){if(t&1&&(pe(Oo,5),pe(Fo,5)),t&2){let o;H(o=G())&&(i.editInputRef=o.first),H(o=G())&&(i.treeComponent=o.first)}},features:[he([mn])],attrs:No,decls:5,vars:0,consts:[["actionButton",""],["content",""],["tree",""],["cm",""],["editInput",""],["pageTitle",`Chart of Accounts Category
159
- `],["routerLink","add",1,"p-button"],[1,"fa-solid","fa-plus"],[1,"row","justify-content-center"],[1,"col"],[3,"showHeader"],["selectionMode","single","draggableScope","self","droppableScope","self",3,"onNodeContextMenuSelect","onNodeSelect","onNodeUnselect","onNodeDrop","virtualScroll","virtualScrollItemSize","scrollHeight","value","contextMenu","selection","draggableNodes","droppableNodes","propagateSelectionUp","propagateSelectionDown"],["pTemplate","edit"],["appendTo","body",3,"model"],["type","text",1,"form-control",3,"ngModelChange","keydown","blur","ngModel"]],template:function(t,i){t&1&&(a(0,"app-main-panel",5),d(1,Lo,3,0,"ng-template",null,0,y)(3,Ro,8,15,"ng-template",null,1,y),r())},dependencies:[$,Fn,V,B,Gn,ct,Te,N,ve,te,U,je,K,fn,ae,re],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return n})();var Bo=["class","page"],Pt=n=>({"is-invalid":n}),$o=n=>({"ng-invalid ng-dirty":n});function Ko(n,s){if(n&1){let e=T();a(0,"div",3)(1,"p-button",4),v("onClick",function(){_(e);let i=c();return g(i.goBack())}),r(),a(2,"p-button",5),v("onClick",function(){_(e);let i=c();return g(i.onSubmit())}),r()()}}function qo(n,s){n&1&&(a(0,"div",20),p(1," Name is required "),r())}function zo(n,s){n&1&&(a(0,"div",20),p(1," Code is required "),r())}function Ho(n,s){n&1&&(a(0,"div",20),p(1," Note is required "),r())}function Go(n,s){if(n&1&&(a(0,"div")(1,"span",22),p(2),r()()),n&2){let e=s.$implicit;m(2),A(e)}}function Uo(n,s){if(n&1&&(a(0,"div"),d(1,Go,3,1,"div",21),r()),n&2){let e=c(2);m(),l("ngForOf",e.getErrors("Category"))}}function Zo(n,s){if(n&1){let e=T();a(0,"p-panel")(1,"div",6)(2,"div",7)(3,"div",8)(4,"div",9)(5,"div",10)(6,"label",11),p(7,"Name"),r(),h(8,"input",12),d(9,qo,2,0,"div",13),r()(),a(10,"div",14)(11,"div",10)(12,"label",11),p(13,"Code"),r(),h(14,"input",15),d(15,zo,2,0,"div",13),r()(),a(16,"div",9)(17,"div",10)(18,"label",11),p(19,"Note"),r(),h(20,"textarea",16),d(21,Ho,2,0,"div",13),r()(),a(22,"div",9)(23,"div",17)(24,"label",11),p(25,"Category"),r(),a(26,"p-treeselect",18),v("onFocus",function(){_(e);let i=c();return g(i.loadCategories())}),r(),d(27,Uo,2,1,"div",19),r()()()()()()}if(n&2){let e=c();m(3),l("formGroup",e.form),m(5),l("ngClass",w(10,Pt,e.form.controls.Name.invalid&&(e.form.controls.Name.dirty||e.form.controls.Name.touched))),m(),l("ngIf",e.form.controls.Name.errors==null?null:e.form.controls.Name.errors.required),m(5),l("ngClass",w(12,Pt,e.form.controls.Code.invalid&&(e.form.controls.Code.dirty||e.form.controls.Code.touched))),m(),l("ngIf",e.form.controls.Code==null||e.form.controls.Code.errors==null?null:e.form.controls.Code.errors.required),m(5),l("ngClass",w(14,Pt,e.form.controls.Note.invalid&&(e.form.controls.Note.dirty||e.form.controls.Note.touched))),m(),l("ngIf",e.form.controls.Note.errors==null?null:e.form.controls.Note.errors.required),m(5),l("ngClass",w(16,$o,e.isInvalid("Category")))("options",e.categories()),m(),l("ngIf",e.isInvalid("Category"))}}var Mt=(()=>{class n extends Dn{constructor(){super(...arguments),this.categories=b([]),this.COATypeService=x(se),this.COAService=x(Z),this.info=b(null),this.route=x(J),this.router=x(ee),this.fb=x(be)}goBack(){this.router.navigate(["/pages/chart-of-account/coa-types"])}ngOnInit(){this.generateForm(),Ft([this.route.paramMap.pipe(z(e=>e.get("id")),Be(e=>!!e)),this.COATypeService.fetchCOACategories()]).pipe(E("fetchCOACategories"),D(([e,t])=>{let i=this.findNodeByKeyInArray(t,e);return this.categories.set(t),this.COATypeService.getCOACategoryByID({ID:e}).pipe(S(o=>{this.form.patchValue({Name:o.name,Code:o.code,Note:o.note,Category:i.parent}),["Asset","Liability","Equity","Revenue","Expense"].includes(o.name)&&this.form.controls.Category.disable()}))})).subscribe()}loadCategories(){this.COAService.getCachedCategoriesOptions().pipe(S(e=>this.categories.set(e))).subscribe()}generateForm(){this.form=new jt({Name:new L("",[de.required]),Code:new L("",[]),Category:new L(null,[de.required]),Note:new L("",[])})}findNodeByKeyInArray(e,t){for(let i of e){let o=this.findNodeByKey(i,t);if(o)return o}return null}findNodeByKey(e,t,i=null){if(e.key===t||e.label===t)return i&&(e.parent=i),e;if(e.children&&e.children.length>0)for(let o of e.children){let u=this.findNodeByKey(o,t,e);if(u)return u}return null}onSubmit(){let{Name:e,Code:t,Note:i,Category:o}=this.form.value,u=null,f=null;if(this.form.invalid){this.form.markAllAsTouched();return}this.route.snapshot.params.id?(u=this.findNodeByKeyInArray(this.categories(),this.route.snapshot.params.id),f={Name:e,Code:t,ParentID:u&&u.parent?u.parent.key:u.key,Note:i,ID:this.route.snapshot.params.id||null}):(u=this.findNodeByKeyInArray(this.categories(),o.key),f={Name:e,Code:t,ParentID:u&&u.parent?u.parent.key:u.key,Note:i}),this.COATypeService.submitCategory(f,{observe:"response"}).pipe(E("response"),S(()=>{this.router.navigate(["/pages/chart-of-account/coa-types"])})).subscribe()}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=qe(n)))(i||n)}})()}static{this.\u0275cmp=O({type:n,selectors:[["app-coa-type-form",8,"page"]],features:[Pe],attrs:Bo,decls:5,vars:1,consts:[["actionButton",""],["content",""],["pageTitle","Chart of Account Category Form",3,"hasMainWrapperPadding"],[1,"d-flex","gap-2"],["label","Cancel","variant","outlined","severity","secondary",3,"onClick"],["label","Submit",3,"onClick"],[1,"row","justify-content-center"],[1,"col"],[1,"row","row-gap-2",3,"formGroup"],[1,"ol-12","col-md-6","col-lg-6"],[1,"form-group","has-validation"],["for",""],["formControlName","Name",1,"form-control",3,"ngClass"],["id","validationServer03Feedback","class","invalid-feedback",4,"ngIf"],[1,"col-12","col-md-6","col-lg-6"],["formControlName","Code",1,"form-control",3,"ngClass"],["formControlName","Note","placeholder","Enter a description for this COA category","id","floatingTextarea2",1,"form-control",2,"height","100px",3,"ngClass"],[1,"form-group","has-validation","d-flex","flex-column"],["showClear","","placeholder","Select a Category","formControlName","Category",1,"ng-invalid","ng-dirty",3,"onFocus","ngClass","options"],[4,"ngIf"],["id","validationServer03Feedback",1,"invalid-feedback"],[4,"ngFor","ngForOf"],[1,"text-danger"]],template:function(t,i){t&1&&(a(0,"app-main-panel",2),d(1,Ko,3,0,"ng-template",null,0,y)(3,Zo,28,18,"ng-template",null,1,y),r()),t&2&&l("hasMainWrapperPadding",!0)},dependencies:[$,V,Ae,we,Se,te,U,Ce,Ie,ye,N,Q,Ze,R,K,oe,ie,ae,re],styles:["[_nghost-%COMP%]{display:block} .p-treeselect{width:100%}"],changeDetection:0})}}return n})();var jo=n=>[n];function Qo(n,s){if(n&1&&(a(0,"a",4),h(1,"i",5),a(2,"span"),p(3,"Edit"),r()()),n&2){let e=c(2);l("routerLink",w(1,jo,"/pages/chart-of-account/coa-types/"+e.info().id+"/edit"))}}function Wo(n,s){if(n&1&&(a(0,"div",6)(1,"div",7)(2,"p-card")(3,"div",8)(4,"div",9)(5,"div",10),p(6,"Name"),r(),a(7,"div",11),p(8),r()(),a(9,"div",9)(10,"div",10),p(11,"Code"),r(),a(12,"div",11),p(13),r()(),a(14,"div",9)(15,"div",10),p(16,"Category"),r(),a(17,"div",11),p(18),r()(),a(19,"div",9)(20,"div",10),p(21,"Note"),r(),a(22,"div",11),h(23,"div",12),r()()()()()()),n&2){let e=c(2);m(8),A(e.info().name),m(5),A(e.info().code),m(5),A(e.info().parentName),m(5),l("innerHTML",e.info().note,Ee)}}function Yo(n,s){n&1&&(ce(0),a(1,"app-main-panel",3),d(2,Qo,4,3,"ng-template",null,0,y)(4,Wo,24,4,"ng-template",null,1,y),r(),me())}var Zn=(()=>{class n{constructor(){this.COATypeService=x(se),this.route=x(J),this.info=b(null)}ngOnInit(){this.route.queryParamMap.pipe(z(e=>e.get("ID")),D(e=>this.COATypeService.getCOACategoryByID({ID:e})),E("getCOACategoryByID"),S(e=>this.info.set(e))).subscribe()}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=O({type:n,selectors:[["app-coa-type-info"]],decls:1,vars:1,consts:[["actionButton",""],["content",""],[4,"ngIf"],["pageTitle",`Type of Account Info
160
- `],["type","button",1,"p-button","p-button-success",3,"routerLink"],[1,"fa-solid","fa-pen-to-square"],[1,"row","justify-content-center","mt-3"],[1,"col-12","col-lg-8"],[1,"d-flex","flex-column","gap-3"],[1,"d-flex"],[1,"col-3"],[1,"col"],[3,"innerHTML"]],template:function(t,i){t&1&&d(0,Yo,6,0,"ng-container",2),t&2&&l("ngIf",i.info())},dependencies:[N,R,$,K,tt,V,B],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return n})();var rl=[{path:"",redirectTo:"account",pathMatch:"full"},{path:"",children:[{path:"account",component:$n},{path:"account/add",component:Et},{path:"account/import",loadComponent:()=>import("./chunk-AZWJMXL6.js").then(n=>n.CoaImportComponent)},{path:"account/:id",component:Rn},{path:"account/:id/edit",component:Et},{path:"coa-types",component:Un},{path:"coa-types/add",component:Mt},{path:"coa-types/info",component:Zn},{path:"coa-types/:id/edit",component:Mt}]}],Kn={path:"cash-of-account",title:"COA",iconName:"fa fa-calculator",class:"",label:"",labelClass:"",extralink:!1,submenu:[{path:"account",title:"Ticket List",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[]},{path:"coa-types",title:"Ticket Details",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[]}]};export{rl as CHART_OF_ACCOUNT_ROUTES,Kn as CHART_OF_ACCOUNT_ROUTE_PAGE};
package/chunk-IL6G454L.js DELETED
@@ -1 +0,0 @@
1
- import{a as r}from"./chunk-K4ALA724.js";import"./chunk-R6NK3ROE.js";import"./chunk-TDMJ2M6W.js";import{E as n}from"./chunk-DAQCANBV.js";import"./chunk-F2X3VGZZ.js";import{ha as o}from"./chunk-WCXWWANV.js";import"./chunk-YQFG5XE2.js";var i=(t,a)=>{let e=o(r),p=o(n);return e.isAuthenticated()&&!e.isTokenExpired()?(console.warn("User is already authenticated, redirecting to dashboard",t,a),p.navigate(["/pages/dashboard"]),!1):!0};var s=[{path:"",canActivate:[i],loadComponent:()=>import("./chunk-CLVUILX2.js").then(t=>t.LoginComponent)},{path:"404",loadComponent:()=>import("./chunk-BPFL7VRT.js").then(t=>t.NotfoundComponent)},{path:"signup",loadComponent:()=>import("./chunk-TLLNQB5C.js").then(t=>t.SignupComponent)},{path:"504",loadComponent:()=>import("./chunk-7ET5CSOO.js").then(t=>t.TimeoutComponent)}];export{s as AuthenticationRoutes};
package/chunk-IY6KCAQ4.js DELETED
@@ -1 +0,0 @@
1
- import{a as Qe}from"./chunk-G4XX7EU2.js";import{a as Xe,b as Ze,c as et,d as tt,e as nt,f as ot}from"./chunk-RSGEQTNJ.js";import{a as Te,b as Fe}from"./chunk-CZWWMQFD.js";import{d as ne,e as qe,i as we,j as Me,k as oe}from"./chunk-CEZEYAWZ.js";import"./chunk-YVGWGEPX.js";import"./chunk-PDNXU4MC.js";import{a as Ae}from"./chunk-C3N6HRIE.js";import{a as ee,b as pe}from"./chunk-W4KTL6Y6.js";import"./chunk-RNOSD5RO.js";import{a as K,b as J}from"./chunk-HFUW7PYZ.js";import"./chunk-WWWY3VE7.js";import"./chunk-35ER6BC7.js";import"./chunk-V4IY7RIP.js";import"./chunk-J6H5UCJR.js";import"./chunk-U75O34AW.js";import"./chunk-3RM5CDGW.js";import{a as Ee,b as Y}from"./chunk-7IPVVF6Y.js";import{h as M}from"./chunk-RYHNURUZ.js";import"./chunk-BX74ZLQG.js";import{a as z,b as U}from"./chunk-CNLYDNON.js";import{a as te,b as ye,c as Pe,d as be,e as Oe,f as Ie,g as Je}from"./chunk-FTI2QPWV.js";import"./chunk-BDJHC5O6.js";import{o as Ke,w as B,x as V}from"./chunk-LMI4DLB5.js";import"./chunk-W6LBFCQQ.js";import{e as H,f as _e,j as re,k as ge,l as xe,m as he,n as Ye,o as Ce,v as Se,x as Z,y as ve}from"./chunk-3GHEXAAZ.js";import{a as fe}from"./chunk-R6NK3ROE.js";import"./chunk-TDMJ2M6W.js";import{C as ae,E as ze,F as G,M as k,f as L,j as He,m as w}from"./chunk-DAQCANBV.js";import"./chunk-F2X3VGZZ.js";import{Ac as ie,Cb as _,Ga as R,Jc as Ue,Kb as s,Kc as je,Mc as u,Nb as F,Pb as $e,Qb as P,Sb as b,Tb as O,Ub as a,Vb as i,Wb as $,X as j,Yc as X,Z as D,_b as v,ba as ue,bb as Ve,c as se,dc as y,ec as c,gb as p,ha as h,pa as C,qa as S,qc as m,rc as d,s as Q,sc as I,uc as We,wb as T,yc as de,zc as E}from"./chunk-WCXWWANV.js";import{a as f,b as x}from"./chunk-YQFG5XE2.js";var A=(()=>{class t{constructor(){this.httpService=h(fe)}getGlobalConfiguration(){return this.httpService.get(void 0,"/api/setup/GlobalConfiguration")}saveGlobalConfiguration(e){return this.httpService.post(void 0,"/api/setup/SubmitGlobalConfiguration",e)}fetchPOSOutletConfiguration(e){return this.httpService.get(void 0,"/api/Setup/OutletConfiguration",{params:e})}fetchPOSOutletFormConfiguration(e){let n={params:e};return this.httpService.get(void 0,"/api/Setup/OutletConfigurationForm",n)}updatePOSOutletConfiguration(e){return this.httpService.post(void 0,"/api/Setup/SubmitOutletConfiguration",e)}fetchPOSPaymentConfiguration(e){return this.httpService.get(void 0,"/api/Setup/PaymentConfiguration",{params:e})}fetchPOSPaymentFormConfiguration(e){let n={params:e};return this.httpService.get(void 0,"api/Setup/PaymentConfigurationForm",n)}updatePOSPaymentConfiguration(e){return this.httpService.post(void 0,"/api/Setup/SubmitPaymentConfiguration",e)}fetchPOSTaxConfiguration(){return this.httpService.get(void 0,"/api/setup/TaxConfigurationForm")}updatePOSTaxConfiguration(e){return this.httpService.post(void 0,"/api/setup/SubmitTaxConfiguration",e)}fetchPOSWriteOffConfiguration(){return this.httpService.get(void 0,"/api/setup/WriteOffConfigurationList")}fetchPOSWriteOffFormConfiguration(e){let n={params:e};return this.httpService.get(void 0,"/api/setup/WriteOffConfigurationForm",n)}updatePOSWriteOffConfiguration(e){return this.httpService.post(void 0,"/api/setup/SubmitWriteOffConfiguration",e)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=ue({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var N=function(t){return t.POSGLOBAL_SELL="Sell",t.POSGLOBAL_BUY="Buy",t.POSGLOBAL_ADJUSTMENT="Adjustment",t.POSGLOBAL_PREPAID="Prepaid",t.POSGLOBAL_RETURN="Return",t.POSGLOBAL_DEBT="Debt",t.POSGLOBAL_PAYMENTFEE="Payment Fee",t.POSGLOBAL_MANUFACTURING="Manufacturing",t.POSGLOBAL_ADVANCE="Advance",t}(N||{});var it={[N.POSGLOBAL_SELL]:[{typeID:2,side:"debit",label:"Account Receivable"},{typeID:1,side:"credit",label:"Sales"},{typeID:4,side:"debit",label:"COGS"},{typeID:3,side:"credit",label:"Sold Inventory"},{typeID:10,side:"debit",label:"Sales Discount"}],[N.POSGLOBAL_BUY]:[{typeID:27,side:"debit",label:"Pending Paid Inventory"},{typeID:5,side:"credit",label:"Account Payable"},{typeID:28,side:"debit",label:"Inventory Bought"},{typeID:27,side:"credit",label:"Pending Paid Inventory"},{typeID:11,side:"credit",label:"Purchase Discount"}],[N.POSGLOBAL_ADJUSTMENT]:[{typeID:26,side:"debit",label:"Adjustment Asset"},{typeID:21,side:"credit",label:"Adjustment Expense"}],[N.POSGLOBAL_PREPAID]:[{typeID:29,side:"debit",label:"Accounting for Prepaid"},{typeID:30,side:"debit",label:"Sales For Prepaid"}],[N.POSGLOBAL_RETURN]:[{typeID:8,side:"debit",label:"Sales Return"},{typeID:27,side:"debit",label:"Inventory"},{typeID:4,side:"credit",label:"COGS"},{typeID:9,side:"credit",label:"Purchase Return"}],[N.POSGLOBAL_DEBT]:[{typeID:17,side:"debit",label:"Consignment Payable"}],[N.POSGLOBAL_PAYMENTFEE]:[{typeID:19,side:"debit",label:"Payment Fee"},{typeID:20,side:"credit",label:"Surcharge"}],[N.POSGLOBAL_MANUFACTURING]:[{typeID:24,side:"debit",label:"Finished Goods"},{typeID:23,side:"credit",label:"Raw Material"},{typeID:25,side:"credit",label:"Production Expenses"}],[N.POSGLOBAL_ADVANCE]:[{typeID:15,side:"debit",label:"Crossing Account"},{typeID:16,side:"debit",label:"Retained Earnings"},{typeID:18,side:"debit",label:"Current Earnings"}]};function gt(t,r){if(t&1){let e=v();a(0,"div",5)(1,"p-button",6),y("onClick",function(){C(e);let o=c();return S(o.onSubmit())}),i()()}}function xt(t,r){if(t&1&&(a(0,"p-tab",10),m(1),i()),t&2){let e=r.$implicit;s("value",e.value),p(),d(e.label)}}function ht(t,r){if(t&1&&(a(0,"div",19)(1,"div")(2,"span"),m(3),i()(),a(4,"div")(5,"span"),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function Ct(t,r){if(t&1&&(a(0,"div",19)(1,"div")(2,"span"),m(3),i()(),a(4,"div")(5,"span"),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function St(t,r){if(t&1&&(a(0,"div",14)(1,"div",15)(2,"div",5)(3,"label",16),m(4),i(),a(5,"span",17),m(6),i()(),a(7,"p-select",18),_(8,ht,7,2,"ng-template",null,2,u)(10,Ct,7,2,"ng-template",null,3,u),i()()()),t&2){let e=r.$implicit,n=c(4);s("formGroupName",e.index),p(4),d(e.entry.value.label),p(2),d(e.entry.value.side),p(),s("options",n.posIntegration().options.accounts)}}function vt(t,r){if(t&1&&(a(0,"div",19)(1,"div")(2,"span"),m(3),i()(),a(4,"div")(5,"span"),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function yt(t,r){if(t&1&&(a(0,"div",19)(1,"div")(2,"span"),m(3),i()(),a(4,"div")(5,"span"),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function Pt(t,r){if(t&1&&(a(0,"div",14)(1,"div",15)(2,"div",5)(3,"label",16),m(4),i(),a(5,"span",20),m(6),i()(),a(7,"p-select",18),_(8,vt,7,2,"ng-template",null,2,u)(10,yt,7,2,"ng-template",null,3,u),i()()()),t&2){let e=r.$implicit,n=c(4);s("formGroupName",e.index),p(4),d(e.entry.value.label),p(2),d(e.entry.value.side),p(),s("options",n.posIntegration().options.accounts)}}function bt(t,r){if(t&1&&(a(0,"p-tabpanel",10)(1,"div",11)(2,"div",12)(3,"div",13),b(4,St,12,4,"div",14,P),i()(),a(6,"div",12)(7,"div",13),b(8,Pt,12,4,"div",14,P),i()()()()),t&2){let e=r.$implicit,n=c(3);s("value",e.value),p(),s("formGroupName",e.value),p(3),O(n.getDebitEntries(e.value)),p(4),O(n.getCreditEntries(e.value))}}function Ot(t,r){if(t&1){let e=v();a(0,"form",8),y("ngSubmit",function(){C(e);let o=c(2);return S(o.onSubmit())}),a(1,"p-tabs",9)(2,"p-tablist"),b(3,xt,2,2,"p-tab",10,P),i(),a(5,"p-tabpanels"),b(6,bt,10,2,"p-tabpanel",10,P),i()()()}if(t&2){let e=c(2);s("formGroup",e.accountForm),p(),s("value",e.tab())("lazy",!0),p(2),O(e.tabs()),p(3),O(e.tabs())}}function It(t,r){if(t&1&&_(0,Ot,8,3,"form",7),t&2){let e=c();s("ngIf",e.posIntegration()&&e.accountForm)}}var at=(()=>{class t{constructor(){this.posConfigService=h(A),this.fb=h(Se),this.tab=R(N.POSGLOBAL_SELL),this.tabs=R(Object.values(N).map(e=>({label:e,value:e}))),this.posIntegration=R(null),this.form=R([]),this.descriptionsMap=new Map,this.objectKeys=Object.keys,this.posGlobalTabEnum=N}ngOnInit(){this.posConfigService.getGlobalConfiguration().pipe(D(e=>{this.posIntegration.set(e),this.form.set(e.form),this.descriptionsMap=new Map(e.descriptions.map(n=>[+n.id,n.name])),this.initializeForm()})).subscribe()}initializeForm(){let e={};this.tabs().forEach(n=>{let o=this.getEntriesForTab(n.value);console.log(`Entries for ${n.value}:`,o),e[n.value]=this.fb.array(o.map(l=>this.createEntryFormGroup(l)))}),this.accountForm=this.fb.group(e)}createEntryFormGroup(e){let n=this.fb.group({typeID:[e.typeID],label:[e.label],side:[e.side],accountID:[this.getAccountIDByTypeID(e.typeID)]});return n.get("accountID").valueChanges.subscribe(o=>{this.syncAccountIDs(e.typeID,o,n)}),n}getAccountIDByTypeID(e){return this.form().find(o=>o.typeID===e)?.accountID||""}getEntriesForTab(e){return it[e]||[]}getTabEntries(e){return this.accountForm.get(e)}onSubmit(){let e=this.accountForm.getRawValue(),n=[],o=new Set;for(let l of Object.values(e))for(let{typeID:g,accountID:W}of l){let Be=`${g}_${W}`;o.has(Be)||(o.add(Be),n.push({typeID:g,accountID:W||Qe}))}console.log("Form submitted with value:",n),this.posConfigService.saveGlobalConfiguration({form:n}).subscribe({next:()=>console.log("Save successful"),error:l=>console.error("Save failed",l)})}getDebitEntries(e){return this.getTabEntries(e).controls.map((n,o)=>({entry:n,index:o})).filter(n=>n.entry.value.side==="debit")}getCreditEntries(e){return this.getTabEntries(e).controls.map((n,o)=>({entry:n,index:o})).filter(n=>n.entry.value.side==="credit")}syncAccountIDs(e,n,o){Object.values(this.accountForm.controls).forEach(l=>{l.controls.forEach(g=>{g!==o&&g.get("typeID")?.value===e&&g.get("accountID")?.value!==n&&g.get("accountID")?.setValue(n,{emitEvent:!1})})})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-global"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],["pageTitle","POS Integration"],[1,"d-flex","gap-2"],["label","Submit",3,"onClick"],[3,"formGroup","ngSubmit",4,"ngIf"],[3,"ngSubmit","formGroup"],[1,"border-top",3,"value","lazy"],[3,"value"],[1,"row",3,"formGroupName"],[1,"col"],[1,"row","gap-3"],[1,"col-12",3,"formGroupName"],[1,"form-group","d-flex","flex-column"],["for","",1,"fs-3"],[1,"text-success","fs-3"],["filter","","filterBy","code,name","formControlName","accountID","optionLabel","name","optionValue","id",3,"options"],[1,"d-flex","align-items-center","gap-2"],[1,"text-danger","fs-3"]],template:function(n,o){n&1&&(a(0,"app-main-panel",4),_(1,gt,2,0,"ng-template",null,0,u)(3,It,1,1,"ng-template",null,1,u),i())},dependencies:[M,ot,nt,tt,et,Xe,Ze,Ke,J,K,Z,ge,H,_e,w,L,k,V,B,ve,xe,Ce,he],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Et=t=>[t];function Tt(t,r){if(t&1&&(a(0,"th",7),m(1),i()),t&2){let e=r.$implicit;p(),d(e.name.slice(0,10))}}function Ft(t,r){if(t&1&&(a(0,"tr")(1,"th",6),m(2,"Method"),i()(),a(3,"tr"),b(4,Tt,2,1,"th",7,P),i()),t&2){let e=c(3);p(4),O(e.paymentConfiguration().outlets)}}function wt(t,r){if(t&1&&(a(0,"td"),m(1),i()),t&2){let e=r.$implicit;p(),d(e.accountName)}}function Mt(t,r){if(t&1&&(a(0,"tr")(1,"td",8)(2,"a",9),m(3),i()(),b(4,wt,2,1,"td",null,P),i()),t&2){let e=r.$implicit;p(2),s("routerLink",ie(2,Et,e.id)),p(),d(e.name),p(),O(e.accounts)}}function Dt(t,r){if(t&1&&(a(0,"p-table",5),_(1,Ft,6,0,"ng-template",null,1,u)(3,Mt,6,4,"ng-template",null,2,u),i()),t&2){let e=c(2);s("scrollable",!0)("scrollHeight","calc(100vh - 70px)")("value",e.paymentConfiguration().payment)}}function Rt(t,r){if(t&1){let e=v();a(0,"app-main-panel",4),y("search",function(o){C(e);let l=c();return S(l.onSearch(o))}),_(1,Dt,5,3,"ng-template",null,0,u),i()}t&2&&s("isSearchableInput",!0)}var rt=(()=>{class t{constructor(){this.POSSetupService=h(A),this.paymentConfiguration=R(null)}ngOnInit(){this.POSSetupService.fetchPOSPaymentConfiguration({}).pipe(D(e=>{this.paymentConfiguration.set(e)})).subscribe()}onSearch(e){this.POSSetupService.fetchPOSPaymentConfiguration({Search:e}).pipe(D(n=>{this.paymentConfiguration.set(n)})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-payment"]],decls:1,vars:1,consts:[["content",""],["header",""],["body",""],["pageTitle","Payment Method Accounting",3,"isSearchableInput","search",4,"ngIf"],["pageTitle","Payment Method Accounting",3,"search","isSearchableInput"],[3,"scrollable","scrollHeight","value"],["rowspan","3",2,"min-width","300px"],[2,"min-width","200px"],["pFrozenColumn",""],[1,"link-primary",3,"routerLink"]],template:function(n,o){n&1&&_(0,Rt,3,1,"app-main-panel",3),n&2&&s("ngIf",o.paymentConfiguration())},dependencies:[M,oe,ne,qe,w,L,k,G],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var kt={data:{listOutletAccount:[],listCOAType:[],pageNumber:1,pageSize:20,totalCount:0,totalPages:0},filter:{PageNumber:1,PageSize:20,Search:""}},Le=ye(Ie(kt),Pe(t=>({first:X(()=>(t.filter().PageNumber-1)*t.filter().PageSize+1),end:X(()=>Math.min(t.filter().PageNumber*t.filter().PageSize,t.data().totalCount))})),Oe(t=>{let r=h(A);return{updateFilter:n=>{te(t,o=>x(f({},o),{filter:f(f({},o.filter),n)}))},getPOSOutlets:Te(se(j(n=>r.fetchPOSOutletConfiguration(n).pipe(Fe({next:o=>{te(t,l=>x(f({},l),{data:o}))},error:o=>{console.error("Error fetching POS outlets:",o)}})))))}}),be(t=>({onInit:()=>{t.getPOSOutlets(t.filter)}})));var At=()=>({height:"calc(100vh - 70px)"}),Nt=t=>[t];function Lt(t,r){if(t&1&&(a(0,"th"),m(1),i()),t&2){let e=r.$implicit;p(),d(e.value)}}function Gt(t,r){if(t&1&&(a(0,"tr")(1,"th"),m(2,"Name"),i(),b(3,Lt,2,1,"th",null,P),i()),t&2){let e=c(2);p(3),O(e.store.data().listCOAType)}}function Bt(t,r){if(t&1&&(a(0,"td"),m(1),i()),t&2){let e=r.$implicit;p(),d(e)}}function Vt(t,r){if(t&1&&(a(0,"tr")(1,"td")(2,"a",7),m(3),i()(),b(4,Bt,2,1,"td",null,P),i()),t&2){let e=r.$implicit;p(2),s("routerLink",ie(2,Nt,e.OutletID)),p(),I(" ",e.OutletName,""),p(),O(e.Accounts)}}function $t(t,r){if(t&1&&m(0),t&2){let e=c(2);We(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Wt(t,r){t&1&&(a(0,"tr")(1,"td",8)(2,"span"),m(3," No journal entries found. "),i()()())}function Ut(t,r){if(t&1){let e=v();a(0,"p-panel")(1,"p-table",6),y("onPage",function(o){C(e);let l=c();return S(l.onPage(o))}),_(2,Gt,5,0,"ng-template",null,1,u)(4,Vt,6,4,"ng-template",null,2,u)(6,$t,1,3,"ng-template",null,3,u)(8,Wt,4,0,"ng-template",null,4,u),i()()}if(t&2){let e=c();F(E(11,At)),p(),s("scrollable",!0)("scrollHeight","calc(100vh - 100px)")("value",e.store.data().listOutletAccount)("paginator",!0)("rows",e.store.filter().PageSize)("lazy",!0)("scrollable",!0)("scrollHeight","calc(100vh - 142px)")("totalRecords",e.store.data().totalCount)}}var pt=(()=>{class t{constructor(){this.store=h(Le)}onSearch(e){this.store.updateFilter({PageNumber:1,PageSize:20,Search:e})}onPage(e){let n=e.first/e.rows+1;this.store.updateFilter(x(f({},this.store.filter()),{PageSize:e.rows,PageNumber:n}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-outlet"]],features:[de([Le])],decls:3,vars:1,consts:[["content",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Outlet Account",3,"search","isSearchableInput"],["styleClass","d-flex flex-column justify-content-between h-100",3,"onPage","scrollable","scrollHeight","value","paginator","rows","lazy","totalRecords"],[1,"link","link-primary",3,"routerLink"],["colspan","8"]],template:function(n,o){if(n&1){let l=v();a(0,"app-main-panel",5),y("search",function(W){return C(l),S(o.onSearch(W))}),_(1,Ut,10,12,"ng-template",null,0,u),i()}n&2&&s("isSearchableInput",!0)},dependencies:[M,w,Y,oe,ne,k,G,U,z],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var jt=()=>({height:"calc(100vh - 100px)"}),Ht=()=>({height:"calc(100vh - 150px)"});function zt(t,r){if(t&1){let e=v();a(0,"a",5),m(1,"Cancel"),i(),a(2,"p-button",6),y("onClick",function(){C(e);let o=c();return S(o.updatePOsOutletConfiguration())}),i()}}function Yt(t,r){if(t&1&&(a(0,"div",16)(1,"div",17)(2,"span"),m(3),i()(),a(4,"div",17)(5,"span",17),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function Kt(t,r){if(t&1&&(a(0,"div",16)(1,"div",17)(2,"span"),m(3),i()(),a(4,"div",18)(5,"span",17),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function Jt(t,r){if(t&1&&(a(0,"div",12)(1,"span",14),m(2),i(),a(3,"p-select",15),_(4,Yt,7,2,"ng-template",null,2,u)(6,Kt,7,2,"ng-template",null,3,u),i()()),t&2){let e,n=r.$implicit,o=r.$index,l=c(3);s("formGroupName",o),p(2),d((e=n.get("TypeName"))==null?null:e.value),p(),s("options",l.options.accounts)}}function qt(t,r){t&1&&$(0,"hr")}function Qt(t,r){if(t&1&&(a(0,"div",9)(1,"h3",10),m(2),Ue(3,"titlecase"),i(),a(4,"div",11),b(5,Jt,8,3,"div",12,P),i()(),_(7,qt,1,0,"hr",13)),t&2){let e,n=r.$implicit,o=r.$index,l=r.$index,g=r.$count,W=c(2);s("formGroupName",o),p(2),I(" ",je(3,3,(e=n.get("groupName"))==null?null:e.value)," "),p(3),O(W.getAccountsFormArray(l).controls),p(2),s("ngIf",l!==g-1)}}function Xt(t,r){if(t&1&&(a(0,"p-panel")(1,"p-scroll-panel")(2,"form",7)(3,"div",8),b(4,Qt,8,5,null,null,P),i()()()()),t&2){let e=c();F(E(5,jt)),p(),F(E(6,Ht)),p(),s("formGroup",e.accountsForm),p(2),O(e.accountGroupsArray.controls)}}var lt=(()=>{class t{constructor(){this.route=h(ae),this.POSSetupService=h(A),this.outletForm=R(null),this.allAccounts=[],this.options=null,this.outletName="",this.accountGroups=[{name:"sell",typeIds:[1,2],accounts:[]},{name:"delivery",typeIds:[3,4],accounts:[]},{name:"buy",typeIds:[27,11,28],accounts:[]},{name:"purchase return",typeIds:[9],accounts:[]},{name:"sales return",typeIds:[8],accounts:[]},{name:"adjustment",typeIds:[21,26],accounts:[]}],this.fb=h(Se)}ngOnInit(){this.accountsForm=this.fb.group({accountGroups:this.fb.array([])}),this.route.paramMap.pipe(Q(e=>e.get("id")),j(e=>this.POSSetupService.fetchPOSOutletFormConfiguration({outletID:e})),D(e=>{this.allAccounts=e.form,this.options=e.options,this.outletName=e.form[0].OutletName,this.accountGroups.forEach(o=>{o.accounts=this.allAccounts.filter(l=>o.typeIds.includes(l.TypeID))});let n=this.accountsForm.get("accountGroups");this.accountGroups.forEach(o=>{n.push(this.createAccountGroupControl(o))})})).subscribe()}get accountGroupsArray(){return this.accountsForm.get("accountGroups")}getAccountsFormArray(e){return this.accountGroupsArray.at(e).get("accounts")}createAccountGroupControl(e){return this.fb.group({groupName:[e.name],accounts:this.fb.array(e.accounts.map(n=>this.createAccountControl(n)))})}createAccountControl(e){return this.fb.group({AccountID:[e.AccountID],TypeID:[e.TypeID],TypeName:[e.TypeName],OutletID:[e.OutletID],OutletName:[e.OutletName]})}updatePOsOutletConfiguration(){let{accountGroups:e}=this.accountsForm.value,n={form:e.flatMap(o=>o.accounts.map(l=>({AccountID:l.AccountID,TypeID:l.TypeID,TypeName:l.TypeName,OutletID:l.OutletID,OutletName:l.OutletName})))};this.POSSetupService.updatePOSOutletConfiguration(n).pipe().subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-outlet-form"]],decls:5,vars:2,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],[3,"pageTitle","hasMainWrapperPadding"],["routerLink","/pages/pos-setup/outlets",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit",3,"onClick"],[1,"",3,"formGroup"],["formArrayName","accountGroups",1,"d-flex","flex-column","gap-2"],[1,"row",3,"formGroupName"],[1,"fs-4","fw-semibold"],["formArrayName","accounts",1,"row","row-gap-3"],[1,"col-6",3,"formGroupName"],[4,"ngIf"],[1,"fs-3"],["formControlName","AccountID","filter","","filterBy","code,name","optionLabel","name","optionValue","id","placeholder","Select an account",1,"w-100",3,"options"],[1,"d-flex","gap-2"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&(a(0,"app-main-panel",4),_(1,zt,3,0,"ng-template",null,0,u)(3,Xt,6,7,"ng-template",null,1,u),i()),n&2&&s("pageTitle","Edit "+o.outletName)("hasMainWrapperPadding",!0)},dependencies:[M,w,L,He,Y,ve,ge,H,_e,xe,Ce,he,Ye,J,K,U,z,ee,V,B,k,G],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var en=()=>({height:"calc(100vh - 100px)"}),tn=()=>({width:"100%",height:"calc(100vh - 150px)"}),nn=()=>({width:"100%"});function on(t,r){if(t&1){let e=v();a(0,"a",6),m(1,"Cancel"),i(),a(2,"p-button",7),y("onClick",function(){C(e);let o=c(3);return S(o.updatePOSOutletConfiguration())}),i()}}function an(t,r){if(t&1&&(a(0,"div",16)(1,"div",17)(2,"span"),m(3),i()(),a(4,"div",17)(5,"span",17),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function rn(t,r){if(t&1&&(a(0,"div",16)(1,"div",17)(2,"span"),m(3),i()(),a(4,"div",18)(5,"span",17),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function pn(t,r){if(t&1){let e=v();a(0,"div",9)(1,"div",10)(2,"div",11)(3,"label",12),m(4),i()(),$(5,"div",13),a(6,"div",14)(7,"p-select",15),y("ngModelChange",function(o){let l=C(e).$index,g=c(4);return S(g.updateAccountById(o,l))}),_(8,an,7,2,"ng-template",null,2,u)(10,rn,7,2,"ng-template",null,3,u),i()()()()}if(t&2){let e=r.$implicit,n=r.$index,o=c(4);p(4),d(e.outletName.slice(0,15)),p(3),F(E(7,nn)),s("ngModel",o.paymentForm().form.accounts[n].accountID)("virtualScroll",!0)("virtualScrollItemSize",50)("options",o.paymentForm().options.chartOfAccount)}}function ln(t,r){if(t&1&&(a(0,"p-card")(1,"p-scrollpanel")(2,"div",8),b(3,pn,12,8,"div",9,P),i()()()),t&2){let e=c(3);F(E(4,en)),p(),F(E(5,tn)),p(2),O(e.paymentForm().form.accounts)}}function mn(t,r){if(t&1&&(a(0,"app-main-panel",4),_(1,on,3,0,"ng-template",null,0,u)(3,ln,5,6,"ng-template",null,1,u),i()),t&2){let e=c(2);s("pageTitle",e.paymentForm().form.paymentMethod.name+" Form Accounting")("hasMainWrapperPadding",!0)}}function cn(t,r){if(t&1&&_(0,mn,5,2,"app-main-panel",5),t&2){let e=c();s("ngIf",e.paymentForm())}}var ct=(()=>{class t{constructor(){this.route=h(ae),this.POSSetupService=h(A),this.paymentForm=R(null),this.router=h(ze)}ngOnInit(){this.route.paramMap.pipe(Q(e=>+e.get("id")),j(e=>this.POSSetupService.fetchPOSPaymentFormConfiguration({ID:e})),D(e=>{this.paymentForm.set(e)}),Ae("response")).subscribe()}updateAccountById(e,n){let o=this.paymentForm().form.accounts,l=x(f({},this.paymentForm()),{form:x(f({},this.paymentForm().form),{accounts:o.map((g,W)=>W===n?x(f({},g),{accountID:e}):g)})});this.paymentForm.set(l)}updatePOSOutletConfiguration(){let e={form:[...this.paymentForm().form.accounts]};this.POSSetupService.updatePOSPaymentConfiguration(e).pipe(Ae("response"),D(()=>{this.router.navigate(["/pages/pos-setup/payments"])})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-payment-form"]],decls:1,vars:1,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],[3,"pageTitle","hasMainWrapperPadding"],[3,"pageTitle","hasMainWrapperPadding",4,"ngIf"],["routerLink","/pages/pos-setup/payments",1,"p-button","p-button-outlined","p-button-secondary"],["label","Submit",3,"onClick"],[1,"row","row-gap-3"],[1,"col-6","d-flex","flex-column","gap-2"],[1,"row","row-gap-4"],[1,"col-2"],["for",""],[1,"col-3"],[1,"col-7"],["filter","","filterBy","name,code","optionLabel","name","optionValue","id","placeholder","Select an account",1,"w-full",3,"ngModelChange","ngModel","virtualScroll","virtualScrollItemSize","options"],[1,"d-flex","gap-2"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&_(0,cn,1,1,"app-main-panel",4),n&2&&$e(o.paymentForm()?0:-1)},dependencies:[Y,Ee,M,w,L,pe,ee,J,K,Z,H,re,k,G,V,B,U],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var sn=()=>({height:"calc(100vh - 70px)"}),un=()=>({width:"100%",height:"calc(100vh - 100px)"});function dn(t,r){if(t&1){let e=v();a(0,"div",5)(1,"a",6),m(2,"Cancel"),i(),a(3,"p-button",7),y("onClick",function(){C(e);let o=c();return S(o.updatePOSTaxConfiguration())}),i()()}}function fn(t,r){if(t&1&&(a(0,"div",5)(1,"div",15)(2,"span"),m(3),i()(),a(4,"div",15)(5,"span",15),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function _n(t,r){if(t&1&&(a(0,"div",5)(1,"div",15)(2,"span"),m(3),i()(),a(4,"div",16)(5,"span",15),m(6),i()()()),t&2){let e=r.$implicit;p(3),I("(",e.code,")"),p(3),d(e.name)}}function gn(t,r){if(t&1){let e=v();a(0,"div",11)(1,"div",12)(2,"label",13),m(3),i(),a(4,"p-select",14),y("ngModelChange",function(o){let l=C(e).$index,g=c(2);return S(g.updateAccountID(o,l))}),_(5,fn,7,2,"ng-template",null,2,u)(7,_n,7,2,"ng-template",null,3,u),i()()()}if(t&2){let e=r.$implicit,n=r.$index,o=c(2);p(3),d(e.name),p(),s("options",o.taxForm().options.chartOfAccount)("ngModel",o.taxForm().form[n].accountID)}}function xn(t,r){if(t&1&&(a(0,"p-panel")(1,"p-scroll-panel")(2,"div",8)(3,"div",9)(4,"div",10),b(5,gn,9,3,"div",11,P),i()()()()()),t&2){let e=c();F(E(4,sn)),p(),F(E(5,un)),p(4),O(e.taxForm().form)}}var st=(()=>{class t{constructor(){this.POSSetupService=h(A),this.taxForm=R(null)}ngOnInit(){this.POSSetupService.fetchPOSTaxConfiguration().pipe(D(e=>{this.taxForm.set(e)})).subscribe()}updateAccountID(e,n){let o=this.taxForm().form,l=x(f({},this.taxForm()),{form:o.map((g,W)=>W===n?x(f({},g),{accountID:e}):g)});this.taxForm.set(l)}updatePOSTaxConfiguration(){let e={form:[...this.taxForm().form]};this.POSSetupService.updatePOSTaxConfiguration(e).pipe(D(n=>console.log(n))).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-tax"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],["pageTitle","Tax Setup"],[1,"d-flex","gap-2"],["routerLink","..",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit",3,"onClick"],[1,"row"],[1,"col-4"],[1,"row","row-gap-3"],[1,"col-12"],[1,"d-flex","flex-column"],["for",""],["filter","","filterBy","name,code","optionLabel","name","optionValue","id","placeholder","Select an Account",3,"ngModelChange","options","ngModel"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&(a(0,"app-main-panel",4),_(1,dn,4,0,"ng-template",null,0,u)(3,xn,7,6,"ng-template",null,1,u),i())},dependencies:[M,Y,w,J,K,pe,ee,Z,H,re,k,G,V,B,U,z],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var hn=()=>({height:"calc(100vh - 70px)"}),Cn=()=>({"min-width":"50rem"}),Sn=t=>[t];function vn(t,r){t&1&&$(0,"p-button",6)}function yn(t,r){if(t&1&&_(0,vn,1,0,"p-button",5),t&2){let e=c();s("ngIf",e.hasCheckedItems())}}function Pn(t,r){t&1&&(a(0,"tr")(1,"th",9),$(2,"p-tableHeaderCheckbox"),i(),a(3,"th"),m(4,"Name"),i(),a(5,"th"),m(6,"Description"),i()())}function bn(t,r){if(t&1&&(a(0,"tr")(1,"td"),$(2,"p-tableCheckbox",10),i(),a(3,"td")(4,"a",11),m(5),i()(),a(6,"td"),m(7),i()()),t&2){let e=r.$implicit;p(2),s("value",e),p(2),s("routerLink",ie(4,Sn,e.id)),p(),d(e.name),p(2),d(e.description)}}function On(t,r){if(t&1){let e=v();a(0,"p-panel")(1,"p-table",8),y("onRowSelect",function(o){C(e);let l=c(2);return S(l.onRowSelect(o))})("onRowUnselect",function(o){C(e);let l=c(2);return S(l.onRowSelect(o))})("onHeaderCheckboxToggle",function(o){C(e);let l=c(2);return S(l.onSelectAll(o))}),_(2,Pn,7,0,"ng-template",null,2,u)(4,bn,8,6,"ng-template",null,3,u),i()()}if(t&2){let e=c(2);F(E(4,hn)),p(),s("value",e.writeoffList().data)("tableStyle",E(5,Cn))}}function In(t,r){if(t&1&&_(0,On,6,6,"p-panel",7),t&2){let e=c();s("ngIf",e.writeoffList())}}var ut=(()=>{class t{constructor(){this.POSSetupService=h(A),this.writeoffList=R(null),this.hasCheckedItems=X(()=>{let e=this.writeoffList();return!e||!e.data||!Array.isArray(e.data)?!1:e.data.some(n=>n&&n.checked===!0)})}ngOnInit(){this.POSSetupService.fetchPOSWriteOffConfiguration().pipe(Q(e=>x(f({},e),{data:e.data.map(n=>x(f({},n),{checked:!1}))})),D(e=>{this.writeoffList.set(e)})).subscribe()}onRowSelect(e){console.log("Selected Row:",e.data);let n=this.writeoffList();if(!n||!n.data)return;let o=n.data.findIndex(l=>l.id===e.data.id);if(o!==-1){let l=[...n.data];l[o]=x(f({},l[o]),{checked:!l[o].checked}),this.writeoffList.set(x(f({},n),{data:l}))}}onSelectAll(e){let n=this.writeoffList();if(!n?.data)return;let o=n.data.map(l=>x(f({},l),{checked:e.checked}));this.writeoffList.set(x(f({},n),{data:o}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-writeoff"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["body",""],["pageTitle","Write Off"],["severity","danger","label","Delete","icon","fa-solid fa-trash",4,"ngIf"],["severity","danger","label","Delete","icon","fa-solid fa-trash"],[3,"style",4,"ngIf"],["dataKey","id",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","tableStyle"],[2,"width","4rem"],[3,"value"],[1,"link-primary",3,"routerLink"]],template:function(n,o){n&1&&(a(0,"app-main-panel",4),_(1,yn,1,1,"ng-template",null,0,u)(3,In,1,1,"ng-template",null,1,u),i())},dependencies:[M,w,L,oe,ne,we,Me,k,G,V,B,U,z],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var En=()=>({witdh:"100%",height:"calc(100vh - 150px)"});function Tn(t,r){if(t&1){let e=v();a(0,"div",6)(1,"a",7),m(2,"Cancel"),i(),a(3,"p-button",8),y("onClick",function(){C(e);let o=c(2);return S(o.updateWriteOffConfiguration())}),i()()}}function Fn(t,r){if(t&1&&(a(0,"div",6)(1,"span",16),m(2),i(),a(3,"span",16),m(4),i()()),t&2){let e=r.$implicit;p(2),I("(",e.code,")"),p(2),d(e.name)}}function wn(t,r){if(t&1&&(a(0,"div",6)(1,"span",16),m(2),i(),a(3,"span",16),m(4),i()()),t&2){let e=r.$implicit;p(2),I("(",e.code,")"),p(2),d(e.name)}}function Mn(t,r){if(t&1){let e=v();a(0,"div",12)(1,"div",13)(2,"label",14),m(3),i(),a(4,"p-select",15),y("ngModelChange",function(o){let l=C(e).$index,g=c(3);return S(g.updateAccountById(o,l))}),_(5,Fn,5,2,"ng-template",null,2,u)(7,wn,5,2,"ng-template",null,3,u),i()()()}if(t&2){let e=r.$implicit,n=c(3);p(3),d(e.name),p(),s("ngModel",e.accountID)("options",n.writeOffForm().options.account)("virtualScroll",!0)("virtualScrollItemSize",50)}}function Dn(t,r){if(t&1&&(a(0,"p-card")(1,"p-scroll-panel")(2,"div",9)(3,"div",10)(4,"div",11),b(5,Mn,9,5,"div",12,P),i()()()()()),t&2){let e=c(2);p(),F(E(2,En)),p(4),O(e.writeOffForm().form)}}function Rn(t,r){if(t&1&&(a(0,"app-main-panel",5),_(1,Tn,4,0,"ng-template",null,0,u)(3,Dn,7,3,"ng-template",null,1,u),i()),t&2){let e=c();s("pageTitle","Write Off Form "+e.writeOffForm().info.name)("hasMainWrapperPadding",!0)}}var dt=(()=>{class t{constructor(){this.POSSetupService=h(A),this.route=h(ae),this.writeOffForm=R(null)}ngOnInit(){this.route.paramMap.pipe(Q(e=>e.get("id")),j(e=>this.POSSetupService.fetchPOSWriteOffFormConfiguration({ID:e})),D(e=>this.writeOffForm.set(e))).subscribe()}updateAccountById(e,n){let o=this.writeOffForm().form,l=x(f({},this.writeOffForm()),{form:o.map((g,W)=>W===n?x(f({},g),{accountID:e}):g)});this.writeOffForm.set(l)}updateWriteOffConfiguration(){let e={form:this.writeOffForm().form};this.POSSetupService.updatePOSWriteOffConfiguration(e).pipe().subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-writeoff-form"]],decls:1,vars:1,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],[3,"pageTitle","hasMainWrapperPadding",4,"ngIf"],[3,"pageTitle","hasMainWrapperPadding"],[1,"d-flex","gap-2"],["routerLink","/pages/pos-setup/writeoff",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit",3,"onClick"],[1,"row"],[1,"col"],[1,"row","row-gap-3"],[1,"col-3"],[1,"d-flex","flex-column"],["for","",1,"d-inline-block","text-truncate",2,"max-width","300px"],["filter","","filterBy","name,code","optionLabel","name","filter","","filterBy","name,code","optionValue","id","placeholder","Select an account",3,"ngModelChange","ngModel","options","virtualScroll","virtualScrollItemSize"],[1,""]],template:function(n,o){n&1&&_(0,Rn,5,2,"app-main-panel",4),n&2&&s("ngIf",o.writeOffForm())},dependencies:[M,w,L,Y,Ee,pe,ee,J,K,Z,H,re,k,G,V,B],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var ft=(()=>{class t{constructor(){this.httpService=h(fe)}getExpenseOptions(){return this.httpService.get(void 0,"/api/SetupExpenseOption/GetExpenseOptions")}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=ue({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var kn={data:{expenseOptions:[]}},Ge=ye(Ie(kn),Je("POSExpenseOptionStore"),Pe(t=>({hasCheckedRows:X(()=>t.data().expenseOptions.some(r=>r.checked)),checkedInvoice:X(()=>t.data().expenseOptions.filter(r=>r.checked).map(r=>r.id))})),Oe(t=>{let r=h(ft);return{onRowSelect(n){te(t,o=>{let l=o.data.expenseOptions.map(g=>g.id===n.id?x(f({},g),{checked:!0}):g);return x(f({},o),{data:x(f({},o.data),{expenseOptions:l})})})},onRowUnselect(n){te(t,o=>{let l=o.data.expenseOptions.map(g=>g.id===n.id?x(f({},g),{checked:!1}):g);return x(f({},o),{data:x(f({},o.data),{expenseOptions:l})})})},onHeaderCheckboxToggle(n){te(t,o=>{let l=o.data.expenseOptions.map(g=>x(f({},g),{checked:n}));return x(f({},o),{data:x(f({},o.data),{expenseOptions:l})})})},getExpenseOptions:Te(se(j(()=>r.getExpenseOptions().pipe(Fe({next:n=>{te(t,o=>x(f({},o),{data:x(f({},o.data),{expenseOptions:n.expenseOptions.map(l=>x(f({},l),{checked:!1}))})}))},error:n=>{console.error("Error fetching expense options:",n)}})))))}}),be({onInit:t=>{t.getExpenseOptions()}}));var An=()=>({height:"calc(100vh - 70px)"});function Nn(t,r){t&1&&$(0,"p-button",6)}function Ln(t,r){if(t&1&&_(0,Nn,1,0,"p-button",5),t&2){let e=c();s("ngIf",e.store.hasCheckedRows())}}function Gn(t,r){t&1&&(a(0,"tr")(1,"th",8),$(2,"p-tableHeaderCheckbox"),i(),a(3,"th"),m(4,"Name"),i(),a(5,"th"),m(6,"Account"),i(),a(7,"th"),m(8,"Description"),i()())}function Bn(t,r){if(t&1&&(a(0,"tr")(1,"td"),$(2,"p-tableCheckbox",9),i(),a(3,"td"),m(4),i(),a(5,"td"),m(6),i(),a(7,"td"),$(8,"p",10),i()()),t&2){let e=r.$implicit;p(2),s("value",e),p(2),d(e.name),p(2),d(e.accountName),p(2),s("innerHTML",e.description,Ve)}}function Vn(t,r){if(t&1){let e=v();a(0,"p-panel")(1,"p-table",7),y("onRowSelect",function(o){C(e);let l=c();return S(l.onRowSelect(o))})("onRowUnselect",function(o){C(e);let l=c();return S(l.onRowUnselect(o))})("onHeaderCheckboxToggle",function(o){C(e);let l=c();return S(l.onHeaderCheckboxToggle(o))}),_(2,Gn,9,0,"ng-template",null,2,u)(4,Bn,9,4,"ng-template",null,3,u),i()()}if(t&2){let e=c();F(E(3,An)),p(),s("value",e.store.data().expenseOptions)}}var _t=(()=>{class t{constructor(){this.store=h(Ge)}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){Array.isArray(e.data)?e.data.forEach(n=>{this.store.onRowUnselect(n)}):this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-expense-option"]],features:[de([Ge])],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["body",""],["pageTitle","Expense Option"],["label","Delete","severity","danger","icon","fa-solid fa-trash",4,"ngIf"],["label","Delete","severity","danger","icon","fa-solid fa-trash"],["dataKey","id",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value"],[2,"width","4rem"],[3,"value"],[3,"innerHTML"]],template:function(n,o){n&1&&(a(0,"app-main-panel",4),_(1,Ln,1,1,"ng-template",null,0,u)(3,Vn,6,4,"ng-template",null,1,u),i())},dependencies:[M,oe,ne,we,Me,U,z,V,B,w,L],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Ua=[{path:"",redirectTo:"global",pathMatch:"full"},{path:"",children:[{path:"global",component:at},{path:"outlets",component:pt},{path:"outlets/:id",component:lt},{path:"payments",component:rt},{path:"payments/:id",component:ct},{path:"taxs",component:st},{path:"writeoff",component:ut},{path:"writeoff/:id",component:dt},{path:"expense-option",component:_t}]}];export{Ua as POS_SETUP_ROUTES};
package/chunk-K4ALA724.js DELETED
@@ -1 +0,0 @@
1
- import{a as m}from"./chunk-R6NK3ROE.js";import{E as g}from"./chunk-DAQCANBV.js";import{Z as s,ba as l,ha as c}from"./chunk-WCXWWANV.js";var a=class extends Error{};a.prototype.name="InvalidTokenError";function u(o){return decodeURIComponent(atob(o).replace(/(.)/g,(r,t)=>{let e=t.charCodeAt(0).toString(16).toUpperCase();return e.length<2&&(e="0"+e),"%"+e}))}function p(o){let r=o.replace(/-/g,"+").replace(/_/g,"/");switch(r.length%4){case 0:break;case 2:r+="==";break;case 3:r+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return u(r)}catch{return atob(r)}}function T(o,r){if(typeof o!="string")throw new a("Invalid token specified: must be a string");r||(r={});let t=r.header===!0?0:1,e=o.split(".")[t];if(typeof e!="string")throw new a(`Invalid token specified: missing part #${t+1}`);let n;try{n=p(e)}catch(i){throw new a(`Invalid token specified: invalid base64 for part #${t+1} (${i.message})`)}try{return JSON.parse(n)}catch(i){throw new a(`Invalid token specified: invalid json for part #${t+1} (${i.message})`)}}var E=(()=>{class o{constructor(){this.httpService=c(m),this.router=c(g),this.autoLogout()}login(t){return this.httpService.post("","api/Authentication/login",t).pipe(s(e=>{let n=t.SubDomain;localStorage.setItem("AUTH_TOKEN",e.access_token),localStorage.setItem("AUTH_POS_TOKEN",e.pos.access_token),localStorage.setItem("AUTH_TOKEN_TYPE",e.token_type),localStorage.setItem("AUTH_EXPIRES_AT",e.expiredAt),localStorage.setItem("AUTH_DOMAIN",n.substring(n.indexOf("."))),localStorage.setItem("AUTH_SUB_DOMAIN",t.SubDomain.split(".")[0]),localStorage.setItem("AUTH_USERNAME",t.Username),this.storeTenantId(e.access_token),this.autoLogout()}))}isAuthenticated(){return!!localStorage.getItem("AUTH_TOKEN")}getToken(){return localStorage.getItem("AUTH_TOKEN")}getTokenType(){return localStorage.getItem("AUTH_TOKEN_TYPE")}isTokenExpired(){let t=localStorage.getItem("AUTH_EXPIRES_AT");return t?new Date(t).getTime()<Date.now():!0}autoLogout(){clearTimeout(this.logoutTimer);let t=localStorage.getItem("AUTH_EXPIRES_AT");if(!t)return;let e=new Date(t).getTime()-Date.now();e>0?this.logoutTimer=setTimeout(()=>this.logout(),e):this.logout()}getTenantExternalURL(){let t=localStorage.getItem("AUTH_SUB_DOMAIN")||"",e=localStorage.getItem("AUTH_DOMAIN")||"";return t&&e?`https://${t}${e}`:""}getTanantToken(){return localStorage.getItem("AUTH_POS_TOKEN")}logout(){localStorage.removeItem("AUTH_TOKEN"),localStorage.removeItem("AUTH_TOKEN_TYPE"),localStorage.removeItem("AUTH_EXPIRES_AT"),clearTimeout(this.logoutTimer),this.router.navigate([""])}getFullDomain(){let t=localStorage.getItem("AUTH_SUB_DOMAIN"),e=localStorage.getItem("AUTH_DOMAIN");return!t||!e?(console.error("Subdomain or domain is missing in local storage."),null):`${t}${e}`}storeTenantId(t){let e=T(t);e&&(localStorage.setItem("AC_TENANT",e.TID),localStorage.setItem("AC_TENANT_LID",e.LID))}static{this.\u0275fac=function(e){return new(e||o)}}static{this.\u0275prov=l({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();export{E as a};
package/chunk-LRI7YFKN.js DELETED
@@ -1 +0,0 @@
1
- import{a as v,b as L}from"./chunk-KHP7E7JG.js";import"./chunk-BOVEGMBL.js";import"./chunk-WUPQR4WU.js";import{a as E,b as O}from"./chunk-W4KTL6Y6.js";import"./chunk-7IPVVF6Y.js";import{h as H}from"./chunk-RYHNURUZ.js";import{b as N,c as G}from"./chunk-BX74ZLQG.js";import{a as R,b as D}from"./chunk-CNLYDNON.js";import"./chunk-FTI2QPWV.js";import"./chunk-BDJHC5O6.js";import{w as V,x as j}from"./chunk-LMI4DLB5.js";import"./chunk-W6LBFCQQ.js";import"./chunk-3GHEXAAZ.js";import"./chunk-R6NK3ROE.js";import{a as I}from"./chunk-TDMJ2M6W.js";import{i as A,m as F}from"./chunk-DAQCANBV.js";import"./chunk-F2X3VGZZ.js";import{Cb as P,Jc as l,Kb as p,Kc as m,Mc as x,Nb as d,Ub as o,V as M,Vb as n,Wb as c,X as y,Z as S,_b as w,dc as h,ec as s,gb as a,h as T,ha as f,pa as g,qa as C,ra as b,s as u,sa as k,wb as B,yc as $,zc as _}from"./chunk-WCXWWANV.js";import"./chunk-YQFG5XE2.js";var q=()=>({height:"calc(100vh - 100px)"});function J(i,z){if(i&1){let e=w();o(0,"div",3)(1,"p-button",4),h("onClick",function(){g(e);let r=s();return C(r.onFormatCOAConfig())}),n(),o(2,"p-button",5),l(3,"async"),l(4,"async"),h("onClick",function(){g(e);let r=s();return C(r.onMigrateCoaConfig())}),n()()}if(i&2){let e=s();a(2),p("disabled",m(3,2,e.countInBooks$)!==0)("pTooltip",m(4,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function K(i,z){if(i&1&&(o(0,"p-scroll-panel")(1,"p-panel")(2,"div",6),c(3,"app-migration-cards",7),l(4,"async"),b(),o(5,"svg",8),c(6,"path",9),n(),k(),c(7,"app-migration-cards",10),l(8,"async"),n()()()),i&2){let e=s();d(_(12,q)),a(),d(_(13,q)),a(2),p("migrationCount",m(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),a(4),p("migrationCount",m(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var ge=(()=>{class i{constructor(){this.migrateService=f(v),this.toastr=f(I),this.refresh$=new T(void 0),this.pageTitle="Chart of Account Configuration"}ngOnInit(){let e=this.refresh$.pipe(y(()=>this.migrateService.getCOAConfigurationCount()),S(t=>console.log("API response:",t)),M(1));this.countInPOS$=e.pipe(u(t=>Number(t.pos))),this.countInBooks$=e.pipe(u(t=>Number(t.books)))}onMigrateCoaConfig(){this.migrateService.migrateCoaConfig().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormatCOAConfig(){this.migrateService.formatManualCOAConfig().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Format Successful")})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=B({type:i,selectors:[["app-coa-configuration"]],features:[$([v])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger",3,"onClick"],["label","Migrate","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(t,r){t&1&&(o(0,"app-main-panel",2),P(1,J,5,6,"ng-template",null,0,x)(3,K,9,14,"ng-template",null,1,x),n()),t&2&&p("pageTitle",r.pageTitle)},dependencies:[H,F,A,j,V,O,E,D,R,G,N,L],encapsulation:2})}}return i})();export{ge as CoaConfigurationComponent};
package/chunk-MPHC4J2R.js DELETED
@@ -1 +0,0 @@
1
- import{a as Ze,b as et,c as tt,d as nt,e as it,f as ot}from"./chunk-RSGEQTNJ.js";import{a as He,b as Ke,c as Qe}from"./chunk-6PS3NJ62.js";import{a as Xe,b as Ye}from"./chunk-6332DY2I.js";import{a as qe}from"./chunk-RLR2HFSC.js";import{b as We}from"./chunk-BOVEGMBL.js";import"./chunk-WUPQR4WU.js";import{a as ze,b as Ue}from"./chunk-VJLO7GNT.js";import"./chunk-DJAICZNR.js";import{a as Re,b as Ve,d as je,k as $e}from"./chunk-CEZEYAWZ.js";import{a as Ge,b as Be}from"./chunk-YVGWGEPX.js";import"./chunk-PDNXU4MC.js";import{a as Le}from"./chunk-C3N6HRIE.js";import{a as ee,b as te}from"./chunk-W4KTL6Y6.js";import"./chunk-RNOSD5RO.js";import{a as Oe,b as ke}from"./chunk-HFUW7PYZ.js";import"./chunk-WWWY3VE7.js";import{a as Pe,b as Je}from"./chunk-35ER6BC7.js";import"./chunk-V4IY7RIP.js";import"./chunk-J6H5UCJR.js";import"./chunk-U75O34AW.js";import"./chunk-3RM5CDGW.js";import{a as De,b as ne}from"./chunk-7IPVVF6Y.js";import{h as M}from"./chunk-RYHNURUZ.js";import"./chunk-BX74ZLQG.js";import{a as z,b as U}from"./chunk-CNLYDNON.js";import"./chunk-FTI2QPWV.js";import"./chunk-BDJHC5O6.js";import{n as Z,o as w,w as $,x as L}from"./chunk-LMI4DLB5.js";import"./chunk-W6LBFCQQ.js";import{Ia as we,Ma as Me,b as J,c as pe,e as N,f as O,j as Te,l as k,m as X,n as Ne,o as R,v as V,x as Y,y as j}from"./chunk-3GHEXAAZ.js";import{a as Ae}from"./chunk-R6NK3ROE.js";import{a as Fe}from"./chunk-TDMJ2M6W.js";import{C as ye,F as Ie,M as Ee,c as Q,f as be,l as Se,m as T}from"./chunk-DAQCANBV.js";import"./chunk-F2X3VGZZ.js";import{Ac as A,Cb as g,Ga as P,Jc as le,Kb as p,Kc as me,L as de,Mc as d,Nb as K,Pb as re,Qb as b,Sb as S,Tb as y,Ub as i,Vb as n,Wb as c,Y as fe,Z as B,_b as h,ba as ge,dc as I,ec as u,g as ue,gb as a,ha as s,mb as _e,pa as v,qa as C,qc as o,rc as E,s as se,sc as ae,vc as ve,wb as F,wc as Ce,xc as he,yc as xe,zc as G}from"./chunk-WCXWWANV.js";import{a as q,b as H}from"./chunk-YQFG5XE2.js";var x=(()=>{class t{#e=s(Ae);fetchLoaderConfiguration(){return this.#e.get("","api/SetupLoader/Load")}updateAccountingIntegrationConfiguration(e){return this.#e.post(void 0,"/api/setup/SubmitConfig",e)}fetchOpeningBalanceFormConfiguration(){return this.#e.get("","/api/setup/OpeningBalance/Form")}submitOpeningBalanceFormConfiguration(e){return this.#e.post("","api/setup/OpeningBalance/Submit",e)}fetchAPICredential(){return this.#e.get(void 0,"/api/AccountConfig")}updateAPICredential(e){return this.#e.put(void 0,"/api/AccountConfig",e)}formatJournal(e){return this.#e.post("","/api/setup/formatdata/clearjournal",{domain:e})}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275prov=ge({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Ct=()=>({height:"calc(100vh - 100px)"}),lt=t=>({"active-state":t}),mt=t=>({"text-white":t});function ht(t,m){if(t&1){let e=h();i(0,"div",5)(1,"a",6),o(2,"Cancel"),n(),i(3,"p-button",7),I("click",function(){v(e);let l=u();return C(l.updateAccountingIntegration())}),n()()}}function xt(t,m){if(t&1&&(i(0,"p-tab",9),o(1),n()),t&2){let e=m.$implicit,r=m.$index;p("value",r),a(),E(e)}}function bt(t,m){if(t&1&&(i(0,"div",42)(1,"h3",43),o(2," End Of Shift "),n()()),t&2){let e=u(4);p("ngClass",A(2,lt,e.form.controls.posIntegration.value.createJournalTriggers===0)),a(),p("ngClass",A(4,mt,e.form.controls.posIntegration.value.createJournalTriggers===0))}}function St(t,m){if(t&1&&(i(0,"div",42)(1,"h3",43),o(2," Every "),n()()),t&2){let e=u(4);p("ngClass",A(2,lt,e.form.controls.posIntegration.value.createJournalTriggers===1)),a(),p("ngClass",A(4,mt,e.form.controls.posIntegration.value.createJournalTriggers===1))}}function yt(t,m){if(t&1&&g(0,bt,3,6,"div",42)(1,St,3,6,"div",42),t&2){let e,r=u().$implicit;re((e=r.key)===0?0:e===1?1:-1)}}function It(t,m){t&1&&(i(0,"h4"),o(1,"Suitable for Cash Sales (Retail & FnB)"),n(),i(2,"p"),o(3," One Journal is generated for all transaction happening within a register open - close period "),n())}function Et(t,m){t&1&&(i(0,"h4"),o(1,"Every"),n(),i(2,"p"),o(3," Suitable for Credit Sales (Wholesale) Journal is generated for each transaction "),n())}function Ft(t,m){if(t&1){let e=h();i(0,"div",14),c(1,"p-radiobutton",40),i(2,"p-card",41),I("click",function(){v(e);let l=u(2);return C(l.changeJournalType())}),g(3,yt,2,1,"ng-template",null,3,d)(5,It,4,0)(6,Et,4,0),n()()}if(t&2){let e,r=m.$implicit;a(),p("inputId",r.value)("value",r.key),a(4),re((e=r.key)===0?5:e===1?6:-1)}}function At(t,m){if(t&1&&(i(0,"div",34),c(1,"p-radiobutton",44),i(2,"label",45),o(3),n()()),t&2){let e=m.$implicit;a(),p("value",e.key)("inputId",e.value),a(),p("for",e.value),a(),E(e.value)}}function Tt(t,m){if(t&1&&(i(0,"div",34),c(1,"p-radiobutton",46),i(2,"label",47),o(3),n()()),t&2){let e=m.$implicit;a(),p("value",e.key)("inputId",e.value),a(),p("for",e.value),a(),E(e.value)}}function Nt(t,m){if(t&1&&(i(0,"div",34),c(1,"p-radiobutton",48),i(2,"label",47),o(3),n()()),t&2){let e=m.$implicit;a(),p("value",e.key)("inputId",e.value),a(),p("for",e.value),a(),E(e.value)}}function wt(t,m){if(t&1&&(i(0,"div",34),c(1,"p-radiobutton",49),i(2,"label",47),o(3),n()()),t&2){let e=m.$implicit;a(),p("value",e.key)("inputId",e.value),a(),p("for",e.value),a(),E(e.value)}}function Mt(t,m){if(t&1&&(i(0,"p-scrollpanel",null,2)(2,"p-tabs",8)(3,"p-tablist"),S(4,xt,2,2,"p-tab",9,b),n(),i(6,"p-tabpanels")(7,"p-tabpanel",9)(8,"h4",10),o(9,"Integration with POS"),n(),i(10,"p"),o(11,"Generate Journal"),n(),i(12,"div",11)(13,"div",12)(14,"div",13),S(15,Ft,7,3,"div",14,b),n()()(),c(17,"hr"),i(18,"div",15)(19,"h3",10),o(20,"Journal Generate"),n(),i(21,"p"),o(22,"Configure generate transaction"),n(),i(23,"div",16)(24,"div")(25,"div",17)(26,"label",18),o(27,"Generate EOD Expense Journal"),n(),c(28,"p-toggleswitch",19),n()(),i(29,"div")(30,"div",17)(31,"label",18),o(32,"Generate Outlet Delivery Journal"),n(),c(33,"p-toggleswitch",20),n()(),i(34,"div")(35,"div",17)(36,"label",18),o(37,"Generate Payment Discount Journal On Payment"),n(),c(38,"p-toggleswitch",21),n()()()()(),i(39,"p-tabpanel",22)(40,"div",23)(41,"h3",10),o(42,"Accounting Numbering"),n(),i(43,"p"),o(44,"Configure numbering format and rule for your accounting"),n(),i(45,"div",13)(46,"div",24)(47,"div",25)(48,"div",24)(49,"div",17)(50,"label",26),o(51,"Digit"),n(),c(52,"p-inputnumber",27),n()(),i(53,"div",24)(54,"div",17)(55,"label",28),o(56,"Seed"),n(),c(57,"p-inputnumber",29),n()(),i(58,"div",24)(59,"div",17)(60,"label",30),o(61,"Last Number"),n(),c(62,"p-inputnumber",31),n()(),i(63,"div",24)(64,"div",17)(65,"label",18),o(66,"Format"),n(),c(67,"p-select",32),n()(),i(68,"div",24)(69,"div",17)(70,"label",18),o(71,"Reset Every"),n(),i(72,"div",33),S(73,At,4,4,"div",34,b),n()()()()()()()(),i(75,"p-tabpanel",35)(76,"div",23)(77,"h3",10),o(78,"Report"),n(),i(79,"p"),o(80,"Configure report behavior"),n(),i(81,"div",13)(82,"div",24)(83,"div",25)(84,"div",24)(85,"div",17)(86,"label",18),o(87,"Audit Journal Transaction"),n(),i(88,"div",36),S(89,Tt,4,4,"div",34,b),n()()(),c(91,"div",24),i(92,"div",24)(93,"div",17)(94,"label",18),o(95,"Accounting For Treatment"),n(),i(96,"div",36),S(97,Nt,4,4,"div",34,b),n()()(),c(99,"div",24),i(100,"div",24)(101,"div",17)(102,"label",18),o(103,"Configure Report Access Control in COA"),n(),i(104,"div",36),S(105,wt,4,4,"div",34,b),n()()()()()()()(),i(107,"p-tabpanel",37)(108,"div",23)(109,"h3",10),o(110,"Note"),n(),i(111,"p"),o(112,"Configure show note"),n(),i(113,"div",13)(114,"div",24)(115,"div",25)(116,"div",24)(117,"div",17)(118,"label",18),o(119,"Note Required On Journal"),n(),c(120,"p-toggleswitch",38),n()(),c(121,"div",24),i(122,"div",24)(123,"div",17)(124,"label",18),o(125,"Trial Balance Footer Visible"),n(),c(126,"p-toggleswitch",39),n()(),c(127,"div",24),n()()()()()()()()),t&2){let e,r,l,f,W,D,_=u();K(G(9,Ct)),a(2),p("value",0)("formGroup",_.form),a(2),y(_.tabs()),a(3),p("value",0),a(8),y((e=_.accountingIntegration())==null||e.options==null?null:e.options.journalType),a(24),p("value",1),a(28),p("options",(r=_.accountingIntegration())==null||r.options==null?null:r.options.monthlyResetPeriodFormat),a(6),y((l=_.accountingIntegration())==null||l.options==null?null:l.options.resetPeriods),a(2),p("value",2),a(14),y((f=_.accountingIntegration())==null||f.options==null?null:f.options.auditType),a(8),y((W=_.accountingIntegration())==null||W.options==null?null:W.options.generatePrepaidJournal),a(8),y((D=_.accountingIntegration())==null||D.options==null?null:D.options.entityAccess),a(2),p("value",3)}}var pt=(()=>{class t{constructor(){this.accountingSetupService=s(x),this.fb=s(V).nonNullable,this.tabs=P(["Pos","Numbering","Report","Note"]),this.journalType=P(0),this.accountingIntegration=P(null)}ngOnInit(){this.initializeForm(),this.loadAccountingConfiguration()}initializeForm(){this.form=this.fb.group({posIntegration:this.createPosIntegrationGroup(),number:this.createNumberGroup(),report:this.createReportGroup(),journalGenerate:this.createJournalGenerateGroup(),note:this.createNoteGroup()})}createPosIntegrationGroup(){return this.fb.group({createJournalTriggers:this.fb.control(0)})}createNumberGroup(){return this.fb.group({seed:this.fb.control(""),digit:this.fb.control(""),resetEvery:this.fb.control(""),monthlyFormat:this.fb.control(""),lastNumber:this.fb.control(""),lastModified:this.fb.control("")})}createReportGroup(){return this.fb.group({accountingAuditType:this.fb.control(""),accountingEntityAccess:this.fb.control(""),generatePrepaidJournal:this.fb.control("")})}createJournalGenerateGroup(){return this.fb.group({eodExpenseJournal:this.fb.control(""),transferOrder:this.fb.control(""),paymentDiscount:this.fb.control("")})}createNoteGroup(){return this.fb.group({noteMandatory:this.fb.control(""),trialBalanceFooterVisible:this.fb.control("")})}changeJournalType(){let e=this.journalType()===0?1:0;this.journalType.set(e),this.accountingIntegration.update(r=>H(q({},r),{form:H(q({},r.form),{posIntegration:H(q({},r.form.posIntegration),{createJournalTriggers:e})})})),this.form.controls.posIntegration.patchValue({createJournalTriggers:e})}loadAccountingConfiguration(){this.accountingSetupService.fetchLoaderConfiguration().pipe(B(e=>{this.accountingIntegration.set(e);let r=e.form.posIntegration.createJournalTriggers;this.journalType.set(r),this.form.get("posIntegration.createJournalTriggers")?.setValue(r),this.form.patchValue(e.form)})).subscribe()}updateAccountingIntegration(){let e={form:this.form.getRawValue()};this.accountingSetupService.updateAccountingIntegrationConfiguration(e).pipe().subscribe()}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275cmp=F({type:t,selectors:[["app-accounting-integration"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["scrollPanelContainer",""],["header",""],["pageTitle","Accounting Integration"],[1,"d-flex","gap-2"],["routerLink","..",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit",3,"click"],[1,"border-top",3,"value","formGroup"],[3,"value"],[1,"fs-5"],["formGroupName","posIntegration",1,"row"],[1,"col-8"],[1,"row"],[1,"col"],["formGroupName","journalGenerate",1,""],[1,"d-flex","column-gap-5"],[1,"d-flex","flex-column"],["for","",1,"fs-4"],["formControlName","eodExpenseJournal"],["formControlName","transferOrder"],["formControlName","paymentDiscount"],["formGroupName","number",3,"value"],[1,""],[1,"col-6"],[1,"row","row-gap-3"],["for","digit",1,"fs-4"],["inputId","digit","formControlName","digit"],["for","seed",1,"fs-4"],["inputId","seed","formControlName","seed"],["for","lastNumber",1,"fs-4"],["inputId","lastNumber","formControlName","lastNumber"],["appendTo","body","formControlName","monthlyFormat","optionValue","key","optionLabel","value",3,"options"],[1,"d-flex","gap-4"],[1,"d-flex","align-items-center","gap-2"],["formGroupName","report",3,"value"],[1,"d-flex","flex-column","gap-2"],["formGroupName","note",3,"value"],["formControlName","noteMandatory"],["formControlName","trialBalanceFooterVisible"],["styleClass","d-none","name","createJournalTriggers","formControlName","createJournalTriggers",3,"inputId","value"],["styleClass","h-100",3,"click"],[1,"d-flex","justify-content-center","inactive-state","text-white","py-2",3,"ngClass"],[1,"m-0",3,"ngClass"],["name","resetEvery","formControlName","resetEvery",3,"value","inputId"],[1,"m-0",3,"for"],["name","accountingAuditType","formControlName","accountingAuditType",3,"value","inputId"],[1,"ml-2","m-0",3,"for"],["name","generatePrepaidJournal","formControlName","generatePrepaidJournal",3,"value","inputId"],["name","accountingEntityAccess","formControlName","accountingEntityAccess",3,"value","inputId"]],template:function(r,l){r&1&&(i(0,"app-main-panel",4),g(1,ht,4,0,"ng-template",null,0,d)(3,Mt,128,10,"ng-template",null,1,d),n())},dependencies:[T,Q,ot,it,nt,tt,Ze,et,M,ne,De,Ve,Re,j,N,O,k,R,X,w,ke,Oe,Ue,ze,Ee,Ie,L,$,Je,Pe,te,ee],styles:["[_nghost-%COMP%]{display:block}.inactive-state[_ngcontent-%COMP%]{background-color:#e5e5e5}.active-state[_ngcontent-%COMP%]{background-color:var(--p-primary-color)}"],changeDetection:0})}}return t})();var Dt=()=>({height:"calc(100vh - 250px)"}),Gt=()=>[],ct=()=>({});function Bt(t,m){if(t&1){let e=h();i(0,"div")(1,"p-button",6),I("onClick",function(){v(e);let l=u();return C(l.submitForm())}),n()()}}function Pt(t,m){t&1&&(i(0,"div",12)(1,"h3",13),o(2,"Date"),n(),c(3,"p-datePicker",14),n())}function Jt(t,m){t&1&&(i(0,"tr")(1,"th",20),o(2,"Account Name"),n(),i(3,"th",21),o(4,"Debit"),n(),i(5,"th",21),o(6,"Credit"),n()())}function Ot(t,m){if(t&1&&(i(0,"tr",10)(1,"td",20),o(2),n(),i(3,"td"),c(4,"input",22),n(),i(5,"td"),c(6,"input",23),n()()),t&2){let e,r=m.$implicit,l=m.rowIndex,f=u(4);p("formGroupName",l),a(2),ae(" ",(e=f.asFormGroup(r).get("accountName"))==null?null:e.value," "),a(2),p("autoNumeric",G(4,ct)),a(2),p("autoNumeric",G(5,ct))}}function kt(t,m){if(t&1&&(i(0,"div",10)(1,"h4",15),o(2),n(),i(3,"div",16)(4,"p-table",17),g(5,Jt,7,0,"ng-template",18)(6,Ot,7,6,"ng-template",19),n()()()),t&2){let e=m.$implicit,r=m.$index,l=u(3);p("formGroupName",r),a(2),ae(" ",e.get("name").value," "),a(2),p("value",l.getItemsArray(l.asFormGroup(e)).controls)}}function Rt(t,m){if(t&1&&(i(0,"tr")(1,"td")(2,"p",24),o(3,"Total"),n()(),i(4,"td",25)(5,"p",24),o(6),le(7,"number"),n()(),i(8,"td",25)(9,"p",24),o(10),le(11,"number"),n()()()),t&2){let e=u(3);a(6),E(me(7,2,e.subtotalDebit)),a(4),E(me(11,4,e.subtotalCredit))}}function Vt(t,m){if(t&1&&(i(0,"p-panel",8),g(1,Pt,4,0,"ng-template",null,2,d),c(3,"p-divider"),i(4,"p-scroll-panel")(5,"div",9),S(6,kt,7,3,"div",10,b),n()(),i(8,"p-table",11),g(9,Rt,12,6,"ng-template",null,3,d),n()()),t&2){let e=u(2);p("formGroup",e.formGroups),a(4),K(G(4,Dt)),a(2),y(e.formsArray.controls),a(2),p("value",G(5,Gt))}}function jt(t,m){if(t&1&&g(0,Vt,11,6,"p-panel",7),t&2){let e=u();p("ngIf",e.formGroups)}}var st=(()=>{class t{constructor(){this.destroy$=new ue,this.subtotalDebit=0,this.subtotalCredit=0,this.fb=s(V),this.accSetupService=s(x),this.dayjsService=s(We),this.date=new Date,this.routes=s(ye)}ngOnInit(){this.initializeForm(),this.loadFormData(),this.calculateSubtotalDebit(),this.formGroups.get("forms").valueChanges.pipe(de(300),fe(this.destroy$)).subscribe(()=>{this.calculateSubtotalDebit()})}initializeForm(){this.formGroups=this.fb.group({forms:this.fb.array([]),date:this.fb.control(new Date)})}get formsArray(){return this.formGroups.get("forms")}getItemsArray(e){return e.get("items")}asFormGroup(e){return e}createFormGroup(e){return this.fb.group({id:[e.id],name:[e.name],items:this.createItemsArray(e.items)})}createItemsArray(e){let r=e.map(l=>this.createItemGroup(l));return this.fb.array(r)}createItemGroup(e){return this.fb.group({accountName:[e.accountName],accountCode:[e.accountCode],id:[e.id],journalID:[e.journalID],accountID:[e.accountID],debitAmount:[e.debitAmount],creditAmount:[e.creditAmount],index:[e.index],note:[e.note]})}loadFormData(){this.routes.data.pipe(se(e=>e.data),Le("response"),B(e=>{for(;this.formsArray.length>0;)this.formsArray.removeAt(0);e.form.filter(l=>l.items&&l.items.length>0).forEach(l=>{this.formsArray.push(this.createFormGroup(l))})})).subscribe({error:e=>console.error("Error loading form data:",e)})}calculateSubtotalDebit(){let e=this.formGroups.controls.forms;this.subtotalDebit=0,this.subtotalCredit=0,e.controls.forEach(r=>{let l=this.getItemsArray(r),f=l.controls.reduce((D,_)=>{let oe=_.get("debitAmount").value||0;return D+oe},0),W=l.controls.reduce((D,_)=>{let oe=_.get("creditAmount").value||0;return D+oe},0);this.subtotalDebit+=f,this.subtotalCredit+=W})}submitForm(){let e=Object.entries(this.formGroups.getRawValue()).reduce((r,[l,f])=>(l==="date"?r[l]=f instanceof Date?this.dayjsService.format(f):f:l==="forms"?r.form=f:r[l]=f,r),{});console.log("Submitting form data:",e),this.accSetupService.submitOpeningBalanceFormConfiguration(e).subscribe(),console.log("Submitting form data:",e)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275cmp=F({type:t,selectors:[["app-acc-opening-balance-form"]],features:[xe([we])],decls:6,vars:0,consts:[["actionButton",""],["content",""],["header",""],["footer",""],["pageTitle","Opening Balance Form"],["preventOpenDuplicates",""],["label","Submit",3,"onClick"],[3,"formGroup",4,"ngIf"],[3,"formGroup"],["formArrayName","forms",1,"d-flex","flex-column","row-gap-4"],[3,"formGroupName"],[3,"value"],[1,"d-flex","flex-column","gap-2","mx-2"],[1,"fs-5","m-0"],["formControlName","date"],[1,"fs-4"],["formArrayName","items"],["dataKey","id",3,"value"],["pTemplate","header"],["pTemplate","body"],[1,"fs-3"],[1,"fs-3",2,"width","200px"],["formControlName","debitAmount",1,"fs-3","form-control",3,"autoNumeric"],["formControlName","creditAmount",1,"fs-3","form-control",3,"autoNumeric"],[1,"fw-semibold","fs-4"],[1,"text-end",2,"width","200px"]],template:function(r,l){r&1&&(i(0,"app-main-panel",4),g(1,Bt,2,0,"ng-template",null,0,d)(3,jt,1,1,"ng-template",null,1,d),n(),c(5,"p-toast",5))},dependencies:[M,ne,Me,T,be,Se,Be,Ge,$e,je,te,ee,Y,J,N,O,w,Qe,L,$,U,z,qe,j,k,R,X,Ne,Ye,Xe],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var dt=t=>({"ng-invalid ng-dirty":t});function Lt(t,m){if(t&1){let e=h();i(0,"p-button",4),I("onClick",function(){v(e);let l=u();return C(l.saveCredentials())}),o(1,"Update"),n()}}function zt(t,m){t&1&&(i(0,"div",12)(1,"h3",13),o(2,"Account"),n(),i(3,"small",14),o(4,"Configure Client ID and Client Secret"),n()())}function Ut(t,m){if(t&1&&(i(0,"div",5)(1,"p-panel"),g(2,zt,5,0,"ng-template",null,2,d),i(4,"div",6)(5,"div",7)(6,"div",8)(7,"label",9),o(8,"Client ID"),n(),c(9,"input",10),n()(),i(10,"div",7)(11,"div",8)(12,"label",9),o(13,"Client Secret"),n(),c(14,"input",11),n()()()()()),t&2){let e=u();a(4),p("formGroup",e.credentialForm),a(5),p("ngClass",A(3,dt,e.clientIDControl.invalid&&e.clientIDControl.dirty||e.clientIDControl.touched)),a(5),p("ngClass",A(5,dt,e.clientSecretControl.invalid&&e.clientSecretControl.dirty||e.clientSecretControl.touched))}}var ft=(()=>{class t{constructor(e){this.fb=e,this.setupService=s(x)}ngOnInit(){this.initForm(),this.setupService.fetchAPICredential().pipe(B(e=>{this.credentialForm.patchValue({clientID:e.clientID||"",clientSecret:e.clientSecret||""})})).subscribe()}initForm(){this.credentialForm=this.fb.group({clientID:["",[pe.required]],clientSecret:["",[pe.required]]})}get clientIDControl(){return this.credentialForm.get("clientID")}get clientSecretControl(){return this.credentialForm.get("clientSecret")}saveCredentials(){if(this.credentialForm.invalid){this.credentialForm.markAllAsTouched();return}let e=this.credentialForm.getRawValue();console.log("Saving credentials:",e),this.setupService.updateAPICredential(e).subscribe()}static{this.\u0275fac=function(r){return new(r||t)(_e(V))}}static{this.\u0275cmp=F({type:t,selectors:[["app-api-credential"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","API Credential"],[3,"onClick"],[1,"d-flex","flex-column","row-gap-4"],[1,"row",3,"formGroup"],[1,"col-6"],[1,"d-flex","flex-column"],["for","outlet"],["type","text","pInputText","","formControlName","clientID",3,"ngClass"],["type","text","pInputText","","formControlName","clientSecret",3,"ngClass"],[1,"d-flex","flex-column","px-2"],[1,"mb-0","fw-bold"],[1,"fst-italic","text-muted"]],template:function(r,l){r&1&&(i(0,"app-main-panel",3),g(1,Lt,2,0,"ng-template",null,0,d)(3,Ut,15,7,"ng-template",null,1,d),n())},dependencies:[T,Q,j,J,N,O,k,R,w,Z,U,z,M,L,$],encapsulation:2})}}return t})();function Wt(t,m){if(t&1){let e=h();i(0,"button",4),I("click",function(){v(e);let l=u();return C(l.onFormatJournal())}),o(1," Format "),n()}}function qt(t,m){t&1&&(i(0,"div",12)(1,"div",13)(2,"h4",14),o(3,"Journal Configuration"),n(),i(4,"small",15),o(5," Enter your account information to format journal entries "),n()()())}function Ht(t,m){if(t&1){let e=h();i(0,"div",5)(1,"p-panel"),g(2,qt,6,0,"ng-template",null,2,d),i(4,"div",6)(5,"div",7)(6,"p-floatlabel",8)(7,"input",9),he("ngModelChange",function(l){v(e);let f=u();return Ce(f.subdomain,l)||(f.subdomain=l),C(l)}),n(),i(8,"label",10),o(9,"Subdomain"),n()(),i(10,"small",11),o(11,"Enter your account subdomain (e.g., mycompany.dealpos.net)"),n()()()()()}if(t&2){let e=u();a(7),ve("ngModel",e.subdomain)}}var gt=(()=>{class t{constructor(){this.setupService=s(x),this.subdomain=P(""),this.toastrService=s(Fe)}onFormatJournal(){if(!this.subdomain()){this.toastrService.error("Please enter a subdomain","Error");return}this.setupService.formatJournal(this.subdomain()).subscribe({next:e=>{this.toastrService.success(e.message,"Success")}})}static{this.\u0275fac=function(r){return new(r||t)}}static{this.\u0275cmp=F({type:t,selectors:[["app-format-jurnal"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","Format Journal"],[1,"btn","btn-success","rounded",3,"click"],[1,"d-flex","flex-column","row-gap-4"],[1,"row","mt-6"],[1,"col-12"],["variant","on"],["pInputText","","id","subdomain","autocomplete","off",1,"w-100",3,"ngModelChange","ngModel"],["for","subdomain"],[1,"text-muted","fst-italic",2,"font-size","12px"],[1,"row","ps-2"],[1,"col-12","d-flex","flex-column"],[1,"mb-1","fw-bold"],[1,"fst-italic","text-muted"]],template:function(r,l){r&1&&(i(0,"app-main-panel",3),g(1,Wt,2,0,"ng-template",null,0,d)(3,Ht,12,1,"ng-template",null,1,d),n())},dependencies:[T,Y,J,N,Te,w,Z,M,U,z,Ke,He],encapsulation:2})}}return t})();var _t=()=>s(x).fetchOpeningBalanceFormConfiguration();var Mi=[{path:"",redirectTo:"accounting-integration",pathMatch:"full"},{path:"",children:[{path:"accounting-integration",component:pt},{path:"opening-balance-form",component:st,resolve:{data:_t}},{path:"api-crendetial",component:ft},{path:"format-journal",component:gt},{path:"closing-entries",loadComponent:()=>import("./chunk-CGUMUBB7.js").then(t=>t.ClosingPageComponent)},{path:"closing-entries/create",loadComponent:()=>import("./chunk-NOZEL54G.js").then(t=>t.ClosingFormComponent)}]}];export{Mi as ACCOUNTING_SETUP_ROUTES};
package/chunk-NHEN24Y3.js DELETED
@@ -1 +0,0 @@
1
- import{a as v,b as L}from"./chunk-KHP7E7JG.js";import"./chunk-BOVEGMBL.js";import"./chunk-WUPQR4WU.js";import{a as I,b as E}from"./chunk-W4KTL6Y6.js";import"./chunk-7IPVVF6Y.js";import{h as H}from"./chunk-RYHNURUZ.js";import{b as N,c as G}from"./chunk-BX74ZLQG.js";import{a as R,b as D}from"./chunk-CNLYDNON.js";import"./chunk-FTI2QPWV.js";import"./chunk-BDJHC5O6.js";import{w as V,x as j}from"./chunk-LMI4DLB5.js";import"./chunk-W6LBFCQQ.js";import"./chunk-3GHEXAAZ.js";import"./chunk-R6NK3ROE.js";import{a as F}from"./chunk-TDMJ2M6W.js";import{i as w,m as $}from"./chunk-DAQCANBV.js";import"./chunk-F2X3VGZZ.js";import{Cb as B,Jc as s,Kb as p,Kc as l,Mc as x,Nb as C,Ub as o,V as M,Vb as n,Wb as m,X as y,Z as S,_b as P,dc as h,ec as c,gb as a,h as T,ha as f,pa as g,qa as d,ra as b,s as u,sa as k,wb as A,yc as O,zc as _}from"./chunk-WCXWWANV.js";import"./chunk-YQFG5XE2.js";var q=()=>({height:"calc(100vh - 100px)"});function J(i,z){if(i&1){let t=P();o(0,"div",3)(1,"p-button",4),h("onClick",function(){g(t);let r=c();return d(r.onFormatCOA())}),n(),o(2,"p-button",5),s(3,"async"),s(4,"async"),h("onClick",function(){g(t);let r=c();return d(r.onMigrateCoaAccount())}),n()()}if(i&2){let t=c();a(2),p("disabled",l(3,2,t.countInBooks$)!==0)("pTooltip",l(4,4,t.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function K(i,z){if(i&1&&(o(0,"p-scroll-panel")(1,"p-panel")(2,"div",6),m(3,"app-migration-cards",7),s(4,"async"),b(),o(5,"svg",8),m(6,"path",9),n(),k(),m(7,"app-migration-cards",10),s(8,"async"),n()()()),i&2){let t=c();C(_(12,q)),a(),C(_(13,q)),a(2),p("migrationCount",l(4,8,t.countInPOS$))("migrationTitle",t.pageTitle),a(4),p("migrationCount",l(8,10,t.countInBooks$))("migrationTitle",t.pageTitle)}}var gt=(()=>{class i{constructor(){this.migrateService=f(v),this.toastr=f(F),this.refresh$=new T(void 0),this.pageTitle="Chart of Account"}ngOnInit(){let t=this.refresh$.pipe(y(()=>this.migrateService.getCOACount()),S(e=>console.log("API response:",e)),M(1));this.countInPOS$=t.pipe(u(e=>Number(e.pos))),this.countInBooks$=t.pipe(u(e=>Number(e.books)))}onMigrateCoaAccount(){this.migrateService.migrateCoaAccount().subscribe(t=>{this.refresh$.next(),this.toastr.success(t.message,"Migration Successful")})}onFormatCOA(){this.migrateService.formatManualCOA().subscribe(t=>{this.refresh$.next(),this.toastr.success(t.message,"Format Successful")})}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275cmp=A({type:i,selectors:[["app-chart-of-account"]],features:[O([v])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger",3,"onClick"],["label","Migrate","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(e,r){e&1&&(o(0,"app-main-panel",2),B(1,J,5,6,"ng-template",null,0,x)(3,K,9,14,"ng-template",null,1,x),n()),e&2&&p("pageTitle",r.pageTitle)},dependencies:[H,$,w,L,j,V,E,I,D,R,G,N],encapsulation:2})}}return i})();export{gt as ChartOfAccountComponent};
package/chunk-NOZEL54G.js DELETED
@@ -1 +0,0 @@
1
- import{a as K}from"./chunk-JO3SI6HU.js";import{b as J}from"./chunk-BOVEGMBL.js";import"./chunk-WUPQR4WU.js";import{a as q,b as z}from"./chunk-JZTK7BS7.js";import{a as H}from"./chunk-DCKLQNGL.js";import{a as O,b as W}from"./chunk-YVGWGEPX.js";import"./chunk-PDNXU4MC.js";import"./chunk-V4IY7RIP.js";import"./chunk-J6H5UCJR.js";import{h as I}from"./chunk-RYHNURUZ.js";import"./chunk-BX74ZLQG.js";import{a as G,b as A}from"./chunk-CNLYDNON.js";import"./chunk-FTI2QPWV.js";import"./chunk-BDJHC5O6.js";import{o as j,w as k,x as B}from"./chunk-LMI4DLB5.js";import"./chunk-W6LBFCQQ.js";import{b as y,e as D,f as M,k as T,l as w,o as N,v as V,y as R}from"./chunk-3GHEXAAZ.js";import"./chunk-R6NK3ROE.js";import"./chunk-TDMJ2M6W.js";import{E as P,m as F}from"./chunk-DAQCANBV.js";import"./chunk-F2X3VGZZ.js";import{Ab as S,Cb as p,Kb as c,Mc as a,Ub as i,Vb as t,Wb as f,Z as C,_b as b,dc as E,ec as u,gb as _,ha as m,pa as x,qa as h,qc as l,wb as v}from"./chunk-WCXWWANV.js";import"./chunk-YQFG5XE2.js";function L(e,d){if(e&1){let o=b();i(0,"p-button",4),E("onClick",function(){x(o);let n=u();return h(n.onSubmit())}),t()}}function Q(e,d){e&1&&(i(0,"div",13)(1,"h3",14),l(2,"General"),t(),i(3,"span",15),l(4,"Enter your closing Fiscal Date"),t()())}function U(e,d){if(e&1&&(i(0,"div",5)(1,"div",6)(2,"p-panel"),p(3,Q,5,0,"ng-template",null,2,a),i(5,"div",5)(6,"div",7)(7,"form",8)(8,"div",9)(9,"label",10),l(10,"Period"),t(),f(11,"p-datePicker",11),t(),i(12,"div",9)(13,"label",10),l(14,"Description"),t(),f(15,"textarea",12),t()()()()()()()),e&2){let o=u();_(7),c("formGroup",o.form)}}var he=(()=>{class e extends H{constructor(){super(),this.closingEntriesService=m(K),this.dayjsService=m(J),this.fb=m(V),this.router=m(P)}ngOnInit(){this.initForm()}initForm(){this.form=this.fb.group({Period:this.fb.control(new Date),Note:this.fb.control("")})}onSubmit(){if(this.form.invalid){this.form.markAllAsTouched();return}let{Period:o}=this.form.getRawValue(),r=Object.entries(this.form.getRawValue()).reduce((n,[s,g])=>(s==="Period"?n[s]=this.dayjsService.from(o)?this.dayjsService.format(g):"":n[s]=g,n),{});this.closingEntriesService.createClosingEntry(r).pipe(C(()=>{this.router.navigate(["/pages/accounting-setup/closing-entries"])})).subscribe()}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=v({type:e,selectors:[["app-closing-form"]],features:[S],decls:5,vars:1,consts:[["actionButton",""],["content",""],["header",""],["pageTitle","Closing Entries Form",3,"hasMainWrapperPadding"],["label","Submit",3,"onClick"],[1,"row"],[1,"col"],[1,"col-4"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for",""],["formControlName","Period","fluid",""],["formControlName","Note","rows","5","cols","30","pTextarea",""],[1,"d-flex","flex-column","mx-2"],[1,"fs-5","m-0"],[1,"fs-3"]],template:function(r,n){r&1&&(i(0,"app-main-panel",3),p(1,L,1,0,"ng-template",null,0,a)(3,U,16,1,"ng-template",null,1,a),t()),r&2&&c("hasMainWrapperPadding",!0)},dependencies:[I,F,A,G,W,O,j,z,q,B,k,R,T,y,D,M,w,N],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return e})();export{he as ClosingFormComponent};
package/chunk-NRULEUE7.js DELETED
@@ -1 +0,0 @@
1
- function l(t,n,c="application/octet-stream"){let d=new Blob([t],{type:c}),e=window.URL.createObjectURL(d),o=document.createElement("a");o.href=e,o.download=n,document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(e)}export{l as a};