dealposbooks 5.43.0 → 5.43.2

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 (70) hide show
  1. package/{chunk-Q6NOUY4Z.js → chunk-5QKCUI7M.js} +1 -1
  2. package/{chunk-O5EVYQVN.js → chunk-5TF7YHMI.js} +1 -1
  3. package/{chunk-DG63C6O3.js → chunk-5VXLWX4K.js} +1 -1
  4. package/{chunk-7PDMDNJK.js → chunk-62K4JEOY.js} +1 -1
  5. package/{chunk-X4KTMWVO.js → chunk-6O5EWYT7.js} +1 -1
  6. package/{chunk-4FPYSVLT.js → chunk-6XT4TD5A.js} +1 -1
  7. package/{chunk-MDMGBODU.js → chunk-6YJVOMOB.js} +1 -1
  8. package/{chunk-WLKS6LBU.js → chunk-7COI2POD.js} +1 -1
  9. package/{chunk-VTMQTY2F.js → chunk-7EIBD6QJ.js} +1 -1
  10. package/{chunk-MJJXITD5.js → chunk-7GIBHGH4.js} +1 -1
  11. package/chunk-AF357XP4.js +1 -0
  12. package/{chunk-CX3TZ3F3.js → chunk-BUYRVZ5Z.js} +1 -1
  13. package/{chunk-2DSX3KAL.js → chunk-BWJHODYX.js} +2 -2
  14. package/chunk-CIVJWHAU.js +202 -0
  15. package/{chunk-UYGD5VP2.js → chunk-DQQKEX6Z.js} +1 -1
  16. package/{chunk-AUWCRG4B.js → chunk-DXRSED76.js} +1 -1
  17. package/{chunk-3MDAGJGX.js → chunk-EQ7DUTAS.js} +1 -1
  18. package/{chunk-KBXNDYNF.js → chunk-ESHOCSRS.js} +1 -1
  19. package/chunk-FDBRUAV5.js +1 -0
  20. package/chunk-FEV4P4DL.js +7 -0
  21. package/{chunk-ROJ6NA2I.js → chunk-GQI7GXAK.js} +1 -1
  22. package/{chunk-Q2RQ5PCS.js → chunk-GZRKRXV7.js} +1 -1
  23. package/chunk-HW2B6ZTB.js +129 -0
  24. package/{chunk-3XWJYJ4W.js → chunk-I7G575WF.js} +1 -1
  25. package/{chunk-HEX727RH.js → chunk-IYO6P6XI.js} +1 -1
  26. package/{chunk-EOT2WEXN.js → chunk-JUCJGYST.js} +1 -1
  27. package/{chunk-PNDE7M5T.js → chunk-LCZ3RU6J.js} +1 -1
  28. package/{chunk-MWKQV6FL.js → chunk-MERIFED5.js} +1 -1
  29. package/{chunk-FFBH7KYD.js → chunk-N3CCHUQK.js} +1 -1
  30. package/{chunk-4TSB6554.js → chunk-N72GOCDS.js} +2 -2
  31. package/{chunk-JRH7ZWIT.js → chunk-OB7IGUCM.js} +1 -1
  32. package/{chunk-O6C3N77O.js → chunk-ONN4TIOR.js} +1 -1
  33. package/{chunk-MGTSVSFN.js → chunk-OZ4T5P3A.js} +1 -1
  34. package/{chunk-4JVYK7DR.js → chunk-P2BR2DYT.js} +1 -1
  35. package/{chunk-6MOKBNZ6.js → chunk-PBMTWCM7.js} +1 -1
  36. package/{chunk-BJ4RON42.js → chunk-PPKCZMH4.js} +1 -1
  37. package/{chunk-6EDSP2AA.js → chunk-PZAVQQFP.js} +12 -12
  38. package/{chunk-J2LCCQ6P.js → chunk-RIAHEVKE.js} +1 -1
  39. package/{chunk-B4JW5G5L.js → chunk-RJSTA3LD.js} +1 -1
  40. package/{chunk-J7XLDEPN.js → chunk-RZVVQ2WV.js} +1 -1
  41. package/{chunk-VNUZJSHB.js → chunk-SJCXXNYW.js} +1 -1
  42. package/{chunk-WPQGYVNT.js → chunk-SVHOGUGR.js} +1 -1
  43. package/{chunk-X6D7ZE6G.js → chunk-TLGBF4OA.js} +1 -1
  44. package/chunk-TNMWSTYV.js +1 -0
  45. package/chunk-TRUGVHVM.js +1 -0
  46. package/chunk-TUX7WEBX.js +2 -0
  47. package/{chunk-6WBZACEK.js → chunk-VF3ARYUC.js} +1 -1
  48. package/{chunk-7R6GFW7F.js → chunk-VHKLRJNY.js} +1 -1
  49. package/{chunk-KLKIEREL.js → chunk-VPQDUC77.js} +1 -1
  50. package/{chunk-HVXMIONQ.js → chunk-WAIG32DS.js} +1 -1
  51. package/{chunk-5CI4POVW.js → chunk-XA75ROED.js} +1 -1
  52. package/{chunk-SUKZ6XS4.js → chunk-XFMPZEYT.js} +1 -1
  53. package/{chunk-XYU7C523.js → chunk-XIKOS3R2.js} +1 -1
  54. package/chunk-XIUI7VXN.js +160 -0
  55. package/{chunk-M3WCSF6D.js → chunk-XMHQMMFC.js} +1 -1
  56. package/{chunk-NDWYDOFG.js → chunk-YQGBYYHV.js} +1 -1
  57. package/{chunk-EM4HKTKQ.js → chunk-ZE2UEAPO.js} +1 -1
  58. package/{chunk-LT3ZB5UZ.js → chunk-ZJ2QSE55.js} +1 -1
  59. package/index.html +2 -2
  60. package/{main-2JJLKGIJ.js → main-3LQSSUNF.js} +1 -1
  61. package/package.json +1 -1
  62. package/chunk-23R63A5E.js +0 -1
  63. package/chunk-3TIJYNSV.js +0 -2
  64. package/chunk-6JKCYLO5.js +0 -202
  65. package/chunk-GKFRKDT6.js +0 -7
  66. package/chunk-IY4CV424.js +0 -1
  67. package/chunk-ORLKNWW4.js +0 -1
  68. package/chunk-SVFKNAYN.js +0 -160
  69. package/chunk-UCCAYD3A.js +0 -129
  70. package/chunk-ZIEHNLX3.js +0 -1
@@ -0,0 +1,160 @@
1
+ import{a as pt,b as dt}from"./chunk-ZEWON3MW.js";import{a as ut}from"./chunk-MS6WBVQX.js";import{a as $n,b as Ee,c as Pe,d as Kn}from"./chunk-IYO6P6XI.js";import{a as Rn,b as Bn}from"./chunk-PPKCZMH4.js";import"./chunk-CNXEJBY5.js";import{a as qn,b as zn}from"./chunk-M5PA3FZY.js";import{a as Gn}from"./chunk-XKI7WLHE.js";import{a as Dn}from"./chunk-MPHY6FVN.js";import"./chunk-NMSYINDE.js";import{a as we}from"./chunk-AF357XP4.js";import"./chunk-7COI2POD.js";import{a as at,b as lt}from"./chunk-NHZLS6JU.js";import{a as ct,b as mt,c as On,d as Fn,i as Nn,j as Vn,k as Ln}from"./chunk-VPQDUC77.js";import"./chunk-76LPTGLX.js";import"./chunk-CWHL7PNC.js";import"./chunk-VRKBMD72.js";import{a as X}from"./chunk-5QKCUI7M.js";import{a as L}from"./chunk-KXE3J4PK.js";import{b as vn}from"./chunk-E3QNEH3B.js";import{a as In}from"./chunk-JUCJGYST.js";import{a as Mn,b as st}from"./chunk-6O5EWYT7.js";import"./chunk-I7ILLTFH.js";import"./chunk-2LQVI4EI.js";import"./chunk-SPKOXGSS.js";import"./chunk-3KYU6FI2.js";import"./chunk-IJTQE2H4.js";import{a as rt,b as K}from"./chunk-WXT6EZ2V.js";import"./chunk-AJZ7YLT4.js";import"./chunk-ATJ55H5D.js";import{f as kn,h as $}from"./chunk-5TF7YHMI.js";import{b as ot,c as _e}from"./chunk-L3PZS6EL.js";import{a as se,b as ce}from"./chunk-5JV52UYK.js";import{a as J,b as Tn,c as An,e as wn,f as En,g as Pn}from"./chunk-ACTRMWEI.js";import{c as Je,d as an,f as ln}from"./chunk-ARXP327B.js";import{a as Tt,f as At,n as nt,o as it,p as bn,t as Sn,u as wt,w as ae,x as le}from"./chunk-7FFMPB6T.js";import"./chunk-UKBDY33R.js";import{Aa as gn,D as yt,Da as hn,I as sn,Ia as xn,K as cn,La as Ae,M as mn,Ma as De,Oa as Cn,Q as et,R as tt,Ua as yn,W as pn,X as It,_ as dn,b as oe,c as fe,da as un,e as Y,f as ye,g as on,ga as fn,i as V,j as Xe,k as rn,ka as _n,l as Ie,na as bt,o as be,qa as re,u as ve,va as vt,w as Se,wa as St,x as Te}from"./chunk-72LNXEXV.js";import{b as ne,d as ie,e as B,l as N}from"./chunk-EFDD6Q3K.js";import{a as nn}from"./chunk-XMHQMMFC.js";import"./chunk-ZDTMCWOO.js";import{c as xt,d as Ct,f as Ve,h as Le}from"./chunk-F2X3VGZZ.js";import{h as z,j as We,k as O,l as ht,m as en,p as tn,q as Ye,s as F,t as Ne}from"./chunk-SB5MSLCX.js";import{$b as w,$c as Ce,Aa as ee,Bb as Oe,Cc as he,D as Ke,Db as u,Dc as R,Ec as T,Fc as Yt,Ha as v,J as qe,Kb as P,L as $t,Lb as s,Nc as de,Ob as He,Oc as xe,P as Kt,Pb as Fe,Pc as Xt,Qb as Ut,Rb as jt,Rc as I,Tb as Zt,Ub as Qt,Vb as a,Wb as r,Xb as h,Y as D,Yb as H,Zb as U,_ as A,_c as ue,ba as qt,bd as W,c as $e,ca as ze,cb as Me,cd as Jt,da as zt,db as Gt,ec as S,fc as m,hb as c,ia as x,kc as Ue,lc as pe,mc as j,nb as gt,nc as Z,qa as _,qc as te,ra as g,rc as p,s as G,sc as E,t as Bt,tc as Q,ua as Ge,vc as Wt,wc as je,xb as M,xc as Ze,yb as Ht,yc as Qe}from"./chunk-6K5LNQ4J.js";import{a as C,b as y}from"./chunk-YQFG5XE2.js";var ii=["class","page"],oi=t=>({id:t}),ri=()=>({"overflow-x":"auto"}),ai=t=>({"table-borderless":t}),li=t=>["fa-solid",t],si=t=>["/pages/journal/journal-entry/",t];function ci(t,l){t&1&&h(0,"p-button",8)}function mi(t,l){if(t&1){let e=w();a(0,"p-button",9),S("onClick",function(){_(e);let i=m(2);return g(i.onDelete())}),r()}}function pi(t,l){if(t&1&&(a(0,"div",4)(1,"p-button-group"),u(2,ci,1,0,"p-button",5)(3,mi,1,0,"p-button",6),r(),a(4,"a",7),p(5,"Ledger"),r()()),t&2){let e,n=m();c(2),s("ngIf",n.roleService.coa().edit),c(),s("ngIf",n.roleService.coa().delete),c(),s("queryParams",T(3,oi,(e=n.COAInfo())==null?null:e.id))}}function di(t,l){if(t&1&&h(0,"i",25),t&2){let e=l.checked;s("ngClass",T(1,li,e?"fa-check":"fa-xmark"))}}function ui(t,l){if(t&1&&(H(0),p(1),de(2,"number"),U()),t&2){let e=m().$implicit;c(),Q(" ",xe(2,1,e.creditAmount)," ")}}function fi(t,l){if(t&1&&(H(0),p(1),de(2,"number"),U()),t&2){let e=m().$implicit;c(),Q(" ",xe(2,1,e.debitAmount)," ")}}function _i(t,l){if(t&1&&(a(0,"tr")(1,"td"),p(2),de(3,"date"),r(),a(4,"td")(5,"div",26)(6,"a",27),p(7),r()()(),a(8,"td",28),u(9,ui,3,3,"ng-container",29),r(),a(10,"td",30),u(11,fi,3,3,"ng-container",29),r(),a(12,"td",31),p(13),de(14,"number"),r()()),t&2){let e=l.$implicit;c(2),E(Xt(3,6,e.date,"dd MMM yyyy")),c(4),s("routerLink",T(11,si,e.id)),c(),E(e.number),c(2),s("ngIf",e.creditAmount!==0),c(2),s("ngIf",e.debitAmount!==0),c(2),Q(" ",xe(14,9,e.balance)," ")}}function gi(t,l){t&1&&(a(0,"tr")(1,"td",32)(2,"div",33),h(3,"img",34),a(4,"div",26)(5,"span",35),p(6,"No Data Available"),r(),a(7,"span",35),p(8,"Your data will be shown here once it's available"),r()()()()())}function hi(t,l){if(t&1){let e=w();a(0,"div",12)(1,"div",13)(2,"p-card",14)(3,"div",15)(4,"div",16)(5,"div",17),p(6,"Name"),r(),a(7,"div",18),p(8),r()(),a(9,"div",16)(10,"div",17),p(11,"Code"),r(),a(12,"div",18),p(13),r()(),a(14,"div",16)(15,"div",17),p(16,"Category"),r(),a(17,"div",18),p(18),r()(),a(19,"div",16)(20,"div",17),p(21,"Note"),r(),a(22,"div",18),p(23),r()(),a(24,"div",16)(25,"div",17),p(26,"Outlet"),r(),a(27,"div",18),p(28),r()(),a(29,"div",16)(30,"div",17),p(31,"Discontinued"),r(),a(32,"div",18)(33,"p-toggleswitch",19),S("onChange",function(i){_(e);let o=m(2);return g(o.onDiscontinued(i))}),u(34,di,1,3,"ng-template",null,2,I),r()()(),a(36,"div",16)(37,"div",17),p(38,"Access Type"),r(),a(39,"div",18),p(40),r()()()()(),a(41,"div",20)(42,"p-card",21)(43,"table",22)(44,"thead")(45,"tr")(46,"th",23),p(47,"Date"),r(),a(48,"th",23),p(49,"Number"),r(),a(50,"th",24),p(51,"Credit"),r(),a(52,"th",24),p(53,"Debit"),r(),a(54,"th",24),p(55,"Balance"),r()()(),a(56,"tbody"),Zt(57,_i,15,13,"tr",null,jt),u(59,gi,9,0,"tr"),r()()()()()}if(t&2){let e,n,i,o,d,f,b=m(2);c(8),E((e=b.COAInfo().name)!==null&&e!==void 0?e:"-"),c(5),E((n=b.COAInfo().code)!==null&&n!==void 0?n:"-"),c(5),E((i=b.COAInfo().category)!==null&&i!==void 0?i:"-"),c(5),E((o=b.COAInfo().note)!==null&&o!==void 0?o:"-"),c(5),E((d=b.COAInfo().outletName)!==null&&d!==void 0?d:"-"),c(5),s("ngModel",b.COAInfo().bin),c(7),E((f=b.COAInfo().accessType)!==null&&f!==void 0?f:"-"),c(2),He(R(11,ri)),c(),s("ngClass",T(12,ai,b.COAInfo().transactions.length===0)),c(14),Qt(b.COAInfo().transactions),c(2),Ut(b.COAInfo().transactions.length===0?59:-1)}}function xi(t,l){if(t&1&&(a(0,"div",10),u(1,hi,60,14,"div",11),r()),t&2){let e=m();c(),s("ngIf",e.COAInfo())}}var Hn=(()=>{class t{constructor(){this.#e=x(X),this.#t=x(ne),this.router=x(ie),this.COAInfo=v(null),this.checked=v(!1),this.roleService=x(we)}#e;#t;ngOnInit(){this.#t.paramMap.pipe(L("params"),D(e=>this.#e.getChartAccountById(e.get("id"))),A(e=>this.COAInfo.set(e)),L("response")).subscribe()}onDelete(){if(!confirm("Are you sure you want to delete this Chart of Accounts?"))return;let n=[this.#t.snapshot.paramMap.get("id")];this.#e.deleteChartAccount(n).pipe(A(()=>{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(n){return new(n||t)}}static{this.\u0275cmp=M({type:t,selectors:[["app-coa-account-info",8,"page"]],attrs:ii,decls:5,vars:1,consts:[["actionButton",""],["content",""],["handle",""],["pageTitle","Chart of Account Details",3,"overflowScroll"],[1,"d-flex","gap-2"],["routerLink","edit","severity","secondary","outlined","","label","Edit","icon","fa-solid fa-pen-to-square",4,"ngIf"],["severity","secondary","outlined","","label","Delete","icon","fa-solid fa-trash",3,"onClick",4,"ngIf"],["routerLink","/pages/report/general-ledger",1,"p-button",3,"queryParams"],["routerLink","edit","severity","secondary","outlined","","label","Edit","icon","fa-solid fa-pen-to-square"],["severity","secondary","outlined","","label","Delete","icon","fa-solid fa-trash",3,"onClick"],[1,"container-fluid"],["class","row justify-content-center mt-3 px-2",4,"ngIf"],[1,"row","justify-content-center","mt-3","px-2"],[1,"col","col-lg-5"],["styleClass","h-100"],[1,"d-flex","flex-column","row-gap-4"],[1,"row"],[1,"col","col-lg-4"],[1,"col"],[3,"onChange","ngModel"],[1,"col","col-lg-7"],["styleClass","h-100",1,"right-panel","h-100"],[1,"table",3,"ngClass"],["scope","col"],["scope","col",1,"text-end"],[3,"ngClass"],[1,"d-flex","flex-column"],["target","_blank",1,"link","link-primary",3,"routerLink"],[1,"text-danger","text-end"],[4,"ngIf"],[1,"text-success","text-end"],[1,"text-end"],["colspan","5",1,"text-center"],[1,"d-flex","flex-column","align-items-center","gap-2"],["src","https://res.cloudinary.com/pos/image/upload/v1705388070/POS/Images/Cashier/globalnodata.svg","alt","No Data"],[1,"text-secondary","text-opacity-75"]],template:function(n,i){n&1&&(a(0,"app-main-panel",3),u(1,pi,6,5,"ng-template",null,0,I)(3,xi,2,1,"ng-template",null,1,I),r()),n&2&&s("overflowScroll",!0)},dependencies:[F,z,O,Ye,tn,Se,Y,Xe,Je,N,B,$,K,rt,le,ae,dt,pt,On,Dn],styles:[".table>thead>tr>th{background-color:#f6f6f6!important;color:#000!important;font-weight:500!important}"],changeDetection:0})}}return t})();var me=(()=>{class t{constructor(){this.httpService=x(nn)}fetchCOACategories(){return this.httpService.get("","api/ChartOfAccount/Category")}getCOACategoryByID(e){let n={params:e};return this.httpService.get("","api/ChartOfAccount/CategoryInfo",n)}renameCategory(e,n){return this.httpService.put("",`api/ChartOfAccount/RenameCategory/${e}`,n)}updateParentCategory(e,n){return this.httpService.put("",`api/ChartOfAccount/UpdateParentCategory/${e}`,n).pipe()}deleteCategory(e){return this.httpService.delete("",`api/ChartOfAccount/Category/${e}`)}submitCategory(e,n={}){return this.httpService.post("","api/ChartOfAccount/SubmitCategory",e,n)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=ze({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Pt=t=>t?t.reduce((l,e)=>(l.push({label:e.label,data:e.data,key:e.key}),e.children&&e.children.length?l.push(...Pt(e.children)):l.push({label:`${e.label} (no children)`,data:e.data,key:`${e.key}-no-children`}),l),[]):[];var kt=(t,l,e)=>{let n=Math.ceil(e/l),i=(t-1)*l+1,o=Math.min(t*l,e);return{start:i,end:o,totalRecords:e,totalPages:n}};var Ci={filter:{PageSize: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"}]},Mt=Tn(En(Ci),Pn("ChartOfAccount"),An(t=>({isAllChecked:W(()=>t.data().every(l=>l.checked)),checkedItems:W(()=>t.data().filter(l=>l.checked)),IDsChecked:W(()=>t.data().filter(l=>l.checked).map(l=>l.id)),categories:W(()=>Pt(t.options.categories())),first:W(()=>{let{start:l}=kt(t.filter().PageNumber,t.filter().PageSize,t.count());return l}),last:W(()=>{let{end:l}=kt(t.filter().PageNumber,t.filter().PageSize,t.count());return l})})),wn(t=>{let l=x(X),e=x(me),n={updateFilter(i){J(t,{filter:C({},i)})},checkedItem(i){if(Array.isArray(i))i.forEach(o=>{let d=t.data().map(f=>f.id===o.id?y(C({},f),{checked:!o.checked}):f);J(t,{data:d})});else{let o=i,d=t.data().map(f=>f.id===o.id?y(C({},f),{checked:!o.checked}):f);J(t,{data:d})}},checkAllCheckbox(){let i=t.data().map(o=>y(C({},o),{checked:!o.checked}));J(t,{data:i})},fetchChartOfAccount:at($e(Ke(()=>!!t.filter()),$t(300),Kt(),D(i=>l.getPaginatedChartAccounts(i).pipe(G(o=>y(C({},o),{data:o.data.map(d=>y(C({},d),{checked:!1}))})),lt({next:o=>J(t,{data:o.data,count:o.count}),error:o=>{J(t,{data:[],count:0}),console.error(o)}}))))),fetchLoader:at($e(D(()=>l.getChartOfAccountLoader().pipe(lt({next:i=>{J(t,{filter:y(C({},t.filter()),{PageSize:i.filter.pageSize,PageNumber:1,CategoryID:i.filter.categoryID||null,Text:"",listOutletID:[]}),options:i.options}),n.fetchChartOfAccount(t.filter)},error:i=>{console.error(i)}}))))),getCategories:at($e(qe(()=>e.fetchCOACategories().pipe(lt({next:i=>{J(t,{options:{entities:t.options.entities(),categories:i}})},error:i=>{console.error(i)}})))))};return n}));var bi=["class","page"],vi=t=>["../account/",t],Si=t=>({"text-decoration-line-through":t}),Ti=()=>["/pages/report/general-ledger"],Ai=t=>({id:t});function wi(t,l){if(t&1){let e=w();a(0,"p-button",13),S("onClick",function(){_(e);let i=m(2);return g(i.deleteCOA())}),r()}}function Ei(t,l){t&1&&h(0,"p-button",14)}function Pi(t,l){if(t&1){let e=w();a(0,"p-button",15),S("onClick",function(){_(e);let i=m(2);return g(i.onExport())}),r()}}function ki(t,l){t&1&&(a(0,"a",16),h(1,"i",17),p(2," Add"),r())}function Mi(t,l){if(t&1&&(a(0,"div",8),u(1,wi,1,0,"p-button",9),a(2,"p-button-group"),u(3,Ei,1,0,"p-button",10)(4,Pi,1,0,"p-button",11),r(),u(5,ki,3,0,"a",12),r()),t&2){let e=m();c(),s("ngIf",e.store.checkedItems().length&&e.roleService.coa().delete),c(2),s("ngIf",e.roleService.coa().create),c(),s("ngIf",e.roleService.global().export),c(),s("ngIf",e.roleService.coa().create)}}function Oi(t,l){t&1&&(a(0,"th",21),h(1,"p-tableHeaderCheckbox"),r())}function Fi(t,l){if(t&1&&(a(0,"tr"),u(1,Oi,2,0,"th",19),a(2,"th"),p(3,"Code"),r(),a(4,"th"),p(5,"Name"),r(),a(6,"th"),p(7,"Category"),r(),a(8,"th"),p(9,"Outlet"),r(),a(10,"th",20),p(11,"Balance"),r()()),t&2){let e=m(2);c(),s("ngIf",e.roleService.coa().delete)}}function Ni(t,l){if(t&1&&(a(0,"td"),h(1,"p-tableCheckbox",25),r()),t&2){let e=m().$implicit;c(),s("value",e)}}function Vi(t,l){if(t&1&&(a(0,"tr"),u(1,Ni,2,1,"td",22),a(2,"td"),p(3),r(),a(4,"td")(5,"a",23),p(6),r()(),a(7,"td"),p(8),r(),a(9,"td"),p(10),r(),a(11,"td",20)(12,"a",24),p(13),de(14,"number"),r()()()),t&2){let e,n=l.$implicit,i=m(2);c(),s("ngIf",i.roleService.coa().delete),c(2),E(n.code),c(2),s("routerLink",T(12,vi,n.id))("ngClass",T(14,Si,n.bin)),c(),E(n.name),c(2),E(n.category),c(2),E(n.outletName),c(2),s("routerLink",R(16,Ti))("queryParams",T(17,Ai,n.id)),c(),E(xe(14,10,(e=n.balance)!==null&&e!==void 0?e:0))}}function Li(t,l){if(t&1&&p(0),t&2){let e=m(2);Wt(" Showing ",e.store.first()," to ",e.store.last()," of ",e.store.count()," entries ")}}function Di(t,l){t&1&&(a(0,"tr")(1,"td",26)(2,"span"),p(3,"No records found."),r()()())}function Ri(t,l){if(t&1){let e=w();a(0,"p-panel")(1,"p-table",18),S("onLazyLoad",function(i){_(e);let o=m();return g(o.loadData(i))})("onRowSelect",function(i){_(e);let o=m();return g(o.onRowSelect(i))})("onRowUnselect",function(i){_(e);let o=m();return g(o.onRowUnselect(i))})("onHeaderCheckboxToggle",function(i){_(e);let o=m();return g(o.onSelectAll(i))})("onPage",function(i){_(e);let o=m();return g(o.onPageChange(i))}),u(2,Fi,12,1,"ng-template",null,3,I)(4,Vi,15,19,"ng-template",null,4,I)(6,Li,1,3,"ng-template",null,5,I)(8,Di,4,0,"ng-template",null,6,I),r()()}if(t&2){let e=m();c(),s("lazy",!0)("value",e.store.data())("paginator",!0)("rows",e.store.filter().PageSize)("totalRecords",e.store.count())}}function Bi(t,l){if(t&1){let e=w();a(0,"form",28)(1,"div",29)(2,"label",30),p(3,"Outlet"),r(),h(4,"p-multiselect",31),r(),a(5,"div",29)(6,"label",30),p(7,"Category"),r(),a(8,"p-treeselect",32),S("onFocus",function(){_(e);let i=m(2);return g(i.onCategoryFocus())}),r()(),a(9,"div",33)(10,"label",30),p(11,"Page Size"),r(),h(12,"input",34),r(),a(13,"div",33)(14,"label",30),p(15,"Discontinued"),r(),a(16,"div",35)(17,"div",36),h(18,"p-radiobutton",37),a(19,"label",38),p(20,"No"),r()(),a(21,"div",36),h(22,"p-radiobutton",39),a(23,"label",40),p(24,"Yes"),r()(),a(25,"div",36),h(26,"p-radiobutton",39),a(27,"label",40),p(28,"All"),r()()()()()}if(t&2){let e=m(2);s("formGroup",e.formFilter),c(4),s("showClear",!0)("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.options().entities),c(4),s("fluid",!0)("showClear",!0)("options",e.categoryNodes()),c(10),s("value",0),c(4),s("value",1),c(4),s("value",2)}}function $i(t,l){if(t&1&&u(0,Bi,29,11,"form",27),t&2){let e=m();s("ngIf",e.formFilter)}}var jn=(()=>{class t{ngOnInit(){this.store.fetchLoader(),console.log(this.store.filter().PageSize),this.generateFilterForm()}#e;constructor(){this.routeInfo=Zn,this.store=x(Mt),this.#e=x(X),this.modalService=x(an),this.roleService=x(we),this.dialogVisible=v(!1),this.categoryNodes=v([]),this.fb=x(ve),this.isDialogFilterVisible=v(!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().PageSize),discontinued:this.fb.control(2)})}onPageChange(e){console.log("Page changed to: ",e),this.store.updateFilter(y(C({},this.store.filter()),{PageNumber:e.first/e.rows+1}))}onCategoryFocus(){this.#e.getCachedCategoriesOptions().pipe(A(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(y(C({},this.store.filter()),{Text:e}))}updateFilter(e,n){this.store.updateFilter(y(C({},this.store.filter()),{[e]:n}))}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(L("response"),A(e=>{console.log("Delete COA Response: ",e),this.store.updateFilter(C({},this.store.filter()))})).subscribe()}onSearchEvent(e){this.store.updateFilter(y(C({},this.store.filter()),{PageNumber:1,Text:e.trim()}))}onFilterEvent(){this.dialogVisible.update(e=>!e)}onFilterOKEvent(){let{categoryID:e,pageSize:n,outletID:i,discontinued:o}=this.formFilter.value;this.store.updateFilter(y(C({},this.store.filter()),{listOutletID:i,CategoryID:e?e.key:"",PageSize:+n,Discontinued:o})),this.isDialogFilterVisible.update(d=>!d)}onExport(){let e=y(C({},this.store.filter()),{ExportPageNumber:1,ExportPageSize:1e4});this.#e.exportChartOfAccounts(e).pipe(A(n=>{let i=n.headers;console.log("All headers:",i.keys());let o=i.get("Content-Disposition"),d=i.get("content-disposition"),f=o??d,b="download.csv";if(f){let q=f.match(/filename\*?=(?:UTF-8'')?"?([^;\r\n"]+)/i);q&&q[1]&&(b=decodeURIComponent(q[1].replace(/"/g,"")))}let k=n.body;Kn(k,b,k.type)})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=M({type:t,selectors:[["app-cash-of-account",8,"page"]],features:[he([Mt])],attrs:bi,decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Chart of Account",3,"search","isDialogFilterVisibleChange","filterEmitted","filterConfirmed","isSearchableInput","isDialogFilterVisible","isFilterable","scrollable"],[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",4,"ngIf"],["outlined","","severity","secondary","label","Export","icon","fa-solid fa-upload",3,"onClick",4,"ngIf"],["class","p-button","routerLink","add",4,"ngIf"],["icon","fa-solid fa-trash","label","Delete","severity","danger",3,"onClick"],["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"],["dataKey","id","styleClass","d-flex flex-column justify-content-between h-100",1,"",3,"onLazyLoad","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","onPage","lazy","value","paginator","rows","totalRecords"],["style","width: 1rem",4,"ngIf"],[1,"text-end"],[2,"width","1rem"],[4,"ngIf"],[1,"link-primary",3,"routerLink","ngClass"],[1,"link","link-primary",3,"routerLink","queryParams"],[3,"value"],["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"],["scrollHeight","300px","filter","","filterBy","label","appendTo","body","formControlName","categoryID","optionLabel","label","optionValue","key","placeholder","Select a Category",3,"onFocus","fluid","showClear","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(n,i){if(n&1){let o=w();a(0,"app-main-panel",7),S("search",function(f){return _(o),g(i.onSearchEvent(f))}),Qe("isDialogFilterVisibleChange",function(f){return _(o),Ze(i.isDialogFilterVisible,f)||(i.isDialogFilterVisible=f),g(f)}),S("filterEmitted",function(){return _(o),g(i.onFilterEvent())})("filterConfirmed",function(){return _(o),g(i.onFilterOKEvent())}),u(1,Mi,6,4,"ng-template",null,0,I)(3,Ri,10,5,"ng-template",null,1,I)(5,$i,1,1,"ng-template",null,2,I),r()}n&2&&(s("isSearchableInput",!0),je("isDialogFilterVisible",i.isDialogFilterVisible),s("isFilterable",!0)("scrollable",!0))},dependencies:[F,z,O,Ye,$,ln,dt,pt,ut,Se,rn,oe,Y,ye,N,B,Te,Ie,be,Je,Ln,Fn,Nn,Vn,K,kn,le,ae,st,it,nt,_e,Bn,Rn,Pe,Ee,ce,se,mt,ct],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 t})();var qi=["class","page"],zi=()=>["../../"],Ft=t=>({"ng-invalid ng-dirty":t}),Gi=t=>({"ng-dirty ng-invalid":t});function Hi(t,l){if(t&1){let e=w();a(0,"div",5)(1,"a",6),p(2,"Cancel"),r(),a(3,"p-button",7),S("onClick",function(){_(e);let i=m();return g(i.onSubmit())}),r()()}t&2&&(c(),s("routerLink",R(1,zi)))}function Ui(t,l){t&1&&(a(0,"div",34),p(1," Name is required "),r())}function ji(t,l){if(t&1&&(a(0,"div"),u(1,Ui,2,0,"div",33),r()),t&2){let e=m(2);c(),s("ngIf",e.form.controls.Name.errors.required)}}function Zi(t,l){t&1&&(a(0,"div",35)(1,"p"),p(2," If you assign an outlet for this account, it is only visible for users who has access to that outlet. "),r()())}function Qi(t,l){if(t&1&&(a(0,"span",36),p(1),r()),t&2){let e=l.$implicit;s("pTooltip",e.name),c(),Q(" ",e.name," ")}}function Wi(t,l){t&1&&(a(0,"div",34),p(1," Code is required "),r())}function Yi(t,l){if(t&1&&(a(0,"div"),u(1,Wi,2,0,"div",33),r()),t&2){let e=m(2);c(),s("ngIf",e.form.controls.Code.errors.required)}}function Xi(t,l){t&1&&(a(0,"div",34),p(1," Note is required "),r())}function Ji(t,l){if(t&1&&(a(0,"div"),u(1,Xi,2,0,"div",33),r()),t&2){let e=m(2);c(),s("ngIf",e.form.controls.Note.errors.required)}}function eo(t,l){if(t&1&&p(0),t&2){let e=l.$implicit;Q(" ",(e==null?null:e.fullLabel)||(e==null?null:e.label)||"Select a category"," ")}}function to(t,l){t&1&&(a(0,"div",34),p(1," Category is required "),r())}function no(t,l){if(t&1&&(a(0,"div"),u(1,to,2,0,"div",33),r()),t&2){let e=m(2);c(),s("ngIf",e.form.controls.Category.errors.required)}}function io(t,l){t&1&&(a(0,"div",34),p(1," Note is required "),r())}function oo(t,l){if(t&1&&(a(0,"div"),u(1,io,2,0,"div",33),r()),t&2){let e=m(2);c(),s("ngIf",e.form.controls.Note.errors.required)}}function ro(t,l){t&1&&(a(0,"div",34),p(1," Note is required "),r())}function ao(t,l){if(t&1&&(a(0,"div"),u(1,ro,2,0,"div",33),r()),t&2){let e=m(2);c(),s("ngIf",e.form.controls.Note.errors.required)}}function lo(t,l){if(t&1&&(a(0,"p-panel",8)(1,"div",9)(2,"div",10)(3,"div",11)(4,"div",12)(5,"label",13),p(6,"Name"),r(),h(7,"input",14),u(8,ji,2,1,"div",15),r()(),a(9,"div",11)(10,"div",16)(11,"label",13),p(12,"Outlet"),r(),a(13,"span",17),h(14,"i",18),r(),u(15,Zi,3,0,"ng-template",null,2,I),r(),a(17,"p-select",19),u(18,Qi,2,2,"ng-template",null,3,I),r()()(),a(20,"div",10)(21,"div",11)(22,"div",12)(23,"label",13),p(24,"Code"),r(),h(25,"input",20),u(26,Yi,2,1,"div",15),r()(),a(27,"div",11)(28,"div",12)(29,"label",13),p(30,"Discontinued"),r(),a(31,"div",10)(32,"div",21),h(33,"p-radiobutton",22),a(34,"label",23),p(35,"No"),r()(),a(36,"div",24),h(37,"p-radiobutton",25),a(38,"label",26),p(39,"Yes"),r()()(),u(40,Ji,2,1,"div",15),r()()(),a(41,"div",10)(42,"div",11)(43,"div",27)(44,"label",13),p(45,"Category"),r(),a(46,"p-treeselect",28),u(47,eo,1,1,"ng-template",29),r(),u(48,no,2,1,"div",15),r()(),a(49,"div",11)(50,"div",12)(51,"label",13),p(52,"Access Type"),r(),a(53,"div",10)(54,"div",30),h(55,"p-select",31),r()(),u(56,oo,2,1,"div",15),r()()(),a(57,"div",10)(58,"div",11)(59,"div",12)(60,"label",13),p(61,"Note"),r(),h(62,"textarea",32),u(63,ao,2,1,"div",15),r()(),h(64,"div",11),r()()()),t&2){let e=te(16),n=m();s("formGroup",n.form),c(7),s("ngClass",T(21,Ft,n.form.controls.Name.invalid&&(n.form.controls.Name.dirty||n.form.controls.Name.touched))),c(),s("ngIf",n.form.controls.Name.invalid&&(n.form.controls.Name.dirty||n.form.controls.Name.touched)),c(5),s("pTooltip",e),c(4),s("fluid",!0)("options",n.outlets()),c(8),s("ngClass",T(23,Ft,n.form.controls.Code.invalid&&(n.form.controls.Code.dirty||n.form.controls.Code.touched))),c(),s("ngIf",n.form.controls.Code.invalid&&(n.form.controls.Code.dirty||n.form.controls.Code.touched)),c(7),s("value",!1),c(4),s("value",!0),c(3),s("ngIf",n.form.controls.Note.errors),c(6),s("fluid",!0)("options",n.categoryOptions())("ngClass",T(25,Gi,n.form.controls.Category.invalid&&(n.form.controls.Category.dirty||n.form.controls.Category.touched))),c(2),s("ngIf",n.form.controls.Category.invalid&&(n.form.controls.Category.dirty||n.form.controls.Category.touched)),c(7),s("options",n.accessTypes())("fluid",!0),c(),s("ngIf",n.form.controls.Note.errors),c(6),s("ngClass",T(27,Ft,n.form.controls.Note.invalid&&(n.form.controls.Note.dirty||n.form.controls.Note.touched)))("autoResize",!0),c(),s("ngIf",n.form.controls.Note.errors)}}var Nt=(()=>{class t{constructor(){this.route=x(ne),this.coa_service=x(X),this.coa_info=v(null),this.fb=x(ve),this.isEdit=v(!1),this.categoryOptions=v([]),this.router=x(ie),this.outlets=W(()=>this.coa_info()?this.coa_info().options.entities:[]),this.accessTypes=W(()=>{let e=["This Chart of Account can be viewed by all users.","Restricted access, only visible to users with the private role"];return this.coa_info()?this.coa_info().options.coaAccessType.map((n,i)=>y(C({},n),{description:e[i]})):[]})}findParenChilds(e,n){function i(o,d=null){for(let f of o){if(f.key===n)return{parent:d,child:f};if(f.children){let b=i(f.children,f);if(b)return b}}return null}return i(e)}generateForm(e){this.form=this.fb.group({ID:new V(e.id||""),Name:new V(e.name||"",[fe.required]),Code:new V(e.code||"",[fe.required]),Note:new V(e.note||"",[]),Balance:new V(e.balance||0),Outlet:new V(e.outletID||""),AccessType:new V(e.accessTypeID||0),Category:new V(null,[fe.required]),Bin:new V(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(qe(e=>{if(e.has("id")){this.isEdit.set(!0);let n=e.get("id");return this.coa_service.getChartAccountFormById(n)}else return this.coa_service.getChartAccountForm()}),L("response"),G(e=>y(C({},e),{form:y(C({},e.form),{categoryID:e.form.categoryID==="00000000-0000-0000-0000-000000000000"?"":e.form.categoryID})})),A(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:n,Category:i,Code:o,Name:d,Note:f,Outlet:b}=this.form.value,k;this.hasIdParam?k={id:this.coa_info().form.id,categoryID:i.key,name:d,bin:this.form.value.Bin||!1,code:o,note:f,outletID:b||null,balance:n,accessTypeID:e}:k={id:this.coa_info().form.id,categoryID:i.key,bin:this.form.value.Bin||!1,name:d,code:o,note:f,outletID:b||null,balance:n,accessTypeID:e},this.hasIdParam?this.coa_service.submitChartAccount(k).pipe(L("submitChartAccount"),A(()=>{this.form.reset(),this.router.navigate(["/pages/chart-of-account/account"])})).subscribe():this.coa_service.submitChartAccount(k).pipe(L("submitChartAccount"),A(()=>{this.form.reset(),this.router.navigate(["/pages/chart-of-account/account"])})).subscribe()}fetchCategoryOptions(){this.coa_service.fetchCategoryOptions().pipe(L("response"),A(e=>{this.categoryOptions.set(e);let n=this.findParenChilds(this.categoryOptions(),this.coa_info()?.form?.categoryID);this.form.controls.Category.setValue(n?.child)})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=M({type:t,selectors:[["app-coa-account-form",8,"page"]],attrs:qi,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",3,"formGroup"],[1,"d-flex","flex-column","gap-2"],[1,"row"],[1,"col-6"],[1,"d-flex","flex-column"],["for",""],["size","small","formControlName","Name","type","text","pInputText","",3,"ngClass"],[4,"ngIf"],[1,"d-flex","align-items-baseline","gap-2"],[3,"pTooltip"],[1,"fa-solid","fa-circle-info"],["appendTo","body","formControlName","Outlet","optionLabel","name","optionValue","id","placeholder","Select Outlet",3,"fluid","options"],["size","small","formControlName","Code","type","text","pInputText","",3,"ngClass"],[1,"col-3","d-flex","align-items-center","gap-2"],["name","Bin","formControlName","Bin","inputId","ingredient1",3,"value"],["for","ingredient1",1,"m-0"],[1,"col","d-flex","align-items-center","gap-2"],["name","Bin","formControlName","Bin","inputId","ingredient2",3,"value"],["for","ingredient2",1,"m-0"],[1,"form-group","d-flex","flex-column"],["formControlName","Category","containerStyleClass","w-full","placeholder","Select a Category",1,"w-full",3,"fluid","options","ngClass"],["pTemplate","value"],[1,"col"],["optionLabel","value","optionValue","key","formControlName","AccessType","placeholder","Select Access Type",3,"options","fluid"],["pSize","small","rows","5","cols","30","pTextarea","","formControlName","Note",3,"ngClass","autoResize"],["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"]],template:function(n,i){n&1&&(a(0,"app-main-panel",4),u(1,Hi,4,2,"ng-template",null,0,I)(3,lo,65,29,"ng-template",null,1,I),r()),n&2&&s("hasMainWrapperPadding",!0)},dependencies:[$,Te,oe,Y,ye,Ie,be,ut,F,z,O,N,B,Pe,Ee,Ae,K,it,nt,zn,qn,st,Mn,_e,ot,le,ae,ce,se,mt,ct],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .p-treeselect{width:100%!important}"],changeDetection:0})}}return t})();var so=["sublist"],co=(t,l)=>({"p-contextmenu-submenu":t,"p-contextmenu-root-list":l}),mo=()=>({"p-contextmenu-item-link":!0}),Yn=()=>({class:"p-contextmenu-submenu-icon"}),po=()=>({exact:!1}),uo=t=>({"p-contextmenu-item-link":!0,"p-disabled":t}),fo=t=>({$implicit:t});function _o(t,l){if(t&1&&h(0,"li",8),t&2){let e=m().$implicit,n=m(2);He(n.getItemProp(e,"style")),s("ngClass",n.getSeparatorItemClass(e)),P("id",n.getItemId(e))("data-pc-section","separator")}}function go(t,l){if(t&1&&h(0,"span",19),t&2){let e=m(4).$implicit,n=m(2);s("ngClass",n.getItemProp(e,"icon"))("ngStyle",n.getItemProp(e,"iconStyle")),P("data-pc-section","icon")("aria-hidden",!0)("tabindex",-1)}}function ho(t,l){if(t&1&&(a(0,"span",20),p(1),r()),t&2){let e=m(4).$implicit,n=m(2);P("data-pc-section","label"),c(),Q(" ",n.getItemLabel(e)," ")}}function xo(t,l){if(t&1&&h(0,"span",21),t&2){let e=m(4).$implicit,n=m(2);s("innerHTML",n.getItemLabel(e),Me),P("data-pc-section","label")}}function Co(t,l){if(t&1&&h(0,"p-badge",22),t&2){let e=m(4).$implicit,n=m(2);s("styleClass",n.getItemProp(e,"badgeStyleClass"))("value",n.getItemProp(e,"badge"))}}function yo(t,l){t&1&&h(0,"AngleRightIcon"),t&2&&(Fe("p-contextmenu-submenu-icon"),P("data-pc-section","submenuicon")("aria-hidden",!0))}function Io(t,l){}function bo(t,l){t&1&&u(0,Io,0,0,"ng-template",25),t&2&&s("data-pc-section","submenuicon")("aria-hidden",!0)}function vo(t,l){if(t&1&&(H(0),u(1,yo,1,4,"AngleRightIcon",23)(2,bo,1,2,null,24),U()),t&2){let e=m(6);c(),s("ngIf",!e.contextMenu.submenuIconTemplate&&!e.contextMenu._submenuIconTemplate),c(),s("ngTemplateOutlet",e.contextMenu.submenuIconTemplate||e.contextMenu._submenuIconTemplate)("ngTemplateOutletContext",R(3,Yn))}}function So(t,l){if(t&1&&(a(0,"a",15),u(1,go,1,5,"span",16)(2,ho,2,2,"span",17)(3,xo,1,2,"ng-template",null,2,I)(5,Co,1,2,"p-badge",18)(6,vo,3,4,"ng-container",11),r()),t&2){let e=te(4),n=m(3).$implicit,i=m(2);s("target",i.getItemProp(n,"target"))("ngClass",R(12,mo)),P("href",i.getItemProp(n,"url"),Gt)("aria-hidden",!0)("data-automationid",i.getItemProp(n,"automationId"))("data-pc-section","action")("tabindex",-1),c(),s("ngIf",i.getItemProp(n,"icon")),c(),s("ngIf",i.getItemProp(n,"escape"))("ngIfElse",e),c(3),s("ngIf",i.getItemProp(n,"badge")),c(),s("ngIf",i.isItemGroup(n))}}function To(t,l){if(t&1&&h(0,"span",19),t&2){let e=m(4).$implicit,n=m(2);s("ngClass",n.getItemProp(e,"icon"))("ngStyle",n.getItemProp(e,"iconStyle")),P("data-pc-section","icon")("aria-hidden",!0)("tabindex",-1)}}function Ao(t,l){if(t&1&&(a(0,"span",20),p(1),r()),t&2){let e=m(4).$implicit,n=m(2);P("data-pc-section","label"),c(),Q(" ",n.getItemLabel(e)," ")}}function wo(t,l){if(t&1&&h(0,"span",21),t&2){let e=m(4).$implicit,n=m(2);s("innerHTML",n.getItemLabel(e),Me),P("data-pc-section","label")}}function Eo(t,l){if(t&1&&h(0,"p-badge",22),t&2){let e=m(4).$implicit,n=m(2);s("styleClass",n.getItemProp(e,"badgeStyleClass"))("value",n.getItemProp(e,"badge"))}}function Po(t,l){t&1&&h(0,"AngleRightIcon"),t&2&&(Fe("p-contextmenu-submenu-icon"),P("data-pc-section","submenuicon")("aria-hidden",!0))}function ko(t,l){}function Mo(t,l){t&1&&u(0,ko,0,0,"ng-template",25),t&2&&s("data-pc-section","submenuicon")("aria-hidden",!0)}function Oo(t,l){if(t&1&&(H(0),u(1,Po,1,4,"AngleRightIcon",23)(2,Mo,1,2,null,24),U()),t&2){let e=m(6);c(),s("ngIf",!e.contextMenu.submenuIconTemplate&&!e.contextMenu._submenuIconTemplate),c(),s("ngTemplateOutlet",!e.contextMenu.submenuIconTemplate||!e.contextMenu._submenuIconTemplate)("ngTemplateOutletContext",R(3,Yn))}}function Fo(t,l){if(t&1&&(a(0,"a",26),u(1,To,1,5,"span",16)(2,Ao,2,2,"span",17)(3,wo,1,2,"ng-template",null,2,I)(5,Eo,1,2,"p-badge",18)(6,Oo,3,4,"ng-container",11),r()),t&2){let e=te(4),n=m(3).$implicit,i=m(2);s("routerLink",i.getItemProp(n,"routerLink"))("queryParams",i.getItemProp(n,"queryParams"))("routerLinkActiveOptions",i.getItemProp(n,"routerLinkActiveOptions")||R(20,po))("target",i.getItemProp(n,"target"))("ngClass",T(21,uo,i.getItemProp(n,"disabled")))("fragment",i.getItemProp(n,"fragment"))("queryParamsHandling",i.getItemProp(n,"queryParamsHandling"))("preserveFragment",i.getItemProp(n,"preserveFragment"))("skipLocationChange",i.getItemProp(n,"skipLocationChange"))("replaceUrl",i.getItemProp(n,"replaceUrl"))("state",i.getItemProp(n,"state")),P("data-automationid",i.getItemProp(n,"automationId"))("tabindex",-1)("aria-hidden",!0)("data-pc-section","action"),c(),s("ngIf",i.getItemProp(n,"icon")),c(),s("ngIf",i.getItemProp(n,"escape"))("ngIfElse",e),c(3),s("ngIf",i.getItemProp(n,"badge")),c(),s("ngIf",i.isItemGroup(n))}}function No(t,l){if(t&1&&(H(0),u(1,So,7,13,"a",13)(2,Fo,7,23,"a",14),U()),t&2){let e=m(2).$implicit,n=m(2);c(),s("ngIf",!n.getItemProp(e,"routerLink")),c(),s("ngIf",n.getItemProp(e,"routerLink"))}}function Vo(t,l){}function Lo(t,l){t&1&&u(0,Vo,0,0,"ng-template")}function Do(t,l){if(t&1&&(H(0),u(1,Lo,1,0,null,24),U()),t&2){let e=m(2).$implicit,n=m(2);c(),s("ngTemplateOutlet",n.itemTemplate)("ngTemplateOutletContext",T(2,fo,e.item))}}function Ro(t,l){if(t&1){let e=w();a(0,"p-contextmenu-sub",27),S("itemClick",function(i){_(e);let o=m(4);return g(o.itemClick.emit(i))})("itemMouseEnter",function(i){_(e);let o=m(4);return g(o.onItemMouseEnter(i))}),r()}if(t&2){let e=m(2).$implicit,n=m(2);s("items",e.items)("itemTemplate",n.itemTemplate)("menuId",n.menuId)("visible",n.isItemActive(e)&&n.isItemGroup(e))("activeItemPath",n.activeItemPath)("focusedItemId",n.focusedItemId)("level",n.level+1)}}function Bo(t,l){if(t&1){let e=w();a(0,"li",9,1)(2,"div",10),S("click",function(i){_(e);let o=m().$implicit,d=m(2);return g(d.onItemClick(i,o))})("mouseenter",function(i){_(e);let o=m().$implicit,d=m(2);return g(d.onItemMouseEnter({$event:i,processedItem:o}))}),u(3,No,3,2,"ng-container",11)(4,Do,2,4,"ng-container",11),r(),u(5,Ro,1,7,"p-contextmenu-sub",12),r()}if(t&2){let e=m(),n=e.$implicit,i=e.index,o=m(2);Fe(o.getItemProp(n,"styleClass")),s("ngStyle",o.getItemProp(n,"style"))("ngClass",o.getItemClass(n))("tooltipOptions",o.getItemProp(n,"tooltipOptions")),P("id",o.getItemId(n))("data-pc-section","menuitem")("data-p-highlight",o.isItemActive(n))("data-p-focused",o.isItemFocused(n))("data-p-disabled",o.isItemDisabled(n))("aria-label",o.getItemLabel(n))("aria-disabled",o.isItemDisabled(n)||void 0)("aria-haspopup",o.isItemGroup(n)&&!o.getItemProp(n,"to")?"menu":void 0)("aria-expanded",o.isItemGroup(n)?o.isItemActive(n):void 0)("aria-level",o.level+1)("aria-setsize",o.getAriaSetSize())("aria-posinset",o.getAriaPosInset(i)),c(2),P("data-pc-section","content"),c(),s("ngIf",!o.itemTemplate),c(),s("ngIf",o.itemTemplate),c(),s("ngIf",o.isItemVisible(n)&&o.isItemGroup(n))}}function $o(t,l){if(t&1&&u(0,_o,1,5,"li",6)(1,Bo,6,21,"li",7),t&2){let e=l.$implicit,n=m(2);s("ngIf",n.isItemVisible(e)&&n.getItemProp(e,"separator")),c(),s("ngIf",n.isItemVisible(e)&&!n.getItemProp(e,"separator"))}}function Ko(t,l){if(t&1){let e=w();a(0,"ul",4,0),S("@overlayAnimation.start",function(i){_(e);let o=te(1),d=m();return g(d.onEnter(i,o))})("keydown",function(i){_(e);let o=m();return g(o.menuKeydown.emit(i))})("focus",function(i){_(e);let o=m();return g(o.menuFocus.emit(i))})("blur",function(i){_(e);let o=m();return g(o.menuBlur.emit(i))}),u(2,$o,2,2,"ng-template",5),r()}if(t&2){let e=m();s("ngClass",Yt(10,co,!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"),c(2),s("ngForOf",e.items)}}var qo=["item"],zo=["submenuicon"],Go=["rootmenu"],Ho=["container"],Uo=t=>({"p-contextmenu p-component":!0,"p-contextmenu-mobile":t}),jo=()=>({value:"visible"});function Zo(t,l){if(t&1){let e=w();a(0,"div",3,0),S("@overlayAnimation.start",function(i){_(e);let o=m();return g(o.onOverlayAnimationStart(i))})("@overlayAnimation.done",function(i){_(e);let o=m();return g(o.onOverlayAnimationEnd(i))}),a(2,"p-contextmenu-sub",4,1),S("itemClick",function(i){_(e);let o=m();return g(o.onItemClick(i))})("menuFocus",function(i){_(e);let o=m();return g(o.onMenuFocus(i))})("menuBlur",function(i){_(e);let o=m();return g(o.onMenuBlur(i))})("menuKeydown",function(i){_(e);let o=m();return g(o.onKeyDown(i))})("itemMouseEnter",function(i){_(e);let o=m();return g(o.onItemMouseEnter(i))}),r()()}if(t&2){let e=m();Fe(e.styleClass),s("ngClass",T(20,Uo,e.queryMatches))("ngStyle",e.style)("@overlayAnimation",R(22,jo)),P("data-pc-section","root")("data-pc-name","contextmenu")("id",e.id),c(2),s("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 Qo=({dt:t})=>`
2
+ .p-contextmenu {
3
+ position: absolute;
4
+ background: ${t("contextmenu.background")};
5
+ color: ${t("contextmenu.color")};
6
+ border: 1px solid ${t("contextmenu.border.color")};
7
+ border-radius: ${t("contextmenu.border.radius")};
8
+ box-shadow: ${t("contextmenu.shadow")};
9
+ min-width: 12.5rem;
10
+ }
11
+
12
+ .p-contextmenu-root-list,
13
+ .p-contextmenu-submenu {
14
+ margin: 0;
15
+ padding: ${t("contextmenu.list.padding")};
16
+ list-style: none;
17
+ outline: 0 none;
18
+ display: flex;
19
+ flex-direction: column;
20
+ gap: ${t("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: ${t("contextmenu.background")};
30
+ color: ${t("contextmenu.color")};
31
+ border: 1px solid ${t("contextmenu.border.color")};
32
+ border-radius: ${t("contextmenu.border.radius")};
33
+ box-shadow: ${t("contextmenu.shadow")};
34
+ }
35
+
36
+ .p-contextmenu-item {
37
+ position: relative;
38
+ }
39
+
40
+ .p-contextmenu-item-content {
41
+ transition: background ${t("contextmenu.transition.duration")}, color ${t("contextmenu.transition.duration")};
42
+ border-radius: ${t("contextmenu.item.border.radius")};
43
+ color: ${t("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: ${t("contextmenu.item.padding")};
55
+ gap: ${t("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: ${t("contextmenu.item.icon.color")};
65
+ }
66
+
67
+ .p-contextmenu-submenu-icon {
68
+ color: ${t("contextmenu.submenu.icon.color")};
69
+ margin-left: auto;
70
+ font-size: ${t("contextmenu.submenu.icon.size")};
71
+ width: ${t("contextmenu.submenu.icon.size")};
72
+ height: ${t("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: ${t("contextmenu.item.focus.color")};
82
+ background: ${t("contextmenu.item.focus.background")};
83
+ }
84
+
85
+ .p-contextmenu-item.p-focus > .p-contextmenu-item-content .p-contextmenu-item-icon {
86
+ color: ${t("contextmenu.item.icon.focus.color")};
87
+ }
88
+
89
+ .p-contextmenu-item.p-focus > .p-contextmenu-item-content .p-contextmenu-submenu-icon {
90
+ color: ${t("contextmenu.submenu.icon.focus.color")};
91
+ }
92
+
93
+ .p-contextmenu-item:not(.p-disabled) > .p-contextmenu-item-content:hover {
94
+ color: ${t("contextmenu.item.focus.color")};
95
+ background: ${t("contextmenu.item.focus.background")};
96
+ }
97
+
98
+ .p-contextmenu-item:not(.p-disabled) > .p-contextmenu-item-content:hover .p-contextmenu-item-icon {
99
+ color: ${t("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: ${t("contextmenu.submenu.icon.focus.color")};
104
+ }
105
+
106
+ .p-contextmenu-item-active > .p-contextmenu-item-content {
107
+ color: ${t("contextmenu.item.active.color")};
108
+ background: ${t("contextmenu.item.active.background")};
109
+ }
110
+
111
+ .p-contextmenu-item-active > .p-contextmenu-item-content .p-contextmenu-item-icon {
112
+ color: ${t("contextmenu.item.icon.active.color")};
113
+ }
114
+
115
+ .p-contextmenu-item-active > .p-contextmenu-item-content .p-contextmenu-submenu-icon {
116
+ color: ${t("contextmenu.submenu.icon.active.color")};
117
+ }
118
+
119
+ .p-contextmenu-separator {
120
+ border-top: 1px solid ${t("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: ${t("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
+ `,Wo={root:"p-contextmenu p-component",rootList:"p-contextmenu-root-list",item:({instance:t,processedItem:l})=>["p-contextmenu-item",{"p-contextmenu-item-active":t.isItemActive(l),"p-focus":t.isItemFocused(l),"p-disabled":t.isItemDisabled(l)}],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"},Wn=(()=>{class t extends yn{name="contextmenu";theme=Qo;classes=Wo;static \u0275fac=(()=>{let e;return function(i){return(e||(e=Ge(t)))(i||t)}})();static \u0275prov=ze({token:t,factory:t.\u0275fac})}return t})();var Yo=(()=>{class t extends Tt{contextMenu;visible=!1;items;itemTemplate;root=!1;autoZIndex=!0;baseZIndex=0;popup;menuId;ariaLabel;ariaLabelledBy;level=0;focusedItemId;activeItemPath;tabindex=0;itemClick=new ee;itemMouseEnter=new ee;menuFocus=new ee;menuBlur=new ee;menuKeydown=new ee;sublistViewChild;constructor(e){super(),this.contextMenu=e}getItemProp(e,n,i=null){return e&&e.item?St(e.item[n],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 y(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 y(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(n=>this.isItemVisible(n)&&this.getItemProp(n,"separator")).length+1}isItemVisible(e){return this.getItemProp(e,"visible")!==!1}isItemActive(e){if(this.activeItemPath)return this.activeItemPath.some(n=>n.key===e.key)}isItemDisabled(e){return this.getItemProp(e,"disabled")}isItemFocused(e){return this.focusedItemId===this.getItemId(e)}isItemGroup(e){return re(e.items)}onItemMouseEnter(e){let{event:n,processedItem:i}=e;this.itemMouseEnter.emit({originalEvent:n,processedItem:i})}onItemClick(e,n){this.getItemProp(n,"command",{originalEvent:e,item:n.item}),this.itemClick.emit({originalEvent:e,processedItem:n,isFocus:!0})}onEnter(e,n){if(e.fromState==="void"&&e.toState){let i=e.element;this.position(i)}}position(e){let n=e.parentElement.parentElement,i=dn(e.parentElement.parentElement),o=yt(),d=e.offsetParent?e.offsetWidth:It(e),f=sn(n.children[0]);e.style.top="0px",parseInt(i.left,10)+f+d>o.width-mn()?e.style.left=-1*d+"px":e.style.left=f+"px"}static \u0275fac=function(n){return new(n||t)(gt(qt(()=>_t)))};static \u0275cmp=M({type:t,selectors:[["p-contextMenuSub"],["p-contextmenu-sub"]],viewQuery:function(n,i){if(n&1&&pe(so,5),n&2){let o;j(o=Z())&&(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",Ce],popup:[2,"popup","popup",ue],menuId:"menuId",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",level:[2,"level","level",Ce],focusedItemId:"focusedItemId",activeItemPath:"activeItemPath",tabindex:[2,"tabindex","tabindex",Ce]},outputs:{itemClick:"itemClick",itemMouseEnter:"itemMouseEnter",menuFocus:"menuFocus",menuBlur:"menuBlur",menuKeydown:"menuKeydown"},features:[Oe],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(n,i){n&1&&u(0,Ko,3,13,"ul",3),n&2&&s("ngIf",i.root?!0:i.visible)},dependencies:[t,F,z,We,O,en,ht,N,B,bn,_e,ot,In,wt,Sn,De],encapsulation:2,data:{animation:[xt("overlayAnimation",[Le(":enter",[Ve({opacity:0})]),Le(":leave",[Ve({opacity:0})])])]}})}return t})(),_t=(()=>{class t extends Tt{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 ee;onHide=new ee;rootmenu;containerViewChild;container;outsideClickListener;resizeListener;triggerEventListener;documentClickListener;documentTriggerListener;touchEndListener;pageX;pageY;visible=v(!1);relativeAlign;window;focused=!1;activeItemPath=v([]);focusedItemInfo=v({index:-1,level:0,parentKey:"",item:null});submenuVisible=v(!1);searchValue="";searchTimeout;_processedItems;_model;pressTimer;matchMediaListener;query;queryMatches;_componentStyle=x(Wn);get visibleItems(){let e=this.activeItemPath().find(n=>n.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}${re(e.parentKey)?"_"+e.parentKey:""}_${e.index}`:null}constructor(e){super(),this.overlayService=e,Jt(()=>{let n=this.activeItemPath();re(n)?this.bindGlobalListeners():this.visible()||this.unbindGlobalListeners()})}ngOnInit(){super.ngOnInit(),this.id=this.id||hn("pn_id_"),this.bindMatchMediaListener(),this.bindTriggerEventListener()}isMobile(){return fn()||un()}bindTriggerEventListener(){Ne(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(Ne(this.platformId)){if(!this.documentClickListener){let e=this.el?this.el.nativeElement.ownerDocument:"document";this.documentClickListener=this.renderer.listen(e,"click",n=>{this.containerViewChild.nativeElement.offsetParent&&this.isOutsideClicked(n)&&!n.ctrlKey&&n.button!==2&&this.triggerEvent!=="click"&&this.hide()}),this.documentTriggerListener=this.renderer.listen(e,this.triggerEvent,n=>{this.containerViewChild.nativeElement.offsetParent&&this.isOutsideClicked(n)&&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,n=0,i={},o=""){let d=[];return e&&e.forEach((f,b)=>{let k=(o!==""?o+"_":"")+b,q={item:f,index:b,level:n,key:k,parent:i,parentKey:o};q.items=this.createProcessedItems(f.items,n+1,q,k),d.push(q)}),d}bindMatchMediaListener(){if(Ne(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,n){return e?St(e[n]):void 0}getProccessedItemLabel(e){return e?this.getItemLabel(e.item):void 0}getItemLabel(e){return this.getItemProp(e,"label")}isProcessedItemGroup(e){return e&&re(e.items)}isSelected(e){return this.activeItemPath().some(n=>n.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&&re(e.items)}onItemClick(e){let{processedItem:n}=e,i=this.isProcessedItemGroup(n);if(this.isSelected(n)){let{index:d,key:f,level:b,parentKey:k,item:q}=n;this.activeItemPath.set(this.activeItemPath().filter(Be=>f!==Be.key&&f.startsWith(Be.key))),this.focusedItemInfo.set({index:d,level:b,parentKey:k,item:q}),tt(this.rootmenu.sublistViewChild.nativeElement)}else i?this.onItemChange(e):this.hide()}onItemMouseEnter(e){this.onItemChange(e,"hover")}onKeyDown(e){let n=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:!n&&gn(e.key)&&this.searchItems(e,e.key);break}}onArrowDownKey(e){let n=this.focusedItemInfo().index!==-1?this.findNextItemIndex(this.focusedItemInfo().index):this.findFirstFocusedItemIndex();this.changeFocusedItemIndex(e,n),e.preventDefault()}onArrowRightKey(e){let n=this.visibleItems[this.focusedItemInfo().index];this.isProccessedItemGroup(n)&&(this.onItemChange({originalEvent:e,processedItem:n}),this.focusedItemInfo.set({index:-1,parentKey:n.key,item:n.item}),this.searchValue="",this.onArrowDownKey(e)),e.preventDefault()}onArrowUpKey(e){if(e.altKey){if(this.focusedItemInfo().index!==-1){let n=this.visibleItems[this.focusedItemInfo().index];!this.isProccessedItemGroup(n)&&this.onItemChange({originalEvent:e,processedItem:n})}this.hide(),e.preventDefault()}else{let n=this.focusedItemInfo().index!==-1?this.findPrevItemIndex(this.focusedItemInfo().index):this.findLastFocusedItemIndex();this.changeFocusedItemIndex(e,n),e.preventDefault()}}onArrowLeftKey(e){let n=this.visibleItems[this.focusedItemInfo().index],i=this.activeItemPath().find(f=>f.key===n.parentKey);bt(n.parent)||(this.focusedItemInfo.set({index:-1,parentKey:i?i.parentKey:"",item:n.item}),this.searchValue="",this.onArrowDownKey(e));let d=this.activeItemPath().filter(f=>f.parentKey!==this.focusedItemInfo().parentKey);this.activeItemPath.set(d),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 n=this.findVisibleItem(this.findFirstFocusedItemIndex()),i=this.focusedItemInfo();this.focusedItemInfo.set(y(C({},i),{index:this.findFirstFocusedItemIndex(),item:n.item})),e.preventDefault()}onTabKey(e){if(this.focusedItemInfo().index!==-1){let n=this.visibleItems[this.focusedItemInfo().index];!this.isProccessedItemGroup(n)&&this.onItemChange({originalEvent:e,processedItem:n})}this.hide()}onEnterKey(e){if(this.focusedItemInfo().index!==-1){let n=et(this.rootmenu.el.nativeElement,`li[id="${`${this.focusedItemId}`}"]`),i=n&&et(n,'a[data-pc-section="action"]');i?i.click():n&&n.click();let o=this.visibleItems[this.focusedItemInfo().index];if(!this.isProccessedItemGroup(o)){let f=this.focusedItemInfo();this.focusedItemInfo.set(y(C({},f),{index:this.findFirstFocusedItemIndex()}))}}e.preventDefault()}onItemChange(e,n){let{processedItem:i,isFocus:o}=e;if(bt(i))return;let{index:d,key:f,level:b,parentKey:k,items:q}=i,Be=re(q),Dt=this.activeItemPath().filter(Rt=>Rt.parentKey!==k&&Rt.parentKey!==f);Be&&(Dt.push(i),this.submenuVisible.set(!0)),this.focusedItemInfo.set({index:d,level:b,parentKey:k,item:i.item}),o&&tt(this.rootmenu.sublistViewChild.nativeElement),!(n==="hover"&&this.queryMatches)&&this.activeItemPath.set(Dt)}onMenuFocus(e){this.focused=!0;let n=this.focusedItemInfo().index!==-1?this.focusedItemInfo():{index:-1,level:0,parentKey:"",item:null};this.focusedItemInfo.set(n)}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(),tt(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):cn(this.appendTo,this.containerViewChild.nativeElement))}moveOnTop(){this.autoZIndex&&this.containerViewChild&&At.set("menu",this.containerViewChild.nativeElement,this.baseZIndex+this.config.zIndex.menu)}onOverlayHide(){this.unbindGlobalListeners(),this.cd.destroyed||(this.target=null),this.container&&this.autoZIndex&&At.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,n=this.pageY+1,i=this.containerViewChild.nativeElement.offsetParent?this.containerViewChild.nativeElement.offsetWidth:It(this.containerViewChild.nativeElement),o=this.containerViewChild.nativeElement.offsetParent?this.containerViewChild.nativeElement.offsetHeight:pn(this.containerViewChild.nativeElement),d=yt();e+i-this.document.scrollingElement.scrollLeft>d.width&&(e-=i),n+o-this.document.scrollingElement.scrollTop>d.height&&(n-=o),e<this.document.scrollingElement.scrollLeft&&(e=this.document.scrollingElement.scrollLeft),n<this.document.scrollingElement.scrollTop&&(n=this.document.scrollingElement.scrollTop),this.containerViewChild.nativeElement.style.left=e+"px",this.containerViewChild.nativeElement.style.top=n+"px"}searchItems(e,n){this.searchValue=(this.searchValue||"")+n;let i=-1,o=!1;return this.focusedItemInfo().index!==-1?(i=this.visibleItems.slice(this.focusedItemInfo().index).findIndex(d=>this.isItemMatched(d)),i=i===-1?this.visibleItems.slice(0,this.focusedItemInfo().index).findIndex(d=>this.isItemMatched(d)):i+this.focusedItemInfo().index):i=this.visibleItems.findIndex(d=>this.isItemMatched(d)),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 re(this.visibleItems)?this.visibleItems[e]:null}findLastFocusedItemIndex(){let e=this.findSelectedItemIndex();return e<0?this.findLastItemIndex():e}findLastItemIndex(){return vt(this.visibleItems,e=>this.isValidItem(e))}findPrevItemIndex(e){let n=e>0?vt(this.visibleItems.slice(0,e),i=>this.isValidItem(i)):-1;return n>-1?n:e}findNextItemIndex(e){let n=e<this.visibleItems.length-1?this.visibleItems.slice(e+1).findIndex(i=>this.isValidItem(i)):-1;return n>-1?n+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,n){let i=this.findVisibleItem(n),o=this.focusedItemInfo();o.index!==n&&(this.focusedItemInfo.set(y(C({},o),{index:n,item:i.item})),this.scrollInView())}scrollInView(e=-1){let n=e!==-1?`${this.id}_${e}`:this.focusedItemId,i=et(this.rootmenu.el.nativeElement,`li[id="${n}"]`);i&&i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"nearest"})}bindResizeListener(){Ne(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):_n(this.containerViewChild.nativeElement,this.appendTo))}ngOnDestroy(){this.unbindGlobalListeners(),this.unbindTriggerEventListener(),this.unbindMatchMediaListener(),this.removeAppendedElements(),super.ngOnDestroy()}static \u0275fac=function(n){return new(n||t)(gt(xn))};static \u0275cmp=M({type:t,selectors:[["p-contextMenu"],["p-contextmenu"],["p-context-menu"]],contentQueries:function(n,i,o){if(n&1&&(Ue(o,qo,4),Ue(o,zo,4),Ue(o,Ae,4)),n&2){let d;j(d=Z())&&(i.itemTemplate=d.first),j(d=Z())&&(i.submenuIconTemplate=d.first),j(d=Z())&&(i.templates=d)}},viewQuery:function(n,i){if(n&1&&(pe(Go,5),pe(Ho,5)),n&2){let o;j(o=Z())&&(i.rootmenu=o.first),j(o=Z())&&(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",Ce],id:"id",breakpoint:"breakpoint",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",pressDelay:[2,"pressDelay","pressDelay",Ce]},outputs:{onShow:"onShow",onHide:"onHide"},features:[he([Wn]),Oe],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(n,i){n&1&&u(0,Zo,4,23,"div",2),n&2&&s("ngIf",i.visible())},dependencies:[F,z,O,ht,Yo,N,_e,wt,De],encapsulation:2,data:{animation:[xt("overlayAnimation",[Le(":enter",[Ve({opacity:0}),Ct("250ms")]),Le(":leave",[Ct(".1s linear",Ve({opacity:0}))])])]},changeDetection:0})}return t})(),Xn=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ht({type:t});static \u0275inj=zt({imports:[_t,De,De]})}return t})();var Jo=["editInput"],er=["tree"],tr=["class","page"];function nr(t,l){t&1&&(a(0,"a",7),h(1,"i",8),p(2," Add"),r())}function ir(t,l){if(t&1&&u(0,nr,3,0,"a",6),t&2){let e=m();s("ngIf",e.roleService.coa().create)}}function or(t,l){if(t&1){let e=w();a(0,"input",15,4),Qe("ngModelChange",function(i){let o=_(e).$implicit;return Ze(o.label,i)||(o.label=i),g(i)}),S("keydown",function(i){_(e);let o=m(2);return g(o.handleEditKeydown(i))})("blur",function(i){_(e);let o=m(2);return g(o.onNodeEditBlur(i))}),r()}if(t&2){let e=l.$implicit;je("ngModel",e.label)}}function rr(t,l){if(t&1){let e=w();a(0,"div",9)(1,"div",10)(2,"p-panel",11)(3,"p-tree",12,2),S("onNodeContextMenuSelect",function(i){_(e);let o=m();return g(o.onNodeContextMenuSelect(i))})("onNodeSelect",function(i){_(e);let o=m();return g(o.onNodeSelect(i))})("onNodeUnselect",function(i){_(e);let o=m();return g(o.onNodeUnselect(i))})("onNodeDrop",function(i){_(e);let o=m();return g(o.onNodeDrop(i))}),u(5,or,2,1,"ng-template",13),r(),h(6,"p-contextmenu",14,3),r()()()}if(t&2){let e=te(7),n=m();c(2),s("showHeader",!1),c(),s("value",n.categoryTree())("contextMenu",e)("selection",n.selectedCategory)("draggableNodes",!0)("droppableNodes",!0)("propagateSelectionUp",!1)("propagateSelectionDown",!1),c(3),s("model",n.contextMenuItems())}}var Jn=(()=>{class t{constructor(){this._coaTypesService=x(me),this._router=x(ie),this.roleService=x(we),this.contextMenuItems=v([]),this.categoryTree=v([]),this.selectedCategory=null,this._shouldAutoFocus=v(!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(A(e=>{this.categoryTree.set(e),this.expandAllNodes()}))}_assignTreeIcons(e){return e.map(n=>{let i=!!n.children?.length;return y(C({},n),{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(n.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._coaTypesService.submitCategory({Name:"New Child Node",ParentID:this.selectedCategory.key,Code:"",Note:""}).pipe(D(e=>this._loadCategories().pipe(G(()=>e))),A(e=>{let n=this._findNodeByKey(e.id);n&&(this.selectedCategory=n,this._shouldAutoFocus.set(!1),n.type="edit")})).subscribe()}_deleteSelectedCategory(){this.selectedCategory?.key&&this._coaTypesService.deleteCategory(this.selectedCategory.key).pipe(D(()=>this._loadCategories())).subscribe()}renameNode(e,n=this.selectedCategory){this._coaTypesService.renameCategory(n.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,["Asset","Liability","Equity","Revenue","Expense"].includes(e.node.label)?this.contextMenuItems.set(this.contextMenuItems().map(i=>["Edit","Delete"].includes(i.label)?y(C({},i),{disabled:!0}):y(C({},i),{disabled:!1}))):this.contextMenuItems.set(this.contextMenuItems().map(i=>i.label==="Add"?y(C({},i),{disabled:!this.roleService.coa().create}):i.label==="Edit"?y(C({},i),{disabled:!this.roleService.coa().edit}):i.label==="Delete"?y(C({},i),{disabled:!this.roleService.coa().delete}):y(C({},i),{disabled:!1})))}onNodeDrop(e){let{dragNode:n,dropNode:i}=e;this._coaTypesService.updateParentCategory(n.key,{ParentID:i.key}).pipe(A(()=>this._loadCategories())).subscribe()}onNodeEditBlur(e){let n=e.target;this.renameNode(n.value);let i=this._findNodeByKey(this.selectedCategory?.key);i&&delete i.type}handleEditKeydown(e){let n=e.target;if([" ","Enter"].includes(e.key)&&e.stopPropagation(),e.key==="Enter"){this.renameNode(n.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,n){e.expanded=n,e.children?.forEach(i=>this._expandRecursive(i,n))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=M({type:t,selectors:[["app-coa-type",8,"page"]],viewQuery:function(n,i){if(n&1&&(pe(Jo,5),pe(er,5)),n&2){let o;j(o=Z())&&(i.editInputRef=o.first),j(o=Z())&&(i.treeComponent=o.first)}},features:[he([Cn])],attrs:tr,decls:5,vars:1,consts:[["actionButton",""],["content",""],["tree",""],["cm",""],["editInput",""],["pageTitle",`Chart of Accounts Category
159
+ `,3,"scrollable"],["class","p-button","routerLink","add",4,"ngIf"],["routerLink","add",1,"p-button"],[1,"fa-solid","fa-plus"],[1,"row","justify-content-center","m-0"],[1,"col","p-0"],[3,"showHeader"],["selectionMode","single","draggableScope","self","droppableScope","self",1,"custom-tree-spacing",3,"onNodeContextMenuSelect","onNodeSelect","onNodeUnselect","onNodeDrop","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(n,i){n&1&&(a(0,"app-main-panel",5),u(1,ir,1,1,"ng-template",null,0,I)(3,rr,8,9,"ng-template",null,1,I),r()),n&2&&s("scrollable",!0)},dependencies:[$,$n,N,B,Xn,_t,Ae,F,O,Se,oe,Y,Xe,K,vn,ce,se],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var ar=["class","page"],Vt=t=>({"is-invalid":t}),lr=t=>({"ng-invalid ng-dirty":t});function sr(t,l){if(t&1){let e=w();a(0,"div",3)(1,"p-button",4),S("onClick",function(){_(e);let i=m();return g(i.goBack())}),r(),a(2,"p-button",5),S("onClick",function(){_(e);let i=m();return g(i.onSubmit())}),r()()}}function cr(t,l){t&1&&(a(0,"div",20),p(1," Name is required "),r())}function mr(t,l){t&1&&(a(0,"div",20),p(1," Code is required "),r())}function pr(t,l){t&1&&(a(0,"div",20),p(1," Note is required "),r())}function dr(t,l){if(t&1&&(a(0,"div")(1,"span",22),p(2),r()()),t&2){let e=l.$implicit;c(2),E(e)}}function ur(t,l){if(t&1&&(a(0,"div"),u(1,dr,3,1,"div",21),r()),t&2){let e=m(2);c(),s("ngForOf",e.getErrors("Category"))}}function fr(t,l){if(t&1){let e=w();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),u(9,cr,2,0,"div",13),r()(),a(10,"div",14)(11,"div",10)(12,"label",11),p(13,"Code"),r(),h(14,"input",15),u(15,mr,2,0,"div",13),r()(),a(16,"div",9)(17,"div",10)(18,"label",11),p(19,"Note"),r(),h(20,"textarea",16),u(21,pr,2,0,"div",13),r()(),a(22,"div",9)(23,"div",17)(24,"label",11),p(25,"Category"),r(),a(26,"p-treeselect",18),S("onFocus",function(){_(e);let i=m();return g(i.loadCategories())}),r(),u(27,ur,2,1,"div",19),r()()()()()()}if(t&2){let e=m();c(3),s("formGroup",e.form),c(5),s("ngClass",T(10,Vt,e.form.controls.Name.invalid&&(e.form.controls.Name.dirty||e.form.controls.Name.touched))),c(),s("ngIf",e.form.controls.Name.errors==null?null:e.form.controls.Name.errors.required),c(5),s("ngClass",T(12,Vt,e.form.controls.Code.invalid&&(e.form.controls.Code.dirty||e.form.controls.Code.touched))),c(),s("ngIf",e.form.controls.Code==null||e.form.controls.Code.errors==null?null:e.form.controls.Code.errors.required),c(5),s("ngClass",T(14,Vt,e.form.controls.Note.invalid&&(e.form.controls.Note.dirty||e.form.controls.Note.touched))),c(),s("ngIf",e.form.controls.Note.errors==null?null:e.form.controls.Note.errors.required),c(5),s("ngClass",T(16,lr,e.isInvalid("Category")))("options",e.categories()),c(),s("ngIf",e.isInvalid("Category"))}}var Lt=(()=>{class t extends Gn{constructor(){super(...arguments),this.categories=v([]),this.COATypeService=x(me),this.COAService=x(X),this.info=v(null),this.route=x(ne),this.router=x(ie),this.fb=x(ve)}goBack(){this.router.navigate(["/pages/chart-of-account/coa-types"])}ngOnInit(){this.generateForm(),Bt([this.route.paramMap.pipe(G(e=>e.get("id")),Ke(e=>!!e)),this.COATypeService.fetchCOACategories()]).pipe(L("fetchCOACategories"),D(([e,n])=>{let i=this.findNodeByKeyInArray(n,e);return this.categories.set(n),this.COATypeService.getCOACategoryByID({ID:e}).pipe(A(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(A(e=>this.categories.set(e))).subscribe()}generateForm(){this.form=new on({Name:new V("",[fe.required]),Code:new V("",[]),Category:new V(null,[fe.required]),Note:new V("",[])})}findNodeByKeyInArray(e,n){for(let i of e){let o=this.findNodeByKey(i,n);if(o)return o}return null}findNodeByKey(e,n,i=null){if(e.key===n||e.label===n)return i&&(e.parent=i),e;if(e.children&&e.children.length>0)for(let o of e.children){let d=this.findNodeByKey(o,n,e);if(d)return d}return null}onSubmit(){let{Name:e,Code:n,Note:i,Category:o}=this.form.value,d=null,f=null;if(this.form.invalid){this.form.markAllAsTouched();return}this.route.snapshot.params.id?(d=this.findNodeByKeyInArray(this.categories(),this.route.snapshot.params.id),f={Name:e,Code:n,ParentID:d&&d.parent?d.parent.key:d.key,Note:i,ID:this.route.snapshot.params.id||null}):(d=this.findNodeByKeyInArray(this.categories(),o.key),f={Name:e,Code:n,ParentID:d&&d.parent?d.parent.key:d.key,Note:i}),this.COATypeService.submitCategory(f,{observe:"response"}).pipe(L("response"),A(()=>{this.router.navigate(["/pages/chart-of-account/coa-types"])})).subscribe()}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Ge(t)))(i||t)}})()}static{this.\u0275cmp=M({type:t,selectors:[["app-coa-type-form",8,"page"]],features:[Oe],attrs:ar,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(n,i){n&1&&(a(0,"app-main-panel",2),u(1,sr,3,0,"ng-template",null,0,I)(3,fr,28,18,"ng-template",null,1,I),r()),n&2&&s("hasMainWrapperPadding",!0)},dependencies:[$,N,Pe,Ee,Te,oe,Y,ye,Ie,be,F,z,We,O,K,le,ae,ce,se],styles:["[_nghost-%COMP%]{display:block} .p-treeselect{width:100%}"],changeDetection:0})}}return t})();var _r=t=>[t];function gr(t,l){if(t&1&&(a(0,"a",4),h(1,"i",5),a(2,"span"),p(3,"Edit"),r()()),t&2){let e=m(2);s("routerLink",T(1,_r,"/pages/chart-of-account/coa-types/"+e.info().id+"/edit"))}}function hr(t,l){if(t&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()()()()()()),t&2){let e=m(2);c(8),E(e.info().name),c(5),E(e.info().code),c(5),E(e.info().parentName),c(5),s("innerHTML",e.info().note,Me)}}function xr(t,l){t&1&&(H(0),a(1,"app-main-panel",3),u(2,gr,4,3,"ng-template",null,0,I)(4,hr,24,4,"ng-template",null,1,I),r(),U())}var ei=(()=>{class t{constructor(){this.COATypeService=x(me),this.route=x(ne),this.info=v(null)}ngOnInit(){this.route.queryParamMap.pipe(G(e=>e.get("ID")),D(e=>this.COATypeService.getCOACategoryByID({ID:e})),L("getCOACategoryByID"),A(e=>this.info.set(e))).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=M({type:t,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(n,i){n&1&&u(0,xr,6,0,"ng-container",2),n&2&&s("ngIf",i.info())},dependencies:[F,O,$,K,rt,N,B],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Es=[{path:"",redirectTo:"account",pathMatch:"full"},{path:"",children:[{path:"account",component:jn},{path:"account/add",component:Nt},{path:"account/import",loadComponent:()=>import("./chunk-EQ7DUTAS.js").then(t=>t.CoaImportComponent)},{path:"account/:id",component:Hn},{path:"account/:id/edit",component:Nt},{path:"coa-types",component:Jn},{path:"coa-types/add",component:Lt},{path:"coa-types/info",component:ei},{path:"coa-types/:id/edit",component:Lt}]}],Zn={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{Es as CHART_OF_ACCOUNT_ROUTES,Zn as CHART_OF_ACCOUNT_ROUTE_PAGE};
@@ -1 +1 @@
1
- import{a as b}from"./chunk-ZDTMCWOO.js";import{B as I,C as g,D}from"./chunk-SB5MSLCX.js";import{I as u,_ as d,ca as m,ia as f,n as y,s as h}from"./chunk-6K5LNQ4J.js";import{a as o,b as c}from"./chunk-YQFG5XE2.js";var L=(()=>{class s{constructor(){this.httpClient=f(D),this.toastr=f(b)}get(t="",e,a={}){return this.httpClient.get(`${t}${e}`,a).pipe(u(this.handleError.bind(this)))}post(t="",e,a,r={observe:"response"}){return this.httpClient.post(`${t}${e}`,a,o({},r)).pipe(d(this.handleResponse.bind(this)),h(n=>n instanceof I&&Object.prototype.hasOwnProperty.call(r,"observe")&&r.observe==="response"?n.body instanceof Blob?n:n.body:n),u(this.handleError.bind(this)))}put(t="",e,a,r={}){return this.httpClient.put(`${t}${e}`,a,c(o({},r),{observe:"response"})).pipe(d(this.handleResponse.bind(this)),h(n=>n.body),u(this.handleError.bind(this)))}delete(t="",e,a={}){return this.httpClient.delete(`${t}${e}`,c(o({},a),{observe:"response"})).pipe(d(this.handleResponse.bind(this)),h(r=>r.body),u(this.handleError.bind(this)))}handleResponse(t){if(t instanceof I&&t.status===200&&t.body){let e;typeof t.body=="object"&&t.body!==null&&(e=t.body.message||t.body.Message),typeof e=="string"&&e.length>0&&this.toastr.success(e,"Success")}}handleError(t){let e={header:"API Error",message:"An unknown error occurred"};if(t instanceof g)switch(t.status){case 0:e.message="CORS error: Request blocked or server not responding with proper CORS headers",e.header="CORS Error";break;case 504:e.message=t.statusText||"Gateway Timeout",e.header=`API Error: ${t.status}`;break;default:e.header=`API Error: ${t.status}`,e.message=t.error&&(t.error.Message||t.error.message||t.error.error)||t.message}return t instanceof g&&(t.status>=200&&t.status<300?this.toastr.success(e.message,e.header):t.status>=400&&t.status<500?this.toastr.warning(e.message,e.header):t.status>=500&&t.status<600&&this.toastr.error(e.message,e.header)),y(()=>e)}static{this.\u0275fac=function(e){return new(e||s)}}static{this.\u0275prov=m({token:s,factory:s.\u0275fac,providedIn:"root"})}}return s})();var p={production:!0,version:"5.43.0",changelogUrl:"https://changelog.dealpos.com/?categories=cat_O6pYAT7GI1mts",defaultTimezone:"Asia/Jakarta",intercom:{appId:"xv1oomgl"}};var l=class s{static{this.emailRegex=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/}static{this.phoneNumberRegex=/^\d+$/}static{this.GuidEmpty="00000000-0000-0000-0000-000000000000"}static{this.DecimalMinValue="-7.922816251426434e+28"}static{this.InputLockTimeSpan=500}static{this.MinDate="0001-01-01T00:00:00"}static{this.MinTime="00:00:00"}static{this.MinDecimal="-79228162514264337593543950335"}static StringFormat(i,...t){for(let e=0;e<t.length;e++)i=i.replace(`{${e}}`,t[e]);return i}static{this.isMobileDevice=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}static IsNotEmpty(i){return i!=""&&!s.containsOnlySpaces(i)&&i!=s.GuidEmpty&&i!=null&&i!=null}static IsEmpty(i){return!!(i==""||s.containsOnlySpaces(i)||i==null||i==null||i==s.GuidEmpty)}static isGuid(i){let t=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/gi,e=!1;return i&&(e=t.test(i)),e}static containsOnlySpaces(i){return/^\s*$/.test(i)}static FilterByID(i,t){try{let e=i.filter(a=>a.ID==t);if(e.length>0)return e[0]}catch{}return null}static{this.Months=[{ID:1,Label:"January"},{ID:2,Label:"February"},{ID:3,Label:"March"},{ID:4,Label:"April"},{ID:5,Label:"May"},{ID:6,Label:"June"},{ID:7,Label:"July"},{ID:8,Label:"August"},{ID:9,Label:"September"},{ID:10,Label:"October"},{ID:11,Label:"November"},{ID:12,Label:"December"}]}static GenerateYears(i,t,e){let a=-1;(t==null||t==null)&&(t=11),(e==null||e==null||!e)&&(a=1);let r=[];for(let n=0;n<t;n++)r.push(i+n*a);return r}static DateOnly(i){return i?new Date(new Date(i).toDateString()):new Date(new Date().toDateString())}static differentInDays(i,t){let e=t.getTime()-i.getTime();return Math.floor(e/(1e3*3600*24))}static minutesDiff(i,t){let e=(t.getTime()-i.getTime())/6e4;return Math.ceil(e)}static hoursDiff(i,t){let a=(t.getTime()-i.getTime())/(1e3*3600);return parseFloat(a.toFixed(1))}static Guid_NewGuid(){let i=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var a=(i+Math.random()*16)%16|0;return i=Math.floor(i/16),(e=="x"?a:a&3|8).toString(16)})}static parseJwt(i){var t=i.split(".")[1],e=t.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(e).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}static numberOnly(i){let t=i.which?i.which:i.keyCode;return!(t>31&&(t<48||t>57))}static formatNumber(i){let t="",e="",a=Math.abs(i);return a>999&&a<1e6?(e="K",t=(a/1e3).toFixed(0)):a>=1e6?(e="M",t=(a/1e6).toFixed(0)):a<999&&(t=a.toString()),i<0&&(t="-"+t),t.replace(/\B(?=(\d{3})+(?!\d))/g,",")+e}static isToDay(i){if(this.IsNotEmpty(i)){i=typeof i=="string"?new Date(i):i;let t=new Date;return t.setHours(0,0,0,0),i.setHours(0,0,0,0),t.getTime()==i.getTime()}return!1}static setToLatestTime(i){let t=new Date(i);return t.setHours(23,59,59),t}static setToFirstTime(i){let t=new Date(i);return t.setHours(0,0,0),t}static compare(i,t,e){return(i<t?-1:1)*(e?1:-1)}static generateSerialasNote(i=[]){let t="";return i&&i.length>0&&(t=`[${i.map((a,r)=>`${r>0?" ":""}${a.Number}${a.Quantity>1||a.Quantity<0?"*"+a.Quantity:""}`)}]`),t}static getDatesInRange(i,t){let e=new Date(i.getTime()),a=[];for(;e<=t;)a.push(new Date(e)),e.setDate(e.getDate()+1);return a}static getDaysBefore(i,t){return new Date(i.setDate(new Date().getDate()-t))}static getRangeDate(i,t){let e=new Date;e.setMonth(i),e.setFullYear(t);let a=new Date(e.getFullYear(),e.getMonth()-1,1),r=new Date(e.getFullYear(),e.getMonth(),0);return{firstDay:a,lastDay:r}}static setDateTime(i,t){let e=new Date;t&&(e=new Date(t));let a=i.split(":");return e.setHours(parseInt(a[0])),e.setMinutes(parseInt(a[1])),e}static isMaskingField(i=""){return i.includes("?")}static generateMaskingField(i=[]){let t={};return i.forEach((e,a)=>{e=e.split(" ")?.join(""),t=c(o({},t),{[e]:!0})}),t}static checkJSApiSupported(i){let t;return i in window?t=!0:t=!1,t}static cloneObject(i){let t;return this.checkJSApiSupported("structuredClone")?t=structuredClone(i):t=JSON.parse(JSON.stringify(i)),t}static formatTitleFromDate(i,t){let e=null,a=new Date(i),r=new Date(t);return a.getDate()!=r.getDate()&&(e="d"),a.getMonth()!=r.getMonth()&&(e="d MMM"),a.getFullYear()!=r.getFullYear()&&(e="d MMM yyyy"),e}};var N=(()=>{class s{initializeIntercom(){let t=this.getFromLocalStorage();l.IsNotEmpty(t)&&window.Intercom("boot",{app_id:p.intercom.appId,name:t.name,email:t.email,created_at:t.created,user_hash:t.hash})}shutdown(){window.Intercom("shutdown"),this.clearStorage()}clearStorage(){localStorage.removeItem("INTERCOM")}updateLocalStorage(t){localStorage.setItem("INTERCOM",JSON.stringify(t))}getFromLocalStorage(){let t=localStorage.getItem("INTERCOM");return JSON.parse(t)}hideLauncher(){let t=this.getFromLocalStorage();t.hide_default_launcher=!0,window.Intercom("update",o({app_id:p.intercom.appId},t)),this.updateLocalStorage(t)}showLauncher(){let t=this.getFromLocalStorage();t.hide_default_launcher=!1,window.Intercom("update",o({app_id:p.intercom.appId},t)),this.updateLocalStorage(t)}isHideLauncher(){let t=this.getFromLocalStorage();return l.IsEmpty(t?.hide_default_launcher)?!1:t?.hide_default_launcher}static{this.\u0275fac=function(e){return new(e||s)}}static{this.\u0275prov=m({token:s,factory:s.\u0275fac,providedIn:"root"})}}return s})();export{L as a,l as b,p as c,N as d};
1
+ import{a as b}from"./chunk-ZDTMCWOO.js";import{B as I,C as g,D}from"./chunk-SB5MSLCX.js";import{I as u,_ as d,ca as m,ia as f,n as y,s as h}from"./chunk-6K5LNQ4J.js";import{a as o,b as c}from"./chunk-YQFG5XE2.js";var L=(()=>{class s{constructor(){this.httpClient=f(D),this.toastr=f(b)}get(t="",e,a={}){return this.httpClient.get(`${t}${e}`,a).pipe(u(this.handleError.bind(this)))}post(t="",e,a,r={observe:"response"}){return this.httpClient.post(`${t}${e}`,a,o({},r)).pipe(d(this.handleResponse.bind(this)),h(n=>n instanceof I&&Object.prototype.hasOwnProperty.call(r,"observe")&&r.observe==="response"?n.body instanceof Blob?n:n.body:n),u(this.handleError.bind(this)))}put(t="",e,a,r={}){return this.httpClient.put(`${t}${e}`,a,c(o({},r),{observe:"response"})).pipe(d(this.handleResponse.bind(this)),h(n=>n.body),u(this.handleError.bind(this)))}delete(t="",e,a={}){return this.httpClient.delete(`${t}${e}`,c(o({},a),{observe:"response"})).pipe(d(this.handleResponse.bind(this)),h(r=>r.body),u(this.handleError.bind(this)))}handleResponse(t){if(t instanceof I&&t.status===200&&t.body){let e;typeof t.body=="object"&&t.body!==null&&(e=t.body.message||t.body.Message),typeof e=="string"&&e.length>0&&this.toastr.success(e,"Success")}}handleError(t){let e={header:"API Error",message:"An unknown error occurred"};if(t instanceof g)switch(t.status){case 0:e.message="CORS error: Request blocked or server not responding with proper CORS headers",e.header="CORS Error";break;case 504:e.message=t.statusText||"Gateway Timeout",e.header=`API Error: ${t.status}`;break;default:e.header=`API Error: ${t.status}`,e.message=t.error&&(t.error.Message||t.error.message||t.error.error)||t.message}return t instanceof g&&(t.status>=200&&t.status<300?this.toastr.success(e.message,e.header):t.status>=400&&t.status<500?this.toastr.warning(e.message,e.header):t.status>=500&&t.status<600&&this.toastr.error(e.message,e.header)),y(()=>e)}static{this.\u0275fac=function(e){return new(e||s)}}static{this.\u0275prov=m({token:s,factory:s.\u0275fac,providedIn:"root"})}}return s})();var p={production:!0,version:"5.43.2",changelogUrl:"https://changelog.dealpos.com/?categories=cat_O6pYAT7GI1mts",defaultTimezone:"Asia/Jakarta",intercom:{appId:"xv1oomgl"}};var l=class s{static{this.emailRegex=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/}static{this.phoneNumberRegex=/^\d+$/}static{this.GuidEmpty="00000000-0000-0000-0000-000000000000"}static{this.DecimalMinValue="-7.922816251426434e+28"}static{this.InputLockTimeSpan=500}static{this.MinDate="0001-01-01T00:00:00"}static{this.MinTime="00:00:00"}static{this.MinDecimal="-79228162514264337593543950335"}static StringFormat(i,...t){for(let e=0;e<t.length;e++)i=i.replace(`{${e}}`,t[e]);return i}static{this.isMobileDevice=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}static IsNotEmpty(i){return i!=""&&!s.containsOnlySpaces(i)&&i!=s.GuidEmpty&&i!=null&&i!=null}static IsEmpty(i){return!!(i==""||s.containsOnlySpaces(i)||i==null||i==null||i==s.GuidEmpty)}static isGuid(i){let t=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/gi,e=!1;return i&&(e=t.test(i)),e}static containsOnlySpaces(i){return/^\s*$/.test(i)}static FilterByID(i,t){try{let e=i.filter(a=>a.ID==t);if(e.length>0)return e[0]}catch{}return null}static{this.Months=[{ID:1,Label:"January"},{ID:2,Label:"February"},{ID:3,Label:"March"},{ID:4,Label:"April"},{ID:5,Label:"May"},{ID:6,Label:"June"},{ID:7,Label:"July"},{ID:8,Label:"August"},{ID:9,Label:"September"},{ID:10,Label:"October"},{ID:11,Label:"November"},{ID:12,Label:"December"}]}static GenerateYears(i,t,e){let a=-1;(t==null||t==null)&&(t=11),(e==null||e==null||!e)&&(a=1);let r=[];for(let n=0;n<t;n++)r.push(i+n*a);return r}static DateOnly(i){return i?new Date(new Date(i).toDateString()):new Date(new Date().toDateString())}static differentInDays(i,t){let e=t.getTime()-i.getTime();return Math.floor(e/(1e3*3600*24))}static minutesDiff(i,t){let e=(t.getTime()-i.getTime())/6e4;return Math.ceil(e)}static hoursDiff(i,t){let a=(t.getTime()-i.getTime())/(1e3*3600);return parseFloat(a.toFixed(1))}static Guid_NewGuid(){let i=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var a=(i+Math.random()*16)%16|0;return i=Math.floor(i/16),(e=="x"?a:a&3|8).toString(16)})}static parseJwt(i){var t=i.split(".")[1],e=t.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(e).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}static numberOnly(i){let t=i.which?i.which:i.keyCode;return!(t>31&&(t<48||t>57))}static formatNumber(i){let t="",e="",a=Math.abs(i);return a>999&&a<1e6?(e="K",t=(a/1e3).toFixed(0)):a>=1e6?(e="M",t=(a/1e6).toFixed(0)):a<999&&(t=a.toString()),i<0&&(t="-"+t),t.replace(/\B(?=(\d{3})+(?!\d))/g,",")+e}static isToDay(i){if(this.IsNotEmpty(i)){i=typeof i=="string"?new Date(i):i;let t=new Date;return t.setHours(0,0,0,0),i.setHours(0,0,0,0),t.getTime()==i.getTime()}return!1}static setToLatestTime(i){let t=new Date(i);return t.setHours(23,59,59),t}static setToFirstTime(i){let t=new Date(i);return t.setHours(0,0,0),t}static compare(i,t,e){return(i<t?-1:1)*(e?1:-1)}static generateSerialasNote(i=[]){let t="";return i&&i.length>0&&(t=`[${i.map((a,r)=>`${r>0?" ":""}${a.Number}${a.Quantity>1||a.Quantity<0?"*"+a.Quantity:""}`)}]`),t}static getDatesInRange(i,t){let e=new Date(i.getTime()),a=[];for(;e<=t;)a.push(new Date(e)),e.setDate(e.getDate()+1);return a}static getDaysBefore(i,t){return new Date(i.setDate(new Date().getDate()-t))}static getRangeDate(i,t){let e=new Date;e.setMonth(i),e.setFullYear(t);let a=new Date(e.getFullYear(),e.getMonth()-1,1),r=new Date(e.getFullYear(),e.getMonth(),0);return{firstDay:a,lastDay:r}}static setDateTime(i,t){let e=new Date;t&&(e=new Date(t));let a=i.split(":");return e.setHours(parseInt(a[0])),e.setMinutes(parseInt(a[1])),e}static isMaskingField(i=""){return i.includes("?")}static generateMaskingField(i=[]){let t={};return i.forEach((e,a)=>{e=e.split(" ")?.join(""),t=c(o({},t),{[e]:!0})}),t}static checkJSApiSupported(i){let t;return i in window?t=!0:t=!1,t}static cloneObject(i){let t;return this.checkJSApiSupported("structuredClone")?t=structuredClone(i):t=JSON.parse(JSON.stringify(i)),t}static formatTitleFromDate(i,t){let e=null,a=new Date(i),r=new Date(t);return a.getDate()!=r.getDate()&&(e="d"),a.getMonth()!=r.getMonth()&&(e="d MMM"),a.getFullYear()!=r.getFullYear()&&(e="d MMM yyyy"),e}};var N=(()=>{class s{initializeIntercom(){let t=this.getFromLocalStorage();l.IsNotEmpty(t)&&window.Intercom("boot",{app_id:p.intercom.appId,name:t.name,email:t.email,created_at:t.created,user_hash:t.hash})}shutdown(){window.Intercom("shutdown"),this.clearStorage()}clearStorage(){localStorage.removeItem("INTERCOM")}updateLocalStorage(t){localStorage.setItem("INTERCOM",JSON.stringify(t))}getFromLocalStorage(){let t=localStorage.getItem("INTERCOM");return JSON.parse(t)}hideLauncher(){let t=this.getFromLocalStorage();t.hide_default_launcher=!0,window.Intercom("update",o({app_id:p.intercom.appId},t)),this.updateLocalStorage(t)}showLauncher(){let t=this.getFromLocalStorage();t.hide_default_launcher=!1,window.Intercom("update",o({app_id:p.intercom.appId},t)),this.updateLocalStorage(t)}isHideLauncher(){let t=this.getFromLocalStorage();return l.IsEmpty(t?.hide_default_launcher)?!1:t?.hide_default_launcher}static{this.\u0275fac=function(e){return new(e||s)}}static{this.\u0275prov=m({token:s,factory:s.\u0275fac,providedIn:"root"})}}return s})();export{L as a,l as b,p as c,N as d};
@@ -1 +1 @@
1
- import{a as x,b as L}from"./chunk-B4JW5G5L.js";import"./chunk-JRH7ZWIT.js";import{a as E,b as O}from"./chunk-E3QNEH3B.js";import"./chunk-WXT6EZ2V.js";import{h as H}from"./chunk-O5EVYQVN.js";import{b as N,c as G}from"./chunk-L3PZS6EL.js";import{a as R,b as D}from"./chunk-5JV52UYK.js";import"./chunk-ACTRMWEI.js";import"./chunk-ARXP327B.js";import{w as V,x as j}from"./chunk-7FFMPB6T.js";import"./chunk-UKBDY33R.js";import"./chunk-72LNXEXV.js";import"./chunk-M3WCSF6D.js";import{a as I}from"./chunk-ZDTMCWOO.js";import"./chunk-F2X3VGZZ.js";import{n as A,s as F}from"./chunk-SB5MSLCX.js";import{$b as w,Cc as $,Db as P,Dc as h,Lb as p,Nc as l,Ob as d,Oc as m,Rc as _,Vb as o,W as T,Wb as n,Xb as c,Y as M,_ as S,ec as y,fc as s,h as v,hb as a,ia as u,qa as f,ra as C,s as g,sa as b,ta as k,xb as B}from"./chunk-6K5LNQ4J.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),y("onClick",function(){f(e);let r=s();return C(r.onFormatCOACategory())}),n(),o(2,"p-button",5),l(3,"async"),l(4,"async"),y("onClick",function(){f(e);let r=s();return C(r.onMigrateCoaCategory())}),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(h(12,q)),a(),d(h(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=u(x),this.toastr=u(I),this.refresh$=new v(void 0),this.pageTitle="Chart of Account Category"}ngOnInit(){let e=this.refresh$.pipe(M(()=>this.migrateService.getCOACategoryCount()),S(t=>console.log("API response:",t)),T(1));this.countInPOS$=e.pipe(g(t=>Number(t.pos))),this.countInBooks$=e.pipe(g(t=>Number(t.books)))}onMigrateCoaCategory(){this.migrateService.migrateCoaCategory().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormatCOACategory(){confirm("Are you sure you want to format?")&&this.migrateService.formatManualCOACategory().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:[$([x])],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,_)(3,K,9,14,"ng-template",null,1,_),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 CoaCategoryComponent};
1
+ import{a as x,b as L}from"./chunk-RJSTA3LD.js";import"./chunk-OB7IGUCM.js";import{a as E,b as O}from"./chunk-E3QNEH3B.js";import"./chunk-WXT6EZ2V.js";import{h as H}from"./chunk-5TF7YHMI.js";import{b as N,c as G}from"./chunk-L3PZS6EL.js";import{a as R,b as D}from"./chunk-5JV52UYK.js";import"./chunk-ACTRMWEI.js";import"./chunk-ARXP327B.js";import{w as V,x as j}from"./chunk-7FFMPB6T.js";import"./chunk-UKBDY33R.js";import"./chunk-72LNXEXV.js";import"./chunk-XMHQMMFC.js";import{a as I}from"./chunk-ZDTMCWOO.js";import"./chunk-F2X3VGZZ.js";import{n as A,s as F}from"./chunk-SB5MSLCX.js";import{$b as w,Cc as $,Db as P,Dc as h,Lb as p,Nc as l,Ob as d,Oc as m,Rc as _,Vb as o,W as T,Wb as n,Xb as c,Y as M,_ as S,ec as y,fc as s,h as v,hb as a,ia as u,qa as f,ra as C,s as g,sa as b,ta as k,xb as B}from"./chunk-6K5LNQ4J.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),y("onClick",function(){f(e);let r=s();return C(r.onFormatCOACategory())}),n(),o(2,"p-button",5),l(3,"async"),l(4,"async"),y("onClick",function(){f(e);let r=s();return C(r.onMigrateCoaCategory())}),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(h(12,q)),a(),d(h(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=u(x),this.toastr=u(I),this.refresh$=new v(void 0),this.pageTitle="Chart of Account Category"}ngOnInit(){let e=this.refresh$.pipe(M(()=>this.migrateService.getCOACategoryCount()),S(t=>console.log("API response:",t)),T(1));this.countInPOS$=e.pipe(g(t=>Number(t.pos))),this.countInBooks$=e.pipe(g(t=>Number(t.books)))}onMigrateCoaCategory(){this.migrateService.migrateCoaCategory().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormatCOACategory(){confirm("Are you sure you want to format?")&&this.migrateService.formatManualCOACategory().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:[$([x])],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,_)(3,K,9,14,"ng-template",null,1,_),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 CoaCategoryComponent};
@@ -1 +1 @@
1
- import{a as i,b as T}from"./chunk-WLKS6LBU.js";import{d as s}from"./chunk-EFDD6Q3K.js";import{a as l,d as m}from"./chunk-M3WCSF6D.js";import{_ as a,ca as c,ia as r}from"./chunk-6K5LNQ4J.js";var h=(()=>{class o{constructor(){this.httpService=r(l),this.router=r(s),this.intercomService=r(m),this.tokenService=r(T),this.autoLogout()}login(e){return this.httpService.post("","api/Authentication/login",e).pipe(a(t=>{let n=e.SubDomain;localStorage.setItem("AUTH_TOKEN",t.access_token),localStorage.setItem("AUTH_POS_TOKEN",t.pos.access_token),localStorage.setItem("AUTH_TOKEN_TYPE",t.token_type),localStorage.setItem("AUTH_EXPIRES_AT",t.expiredAt),localStorage.setItem("AUTH_DOMAIN",n.substring(n.indexOf("."))),localStorage.setItem("AUTH_SUB_DOMAIN",e.SubDomain.split(".")[0]),localStorage.setItem("AUTH_USERNAME",e.Username),this.storeIntercom(t),this.storeTenantId(t.pos.access_token),this.storeRoles(t.access_token),this.tokenService.setToken(t.access_token),this.autoLogout()}))}storeIntercom(e){let t=e.intercomWidget?JSON.stringify(e.intercomWidget):null;t&&localStorage.setItem("INTERCOM",t)}isAuthenticated(){return!!localStorage.getItem("AUTH_TOKEN")}getToken(){return localStorage.getItem("AUTH_TOKEN")}getTokenType(){return localStorage.getItem("AUTH_TOKEN_TYPE")}isTokenExpired(){let e=localStorage.getItem("AUTH_EXPIRES_AT");return e?new Date(e).getTime()<Date.now():!0}autoLogout(){clearTimeout(this.logoutTimer);let e=localStorage.getItem("AUTH_EXPIRES_AT");if(!e)return;let t=new Date(e).getTime()-Date.now();t>0?this.logoutTimer=setTimeout(()=>this.logout(),t):this.logout()}getTenantExternalURL(){let e=localStorage.getItem("AUTH_SUB_DOMAIN")||"",t=localStorage.getItem("AUTH_DOMAIN")||"";return e&&t?`https://${e}${t}`:""}getTanantToken(){return localStorage.getItem("AUTH_POS_TOKEN")}logout(){this.intercomService.shutdown(),localStorage.removeItem("AUTH_TOKEN"),localStorage.removeItem("AUTH_TOKEN_TYPE"),localStorage.removeItem("AUTH_EXPIRES_AT"),localStorage.removeItem("INTERCOM"),clearTimeout(this.logoutTimer),this.router.navigate([""])}getFullDomain(){let e=localStorage.getItem("AUTH_SUB_DOMAIN"),t=localStorage.getItem("AUTH_DOMAIN");return!e||!t?(console.error("Subdomain or domain is missing in local storage."),null):`${e}${t}`}storeTenantId(e){let t=i(e);console.log("Decoded Token:",t),t&&(localStorage.setItem("AC_TENANT_BRAND",t.Brand),localStorage.setItem("AC_TENANT_LID",t.LID))}storeRoles(e){let t=i(e);console.log("Decoded Token:",t),t&&localStorage.setItem("AUTH_ROLES",JSON.stringify(t["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"]))}checkAuthKeysExists(){return["AC_TENANT_BRAND","AC_TENANT_LID","AUTH_DOMAIN","AUTH_EXPIRES_AT","AUTH_POS_TOKEN","AUTH_SUB_DOMAIN","AUTH_TOKEN","AUTH_TOKEN_TYPE","AUTH_USERNAME","AUTH_ROLES"].every(t=>!!localStorage.getItem(t))}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275prov=c({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();export{h as a};
1
+ import{a as i,b as T}from"./chunk-7COI2POD.js";import{d as s}from"./chunk-EFDD6Q3K.js";import{a as l,d as m}from"./chunk-XMHQMMFC.js";import{_ as a,ca as c,ia as r}from"./chunk-6K5LNQ4J.js";var h=(()=>{class o{constructor(){this.httpService=r(l),this.router=r(s),this.intercomService=r(m),this.tokenService=r(T),this.autoLogout()}login(e){return this.httpService.post("","api/Authentication/login",e).pipe(a(t=>{let n=e.SubDomain;localStorage.setItem("AUTH_TOKEN",t.access_token),localStorage.setItem("AUTH_POS_TOKEN",t.pos.access_token),localStorage.setItem("AUTH_TOKEN_TYPE",t.token_type),localStorage.setItem("AUTH_EXPIRES_AT",t.expiredAt),localStorage.setItem("AUTH_DOMAIN",n.substring(n.indexOf("."))),localStorage.setItem("AUTH_SUB_DOMAIN",e.SubDomain.split(".")[0]),localStorage.setItem("AUTH_USERNAME",e.Username),this.storeIntercom(t),this.storeTenantId(t.pos.access_token),this.storeRoles(t.access_token),this.tokenService.setToken(t.access_token),this.autoLogout()}))}storeIntercom(e){let t=e.intercomWidget?JSON.stringify(e.intercomWidget):null;t&&localStorage.setItem("INTERCOM",t)}isAuthenticated(){return!!localStorage.getItem("AUTH_TOKEN")}getToken(){return localStorage.getItem("AUTH_TOKEN")}getTokenType(){return localStorage.getItem("AUTH_TOKEN_TYPE")}isTokenExpired(){let e=localStorage.getItem("AUTH_EXPIRES_AT");return e?new Date(e).getTime()<Date.now():!0}autoLogout(){clearTimeout(this.logoutTimer);let e=localStorage.getItem("AUTH_EXPIRES_AT");if(!e)return;let t=new Date(e).getTime()-Date.now();t>0?this.logoutTimer=setTimeout(()=>this.logout(),t):this.logout()}getTenantExternalURL(){let e=localStorage.getItem("AUTH_SUB_DOMAIN")||"",t=localStorage.getItem("AUTH_DOMAIN")||"";return e&&t?`https://${e}${t}`:""}getTanantToken(){return localStorage.getItem("AUTH_POS_TOKEN")}logout(){this.intercomService.shutdown(),localStorage.removeItem("AUTH_TOKEN"),localStorage.removeItem("AUTH_TOKEN_TYPE"),localStorage.removeItem("AUTH_EXPIRES_AT"),localStorage.removeItem("INTERCOM"),clearTimeout(this.logoutTimer),this.router.navigate([""])}getFullDomain(){let e=localStorage.getItem("AUTH_SUB_DOMAIN"),t=localStorage.getItem("AUTH_DOMAIN");return!e||!t?(console.error("Subdomain or domain is missing in local storage."),null):`${e}${t}`}storeTenantId(e){let t=i(e);console.log("Decoded Token:",t),t&&(localStorage.setItem("AC_TENANT_BRAND",t.Brand),localStorage.setItem("AC_TENANT_LID",t.LID))}storeRoles(e){let t=i(e);console.log("Decoded Token:",t),t&&localStorage.setItem("AUTH_ROLES",JSON.stringify(t["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"]))}checkAuthKeysExists(){return["AC_TENANT_BRAND","AC_TENANT_LID","AUTH_DOMAIN","AUTH_EXPIRES_AT","AUTH_POS_TOKEN","AUTH_SUB_DOMAIN","AUTH_TOKEN","AUTH_TOKEN_TYPE","AUTH_USERNAME","AUTH_ROLES"].every(t=>!!localStorage.getItem(t))}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275prov=c({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();export{h as a};
@@ -1 +1 @@
1
- import{a as v,b as H}from"./chunk-B4JW5G5L.js";import"./chunk-JRH7ZWIT.js";import{a as F,b as I}from"./chunk-E3QNEH3B.js";import"./chunk-WXT6EZ2V.js";import{h as G}from"./chunk-O5EVYQVN.js";import{b as D,c as N}from"./chunk-L3PZS6EL.js";import{a as O,b as R}from"./chunk-5JV52UYK.js";import"./chunk-ACTRMWEI.js";import"./chunk-ARXP327B.js";import{w as V,x as j}from"./chunk-7FFMPB6T.js";import"./chunk-UKBDY33R.js";import"./chunk-72LNXEXV.js";import"./chunk-M3WCSF6D.js";import{a as $}from"./chunk-ZDTMCWOO.js";import"./chunk-F2X3VGZZ.js";import{n as A,s as P}from"./chunk-SB5MSLCX.js";import{$b as w,Cc as B,Db as E,Dc as _,Lb as p,Nc as c,Ob as x,Oc as m,Rc as C,Vb as n,W as y,Wb as o,Xb as l,Y as b,ec as h,fc as s,h as T,hb as a,ia as f,qa as g,ra as d,s as u,sa as M,ta as S,xb as k}from"./chunk-6K5LNQ4J.js";import"./chunk-YQFG5XE2.js";var L=()=>({height:"calc(100vh - 100px)"});function z(i,q){if(i&1){let e=w();n(0,"div",3)(1,"p-button",4),h("onClick",function(){g(e);let r=s();return d(r.onFormat())}),o(),n(2,"p-button",5),c(3,"async"),c(4,"async"),h("onClick",function(){g(e);let r=s();return d(r.onMigrate())}),o()()}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 J(i,q){if(i&1&&(n(0,"p-scroll-panel")(1,"p-panel")(2,"div",6),l(3,"app-migration-cards",7),c(4,"async"),M(),n(5,"svg",8),l(6,"path",9),o(),S(),l(7,"app-migration-cards",10),c(8,"async"),o()()()),i&2){let e=s();x(_(12,L)),a(),x(_(13,L)),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 le=(()=>{class i{constructor(){this.migrateService=f(v),this.toastr=f($),this.refresh$=new T(void 0),this.pageTitle="Expense Account"}ngOnInit(){let e=this.refresh$.pipe(b(()=>this.migrateService.getExpenseAccountCount()),y(1));this.countInPOS$=e.pipe(u(t=>Number(t.pos))),this.countInBooks$=e.pipe(u(t=>Number(t.books)))}onMigrate(){this.migrateService.migrateExpenseAccount().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormat(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatExpenseAccount().subscribe(t=>{this.refresh$.next(),this.toastr.success(t.message,"Format Successful")})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=k({type:i,selectors:[["app-expense-account"]],features:[B([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&&(n(0,"app-main-panel",2),E(1,z,5,6,"ng-template",null,0,C)(3,J,9,14,"ng-template",null,1,C),o()),t&2&&p("pageTitle",r.pageTitle)},dependencies:[G,P,A,I,F,R,O,N,D,H,j,V],encapsulation:2})}}return i})();export{le as ExpenseAccountComponent};
1
+ import{a as v,b as H}from"./chunk-RJSTA3LD.js";import"./chunk-OB7IGUCM.js";import{a as F,b as I}from"./chunk-E3QNEH3B.js";import"./chunk-WXT6EZ2V.js";import{h as G}from"./chunk-5TF7YHMI.js";import{b as D,c as N}from"./chunk-L3PZS6EL.js";import{a as O,b as R}from"./chunk-5JV52UYK.js";import"./chunk-ACTRMWEI.js";import"./chunk-ARXP327B.js";import{w as V,x as j}from"./chunk-7FFMPB6T.js";import"./chunk-UKBDY33R.js";import"./chunk-72LNXEXV.js";import"./chunk-XMHQMMFC.js";import{a as $}from"./chunk-ZDTMCWOO.js";import"./chunk-F2X3VGZZ.js";import{n as A,s as P}from"./chunk-SB5MSLCX.js";import{$b as w,Cc as B,Db as E,Dc as _,Lb as p,Nc as c,Ob as x,Oc as m,Rc as C,Vb as n,W as y,Wb as o,Xb as l,Y as b,ec as h,fc as s,h as T,hb as a,ia as f,qa as g,ra as d,s as u,sa as M,ta as S,xb as k}from"./chunk-6K5LNQ4J.js";import"./chunk-YQFG5XE2.js";var L=()=>({height:"calc(100vh - 100px)"});function z(i,q){if(i&1){let e=w();n(0,"div",3)(1,"p-button",4),h("onClick",function(){g(e);let r=s();return d(r.onFormat())}),o(),n(2,"p-button",5),c(3,"async"),c(4,"async"),h("onClick",function(){g(e);let r=s();return d(r.onMigrate())}),o()()}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 J(i,q){if(i&1&&(n(0,"p-scroll-panel")(1,"p-panel")(2,"div",6),l(3,"app-migration-cards",7),c(4,"async"),M(),n(5,"svg",8),l(6,"path",9),o(),S(),l(7,"app-migration-cards",10),c(8,"async"),o()()()),i&2){let e=s();x(_(12,L)),a(),x(_(13,L)),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 le=(()=>{class i{constructor(){this.migrateService=f(v),this.toastr=f($),this.refresh$=new T(void 0),this.pageTitle="Expense Account"}ngOnInit(){let e=this.refresh$.pipe(b(()=>this.migrateService.getExpenseAccountCount()),y(1));this.countInPOS$=e.pipe(u(t=>Number(t.pos))),this.countInBooks$=e.pipe(u(t=>Number(t.books)))}onMigrate(){this.migrateService.migrateExpenseAccount().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormat(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatExpenseAccount().subscribe(t=>{this.refresh$.next(),this.toastr.success(t.message,"Format Successful")})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=k({type:i,selectors:[["app-expense-account"]],features:[B([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&&(n(0,"app-main-panel",2),E(1,z,5,6,"ng-template",null,0,C)(3,J,9,14,"ng-template",null,1,C),o()),t&2&&p("pageTitle",r.pageTitle)},dependencies:[G,P,A,I,F,R,O,N,D,H,j,V],encapsulation:2})}}return i})();export{le as ExpenseAccountComponent};