dealpos 25.48.5 → 25.48.6

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 (86) hide show
  1. package/browser/{chunk-KOIXQIFI.js → chunk-332USX7W.js} +2 -2
  2. package/browser/{chunk-3BYOAKKN.js → chunk-3HJZRVBA.js} +2 -2
  3. package/browser/{chunk-43XCKR4T.js → chunk-3HW5OYRU.js} +1 -1
  4. package/browser/{chunk-FGQSNKIW.js → chunk-3KBVHDMW.js} +1 -1
  5. package/browser/{chunk-3O2KEJPY.js → chunk-3ZZKFV67.js} +1 -1
  6. package/browser/{chunk-SZP2CG53.js → chunk-5MIYFDIU.js} +1 -1
  7. package/browser/{chunk-H3ZKZANT.js → chunk-5S3ODP72.js} +2 -2
  8. package/browser/{chunk-AFCGZXZL.js → chunk-6GBWF2IE.js} +1 -1
  9. package/browser/{chunk-CU4MAJ2F.js → chunk-76AAF2XH.js} +1 -1
  10. package/browser/{chunk-SRI2BJQF.js → chunk-7DAOMPKT.js} +1 -1
  11. package/browser/{chunk-YMKC6WKL.js → chunk-7RNMAY2Q.js} +1 -1
  12. package/browser/{chunk-JSOH4GF6.js → chunk-7YT7VTC7.js} +1 -1
  13. package/browser/{chunk-FYT4PMAA.js → chunk-ALRWC3CB.js} +1 -1
  14. package/browser/{chunk-SUNKROJW.js → chunk-AV6NQKIK.js} +1 -1
  15. package/browser/{chunk-VZACJTOY.js → chunk-AZHKO7UJ.js} +1 -1
  16. package/browser/{chunk-UTINDCB3.js → chunk-BF3MVRGL.js} +1 -1
  17. package/browser/{chunk-EL573UFU.js → chunk-BYKK6PJ6.js} +1 -1
  18. package/browser/{chunk-LHCZ2R2J.js → chunk-C3OTQN4T.js} +1 -1
  19. package/browser/{chunk-VEFO7MBD.js → chunk-COQRSZM6.js} +1 -1
  20. package/browser/{chunk-HOVNEAPE.js → chunk-CU53YQQD.js} +1 -1
  21. package/browser/{chunk-QBD5GPEL.js → chunk-CUXNQSG5.js} +1 -1
  22. package/browser/{chunk-VFACQEV2.js → chunk-D7E53ETR.js} +1 -1
  23. package/browser/{chunk-IPQEP4DL.js → chunk-DMMG2LPV.js} +1 -1
  24. package/browser/{chunk-CBWH54HO.js → chunk-DW7WC4FH.js} +2 -2
  25. package/browser/{chunk-FYPVBCSP.js → chunk-E4O357Z5.js} +1 -1
  26. package/browser/{chunk-5MTTARWP.js → chunk-EOCYW77B.js} +1 -1
  27. package/browser/{chunk-E2X2VUY5.js → chunk-F7DQLZDB.js} +1 -1
  28. package/browser/{chunk-WZMG65MB.js → chunk-FH4Y2WG5.js} +1 -1
  29. package/browser/{chunk-QCGJCA7W.js → chunk-FPGP3VWH.js} +1 -1
  30. package/browser/{chunk-EUPX7YAH.js → chunk-I4ZRPW56.js} +1 -1
  31. package/browser/{chunk-ATSDXPMD.js → chunk-IQGTPKBQ.js} +1 -1
  32. package/browser/{chunk-TE5XQAKG.js → chunk-JEKBZZ5U.js} +1 -1
  33. package/browser/{chunk-2URU7BNW.js → chunk-JR4YQHON.js} +1 -1
  34. package/browser/{chunk-J3RH6VSY.js → chunk-JTQ2DJ3S.js} +1 -1
  35. package/browser/{chunk-T6JASS2U.js → chunk-KGDYUUZW.js} +1 -1
  36. package/browser/{chunk-EXZ5WHGJ.js → chunk-KHJPKMJG.js} +1 -1
  37. package/browser/{chunk-6ESEH65X.js → chunk-KOB6YLFK.js} +1 -1
  38. package/browser/{chunk-4JO4I7OP.js → chunk-L4N6SUWU.js} +1 -1
  39. package/browser/{chunk-P33FDCSO.js → chunk-M4CNRLAE.js} +1 -1
  40. package/browser/{chunk-ONA5XQJ6.js → chunk-M4SJ6QNM.js} +1 -1
  41. package/browser/{chunk-WNSJUVEG.js → chunk-M665M6PA.js} +1 -1
  42. package/browser/{chunk-EEP3AGFO.js → chunk-MHI4CB7R.js} +1 -1
  43. package/browser/{chunk-XQPY2KKM.js → chunk-MKNNAGYJ.js} +1 -1
  44. package/browser/{chunk-HXZ3BBWV.js → chunk-MKWUM2LV.js} +1 -1
  45. package/browser/{chunk-M7VQYRIN.js → chunk-N2MEEQHJ.js} +1 -1
  46. package/browser/{chunk-BXMPPC2K.js → chunk-N5DU5K47.js} +1 -1
  47. package/browser/{chunk-SRQAU7MO.js → chunk-N5RGMLD2.js} +1 -1
  48. package/browser/{chunk-ECI3JUT4.js → chunk-N5ZHCZLF.js} +2 -2
  49. package/browser/{chunk-5IDSWQS3.js → chunk-NEQHRQ56.js} +1 -1
  50. package/browser/{chunk-7Q7EXWXQ.js → chunk-O354RIVK.js} +1 -1
  51. package/browser/{chunk-MUDKCTQZ.js → chunk-PHFXJNIZ.js} +1 -1
  52. package/browser/{chunk-SMBODI4Z.js → chunk-PVEBGKGT.js} +1 -1
  53. package/browser/{chunk-DLTP25Q4.js → chunk-Q3N7QXAE.js} +1 -1
  54. package/browser/{chunk-GQ4YHESM.js → chunk-QEP6RSHV.js} +1 -1
  55. package/browser/{chunk-TFQEDTIJ.js → chunk-QK5RV2BD.js} +1 -1
  56. package/browser/{chunk-IOV4GOQI.js → chunk-QK73Q7YA.js} +1 -1
  57. package/browser/{chunk-5Z67OF3F.js → chunk-QOGVK4JI.js} +1 -1
  58. package/browser/{chunk-3VUYS2R3.js → chunk-RZGFJCUE.js} +1 -1
  59. package/browser/{chunk-QSOSU4WJ.js → chunk-S65DCKKO.js} +1 -1
  60. package/browser/{chunk-BFG3ONDW.js → chunk-SMIPNG4O.js} +1 -1
  61. package/browser/{chunk-ZWOO2T5B.js → chunk-SXXWBS4Q.js} +1 -1
  62. package/browser/{chunk-XVAXBZRP.js → chunk-SZY2RG5Z.js} +1 -1
  63. package/browser/{chunk-VYFNN5KO.js → chunk-T5T2JDU6.js} +2 -2
  64. package/browser/{chunk-DCP6YHOG.js → chunk-TCX4QJVI.js} +1 -1
  65. package/browser/{chunk-BAJZN6GG.js → chunk-TWDVQAYI.js} +1 -1
  66. package/browser/{chunk-OVURZHBN.js → chunk-US6O4OD4.js} +1 -1
  67. package/browser/{chunk-GIXQDFPA.js → chunk-V7QWHGJY.js} +1 -1
  68. package/browser/{chunk-MHWKMAZA.js → chunk-VBQ3XDAA.js} +1 -1
  69. package/browser/{chunk-OS2K6L3F.js → chunk-VDEYY3ZP.js} +1 -1
  70. package/browser/{chunk-DW45VI5D.js → chunk-VPCX5SL3.js} +1 -1
  71. package/browser/{chunk-BYJWH7XV.js → chunk-W6IXGY3Q.js} +1 -1
  72. package/browser/{chunk-MY3RL7KC.js → chunk-WT3FMUO2.js} +1 -1
  73. package/browser/{chunk-7CV4W47N.js → chunk-WUYZJSXG.js} +2 -2
  74. package/browser/{chunk-3SWXTTPO.js → chunk-WZOD5NOT.js} +1 -1
  75. package/browser/{chunk-2F2N3F6Z.js → chunk-X7DJSHLD.js} +1 -1
  76. package/browser/{chunk-TX25Q7SF.js → chunk-XIYMH3JF.js} +1 -1
  77. package/browser/{chunk-KUHFLUAH.js → chunk-XOGIPG34.js} +1 -1
  78. package/browser/{chunk-FN3FLPZX.js → chunk-XZCKUF3K.js} +1 -1
  79. package/browser/{chunk-S3K4X3F3.js → chunk-YAHJ37F6.js} +1 -1
  80. package/browser/{chunk-63GHS5BY.js → chunk-ZEUW2FNU.js} +1 -1
  81. package/browser/{chunk-SWCGPTOO.js → chunk-ZNU6SF5X.js} +1 -1
  82. package/browser/{chunk-OYAPHDOB.js → chunk-ZP5JY3GX.js} +1 -1
  83. package/browser/{chunk-B2JIU5OL.js → chunk-ZQ3KZRWR.js} +1 -1
  84. package/browser/index.html +2 -2
  85. package/browser/{main-R5FU4LYU.js → main-O4YWLPG2.js} +2 -2
  86. package/package.json +1 -1
@@ -1 +1 @@
1
- import{a as ce,b as de,c as _e,d as se,e as ge,f as ue}from"./chunk-MUDKCTQZ.js";import"./chunk-PHH2AA3W.js";import"./chunk-OS2K6L3F.js";import"./chunk-DTVCBHPA.js";import"./chunk-5USF4MRW.js";import{a as te}from"./chunk-363IDTE3.js";import{a as ee}from"./chunk-QZZ2NRA3.js";import"./chunk-FAED643P.js";import{e as me}from"./chunk-WMZLH4YK.js";import"./chunk-72RZBOHX.js";import"./chunk-3RK6DDJD.js";import"./chunk-M3DKYPGC.js";import"./chunk-6WATOQG3.js";import"./chunk-VM4K4MNV.js";import"./chunk-XTCEZONP.js";import"./chunk-LNDHYAFW.js";import{d as re,e as le}from"./chunk-5ZD6KTDH.js";import"./chunk-ZZBF7AOW.js";import{c as pe}from"./chunk-ATSDXPMD.js";import{b as $}from"./chunk-VXPORXGI.js";import{a as Y}from"./chunk-ZWOO2T5B.js";import"./chunk-SMBODI4Z.js";import"./chunk-L6PKNRWO.js";import"./chunk-SIQZO2WM.js";import{a as ie}from"./chunk-J6M7UWVR.js";import{e as oe,f as ae}from"./chunk-WZMG65MB.js";import"./chunk-SUNKROJW.js";import"./chunk-7YUPYNWQ.js";import"./chunk-2CL5FM3P.js";import"./chunk-LGINK7BD.js";import"./chunk-IKKPP4JS.js";import"./chunk-QPAUI5EG.js";import"./chunk-45E6XCHN.js";import"./chunk-SIDUUVNA.js";import"./chunk-KZFNI67M.js";import"./chunk-4BXCIT62.js";import"./chunk-D4FCXEV4.js";import"./chunk-6P2ASCNY.js";import"./chunk-BAJZN6GG.js";import{b as ne}from"./chunk-QSOSU4WJ.js";import"./chunk-R2GUMKAU.js";import"./chunk-BT7NN7PT.js";import"./chunk-26YFRPR2.js";import{b as U,c as X}from"./chunk-JBS5UYZC.js";import"./chunk-TEGIL5RZ.js";import"./chunk-B7AC4RMR.js";import"./chunk-EQLHPWVB.js";import"./chunk-THT6CY5E.js";import{g as Z}from"./chunk-ZTD4APMR.js";import"./chunk-7P3L3ODB.js";import"./chunk-S7FOJJP2.js";import"./chunk-FU2ZGMX4.js";import"./chunk-2FWFPV5I.js";import{oa as K}from"./chunk-SLX34TWD.js";import{F as G,c as k,h as Q,o as j,q}from"./chunk-DWZ5JTI2.js";import"./chunk-SZP2CG53.js";import"./chunk-LHCZ2R2J.js";import"./chunk-36GWLMZX.js";import{b as J}from"./chunk-YVBGB3JF.js";import"./chunk-WUV22SZ4.js";import"./chunk-VZACJTOY.js";import{s as z}from"./chunk-LGOSIAUC.js";import{Ab as E,Fb as p,Fc as _,Gb as o,Gc as s,Hb as i,Hc as D,Ib as f,Jd as W,Lc as O,Pb as I,Qd as A,Sb as h,Sd as N,Ub as m,Xa as a,eb as C,hc as l,ib as B,ic as M,jc as g,jd as L,mb as F,mc as v,nc as S,ob as x,oc as b,sc as V,sd as R,ta as u,ua as y,vd as H,xc as T,yb as P,yc as w}from"./chunk-IEVGW2RT.js";import"./chunk-WFMAM73Y.js";import"./chunk-SNAKHGZS.js";var Ce=()=>({"min-width":"50rem","font-family":"Roboto, sans-serif"}),xe=()=>["/menu/Products/Catalog/Products"],ye=t=>({CategoryID:t}),ve=()=>["/menu/Inventory/Quantity/Valuation"];function Se(t,c){if(t&1){let e=I();o(0,"button",10),h("click",function(){u(e);let n=m(2);return y(n.openExportModal())}),f(1,"i",11),l(2," Export "),i()}}function be(t,c){if(t&1){let e=I();o(0,"div",12)(1,"h6"),l(2,"Outlet"),i(),o(3,"outlet-selector",13),b("ngModelChange",function(n){u(e);let d=m(2);return S(d.pageData.Filter.ListIDs,n)||(d.pageData.Filter.ListIDs=n),y(n)}),i(),o(4,"h6"),l(5,"Quantity From - To"),i(),o(6,"div",14)(7,"input",15),b("ngModelChange",function(n){u(e);let d=m(2);return S(d.pageData.Filter.QuantityFrom,n)||(d.pageData.Filter.QuantityFrom=n),y(n)}),i(),o(8,"span",16),l(9,"-"),i(),o(10,"input",17),b("ngModelChange",function(n){u(e);let d=m(2);return S(d.pageData.Filter.QuantityTo,n)||(d.pageData.Filter.QuantityTo=n),y(n)}),i()(),o(11,"h6"),l(12,"Discontinued"),i(),o(13,"radio-options",18),b("modelChange",function(n){u(e);let d=m(2);return S(d.pageData.Filter.Discontinued,n)||(d.pageData.Filter.Discontinued=n),y(n)}),i()()}if(t&2){let e=m(2);a(3),p("multiple",!0)("accessType",2),v("ngModel",e.pageData.Filter.ListIDs),a(4),v("ngModel",e.pageData.Filter.QuantityFrom),a(3),v("ngModel",e.pageData.Filter.QuantityTo),a(3),v("model",e.pageData.Filter.Discontinued),p("options",e.pageData.Options.Discontinued)}}function Ie(t,c){t&1&&(o(0,"th",27),l(1," Cost "),f(2,"p-treeTableSortIcon",28),i())}function Te(t,c){t&1&&(o(0,"th",29),l(1," Price "),f(2,"p-treeTableSortIcon",30),i())}function De(t,c){t&1&&(o(0,"th",31),l(1," % "),f(2,"p-treeTableSortIcon",32),i())}function he(t,c){if(t&1&&(o(0,"tr",19)(1,"th",20),l(2," Category "),f(3,"p-treeTableSortIcon",21),i(),o(4,"th",22),l(5," On Hand "),f(6,"p-treeTableSortIcon",23),i(),x(7,Ie,3,0,"th",24)(8,Te,3,0,"th",25)(9,De,3,0,"th",26),i()),t&2){let e=m(2);a(7),p("ngIf",e.roleService.product.Cost),a(),p("ngIf",e.roleService.product.Price),a(),p("ngIf",e.roleService.product.Cost&&e.roleService.product.Price)}}function we(t,c){if(t&1&&(o(0,"td"),l(1),_(2,"amountFraction"),i()),t&2){let e=m().rowData;a(),g(" ",s(2,1,e.DisplayedCost)," ")}}function Be(t,c){if(t&1&&(o(0,"td"),l(1),_(2,"amountFraction"),i()),t&2){let e=m().rowData;a(),g(" ",s(2,1,e.DisplayedPrice)," ")}}function Fe(t,c){if(t&1&&(o(0,"td")(1,"span",38),_(2,"number"),l(3),_(4,"number"),i()()),t&2){let e=m().rowData;a(),p("matTooltip",D(2,2,e.DisplayedPercentage,"1.0-5")+"%"),a(2),g(" ",D(4,5,e.DisplayedPercentage,"1.0-0"),"% ")}}function Pe(t,c){if(t&1&&(o(0,"tr",33)(1,"td"),f(2,"p-treeTableToggler",34),o(3,"a",35),l(4),i()(),o(5,"td")(6,"a",36),_(7,"number"),_(8,"number"),_(9,"number"),l(10),_(11,"quantityFraction"),i()(),x(12,we,3,3,"td",37)(13,Be,3,3,"td",37)(14,Fe,5,8,"td",37),i()),t&2){let e=c.$implicit,r=c.rowData,n=m(2);p("ttRow",e),a(2),p("rowNode",e),a(),p("routerLink",T(21,xe))("queryParams",w(22,ye,r.ID)),a(),M(r.Name),a(2),p("matTooltip",V(r.OnHandIndirect&&r.OnHand?"Direct ("+s(7,13,r.OnHand)+") Indirect ("+s(8,15,r.OnHandIndirect)+")":r.OnHandIndirect?"Indirect ("+s(9,17,r.OnHandIndirect)+")":""))("routerLink",T(24,ve))("queryParams",w(25,ye,r.ID)),a(4),g("",s(11,19,r.DisplayedOnHand)," "),a(2),p("ngIf",n.roleService.product.Cost),a(),p("ngIf",n.roleService.product.Price),a(),p("ngIf",n.roleService.product.Cost&&n.roleService.product.Price)}}function Ee(t,c){if(t&1&&(o(0,"td",40),l(1),_(2,"amountFraction"),i()),t&2){let e=m(3);a(),g(" ",s(2,1,e.data==null||e.data.Aggregate==null?null:e.data.Aggregate.TotalCost)," ")}}function Me(t,c){if(t&1&&(o(0,"td",40),l(1),_(2,"amountFraction"),i()),t&2){let e=m(3);a(),g(" ",s(2,1,e.data==null||e.data.Aggregate==null?null:e.data.Aggregate.TotalPrice)," ")}}function Ve(t,c){if(t&1&&(o(0,"td",40),l(1),_(2,"number"),i()),t&2){let e=m(3);a(),g(" ",D(2,1,e.data==null||e.data.Aggregate==null?null:e.data.Aggregate.TotalPercentage,"1.0-0"),"% ")}}function Oe(t,c){if(t&1&&(o(0,"tr",39)(1,"td",40),l(2,"Total:"),i(),o(3,"td",40),l(4),_(5,"quantityFraction"),i(),x(6,Ee,3,3,"td",41)(7,Me,3,3,"td",41)(8,Ve,3,4,"td",41),i()),t&2){let e=m(2);a(4),g(" ",s(5,4,e.data==null||e.data.Aggregate==null?null:e.data.Aggregate.TotalOnHand)," "),a(2),p("ngIf",e.roleService.product.Cost),a(),p("ngIf",e.roleService.product.Price),a(),p("ngIf",e.roleService.product.Cost&&e.roleService.product.Price)}}function Le(t,c){if(t&1){let e=I();o(0,"mainpanel-cmp",2),h("onSubmit",function(){u(e);let n=m();return y(n.searchFromPageOne())}),b("filterChange",function(n){u(e);let d=m();return S(d.pageData.Filter,n)||(d.pageData.Filter=n),y(n)}),o(1,"actions"),P(2,Se,3,0,"button",3),i(),o(3,"div",4),x(4,be,14,7,"ng-template",null,0,O),i(),o(6,"content")(7,"div",5)(8,"p-treeTable",6),x(9,he,10,3,"ng-template",7)(10,Pe,15,27,"ng-template",8)(11,Oe,9,6,"ng-template",9),i()()()()}if(t&2){let e=m();p("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),v("filter",e.pageData.Filter),a(2),E(e.roleService.global.Export?2:-1),a(6),p("value",e.data.data)("scrollable",!0)("scrollable",!0)("tableStyle",T(9,Ce))}}var fe=class t extends Y{constructor(e,r,n,d,Re,He){super(e,r,"Inventory/GetByCategory","InventoryLoader/GetByCategory");this.httpService=r;this.csvConverter=n;this.pageTitle=d;this.roleService=Re;this.dialog=He}openExportModal(){this.dialog.open($,{data:{title:"Inventory By Category",exportTypes:[{ID:"inventoryexport/GetExportInventoryByCategory",Value:"Default",FileName:"Inventory By Category"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||t)(C(ne),C(z),C(ie),C(W),C(J),C(Z))};static \u0275cmp=B({type:t,selectors:[["app-inventory-by-category"]],features:[F],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],["filters",""],[1,"container-fluid","mt-3"],[3,"value","scrollable","tableStyle"],["pTemplate","header"],["pTemplate","body"],["pTemplate","footer"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","ngModel"],[1,"d-flex","align-items-center"],["type","number","placeholder","From",1,"form-control",3,"ngModelChange","ngModel"],[1,"mx-3"],["type","number","placeholder","To",1,"form-control",3,"ngModelChange","ngModel"],[3,"modelChange","model","options"],[1,"custom-header"],["ttSortableColumn","Name",1,"text-uppercase"],["field","Name"],["ttSortableColumn","DisplayedOnHand",1,"text-uppercase"],["field","DisplayedOnHand"],["class","text-uppercase","ttSortableColumn","DisplayedCost",4,"ngIf"],["class","text-uppercase","ttSortableColumn","DisplayedPrice",4,"ngIf"],["class","text-uppercase","ttSortableColumn","DisplayedPercentage",4,"ngIf"],["ttSortableColumn","DisplayedCost",1,"text-uppercase"],["field","DisplayedCost"],["ttSortableColumn","DisplayedPrice",1,"text-uppercase"],["field","DisplayedPrice"],["ttSortableColumn","DisplayedPercentage",1,"text-uppercase"],["field","DisplayedPercentage"],[3,"ttRow"],[3,"rowNode"],["target","_blank",3,"routerLink","queryParams"],["matTooltipPosition","above",3,"routerLink","queryParams","matTooltip"],[4,"ngIf"],["matTooltipPosition","above",3,"matTooltip"],[1,"table-footer"],[1,"text-end"],["class","text-end",4,"ngIf"]],template:function(r,n){r&1&&x(0,Le,12,10,"mainpanel-cmp",1),r&2&&p("ngIf",n.data)},dependencies:[H,L,ae,oe,N,A,ue,ce,K,ge,de,_e,se,pe,me,le,re,G,k,q,Q,j,X,U,R,ee,te],styles:[".p-treetable-scrollable-header-box{padding-right:0!important} .p-treetable .p-treetable-thead>tr>th:not(:first-child){text-align:right!important} .p-treetable .p-treetable-tbody>tr>td:not(:first-child){text-align:right!important} .p-treetable-scrollable-footer-box{padding-right:0!important} .table-header-styles, .p-treetable-tfoot td, .p-treetable-thead th{background:#f6f6f6!important;color:#3b3b3b!important;text-transform:uppercase!important;font-weight:700!important;line-height:25px!important;font-size:12px!important;font-family:Roboto,sans-serif!important} .p-component.p-iconwrapper>svg{height:11px!important} .p-treetable .p-treetable-tbody>tr>td{border-bottom-width:1px;border-color:#dee2e6}"]})};export{fe as InventoryByCategoryComponent};
1
+ import{a as ce,b as de,c as _e,d as se,e as ge,f as ue}from"./chunk-PHFXJNIZ.js";import"./chunk-PHH2AA3W.js";import"./chunk-VDEYY3ZP.js";import"./chunk-DTVCBHPA.js";import"./chunk-5USF4MRW.js";import{a as te}from"./chunk-363IDTE3.js";import{a as ee}from"./chunk-QZZ2NRA3.js";import"./chunk-FAED643P.js";import{e as me}from"./chunk-WMZLH4YK.js";import"./chunk-72RZBOHX.js";import"./chunk-3RK6DDJD.js";import"./chunk-M3DKYPGC.js";import"./chunk-6WATOQG3.js";import"./chunk-VM4K4MNV.js";import"./chunk-XTCEZONP.js";import"./chunk-LNDHYAFW.js";import{d as re,e as le}from"./chunk-5ZD6KTDH.js";import"./chunk-ZZBF7AOW.js";import{c as pe}from"./chunk-IQGTPKBQ.js";import{b as $}from"./chunk-VXPORXGI.js";import{a as Y}from"./chunk-SXXWBS4Q.js";import"./chunk-PVEBGKGT.js";import"./chunk-L6PKNRWO.js";import"./chunk-SIQZO2WM.js";import{a as ie}from"./chunk-J6M7UWVR.js";import{e as oe,f as ae}from"./chunk-FH4Y2WG5.js";import"./chunk-AV6NQKIK.js";import"./chunk-7YUPYNWQ.js";import"./chunk-2CL5FM3P.js";import"./chunk-LGINK7BD.js";import"./chunk-IKKPP4JS.js";import"./chunk-QPAUI5EG.js";import"./chunk-45E6XCHN.js";import"./chunk-SIDUUVNA.js";import"./chunk-KZFNI67M.js";import"./chunk-4BXCIT62.js";import"./chunk-D4FCXEV4.js";import"./chunk-6P2ASCNY.js";import"./chunk-TWDVQAYI.js";import{b as ne}from"./chunk-S65DCKKO.js";import"./chunk-R2GUMKAU.js";import"./chunk-BT7NN7PT.js";import"./chunk-26YFRPR2.js";import{b as U,c as X}from"./chunk-JBS5UYZC.js";import"./chunk-TEGIL5RZ.js";import"./chunk-B7AC4RMR.js";import"./chunk-EQLHPWVB.js";import"./chunk-THT6CY5E.js";import{g as Z}from"./chunk-ZTD4APMR.js";import"./chunk-7P3L3ODB.js";import"./chunk-S7FOJJP2.js";import"./chunk-FU2ZGMX4.js";import"./chunk-2FWFPV5I.js";import{oa as K}from"./chunk-SLX34TWD.js";import{F as G,c as k,h as Q,o as j,q}from"./chunk-DWZ5JTI2.js";import"./chunk-5MIYFDIU.js";import"./chunk-C3OTQN4T.js";import"./chunk-36GWLMZX.js";import{b as J}from"./chunk-YVBGB3JF.js";import"./chunk-WUV22SZ4.js";import"./chunk-AZHKO7UJ.js";import{s as z}from"./chunk-LGOSIAUC.js";import{Ab as E,Fb as p,Fc as _,Gb as o,Gc as s,Hb as i,Hc as D,Ib as f,Jd as W,Lc as O,Pb as I,Qd as A,Sb as h,Sd as N,Ub as m,Xa as a,eb as C,hc as l,ib as B,ic as M,jc as g,jd as L,mb as F,mc as v,nc as S,ob as x,oc as b,sc as V,sd as R,ta as u,ua as y,vd as H,xc as T,yb as P,yc as w}from"./chunk-IEVGW2RT.js";import"./chunk-WFMAM73Y.js";import"./chunk-SNAKHGZS.js";var Ce=()=>({"min-width":"50rem","font-family":"Roboto, sans-serif"}),xe=()=>["/menu/Products/Catalog/Products"],ye=t=>({CategoryID:t}),ve=()=>["/menu/Inventory/Quantity/Valuation"];function Se(t,c){if(t&1){let e=I();o(0,"button",10),h("click",function(){u(e);let n=m(2);return y(n.openExportModal())}),f(1,"i",11),l(2," Export "),i()}}function be(t,c){if(t&1){let e=I();o(0,"div",12)(1,"h6"),l(2,"Outlet"),i(),o(3,"outlet-selector",13),b("ngModelChange",function(n){u(e);let d=m(2);return S(d.pageData.Filter.ListIDs,n)||(d.pageData.Filter.ListIDs=n),y(n)}),i(),o(4,"h6"),l(5,"Quantity From - To"),i(),o(6,"div",14)(7,"input",15),b("ngModelChange",function(n){u(e);let d=m(2);return S(d.pageData.Filter.QuantityFrom,n)||(d.pageData.Filter.QuantityFrom=n),y(n)}),i(),o(8,"span",16),l(9,"-"),i(),o(10,"input",17),b("ngModelChange",function(n){u(e);let d=m(2);return S(d.pageData.Filter.QuantityTo,n)||(d.pageData.Filter.QuantityTo=n),y(n)}),i()(),o(11,"h6"),l(12,"Discontinued"),i(),o(13,"radio-options",18),b("modelChange",function(n){u(e);let d=m(2);return S(d.pageData.Filter.Discontinued,n)||(d.pageData.Filter.Discontinued=n),y(n)}),i()()}if(t&2){let e=m(2);a(3),p("multiple",!0)("accessType",2),v("ngModel",e.pageData.Filter.ListIDs),a(4),v("ngModel",e.pageData.Filter.QuantityFrom),a(3),v("ngModel",e.pageData.Filter.QuantityTo),a(3),v("model",e.pageData.Filter.Discontinued),p("options",e.pageData.Options.Discontinued)}}function Ie(t,c){t&1&&(o(0,"th",27),l(1," Cost "),f(2,"p-treeTableSortIcon",28),i())}function Te(t,c){t&1&&(o(0,"th",29),l(1," Price "),f(2,"p-treeTableSortIcon",30),i())}function De(t,c){t&1&&(o(0,"th",31),l(1," % "),f(2,"p-treeTableSortIcon",32),i())}function he(t,c){if(t&1&&(o(0,"tr",19)(1,"th",20),l(2," Category "),f(3,"p-treeTableSortIcon",21),i(),o(4,"th",22),l(5," On Hand "),f(6,"p-treeTableSortIcon",23),i(),x(7,Ie,3,0,"th",24)(8,Te,3,0,"th",25)(9,De,3,0,"th",26),i()),t&2){let e=m(2);a(7),p("ngIf",e.roleService.product.Cost),a(),p("ngIf",e.roleService.product.Price),a(),p("ngIf",e.roleService.product.Cost&&e.roleService.product.Price)}}function we(t,c){if(t&1&&(o(0,"td"),l(1),_(2,"amountFraction"),i()),t&2){let e=m().rowData;a(),g(" ",s(2,1,e.DisplayedCost)," ")}}function Be(t,c){if(t&1&&(o(0,"td"),l(1),_(2,"amountFraction"),i()),t&2){let e=m().rowData;a(),g(" ",s(2,1,e.DisplayedPrice)," ")}}function Fe(t,c){if(t&1&&(o(0,"td")(1,"span",38),_(2,"number"),l(3),_(4,"number"),i()()),t&2){let e=m().rowData;a(),p("matTooltip",D(2,2,e.DisplayedPercentage,"1.0-5")+"%"),a(2),g(" ",D(4,5,e.DisplayedPercentage,"1.0-0"),"% ")}}function Pe(t,c){if(t&1&&(o(0,"tr",33)(1,"td"),f(2,"p-treeTableToggler",34),o(3,"a",35),l(4),i()(),o(5,"td")(6,"a",36),_(7,"number"),_(8,"number"),_(9,"number"),l(10),_(11,"quantityFraction"),i()(),x(12,we,3,3,"td",37)(13,Be,3,3,"td",37)(14,Fe,5,8,"td",37),i()),t&2){let e=c.$implicit,r=c.rowData,n=m(2);p("ttRow",e),a(2),p("rowNode",e),a(),p("routerLink",T(21,xe))("queryParams",w(22,ye,r.ID)),a(),M(r.Name),a(2),p("matTooltip",V(r.OnHandIndirect&&r.OnHand?"Direct ("+s(7,13,r.OnHand)+") Indirect ("+s(8,15,r.OnHandIndirect)+")":r.OnHandIndirect?"Indirect ("+s(9,17,r.OnHandIndirect)+")":""))("routerLink",T(24,ve))("queryParams",w(25,ye,r.ID)),a(4),g("",s(11,19,r.DisplayedOnHand)," "),a(2),p("ngIf",n.roleService.product.Cost),a(),p("ngIf",n.roleService.product.Price),a(),p("ngIf",n.roleService.product.Cost&&n.roleService.product.Price)}}function Ee(t,c){if(t&1&&(o(0,"td",40),l(1),_(2,"amountFraction"),i()),t&2){let e=m(3);a(),g(" ",s(2,1,e.data==null||e.data.Aggregate==null?null:e.data.Aggregate.TotalCost)," ")}}function Me(t,c){if(t&1&&(o(0,"td",40),l(1),_(2,"amountFraction"),i()),t&2){let e=m(3);a(),g(" ",s(2,1,e.data==null||e.data.Aggregate==null?null:e.data.Aggregate.TotalPrice)," ")}}function Ve(t,c){if(t&1&&(o(0,"td",40),l(1),_(2,"number"),i()),t&2){let e=m(3);a(),g(" ",D(2,1,e.data==null||e.data.Aggregate==null?null:e.data.Aggregate.TotalPercentage,"1.0-0"),"% ")}}function Oe(t,c){if(t&1&&(o(0,"tr",39)(1,"td",40),l(2,"Total:"),i(),o(3,"td",40),l(4),_(5,"quantityFraction"),i(),x(6,Ee,3,3,"td",41)(7,Me,3,3,"td",41)(8,Ve,3,4,"td",41),i()),t&2){let e=m(2);a(4),g(" ",s(5,4,e.data==null||e.data.Aggregate==null?null:e.data.Aggregate.TotalOnHand)," "),a(2),p("ngIf",e.roleService.product.Cost),a(),p("ngIf",e.roleService.product.Price),a(),p("ngIf",e.roleService.product.Cost&&e.roleService.product.Price)}}function Le(t,c){if(t&1){let e=I();o(0,"mainpanel-cmp",2),h("onSubmit",function(){u(e);let n=m();return y(n.searchFromPageOne())}),b("filterChange",function(n){u(e);let d=m();return S(d.pageData.Filter,n)||(d.pageData.Filter=n),y(n)}),o(1,"actions"),P(2,Se,3,0,"button",3),i(),o(3,"div",4),x(4,be,14,7,"ng-template",null,0,O),i(),o(6,"content")(7,"div",5)(8,"p-treeTable",6),x(9,he,10,3,"ng-template",7)(10,Pe,15,27,"ng-template",8)(11,Oe,9,6,"ng-template",9),i()()()()}if(t&2){let e=m();p("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),v("filter",e.pageData.Filter),a(2),E(e.roleService.global.Export?2:-1),a(6),p("value",e.data.data)("scrollable",!0)("scrollable",!0)("tableStyle",T(9,Ce))}}var fe=class t extends Y{constructor(e,r,n,d,Re,He){super(e,r,"Inventory/GetByCategory","InventoryLoader/GetByCategory");this.httpService=r;this.csvConverter=n;this.pageTitle=d;this.roleService=Re;this.dialog=He}openExportModal(){this.dialog.open($,{data:{title:"Inventory By Category",exportTypes:[{ID:"inventoryexport/GetExportInventoryByCategory",Value:"Default",FileName:"Inventory By Category"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||t)(C(ne),C(z),C(ie),C(W),C(J),C(Z))};static \u0275cmp=B({type:t,selectors:[["app-inventory-by-category"]],features:[F],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],["filters",""],[1,"container-fluid","mt-3"],[3,"value","scrollable","tableStyle"],["pTemplate","header"],["pTemplate","body"],["pTemplate","footer"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","ngModel"],[1,"d-flex","align-items-center"],["type","number","placeholder","From",1,"form-control",3,"ngModelChange","ngModel"],[1,"mx-3"],["type","number","placeholder","To",1,"form-control",3,"ngModelChange","ngModel"],[3,"modelChange","model","options"],[1,"custom-header"],["ttSortableColumn","Name",1,"text-uppercase"],["field","Name"],["ttSortableColumn","DisplayedOnHand",1,"text-uppercase"],["field","DisplayedOnHand"],["class","text-uppercase","ttSortableColumn","DisplayedCost",4,"ngIf"],["class","text-uppercase","ttSortableColumn","DisplayedPrice",4,"ngIf"],["class","text-uppercase","ttSortableColumn","DisplayedPercentage",4,"ngIf"],["ttSortableColumn","DisplayedCost",1,"text-uppercase"],["field","DisplayedCost"],["ttSortableColumn","DisplayedPrice",1,"text-uppercase"],["field","DisplayedPrice"],["ttSortableColumn","DisplayedPercentage",1,"text-uppercase"],["field","DisplayedPercentage"],[3,"ttRow"],[3,"rowNode"],["target","_blank",3,"routerLink","queryParams"],["matTooltipPosition","above",3,"routerLink","queryParams","matTooltip"],[4,"ngIf"],["matTooltipPosition","above",3,"matTooltip"],[1,"table-footer"],[1,"text-end"],["class","text-end",4,"ngIf"]],template:function(r,n){r&1&&x(0,Le,12,10,"mainpanel-cmp",1),r&2&&p("ngIf",n.data)},dependencies:[H,L,ae,oe,N,A,ue,ce,K,ge,de,_e,se,pe,me,le,re,G,k,q,Q,j,X,U,R,ee,te],styles:[".p-treetable-scrollable-header-box{padding-right:0!important} .p-treetable .p-treetable-thead>tr>th:not(:first-child){text-align:right!important} .p-treetable .p-treetable-tbody>tr>td:not(:first-child){text-align:right!important} .p-treetable-scrollable-footer-box{padding-right:0!important} .table-header-styles, .p-treetable-tfoot td, .p-treetable-thead th{background:#f6f6f6!important;color:#3b3b3b!important;text-transform:uppercase!important;font-weight:700!important;line-height:25px!important;font-size:12px!important;font-family:Roboto,sans-serif!important} .p-component.p-iconwrapper>svg{height:11px!important} .p-treetable .p-treetable-tbody>tr>td{border-bottom-width:1px;border-color:#dee2e6}"]})};export{fe as InventoryByCategoryComponent};
@@ -1 +1 @@
1
- import{a as $}from"./chunk-EXZ5WHGJ.js";import{a as J,b as K}from"./chunk-32QBWLTN.js";import{a as G}from"./chunk-M3DKYPGC.js";import{e as Y,f as Z}from"./chunk-WZMG65MB.js";import{a as Q,c as U}from"./chunk-D4FCXEV4.js";import{b as X}from"./chunk-QSOSU4WJ.js";import{h as H,m as q,q as z}from"./chunk-26YFRPR2.js";import{b as R,c as j}from"./chunk-JBS5UYZC.js";import{a as V}from"./chunk-2FWFPV5I.js";import{F as k,c as A,h as v,o as b}from"./chunk-DWZ5JTI2.js";import{p as L,s as B}from"./chunk-LGOSIAUC.js";import{Ab as O,Bb as y,Db as P,Eb as w,Fb as p,Gb as o,Hb as a,Nd as W,Pb as I,Sb as c,Tc as g,Ub as d,Xa as m,Ya as C,eb as h,hc as r,ib as M,ic as F,mb as D,mc as T,nc as S,oc as E,ta as u,ua as f,yb as N}from"./chunk-IEVGW2RT.js";var x=class s{stringPrefixMask=g();stringSuffixMask=g();stringPrefixMaskChange=new C;stringSuffixMaskChange=new C;onStringPrefixMaskChange(l){this.stringPrefixMaskChange.emit(l)}onStringSuffixMaskChange(l){this.stringSuffixMaskChange.emit(l)}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=M({type:s,selectors:[["masking-config"]],inputs:{stringPrefixMask:[1,"stringPrefixMask"],stringSuffixMask:[1,"stringSuffixMask"]},outputs:{stringPrefixMaskChange:"stringPrefixMaskChange",stringSuffixMaskChange:"stringSuffixMaskChange"},decls:18,vars:2,consts:[[1,"row","my-10","ms-2"],[1,"col-md-2"],[1,"notes","text-muted"],[1,"col-md-10"],[1,"row"],[1,"col-6"],["matTooltipPosition","above","matTooltip","Sets the number of characters at the beginning of the sensitive field that remain visible",1,"form-floating-outline"],["type","text","id","name","placeholder","Max Visible Prefix","autoNum","",1,"form-control",3,"ngModelChange","ngModel"],["matTooltipPosition","above","matTooltip","Sets the number of characters at the end of the sensitive field that remain visible",1,"form-floating-outline"],["type","text","id","name","placeholder","Max Visible Suffix","autoNum","",1,"form-control",3,"ngModelChange","ngModel"]],template:function(e,i){e&1&&(o(0,"div",0)(1,"div",1)(2,"h5"),r(3,"Visible Masking Settings"),a(),o(4,"i",2),r(5," Configure how many characters at the beginning and end of sensitive fields remain visible. "),a()(),o(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"input",7),c("ngModelChange",function(n){return i.onStringPrefixMaskChange(n)}),a(),o(11,"label"),r(12,"Max Visible Prefix"),a()()(),o(13,"div",5)(14,"div",8)(15,"input",9),c("ngModelChange",function(n){return i.onStringSuffixMaskChange(n)}),a(),o(16,"label"),r(17,"Max Visible Suffix"),a()()()()()()),e&2&&(m(10),p("ngModel",i.stringPrefixMask()),m(5),p("ngModel",i.stringSuffixMask()))},dependencies:[k,A,v,b,Q,U,j,R],encapsulation:2})};function oe(s,l){if(s&1&&(o(0,"mat-option",10),r(1),a()),s&2){let e=l.$implicit;p("value",e),m(),F(e)}}function ae(s,l){if(s&1&&(o(0,"mat-option",10),r(1),a()),s&2){let e=l.$implicit;p("value",e),m(),F(e)}}var _=class s{options=g();contacts=g([]);products=g([]);contactsChange=new C;productsChange=new C;onContactsChange(l){this.contactsChange.emit(l)}onProductsChange(l){this.productsChange.emit(l)}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=M({type:s,selectors:[["masking-options"]],inputs:{options:[1,"options"],contacts:[1,"contacts"],products:[1,"products"]},outputs:{contactsChange:"contactsChange",productsChange:"productsChange"},decls:27,vars:2,consts:[[1,"row","my-10","ms-2"],[1,"col-md-2"],[1,"notes","text-muted"],["href","https://support.dealpos.com/en/articles/8278008-sensitive-field-roles-configuration-for-contacts","target","_blank"],[1,"col-md-10"],[1,"row"],[1,"col-6"],["appearance","outline",1,"w-100"],[1,"fs-4"],["placeholder","Product","multiple","",3,"ngModelChange","ngModel"],[3,"value"],["placeholder","Contact","multiple","",3,"ngModelChange","ngModel"]],template:function(e,i){if(e&1&&(o(0,"div",0)(1,"div",1)(2,"h5"),r(3,"Sensitive Field"),a(),o(4,"i",2),r(5,"When you mark a property as sensitive, the property value cannot be viewed to users without 'sensitive field' role. Please refer this "),o(6,"a",3),r(7,"Article"),a(),r(8," for more information"),a()(),o(9,"div",4)(10,"div",5)(11,"div",6)(12,"mat-form-field",7)(13,"mat-label")(14,"span",8),r(15,"Product"),a()(),o(16,"mat-select",9),c("ngModelChange",function(n){return i.onProductsChange(n)}),P(17,oe,2,2,"mat-option",10,y),a()()(),o(19,"div",6)(20,"mat-form-field",7)(21,"mat-label")(22,"span",8),r(23,"Contact"),a()(),o(24,"mat-select",11),c("ngModelChange",function(n){return i.onContactsChange(n)}),P(25,ae,2,2,"mat-option",10,y),a()()()()()()),e&2){let t,n;m(16),p("ngModel",i.products()),m(),w((t=i.options())==null?null:t.Product),m(7),p("ngModel",i.contacts()),m(),w((n=i.options())==null?null:n.Customer)}},dependencies:[K,q,H,J,z,G,k,v,b],encapsulation:2})};function re(s,l){if(s&1){let e=I();o(0,"mainpanel-cmp",0)(1,"actions")(2,"button",1),c("click",function(){u(e);let t=d();return f(t.onSubmit("Setup/Configuration/SubmitSensitiveFieldConfigurationV2"))}),r(3," Save "),a()(),o(4,"content")(5,"div",2)(6,"ul",3)(7,"li",4)(8,"button",5),r(9," Objects "),a()(),o(10,"li",4)(11,"button",6),r(12," Masking "),a()()(),o(13,"div",7)(14,"div",8)(15,"masking-options",9),E("productsChange",function(t){u(e);let n=d();return S(n.data.Form.Product,t)||(n.data.Form.Product=t),f(t)})("contactsChange",function(t){u(e);let n=d();return S(n.data.Form.Customer,t)||(n.data.Form.Customer=t),f(t)}),a()(),o(16,"div",10)(17,"masking-config",11),E("stringPrefixMaskChange",function(t){u(e);let n=d();return S(n.data.Form.Masking.StringPrefixMaskVisibleCharacterLength,t)||(n.data.Form.Masking.StringPrefixMaskVisibleCharacterLength=t),f(t)})("stringSuffixMaskChange",function(t){u(e);let n=d();return S(n.data.Form.Masking.StringSuffixMaskVisibleCharacterLength,t)||(n.data.Form.Masking.StringSuffixMaskVisibleCharacterLength=t),f(t)}),a()()()()()()}if(s&2){let e=d();p("pageData",e.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),m(15),p("options",e.data.Options),T("products",e.data.Form.Product)("contacts",e.data.Form.Customer),m(2),T("stringPrefixMask",e.data.Form.Masking.StringPrefixMaskVisibleCharacterLength)("stringSuffixMask",e.data.Form.Masking.StringSuffixMaskVisibleCharacterLength)}}var ie=class s extends ${constructor(e,i,t,n){super(e,i,"Setup/ConfigurationLoader/SensitiveFieldConfigurationV2",t);this.httpService=i;this.activatedRoute=t;this.toaster=n}onSubmitSuccess(e){e?.MessageWarning?this.toaster.warning(e.MessageWarning,V.Warning):this.toaster.success("Config has been updated succesfully!",V.Success)}static \u0275fac=function(i){return new(i||s)(h(X),h(B),h(W),h(L))};static \u0275cmp=M({type:s,selectors:[["app-sensitive-field"]],features:[D],decls:1,vars:1,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox"],["type","button","role","button",1,"btn","btn-success",3,"click"],[1,"container-fluid","py-5","bg-light-white"],["id","myTab","role","tablist",1,"nav","nav-tabs"],[1,"nav-item"],["id","masking-options-tab","data-bs-toggle","tab","data-bs-target","#masking-options","role","tab","aria-controls","masking-options","aria-selected","true",1,"nav-link","active"],["id","masking-tab","data-bs-toggle","tab","data-bs-target","#masking","role","tab","aria-controls","masking","aria-selected","false",1,"nav-link"],["id","myTabContent",1,"tab-content","border-top-0","bg-white"],["id","masking-options","aria-labelledby","masking-options-tab","role","tabpanel",1,"tab-pane","fade","mt-0","p-7","show","active"],[3,"productsChange","contactsChange","options","products","contacts"],["id","masking","aria-labelledby","masking-tab","role","tabpanel",1,"tab-pane","fade","mt-0","p-7"],[3,"stringPrefixMaskChange","stringSuffixMaskChange","stringPrefixMask","stringSuffixMask"]],template:function(i,t){i&1&&N(0,re,18,8,"mainpanel-cmp",0),i&2&&O(t.formData?0:-1)},dependencies:[Z,Y,x,_],encapsulation:2})};export{ie as a};
1
+ import{a as $}from"./chunk-KHJPKMJG.js";import{a as J,b as K}from"./chunk-32QBWLTN.js";import{a as G}from"./chunk-M3DKYPGC.js";import{e as Y,f as Z}from"./chunk-FH4Y2WG5.js";import{a as Q,c as U}from"./chunk-D4FCXEV4.js";import{b as X}from"./chunk-S65DCKKO.js";import{h as H,m as q,q as z}from"./chunk-26YFRPR2.js";import{b as R,c as j}from"./chunk-JBS5UYZC.js";import{a as V}from"./chunk-2FWFPV5I.js";import{F as k,c as A,h as v,o as b}from"./chunk-DWZ5JTI2.js";import{p as L,s as B}from"./chunk-LGOSIAUC.js";import{Ab as O,Bb as y,Db as P,Eb as w,Fb as p,Gb as o,Hb as a,Nd as W,Pb as I,Sb as c,Tc as g,Ub as d,Xa as m,Ya as C,eb as h,hc as r,ib as M,ic as F,mb as D,mc as T,nc as S,oc as E,ta as u,ua as f,yb as N}from"./chunk-IEVGW2RT.js";var x=class s{stringPrefixMask=g();stringSuffixMask=g();stringPrefixMaskChange=new C;stringSuffixMaskChange=new C;onStringPrefixMaskChange(l){this.stringPrefixMaskChange.emit(l)}onStringSuffixMaskChange(l){this.stringSuffixMaskChange.emit(l)}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=M({type:s,selectors:[["masking-config"]],inputs:{stringPrefixMask:[1,"stringPrefixMask"],stringSuffixMask:[1,"stringSuffixMask"]},outputs:{stringPrefixMaskChange:"stringPrefixMaskChange",stringSuffixMaskChange:"stringSuffixMaskChange"},decls:18,vars:2,consts:[[1,"row","my-10","ms-2"],[1,"col-md-2"],[1,"notes","text-muted"],[1,"col-md-10"],[1,"row"],[1,"col-6"],["matTooltipPosition","above","matTooltip","Sets the number of characters at the beginning of the sensitive field that remain visible",1,"form-floating-outline"],["type","text","id","name","placeholder","Max Visible Prefix","autoNum","",1,"form-control",3,"ngModelChange","ngModel"],["matTooltipPosition","above","matTooltip","Sets the number of characters at the end of the sensitive field that remain visible",1,"form-floating-outline"],["type","text","id","name","placeholder","Max Visible Suffix","autoNum","",1,"form-control",3,"ngModelChange","ngModel"]],template:function(e,i){e&1&&(o(0,"div",0)(1,"div",1)(2,"h5"),r(3,"Visible Masking Settings"),a(),o(4,"i",2),r(5," Configure how many characters at the beginning and end of sensitive fields remain visible. "),a()(),o(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"input",7),c("ngModelChange",function(n){return i.onStringPrefixMaskChange(n)}),a(),o(11,"label"),r(12,"Max Visible Prefix"),a()()(),o(13,"div",5)(14,"div",8)(15,"input",9),c("ngModelChange",function(n){return i.onStringSuffixMaskChange(n)}),a(),o(16,"label"),r(17,"Max Visible Suffix"),a()()()()()()),e&2&&(m(10),p("ngModel",i.stringPrefixMask()),m(5),p("ngModel",i.stringSuffixMask()))},dependencies:[k,A,v,b,Q,U,j,R],encapsulation:2})};function oe(s,l){if(s&1&&(o(0,"mat-option",10),r(1),a()),s&2){let e=l.$implicit;p("value",e),m(),F(e)}}function ae(s,l){if(s&1&&(o(0,"mat-option",10),r(1),a()),s&2){let e=l.$implicit;p("value",e),m(),F(e)}}var _=class s{options=g();contacts=g([]);products=g([]);contactsChange=new C;productsChange=new C;onContactsChange(l){this.contactsChange.emit(l)}onProductsChange(l){this.productsChange.emit(l)}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=M({type:s,selectors:[["masking-options"]],inputs:{options:[1,"options"],contacts:[1,"contacts"],products:[1,"products"]},outputs:{contactsChange:"contactsChange",productsChange:"productsChange"},decls:27,vars:2,consts:[[1,"row","my-10","ms-2"],[1,"col-md-2"],[1,"notes","text-muted"],["href","https://support.dealpos.com/en/articles/8278008-sensitive-field-roles-configuration-for-contacts","target","_blank"],[1,"col-md-10"],[1,"row"],[1,"col-6"],["appearance","outline",1,"w-100"],[1,"fs-4"],["placeholder","Product","multiple","",3,"ngModelChange","ngModel"],[3,"value"],["placeholder","Contact","multiple","",3,"ngModelChange","ngModel"]],template:function(e,i){if(e&1&&(o(0,"div",0)(1,"div",1)(2,"h5"),r(3,"Sensitive Field"),a(),o(4,"i",2),r(5,"When you mark a property as sensitive, the property value cannot be viewed to users without 'sensitive field' role. Please refer this "),o(6,"a",3),r(7,"Article"),a(),r(8," for more information"),a()(),o(9,"div",4)(10,"div",5)(11,"div",6)(12,"mat-form-field",7)(13,"mat-label")(14,"span",8),r(15,"Product"),a()(),o(16,"mat-select",9),c("ngModelChange",function(n){return i.onProductsChange(n)}),P(17,oe,2,2,"mat-option",10,y),a()()(),o(19,"div",6)(20,"mat-form-field",7)(21,"mat-label")(22,"span",8),r(23,"Contact"),a()(),o(24,"mat-select",11),c("ngModelChange",function(n){return i.onContactsChange(n)}),P(25,ae,2,2,"mat-option",10,y),a()()()()()()),e&2){let t,n;m(16),p("ngModel",i.products()),m(),w((t=i.options())==null?null:t.Product),m(7),p("ngModel",i.contacts()),m(),w((n=i.options())==null?null:n.Customer)}},dependencies:[K,q,H,J,z,G,k,v,b],encapsulation:2})};function re(s,l){if(s&1){let e=I();o(0,"mainpanel-cmp",0)(1,"actions")(2,"button",1),c("click",function(){u(e);let t=d();return f(t.onSubmit("Setup/Configuration/SubmitSensitiveFieldConfigurationV2"))}),r(3," Save "),a()(),o(4,"content")(5,"div",2)(6,"ul",3)(7,"li",4)(8,"button",5),r(9," Objects "),a()(),o(10,"li",4)(11,"button",6),r(12," Masking "),a()()(),o(13,"div",7)(14,"div",8)(15,"masking-options",9),E("productsChange",function(t){u(e);let n=d();return S(n.data.Form.Product,t)||(n.data.Form.Product=t),f(t)})("contactsChange",function(t){u(e);let n=d();return S(n.data.Form.Customer,t)||(n.data.Form.Customer=t),f(t)}),a()(),o(16,"div",10)(17,"masking-config",11),E("stringPrefixMaskChange",function(t){u(e);let n=d();return S(n.data.Form.Masking.StringPrefixMaskVisibleCharacterLength,t)||(n.data.Form.Masking.StringPrefixMaskVisibleCharacterLength=t),f(t)})("stringSuffixMaskChange",function(t){u(e);let n=d();return S(n.data.Form.Masking.StringSuffixMaskVisibleCharacterLength,t)||(n.data.Form.Masking.StringSuffixMaskVisibleCharacterLength=t),f(t)}),a()()()()()()}if(s&2){let e=d();p("pageData",e.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),m(15),p("options",e.data.Options),T("products",e.data.Form.Product)("contacts",e.data.Form.Customer),m(2),T("stringPrefixMask",e.data.Form.Masking.StringPrefixMaskVisibleCharacterLength)("stringSuffixMask",e.data.Form.Masking.StringSuffixMaskVisibleCharacterLength)}}var ie=class s extends ${constructor(e,i,t,n){super(e,i,"Setup/ConfigurationLoader/SensitiveFieldConfigurationV2",t);this.httpService=i;this.activatedRoute=t;this.toaster=n}onSubmitSuccess(e){e?.MessageWarning?this.toaster.warning(e.MessageWarning,V.Warning):this.toaster.success("Config has been updated succesfully!",V.Success)}static \u0275fac=function(i){return new(i||s)(h(X),h(B),h(W),h(L))};static \u0275cmp=M({type:s,selectors:[["app-sensitive-field"]],features:[D],decls:1,vars:1,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox"],["type","button","role","button",1,"btn","btn-success",3,"click"],[1,"container-fluid","py-5","bg-light-white"],["id","myTab","role","tablist",1,"nav","nav-tabs"],[1,"nav-item"],["id","masking-options-tab","data-bs-toggle","tab","data-bs-target","#masking-options","role","tab","aria-controls","masking-options","aria-selected","true",1,"nav-link","active"],["id","masking-tab","data-bs-toggle","tab","data-bs-target","#masking","role","tab","aria-controls","masking","aria-selected","false",1,"nav-link"],["id","myTabContent",1,"tab-content","border-top-0","bg-white"],["id","masking-options","aria-labelledby","masking-options-tab","role","tabpanel",1,"tab-pane","fade","mt-0","p-7","show","active"],[3,"productsChange","contactsChange","options","products","contacts"],["id","masking","aria-labelledby","masking-tab","role","tabpanel",1,"tab-pane","fade","mt-0","p-7"],[3,"stringPrefixMaskChange","stringSuffixMaskChange","stringPrefixMask","stringSuffixMask"]],template:function(i,t){i&1&&N(0,re,18,8,"mainpanel-cmp",0),i&2&&O(t.formData?0:-1)},dependencies:[Z,Y,x,_],encapsulation:2})};export{ie as a};
@@ -1,4 +1,4 @@
1
- import{a as io}from"./chunk-ZTU3TIGR.js";import{a as no,c as oo}from"./chunk-53VS5DA7.js";import{a as li}from"./chunk-CAYYUGXV.js";import{a as Yn,b as Xn,c as Zn,d as eo,e as to,f as ke}from"./chunk-PPVORSJQ.js";import{a as Kn}from"./chunk-4KGHH5FV.js";import{a as zn}from"./chunk-T4MU3R7Y.js";import"./chunk-USD2ALDX.js";import{a as ii}from"./chunk-A565EUMD.js";import{a as $n}from"./chunk-DOCQN2VL.js";import{a as ri}from"./chunk-RO6RY4AJ.js";import{a as ki}from"./chunk-IZLEZJ6U.js";import{c as Qn,d as Un}from"./chunk-4XJWQAS6.js";import"./chunk-DC3TCY6D.js";import{a as Gn}from"./chunk-CFWHBIM3.js";import{a as qn}from"./chunk-7DAPNQYU.js";import"./chunk-NM3IQUNN.js";import"./chunk-NQX7EX5A.js";import"./chunk-A2EVMYAR.js";import"./chunk-P3KIIKY4.js";import{a as ni,b as jn,c as Ln}from"./chunk-CQLZHUT4.js";import"./chunk-S27D5MBU.js";import{a as Nt}from"./chunk-HGSF7LOB.js";import"./chunk-2VE2WNSA.js";import"./chunk-25H27N7N.js";import{a as Xt}from"./chunk-T7XU5W5A.js";import{b as Rn}from"./chunk-MNJSQKLX.js";import{a as Wn,b as Jn,c as Hn}from"./chunk-OXWQ7ZZS.js";import{a as oi,b as ai}from"./chunk-FW4OCSXV.js";import{a as Bn}from"./chunk-4CPRMZL6.js";import"./chunk-BYXBJQAS.js";import"./chunk-PRVQ3NAP.js";import"./chunk-BYXBJQAS.js";import{b as Vn}from"./chunk-4OEDK7YE.js";import"./chunk-GWKBJZYT.js";import"./chunk-B5IABJO5.js";import{e as Dt}from"./chunk-O2VVATBW.js";import{a as ei}from"./chunk-363IDTE3.js";import"./chunk-FAED643P.js";import{d as kn,e as ti}from"./chunk-WMZLH4YK.js";import"./chunk-72RZBOHX.js";import"./chunk-3RK6DDJD.js";import"./chunk-M3DKYPGC.js";import"./chunk-6WATOQG3.js";import"./chunk-VM4K4MNV.js";import"./chunk-XTCEZONP.js";import"./chunk-LNDHYAFW.js";import"./chunk-ZZBF7AOW.js";import"./chunk-SIQZO2WM.js";import"./chunk-2CL5FM3P.js";import"./chunk-LGINK7BD.js";import{a as Dn,b as xn,c as Sn}from"./chunk-IKKPP4JS.js";import"./chunk-QPAUI5EG.js";import"./chunk-45E6XCHN.js";import"./chunk-SIDUUVNA.js";import"./chunk-KZFNI67M.js";import"./chunk-4BXCIT62.js";import{a as st,c as ct}from"./chunk-D4FCXEV4.js";import{a as Mn,c as In,e as Pn,g as On}from"./chunk-6P2ASCNY.js";import{a as Tn,b as wn}from"./chunk-QSOSU4WJ.js";import"./chunk-R2GUMKAU.js";import{a as vn}from"./chunk-BT7NN7PT.js";import{A as Fn,G as An,q as _n,u as Ie,v as Pe,w as Oe,x as Nn,z as En}from"./chunk-26YFRPR2.js";import{b as rt,c as lt}from"./chunk-JBS5UYZC.js";import{O as Ae}from"./chunk-TEGIL5RZ.js";import{a as un,b as fn,c as gn}from"./chunk-EQLHPWVB.js";import{d as xt}from"./chunk-THT6CY5E.js";import{a as z,e as Me,f as Fe,g as Z,l as Zt}from"./chunk-ZTD4APMR.js";import"./chunk-7P3L3ODB.js";import"./chunk-S7FOJJP2.js";import"./chunk-FU2ZGMX4.js";import{a as ve}from"./chunk-2FWFPV5I.js";import"./chunk-SLX34TWD.js";import{E as bn,F as Se,G as Ye,a as Ke,b as Cn,c as be,h as ae,l as ce,o as xe,r as yn,s as ze}from"./chunk-DWZ5JTI2.js";import{a as hn}from"./chunk-LHCZ2R2J.js";import"./chunk-36GWLMZX.js";import{b as he}from"./chunk-YVBGB3JF.js";import{a as S}from"./chunk-WUV22SZ4.js";import{a as dn}from"./chunk-VZACJTOY.js";import{p as qe,s as re}from"./chunk-LGOSIAUC.js";import{$ as je,Ab as _,Ca as Le,Cb as Qe,D as ot,Db as Ue,E as V,Eb as We,Fb as b,Fc as f,Fd as mn,Gb as r,Gc as g,H as Hi,Hb as a,Hc as wt,I as ye,Ib as M,Ja as Fi,Jb as Je,Kb as it,Lb as kt,Lc as Gt,M as Gi,Mb as Vt,N as Ei,Nb as $t,Nd as pn,Ob as on,Pb as j,Pc as rn,Pd as Kt,Q as qi,Qa as Yi,Qd as zt,Sa as at,Sb as D,Sd as Yt,T as Ki,Tb as bt,Ub as p,Uc as qt,W as Tt,Wa as Xi,Xa as l,Y as X,Yb as Rt,Zb as Bt,_b as jt,aa as Y,ac as Lt,bc as Qt,ca as zi,cc as ht,d as ge,db as Zi,e as et,eb as u,ec as vt,f as Ui,fa as E,ga as me,gb as en,gc as an,gd as Ge,hc as m,ib as F,ic as te,id as ln,jc as $,k as we,kc as He,la as ne,mb as tn,mc as U,n as Wi,nc as L,nd as sn,o as tt,oa as Q,ob as ut,oc as W,od as Ee,p as Ji,pa as le,pc as Ut,qc as Wt,qd as cn,rc as Jt,sc as Ai,sd as De,t as d,ta as P,u as Ce,ua as O,v as Ni,vd as se,wc as Ne,xc as Ht,y as dt,yb as v,yc as ie,zb as nn,zc as _t}from"./chunk-IEVGW2RT.js";import"./chunk-WFMAM73Y.js";import{a as w,b as B,e as Qi,k as yt}from"./chunk-SNAKHGZS.js";var H=class n{constructor(t,e){this.http=e;this.buyForm=t.group({NewOrderID:[""],Order:t.group({Att:[""],SupplierID:[""],Number:[""],Date:[new Date],ID:[S.GuidEmpty]}),Invoice:t.group({ID:[S.GuidEmpty],Due:[new Date],Tax:[0]}),Payment:t.group({ID:[S.GuidEmpty],Amount:[0],MethodID:[0],Code:[""],Note:[""],ImageUrl:[""]})})}outlet=new ce({ID:"",Name:"Choose an Outlet"});dueDays=new ce(0);deliveryEntityID=new ce(S.GuidEmpty);noteForm=new ce({Note:"",TagID:"",Currency:{ID:"",ExchangeRate:0,Symbol:""},InvoiceNumber:""});discountAndTaxForm=new ce({Discount:{Amount:0,Percentage:0},Tax:{ID:"",CalculationTypeName:"",Rate:0,Label:"",Discontinue:!1}});buyForm;setPONumber(t){let e="";if(t.Seed){let i=t.Seed+"";for(;i.length<t.Digit;)i="0"+i;e=S.StringFormat(t.Prefix,i)}this.buyForm.controls.Order.controls.Number.setValue(e)}setDueDateBasedOnDaysDue(t){console.log(t);let e=this.invoiceDate,i=new Date(S.cloneObject(e));i.setDate(i.getDate()+t),this.buyForm.controls.Invoice.controls.Due.setValue(i)}get dueDate(){return this.buyForm.controls.Invoice.controls.Due.value}get invoiceDate(){return this.buyForm.controls.Order.controls.Date.value}setAmount(t){this.buyForm.controls.Payment.controls.Amount.setValue(t)}setPaymentMethodID(t){this.buyForm.controls.Payment.controls.MethodID.setValue(t)}setTaxAmount(t){this.buyForm.controls.Invoice.controls.Tax.setValue(t)}setNewOrderID(t){this.buyForm.controls.NewOrderID.setValue(t)}setTax(t){let e=w({},this.discountAndTaxForm.value.Discount);this.discountAndTaxForm.setValue({Discount:e,Tax:t})}setCurrency(t){let e=this.noteForm.value;this.noteForm.setValue(B(w({},e),{Currency:t}))}setDeliveryEntityID(t){this.deliveryEntityID.setValue(t)}setdueDays(t){this.dueDays.setValue(t)}setBulkOrderForm(t){this.buyForm.controls.Order.setValue(t)}setBulkNoteForm(t){this.noteForm.setValue(t)}setBulkDiscountAndTaxForm(t){this.discountAndTaxForm.setValue(t)}setOutletForm(t){this.outlet.setValue(t)}setBulkInvoice(t){this.buyForm.controls.Invoice.setValue(w(w({},this.buyForm.controls.Invoice.value),t))}setBulkPayment(t){this.buyForm.controls.Payment.setValue(t)}resetOutletForm(){this.outlet.setValue({ID:"",Name:"Choose an Outlet"})}resetDueDaysForm(){this.dueDays.setValue(0)}resetDeliveryEntityID(){this.deliveryEntityID.setValue(S.GuidEmpty)}resetNoteForm(){this.noteForm.setValue(B(w({},this.noteForm.value),{Note:"",TagID:"",InvoiceNumber:""}))}resetDiscountAndTaxForm(){let t=this.discountAndTaxForm.value;this.discountAndTaxForm.setValue(B(w({},t),{Discount:{Amount:0,Percentage:0}}))}resetBuyForm(){this.buyForm.reset(),this.buyForm.controls.Invoice.controls.ID.setValue(S.GuidEmpty),this.buyForm.controls.Invoice.controls.Due.setValue(new Date),this.buyForm.controls.Order.controls.Date.setValue(new Date),this.buyForm.controls.Order.controls.ID.setValue(S.GuidEmpty),this.generateNumberOnNewTransaction()}generateNumberOnNewTransaction(){this.http.post("/API/Buy/GenerateNumber",{ID:this.outlet.value.ID}).subscribe(t=>{this.setNewOrderID(S.Guid_NewGuid()),this.buyForm.controls.Order.controls.Number.setValue(t.Number)})}static \u0275fac=function(e){return new(e||n)(Q(bn),Q(re))};static \u0275prov=ne({token:n,factory:n.\u0275fac,providedIn:"root"})};var de=class n{entities$;appConfigJSON$;taxes$;currencies$;supplierPOTypes$;predefinedNotes$;denomination$;defaultDueDays$;constructor(t,e){let i=t.get("/API/Buy2/Load").pipe(E(o=>e.setCurrency(o.Currencies.find(s=>s.ID==o.AppConfigJSON.CoreDefaults.CurrencyID))),X(1));this.denomination$=i.pipe(d(o=>o.Denomination)),this.entities$=i.pipe(d(o=>o.Entities)),this.appConfigJSON$=i.pipe(d(o=>o.AppConfigJSON)),this.taxes$=i.pipe(d(o=>o.Taxes),X(1)),this.currencies$=i.pipe(d(o=>o.Currencies),X(1)),this.supplierPOTypes$=i.pipe(d(o=>o.SupplierPOTypes)),this.predefinedNotes$=i.pipe(d(o=>o.PredefinedNotes)),this.defaultDueDays$=i.pipe(d(o=>o.AppConfigJSON.ModuleBuy.PaymentDialog.DefaultDueDays),E(o=>e.setdueDays(o)),E(o=>e.setDueDateBasedOnDaysDue(o)))}updateDueDays(){this.defaultDueDays$.subscribe()}static \u0275fac=function(e){return new(e||n)(Q(re),Q(H))};static \u0275prov=ne({token:n,factory:n.\u0275fac,providedIn:"root"})};var mt=class n{returnInvoiceNumber=new ce("");invoiceInfo$;constructor(t,e,i){let o=e.outlet.valueChanges.pipe(d(c=>c.ID),z());this.invoiceInfo$=this.returnInvoiceNumber.valueChanges.pipe(V(c=>!!c),me(o),Y(([c,I])=>t.post("/API/Buy/GetSupplierInvoiceRetur2",{EntityID:I,Number:c}).pipe(ye(()=>we))),X(1),z());let s=this.invoiceInfo$.pipe(d(c=>w({},c.Order)),E(c=>{let I={Att:c.Att,SupplierID:{Key:c.SupplierID,Value:c.SupplierName,OnSet:!0},Date:new Date,Number:e.buyForm.controls.Order.controls.Number.value,ID:S.GuidEmpty};e.setBulkOrderForm(I)}),z()),T=this.invoiceInfo$.pipe(d(c=>c.Order),E(c=>{let I={Note:`Return #${c.Number}`,TagID:c.TypeID,Currency:{ID:c.CurrencyID,ExchangeRate:c.CurrencyRate,Symbol:c.CurrencySymbol??"$"},InvoiceNumber:c.Number};e.setBulkNoteForm(I)}),z()),h=this.invoiceInfo$.pipe(d(c=>c.Order),me(i.taxes$),d(([c,I])=>B(w({},c),{Tax:I.find(J=>J.ID===c.TaxTypeID)})),E(c=>{let I={Discount:{Amount:c.DiscountAmount,Percentage:c.Discount},Tax:{ID:c.TaxTypeID,Rate:c.Tax?.Rate,CalculationTypeName:c.Tax?.CalculationTypeName,Label:c.Tax?.Label,Discontinue:!c.Tax?.Label}};e.setBulkDiscountAndTaxForm(I)}),z()),R=this.invoiceInfo$.pipe(d(c=>c.DeliveryEntityID),E(c=>e.setDeliveryEntityID(c)),z()),G=this.invoiceInfo$.pipe(d(c=>c.Invoice),E(c=>{let I={ID:c.ID,Tax:c.Tax};e.setBulkInvoice(I)}),z()),x=this.invoiceInfo$.pipe(d(c=>c.Payment),E(c=>{let I={ID:S.GuidEmpty,Amount:c.Amount,MethodID:c.MethodID,Note:c.Note,Code:c.Code,ImageUrl:c.ImageUrl};e.setBulkPayment(I)}),z());Ce(s,T,h,R,G,x).pipe(z()).subscribe()}static \u0275fac=function(e){return new(e||n)(Q(re),Q(H),Q(de))};static \u0275prov=ne({token:n,factory:n.\u0275fac,providedIn:"root"})};var ee=class n{constructor(t,e,i,o){this.matDialog=o;let s=e.outlet.valueChanges.pipe(d(c=>c.ID));this.addVariantThroughSerial$=this._addVariantThroughSerial.asObservable().pipe(me(s),Y(([c,I])=>t.get(Ae.GetVariantBySerial,[{key:"Serial",value:c},{key:"EntityID",value:I}]).pipe(ye(()=>we))),d(c=>this.setUnitPrice(c)),d(c=>B(w({},c),{Quantity:1,Total:c.UnitPrice,VariantID:c.ID})),d(c=>({action:"addAsSerial",variant:c})));let T=this.variantAutocomplete.valueChanges.pipe(V(c=>S.IsNotEmpty(c)&&c.type=="Code"),d(c=>c.str),me(s),Y(([c,I])=>t.get(Ae.GetVariantByCode,[{key:"Code",value:c},{key:"EntityID",value:I},{key:"Promotion",value:!0}]).pipe(ye(()=>we))),d(c=>this.setUnitPrice(c)),d(c=>B(w({},c),{Quantity:1,Total:c.UnitPrice*((100-c.PriceDiscount)/100),Discount:c.PriceDiscount,VariantID:c.ID}))),h=this.variantAutocomplete.valueChanges.pipe(V(c=>S.IsNotEmpty(c)&&c.type=="ID"),d(c=>c.str)),R=this.variantQuickKey.valueChanges,G=ot(h,R).pipe(me(s),Y(([c,I])=>t.get(Ae.GetVariantByID,[{key:"ID",value:c},{key:"EntityID",value:I}]).pipe(ye(()=>we))),d(c=>this.setUnitPrice(c)),d(c=>B(w({},c),{Quantity:1,Total:c.UnitPrice*((100-c.OrderPriceDiscount)/100),Discount:c.OrderPriceDiscount,VariantID:c.ID}))),x=ot(G,T).pipe(E(c=>{c.CategoryTypeID===1&&this.toastr.info(`${c.Name} is sellable only.`,ve.Info)}),V(c=>c.CategoryTypeID!==1),d(c=>({action:"add",variant:c})),E(()=>{this.cartDisplayRef&&setTimeout(()=>{let c=this.cartDisplayRef.nativeElement.scrollHeight;this.cartDisplayRef.nativeElement.scrollTop=c},1)})),A=i.invoiceInfo$.pipe(d(c=>({action:"returnInvoice",variants:c.Items.map(I=>B(w({},I.Variant),{Quantity:I.Quantity,Total:I.Total,UnitPrice:I.UnitPrice,Discount:I.Discount,Serial:I.Serial,ID:I.ID,DiscountAmount:I.DiscountAmount,VariantID:I.VariantID,UnitQuantity:I.UnitQuantity}))})));this.cart$=ot(x,A,this.deleteVariant$,this.dragDropCart$,this.returnCart$,this.updateVariant$,this.returnVariant$,this.purchaseVariant$,this.clearCart$,this.onEditForm$,this.addVariantThroughSerial$,this.addVariant$,this.onUploadCart$,this.listenRFID$).pipe(Tt((c,I)=>{let J=[...c],K=[],C=I.action;if(C=="add"){let y=I.variant;K=!!J.find(k=>k.VariantID==y.ID)?J.map(k=>k.VariantID==y.ID?B(w({},k),{Quantity:k.Quantity+1,Total:k.Total+k.UnitPrice}):k):[...J,y]}else if(C=="returnInvoice"||C=="onEditForm")K=I.variants;else if(C=="delete"){let y=I.index;K=J.filter((N,k)=>k!=y)}else if(C=="sort"){let y=I.ev;K=J,Mn(K,y.previousIndex,y.currentIndex)}else if(C=="returnCart")K=J.map(y=>B(w({},y),{Quantity:-Math.abs(y.Quantity),Total:-Math.abs(y.Total)}));else if(C=="update"){let y=I.index;K=J.map((N,k)=>k==y?I.variant:N)}else if(C=="returnVariant"){let y=I.index;K=J.map((N,k)=>k==y?B(w({},N),{Quantity:-Math.abs(N.Quantity),Total:-Math.abs(N.Total)}):N)}else if(C=="purchaseVariant"){let y=I.index;K=J.map((N,k)=>k==y?B(w({},N),{Quantity:Math.abs(N.Quantity),Total:Math.abs(N.Total)}):N)}else if(C=="clearCart")K=[];else if(C=="addAsSerial"){let y=B(w({},I.variant),{Serial:[{Number:I.variant.Serial.Number,Quantity:1,ExpiryDate:I.variant.Serial.ExpiryDate}]});if(!!J.find(k=>k.ID==y.ID)){let k=y.Serial[0],fe=J.find(pe=>pe.ID==y.ID),At=!!fe.Serial.find(pe=>pe.Number==k.Number)?[...fe.Serial].map(pe=>pe.Number==k.Number?B(w({},pe),{Quantity:pe.Quantity+1}):pe):[...fe.Serial,k];K=J.map(pe=>pe.ID==y.ID?B(w({},pe),{Quantity:pe.Quantity+1,Total:pe.Total+pe.UnitPrice,Serial:At}):pe)}else K=[...J,B(w({},y),{Quantity:1,Total:y.UnitPrice})]}else if(C=="uploadCart")K=[...J,...I.variants];else if(C=="addNewRow"){let y=I.variant;K=[...J,y]}else if(C=="rfid"){let y=I.variants;Object.keys(y).forEach(N=>{if(y.hasOwnProperty(N)){let k=y[N];if(k&&Object.keys(k.variant).length>0){let fe=J.findIndex(Ct=>Ct.Code.toLowerCase()===N.toLowerCase());if(fe!==-1){let Ct=Number(k.count);J[fe].Quantity+=Ct,J[fe].Total=+J[fe].UnitPrice*+J[fe].Quantity,delete y[N],K=[...J]}else{let Ct=k.variant,At=Number(k.count),pe=this.setUnitPrice(Ct),co=this.formatItemObject(B(w({},pe),{Quantity:At,Total:+pe.UnitPrice*+At}));delete y[N],K=[...J,co]}}}})}return K},[]),je([]),X(1)),this.totalVariantOrdered$=this.cart$.pipe(d(c=>c.map(I=>I.Quantity)),d(c=>c.reduce((I,J)=>I+J,0)),je(0))}toastr=le(qe);cartDisplayRef;variantAutocomplete=new ce;variantQuickKey=new ce;_listenRFID=new ge;listenRFID$=this._listenRFID.asObservable().pipe(d(t=>({action:"rfid",variants:t})));_deleteVariant=new ge;deleteVariant$=this._deleteVariant.asObservable().pipe(d(t=>({action:"delete",index:t})));_dragDropCart=new ge;dragDropCart$=this._dragDropCart.asObservable().pipe(d(t=>({action:"sort",ev:t})));_returnCart=new ge;returnCart$=this._returnCart.asObservable().pipe(d(()=>({action:"returnCart"})));_onEditForm=new et(null);onEditForm$=this._onEditForm.asObservable().pipe(V(t=>!!t),d(t=>({action:"onEditForm",variants:t})));_clearCart=new ge;clearCart$=this._clearCart.asObservable().pipe(d(()=>({action:"clearCart"})));_updateVariant=new ge;updateVariant$=this._updateVariant.asObservable().pipe(d(t=>({action:"update",variant:t.variant,index:t.index})));_returnVariant=new ge;returnVariant$=this._returnVariant.asObservable().pipe(d(t=>({action:"returnVariant",index:t})));_purchaseVariant=new ge;purchaseVariant$=this._purchaseVariant.asObservable().pipe(d(t=>({action:"purchaseVariant",index:t})));_addVariant=new ge;addVariant$=this._addVariant.asObservable().pipe(d(t=>({action:"addNewRow",variant:t})));_onUploadCart=new ge;onUploadCart$=this._onUploadCart.asObservable().pipe(d(t=>({action:"uploadCart",variants:t})));cart$;totalVariantOrdered$;_addVariantThroughSerial=new ge;addVariantThroughSerial$;deleteVariant(t){this._deleteVariant.next(t)}dragDropCart(t){this._dragDropCart.next(t)}returnCart(){this._returnCart.next()}updateVariant(t,e){this._updateVariant.next({variant:t,index:e})}returnVariant(t){this._returnVariant.next(t)}purchaseVariant(t){this._purchaseVariant.next(t)}clearCart(){this._clearCart.next()}editForm(t){this._onEditForm.next(t)}addVariant(t){this._addVariant.next(t)}addVariantThroughSerial(t){this._addVariantThroughSerial.next(t)}uploadCart(t){this._onUploadCart.next(t)}setUnitPrice(t){let e=w({},t);return S.IsNotEmpty(t.OrderPrice)?e.UnitPrice=t.OrderPrice:e.UnitPrice=t.UnitCost,e}formatItemObject=t=>{let o=t,{ID:e}=o,i=Qi(o,["ID"]);return B(w({},i),{Quantity:i.Quantity??1,Total:i.Total??i.UnitPrice,VariantID:e})};addCartRFID(t){this._listenRFID.next(t)}static \u0275fac=function(e){return new(e||n)(Q(re),Q(H),Q(mt),Q(Z))};static \u0275prov=ne({token:n,factory:n.\u0275fac,providedIn:"root"})};var Ve=class n{_isEdit=new ge;isEdit$;id$;isUnpaid$;dialog=le(Z);constructor(t,e,i,o,s){let T=tt(t.snapshot.queryParams);this.isEdit$=ot(T.pipe(d(C=>!!C.ID)),this._isEdit.asObservable()).pipe(X(1)),this.id$=T.pipe(V(C=>C.ID),d(C=>C.ID));let h=this.id$.pipe(Y(C=>e.post("/api/Buy2/GetDataByID2",{ID:C})),X(1)),R=dt(()=>o.entities$).pipe(Y(C=>h.pipe(d(y=>[y.Order,C]))),E(([C,y])=>{let N={Att:C.Att,SupplierID:{Key:C.SupplierID,Value:C.SupplierName,OnSet:!0},Date:C.Date,Number:C.Number,ID:C.ID};i.setBulkOrderForm(N)}),E(([C,y])=>{let N=y.find(k=>k.ID==C.EntityID);i.setOutletForm(N)})),G=h.pipe(d(C=>C.Items),d(C=>C.map(y=>B(w({},y.Variant),{Quantity:y.Quantity,Total:y.Total,Note:y.Note,UnitPrice:y.UnitPrice,Discount:y.Discount,Serial:y.Serial,ID:y.ID,VariantID:y.VariantID,UnitQuantity:y.UnitQuantity,QtyRequested:y.QtyRequested,DiscountAmount:y.DiscountAmount}))),E(C=>s.editForm(C))),x=dt(()=>o.currencies$).pipe(Y(C=>h.pipe(d(y=>[y.Order,C,y.Invoice]))),d(([C,y,N])=>B(w({},C),{Number:C.Number!=N.Number?N.Number:C.Number,Currency:y.find(k=>k.ID===C.CurrencyID)})),E(C=>{let y={Note:C.Note,TagID:C.TypeID,Currency:w({},C.Currency),InvoiceNumber:C.Number};i.setBulkNoteForm(y)})),A=h.pipe(d(C=>C.DeliveryEntityID),E(C=>i.setDeliveryEntityID(C))),c=dt(()=>o.taxes$).pipe(Y(C=>h.pipe(d(y=>[y.Order,C]))),d(([C,y])=>B(w({},C),{Taxes:y})),E(C=>{let y=C.Taxes.find(k=>k.ID===C.TaxTypeID);y?.Bin&&this.dialog.open(ni,{id:"ModalInfo",data:{title:"Default Tax Discontinued",message:`
1
+ import{a as io}from"./chunk-ZTU3TIGR.js";import{a as no,c as oo}from"./chunk-53VS5DA7.js";import{a as li}from"./chunk-CAYYUGXV.js";import{a as Yn,b as Xn,c as Zn,d as eo,e as to,f as ke}from"./chunk-PPVORSJQ.js";import{a as Kn}from"./chunk-4KGHH5FV.js";import{a as zn}from"./chunk-T4MU3R7Y.js";import"./chunk-USD2ALDX.js";import{a as ii}from"./chunk-A565EUMD.js";import{a as $n}from"./chunk-DOCQN2VL.js";import{a as ri}from"./chunk-RO6RY4AJ.js";import{a as ki}from"./chunk-IZLEZJ6U.js";import{c as Qn,d as Un}from"./chunk-4XJWQAS6.js";import"./chunk-DC3TCY6D.js";import{a as Gn}from"./chunk-CFWHBIM3.js";import{a as qn}from"./chunk-7DAPNQYU.js";import"./chunk-NM3IQUNN.js";import"./chunk-NQX7EX5A.js";import"./chunk-A2EVMYAR.js";import"./chunk-P3KIIKY4.js";import{a as ni,b as jn,c as Ln}from"./chunk-CQLZHUT4.js";import"./chunk-S27D5MBU.js";import{a as Nt}from"./chunk-HGSF7LOB.js";import"./chunk-2VE2WNSA.js";import"./chunk-25H27N7N.js";import{a as Xt}from"./chunk-T7XU5W5A.js";import{b as Rn}from"./chunk-MNJSQKLX.js";import{a as Wn,b as Jn,c as Hn}from"./chunk-OXWQ7ZZS.js";import{a as oi,b as ai}from"./chunk-FW4OCSXV.js";import{a as Bn}from"./chunk-4CPRMZL6.js";import"./chunk-BYXBJQAS.js";import"./chunk-PRVQ3NAP.js";import"./chunk-BYXBJQAS.js";import{b as Vn}from"./chunk-4OEDK7YE.js";import"./chunk-GWKBJZYT.js";import"./chunk-B5IABJO5.js";import{e as Dt}from"./chunk-O2VVATBW.js";import{a as ei}from"./chunk-363IDTE3.js";import"./chunk-FAED643P.js";import{d as kn,e as ti}from"./chunk-WMZLH4YK.js";import"./chunk-72RZBOHX.js";import"./chunk-3RK6DDJD.js";import"./chunk-M3DKYPGC.js";import"./chunk-6WATOQG3.js";import"./chunk-VM4K4MNV.js";import"./chunk-XTCEZONP.js";import"./chunk-LNDHYAFW.js";import"./chunk-ZZBF7AOW.js";import"./chunk-SIQZO2WM.js";import"./chunk-2CL5FM3P.js";import"./chunk-LGINK7BD.js";import{a as Dn,b as xn,c as Sn}from"./chunk-IKKPP4JS.js";import"./chunk-QPAUI5EG.js";import"./chunk-45E6XCHN.js";import"./chunk-SIDUUVNA.js";import"./chunk-KZFNI67M.js";import"./chunk-4BXCIT62.js";import{a as st,c as ct}from"./chunk-D4FCXEV4.js";import{a as Mn,c as In,e as Pn,g as On}from"./chunk-6P2ASCNY.js";import{a as Tn,b as wn}from"./chunk-S65DCKKO.js";import"./chunk-R2GUMKAU.js";import{a as vn}from"./chunk-BT7NN7PT.js";import{A as Fn,G as An,q as _n,u as Ie,v as Pe,w as Oe,x as Nn,z as En}from"./chunk-26YFRPR2.js";import{b as rt,c as lt}from"./chunk-JBS5UYZC.js";import{O as Ae}from"./chunk-TEGIL5RZ.js";import{a as un,b as fn,c as gn}from"./chunk-EQLHPWVB.js";import{d as xt}from"./chunk-THT6CY5E.js";import{a as z,e as Me,f as Fe,g as Z,l as Zt}from"./chunk-ZTD4APMR.js";import"./chunk-7P3L3ODB.js";import"./chunk-S7FOJJP2.js";import"./chunk-FU2ZGMX4.js";import{a as ve}from"./chunk-2FWFPV5I.js";import"./chunk-SLX34TWD.js";import{E as bn,F as Se,G as Ye,a as Ke,b as Cn,c as be,h as ae,l as ce,o as xe,r as yn,s as ze}from"./chunk-DWZ5JTI2.js";import{a as hn}from"./chunk-C3OTQN4T.js";import"./chunk-36GWLMZX.js";import{b as he}from"./chunk-YVBGB3JF.js";import{a as S}from"./chunk-WUV22SZ4.js";import{a as dn}from"./chunk-AZHKO7UJ.js";import{p as qe,s as re}from"./chunk-LGOSIAUC.js";import{$ as je,Ab as _,Ca as Le,Cb as Qe,D as ot,Db as Ue,E as V,Eb as We,Fb as b,Fc as f,Fd as mn,Gb as r,Gc as g,H as Hi,Hb as a,Hc as wt,I as ye,Ib as M,Ja as Fi,Jb as Je,Kb as it,Lb as kt,Lc as Gt,M as Gi,Mb as Vt,N as Ei,Nb as $t,Nd as pn,Ob as on,Pb as j,Pc as rn,Pd as Kt,Q as qi,Qa as Yi,Qd as zt,Sa as at,Sb as D,Sd as Yt,T as Ki,Tb as bt,Ub as p,Uc as qt,W as Tt,Wa as Xi,Xa as l,Y as X,Yb as Rt,Zb as Bt,_b as jt,aa as Y,ac as Lt,bc as Qt,ca as zi,cc as ht,d as ge,db as Zi,e as et,eb as u,ec as vt,f as Ui,fa as E,ga as me,gb as en,gc as an,gd as Ge,hc as m,ib as F,ic as te,id as ln,jc as $,k as we,kc as He,la as ne,mb as tn,mc as U,n as Wi,nc as L,nd as sn,o as tt,oa as Q,ob as ut,oc as W,od as Ee,p as Ji,pa as le,pc as Ut,qc as Wt,qd as cn,rc as Jt,sc as Ai,sd as De,t as d,ta as P,u as Ce,ua as O,v as Ni,vd as se,wc as Ne,xc as Ht,y as dt,yb as v,yc as ie,zb as nn,zc as _t}from"./chunk-IEVGW2RT.js";import"./chunk-WFMAM73Y.js";import{a as w,b as B,e as Qi,k as yt}from"./chunk-SNAKHGZS.js";var H=class n{constructor(t,e){this.http=e;this.buyForm=t.group({NewOrderID:[""],Order:t.group({Att:[""],SupplierID:[""],Number:[""],Date:[new Date],ID:[S.GuidEmpty]}),Invoice:t.group({ID:[S.GuidEmpty],Due:[new Date],Tax:[0]}),Payment:t.group({ID:[S.GuidEmpty],Amount:[0],MethodID:[0],Code:[""],Note:[""],ImageUrl:[""]})})}outlet=new ce({ID:"",Name:"Choose an Outlet"});dueDays=new ce(0);deliveryEntityID=new ce(S.GuidEmpty);noteForm=new ce({Note:"",TagID:"",Currency:{ID:"",ExchangeRate:0,Symbol:""},InvoiceNumber:""});discountAndTaxForm=new ce({Discount:{Amount:0,Percentage:0},Tax:{ID:"",CalculationTypeName:"",Rate:0,Label:"",Discontinue:!1}});buyForm;setPONumber(t){let e="";if(t.Seed){let i=t.Seed+"";for(;i.length<t.Digit;)i="0"+i;e=S.StringFormat(t.Prefix,i)}this.buyForm.controls.Order.controls.Number.setValue(e)}setDueDateBasedOnDaysDue(t){console.log(t);let e=this.invoiceDate,i=new Date(S.cloneObject(e));i.setDate(i.getDate()+t),this.buyForm.controls.Invoice.controls.Due.setValue(i)}get dueDate(){return this.buyForm.controls.Invoice.controls.Due.value}get invoiceDate(){return this.buyForm.controls.Order.controls.Date.value}setAmount(t){this.buyForm.controls.Payment.controls.Amount.setValue(t)}setPaymentMethodID(t){this.buyForm.controls.Payment.controls.MethodID.setValue(t)}setTaxAmount(t){this.buyForm.controls.Invoice.controls.Tax.setValue(t)}setNewOrderID(t){this.buyForm.controls.NewOrderID.setValue(t)}setTax(t){let e=w({},this.discountAndTaxForm.value.Discount);this.discountAndTaxForm.setValue({Discount:e,Tax:t})}setCurrency(t){let e=this.noteForm.value;this.noteForm.setValue(B(w({},e),{Currency:t}))}setDeliveryEntityID(t){this.deliveryEntityID.setValue(t)}setdueDays(t){this.dueDays.setValue(t)}setBulkOrderForm(t){this.buyForm.controls.Order.setValue(t)}setBulkNoteForm(t){this.noteForm.setValue(t)}setBulkDiscountAndTaxForm(t){this.discountAndTaxForm.setValue(t)}setOutletForm(t){this.outlet.setValue(t)}setBulkInvoice(t){this.buyForm.controls.Invoice.setValue(w(w({},this.buyForm.controls.Invoice.value),t))}setBulkPayment(t){this.buyForm.controls.Payment.setValue(t)}resetOutletForm(){this.outlet.setValue({ID:"",Name:"Choose an Outlet"})}resetDueDaysForm(){this.dueDays.setValue(0)}resetDeliveryEntityID(){this.deliveryEntityID.setValue(S.GuidEmpty)}resetNoteForm(){this.noteForm.setValue(B(w({},this.noteForm.value),{Note:"",TagID:"",InvoiceNumber:""}))}resetDiscountAndTaxForm(){let t=this.discountAndTaxForm.value;this.discountAndTaxForm.setValue(B(w({},t),{Discount:{Amount:0,Percentage:0}}))}resetBuyForm(){this.buyForm.reset(),this.buyForm.controls.Invoice.controls.ID.setValue(S.GuidEmpty),this.buyForm.controls.Invoice.controls.Due.setValue(new Date),this.buyForm.controls.Order.controls.Date.setValue(new Date),this.buyForm.controls.Order.controls.ID.setValue(S.GuidEmpty),this.generateNumberOnNewTransaction()}generateNumberOnNewTransaction(){this.http.post("/API/Buy/GenerateNumber",{ID:this.outlet.value.ID}).subscribe(t=>{this.setNewOrderID(S.Guid_NewGuid()),this.buyForm.controls.Order.controls.Number.setValue(t.Number)})}static \u0275fac=function(e){return new(e||n)(Q(bn),Q(re))};static \u0275prov=ne({token:n,factory:n.\u0275fac,providedIn:"root"})};var de=class n{entities$;appConfigJSON$;taxes$;currencies$;supplierPOTypes$;predefinedNotes$;denomination$;defaultDueDays$;constructor(t,e){let i=t.get("/API/Buy2/Load").pipe(E(o=>e.setCurrency(o.Currencies.find(s=>s.ID==o.AppConfigJSON.CoreDefaults.CurrencyID))),X(1));this.denomination$=i.pipe(d(o=>o.Denomination)),this.entities$=i.pipe(d(o=>o.Entities)),this.appConfigJSON$=i.pipe(d(o=>o.AppConfigJSON)),this.taxes$=i.pipe(d(o=>o.Taxes),X(1)),this.currencies$=i.pipe(d(o=>o.Currencies),X(1)),this.supplierPOTypes$=i.pipe(d(o=>o.SupplierPOTypes)),this.predefinedNotes$=i.pipe(d(o=>o.PredefinedNotes)),this.defaultDueDays$=i.pipe(d(o=>o.AppConfigJSON.ModuleBuy.PaymentDialog.DefaultDueDays),E(o=>e.setdueDays(o)),E(o=>e.setDueDateBasedOnDaysDue(o)))}updateDueDays(){this.defaultDueDays$.subscribe()}static \u0275fac=function(e){return new(e||n)(Q(re),Q(H))};static \u0275prov=ne({token:n,factory:n.\u0275fac,providedIn:"root"})};var mt=class n{returnInvoiceNumber=new ce("");invoiceInfo$;constructor(t,e,i){let o=e.outlet.valueChanges.pipe(d(c=>c.ID),z());this.invoiceInfo$=this.returnInvoiceNumber.valueChanges.pipe(V(c=>!!c),me(o),Y(([c,I])=>t.post("/API/Buy/GetSupplierInvoiceRetur2",{EntityID:I,Number:c}).pipe(ye(()=>we))),X(1),z());let s=this.invoiceInfo$.pipe(d(c=>w({},c.Order)),E(c=>{let I={Att:c.Att,SupplierID:{Key:c.SupplierID,Value:c.SupplierName,OnSet:!0},Date:new Date,Number:e.buyForm.controls.Order.controls.Number.value,ID:S.GuidEmpty};e.setBulkOrderForm(I)}),z()),T=this.invoiceInfo$.pipe(d(c=>c.Order),E(c=>{let I={Note:`Return #${c.Number}`,TagID:c.TypeID,Currency:{ID:c.CurrencyID,ExchangeRate:c.CurrencyRate,Symbol:c.CurrencySymbol??"$"},InvoiceNumber:c.Number};e.setBulkNoteForm(I)}),z()),h=this.invoiceInfo$.pipe(d(c=>c.Order),me(i.taxes$),d(([c,I])=>B(w({},c),{Tax:I.find(J=>J.ID===c.TaxTypeID)})),E(c=>{let I={Discount:{Amount:c.DiscountAmount,Percentage:c.Discount},Tax:{ID:c.TaxTypeID,Rate:c.Tax?.Rate,CalculationTypeName:c.Tax?.CalculationTypeName,Label:c.Tax?.Label,Discontinue:!c.Tax?.Label}};e.setBulkDiscountAndTaxForm(I)}),z()),R=this.invoiceInfo$.pipe(d(c=>c.DeliveryEntityID),E(c=>e.setDeliveryEntityID(c)),z()),G=this.invoiceInfo$.pipe(d(c=>c.Invoice),E(c=>{let I={ID:c.ID,Tax:c.Tax};e.setBulkInvoice(I)}),z()),x=this.invoiceInfo$.pipe(d(c=>c.Payment),E(c=>{let I={ID:S.GuidEmpty,Amount:c.Amount,MethodID:c.MethodID,Note:c.Note,Code:c.Code,ImageUrl:c.ImageUrl};e.setBulkPayment(I)}),z());Ce(s,T,h,R,G,x).pipe(z()).subscribe()}static \u0275fac=function(e){return new(e||n)(Q(re),Q(H),Q(de))};static \u0275prov=ne({token:n,factory:n.\u0275fac,providedIn:"root"})};var ee=class n{constructor(t,e,i,o){this.matDialog=o;let s=e.outlet.valueChanges.pipe(d(c=>c.ID));this.addVariantThroughSerial$=this._addVariantThroughSerial.asObservable().pipe(me(s),Y(([c,I])=>t.get(Ae.GetVariantBySerial,[{key:"Serial",value:c},{key:"EntityID",value:I}]).pipe(ye(()=>we))),d(c=>this.setUnitPrice(c)),d(c=>B(w({},c),{Quantity:1,Total:c.UnitPrice,VariantID:c.ID})),d(c=>({action:"addAsSerial",variant:c})));let T=this.variantAutocomplete.valueChanges.pipe(V(c=>S.IsNotEmpty(c)&&c.type=="Code"),d(c=>c.str),me(s),Y(([c,I])=>t.get(Ae.GetVariantByCode,[{key:"Code",value:c},{key:"EntityID",value:I},{key:"Promotion",value:!0}]).pipe(ye(()=>we))),d(c=>this.setUnitPrice(c)),d(c=>B(w({},c),{Quantity:1,Total:c.UnitPrice*((100-c.PriceDiscount)/100),Discount:c.PriceDiscount,VariantID:c.ID}))),h=this.variantAutocomplete.valueChanges.pipe(V(c=>S.IsNotEmpty(c)&&c.type=="ID"),d(c=>c.str)),R=this.variantQuickKey.valueChanges,G=ot(h,R).pipe(me(s),Y(([c,I])=>t.get(Ae.GetVariantByID,[{key:"ID",value:c},{key:"EntityID",value:I}]).pipe(ye(()=>we))),d(c=>this.setUnitPrice(c)),d(c=>B(w({},c),{Quantity:1,Total:c.UnitPrice*((100-c.OrderPriceDiscount)/100),Discount:c.OrderPriceDiscount,VariantID:c.ID}))),x=ot(G,T).pipe(E(c=>{c.CategoryTypeID===1&&this.toastr.info(`${c.Name} is sellable only.`,ve.Info)}),V(c=>c.CategoryTypeID!==1),d(c=>({action:"add",variant:c})),E(()=>{this.cartDisplayRef&&setTimeout(()=>{let c=this.cartDisplayRef.nativeElement.scrollHeight;this.cartDisplayRef.nativeElement.scrollTop=c},1)})),A=i.invoiceInfo$.pipe(d(c=>({action:"returnInvoice",variants:c.Items.map(I=>B(w({},I.Variant),{Quantity:I.Quantity,Total:I.Total,UnitPrice:I.UnitPrice,Discount:I.Discount,Serial:I.Serial,ID:I.ID,DiscountAmount:I.DiscountAmount,VariantID:I.VariantID,UnitQuantity:I.UnitQuantity}))})));this.cart$=ot(x,A,this.deleteVariant$,this.dragDropCart$,this.returnCart$,this.updateVariant$,this.returnVariant$,this.purchaseVariant$,this.clearCart$,this.onEditForm$,this.addVariantThroughSerial$,this.addVariant$,this.onUploadCart$,this.listenRFID$).pipe(Tt((c,I)=>{let J=[...c],K=[],C=I.action;if(C=="add"){let y=I.variant;K=!!J.find(k=>k.VariantID==y.ID)?J.map(k=>k.VariantID==y.ID?B(w({},k),{Quantity:k.Quantity+1,Total:k.Total+k.UnitPrice}):k):[...J,y]}else if(C=="returnInvoice"||C=="onEditForm")K=I.variants;else if(C=="delete"){let y=I.index;K=J.filter((N,k)=>k!=y)}else if(C=="sort"){let y=I.ev;K=J,Mn(K,y.previousIndex,y.currentIndex)}else if(C=="returnCart")K=J.map(y=>B(w({},y),{Quantity:-Math.abs(y.Quantity),Total:-Math.abs(y.Total)}));else if(C=="update"){let y=I.index;K=J.map((N,k)=>k==y?I.variant:N)}else if(C=="returnVariant"){let y=I.index;K=J.map((N,k)=>k==y?B(w({},N),{Quantity:-Math.abs(N.Quantity),Total:-Math.abs(N.Total)}):N)}else if(C=="purchaseVariant"){let y=I.index;K=J.map((N,k)=>k==y?B(w({},N),{Quantity:Math.abs(N.Quantity),Total:Math.abs(N.Total)}):N)}else if(C=="clearCart")K=[];else if(C=="addAsSerial"){let y=B(w({},I.variant),{Serial:[{Number:I.variant.Serial.Number,Quantity:1,ExpiryDate:I.variant.Serial.ExpiryDate}]});if(!!J.find(k=>k.ID==y.ID)){let k=y.Serial[0],fe=J.find(pe=>pe.ID==y.ID),At=!!fe.Serial.find(pe=>pe.Number==k.Number)?[...fe.Serial].map(pe=>pe.Number==k.Number?B(w({},pe),{Quantity:pe.Quantity+1}):pe):[...fe.Serial,k];K=J.map(pe=>pe.ID==y.ID?B(w({},pe),{Quantity:pe.Quantity+1,Total:pe.Total+pe.UnitPrice,Serial:At}):pe)}else K=[...J,B(w({},y),{Quantity:1,Total:y.UnitPrice})]}else if(C=="uploadCart")K=[...J,...I.variants];else if(C=="addNewRow"){let y=I.variant;K=[...J,y]}else if(C=="rfid"){let y=I.variants;Object.keys(y).forEach(N=>{if(y.hasOwnProperty(N)){let k=y[N];if(k&&Object.keys(k.variant).length>0){let fe=J.findIndex(Ct=>Ct.Code.toLowerCase()===N.toLowerCase());if(fe!==-1){let Ct=Number(k.count);J[fe].Quantity+=Ct,J[fe].Total=+J[fe].UnitPrice*+J[fe].Quantity,delete y[N],K=[...J]}else{let Ct=k.variant,At=Number(k.count),pe=this.setUnitPrice(Ct),co=this.formatItemObject(B(w({},pe),{Quantity:At,Total:+pe.UnitPrice*+At}));delete y[N],K=[...J,co]}}}})}return K},[]),je([]),X(1)),this.totalVariantOrdered$=this.cart$.pipe(d(c=>c.map(I=>I.Quantity)),d(c=>c.reduce((I,J)=>I+J,0)),je(0))}toastr=le(qe);cartDisplayRef;variantAutocomplete=new ce;variantQuickKey=new ce;_listenRFID=new ge;listenRFID$=this._listenRFID.asObservable().pipe(d(t=>({action:"rfid",variants:t})));_deleteVariant=new ge;deleteVariant$=this._deleteVariant.asObservable().pipe(d(t=>({action:"delete",index:t})));_dragDropCart=new ge;dragDropCart$=this._dragDropCart.asObservable().pipe(d(t=>({action:"sort",ev:t})));_returnCart=new ge;returnCart$=this._returnCart.asObservable().pipe(d(()=>({action:"returnCart"})));_onEditForm=new et(null);onEditForm$=this._onEditForm.asObservable().pipe(V(t=>!!t),d(t=>({action:"onEditForm",variants:t})));_clearCart=new ge;clearCart$=this._clearCart.asObservable().pipe(d(()=>({action:"clearCart"})));_updateVariant=new ge;updateVariant$=this._updateVariant.asObservable().pipe(d(t=>({action:"update",variant:t.variant,index:t.index})));_returnVariant=new ge;returnVariant$=this._returnVariant.asObservable().pipe(d(t=>({action:"returnVariant",index:t})));_purchaseVariant=new ge;purchaseVariant$=this._purchaseVariant.asObservable().pipe(d(t=>({action:"purchaseVariant",index:t})));_addVariant=new ge;addVariant$=this._addVariant.asObservable().pipe(d(t=>({action:"addNewRow",variant:t})));_onUploadCart=new ge;onUploadCart$=this._onUploadCart.asObservable().pipe(d(t=>({action:"uploadCart",variants:t})));cart$;totalVariantOrdered$;_addVariantThroughSerial=new ge;addVariantThroughSerial$;deleteVariant(t){this._deleteVariant.next(t)}dragDropCart(t){this._dragDropCart.next(t)}returnCart(){this._returnCart.next()}updateVariant(t,e){this._updateVariant.next({variant:t,index:e})}returnVariant(t){this._returnVariant.next(t)}purchaseVariant(t){this._purchaseVariant.next(t)}clearCart(){this._clearCart.next()}editForm(t){this._onEditForm.next(t)}addVariant(t){this._addVariant.next(t)}addVariantThroughSerial(t){this._addVariantThroughSerial.next(t)}uploadCart(t){this._onUploadCart.next(t)}setUnitPrice(t){let e=w({},t);return S.IsNotEmpty(t.OrderPrice)?e.UnitPrice=t.OrderPrice:e.UnitPrice=t.UnitCost,e}formatItemObject=t=>{let o=t,{ID:e}=o,i=Qi(o,["ID"]);return B(w({},i),{Quantity:i.Quantity??1,Total:i.Total??i.UnitPrice,VariantID:e})};addCartRFID(t){this._listenRFID.next(t)}static \u0275fac=function(e){return new(e||n)(Q(re),Q(H),Q(mt),Q(Z))};static \u0275prov=ne({token:n,factory:n.\u0275fac,providedIn:"root"})};var Ve=class n{_isEdit=new ge;isEdit$;id$;isUnpaid$;dialog=le(Z);constructor(t,e,i,o,s){let T=tt(t.snapshot.queryParams);this.isEdit$=ot(T.pipe(d(C=>!!C.ID)),this._isEdit.asObservable()).pipe(X(1)),this.id$=T.pipe(V(C=>C.ID),d(C=>C.ID));let h=this.id$.pipe(Y(C=>e.post("/api/Buy2/GetDataByID2",{ID:C})),X(1)),R=dt(()=>o.entities$).pipe(Y(C=>h.pipe(d(y=>[y.Order,C]))),E(([C,y])=>{let N={Att:C.Att,SupplierID:{Key:C.SupplierID,Value:C.SupplierName,OnSet:!0},Date:C.Date,Number:C.Number,ID:C.ID};i.setBulkOrderForm(N)}),E(([C,y])=>{let N=y.find(k=>k.ID==C.EntityID);i.setOutletForm(N)})),G=h.pipe(d(C=>C.Items),d(C=>C.map(y=>B(w({},y.Variant),{Quantity:y.Quantity,Total:y.Total,Note:y.Note,UnitPrice:y.UnitPrice,Discount:y.Discount,Serial:y.Serial,ID:y.ID,VariantID:y.VariantID,UnitQuantity:y.UnitQuantity,QtyRequested:y.QtyRequested,DiscountAmount:y.DiscountAmount}))),E(C=>s.editForm(C))),x=dt(()=>o.currencies$).pipe(Y(C=>h.pipe(d(y=>[y.Order,C,y.Invoice]))),d(([C,y,N])=>B(w({},C),{Number:C.Number!=N.Number?N.Number:C.Number,Currency:y.find(k=>k.ID===C.CurrencyID)})),E(C=>{let y={Note:C.Note,TagID:C.TypeID,Currency:w({},C.Currency),InvoiceNumber:C.Number};i.setBulkNoteForm(y)})),A=h.pipe(d(C=>C.DeliveryEntityID),E(C=>i.setDeliveryEntityID(C))),c=dt(()=>o.taxes$).pipe(Y(C=>h.pipe(d(y=>[y.Order,C]))),d(([C,y])=>B(w({},C),{Taxes:y})),E(C=>{let y=C.Taxes.find(k=>k.ID===C.TaxTypeID);y?.Bin&&this.dialog.open(ni,{id:"ModalInfo",data:{title:"Default Tax Discontinued",message:`
2
2
  <div class="d-flex justify-content-center my-4">
3
3
  <img class="img-2x" src="https://cdn.dealpos.xyz/web-image/globalerror.svg"
4
4
  alt="Empty Sales Order Tag" />
@@ -1 +1 @@
1
- import{a as U}from"./chunk-LHCZ2R2J.js";import{a as O}from"./chunk-36GWLMZX.js";import{b as R}from"./chunk-YVBGB3JF.js";import{a as f}from"./chunk-WUV22SZ4.js";import{s as h}from"./chunk-LGOSIAUC.js";import{Ma as v,Pd as C,fa as S,la as u,oa as p,pa as g,wd as N,ya as d}from"./chunk-IEVGW2RT.js";var k=(t=>(t[t.PAID=0]="PAID",t[t.OVERDUE=1]="OVERDUE",t[t.SELL_ONLY=2]="SELL_ONLY",t[t.SUSPENDED=3]="SUSPENDED",t))(k||{});var D=(()=>{let e=class e{constructor(){this.document=g(d),this.platformId=g(v),this.documentIsAccessible=N(this.platformId)}static getCookieRegExp(i){let t=i.replace(/([[\]{}()|=;+?,.*^$\\])/gi,"\\$1");return new RegExp("(?:^"+t+"|;\\s*"+t+")=(.*?)(?:;|$)","g")}static safeDecodeURIComponent(i){try{return decodeURIComponent(i)}catch{return i}}check(i){return this.documentIsAccessible?(i=encodeURIComponent(i),e.getCookieRegExp(i).test(this.document.cookie)):!1}get(i){if(this.check(i)){i=encodeURIComponent(i);let n=e.getCookieRegExp(i).exec(this.document.cookie);return n?.[1]?e.safeDecodeURIComponent(n[1]):""}else return""}getAll(){if(!this.documentIsAccessible)return{};let i={},t=this.document;return t.cookie&&t.cookie!==""&&t.cookie.split(";").forEach(n=>{let[s,c]=n.split("=");i[e.safeDecodeURIComponent(s.replace(/^ /,""))]=e.safeDecodeURIComponent(c)}),i}set(i,t,n,s,c,l,T,b){if(!this.documentIsAccessible)return;if(typeof n=="number"||n instanceof Date||s||c||l||T){let I={expires:n,path:s,domain:c,secure:l,sameSite:T||"Lax",partitioned:b};this.set(i,t,I);return}let a=encodeURIComponent(i)+"="+encodeURIComponent(t)+";",r=n||{};if(r.expires)if(typeof r.expires=="number"){let I=new Date(new Date().getTime()+r.expires*1e3*60*60*24);a+="expires="+I.toUTCString()+";"}else a+="expires="+r.expires.toUTCString()+";";r.path&&(a+="path="+r.path+";"),r.domain&&(a+="domain="+r.domain+";"),r.secure===!1&&r.sameSite==="None"&&(r.secure=!0,console.warn(`[ngx-cookie-service] Cookie ${i} was forced with secure flag because sameSite=None.More details : https://github.com/stevermeister/ngx-cookie-service/issues/86#issuecomment-597720130`)),r.secure&&(a+="secure;"),r.sameSite||(r.sameSite="Lax"),a+="sameSite="+r.sameSite+";",r.partitioned&&(a+="Partitioned;"),this.document.cookie=a}delete(i,t,n,s,c="Lax"){if(!this.documentIsAccessible)return;let l=new Date("Thu, 01 Jan 1970 00:00:01 GMT");this.set(i,"",{expires:l,path:t,domain:n,secure:s,sameSite:c})}deleteAll(i,t,n,s="Lax"){if(!this.documentIsAccessible)return;let c=this.getAll();for(let l in c)c.hasOwnProperty(l)&&this.delete(l,i,t,n,s)}};e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=u({token:e,factory:e.\u0275fac,providedIn:"root"});let m=e;return m})();var E=class m{constructor(e,o,i,t,n,s){this.httpService=e;this.cookieService=o;this.router=i;this.roleService=t;this.intercomService=n;this.fraction=s}role=[];_returnUrl;_loginResponse;_jwtToken;set returnUrl(e){this._returnUrl=e}get returnUrl(){return this._returnUrl}login(e){return this.httpService.post("/api/Login/Web",e).pipe(S(o=>{this._loginResponse=o,o.Type=="geo"||o.Type=="totp"||this.saveLoginConfigToStorage(o)}))}loginLoader(){return this.httpService.get("/api/login/Loader")}getRedirectUrl(){let e=this.getSubscriptionStatus(),o=this.getRedirectUrlByRole();return(e==2||e==3)&&(o="/menu/Profile/Main/My_Subscription"),o}getRedirectUrlByRole(){let e,o=this.roleService;return o.dashboard.View?e="/menu/Dashboard":o.product.View?e="/menu/Products":e="/menu/Sell",e}logout(){localStorage.removeItem("ConfigData"),localStorage.removeItem("Token"),localStorage.removeItem("Roles"),localStorage.removeItem("AccountInfo"),localStorage.removeItem("CloudinaryConfig"),localStorage.removeItem("SubscriptionStatus"),this.cookieService.delete("ReportFilter","/"),this.intercomService.shutdown(),this._jwtToken=null,this.roleService.resetRoles(),this.router.navigate(["/"])}refreshToken(){this.httpService.post("/API/Authentication/RefreshToken",{}).subscribe(e=>{localStorage.removeItem("Token"),localStorage.setItem("Token",e.Token),this._jwtToken=null,this.roleService.resetRoles(),this.roleService.parseJWTRoles()})}isTokenExpired(){let e=localStorage.getItem("Token");if(e){let o=f.parseJwt(e),i=this.convertUnixTimesTamp(o.exp),t=new Date;if(i.getTime()-t.getTime()>0)return!1}return!0}isInRole(e){e.forEach(o=>o(this.role))}convertUnixTimesTamp(e){return new Date(e*1e3)}saveLoginConfigToStorage(e){localStorage.setItem("quantityFraction",JSON.stringify(e.UIConfig.Fraction.Quantity)),localStorage.setItem("amountFraction",JSON.stringify(e.UIConfig.Fraction.Amount)),this.fraction.setAmountFraction(e.UIConfig.Fraction.Amount.Minimum,e.UIConfig.Fraction.Amount.Maximum),this.fraction.setQuantityFraction(e.UIConfig.Fraction.Quantity.Minimum,e.UIConfig.Fraction.Quantity.Maximum),localStorage.setItem("AccountInfo",JSON.stringify(e?.AccountInfo)),localStorage.setItem("Token",e?.Token),localStorage.setItem("TinyMCEPlugins",e?.UIConfig.TinyMCE),this.intercomService.updateLocalStorage(e?.Intercom),localStorage.setItem("CloudinaryConfig",e?.UIConfig.CloudinaryConfig),localStorage.setItem("DataDaysRange",e?.UIConfig.DataDaysRange),localStorage.setItem("SubscriptionStatus",JSON.stringify(e?.SubscriptionStatus));let o=this.getParseToken();f.IsNotEmpty(o?.NotificationOutletID)&&localStorage.setItem("NotificationOutletID",o?.NotificationOutletID),this.roleService.parseJWTRoles(),this._loginResponse=null}getParseToken(){let e=localStorage.getItem("Token");return e&&!this._jwtToken&&(this._jwtToken=f.parseJwt(e)),this._jwtToken}get loginResponse(){return this._loginResponse}getSubscriptionStatus(){let e=localStorage.getItem("SubscriptionStatus");return e?parseInt(e):null}static \u0275fac=function(o){return new(o||m)(p(h),p(D),p(C),p(R),p(U),p(O))};static \u0275prov=u({token:m,factory:m.\u0275fac,providedIn:"root"})};export{k as a,D as b,E as c};
1
+ import{a as U}from"./chunk-C3OTQN4T.js";import{a as O}from"./chunk-36GWLMZX.js";import{b as R}from"./chunk-YVBGB3JF.js";import{a as f}from"./chunk-WUV22SZ4.js";import{s as h}from"./chunk-LGOSIAUC.js";import{Ma as v,Pd as C,fa as S,la as u,oa as p,pa as g,wd as N,ya as d}from"./chunk-IEVGW2RT.js";var k=(t=>(t[t.PAID=0]="PAID",t[t.OVERDUE=1]="OVERDUE",t[t.SELL_ONLY=2]="SELL_ONLY",t[t.SUSPENDED=3]="SUSPENDED",t))(k||{});var D=(()=>{let e=class e{constructor(){this.document=g(d),this.platformId=g(v),this.documentIsAccessible=N(this.platformId)}static getCookieRegExp(i){let t=i.replace(/([[\]{}()|=;+?,.*^$\\])/gi,"\\$1");return new RegExp("(?:^"+t+"|;\\s*"+t+")=(.*?)(?:;|$)","g")}static safeDecodeURIComponent(i){try{return decodeURIComponent(i)}catch{return i}}check(i){return this.documentIsAccessible?(i=encodeURIComponent(i),e.getCookieRegExp(i).test(this.document.cookie)):!1}get(i){if(this.check(i)){i=encodeURIComponent(i);let n=e.getCookieRegExp(i).exec(this.document.cookie);return n?.[1]?e.safeDecodeURIComponent(n[1]):""}else return""}getAll(){if(!this.documentIsAccessible)return{};let i={},t=this.document;return t.cookie&&t.cookie!==""&&t.cookie.split(";").forEach(n=>{let[s,c]=n.split("=");i[e.safeDecodeURIComponent(s.replace(/^ /,""))]=e.safeDecodeURIComponent(c)}),i}set(i,t,n,s,c,l,T,b){if(!this.documentIsAccessible)return;if(typeof n=="number"||n instanceof Date||s||c||l||T){let I={expires:n,path:s,domain:c,secure:l,sameSite:T||"Lax",partitioned:b};this.set(i,t,I);return}let a=encodeURIComponent(i)+"="+encodeURIComponent(t)+";",r=n||{};if(r.expires)if(typeof r.expires=="number"){let I=new Date(new Date().getTime()+r.expires*1e3*60*60*24);a+="expires="+I.toUTCString()+";"}else a+="expires="+r.expires.toUTCString()+";";r.path&&(a+="path="+r.path+";"),r.domain&&(a+="domain="+r.domain+";"),r.secure===!1&&r.sameSite==="None"&&(r.secure=!0,console.warn(`[ngx-cookie-service] Cookie ${i} was forced with secure flag because sameSite=None.More details : https://github.com/stevermeister/ngx-cookie-service/issues/86#issuecomment-597720130`)),r.secure&&(a+="secure;"),r.sameSite||(r.sameSite="Lax"),a+="sameSite="+r.sameSite+";",r.partitioned&&(a+="Partitioned;"),this.document.cookie=a}delete(i,t,n,s,c="Lax"){if(!this.documentIsAccessible)return;let l=new Date("Thu, 01 Jan 1970 00:00:01 GMT");this.set(i,"",{expires:l,path:t,domain:n,secure:s,sameSite:c})}deleteAll(i,t,n,s="Lax"){if(!this.documentIsAccessible)return;let c=this.getAll();for(let l in c)c.hasOwnProperty(l)&&this.delete(l,i,t,n,s)}};e.\u0275fac=function(t){return new(t||e)},e.\u0275prov=u({token:e,factory:e.\u0275fac,providedIn:"root"});let m=e;return m})();var E=class m{constructor(e,o,i,t,n,s){this.httpService=e;this.cookieService=o;this.router=i;this.roleService=t;this.intercomService=n;this.fraction=s}role=[];_returnUrl;_loginResponse;_jwtToken;set returnUrl(e){this._returnUrl=e}get returnUrl(){return this._returnUrl}login(e){return this.httpService.post("/api/Login/Web",e).pipe(S(o=>{this._loginResponse=o,o.Type=="geo"||o.Type=="totp"||this.saveLoginConfigToStorage(o)}))}loginLoader(){return this.httpService.get("/api/login/Loader")}getRedirectUrl(){let e=this.getSubscriptionStatus(),o=this.getRedirectUrlByRole();return(e==2||e==3)&&(o="/menu/Profile/Main/My_Subscription"),o}getRedirectUrlByRole(){let e,o=this.roleService;return o.dashboard.View?e="/menu/Dashboard":o.product.View?e="/menu/Products":e="/menu/Sell",e}logout(){localStorage.removeItem("ConfigData"),localStorage.removeItem("Token"),localStorage.removeItem("Roles"),localStorage.removeItem("AccountInfo"),localStorage.removeItem("CloudinaryConfig"),localStorage.removeItem("SubscriptionStatus"),this.cookieService.delete("ReportFilter","/"),this.intercomService.shutdown(),this._jwtToken=null,this.roleService.resetRoles(),this.router.navigate(["/"])}refreshToken(){this.httpService.post("/API/Authentication/RefreshToken",{}).subscribe(e=>{localStorage.removeItem("Token"),localStorage.setItem("Token",e.Token),this._jwtToken=null,this.roleService.resetRoles(),this.roleService.parseJWTRoles()})}isTokenExpired(){let e=localStorage.getItem("Token");if(e){let o=f.parseJwt(e),i=this.convertUnixTimesTamp(o.exp),t=new Date;if(i.getTime()-t.getTime()>0)return!1}return!0}isInRole(e){e.forEach(o=>o(this.role))}convertUnixTimesTamp(e){return new Date(e*1e3)}saveLoginConfigToStorage(e){localStorage.setItem("quantityFraction",JSON.stringify(e.UIConfig.Fraction.Quantity)),localStorage.setItem("amountFraction",JSON.stringify(e.UIConfig.Fraction.Amount)),this.fraction.setAmountFraction(e.UIConfig.Fraction.Amount.Minimum,e.UIConfig.Fraction.Amount.Maximum),this.fraction.setQuantityFraction(e.UIConfig.Fraction.Quantity.Minimum,e.UIConfig.Fraction.Quantity.Maximum),localStorage.setItem("AccountInfo",JSON.stringify(e?.AccountInfo)),localStorage.setItem("Token",e?.Token),localStorage.setItem("TinyMCEPlugins",e?.UIConfig.TinyMCE),this.intercomService.updateLocalStorage(e?.Intercom),localStorage.setItem("CloudinaryConfig",e?.UIConfig.CloudinaryConfig),localStorage.setItem("DataDaysRange",e?.UIConfig.DataDaysRange),localStorage.setItem("SubscriptionStatus",JSON.stringify(e?.SubscriptionStatus));let o=this.getParseToken();f.IsNotEmpty(o?.NotificationOutletID)&&localStorage.setItem("NotificationOutletID",o?.NotificationOutletID),this.roleService.parseJWTRoles(),this._loginResponse=null}getParseToken(){let e=localStorage.getItem("Token");return e&&!this._jwtToken&&(this._jwtToken=f.parseJwt(e)),this._jwtToken}get loginResponse(){return this._loginResponse}getSubscriptionStatus(){let e=localStorage.getItem("SubscriptionStatus");return e?parseInt(e):null}static \u0275fac=function(o){return new(o||m)(p(h),p(D),p(C),p(R),p(U),p(O))};static \u0275prov=u({token:m,factory:m.\u0275fac,providedIn:"root"})};export{k as a,D as b,E as c};