marketplacepos 6.29.0 → 6.29.1

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 (61) hide show
  1. package/Marketplace/{chunk-HC762TVU.js → chunk-2B7ODPLC.js} +1 -1
  2. package/Marketplace/{chunk-FCSLH5Z4.js → chunk-2FPBNHEF.js} +1 -1
  3. package/Marketplace/{chunk-VOEKDRNB.js → chunk-3BVPOKDD.js} +1 -1
  4. package/Marketplace/{chunk-WVTZ3R4Z.js → chunk-4UAOJXM3.js} +1 -1
  5. package/Marketplace/{chunk-RF2EWEGM.js → chunk-4UNOJTDA.js} +1 -1
  6. package/Marketplace/{chunk-AEMKWZVV.js → chunk-55IIUWV3.js} +1 -1
  7. package/Marketplace/{chunk-DJ426GKH.js → chunk-5O5AIURM.js} +1 -1
  8. package/Marketplace/{chunk-DAGGBVVW.js → chunk-5Y6OOO6C.js} +1 -1
  9. package/Marketplace/{chunk-IPA3OOUY.js → chunk-62ICE3KY.js} +1 -1
  10. package/Marketplace/{chunk-TBQAAZKJ.js → chunk-657SQGUO.js} +1 -1
  11. package/Marketplace/{chunk-Q7MTS26W.js → chunk-AST2F74E.js} +1 -1
  12. package/Marketplace/{chunk-IXBR3WKA.js → chunk-BESMYE2V.js} +1 -1
  13. package/Marketplace/{chunk-6P6G7QWW.js → chunk-CA5JAVT2.js} +1 -1
  14. package/Marketplace/{chunk-ETH4AAKD.js → chunk-CBI2K7TM.js} +1 -1
  15. package/Marketplace/{chunk-WU3VRNRG.js → chunk-CFR6UX5N.js} +1 -1
  16. package/Marketplace/{chunk-HBSTLOE2.js → chunk-CKSYASAI.js} +1 -1
  17. package/Marketplace/{chunk-2TG7MEQ5.js → chunk-CNH3BXPT.js} +1 -1
  18. package/Marketplace/{chunk-QEDHPH5V.js → chunk-D75GBA7N.js} +1 -1
  19. package/Marketplace/{chunk-TUTJGFDI.js → chunk-DC7PQONZ.js} +1 -1
  20. package/Marketplace/{chunk-IFHQPJQM.js → chunk-DG2VHZHH.js} +1 -1
  21. package/Marketplace/{chunk-PHJBC5R3.js → chunk-FM6BBO2I.js} +1 -1
  22. package/Marketplace/{chunk-JEUWKV3T.js → chunk-G4HCG5E5.js} +1 -1
  23. package/Marketplace/{chunk-5B7SG3J3.js → chunk-GIGBUUHT.js} +1 -1
  24. package/Marketplace/{chunk-EF5LYKAK.js → chunk-GMERKEUB.js} +1 -1
  25. package/Marketplace/{chunk-CFBU64JO.js → chunk-IC4CEP7Z.js} +1 -1
  26. package/Marketplace/{chunk-5DOBCXKU.js → chunk-IW2ZGLNA.js} +1 -1
  27. package/Marketplace/{chunk-GHLABPFB.js → chunk-IWG33CWU.js} +1 -1
  28. package/Marketplace/{chunk-DYLH5K52.js → chunk-KCSQVIGX.js} +1 -1
  29. package/Marketplace/{chunk-RG24XPVA.js → chunk-LATBLSAP.js} +1 -1
  30. package/Marketplace/{chunk-SJ6Z2ADB.js → chunk-LRYFOWJW.js} +1 -1
  31. package/Marketplace/{chunk-6KHFHPAM.js → chunk-LX4G4IYW.js} +1 -1
  32. package/Marketplace/{chunk-4HHY4EKW.js → chunk-ME5VXD5H.js} +1 -1
  33. package/Marketplace/{chunk-WFHEQIDZ.js → chunk-ML2F3YUA.js} +1 -1
  34. package/Marketplace/{chunk-4JVYHBV4.js → chunk-MSBVQSUZ.js} +1 -1
  35. package/Marketplace/{chunk-HKSZ4D5H.js → chunk-PABQDENQ.js} +1 -1
  36. package/Marketplace/{chunk-HYGCXNVV.js → chunk-PCCPAQ4T.js} +1 -1
  37. package/Marketplace/{chunk-PN7IVNMM.js → chunk-PH26W3PD.js} +1 -1
  38. package/Marketplace/{chunk-OMF3AB4P.js → chunk-PPKRUNM5.js} +1 -1
  39. package/Marketplace/{chunk-6AP5LR6M.js → chunk-Q4WUHR3O.js} +1 -1
  40. package/Marketplace/{chunk-QSMDXTAY.js → chunk-RQB2PNOP.js} +1 -1
  41. package/Marketplace/{chunk-X7PBJAFL.js → chunk-S3FKNXVN.js} +1 -1
  42. package/Marketplace/{chunk-IP2DQDRF.js → chunk-U5BWTDHM.js} +1 -1
  43. package/Marketplace/{chunk-LCDZVI4S.js → chunk-UCPQI4IJ.js} +1 -1
  44. package/Marketplace/{chunk-OBB6ZQHB.js → chunk-UHV5SMNA.js} +1 -1
  45. package/Marketplace/{chunk-TNEEOMHX.js → chunk-UL34WZGE.js} +1 -1
  46. package/Marketplace/{chunk-45QTRO26.js → chunk-UMXN6GXF.js} +1 -1
  47. package/Marketplace/{chunk-SZNMIESM.js → chunk-UYBKQVDL.js} +1 -1
  48. package/Marketplace/{chunk-ZVCNMOKL.js → chunk-UZ7JBETM.js} +1 -1
  49. package/Marketplace/{chunk-GSGIBJDK.js → chunk-VA45EGRR.js} +1 -1
  50. package/Marketplace/{chunk-SGTHXNHB.js → chunk-VAM242PL.js} +1 -1
  51. package/Marketplace/{chunk-HT2Y27RB.js → chunk-VZOFNZFQ.js} +1 -1
  52. package/Marketplace/{chunk-EWWYRIYD.js → chunk-WRVJRQDB.js} +1 -1
  53. package/Marketplace/{chunk-UJJ6DXG3.js → chunk-WY25NVRN.js} +1 -1
  54. package/Marketplace/{chunk-OSRUSLIZ.js → chunk-WY3SXQAA.js} +1 -1
  55. package/Marketplace/{chunk-NTAJMMK3.js → chunk-X24FCGRE.js} +1 -1
  56. package/Marketplace/{chunk-XBJ3AIIM.js → chunk-YQGT34PL.js} +1 -1
  57. package/Marketplace/{chunk-VICDTVX6.js → chunk-ZCS5NK2R.js} +2 -2
  58. package/Marketplace/{chunk-USM6HESV.js → chunk-ZUBP3Z4P.js} +1 -1
  59. package/Marketplace/index.html +2 -2
  60. package/Marketplace/{main-ZZ2N25E4.js → main-JDMNFH65.js} +2 -2
  61. package/package.json +1 -1
@@ -1 +1 @@
1
- import{a as pe,b as me,d as de}from"./chunk-ZZ7HSVKU.js";import{b as ce}from"./chunk-N54LZIRM.js";import"./chunk-DEQSZUMF.js";import"./chunk-NIRJAWTX.js";import"./chunk-RDXDKWLL.js";import{b as le}from"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import{a as oe}from"./chunk-ZSUWHVKX.js";import{h as ne}from"./chunk-ZVCNMOKL.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import"./chunk-P5OAPFNC.js";import{b as te,c as ie}from"./chunk-7R55YTL6.js";import{b as d,c as Y}from"./chunk-NNVT5X6O.js";import{A as se,h as re,m as ae}from"./chunk-JUXE7GQZ.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import{b as Z,e as ee}from"./chunk-45DFJJAO.js";import"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import{z as X}from"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{Eb as U,Ga as u,Jc as T,Kb as S,Oc as s,Pc as g,Qc as A,Sc as H,Tc as z,Uc as J,V as v,Vc as j,Wc as G,Xc as q,Y as D,aa as w,bc as F,bd as Q,dc as B,fc as k,gc as R,hc as K,ic as m,jc as o,kb as I,kc as r,kd as C,lc as $,ld as x,mb as a,na as _,o as M,od as N,pc as V,qc as W,sc as E,t as L,ua as b,va as y,xc as f,zc as c}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import{a as O,b as P}from"./chunk-66YHNWRR.js";var ge=n=>[n];function he(n,p){if(n&1&&(o(0,"span",14),$(1,"img",15),r(),o(2,"span"),s(3),r()),n&2){let e=p.item;a(),m("src",e.Img,I)("alt",e.Name),a(2),A(" ",e.Name," ")}}function _e(n,p){if(n&1){let e=E();V(0),j(1),C(2,"async"),o(3,"a",16),f("click",function(){b(e);let i=q(1),l=c();return y(l.submitLogistics(i))}),s(4,"Submit"),r(),W()}if(n&2){let e=c();a(),G(x(2,0,e.logisticServices$))}}function ue(n,p){}function Se(n,p){if(n&1){let e=E();o(0,"ng-select",18),J("ngModelChange",function(i){b(e);let l=c(2).$implicit;return z(l.ProductSKU,i)||(l.ProductSKU=i),y(i)}),r()}if(n&2){let e=c(),t=c().$implicit;H("ngModel",t.ProductSKU),m("items",e)}}function fe(n,p){if(n&1&&(o(0,"span"),s(1),r()),n&2){let e=c(2).$implicit;a(),g(e.ProductSKU||"-")}}function Ce(n,p){if(n&1&&S(0,ue,0,0,"ng-template",17)(1,Se,1,2,"ng-template",null,0,N)(3,fe,2,1,"ng-template",null,1,N),n&2){let e=T(2),t=T(4),i=c(2);m("ngxPermissionsOnly",Q(3,ge,i.logisticEditRole))("ngxPermissionsOnlyThen",e)("ngxPermissionsOnlyElse",t)}}function xe(n,p){if(n&1&&(o(0,"tr")(1,"td"),s(2),r(),o(3,"td"),s(4),r(),o(5,"td"),s(6),r(),o(7,"td"),F(8,Ce,5,5),C(9,"async"),r()()),n&2){let e,t=p.$implicit,i=c();a(2),g(t.Name),a(2),g(t.Service),a(2),g(t.TypeString),a(2),B((e=x(9,4,i.logisticOptions$))?8:-1,e)}}var Ve=(()=>{class n{constructor(){this.http=_(ee),this.toastr=_(Z),this.authService=_(ne),this.channelOptions=u([]),this.filter=u({ChannelID:""}),this.channelName=u(""),this.logisticEditRole=oe.LogisticUpdate,this.channelOptions.set(this.authService.getChannels()),this.initUnsupportedChannel(),this.initLoader()}initUnsupportedChannel(){let e=[d.WooCommerce,d.Lazada,d.Shopify,d.Plugo,d.Tokopedia];this.channelOptions.update(t=>t.map(i=>(e.forEach(l=>{i.TypeID===l&&(i.disabled=!0)}),i)))}initLoader(){this.http.post("/api/Logistic/Load",{}).subscribe(e=>{this.filter.set(e.Filter),this.channelName.set(this.channelOptions()[0].Name),this.initLogisticServiceOptions(),this.getLogisticService()})}initLogisticServiceOptions(){this.logisticOptions$=this.http.get("/api/Logistic/OptionLogisticsService").pipe(v(1))}submitLogistics(e){this.clonedLogisticServices$.pipe(L(t=>e.map(i=>(t.findIndex(h=>h.Name===i.Name&&h.ProductSKU==i.ProductSKU)==-1&&(i.IsChange=!0),i))),D(t=>this.http.post("/api/Logistic/Submit",t))).subscribe(()=>{this.toastr.success("Logistic service updated successfully.","Success"),this.getLogisticService()})}getLogisticService(){this.iniTitle(),this.logisticServices$=this.http.post("/api/Logistic/Get",this.filter()).pipe(L(e=>e.map(t=>(t.ProductSKU=Y.IsEmpty(t.ProductSKU)?null:t.ProductSKU,t))),w(e=>{let t=JSON.parse(JSON.stringify(e));this.clonedLogisticServices$=M(t)}),v(1))}iniTitle(){let e=this.channelOptions().find(t=>t.ID==this.filter().ChannelID);this.channelName.set(e?e.Name:null)}updateFilter(e,t){this.filter.update(i=>P(O({},i),{[e]:t}))}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=U({type:n,selectors:[["app-logistic"]],decls:29,vars:8,consts:[["thenBlock",""],["elseBlock",""],["hideSearchBox","true","searchBoxPlaceHolder","Enter Number...",3,"onSubmit","headerTitle","hideSearchDropdown"],[1,"mb-2","fw-bold"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[4,"ngxPermissionsOnly"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[1,"me-2"],[2,"width","18px",3,"src","alt"],["role","button","data-toggle","tooltip","data-placement","top","matTooltip","enter Logistic for recorded",1,"btn","btn-success","btn-fill","btn-lg","text-white",3,"click"],[3,"ngxPermissionsOnly","ngxPermissionsOnlyThen","ngxPermissionsOnlyElse"],["placeholder","Logistic Service Code","bindLabel","Name","bindValue","Code",1,"w-75",3,"ngModelChange","ngModel","items"]],template:function(t,i){t&1&&(o(0,"mainpanel",2),f("onSubmit",function(){return i.getLogisticService()}),o(1,"filters")(2,"div")(3,"label",3),s(4,"Select a Channel"),r(),o(5,"ng-select",4),f("ngModelChange",function(h){return i.updateFilter("ChannelID",h)}),S(6,he,4,3,"ng-template",5),r()()(),o(7,"actions"),S(8,_e,5,3,"ng-container",6),r(),o(9,"content")(10,"div",7)(11,"div",8)(12,"div",9)(13,"div",10)(14,"table",11)(15,"thead",12)(16,"tr",13)(17,"th"),s(18,"Logistic"),r(),o(19,"th"),s(20,"Service"),r(),o(21,"th"),s(22,"Type"),r(),o(23,"th"),s(24,"Logistic Service"),r()()(),o(25,"tbody"),R(26,xe,10,6,"tr",null,k),C(28,"async"),r()()()()()()()()),t&2&&(m("headerTitle","Logistic Courier - "+i.channelName())("hideSearchDropdown",!1),a(5),m("clearable",!1)("items",i.channelOptions())("ngModel",i.filter().ChannelID),a(3),m("ngxPermissionsOnly",i.logisticEditRole),a(18),K(x(28,6,i.logisticServices$)))},dependencies:[ce,de,se,re,ae,pe,me,ie,te,le,X],encapsulation:2,changeDetection:0})}}return n})();export{Ve as LogisticComponent};
1
+ import{a as pe,b as me,d as de}from"./chunk-ZZ7HSVKU.js";import{b as ce}from"./chunk-N54LZIRM.js";import"./chunk-DEQSZUMF.js";import"./chunk-NIRJAWTX.js";import"./chunk-RDXDKWLL.js";import{b as le}from"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import{a as oe}from"./chunk-ZSUWHVKX.js";import{h as ne}from"./chunk-UZ7JBETM.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import"./chunk-P5OAPFNC.js";import{b as te,c as ie}from"./chunk-7R55YTL6.js";import{b as d,c as Y}from"./chunk-NNVT5X6O.js";import{A as se,h as re,m as ae}from"./chunk-JUXE7GQZ.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import{b as Z,e as ee}from"./chunk-45DFJJAO.js";import"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import{z as X}from"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{Eb as U,Ga as u,Jc as T,Kb as S,Oc as s,Pc as g,Qc as A,Sc as H,Tc as z,Uc as J,V as v,Vc as j,Wc as G,Xc as q,Y as D,aa as w,bc as F,bd as Q,dc as B,fc as k,gc as R,hc as K,ic as m,jc as o,kb as I,kc as r,kd as C,lc as $,ld as x,mb as a,na as _,o as M,od as N,pc as V,qc as W,sc as E,t as L,ua as b,va as y,xc as f,zc as c}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import{a as O,b as P}from"./chunk-66YHNWRR.js";var ge=n=>[n];function he(n,p){if(n&1&&(o(0,"span",14),$(1,"img",15),r(),o(2,"span"),s(3),r()),n&2){let e=p.item;a(),m("src",e.Img,I)("alt",e.Name),a(2),A(" ",e.Name," ")}}function _e(n,p){if(n&1){let e=E();V(0),j(1),C(2,"async"),o(3,"a",16),f("click",function(){b(e);let i=q(1),l=c();return y(l.submitLogistics(i))}),s(4,"Submit"),r(),W()}if(n&2){let e=c();a(),G(x(2,0,e.logisticServices$))}}function ue(n,p){}function Se(n,p){if(n&1){let e=E();o(0,"ng-select",18),J("ngModelChange",function(i){b(e);let l=c(2).$implicit;return z(l.ProductSKU,i)||(l.ProductSKU=i),y(i)}),r()}if(n&2){let e=c(),t=c().$implicit;H("ngModel",t.ProductSKU),m("items",e)}}function fe(n,p){if(n&1&&(o(0,"span"),s(1),r()),n&2){let e=c(2).$implicit;a(),g(e.ProductSKU||"-")}}function Ce(n,p){if(n&1&&S(0,ue,0,0,"ng-template",17)(1,Se,1,2,"ng-template",null,0,N)(3,fe,2,1,"ng-template",null,1,N),n&2){let e=T(2),t=T(4),i=c(2);m("ngxPermissionsOnly",Q(3,ge,i.logisticEditRole))("ngxPermissionsOnlyThen",e)("ngxPermissionsOnlyElse",t)}}function xe(n,p){if(n&1&&(o(0,"tr")(1,"td"),s(2),r(),o(3,"td"),s(4),r(),o(5,"td"),s(6),r(),o(7,"td"),F(8,Ce,5,5),C(9,"async"),r()()),n&2){let e,t=p.$implicit,i=c();a(2),g(t.Name),a(2),g(t.Service),a(2),g(t.TypeString),a(2),B((e=x(9,4,i.logisticOptions$))?8:-1,e)}}var Ve=(()=>{class n{constructor(){this.http=_(ee),this.toastr=_(Z),this.authService=_(ne),this.channelOptions=u([]),this.filter=u({ChannelID:""}),this.channelName=u(""),this.logisticEditRole=oe.LogisticUpdate,this.channelOptions.set(this.authService.getChannels()),this.initUnsupportedChannel(),this.initLoader()}initUnsupportedChannel(){let e=[d.WooCommerce,d.Lazada,d.Shopify,d.Plugo,d.Tokopedia];this.channelOptions.update(t=>t.map(i=>(e.forEach(l=>{i.TypeID===l&&(i.disabled=!0)}),i)))}initLoader(){this.http.post("/api/Logistic/Load",{}).subscribe(e=>{this.filter.set(e.Filter),this.channelName.set(this.channelOptions()[0].Name),this.initLogisticServiceOptions(),this.getLogisticService()})}initLogisticServiceOptions(){this.logisticOptions$=this.http.get("/api/Logistic/OptionLogisticsService").pipe(v(1))}submitLogistics(e){this.clonedLogisticServices$.pipe(L(t=>e.map(i=>(t.findIndex(h=>h.Name===i.Name&&h.ProductSKU==i.ProductSKU)==-1&&(i.IsChange=!0),i))),D(t=>this.http.post("/api/Logistic/Submit",t))).subscribe(()=>{this.toastr.success("Logistic service updated successfully.","Success"),this.getLogisticService()})}getLogisticService(){this.iniTitle(),this.logisticServices$=this.http.post("/api/Logistic/Get",this.filter()).pipe(L(e=>e.map(t=>(t.ProductSKU=Y.IsEmpty(t.ProductSKU)?null:t.ProductSKU,t))),w(e=>{let t=JSON.parse(JSON.stringify(e));this.clonedLogisticServices$=M(t)}),v(1))}iniTitle(){let e=this.channelOptions().find(t=>t.ID==this.filter().ChannelID);this.channelName.set(e?e.Name:null)}updateFilter(e,t){this.filter.update(i=>P(O({},i),{[e]:t}))}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=U({type:n,selectors:[["app-logistic"]],decls:29,vars:8,consts:[["thenBlock",""],["elseBlock",""],["hideSearchBox","true","searchBoxPlaceHolder","Enter Number...",3,"onSubmit","headerTitle","hideSearchDropdown"],[1,"mb-2","fw-bold"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[4,"ngxPermissionsOnly"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[1,"me-2"],[2,"width","18px",3,"src","alt"],["role","button","data-toggle","tooltip","data-placement","top","matTooltip","enter Logistic for recorded",1,"btn","btn-success","btn-fill","btn-lg","text-white",3,"click"],[3,"ngxPermissionsOnly","ngxPermissionsOnlyThen","ngxPermissionsOnlyElse"],["placeholder","Logistic Service Code","bindLabel","Name","bindValue","Code",1,"w-75",3,"ngModelChange","ngModel","items"]],template:function(t,i){t&1&&(o(0,"mainpanel",2),f("onSubmit",function(){return i.getLogisticService()}),o(1,"filters")(2,"div")(3,"label",3),s(4,"Select a Channel"),r(),o(5,"ng-select",4),f("ngModelChange",function(h){return i.updateFilter("ChannelID",h)}),S(6,he,4,3,"ng-template",5),r()()(),o(7,"actions"),S(8,_e,5,3,"ng-container",6),r(),o(9,"content")(10,"div",7)(11,"div",8)(12,"div",9)(13,"div",10)(14,"table",11)(15,"thead",12)(16,"tr",13)(17,"th"),s(18,"Logistic"),r(),o(19,"th"),s(20,"Service"),r(),o(21,"th"),s(22,"Type"),r(),o(23,"th"),s(24,"Logistic Service"),r()()(),o(25,"tbody"),R(26,xe,10,6,"tr",null,k),C(28,"async"),r()()()()()()()()),t&2&&(m("headerTitle","Logistic Courier - "+i.channelName())("hideSearchDropdown",!1),a(5),m("clearable",!1)("items",i.channelOptions())("ngModel",i.filter().ChannelID),a(3),m("ngxPermissionsOnly",i.logisticEditRole),a(18),K(x(28,6,i.logisticServices$)))},dependencies:[ce,de,se,re,ae,pe,me,ie,te,le,X],encapsulation:2,changeDetection:0})}}return n})();export{Ve as LogisticComponent};
@@ -1 +1 @@
1
- import{a as ee}from"./chunk-24Q33PBZ.js";import{a as $}from"./chunk-YGXBMXX2.js";import"./chunk-QUY3OMUB.js";import"./chunk-72AE6737.js";import{a as Z}from"./chunk-KMCVYMXQ.js";import"./chunk-ACIMXBIC.js";import{a as Q,b as X,d as Y}from"./chunk-ZZ7HSVKU.js";import{b as K}from"./chunk-N54LZIRM.js";import"./chunk-DEQSZUMF.js";import"./chunk-NIRJAWTX.js";import"./chunk-RDXDKWLL.js";import"./chunk-2GINYFUG.js";import"./chunk-RMWAYIJL.js";import"./chunk-EDNKI3WA.js";import"./chunk-CM45JN3C.js";import"./chunk-7BEOEYAC.js";import"./chunk-WU3SNCIC.js";import"./chunk-MOG4SYJE.js";import"./chunk-JY726AM5.js";import"./chunk-2BS4VK45.js";import"./chunk-TTMPMWUQ.js";import"./chunk-5RV2CJGS.js";import"./chunk-QGNTUEVO.js";import"./chunk-GJXDRPAS.js";import"./chunk-GBUDZCXK.js";import"./chunk-S3MYFAWN.js";import"./chunk-BXA5YUTN.js";import"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import{h as q}from"./chunk-ZVCNMOKL.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import"./chunk-P5OAPFNC.js";import"./chunk-7R55YTL6.js";import"./chunk-NNVT5X6O.js";import{A as U,c as J,h as H,m as j,o as G}from"./chunk-JUXE7GQZ.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import{e as V}from"./chunk-45DFJJAO.js";import{e as A}from"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import{B}from"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{Eb as w,Ga as g,Kb as M,Oc as p,Pc as O,Qc as _,Sc as S,Tc as E,Uc as v,ad as k,bc as C,bd as R,dc as x,fc as D,gc as I,hc as P,ic as d,jc as n,kb as N,kc as i,kd as z,lc as b,mb as m,md as W,na as y,sc as F,ua as L,va as T,xc as u,zc as h}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import{a as s,b as f}from"./chunk-66YHNWRR.js";var te=()=>["/menu/log/exception/detail"],ne=o=>({ID:o});function ie(o,c){if(o&1&&(n(0,"span",17),b(1,"img",18),i(),p(2)),o&2){let e=c.item;m(),d("src",e.Img,N)("alt",e.Name),m(),_(" ",e.Name," ")}}function oe(o,c){if(o&1&&b(0,"img",23),o&2){let e=h().$implicit;d("src",e.Logo,N)}}function ae(o,c){if(o&1&&(n(0,"tr")(1,"td"),C(2,oe,1,1,"img",23),p(3),i(),n(4,"td")(5,"a",24),p(6),i()(),n(7,"td"),p(8),z(9,"date"),i(),n(10,"td")(11,"div"),p(12),i()()()),o&2){let e=c.$implicit;m(2),x(e.Logo?2:-1),m(),_(" ",e.ChannelName," "),m(2),d("routerLink",k(10,te))("queryParams",R(11,ne,e.id)),m(),_(" ",e.number??"N/A"," "),m(2),_(" ",W(9,7,e.date,"dd-MM-yyyy hh:mm:ss")," "),m(4),O(e.response)}}function re(o,c){if(o&1){let e=F();n(0,"mat-paginator",25),u("page",function(t){L(e);let r=h(2);return T(r.onPaginationChange(t))}),i()}if(o&2){let e=h(2);d("length",e.pageTotal())("pageSize",e.pageSize())("pageIndex",e.filter().PageNumber==0?0:e.filter().PageNumber-1)}}function le(o,c){if(o&1&&(n(0,"div",15)(1,"table",19)(2,"thead")(3,"tr",20)(4,"th",21),p(5,"Channel Name"),i(),n(6,"th",21),p(7,"Number"),i(),n(8,"th",21),p(9,"Date"),i(),n(10,"th"),p(11,"Exception"),i()()(),n(12,"tbody"),I(13,ae,13,13,"tr",null,D),i()(),C(15,re,1,3,"mat-paginator",22),i()),o&2){let e,l=h();m(13),P(l.exceptions()),m(2),x(((e=l.exceptions())==null?null:e.length)>0?15:-1)}}function me(o,c){o&1&&(n(0,"div",16),b(1,"app-empty-state"),i())}var Ne=(()=>{class o{constructor(){this.http=y(V),this.authService=y(q),this.exceptions=g([]),this.pageTotal=g(0),this.pageSize=g(0),this.filter=g({RowCount:50,PageNumber:1,Number:null,From:null,To:null,ChannelID:null}),this.channelOptions=g(this.authService.getChannels())}parseJsonSafe(e){if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e}ngOnInit(){this.Load()}Load(e={}){this.http.post("/api/OrdersLoader/Get",e).subscribe(l=>{this.filter.update(t=>s(s({},t),l.Filter)),this.getData()})}getData(e){this.filter.update(l=>f(s({},l),{Number:e})),this.http.post("/api/Orders/GetExceptionList",this.filter()).subscribe(l=>{this.exceptions.set(l.hits.map(t=>{let r=t._source||{};return{id:t._id,ChannelName:r.channelId!=null?this.channelOptions().find(a=>a.ID===r.channelId)?.Name:r.shopId,Logo:r.channelId!=null?this.channelOptions().find(a=>a.ID===r.channelId)?.Img:null,number:r.error?.number,date:r["@timestamp_received"]||r["@timestamp"]||null,stackTrace:r.error?.stackTrace,response:r.error?.response,message:r.message,requestJSON:r.error?.requestJSON}})),this.pageTotal.set(l.total?.value),this.pageSize.set(this.filter().RowCount>this.pageTotal()?this.pageTotal():this.filter()?.RowCount)})}onPaginationChange(e){this.filter.update(l=>f(s({},l),{PageNumber:e.pageIndex+1})),this.getData()}updateFilter(e,l){this.filter.update(t=>f(s({},t),{[e]:l}))}static{this.\u0275fac=function(l){return new(l||o)}}static{this.\u0275cmp=w({type:o,selectors:[["app-exception-log"]],decls:28,vars:8,consts:[["headerTitle","Exception Log","searchBoxPlaceHolder","Enter Number...",3,"onSubmit"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table","table-hover"],[1,"table-light"],[2,"width","10%"],[3,"length","pageSize","pageIndex"],["alt","Logo",2,"width","18px",3,"src"],[3,"routerLink","queryParams"],[3,"page","length","pageSize","pageIndex"]],template:function(l,t){l&1&&(n(0,"mainpanel",0),u("onSubmit",function(a){return t.getData(a)}),n(1,"filters")(2,"div")(3,"label",1),p(4,"Channel"),i(),n(5,"ng-select",2),v("ngModelChange",function(a){return E(t.filter().ChannelID,a)||(t.filter().ChannelID=a),a}),M(6,ie,3,3,"ng-template",3),i()(),n(7,"div",4)(8,"label",5),p(9,"From/To"),i(),n(10,"div",6)(11,"datepicker",7),u("dateChange",function(a){return t.updateFilter("From",a)}),i()(),n(12,"div")(13,"datepicker",8),u("dateChange",function(a){return t.updateFilter("To",a)}),i()()(),n(14,"div",4)(15,"label",9),p(16,"Page Number"),i(),n(17,"input",10),v("ngModelChange",function(a){return E(t.filter().PageNumber,a)||(t.filter().PageNumber=a),a}),i()(),n(18,"div",4)(19,"label",9),p(20,"Page Size"),i(),n(21,"input",11),v("ngModelChange",function(a){return E(t.filter().RowCount,a)||(t.filter().RowCount=a),a}),i()()(),n(22,"content")(23,"div",12)(24,"div",13)(25,"div",14),C(26,le,16,1,"div",15)(27,me,2,0,"div",16),i()()()()()),l&2&&(m(5),d("clearable",!0)("items",t.channelOptions()),S("ngModel",t.filter().ChannelID),m(6),d("date",t.filter().From),m(2),d("date",t.filter().To),m(4),S("ngModel",t.filter().PageNumber),m(4),S("ngModel",t.filter().RowCount),m(5),x(t.exceptions().length>0?26:27))},dependencies:[K,Y,U,J,G,H,j,Q,X,$,A,ee,Z,B],encapsulation:2,changeDetection:0})}}return o})();export{Ne as ExceptionLogComponent};
1
+ import{a as ee}from"./chunk-24Q33PBZ.js";import{a as $}from"./chunk-YGXBMXX2.js";import"./chunk-QUY3OMUB.js";import"./chunk-72AE6737.js";import{a as Z}from"./chunk-KMCVYMXQ.js";import"./chunk-ACIMXBIC.js";import{a as Q,b as X,d as Y}from"./chunk-ZZ7HSVKU.js";import{b as K}from"./chunk-N54LZIRM.js";import"./chunk-DEQSZUMF.js";import"./chunk-NIRJAWTX.js";import"./chunk-RDXDKWLL.js";import"./chunk-2GINYFUG.js";import"./chunk-RMWAYIJL.js";import"./chunk-EDNKI3WA.js";import"./chunk-CM45JN3C.js";import"./chunk-7BEOEYAC.js";import"./chunk-WU3SNCIC.js";import"./chunk-MOG4SYJE.js";import"./chunk-JY726AM5.js";import"./chunk-2BS4VK45.js";import"./chunk-TTMPMWUQ.js";import"./chunk-5RV2CJGS.js";import"./chunk-QGNTUEVO.js";import"./chunk-GJXDRPAS.js";import"./chunk-GBUDZCXK.js";import"./chunk-S3MYFAWN.js";import"./chunk-BXA5YUTN.js";import"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import{h as q}from"./chunk-UZ7JBETM.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import"./chunk-P5OAPFNC.js";import"./chunk-7R55YTL6.js";import"./chunk-NNVT5X6O.js";import{A as U,c as J,h as H,m as j,o as G}from"./chunk-JUXE7GQZ.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import{e as V}from"./chunk-45DFJJAO.js";import{e as A}from"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import{B}from"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{Eb as w,Ga as g,Kb as M,Oc as p,Pc as O,Qc as _,Sc as S,Tc as E,Uc as v,ad as k,bc as C,bd as R,dc as x,fc as D,gc as I,hc as P,ic as d,jc as n,kb as N,kc as i,kd as z,lc as b,mb as m,md as W,na as y,sc as F,ua as L,va as T,xc as u,zc as h}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import{a as s,b as f}from"./chunk-66YHNWRR.js";var te=()=>["/menu/log/exception/detail"],ne=o=>({ID:o});function ie(o,c){if(o&1&&(n(0,"span",17),b(1,"img",18),i(),p(2)),o&2){let e=c.item;m(),d("src",e.Img,N)("alt",e.Name),m(),_(" ",e.Name," ")}}function oe(o,c){if(o&1&&b(0,"img",23),o&2){let e=h().$implicit;d("src",e.Logo,N)}}function ae(o,c){if(o&1&&(n(0,"tr")(1,"td"),C(2,oe,1,1,"img",23),p(3),i(),n(4,"td")(5,"a",24),p(6),i()(),n(7,"td"),p(8),z(9,"date"),i(),n(10,"td")(11,"div"),p(12),i()()()),o&2){let e=c.$implicit;m(2),x(e.Logo?2:-1),m(),_(" ",e.ChannelName," "),m(2),d("routerLink",k(10,te))("queryParams",R(11,ne,e.id)),m(),_(" ",e.number??"N/A"," "),m(2),_(" ",W(9,7,e.date,"dd-MM-yyyy hh:mm:ss")," "),m(4),O(e.response)}}function re(o,c){if(o&1){let e=F();n(0,"mat-paginator",25),u("page",function(t){L(e);let r=h(2);return T(r.onPaginationChange(t))}),i()}if(o&2){let e=h(2);d("length",e.pageTotal())("pageSize",e.pageSize())("pageIndex",e.filter().PageNumber==0?0:e.filter().PageNumber-1)}}function le(o,c){if(o&1&&(n(0,"div",15)(1,"table",19)(2,"thead")(3,"tr",20)(4,"th",21),p(5,"Channel Name"),i(),n(6,"th",21),p(7,"Number"),i(),n(8,"th",21),p(9,"Date"),i(),n(10,"th"),p(11,"Exception"),i()()(),n(12,"tbody"),I(13,ae,13,13,"tr",null,D),i()(),C(15,re,1,3,"mat-paginator",22),i()),o&2){let e,l=h();m(13),P(l.exceptions()),m(2),x(((e=l.exceptions())==null?null:e.length)>0?15:-1)}}function me(o,c){o&1&&(n(0,"div",16),b(1,"app-empty-state"),i())}var Ne=(()=>{class o{constructor(){this.http=y(V),this.authService=y(q),this.exceptions=g([]),this.pageTotal=g(0),this.pageSize=g(0),this.filter=g({RowCount:50,PageNumber:1,Number:null,From:null,To:null,ChannelID:null}),this.channelOptions=g(this.authService.getChannels())}parseJsonSafe(e){if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e}ngOnInit(){this.Load()}Load(e={}){this.http.post("/api/OrdersLoader/Get",e).subscribe(l=>{this.filter.update(t=>s(s({},t),l.Filter)),this.getData()})}getData(e){this.filter.update(l=>f(s({},l),{Number:e})),this.http.post("/api/Orders/GetExceptionList",this.filter()).subscribe(l=>{this.exceptions.set(l.hits.map(t=>{let r=t._source||{};return{id:t._id,ChannelName:r.channelId!=null?this.channelOptions().find(a=>a.ID===r.channelId)?.Name:r.shopId,Logo:r.channelId!=null?this.channelOptions().find(a=>a.ID===r.channelId)?.Img:null,number:r.error?.number,date:r["@timestamp_received"]||r["@timestamp"]||null,stackTrace:r.error?.stackTrace,response:r.error?.response,message:r.message,requestJSON:r.error?.requestJSON}})),this.pageTotal.set(l.total?.value),this.pageSize.set(this.filter().RowCount>this.pageTotal()?this.pageTotal():this.filter()?.RowCount)})}onPaginationChange(e){this.filter.update(l=>f(s({},l),{PageNumber:e.pageIndex+1})),this.getData()}updateFilter(e,l){this.filter.update(t=>f(s({},t),{[e]:l}))}static{this.\u0275fac=function(l){return new(l||o)}}static{this.\u0275cmp=w({type:o,selectors:[["app-exception-log"]],decls:28,vars:8,consts:[["headerTitle","Exception Log","searchBoxPlaceHolder","Enter Number...",3,"onSubmit"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table","table-hover"],[1,"table-light"],[2,"width","10%"],[3,"length","pageSize","pageIndex"],["alt","Logo",2,"width","18px",3,"src"],[3,"routerLink","queryParams"],[3,"page","length","pageSize","pageIndex"]],template:function(l,t){l&1&&(n(0,"mainpanel",0),u("onSubmit",function(a){return t.getData(a)}),n(1,"filters")(2,"div")(3,"label",1),p(4,"Channel"),i(),n(5,"ng-select",2),v("ngModelChange",function(a){return E(t.filter().ChannelID,a)||(t.filter().ChannelID=a),a}),M(6,ie,3,3,"ng-template",3),i()(),n(7,"div",4)(8,"label",5),p(9,"From/To"),i(),n(10,"div",6)(11,"datepicker",7),u("dateChange",function(a){return t.updateFilter("From",a)}),i()(),n(12,"div")(13,"datepicker",8),u("dateChange",function(a){return t.updateFilter("To",a)}),i()()(),n(14,"div",4)(15,"label",9),p(16,"Page Number"),i(),n(17,"input",10),v("ngModelChange",function(a){return E(t.filter().PageNumber,a)||(t.filter().PageNumber=a),a}),i()(),n(18,"div",4)(19,"label",9),p(20,"Page Size"),i(),n(21,"input",11),v("ngModelChange",function(a){return E(t.filter().RowCount,a)||(t.filter().RowCount=a),a}),i()()(),n(22,"content")(23,"div",12)(24,"div",13)(25,"div",14),C(26,le,16,1,"div",15)(27,me,2,0,"div",16),i()()()()()),l&2&&(m(5),d("clearable",!0)("items",t.channelOptions()),S("ngModel",t.filter().ChannelID),m(6),d("date",t.filter().From),m(2),d("date",t.filter().To),m(4),S("ngModel",t.filter().PageNumber),m(4),S("ngModel",t.filter().RowCount),m(5),x(t.exceptions().length>0?26:27))},dependencies:[K,Y,U,J,G,H,j,Q,X,$,A,ee,Z,B],encapsulation:2,changeDetection:0})}}return o})();export{Ne as ExceptionLogComponent};
@@ -1 +1 @@
1
- import"./chunk-66YHNWRR.js";var o=[{path:"",loadComponent(){return import("./chunk-LCDZVI4S.js").then(t=>t.LoginComponent)},data:{title:"Dealpos x Marketplace"}},{path:"shopee",loadComponent(){return import("./chunk-VVPKQD3A.js").then(t=>t.ShopeeAuthorizedComponent)},data:{title:"Success"}},{path:"tiktok",loadComponent(){return import("./chunk-L2H7TFVM.js").then(t=>t.TiktokComponent)},data:{title:"Success"}},{path:"lazada",loadComponent(){return import("./chunk-YJPGX6PH.js").then(t=>t.LazadaComponent)},data:{title:"Success"}},{path:"shopify",loadComponent(){return import("./chunk-Z35LIB3M.js").then(t=>t.ShopifyAuthorizedComponent)},data:{title:"Success"}}];export{o as routes};
1
+ import"./chunk-66YHNWRR.js";var o=[{path:"",loadComponent(){return import("./chunk-UCPQI4IJ.js").then(t=>t.LoginComponent)},data:{title:"Dealpos x Marketplace"}},{path:"shopee",loadComponent(){return import("./chunk-VVPKQD3A.js").then(t=>t.ShopeeAuthorizedComponent)},data:{title:"Success"}},{path:"tiktok",loadComponent(){return import("./chunk-L2H7TFVM.js").then(t=>t.TiktokComponent)},data:{title:"Success"}},{path:"lazada",loadComponent(){return import("./chunk-YJPGX6PH.js").then(t=>t.LazadaComponent)},data:{title:"Success"}},{path:"shopify",loadComponent(){return import("./chunk-Z35LIB3M.js").then(t=>t.ShopifyAuthorizedComponent)},data:{title:"Success"}}];export{o as routes};
@@ -1 +1 @@
1
- import{a as ae,b as de}from"./chunk-YAUELLS3.js";import"./chunk-QUY3OMUB.js";import{a as ge}from"./chunk-YWLXJVUQ.js";import{a as se}from"./chunk-7KG3DC5J.js";import{a as Ce}from"./chunk-TWRFL73R.js";import{e as ce}from"./chunk-TBQAAZKJ.js";import"./chunk-GIPWMAZL.js";import"./chunk-7ES2Z445.js";import{a as k}from"./chunk-D7S7RUIP.js";import"./chunk-SSQ23ZNC.js";import"./chunk-HEO6A7EN.js";import"./chunk-72AE6737.js";import"./chunk-WTUKJT4T.js";import{a as _e}from"./chunk-KMCVYMXQ.js";import{a as le}from"./chunk-RG24XPVA.js";import"./chunk-QDKVYF6D.js";import"./chunk-YHJNCAG6.js";import"./chunk-6PI5PUIQ.js";import"./chunk-6V4QU6J7.js";import"./chunk-XSXHGAXP.js";import"./chunk-W2CSYQ6H.js";import"./chunk-ODW7HQHU.js";import"./chunk-TWIWWZUD.js";import"./chunk-BKR7YPEW.js";import"./chunk-DAGGBVVW.js";import"./chunk-ACIMXBIC.js";import"./chunk-67AXBZYF.js";import"./chunk-5QG5PZ7U.js";import"./chunk-KYK2ZFUZ.js";import{d as re}from"./chunk-ZZ7HSVKU.js";import{b as oe}from"./chunk-N54LZIRM.js";import"./chunk-DEQSZUMF.js";import{c as ne,h as ie}from"./chunk-NIRJAWTX.js";import"./chunk-RDXDKWLL.js";import{f as pe,g as ue,h as he,i as me}from"./chunk-RMWAYIJL.js";import"./chunk-EDNKI3WA.js";import"./chunk-CM45JN3C.js";import"./chunk-7BEOEYAC.js";import"./chunk-WU3SNCIC.js";import"./chunk-MOG4SYJE.js";import"./chunk-JY726AM5.js";import"./chunk-2BS4VK45.js";import"./chunk-TTMPMWUQ.js";import"./chunk-5RV2CJGS.js";import"./chunk-QGNTUEVO.js";import"./chunk-GJXDRPAS.js";import"./chunk-GBUDZCXK.js";import"./chunk-S3MYFAWN.js";import"./chunk-SPNVH2ST.js";import"./chunk-BXA5YUTN.js";import"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import{a as T}from"./chunk-ZSUWHVKX.js";import{h as K}from"./chunk-ZVCNMOKL.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import"./chunk-P5OAPFNC.js";import{b as Y,c as q}from"./chunk-7R55YTL6.js";import{b as M,c as h}from"./chunk-NNVT5X6O.js";import{A as te,c as Q,h as X,m as ee}from"./chunk-JUXE7GQZ.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import{b as j,e as z}from"./chunk-45DFJJAO.js";import{d as Z}from"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{E as w,Eb as G,Ga as _,Jc as O,Kb as J,Oc as y,Qc as F,Sc as B,Tc as U,Uc as A,Y as R,bc as S,bd as V,dc as x,fc as W,gc as H,hc as $,ic as C,jc as u,kc as d,lc as b,mb as r,na as P,pc as I,qc as v,sc as f,ua as c,va as s,xc as m,zc as a}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import{a as E,b as N}from"./chunk-66YHNWRR.js";var L=o=>[o];function Pe(o,g){if(o&1){let e=f();u(0,"button",15),m("click",function(){c(e);let t=a(2);return s(t.onDetachMultipleProduct())}),b(1,"i",16),y(2),d()}if(o&2){let e,n=a(2);r(2),F("Detach (",(e=n.productService.selectedProduct(n.products()))==null?null:e.length,") ")}}function fe(o,g){if(o&1&&(I(0),S(1,Pe,3,1,"button",14),v()),o&2){let e=a();r(),x(e.productService.hasSelection(e.products())?1:-1)}}function Se(o,g){if(o&1){let e=f();u(0,"button",18),m("click",function(){c(e);let t=a(2);return s(t.onScanMultipleProduct())}),b(1,"i",19),y(2),d()}if(o&2){let e,n=a(2);r(2),F(" Scan (",(e=n.productService.selectedProduct(n.products()))==null?null:e.length,") ")}}function xe(o,g){if(o&1&&(I(0),S(1,Se,3,1,"button",17),v()),o&2){let e=a();r(),x(e.productService.hasSelection(e.products())&&e.multipeScanChannels().length>0?1:-1)}}function be(o,g){if(o&1){let e=f();u(0,"button",21),m("click",function(){c(e);let t=a(2);return s(t.onUploadMultipleProduct())}),b(1,"i",22),y(2),d()}if(o&2){let e,n=a(2);r(2),F(" Upload (",(e=n.productService.selectedProduct(n.products()))==null?null:e.length,") ")}}function we(o,g){if(o&1&&(I(0),S(1,be,3,1,"button",20),v()),o&2){let e=a();r(),x(e.productService.hasSelection(e.products())?1:-1)}}function ye(o,g){if(o&1){let e=f();u(0,"div",11)(1,"app-product-card",23),m("onUpload",function(){let t=c(e).$implicit,i=a();return s(i.onUploadToMultipleChannel(t))})("onScan",function(){let t=c(e).$implicit,i=a();return s(i.onScanSingleProduct(t))})("onDescEvent",function(){let t=c(e).$index,i=a();return s(i.onOpenDialogVariant(t))})("onCheckBoxChange",function(t){let i=c(e).$implicit;return s(i.selected=t)})("onDetach",function(){let t=c(e).$implicit,i=a();return s(i.onDetachProduct([t]))}),d()()}if(o&2){let e=g.$implicit,n=a();r(),C("productId",e.ID)("title",e==null?null:e.Name)("image",e==null?null:e.ThumbnailUrl)("description",(e==null||e.Variants==null?null:e.Variants.length)>1?(e==null||e.Variants==null?null:e.Variants.length)+" Variants":null)("channels",n.productService.getChannelProduct(e))("code",n.getVariantCode(e==null?null:e.Variants))("showCheckBox",(e==null?null:e.Channel.length)<n.channelOptions().length)("scanButton",!0)("uploadButton",e==null?null:e.hasUpload)("imageForZoom",e==null?null:e.ImageUrl)("detachButton",(e==null||e.Channel==null?null:e.Channel.length)>0)}}function Me(o,g){o&1&&(u(0,"div",12),b(1,"app-empty-state"),d())}function De(o,g){if(o&1){let e=f();u(0,"div",13)(1,"div",24)(2,"app-custom-paginator",25),m("next",function(){c(e);let t=a();return s(t.getProducts())})("previous",function(){c(e);let t=a();return s(t.getProducts())}),d()()()}if(o&2){let e,n=a();r(2),C("filter",n.searchFilter())("totaldata",(e=n.products())==null?null:e.length)("paginationTotal",n.rowCount())("hasClicked",!0)("nextButtonAlwaysVisible",!0)}}var ot=(()=>{class o{constructor(){this.http=P(z),this.toastr=P(j),this.dialog=P(ne),this.productService=P(le),this.authService=P(K),this.uploadProductService=P(ce),this.route=P(Z),this.channelOptions=_([]),this.Categories=_([]),this.searchFilter=_(new se),this.products=_([]),this.rowCount=_(0),this.startDate=_(void 0),this.endDate=_(void 0),this.multipeScanChannels=_([]),this.scanProductRole=T.ProductScan,this.uploadProductRole=T.ProductUpload,this.detachProductRole=T.ProductDetach,this.getLoaderPage(),this.channelOptions.set(this.authService.getChannels()),this.initMultiScanChannels()}getLoaderPage(){this.productService.LoadInPOS().subscribe(e=>{this.Categories.set(e.Options.Categories),this.searchFilter.update(n=>(n.PageNumber=e.Filter.PageNumber,n.RowCount=e.Filter.RowCount,n.ChannelID=null,n.Category=e.Filter.Category,n.PageSize=100,n)),this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels.set(this.productService.filterChannelByTypeId(this.channelOptions(),[M.Tokopedia,M.Tiktok]))}getProducts(){let e={PageNumber:this.searchFilter().PageNumber,RowCount:this.searchFilter().RowCount,text:this.searchFilter().text,Category:this.searchFilter().Category,From:this.startDate(),To:this.endDate()};this.http.post("/api/product/GetInPOS",e).subscribe(n=>{this.products.set(n.Data),this.rowCount.set(n.Total==null?this.searchFilter().RowCount:n.Total.toString()),this.products.set(this.productService.checkProductHasUploadBtn(this.products(),this.channelOptions()))})}onOpenScanDialog(){let e=JSON.parse(JSON.stringify(this.searchFilter()));e.ChannelID=h.GuidEMpty,this.dialog.open(k,{data:{filter:e,channelOptions:this.channelOptions()},width:"600px"}).afterClosed().pipe(w(t=>h.IsNotEmpty(t))).subscribe(t=>{this.searchFilter.update(i=>(i.ChannelID=t.ChannelID,i.ScanFull=t.ScanFull,i.UpdatedProduct=t.UpdatedProduct,i.Async=t.Async,i)),this.scanAllProduct()})}scanAllProduct(){if(this.searchFilter().ChannelID==null){this.toastr.error("Please Select Channel","Error");return}this.productService.scanAll(this.searchFilter().ChannelID,this.searchFilter().ScanFull,this.searchFilter().UpdatedProduct,this.searchFilter().Async).subscribe(e=>{if(this.searchFilter().Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{this.getLoaderPage();let n=this.productService.findChannelById(this.searchFilter().ChannelID,this.channelOptions());this.productService.successToastrScanAllProduct(e,n,!this.searchFilter().UpdatedProduct)}})}onOpenDialogVariant(e){let n=this.products()[e];this.productService.getSoldInChannelDetail(n.ID,this.searchFilter().ListChannelID).pipe(R(t=>this.dialog.open(ae,{data:{variants:t,title:n.Name}}).afterClosed())).subscribe()}onUploadMultipleProduct(){let e=this.productService.selectedProduct(this.products());this.uploadProductService.setSelectedProduct(e),this.route.navigate(["/menu/products/upload"])}onUploadToMultipleChannel(e){this.uploadProductService.setSelectedProduct([e]),this.route.navigate(["/menu/products/upload"])}searchProduct(e){this.searchFilter.update(n=>(n.text=e,n)),this.getProducts()}onScanMultipleProduct(){let e=JSON.parse(JSON.stringify(this.searchFilter()));e.ChannelID=h.GuidEMpty;let n=this.productService.filterChannelByTypeId(this.channelOptions(),[M.Tokopedia,M.Tiktok]);this.dialog.open(k,{data:{filter:e,channelOptions:n,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(w(i=>h.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.update(D=>(D.ChannelID=i.ChannelID,D.ScanFull=i.ScanFull,D.UpdatedProduct=i.UpdatedProduct,D));let p=this.productService.selectedProduct(this.products()),l=this.productService.getVariantCodesProducts(p);this.scanSingleProduct(l)})}onScanSingleProduct(e){let n=JSON.parse(JSON.stringify(this.searchFilter()));n.ChannelID=h.GuidEMpty,this.dialog.open(k,{data:{filter:n,channelOptions:this.channelOptions(),isSingleChannel:!0},width:"600px"}).afterClosed().pipe(w(t=>h.IsNotEmpty(t))).subscribe(t=>{this.searchFilter.update(p=>(p.ChannelID=t.ChannelID,p));let i=this.productService.getVariantCodesProduct(e);this.scanSingleProduct(i)})}scanSingleProduct(e){this.productService.scanSingle(this.searchFilter().ChannelID,e).subscribe({next:n=>{if(n)this.toastr.success("Successfully Scan ","Success");else{let t=this.productService.findChannelById(this.searchFilter().ChannelID,this.channelOptions());this.toastr.error(`This product is not existed in ${t?.Name} `,"Error")}this.searchFilter.update(t=>(t.ChannelID=h.GuidEMpty,t)),n&&this.getProducts()},error:n=>{this.searchFilter.update(t=>(t.ChannelID=h.GuidEMpty,t))}})}getVariantCode(e=[]){let n;return e?.length>1&&(n=(e[0].model?e[0].model:"")+e[0].Code),e?.length==1&&(n=e[0].Code),n}onDetachProduct(e){let n=[];e.forEach(t=>{t.Channel=h.assignChannelLogo(t.Channel),n.push(...t.Channel)}),this.dialog.open(de,{width:"600px",data:[...n]}).afterClosed().pipe(w(t=>h.IsNotEmpty(t)),R(t=>{let i=t.map(p=>N(E({},p),{POSProductID:e[0]?.ID}));return this.productService.detachProduct(i)})).subscribe(t=>{this.toastr.success(t.Message,ie.Success),this.getProducts()})}onDetachMultipleProduct(){let e=this.productService.selectedProduct(this.products());this.onDetachProduct(e)}updateFilter(e,n){this.searchFilter.update(t=>N(E({},t),{[e]:n}))}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=G({type:o,selectors:[["app-in-pos"]],decls:23,vars:18,consts:[["picker",""],["description","All products which is already available in POS",3,"onSubmit","headerTitle"],[4,"ngxPermissionsOnly"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","Name","bindValue","Name","placeholder","Select Category",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[1,"mt-5"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"container-fluid"],[1,"row","mt-8"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"fa-sharp","fa-link-slash","me-2"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-light","shadow","rounded","ms-2"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[3,"onUpload","onScan","onDescEvent","onCheckBoxChange","onDetach","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","detachButton"],[1,"col-md-12"],[3,"next","previous","filter","totaldata","paginationTotal","hasClicked","nextButtonAlwaysVisible"]],template:function(n,t){if(n&1){let i=f();u(0,"mainpanel",1),m("onSubmit",function(l){return c(i),s(t.searchProduct(l))}),u(1,"actions"),J(2,fe,2,1,"ng-container",2)(3,xe,2,1,"ng-container",2)(4,we,2,1,"ng-container",2),d(),u(5,"filters")(6,"div")(7,"label",3),y(8,"Category"),d(),u(9,"ng-select",4),m("ngModelChange",function(l){return c(i),s(t.updateFilter("Category",l))}),d()(),u(10,"div",5)(11,"mat-date-range-input",6)(12,"input",7),A("ngModelChange",function(l){return c(i),U(t.startDate,l)||(t.startDate=l),s(l)}),m("click",function(){c(i);let l=O(15);return s(l.open())}),d(),u(13,"input",8),A("ngModelChange",function(l){return c(i),U(t.endDate,l)||(t.endDate=l),s(l)}),m("click",function(){c(i);let l=O(15);return s(l.open())}),d()(),b(14,"mat-date-range-picker",null,0),d()(),u(16,"content")(17,"div",9)(18,"div",10),H(19,ye,2,11,"div",11,W),S(21,Me,2,0,"div",12),d(),S(22,De,3,5,"div",13),d()()()}if(n&2){let i,p=O(15);C("headerTitle","In POS ("+t.rowCount()+")"),r(2),C("ngxPermissionsOnly",V(12,L,t.detachProductRole)),r(),C("ngxPermissionsOnly",V(14,L,t.scanProductRole)),r(),C("ngxPermissionsOnly",V(16,L,t.scanProductRole)),r(5),C("clearable",!0)("items",t.Categories())("ngModel",t.searchFilter().Category),r(2),C("rangePicker",p),r(),B("ngModel",t.startDate),r(),B("ngModel",t.endDate),r(6),$(t.products()),r(2),x(t.products().length==0?21:-1),r(),x(((i=t.products())==null?null:i.length)>0?22:-1)}},dependencies:[oe,te,Q,X,ee,q,Y,re,pe,ue,he,me,ge,_e,Ce],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media(min-width:1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.img-logo[_ngcontent-%COMP%]{height:24px;width:24px}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}"],changeDetection:0})}}return o})();export{ot as InPosComponent};
1
+ import{a as ae,b as de}from"./chunk-YAUELLS3.js";import"./chunk-QUY3OMUB.js";import{a as ge}from"./chunk-YWLXJVUQ.js";import{a as se}from"./chunk-7KG3DC5J.js";import{a as Ce}from"./chunk-TWRFL73R.js";import{e as ce}from"./chunk-657SQGUO.js";import"./chunk-GIPWMAZL.js";import"./chunk-7ES2Z445.js";import{a as k}from"./chunk-D7S7RUIP.js";import"./chunk-SSQ23ZNC.js";import"./chunk-HEO6A7EN.js";import"./chunk-72AE6737.js";import"./chunk-WTUKJT4T.js";import{a as _e}from"./chunk-KMCVYMXQ.js";import{a as le}from"./chunk-LATBLSAP.js";import"./chunk-QDKVYF6D.js";import"./chunk-YHJNCAG6.js";import"./chunk-6PI5PUIQ.js";import"./chunk-6V4QU6J7.js";import"./chunk-XSXHGAXP.js";import"./chunk-W2CSYQ6H.js";import"./chunk-ODW7HQHU.js";import"./chunk-TWIWWZUD.js";import"./chunk-BKR7YPEW.js";import"./chunk-5Y6OOO6C.js";import"./chunk-ACIMXBIC.js";import"./chunk-67AXBZYF.js";import"./chunk-5QG5PZ7U.js";import"./chunk-KYK2ZFUZ.js";import{d as re}from"./chunk-ZZ7HSVKU.js";import{b as oe}from"./chunk-N54LZIRM.js";import"./chunk-DEQSZUMF.js";import{c as ne,h as ie}from"./chunk-NIRJAWTX.js";import"./chunk-RDXDKWLL.js";import{f as pe,g as ue,h as he,i as me}from"./chunk-RMWAYIJL.js";import"./chunk-EDNKI3WA.js";import"./chunk-CM45JN3C.js";import"./chunk-7BEOEYAC.js";import"./chunk-WU3SNCIC.js";import"./chunk-MOG4SYJE.js";import"./chunk-JY726AM5.js";import"./chunk-2BS4VK45.js";import"./chunk-TTMPMWUQ.js";import"./chunk-5RV2CJGS.js";import"./chunk-QGNTUEVO.js";import"./chunk-GJXDRPAS.js";import"./chunk-GBUDZCXK.js";import"./chunk-S3MYFAWN.js";import"./chunk-SPNVH2ST.js";import"./chunk-BXA5YUTN.js";import"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import{a as T}from"./chunk-ZSUWHVKX.js";import{h as K}from"./chunk-UZ7JBETM.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import"./chunk-P5OAPFNC.js";import{b as Y,c as q}from"./chunk-7R55YTL6.js";import{b as M,c as h}from"./chunk-NNVT5X6O.js";import{A as te,c as Q,h as X,m as ee}from"./chunk-JUXE7GQZ.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import{b as j,e as z}from"./chunk-45DFJJAO.js";import{d as Z}from"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{E as w,Eb as G,Ga as _,Jc as O,Kb as J,Oc as y,Qc as F,Sc as B,Tc as U,Uc as A,Y as R,bc as S,bd as V,dc as x,fc as W,gc as H,hc as $,ic as C,jc as u,kc as d,lc as b,mb as r,na as P,pc as I,qc as v,sc as f,ua as c,va as s,xc as m,zc as a}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import{a as E,b as N}from"./chunk-66YHNWRR.js";var L=o=>[o];function Pe(o,g){if(o&1){let e=f();u(0,"button",15),m("click",function(){c(e);let t=a(2);return s(t.onDetachMultipleProduct())}),b(1,"i",16),y(2),d()}if(o&2){let e,n=a(2);r(2),F("Detach (",(e=n.productService.selectedProduct(n.products()))==null?null:e.length,") ")}}function fe(o,g){if(o&1&&(I(0),S(1,Pe,3,1,"button",14),v()),o&2){let e=a();r(),x(e.productService.hasSelection(e.products())?1:-1)}}function Se(o,g){if(o&1){let e=f();u(0,"button",18),m("click",function(){c(e);let t=a(2);return s(t.onScanMultipleProduct())}),b(1,"i",19),y(2),d()}if(o&2){let e,n=a(2);r(2),F(" Scan (",(e=n.productService.selectedProduct(n.products()))==null?null:e.length,") ")}}function xe(o,g){if(o&1&&(I(0),S(1,Se,3,1,"button",17),v()),o&2){let e=a();r(),x(e.productService.hasSelection(e.products())&&e.multipeScanChannels().length>0?1:-1)}}function be(o,g){if(o&1){let e=f();u(0,"button",21),m("click",function(){c(e);let t=a(2);return s(t.onUploadMultipleProduct())}),b(1,"i",22),y(2),d()}if(o&2){let e,n=a(2);r(2),F(" Upload (",(e=n.productService.selectedProduct(n.products()))==null?null:e.length,") ")}}function we(o,g){if(o&1&&(I(0),S(1,be,3,1,"button",20),v()),o&2){let e=a();r(),x(e.productService.hasSelection(e.products())?1:-1)}}function ye(o,g){if(o&1){let e=f();u(0,"div",11)(1,"app-product-card",23),m("onUpload",function(){let t=c(e).$implicit,i=a();return s(i.onUploadToMultipleChannel(t))})("onScan",function(){let t=c(e).$implicit,i=a();return s(i.onScanSingleProduct(t))})("onDescEvent",function(){let t=c(e).$index,i=a();return s(i.onOpenDialogVariant(t))})("onCheckBoxChange",function(t){let i=c(e).$implicit;return s(i.selected=t)})("onDetach",function(){let t=c(e).$implicit,i=a();return s(i.onDetachProduct([t]))}),d()()}if(o&2){let e=g.$implicit,n=a();r(),C("productId",e.ID)("title",e==null?null:e.Name)("image",e==null?null:e.ThumbnailUrl)("description",(e==null||e.Variants==null?null:e.Variants.length)>1?(e==null||e.Variants==null?null:e.Variants.length)+" Variants":null)("channels",n.productService.getChannelProduct(e))("code",n.getVariantCode(e==null?null:e.Variants))("showCheckBox",(e==null?null:e.Channel.length)<n.channelOptions().length)("scanButton",!0)("uploadButton",e==null?null:e.hasUpload)("imageForZoom",e==null?null:e.ImageUrl)("detachButton",(e==null||e.Channel==null?null:e.Channel.length)>0)}}function Me(o,g){o&1&&(u(0,"div",12),b(1,"app-empty-state"),d())}function De(o,g){if(o&1){let e=f();u(0,"div",13)(1,"div",24)(2,"app-custom-paginator",25),m("next",function(){c(e);let t=a();return s(t.getProducts())})("previous",function(){c(e);let t=a();return s(t.getProducts())}),d()()()}if(o&2){let e,n=a();r(2),C("filter",n.searchFilter())("totaldata",(e=n.products())==null?null:e.length)("paginationTotal",n.rowCount())("hasClicked",!0)("nextButtonAlwaysVisible",!0)}}var ot=(()=>{class o{constructor(){this.http=P(z),this.toastr=P(j),this.dialog=P(ne),this.productService=P(le),this.authService=P(K),this.uploadProductService=P(ce),this.route=P(Z),this.channelOptions=_([]),this.Categories=_([]),this.searchFilter=_(new se),this.products=_([]),this.rowCount=_(0),this.startDate=_(void 0),this.endDate=_(void 0),this.multipeScanChannels=_([]),this.scanProductRole=T.ProductScan,this.uploadProductRole=T.ProductUpload,this.detachProductRole=T.ProductDetach,this.getLoaderPage(),this.channelOptions.set(this.authService.getChannels()),this.initMultiScanChannels()}getLoaderPage(){this.productService.LoadInPOS().subscribe(e=>{this.Categories.set(e.Options.Categories),this.searchFilter.update(n=>(n.PageNumber=e.Filter.PageNumber,n.RowCount=e.Filter.RowCount,n.ChannelID=null,n.Category=e.Filter.Category,n.PageSize=100,n)),this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels.set(this.productService.filterChannelByTypeId(this.channelOptions(),[M.Tokopedia,M.Tiktok]))}getProducts(){let e={PageNumber:this.searchFilter().PageNumber,RowCount:this.searchFilter().RowCount,text:this.searchFilter().text,Category:this.searchFilter().Category,From:this.startDate(),To:this.endDate()};this.http.post("/api/product/GetInPOS",e).subscribe(n=>{this.products.set(n.Data),this.rowCount.set(n.Total==null?this.searchFilter().RowCount:n.Total.toString()),this.products.set(this.productService.checkProductHasUploadBtn(this.products(),this.channelOptions()))})}onOpenScanDialog(){let e=JSON.parse(JSON.stringify(this.searchFilter()));e.ChannelID=h.GuidEMpty,this.dialog.open(k,{data:{filter:e,channelOptions:this.channelOptions()},width:"600px"}).afterClosed().pipe(w(t=>h.IsNotEmpty(t))).subscribe(t=>{this.searchFilter.update(i=>(i.ChannelID=t.ChannelID,i.ScanFull=t.ScanFull,i.UpdatedProduct=t.UpdatedProduct,i.Async=t.Async,i)),this.scanAllProduct()})}scanAllProduct(){if(this.searchFilter().ChannelID==null){this.toastr.error("Please Select Channel","Error");return}this.productService.scanAll(this.searchFilter().ChannelID,this.searchFilter().ScanFull,this.searchFilter().UpdatedProduct,this.searchFilter().Async).subscribe(e=>{if(this.searchFilter().Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{this.getLoaderPage();let n=this.productService.findChannelById(this.searchFilter().ChannelID,this.channelOptions());this.productService.successToastrScanAllProduct(e,n,!this.searchFilter().UpdatedProduct)}})}onOpenDialogVariant(e){let n=this.products()[e];this.productService.getSoldInChannelDetail(n.ID,this.searchFilter().ListChannelID).pipe(R(t=>this.dialog.open(ae,{data:{variants:t,title:n.Name}}).afterClosed())).subscribe()}onUploadMultipleProduct(){let e=this.productService.selectedProduct(this.products());this.uploadProductService.setSelectedProduct(e),this.route.navigate(["/menu/products/upload"])}onUploadToMultipleChannel(e){this.uploadProductService.setSelectedProduct([e]),this.route.navigate(["/menu/products/upload"])}searchProduct(e){this.searchFilter.update(n=>(n.text=e,n)),this.getProducts()}onScanMultipleProduct(){let e=JSON.parse(JSON.stringify(this.searchFilter()));e.ChannelID=h.GuidEMpty;let n=this.productService.filterChannelByTypeId(this.channelOptions(),[M.Tokopedia,M.Tiktok]);this.dialog.open(k,{data:{filter:e,channelOptions:n,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(w(i=>h.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.update(D=>(D.ChannelID=i.ChannelID,D.ScanFull=i.ScanFull,D.UpdatedProduct=i.UpdatedProduct,D));let p=this.productService.selectedProduct(this.products()),l=this.productService.getVariantCodesProducts(p);this.scanSingleProduct(l)})}onScanSingleProduct(e){let n=JSON.parse(JSON.stringify(this.searchFilter()));n.ChannelID=h.GuidEMpty,this.dialog.open(k,{data:{filter:n,channelOptions:this.channelOptions(),isSingleChannel:!0},width:"600px"}).afterClosed().pipe(w(t=>h.IsNotEmpty(t))).subscribe(t=>{this.searchFilter.update(p=>(p.ChannelID=t.ChannelID,p));let i=this.productService.getVariantCodesProduct(e);this.scanSingleProduct(i)})}scanSingleProduct(e){this.productService.scanSingle(this.searchFilter().ChannelID,e).subscribe({next:n=>{if(n)this.toastr.success("Successfully Scan ","Success");else{let t=this.productService.findChannelById(this.searchFilter().ChannelID,this.channelOptions());this.toastr.error(`This product is not existed in ${t?.Name} `,"Error")}this.searchFilter.update(t=>(t.ChannelID=h.GuidEMpty,t)),n&&this.getProducts()},error:n=>{this.searchFilter.update(t=>(t.ChannelID=h.GuidEMpty,t))}})}getVariantCode(e=[]){let n;return e?.length>1&&(n=(e[0].model?e[0].model:"")+e[0].Code),e?.length==1&&(n=e[0].Code),n}onDetachProduct(e){let n=[];e.forEach(t=>{t.Channel=h.assignChannelLogo(t.Channel),n.push(...t.Channel)}),this.dialog.open(de,{width:"600px",data:[...n]}).afterClosed().pipe(w(t=>h.IsNotEmpty(t)),R(t=>{let i=t.map(p=>N(E({},p),{POSProductID:e[0]?.ID}));return this.productService.detachProduct(i)})).subscribe(t=>{this.toastr.success(t.Message,ie.Success),this.getProducts()})}onDetachMultipleProduct(){let e=this.productService.selectedProduct(this.products());this.onDetachProduct(e)}updateFilter(e,n){this.searchFilter.update(t=>N(E({},t),{[e]:n}))}static{this.\u0275fac=function(n){return new(n||o)}}static{this.\u0275cmp=G({type:o,selectors:[["app-in-pos"]],decls:23,vars:18,consts:[["picker",""],["description","All products which is already available in POS",3,"onSubmit","headerTitle"],[4,"ngxPermissionsOnly"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","Name","bindValue","Name","placeholder","Select Category",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[1,"mt-5"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"container-fluid"],[1,"row","mt-8"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"fa-sharp","fa-link-slash","me-2"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-light","shadow","rounded","ms-2"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[3,"onUpload","onScan","onDescEvent","onCheckBoxChange","onDetach","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","detachButton"],[1,"col-md-12"],[3,"next","previous","filter","totaldata","paginationTotal","hasClicked","nextButtonAlwaysVisible"]],template:function(n,t){if(n&1){let i=f();u(0,"mainpanel",1),m("onSubmit",function(l){return c(i),s(t.searchProduct(l))}),u(1,"actions"),J(2,fe,2,1,"ng-container",2)(3,xe,2,1,"ng-container",2)(4,we,2,1,"ng-container",2),d(),u(5,"filters")(6,"div")(7,"label",3),y(8,"Category"),d(),u(9,"ng-select",4),m("ngModelChange",function(l){return c(i),s(t.updateFilter("Category",l))}),d()(),u(10,"div",5)(11,"mat-date-range-input",6)(12,"input",7),A("ngModelChange",function(l){return c(i),U(t.startDate,l)||(t.startDate=l),s(l)}),m("click",function(){c(i);let l=O(15);return s(l.open())}),d(),u(13,"input",8),A("ngModelChange",function(l){return c(i),U(t.endDate,l)||(t.endDate=l),s(l)}),m("click",function(){c(i);let l=O(15);return s(l.open())}),d()(),b(14,"mat-date-range-picker",null,0),d()(),u(16,"content")(17,"div",9)(18,"div",10),H(19,ye,2,11,"div",11,W),S(21,Me,2,0,"div",12),d(),S(22,De,3,5,"div",13),d()()()}if(n&2){let i,p=O(15);C("headerTitle","In POS ("+t.rowCount()+")"),r(2),C("ngxPermissionsOnly",V(12,L,t.detachProductRole)),r(),C("ngxPermissionsOnly",V(14,L,t.scanProductRole)),r(),C("ngxPermissionsOnly",V(16,L,t.scanProductRole)),r(5),C("clearable",!0)("items",t.Categories())("ngModel",t.searchFilter().Category),r(2),C("rangePicker",p),r(),B("ngModel",t.startDate),r(),B("ngModel",t.endDate),r(6),$(t.products()),r(2),x(t.products().length==0?21:-1),r(),x(((i=t.products())==null?null:i.length)>0?22:-1)}},dependencies:[oe,te,Q,X,ee,q,Y,re,pe,ue,he,me,ge,_e,Ce],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media(min-width:1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.img-logo[_ngcontent-%COMP%]{height:24px;width:24px}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}"],changeDetection:0})}}return o})();export{ot as InPosComponent};
@@ -1 +1 @@
1
- import{a as Nt}from"./chunk-XI37PNRD.js";import"./chunk-GAECPRA5.js";import{c as yt,d as vt}from"./chunk-SEX4VJEZ.js";import"./chunk-M3XAI5VN.js";import{e as bt}from"./chunk-TBQAAZKJ.js";import"./chunk-GIPWMAZL.js";import{a as St}from"./chunk-7ES2Z445.js";import{a as xt}from"./chunk-D7S7RUIP.js";import"./chunk-SSQ23ZNC.js";import"./chunk-HEO6A7EN.js";import"./chunk-72AE6737.js";import"./chunk-WTUKJT4T.js";import{a as Pt}from"./chunk-KMCVYMXQ.js";import{a as ft}from"./chunk-RG24XPVA.js";import"./chunk-QDKVYF6D.js";import"./chunk-YHJNCAG6.js";import"./chunk-6PI5PUIQ.js";import"./chunk-6V4QU6J7.js";import"./chunk-XSXHGAXP.js";import"./chunk-W2CSYQ6H.js";import"./chunk-ODW7HQHU.js";import"./chunk-TWIWWZUD.js";import"./chunk-BKR7YPEW.js";import"./chunk-DAGGBVVW.js";import"./chunk-ACIMXBIC.js";import"./chunk-67AXBZYF.js";import"./chunk-5QG5PZ7U.js";import"./chunk-KYK2ZFUZ.js";import"./chunk-ZZ7HSVKU.js";import{b as gt}from"./chunk-N54LZIRM.js";import"./chunk-DEQSZUMF.js";import{c as Ct}from"./chunk-NIRJAWTX.js";import"./chunk-RDXDKWLL.js";import"./chunk-CM45JN3C.js";import"./chunk-7BEOEYAC.js";import"./chunk-WU3SNCIC.js";import"./chunk-MOG4SYJE.js";import"./chunk-JY726AM5.js";import"./chunk-2BS4VK45.js";import"./chunk-TTMPMWUQ.js";import"./chunk-5RV2CJGS.js";import"./chunk-QGNTUEVO.js";import"./chunk-GJXDRPAS.js";import"./chunk-GBUDZCXK.js";import"./chunk-S3MYFAWN.js";import"./chunk-SPNVH2ST.js";import"./chunk-BXA5YUTN.js";import{b as ht}from"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import{a as z}from"./chunk-ZSUWHVKX.js";import{h as dt}from"./chunk-ZVCNMOKL.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import{a as G}from"./chunk-P5OAPFNC.js";import{b as ct,c as st}from"./chunk-7R55YTL6.js";import{c as N}from"./chunk-NNVT5X6O.js";import{A as ut,b as pt,h as _t,m as mt}from"./chunk-JUXE7GQZ.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import{b as rt,e as U}from"./chunk-45DFJJAO.js";import{d as lt}from"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import{D as at,z as ot}from"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{E as V,Eb as et,Ga as P,I as q,Kb as A,Oc as d,Pc as it,Qc as y,Sc as $,T as J,Tc as L,Uc as W,V as Z,_ as Q,aa as k,ba as Y,bc as _,bd as R,cc as nt,d as K,dc as m,e as j,fc as I,gc as F,hc as T,ia as X,ic as p,jc as o,kb as v,kc as l,kd as b,lc as g,ld as S,ma as tt,mb as r,na as C,pc as D,qc as B,sc as f,t as w,ua as u,va as h,xc as x,zc as s}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import{a as M,b as E}from"./chunk-66YHNWRR.js";var wt=(()=>{class e{get footerPageNumber(){return this._footerPageNumber}set footerPageNumber(t){this._footerPageNumber=t}get hideCount(){return this._hideCount}set hideCount(t){this._hideCount=t}get disableNextButton(){return this._disableNextButton}set disableNextButton(t){this._disableNextButton=t}get goToLastPage(){return this._goToLastPage}set goToLastPage(t){this._goToLastPage=t}constructor(t){this.http=t,this.pagination$=new j(null),this.destroy$=new K,this.data$=this.paginationFunction()}onNextPage(t){t.PageNumber+=1,this.pagination$.next(t)}setPageNumberFooter(t){this.footerPageNumber=t.PageNumber}setPaginationButtonState(t,i){i==0?this.disableNextButton=!0:this.disableNextButton=!(i<t.RowCount*t.PageNumber)}reloadPagination(t){N.IsEmpty(t.PageNumber)&&(t.PageNumber=1),this.pagination$.next(t),this.hideCount=!0,this.goToLastPage=!1}getAllData(t,i){t.RowCount=i,this.pagination$.next(t),this.goToLastPage=!0}destroy(){this.destroy$.next(!0),this.destroy$.complete(),this.pagination$=null,this.pagination$=new j(null),this.data$=this.paginationFunction()}paginationFunction(){return this.pagination$.pipe(Q(this.destroy$),V(t=>t!=null),q(t=>this.http.post(`/API/${this.fetchDataEndpoint}`,JSON.stringify(t)).pipe(w(i=>i.Data))),Y(this.pagination$),J((t,i)=>{let[n,a]=t,[O]=i;return a.PageNumber==1?[O,a]:[n.concat(O),a]}),k(([t,i])=>{this.setPageNumberFooter(i),this.setPaginationButtonState(i,t.length)}),w(([t])=>t),Z())}static{this.\u0275fac=function(i){return new(i||e)(tt(U))}}static{this.\u0275prov=X({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var H=e=>[e];function Ft(e,c){if(e&1){let t=f();o(0,"button",11),x("click",function(){u(t);let n=s(3);return h(n.uploadMultipleProduct())}),g(1,"i",12),d(2),l()}if(e&2){let t,i=s(3);r(2),y(" upload (",(t=i.selectedProducts())==null?null:t.length,") ")}}function Tt(e,c){if(e&1&&(D(0),_(1,Ft,3,1,"button",10),B()),e&2){let t=s(2);r(),m(t.hasSelectionProduct()?1:-1)}}function Ot(e,c){e&1&&(D(0),g(1,"th",19),B())}function Mt(e,c){if(e&1){let t=f();o(0,"td",25)(1,"input",26),W("ngModelChange",function(n){u(t);let a=s(3).$implicit;return L(a.selected,n)||(a.selected=n),h(n)}),x("ngModelChange",function(){u(t);let n=s(4),a=s(3);return h(a.onSelectProduct(n))}),l()()}if(e&2){let t=s(3).$implicit;p("rowSpan",t==null?null:t.Variants.length),r(),$("ngModel",t.selected)}}function Et(e,c){if(e&1&&(D(0),_(1,Mt,2,2,"td",25),B()),e&2){let t=s().$index;r(),m(t==0?1:-1)}}function Vt(e,c){if(e&1){let t=f();o(0,"img",33),x("click",function(n){u(t);let a=s(3).$implicit,O=s(4);return h(O.onZoomImage(n,a==null?null:a.ImageUrl))}),l()}if(e&2){let t=s(3).$implicit;p("src",t==null?null:t.ImageUrl,v)}}function kt(e,c){e&1&&g(0,"img",29)}function At(e,c){if(e&1&&(o(0,"td",25)(1,"div",27),_(2,Vt,1,1,"img",28)(3,kt,1,0,"img",29),l()(),o(4,"td",30)(5,"h4",31)(6,"span",32),d(7),l()()()),e&2){let t=s(2).$implicit;p("rowSpan",t==null?null:t.Variants.length),r(2),m(t!=null&&t.ImageUrl?2:3),r(2),p("rowSpan",t==null?null:t.Variants.length),r(2),p("matTooltip",(t==null||t.Name==null?null:t.Name.length)>50?t==null?null:t.Name:""),r(),y(" ",t==null?null:t.Name," ")}}function Dt(e,c){if(e&1&&(o(0,"div")(1,"a",21),g(2,"img",34),l()()),e&2){let t=c.$implicit;r(),p("href",t.URL,v),r(),p("src",t.Img,v)("matTooltip",t.Name)}}function Bt(e,c){if(e&1&&(o(0,"div"),g(1,"img",34),l()),e&2){let t=c.$implicit;r(),p("src",t.Img,v)("matTooltip",t.Name)}}function $t(e,c){if(e&1&&(o(0,"tr"),A(1,Et,2,1,"ng-container",2),_(2,At,8,5),o(3,"td"),d(4),l(),o(5,"td")(6,"span"),d(7),l(),o(8,"span",20)(9,"a",21),g(10,"i",22),l()()(),o(11,"td",23)(12,"div",24),F(13,Dt,3,3,"div",null,I),l()(),o(15,"td",23)(16,"div",24),F(17,Bt,2,2,"div",null,I),l()()()),e&2){let t=c.$implicit,i=c.$index,n=s(5);r(),p("ngxPermissionsOnly",R(5,H,n.uploadProductRole)),r(),m(i==0?2:-1),r(2),y(" ",t.Name," "),r(3),y(" ",t.Code," "),r(2),p("href",n.hostName()+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),v),r(4),T(t==null?null:t.Available),r(4),T(t==null?null:t.NotAvailable)}}function Lt(e,c){if(e&1&&F(0,$t,19,7,"tr",null,I),e&2){let t=c.$implicit;T(t.Variants)}}function Rt(e,c){e&1&&(o(0,"tbody"),F(1,Lt,2,0,null,null,I),l()),e&2&&(r(),T(c))}function Ut(e,c){if(e&1&&(o(0,"div",8)(1,"table",13)(2,"thead",14)(3,"tr"),A(4,Ot,2,0,"ng-container",2),o(5,"th",15),d(6," Product "),l(),o(7,"th",16),d(8,"Variant"),l(),o(9,"th",16),d(10,"SKU"),l(),o(11,"th",17),d(12,"Available In"),l(),o(13,"th",18),d(14,"Not Available In"),l()()(),_(15,Rt,3,0,"tbody"),b(16,"async"),l()()),e&2){let t,i=s(2);r(4),p("ngxPermissionsOnly",R(4,H,i.uploadProductRole)),r(11),m((t=S(16,2,i.data$))?15:-1,t)}}function jt(e,c){e&1&&(o(0,"div",9),g(1,"app-empty-state"),l())}function Wt(e,c){if(e&1){let t=f();o(0,"span",42),x("click",function(){u(t);let n=s(4);return h(n.getRowCount())}),o(1,"i",43),d(2,"?"),l()()}}function Gt(e,c){if(e&1&&(o(0,"span"),d(1),b(2,"number"),l()),e&2){let t=c;r(),it(S(2,1,t==null?null:t.Count))}}function zt(e,c){if(e&1){let t=f();o(0,"a",44),x("click",function(){u(t);let n=s(4);return h(n.onNextPage())}),g(1,"i",45),d(2," Next"),l()}}function Ht(e,c){if(e&1){let t=f();o(0,"a",46),x("click",function(){u(t);let n=s(4);return h(n.onLastPage())}),g(1,"i",47),d(2," Last"),l()}}function Kt(e,c){if(e&1&&(o(0,"div",35)(1,"div",36)(2,"div",37),d(3),b(4,"number"),_(5,Wt,3,0,"span",38),_(6,Gt,3,3,"span"),b(7,"async"),d(8),l()(),o(9,"div",39),_(10,zt,3,0,"a",40),_(11,Ht,3,0,"a",41),l()()),e&2){let t,i=s(),n=s(2);r(3),y(" Showing 1 - ",S(4,6,i==null?null:i.length)," of "),r(2),m(n.paginationService.hideCount?5:-1),r(),m((t=!n.paginationService.hideCount&&S(7,8,n.rowCount$))?6:-1,t),r(2),y(" records ~ ",n.paginationService.footerPageNumber," Page "),r(2),m(n.paginationService.disableNextButton&&!n.paginationService.goToLastPage?10:-1),r(),m(n.paginationService.disableNextButton&&!n.paginationService.goToLastPage?11:-1)}}function qt(e,c){if(e&1&&_(0,Kt,12,10,"div",35),e&2){let t=c;m((t==null?null:t.length)>0?0:-1)}}function Jt(e,c){if(e&1){let t=f();o(0,"mainpanel",1),x("onSubmit",function(n){u(t);let a=s();return h(a.searchProduct(n))}),o(1,"actions"),A(2,Tt,2,1,"ng-container",2),o(3,"button",3),x("click",function(){u(t);let n=s();return h(n.openExportDialog())}),g(4,"i",4),o(5,"span"),d(6,"Export"),l()()(),o(7,"filters")(8,"filter-query-type",5),W("numberFilterComparatorChange",function(n){u(t);let a=s();return L(a.searchFilter().NumberFilterComparator,n)||(a.searchFilter().NumberFilterComparator=n),h(n)})("searchTypeChange",function(n){u(t);let a=s();return L(a.searchFilter().SearchType,n)||(a.searchFilter().SearchType=n),h(n)}),l()(),o(9,"content")(10,"div",6)(11,"div",7),_(12,Ut,17,6,"div",8),b(13,"async"),nt(14,jt,2,0,"div",9),l(),_(15,qt,1,1),b(16,"async"),l()()()}if(e&2){let t,i,n=c,a=s();p("searchBoxPlaceHolder",a.searchPlaceholder()),r(2),p("ngxPermissionsOnly",R(12,H,a.uploadProductRole)),r(6),p("numberFilterComparatorOptions",n==null||n.Options==null?null:n.Options.SearchComparatorTypeOptions),$("numberFilterComparator",a.searchFilter().NumberFilterComparator),p("searchTypeOptions",n==null||n.Options==null?null:n.Options.SearchSKUOnlyOrSKUNameOptions),$("searchType",a.searchFilter().SearchType),r(4),m(((t=S(13,8,a.data$))==null?null:t.length)>0?12:14),r(3),m((i=S(16,10,a.data$))?15:-1,i)}}var Te=(()=>{class e{constructor(){this.http=C(U),this.dialog=C(Ct),this.toastr=C(rt),this.route=C(lt),this.productService=C(ft),this.paginationService=C(wt),this.biggerPictureService=C(St),this.authService=C(dt),this.uploadProductService=C(bt),this.placeholderService=C(yt),this.loaderAPI="product/Load",this.notChannelAPI="product/GetNotInChannelV2",this.searchFilter=P({}),this.hostName=P(""),this.hasSelectionProduct=P(!1),this.selectedProducts=P([]),this.channelOptions=P([]),this.scanProductRole=z.ProductScan,this.uploadProductRole=z.ProductUpload,this.searchPlaceholder=P("Search ...");let t=this.authService;this.channelOptions.set(t.getChannels()),this.hostName.set(this.authService.getDomain())}ngOnInit(){this.initPageLoader(),this.iniData()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.notChannelAPI,this.loader$=this.http.post(`api/${this.loaderAPI}`,{}).pipe(k(t=>{this.searchFilter.set(t.Filter),this.paginationService.reloadPagination(t.Filter),this.initSearchPlaceholder()}))}initSearchPlaceholder(){let t=this.searchFilter();this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(t.SearchType,t.NumberFilterComparator))}iniData(){this.data$=this.paginationService.data$.pipe(w(t=>(t=t.map(i=>(i.Variants=i.Variants.map(n=>(n.Available=this.productService.sortChannel(n.Available),n.NotAvailable=this.productService.sortChannel(n.NotAvailable),n.Available=this.assignLogoChannel(n.Available),n.NotAvailable=this.assignLogoChannel(n.NotAvailable),n)),i.Channel=i?.Variants[0]?.Available,i)),t)))}assignLogoChannel(t){return t=t.map(i=>(i.Img=N.getChannelLogoByTypeId(i.TypeID),i)),t}searchProduct(t){this.searchFilter.update(i=>E(M({},i),{text:t})),this.paginationService.reloadPagination(this.searchFilter()),this.initSearchPlaceholder()}scanAllProduct(){let t=this.searchFilter(),i=this.productService.findChannelById(t.ChannelID,this.channelOptions());this.productService.scanAll(t.ChannelID,t.ScanFull,t.UpdatedProduct,t.Async).subscribe(n=>{t.Async?this.toastr.success("You will be notified when the scan is completed.","Scan Asynchronous"):(this.productService.successToastrScanAllProduct(n,i,!t.UpdatedProduct),this.initPageLoader())})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter()));t.ChannelID=N.GuidEMpty,this.dialog.open(xt,{data:{filter:t,channelOptions:this.channelOptions()},width:"600px"}).afterClosed().pipe(V(n=>N.IsNotEmpty(n))).subscribe(n=>{this.searchFilter.update(a=>E(M({},a),{ChannelID:n.ChannelID,ScanFull:n.ScanFull,UpdatedProduct:n.UpdatedProduct,Async:n.Async})),this.scanAllProduct()})}getRowCount(){this.paginationService.hideCount=!1;let t=this.searchFilter(),i={text:t.text,NumberFilterComparator:t.NumberFilterComparator,SearchType:t.SearchType};this.rowCount$=this.http.post(G.GetNotInChannelRowCount,i)}onNextPage(){this.paginationService.onNextPage(this.searchFilter())}onLastPage(){let t=this.searchFilter(),i={text:t.text,NumberFilterComparator:t.NumberFilterComparator,SearchType:t.SearchType};this.http.post(G.GetNotInChannelRowCount,i).subscribe({next:n=>{this.searchFilter.update(a=>E(M({},a),{PageNumber:1})),this.paginationService.getAllData(this.searchFilter(),n.Count)}})}onZoomImage(t,i){this.biggerPictureService.openBiggerPicture(t,i)}onSelectProduct(t){this.hasSelectionProduct.set(this.productService.hasSelection(t)),this.selectedProducts.set(this.productService.selectedProduct(t))}uploadMultipleProduct(){this.uploadProductService.setSelectedProduct(this.selectedProducts()),this.route.navigate(["/menu/products/upload"])}ngOnDestroy(){this.paginationService.destroy()}openExportDialog(){let t=this.searchFilter();this.dialog.open(Nt,{data:{title:"Export Not In Channel",pageNumber:t.PageNumber,rowCount:t.RowCount,filterExport:t,getRowCountApi:"product/GetNotInChannelRowCount",exportApi:"product/GetNotInChannelExport"}}).afterClosed().subscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=et({type:e,selectors:[["app-not-in-channel"]],decls:2,vars:3,consts:[["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"searchBoxPlaceHolder"],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"onSubmit","searchBoxPlaceHolder"],[4,"ngxPermissionsOnly"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[3,"numberFilterComparatorChange","searchTypeChange","numberFilterComparatorOptions","numberFilterComparator","searchTypeOptions","searchType"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"btn","btn-light","shadow","rounded","ms-2"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"ms-5","text-center",2,"width","450px"],[2,"width","150px"],[2,"width","20%"],[2,"width","16%"],[2,"width","10px"],[1,"ms-1"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"padding-left","0px"],[1,"d-flex","flex-wrap","mb-1"],[1,"text-center",3,"rowSpan"],["type","checkbox",3,"ngModelChange","ngModel"],[2,"padding-right","0px"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],[1,"text-start",3,"rowSpan"],[1,"ms-5","fw-normal","text-ellipsis",2,"max-width","26vw !important"],[3,"matTooltip"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"click","src"],["alt","",1,"channel-logo","cursor-pointer","ms-4","mt-3",3,"src","matTooltip"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],[2,"cursor","pointer"],[1,"btn-group"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(i,n){if(i&1&&(_(0,Jt,17,14,"mainpanel",0),b(1,"async")),i&2){let a;m((a=S(1,1,n.loader$))?0:-1,a)}},dependencies:[gt,st,ct,vt,ut,pt,_t,mt,ht,Pt,ot,at],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media(min-width:1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}thead[_ngcontent-%COMP%]{position:sticky;top:0}.channel-logo[_ngcontent-%COMP%]{width:20px}.w-img[_ngcontent-%COMP%]{width:100%}"],changeDetection:0})}}return e})();export{Te as NotInChannelComponent};
1
+ import{a as Nt}from"./chunk-XI37PNRD.js";import"./chunk-GAECPRA5.js";import{c as yt,d as vt}from"./chunk-SEX4VJEZ.js";import"./chunk-M3XAI5VN.js";import{e as bt}from"./chunk-657SQGUO.js";import"./chunk-GIPWMAZL.js";import{a as St}from"./chunk-7ES2Z445.js";import{a as xt}from"./chunk-D7S7RUIP.js";import"./chunk-SSQ23ZNC.js";import"./chunk-HEO6A7EN.js";import"./chunk-72AE6737.js";import"./chunk-WTUKJT4T.js";import{a as Pt}from"./chunk-KMCVYMXQ.js";import{a as ft}from"./chunk-LATBLSAP.js";import"./chunk-QDKVYF6D.js";import"./chunk-YHJNCAG6.js";import"./chunk-6PI5PUIQ.js";import"./chunk-6V4QU6J7.js";import"./chunk-XSXHGAXP.js";import"./chunk-W2CSYQ6H.js";import"./chunk-ODW7HQHU.js";import"./chunk-TWIWWZUD.js";import"./chunk-BKR7YPEW.js";import"./chunk-5Y6OOO6C.js";import"./chunk-ACIMXBIC.js";import"./chunk-67AXBZYF.js";import"./chunk-5QG5PZ7U.js";import"./chunk-KYK2ZFUZ.js";import"./chunk-ZZ7HSVKU.js";import{b as gt}from"./chunk-N54LZIRM.js";import"./chunk-DEQSZUMF.js";import{c as Ct}from"./chunk-NIRJAWTX.js";import"./chunk-RDXDKWLL.js";import"./chunk-CM45JN3C.js";import"./chunk-7BEOEYAC.js";import"./chunk-WU3SNCIC.js";import"./chunk-MOG4SYJE.js";import"./chunk-JY726AM5.js";import"./chunk-2BS4VK45.js";import"./chunk-TTMPMWUQ.js";import"./chunk-5RV2CJGS.js";import"./chunk-QGNTUEVO.js";import"./chunk-GJXDRPAS.js";import"./chunk-GBUDZCXK.js";import"./chunk-S3MYFAWN.js";import"./chunk-SPNVH2ST.js";import"./chunk-BXA5YUTN.js";import{b as ht}from"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import{a as z}from"./chunk-ZSUWHVKX.js";import{h as dt}from"./chunk-UZ7JBETM.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import{a as G}from"./chunk-P5OAPFNC.js";import{b as ct,c as st}from"./chunk-7R55YTL6.js";import{c as N}from"./chunk-NNVT5X6O.js";import{A as ut,b as pt,h as _t,m as mt}from"./chunk-JUXE7GQZ.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import{b as rt,e as U}from"./chunk-45DFJJAO.js";import{d as lt}from"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import{D as at,z as ot}from"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{E as V,Eb as et,Ga as P,I as q,Kb as A,Oc as d,Pc as it,Qc as y,Sc as $,T as J,Tc as L,Uc as W,V as Z,_ as Q,aa as k,ba as Y,bc as _,bd as R,cc as nt,d as K,dc as m,e as j,fc as I,gc as F,hc as T,ia as X,ic as p,jc as o,kb as v,kc as l,kd as b,lc as g,ld as S,ma as tt,mb as r,na as C,pc as D,qc as B,sc as f,t as w,ua as u,va as h,xc as x,zc as s}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import{a as M,b as E}from"./chunk-66YHNWRR.js";var wt=(()=>{class e{get footerPageNumber(){return this._footerPageNumber}set footerPageNumber(t){this._footerPageNumber=t}get hideCount(){return this._hideCount}set hideCount(t){this._hideCount=t}get disableNextButton(){return this._disableNextButton}set disableNextButton(t){this._disableNextButton=t}get goToLastPage(){return this._goToLastPage}set goToLastPage(t){this._goToLastPage=t}constructor(t){this.http=t,this.pagination$=new j(null),this.destroy$=new K,this.data$=this.paginationFunction()}onNextPage(t){t.PageNumber+=1,this.pagination$.next(t)}setPageNumberFooter(t){this.footerPageNumber=t.PageNumber}setPaginationButtonState(t,i){i==0?this.disableNextButton=!0:this.disableNextButton=!(i<t.RowCount*t.PageNumber)}reloadPagination(t){N.IsEmpty(t.PageNumber)&&(t.PageNumber=1),this.pagination$.next(t),this.hideCount=!0,this.goToLastPage=!1}getAllData(t,i){t.RowCount=i,this.pagination$.next(t),this.goToLastPage=!0}destroy(){this.destroy$.next(!0),this.destroy$.complete(),this.pagination$=null,this.pagination$=new j(null),this.data$=this.paginationFunction()}paginationFunction(){return this.pagination$.pipe(Q(this.destroy$),V(t=>t!=null),q(t=>this.http.post(`/API/${this.fetchDataEndpoint}`,JSON.stringify(t)).pipe(w(i=>i.Data))),Y(this.pagination$),J((t,i)=>{let[n,a]=t,[O]=i;return a.PageNumber==1?[O,a]:[n.concat(O),a]}),k(([t,i])=>{this.setPageNumberFooter(i),this.setPaginationButtonState(i,t.length)}),w(([t])=>t),Z())}static{this.\u0275fac=function(i){return new(i||e)(tt(U))}}static{this.\u0275prov=X({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var H=e=>[e];function Ft(e,c){if(e&1){let t=f();o(0,"button",11),x("click",function(){u(t);let n=s(3);return h(n.uploadMultipleProduct())}),g(1,"i",12),d(2),l()}if(e&2){let t,i=s(3);r(2),y(" upload (",(t=i.selectedProducts())==null?null:t.length,") ")}}function Tt(e,c){if(e&1&&(D(0),_(1,Ft,3,1,"button",10),B()),e&2){let t=s(2);r(),m(t.hasSelectionProduct()?1:-1)}}function Ot(e,c){e&1&&(D(0),g(1,"th",19),B())}function Mt(e,c){if(e&1){let t=f();o(0,"td",25)(1,"input",26),W("ngModelChange",function(n){u(t);let a=s(3).$implicit;return L(a.selected,n)||(a.selected=n),h(n)}),x("ngModelChange",function(){u(t);let n=s(4),a=s(3);return h(a.onSelectProduct(n))}),l()()}if(e&2){let t=s(3).$implicit;p("rowSpan",t==null?null:t.Variants.length),r(),$("ngModel",t.selected)}}function Et(e,c){if(e&1&&(D(0),_(1,Mt,2,2,"td",25),B()),e&2){let t=s().$index;r(),m(t==0?1:-1)}}function Vt(e,c){if(e&1){let t=f();o(0,"img",33),x("click",function(n){u(t);let a=s(3).$implicit,O=s(4);return h(O.onZoomImage(n,a==null?null:a.ImageUrl))}),l()}if(e&2){let t=s(3).$implicit;p("src",t==null?null:t.ImageUrl,v)}}function kt(e,c){e&1&&g(0,"img",29)}function At(e,c){if(e&1&&(o(0,"td",25)(1,"div",27),_(2,Vt,1,1,"img",28)(3,kt,1,0,"img",29),l()(),o(4,"td",30)(5,"h4",31)(6,"span",32),d(7),l()()()),e&2){let t=s(2).$implicit;p("rowSpan",t==null?null:t.Variants.length),r(2),m(t!=null&&t.ImageUrl?2:3),r(2),p("rowSpan",t==null?null:t.Variants.length),r(2),p("matTooltip",(t==null||t.Name==null?null:t.Name.length)>50?t==null?null:t.Name:""),r(),y(" ",t==null?null:t.Name," ")}}function Dt(e,c){if(e&1&&(o(0,"div")(1,"a",21),g(2,"img",34),l()()),e&2){let t=c.$implicit;r(),p("href",t.URL,v),r(),p("src",t.Img,v)("matTooltip",t.Name)}}function Bt(e,c){if(e&1&&(o(0,"div"),g(1,"img",34),l()),e&2){let t=c.$implicit;r(),p("src",t.Img,v)("matTooltip",t.Name)}}function $t(e,c){if(e&1&&(o(0,"tr"),A(1,Et,2,1,"ng-container",2),_(2,At,8,5),o(3,"td"),d(4),l(),o(5,"td")(6,"span"),d(7),l(),o(8,"span",20)(9,"a",21),g(10,"i",22),l()()(),o(11,"td",23)(12,"div",24),F(13,Dt,3,3,"div",null,I),l()(),o(15,"td",23)(16,"div",24),F(17,Bt,2,2,"div",null,I),l()()()),e&2){let t=c.$implicit,i=c.$index,n=s(5);r(),p("ngxPermissionsOnly",R(5,H,n.uploadProductRole)),r(),m(i==0?2:-1),r(2),y(" ",t.Name," "),r(3),y(" ",t.Code," "),r(2),p("href",n.hostName()+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),v),r(4),T(t==null?null:t.Available),r(4),T(t==null?null:t.NotAvailable)}}function Lt(e,c){if(e&1&&F(0,$t,19,7,"tr",null,I),e&2){let t=c.$implicit;T(t.Variants)}}function Rt(e,c){e&1&&(o(0,"tbody"),F(1,Lt,2,0,null,null,I),l()),e&2&&(r(),T(c))}function Ut(e,c){if(e&1&&(o(0,"div",8)(1,"table",13)(2,"thead",14)(3,"tr"),A(4,Ot,2,0,"ng-container",2),o(5,"th",15),d(6," Product "),l(),o(7,"th",16),d(8,"Variant"),l(),o(9,"th",16),d(10,"SKU"),l(),o(11,"th",17),d(12,"Available In"),l(),o(13,"th",18),d(14,"Not Available In"),l()()(),_(15,Rt,3,0,"tbody"),b(16,"async"),l()()),e&2){let t,i=s(2);r(4),p("ngxPermissionsOnly",R(4,H,i.uploadProductRole)),r(11),m((t=S(16,2,i.data$))?15:-1,t)}}function jt(e,c){e&1&&(o(0,"div",9),g(1,"app-empty-state"),l())}function Wt(e,c){if(e&1){let t=f();o(0,"span",42),x("click",function(){u(t);let n=s(4);return h(n.getRowCount())}),o(1,"i",43),d(2,"?"),l()()}}function Gt(e,c){if(e&1&&(o(0,"span"),d(1),b(2,"number"),l()),e&2){let t=c;r(),it(S(2,1,t==null?null:t.Count))}}function zt(e,c){if(e&1){let t=f();o(0,"a",44),x("click",function(){u(t);let n=s(4);return h(n.onNextPage())}),g(1,"i",45),d(2," Next"),l()}}function Ht(e,c){if(e&1){let t=f();o(0,"a",46),x("click",function(){u(t);let n=s(4);return h(n.onLastPage())}),g(1,"i",47),d(2," Last"),l()}}function Kt(e,c){if(e&1&&(o(0,"div",35)(1,"div",36)(2,"div",37),d(3),b(4,"number"),_(5,Wt,3,0,"span",38),_(6,Gt,3,3,"span"),b(7,"async"),d(8),l()(),o(9,"div",39),_(10,zt,3,0,"a",40),_(11,Ht,3,0,"a",41),l()()),e&2){let t,i=s(),n=s(2);r(3),y(" Showing 1 - ",S(4,6,i==null?null:i.length)," of "),r(2),m(n.paginationService.hideCount?5:-1),r(),m((t=!n.paginationService.hideCount&&S(7,8,n.rowCount$))?6:-1,t),r(2),y(" records ~ ",n.paginationService.footerPageNumber," Page "),r(2),m(n.paginationService.disableNextButton&&!n.paginationService.goToLastPage?10:-1),r(),m(n.paginationService.disableNextButton&&!n.paginationService.goToLastPage?11:-1)}}function qt(e,c){if(e&1&&_(0,Kt,12,10,"div",35),e&2){let t=c;m((t==null?null:t.length)>0?0:-1)}}function Jt(e,c){if(e&1){let t=f();o(0,"mainpanel",1),x("onSubmit",function(n){u(t);let a=s();return h(a.searchProduct(n))}),o(1,"actions"),A(2,Tt,2,1,"ng-container",2),o(3,"button",3),x("click",function(){u(t);let n=s();return h(n.openExportDialog())}),g(4,"i",4),o(5,"span"),d(6,"Export"),l()()(),o(7,"filters")(8,"filter-query-type",5),W("numberFilterComparatorChange",function(n){u(t);let a=s();return L(a.searchFilter().NumberFilterComparator,n)||(a.searchFilter().NumberFilterComparator=n),h(n)})("searchTypeChange",function(n){u(t);let a=s();return L(a.searchFilter().SearchType,n)||(a.searchFilter().SearchType=n),h(n)}),l()(),o(9,"content")(10,"div",6)(11,"div",7),_(12,Ut,17,6,"div",8),b(13,"async"),nt(14,jt,2,0,"div",9),l(),_(15,qt,1,1),b(16,"async"),l()()()}if(e&2){let t,i,n=c,a=s();p("searchBoxPlaceHolder",a.searchPlaceholder()),r(2),p("ngxPermissionsOnly",R(12,H,a.uploadProductRole)),r(6),p("numberFilterComparatorOptions",n==null||n.Options==null?null:n.Options.SearchComparatorTypeOptions),$("numberFilterComparator",a.searchFilter().NumberFilterComparator),p("searchTypeOptions",n==null||n.Options==null?null:n.Options.SearchSKUOnlyOrSKUNameOptions),$("searchType",a.searchFilter().SearchType),r(4),m(((t=S(13,8,a.data$))==null?null:t.length)>0?12:14),r(3),m((i=S(16,10,a.data$))?15:-1,i)}}var Te=(()=>{class e{constructor(){this.http=C(U),this.dialog=C(Ct),this.toastr=C(rt),this.route=C(lt),this.productService=C(ft),this.paginationService=C(wt),this.biggerPictureService=C(St),this.authService=C(dt),this.uploadProductService=C(bt),this.placeholderService=C(yt),this.loaderAPI="product/Load",this.notChannelAPI="product/GetNotInChannelV2",this.searchFilter=P({}),this.hostName=P(""),this.hasSelectionProduct=P(!1),this.selectedProducts=P([]),this.channelOptions=P([]),this.scanProductRole=z.ProductScan,this.uploadProductRole=z.ProductUpload,this.searchPlaceholder=P("Search ...");let t=this.authService;this.channelOptions.set(t.getChannels()),this.hostName.set(this.authService.getDomain())}ngOnInit(){this.initPageLoader(),this.iniData()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.notChannelAPI,this.loader$=this.http.post(`api/${this.loaderAPI}`,{}).pipe(k(t=>{this.searchFilter.set(t.Filter),this.paginationService.reloadPagination(t.Filter),this.initSearchPlaceholder()}))}initSearchPlaceholder(){let t=this.searchFilter();this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(t.SearchType,t.NumberFilterComparator))}iniData(){this.data$=this.paginationService.data$.pipe(w(t=>(t=t.map(i=>(i.Variants=i.Variants.map(n=>(n.Available=this.productService.sortChannel(n.Available),n.NotAvailable=this.productService.sortChannel(n.NotAvailable),n.Available=this.assignLogoChannel(n.Available),n.NotAvailable=this.assignLogoChannel(n.NotAvailable),n)),i.Channel=i?.Variants[0]?.Available,i)),t)))}assignLogoChannel(t){return t=t.map(i=>(i.Img=N.getChannelLogoByTypeId(i.TypeID),i)),t}searchProduct(t){this.searchFilter.update(i=>E(M({},i),{text:t})),this.paginationService.reloadPagination(this.searchFilter()),this.initSearchPlaceholder()}scanAllProduct(){let t=this.searchFilter(),i=this.productService.findChannelById(t.ChannelID,this.channelOptions());this.productService.scanAll(t.ChannelID,t.ScanFull,t.UpdatedProduct,t.Async).subscribe(n=>{t.Async?this.toastr.success("You will be notified when the scan is completed.","Scan Asynchronous"):(this.productService.successToastrScanAllProduct(n,i,!t.UpdatedProduct),this.initPageLoader())})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter()));t.ChannelID=N.GuidEMpty,this.dialog.open(xt,{data:{filter:t,channelOptions:this.channelOptions()},width:"600px"}).afterClosed().pipe(V(n=>N.IsNotEmpty(n))).subscribe(n=>{this.searchFilter.update(a=>E(M({},a),{ChannelID:n.ChannelID,ScanFull:n.ScanFull,UpdatedProduct:n.UpdatedProduct,Async:n.Async})),this.scanAllProduct()})}getRowCount(){this.paginationService.hideCount=!1;let t=this.searchFilter(),i={text:t.text,NumberFilterComparator:t.NumberFilterComparator,SearchType:t.SearchType};this.rowCount$=this.http.post(G.GetNotInChannelRowCount,i)}onNextPage(){this.paginationService.onNextPage(this.searchFilter())}onLastPage(){let t=this.searchFilter(),i={text:t.text,NumberFilterComparator:t.NumberFilterComparator,SearchType:t.SearchType};this.http.post(G.GetNotInChannelRowCount,i).subscribe({next:n=>{this.searchFilter.update(a=>E(M({},a),{PageNumber:1})),this.paginationService.getAllData(this.searchFilter(),n.Count)}})}onZoomImage(t,i){this.biggerPictureService.openBiggerPicture(t,i)}onSelectProduct(t){this.hasSelectionProduct.set(this.productService.hasSelection(t)),this.selectedProducts.set(this.productService.selectedProduct(t))}uploadMultipleProduct(){this.uploadProductService.setSelectedProduct(this.selectedProducts()),this.route.navigate(["/menu/products/upload"])}ngOnDestroy(){this.paginationService.destroy()}openExportDialog(){let t=this.searchFilter();this.dialog.open(Nt,{data:{title:"Export Not In Channel",pageNumber:t.PageNumber,rowCount:t.RowCount,filterExport:t,getRowCountApi:"product/GetNotInChannelRowCount",exportApi:"product/GetNotInChannelExport"}}).afterClosed().subscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=et({type:e,selectors:[["app-not-in-channel"]],decls:2,vars:3,consts:[["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"searchBoxPlaceHolder"],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"onSubmit","searchBoxPlaceHolder"],[4,"ngxPermissionsOnly"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[3,"numberFilterComparatorChange","searchTypeChange","numberFilterComparatorOptions","numberFilterComparator","searchTypeOptions","searchType"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"btn","btn-light","shadow","rounded","ms-2"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"ms-5","text-center",2,"width","450px"],[2,"width","150px"],[2,"width","20%"],[2,"width","16%"],[2,"width","10px"],[1,"ms-1"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"padding-left","0px"],[1,"d-flex","flex-wrap","mb-1"],[1,"text-center",3,"rowSpan"],["type","checkbox",3,"ngModelChange","ngModel"],[2,"padding-right","0px"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],[1,"text-start",3,"rowSpan"],[1,"ms-5","fw-normal","text-ellipsis",2,"max-width","26vw !important"],[3,"matTooltip"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"click","src"],["alt","",1,"channel-logo","cursor-pointer","ms-4","mt-3",3,"src","matTooltip"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],[2,"cursor","pointer"],[1,"btn-group"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(i,n){if(i&1&&(_(0,Jt,17,14,"mainpanel",0),b(1,"async")),i&2){let a;m((a=S(1,1,n.loader$))?0:-1,a)}},dependencies:[gt,st,ct,vt,ut,pt,_t,mt,ht,Pt,ot,at],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media(min-width:1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}thead[_ngcontent-%COMP%]{position:sticky;top:0}.channel-logo[_ngcontent-%COMP%]{width:20px}.w-img[_ngcontent-%COMP%]{width:100%}"],changeDetection:0})}}return e})();export{Te as NotInChannelComponent};
@@ -1 +1 @@
1
- import{a as re,b as oe}from"./chunk-XBJ3AIIM.js";import"./chunk-KAO5YCJZ.js";import{a as le}from"./chunk-LZ4OSFKB.js";import{c as ae,d as v,e as T}from"./chunk-QLY33AKV.js";import{a as te}from"./chunk-EWWYRIYD.js";import"./chunk-K6DXVJ5E.js";import"./chunk-2C6XBRGE.js";import"./chunk-RUHYZ275.js";import"./chunk-FQLAWEGT.js";import{a as ne}from"./chunk-XI37PNRD.js";import"./chunk-GAECPRA5.js";import{a as Y,b as Z,c as ee,d as ie}from"./chunk-SEX4VJEZ.js";import"./chunk-M3XAI5VN.js";import"./chunk-7ES2Z445.js";import"./chunk-HEO6A7EN.js";import"./chunk-72AE6737.js";import"./chunk-WTUKJT4T.js";import{a as X}from"./chunk-RG24XPVA.js";import"./chunk-QDKVYF6D.js";import"./chunk-YHJNCAG6.js";import"./chunk-6PI5PUIQ.js";import"./chunk-6V4QU6J7.js";import"./chunk-XSXHGAXP.js";import"./chunk-W2CSYQ6H.js";import"./chunk-ODW7HQHU.js";import"./chunk-TWIWWZUD.js";import"./chunk-DAGGBVVW.js";import"./chunk-ACIMXBIC.js";import"./chunk-67AXBZYF.js";import"./chunk-5QG5PZ7U.js";import"./chunk-KYK2ZFUZ.js";import{e as W}from"./chunk-ZZ7HSVKU.js";import{a as z,b as Q}from"./chunk-N54LZIRM.js";import"./chunk-DEQSZUMF.js";import{c as j}from"./chunk-NIRJAWTX.js";import"./chunk-RDXDKWLL.js";import"./chunk-WU3SNCIC.js";import"./chunk-MOG4SYJE.js";import"./chunk-JY726AM5.js";import"./chunk-2BS4VK45.js";import"./chunk-TTMPMWUQ.js";import"./chunk-5RV2CJGS.js";import"./chunk-QGNTUEVO.js";import"./chunk-GBUDZCXK.js";import"./chunk-S3MYFAWN.js";import"./chunk-SPNVH2ST.js";import"./chunk-BXA5YUTN.js";import"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import"./chunk-ZSUWHVKX.js";import{h as $}from"./chunk-ZVCNMOKL.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import{a as F}from"./chunk-P5OAPFNC.js";import"./chunk-7R55YTL6.js";import{c as x}from"./chunk-NNVT5X6O.js";import{A as K,c as G,h as k,m as q,o as J}from"./chunk-JUXE7GQZ.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import{b as A,e as H}from"./chunk-45DFJJAO.js";import"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import{D as U,z as B}from"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{$c as L,E as V,Eb as O,Ga as g,Oc as C,V as M,Vc as R,aa as E,bc as b,dc as w,ic as u,jc as a,kc as p,kd as f,lc as y,ld as _,mb as h,na as c,sc as S,ua as l,va as s,xc as d,zc as P}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import{a as D,b as N}from"./chunk-66YHNWRR.js";function se(m,I){if(m&1){let t=S();a(0,"button",16),d("click",function(){l(t);let e=P(),n=P();return s(n.onUpdateItems(e))}),y(1,"i",17),C(2," Update "),p()}}function pe(m,I){if(m&1){let t=S();a(0,"div"),b(1,se,3,0,"button",13),p(),a(2,"button",14),d("click",function(){l(t);let e=P();return s(e.openExportDialog())}),y(3,"i",15),a(4,"span"),C(5,"Export"),p()()}if(m&2){let t=P();h(),w(t.productService.hasSelectionVariant(I)?1:-1)}}var $e=(()=>{class m{constructor(){this.http=c(H),this.toastr=c(A),this.dialog=c(j),this.productService=c(X),this.authService=c($),this.placeholderService=c(ee),this.infinitePagination=c(v),this.updateResHandling=c(T),this.mainPanelService=c(z),this.channelOptions=g([]),this.searchFilter=g({PageNumber:1,RowCount:50,filterModel:1,text:"",ListChannelID:[],SearchType:Y.NameOnly,NumberFilterComparator:Z.Contains}),this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.data$=this.infinitePagination.data$.pipe(M()),this.searchPlaceholder=g("Search ..."),this.isUpdatePriceBtnDisabled=g(!0)}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.getDataAPI,this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe(E(t=>{t.Filter={PageNumber:t.Filter.PageNumber,RowCount:t.Filter.RowCount,filterModel:1,SearchType:t.Filter.SearchType,NumberFilterComparator:t.Filter.NumberFilterComparator},this.initSearchPlaceholder(),this.searchFilter.set(t.Filter),this.mainPanelService.openModalFilter()}))}initSearchPlaceholder(){this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(this.searchFilter().SearchType,this.searchFilter().NumberFilterComparator))}onShowDifferencePrice(t){let i=1;t&&(i=3),this.searchFilter.update(e=>(e.filterModel=i,e)),this.infinitePagination.reloadPagination(this.searchFilter())}onSearch(t){this.searchFilter.update(i=>(i.text=t,i)),this.infinitePagination.reloadPagination(this.searchFilter()),this.filterSelectedChannels(),this.initSearchPlaceholder()}onUpdateItems(t){let i=JSON.parse(JSON.stringify(this.channelOptions())),e=this.productService.selectedVariantProduct(t);this.dialog.open(re,{data:{title:"Updating Price",selectedItems:e,channels:i},width:"400px"}).afterClosed().pipe(V(n=>x.IsNotEmpty(n))).subscribe(n=>{this.channelOptions.set(n),this.updatePrice(t)})}filterSelectedChannels(){let i=this.authService.getChannels().filter(e=>this.searchFilter().ListChannelID?.indexOf(e.ID)!==-1);this.channelOptions.set(i)}updatePrice(t){let i=this.productService.selectedVariantProduct(t);if(i.length>0){let e=i.map(r=>({ID:r.ID,Code:r.Code,Price:r.UnitPrice})),o={ListChannelID:this.getSelectedChannels().map(r=>r.ID),ListPrice:e};this.http.post(F.UpdateChannelPrice,o).subscribe(r=>{this.infinitePagination.reloadPagination(this.searchFilter()),this.handlingUpdatePrice(r),this.resetSelectedChannels()})}}updatePriceByVariant(t){let i={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,Price:t.Price-0,VariantID:t.ID};this.http.post(F.UpdatePriceById,i).subscribe(e=>{this.infinitePagination.reloadPagination(this.searchFilter()),this.handlingUpdatePrice(e)})}handlingUpdatePrice(t){let i=t?.Response?.success_list,e=t?.Response?.failure_list,n=this.getSelectedChannels();i?.length>0||e?.length>0?this.updateResHandling.responseHandling(i,e,"Price",n):this.toastr.error(t[0]?.Exception,"Error")}openExportDialog(){this.dialog.open(ne,{data:{title:"Export Multi Channel Comparison",pageNumber:this.searchFilter().PageNumber,rowCount:this.searchFilter().RowCount,filterExport:this.searchFilter(),getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportMultipleChannelComparison"}}).afterClosed().subscribe()}resetSelectedChannels(){this.channelOptions.update(t=>(t.forEach(i=>{i.selected=!1}),t))}getSelectedChannels(){return this.channelOptions().filter(t=>t.selected)}updateFilter(t,i){this.searchFilter.update(e=>N(D({},e),{[t]:i}))}static{this.\u0275fac=function(i){return new(i||m)}}static{this.\u0275cmp=O({type:m,selectors:[["app-price-pos-channel"]],features:[L([v,U,le,T])],decls:30,vars:28,consts:[["headerTitle","Price Comparison","textButton","Search",3,"onSubmit","searchBoxPlaceHolder"],[1,"d-flex"],[1,"mb-5"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[3,"numberFilterComparatorChange","searchTypeChange","numberFilterComparatorOptions","numberFilterComparator","searchTypeOptions","searchType"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"onToggle","onSubmit","showProductToggle","data","channel","hiddenIPOSInventory"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"]],template:function(i,e){if(i&1){let n=S();R(0),f(1,"async"),a(2,"mainpanel",0),d("onSubmit",function(r){return l(n),s(e.onSearch(r))}),a(3,"actions")(4,"div",1),b(5,pe,6,1),f(6,"async"),p()(),a(7,"filters")(8,"div",2)(9,"label",3),C(10,"Channel"),p(),a(11,"app-channel-options-v2",4),d("ngModelChange",function(r){return l(n),s(e.updateFilter("ListChannelID",r))}),p()(),a(12,"div",2)(13,"filter-query-type",5),d("numberFilterComparatorChange",function(r){return l(n),s(e.updateFilter("NumberFilterComparator",r))})("searchTypeChange",function(r){return l(n),s(e.updateFilter("SearchType",r))}),p()(),a(14,"div",2)(15,"label",6),C(16,"Page Number"),p(),a(17,"input",7),d("ngModelChange",function(r){return l(n),s(e.updateFilter("PageNumber",r))}),p()(),a(18,"div")(19,"label",6),C(20,"Page Size"),p(),a(21,"input",7),d("ngModelChange",function(r){return l(n),s(e.updateFilter("RowCount",r))}),p()()(),a(22,"content")(23,"div",8)(24,"div",9)(25,"div",10)(26,"app-table",11),f(27,"async"),d("onToggle",function(r){return l(n),s(e.onShowDifferencePrice(r))})("onSubmit",function(r){return l(n),s(e.updatePriceByVariant(r))}),p(),a(28,"infinite-paginator",12),f(29,"async"),d("onNextPage",function(){return l(n),s(e.infinitePagination.onNextPage(e.searchFilter()))})("onLastPage",function(){return l(n),s(e.infinitePagination.onLastPage(e.searchFilter()))})("onGetRowCount",function(){return l(n),s(e.infinitePagination.getRowCount(e.searchFilter()))}),p()()()()()()}if(i&2){let n,o=_(1,20,e.loader$);h(2),u("searchBoxPlaceHolder",e.searchPlaceholder()),h(3),w((n=_(6,22,e.data$))?5:-1,n),h(6),u("multiple",!0)("ngModel",e.searchFilter().ListChannelID),h(2),u("numberFilterComparatorOptions",o==null||o.Options==null?null:o.Options.SearchComparatorTypeOptions)("numberFilterComparator",e.searchFilter().NumberFilterComparator)("searchTypeOptions",o==null||o.Options==null?null:o.Options.SearchSKUOnlyOrSKUNameOptions)("searchType",e.searchFilter().SearchType),h(4),u("ngModel",e.searchFilter().PageNumber),h(4),u("ngModel",e.searchFilter().RowCount),h(5),u("showProductToggle",!0)("data",_(27,24,e.data$))("channel",e.channelOptions())("hiddenIPOSInventory",!1),h(2),u("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",_(29,26,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}},dependencies:[K,G,J,k,q,ae,Q,oe,te,W,ie,B],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"],changeDetection:0})}}return m})();export{$e as PricePosChannelComponent};
1
+ import{a as re,b as oe}from"./chunk-YQGT34PL.js";import"./chunk-KAO5YCJZ.js";import{a as le}from"./chunk-LZ4OSFKB.js";import{c as ae,d as v,e as T}from"./chunk-QLY33AKV.js";import{a as te}from"./chunk-WRVJRQDB.js";import"./chunk-K6DXVJ5E.js";import"./chunk-2C6XBRGE.js";import"./chunk-RUHYZ275.js";import"./chunk-FQLAWEGT.js";import{a as ne}from"./chunk-XI37PNRD.js";import"./chunk-GAECPRA5.js";import{a as Y,b as Z,c as ee,d as ie}from"./chunk-SEX4VJEZ.js";import"./chunk-M3XAI5VN.js";import"./chunk-7ES2Z445.js";import"./chunk-HEO6A7EN.js";import"./chunk-72AE6737.js";import"./chunk-WTUKJT4T.js";import{a as X}from"./chunk-LATBLSAP.js";import"./chunk-QDKVYF6D.js";import"./chunk-YHJNCAG6.js";import"./chunk-6PI5PUIQ.js";import"./chunk-6V4QU6J7.js";import"./chunk-XSXHGAXP.js";import"./chunk-W2CSYQ6H.js";import"./chunk-ODW7HQHU.js";import"./chunk-TWIWWZUD.js";import"./chunk-5Y6OOO6C.js";import"./chunk-ACIMXBIC.js";import"./chunk-67AXBZYF.js";import"./chunk-5QG5PZ7U.js";import"./chunk-KYK2ZFUZ.js";import{e as W}from"./chunk-ZZ7HSVKU.js";import{a as z,b as Q}from"./chunk-N54LZIRM.js";import"./chunk-DEQSZUMF.js";import{c as j}from"./chunk-NIRJAWTX.js";import"./chunk-RDXDKWLL.js";import"./chunk-WU3SNCIC.js";import"./chunk-MOG4SYJE.js";import"./chunk-JY726AM5.js";import"./chunk-2BS4VK45.js";import"./chunk-TTMPMWUQ.js";import"./chunk-5RV2CJGS.js";import"./chunk-QGNTUEVO.js";import"./chunk-GBUDZCXK.js";import"./chunk-S3MYFAWN.js";import"./chunk-SPNVH2ST.js";import"./chunk-BXA5YUTN.js";import"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import"./chunk-ZSUWHVKX.js";import{h as $}from"./chunk-UZ7JBETM.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import{a as F}from"./chunk-P5OAPFNC.js";import"./chunk-7R55YTL6.js";import{c as x}from"./chunk-NNVT5X6O.js";import{A as K,c as G,h as k,m as q,o as J}from"./chunk-JUXE7GQZ.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import{b as A,e as H}from"./chunk-45DFJJAO.js";import"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import{D as U,z as B}from"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{$c as L,E as V,Eb as O,Ga as g,Oc as C,V as M,Vc as R,aa as E,bc as b,dc as w,ic as u,jc as a,kc as p,kd as f,lc as y,ld as _,mb as h,na as c,sc as S,ua as l,va as s,xc as d,zc as P}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import{a as D,b as N}from"./chunk-66YHNWRR.js";function se(m,I){if(m&1){let t=S();a(0,"button",16),d("click",function(){l(t);let e=P(),n=P();return s(n.onUpdateItems(e))}),y(1,"i",17),C(2," Update "),p()}}function pe(m,I){if(m&1){let t=S();a(0,"div"),b(1,se,3,0,"button",13),p(),a(2,"button",14),d("click",function(){l(t);let e=P();return s(e.openExportDialog())}),y(3,"i",15),a(4,"span"),C(5,"Export"),p()()}if(m&2){let t=P();h(),w(t.productService.hasSelectionVariant(I)?1:-1)}}var $e=(()=>{class m{constructor(){this.http=c(H),this.toastr=c(A),this.dialog=c(j),this.productService=c(X),this.authService=c($),this.placeholderService=c(ee),this.infinitePagination=c(v),this.updateResHandling=c(T),this.mainPanelService=c(z),this.channelOptions=g([]),this.searchFilter=g({PageNumber:1,RowCount:50,filterModel:1,text:"",ListChannelID:[],SearchType:Y.NameOnly,NumberFilterComparator:Z.Contains}),this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.data$=this.infinitePagination.data$.pipe(M()),this.searchPlaceholder=g("Search ..."),this.isUpdatePriceBtnDisabled=g(!0)}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.getDataAPI,this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe(E(t=>{t.Filter={PageNumber:t.Filter.PageNumber,RowCount:t.Filter.RowCount,filterModel:1,SearchType:t.Filter.SearchType,NumberFilterComparator:t.Filter.NumberFilterComparator},this.initSearchPlaceholder(),this.searchFilter.set(t.Filter),this.mainPanelService.openModalFilter()}))}initSearchPlaceholder(){this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(this.searchFilter().SearchType,this.searchFilter().NumberFilterComparator))}onShowDifferencePrice(t){let i=1;t&&(i=3),this.searchFilter.update(e=>(e.filterModel=i,e)),this.infinitePagination.reloadPagination(this.searchFilter())}onSearch(t){this.searchFilter.update(i=>(i.text=t,i)),this.infinitePagination.reloadPagination(this.searchFilter()),this.filterSelectedChannels(),this.initSearchPlaceholder()}onUpdateItems(t){let i=JSON.parse(JSON.stringify(this.channelOptions())),e=this.productService.selectedVariantProduct(t);this.dialog.open(re,{data:{title:"Updating Price",selectedItems:e,channels:i},width:"400px"}).afterClosed().pipe(V(n=>x.IsNotEmpty(n))).subscribe(n=>{this.channelOptions.set(n),this.updatePrice(t)})}filterSelectedChannels(){let i=this.authService.getChannels().filter(e=>this.searchFilter().ListChannelID?.indexOf(e.ID)!==-1);this.channelOptions.set(i)}updatePrice(t){let i=this.productService.selectedVariantProduct(t);if(i.length>0){let e=i.map(r=>({ID:r.ID,Code:r.Code,Price:r.UnitPrice})),o={ListChannelID:this.getSelectedChannels().map(r=>r.ID),ListPrice:e};this.http.post(F.UpdateChannelPrice,o).subscribe(r=>{this.infinitePagination.reloadPagination(this.searchFilter()),this.handlingUpdatePrice(r),this.resetSelectedChannels()})}}updatePriceByVariant(t){let i={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,Price:t.Price-0,VariantID:t.ID};this.http.post(F.UpdatePriceById,i).subscribe(e=>{this.infinitePagination.reloadPagination(this.searchFilter()),this.handlingUpdatePrice(e)})}handlingUpdatePrice(t){let i=t?.Response?.success_list,e=t?.Response?.failure_list,n=this.getSelectedChannels();i?.length>0||e?.length>0?this.updateResHandling.responseHandling(i,e,"Price",n):this.toastr.error(t[0]?.Exception,"Error")}openExportDialog(){this.dialog.open(ne,{data:{title:"Export Multi Channel Comparison",pageNumber:this.searchFilter().PageNumber,rowCount:this.searchFilter().RowCount,filterExport:this.searchFilter(),getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportMultipleChannelComparison"}}).afterClosed().subscribe()}resetSelectedChannels(){this.channelOptions.update(t=>(t.forEach(i=>{i.selected=!1}),t))}getSelectedChannels(){return this.channelOptions().filter(t=>t.selected)}updateFilter(t,i){this.searchFilter.update(e=>N(D({},e),{[t]:i}))}static{this.\u0275fac=function(i){return new(i||m)}}static{this.\u0275cmp=O({type:m,selectors:[["app-price-pos-channel"]],features:[L([v,U,le,T])],decls:30,vars:28,consts:[["headerTitle","Price Comparison","textButton","Search",3,"onSubmit","searchBoxPlaceHolder"],[1,"d-flex"],[1,"mb-5"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[3,"numberFilterComparatorChange","searchTypeChange","numberFilterComparatorOptions","numberFilterComparator","searchTypeOptions","searchType"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"onToggle","onSubmit","showProductToggle","data","channel","hiddenIPOSInventory"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"]],template:function(i,e){if(i&1){let n=S();R(0),f(1,"async"),a(2,"mainpanel",0),d("onSubmit",function(r){return l(n),s(e.onSearch(r))}),a(3,"actions")(4,"div",1),b(5,pe,6,1),f(6,"async"),p()(),a(7,"filters")(8,"div",2)(9,"label",3),C(10,"Channel"),p(),a(11,"app-channel-options-v2",4),d("ngModelChange",function(r){return l(n),s(e.updateFilter("ListChannelID",r))}),p()(),a(12,"div",2)(13,"filter-query-type",5),d("numberFilterComparatorChange",function(r){return l(n),s(e.updateFilter("NumberFilterComparator",r))})("searchTypeChange",function(r){return l(n),s(e.updateFilter("SearchType",r))}),p()(),a(14,"div",2)(15,"label",6),C(16,"Page Number"),p(),a(17,"input",7),d("ngModelChange",function(r){return l(n),s(e.updateFilter("PageNumber",r))}),p()(),a(18,"div")(19,"label",6),C(20,"Page Size"),p(),a(21,"input",7),d("ngModelChange",function(r){return l(n),s(e.updateFilter("RowCount",r))}),p()()(),a(22,"content")(23,"div",8)(24,"div",9)(25,"div",10)(26,"app-table",11),f(27,"async"),d("onToggle",function(r){return l(n),s(e.onShowDifferencePrice(r))})("onSubmit",function(r){return l(n),s(e.updatePriceByVariant(r))}),p(),a(28,"infinite-paginator",12),f(29,"async"),d("onNextPage",function(){return l(n),s(e.infinitePagination.onNextPage(e.searchFilter()))})("onLastPage",function(){return l(n),s(e.infinitePagination.onLastPage(e.searchFilter()))})("onGetRowCount",function(){return l(n),s(e.infinitePagination.getRowCount(e.searchFilter()))}),p()()()()()()}if(i&2){let n,o=_(1,20,e.loader$);h(2),u("searchBoxPlaceHolder",e.searchPlaceholder()),h(3),w((n=_(6,22,e.data$))?5:-1,n),h(6),u("multiple",!0)("ngModel",e.searchFilter().ListChannelID),h(2),u("numberFilterComparatorOptions",o==null||o.Options==null?null:o.Options.SearchComparatorTypeOptions)("numberFilterComparator",e.searchFilter().NumberFilterComparator)("searchTypeOptions",o==null||o.Options==null?null:o.Options.SearchSKUOnlyOrSKUNameOptions)("searchType",e.searchFilter().SearchType),h(4),u("ngModel",e.searchFilter().PageNumber),h(4),u("ngModel",e.searchFilter().RowCount),h(5),u("showProductToggle",!0)("data",_(27,24,e.data$))("channel",e.channelOptions())("hiddenIPOSInventory",!1),h(2),u("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",_(29,26,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}},dependencies:[K,G,J,k,q,ae,Q,oe,te,W,ie,B],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"],changeDetection:0})}}return m})();export{$e as PricePosChannelComponent};
@@ -1 +1 @@
1
- import{a as oe}from"./chunk-MIMZDUDP.js";import{a as ie}from"./chunk-24Q33PBZ.js";import{a as ne}from"./chunk-YGXBMXX2.js";import"./chunk-QUY3OMUB.js";import"./chunk-72AE6737.js";import{a as te}from"./chunk-KMCVYMXQ.js";import"./chunk-ACIMXBIC.js";import{a as Y,b as Z,d as ee}from"./chunk-ZZ7HSVKU.js";import{b as X}from"./chunk-N54LZIRM.js";import"./chunk-DEQSZUMF.js";import"./chunk-NIRJAWTX.js";import"./chunk-RDXDKWLL.js";import"./chunk-2GINYFUG.js";import"./chunk-RMWAYIJL.js";import"./chunk-EDNKI3WA.js";import"./chunk-CM45JN3C.js";import"./chunk-7BEOEYAC.js";import"./chunk-WU3SNCIC.js";import"./chunk-MOG4SYJE.js";import"./chunk-JY726AM5.js";import"./chunk-2BS4VK45.js";import"./chunk-TTMPMWUQ.js";import"./chunk-5RV2CJGS.js";import"./chunk-QGNTUEVO.js";import"./chunk-GJXDRPAS.js";import"./chunk-GBUDZCXK.js";import"./chunk-S3MYFAWN.js";import"./chunk-BXA5YUTN.js";import{b as Q}from"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import{h as G}from"./chunk-ZVCNMOKL.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import"./chunk-P5OAPFNC.js";import"./chunk-7R55YTL6.js";import"./chunk-NNVT5X6O.js";import{A as J,c as H,h as q,m as $,o as j,u as K,v as U}from"./chunk-JUXE7GQZ.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import{e as V}from"./chunk-45DFJJAO.js";import{b as k,e as z}from"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import{B as L}from"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{Eb as N,Ga as c,Kb as E,Lc as I,Nc as B,Oc as l,Pc as b,Qc as v,ad as P,bc as _,bd as W,dc as h,fc as O,gc as R,hc as w,ic as s,jc as n,kb as x,kc as t,kd as F,lc as S,mb as o,md as A,na as f,sc as D,ua as M,va as T,xc as m,zc as C}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import{a as u,b as y}from"./chunk-66YHNWRR.js";var re=()=>["/menu/log/order/detail-user"],le=a=>({ID:a});function de(a,g){if(a&1&&(n(0,"span",22),S(1,"img",23),t(),l(2)),a&2){let e=g.item;o(),s("src",e.Img,x)("alt",e.Name),o(),v(" ",e.Name," ")}}function pe(a,g){a&1&&(n(0,"th")(1,"span",29),l(2," Response Body Warning "),t()())}function se(a,g){a&1&&(n(0,"th")(1,"span",29),l(2," Number Override "),t()())}function me(a,g){if(a&1&&(n(0,"td",26)(1,"span",31),l(2),t()()),a&2){let e=C().$implicit;o(),I("bg-warning",e.responseBodyWarning!=null),o(),b(e.responseBodyWarning)}}function ge(a,g){if(a&1&&(n(0,"td"),l(1),t()),a&2){let e=C().$implicit;o(),v(" ",e.ResponseBodyWarningReference," ")}}function ce(a,g){if(a&1&&(n(0,"tr")(1,"td")(2,"a",30),l(3),F(4,"date"),t()(),n(5,"td"),l(6),t(),n(7,"td"),l(8),t(),n(9,"td"),l(10),t(),n(11,"td",26)(12,"span",31),l(13),t()(),_(14,me,3,3,"td",26),_(15,ge,2,1,"td"),t()),a&2){let e=g.$implicit,d=C(2);o(2),s("routerLink",P(14,re))("queryParams",W(15,le,e.ID)),o(),v(" ",A(4,11,e.Created,"dd MMM yyyy HH:mm:ss")," "),o(3),b(e.ChannelName),o(2),b(e.POSActionTypeString),o(2),b(e.Number),o(2),B(e.ResponseCode===200||e.ResponseCode===202?"bg-success":"bg-warning"),o(),v(" ",e.ResponseCode," "),o(),h(d.responseBodyWarningVisible()?14:-1),o(),h(d.responseBodyWarningVisible()?15:-1)}}function ue(a,g){if(a&1){let e=D();n(0,"div",20)(1,"table",24)(2,"thead")(3,"tr",25)(4,"th"),l(5,"Date"),t(),n(6,"th"),l(7,"Channel"),t(),n(8,"th"),l(9,"Actions"),t(),n(10,"th"),l(11,"Number"),t(),n(12,"th",26)(13,"span",27),l(14," Response Code "),t()(),_(15,pe,3,0,"th"),_(16,se,3,0,"th"),t()(),n(17,"tbody"),R(18,ce,16,17,"tr",null,O),t()(),n(20,"mat-paginator",28),m("page",function(i){M(e);let r=C();return T(r.changePage(i))}),t()()}if(a&2){let e=C();o(15),h(e.responseBodyWarningVisible()?15:-1),o(),h(e.responseBodyWarningVisible()?16:-1),o(2),w(e.Result()),o(2),s("length",e.paginationTotal())("pageSize",e.paginationPageSize())("pageIndex",e.filter().PageNumber==0?0:e.filter().PageNumber-1)}}function _e(a,g){a&1&&(n(0,"div",21),S(1,"app-empty-state"),t())}var Pe=(()=>{class a{constructor(){this.http=f(V),this._RawLogService=f(oe),this.route=f(k),this.authService=f(G),this.Result=c([]),this.filter=c({RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCode:"",From:"",To:"",responseBodyWarning:""}),this.paginationTotal=c(0),this.paginationPageSize=c(0),this.Number=c(null),this.channelOptions=c(this.authService.getChannels()),this.ActionTypeList=c(null),this.responseBodyWarningVisible=c(!1)}ngOnInit(){this.route.queryParams.subscribe(e=>{this.responseCode=e.responseCode,this.responseCode!=null?this.Load(e):this.Load()})}Load(e={}){this.http.post("/api/OrdersLoader/Get",e).subscribe(d=>{this.filter.update(i=>u(u({},i),d.Filter)),this.ActionTypeList.set(d.Options.ActionTypeList),this.Get()})}Get(e){this.filter.update(d=>y(u({},d),{Number:e})),this.http.post("/api/Orders/Get",this.filter()).subscribe(d=>{this._RawLogService.Data=d.hits;let i=[];for(let r of d.hits){r._source.log.responseBodyWarning!=null&&this.responseBodyWarningVisible.set(!0);let p={ID:r._id,Created:r._source["@timestamp_received"],shopId:r._source.shopId,MarketTypeString:r._source.log.type,ChannelName:r._source?.channelId!=null?this.channelOptions().find(ae=>ae.ID===r._source?.channelId)?.Name:"",POSActionTypeString:r._source.message,Number:r._source.log.number,ResponseCode:r._source.log.responseCode,responseBodyWarning:r._source.log.responseBodyWarning,ResponseBodyWarningReference:r._source.log.ResponseBodyWarningReference};i.push(p)}this.Result.set(i),this.paginationTotal.set(d.total.value),this.paginationPageSize.set(this.filter().RowCount>this.paginationTotal()?this.paginationTotal():this.filter().RowCount)})}changePage(e){this.filter.update(d=>y(u({},d),{PageNumber:e.pageIndex+1})),this.Get()}updateFilter(e,d){this.filter.update(i=>y(u({},i),{[e]:d}))}static{this.\u0275fac=function(d){return new(d||a)}}static{this.\u0275cmp=N({type:a,selectors:[["app-order"]],decls:42,vars:14,consts:[["headerTitle","Order Log","searchBoxPlaceHolder","Invoice Number..",3,"textChange","onSubmit","text"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],["bindLabel","Value","name","ActionType","bindValue","Key","placeholder","Action Type",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","text","name","StatusCode",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","text","name","responseBodyWarning","list","listresponseBodyWarning",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["id","listresponseBodyWarning"],["value","number-override"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table","table-hover"],[1,"table-light"],[1,"text-center"],["matTooltip","Http Status Code from developer.dealpos.com."],[3,"page","length","pageSize","pageIndex"],["matTooltip","ex: when payload.Number != response.Number value will be number-override"],[3,"routerLink","queryParams"],[1,"text-white","p-2","rounded","response-desc"]],template:function(d,i){if(d&1&&(n(0,"mainpanel",0),m("textChange",function(p){return i.Number.set(p)})("onSubmit",function(p){return i.Get(p)}),n(1,"filters")(2,"div")(3,"label",1),l(4,"Channel"),t(),n(5,"ng-select",2),m("ngModelChange",function(p){return i.updateFilter("ChannelID",p)}),E(6,de,3,3,"ng-template",3),t()(),n(7,"div",4)(8,"label",1),l(9,"Action"),t(),n(10,"ng-select",5),m("ngModelChange",function(p){return i.updateFilter("ActionType",p)}),t()(),n(11,"div",4)(12,"label",6),l(13,"From/To"),t(),n(14,"div",7)(15,"datepicker",8),m("dateChange",function(p){return i.updateFilter("From",p)}),t()(),n(16,"div")(17,"datepicker",9),m("dateChange",function(p){return i.updateFilter("To",p)}),t()()(),n(18,"div",4)(19,"label",10),l(20,"Response Code"),t(),n(21,"input",11),m("ngModelChange",function(p){return i.updateFilter("StatusCode",p)}),t()(),n(22,"div",4)(23,"label",10),l(24,"Response Body Warning"),t(),n(25,"input",12),m("ngModelChange",function(p){return i.updateFilter("responseBodyWarning",p)}),t(),n(26,"datalist",13),S(27,"option",14),t()(),n(28,"div",4)(29,"label",10),l(30,"Page Number"),t(),n(31,"input",15),m("ngModelChange",function(p){return i.updateFilter("PageNumber",p)}),t()(),n(32,"div",4)(33,"label",10),l(34,"Page Size"),t(),n(35,"input",16),m("ngModelChange",function(p){return i.updateFilter("RowCount",p)}),t()()(),n(36,"content")(37,"div",17)(38,"div",18)(39,"div",19),_(40,ue,21,5,"div",20)(41,_e,2,0,"div",21),t()()()()()),d&2){let r;s("text",i.Number()),o(5),s("clearable",!0)("items",i.channelOptions())("ngModel",i.filter().ChannelID),o(5),s("clearable",!0)("items",i.ActionTypeList())("ngModel",i.filter().ActionType),o(5),s("date",i.filter().From),o(2),s("date",i.filter().To),o(4),s("ngModel",i.filter().StatusCode),o(4),s("ngModel",i.filter().responseBodyWarning),o(6),s("ngModel",i.filter().PageNumber),o(4),s("ngModel",i.filter().RowCount),o(5),h(((r=i.Result())==null?null:r.length)>0?40:41)}},dependencies:[X,ee,J,K,U,H,j,q,$,Y,Z,ne,Q,z,ie,te,L],encapsulation:2,changeDetection:0})}}return a})();export{Pe as OrderComponent};
1
+ import{a as oe}from"./chunk-MIMZDUDP.js";import{a as ie}from"./chunk-24Q33PBZ.js";import{a as ne}from"./chunk-YGXBMXX2.js";import"./chunk-QUY3OMUB.js";import"./chunk-72AE6737.js";import{a as te}from"./chunk-KMCVYMXQ.js";import"./chunk-ACIMXBIC.js";import{a as Y,b as Z,d as ee}from"./chunk-ZZ7HSVKU.js";import{b as X}from"./chunk-N54LZIRM.js";import"./chunk-DEQSZUMF.js";import"./chunk-NIRJAWTX.js";import"./chunk-RDXDKWLL.js";import"./chunk-2GINYFUG.js";import"./chunk-RMWAYIJL.js";import"./chunk-EDNKI3WA.js";import"./chunk-CM45JN3C.js";import"./chunk-7BEOEYAC.js";import"./chunk-WU3SNCIC.js";import"./chunk-MOG4SYJE.js";import"./chunk-JY726AM5.js";import"./chunk-2BS4VK45.js";import"./chunk-TTMPMWUQ.js";import"./chunk-5RV2CJGS.js";import"./chunk-QGNTUEVO.js";import"./chunk-GJXDRPAS.js";import"./chunk-GBUDZCXK.js";import"./chunk-S3MYFAWN.js";import"./chunk-BXA5YUTN.js";import{b as Q}from"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import{h as G}from"./chunk-UZ7JBETM.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import"./chunk-P5OAPFNC.js";import"./chunk-7R55YTL6.js";import"./chunk-NNVT5X6O.js";import{A as J,c as H,h as q,m as $,o as j,u as K,v as U}from"./chunk-JUXE7GQZ.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import{e as V}from"./chunk-45DFJJAO.js";import{b as k,e as z}from"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import{B as L}from"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{Eb as N,Ga as c,Kb as E,Lc as I,Nc as B,Oc as l,Pc as b,Qc as v,ad as P,bc as _,bd as W,dc as h,fc as O,gc as R,hc as w,ic as s,jc as n,kb as x,kc as t,kd as F,lc as S,mb as o,md as A,na as f,sc as D,ua as M,va as T,xc as m,zc as C}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import{a as u,b as y}from"./chunk-66YHNWRR.js";var re=()=>["/menu/log/order/detail-user"],le=a=>({ID:a});function de(a,g){if(a&1&&(n(0,"span",22),S(1,"img",23),t(),l(2)),a&2){let e=g.item;o(),s("src",e.Img,x)("alt",e.Name),o(),v(" ",e.Name," ")}}function pe(a,g){a&1&&(n(0,"th")(1,"span",29),l(2," Response Body Warning "),t()())}function se(a,g){a&1&&(n(0,"th")(1,"span",29),l(2," Number Override "),t()())}function me(a,g){if(a&1&&(n(0,"td",26)(1,"span",31),l(2),t()()),a&2){let e=C().$implicit;o(),I("bg-warning",e.responseBodyWarning!=null),o(),b(e.responseBodyWarning)}}function ge(a,g){if(a&1&&(n(0,"td"),l(1),t()),a&2){let e=C().$implicit;o(),v(" ",e.ResponseBodyWarningReference," ")}}function ce(a,g){if(a&1&&(n(0,"tr")(1,"td")(2,"a",30),l(3),F(4,"date"),t()(),n(5,"td"),l(6),t(),n(7,"td"),l(8),t(),n(9,"td"),l(10),t(),n(11,"td",26)(12,"span",31),l(13),t()(),_(14,me,3,3,"td",26),_(15,ge,2,1,"td"),t()),a&2){let e=g.$implicit,d=C(2);o(2),s("routerLink",P(14,re))("queryParams",W(15,le,e.ID)),o(),v(" ",A(4,11,e.Created,"dd MMM yyyy HH:mm:ss")," "),o(3),b(e.ChannelName),o(2),b(e.POSActionTypeString),o(2),b(e.Number),o(2),B(e.ResponseCode===200||e.ResponseCode===202?"bg-success":"bg-warning"),o(),v(" ",e.ResponseCode," "),o(),h(d.responseBodyWarningVisible()?14:-1),o(),h(d.responseBodyWarningVisible()?15:-1)}}function ue(a,g){if(a&1){let e=D();n(0,"div",20)(1,"table",24)(2,"thead")(3,"tr",25)(4,"th"),l(5,"Date"),t(),n(6,"th"),l(7,"Channel"),t(),n(8,"th"),l(9,"Actions"),t(),n(10,"th"),l(11,"Number"),t(),n(12,"th",26)(13,"span",27),l(14," Response Code "),t()(),_(15,pe,3,0,"th"),_(16,se,3,0,"th"),t()(),n(17,"tbody"),R(18,ce,16,17,"tr",null,O),t()(),n(20,"mat-paginator",28),m("page",function(i){M(e);let r=C();return T(r.changePage(i))}),t()()}if(a&2){let e=C();o(15),h(e.responseBodyWarningVisible()?15:-1),o(),h(e.responseBodyWarningVisible()?16:-1),o(2),w(e.Result()),o(2),s("length",e.paginationTotal())("pageSize",e.paginationPageSize())("pageIndex",e.filter().PageNumber==0?0:e.filter().PageNumber-1)}}function _e(a,g){a&1&&(n(0,"div",21),S(1,"app-empty-state"),t())}var Pe=(()=>{class a{constructor(){this.http=f(V),this._RawLogService=f(oe),this.route=f(k),this.authService=f(G),this.Result=c([]),this.filter=c({RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCode:"",From:"",To:"",responseBodyWarning:""}),this.paginationTotal=c(0),this.paginationPageSize=c(0),this.Number=c(null),this.channelOptions=c(this.authService.getChannels()),this.ActionTypeList=c(null),this.responseBodyWarningVisible=c(!1)}ngOnInit(){this.route.queryParams.subscribe(e=>{this.responseCode=e.responseCode,this.responseCode!=null?this.Load(e):this.Load()})}Load(e={}){this.http.post("/api/OrdersLoader/Get",e).subscribe(d=>{this.filter.update(i=>u(u({},i),d.Filter)),this.ActionTypeList.set(d.Options.ActionTypeList),this.Get()})}Get(e){this.filter.update(d=>y(u({},d),{Number:e})),this.http.post("/api/Orders/Get",this.filter()).subscribe(d=>{this._RawLogService.Data=d.hits;let i=[];for(let r of d.hits){r._source.log.responseBodyWarning!=null&&this.responseBodyWarningVisible.set(!0);let p={ID:r._id,Created:r._source["@timestamp_received"],shopId:r._source.shopId,MarketTypeString:r._source.log.type,ChannelName:r._source?.channelId!=null?this.channelOptions().find(ae=>ae.ID===r._source?.channelId)?.Name:"",POSActionTypeString:r._source.message,Number:r._source.log.number,ResponseCode:r._source.log.responseCode,responseBodyWarning:r._source.log.responseBodyWarning,ResponseBodyWarningReference:r._source.log.ResponseBodyWarningReference};i.push(p)}this.Result.set(i),this.paginationTotal.set(d.total.value),this.paginationPageSize.set(this.filter().RowCount>this.paginationTotal()?this.paginationTotal():this.filter().RowCount)})}changePage(e){this.filter.update(d=>y(u({},d),{PageNumber:e.pageIndex+1})),this.Get()}updateFilter(e,d){this.filter.update(i=>y(u({},i),{[e]:d}))}static{this.\u0275fac=function(d){return new(d||a)}}static{this.\u0275cmp=N({type:a,selectors:[["app-order"]],decls:42,vars:14,consts:[["headerTitle","Order Log","searchBoxPlaceHolder","Invoice Number..",3,"textChange","onSubmit","text"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],["bindLabel","Value","name","ActionType","bindValue","Key","placeholder","Action Type",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","text","name","StatusCode",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","text","name","responseBodyWarning","list","listresponseBodyWarning",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["id","listresponseBodyWarning"],["value","number-override"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table","table-hover"],[1,"table-light"],[1,"text-center"],["matTooltip","Http Status Code from developer.dealpos.com."],[3,"page","length","pageSize","pageIndex"],["matTooltip","ex: when payload.Number != response.Number value will be number-override"],[3,"routerLink","queryParams"],[1,"text-white","p-2","rounded","response-desc"]],template:function(d,i){if(d&1&&(n(0,"mainpanel",0),m("textChange",function(p){return i.Number.set(p)})("onSubmit",function(p){return i.Get(p)}),n(1,"filters")(2,"div")(3,"label",1),l(4,"Channel"),t(),n(5,"ng-select",2),m("ngModelChange",function(p){return i.updateFilter("ChannelID",p)}),E(6,de,3,3,"ng-template",3),t()(),n(7,"div",4)(8,"label",1),l(9,"Action"),t(),n(10,"ng-select",5),m("ngModelChange",function(p){return i.updateFilter("ActionType",p)}),t()(),n(11,"div",4)(12,"label",6),l(13,"From/To"),t(),n(14,"div",7)(15,"datepicker",8),m("dateChange",function(p){return i.updateFilter("From",p)}),t()(),n(16,"div")(17,"datepicker",9),m("dateChange",function(p){return i.updateFilter("To",p)}),t()()(),n(18,"div",4)(19,"label",10),l(20,"Response Code"),t(),n(21,"input",11),m("ngModelChange",function(p){return i.updateFilter("StatusCode",p)}),t()(),n(22,"div",4)(23,"label",10),l(24,"Response Body Warning"),t(),n(25,"input",12),m("ngModelChange",function(p){return i.updateFilter("responseBodyWarning",p)}),t(),n(26,"datalist",13),S(27,"option",14),t()(),n(28,"div",4)(29,"label",10),l(30,"Page Number"),t(),n(31,"input",15),m("ngModelChange",function(p){return i.updateFilter("PageNumber",p)}),t()(),n(32,"div",4)(33,"label",10),l(34,"Page Size"),t(),n(35,"input",16),m("ngModelChange",function(p){return i.updateFilter("RowCount",p)}),t()()(),n(36,"content")(37,"div",17)(38,"div",18)(39,"div",19),_(40,ue,21,5,"div",20)(41,_e,2,0,"div",21),t()()()()()),d&2){let r;s("text",i.Number()),o(5),s("clearable",!0)("items",i.channelOptions())("ngModel",i.filter().ChannelID),o(5),s("clearable",!0)("items",i.ActionTypeList())("ngModel",i.filter().ActionType),o(5),s("date",i.filter().From),o(2),s("date",i.filter().To),o(4),s("ngModel",i.filter().StatusCode),o(4),s("ngModel",i.filter().responseBodyWarning),o(6),s("ngModel",i.filter().PageNumber),o(4),s("ngModel",i.filter().RowCount),o(5),h(((r=i.Result())==null?null:r.length)>0?40:41)}},dependencies:[X,ee,J,K,U,H,j,q,$,Y,Z,ne,Q,z,ie,te,L],encapsulation:2,changeDetection:0})}}return a})();export{Pe as OrderComponent};