dealpos 25.31.2 → 25.31.4

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 (72) hide show
  1. package/browser/{chunk-XHBIIXPS.js → chunk-2DUED7ZR.js} +1 -1
  2. package/browser/{chunk-W5PF5BAF.js → chunk-2EVNVVFK.js} +1 -1
  3. package/browser/{chunk-ZESJJFN2.js → chunk-2T7IINRT.js} +1 -1
  4. package/browser/{chunk-6EI3EXE7.js → chunk-2ZGK5566.js} +1 -1
  5. package/browser/{chunk-TU4O6KBQ.js → chunk-32OZVFJK.js} +1 -1
  6. package/browser/{chunk-UHGOF24M.js → chunk-3G5ELBPD.js} +1 -1
  7. package/browser/{chunk-SJHBFLM7.js → chunk-466WTRXG.js} +1 -1
  8. package/browser/{chunk-HIUH7JJU.js → chunk-46H7MV5K.js} +1 -1
  9. package/browser/{chunk-L27WHOBJ.js → chunk-4P46Z6BK.js} +1 -1
  10. package/browser/{chunk-RGM2KZ5L.js → chunk-4UQJISWF.js} +1 -1
  11. package/browser/chunk-4XHFFY73.js +1 -0
  12. package/browser/{chunk-OBZMOT6W.js → chunk-6EQJIS3K.js} +1 -1
  13. package/browser/{chunk-74ZM5NHT.js → chunk-7O4KILVO.js} +1 -1
  14. package/browser/{chunk-YU32SBPB.js → chunk-7PKREZ2F.js} +1 -1
  15. package/browser/{chunk-J6RZLLDH.js → chunk-A2WJJXY7.js} +1 -1
  16. package/browser/{chunk-MLQCCNEW.js → chunk-ASTXFBCH.js} +2 -2
  17. package/browser/{chunk-J4GCFDIV.js → chunk-ATPD7KTM.js} +1 -1
  18. package/browser/{chunk-IPTLWEIL.js → chunk-B3SK6KY7.js} +1 -1
  19. package/browser/{chunk-ZSUZVVVK.js → chunk-BJ7PWFZL.js} +1 -1
  20. package/browser/{chunk-356IV4ZE.js → chunk-BK5ZN3WX.js} +1 -1
  21. package/browser/{chunk-VIYE2OFI.js → chunk-BKVMGGS5.js} +1 -1
  22. package/browser/{chunk-UD4WWZOI.js → chunk-CDA6RYZQ.js} +1 -1
  23. package/browser/{chunk-AHKKBRLR.js → chunk-CMJ47WH5.js} +1 -1
  24. package/browser/{chunk-Y5HNNIJE.js → chunk-CN4GZXKR.js} +1 -1
  25. package/browser/{chunk-4F5WEZVF.js → chunk-CW5S3DQO.js} +1 -1
  26. package/browser/{chunk-HR5WLTC4.js → chunk-D3M4Y45V.js} +1 -1
  27. package/browser/{chunk-DMSBV63C.js → chunk-DAVZ5ZHF.js} +1 -1
  28. package/browser/{chunk-PXKTG2K3.js → chunk-EPD7WB57.js} +1 -1
  29. package/browser/{chunk-6BSPRF7M.js → chunk-GFZOMKOU.js} +1 -1
  30. package/browser/{chunk-2BIGSZO5.js → chunk-GIUQ2MII.js} +1 -1
  31. package/browser/{chunk-S2MC4OUN.js → chunk-GWKGRN77.js} +1 -1
  32. package/browser/{chunk-B7DKFLLG.js → chunk-K7YL5PGK.js} +1 -1
  33. package/browser/{chunk-MGZYE4DB.js → chunk-K7ZF26GE.js} +1 -1
  34. package/browser/{chunk-LOHRG6CW.js → chunk-KAFG3VKC.js} +1 -1
  35. package/browser/{chunk-RVEF5C4M.js → chunk-KMN3C6MP.js} +1 -1
  36. package/browser/{chunk-4PC6PQ7Q.js → chunk-KWFATZFJ.js} +1 -1
  37. package/browser/{chunk-K4YULPNU.js → chunk-L2CVC562.js} +2 -2
  38. package/browser/{chunk-AWUM3KMS.js → chunk-LIPAZGM2.js} +1 -1
  39. package/browser/{chunk-4TP7S3U3.js → chunk-LV35QVNA.js} +1 -1
  40. package/browser/{chunk-CY4FO26Z.js → chunk-MGZTCXBX.js} +1 -1
  41. package/browser/{chunk-6HUVTRYH.js → chunk-NIZ2TPWB.js} +1 -1
  42. package/browser/{chunk-XETIOXLN.js → chunk-NXTRSCQX.js} +1 -1
  43. package/browser/{chunk-4GNV76N3.js → chunk-NZ7ZSG7T.js} +1 -1
  44. package/browser/{chunk-6IFNMT72.js → chunk-OKIY24GE.js} +1 -1
  45. package/browser/{chunk-DX2NQ3TK.js → chunk-OMIMFRRI.js} +1 -1
  46. package/browser/{chunk-N27F227W.js → chunk-OTNH2BIJ.js} +1 -1
  47. package/browser/{chunk-NARPOKGG.js → chunk-P6VK2PBY.js} +1 -1
  48. package/browser/{chunk-6K77FOTH.js → chunk-PCE2GBLC.js} +1 -1
  49. package/browser/{chunk-LWQAPXWM.js → chunk-PDZHVC4S.js} +1 -1
  50. package/browser/{chunk-4KJRE3GP.js → chunk-PIJ2427T.js} +1 -1
  51. package/browser/{chunk-SDGA5WRP.js → chunk-PQEPUK2L.js} +1 -1
  52. package/browser/{chunk-5WBNHRSF.js → chunk-PQMUNABI.js} +1 -1
  53. package/browser/{chunk-YUROCGY4.js → chunk-QVGY4BMQ.js} +1 -1
  54. package/browser/{chunk-EWLYV6PD.js → chunk-RVIZKQK2.js} +2 -2
  55. package/browser/{chunk-Q2ITLIW2.js → chunk-TBK74DIQ.js} +1 -1
  56. package/browser/{chunk-OPOZFMCV.js → chunk-TMIMCOHS.js} +1 -1
  57. package/browser/{chunk-A2QB6KDW.js → chunk-TW4WEQON.js} +2 -2
  58. package/browser/{chunk-SMHJ3JIG.js → chunk-TZWHX2KG.js} +2 -2
  59. package/browser/{chunk-2VRY7O77.js → chunk-UIHT537E.js} +1 -1
  60. package/browser/{chunk-JALOTTYL.js → chunk-URR2AQGO.js} +1 -1
  61. package/browser/{chunk-SGTPMFH6.js → chunk-VI33QAIU.js} +1 -1
  62. package/browser/{chunk-MAFIFJSJ.js → chunk-VYR4I7QG.js} +1 -1
  63. package/browser/{chunk-NRY2MTXW.js → chunk-W2TWTKY6.js} +1 -1
  64. package/browser/{chunk-JK75ENMS.js → chunk-WYL36OXL.js} +1 -1
  65. package/browser/{chunk-NCR5B5Y4.js → chunk-XESOCXQ6.js} +2 -2
  66. package/browser/{chunk-ZAJCD6I2.js → chunk-XOQX24GP.js} +1 -1
  67. package/browser/{chunk-7MB4HURG.js → chunk-YANTEHGF.js} +1 -1
  68. package/browser/{chunk-5233FXFY.js → chunk-YBMMLF6J.js} +1 -1
  69. package/browser/index.html +2 -2
  70. package/browser/{main-2NK4AXEX.js → main-UTJ7MSD7.js} +2 -2
  71. package/package.json +1 -1
  72. package/browser/chunk-ZOSMCW2A.js +0 -1
@@ -1 +1 @@
1
- import{c as N}from"./chunk-DMSBV63C.js";import"./chunk-MAFIFJSJ.js";import{a as D}from"./chunk-MP62IGYR.js";import"./chunk-J6RZLLDH.js";import{$ as _,$a as l,Ga as P,Ib as o,Jb as e,Kb as u,N as b,Ob as S,Od as G,Qb as I,Rb as f,Wd as j,Xc as A,Y as m,aa as s,ad as E,c as p,db as d,ec as a,fa as y,fc as x,hd as R,kb as w,n as v,qb as g,va as C,vb as c,wa as O,xc as L,yb as M,yc as k}from"./chunk-EDB2BAIG.js";import"./chunk-7DCB7DB2.js";function T(r,n){r&1&&(o(0,"div",21)(1,"span",22),a(2,"Latitude and Longitude is empty, please allow your browser location permission!"),e(),o(3,"a",23),a(4,"Click here to learn how to manually activate the location permission"),e()())}function z(r,n){if(r&1){let t=S();o(0,"div",1)(1,"div",2)(2,"div",3)(3,"h3",4),a(4,"Geo Fencing"),e(),o(5,"p",5),a(6,"You are about to sign-in from this location"),e(),o(7,"div",6)(8,"div",7)(9,"div",8)(10,"span",9),a(11,"LAT"),e(),o(12,"span",10),a(13),e()(),o(14,"div",8)(15,"span",11),a(16,"LONG"),e(),o(17,"span",12),a(18),e()()(),o(19,"button",13),I("click",function(){C(t);let h=f();return O(h.proceed())}),a(20,"Proceed"),e()(),g(21,T,5,0,"div",14),e(),o(22,"div",15),u(23,"img",16),e()(),o(24,"div",17)(25,"div",18)(26,"div")(27,"span"),a(28,"powered by :"),e(),u(29,"a",19)(30,"img",20),e()()()()}if(r&2){let t=n.ngIf,i=f();l(2),M(t.latitude&&t.longitude?i.centerGeoPanelStyle:""),l(11),x(t.latitude),l(5),x(t.longitude),l(),c("disabled",!(t.latitude&&t.longitude)),l(2),c("ngIf",!(t.latitude&&t.longitude))}}var Z=class r{constructor(n,t,i,h){this.ngZone=n;this.auth=t;this.http=i;this.router=h}centerGeoPanelStyle="display: flex; flex-direction: column; justify-content: center;";latLong$;ngOnInit(){this.checkOnRefreshPage(),document.body.classList.add("login-body");let n=v(navigator.permissions.query({name:"geolocation"})).pipe(s(t=>new p(i=>{i.next(t.state),t.onchange=()=>this.ngZone.run(()=>i.next(t.state))})),m(1));this.latLong$=n.pipe(s(()=>new p(t=>{navigator.geolocation.getCurrentPosition(i=>this.ngZone.run(()=>{t.next({latitude:i.coords.latitude.toString(),longitude:i.coords.longitude.toString()}),t.complete()}),()=>this.ngZone.run(()=>{t.next({latitude:"",longitude:""}),t.complete()}),{enableHighAccuracy:!0,maximumAge:0,timeout:8e3})})),_({latitude:"",longitude:""}),m(1))}ngOnDestroy(){document.body.classList.remove("login-body")}checkOnRefreshPage(){D.IsEmpty(this.auth.loginResponse)&&this.router.navigate(["/"])}proceed(){this.latLong$.pipe(s(n=>this.http.post("/api/Authentication/LoginGeoRestriction",{UserID:this.auth.loginResponse.UserID,Latitude:n.latitude,Longitude:n.longitude})),y(n=>this.auth.saveLoginConfigToStorage(n)),s(()=>this.router.navigate([this.auth.getRedirectUrl()])),b(1)).subscribe()}static \u0275fac=function(t){return new(t||r)(d(P),d(N),d(j),d(G))};static \u0275cmp=w({type:r,selectors:[["POS-auth-geolocation"]],decls:2,vars:3,consts:[["class","container-fluid",4,"ngIf"],[1,"container-fluid"],[1,"row","bg-white","mx-auto","totp-pane"],[1,"col-md-7","order-md-first","order-last","form-pane"],[1,"text-start"],[1,"text-start","mb-7"],[1,"d-flex","flex-column","flex-md-row",2,"column-gap","10px"],[1,"latlong-container","d-flex","flex-grow-1"],[1,"flex-grow-1","text-start","d-flex"],[1,"lat-label","fw-bold"],[1,"ps-5","lat-value","flex-grow-1","d-flex","align-items-center"],[1,"long-label","fw-bold"],[1,"ps-5","long-value","flex-grow-1","d-flex","align-items-center"],[1,"btn","btn-success","mt-5","mx-auto","mx-md-0","mt-md-0","w-25","w-md-100",3,"click","disabled"],["class","text-start mt-7",4,"ngIf"],[1,"col-md-5","order-md-last","order-first","border-start","border-secondary","d-flex","align-items-center","justify-content-center","img-pane","py-6"],["src","https://res.cloudinary.com/pos/image/upload/v1685343992/POS/Images/geolocation-map.png",1,"border-0","w-100"],[1,"fixed-bottom"],[1,"d-flex","justify-content-start","mb-11","mx-11","footer-mobile"],["target","_blank","href","http://www.dealpos.com"],["src","//res.cloudinary.com/pos/image/upload/POS/Images/Login/dealpos.png",1,"ms-3","border-0"],[1,"text-start","mt-7"],[1,"text-danger"],["href","https://support.dealpos.com/en/articles/7963864-enable-location-services-for-several-browser","target","_blank",1,"d-block"]],template:function(t,i){t&1&&(g(0,z,31,6,"div",0),L(1,"async")),t&2&&c("ngIf",k(1,1,i.latLong$))},dependencies:[R,A,E],styles:["input[type=submit][_ngcontent-%COMP%]{font-size:1.125rem;width:11.25rem;font-family:Roboto Slab,serif}.totp-pane[_ngcontent-%COMP%]{max-width:57rem;height:max-content;margin-top:140px}@media (max-width: 768px){.totp-pane[_ngcontent-%COMP%]{margin-top:0}}.form-pane[_ngcontent-%COMP%]{padding:2rem}@media (max-width: 768px){.form-pane[_ngcontent-%COMP%]{padding:50px 24px 30px}}@media (max-width: 768px){.img-pane[_ngcontent-%COMP%]{border:0px!important}}.otp-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{font-size:32px;letter-spacing:32px;width:325px;font-family:monospace;background:transparent;z-index:1;position:relative}.otp-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus{outline:none!important}.otp-container[_ngcontent-%COMP%] .stripe[_ngcontent-%COMP%]{font-size:32px;letter-spacing:32px;font-family:monospace;position:absolute;padding-top:6px;z-index:0;bottom:0;left:14px}.latlong-container[_ngcontent-%COMP%]{background:#fff;border:1px solid #000000;border-radius:5px}.latlong-container[_ngcontent-%COMP%] .lat-label[_ngcontent-%COMP%], .latlong-container[_ngcontent-%COMP%] .long-label[_ngcontent-%COMP%]{display:inline-block;padding:12px;border-right:1px solid #000000}.latlong-container[_ngcontent-%COMP%] .long-label[_ngcontent-%COMP%]{border-left:1px solid #000000}.latlong-container[_ngcontent-%COMP%] .lat-value[_ngcontent-%COMP%], .latlong-container[_ngcontent-%COMP%] .long-value[_ngcontent-%COMP%]{background:#d9d9d94d}"]})};export{Z as AuthGeolocationComponent};
1
+ import{c as N}from"./chunk-DAVZ5ZHF.js";import"./chunk-VYR4I7QG.js";import{a as D}from"./chunk-MP62IGYR.js";import"./chunk-A2WJJXY7.js";import{$ as _,$a as l,Ga as P,Ib as o,Jb as e,Kb as u,N as b,Ob as S,Od as G,Qb as I,Rb as f,Wd as j,Xc as A,Y as m,aa as s,ad as E,c as p,db as d,ec as a,fa as y,fc as x,hd as R,kb as w,n as v,qb as g,va as C,vb as c,wa as O,xc as L,yb as M,yc as k}from"./chunk-EDB2BAIG.js";import"./chunk-7DCB7DB2.js";function T(r,n){r&1&&(o(0,"div",21)(1,"span",22),a(2,"Latitude and Longitude is empty, please allow your browser location permission!"),e(),o(3,"a",23),a(4,"Click here to learn how to manually activate the location permission"),e()())}function z(r,n){if(r&1){let t=S();o(0,"div",1)(1,"div",2)(2,"div",3)(3,"h3",4),a(4,"Geo Fencing"),e(),o(5,"p",5),a(6,"You are about to sign-in from this location"),e(),o(7,"div",6)(8,"div",7)(9,"div",8)(10,"span",9),a(11,"LAT"),e(),o(12,"span",10),a(13),e()(),o(14,"div",8)(15,"span",11),a(16,"LONG"),e(),o(17,"span",12),a(18),e()()(),o(19,"button",13),I("click",function(){C(t);let h=f();return O(h.proceed())}),a(20,"Proceed"),e()(),g(21,T,5,0,"div",14),e(),o(22,"div",15),u(23,"img",16),e()(),o(24,"div",17)(25,"div",18)(26,"div")(27,"span"),a(28,"powered by :"),e(),u(29,"a",19)(30,"img",20),e()()()()}if(r&2){let t=n.ngIf,i=f();l(2),M(t.latitude&&t.longitude?i.centerGeoPanelStyle:""),l(11),x(t.latitude),l(5),x(t.longitude),l(),c("disabled",!(t.latitude&&t.longitude)),l(2),c("ngIf",!(t.latitude&&t.longitude))}}var Z=class r{constructor(n,t,i,h){this.ngZone=n;this.auth=t;this.http=i;this.router=h}centerGeoPanelStyle="display: flex; flex-direction: column; justify-content: center;";latLong$;ngOnInit(){this.checkOnRefreshPage(),document.body.classList.add("login-body");let n=v(navigator.permissions.query({name:"geolocation"})).pipe(s(t=>new p(i=>{i.next(t.state),t.onchange=()=>this.ngZone.run(()=>i.next(t.state))})),m(1));this.latLong$=n.pipe(s(()=>new p(t=>{navigator.geolocation.getCurrentPosition(i=>this.ngZone.run(()=>{t.next({latitude:i.coords.latitude.toString(),longitude:i.coords.longitude.toString()}),t.complete()}),()=>this.ngZone.run(()=>{t.next({latitude:"",longitude:""}),t.complete()}),{enableHighAccuracy:!0,maximumAge:0,timeout:8e3})})),_({latitude:"",longitude:""}),m(1))}ngOnDestroy(){document.body.classList.remove("login-body")}checkOnRefreshPage(){D.IsEmpty(this.auth.loginResponse)&&this.router.navigate(["/"])}proceed(){this.latLong$.pipe(s(n=>this.http.post("/api/Authentication/LoginGeoRestriction",{UserID:this.auth.loginResponse.UserID,Latitude:n.latitude,Longitude:n.longitude})),y(n=>this.auth.saveLoginConfigToStorage(n)),s(()=>this.router.navigate([this.auth.getRedirectUrl()])),b(1)).subscribe()}static \u0275fac=function(t){return new(t||r)(d(P),d(N),d(j),d(G))};static \u0275cmp=w({type:r,selectors:[["POS-auth-geolocation"]],decls:2,vars:3,consts:[["class","container-fluid",4,"ngIf"],[1,"container-fluid"],[1,"row","bg-white","mx-auto","totp-pane"],[1,"col-md-7","order-md-first","order-last","form-pane"],[1,"text-start"],[1,"text-start","mb-7"],[1,"d-flex","flex-column","flex-md-row",2,"column-gap","10px"],[1,"latlong-container","d-flex","flex-grow-1"],[1,"flex-grow-1","text-start","d-flex"],[1,"lat-label","fw-bold"],[1,"ps-5","lat-value","flex-grow-1","d-flex","align-items-center"],[1,"long-label","fw-bold"],[1,"ps-5","long-value","flex-grow-1","d-flex","align-items-center"],[1,"btn","btn-success","mt-5","mx-auto","mx-md-0","mt-md-0","w-25","w-md-100",3,"click","disabled"],["class","text-start mt-7",4,"ngIf"],[1,"col-md-5","order-md-last","order-first","border-start","border-secondary","d-flex","align-items-center","justify-content-center","img-pane","py-6"],["src","https://res.cloudinary.com/pos/image/upload/v1685343992/POS/Images/geolocation-map.png",1,"border-0","w-100"],[1,"fixed-bottom"],[1,"d-flex","justify-content-start","mb-11","mx-11","footer-mobile"],["target","_blank","href","http://www.dealpos.com"],["src","//res.cloudinary.com/pos/image/upload/POS/Images/Login/dealpos.png",1,"ms-3","border-0"],[1,"text-start","mt-7"],[1,"text-danger"],["href","https://support.dealpos.com/en/articles/7963864-enable-location-services-for-several-browser","target","_blank",1,"d-block"]],template:function(t,i){t&1&&(g(0,z,31,6,"div",0),L(1,"async")),t&2&&c("ngIf",k(1,1,i.latLong$))},dependencies:[R,A,E],styles:["input[type=submit][_ngcontent-%COMP%]{font-size:1.125rem;width:11.25rem;font-family:Roboto Slab,serif}.totp-pane[_ngcontent-%COMP%]{max-width:57rem;height:max-content;margin-top:140px}@media (max-width: 768px){.totp-pane[_ngcontent-%COMP%]{margin-top:0}}.form-pane[_ngcontent-%COMP%]{padding:2rem}@media (max-width: 768px){.form-pane[_ngcontent-%COMP%]{padding:50px 24px 30px}}@media (max-width: 768px){.img-pane[_ngcontent-%COMP%]{border:0px!important}}.otp-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{font-size:32px;letter-spacing:32px;width:325px;font-family:monospace;background:transparent;z-index:1;position:relative}.otp-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus{outline:none!important}.otp-container[_ngcontent-%COMP%] .stripe[_ngcontent-%COMP%]{font-size:32px;letter-spacing:32px;font-family:monospace;position:absolute;padding-top:6px;z-index:0;bottom:0;left:14px}.latlong-container[_ngcontent-%COMP%]{background:#fff;border:1px solid #000000;border-radius:5px}.latlong-container[_ngcontent-%COMP%] .lat-label[_ngcontent-%COMP%], .latlong-container[_ngcontent-%COMP%] .long-label[_ngcontent-%COMP%]{display:inline-block;padding:12px;border-right:1px solid #000000}.latlong-container[_ngcontent-%COMP%] .long-label[_ngcontent-%COMP%]{border-left:1px solid #000000}.latlong-container[_ngcontent-%COMP%] .lat-value[_ngcontent-%COMP%], .latlong-container[_ngcontent-%COMP%] .long-value[_ngcontent-%COMP%]{background:#d9d9d94d}"]})};export{Z as AuthGeolocationComponent};
@@ -1 +1 @@
1
- import{a as te}from"./chunk-XTP25C6R.js";import{h as U,i as re}from"./chunk-6IFNMT72.js";import"./chunk-4KJRE3GP.js";import{a as Q,b as H}from"./chunk-5233FXFY.js";import"./chunk-YQGBGJ5U.js";import"./chunk-XUP2FY5D.js";import{L as A}from"./chunk-5UTBAGIS.js";import"./chunk-JLOQTYOI.js";import{G as ie,O as ne}from"./chunk-YJVLRBSS.js";import"./chunk-B4243VJD.js";import"./chunk-7COMDF6M.js";import"./chunk-2FWFPV5I.js";import"./chunk-NEEN2JO2.js";import"./chunk-LNLGRZBB.js";import"./chunk-DMSBV63C.js";import"./chunk-MAFIFJSJ.js";import{d as ee}from"./chunk-MP62IGYR.js";import"./chunk-J6RZLLDH.js";import{$a as o,Ac as X,Dc as P,Ib as n,Jb as i,Kb as h,Lb as I,Mb as D,Ob as O,Qb as y,Rb as m,Rd as q,Td as Z,Wc as k,Wd as R,Xc as L,cd as j,d as w,da as u,db as x,dc as T,ec as r,ed as B,fc as v,gc as f,hc as K,hd as Y,ka as M,kb as $,lb as N,ob as V,qb as d,va as g,vb as c,wa as S,xc as _,yc as C,zc as b}from"./chunk-EDB2BAIG.js";import"./chunk-7DCB7DB2.js";function ue(t,a){if(t&1){let e=O();n(0,"a",19),y("click",function(){g(e);let l=m();return S(l.convertToCsv())}),h(1,"i",20),r(2," Export Fail"),i()}}function xe(t,a){if(t&1){let e=O();n(0,"a",21),y("click",function(){g(e);let l=m();return S(l.uploadOrders())}),h(1,"i",22),r(2," Send Transaction"),i()}}function ve(t,a){t&1&&(n(0,"th",23)(1,"i"),r(2,"Actions"),i()())}function ge(t,a){if(t&1&&(n(0,"span"),r(1),i()),t&2){let e=m().$implicit;o(),v(e==null||e.Variant==null?null:e.Variant.Name)}}function Se(t,a){if(t&1&&(n(0,"div",28),d(1,ge,2,1,"span",29),i()),t&2){let e=a.$implicit;o(),c("ngIf",e!=null)}}function he(t,a){if(t&1&&(n(0,"span"),r(1),i()),t&2){let e=m().$implicit;o(),f(" ",e==null?null:e.Quantity," ")}}function Oe(t,a){if(t&1&&(n(0,"div",30),d(1,he,2,1,"span",29),i()),t&2){let e=a.$implicit;o(),c("ngIf",e!=null)}}function ye(t,a){if(t&1&&(n(0,"span"),r(1),_(2,"number"),i()),t&2){let e=m().$implicit;o(),f(" ",C(2,1,e.Price)," ")}}function Ce(t,a){if(t&1&&(n(0,"div",30),d(1,ye,3,3,"span",29),i()),t&2){let e=a.$implicit;o(),c("ngIf",e!=null)}}function be(t,a){if(t&1&&(n(0,"span"),r(1),_(2,"number"),i()),t&2){let e=m().$implicit;o(),f(" ",C(2,1,e.Quantity*e.UnitQuantity*e.Price*(1-e.Discount/100)-e.DiscountAmount)," ")}}function Ee(t,a){if(t&1&&(n(0,"div",30),d(1,be,3,3,"span",29),i()),t&2){let e=a.$implicit;o(),c("ngIf",e!=null)}}function Ie(t,a){if(t&1){let e=O();n(0,"td",31)(1,"i",32),y("click",function(){g(e);let l=m().$implicit,p=m(2);return S(p.removeOrder(l))}),i()()}}function De(t,a){if(t&1&&(n(0,"tr")(1,"td"),r(2),i(),n(3,"td"),r(4),_(5,"date"),i(),n(6,"td"),d(7,Se,2,1,"div",25),i(),n(8,"td"),d(9,Oe,2,1,"div",26),i(),n(10,"td"),d(11,Ce,2,1,"div",26),i(),n(12,"td"),d(13,Ee,2,1,"div",26),i(),d(14,Ie,2,0,"td",27),i()),t&2){let e=a.$implicit,s=m(2);o(2),v(e.Order.Number),o(2),v(b(5,7,e.Order.Date,"dd MMM yyyy")),o(3),c("ngForOf",e.CartItems),o(2),c("ngForOf",e.CartItems),o(2),c("ngForOf",e.CartItems),o(2),c("ngForOf",e.CartItems),o(),c("ngIf",s.roleService.sell.Delete)}}function Te(t,a){if(t&1&&(I(0),d(1,De,15,10,"tr",24),D()),t&2){let e=m();o(),c("ngForOf",e.offlineOrders)}}function Pe(t,a){t&1&&(n(0,"td",33)(1,"h4",34),r(2,"There is no Offline Order"),i()())}function Fe(t,a){if(t&1&&(I(0),n(1,"span"),r(2),n(3,"strong"),r(4),i(),n(5,"strong"),r(6),_(7,"number"),i(),n(8,"strong"),r(9),_(10,"number"),i()(),D()),t&2){let e=m().$implicit;o(2),f("",e==null||e.Variant==null?null:e.Variant.Name," "),o(2),f(" ",e.Quantity+" x"," "),o(2),f(" ",C(7,4,e.Price)+" ="," "),o(3),f(" ",C(10,6,e.Quantity*e.UnitQuantity*e.Price*(1-e.Discount/100)-e.DiscountAmount)," ")}}function we(t,a){if(t&1&&(n(0,"div",40),d(1,Fe,11,8,"ng-container",29),i()),t&2){let e=a.$implicit;o(),c("ngIf",e!=null)}}function Me(t,a){if(t&1&&(n(0,"div",41),r(1),i()),t&2){let e=m().$implicit;o(),f(" ",e.Message," ")}}function $e(t,a){if(t&1){let e=O();I(0),n(1,"a",42),y("click",function(){g(e);let l=m().$implicit,p=m(2);return S(p.removeFailedOrder(l))}),h(2,"i",43),i(),D()}}function Ne(t,a){if(t&1){let e=O();n(0,"tr")(1,"td"),r(2),i(),n(3,"td"),r(4),_(5,"date"),i(),n(6,"td"),d(7,we,2,1,"div",35),i(),n(8,"td"),d(9,Me,2,1,"div",36),i(),n(10,"td",37)(11,"a",38),y("click",function(){let l=g(e).$implicit,p=m(2);return S(p.uploadFailedOrder(l))}),h(12,"i",39),i(),d(13,$e,3,0,"ng-container",29),i()()}if(t&2){let e=a.$implicit,s=m(2);o(2),v(e.Order.Number),o(2),v(b(5,5,e.Order.Date,"dd MMM yyyy")),o(3),c("ngForOf",e.CartItems),o(2),c("ngIf",e.Message),o(4),c("ngIf",s.roleService.sell.Delete)}}function Ve(t,a){if(t&1&&(I(0),d(1,Ne,14,8,"tr",24),D()),t&2){let e=m();o(),c("ngForOf",e.failedOrders)}}function ke(t,a){t&1&&(n(0,"td",44)(1,"h4",34),r(2,"There is no Failed Order"),i()())}var G=class t extends Q{constructor(e,s,l,p,E,F){super(e);this.httpService=s;this.localData=l;this.csvConverter=p;this.toastr=E;this.roleService=F;this.destroy$=new w,this.pageData={Header:"Offline Orders"}}pageData;offlineOrders=[];failedOrders=[];destroy$;ngOnInit(){this.menuData$.pipe(u(this.destroy$)).subscribe(()=>{this.getOfflineOrders(),this.getFailedOrders()})}removeOrder(e){this.localData.removeOrder(e.id).subscribe({next:()=>{this.toastr.success("Successfully removed order "+e.Order.Number,"Offline Order Deleted!"),this.getOfflineOrders()},error:s=>{this.toastr.warning("Failed to remove order "+e.Order.Number,"Failed to delete order!")}})}getOfflineOrders(){this.localData.findAllOrders().pipe(u(this.destroy$)).subscribe({next:e=>{this.offlineOrders=e},error:e=>{this.toastr.error(e.message,"Error!")}})}getFailedOrders(){this.localData.getFailedOrders().pipe(u(this.destroy$)).subscribe({next:e=>{this.failedOrders=e},error:e=>{this.toastr.error(e.message,"Error!")}})}uploadFailedOrder(e){this.localData.uploadFailedOrder(e).pipe(u(this.destroy$)).subscribe({next:()=>{this.toastr.success("Successfully uploaded order "+e.Order.Number,"Sync Successful!"),this.getFailedOrders()},error:()=>{this.toastr.error("Failed to sync failed order "+e.Order.Number,"Error!")}})}removeFailedOrder(e){this.localData.removeFailedOrder(e.id).pipe(u(this.destroy$)).subscribe({next:s=>{this.toastr.success("Success to remove failed offline order","Error!"),this.getFailedOrders()},error:s=>{this.toastr.error("Failed to remove failed offline order","Error!")}})}uploadOrders(){this.localData.uploadOrders().pipe(u(this.destroy$)).subscribe({next:e=>{e?this.getOfflineOrders():(this.getOfflineOrders(),this.getFailedOrders())},error:e=>{this.getOfflineOrders(),this.getFailedOrders()}})}convertToCsv(){this.csvConverter.convertToCSV(this.getExportData(),"Fail_Transaction.csv")}getExportData(){let e=[["Number","Date","Item","Qty","Price","Total"]];return this.failedOrders.forEach(s=>{s.Items.forEach(l=>{let p=s.Order.Number.toString(),E=s.Order.Date.toLocaleString(),F=l.Quantity.toString(),ae=l.Price.toString(),le=(l.Quantity*l.UnitQuantity*(l.Price*(1-l.Discount/100))-l.DiscountAmount).toString(),se=[p,E,l.Variant.Name,F,ae,le];e.push(se)})}),e}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static \u0275fac=function(s){return new(s||t)(x(H),x(R),x(A),x(te),x(Z),x(ee))};static \u0275cmp=$({type:t,selectors:[["pos-orders"]],standalone:!1,features:[V],decls:54,vars:10,consts:[["noOrders",""],["noFailedOrders",""],[3,"pageData","hideSearchDropdown","hideSearchBox"],["matTooltipPosition","above","matTooltip","Export","class","btn btn-outline-secondary me-6",3,"click",4,"ngIf"],["value","Send Transaction","matTooltipPosition","above","matTooltip","Send Transaction","class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"container-fluid"],[1,"row","mt-10","mb-12"],[1,"col-md"],[1,"table","mt-5"],[1,"thead-light","sticky-top-thead"],[1,"border-end",2,"width","130px"],[1,"border-end",2,"width","90px"],[1,"border-end"],[1,"border-end","text-end",2,"width","103px"],[1,"border-end","text-end",2,"width","200px"],["class","text-center","style","width: 90px",4,"ngIf"],[4,"ngIf","ngIfElse"],[1,"row","mt-12"],[1,"border-end",2,"width","102px"],["matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary","me-6",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],["value","Send Transaction","matTooltipPosition","above","matTooltip","Send Transaction",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa","fa-paper-plane"],[1,"text-center",2,"width","90px"],[4,"ngFor","ngForOf"],["class","list-unstyled text-start",4,"ngFor","ngForOf"],["class","list-unstyled text-end",4,"ngFor","ngForOf"],["class","text-center text-danger",4,"ngIf"],[1,"list-unstyled","text-start"],[4,"ngIf"],[1,"list-unstyled","text-end"],[1,"text-center","text-danger"],[1,"fa-solid","fa-xmark","fa-2x","cursor-pointer",3,"click"],["colspan","7"],[1,"text-center","mt-2"],["class","list-inline text-start",4,"ngFor","ngForOf"],["class","text-danger",4,"ngIf"],[1,"d-flex","justify-content-center"],["matTooltipPosition","above","matTooltip","Sync",1,"ms-2","me-2","cursor-pointer",3,"click"],["aria-hidden","true",1,"fa-solid","fa-cloud-arrow-up","text-primary","fa-2x"],[1,"list-inline","text-start"],[1,"text-danger"],["matTooltipPosition","above","matTooltip","Remove",1,"ms-5","cursor-pointer",3,"click"],["aria-hidden","true",1,"fa-regular","fa-xmark-circle","text-primary","fa-2x"],["colSpan","5"]],template:function(s,l){if(s&1&&(n(0,"mainpanel-cmp",2)(1,"actions"),d(2,ue,3,0,"a",3)(3,xe,3,0,"a",4),i(),n(4,"content")(5,"div",5)(6,"div",6)(7,"div",7)(8,"h5"),r(9,"Offline Orders"),i(),n(10,"i"),r(11,"Waiting to be uploaded to the server!"),i(),n(12,"table",8)(13,"thead",9)(14,"tr")(15,"th",10),r(16,"Number"),i(),n(17,"th",11),r(18,"Date"),i(),n(19,"th",12),r(20,"item"),i(),n(21,"th",13),r(22," Qty "),i(),n(23,"th",14),r(24," Price "),i(),n(25,"th",14),r(26," Total "),i(),d(27,ve,3,0,"th",15),i()(),n(28,"tbody"),d(29,Te,2,1,"ng-container",16)(30,Pe,3,0,"ng-template",null,0,P),i()()()(),n(32,"div",17)(33,"div",7)(34,"h5"),r(35,"Synchronization Errors"),i(),n(36,"i"),r(37,"Exception occured when trying to upload these orders"),i(),n(38,"table",8)(39,"thead",9)(40,"tr")(41,"th",11),r(42,"Number"),i(),n(43,"th",11),r(44,"Date"),i(),n(45,"th",12),r(46,"item"),i(),n(47,"th",12),r(48,"Sync exception"),i(),h(49,"th",18),i()(),n(50,"tbody"),d(51,Ve,2,1,"ng-container",16)(52,ke,3,0,"ng-template",null,1,P),i()()()()()()()),s&2){let p=T(31),E=T(53);c("pageData",l.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),o(2),c("ngIf",(l.failedOrders==null?null:l.failedOrders.length)>0),o(),c("ngIf",l.offlineOrders.length>0),o(24),c("ngIf",l.roleService.sell.Delete),o(2),c("ngIf",l.offlineOrders.length>0)("ngIfElse",p),o(22),c("ngIf",l.failedOrders.length>0)("ngIfElse",E)}},dependencies:[k,L,U,B,j],styles:[".cursor-pointer[_ngcontent-%COMP%]{cursor:pointer}"]})};function Le(t,a){if(t&1&&(n(0,"div",5),h(1,"i",6),r(2),_(3,"date"),i()),t&2){let e=m();o(2),f(" ",b(3,1,e.LastSync,"dd MMM yyyy HH:mm:ss")," ")}}function je(t,a){if(t&1&&(n(0,"tr")(1,"td",15),r(2),i(),n(3,"td",16),r(4),i(),n(5,"td"),r(6),i(),n(7,"td",11),r(8),_(9,"number"),i()()),t&2){let e=a.$implicit,s=m(2);o(2),v(e.ID),o(2),v(e.Name),o(2),v(e.Code),o(2),K(" ",s.currency," ",b(9,5,e.UnitPrice,"1.0-4")," ")}}function Be(t,a){if(t&1&&(n(0,"table",7)(1,"thead",8)(2,"tr",9)(3,"th",10),r(4,"ID"),i(),n(5,"th",10),r(6,"Name"),i(),n(7,"th",10),r(8,"Code"),i(),n(9,"th",11),r(10,"Unit Price"),i()()(),n(11,"tbody"),d(12,je,10,8,"tr",12),_(13,"sortBy"),i(),n(14,"tfoot")(15,"tr",13)(16,"td",14)(17,"strong"),r(18),_(19,"number"),i()()()()()),t&2){let e=m();o(12),c("ngForOf",X(13,2,e.variantList,"asc","Name")),o(6),f("",C(19,6,e.variantList.length)," Product ")}}function Re(t,a){t&1&&(n(0,"h3",17),r(1,"Product has not been synced yet!"),i())}var z=class t extends Q{constructor(e,s,l){super(e);this.httpService=s;this._localDataService=l;this.destroy$=new w}variantList=[];OriginalList=[];LastSync;currency;destroy$;ngOnInit(){this.menuData$.subscribe(e=>{this.getVariants(),this.getSyncDate(),this.getCurrency()})}getVariants(){this._localDataService.findAllVariant().pipe(u(this.destroy$)).subscribe({next:e=>{this.OriginalList=e,this.variantList=this.OriginalList},error:e=>{console.error(e)}})}getSyncDate(){this._localDataService.getSyncTime().pipe(u(this.destroy$)).subscribe(e=>{this.LastSync=new Date(e.time)})}getCurrency(){this._localDataService.getPOSStorage().pipe(u(this.destroy$)).subscribe(e=>{e&&(this.currency=e.Currencies[0].Symbol)})}filterList(e){this.variantList=this.OriginalList.filter(s=>s.Name.includes(e))}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static \u0275fac=function(s){return new(s||t)(x(H),x(R),x(A))};static \u0275cmp=$({type:t,selectors:[["pos-products"]],standalone:!1,features:[V],decls:8,vars:5,consts:[["noProduct",""],[3,"textChange","pageData","hideSearchDropdown"],["class","h5",4,"ngIf"],[1,"container-fluid","mt-5"],["id","tableGrid","class","table",4,"ngIf","ngIfElse"],[1,"h5"],[1,"fa-solid","fa-sync-alt"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"header"],[1,"text-start"],[1,"text-end"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","4",1,"text-start","empty-column"],[2,"max-width","100px"],[2,"max-width","300px"],[1,"text-center","mt-4"]],template:function(s,l){if(s&1){let p=O();n(0,"mainpanel-cmp",1),y("textChange",function(F){return g(p),S(l.filterList(F))}),n(1,"actions"),d(2,Le,4,4,"div",2),i(),n(3,"content")(4,"div",3),d(5,Be,20,8,"table",4)(6,Re,2,0,"ng-template",null,0,P),i()()()}if(s&2){let p=T(7);c("pageData",l.menuData)("hideSearchDropdown",!0),o(2),c("ngIf",l.LastSync),o(3),c("ngIf",l.variantList.length>0)("ngIfElse",p)}},dependencies:[k,L,U,B,j,ie],encapsulation:2})};var Qe=[{path:"Products",component:z},{path:"Orders",component:G},{path:"**",redirectTo:"Products",pathMatch:"full"}],W=class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=N({type:t});static \u0275inj=M({imports:[q.forChild(Qe),q]})};var oe=class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=N({type:t});static \u0275inj=M({imports:[Y,W,re,ne]})};export{oe as OfflineModule};
1
+ import{a as te}from"./chunk-XTP25C6R.js";import{h as U,i as re}from"./chunk-OKIY24GE.js";import"./chunk-PIJ2427T.js";import{a as Q,b as H}from"./chunk-YBMMLF6J.js";import"./chunk-YQGBGJ5U.js";import"./chunk-XUP2FY5D.js";import{L as A}from"./chunk-5UTBAGIS.js";import"./chunk-JLOQTYOI.js";import{G as ie,O as ne}from"./chunk-YJVLRBSS.js";import"./chunk-B4243VJD.js";import"./chunk-7COMDF6M.js";import"./chunk-2FWFPV5I.js";import"./chunk-NEEN2JO2.js";import"./chunk-LNLGRZBB.js";import"./chunk-DAVZ5ZHF.js";import"./chunk-VYR4I7QG.js";import{d as ee}from"./chunk-MP62IGYR.js";import"./chunk-A2WJJXY7.js";import{$a as o,Ac as X,Dc as P,Ib as n,Jb as i,Kb as h,Lb as I,Mb as D,Ob as O,Qb as y,Rb as m,Rd as q,Td as Z,Wc as k,Wd as R,Xc as L,cd as j,d as w,da as u,db as x,dc as T,ec as r,ed as B,fc as v,gc as f,hc as K,hd as Y,ka as M,kb as $,lb as N,ob as V,qb as d,va as g,vb as c,wa as S,xc as _,yc as C,zc as b}from"./chunk-EDB2BAIG.js";import"./chunk-7DCB7DB2.js";function ue(t,a){if(t&1){let e=O();n(0,"a",19),y("click",function(){g(e);let l=m();return S(l.convertToCsv())}),h(1,"i",20),r(2," Export Fail"),i()}}function xe(t,a){if(t&1){let e=O();n(0,"a",21),y("click",function(){g(e);let l=m();return S(l.uploadOrders())}),h(1,"i",22),r(2," Send Transaction"),i()}}function ve(t,a){t&1&&(n(0,"th",23)(1,"i"),r(2,"Actions"),i()())}function ge(t,a){if(t&1&&(n(0,"span"),r(1),i()),t&2){let e=m().$implicit;o(),v(e==null||e.Variant==null?null:e.Variant.Name)}}function Se(t,a){if(t&1&&(n(0,"div",28),d(1,ge,2,1,"span",29),i()),t&2){let e=a.$implicit;o(),c("ngIf",e!=null)}}function he(t,a){if(t&1&&(n(0,"span"),r(1),i()),t&2){let e=m().$implicit;o(),f(" ",e==null?null:e.Quantity," ")}}function Oe(t,a){if(t&1&&(n(0,"div",30),d(1,he,2,1,"span",29),i()),t&2){let e=a.$implicit;o(),c("ngIf",e!=null)}}function ye(t,a){if(t&1&&(n(0,"span"),r(1),_(2,"number"),i()),t&2){let e=m().$implicit;o(),f(" ",C(2,1,e.Price)," ")}}function Ce(t,a){if(t&1&&(n(0,"div",30),d(1,ye,3,3,"span",29),i()),t&2){let e=a.$implicit;o(),c("ngIf",e!=null)}}function be(t,a){if(t&1&&(n(0,"span"),r(1),_(2,"number"),i()),t&2){let e=m().$implicit;o(),f(" ",C(2,1,e.Quantity*e.UnitQuantity*e.Price*(1-e.Discount/100)-e.DiscountAmount)," ")}}function Ee(t,a){if(t&1&&(n(0,"div",30),d(1,be,3,3,"span",29),i()),t&2){let e=a.$implicit;o(),c("ngIf",e!=null)}}function Ie(t,a){if(t&1){let e=O();n(0,"td",31)(1,"i",32),y("click",function(){g(e);let l=m().$implicit,p=m(2);return S(p.removeOrder(l))}),i()()}}function De(t,a){if(t&1&&(n(0,"tr")(1,"td"),r(2),i(),n(3,"td"),r(4),_(5,"date"),i(),n(6,"td"),d(7,Se,2,1,"div",25),i(),n(8,"td"),d(9,Oe,2,1,"div",26),i(),n(10,"td"),d(11,Ce,2,1,"div",26),i(),n(12,"td"),d(13,Ee,2,1,"div",26),i(),d(14,Ie,2,0,"td",27),i()),t&2){let e=a.$implicit,s=m(2);o(2),v(e.Order.Number),o(2),v(b(5,7,e.Order.Date,"dd MMM yyyy")),o(3),c("ngForOf",e.CartItems),o(2),c("ngForOf",e.CartItems),o(2),c("ngForOf",e.CartItems),o(2),c("ngForOf",e.CartItems),o(),c("ngIf",s.roleService.sell.Delete)}}function Te(t,a){if(t&1&&(I(0),d(1,De,15,10,"tr",24),D()),t&2){let e=m();o(),c("ngForOf",e.offlineOrders)}}function Pe(t,a){t&1&&(n(0,"td",33)(1,"h4",34),r(2,"There is no Offline Order"),i()())}function Fe(t,a){if(t&1&&(I(0),n(1,"span"),r(2),n(3,"strong"),r(4),i(),n(5,"strong"),r(6),_(7,"number"),i(),n(8,"strong"),r(9),_(10,"number"),i()(),D()),t&2){let e=m().$implicit;o(2),f("",e==null||e.Variant==null?null:e.Variant.Name," "),o(2),f(" ",e.Quantity+" x"," "),o(2),f(" ",C(7,4,e.Price)+" ="," "),o(3),f(" ",C(10,6,e.Quantity*e.UnitQuantity*e.Price*(1-e.Discount/100)-e.DiscountAmount)," ")}}function we(t,a){if(t&1&&(n(0,"div",40),d(1,Fe,11,8,"ng-container",29),i()),t&2){let e=a.$implicit;o(),c("ngIf",e!=null)}}function Me(t,a){if(t&1&&(n(0,"div",41),r(1),i()),t&2){let e=m().$implicit;o(),f(" ",e.Message," ")}}function $e(t,a){if(t&1){let e=O();I(0),n(1,"a",42),y("click",function(){g(e);let l=m().$implicit,p=m(2);return S(p.removeFailedOrder(l))}),h(2,"i",43),i(),D()}}function Ne(t,a){if(t&1){let e=O();n(0,"tr")(1,"td"),r(2),i(),n(3,"td"),r(4),_(5,"date"),i(),n(6,"td"),d(7,we,2,1,"div",35),i(),n(8,"td"),d(9,Me,2,1,"div",36),i(),n(10,"td",37)(11,"a",38),y("click",function(){let l=g(e).$implicit,p=m(2);return S(p.uploadFailedOrder(l))}),h(12,"i",39),i(),d(13,$e,3,0,"ng-container",29),i()()}if(t&2){let e=a.$implicit,s=m(2);o(2),v(e.Order.Number),o(2),v(b(5,5,e.Order.Date,"dd MMM yyyy")),o(3),c("ngForOf",e.CartItems),o(2),c("ngIf",e.Message),o(4),c("ngIf",s.roleService.sell.Delete)}}function Ve(t,a){if(t&1&&(I(0),d(1,Ne,14,8,"tr",24),D()),t&2){let e=m();o(),c("ngForOf",e.failedOrders)}}function ke(t,a){t&1&&(n(0,"td",44)(1,"h4",34),r(2,"There is no Failed Order"),i()())}var G=class t extends Q{constructor(e,s,l,p,E,F){super(e);this.httpService=s;this.localData=l;this.csvConverter=p;this.toastr=E;this.roleService=F;this.destroy$=new w,this.pageData={Header:"Offline Orders"}}pageData;offlineOrders=[];failedOrders=[];destroy$;ngOnInit(){this.menuData$.pipe(u(this.destroy$)).subscribe(()=>{this.getOfflineOrders(),this.getFailedOrders()})}removeOrder(e){this.localData.removeOrder(e.id).subscribe({next:()=>{this.toastr.success("Successfully removed order "+e.Order.Number,"Offline Order Deleted!"),this.getOfflineOrders()},error:s=>{this.toastr.warning("Failed to remove order "+e.Order.Number,"Failed to delete order!")}})}getOfflineOrders(){this.localData.findAllOrders().pipe(u(this.destroy$)).subscribe({next:e=>{this.offlineOrders=e},error:e=>{this.toastr.error(e.message,"Error!")}})}getFailedOrders(){this.localData.getFailedOrders().pipe(u(this.destroy$)).subscribe({next:e=>{this.failedOrders=e},error:e=>{this.toastr.error(e.message,"Error!")}})}uploadFailedOrder(e){this.localData.uploadFailedOrder(e).pipe(u(this.destroy$)).subscribe({next:()=>{this.toastr.success("Successfully uploaded order "+e.Order.Number,"Sync Successful!"),this.getFailedOrders()},error:()=>{this.toastr.error("Failed to sync failed order "+e.Order.Number,"Error!")}})}removeFailedOrder(e){this.localData.removeFailedOrder(e.id).pipe(u(this.destroy$)).subscribe({next:s=>{this.toastr.success("Success to remove failed offline order","Error!"),this.getFailedOrders()},error:s=>{this.toastr.error("Failed to remove failed offline order","Error!")}})}uploadOrders(){this.localData.uploadOrders().pipe(u(this.destroy$)).subscribe({next:e=>{e?this.getOfflineOrders():(this.getOfflineOrders(),this.getFailedOrders())},error:e=>{this.getOfflineOrders(),this.getFailedOrders()}})}convertToCsv(){this.csvConverter.convertToCSV(this.getExportData(),"Fail_Transaction.csv")}getExportData(){let e=[["Number","Date","Item","Qty","Price","Total"]];return this.failedOrders.forEach(s=>{s.Items.forEach(l=>{let p=s.Order.Number.toString(),E=s.Order.Date.toLocaleString(),F=l.Quantity.toString(),ae=l.Price.toString(),le=(l.Quantity*l.UnitQuantity*(l.Price*(1-l.Discount/100))-l.DiscountAmount).toString(),se=[p,E,l.Variant.Name,F,ae,le];e.push(se)})}),e}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static \u0275fac=function(s){return new(s||t)(x(H),x(R),x(A),x(te),x(Z),x(ee))};static \u0275cmp=$({type:t,selectors:[["pos-orders"]],standalone:!1,features:[V],decls:54,vars:10,consts:[["noOrders",""],["noFailedOrders",""],[3,"pageData","hideSearchDropdown","hideSearchBox"],["matTooltipPosition","above","matTooltip","Export","class","btn btn-outline-secondary me-6",3,"click",4,"ngIf"],["value","Send Transaction","matTooltipPosition","above","matTooltip","Send Transaction","class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"container-fluid"],[1,"row","mt-10","mb-12"],[1,"col-md"],[1,"table","mt-5"],[1,"thead-light","sticky-top-thead"],[1,"border-end",2,"width","130px"],[1,"border-end",2,"width","90px"],[1,"border-end"],[1,"border-end","text-end",2,"width","103px"],[1,"border-end","text-end",2,"width","200px"],["class","text-center","style","width: 90px",4,"ngIf"],[4,"ngIf","ngIfElse"],[1,"row","mt-12"],[1,"border-end",2,"width","102px"],["matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary","me-6",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],["value","Send Transaction","matTooltipPosition","above","matTooltip","Send Transaction",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa","fa-paper-plane"],[1,"text-center",2,"width","90px"],[4,"ngFor","ngForOf"],["class","list-unstyled text-start",4,"ngFor","ngForOf"],["class","list-unstyled text-end",4,"ngFor","ngForOf"],["class","text-center text-danger",4,"ngIf"],[1,"list-unstyled","text-start"],[4,"ngIf"],[1,"list-unstyled","text-end"],[1,"text-center","text-danger"],[1,"fa-solid","fa-xmark","fa-2x","cursor-pointer",3,"click"],["colspan","7"],[1,"text-center","mt-2"],["class","list-inline text-start",4,"ngFor","ngForOf"],["class","text-danger",4,"ngIf"],[1,"d-flex","justify-content-center"],["matTooltipPosition","above","matTooltip","Sync",1,"ms-2","me-2","cursor-pointer",3,"click"],["aria-hidden","true",1,"fa-solid","fa-cloud-arrow-up","text-primary","fa-2x"],[1,"list-inline","text-start"],[1,"text-danger"],["matTooltipPosition","above","matTooltip","Remove",1,"ms-5","cursor-pointer",3,"click"],["aria-hidden","true",1,"fa-regular","fa-xmark-circle","text-primary","fa-2x"],["colSpan","5"]],template:function(s,l){if(s&1&&(n(0,"mainpanel-cmp",2)(1,"actions"),d(2,ue,3,0,"a",3)(3,xe,3,0,"a",4),i(),n(4,"content")(5,"div",5)(6,"div",6)(7,"div",7)(8,"h5"),r(9,"Offline Orders"),i(),n(10,"i"),r(11,"Waiting to be uploaded to the server!"),i(),n(12,"table",8)(13,"thead",9)(14,"tr")(15,"th",10),r(16,"Number"),i(),n(17,"th",11),r(18,"Date"),i(),n(19,"th",12),r(20,"item"),i(),n(21,"th",13),r(22," Qty "),i(),n(23,"th",14),r(24," Price "),i(),n(25,"th",14),r(26," Total "),i(),d(27,ve,3,0,"th",15),i()(),n(28,"tbody"),d(29,Te,2,1,"ng-container",16)(30,Pe,3,0,"ng-template",null,0,P),i()()()(),n(32,"div",17)(33,"div",7)(34,"h5"),r(35,"Synchronization Errors"),i(),n(36,"i"),r(37,"Exception occured when trying to upload these orders"),i(),n(38,"table",8)(39,"thead",9)(40,"tr")(41,"th",11),r(42,"Number"),i(),n(43,"th",11),r(44,"Date"),i(),n(45,"th",12),r(46,"item"),i(),n(47,"th",12),r(48,"Sync exception"),i(),h(49,"th",18),i()(),n(50,"tbody"),d(51,Ve,2,1,"ng-container",16)(52,ke,3,0,"ng-template",null,1,P),i()()()()()()()),s&2){let p=T(31),E=T(53);c("pageData",l.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),o(2),c("ngIf",(l.failedOrders==null?null:l.failedOrders.length)>0),o(),c("ngIf",l.offlineOrders.length>0),o(24),c("ngIf",l.roleService.sell.Delete),o(2),c("ngIf",l.offlineOrders.length>0)("ngIfElse",p),o(22),c("ngIf",l.failedOrders.length>0)("ngIfElse",E)}},dependencies:[k,L,U,B,j],styles:[".cursor-pointer[_ngcontent-%COMP%]{cursor:pointer}"]})};function Le(t,a){if(t&1&&(n(0,"div",5),h(1,"i",6),r(2),_(3,"date"),i()),t&2){let e=m();o(2),f(" ",b(3,1,e.LastSync,"dd MMM yyyy HH:mm:ss")," ")}}function je(t,a){if(t&1&&(n(0,"tr")(1,"td",15),r(2),i(),n(3,"td",16),r(4),i(),n(5,"td"),r(6),i(),n(7,"td",11),r(8),_(9,"number"),i()()),t&2){let e=a.$implicit,s=m(2);o(2),v(e.ID),o(2),v(e.Name),o(2),v(e.Code),o(2),K(" ",s.currency," ",b(9,5,e.UnitPrice,"1.0-4")," ")}}function Be(t,a){if(t&1&&(n(0,"table",7)(1,"thead",8)(2,"tr",9)(3,"th",10),r(4,"ID"),i(),n(5,"th",10),r(6,"Name"),i(),n(7,"th",10),r(8,"Code"),i(),n(9,"th",11),r(10,"Unit Price"),i()()(),n(11,"tbody"),d(12,je,10,8,"tr",12),_(13,"sortBy"),i(),n(14,"tfoot")(15,"tr",13)(16,"td",14)(17,"strong"),r(18),_(19,"number"),i()()()()()),t&2){let e=m();o(12),c("ngForOf",X(13,2,e.variantList,"asc","Name")),o(6),f("",C(19,6,e.variantList.length)," Product ")}}function Re(t,a){t&1&&(n(0,"h3",17),r(1,"Product has not been synced yet!"),i())}var z=class t extends Q{constructor(e,s,l){super(e);this.httpService=s;this._localDataService=l;this.destroy$=new w}variantList=[];OriginalList=[];LastSync;currency;destroy$;ngOnInit(){this.menuData$.subscribe(e=>{this.getVariants(),this.getSyncDate(),this.getCurrency()})}getVariants(){this._localDataService.findAllVariant().pipe(u(this.destroy$)).subscribe({next:e=>{this.OriginalList=e,this.variantList=this.OriginalList},error:e=>{console.error(e)}})}getSyncDate(){this._localDataService.getSyncTime().pipe(u(this.destroy$)).subscribe(e=>{this.LastSync=new Date(e.time)})}getCurrency(){this._localDataService.getPOSStorage().pipe(u(this.destroy$)).subscribe(e=>{e&&(this.currency=e.Currencies[0].Symbol)})}filterList(e){this.variantList=this.OriginalList.filter(s=>s.Name.includes(e))}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static \u0275fac=function(s){return new(s||t)(x(H),x(R),x(A))};static \u0275cmp=$({type:t,selectors:[["pos-products"]],standalone:!1,features:[V],decls:8,vars:5,consts:[["noProduct",""],[3,"textChange","pageData","hideSearchDropdown"],["class","h5",4,"ngIf"],[1,"container-fluid","mt-5"],["id","tableGrid","class","table",4,"ngIf","ngIfElse"],[1,"h5"],[1,"fa-solid","fa-sync-alt"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"header"],[1,"text-start"],[1,"text-end"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","4",1,"text-start","empty-column"],[2,"max-width","100px"],[2,"max-width","300px"],[1,"text-center","mt-4"]],template:function(s,l){if(s&1){let p=O();n(0,"mainpanel-cmp",1),y("textChange",function(F){return g(p),S(l.filterList(F))}),n(1,"actions"),d(2,Le,4,4,"div",2),i(),n(3,"content")(4,"div",3),d(5,Be,20,8,"table",4)(6,Re,2,0,"ng-template",null,0,P),i()()()}if(s&2){let p=T(7);c("pageData",l.menuData)("hideSearchDropdown",!0),o(2),c("ngIf",l.LastSync),o(3),c("ngIf",l.variantList.length>0)("ngIfElse",p)}},dependencies:[k,L,U,B,j,ie],encapsulation:2})};var Qe=[{path:"Products",component:z},{path:"Orders",component:G},{path:"**",redirectTo:"Products",pathMatch:"full"}],W=class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=N({type:t});static \u0275inj=M({imports:[q.forChild(Qe),q]})};var oe=class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=N({type:t});static \u0275inj=M({imports:[Y,W,re,ne]})};export{oe as OfflineModule};
@@ -1,4 +1,4 @@
1
- var e={production:!0,firebaseConfig:{apiKey:"AIzaSyDnnitFXpM8TglWKNpzu4ChgF98n25Rgvw",authDomain:"auth.dealpos.com",projectId:"devops-signin",storageBucket:"devops-signin.appspot.com",messagingSenderId:"412465165194",appId:"1:412465165194:web:03d806f6b6ab6f8b460e73",measurementId:"G-MNDBRJ5XZD"},pos:{indexedDBVersion:3,submitOrderTimeout:2e4,fileSizeLimit:9e5},version:"25312",outletMaximumSubscription:10,midtransClientKey:"Mid-client-rdi5ridKhHfeIvTj",ngHttpLoaderDebounceDelay:175,news:"https://changelog.dealpos.app/umbraco/delivery/api/v2/content?fetch=children:web&sort=sortOrder:asc",changelog:[],uppy:{invoicePayment:25e5,receiptTemplate:25e5},intercom:{appId:"xv1oomgl"},whatsappTemplateMessage:`Thank you for shopping at {Brand}
1
+ var e={production:!0,firebaseConfig:{apiKey:"AIzaSyDnnitFXpM8TglWKNpzu4ChgF98n25Rgvw",authDomain:"auth.dealpos.com",projectId:"devops-signin",storageBucket:"devops-signin.appspot.com",messagingSenderId:"412465165194",appId:"1:412465165194:web:03d806f6b6ab6f8b460e73",measurementId:"G-MNDBRJ5XZD"},pos:{indexedDBVersion:3,submitOrderTimeout:2e4,fileSizeLimit:9e5},version:"25314",outletMaximumSubscription:10,midtransClientKey:"Mid-client-rdi5ridKhHfeIvTj",ngHttpLoaderDebounceDelay:175,news:"https://changelog.dealpos.app/umbraco/delivery/api/v2/content?fetch=children:web&sort=sortOrder:asc",changelog:[],uppy:{invoicePayment:25e5,receiptTemplate:25e5},intercom:{appId:"xv1oomgl"},whatsappTemplateMessage:`Thank you for shopping at {Brand}
2
2
  Here is the receipt for your purchase {Number} - {Currency} {Amount}
3
3
  {ReceiptLink}
4
4
  Please let us know about your shopping experience using the receipt link.`,FALLBACK_PRODUCT_IMAGE_URL:"https://cdn.dealpos.app/template/products_thumb.png"};export{e as a};