dealpos 25.36.4 → 25.36.5

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 (77) hide show
  1. package/browser/{chunk-MYY7XGIP.js → chunk-23Y4YCAW.js} +1 -1
  2. package/browser/{chunk-SHX4HZR5.js → chunk-2RSKW5G2.js} +1 -1
  3. package/browser/{chunk-CANVSK3K.js → chunk-33NXJZ72.js} +1 -1
  4. package/browser/{chunk-SVWFMPX6.js → chunk-3IOQWLB5.js} +1 -1
  5. package/browser/{chunk-NMSWEKQO.js → chunk-3IPP3AZL.js} +1 -1
  6. package/browser/{chunk-IC6JYWIM.js → chunk-3O2TNQSP.js} +1 -1
  7. package/browser/{chunk-VVY5LOFN.js → chunk-3TA4OWHL.js} +2 -2
  8. package/browser/{chunk-VPWEJCYI.js → chunk-44PHIXFD.js} +2 -2
  9. package/browser/{chunk-EHMDBGDW.js → chunk-44YH56DF.js} +1 -1
  10. package/browser/{chunk-NEIJ2VB2.js → chunk-4GUECTPN.js} +1 -1
  11. package/browser/{chunk-V4CJN6HP.js → chunk-56WYLSRZ.js} +1 -1
  12. package/browser/{chunk-Z4WQ7UZ7.js → chunk-5DD6XM7Q.js} +1 -1
  13. package/browser/{chunk-5D5E5L7B.js → chunk-5DKNOWTW.js} +1 -1
  14. package/browser/{chunk-P7XJ76G4.js → chunk-5EWWMBXV.js} +1 -1
  15. package/browser/{chunk-2JW3Q5UE.js → chunk-6HZ67QEX.js} +1 -1
  16. package/browser/{chunk-G42GWWEK.js → chunk-ADD7IJCW.js} +1 -1
  17. package/browser/{chunk-TPPXSXQL.js → chunk-ALOHPKEB.js} +1 -1
  18. package/browser/{chunk-5FQYVKRJ.js → chunk-ARJLWLHF.js} +1 -1
  19. package/browser/{chunk-WGHNPI32.js → chunk-BF3HM72L.js} +1 -1
  20. package/browser/{chunk-Q5R2UJWA.js → chunk-BKS3I5O7.js} +1 -1
  21. package/browser/{chunk-4XGEASWE.js → chunk-BYT3ZVBA.js} +1 -1
  22. package/browser/{chunk-HHWP2JX2.js → chunk-COG3GHJD.js} +1 -1
  23. package/browser/{chunk-6KKSOYUD.js → chunk-CQVVIZJ7.js} +1 -1
  24. package/browser/{chunk-PNUK526Z.js → chunk-CRTHBX5Z.js} +1 -1
  25. package/browser/{chunk-BMO6VRUL.js → chunk-D5CTQSRR.js} +1 -1
  26. package/browser/{chunk-A4ZBR5EG.js → chunk-D5E7MR22.js} +1 -1
  27. package/browser/{chunk-JTW2HUGK.js → chunk-DADXJJV4.js} +1 -1
  28. package/browser/{chunk-FIVKLVNO.js → chunk-DGRQO7J7.js} +1 -1
  29. package/browser/{chunk-ZJ7P3FXP.js → chunk-DQUPGPLI.js} +1 -1
  30. package/browser/{chunk-QJKL3QCW.js → chunk-E5KSEPMR.js} +1 -1
  31. package/browser/{chunk-4GGKDU75.js → chunk-ECSUCVRE.js} +1 -1
  32. package/browser/{chunk-XGQYIBFW.js → chunk-EVX52NA7.js} +1 -1
  33. package/browser/{chunk-SU773RBY.js → chunk-FPBO7JOG.js} +1 -1
  34. package/browser/{chunk-ZPXMVSOE.js → chunk-FSFWFU4W.js} +1 -1
  35. package/browser/{chunk-L6ZV6K7H.js → chunk-G7GHTJTG.js} +1 -1
  36. package/browser/{chunk-XRNWNUVG.js → chunk-GR3EU2XL.js} +1 -1
  37. package/browser/{chunk-26PBHX4V.js → chunk-GYLHVSYU.js} +1 -1
  38. package/browser/{chunk-X7EUHZHE.js → chunk-H43K36DA.js} +1 -1
  39. package/browser/{chunk-R4KZZ4Z4.js → chunk-HXWCQE45.js} +1 -1
  40. package/browser/{chunk-M5NEB347.js → chunk-IB5RZ52J.js} +2 -2
  41. package/browser/{chunk-TVBVDVFT.js → chunk-IWKZ2PDL.js} +1 -1
  42. package/browser/{chunk-CMLB4IUQ.js → chunk-M4WOVW67.js} +1 -1
  43. package/browser/{chunk-25NQQNU2.js → chunk-MTCDHEYA.js} +1 -1
  44. package/browser/{chunk-5JJVCYOU.js → chunk-NNSCOQQS.js} +1 -1
  45. package/browser/{chunk-3NUTLR5R.js → chunk-NW2SL2BH.js} +2 -2
  46. package/browser/{chunk-4ECPS3D4.js → chunk-O65PGOTS.js} +1 -1
  47. package/browser/{chunk-WRF3RPQH.js → chunk-P2IBO7GU.js} +1 -1
  48. package/browser/{chunk-7RGCBUUG.js → chunk-PBNWYWYT.js} +1 -1
  49. package/browser/{chunk-UDCPYYEK.js → chunk-PDCSUOQI.js} +1 -1
  50. package/browser/{chunk-YFJME3JU.js → chunk-PX7NWQZQ.js} +1 -1
  51. package/browser/{chunk-KOUQSPVF.js → chunk-R6UDCFVL.js} +1 -1
  52. package/browser/{chunk-NZVEUXSI.js → chunk-RZ4V7O3L.js} +1 -1
  53. package/browser/{chunk-PM5UEADY.js → chunk-S2EI3VNS.js} +1 -1
  54. package/browser/{chunk-LLHQZRPT.js → chunk-T43U2XFQ.js} +1 -1
  55. package/browser/{chunk-IXKPLT63.js → chunk-T4OLDAMN.js} +1 -1
  56. package/browser/{chunk-I4DDICSE.js → chunk-TR7C2V7C.js} +1 -1
  57. package/browser/{chunk-XJWOCBHY.js → chunk-U3J3KT5P.js} +1 -1
  58. package/browser/{chunk-G5KKF5D7.js → chunk-URUVKPAB.js} +1 -1
  59. package/browser/{chunk-Y6ZXG57B.js → chunk-VAZRO2E6.js} +1 -1
  60. package/browser/chunk-VGJ6EDWD.js +1 -0
  61. package/browser/{chunk-2ZXGZWAV.js → chunk-VR6M3JBL.js} +1 -1
  62. package/browser/{chunk-LN2FL2NZ.js → chunk-VVIANPDG.js} +1 -1
  63. package/browser/{chunk-B52C6HPB.js → chunk-WKGWRMO2.js} +1 -1
  64. package/browser/{chunk-SCYP72MI.js → chunk-WLD23T7Q.js} +1 -1
  65. package/browser/{chunk-QWH7FCU6.js → chunk-WVU5HUMZ.js} +1 -1
  66. package/browser/{chunk-74LNWUT7.js → chunk-X3I26PYS.js} +1 -1
  67. package/browser/{chunk-OZNDPGO2.js → chunk-X3NWRG4U.js} +2 -2
  68. package/browser/{chunk-A5ANN35P.js → chunk-X4MTY5HS.js} +1 -1
  69. package/browser/{chunk-7Z4J6IB3.js → chunk-XNA3D2E7.js} +1 -1
  70. package/browser/{chunk-6S7EAWBA.js → chunk-Y2B6ZAXI.js} +2 -2
  71. package/browser/{chunk-QU62JM5V.js → chunk-YLH7XCUD.js} +1 -1
  72. package/browser/{chunk-A3XDE76F.js → chunk-YRZFNDFW.js} +1 -1
  73. package/browser/{chunk-O6NH4M23.js → chunk-Z7LZBNHM.js} +1 -1
  74. package/browser/index.html +2 -2
  75. package/browser/{main-ID5J3GGJ.js → main-2V5AVI54.js} +2 -2
  76. package/package.json +1 -1
  77. package/browser/chunk-DKAR5SKR.js +0 -1
@@ -1,4 +1,4 @@
1
- import{a as Hi}from"./chunk-6FWTWEKT.js";import{a as Gi}from"./chunk-33VUJMCJ.js";import{a as Oi,b as Wi}from"./chunk-7LHQ4DZG.js";import{b as Bi}from"./chunk-S2ZO4T7V.js";import{a as Ai}from"./chunk-SSX7RVMB.js";import{a as Qe}from"./chunk-ITEHBWAC.js";import{a as Ue}from"./chunk-Q5R2UJWA.js";import{a as ze}from"./chunk-SDCEXGQQ.js";import{a as ne,b as vi}from"./chunk-DPLLLOO5.js";import{a as ci}from"./chunk-EYCZLRFX.js";import"./chunk-J2YJ7UWM.js";import{a as ke,b as Ri}from"./chunk-JXKXAC3X.js";import{b as Li}from"./chunk-5Q5T67DH.js";import"./chunk-OLALZT3L.js";import"./chunk-IUVGWNPX.js";import"./chunk-6N4AU5UX.js";import{e as Pi}from"./chunk-5ZWOT4WG.js";import{b as fi}from"./chunk-WAWDDMQZ.js";import"./chunk-3RK6DDJD.js";import"./chunk-L2EDFSBR.js";import"./chunk-MUCQWTKH.js";import{a as Ni}from"./chunk-A6YCCT6G.js";import{p as pi,q as _i}from"./chunk-HSZIMZAT.js";import"./chunk-TEFNN3TY.js";import"./chunk-BRUTIHV5.js";import{e as hi}from"./chunk-Y2LBBMGV.js";import"./chunk-JKYTSC2D.js";import{a as Si}from"./chunk-KUUYZ5UQ.js";import{c as gi,d as Ee,e as ki}from"./chunk-PS4PFFPT.js";import{a as di}from"./chunk-VQ7WKMGF.js";import{a as Ui,b as Vi}from"./chunk-C73IEBHE.js";import{b as Fi}from"./chunk-KJ6NWQLT.js";import{b as Ci}from"./chunk-6QW64OSB.js";import{a as ri,b as li,c as si}from"./chunk-GXVV54HN.js";import{a as oe}from"./chunk-7RGCBUUG.js";import"./chunk-V4CJN6HP.js";import{c as bi}from"./chunk-A4CYZHDA.js";import"./chunk-3LBZWLLT.js";import"./chunk-X7G45LGM.js";import"./chunk-C6ARCDXZ.js";import"./chunk-FD5YMPRL.js";import"./chunk-MV3QRRW6.js";import"./chunk-6ZOGADBZ.js";import{a as wi,c as Me}from"./chunk-HA2GY7XU.js";import{h as U,i as Ei}from"./chunk-A5ANN35P.js";import"./chunk-IXKPLT63.js";import{a as qe,b as k}from"./chunk-6KKSOYUD.js";import"./chunk-52EOLV7I.js";import"./chunk-5UL73W4S.js";import{F as Ti,G as Mi,a as ai,e as mi,t as ui,w as xi}from"./chunk-7ARFB5UX.js";import{b as K,c as oi}from"./chunk-CIBQBSM6.js";import{O as Ii,P as je,o as Di}from"./chunk-5UCQBOD6.js";import"./chunk-ZT4RBJMM.js";import"./chunk-GIKR6Y2K.js";import{e as q}from"./chunk-VMY3JQDA.js";import{g as Te,l as yi}from"./chunk-D35OBUDE.js";import{ea as _t,l as ti,n as ii,y as ni}from"./chunk-567HXZXC.js";import"./chunk-UHJRDVRX.js";import"./chunk-CGESXTHC.js";import{a as T}from"./chunk-2FWFPV5I.js";import"./chunk-TLOTIYIE.js";import{D as Zt,E as $t,a as zt,b as De,c as ie,d as Qt,h as G,i as Xt,k as Yt,o as O,p as Kt,r as He,y as Ie,z as Jt}from"./chunk-P7HKWFZT.js";import{c as ei}from"./chunk-NZVEUXSI.js";import"./chunk-XRNWNUVG.js";import{a as ge,d as W}from"./chunk-AHCRE4GP.js";import"./chunk-PNUK526Z.js";import{$a as l,$b as Gt,Ac as Z,Bc as ee,Ca as It,Db as B,E as yt,Eb as Ut,Fa as pt,Fc as pe,Gb as Vt,Hb as Ft,Ib as n,Jb as o,K as he,Ka as Tt,Kb as v,Kc as Bt,Lb as we,Mb as xe,Mc as _e,Nc as Ht,Ob as w,Od as N,Pb as Pt,Qa as Mt,Qb as b,Qd as Y,Rb as m,Rd as L,Sb as Lt,Tb as Rt,Td as ut,Ub as Ce,V as mt,Va as Et,Vb as Pe,Vd as A,Wc as X,Y as wt,Yc as P,Yd as E,Zb as Nt,Zc as M,_b as At,aa as Oe,cd as Se,db as y,dc as z,ec as c,ed as te,fa as We,fc as x,gc as H,gd as qt,hc as Le,ia as xt,jc as g,jd as dt,k as ht,ka as ve,kb as D,kc as f,la as Ct,lb as be,lc as h,na as F,o as vt,ob as V,pc as Ot,qb as _,qc as I,rc as C,sc as Wt,t as Fe,u as bt,ua as St,ub as ye,va as d,vb as s,wa as u,wb as kt,wd as jt,xa as Dt,xb as ue,zb as Be,zc as R}from"./chunk-DZT5XHBQ.js";import{a as st,b as ct}from"./chunk-7DCB7DB2.js";function Zi(i,p){if(i&1){let e=w();n(0,"div",12)(1,"h6"),c(2,"User"),o(),n(3,"ng-select",13),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.pageData.Filter.ID,t)||(r.pageData.Filter.ID=t),u(t)}),o(),n(4,"h6"),c(5,"Type"),o(),n(6,"ng-select",14),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.pageData.Filter.LoginTypeID,t)||(r.pageData.Filter.LoginTypeID=t),u(t)}),o()()}if(i&2){let e=m(2);l(3),g("ngModel",e.pageData.Filter.ID),s("items",e.pageData.Options.User),l(3),g("ngModel",e.pageData.Filter.LoginTypeID),s("items",e.pageData.Options.LoginTypes)}}function $i(i,p){if(i&1&&(n(0,"tr",15)(1,"td"),c(2),o(),n(3,"td"),c(4),o(),n(5,"td"),c(6),o(),n(7,"td"),c(8),o(),n(9,"td"),c(10),R(11,"date"),o()()),i&2){let e=p.$implicit;l(2),x(e._source.log.LoginID),l(2),x(e._source.log.typeID),l(2),x(e._source.log.AppID?e._source.log.AppID:"-"),l(2),x(e._source.log.IP),l(2),x(ee(11,5,e._source["@timestamp"],"dd MMM yyyy HH:mm:ss"))}}function en(i,p){if(i&1){let e=w();n(0,"mat-paginator",16),b("page",function(t){d(e);let r=m(2);return u(r.onPaginationChange(t))}),o()}if(i&2){let e=m(2);s("length",e.pagination.listTotal)("pageSize",e.pagination.pageSize)("pageIndex",e.pageData.Filter.PageNumber==0?0:e.pageData.Filter.PageNumber-1)}}function tn(i,p){if(i&1){let e=w();n(0,"mainpanel-cmp",2),b("onSubmit",function(){d(e);let t=m();return u(t.searchFromPageOne())}),h("filterChange",function(t){d(e);let r=m();return f(r.pageData.Filter,t)||(r.pageData.Filter=t),u(t)}),n(1,"filters"),_(2,Zi,7,4,"ng-template",null,0,pe),o(),n(4,"content")(5,"div",3)(6,"div",4)(7,"table",5)(8,"thead",6)(9,"tr")(10,"th",7),c(11,"Login ID"),o(),n(12,"th",8),c(13,"Type"),o(),n(14,"th",8),c(15,"App ID"),o(),n(16,"th",8),c(17,"IP Address"),o(),n(18,"th",9),c(19,"Log In Time"),o()()(),n(20,"tbody"),_(21,$i,12,8,"tr",10),o()(),n(22,"div"),_(23,en,1,3,"mat-paginator",11),o()()()()()}if(i&2){let e=m();s("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),g("filter",e.pageData.Filter),l(21),s("ngForOf",e.data.hits),l(2),s("ngIf",e.pagination.listTotal>0)}}var Xe=class i extends oe{constructor(p,e){super(p,e,"user/user/LoginHistoryList","user/UserLoader/LoginHistoryList")}postInit(p){this.data.ListTotal=p.total.value}static \u0275fac=function(e){return new(e||i)(y(k),y(E))};static \u0275cmp=D({type:i,selectors:[["ng-component"]],standalone:!1,features:[V],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","250px"],[2,"width","170px"],[2,"width","110px"],["class","border-bottom",4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page",4,"ngIf"],[1,"dialog-filter"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose an User...",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose a Type...",3,"ngModelChange","ngModel","items"],[1,"border-bottom"],[3,"page","length","pageSize","pageIndex"]],template:function(e,a){e&1&&_(0,tn,24,6,"mainpanel-cmp",1),e&2&&s("ngIf",a.data)},dependencies:[P,M,U,G,O,ne,q,te],encapsulation:2})};var nn=()=>["/menu/Users/User/Users/Form"],on=i=>({ID:i});function an(i,p){if(i&1){let e=w();n(0,"div",10)(1,"h6"),c(2,"User"),o(),n(3,"autocompleteV2",11),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.pageData.Filter.UserID,t)||(r.pageData.Filter.UserID=t),u(t)}),o(),n(4,"h6"),c(5,"Row Count"),o(),n(6,"input",12),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.pageData.Filter.RowCount,t)||(r.pageData.Filter.RowCount=t),u(t)}),o()()}if(i&2){let e=m(2);l(3),g("ngModel",e.pageData.Filter.UserID),l(3),g("ngModel",e.pageData.Filter.RowCount),s("max",1e4)}}function rn(i,p){i&1&&(n(0,"th"),c(1,"User"),o())}function ln(i,p){if(i&1&&(n(0,"a",16),c(1),o()),i&2){let e=m(2).$implicit;s("routerLink",I(3,nn))("queryParams",C(4,on,e._source.log.parentId)),l(),x(e._source.log.username)}}function sn(i,p){if(i&1&&(n(0,"span"),c(1),o()),i&2){let e=m(2).$implicit;l(),x(e._source.log.username)}}function cn(i,p){if(i&1&&(n(0,"td"),_(1,ln,2,6,"a",15)(2,sn,2,1,"span",7),o()),i&2){let e=m(3);l(),s("ngIf",e.role.users.Edit),l(),s("ngIf",!e.role.users.Edit)}}function mn(i,p){if(i&1&&(n(0,"tr",13),_(1,cn,3,2,"td",7),n(2,"td"),c(3),R(4,"date"),o(),n(5,"td"),c(6),o(),v(7,"td",14),R(8,"newlines"),o()),i&2){let e=p.$implicit,a=m(2);l(),s("ngIf",a.data.showColumnUser),l(2),x(ee(4,4,e._source["@timestamp"],"dd MMM yyyy HH:mm")),l(3),x(e._source.log.creator),l(),s("innerHtml",Z(8,7,e._source.log.note),Et)}}function pn(i,p){if(i&1){let e=w();n(0,"mainpanel-cmp",2),h("textChange",function(t){d(e);let r=m();return f(r.pageData.Filter.Note,t)||(r.pageData.Filter.Note=t),u(t)}),b("onSubmit",function(){d(e);let t=m();return u(t.searchFromPageOne())}),h("filterChange",function(t){d(e);let r=m();return f(r.pageData.Filter,t)||(r.pageData.Filter=t),u(t)}),n(1,"filters"),_(2,an,7,3,"ng-template",null,0,pe),o(),n(4,"content")(5,"div",3)(6,"div",4)(7,"table",5)(8,"thead",6)(9,"tr"),_(10,rn,2,0,"th",7),n(11,"th"),c(12,"Modified"),o(),n(13,"th"),c(14,"Modify By"),o(),n(15,"th"),c(16,"Note"),o()()(),n(17,"tbody"),_(18,mn,9,9,"tr",8),o()(),n(19,"div")(20,"mat-paginator",9),b("page",function(t){d(e);let r=m();return u(r.onPaginationChange(t))}),o()()()()()()}if(i&2){let e=m();s("pageData",e.menuData),g("text",e.pageData.Filter.Note),s("isFilterOnDropdown",!1),g("filter",e.pageData.Filter),l(10),s("ngIf",e.data.showColumnUser),l(8),s("ngForOf",e.data.Data.hits),l(2),s("length",e.pagination.listTotal)("pageSize",e.pagination.pageSize)("pageIndex",e.pageData.Filter.PageNumber==0?0:e.pageData.Filter.PageNumber-1)}}var Ne=class i extends oe{constructor(e,a,t,r){super(e,a,"user/user/UpdateList","user/UserLoader/HistoryLoader",null,t);this.httpService=a;this.role=r}static \u0275fac=function(a){return new(a||i)(y(k),y(E),y(N),y(W))};static \u0275cmp=D({type:i,selectors:[["ng-component"]],standalone:!1,features:[V],decls:1,vars:1,consts:[["pageFilterTemplate",""],["searchBoxPlaceholder","Search Note...",3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],["searchBoxPlaceholder","Search Note...",3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],[1,"dialog-filter"],["requestUrl","/API/AC/GetUserSuggestion",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","ngModel","max"],[1,"border-bottom"],[3,"innerHtml"],[3,"routerLink","queryParams",4,"ngIf"],[3,"routerLink","queryParams"]],template:function(a,t){a&1&&_(0,pn,21,9,"mainpanel-cmp",1),a&2&&s("ngIf",t.data)},dependencies:[P,M,L,U,ie,G,O,ne,Me,Ti,te,Di],encapsulation:2})};var dn=()=>["/menu/Users/User/Groups"],un=i=>({selected:i}),_n=i=>({"border-top-0":i}),gn=(i,p)=>({"bg-gradient-warning":i,"border-top-0":p});function fn(i,p){i&1&&(n(0,"span",50),c(1," Name required."),o())}function hn(i,p){if(i&1){let e=w();we(0),n(1,"div",59)(2,"div",60)(3,"div",61)(4,"input",62),b("click",function(){let t=d(e).$implicit,r=m(4);return u(r.onSelectRole(t.ID))}),o()(),n(5,"label",63),c(6),o()()(),xe()}if(i&2){let e=p.$implicit,a=p.index,t=m().$implicit,r=m(3);l(2),s("matTooltip",t.Name==r.userGroupName&&r.data.LastGroupWithUserRole?"":e.Description),l(),s("ngClass",C(8,_n,a/4>=1)),l(),Ce("id",t.Name+a),s("disabled",t.Name==r.userGroupName&&r.data.LastGroupWithUserRole)("checked",r.formData.Roles.indexOf(e.ID)>-1),l(),Ce("for",t.Name+a),s("ngClass",Wt(10,gn,e.Type==1,a/4>=1)),l(),x(e.Model)}}function vn(i,p){if(i&1){let e=w();we(0),n(1,"div",68)(2,"div",69)(3,"div",70)(4,"input",71),b("click",function(){let t=d(e).$implicit,r=m(6);return u(r.onSelectRole(t.ID))}),o()(),n(5,"label",72),c(6),o()()(),xe()}if(i&2){let e=p.$implicit,a=m().index,t=m(5);l(4),Ce("id",e.Name+"more"+a),s("checked",t.formData.Roles.indexOf(e.ID)>-1),l(),Ce("for",e.Name+"more"+a),Ce("matTooltip",e.Description),l(),x(e.Model)}}function bn(i,p){if(i&1&&(we(0),n(1,"div",67),_(2,vn,7,5,"ng-container",36),o(),xe()),i&2){let e=p.$implicit;l(2),s("ngForOf",e)}}function yn(i,p){if(i&1&&(n(0,"div",64)(1,"a",65),c(2,"More Permission"),o(),n(3,"div",66)(4,"div",57),_(5,bn,3,1,"ng-container",36),o()()()),i&2){let e=m().index,a=m(3);l(5),s("ngForOf",a.listMorePermission[e])}}function wn(i,p){if(i&1){let e=w();n(0,"div",51)(1,"div",52)(2,"div",53)(3,"p",54),c(4),o(),n(5,"input",55),b("change",function(t){let r=d(e).$implicit,S=m(3);return u(S.selectGroupRole(t.target.checked,r.ID))}),o()()(),n(6,"div",56)(7,"div",57),_(8,hn,7,13,"ng-container",36),o(),_(9,yn,6,1,"div",58),o()()}if(i&2){let e=p.$implicit,a=m(3);s("matTooltip",e.Name==a.userGroupName&&a.data.LastGroupWithUserRole?"You cannot edit this section because this Group is the last group with User Access":""),l(4),H(" ",e.Name," "),l(),s("disabled",e.Name==a.userGroupName&&a.data.LastGroupWithUserRole),l(3),s("ngForOf",e.ListRole),l(),s("ngIf",(e.ListMorePermission==null?null:e.ListMorePermission.length)>0)}}function xn(i,p){if(i&1){let e=w();n(0,"tr")(1,"td"),c(2),o(),n(3,"td",73)(4,"input",74),h("ngModelChange",function(t){let r=d(e).$implicit;return f(r.AccessTypeID,t)||(r.AccessTypeID=t),u(t)}),o()(),n(5,"td",73)(6,"input",74),h("ngModelChange",function(t){let r=d(e).$implicit;return f(r.AccessTypeID,t)||(r.AccessTypeID=t),u(t)}),o()(),n(7,"td",73)(8,"input",74),h("ngModelChange",function(t){let r=d(e).$implicit;return f(r.AccessTypeID,t)||(r.AccessTypeID=t),u(t)}),o()(),n(9,"td",73)(10,"input",74),h("ngModelChange",function(t){let r=d(e).$implicit;return f(r.AccessTypeID,t)||(r.AccessTypeID=t),u(t)}),o()()()}if(i&2){let e=p.$implicit,a=p.index;l(2),x(e.Name),l(2),Pe("name","noaccess",a,""),g("ngModel",e.AccessTypeID),s("value",0),l(2),Pe("name","peek",a,""),g("ngModel",e.AccessTypeID),s("value",1),l(2),Pe("name","read",a,""),g("ngModel",e.AccessTypeID),s("value",2),l(2),Pe("name","write",a,""),g("ngModel",e.AccessTypeID),s("value",3)}}function Cn(i,p){if(i&1){let e=w();n(0,"div",6)(1,"div",7)(2,"div",8)(3,"div",9)(4,"input",10,0),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.formData.Group.Name,t)||(r.formData.Group.Name=t),u(t)}),o(),n(6,"label",11),c(7,"Group Name"),o(),_(8,fn,2,0,"span",12),o(),n(9,"ul",13)(10,"li",14)(11,"button",15),c(12," Permission "),o()(),n(13,"li",14)(14,"button",16),c(15," Outlet "),o()(),n(16,"li",14)(17,"button",17),c(18," Description "),o()(),n(19,"li",14)(20,"button",18),c(21," Restriction "),o()()(),n(22,"div",19)(23,"div",20),_(24,wn,10,5,"div",21),o(),n(25,"div",22)(26,"div",23)(27,"table",24)(28,"thead",25)(29,"tr")(30,"th",26),c(31,"Name"),o(),n(32,"th",27)(33,"span",28),c(34,"No Access"),o(),n(35,"input",29),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.checkAll,t)||(r.checkAll=t),u(t)}),b("change",function(){d(e);let t=m(2);return u(t.SelectAll(t.checkAll,t.formData.Outlets))}),o()(),n(36,"th",30)(37,"span",28),c(38,"Peek"),o(),n(39,"input",31),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.checkAll,t)||(r.checkAll=t),u(t)}),b("change",function(){d(e);let t=m(2);return u(t.SelectAll(t.checkAll,t.formData.Outlets))}),o()(),n(40,"th",32)(41,"span",28),c(42,"Read"),o(),n(43,"input",33),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.checkAll,t)||(r.checkAll=t),u(t)}),b("change",function(){d(e);let t=m(2);return u(t.SelectAll(t.checkAll,t.formData.Outlets))}),o()(),n(44,"th",34)(45,"span",28),c(46,"Write"),o(),n(47,"input",35),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.checkAll,t)||(r.checkAll=t),u(t)}),b("change",function(){d(e);let t=m(2);return u(t.SelectAll(t.checkAll,t.formData.Outlets))}),o()()()(),n(48,"tbody"),_(49,xn,11,17,"tr",36),o()()()(),n(50,"div",37)(51,"div",7)(52,"div",38)(53,"div",9)(54,"textarea",39),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.formData.Group.Description,t)||(r.formData.Group.Description=t),u(t)}),c(55," "),o(),n(56,"label",40),c(57,"Description"),o()()()()(),n(58,"div",41)(59,"div",7)(60,"div",42)(61,"div",9)(62,"input",43),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.formData.Group.DataDaysRange,t)||(r.formData.Group.DataDaysRange=t),u(t)}),o(),n(63,"label",44),c(64,"Data Days Range"),o()()(),n(65,"div",42)(66,"div",45)(67,"label"),c(68,"Live Chat Enabled"),o(),n(69,"radio-options",46),h("modelChange",function(t){d(e);let r=m(2);return f(r.formData.Group.LiveChatEnabled,t)||(r.formData.Group.LiveChatEnabled=t),u(t)}),o()()()(),n(70,"div",7)(71,"div",42)(72,"div",47)(73,"ng-select",48),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.formData.Group.BrandID,t)||(r.formData.Group.BrandID=t),u(t)}),o(),n(74,"label",49),c(75,"Brand"),o()()()()()()()()()}if(i&2){let e=z(5),a=m(2);l(4),g("ngModel",a.formData.Group.Name),l(4),s("ngIf",e.invalid&&(e.dirty||e.touched)),l(16),s("ngForOf",a.options),l(11),g("ngModel",a.checkAll),s("value",0),l(4),g("ngModel",a.checkAll),s("value",1),l(4),g("ngModel",a.checkAll),s("value",2),l(4),g("ngModel",a.checkAll),s("value",3),l(2),s("ngForOf",a.formData.Outlets),l(5),g("ngModel",a.formData.Group.Description),l(8),g("ngModel",a.formData.Group.DataDaysRange),l(7),g("model",a.formData.Group.LiveChatEnabled),l(3),s("ngClass",C(18,un,a.formData.Group.BrandID)),l(),g("ngModel",a.formData.Group.BrandID),s("items",a.Brands)}}function Sn(i,p){if(i&1){let e=w();n(0,"mainpanel-cmp",2)(1,"actions")(2,"a",3),c(3,"Cancel"),o(),n(4,"button",4),b("click",function(){d(e);let t=m();return u(t.onSubmitForm())}),c(5," Submit "),o()(),n(6,"content"),_(7,Cn,76,20,"div",5),o()()}if(i&2){let e=m();s("pageData",e.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),s("routerLink",I(5,dn)),l(5),s("ngIf",e.formData.Group)}}var Ke=class i extends Ue{constructor(e,a,t,r,S,$,j,J){super(e,a,"User/GroupLoader/Form",t);this.toaster=r;this.router=S;this.actRoute=$;this.dataDaysRangeService=j;this.authService=J}checkAll=-1;listMorePermission=[];Brands=[];userGroupName="Users";onSelectRole(e){var a=this.formData.Roles.indexOf(e);a>-1?this.formData.Roles.splice(a,1):this.formData.Roles.push(e)}selectGroupRole(e,a){let t=this.options.find(r=>r.ID==a);if(t){let r=t.ListRole.map(j=>j.ID),S=t.ListMorePermission.map(j=>j.ID),$=[...r,...S];e?(this.formData.Roles=[...this.formData.Roles,...$],this.formData.Roles=this.formData.Roles.filter((j,J,fe)=>fe.indexOf(j)==J)):this.formData.Roles=this.formData.Roles.filter(j=>$.findIndex(J=>J==j)==-1)}}postBindForm(e){e.Form.Group.Name&&(this.menuData.H=`Edit Group - ${e.Form.Group.Name}`),this.Brands=e.Brands,this.setListMorePermission()}onSubmitForm(){if(ge.IsEmpty(this.formData.Group.Name)){this.toaster.error("Group name is required",T.Error);return}this.onSubmit("user/group/Submit")}onSubmitSuccess(e){this.refreshToken(),this.saveDataDaysRange(e.DataDaysRange),this.dataDaysRangeService.bindDataDaysRange();let a=this.actRoute.snapshot.queryParams;ge.IsEmpty(a.ID)?this.toaster.success("Success add group",T.Success):this.toaster.info(`
1
+ import{a as Hi}from"./chunk-6FWTWEKT.js";import{a as Gi}from"./chunk-33VUJMCJ.js";import{a as Oi,b as Wi}from"./chunk-7LHQ4DZG.js";import{b as Bi}from"./chunk-S2ZO4T7V.js";import{a as Ai}from"./chunk-SSX7RVMB.js";import{a as Qe}from"./chunk-ITEHBWAC.js";import{a as Ue}from"./chunk-BKS3I5O7.js";import{a as ze}from"./chunk-SDCEXGQQ.js";import{a as ne,b as vi}from"./chunk-DPLLLOO5.js";import{a as ci}from"./chunk-EYCZLRFX.js";import"./chunk-J2YJ7UWM.js";import{a as ke,b as Ri}from"./chunk-JXKXAC3X.js";import{b as Li}from"./chunk-5Q5T67DH.js";import"./chunk-OLALZT3L.js";import"./chunk-IUVGWNPX.js";import"./chunk-6N4AU5UX.js";import{e as Pi}from"./chunk-5ZWOT4WG.js";import{b as fi}from"./chunk-WAWDDMQZ.js";import"./chunk-3RK6DDJD.js";import"./chunk-L2EDFSBR.js";import"./chunk-MUCQWTKH.js";import{a as Ni}from"./chunk-A6YCCT6G.js";import{p as pi,q as _i}from"./chunk-HSZIMZAT.js";import"./chunk-TEFNN3TY.js";import"./chunk-BRUTIHV5.js";import{e as hi}from"./chunk-Y2LBBMGV.js";import"./chunk-JKYTSC2D.js";import{a as Si}from"./chunk-KUUYZ5UQ.js";import{c as gi,d as Ee,e as ki}from"./chunk-PS4PFFPT.js";import{a as di}from"./chunk-VQ7WKMGF.js";import{a as Ui,b as Vi}from"./chunk-C73IEBHE.js";import{b as Fi}from"./chunk-KJ6NWQLT.js";import{b as Ci}from"./chunk-6QW64OSB.js";import{a as ri,b as li,c as si}from"./chunk-GXVV54HN.js";import{a as oe}from"./chunk-PBNWYWYT.js";import"./chunk-56WYLSRZ.js";import{c as bi}from"./chunk-A4CYZHDA.js";import"./chunk-3LBZWLLT.js";import"./chunk-X7G45LGM.js";import"./chunk-C6ARCDXZ.js";import"./chunk-FD5YMPRL.js";import"./chunk-MV3QRRW6.js";import"./chunk-6ZOGADBZ.js";import{a as wi,c as Me}from"./chunk-HA2GY7XU.js";import{h as U,i as Ei}from"./chunk-X4MTY5HS.js";import"./chunk-T4OLDAMN.js";import{a as qe,b as k}from"./chunk-CQVVIZJ7.js";import"./chunk-52EOLV7I.js";import"./chunk-5UL73W4S.js";import{F as Ti,G as Mi,a as ai,e as mi,t as ui,w as xi}from"./chunk-7ARFB5UX.js";import{b as K,c as oi}from"./chunk-CIBQBSM6.js";import{O as Ii,P as je,o as Di}from"./chunk-5UCQBOD6.js";import"./chunk-ZT4RBJMM.js";import"./chunk-GIKR6Y2K.js";import{e as q}from"./chunk-VMY3JQDA.js";import{g as Te,l as yi}from"./chunk-D35OBUDE.js";import{ea as _t,l as ti,n as ii,y as ni}from"./chunk-567HXZXC.js";import"./chunk-UHJRDVRX.js";import"./chunk-CGESXTHC.js";import{a as T}from"./chunk-2FWFPV5I.js";import"./chunk-TLOTIYIE.js";import{D as Zt,E as $t,a as zt,b as De,c as ie,d as Qt,h as G,i as Xt,k as Yt,o as O,p as Kt,r as He,y as Ie,z as Jt}from"./chunk-P7HKWFZT.js";import{c as ei}from"./chunk-RZ4V7O3L.js";import"./chunk-GR3EU2XL.js";import{a as ge,d as W}from"./chunk-AHCRE4GP.js";import"./chunk-CRTHBX5Z.js";import{$a as l,$b as Gt,Ac as Z,Bc as ee,Ca as It,Db as B,E as yt,Eb as Ut,Fa as pt,Fc as pe,Gb as Vt,Hb as Ft,Ib as n,Jb as o,K as he,Ka as Tt,Kb as v,Kc as Bt,Lb as we,Mb as xe,Mc as _e,Nc as Ht,Ob as w,Od as N,Pb as Pt,Qa as Mt,Qb as b,Qd as Y,Rb as m,Rd as L,Sb as Lt,Tb as Rt,Td as ut,Ub as Ce,V as mt,Va as Et,Vb as Pe,Vd as A,Wc as X,Y as wt,Yc as P,Yd as E,Zb as Nt,Zc as M,_b as At,aa as Oe,cd as Se,db as y,dc as z,ec as c,ed as te,fa as We,fc as x,gc as H,gd as qt,hc as Le,ia as xt,jc as g,jd as dt,k as ht,ka as ve,kb as D,kc as f,la as Ct,lb as be,lc as h,na as F,o as vt,ob as V,pc as Ot,qb as _,qc as I,rc as C,sc as Wt,t as Fe,u as bt,ua as St,ub as ye,va as d,vb as s,wa as u,wb as kt,wd as jt,xa as Dt,xb as ue,zb as Be,zc as R}from"./chunk-DZT5XHBQ.js";import{a as st,b as ct}from"./chunk-7DCB7DB2.js";function Zi(i,p){if(i&1){let e=w();n(0,"div",12)(1,"h6"),c(2,"User"),o(),n(3,"ng-select",13),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.pageData.Filter.ID,t)||(r.pageData.Filter.ID=t),u(t)}),o(),n(4,"h6"),c(5,"Type"),o(),n(6,"ng-select",14),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.pageData.Filter.LoginTypeID,t)||(r.pageData.Filter.LoginTypeID=t),u(t)}),o()()}if(i&2){let e=m(2);l(3),g("ngModel",e.pageData.Filter.ID),s("items",e.pageData.Options.User),l(3),g("ngModel",e.pageData.Filter.LoginTypeID),s("items",e.pageData.Options.LoginTypes)}}function $i(i,p){if(i&1&&(n(0,"tr",15)(1,"td"),c(2),o(),n(3,"td"),c(4),o(),n(5,"td"),c(6),o(),n(7,"td"),c(8),o(),n(9,"td"),c(10),R(11,"date"),o()()),i&2){let e=p.$implicit;l(2),x(e._source.log.LoginID),l(2),x(e._source.log.typeID),l(2),x(e._source.log.AppID?e._source.log.AppID:"-"),l(2),x(e._source.log.IP),l(2),x(ee(11,5,e._source["@timestamp"],"dd MMM yyyy HH:mm:ss"))}}function en(i,p){if(i&1){let e=w();n(0,"mat-paginator",16),b("page",function(t){d(e);let r=m(2);return u(r.onPaginationChange(t))}),o()}if(i&2){let e=m(2);s("length",e.pagination.listTotal)("pageSize",e.pagination.pageSize)("pageIndex",e.pageData.Filter.PageNumber==0?0:e.pageData.Filter.PageNumber-1)}}function tn(i,p){if(i&1){let e=w();n(0,"mainpanel-cmp",2),b("onSubmit",function(){d(e);let t=m();return u(t.searchFromPageOne())}),h("filterChange",function(t){d(e);let r=m();return f(r.pageData.Filter,t)||(r.pageData.Filter=t),u(t)}),n(1,"filters"),_(2,Zi,7,4,"ng-template",null,0,pe),o(),n(4,"content")(5,"div",3)(6,"div",4)(7,"table",5)(8,"thead",6)(9,"tr")(10,"th",7),c(11,"Login ID"),o(),n(12,"th",8),c(13,"Type"),o(),n(14,"th",8),c(15,"App ID"),o(),n(16,"th",8),c(17,"IP Address"),o(),n(18,"th",9),c(19,"Log In Time"),o()()(),n(20,"tbody"),_(21,$i,12,8,"tr",10),o()(),n(22,"div"),_(23,en,1,3,"mat-paginator",11),o()()()()()}if(i&2){let e=m();s("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),g("filter",e.pageData.Filter),l(21),s("ngForOf",e.data.hits),l(2),s("ngIf",e.pagination.listTotal>0)}}var Xe=class i extends oe{constructor(p,e){super(p,e,"user/user/LoginHistoryList","user/UserLoader/LoginHistoryList")}postInit(p){this.data.ListTotal=p.total.value}static \u0275fac=function(e){return new(e||i)(y(k),y(E))};static \u0275cmp=D({type:i,selectors:[["ng-component"]],standalone:!1,features:[V],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","250px"],[2,"width","170px"],[2,"width","110px"],["class","border-bottom",4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page",4,"ngIf"],[1,"dialog-filter"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose an User...",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose a Type...",3,"ngModelChange","ngModel","items"],[1,"border-bottom"],[3,"page","length","pageSize","pageIndex"]],template:function(e,a){e&1&&_(0,tn,24,6,"mainpanel-cmp",1),e&2&&s("ngIf",a.data)},dependencies:[P,M,U,G,O,ne,q,te],encapsulation:2})};var nn=()=>["/menu/Users/User/Users/Form"],on=i=>({ID:i});function an(i,p){if(i&1){let e=w();n(0,"div",10)(1,"h6"),c(2,"User"),o(),n(3,"autocompleteV2",11),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.pageData.Filter.UserID,t)||(r.pageData.Filter.UserID=t),u(t)}),o(),n(4,"h6"),c(5,"Row Count"),o(),n(6,"input",12),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.pageData.Filter.RowCount,t)||(r.pageData.Filter.RowCount=t),u(t)}),o()()}if(i&2){let e=m(2);l(3),g("ngModel",e.pageData.Filter.UserID),l(3),g("ngModel",e.pageData.Filter.RowCount),s("max",1e4)}}function rn(i,p){i&1&&(n(0,"th"),c(1,"User"),o())}function ln(i,p){if(i&1&&(n(0,"a",16),c(1),o()),i&2){let e=m(2).$implicit;s("routerLink",I(3,nn))("queryParams",C(4,on,e._source.log.parentId)),l(),x(e._source.log.username)}}function sn(i,p){if(i&1&&(n(0,"span"),c(1),o()),i&2){let e=m(2).$implicit;l(),x(e._source.log.username)}}function cn(i,p){if(i&1&&(n(0,"td"),_(1,ln,2,6,"a",15)(2,sn,2,1,"span",7),o()),i&2){let e=m(3);l(),s("ngIf",e.role.users.Edit),l(),s("ngIf",!e.role.users.Edit)}}function mn(i,p){if(i&1&&(n(0,"tr",13),_(1,cn,3,2,"td",7),n(2,"td"),c(3),R(4,"date"),o(),n(5,"td"),c(6),o(),v(7,"td",14),R(8,"newlines"),o()),i&2){let e=p.$implicit,a=m(2);l(),s("ngIf",a.data.showColumnUser),l(2),x(ee(4,4,e._source["@timestamp"],"dd MMM yyyy HH:mm")),l(3),x(e._source.log.creator),l(),s("innerHtml",Z(8,7,e._source.log.note),Et)}}function pn(i,p){if(i&1){let e=w();n(0,"mainpanel-cmp",2),h("textChange",function(t){d(e);let r=m();return f(r.pageData.Filter.Note,t)||(r.pageData.Filter.Note=t),u(t)}),b("onSubmit",function(){d(e);let t=m();return u(t.searchFromPageOne())}),h("filterChange",function(t){d(e);let r=m();return f(r.pageData.Filter,t)||(r.pageData.Filter=t),u(t)}),n(1,"filters"),_(2,an,7,3,"ng-template",null,0,pe),o(),n(4,"content")(5,"div",3)(6,"div",4)(7,"table",5)(8,"thead",6)(9,"tr"),_(10,rn,2,0,"th",7),n(11,"th"),c(12,"Modified"),o(),n(13,"th"),c(14,"Modify By"),o(),n(15,"th"),c(16,"Note"),o()()(),n(17,"tbody"),_(18,mn,9,9,"tr",8),o()(),n(19,"div")(20,"mat-paginator",9),b("page",function(t){d(e);let r=m();return u(r.onPaginationChange(t))}),o()()()()()()}if(i&2){let e=m();s("pageData",e.menuData),g("text",e.pageData.Filter.Note),s("isFilterOnDropdown",!1),g("filter",e.pageData.Filter),l(10),s("ngIf",e.data.showColumnUser),l(8),s("ngForOf",e.data.Data.hits),l(2),s("length",e.pagination.listTotal)("pageSize",e.pagination.pageSize)("pageIndex",e.pageData.Filter.PageNumber==0?0:e.pageData.Filter.PageNumber-1)}}var Ne=class i extends oe{constructor(e,a,t,r){super(e,a,"user/user/UpdateList","user/UserLoader/HistoryLoader",null,t);this.httpService=a;this.role=r}static \u0275fac=function(a){return new(a||i)(y(k),y(E),y(N),y(W))};static \u0275cmp=D({type:i,selectors:[["ng-component"]],standalone:!1,features:[V],decls:1,vars:1,consts:[["pageFilterTemplate",""],["searchBoxPlaceholder","Search Note...",3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],["searchBoxPlaceholder","Search Note...",3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],[1,"dialog-filter"],["requestUrl","/API/AC/GetUserSuggestion",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","ngModel","max"],[1,"border-bottom"],[3,"innerHtml"],[3,"routerLink","queryParams",4,"ngIf"],[3,"routerLink","queryParams"]],template:function(a,t){a&1&&_(0,pn,21,9,"mainpanel-cmp",1),a&2&&s("ngIf",t.data)},dependencies:[P,M,L,U,ie,G,O,ne,Me,Ti,te,Di],encapsulation:2})};var dn=()=>["/menu/Users/User/Groups"],un=i=>({selected:i}),_n=i=>({"border-top-0":i}),gn=(i,p)=>({"bg-gradient-warning":i,"border-top-0":p});function fn(i,p){i&1&&(n(0,"span",50),c(1," Name required."),o())}function hn(i,p){if(i&1){let e=w();we(0),n(1,"div",59)(2,"div",60)(3,"div",61)(4,"input",62),b("click",function(){let t=d(e).$implicit,r=m(4);return u(r.onSelectRole(t.ID))}),o()(),n(5,"label",63),c(6),o()()(),xe()}if(i&2){let e=p.$implicit,a=p.index,t=m().$implicit,r=m(3);l(2),s("matTooltip",t.Name==r.userGroupName&&r.data.LastGroupWithUserRole?"":e.Description),l(),s("ngClass",C(8,_n,a/4>=1)),l(),Ce("id",t.Name+a),s("disabled",t.Name==r.userGroupName&&r.data.LastGroupWithUserRole)("checked",r.formData.Roles.indexOf(e.ID)>-1),l(),Ce("for",t.Name+a),s("ngClass",Wt(10,gn,e.Type==1,a/4>=1)),l(),x(e.Model)}}function vn(i,p){if(i&1){let e=w();we(0),n(1,"div",68)(2,"div",69)(3,"div",70)(4,"input",71),b("click",function(){let t=d(e).$implicit,r=m(6);return u(r.onSelectRole(t.ID))}),o()(),n(5,"label",72),c(6),o()()(),xe()}if(i&2){let e=p.$implicit,a=m().index,t=m(5);l(4),Ce("id",e.Name+"more"+a),s("checked",t.formData.Roles.indexOf(e.ID)>-1),l(),Ce("for",e.Name+"more"+a),Ce("matTooltip",e.Description),l(),x(e.Model)}}function bn(i,p){if(i&1&&(we(0),n(1,"div",67),_(2,vn,7,5,"ng-container",36),o(),xe()),i&2){let e=p.$implicit;l(2),s("ngForOf",e)}}function yn(i,p){if(i&1&&(n(0,"div",64)(1,"a",65),c(2,"More Permission"),o(),n(3,"div",66)(4,"div",57),_(5,bn,3,1,"ng-container",36),o()()()),i&2){let e=m().index,a=m(3);l(5),s("ngForOf",a.listMorePermission[e])}}function wn(i,p){if(i&1){let e=w();n(0,"div",51)(1,"div",52)(2,"div",53)(3,"p",54),c(4),o(),n(5,"input",55),b("change",function(t){let r=d(e).$implicit,S=m(3);return u(S.selectGroupRole(t.target.checked,r.ID))}),o()()(),n(6,"div",56)(7,"div",57),_(8,hn,7,13,"ng-container",36),o(),_(9,yn,6,1,"div",58),o()()}if(i&2){let e=p.$implicit,a=m(3);s("matTooltip",e.Name==a.userGroupName&&a.data.LastGroupWithUserRole?"You cannot edit this section because this Group is the last group with User Access":""),l(4),H(" ",e.Name," "),l(),s("disabled",e.Name==a.userGroupName&&a.data.LastGroupWithUserRole),l(3),s("ngForOf",e.ListRole),l(),s("ngIf",(e.ListMorePermission==null?null:e.ListMorePermission.length)>0)}}function xn(i,p){if(i&1){let e=w();n(0,"tr")(1,"td"),c(2),o(),n(3,"td",73)(4,"input",74),h("ngModelChange",function(t){let r=d(e).$implicit;return f(r.AccessTypeID,t)||(r.AccessTypeID=t),u(t)}),o()(),n(5,"td",73)(6,"input",74),h("ngModelChange",function(t){let r=d(e).$implicit;return f(r.AccessTypeID,t)||(r.AccessTypeID=t),u(t)}),o()(),n(7,"td",73)(8,"input",74),h("ngModelChange",function(t){let r=d(e).$implicit;return f(r.AccessTypeID,t)||(r.AccessTypeID=t),u(t)}),o()(),n(9,"td",73)(10,"input",74),h("ngModelChange",function(t){let r=d(e).$implicit;return f(r.AccessTypeID,t)||(r.AccessTypeID=t),u(t)}),o()()()}if(i&2){let e=p.$implicit,a=p.index;l(2),x(e.Name),l(2),Pe("name","noaccess",a,""),g("ngModel",e.AccessTypeID),s("value",0),l(2),Pe("name","peek",a,""),g("ngModel",e.AccessTypeID),s("value",1),l(2),Pe("name","read",a,""),g("ngModel",e.AccessTypeID),s("value",2),l(2),Pe("name","write",a,""),g("ngModel",e.AccessTypeID),s("value",3)}}function Cn(i,p){if(i&1){let e=w();n(0,"div",6)(1,"div",7)(2,"div",8)(3,"div",9)(4,"input",10,0),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.formData.Group.Name,t)||(r.formData.Group.Name=t),u(t)}),o(),n(6,"label",11),c(7,"Group Name"),o(),_(8,fn,2,0,"span",12),o(),n(9,"ul",13)(10,"li",14)(11,"button",15),c(12," Permission "),o()(),n(13,"li",14)(14,"button",16),c(15," Outlet "),o()(),n(16,"li",14)(17,"button",17),c(18," Description "),o()(),n(19,"li",14)(20,"button",18),c(21," Restriction "),o()()(),n(22,"div",19)(23,"div",20),_(24,wn,10,5,"div",21),o(),n(25,"div",22)(26,"div",23)(27,"table",24)(28,"thead",25)(29,"tr")(30,"th",26),c(31,"Name"),o(),n(32,"th",27)(33,"span",28),c(34,"No Access"),o(),n(35,"input",29),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.checkAll,t)||(r.checkAll=t),u(t)}),b("change",function(){d(e);let t=m(2);return u(t.SelectAll(t.checkAll,t.formData.Outlets))}),o()(),n(36,"th",30)(37,"span",28),c(38,"Peek"),o(),n(39,"input",31),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.checkAll,t)||(r.checkAll=t),u(t)}),b("change",function(){d(e);let t=m(2);return u(t.SelectAll(t.checkAll,t.formData.Outlets))}),o()(),n(40,"th",32)(41,"span",28),c(42,"Read"),o(),n(43,"input",33),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.checkAll,t)||(r.checkAll=t),u(t)}),b("change",function(){d(e);let t=m(2);return u(t.SelectAll(t.checkAll,t.formData.Outlets))}),o()(),n(44,"th",34)(45,"span",28),c(46,"Write"),o(),n(47,"input",35),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.checkAll,t)||(r.checkAll=t),u(t)}),b("change",function(){d(e);let t=m(2);return u(t.SelectAll(t.checkAll,t.formData.Outlets))}),o()()()(),n(48,"tbody"),_(49,xn,11,17,"tr",36),o()()()(),n(50,"div",37)(51,"div",7)(52,"div",38)(53,"div",9)(54,"textarea",39),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.formData.Group.Description,t)||(r.formData.Group.Description=t),u(t)}),c(55," "),o(),n(56,"label",40),c(57,"Description"),o()()()()(),n(58,"div",41)(59,"div",7)(60,"div",42)(61,"div",9)(62,"input",43),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.formData.Group.DataDaysRange,t)||(r.formData.Group.DataDaysRange=t),u(t)}),o(),n(63,"label",44),c(64,"Data Days Range"),o()()(),n(65,"div",42)(66,"div",45)(67,"label"),c(68,"Live Chat Enabled"),o(),n(69,"radio-options",46),h("modelChange",function(t){d(e);let r=m(2);return f(r.formData.Group.LiveChatEnabled,t)||(r.formData.Group.LiveChatEnabled=t),u(t)}),o()()()(),n(70,"div",7)(71,"div",42)(72,"div",47)(73,"ng-select",48),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.formData.Group.BrandID,t)||(r.formData.Group.BrandID=t),u(t)}),o(),n(74,"label",49),c(75,"Brand"),o()()()()()()()()()}if(i&2){let e=z(5),a=m(2);l(4),g("ngModel",a.formData.Group.Name),l(4),s("ngIf",e.invalid&&(e.dirty||e.touched)),l(16),s("ngForOf",a.options),l(11),g("ngModel",a.checkAll),s("value",0),l(4),g("ngModel",a.checkAll),s("value",1),l(4),g("ngModel",a.checkAll),s("value",2),l(4),g("ngModel",a.checkAll),s("value",3),l(2),s("ngForOf",a.formData.Outlets),l(5),g("ngModel",a.formData.Group.Description),l(8),g("ngModel",a.formData.Group.DataDaysRange),l(7),g("model",a.formData.Group.LiveChatEnabled),l(3),s("ngClass",C(18,un,a.formData.Group.BrandID)),l(),g("ngModel",a.formData.Group.BrandID),s("items",a.Brands)}}function Sn(i,p){if(i&1){let e=w();n(0,"mainpanel-cmp",2)(1,"actions")(2,"a",3),c(3,"Cancel"),o(),n(4,"button",4),b("click",function(){d(e);let t=m();return u(t.onSubmitForm())}),c(5," Submit "),o()(),n(6,"content"),_(7,Cn,76,20,"div",5),o()()}if(i&2){let e=m();s("pageData",e.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),s("routerLink",I(5,dn)),l(5),s("ngIf",e.formData.Group)}}var Ke=class i extends Ue{constructor(e,a,t,r,S,$,j,J){super(e,a,"User/GroupLoader/Form",t);this.toaster=r;this.router=S;this.actRoute=$;this.dataDaysRangeService=j;this.authService=J}checkAll=-1;listMorePermission=[];Brands=[];userGroupName="Users";onSelectRole(e){var a=this.formData.Roles.indexOf(e);a>-1?this.formData.Roles.splice(a,1):this.formData.Roles.push(e)}selectGroupRole(e,a){let t=this.options.find(r=>r.ID==a);if(t){let r=t.ListRole.map(j=>j.ID),S=t.ListMorePermission.map(j=>j.ID),$=[...r,...S];e?(this.formData.Roles=[...this.formData.Roles,...$],this.formData.Roles=this.formData.Roles.filter((j,J,fe)=>fe.indexOf(j)==J)):this.formData.Roles=this.formData.Roles.filter(j=>$.findIndex(J=>J==j)==-1)}}postBindForm(e){e.Form.Group.Name&&(this.menuData.H=`Edit Group - ${e.Form.Group.Name}`),this.Brands=e.Brands,this.setListMorePermission()}onSubmitForm(){if(ge.IsEmpty(this.formData.Group.Name)){this.toaster.error("Group name is required",T.Error);return}this.onSubmit("user/group/Submit")}onSubmitSuccess(e){this.refreshToken(),this.saveDataDaysRange(e.DataDaysRange),this.dataDaysRangeService.bindDataDaysRange();let a=this.actRoute.snapshot.queryParams;ge.IsEmpty(a.ID)?this.toaster.success("Success add group",T.Success):this.toaster.info(`
2
2
  The user group has been updated.<br/>
3
3
  Please reload to apply the changes.
4
4
  `,T.Info,{enableHtml:!0}),this.router.navigate(["/menu/Users/User/Groups"])}saveDataDaysRange(e){localStorage.setItem("DataDaysRange",JSON.stringify(e))}setListMorePermission(){this.data.Options.forEach((a,t)=>{this.listMorePermission[t]=this.generateListPermission(a.ListMorePermission)})}generateListPermission(e){let a=[];return e.forEach(t=>{a.length==0?a[a.length]=[t]:a[a.length-1].length<=7?a[a.length-1].push(t):a[a.length]=[t]}),a}refreshToken(){this.data?.IsSameGroup&&this.authService.refreshToken()}SelectAll(e,a){a.forEach(function(t){t.AccessTypeID=e})}static \u0275fac=function(a){return new(a||i)(y(k),y(E),y(N),y(A),y(Y),y(N),y(Gi),y(ei))};static \u0275cmp=D({type:i,selectors:[["CustomerDisplay-groups-form"]],standalone:!1,features:[V],decls:1,vars:1,consts:[["roleName","ngModel"],[3,"pageData","hideSearchDropdown","hideSearchBox",4,"ngIf"],[3,"pageData","hideSearchDropdown","hideSearchBox"],["role","button",1,"btn","btn-outline-secondary","me-5",3,"routerLink"],["type","button","role","button",1,"btn","btn-success",3,"click"],["class","container-fluid p-10",4,"ngIf"],[1,"container-fluid","p-10"],[1,"row"],[1,"col"],[1,"form-floating-outline"],["type","text","id","groupName","name","grpName","placeholder","Group Name","autofocus","","required","",1,"form-control",3,"ngModelChange","ngModel"],["for","groupName"],["class","control-label text-danger border-0",4,"ngIf"],["id","myTabs","role","tablist",1,"nav","nav-tabs"],[1,"nav-item"],["id","permission-tab","data-bs-toggle","tab","data-bs-target","#permission","role","tab","aria-selected","true",1,"nav-link","active"],["id","outlet-tab","data-bs-toggle","tab","data-bs-target","#outlet","role","tab","aria-selected","false",1,"nav-link"],["id","description-tab","data-bs-toggle","tab","data-bs-target","#description","role","tab","aria-selected","false",1,"nav-link"],["id","description-tab","data-bs-toggle","tab","data-bs-target","#restriction","role","tab","aria-selected","false",1,"nav-link"],["id","myTabContecnt",1,"tab-content"],["id","permission","role","tabpanel",1,"tab-pane","fade","show","active","mt-0","p-5"],["class","row my-5","matTooltipPosition","above",3,"matTooltip",4,"ngFor","ngForOf"],["id","outlet","role","tabpanel",1,"tab-pane","fade","show","mt-0","p-7"],[1,"row","border-top-0"],[1,"table","table-bordered"],[1,"thead-light","w-250px"],[1,"border-end"],[1,"border-end","text-center",2,"width","90px"],[1,"d-block","border-bottom","pb-3","mb-3"],["type","radio","name","noaccess",3,"ngModelChange","change","ngModel","value"],["matTooltipPosition","above","matTooltip","User can check Inventory at outlet",1,"border-end","text-center",2,"width","90px"],["type","radio","name","peek",3,"ngModelChange","change","ngModel","value"],["matTooltipPosition","above","matTooltip","User can check Inventory + Orders at outlet",1,"border-end","text-center",2,"width","90px"],["type","radio","name","read",3,"ngModelChange","change","ngModel","value"],["matTooltipPosition","above","matTooltip","User can create new orders at outlet",1,"text-center",2,"width","90px"],["type","radio","name","write",3,"ngModelChange","change","ngModel","value"],[4,"ngFor","ngForOf"],["id","description","role","tabpanel",1,"tab-pane","face","show","mt-5","p-5"],[1,"col-sm-12"],["id","desc",1,"form-control",2,"width","100%",3,"ngModelChange","ngModel"],["for","desc"],["id","restriction","role","tabpanel",1,"tab-pane","fade","show","mt-5","p-5"],[1,"col-sm-6"],["type","text","autoNum","","id","days","placeholder","Data Days Range",1,"form-control",3,"ngModelChange","ngModel"],["for","days"],[1,"form-floating-outline","radio","border","rounded"],[3,"modelChange","model"],[1,"form-floating-outline",3,"ngClass"],["id","brand","bindLabel","Value","bindValue","Key",1,"productform","w-100",3,"ngModelChange","ngModel","items"],["for","brand",1,"ng-select"],[1,"control-label","text-danger","border-0"],["matTooltipPosition","above",1,"row","my-5",3,"matTooltip"],[1,"col-sm-2","border",2,"background-color","#f6f6f6","font-weight","bold","padding","5px","text-align","center"],[1,"d-flex","align-items-center"],[1,"mb-0",2,"flex","1","text-align","center"],["type","checkbox",2,"margin-left","auto",3,"change","disabled"],[1,"col-sm-10","g-0"],[1,"row","g-0"],["class","col-md-3 border border-top-0 ps-5 border-start-0 d-flex align-items-center","style","min-height: 32px",4,"ngIf"],[1,"col-3","px-0"],["matTooltipPosition","above",1,"input-group",3,"matTooltip"],[1,"input-group-text","border","border-start-0",3,"ngClass"],["type","checkbox",3,"click","id","disabled","checked"],[1,"form-control","border",3,"ngClass","for"],[1,"col-md-3","border","border-top-0","ps-5","border-start-0","d-flex","align-items-center",2,"min-height","32px"],["href","#","data-bs-toggle","dropdown","matTooltipPosition","above","matTooltip","More Permission",1,"simple-text","text-start"],[1,"dropdown-menu",2,"max-height","400px","overflow","auto","width","230px"],[1,"col-12","px-0"],[1,"dropdown-item","h6","py-0","px-3"],[1,"input-group"],[1,"input-group-text","border"],["type","checkbox",3,"click","id","checked"],["matTooltipPosition","above",1,"form-control","border",3,"for","matTooltip"],[2,"text-align","center"],["type","radio",3,"ngModelChange","ngModel","name","value"]],template:function(a,t){a&1&&_(0,Sn,8,6,"mainpanel-cmp",1),a&2&&s("ngIf",t.data&&t.formData)},dependencies:[X,P,M,L,U,ie,He,G,Ie,O,q,Me,Ee,K],styles:[".w-250px[_ngcontent-%COMP%]{width:250px}"]})};var Dn=()=>["/menu/Users/User/Groups/Form"],In=i=>({"bg-gradient-warning":i}),Tn=()=>["/menu/Users/User/Groups/Info"],Mn=i=>({ID:i}),En=()=>["/menu/Users/User/Users"],kn=i=>({GroupID:i});function Un(i,p){if(i&1){let e=w();n(0,"a",15),b("click",function(){d(e);let t=m(2);return u(t.httpDeleteListID("user/group"))}),v(1,"i",16),c(2," Delete "),o()}}function Vn(i,p){i&1&&(n(0,"a",17),c(1,"Add "),o()),i&2&&s("routerLink",I(1,Dn))}function Fn(i,p){if(i&1){let e=w();n(0,"th",18)(1,"input",19),b("change",function(t){d(e);let r=m(2);return r.onSelectAllData(t.target.checked),u(r.uncheckSystemGroup())}),o()()}}function Pn(i,p){i&1&&v(0,"th")}function Ln(i,p){if(i&1){let e=w();n(0,"td")(1,"input",24),h("ngModelChange",function(t){d(e);let r=m().$implicit;return f(r.selected,t)||(r.selected=t),u(t)}),o()()}if(i&2){let e=m().$implicit;l(),g("ngModel",e.selected)}}function Rn(i,p){if(i&1){let e=w();n(0,"td",25)(1,"button",26),b("click",function(){d(e);let t=m().$implicit,r=m(2);return u(r.onDuplicateGroup(t.ID))}),v(2,"i",27),o()()}}function Nn(i,p){if(i&1&&(n(0,"tr",20),_(1,Ln,2,1,"td",12),n(2,"td")(3,"a",21),c(4),o()(),n(5,"td")(6,"a",22),c(7),R(8,"number"),o()(),n(9,"td"),c(10),o(),_(11,Rn,3,0,"td",23),o()),i&2){let e=p.$implicit,a=m(2);s("ngClass",C(12,In,e.Type==1)),l(),s("ngIf",a.roleService.users.Delete),l(2),s("routerLink",I(14,Tn))("queryParams",C(15,Mn,e.ID)),l(),x(e.Name),l(2),s("routerLink",I(17,En))("queryParams",C(18,kn,e.ID)),l(),H(" ",Z(8,10,e.TotalUsers)," "),l(3),x(e.Description),l(),s("ngIf",a.roleService.users.Create)}}function An(i,p){if(i&1){let e=w();n(0,"mat-paginator",28),b("page",function(t){d(e);let r=m(2);return u(r.onPaginationChange(t))}),o()}if(i&2){let e=m(2);s("length",e.pagination.listTotal)("pageSize",e.pagination.pageSize)("pageIndex",e.pageData.Filter.PageNumber==0?0:e.pageData.Filter.PageNumber-1)}}function Gn(i,p){if(i&1){let e=w();n(0,"mainpanel-cmp",1),h("textChange",function(t){d(e);let r=m();return f(r.pageData.Filter.Text,t)||(r.pageData.Filter.Text=t),u(t)}),b("onSubmit",function(){d(e);let t=m();return u(t.searchFromPageOne())}),n(1,"actions"),_(2,Un,3,0,"a",2)(3,Vn,2,2,"a",3),o(),n(4,"content")(5,"div",4)(6,"div",5)(7,"table",6)(8,"thead",7)(9,"tr",8),_(10,Fn,2,0,"th",9),n(11,"th",10),c(12,"NAME"),o(),n(13,"th",11),c(14," USERS "),o(),n(15,"th"),c(16,"DESCRIPTION"),o(),_(17,Pn,1,0,"th",12),o()(),n(18,"tbody"),_(19,Nn,12,20,"tr",13),o()()(),n(20,"div"),_(21,An,1,3,"mat-paginator",14),o()()()()}if(i&2){let e=m();s("pageData",e.menuData)("hideSearchDropdown",!0),g("text",e.pageData.Filter.Text),l(2),s("ngIf",e.getSelectedData().length>0),l(),s("ngIf",e.roleService.users.Create),l(7),s("ngIf",e.roleService.users.Delete),l(7),s("ngIf",e.roleService.users.Create),l(2),s("ngForOf",e.data.Data),l(2),s("ngIf",e.pagination.listTotal>0)}}var Je=class i extends oe{constructor(e,a,t,r){super(e,a,"user/group/List","user/GroupLoader/List",t);this.roleService=r}onDuplicateGroup(e){if(confirm("Are you sure you want to copy this group?")==!1)return;let t={GroupID:e};this.httpService.put("/api/user/group/CopyGroup",t).subscribe(r=>{this.toastrService.success(r.Message,T.Success),this.getListData()})}uncheckSystemGroup(){this.data.Data=this.data.Data.map(e=>(e.GetISRoleSystem&&(e.selected=!1),e))}static \u0275fac=function(a){return new(a||i)(y(k),y(E),y(A),y(W))};static \u0275cmp=D({type:i,selectors:[["ng-component"]],standalone:!1,features:[V],decls:1,vars:1,consts:[[3,"pageData","hideSearchDropdown","text","textChange","onSubmit",4,"ngIf"],[3,"textChange","onSubmit","pageData","hideSearchDropdown","text"],["role","button","class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["role","button","class","btn btn-success ms-2",3,"routerLink",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"header"],["style","width: 14px",4,"ngIf"],[2,"width","250px"],["matTooltip","Number of users associated with the group",2,"width","80px"],[4,"ngIf"],["class","border-bottom",3,"ngClass",4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page",4,"ngIf"],["role","button",1,"btn","btn-outline-secondary","me-3",3,"click"],[1,"fa-solid","fa-trash"],["role","button",1,"btn","btn-success","ms-2",3,"routerLink"],[2,"width","14px"],["type","checkbox",3,"change"],[1,"border-bottom",3,"ngClass"],[3,"routerLink","queryParams"],["target","_blank",3,"routerLink","queryParams"],["class","d-flex justify-content-end",4,"ngIf"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"d-flex","justify-content-end"],["title","Copy Group",1,"btn","btn-success","btn-sm","fs-6",3,"click"],[1,"fa-solid","fa-copy"],[3,"page","length","pageSize","pageIndex"]],template:function(a,t){a&1&&_(0,Gn,22,9,"mainpanel-cmp",0),a&2&&s("ngIf",t.data)},dependencies:[X,P,M,L,U,De,G,O,ne,K,qt],encapsulation:2})};var On=()=>["/menu/Users/User/Roles"],Wn=i=>({selected:i});function Bn(i,p){i&1&&(n(0,"span",28),c(1," Name required. "),o())}function Hn(i,p){if(i&1){let e=w();n(0,"mainpanel-cmp",3)(1,"actions")(2,"a",4),c(3,"Cancel"),o(),n(4,"button",5),b("click",function(){d(e);let t=m();return u(t.onSubmit("user/role/Submit"))}),c(5,"Submit "),o()(),n(6,"content")(7,"div",6)(8,"div",7)(9,"div",8)(10,"div",9)(11,"div",10)(12,"h3",11),c(13,"General"),o(),n(14,"div",12)(15,"input",13,0),h("ngModelChange",function(t){d(e);let r=m();return f(r.formData.Name,t)||(r.formData.Name=t),u(t)}),o(),n(17,"label",14),c(18,"Name"),o(),_(19,Bn,2,0,"span",15),o(),n(20,"div",12)(21,"input",16),h("ngModelChange",function(t){d(e);let r=m();return f(r.formData.Model,t)||(r.formData.Model=t),u(t)}),o(),n(22,"label",17),c(23,"Model"),o()(),n(24,"div",12)(25,"textarea",18),h("ngModelChange",function(t){d(e);let r=m();return f(r.formData.Description,t)||(r.formData.Description=t),u(t)}),o(),n(26,"label",19),c(27,"Description"),o()()()()(),n(28,"div",20)(29,"div",9)(30,"div",10)(31,"h3",11),c(32,"Properties"),o(),n(33,"div",21)(34,"ng-select",22,1),h("ngModelChange",function(t){d(e);let r=m();return f(r.formData.GroupID,t)||(r.formData.GroupID=t),u(t)}),o(),n(36,"label",23),c(37,"Type"),o()(),n(38,"div",24)(39,"label"),c(40,"More Permission"),o(),n(41,"radio-options",25),h("modelChange",function(t){d(e);let r=m();return f(r.formData.Advanced,t)||(r.formData.Advanced=t),u(t)}),o()(),n(42,"div",12)(43,"input",26),h("ngModelChange",function(t){d(e);let r=m();return f(r.formData.Index,t)||(r.formData.Index=t),u(t)}),o(),n(44,"label",27),c(45,"Index"),o()()()()()()()()()}if(i&2){let e=z(16),a=z(35),t=m();s("pageData",t.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),s("routerLink",I(15,On)),l(13),g("ngModel",t.formData.Name),l(4),s("ngIf",e.invalid&&(e.dirty||e.touched)),l(2),g("ngModel",t.formData.Model),l(4),g("ngModel",t.formData.Description),l(8),s("ngClass",C(16,Wn,t.formData.GroupID)),l(),g("ngModel",t.formData.GroupID),s("items",t.groupTypes),l(2),kt("z-index",a.isOpen?"9999":"0"),l(5),g("model",t.formData.Advanced),l(2),g("ngModel",t.formData.Index)}}var Ze=class i extends Ue{constructor(e,a,t,r,S,$){super(e,a,"user/RoleLoader/Form",t);this.toaster=r;this.router=S;this.actRoute=$}groupTypes;postBindForm(e){this.groupTypes=e.GroupTypes}onSubmitSuccess(){let e=this.actRoute.snapshot.queryParams;ge.IsEmpty(e.ID)?this.toaster.success("Success add roles",T.Success):this.toaster.success("Success update roles",T.Success),this.router.navigate(["/menu/Users/User/Roles"])}static \u0275fac=function(a){return new(a||i)(y(k),y(E),y(N),y(A),y(Y),y(N))};static \u0275cmp=D({type:i,selectors:[["ng-component"]],standalone:!1,features:[V],decls:1,vars:1,consts:[["roleName","ngModel"],["typeSelect",""],[3,"pageData","hideSearchDropdown","hideSearchBox",4,"ngIf"],[3,"pageData","hideSearchDropdown","hideSearchBox"],["role","button",1,"btn","btn-outline-secondary","me-5",3,"routerLink"],["type","button","role","button",1,"btn","btn-success",3,"click"],[1,"container-fluid","bg-light-gray","pt-10"],[1,"row"],[1,"col-md-8"],[1,"card"],[1,"card-body"],[1,"card-title","mb-10"],[1,"form-floating-outline"],["type","text","id","inputName","placeholder","Name","name","roleName","autofocus","","required","",1,"form-control",3,"ngModelChange","ngModel"],["for","inputName"],["class","control-label text-danger",4,"ngIf"],["type","text","id","inputMode","placeholder","Model","name","model",1,"form-control",3,"ngModelChange","ngModel"],["for","inputModel"],["id","inputDescription","placeholder","Description",1,"form-control",3,"ngModelChange","ngModel"],["for","inputDescription"],[1,"col-md-4"],[1,"form-floating-outline",3,"ngClass"],["id","inputType","bindLabel","Name","bindValue","ID",1,"productform","w-100",3,"ngModelChange","ngModel","items"],["for","inputType"],[1,"form-floating-outline","radio","border","rounded",2,"padding-top","20px"],[3,"modelChange","model"],["type","text","id","inputIndex","placeholder","Index","autoNum","",1,"form-control",3,"ngModelChange","ngModel"],["for","inputIndex"],[1,"control-label","text-danger"]],template:function(a,t){a&1&&_(0,Hn,46,18,"mainpanel-cmp",2),a&2&&s("ngIf",t.data&&t.formData)},dependencies:[X,M,L,U,ie,G,Ie,O,q,Me,Ee],encapsulation:2})};var qn=()=>["/menu/Users/User/Roles/Form"],jn=i=>({ID:i});function zn(i,p){if(i&1){let e=w();n(0,"a",21),b("click",function(){d(e);let t=m(2).ngIf,r=m();return u(r.deleteRole(t.Role.ID))}),v(1,"i",22),c(2," Delete "),o()}}function Qn(i,p){if(i&1&&(n(0,"a",23),v(1,"i",24),c(2," Edit "),o()),i&2){let e=m(2).ngIf;s("routerLink",I(2,qn))("queryParams",C(3,jn,e.Role.ID))}}function Xn(i,p){if(i&1&&(n(0,"actions"),_(1,zn,3,0,"a",19)(2,Qn,3,5,"a",20),o()),i&2){let e=m(2);l(),s("ngIf",e.roleService.users.Delete),l(),s("ngIf",e.roleService.users.Edit)}}function Yn(i,p){if(i&1&&(n(0,"div",25),v(1,"span",26),n(2,"span",27),c(3),o()()),i&2){let e=p.$implicit;l(3),x(e.Name)}}function Kn(i,p){if(i&1&&(n(0,"mainpanel-cmp",1),R(1,"async"),_(2,Xn,3,2,"actions",2),n(3,"content")(4,"div",3)(5,"div",4)(6,"div",5)(7,"div",6)(8,"div",7)(9,"h3",8),c(10,"General"),o(),n(11,"div",9),v(12,"POS-info-page-input",10),o(),n(13,"div",9),v(14,"POS-info-page-input",11),o(),n(15,"div",9),v(16,"POS-info-page-input",12),o()()()(),n(17,"div",13)(18,"div",6)(19,"div",7)(20,"h3",8),c(21,"Properties"),o(),n(22,"div",9),v(23,"POS-info-page-input",14),o(),n(24,"div",9),v(25,"POS-info-page-input",15),o(),n(26,"div",9),v(27,"POS-info-page-input",16),o()()()()(),n(28,"div",4)(29,"div",17)(30,"div",6)(31,"div",7)(32,"h3",8),c(33,"User Group"),o(),n(34,"div",4),_(35,Yn,4,1,"div",18),o()()()()()()()()),i&2){let e=p.ngIf,a=m();s("pageData",Z(1,11,a.menu$))("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),s("ngIf",a.roleService.isSystemUser),l(10),s("inputValue",e.Role.Name),l(2),s("inputValue",e.Role.Model),l(2),s("inputValue",e.Role.Description),l(7),s("inputValue",e.Role.GroupName),l(2),s("inputValue",e.Role.Advanced?"Yes":"No"),l(2),s("inputValue",e.Role.Index),l(8),s("ngForOf",e.UserGroupRole)}}var $e=class i{constructor(p,e,a,t,r,S){this.http=p;this.route=a;this.toastr=t;this.roleService=r;S.setMenu$(),this.menu$=S.menu$;let $=vt(e.snapshot.queryParams).pipe(he(J=>p.get(this.endpoint+J.ID))),j=bt(this.menu$,$).pipe(Fe(([J,fe])=>({menu:ct(st({},J),{H:`${fe.Role.Name} Role`}),info:fe})),wt());this.info$=j.pipe(mt("info"),Fe(J=>ct(st({},J),{UserGroupRole:J.UserGroupRole.filter(fe=>fe.HasRole)}))),this.menu$=j.pipe(mt("menu"))}endpoint="/API/user/role/";menu$;info$;deleteRole(p){this.http.delete("/API/User/Role",{body:[p]}).subscribe({next:()=>{this.route.navigate(["/menu/Users/User/Roles"]),this.toastr.success("Success delete role.",T.Success)}})}static \u0275fac=function(e){return new(e||i)(y(E),y(N),y(Y),y(A),y(W),y(k))};static \u0275cmp=D({type:i,selectors:[["POS-roles-info"]],standalone:!1,decls:2,vars:3,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox",4,"ngIf"],[3,"pageData","hideSearchDropdown","hideSearchBox"],[4,"ngIf"],[1,"container-fluid","pt-10"],[1,"row"],[1,"col-md-8"],[1,"card"],[1,"card-body"],[1,"card-title","mb-10"],[1,"form-floating-outline"],["labelValue","Name",3,"inputValue"],["labelValue","Model",3,"inputValue"],["labelValue","Description","inputType","textarea",3,"inputValue"],[1,"col-md-4"],["labelValue","Type",3,"inputValue"],["labelValue","More Permission",3,"inputValue"],["labelValue","Index",3,"inputValue"],[1,"col-8"],["class","col-3 d-flex align-items-center",4,"ngFor","ngForOf"],["role","button","class","btn btn-outline-secondary",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary ms-5",3,"routerLink","queryParams",4,"ngIf"],["role","button",1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-trash"],["role","button",1,"btn","btn-outline-secondary","ms-5",3,"routerLink","queryParams"],[1,"fa-solid","fa-pen-to-square"],[1,"col-3","d-flex","align-items-center"],[1,"me-5",2,"width","5px","height","5px","background","black","border-radius","100%"],[2,"font-size","14px"]],template:function(e,a){e&1&&(_(0,Kn,36,13,"mainpanel-cmp",0),R(1,"async")),e&2&&s("ngIf",Z(1,1,a.info$))},dependencies:[P,M,L,U,ke,Se],encapsulation:2})};var Jn=()=>["/menu/Users/User/Roles/Form"],Zn=i=>({"bg-gradient-warning":i}),$n=()=>["Info"],eo=i=>({ID:i});function to(i,p){if(i&1){let e=w();n(0,"a",14),b("click",function(){d(e);let t=m(2);return u(t.httpDeleteListID("user/role"))}),v(1,"i",15),c(2," Delete "),o()}}function io(i,p){i&1&&(n(0,"a",16),c(1,"Add "),o()),i&2&&s("routerLink",I(1,Jn))}function no(i,p){if(i&1){let e=w();n(0,"div",17)(1,"h6"),c(2,"Group Name"),o(),n(3,"ng-select",18),h("ngModelChange",function(t){d(e);let r=m(2);return f(r.pageData.Filter.GroupID,t)||(r.pageData.Filter.GroupID=t),u(t)}),o()()}if(i&2){let e=m(2);l(3),g("ngModel",e.pageData.Filter.GroupID),s("items",e.pageData.Options)}}function oo(i,p){if(i&1){let e=w();n(0,"th",19)(1,"input",20),b("change",function(t){d(e);let r=m(2);return u(r.onSelectAllData(t.target.checked))}),o()()}}function ao(i,p){if(i&1){let e=w();n(0,"td")(1,"input",24),h("ngModelChange",function(t){d(e);let r=m().$implicit;return f(r.selected,t)||(r.selected=t),u(t)}),o()()}if(i&2){let e=m().$implicit;l(),g("ngModel",e.selected)}}function ro(i,p){if(i&1&&(n(0,"tr",21),_(1,ao,2,1,"td",22),n(2,"td")(3,"a",23),c(4),o()(),n(5,"td"),c(6),o(),n(7,"td"),c(8),o(),n(9,"td"),c(10),o()()),i&2){let e=p.$implicit,a=m(2);s("ngClass",C(8,Zn,e.Type==1)),l(),s("ngIf",a.data.IsSystem),l(2),s("routerLink",I(10,$n))("queryParams",C(11,eo,e.ID)),l(),x(e.RolesName),l(2),x(e.GroupName),l(2),x(e.Model),l(2),x(e.Description)}}function lo(i,p){if(i&1){let e=w();n(0,"mat-paginator",25),b("page",function(t){d(e);let r=m(2);return u(r.onPaginationChange(t))}),o()}if(i&2){let e=m(2);s("length",e.pagination.listTotal)("pageSize",e.pagination.pageSize)("pageIndex",e.pageData.Filter.PageNumber==0?0:e.pageData.Filter.PageNumber-1)}}function so(i,p){if(i&1){let e=w();n(0,"mainpanel-cmp",2),h("textChange",function(t){d(e);let r=m();return f(r.pageData.Filter.Text,t)||(r.pageData.Filter.Text=t),u(t)}),b("onSubmit",function(){d(e);let t=m();return u(t.searchFromPageOne())}),h("filterChange",function(t){d(e);let r=m();return f(r.pageData.Filter,t)||(r.pageData.Filter=t),u(t)}),n(1,"actions"),_(2,to,3,0,"a",3)(3,io,2,2,"a",4),o(),n(4,"filters"),_(5,no,4,2,"ng-template",null,0,pe),o(),n(7,"content")(8,"div",5)(9,"div",6)(10,"table",7)(11,"thead",8)(12,"tr",9),_(13,oo,2,0,"th",10),n(14,"th",11),c(15,"NAME"),o(),n(16,"th"),c(17,"GROUP NAME"),o(),n(18,"th"),c(19,"MODEL"),o(),n(20,"th"),c(21,"DESCRIPTION"),o()()(),n(22,"tbody"),_(23,ro,11,13,"tr",12),o()()(),n(24,"div"),_(25,lo,1,3,"mat-paginator",13),o()()()()}if(i&2){let e=m();s("pageData",e.menuData),g("text",e.pageData.Filter.Text),s("isFilterOnDropdown",!1),g("filter",e.pageData.Filter),l(2),s("ngIf",e.getSelectedData().length>0),l(),s("ngIf",e.roleService.isSystemUser),l(10),s("ngIf",e.data.IsSystem),l(10),s("ngForOf",e.data.Data),l(2),s("ngIf",e.pagination.listTotal>0)}}var et=class i extends oe{constructor(e,a,t,r){super(e,a,"user/role/List","user/RoleLoader/List",t);this.httpService=a;this.roleService=r}static \u0275fac=function(a){return new(a||i)(y(k),y(E),y(A),y(W))};static \u0275cmp=D({type:i,selectors:[["ng-component"]],standalone:!1,features:[V],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["role","button","class","btn btn-outline-secondary",3,"click",4,"ngIf"],["role","button","class","btn btn-success ms-3",3,"routerLink",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"header"],["style","width: 14px",4,"ngIf"],[2,"width","250px"],["class","border-bottom",3,"ngClass",4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page",4,"ngIf"],["role","button",1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-trash"],["role","button",1,"btn","btn-success","ms-3",3,"routerLink"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose a Group...",3,"ngModelChange","ngModel","items"],[2,"width","14px"],["type","checkbox",3,"change"],[1,"border-bottom",3,"ngClass"],[4,"ngIf"],[3,"routerLink","queryParams"],["type","checkbox",3,"ngModelChange","ngModel"],[3,"page","length","pageSize","pageIndex"]],template:function(a,t){a&1&&_(0,so,26,9,"mainpanel-cmp",1),a&2&&s("ngIf",t.data)},dependencies:[X,P,M,L,U,De,G,O,ne,q],encapsulation:2})};var co=["switch"],mo=["*"];function po(i,p){i&1&&(n(0,"span",10),Dt(),n(1,"svg",12),v(2,"path",13),o(),n(3,"svg",14),v(4,"path",15),o()())}var uo=new Ct("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1,hideIcon:!1,disabledInteractive:!1})}),_o={provide:zt,useExisting:xt(()=>it),multi:!0},tt=class{source;checked;constructor(p,e){this.source=p,this.checked=e}},it=(()=>{class i{_elementRef=F(Tt);_focusMonitor=F(ti);_changeDetectorRef=F(Bt);defaults=F(uo);_onChange=e=>{};_onTouched=()=>{};_validatorOnChange=()=>{};_uniqueId;_checked=!1;_createChangeEvent(e){return new tt(this,e)}_labelId;get buttonId(){return`${this.id||this._uniqueId}-button`}_switchElement;focus(){this._switchElement.nativeElement.focus()}_noopAnimations;_focused;name=null;id;labelPosition="after";ariaLabel=null;ariaLabelledby=null;ariaDescribedby;required;color;disabled=!1;disableRipple=!1;tabIndex=0;get checked(){return this._checked}set checked(e){this._checked=e,this._changeDetectorRef.markForCheck()}hideIcon;disabledInteractive;change=new pt;toggleChange=new pt;get inputId(){return`${this.id||this._uniqueId}-input`}constructor(){F(ii).load(ai);let e=F(new It("tabindex"),{optional:!0}),a=this.defaults,t=F(Mt,{optional:!0});this.tabIndex=e==null?0:parseInt(e)||0,this.color=a.color||"accent",this._noopAnimations=t==="NoopAnimations",this.id=this._uniqueId=F(ni).getId("mat-mdc-slide-toggle-"),this.hideIcon=a.hideIcon??!1,this.disabledInteractive=a.disabledInteractive??!1,this._labelId=this._uniqueId+"-label"}ngAfterContentInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(e=>{e==="keyboard"||e==="program"?(this._focused=!0,this._changeDetectorRef.markForCheck()):e||Promise.resolve().then(()=>{this._focused=!1,this._onTouched(),this._changeDetectorRef.markForCheck()})})}ngOnChanges(e){e.required&&this._validatorOnChange()}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}writeValue(e){this.checked=!!e}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}validate(e){return this.required&&e.value!==!0?{required:!0}:null}registerOnValidatorChange(e){this._validatorOnChange=e}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck()}toggle(){this.checked=!this.checked,this._onChange(this.checked)}_emitChangeEvent(){this._onChange(this.checked),this.change.emit(this._createChangeEvent(this.checked))}_handleClick(){this.disabled||(this.toggleChange.emit(),this.defaults.disableToggleValue||(this.checked=!this.checked,this._onChange(this.checked),this.change.emit(new tt(this,this.checked))))}_getAriaLabelledBy(){return this.ariaLabelledby?this.ariaLabelledby:this.ariaLabel?null:this._labelId}static \u0275fac=function(a){return new(a||i)};static \u0275cmp=D({type:i,selectors:[["mat-slide-toggle"]],viewQuery:function(a,t){if(a&1&&Nt(co,5),a&2){let r;At(r=Gt())&&(t._switchElement=r.first)}},hostAttrs:[1,"mat-mdc-slide-toggle"],hostVars:13,hostBindings:function(a,t){a&2&&(Pt("id",t.id),ye("tabindex",null)("aria-label",null)("name",null)("aria-labelledby",null),Be(t.color?"mat-"+t.color:""),ue("mat-mdc-slide-toggle-focused",t._focused)("mat-mdc-slide-toggle-checked",t.checked)("_mat-animation-noopable",t._noopAnimations))},inputs:{name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],required:[2,"required","required",_e],color:"color",disabled:[2,"disabled","disabled",_e],disableRipple:[2,"disableRipple","disableRipple",_e],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:Ht(e)],checked:[2,"checked","checked",_e],hideIcon:[2,"hideIcon","hideIcon",_e],disabledInteractive:[2,"disabledInteractive","disabledInteractive",_e]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[Ot([_o,{provide:Qt,useExisting:i,multi:!0}]),St],ngContentSelectors:mo,decls:13,vars:27,consts:[["switch",""],["mat-internal-form-field","",3,"labelPosition"],["role","switch","type","button",1,"mdc-switch",3,"click","tabIndex","disabled"],[1,"mdc-switch__track"],[1,"mdc-switch__handle-track"],[1,"mdc-switch__handle"],[1,"mdc-switch__shadow"],[1,"mdc-elevation-overlay"],[1,"mdc-switch__ripple"],["mat-ripple","",1,"mat-mdc-slide-toggle-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mdc-switch__icons"],[1,"mdc-label",3,"click","for"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--on"],["d","M19.69,5.23L8.96,15.96l-4.23-4.23L2.96,13.5l6,6L21.46,7L19.69,5.23z"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--off"],["d","M20 13H4v-2h16v2z"]],template:function(a,t){if(a&1){let r=w();Lt(),n(0,"div",1)(1,"button",2,0),b("click",function(){return d(r),u(t._handleClick())}),v(3,"span",3),n(4,"span",4)(5,"span",5)(6,"span",6),v(7,"span",7),o(),n(8,"span",8),v(9,"span",9),o(),_(10,po,5,0,"span",10),o()()(),n(11,"label",11),b("click",function($){return d(r),u($.stopPropagation())}),Rt(12),o()()}if(a&2){let r=z(2);s("labelPosition",t.labelPosition),l(),ue("mdc-switch--selected",t.checked)("mdc-switch--unselected",!t.checked)("mdc-switch--checked",t.checked)("mdc-switch--disabled",t.disabled)("mat-mdc-slide-toggle-disabled-interactive",t.disabledInteractive),s("tabIndex",t.disabled&&!t.disabledInteractive?-1:t.tabIndex)("disabled",t.disabled&&!t.disabledInteractive),ye("id",t.buttonId)("name",t.name)("aria-label",t.ariaLabel)("aria-labelledby",t._getAriaLabelledBy())("aria-describedby",t.ariaDescribedby)("aria-required",t.required||null)("aria-checked",t.checked)("aria-disabled",t.disabled&&t.disabledInteractive?"true":null),l(8),s("matRippleTrigger",r)("matRippleDisabled",t.disableRipple||t.disabled)("matRippleCentered",!0),l(),B(t.hideIcon?-1:10),l(),s("for",t.buttonId),ye("id",t._labelId)}},dependencies:[mi,di],styles:[`.mdc-switch{align-items:center;background:none;border:none;cursor:pointer;display:inline-flex;flex-shrink:0;margin:0;outline:none;overflow:visible;padding:0;position:relative;width:var(--mdc-switch-track-width, 52px)}.mdc-switch.mdc-switch--disabled{cursor:default;pointer-events:none}.mdc-switch.mat-mdc-slide-toggle-disabled-interactive{pointer-events:auto}.mdc-switch__track{overflow:hidden;position:relative;width:100%;height:var(--mdc-switch-track-height, 32px);border-radius:var(--mdc-switch-track-shape, var(--mat-sys-corner-full))}.mdc-switch--disabled.mdc-switch .mdc-switch__track{opacity:var(--mdc-switch-disabled-track-opacity, 0.12)}.mdc-switch__track::before,.mdc-switch__track::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";height:100%;left:0;position:absolute;width:100%;border-width:var(--mat-switch-track-outline-width, 2px);border-color:var(--mat-switch-track-outline-color, var(--mat-sys-outline))}.mdc-switch--selected .mdc-switch__track::before,.mdc-switch--selected .mdc-switch__track::after{border-width:var(--mat-switch-selected-track-outline-width, 2px);border-color:var(--mat-switch-selected-track-outline-color, transparent)}.mdc-switch--disabled .mdc-switch__track::before,.mdc-switch--disabled .mdc-switch__track::after{border-width:var(--mat-switch-disabled-unselected-track-outline-width, 2px);border-color:var(--mat-switch-disabled-unselected-track-outline-color, var(--mat-sys-on-surface))}@media(forced-colors: active){.mdc-switch__track{border-color:currentColor}}.mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0, 0, 0.2, 1);transform:translateX(0);background:var(--mdc-switch-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.6, 1);transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch--selected .mdc-switch__track::before{transform:translateX(-100%)}.mdc-switch--selected .mdc-switch__track::before{opacity:var(--mat-switch-hidden-track-opacity, 0);transition:var(--mat-switch-hidden-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::before{opacity:var(--mat-switch-visible-track-opacity, 1);transition:var(--mat-switch-visible-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::before{background:var(--mdc-switch-unselected-hover-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::before{background:var(--mdc-switch-unselected-focus-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:active .mdc-switch__track::before{background:var(--mdc-switch-unselected-pressed-track-color, var(--mat-sys-surface-variant))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::before,.mdc-switch.mdc-switch--disabled .mdc-switch__track::before{background:var(--mdc-switch-disabled-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch__track::after{transform:translateX(-100%);background:var(--mdc-switch-selected-track-color, var(--mat-sys-primary))}[dir=rtl] .mdc-switch__track::after{transform:translateX(100%)}.mdc-switch--selected .mdc-switch__track::after{transform:translateX(0)}.mdc-switch--selected .mdc-switch__track::after{opacity:var(--mat-switch-visible-track-opacity, 1);transition:var(--mat-switch-visible-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::after{opacity:var(--mat-switch-hidden-track-opacity, 0);transition:var(--mat-switch-hidden-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::after{background:var(--mdc-switch-selected-hover-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::after{background:var(--mdc-switch-selected-focus-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:active .mdc-switch__track::after{background:var(--mdc-switch-selected-pressed-track-color, var(--mat-sys-primary))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::after,.mdc-switch.mdc-switch--disabled .mdc-switch__track::after{background:var(--mdc-switch-disabled-selected-track-color, var(--mat-sys-on-surface))}.mdc-switch__handle-track{height:100%;pointer-events:none;position:absolute;top:0;transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);left:0;right:auto;transform:translateX(0);width:calc(100% - var(--mdc-switch-handle-width))}[dir=rtl] .mdc-switch__handle-track{left:auto;right:0}.mdc-switch--selected .mdc-switch__handle-track{transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch__handle-track{transform:translateX(-100%)}.mdc-switch__handle{display:flex;pointer-events:auto;position:absolute;top:50%;transform:translateY(-50%);left:0;right:auto;transition:width 75ms cubic-bezier(0.4, 0, 0.2, 1),height 75ms cubic-bezier(0.4, 0, 0.2, 1),margin 75ms cubic-bezier(0.4, 0, 0.2, 1);width:var(--mdc-switch-handle-width);height:var(--mdc-switch-handle-height);border-radius:var(--mdc-switch-handle-shape, var(--mat-sys-corner-full))}[dir=rtl] .mdc-switch__handle{left:auto;right:0}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle{width:var(--mat-switch-unselected-handle-size, 16px);height:var(--mat-switch-unselected-handle-size, 16px);margin:var(--mat-switch-unselected-handle-horizontal-margin, 0 8px)}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-switch-unselected-with-icon-handle-horizontal-margin, 0 4px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle{width:var(--mat-switch-selected-handle-size, 24px);height:var(--mat-switch-selected-handle-size, 24px);margin:var(--mat-switch-selected-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-switch-selected-with-icon-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch__handle:has(.mdc-switch__icons){width:var(--mat-switch-with-icon-handle-size, 24px);height:var(--mat-switch-with-icon-handle-size, 24px)}.mat-mdc-slide-toggle .mdc-switch:active:not(.mdc-switch--disabled) .mdc-switch__handle{width:var(--mat-switch-pressed-handle-size, 28px);height:var(--mat-switch-pressed-handle-size, 28px)}.mat-mdc-slide-toggle .mdc-switch--selected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-switch-selected-pressed-handle-horizontal-margin, 0 22px)}.mat-mdc-slide-toggle .mdc-switch--unselected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-switch-unselected-pressed-handle-horizontal-margin, 0 2px)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__handle::after{opacity:var(--mat-switch-disabled-selected-handle-opacity, 1)}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__handle::after{opacity:var(--mat-switch-disabled-unselected-handle-opacity, 0.38)}.mdc-switch__handle::before,.mdc-switch__handle::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";width:100%;height:100%;left:0;position:absolute;top:0;transition:background-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1),border-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);z-index:-1}@media(forced-colors: active){.mdc-switch__handle::before,.mdc-switch__handle::after{border-color:currentColor}}.mdc-switch--selected:enabled .mdc-switch__handle::after{background:var(--mdc-switch-selected-handle-color, var(--mat-sys-on-primary))}.mdc-switch--selected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-selected-hover-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-selected-focus-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:active .mdc-switch__handle::after{background:var(--mdc-switch-selected-pressed-handle-color, var(--mat-sys-primary-container))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:hover:not(:focus):not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:focus:not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:active .mdc-switch__handle::after,.mdc-switch--selected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mdc-switch-disabled-selected-handle-color, var(--mat-sys-surface))}.mdc-switch--unselected:enabled .mdc-switch__handle::after{background:var(--mdc-switch-unselected-handle-color, var(--mat-sys-outline))}.mdc-switch--unselected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-unselected-hover-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-unselected-focus-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:active .mdc-switch__handle::after{background:var(--mdc-switch-unselected-pressed-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mdc-switch-disabled-unselected-handle-color, var(--mat-sys-on-surface))}.mdc-switch__handle::before{background:var(--mdc-switch-handle-surface-color)}.mdc-switch__shadow{border-radius:inherit;bottom:0;left:0;position:absolute;right:0;top:0}.mdc-switch:enabled .mdc-switch__shadow{box-shadow:var(--mdc-switch-handle-elevation-shadow)}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__shadow,.mdc-switch.mdc-switch--disabled .mdc-switch__shadow{box-shadow:var(--mdc-switch-disabled-handle-elevation-shadow)}.mdc-switch__ripple{left:50%;position:absolute;top:50%;transform:translate(-50%, -50%);z-index:-1;width:var(--mdc-switch-state-layer-size, 40px);height:var(--mdc-switch-state-layer-size, 40px)}.mdc-switch__ripple::after{content:"";opacity:0}.mdc-switch--disabled .mdc-switch__ripple::after{display:none}.mat-mdc-slide-toggle-disabled-interactive .mdc-switch__ripple::after{display:block}.mdc-switch:hover .mdc-switch__ripple::after{opacity:.04;transition:75ms opacity cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle.mat-mdc-slide-toggle-focused .mdc-switch .mdc-switch__ripple::after{opacity:.12}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:focus .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:active .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:hover:not(:focus) .mdc-switch__ripple::after,.mdc-switch--unselected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mdc-switch-unselected-hover-state-layer-color, var(--mat-sys-on-surface))}.mdc-switch--unselected:enabled:focus .mdc-switch__ripple::after{background:var(--mdc-switch-unselected-focus-state-layer-color, var(--mat-sys-on-surface))}.mdc-switch--unselected:enabled:active .mdc-switch__ripple::after{background:var(--mdc-switch-unselected-pressed-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mdc-switch-unselected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch--selected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mdc-switch-selected-hover-state-layer-color, var(--mat-sys-primary))}.mdc-switch--selected:enabled:focus .mdc-switch__ripple::after{background:var(--mdc-switch-selected-focus-state-layer-color, var(--mat-sys-primary))}.mdc-switch--selected:enabled:active .mdc-switch__ripple::after{background:var(--mdc-switch-selected-pressed-state-layer-color, var(--mat-sys-primary));opacity:var(--mdc-switch-selected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch__icons{position:relative;height:100%;width:100%;z-index:1;transform:translateZ(0)}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__icons{opacity:var(--mdc-switch-disabled-unselected-icon-opacity, 0.38)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__icons{opacity:var(--mdc-switch-disabled-selected-icon-opacity, 0.38)}.mdc-switch__icon{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0;opacity:0;transition:opacity 30ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mdc-switch--unselected .mdc-switch__icon{width:var(--mdc-switch-unselected-icon-size, 16px);height:var(--mdc-switch-unselected-icon-size, 16px);fill:var(--mdc-switch-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mdc-switch-disabled-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__icon{width:var(--mdc-switch-selected-icon-size, 16px);height:var(--mdc-switch-selected-icon-size, 16px);fill:var(--mdc-switch-selected-icon-color, var(--mat-sys-on-primary-container))}.mdc-switch--selected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mdc-switch-disabled-selected-icon-color, var(--mat-sys-on-surface))}.mdc-switch--selected .mdc-switch__icon--on,.mdc-switch--unselected .mdc-switch__icon--off{opacity:1;transition:opacity 45ms 30ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle{-webkit-user-select:none;user-select:none;display:inline-block;-webkit-tap-highlight-color:rgba(0,0,0,0);outline:0}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple,.mat-mdc-slide-toggle .mdc-switch__ripple::after{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:50%;pointer-events:none}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple:not(:empty),.mat-mdc-slide-toggle .mdc-switch__ripple::after:not(:empty){transform:translateZ(0)}.mat-mdc-slide-toggle.mat-mdc-slide-toggle-focused .mat-focus-indicator::before{content:""}.mat-mdc-slide-toggle .mat-internal-form-field{color:var(--mat-switch-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-switch-label-text-font, var(--mat-sys-body-medium-font));line-height:var(--mat-switch-label-text-line-height, var(--mat-sys-body-medium-line-height));font-size:var(--mat-switch-label-text-size, var(--mat-sys-body-medium-size));letter-spacing:var(--mat-switch-label-text-tracking, var(--mat-sys-body-medium-tracking));font-weight:var(--mat-switch-label-text-weight, var(--mat-sys-body-medium-weight))}.mat-mdc-slide-toggle .mat-ripple-element{opacity:.12}.mat-mdc-slide-toggle .mat-focus-indicator::before{border-radius:50%}.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle-track,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__icon,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::after,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::after{transition:none}.mat-mdc-slide-toggle .mdc-switch:enabled+.mdc-label{cursor:pointer}.mat-mdc-slide-toggle .mdc-switch--disabled+label{color:var(--mdc-switch-disabled-label-text-color)}
@@ -1 +1 @@
1
- import{a as de}from"./chunk-Q5R2UJWA.js";import{h as me,i as se}from"./chunk-A5ANN35P.js";import"./chunk-IXKPLT63.js";import{b as le}from"./chunk-6KKSOYUD.js";import"./chunk-52EOLV7I.js";import"./chunk-5UL73W4S.js";import{u as ae,v as ne,w as re}from"./chunk-7ARFB5UX.js";import"./chunk-CIBQBSM6.js";import"./chunk-5UCQBOD6.js";import{e as te,f as ie,g as oe}from"./chunk-D35OBUDE.js";import"./chunk-567HXZXC.js";import"./chunk-CGESXTHC.js";import{a as ee}from"./chunk-2FWFPV5I.js";import"./chunk-TLOTIYIE.js";import{C as X,D as Z,c as G,h as z,o as J,y as Q}from"./chunk-P7HKWFZT.js";import"./chunk-NZVEUXSI.js";import"./chunk-XRNWNUVG.js";import{a as W}from"./chunk-AHCRE4GP.js";import"./chunk-PNUK526Z.js";import{$a as m,Ac as B,Db as F,E as A,Ib as o,Jb as a,Kb as w,Lb as T,Ma as Y,Mb as g,Ob as y,Od as H,Qb as _,Rb as u,Vd as q,Wc as U,Yc as j,Yd as $,Zc as v,db as f,dc as O,ec as r,fc as R,gc as x,gd as K,jc as E,jd as h,kb as b,kc as M,lc as P,ob as L,qb as S,rc as D,va as d,vb as c,wa as p,zc as k}from"./chunk-DZT5XHBQ.js";import"./chunk-7DCB7DB2.js";var I=(s=>(s.TRANSACTIONS="TRANSACTIONS",s.PRODUCTS="PRODUCTS",s.CONTACTS="CONTACTS",s.LOYALTY_POINTS="LOYALTY_POINTS",s.RECYCLE_BIN="RECYCLE_BIN",s.INVENTORY="INVENTORY",s))(I||{});function _e(n,l){if(n&1&&(T(0),o(1,"div",4)(2,"div",5)(3,"div",16),w(4,"i",17),o(5,"span"),r(6),a()()()(),g()),n&2){let i=u();m(6),x(" ",i.selectedClearData.message," ")}}function Se(n,l){n&1&&(T(0),o(1,"small",18),r(2," *Subdomain is required "),a(),g())}function Te(n,l){n&1&&(T(0),o(1,"small",18),r(2," *Password is required "),a(),g())}function ge(n,l){n&1&&w(0,"i",14)}function be(n,l){n&1&&w(0,"i",15)}var N=class n{constructor(l,i,t){this.data=l;this.dialogRef=i;this.fb=t;this.modalConfig.title=this.modalTitle[this.data.type],this.subdomain="",this.subdomainPlaceholder=l.subDomain}clearData=[{type:"TRANSACTIONS",api:"Setup/Data/ClearTransaction",message:"Your Invoice, Bill, Adjustment, TransferOrder will be deleted"},{type:"PRODUCTS",api:"Setup/Data/ClearProduct",message:"Your Category, Product and Variant will be deleted"},{type:"LOYALTY_POINTS",api:"Setup/Data/ClearLoyaltyPoint"},{type:"RECYCLE_BIN",api:"Setup/Data/ClearRecycleBin"},{type:"INVENTORY",api:"Setup/Data/ClearInventory",message:"Your Product Inventory will be set to 0"},{type:"CONTACTS",api:"Setup/Data/ClearContact",message:"Your Customer, Supplier and Sales Person will be deleted"}];selectedClearData;modalConfig=new ae;modalTitle={TRANSACTIONS:"Clear Transactions",PRODUCTS:"Clear Products",LOYALTY_POINTS:"Clear Loyalty Points",RECYCLE_BIN:"Clear Recycle Bin",CONTACTS:"Clear Contacts",INVENTORY:"Clear Inventory"};subdomain;subdomainPlaceholder;password;form;passwordVisibility=Y(!1);ngOnInit(){this.initSelectedClearData(),this.form=this.fb.group({subdomain:[""],password:[""]})}initSelectedClearData(){this.selectedClearData=this.clearData.find(l=>l.type===this.data.type)}onSubmit(){let l={password:this.password,subdomain:this.subdomain,apiUrl:this.selectedClearData.api};this.dialogRef.close(l)}static \u0275fac=function(i){return new(i||n)(f(ie),f(te),f(X))};static \u0275cmp=b({type:n,selectors:[["app-confirmation-modal"]],decls:24,vars:10,consts:[["subdomainCtrl","ngModel"],["passwordCtrl","ngModel"],[3,"onOk","onClose","onCancel","config","dynamicValidated"],[4,"ngIf"],[1,"row"],[1,"col-12"],[1,"form-floating-outline","mt-5"],["type","text","id","subdomain","placeholder","Subdomain","name","subdomain","autofocus","","required","",1,"form-control",3,"ngModelChange","ngModel"],["for","subdomain"],[1,"form-floating-outline"],["id","pass","placeholder","Password","name","password","required","",1,"form-control",3,"ngModelChange","type","ngModel"],["for","pass"],[1,"password-visibility"],["type","button",1,"btn","btn-link",3,"click"],[1,"fa-solid","fa-eye"],[1,"fa-solid","fa-eye-slash"],[1,"alert","alert-warning","cursor","w-100"],[1,"fa-solid","fa-circle-exclamation","me-2"],[1,"control-label","text-danger"]],template:function(i,t){if(i&1){let e=y();o(0,"modal-material",2),_("onOk",function(){return d(e),p(t.onSubmit())})("onClose",function(){return d(e),p(t.dialogRef.close())})("onCancel",function(){return d(e),p(t.dialogRef.close())}),o(1,"content"),S(2,_e,7,1,"ng-container",3),o(3,"div",4)(4,"div",5)(5,"strong"),r(6),a(),o(7,"div",6)(8,"input",7,0),P("ngModelChange",function(s){return d(e),M(t.subdomain,s)||(t.subdomain=s),p(s)}),a(),o(10,"label",8),r(11,"Subdomain"),a(),S(12,Se,3,0,"ng-container",3),a()(),o(13,"div",5)(14,"div",9)(15,"input",10,1),P("ngModelChange",function(s){return d(e),M(t.password,s)||(t.password=s),p(s)}),a(),o(17,"label",11),r(18,"Password"),a(),S(19,Te,3,0,"ng-container",3),o(20,"div",12)(21,"button",13),_("click",function(){return d(e),p(t.passwordVisibility.set(!t.passwordVisibility()))}),S(22,ge,1,0,"i",14)(23,be,1,0,"i",15),a()()()()()()()}if(i&2){let e=O(9),C=O(16);c("config",t.modalConfig)("dynamicValidated",t.password&&t.subdomain),m(2),c("ngIf",t.selectedClearData.message),m(4),x("Enter the following subdomain to confirm: ",t.subdomainPlaceholder,""),m(2),E("ngModel",t.subdomain),m(4),c("ngIf",e.invalid&&(e.dirty||e.touched)),m(3),c("type",t.passwordVisibility()?"text":"password"),E("ngModel",t.password),m(4),c("ngIf",C.invalid&&(C.dirty||C.touched)),m(3),F(t.passwordVisibility()?22:23)}},dependencies:[h,v,re,ne,Z,G,z,Q,J],styles:[".password-visibility[_ngcontent-%COMP%]{position:absolute;right:0;top:50%;transform:translateY(-50%);cursor:pointer;font-size:1.5rem}"]})};var V=n=>({"border border-0":n});function we(n,l){if(n&1&&(T(0),o(1,"tr",23)(2,"td",23),r(3),a(),o(4,"td",24),r(5),k(6,"number"),a()(),g()),n&2){let i=l.$implicit,t=l.index,e=u(2);m(),c("ngClass",D(7,V,t==e.data.Data.length-1)),m(),c("ngClass",D(9,V,t==e.data.Data.length-1)),m(),R(i.Key),m(),c("ngClass",D(11,V,t==e.data.Data.length-1)),m(),R(B(6,5,i.Value))}}function ye(n,l){if(n&1){let i=y();o(0,"mainpanel-cmp",1)(1,"actions")(2,"div",2)(3,"div",3)(4,"button",4),r(5," Format Data "),a(),o(6,"ul",5)(7,"li")(8,"a",6),_("click",function(){d(i);let e=u();return p(e.onClearRecord(e.clearDataType.TRANSACTIONS))}),r(9," 1. Clear Transactions "),a()(),o(10,"li")(11,"a",7),_("click",function(){d(i);let e=u();return p(e.onClearRecord(e.clearDataType.INVENTORY))}),r(12," 2. Clear Inventory "),a()(),o(13,"li")(14,"a",8),_("click",function(){d(i);let e=u();return p(e.onClearRecord(e.clearDataType.PRODUCTS))}),r(15," 3. Clear Products "),a()(),o(16,"li")(17,"a",9),_("click",function(){d(i);let e=u();return p(e.onClearRecord(e.clearDataType.CONTACTS))}),r(18," 4. Clear Contacts "),a()(),o(19,"li")(20,"a",10),_("click",function(){d(i);let e=u();return p(e.onClearRecord(e.clearDataType.LOYALTY_POINTS))}),r(21," 5. Clear Loyalty Point "),a()(),o(22,"li")(23,"a",11),_("click",function(){d(i);let e=u();return p(e.onClearRecord(e.clearDataType.RECYCLE_BIN))}),r(24," 6. Clear Recycle Bin "),a()()()()()(),o(25,"content")(26,"div",12)(27,"div",13)(28,"div",14)(29,"h5"),r(30,"Database Records"),a(),o(31,"i"),r(32,"Current data count"),a()(),o(33,"div",15)(34,"div",16)(35,"div",17)(36,"table",18)(37,"thead",19)(38,"tr",20)(39,"th"),r(40,"Table"),a(),o(41,"th",21),r(42,"Rows"),a()()(),o(43,"tbody"),S(44,we,7,13,"ng-container",22),a()()()()()()()()()}if(n&2){let i=u();c("pageData",i.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),m(44),c("ngForOf",i.data.Data)}}var pe=class n extends de{constructor(i,t,e,C,s){super(i,t,"Setup/DataLoader/clearformatdata",e);this.httpService=t;this.activatedRoute=e;this.toaster=C;this.dialog=s}clearDataType=I;onClearRecord(i){this.dialog.open(N,{data:{type:i,subDomain:this.data.SubDomain}}).afterClosed().pipe(A(t=>W.IsNotEmpty(t))).subscribe(t=>{this.formData={Subdomain:t.subdomain,Password:t.password},this.onSubmit(t.apiUrl),i=="PRODUCTS"?this.data.Data.find(e=>e.Key=="Product").Value=0:i=="CONTACTS"?this.data.Data.find(e=>e.Key=="Customer").Value=0:i=="INVENTORY"?this.data.Data.find(e=>e.Key=="ItemTransfer").Value=0:i=="LOYALTY_POINTS"?this.data.Data.find(e=>e.Key=="JournalHeader").Value=0:i=="RECYCLE_BIN"?this.data.Data.find(e=>e.Key=="Recycle Bin").Value=0:i=="TRANSACTIONS"&&(this.data.Data.find(e=>e.Key=="SalesOrder").Value=0)})}onSubmitSuccess(i){this.toaster.success(i.Message,ee.Success)}static \u0275fac=function(t){return new(t||n)(f(le),f($),f(H),f(q),f(oe))};static \u0275cmp=b({type:n,selectors:[["POS-format-data"]],features:[L],decls:1,vars:1,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox",4,"ngIf"],[3,"pageData","hideSearchDropdown","hideSearchBox"],[1,"d-flex"],[1,"dropdown"],["type","button","data-bs-toggle","dropdown","aria-expanded","false","confirm-message","Are you sure you want to clear the record?",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end"],["role","button","matTooltipPosition","above","matTooltip","Clear Transaction",1,"dropdown-item",3,"click"],["role","button","matTooltipPosition","above","matTooltip","Clear Inventory",1,"dropdown-item",3,"click"],["role","button","matTooltipPosition","above","matTooltip","Clear Products",1,"dropdown-item",3,"click"],["role","button","matTooltipPosition","above","matTooltip","Clear Contacts",1,"dropdown-item",3,"click"],["role","button","matTooltipPosition","above","matTooltip","Clear Loyalty Point",1,"dropdown-item",3,"click"],["role","button","matTooltipPosition","above","matTooltip","Clear Recycle Bin",1,"dropdown-item",3,"click"],[1,"container","pt-3"],[1,"row","border-bottom","mt-10","ms-2"],[1,"col-sm-2"],[1,"col-sm-10"],[1,"row"],[1,"col-md-12"],["id","tableGrid",1,"table",2,"width","250px"],[1,"thead-light","sticky-top-thead"],[1,"header"],[1,"text-end"],[4,"ngFor","ngForOf"],[3,"ngClass"],[1,"text-end",3,"ngClass"]],template:function(t,e){t&1&&S(0,ye,45,4,"mainpanel-cmp",0),t&2&&c("ngIf",e.formData)},dependencies:[h,U,j,v,K,se,me],encapsulation:2})};export{pe as FormatDataComponent};
1
+ import{a as de}from"./chunk-BKS3I5O7.js";import{h as me,i as se}from"./chunk-X4MTY5HS.js";import"./chunk-T4OLDAMN.js";import{b as le}from"./chunk-CQVVIZJ7.js";import"./chunk-52EOLV7I.js";import"./chunk-5UL73W4S.js";import{u as ae,v as ne,w as re}from"./chunk-7ARFB5UX.js";import"./chunk-CIBQBSM6.js";import"./chunk-5UCQBOD6.js";import{e as te,f as ie,g as oe}from"./chunk-D35OBUDE.js";import"./chunk-567HXZXC.js";import"./chunk-CGESXTHC.js";import{a as ee}from"./chunk-2FWFPV5I.js";import"./chunk-TLOTIYIE.js";import{C as X,D as Z,c as G,h as z,o as J,y as Q}from"./chunk-P7HKWFZT.js";import"./chunk-RZ4V7O3L.js";import"./chunk-GR3EU2XL.js";import{a as W}from"./chunk-AHCRE4GP.js";import"./chunk-CRTHBX5Z.js";import{$a as m,Ac as B,Db as F,E as A,Ib as o,Jb as a,Kb as w,Lb as T,Ma as Y,Mb as g,Ob as y,Od as H,Qb as _,Rb as u,Vd as q,Wc as U,Yc as j,Yd as $,Zc as v,db as f,dc as O,ec as r,fc as R,gc as x,gd as K,jc as E,jd as h,kb as b,kc as M,lc as P,ob as L,qb as S,rc as D,va as d,vb as c,wa as p,zc as k}from"./chunk-DZT5XHBQ.js";import"./chunk-7DCB7DB2.js";var I=(s=>(s.TRANSACTIONS="TRANSACTIONS",s.PRODUCTS="PRODUCTS",s.CONTACTS="CONTACTS",s.LOYALTY_POINTS="LOYALTY_POINTS",s.RECYCLE_BIN="RECYCLE_BIN",s.INVENTORY="INVENTORY",s))(I||{});function _e(n,l){if(n&1&&(T(0),o(1,"div",4)(2,"div",5)(3,"div",16),w(4,"i",17),o(5,"span"),r(6),a()()()(),g()),n&2){let i=u();m(6),x(" ",i.selectedClearData.message," ")}}function Se(n,l){n&1&&(T(0),o(1,"small",18),r(2," *Subdomain is required "),a(),g())}function Te(n,l){n&1&&(T(0),o(1,"small",18),r(2," *Password is required "),a(),g())}function ge(n,l){n&1&&w(0,"i",14)}function be(n,l){n&1&&w(0,"i",15)}var N=class n{constructor(l,i,t){this.data=l;this.dialogRef=i;this.fb=t;this.modalConfig.title=this.modalTitle[this.data.type],this.subdomain="",this.subdomainPlaceholder=l.subDomain}clearData=[{type:"TRANSACTIONS",api:"Setup/Data/ClearTransaction",message:"Your Invoice, Bill, Adjustment, TransferOrder will be deleted"},{type:"PRODUCTS",api:"Setup/Data/ClearProduct",message:"Your Category, Product and Variant will be deleted"},{type:"LOYALTY_POINTS",api:"Setup/Data/ClearLoyaltyPoint"},{type:"RECYCLE_BIN",api:"Setup/Data/ClearRecycleBin"},{type:"INVENTORY",api:"Setup/Data/ClearInventory",message:"Your Product Inventory will be set to 0"},{type:"CONTACTS",api:"Setup/Data/ClearContact",message:"Your Customer, Supplier and Sales Person will be deleted"}];selectedClearData;modalConfig=new ae;modalTitle={TRANSACTIONS:"Clear Transactions",PRODUCTS:"Clear Products",LOYALTY_POINTS:"Clear Loyalty Points",RECYCLE_BIN:"Clear Recycle Bin",CONTACTS:"Clear Contacts",INVENTORY:"Clear Inventory"};subdomain;subdomainPlaceholder;password;form;passwordVisibility=Y(!1);ngOnInit(){this.initSelectedClearData(),this.form=this.fb.group({subdomain:[""],password:[""]})}initSelectedClearData(){this.selectedClearData=this.clearData.find(l=>l.type===this.data.type)}onSubmit(){let l={password:this.password,subdomain:this.subdomain,apiUrl:this.selectedClearData.api};this.dialogRef.close(l)}static \u0275fac=function(i){return new(i||n)(f(ie),f(te),f(X))};static \u0275cmp=b({type:n,selectors:[["app-confirmation-modal"]],decls:24,vars:10,consts:[["subdomainCtrl","ngModel"],["passwordCtrl","ngModel"],[3,"onOk","onClose","onCancel","config","dynamicValidated"],[4,"ngIf"],[1,"row"],[1,"col-12"],[1,"form-floating-outline","mt-5"],["type","text","id","subdomain","placeholder","Subdomain","name","subdomain","autofocus","","required","",1,"form-control",3,"ngModelChange","ngModel"],["for","subdomain"],[1,"form-floating-outline"],["id","pass","placeholder","Password","name","password","required","",1,"form-control",3,"ngModelChange","type","ngModel"],["for","pass"],[1,"password-visibility"],["type","button",1,"btn","btn-link",3,"click"],[1,"fa-solid","fa-eye"],[1,"fa-solid","fa-eye-slash"],[1,"alert","alert-warning","cursor","w-100"],[1,"fa-solid","fa-circle-exclamation","me-2"],[1,"control-label","text-danger"]],template:function(i,t){if(i&1){let e=y();o(0,"modal-material",2),_("onOk",function(){return d(e),p(t.onSubmit())})("onClose",function(){return d(e),p(t.dialogRef.close())})("onCancel",function(){return d(e),p(t.dialogRef.close())}),o(1,"content"),S(2,_e,7,1,"ng-container",3),o(3,"div",4)(4,"div",5)(5,"strong"),r(6),a(),o(7,"div",6)(8,"input",7,0),P("ngModelChange",function(s){return d(e),M(t.subdomain,s)||(t.subdomain=s),p(s)}),a(),o(10,"label",8),r(11,"Subdomain"),a(),S(12,Se,3,0,"ng-container",3),a()(),o(13,"div",5)(14,"div",9)(15,"input",10,1),P("ngModelChange",function(s){return d(e),M(t.password,s)||(t.password=s),p(s)}),a(),o(17,"label",11),r(18,"Password"),a(),S(19,Te,3,0,"ng-container",3),o(20,"div",12)(21,"button",13),_("click",function(){return d(e),p(t.passwordVisibility.set(!t.passwordVisibility()))}),S(22,ge,1,0,"i",14)(23,be,1,0,"i",15),a()()()()()()()}if(i&2){let e=O(9),C=O(16);c("config",t.modalConfig)("dynamicValidated",t.password&&t.subdomain),m(2),c("ngIf",t.selectedClearData.message),m(4),x("Enter the following subdomain to confirm: ",t.subdomainPlaceholder,""),m(2),E("ngModel",t.subdomain),m(4),c("ngIf",e.invalid&&(e.dirty||e.touched)),m(3),c("type",t.passwordVisibility()?"text":"password"),E("ngModel",t.password),m(4),c("ngIf",C.invalid&&(C.dirty||C.touched)),m(3),F(t.passwordVisibility()?22:23)}},dependencies:[h,v,re,ne,Z,G,z,Q,J],styles:[".password-visibility[_ngcontent-%COMP%]{position:absolute;right:0;top:50%;transform:translateY(-50%);cursor:pointer;font-size:1.5rem}"]})};var V=n=>({"border border-0":n});function we(n,l){if(n&1&&(T(0),o(1,"tr",23)(2,"td",23),r(3),a(),o(4,"td",24),r(5),k(6,"number"),a()(),g()),n&2){let i=l.$implicit,t=l.index,e=u(2);m(),c("ngClass",D(7,V,t==e.data.Data.length-1)),m(),c("ngClass",D(9,V,t==e.data.Data.length-1)),m(),R(i.Key),m(),c("ngClass",D(11,V,t==e.data.Data.length-1)),m(),R(B(6,5,i.Value))}}function ye(n,l){if(n&1){let i=y();o(0,"mainpanel-cmp",1)(1,"actions")(2,"div",2)(3,"div",3)(4,"button",4),r(5," Format Data "),a(),o(6,"ul",5)(7,"li")(8,"a",6),_("click",function(){d(i);let e=u();return p(e.onClearRecord(e.clearDataType.TRANSACTIONS))}),r(9," 1. Clear Transactions "),a()(),o(10,"li")(11,"a",7),_("click",function(){d(i);let e=u();return p(e.onClearRecord(e.clearDataType.INVENTORY))}),r(12," 2. Clear Inventory "),a()(),o(13,"li")(14,"a",8),_("click",function(){d(i);let e=u();return p(e.onClearRecord(e.clearDataType.PRODUCTS))}),r(15," 3. Clear Products "),a()(),o(16,"li")(17,"a",9),_("click",function(){d(i);let e=u();return p(e.onClearRecord(e.clearDataType.CONTACTS))}),r(18," 4. Clear Contacts "),a()(),o(19,"li")(20,"a",10),_("click",function(){d(i);let e=u();return p(e.onClearRecord(e.clearDataType.LOYALTY_POINTS))}),r(21," 5. Clear Loyalty Point "),a()(),o(22,"li")(23,"a",11),_("click",function(){d(i);let e=u();return p(e.onClearRecord(e.clearDataType.RECYCLE_BIN))}),r(24," 6. Clear Recycle Bin "),a()()()()()(),o(25,"content")(26,"div",12)(27,"div",13)(28,"div",14)(29,"h5"),r(30,"Database Records"),a(),o(31,"i"),r(32,"Current data count"),a()(),o(33,"div",15)(34,"div",16)(35,"div",17)(36,"table",18)(37,"thead",19)(38,"tr",20)(39,"th"),r(40,"Table"),a(),o(41,"th",21),r(42,"Rows"),a()()(),o(43,"tbody"),S(44,we,7,13,"ng-container",22),a()()()()()()()()()}if(n&2){let i=u();c("pageData",i.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),m(44),c("ngForOf",i.data.Data)}}var pe=class n extends de{constructor(i,t,e,C,s){super(i,t,"Setup/DataLoader/clearformatdata",e);this.httpService=t;this.activatedRoute=e;this.toaster=C;this.dialog=s}clearDataType=I;onClearRecord(i){this.dialog.open(N,{data:{type:i,subDomain:this.data.SubDomain}}).afterClosed().pipe(A(t=>W.IsNotEmpty(t))).subscribe(t=>{this.formData={Subdomain:t.subdomain,Password:t.password},this.onSubmit(t.apiUrl),i=="PRODUCTS"?this.data.Data.find(e=>e.Key=="Product").Value=0:i=="CONTACTS"?this.data.Data.find(e=>e.Key=="Customer").Value=0:i=="INVENTORY"?this.data.Data.find(e=>e.Key=="ItemTransfer").Value=0:i=="LOYALTY_POINTS"?this.data.Data.find(e=>e.Key=="JournalHeader").Value=0:i=="RECYCLE_BIN"?this.data.Data.find(e=>e.Key=="Recycle Bin").Value=0:i=="TRANSACTIONS"&&(this.data.Data.find(e=>e.Key=="SalesOrder").Value=0)})}onSubmitSuccess(i){this.toaster.success(i.Message,ee.Success)}static \u0275fac=function(t){return new(t||n)(f(le),f($),f(H),f(q),f(oe))};static \u0275cmp=b({type:n,selectors:[["POS-format-data"]],features:[L],decls:1,vars:1,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox",4,"ngIf"],[3,"pageData","hideSearchDropdown","hideSearchBox"],[1,"d-flex"],[1,"dropdown"],["type","button","data-bs-toggle","dropdown","aria-expanded","false","confirm-message","Are you sure you want to clear the record?",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end"],["role","button","matTooltipPosition","above","matTooltip","Clear Transaction",1,"dropdown-item",3,"click"],["role","button","matTooltipPosition","above","matTooltip","Clear Inventory",1,"dropdown-item",3,"click"],["role","button","matTooltipPosition","above","matTooltip","Clear Products",1,"dropdown-item",3,"click"],["role","button","matTooltipPosition","above","matTooltip","Clear Contacts",1,"dropdown-item",3,"click"],["role","button","matTooltipPosition","above","matTooltip","Clear Loyalty Point",1,"dropdown-item",3,"click"],["role","button","matTooltipPosition","above","matTooltip","Clear Recycle Bin",1,"dropdown-item",3,"click"],[1,"container","pt-3"],[1,"row","border-bottom","mt-10","ms-2"],[1,"col-sm-2"],[1,"col-sm-10"],[1,"row"],[1,"col-md-12"],["id","tableGrid",1,"table",2,"width","250px"],[1,"thead-light","sticky-top-thead"],[1,"header"],[1,"text-end"],[4,"ngFor","ngForOf"],[3,"ngClass"],[1,"text-end",3,"ngClass"]],template:function(t,e){t&1&&S(0,ye,45,4,"mainpanel-cmp",0),t&2&&c("ngIf",e.formData)},dependencies:[h,U,j,v,K,se,me],encapsulation:2})};export{pe as FormatDataComponent};
@@ -1,4 +1,4 @@
1
- import{a as ji}from"./chunk-UP3KWF4T.js";import{a as Li,c as Qi}from"./chunk-JOT2JETS.js";import{a as Kt}from"./chunk-AYYLS3ND.js";import{a as ki,b as Vi,c as Ri,d as $i,e as Bi,f as Be}from"./chunk-YDEXBKCL.js";import"./chunk-I5T3YLJW.js";import{a as Fi}from"./chunk-FMLC555I.js";import{a as Wt}from"./chunk-CFUU3EHR.js";import{a as hi}from"./chunk-6SK3XWNT.js";import{a as qt}from"./chunk-Y4MOEVLJ.js";import{a as In}from"./chunk-UU5RJKWG.js";import{c as Mi,d as Pi}from"./chunk-LVTGTXYR.js";import"./chunk-7BU64MD2.js";import{a as Ei}from"./chunk-P5PNY2PR.js";import{a as Ni}from"./chunk-FHUSU4FC.js";import"./chunk-5JZJ4OL3.js";import"./chunk-SE7OFLAL.js";import"./chunk-NOLQHNIQ.js";import"./chunk-WLRXTHLM.js";import{a as Ht,b as Si,c as Ii}from"./chunk-ADCACICM.js";import"./chunk-PP2K4DVZ.js";import{a as Pt}from"./chunk-5VAXIJEW.js";import"./chunk-YOKPVEGO.js";import"./chunk-BYXBJQAS.js";import"./chunk-UCSQUJJW.js";import{b as _i}from"./chunk-5Q5T67DH.js";import"./chunk-OLALZT3L.js";import"./chunk-IUVGWNPX.js";import"./chunk-6N4AU5UX.js";import{d as vi,e as Ut}from"./chunk-5ZWOT4WG.js";import"./chunk-WAWDDMQZ.js";import"./chunk-3RK6DDJD.js";import"./chunk-L2EDFSBR.js";import{a as Ai}from"./chunk-GYWSH2X4.js";import"./chunk-A6YCCT6G.js";import{a as oi}from"./chunk-O7MCO2N7.js";import"./chunk-UZKYLAUE.js";import{b as Di}from"./chunk-KER7KQ5L.js";import{a as Oi,b as Ti,c as wi}from"./chunk-47MDCKEY.js";import{a as Jt,b as Gt}from"./chunk-7F6H3VFX.js";import"./chunk-HSZIMZAT.js";import"./chunk-TEFNN3TY.js";import"./chunk-BRUTIHV5.js";import{e as vt}from"./chunk-Y2LBBMGV.js";import"./chunk-JKYTSC2D.js";import{a as xi}from"./chunk-TGAOY65D.js";import"./chunk-BYXBJQAS.js";import{a as Qt}from"./chunk-XX6Z7QPA.js";import"./chunk-VQ7WKMGF.js";import"./chunk-OBNSNZON.js";import{a as ri,b as li,c as si}from"./chunk-A4CYZHDA.js";import"./chunk-3LBZWLLT.js";import"./chunk-X7G45LGM.js";import"./chunk-C6ARCDXZ.js";import"./chunk-FD5YMPRL.js";import"./chunk-MV3QRRW6.js";import{a as ci,d as pi,f as mi,h as di}from"./chunk-6ZOGADBZ.js";import{a as ot,c as at}from"./chunk-HA2GY7XU.js";import{a as ui,b as fi}from"./chunk-6KKSOYUD.js";import"./chunk-52EOLV7I.js";import{a as ii}from"./chunk-5UL73W4S.js";import{A as bi,G as Ci,q as ai,u as we,v as Ee,w as Ne,x as gi,z as yi}from"./chunk-7ARFB5UX.js";import{b as bt,c as Ct}from"./chunk-CIBQBSM6.js";import{P as $e}from"./chunk-5UCQBOD6.js";import{a as zn,b as Yn,c as Xn}from"./chunk-GIKR6Y2K.js";import{e as _t}from"./chunk-VMY3JQDA.js";import{a as ee,e as Te,f as Re,g as ne,l as Lt}from"./chunk-D35OBUDE.js";import"./chunk-567HXZXC.js";import"./chunk-UHJRDVRX.js";import"./chunk-CGESXTHC.js";import{a as xe}from"./chunk-2FWFPV5I.js";import"./chunk-TLOTIYIE.js";import{C as ti,D as Oe,E as Ke,a as Ge,b as Zn,c as he,h as le,l as me,o as Pe,r as ei,s as qe}from"./chunk-P7HKWFZT.js";import{a as ni}from"./chunk-XRNWNUVG.js";import{a as P,d as De}from"./chunk-AHCRE4GP.js";import"./chunk-PNUK526Z.js";import{$ as ct,$a as l,$b as At,Ac as y,Bc as Sn,D as tt,Db as mt,E as V,Fc as be,H as An,I as _e,Ib as a,Jb as r,Ka as Dn,Kb as I,Lb as Q,M as kn,Ma as pt,Mb as U,N as hn,Ob as B,Od as qn,Q as Vn,Qb as _,Qc as Hn,Qd as Kn,Rb as d,Rd as Bt,T as Rn,Td as jt,Ub as xn,Va as Bn,Vd as Je,W as Mt,Wa as nt,Wc as it,Y as te,Yc as He,Yd as se,Zb as Nt,Zc as pe,_a as jn,_b as Ft,aa as Z,bc as kt,ca as $n,cb as Ln,cc as Vt,cd as Ve,d as ve,db as f,dc as ue,e as Xe,ec as m,ed as Jn,f as En,fa as E,fb as Qn,fc as X,ga as de,gb as Et,gc as j,gd as Me,hc as We,ja as oe,jc as H,jd as F,k as Ae,kb as N,kc as L,lc as J,ma as W,n as Nn,na as ce,o as Ze,ob as Un,p as Fn,pc as ke,qb as D,qc as Rt,rc as ae,sc as $t,sd as Gn,t as u,u as Ie,v as _n,va as x,vb as c,wa as S,xb as yt,y as st,zb as Wn,zc as g}from"./chunk-DZT5XHBQ.js";import{a as T,b as R,d as wn,j as gt}from"./chunk-7DCB7DB2.js";var q=class i{constructor(t,e){this.http=e;this.buyForm=t.group({NewOrderID:[""],Order:t.group({Att:[""],SupplierID:[""],Number:[""],Date:[new Date],ID:[P.GuidEmpty]}),Invoice:t.group({ID:[P.GuidEmpty],Due:[new Date],Tax:[0]}),Payment:t.group({ID:[P.GuidEmpty],Amount:[0],MethodID:[0],Code:[""],Note:[""],ImageUrl:[""]})})}outlet=new me({ID:"",Name:"Choose an Outlet"});dueDays=new me(0);deliveryEntityID=new me(P.GuidEmpty);noteForm=new me({Note:"",TagID:"",Currency:{ID:"",ExchangeRate:0,Symbol:""},InvoiceNumber:""});discountAndTaxForm=new me({Discount:{Amount:0,Percentage:0},Tax:{ID:"",CalculationTypeName:"",Rate:0,Label:"",Discontinue:!1}});buyForm;setPONumber(t){let e="";if(t.Seed){let n=t.Seed+"";for(;n.length<t.Digit;)n="0"+n;e=P.StringFormat(t.Prefix,n)}this.buyForm.controls.Order.controls.Number.setValue(e)}setDueDateBasedOnDaysDue(t){console.log(t);let e=this.invoiceDate,n=new Date(P.cloneObject(e));n.setDate(n.getDate()+t),this.buyForm.controls.Invoice.controls.Due.setValue(n)}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=T({},this.discountAndTaxForm.value.Discount);this.discountAndTaxForm.setValue({Discount:e,Tax:t})}setCurrency(t){let e=this.noteForm.value;this.noteForm.setValue(R(T({},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(T(T({},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(P.GuidEmpty)}resetNoteForm(){this.noteForm.setValue(R(T({},this.noteForm.value),{Note:"",TagID:"",InvoiceNumber:""}))}resetDiscountAndTaxForm(){let t=this.discountAndTaxForm.value;this.discountAndTaxForm.setValue(R(T({},t),{Discount:{Amount:0,Percentage:0}}))}resetBuyForm(){this.buyForm.reset(),this.buyForm.controls.Invoice.controls.ID.setValue(P.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(P.GuidEmpty),this.generateNumberOnNewTransaction()}generateNumberOnNewTransaction(){this.http.post("/API/Buy/GenerateNumber",{ID:this.outlet.value.ID}).subscribe(t=>{this.setNewOrderID(P.Guid_NewGuid()),this.buyForm.controls.Order.controls.Number.setValue(t.Number)})}static \u0275fac=function(e){return new(e||i)(W(ti),W(se))};static \u0275prov=oe({token:i,factory:i.\u0275fac,providedIn:"root"})};var ge=class i{entities$;appConfigJSON$;taxes$;currencies$;supplierPOTypes$;predefinedNotes$;denomination$;defaultDueDays$;constructor(t,e){let n=t.get("/API/Buy2/Load").pipe(E(o=>e.setCurrency(o.Currencies.find(s=>s.ID==o.AppConfigJSON.CoreDefaults.CurrencyID))),te(1));this.denomination$=n.pipe(u(o=>o.Denomination)),this.entities$=n.pipe(u(o=>o.Entities)),this.appConfigJSON$=n.pipe(u(o=>o.AppConfigJSON)),this.taxes$=n.pipe(u(o=>o.Taxes),te(1)),this.currencies$=n.pipe(u(o=>o.Currencies),te(1)),this.supplierPOTypes$=n.pipe(u(o=>o.SupplierPOTypes)),this.predefinedNotes$=n.pipe(u(o=>o.PredefinedNotes)),this.defaultDueDays$=n.pipe(u(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||i)(W(se),W(q))};static \u0275prov=oe({token:i,factory:i.\u0275fac,providedIn:"root"})};var rt=class i{returnInvoiceNumber=new me("");invoiceInfo$;constructor(t,e,n){let o=e.outlet.valueChanges.pipe(u(p=>p.ID),ee());this.invoiceInfo$=this.returnInvoiceNumber.valueChanges.pipe(V(p=>!!p),de(o),Z(([p,M])=>t.post("/API/Buy/GetSupplierInvoiceRetur2",{EntityID:M,Number:p}).pipe(_e(()=>Ae))),te(1),ee());let s=this.invoiceInfo$.pipe(u(p=>T({},p.Order)),E(p=>{let M={Att:p.Att,SupplierID:{Key:p.SupplierID,Value:p.SupplierName,OnSet:!0},Date:new Date,Number:e.buyForm.controls.Order.controls.Number.value,ID:P.GuidEmpty};e.setBulkOrderForm(M)}),ee()),O=this.invoiceInfo$.pipe(u(p=>p.Order),E(p=>{let M={Note:`Return #${p.Number}`,TagID:p.TypeID,Currency:{ID:p.CurrencyID,ExchangeRate:p.CurrencyRate,Symbol:p.CurrencySymbol??"$"},InvoiceNumber:p.Number};e.setBulkNoteForm(M)}),ee()),v=this.invoiceInfo$.pipe(u(p=>p.Order),de(n.taxes$),u(([p,M])=>R(T({},p),{Tax:M.find(G=>G.ID===p.TaxTypeID)})),E(p=>{let M={Discount:{Amount:p.DiscountAmount,Percentage:p.Discount},Tax:{ID:p.TaxTypeID,Rate:p.Tax?.Rate,CalculationTypeName:p.Tax?.CalculationTypeName,Label:p.Tax?.Label,Discontinue:!p.Tax?.Label}};e.setBulkDiscountAndTaxForm(M)}),ee()),$=this.invoiceInfo$.pipe(u(p=>p.DeliveryEntityID),E(p=>e.setDeliveryEntityID(p)),ee()),K=this.invoiceInfo$.pipe(u(p=>p.Invoice),E(p=>{let M={ID:p.ID,Tax:p.Tax};e.setBulkInvoice(M)}),ee()),h=this.invoiceInfo$.pipe(u(p=>p.Payment),E(p=>{let M={ID:P.GuidEmpty,Amount:p.Amount,MethodID:p.MethodID,Note:p.Note,Code:p.Code,ImageUrl:p.ImageUrl};e.setBulkPayment(M)}),ee());Ie(s,O,v,$,K,h).pipe(ee()).subscribe()}static \u0275fac=function(e){return new(e||i)(W(se),W(q),W(ge))};static \u0275prov=oe({token:i,factory:i.\u0275fac,providedIn:"root"})};var ie=class i{constructor(t,e,n,o){this.matDialog=o;let s=e.outlet.valueChanges.pipe(u(p=>p.ID));this.addVariantThroughSerial$=this._addVariantThroughSerial.asObservable().pipe(de(s),Z(([p,M])=>t.get($e.GetVariantBySerial,[{key:"Serial",value:p},{key:"EntityID",value:M}]).pipe(_e(()=>Ae))),u(p=>this.setUnitPrice(p)),u(p=>R(T({},p),{Quantity:1,Total:p.UnitPrice,VariantID:p.ID})),u(p=>({action:"addAsSerial",variant:p})));let O=this.variantAutocomplete.valueChanges.pipe(V(p=>P.IsNotEmpty(p)&&p.type=="Code"),u(p=>p.str),de(s),Z(([p,M])=>t.get($e.GetVariantByCode,[{key:"Code",value:p},{key:"EntityID",value:M},{key:"Promotion",value:!0}]).pipe(_e(()=>Ae))),u(p=>this.setUnitPrice(p)),u(p=>R(T({},p),{Quantity:1,Total:p.UnitPrice*((100-p.PriceDiscount)/100),Discount:p.PriceDiscount,VariantID:p.ID}))),v=this.variantAutocomplete.valueChanges.pipe(V(p=>P.IsNotEmpty(p)&&p.type=="ID"),u(p=>p.str)),$=this.variantQuickKey.valueChanges,K=tt(v,$).pipe(de(s),Z(([p,M])=>t.get($e.GetVariantByID,[{key:"ID",value:p},{key:"EntityID",value:M}]).pipe(_e(()=>Ae))),u(p=>this.setUnitPrice(p)),u(p=>R(T({},p),{Quantity:1,Total:p.UnitPrice*((100-p.OrderPriceDiscount)/100),Discount:p.OrderPriceDiscount,VariantID:p.ID}))),h=tt(K,O).pipe(E(p=>{p.CategoryTypeID===1&&this.toastr.info(`${p.Name} is sellable only.`,xe.Info)}),V(p=>p.CategoryTypeID!==1),u(p=>({action:"add",variant:p})),E(()=>{this.cartDisplayRef&&setTimeout(()=>{let p=this.cartDisplayRef.nativeElement.scrollHeight;this.cartDisplayRef.nativeElement.scrollTop=p},1)})),A=n.invoiceInfo$.pipe(u(p=>({action:"returnInvoice",variants:p.Items.map(M=>R(T({},M.Variant),{Quantity:M.Quantity,Total:M.Total,UnitPrice:M.UnitPrice,Discount:M.Discount,Serial:M.Serial,ID:M.ID,DiscountAmount:M.DiscountAmount,VariantID:M.VariantID,UnitQuantity:M.UnitQuantity}))})));this.cart$=tt(h,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(Mt((p,M)=>{let G=[...p],Y=[],b=M.action;if(b=="add"){let C=M.variant;Y=!!G.find(k=>k.VariantID==C.ID)?G.map(k=>k.VariantID==C.ID?R(T({},k),{Quantity:k.Quantity+1,Total:k.Total+k.UnitPrice}):k):[...G,C]}else if(b=="returnInvoice"||b=="onEditForm")Y=M.variants;else if(b=="delete"){let C=M.index;Y=G.filter((w,k)=>k!=C)}else if(b=="sort"){let C=M.ev;Y=G,ci(Y,C.previousIndex,C.currentIndex)}else if(b=="returnCart")Y=G.map(C=>R(T({},C),{Quantity:-Math.abs(C.Quantity),Total:-Math.abs(C.Total)}));else if(b=="update"){let C=M.index;Y=G.map((w,k)=>k==C?M.variant:w)}else if(b=="returnVariant"){let C=M.index;Y=G.map((w,k)=>k==C?R(T({},w),{Quantity:-Math.abs(w.Quantity),Total:-Math.abs(w.Total)}):w)}else if(b=="purchaseVariant"){let C=M.index;Y=G.map((w,k)=>k==C?R(T({},w),{Quantity:Math.abs(w.Quantity),Total:Math.abs(w.Total)}):w)}else if(b=="clearCart")Y=[];else if(b=="addAsSerial"){let C=R(T({},M.variant),{Serial:[{Number:M.variant.Serial.Number,Quantity:1,ExpiryDate:M.variant.Serial.ExpiryDate}]});if(!!G.find(k=>k.ID==C.ID)){let k=C.Serial[0],Ce=G.find(fe=>fe.ID==C.ID),wt=!!Ce.Serial.find(fe=>fe.Number==k.Number)?[...Ce.Serial].map(fe=>fe.Number==k.Number?R(T({},fe),{Quantity:fe.Quantity+1}):fe):[...Ce.Serial,k];Y=G.map(fe=>fe.ID==C.ID?R(T({},fe),{Quantity:fe.Quantity+1,Total:fe.Total+fe.UnitPrice,Serial:wt}):fe)}else Y=[...G,R(T({},C),{Quantity:1,Total:C.UnitPrice})]}else if(b=="uploadCart")Y=[...G,...M.variants];else if(b=="addNewRow"){let C=M.variant;Y=[...G,C]}else if(b=="rfid"){let C=M.variants;Object.keys(C).forEach(w=>{if(C.hasOwnProperty(w)){let k=C[w];if(k&&Object.keys(k.variant).length>0){let Ce=G.findIndex(ft=>ft.Code.toLowerCase()===w.toLowerCase());if(Ce!==-1){let ft=Number(k.count);G[Ce].Quantity+=ft,G[Ce].Total=+G[Ce].UnitPrice*+G[Ce].Quantity,delete C[w],Y=[...G]}else{let ft=k.variant,wt=Number(k.count),fe=this.setUnitPrice(ft),Ki=this.formatItemObject(R(T({},fe),{Quantity:wt,Total:+fe.UnitPrice*+wt}));delete C[w],Y=[...G,Ki]}}}})}return Y},[]),ct([]),te(1)),this.totalVariantOrdered$=this.cart$.pipe(u(p=>p.map(M=>M.Quantity)),u(p=>p.reduce((M,G)=>M+G,0)),ct(0))}toastr=ce(Je);cartDisplayRef;variantAutocomplete=new me;variantQuickKey=new me;_listenRFID=new ve;listenRFID$=this._listenRFID.asObservable().pipe(u(t=>({action:"rfid",variants:t})));_deleteVariant=new ve;deleteVariant$=this._deleteVariant.asObservable().pipe(u(t=>({action:"delete",index:t})));_dragDropCart=new ve;dragDropCart$=this._dragDropCart.asObservable().pipe(u(t=>({action:"sort",ev:t})));_returnCart=new ve;returnCart$=this._returnCart.asObservable().pipe(u(()=>({action:"returnCart"})));_onEditForm=new Xe(null);onEditForm$=this._onEditForm.asObservable().pipe(V(t=>!!t),u(t=>({action:"onEditForm",variants:t})));_clearCart=new ve;clearCart$=this._clearCart.asObservable().pipe(u(()=>({action:"clearCart"})));_updateVariant=new ve;updateVariant$=this._updateVariant.asObservable().pipe(u(t=>({action:"update",variant:t.variant,index:t.index})));_returnVariant=new ve;returnVariant$=this._returnVariant.asObservable().pipe(u(t=>({action:"returnVariant",index:t})));_purchaseVariant=new ve;purchaseVariant$=this._purchaseVariant.asObservable().pipe(u(t=>({action:"purchaseVariant",index:t})));_addVariant=new ve;addVariant$=this._addVariant.asObservable().pipe(u(t=>({action:"addNewRow",variant:t})));_onUploadCart=new ve;onUploadCart$=this._onUploadCart.asObservable().pipe(u(t=>({action:"uploadCart",variants:t})));cart$;totalVariantOrdered$;_addVariantThroughSerial=new ve;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=T({},t);return P.IsNotEmpty(t.OrderPrice)?e.UnitPrice=t.OrderPrice:e.UnitPrice=t.UnitCost,e}formatItemObject=t=>{let o=t,{ID:e}=o,n=wn(o,["ID"]);return R(T({},n),{Quantity:n.Quantity??1,Total:n.Total??n.UnitPrice,VariantID:e})};addCartRFID(t){this._listenRFID.next(t)}static \u0275fac=function(e){return new(e||i)(W(se),W(q),W(rt),W(ne))};static \u0275prov=oe({token:i,factory:i.\u0275fac,providedIn:"root"})};var je=class i{_isEdit=new ve;isEdit$;id$;isUnpaid$;dialog=ce(ne);constructor(t,e,n,o,s){let O=Ze(t.snapshot.queryParams);this.isEdit$=tt(O.pipe(u(b=>!!b.ID)),this._isEdit.asObservable()).pipe(te(1)),this.id$=O.pipe(V(b=>b.ID),u(b=>b.ID));let v=this.id$.pipe(Z(b=>e.post("/api/Buy2/GetDataByID2",{ID:b})),te(1)),$=st(()=>o.entities$).pipe(Z(b=>v.pipe(u(C=>[C.Order,b]))),E(([b,C])=>{let w={Att:b.Att,SupplierID:{Key:b.SupplierID,Value:b.SupplierName,OnSet:!0},Date:b.Date,Number:b.Number,ID:b.ID};n.setBulkOrderForm(w)}),E(([b,C])=>{let w=C.find(k=>k.ID==b.EntityID);n.setOutletForm(w)})),K=v.pipe(u(b=>b.Items),u(b=>b.map(C=>R(T({},C.Variant),{Quantity:C.Quantity,Total:C.Total,Note:C.Note,UnitPrice:C.UnitPrice,Discount:C.Discount,Serial:C.Serial,ID:C.ID,VariantID:C.VariantID,UnitQuantity:C.UnitQuantity,QtyRequested:C.QtyRequested,DiscountAmount:C.DiscountAmount}))),E(b=>s.editForm(b))),h=st(()=>o.currencies$).pipe(Z(b=>v.pipe(u(C=>[C.Order,b,C.Invoice]))),u(([b,C,w])=>R(T({},b),{Number:b.Number!=w.Number?w.Number:b.Number,Currency:C.find(k=>k.ID===b.CurrencyID)})),E(b=>{let C={Note:b.Note,TagID:b.TypeID,Currency:T({},b.Currency),InvoiceNumber:b.Number};n.setBulkNoteForm(C)})),A=v.pipe(u(b=>b.DeliveryEntityID),E(b=>n.setDeliveryEntityID(b))),p=st(()=>o.taxes$).pipe(Z(b=>v.pipe(u(C=>[C.Order,b]))),u(([b,C])=>R(T({},b),{Taxes:C})),E(b=>{let C=b.Taxes.find(k=>k.ID===b.TaxTypeID);C?.Bin&&this.dialog.open(Ht,{id:"ModalInfo",data:{title:"Default Tax Discontinued",message:`
1
+ import{a as ji}from"./chunk-UP3KWF4T.js";import{a as Li,c as Qi}from"./chunk-JOT2JETS.js";import{a as Kt}from"./chunk-AYYLS3ND.js";import{a as ki,b as Vi,c as Ri,d as $i,e as Bi,f as Be}from"./chunk-YDEXBKCL.js";import"./chunk-I5T3YLJW.js";import{a as Fi}from"./chunk-FMLC555I.js";import{a as Wt}from"./chunk-CFUU3EHR.js";import{a as hi}from"./chunk-6SK3XWNT.js";import{a as qt}from"./chunk-Y4MOEVLJ.js";import{a as In}from"./chunk-UU5RJKWG.js";import{c as Mi,d as Pi}from"./chunk-LVTGTXYR.js";import"./chunk-7BU64MD2.js";import{a as Ei}from"./chunk-P5PNY2PR.js";import{a as Ni}from"./chunk-FHUSU4FC.js";import"./chunk-5JZJ4OL3.js";import"./chunk-SE7OFLAL.js";import"./chunk-NOLQHNIQ.js";import"./chunk-WLRXTHLM.js";import{a as Ht,b as Si,c as Ii}from"./chunk-ADCACICM.js";import"./chunk-PP2K4DVZ.js";import{a as Pt}from"./chunk-5VAXIJEW.js";import"./chunk-YOKPVEGO.js";import"./chunk-BYXBJQAS.js";import"./chunk-UCSQUJJW.js";import{b as _i}from"./chunk-5Q5T67DH.js";import"./chunk-OLALZT3L.js";import"./chunk-IUVGWNPX.js";import"./chunk-6N4AU5UX.js";import{d as vi,e as Ut}from"./chunk-5ZWOT4WG.js";import"./chunk-WAWDDMQZ.js";import"./chunk-3RK6DDJD.js";import"./chunk-L2EDFSBR.js";import{a as Ai}from"./chunk-GYWSH2X4.js";import"./chunk-A6YCCT6G.js";import{a as oi}from"./chunk-O7MCO2N7.js";import"./chunk-UZKYLAUE.js";import{b as Di}from"./chunk-KER7KQ5L.js";import{a as Oi,b as Ti,c as wi}from"./chunk-47MDCKEY.js";import{a as Jt,b as Gt}from"./chunk-7F6H3VFX.js";import"./chunk-HSZIMZAT.js";import"./chunk-TEFNN3TY.js";import"./chunk-BRUTIHV5.js";import{e as vt}from"./chunk-Y2LBBMGV.js";import"./chunk-JKYTSC2D.js";import{a as xi}from"./chunk-TGAOY65D.js";import"./chunk-BYXBJQAS.js";import{a as Qt}from"./chunk-XX6Z7QPA.js";import"./chunk-VQ7WKMGF.js";import"./chunk-OBNSNZON.js";import{a as ri,b as li,c as si}from"./chunk-A4CYZHDA.js";import"./chunk-3LBZWLLT.js";import"./chunk-X7G45LGM.js";import"./chunk-C6ARCDXZ.js";import"./chunk-FD5YMPRL.js";import"./chunk-MV3QRRW6.js";import{a as ci,d as pi,f as mi,h as di}from"./chunk-6ZOGADBZ.js";import{a as ot,c as at}from"./chunk-HA2GY7XU.js";import{a as ui,b as fi}from"./chunk-CQVVIZJ7.js";import"./chunk-52EOLV7I.js";import{a as ii}from"./chunk-5UL73W4S.js";import{A as bi,G as Ci,q as ai,u as we,v as Ee,w as Ne,x as gi,z as yi}from"./chunk-7ARFB5UX.js";import{b as bt,c as Ct}from"./chunk-CIBQBSM6.js";import{P as $e}from"./chunk-5UCQBOD6.js";import{a as zn,b as Yn,c as Xn}from"./chunk-GIKR6Y2K.js";import{e as _t}from"./chunk-VMY3JQDA.js";import{a as ee,e as Te,f as Re,g as ne,l as Lt}from"./chunk-D35OBUDE.js";import"./chunk-567HXZXC.js";import"./chunk-UHJRDVRX.js";import"./chunk-CGESXTHC.js";import{a as xe}from"./chunk-2FWFPV5I.js";import"./chunk-TLOTIYIE.js";import{C as ti,D as Oe,E as Ke,a as Ge,b as Zn,c as he,h as le,l as me,o as Pe,r as ei,s as qe}from"./chunk-P7HKWFZT.js";import{a as ni}from"./chunk-GR3EU2XL.js";import{a as P,d as De}from"./chunk-AHCRE4GP.js";import"./chunk-CRTHBX5Z.js";import{$ as ct,$a as l,$b as At,Ac as y,Bc as Sn,D as tt,Db as mt,E as V,Fc as be,H as An,I as _e,Ib as a,Jb as r,Ka as Dn,Kb as I,Lb as Q,M as kn,Ma as pt,Mb as U,N as hn,Ob as B,Od as qn,Q as Vn,Qb as _,Qc as Hn,Qd as Kn,Rb as d,Rd as Bt,T as Rn,Td as jt,Ub as xn,Va as Bn,Vd as Je,W as Mt,Wa as nt,Wc as it,Y as te,Yc as He,Yd as se,Zb as Nt,Zc as pe,_a as jn,_b as Ft,aa as Z,bc as kt,ca as $n,cb as Ln,cc as Vt,cd as Ve,d as ve,db as f,dc as ue,e as Xe,ec as m,ed as Jn,f as En,fa as E,fb as Qn,fc as X,ga as de,gb as Et,gc as j,gd as Me,hc as We,ja as oe,jc as H,jd as F,k as Ae,kb as N,kc as L,lc as J,ma as W,n as Nn,na as ce,o as Ze,ob as Un,p as Fn,pc as ke,qb as D,qc as Rt,rc as ae,sc as $t,sd as Gn,t as u,u as Ie,v as _n,va as x,vb as c,wa as S,xb as yt,y as st,zb as Wn,zc as g}from"./chunk-DZT5XHBQ.js";import{a as T,b as R,d as wn,j as gt}from"./chunk-7DCB7DB2.js";var q=class i{constructor(t,e){this.http=e;this.buyForm=t.group({NewOrderID:[""],Order:t.group({Att:[""],SupplierID:[""],Number:[""],Date:[new Date],ID:[P.GuidEmpty]}),Invoice:t.group({ID:[P.GuidEmpty],Due:[new Date],Tax:[0]}),Payment:t.group({ID:[P.GuidEmpty],Amount:[0],MethodID:[0],Code:[""],Note:[""],ImageUrl:[""]})})}outlet=new me({ID:"",Name:"Choose an Outlet"});dueDays=new me(0);deliveryEntityID=new me(P.GuidEmpty);noteForm=new me({Note:"",TagID:"",Currency:{ID:"",ExchangeRate:0,Symbol:""},InvoiceNumber:""});discountAndTaxForm=new me({Discount:{Amount:0,Percentage:0},Tax:{ID:"",CalculationTypeName:"",Rate:0,Label:"",Discontinue:!1}});buyForm;setPONumber(t){let e="";if(t.Seed){let n=t.Seed+"";for(;n.length<t.Digit;)n="0"+n;e=P.StringFormat(t.Prefix,n)}this.buyForm.controls.Order.controls.Number.setValue(e)}setDueDateBasedOnDaysDue(t){console.log(t);let e=this.invoiceDate,n=new Date(P.cloneObject(e));n.setDate(n.getDate()+t),this.buyForm.controls.Invoice.controls.Due.setValue(n)}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=T({},this.discountAndTaxForm.value.Discount);this.discountAndTaxForm.setValue({Discount:e,Tax:t})}setCurrency(t){let e=this.noteForm.value;this.noteForm.setValue(R(T({},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(T(T({},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(P.GuidEmpty)}resetNoteForm(){this.noteForm.setValue(R(T({},this.noteForm.value),{Note:"",TagID:"",InvoiceNumber:""}))}resetDiscountAndTaxForm(){let t=this.discountAndTaxForm.value;this.discountAndTaxForm.setValue(R(T({},t),{Discount:{Amount:0,Percentage:0}}))}resetBuyForm(){this.buyForm.reset(),this.buyForm.controls.Invoice.controls.ID.setValue(P.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(P.GuidEmpty),this.generateNumberOnNewTransaction()}generateNumberOnNewTransaction(){this.http.post("/API/Buy/GenerateNumber",{ID:this.outlet.value.ID}).subscribe(t=>{this.setNewOrderID(P.Guid_NewGuid()),this.buyForm.controls.Order.controls.Number.setValue(t.Number)})}static \u0275fac=function(e){return new(e||i)(W(ti),W(se))};static \u0275prov=oe({token:i,factory:i.\u0275fac,providedIn:"root"})};var ge=class i{entities$;appConfigJSON$;taxes$;currencies$;supplierPOTypes$;predefinedNotes$;denomination$;defaultDueDays$;constructor(t,e){let n=t.get("/API/Buy2/Load").pipe(E(o=>e.setCurrency(o.Currencies.find(s=>s.ID==o.AppConfigJSON.CoreDefaults.CurrencyID))),te(1));this.denomination$=n.pipe(u(o=>o.Denomination)),this.entities$=n.pipe(u(o=>o.Entities)),this.appConfigJSON$=n.pipe(u(o=>o.AppConfigJSON)),this.taxes$=n.pipe(u(o=>o.Taxes),te(1)),this.currencies$=n.pipe(u(o=>o.Currencies),te(1)),this.supplierPOTypes$=n.pipe(u(o=>o.SupplierPOTypes)),this.predefinedNotes$=n.pipe(u(o=>o.PredefinedNotes)),this.defaultDueDays$=n.pipe(u(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||i)(W(se),W(q))};static \u0275prov=oe({token:i,factory:i.\u0275fac,providedIn:"root"})};var rt=class i{returnInvoiceNumber=new me("");invoiceInfo$;constructor(t,e,n){let o=e.outlet.valueChanges.pipe(u(p=>p.ID),ee());this.invoiceInfo$=this.returnInvoiceNumber.valueChanges.pipe(V(p=>!!p),de(o),Z(([p,M])=>t.post("/API/Buy/GetSupplierInvoiceRetur2",{EntityID:M,Number:p}).pipe(_e(()=>Ae))),te(1),ee());let s=this.invoiceInfo$.pipe(u(p=>T({},p.Order)),E(p=>{let M={Att:p.Att,SupplierID:{Key:p.SupplierID,Value:p.SupplierName,OnSet:!0},Date:new Date,Number:e.buyForm.controls.Order.controls.Number.value,ID:P.GuidEmpty};e.setBulkOrderForm(M)}),ee()),O=this.invoiceInfo$.pipe(u(p=>p.Order),E(p=>{let M={Note:`Return #${p.Number}`,TagID:p.TypeID,Currency:{ID:p.CurrencyID,ExchangeRate:p.CurrencyRate,Symbol:p.CurrencySymbol??"$"},InvoiceNumber:p.Number};e.setBulkNoteForm(M)}),ee()),v=this.invoiceInfo$.pipe(u(p=>p.Order),de(n.taxes$),u(([p,M])=>R(T({},p),{Tax:M.find(G=>G.ID===p.TaxTypeID)})),E(p=>{let M={Discount:{Amount:p.DiscountAmount,Percentage:p.Discount},Tax:{ID:p.TaxTypeID,Rate:p.Tax?.Rate,CalculationTypeName:p.Tax?.CalculationTypeName,Label:p.Tax?.Label,Discontinue:!p.Tax?.Label}};e.setBulkDiscountAndTaxForm(M)}),ee()),$=this.invoiceInfo$.pipe(u(p=>p.DeliveryEntityID),E(p=>e.setDeliveryEntityID(p)),ee()),K=this.invoiceInfo$.pipe(u(p=>p.Invoice),E(p=>{let M={ID:p.ID,Tax:p.Tax};e.setBulkInvoice(M)}),ee()),h=this.invoiceInfo$.pipe(u(p=>p.Payment),E(p=>{let M={ID:P.GuidEmpty,Amount:p.Amount,MethodID:p.MethodID,Note:p.Note,Code:p.Code,ImageUrl:p.ImageUrl};e.setBulkPayment(M)}),ee());Ie(s,O,v,$,K,h).pipe(ee()).subscribe()}static \u0275fac=function(e){return new(e||i)(W(se),W(q),W(ge))};static \u0275prov=oe({token:i,factory:i.\u0275fac,providedIn:"root"})};var ie=class i{constructor(t,e,n,o){this.matDialog=o;let s=e.outlet.valueChanges.pipe(u(p=>p.ID));this.addVariantThroughSerial$=this._addVariantThroughSerial.asObservable().pipe(de(s),Z(([p,M])=>t.get($e.GetVariantBySerial,[{key:"Serial",value:p},{key:"EntityID",value:M}]).pipe(_e(()=>Ae))),u(p=>this.setUnitPrice(p)),u(p=>R(T({},p),{Quantity:1,Total:p.UnitPrice,VariantID:p.ID})),u(p=>({action:"addAsSerial",variant:p})));let O=this.variantAutocomplete.valueChanges.pipe(V(p=>P.IsNotEmpty(p)&&p.type=="Code"),u(p=>p.str),de(s),Z(([p,M])=>t.get($e.GetVariantByCode,[{key:"Code",value:p},{key:"EntityID",value:M},{key:"Promotion",value:!0}]).pipe(_e(()=>Ae))),u(p=>this.setUnitPrice(p)),u(p=>R(T({},p),{Quantity:1,Total:p.UnitPrice*((100-p.PriceDiscount)/100),Discount:p.PriceDiscount,VariantID:p.ID}))),v=this.variantAutocomplete.valueChanges.pipe(V(p=>P.IsNotEmpty(p)&&p.type=="ID"),u(p=>p.str)),$=this.variantQuickKey.valueChanges,K=tt(v,$).pipe(de(s),Z(([p,M])=>t.get($e.GetVariantByID,[{key:"ID",value:p},{key:"EntityID",value:M}]).pipe(_e(()=>Ae))),u(p=>this.setUnitPrice(p)),u(p=>R(T({},p),{Quantity:1,Total:p.UnitPrice*((100-p.OrderPriceDiscount)/100),Discount:p.OrderPriceDiscount,VariantID:p.ID}))),h=tt(K,O).pipe(E(p=>{p.CategoryTypeID===1&&this.toastr.info(`${p.Name} is sellable only.`,xe.Info)}),V(p=>p.CategoryTypeID!==1),u(p=>({action:"add",variant:p})),E(()=>{this.cartDisplayRef&&setTimeout(()=>{let p=this.cartDisplayRef.nativeElement.scrollHeight;this.cartDisplayRef.nativeElement.scrollTop=p},1)})),A=n.invoiceInfo$.pipe(u(p=>({action:"returnInvoice",variants:p.Items.map(M=>R(T({},M.Variant),{Quantity:M.Quantity,Total:M.Total,UnitPrice:M.UnitPrice,Discount:M.Discount,Serial:M.Serial,ID:M.ID,DiscountAmount:M.DiscountAmount,VariantID:M.VariantID,UnitQuantity:M.UnitQuantity}))})));this.cart$=tt(h,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(Mt((p,M)=>{let G=[...p],Y=[],b=M.action;if(b=="add"){let C=M.variant;Y=!!G.find(k=>k.VariantID==C.ID)?G.map(k=>k.VariantID==C.ID?R(T({},k),{Quantity:k.Quantity+1,Total:k.Total+k.UnitPrice}):k):[...G,C]}else if(b=="returnInvoice"||b=="onEditForm")Y=M.variants;else if(b=="delete"){let C=M.index;Y=G.filter((w,k)=>k!=C)}else if(b=="sort"){let C=M.ev;Y=G,ci(Y,C.previousIndex,C.currentIndex)}else if(b=="returnCart")Y=G.map(C=>R(T({},C),{Quantity:-Math.abs(C.Quantity),Total:-Math.abs(C.Total)}));else if(b=="update"){let C=M.index;Y=G.map((w,k)=>k==C?M.variant:w)}else if(b=="returnVariant"){let C=M.index;Y=G.map((w,k)=>k==C?R(T({},w),{Quantity:-Math.abs(w.Quantity),Total:-Math.abs(w.Total)}):w)}else if(b=="purchaseVariant"){let C=M.index;Y=G.map((w,k)=>k==C?R(T({},w),{Quantity:Math.abs(w.Quantity),Total:Math.abs(w.Total)}):w)}else if(b=="clearCart")Y=[];else if(b=="addAsSerial"){let C=R(T({},M.variant),{Serial:[{Number:M.variant.Serial.Number,Quantity:1,ExpiryDate:M.variant.Serial.ExpiryDate}]});if(!!G.find(k=>k.ID==C.ID)){let k=C.Serial[0],Ce=G.find(fe=>fe.ID==C.ID),wt=!!Ce.Serial.find(fe=>fe.Number==k.Number)?[...Ce.Serial].map(fe=>fe.Number==k.Number?R(T({},fe),{Quantity:fe.Quantity+1}):fe):[...Ce.Serial,k];Y=G.map(fe=>fe.ID==C.ID?R(T({},fe),{Quantity:fe.Quantity+1,Total:fe.Total+fe.UnitPrice,Serial:wt}):fe)}else Y=[...G,R(T({},C),{Quantity:1,Total:C.UnitPrice})]}else if(b=="uploadCart")Y=[...G,...M.variants];else if(b=="addNewRow"){let C=M.variant;Y=[...G,C]}else if(b=="rfid"){let C=M.variants;Object.keys(C).forEach(w=>{if(C.hasOwnProperty(w)){let k=C[w];if(k&&Object.keys(k.variant).length>0){let Ce=G.findIndex(ft=>ft.Code.toLowerCase()===w.toLowerCase());if(Ce!==-1){let ft=Number(k.count);G[Ce].Quantity+=ft,G[Ce].Total=+G[Ce].UnitPrice*+G[Ce].Quantity,delete C[w],Y=[...G]}else{let ft=k.variant,wt=Number(k.count),fe=this.setUnitPrice(ft),Ki=this.formatItemObject(R(T({},fe),{Quantity:wt,Total:+fe.UnitPrice*+wt}));delete C[w],Y=[...G,Ki]}}}})}return Y},[]),ct([]),te(1)),this.totalVariantOrdered$=this.cart$.pipe(u(p=>p.map(M=>M.Quantity)),u(p=>p.reduce((M,G)=>M+G,0)),ct(0))}toastr=ce(Je);cartDisplayRef;variantAutocomplete=new me;variantQuickKey=new me;_listenRFID=new ve;listenRFID$=this._listenRFID.asObservable().pipe(u(t=>({action:"rfid",variants:t})));_deleteVariant=new ve;deleteVariant$=this._deleteVariant.asObservable().pipe(u(t=>({action:"delete",index:t})));_dragDropCart=new ve;dragDropCart$=this._dragDropCart.asObservable().pipe(u(t=>({action:"sort",ev:t})));_returnCart=new ve;returnCart$=this._returnCart.asObservable().pipe(u(()=>({action:"returnCart"})));_onEditForm=new Xe(null);onEditForm$=this._onEditForm.asObservable().pipe(V(t=>!!t),u(t=>({action:"onEditForm",variants:t})));_clearCart=new ve;clearCart$=this._clearCart.asObservable().pipe(u(()=>({action:"clearCart"})));_updateVariant=new ve;updateVariant$=this._updateVariant.asObservable().pipe(u(t=>({action:"update",variant:t.variant,index:t.index})));_returnVariant=new ve;returnVariant$=this._returnVariant.asObservable().pipe(u(t=>({action:"returnVariant",index:t})));_purchaseVariant=new ve;purchaseVariant$=this._purchaseVariant.asObservable().pipe(u(t=>({action:"purchaseVariant",index:t})));_addVariant=new ve;addVariant$=this._addVariant.asObservable().pipe(u(t=>({action:"addNewRow",variant:t})));_onUploadCart=new ve;onUploadCart$=this._onUploadCart.asObservable().pipe(u(t=>({action:"uploadCart",variants:t})));cart$;totalVariantOrdered$;_addVariantThroughSerial=new ve;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=T({},t);return P.IsNotEmpty(t.OrderPrice)?e.UnitPrice=t.OrderPrice:e.UnitPrice=t.UnitCost,e}formatItemObject=t=>{let o=t,{ID:e}=o,n=wn(o,["ID"]);return R(T({},n),{Quantity:n.Quantity??1,Total:n.Total??n.UnitPrice,VariantID:e})};addCartRFID(t){this._listenRFID.next(t)}static \u0275fac=function(e){return new(e||i)(W(se),W(q),W(rt),W(ne))};static \u0275prov=oe({token:i,factory:i.\u0275fac,providedIn:"root"})};var je=class i{_isEdit=new ve;isEdit$;id$;isUnpaid$;dialog=ce(ne);constructor(t,e,n,o,s){let O=Ze(t.snapshot.queryParams);this.isEdit$=tt(O.pipe(u(b=>!!b.ID)),this._isEdit.asObservable()).pipe(te(1)),this.id$=O.pipe(V(b=>b.ID),u(b=>b.ID));let v=this.id$.pipe(Z(b=>e.post("/api/Buy2/GetDataByID2",{ID:b})),te(1)),$=st(()=>o.entities$).pipe(Z(b=>v.pipe(u(C=>[C.Order,b]))),E(([b,C])=>{let w={Att:b.Att,SupplierID:{Key:b.SupplierID,Value:b.SupplierName,OnSet:!0},Date:b.Date,Number:b.Number,ID:b.ID};n.setBulkOrderForm(w)}),E(([b,C])=>{let w=C.find(k=>k.ID==b.EntityID);n.setOutletForm(w)})),K=v.pipe(u(b=>b.Items),u(b=>b.map(C=>R(T({},C.Variant),{Quantity:C.Quantity,Total:C.Total,Note:C.Note,UnitPrice:C.UnitPrice,Discount:C.Discount,Serial:C.Serial,ID:C.ID,VariantID:C.VariantID,UnitQuantity:C.UnitQuantity,QtyRequested:C.QtyRequested,DiscountAmount:C.DiscountAmount}))),E(b=>s.editForm(b))),h=st(()=>o.currencies$).pipe(Z(b=>v.pipe(u(C=>[C.Order,b,C.Invoice]))),u(([b,C,w])=>R(T({},b),{Number:b.Number!=w.Number?w.Number:b.Number,Currency:C.find(k=>k.ID===b.CurrencyID)})),E(b=>{let C={Note:b.Note,TagID:b.TypeID,Currency:T({},b.Currency),InvoiceNumber:b.Number};n.setBulkNoteForm(C)})),A=v.pipe(u(b=>b.DeliveryEntityID),E(b=>n.setDeliveryEntityID(b))),p=st(()=>o.taxes$).pipe(Z(b=>v.pipe(u(C=>[C.Order,b]))),u(([b,C])=>R(T({},b),{Taxes:C})),E(b=>{let C=b.Taxes.find(k=>k.ID===b.TaxTypeID);C?.Bin&&this.dialog.open(Ht,{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://res.cloudinary.com/pos/image/upload/v1705387550/POS/Images/Cashier/globalerror.svg"
4
4
  alt="Empty Sales Order Tag" />
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-XNA3D2E7.js";import"./chunk-NJIOGT5G.js";import"./chunk-BKS3I5O7.js";import"./chunk-J2YJ7UWM.js";import"./chunk-3RK6DDJD.js";import"./chunk-L2EDFSBR.js";import"./chunk-JKYTSC2D.js";import"./chunk-FD5YMPRL.js";import"./chunk-MV3QRRW6.js";import"./chunk-HA2GY7XU.js";import"./chunk-X4MTY5HS.js";import"./chunk-T4OLDAMN.js";import"./chunk-CQVVIZJ7.js";import"./chunk-52EOLV7I.js";import"./chunk-5UL73W4S.js";import"./chunk-7ARFB5UX.js";import"./chunk-CIBQBSM6.js";import"./chunk-5UCQBOD6.js";import"./chunk-D35OBUDE.js";import"./chunk-567HXZXC.js";import"./chunk-CGESXTHC.js";import"./chunk-2FWFPV5I.js";import"./chunk-TLOTIYIE.js";import"./chunk-P7HKWFZT.js";import"./chunk-RZ4V7O3L.js";import"./chunk-GR3EU2XL.js";import"./chunk-AHCRE4GP.js";import"./chunk-CRTHBX5Z.js";import"./chunk-DZT5XHBQ.js";import"./chunk-7DCB7DB2.js";export{a as SensitiveFieldComponent};
@@ -1 +1 @@
1
- import{a as A,b as G}from"./chunk-DPLLLOO5.js";import{d as Z,e as $}from"./chunk-5ZWOT4WG.js";import{a as K}from"./chunk-7RGCBUUG.js";import{h as X,i as Y}from"./chunk-A5ANN35P.js";import{b as U}from"./chunk-6KKSOYUD.js";import{e as Q}from"./chunk-VMY3JQDA.js";import{D as H,c as B,h as R,o as j}from"./chunk-P7HKWFZT.js";import{d as q}from"./chunk-AHCRE4GP.js";import{$a as p,Bc as y,Fc as W,Ib as i,Jb as o,Ob as S,Qb as C,Rb as s,Rd as V,Td as N,Vd as O,Wc as M,Yc as I,Yd as z,Zc as T,db as _,ec as m,ed as E,gc as x,gd as P,jc as b,jd as J,kb as F,kc as h,lc as f,ob as v,qb as u,qc as w,rc as L,sc as k,va as d,vb as l,wa as g,zc as D}from"./chunk-DZT5XHBQ.js";var te=()=>["/menu/Developer/Webhook/Job_Logs/Detail"],ie=a=>({ID:a}),oe=(a,c)=>({"text-success":a,"text-danger":c});function ae(a,c){if(a&1){let e=S();i(0,"div",12)(1,"h6"),m(2,"Status"),o(),i(3,"ng-select",13),f("ngModelChange",function(t){d(e);let r=s(2);return h(r.pageData.Filter.Status,t)||(r.pageData.Filter.Status=t),g(t)}),o(),i(4,"h6"),m(5,"Job ID"),o(),i(6,"input",14),f("ngModelChange",function(t){d(e);let r=s(2);return h(r.pageData.Filter.JobID,t)||(r.pageData.Filter.JobID=t),g(t)}),o(),i(7,"h6"),m(8,"From"),o(),i(9,"datepicker",15),f("dateChange",function(t){d(e);let r=s(2);return h(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),g(t)}),o(),i(10,"h6"),m(11,"To"),o(),i(12,"datepicker",16),f("dateChange",function(t){d(e);let r=s(2);return h(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),g(t)}),o()()}if(a&2){let e=s(2);p(3),l("disabled",!e.role.developer.Edit)("items",e.pageData.Options.Status),b("ngModel",e.pageData.Filter.Status),p(3),b("ngModel",e.pageData.Filter.JobID),p(3),l("isFloatingLabel",!1),b("date",e.pageData.Filter.From),p(3),l("isFloatingLabel",!1),b("date",e.pageData.Filter.To)}}function ne(a,c){if(a&1&&(i(0,"tr",17)(1,"td")(2,"a",18),m(3),D(4,"date"),o()(),i(5,"td"),m(6),D(7,"number"),o(),i(8,"td",19),m(9),o()()),a&2){let e=c.$implicit;p(2),l("routerLink",w(12,te))("queryParams",L(13,ie,e._id)),p(),x(" ",y(4,6,e._source["@timestamp_received"],"dd MMM yyyy HH:mm")," "),p(3),x("",y(7,9,e.DurationInSecond,"1.1-1")," s"),p(2),l("ngClass",k(15,oe,e._source.log.respCode==200,e._source.log.respCode!=200)),p(),x(" ",e._source.log.respCode," ")}}function re(a,c){if(a&1){let e=S();i(0,"mat-paginator",20),C("page",function(t){d(e);let r=s(2);return g(r.onPaginationChange(t))}),o()}if(a&2){let e=s(2);l("length",e.pagination.listTotal)("pageSize",e.pagination.pageSize)("pageIndex",e.pageData.Filter.PageNumber==0?0:e.pageData.Filter.PageNumber-1)}}function pe(a,c){if(a&1){let e=S();i(0,"mainpanel-cmp",2),C("onSubmit",function(){d(e);let t=s();return g(t.searchFromPageOne())}),i(1,"filters"),u(2,ae,13,8,"ng-template",null,0,W),o(),i(4,"content")(5,"div",3)(6,"div",4)(7,"table",5)(8,"thead",6)(9,"tr",7)(10,"th",8),m(11,"Created"),o(),i(12,"th",8),m(13,"Duration"),o(),i(14,"th",8),m(15,"Status"),o()()(),i(16,"tbody"),u(17,ne,10,18,"tr",9),o()()(),i(18,"div",10),u(19,re,1,3,"mat-paginator",11),o()()()()}if(a&2){let e=s();l("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),p(17),l("ngForOf",e.data.hits),p(2),l("ngIf",e.pagination.listTotal>0)}}var ee=class a extends K{constructor(e,n,t,r){super(e,n,"Developer/DeveloperSpace/Webhook/JobLogs","Developer/DeveloperSpace/WebhookLoader/GetLogs",t);this.httpService=n;this.role=r}postInit(e){this.data.hits=this.data?.hits.map(n=>(n.DurationInSecond=parseInt(n._source?.Duration)/1e3,n)),this.data.ListTotal=e?.total?.value}static \u0275fac=function(n){return new(n||a)(_(U),_(z),_(O),_(q))};static \u0275cmp=F({type:a,selectors:[["app-webhook-job-logs"]],features:[v],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","onSubmit",4,"ngIf"],[3,"onSubmit","pageData","hideSearchBox","isFilterOnDropdown"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"header"],[2,"width","50px"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"mt-2"],[3,"length","pageSize","pageIndex","page",4,"ngIf"],[1,"dialog-filter"],["bindLabel","Value","bindValue","Key","placeholder","Choose a status","appendTo","body",3,"ngModelChange","disabled","items","ngModel"],["type","text",1,"form-control",3,"ngModelChange","ngModel"],["placeholder","From","appearance","outline",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline",3,"dateChange","isFloatingLabel","date"],[1,"border-bottom"],[3,"routerLink","queryParams"],[3,"ngClass"],[3,"page","length","pageSize","pageIndex"]],template:function(n,t){n&1&&u(0,pe,20,5,"mainpanel-cmp",1),n&2&&l("ngIf",t.data)},dependencies:[J,M,I,T,P,E,Y,X,$,Z,G,A,Q,H,B,R,j,N,V],encapsulation:2})};export{ee as a};
1
+ import{a as A,b as G}from"./chunk-DPLLLOO5.js";import{d as Z,e as $}from"./chunk-5ZWOT4WG.js";import{a as K}from"./chunk-PBNWYWYT.js";import{h as X,i as Y}from"./chunk-X4MTY5HS.js";import{b as U}from"./chunk-CQVVIZJ7.js";import{e as Q}from"./chunk-VMY3JQDA.js";import{D as H,c as B,h as R,o as j}from"./chunk-P7HKWFZT.js";import{d as q}from"./chunk-AHCRE4GP.js";import{$a as p,Bc as y,Fc as W,Ib as i,Jb as o,Ob as S,Qb as C,Rb as s,Rd as V,Td as N,Vd as O,Wc as M,Yc as I,Yd as z,Zc as T,db as _,ec as m,ed as E,gc as x,gd as P,jc as b,jd as J,kb as F,kc as h,lc as f,ob as v,qb as u,qc as w,rc as L,sc as k,va as d,vb as l,wa as g,zc as D}from"./chunk-DZT5XHBQ.js";var te=()=>["/menu/Developer/Webhook/Job_Logs/Detail"],ie=a=>({ID:a}),oe=(a,c)=>({"text-success":a,"text-danger":c});function ae(a,c){if(a&1){let e=S();i(0,"div",12)(1,"h6"),m(2,"Status"),o(),i(3,"ng-select",13),f("ngModelChange",function(t){d(e);let r=s(2);return h(r.pageData.Filter.Status,t)||(r.pageData.Filter.Status=t),g(t)}),o(),i(4,"h6"),m(5,"Job ID"),o(),i(6,"input",14),f("ngModelChange",function(t){d(e);let r=s(2);return h(r.pageData.Filter.JobID,t)||(r.pageData.Filter.JobID=t),g(t)}),o(),i(7,"h6"),m(8,"From"),o(),i(9,"datepicker",15),f("dateChange",function(t){d(e);let r=s(2);return h(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),g(t)}),o(),i(10,"h6"),m(11,"To"),o(),i(12,"datepicker",16),f("dateChange",function(t){d(e);let r=s(2);return h(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),g(t)}),o()()}if(a&2){let e=s(2);p(3),l("disabled",!e.role.developer.Edit)("items",e.pageData.Options.Status),b("ngModel",e.pageData.Filter.Status),p(3),b("ngModel",e.pageData.Filter.JobID),p(3),l("isFloatingLabel",!1),b("date",e.pageData.Filter.From),p(3),l("isFloatingLabel",!1),b("date",e.pageData.Filter.To)}}function ne(a,c){if(a&1&&(i(0,"tr",17)(1,"td")(2,"a",18),m(3),D(4,"date"),o()(),i(5,"td"),m(6),D(7,"number"),o(),i(8,"td",19),m(9),o()()),a&2){let e=c.$implicit;p(2),l("routerLink",w(12,te))("queryParams",L(13,ie,e._id)),p(),x(" ",y(4,6,e._source["@timestamp_received"],"dd MMM yyyy HH:mm")," "),p(3),x("",y(7,9,e.DurationInSecond,"1.1-1")," s"),p(2),l("ngClass",k(15,oe,e._source.log.respCode==200,e._source.log.respCode!=200)),p(),x(" ",e._source.log.respCode," ")}}function re(a,c){if(a&1){let e=S();i(0,"mat-paginator",20),C("page",function(t){d(e);let r=s(2);return g(r.onPaginationChange(t))}),o()}if(a&2){let e=s(2);l("length",e.pagination.listTotal)("pageSize",e.pagination.pageSize)("pageIndex",e.pageData.Filter.PageNumber==0?0:e.pageData.Filter.PageNumber-1)}}function pe(a,c){if(a&1){let e=S();i(0,"mainpanel-cmp",2),C("onSubmit",function(){d(e);let t=s();return g(t.searchFromPageOne())}),i(1,"filters"),u(2,ae,13,8,"ng-template",null,0,W),o(),i(4,"content")(5,"div",3)(6,"div",4)(7,"table",5)(8,"thead",6)(9,"tr",7)(10,"th",8),m(11,"Created"),o(),i(12,"th",8),m(13,"Duration"),o(),i(14,"th",8),m(15,"Status"),o()()(),i(16,"tbody"),u(17,ne,10,18,"tr",9),o()()(),i(18,"div",10),u(19,re,1,3,"mat-paginator",11),o()()()()}if(a&2){let e=s();l("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),p(17),l("ngForOf",e.data.hits),p(2),l("ngIf",e.pagination.listTotal>0)}}var ee=class a extends K{constructor(e,n,t,r){super(e,n,"Developer/DeveloperSpace/Webhook/JobLogs","Developer/DeveloperSpace/WebhookLoader/GetLogs",t);this.httpService=n;this.role=r}postInit(e){this.data.hits=this.data?.hits.map(n=>(n.DurationInSecond=parseInt(n._source?.Duration)/1e3,n)),this.data.ListTotal=e?.total?.value}static \u0275fac=function(n){return new(n||a)(_(U),_(z),_(O),_(q))};static \u0275cmp=F({type:a,selectors:[["app-webhook-job-logs"]],features:[v],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","onSubmit",4,"ngIf"],[3,"onSubmit","pageData","hideSearchBox","isFilterOnDropdown"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"header"],[2,"width","50px"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"mt-2"],[3,"length","pageSize","pageIndex","page",4,"ngIf"],[1,"dialog-filter"],["bindLabel","Value","bindValue","Key","placeholder","Choose a status","appendTo","body",3,"ngModelChange","disabled","items","ngModel"],["type","text",1,"form-control",3,"ngModelChange","ngModel"],["placeholder","From","appearance","outline",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline",3,"dateChange","isFloatingLabel","date"],[1,"border-bottom"],[3,"routerLink","queryParams"],[3,"ngClass"],[3,"page","length","pageSize","pageIndex"]],template:function(n,t){n&1&&u(0,pe,20,5,"mainpanel-cmp",1),n&2&&l("ngIf",t.data)},dependencies:[J,M,I,T,P,E,Y,X,$,Z,G,A,Q,H,B,R,j,N,V],encapsulation:2})};export{ee as a};
@@ -1 +1 @@
1
- import{a as e}from"./chunk-4GGKDU75.js";import{a as t}from"./chunk-7DCB7DB2.js";var i=class extends e{constructor(r,a,o,l,s,p,F){super(r,a,o,l,s,p,F)}preInitLoader(){this.loaderPayload=t({ListIDs:this.reportFilterService.initOutletFilter([])},this.loaderPayload)}preInitList(){this.pageData.Filter.ListIDs=this.loaderPayload.ListIDs,this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}};export{i as a};
1
+ import{a as e}from"./chunk-ECSUCVRE.js";import{a as t}from"./chunk-7DCB7DB2.js";var i=class extends e{constructor(r,a,o,l,s,p,F){super(r,a,o,l,s,p,F)}preInitLoader(){this.loaderPayload=t({ListIDs:this.reportFilterService.initOutletFilter([])},this.loaderPayload)}preInitList(){this.pageData.Filter.ListIDs=this.loaderPayload.ListIDs,this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}};export{i as a};
@@ -1 +1 @@
1
- import{b as c}from"./chunk-NZVEUXSI.js";import{ja as r,na as s}from"./chunk-DZT5XHBQ.js";var i=class{to;from;constructor(){this.to=new Date,this.from=new Date}};var n=class o{cookiesService=s(c);_cookiesName="PaymentDate";dateFilter={from:new Date,to:new Date};set(e){this.saveFilterToCookie(e),this.dateFilter=e}initFilterDate(e){let t;if(this.checkCookieExists())t=this.get();else{let a=e.From||new Date,m=e.To||new Date;t={from:a,to:m}}return e.From=t.from,e.To=t.to,e}get(){return this.checkCookieExists()?this.dateFilter=JSON.parse(this.cookiesService.get(this._cookiesName)):this.dateFilter=new i,this.dateFilter}checkCookieExists(){return this.cookiesService.check(this._cookiesName)}saveFilterToCookie(e){this.cookiesService.set(this._cookiesName,JSON.stringify(e),this.getExpiredDate(),"/")}clear(){this.cookiesService.delete(this._cookiesName,"/"),this.dateFilter=new i}getExpiredDate(){let e=new Date,a=1*60*60*1e3;return e.setTime(e.getTime()+a),e}static \u0275fac=function(t){return new(t||o)};static \u0275prov=r({token:o,factory:o.\u0275fac,providedIn:"root"})};export{n as a};
1
+ import{b as c}from"./chunk-RZ4V7O3L.js";import{ja as r,na as s}from"./chunk-DZT5XHBQ.js";var i=class{to;from;constructor(){this.to=new Date,this.from=new Date}};var n=class o{cookiesService=s(c);_cookiesName="PaymentDate";dateFilter={from:new Date,to:new Date};set(e){this.saveFilterToCookie(e),this.dateFilter=e}initFilterDate(e){let t;if(this.checkCookieExists())t=this.get();else{let a=e.From||new Date,m=e.To||new Date;t={from:a,to:m}}return e.From=t.from,e.To=t.to,e}get(){return this.checkCookieExists()?this.dateFilter=JSON.parse(this.cookiesService.get(this._cookiesName)):this.dateFilter=new i,this.dateFilter}checkCookieExists(){return this.cookiesService.check(this._cookiesName)}saveFilterToCookie(e){this.cookiesService.set(this._cookiesName,JSON.stringify(e),this.getExpiredDate(),"/")}clear(){this.cookiesService.delete(this._cookiesName,"/"),this.dateFilter=new i}getExpiredDate(){let e=new Date,a=1*60*60*1e3;return e.setTime(e.getTime()+a),e}static \u0275fac=function(t){return new(t||o)};static \u0275prov=r({token:o,factory:o.\u0275fac,providedIn:"root"})};export{n as a};
@@ -1 +1 @@
1
- import{a as re}from"./chunk-XWD54EOV.js";import{a as ae,b as oe}from"./chunk-OLFWZQFT.js";import"./chunk-W2UCLTBY.js";import"./chunk-5Q5T67DH.js";import"./chunk-OLALZT3L.js";import"./chunk-IUVGWNPX.js";import"./chunk-6N4AU5UX.js";import{d as ie,e as ne}from"./chunk-5ZWOT4WG.js";import"./chunk-WAWDDMQZ.js";import"./chunk-3RK6DDJD.js";import"./chunk-L2EDFSBR.js";import"./chunk-HSZIMZAT.js";import"./chunk-TEFNN3TY.js";import"./chunk-BRUTIHV5.js";import"./chunk-JKYTSC2D.js";import"./chunk-TGAOY65D.js";import{e as ee}from"./chunk-PS4PFFPT.js";import"./chunk-VQ7WKMGF.js";import{a as K}from"./chunk-7RGCBUUG.js";import"./chunk-V4CJN6HP.js";import"./chunk-3LBZWLLT.js";import"./chunk-X7G45LGM.js";import"./chunk-C6ARCDXZ.js";import"./chunk-FD5YMPRL.js";import"./chunk-MV3QRRW6.js";import"./chunk-6ZOGADBZ.js";import{b as te}from"./chunk-WXF4SX6R.js";import{a as J,h as Z,i as $}from"./chunk-A5ANN35P.js";import"./chunk-IXKPLT63.js";import{b as X}from"./chunk-6KKSOYUD.js";import"./chunk-52EOLV7I.js";import"./chunk-5UL73W4S.js";import"./chunk-7ARFB5UX.js";import"./chunk-CIBQBSM6.js";import{P as Y}from"./chunk-5UCQBOD6.js";import"./chunk-ZT4RBJMM.js";import"./chunk-GIKR6Y2K.js";import{e as Q}from"./chunk-VMY3JQDA.js";import"./chunk-D35OBUDE.js";import"./chunk-567HXZXC.js";import"./chunk-UHJRDVRX.js";import"./chunk-CGESXTHC.js";import{a as z}from"./chunk-2FWFPV5I.js";import"./chunk-TLOTIYIE.js";import{D as U,h as j,o as G}from"./chunk-P7HKWFZT.js";import"./chunk-NZVEUXSI.js";import"./chunk-XRNWNUVG.js";import"./chunk-AHCRE4GP.js";import"./chunk-PNUK526Z.js";import{$a as c,Ac as x,Db as A,Eb as E,Fc as O,Gb as V,Hb as W,Ib as n,Jb as a,Kb as S,Lb as D,Mb as v,Ob as T,Qb as y,Rb as s,Vd as H,Y as k,Yd as q,Zc as L,cd as N,db as h,ec as u,fa as I,jc as g,jd as R,kb as P,kc as _,lc as f,na as B,ob as M,qb as C,va as p,vb as l,wa as m,zc as b}from"./chunk-DZT5XHBQ.js";import"./chunk-7DCB7DB2.js";function pe(o,d){if(o&1){let t=T();n(0,"button",7),y("click",function(){p(t);let e=s();return m(e.onPrint())}),S(1,"i",8),n(2,"span"),u(3,"Print"),a()()}}function me(o,d){if(o&1){let t=T();n(0,"div",9)(1,"h6"),u(2,"Outlet"),a(),n(3,"outlet-selector",10),f("ngModelChange",function(e){p(t);let i=s();return _(i.pageData.Filter.EntityID,e)||(i.pageData.Filter.EntityID=e),m(e)}),a(),n(4,"h6"),u(5,"Sales Order Tag"),a(),n(6,"ng-select",11),f("ngModelChange",function(e){p(t);let i=s();return _(i.pageData.Filter.SalesOrderTagID,e)||(i.pageData.Filter.SalesOrderTagID=e),m(e)}),a(),n(7,"h6"),u(8,"From"),a(),n(9,"div",12)(10,"div",13)(11,"datepicker",14),f("dateChange",function(e){p(t);let i=s();return _(i.pageData.Filter.From,e)||(i.pageData.Filter.From=e),m(e)}),a()(),n(12,"div",13)(13,"app-timepicker",15),f("timeChange",function(e){p(t);let i=s();return _(i.pageData.Filter.StartTime,e)||(i.pageData.Filter.StartTime=e),m(e)}),a()()(),n(14,"h6"),u(15,"To"),a(),n(16,"div",12)(17,"div",13)(18,"datepicker",16),f("dateChange",function(e){p(t);let i=s();return _(i.pageData.Filter.To,e)||(i.pageData.Filter.To=e),m(e)}),a()(),n(19,"div",13)(20,"app-timepicker",15),f("timeChange",function(e){p(t);let i=s();return _(i.pageData.Filter.EndTime,e)||(i.pageData.Filter.EndTime=e),m(e)}),a()()()()}if(o&2){let t=s();c(3),l("accessType",2),g("ngModel",t.pageData.Filter.EntityID),c(3),l("items",t.pageData==null||t.pageData.Options==null?null:t.pageData.Options.SalesOrderTags),g("ngModel",t.pageData.Filter.SalesOrderTagID),c(5),l("isFloatingLabel",!1),g("date",t.pageData.Filter.From),l("hidelClearBtn",!0),c(2),g("time",t.pageData.Filter.StartTime),l("fullWidth",!0),c(5),l("isFloatingLabel",!1)("hidelClearBtn",!0),g("date",t.pageData.Filter.To),c(2),g("time",t.pageData.Filter.EndTime),l("fullWidth",!0)}}function ce(o,d){o&1&&(D(0),n(1,"div",20),u(2,"\xA0"),a(),v())}function se(o,d){if(o&1&&(S(0,"pos-receipt-a4",17),n(1,"div",18),S(2,"div",19),a(),C(3,ce,3,0,"ng-container",6)),o&2){let t=d.$implicit,r=d.$index,e=s().ngIf,i=s();l("data",t)("printTemplate",i.printTemplates==null?null:i.printTemplates.get(t.PrintTemplateID))("config",e.AppConfig)("workOrderMode",!1)("fullMode",!0)("stylesheet",e.StylesSheet),c(3),l("ngIf",r!==(e.Data==null?null:e.Data.length)-1)}}function de(o,d){if(o&1&&(D(0),V(1,se,4,7,null,null,E),v()),o&2){let t=d.ngIf;c(),W(t.Data)}}var le=class o extends K{constructor(t,r,e){super(t,r,"Tool/GetBulkPrintLoader","Tool/GetBulkPrintLoader",e,null,!0);this.httpService=r}dialogFilter=B(J);receipts$;printTemplates;preInitList(){this.pageData.Filter.From=new Date,this.pageData.Filter.To=new Date,this.pageData.Filter.StartTime="00:00",this.pageData.Filter.EndTime="23:59"}onFilter(){this.receipts$=this.httpService.post(Y.GetBulkPrintA4,this.pageData.Filter).pipe(I(t=>{t?.Data?.length==0?this.toastrService.info("There are no transaction",z.Info):this.generatePrintTemplate(t.PrintTemplates)}),k(1))}generatePrintTemplate(t=[]){this.printTemplates=new Map(t.map(r=>[r.ID,r]))}onNewPrint(){this.dialogFilter.openDialog()}onPrint(){window.setTimeout(function(){window.print()},500)}static \u0275fac=function(r){return new(r||o)(h(X),h(q),h(H))};static \u0275cmp=P({type:o,selectors:[["bulk-invoice-A4"]],features:[M],decls:13,vars:10,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","pageData","hideSearchBox","text","hideSearchDropdown"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-success",3,"click"],["filters",""],[1,"container-fluid","mt-5"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],[1,"fa","fa-print","me-3"],[1,"dialog-filter"],["placeholder","Choose an Outlet",3,"ngModelChange","accessType","ngModel"],["bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","items","ngModel"],[1,"d-flex","align-items-center","gap-5"],[1,"w-100"],["placeholder","From","appearance","outline","name","From",1,"me-4",3,"dateChange","isFloatingLabel","date","hidelClearBtn"],[3,"timeChange","time","fullWidth"],["placeholder","To","appearance","outline","name","To",1,"me-4",3,"dateChange","isFloatingLabel","hidelClearBtn","date"],[3,"data","printTemplate","config","workOrderMode","fullMode","stylesheet"],[1,"d-print-none","mt-8"],[2,"border-top-style","dotted","margin-bottom","5px"],[1,"page-break"]],template:function(r,e){if(r&1){let i=T();n(0,"mainpanel-cmp",1),f("textChange",function(w){return p(i),_(e.pageData.Filter.Number,w)||(e.pageData.Filter.Number=w),m(w)}),y("onSubmit",function(){return p(i),m(e.onFilter())}),n(1,"actions"),C(2,pe,4,0,"button",2),b(3,"async"),n(4,"button",3),y("click",function(){return p(i),m(e.onNewPrint())}),u(5,"New"),a()(),n(6,"div",4),C(7,me,21,14,"ng-template",null,0,O),a(),n(9,"content")(10,"div",5),C(11,de,3,0,"ng-container",6),b(12,"async"),a()()()}if(r&2){let i;l("pageData",e.menuData)("hideSearchBox",!0),g("text",e.pageData.Filter.Number),l("hideSearchDropdown",!0),c(2),A(((i=x(3,6,e.receipts$))==null||i.Data==null?null:i.Data.length)>0?2:-1),c(9),l("ngIf",x(12,8,e.printTemplates&&e.receipts$))}},dependencies:[R,L,N,oe,ae,$,Z,te,Q,ne,ie,ee,U,j,G,re],styles:["input.p-inputtext{height:46.63px;border-color:#0000001f!important} input.p-inputtext :hover{border-color:#0000001f!important}@media print{.page-break[_ngcontent-%COMP%]{page-break-after:always}}"]})};export{le as BulkInvoiceA4Component};
1
+ import{a as re}from"./chunk-XWD54EOV.js";import{a as ae,b as oe}from"./chunk-OLFWZQFT.js";import"./chunk-W2UCLTBY.js";import"./chunk-5Q5T67DH.js";import"./chunk-OLALZT3L.js";import"./chunk-IUVGWNPX.js";import"./chunk-6N4AU5UX.js";import{d as ie,e as ne}from"./chunk-5ZWOT4WG.js";import"./chunk-WAWDDMQZ.js";import"./chunk-3RK6DDJD.js";import"./chunk-L2EDFSBR.js";import"./chunk-HSZIMZAT.js";import"./chunk-TEFNN3TY.js";import"./chunk-BRUTIHV5.js";import"./chunk-JKYTSC2D.js";import"./chunk-TGAOY65D.js";import{e as ee}from"./chunk-PS4PFFPT.js";import"./chunk-VQ7WKMGF.js";import{a as K}from"./chunk-PBNWYWYT.js";import"./chunk-56WYLSRZ.js";import"./chunk-3LBZWLLT.js";import"./chunk-X7G45LGM.js";import"./chunk-C6ARCDXZ.js";import"./chunk-FD5YMPRL.js";import"./chunk-MV3QRRW6.js";import"./chunk-6ZOGADBZ.js";import{b as te}from"./chunk-WXF4SX6R.js";import{a as J,h as Z,i as $}from"./chunk-X4MTY5HS.js";import"./chunk-T4OLDAMN.js";import{b as X}from"./chunk-CQVVIZJ7.js";import"./chunk-52EOLV7I.js";import"./chunk-5UL73W4S.js";import"./chunk-7ARFB5UX.js";import"./chunk-CIBQBSM6.js";import{P as Y}from"./chunk-5UCQBOD6.js";import"./chunk-ZT4RBJMM.js";import"./chunk-GIKR6Y2K.js";import{e as Q}from"./chunk-VMY3JQDA.js";import"./chunk-D35OBUDE.js";import"./chunk-567HXZXC.js";import"./chunk-UHJRDVRX.js";import"./chunk-CGESXTHC.js";import{a as z}from"./chunk-2FWFPV5I.js";import"./chunk-TLOTIYIE.js";import{D as U,h as j,o as G}from"./chunk-P7HKWFZT.js";import"./chunk-RZ4V7O3L.js";import"./chunk-GR3EU2XL.js";import"./chunk-AHCRE4GP.js";import"./chunk-CRTHBX5Z.js";import{$a as c,Ac as x,Db as A,Eb as E,Fc as O,Gb as V,Hb as W,Ib as n,Jb as a,Kb as S,Lb as D,Mb as v,Ob as T,Qb as y,Rb as s,Vd as H,Y as k,Yd as q,Zc as L,cd as N,db as h,ec as u,fa as I,jc as g,jd as R,kb as P,kc as _,lc as f,na as B,ob as M,qb as C,va as p,vb as l,wa as m,zc as b}from"./chunk-DZT5XHBQ.js";import"./chunk-7DCB7DB2.js";function pe(o,d){if(o&1){let t=T();n(0,"button",7),y("click",function(){p(t);let e=s();return m(e.onPrint())}),S(1,"i",8),n(2,"span"),u(3,"Print"),a()()}}function me(o,d){if(o&1){let t=T();n(0,"div",9)(1,"h6"),u(2,"Outlet"),a(),n(3,"outlet-selector",10),f("ngModelChange",function(e){p(t);let i=s();return _(i.pageData.Filter.EntityID,e)||(i.pageData.Filter.EntityID=e),m(e)}),a(),n(4,"h6"),u(5,"Sales Order Tag"),a(),n(6,"ng-select",11),f("ngModelChange",function(e){p(t);let i=s();return _(i.pageData.Filter.SalesOrderTagID,e)||(i.pageData.Filter.SalesOrderTagID=e),m(e)}),a(),n(7,"h6"),u(8,"From"),a(),n(9,"div",12)(10,"div",13)(11,"datepicker",14),f("dateChange",function(e){p(t);let i=s();return _(i.pageData.Filter.From,e)||(i.pageData.Filter.From=e),m(e)}),a()(),n(12,"div",13)(13,"app-timepicker",15),f("timeChange",function(e){p(t);let i=s();return _(i.pageData.Filter.StartTime,e)||(i.pageData.Filter.StartTime=e),m(e)}),a()()(),n(14,"h6"),u(15,"To"),a(),n(16,"div",12)(17,"div",13)(18,"datepicker",16),f("dateChange",function(e){p(t);let i=s();return _(i.pageData.Filter.To,e)||(i.pageData.Filter.To=e),m(e)}),a()(),n(19,"div",13)(20,"app-timepicker",15),f("timeChange",function(e){p(t);let i=s();return _(i.pageData.Filter.EndTime,e)||(i.pageData.Filter.EndTime=e),m(e)}),a()()()()}if(o&2){let t=s();c(3),l("accessType",2),g("ngModel",t.pageData.Filter.EntityID),c(3),l("items",t.pageData==null||t.pageData.Options==null?null:t.pageData.Options.SalesOrderTags),g("ngModel",t.pageData.Filter.SalesOrderTagID),c(5),l("isFloatingLabel",!1),g("date",t.pageData.Filter.From),l("hidelClearBtn",!0),c(2),g("time",t.pageData.Filter.StartTime),l("fullWidth",!0),c(5),l("isFloatingLabel",!1)("hidelClearBtn",!0),g("date",t.pageData.Filter.To),c(2),g("time",t.pageData.Filter.EndTime),l("fullWidth",!0)}}function ce(o,d){o&1&&(D(0),n(1,"div",20),u(2,"\xA0"),a(),v())}function se(o,d){if(o&1&&(S(0,"pos-receipt-a4",17),n(1,"div",18),S(2,"div",19),a(),C(3,ce,3,0,"ng-container",6)),o&2){let t=d.$implicit,r=d.$index,e=s().ngIf,i=s();l("data",t)("printTemplate",i.printTemplates==null?null:i.printTemplates.get(t.PrintTemplateID))("config",e.AppConfig)("workOrderMode",!1)("fullMode",!0)("stylesheet",e.StylesSheet),c(3),l("ngIf",r!==(e.Data==null?null:e.Data.length)-1)}}function de(o,d){if(o&1&&(D(0),V(1,se,4,7,null,null,E),v()),o&2){let t=d.ngIf;c(),W(t.Data)}}var le=class o extends K{constructor(t,r,e){super(t,r,"Tool/GetBulkPrintLoader","Tool/GetBulkPrintLoader",e,null,!0);this.httpService=r}dialogFilter=B(J);receipts$;printTemplates;preInitList(){this.pageData.Filter.From=new Date,this.pageData.Filter.To=new Date,this.pageData.Filter.StartTime="00:00",this.pageData.Filter.EndTime="23:59"}onFilter(){this.receipts$=this.httpService.post(Y.GetBulkPrintA4,this.pageData.Filter).pipe(I(t=>{t?.Data?.length==0?this.toastrService.info("There are no transaction",z.Info):this.generatePrintTemplate(t.PrintTemplates)}),k(1))}generatePrintTemplate(t=[]){this.printTemplates=new Map(t.map(r=>[r.ID,r]))}onNewPrint(){this.dialogFilter.openDialog()}onPrint(){window.setTimeout(function(){window.print()},500)}static \u0275fac=function(r){return new(r||o)(h(X),h(q),h(H))};static \u0275cmp=P({type:o,selectors:[["bulk-invoice-A4"]],features:[M],decls:13,vars:10,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","pageData","hideSearchBox","text","hideSearchDropdown"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-success",3,"click"],["filters",""],[1,"container-fluid","mt-5"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],[1,"fa","fa-print","me-3"],[1,"dialog-filter"],["placeholder","Choose an Outlet",3,"ngModelChange","accessType","ngModel"],["bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","items","ngModel"],[1,"d-flex","align-items-center","gap-5"],[1,"w-100"],["placeholder","From","appearance","outline","name","From",1,"me-4",3,"dateChange","isFloatingLabel","date","hidelClearBtn"],[3,"timeChange","time","fullWidth"],["placeholder","To","appearance","outline","name","To",1,"me-4",3,"dateChange","isFloatingLabel","hidelClearBtn","date"],[3,"data","printTemplate","config","workOrderMode","fullMode","stylesheet"],[1,"d-print-none","mt-8"],[2,"border-top-style","dotted","margin-bottom","5px"],[1,"page-break"]],template:function(r,e){if(r&1){let i=T();n(0,"mainpanel-cmp",1),f("textChange",function(w){return p(i),_(e.pageData.Filter.Number,w)||(e.pageData.Filter.Number=w),m(w)}),y("onSubmit",function(){return p(i),m(e.onFilter())}),n(1,"actions"),C(2,pe,4,0,"button",2),b(3,"async"),n(4,"button",3),y("click",function(){return p(i),m(e.onNewPrint())}),u(5,"New"),a()(),n(6,"div",4),C(7,me,21,14,"ng-template",null,0,O),a(),n(9,"content")(10,"div",5),C(11,de,3,0,"ng-container",6),b(12,"async"),a()()()}if(r&2){let i;l("pageData",e.menuData)("hideSearchBox",!0),g("text",e.pageData.Filter.Number),l("hideSearchDropdown",!0),c(2),A(((i=x(3,6,e.receipts$))==null||i.Data==null?null:i.Data.length)>0?2:-1),c(9),l("ngIf",x(12,8,e.printTemplates&&e.receipts$))}},dependencies:[R,L,N,oe,ae,$,Z,te,Q,ne,ie,ee,U,j,G,re],styles:["input.p-inputtext{height:46.63px;border-color:#0000001f!important} input.p-inputtext :hover{border-color:#0000001f!important}@media print{.page-break[_ngcontent-%COMP%]{page-break-after:always}}"]})};export{le as BulkInvoiceA4Component};