marketplacepos 3.6.2 → 3.6.3

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 (76) hide show
  1. package/Marketplace/{chunk-TPFTT632.js → chunk-23JYSN6Q.js} +1 -1
  2. package/Marketplace/{chunk-ZRTKOAYD.js → chunk-2CW5UYLD.js} +1 -1
  3. package/Marketplace/{chunk-DZKSVYPR.js → chunk-2PUWLP55.js} +1 -1
  4. package/Marketplace/{chunk-YBEJ6DSM.js → chunk-4OJVE2Q5.js} +1 -1
  5. package/Marketplace/{chunk-46GC4FG7.js → chunk-5PZ6BLED.js} +1 -1
  6. package/Marketplace/{chunk-SB5XTLLY.js → chunk-6G6GKWWY.js} +1 -1
  7. package/Marketplace/{chunk-FH2STK2T.js → chunk-7KBKCIN6.js} +1 -1
  8. package/Marketplace/{chunk-BW5REXI6.js → chunk-7KE42BE5.js} +1 -1
  9. package/Marketplace/{chunk-FO3KSKQ6.js → chunk-7KXBD73I.js} +1 -1
  10. package/Marketplace/{chunk-TG2NAWXW.js → chunk-7NGXKP3O.js} +1 -1
  11. package/Marketplace/{chunk-BVGNNSM2.js → chunk-7U5UAWCO.js} +1 -1
  12. package/Marketplace/{chunk-7JWQMOH7.js → chunk-A3QB35Z5.js} +1 -1
  13. package/Marketplace/{chunk-RISSBTN2.js → chunk-AU4SOVII.js} +1 -1
  14. package/Marketplace/{chunk-PFXGXQHO.js → chunk-C7F32KU3.js} +1 -1
  15. package/Marketplace/{chunk-ZJYHLYQC.js → chunk-E22FOFQL.js} +1 -1
  16. package/Marketplace/{chunk-I3M6GHUE.js → chunk-EHWPM4BE.js} +1 -1
  17. package/Marketplace/{chunk-YO44EPAG.js → chunk-FCTD55SB.js} +1 -1
  18. package/Marketplace/{chunk-5LHF6NCK.js → chunk-FSLQ5TRN.js} +1 -1
  19. package/Marketplace/chunk-G7267XOM.js +1 -0
  20. package/Marketplace/{chunk-GMNZLOVM.js → chunk-GQBV5OAK.js} +1 -1
  21. package/Marketplace/{chunk-4YRDQUI3.js → chunk-HHAAJG6G.js} +1 -1
  22. package/Marketplace/{chunk-HUDF4XGA.js → chunk-HUTPG746.js} +1 -1
  23. package/Marketplace/{chunk-QZ6GD3DK.js → chunk-IYRCZVA4.js} +1 -1
  24. package/Marketplace/{chunk-XJMXZWZW.js → chunk-J6AJBBZ3.js} +1 -1
  25. package/Marketplace/{chunk-DQRS5DAE.js → chunk-JDFOZTNQ.js} +1 -1
  26. package/Marketplace/{chunk-BATYANE3.js → chunk-JKVEO7GJ.js} +1 -1
  27. package/Marketplace/{chunk-ERRFLL6T.js → chunk-JTTK3RAC.js} +1 -1
  28. package/Marketplace/{chunk-Z4L57D42.js → chunk-JW6NHBN5.js} +1 -1
  29. package/Marketplace/{chunk-XAU4KWDG.js → chunk-KJXEV3CR.js} +1 -1
  30. package/Marketplace/{chunk-LXDCPBTR.js → chunk-KRHP6DRW.js} +1 -1
  31. package/Marketplace/{chunk-PXAUQQ7Y.js → chunk-L5RZ2NWC.js} +1 -1
  32. package/Marketplace/{chunk-KM23UFSR.js → chunk-LX6C545M.js} +1 -1
  33. package/Marketplace/{chunk-45NXB6RE.js → chunk-LYFRN35D.js} +1 -1
  34. package/Marketplace/{chunk-RNPQSH4X.js → chunk-MAVB5XKB.js} +1 -1
  35. package/Marketplace/{chunk-2GCJVDVN.js → chunk-NG6JQWVZ.js} +1 -1
  36. package/Marketplace/{chunk-6M2Q3GGB.js → chunk-NJI6OAOU.js} +1 -1
  37. package/Marketplace/{chunk-ZLHGVQE6.js → chunk-NTY552OQ.js} +1 -1
  38. package/Marketplace/{chunk-EOM22W74.js → chunk-NXCMFVSB.js} +1 -1
  39. package/Marketplace/{chunk-TAD43MYD.js → chunk-O3ASI5PY.js} +1 -1
  40. package/Marketplace/chunk-P7QKTYYT.js +1 -0
  41. package/Marketplace/{chunk-HXRWGEJ5.js → chunk-PP4ELWXY.js} +1 -1
  42. package/Marketplace/{chunk-RWYXA653.js → chunk-PSWRS2QZ.js} +1 -1
  43. package/Marketplace/{chunk-CBOPSK2G.js → chunk-PTRHHOMT.js} +1 -1
  44. package/Marketplace/{chunk-QYZDV3KB.js → chunk-QEO6A33I.js} +1 -1
  45. package/Marketplace/{chunk-NZQHBWBK.js → chunk-QNIEXALL.js} +2 -2
  46. package/Marketplace/{chunk-JSCR55UZ.js → chunk-QO6GWCX7.js} +2 -2
  47. package/Marketplace/{chunk-F45ZZTMU.js → chunk-QP3S52F6.js} +1 -1
  48. package/Marketplace/{chunk-BVMOK3VE.js → chunk-QUZBZ5K4.js} +1 -1
  49. package/Marketplace/{chunk-ZHLG7GCJ.js → chunk-TIWU4GET.js} +1 -1
  50. package/Marketplace/{chunk-7EYB3DHT.js → chunk-TQSDPBUE.js} +1 -1
  51. package/Marketplace/{chunk-BREDWZJ7.js → chunk-UREGZMHY.js} +1 -1
  52. package/Marketplace/{chunk-J2UWP2SN.js → chunk-UU26ASVF.js} +1 -1
  53. package/Marketplace/{chunk-EAYXHDLW.js → chunk-VPP6ZKI2.js} +1 -1
  54. package/Marketplace/{chunk-XDJYCAPB.js → chunk-VUAKZHTF.js} +1 -1
  55. package/Marketplace/{chunk-GF526R3A.js → chunk-W6QK3KI2.js} +1 -1
  56. package/Marketplace/{chunk-RQYJJ3EK.js → chunk-WKRAISAM.js} +1 -1
  57. package/Marketplace/{chunk-L3TBTXVF.js → chunk-WOXH3LCZ.js} +1 -1
  58. package/Marketplace/{chunk-7V6UQDFG.js → chunk-WRAMXNGJ.js} +1 -1
  59. package/Marketplace/{chunk-DKGYGZK7.js → chunk-WUPPCYDC.js} +1 -1
  60. package/Marketplace/{chunk-V7X66MWE.js → chunk-WZRJRVH6.js} +1 -1
  61. package/Marketplace/{chunk-66UC4STB.js → chunk-XXLBTCRU.js} +1 -1
  62. package/Marketplace/{chunk-A4X2AUOC.js → chunk-YMMBFSTV.js} +1 -1
  63. package/Marketplace/{chunk-BYPWQ2HT.js → chunk-ZQL3IYZ4.js} +1 -1
  64. package/Marketplace/{chunk-UV6KK4W6.js → chunk-ZVHCE4K4.js} +1 -1
  65. package/Marketplace/index.html +2 -2
  66. package/Marketplace/{main-JR4ZU2LJ.js → main-3ZACSMQZ.js} +1 -1
  67. package/Marketplace/{styles-DXZCV23O.css → styles-DE7M2S4O.css} +1 -1
  68. package/package.json +1 -1
  69. package/Marketplace/chunk-2KGUHH44.js +0 -1
  70. package/Marketplace/chunk-MO3YBEXE.js +0 -1
  71. /package/Marketplace/{chunk-72VLH7XK.js → chunk-4EVRTQJX.js} +0 -0
  72. /package/Marketplace/{chunk-YD4CXLB4.js → chunk-5TEZF6KQ.js} +0 -0
  73. /package/Marketplace/{chunk-NXHCLVII.js → chunk-KTBPHH7N.js} +0 -0
  74. /package/Marketplace/{chunk-OUASU5FP.js → chunk-RHYO2A6O.js} +0 -0
  75. /package/Marketplace/{chunk-GCXKRLIU.js → chunk-SINQ7SXI.js} +0 -0
  76. /package/Marketplace/{polyfills-ON52FDZY.js → polyfills-AGGI3U6M.js} +0 -0
@@ -1 +1 @@
1
- import{a as q,b as f,c as _}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-UV6KK4W6.js";import{a as h,b as O}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-PFXGXQHO.js";import{b as P,e as V}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-HUDF4XGA.js";import{c as M,h as v,k as S,r as j,t as K}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-BREDWZJ7.js";import{c as F}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-YD4CXLB4.js";import{$a as k,Fa as s,Ga as g,Oa as d,Ua as y,Xb as W,Za as t,Zb as A,_a as i,_b as N,ea as C,hb as c,jb as x,ob as b,pb as m,qb as T,vb as L,wb as U,za as I}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-ZHLG7GCJ.js";function G(a,n){if(a&1&&(t(0,"tr")(1,"td")(2,"a",11),k(3,"img",12),t(4,"span"),m(5),i()()(),t(6,"td"),m(7),i(),t(8,"td"),m(9),i()()),a&2){let u=n.$implicit;s(2),d("href","/menu/channel/marketplace/view?ID="+u.Key.ID,I),s(1),d("src",u.Logo,I),s(2),T(u.Key.Name),s(2),T(u.Value.Out),s(2),T(u.Value.Tg)}}var oe=(()=>{let n=class n{constructor(l,o){this.dialogRef=l,this.data=o,this.generateChannelName(),this.channels=this.setChannelLogo(o.channels)}ngOnInit(){this.modalConfig=new f,this.modalConfig.title="Channel - New Order Configuration is not Unique!",this.modalConfig.headerType=q.Warning,this.modalConfig.hideOk=!0,this.modalConfig.cancelText="Close",this.modalConfig.customWidth="500px",this.modalConfig.hideClose=!0}setChannelLogo(l){return l.map(o=>(o.Logo=F.getChannelLogoByTypeId(o.Key.TypeID),o))}generateChannelName(){this.channelNames="";let l=this.data.channels;l.forEach((o,e)=>{this.channelNames+=`${o.Key} ${e!=l.length-1?" + ":""}`})}onClose(){this.dialogRef.close()}};n.\u0275fac=function(o){return new(o||n)(g(h),g(O))},n.\u0275cmp=C({type:n,selectors:[["app-modal-channel-warning"]],decls:24,vars:2,consts:[[3,"config","onCancel","onClose"],["content","",1,"pt-2","px-4"],[1,"row"],[1,"col-12"],[1,"lh-base","fs-5"],[1,"mb-4"],[1,"table","table-bordered"],[1,"table-light"],[4,"ngFor","ngForOf"],[1,"fs-5","mt-4"],["href","https://support.dealpos.com/en/articles/8281096-setup-multiple-channel-marketplace-to-one-warehouse-outlet","target","_blank"],["target","_blank",3,"href"],[1,"me-3",2,"width","24px",3,"src"]],template:function(o,e){o&1&&(t(0,"modal-material",0),c("onCancel",function(){return e.onClose()})("onClose",function(){return e.onClose()}),t(1,"div",1)(2,"div",2)(3,"div",3)(4,"p",4),m(5,"When your order configuration is not unique, your Dashboard Sales Report will be invalid. You can use either Outlet or Order Tag to differentiate Channel Order. "),i(),t(6,"h5",5),m(7,"Your duplicate Channels are"),i(),t(8,"table",6)(9,"thead")(10,"tr",7)(11,"th"),m(12,"Channel"),i(),t(13,"th"),m(14,"Outlet"),i(),t(15,"th"),m(16,"Tag"),i()()(),t(17,"tbody"),y(18,G,10,5,"tr",8),i()(),t(19,"p",9),m(20," Please refer to this "),t(21,"a",10),m(22,"article"),i(),m(23," for more information "),i()()()()()),o&2&&(d("config",e.modalConfig),s(18),d("ngForOf",e.channels))},dependencies:[A,_]});let a=n;return a})();var me=(()=>{let n=class n{constructor(l,o,e){this.dialogRef=l,this.httpService=o,this.toastr=e,this.modalConfig=new f,this.modalConfig.title="Write Off Reason"}onSubmit(){let l={Name:this.reason};this.subscription=this.httpService.post("/api/channel/AddWriteoffOption",l).subscribe(o=>{this.toastr.success(o.Message,"Success"),this.dialogRef.close(l)})}onClose(){this.dialogRef.close(!1)}ngOnDestroy(){this.subscription.unsubscribe()}};n.\u0275fac=function(o){return new(o||n)(g(h),g(V),g(P))},n.\u0275cmp=C({type:n,selectors:[["app-dialog-writeOff-reason"]],decls:7,vars:3,consts:[[3,"dynamicValidated","config","onClose","onCancel","onOk"],["content",""],[1,"form-label-group"],["type","text","id","writeOffReason","placeholder","Write Off Reason","name","writeOffReason",1,"form-control",3,"ngModel","ngModelChange"],["name","ngModel"],["for","shopid"]],template:function(o,e){o&1&&(t(0,"modal-material",0),c("onClose",function(){return e.onClose()})("onCancel",function(){return e.onClose()})("onOk",function(){return e.onSubmit()}),t(1,"div",1)(2,"div",2)(3,"input",3,4),c("ngModelChange",function(p){return e.reason=p}),i(),t(5,"label",5),m(6,"Reason"),i()()()()),o&2&&(d("dynamicValidated",e.reason)("config",e.modalConfig),s(3),d("ngModel",e.reason))},dependencies:[M,v,S,_],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}"]});let a=n;return a})();function $(a,n){a&1&&(t(0,"p"),m(1," URL is required "),i())}function H(a,n){if(a&1&&(t(0,"div",13),y(1,$,2,0,"p",14),i()),a&2){x();let u=b(10);s(1),d("ngIf",u.errors.required)}}function Y(a,n){a&1&&(t(0,"p"),m(1," Email is required "),i())}function B(a,n){a&1&&(t(0,"p"),m(1," Email is not valid "),i())}function J(a,n){if(a&1&&(t(0,"div",13),y(1,Y,2,0,"p",14)(2,B,2,0,"p",14),i()),a&2){x();let u=b(16);s(1),d("ngIf",u.errors.required),s(1),d("ngIf",u.errors.pattern)}}var Q=a=>({invalid:a}),X=()=>({updateOn:"blur"}),pe=(()=>{let n=class n{constructor(l){this.dialogRef=l}ngOnInit(){this.data={},this.initModalConfig()}initModalConfig(){this.modalConfig=new f,this.modalConfig.title="Fill data for Customer Support"}onSubmit(){this.dialogRef.close(this.data)}onClose(){this.dialogRef.close()}};n.\u0275fac=function(o){return new(o||n)(g(h))},n.\u0275cmp=C({type:n,selectors:[["app-contact-support"]],decls:18,vars:11,consts:[[3,"dynamicValidated","config","onClose","onCancel","onOk"],["content",""],[1,"mx-4"],["for","customerURL"],[1,"input-group","mb-5"],[1,"input-group-prepend"],["id","tokopediaUrl",1,"border-start-0","rounded-start","input-group-text","pointer-default","bg-light",2,"height","58px",3,"ngClass"],["required","","type","text","id","customerURL","name","customerURL","data-toggle","tooltip","title","customerURL",1,"form-control","border-start-0","customerUrl",3,"ngModel","ngModelChange"],["url","ngModel"],["class","text-danger",4,"ngIf"],["for","customerEmail"],["required","","type","text","id","customerEmail","name","customerEmail","data-toggle","tooltip","title","customerEmail","pattern","\\b[\\w\\.-]+@[\\w\\.-]+\\.\\w{2,4}\\b",1,"form-control",3,"ngModel","ngModelOptions","ngModelChange"],["email","ngModel"],[1,"text-danger"],[4,"ngIf"]],template:function(o,e){if(o&1&&(t(0,"modal-material",0),c("onClose",function(){return e.onClose()})("onCancel",function(){return e.onClose()})("onOk",function(){return e.onSubmit()}),t(1,"div",1)(2,"div",2)(3,"label",3),m(4,"Tokopedia URL"),i(),t(5,"div",4)(6,"div",5)(7,"span",6),m(8,"https://tokopedia.com/"),i()(),t(9,"input",7,8),c("ngModelChange",function(p){return e.data.URL=p}),i()(),y(11,H,2,1,"div",9),t(12,"label",10),m(13,"Requester's Email"),i(),t(14,"div",4)(15,"input",11,12),c("ngModelChange",function(p){return e.data.Email=p}),i()(),y(17,J,3,2,"div",9),i()()()),o&2){let r=b(10),p=b(16);d("dynamicValidated",!r.invalid&&!p.invalid)("config",e.modalConfig),s(7),d("ngClass",U(8,Q,r.invalid&&(r.dirty||r.touched))),s(2),d("ngModel",e.data.URL),s(2),d("ngIf",r.invalid&&(r.dirty||r.touched)),s(4),d("ngModel",e.data.Email)("ngModelOptions",L(10,X)),s(2),d("ngIf",p.invalid&&(p.dirty||p.touched))}},dependencies:[W,N,M,v,j,K,S,_],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.input-group[_ngcontent-%COMP%] > input[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem;color:#343434;font-size:.875rem;border-radius:.25rem!important;border-color:#c8d3df}.input-group[_ngcontent-%COMP%] > input.ng-invalid.ng-touched[_ngcontent-%COMP%]{border-color:#fb404b}.input-group[_ngcontent-%COMP%] > input.customerUrl[_ngcontent-%COMP%]{border-top-left-radius:0!important;border-bottom-left-radius:0!important}.invalid[_ngcontent-%COMP%]{border-color:#fb404b}.pointer-default[_ngcontent-%COMP%]{cursor:default}"]});let a=n;return a})();var ue=(()=>{let n=class n{constructor(l,o){this.dialogRef=l,this.data=o}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new f,this.modalConfig.title=this.data?.title,this.modalConfig.okText="SAVE"}onSubmit(){this.dialogRef.close(this.data)}onClose(){this.dialogRef.close()}};n.\u0275fac=function(o){return new(o||n)(g(h),g(O))},n.\u0275cmp=C({type:n,selectors:[["app-modal-dialog-tokopedia"]],decls:7,vars:3,consts:[[3,"dynamicValidated","config","onClose","onCancel","onOk"],["content",""],[1,"form-label-group"],["type","text","id","shopid","placeholder","Shop ID","name","ShopID","data-toggle","tooltip","title","Channel Name",1,"form-control",3,"ngModel","ngModelChange"],["name","ngModel"],["for","shopid"]],template:function(o,e){o&1&&(t(0,"modal-material",0),c("onClose",function(){return e.onClose()})("onCancel",function(){return e.onClose()})("onOk",function(){return e.onSubmit()}),t(1,"div",1)(2,"div",2)(3,"input",3,4),c("ngModelChange",function(p){return e.data.ShopID=p}),i(),t(5,"label",5),m(6,"Shop ID"),i()()()()),o&2&&(d("dynamicValidated",e.data.ShopID)("config",e.modalConfig),s(3),d("ngModel",e.data.ShopID))},dependencies:[M,v,S,_],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}"]});let a=n;return a})();var Me=(()=>{let n=class n{constructor(l,o){this.dialogRef=l,this.data=o,this.modalConfig=new f}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new f,this.modalConfig.title="WooCommerce",this.modalConfig.okText="SAVE"}onSubmit(){this.data.TypeID=2,this.dialogRef.close(this.data)}onClose(){this.dialogRef.close()}};n.\u0275fac=function(o){return new(o||n)(g(h),g(O))},n.\u0275cmp=C({type:n,selectors:[["app-modal-dialog-woocommerce"]],decls:17,vars:5,consts:[[3,"dynamicValidated","config","onClose","onCancel","onOk"],["content",""],[1,"form-label-group"],["type","text","id","shopid","placeholder","Shop ID","name","URL","data-toggle","tooltip","title","URL",1,"form-control",3,"ngModel","ngModelChange"],["name","ngModel"],["for","shopid"],["type","text","id","ConsumerKey","placeholder","Consumer Key","name","ConsumerKey","data-toggle","tooltip","title","ConsumerKey",1,"form-control",3,"ngModel","ngModelChange"],["for","ConsumerKey"],["type","text","id","ConsumerSecret","placeholder","Consumer Secret","name","ConsumerSecret","data-toggle","tooltip","title","ConsumerSecret",1,"form-control",3,"ngModel","ngModelChange"],["for","ConsumerSecret"]],template:function(o,e){o&1&&(t(0,"modal-material",0),c("onClose",function(){return e.onClose()})("onCancel",function(){return e.onClose()})("onOk",function(){return e.onSubmit()}),t(1,"div",1)(2,"div",2)(3,"input",3,4),c("ngModelChange",function(p){return e.data.URL=p}),i(),t(5,"label",5),m(6,"URL"),i()(),t(7,"div",2)(8,"input",6,4),c("ngModelChange",function(p){return e.data.ConsumerKey=p}),i(),t(10,"label",7),m(11,"Consumer Key"),i()(),t(12,"div",2)(13,"input",8,4),c("ngModelChange",function(p){return e.data.ConsumerSecret=p}),i(),t(15,"label",9),m(16,"Consumer Secret"),i()()()()),o&2&&(d("dynamicValidated",e.data.ConsumerKey&&e.data.URL&&e.data.ConsumerSecret)("config",e.modalConfig),s(3),d("ngModel",e.data.URL),s(5),d("ngModel",e.data.ConsumerKey),s(5),d("ngModel",e.data.ConsumerSecret))},dependencies:[M,v,S,_],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}"]});let a=n;return a})();export{oe as a,me as b,pe as c,ue as d,Me as e};
1
+ import{a as q,b as f,c as _}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-ZVHCE4K4.js";import{a as h,b as O}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-C7F32KU3.js";import{b as P,e as V}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-HUTPG746.js";import{c as M,h as v,k as S,r as j,t as K}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-UREGZMHY.js";import{c as F}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-5TEZF6KQ.js";import{$a as k,Fa as s,Ga as g,Oa as d,Ua as y,Xb as W,Za as t,Zb as A,_a as i,_b as N,ea as C,hb as c,jb as x,ob as b,pb as m,qb as T,vb as L,wb as U,za as I}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-TIWU4GET.js";function G(a,n){if(a&1&&(t(0,"tr")(1,"td")(2,"a",11),k(3,"img",12),t(4,"span"),m(5),i()()(),t(6,"td"),m(7),i(),t(8,"td"),m(9),i()()),a&2){let u=n.$implicit;s(2),d("href","/menu/channel/marketplace/view?ID="+u.Key.ID,I),s(1),d("src",u.Logo,I),s(2),T(u.Key.Name),s(2),T(u.Value.Out),s(2),T(u.Value.Tg)}}var oe=(()=>{let n=class n{constructor(l,o){this.dialogRef=l,this.data=o,this.generateChannelName(),this.channels=this.setChannelLogo(o.channels)}ngOnInit(){this.modalConfig=new f,this.modalConfig.title="Channel - New Order Configuration is not Unique!",this.modalConfig.headerType=q.Warning,this.modalConfig.hideOk=!0,this.modalConfig.cancelText="Close",this.modalConfig.customWidth="500px",this.modalConfig.hideClose=!0}setChannelLogo(l){return l.map(o=>(o.Logo=F.getChannelLogoByTypeId(o.Key.TypeID),o))}generateChannelName(){this.channelNames="";let l=this.data.channels;l.forEach((o,e)=>{this.channelNames+=`${o.Key} ${e!=l.length-1?" + ":""}`})}onClose(){this.dialogRef.close()}};n.\u0275fac=function(o){return new(o||n)(g(h),g(O))},n.\u0275cmp=C({type:n,selectors:[["app-modal-channel-warning"]],decls:24,vars:2,consts:[[3,"config","onCancel","onClose"],["content","",1,"pt-2","px-4"],[1,"row"],[1,"col-12"],[1,"lh-base","fs-5"],[1,"mb-4"],[1,"table","table-bordered"],[1,"table-light"],[4,"ngFor","ngForOf"],[1,"fs-5","mt-4"],["href","https://support.dealpos.com/en/articles/8281096-setup-multiple-channel-marketplace-to-one-warehouse-outlet","target","_blank"],["target","_blank",3,"href"],[1,"me-3",2,"width","24px",3,"src"]],template:function(o,e){o&1&&(t(0,"modal-material",0),c("onCancel",function(){return e.onClose()})("onClose",function(){return e.onClose()}),t(1,"div",1)(2,"div",2)(3,"div",3)(4,"p",4),m(5,"When your order configuration is not unique, your Dashboard Sales Report will be invalid. You can use either Outlet or Order Tag to differentiate Channel Order. "),i(),t(6,"h5",5),m(7,"Your duplicate Channels are"),i(),t(8,"table",6)(9,"thead")(10,"tr",7)(11,"th"),m(12,"Channel"),i(),t(13,"th"),m(14,"Outlet"),i(),t(15,"th"),m(16,"Tag"),i()()(),t(17,"tbody"),y(18,G,10,5,"tr",8),i()(),t(19,"p",9),m(20," Please refer to this "),t(21,"a",10),m(22,"article"),i(),m(23," for more information "),i()()()()()),o&2&&(d("config",e.modalConfig),s(18),d("ngForOf",e.channels))},dependencies:[A,_]});let a=n;return a})();var me=(()=>{let n=class n{constructor(l,o,e){this.dialogRef=l,this.httpService=o,this.toastr=e,this.modalConfig=new f,this.modalConfig.title="Write Off Reason"}onSubmit(){let l={Name:this.reason};this.subscription=this.httpService.post("/api/channel/AddWriteoffOption",l).subscribe(o=>{this.toastr.success(o.Message,"Success"),this.dialogRef.close(l)})}onClose(){this.dialogRef.close(!1)}ngOnDestroy(){this.subscription.unsubscribe()}};n.\u0275fac=function(o){return new(o||n)(g(h),g(V),g(P))},n.\u0275cmp=C({type:n,selectors:[["app-dialog-writeOff-reason"]],decls:7,vars:3,consts:[[3,"dynamicValidated","config","onClose","onCancel","onOk"],["content",""],[1,"form-label-group"],["type","text","id","writeOffReason","placeholder","Write Off Reason","name","writeOffReason",1,"form-control",3,"ngModel","ngModelChange"],["name","ngModel"],["for","shopid"]],template:function(o,e){o&1&&(t(0,"modal-material",0),c("onClose",function(){return e.onClose()})("onCancel",function(){return e.onClose()})("onOk",function(){return e.onSubmit()}),t(1,"div",1)(2,"div",2)(3,"input",3,4),c("ngModelChange",function(p){return e.reason=p}),i(),t(5,"label",5),m(6,"Reason"),i()()()()),o&2&&(d("dynamicValidated",e.reason)("config",e.modalConfig),s(3),d("ngModel",e.reason))},dependencies:[M,v,S,_],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}"]});let a=n;return a})();function $(a,n){a&1&&(t(0,"p"),m(1," URL is required "),i())}function H(a,n){if(a&1&&(t(0,"div",13),y(1,$,2,0,"p",14),i()),a&2){x();let u=b(10);s(1),d("ngIf",u.errors.required)}}function Y(a,n){a&1&&(t(0,"p"),m(1," Email is required "),i())}function B(a,n){a&1&&(t(0,"p"),m(1," Email is not valid "),i())}function J(a,n){if(a&1&&(t(0,"div",13),y(1,Y,2,0,"p",14)(2,B,2,0,"p",14),i()),a&2){x();let u=b(16);s(1),d("ngIf",u.errors.required),s(1),d("ngIf",u.errors.pattern)}}var Q=a=>({invalid:a}),X=()=>({updateOn:"blur"}),pe=(()=>{let n=class n{constructor(l){this.dialogRef=l}ngOnInit(){this.data={},this.initModalConfig()}initModalConfig(){this.modalConfig=new f,this.modalConfig.title="Fill data for Customer Support"}onSubmit(){this.dialogRef.close(this.data)}onClose(){this.dialogRef.close()}};n.\u0275fac=function(o){return new(o||n)(g(h))},n.\u0275cmp=C({type:n,selectors:[["app-contact-support"]],decls:18,vars:11,consts:[[3,"dynamicValidated","config","onClose","onCancel","onOk"],["content",""],[1,"mx-4"],["for","customerURL"],[1,"input-group","mb-5"],[1,"input-group-prepend"],["id","tokopediaUrl",1,"border-start-0","rounded-start","input-group-text","pointer-default","bg-light",2,"height","58px",3,"ngClass"],["required","","type","text","id","customerURL","name","customerURL","data-toggle","tooltip","title","customerURL",1,"form-control","border-start-0","customerUrl",3,"ngModel","ngModelChange"],["url","ngModel"],["class","text-danger",4,"ngIf"],["for","customerEmail"],["required","","type","text","id","customerEmail","name","customerEmail","data-toggle","tooltip","title","customerEmail","pattern","\\b[\\w\\.-]+@[\\w\\.-]+\\.\\w{2,4}\\b",1,"form-control",3,"ngModel","ngModelOptions","ngModelChange"],["email","ngModel"],[1,"text-danger"],[4,"ngIf"]],template:function(o,e){if(o&1&&(t(0,"modal-material",0),c("onClose",function(){return e.onClose()})("onCancel",function(){return e.onClose()})("onOk",function(){return e.onSubmit()}),t(1,"div",1)(2,"div",2)(3,"label",3),m(4,"Tokopedia URL"),i(),t(5,"div",4)(6,"div",5)(7,"span",6),m(8,"https://tokopedia.com/"),i()(),t(9,"input",7,8),c("ngModelChange",function(p){return e.data.URL=p}),i()(),y(11,H,2,1,"div",9),t(12,"label",10),m(13,"Requester's Email"),i(),t(14,"div",4)(15,"input",11,12),c("ngModelChange",function(p){return e.data.Email=p}),i()(),y(17,J,3,2,"div",9),i()()()),o&2){let r=b(10),p=b(16);d("dynamicValidated",!r.invalid&&!p.invalid)("config",e.modalConfig),s(7),d("ngClass",U(8,Q,r.invalid&&(r.dirty||r.touched))),s(2),d("ngModel",e.data.URL),s(2),d("ngIf",r.invalid&&(r.dirty||r.touched)),s(4),d("ngModel",e.data.Email)("ngModelOptions",L(10,X)),s(2),d("ngIf",p.invalid&&(p.dirty||p.touched))}},dependencies:[W,N,M,v,j,K,S,_],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.input-group[_ngcontent-%COMP%] > input[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem;color:#343434;font-size:.875rem;border-radius:.25rem!important;border-color:#c8d3df}.input-group[_ngcontent-%COMP%] > input.ng-invalid.ng-touched[_ngcontent-%COMP%]{border-color:#fb404b}.input-group[_ngcontent-%COMP%] > input.customerUrl[_ngcontent-%COMP%]{border-top-left-radius:0!important;border-bottom-left-radius:0!important}.invalid[_ngcontent-%COMP%]{border-color:#fb404b}.pointer-default[_ngcontent-%COMP%]{cursor:default}"]});let a=n;return a})();var ue=(()=>{let n=class n{constructor(l,o){this.dialogRef=l,this.data=o}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new f,this.modalConfig.title=this.data?.title,this.modalConfig.okText="SAVE"}onSubmit(){this.dialogRef.close(this.data)}onClose(){this.dialogRef.close()}};n.\u0275fac=function(o){return new(o||n)(g(h),g(O))},n.\u0275cmp=C({type:n,selectors:[["app-modal-dialog-tokopedia"]],decls:7,vars:3,consts:[[3,"dynamicValidated","config","onClose","onCancel","onOk"],["content",""],[1,"form-label-group"],["type","text","id","shopid","placeholder","Shop ID","name","ShopID","data-toggle","tooltip","title","Channel Name",1,"form-control",3,"ngModel","ngModelChange"],["name","ngModel"],["for","shopid"]],template:function(o,e){o&1&&(t(0,"modal-material",0),c("onClose",function(){return e.onClose()})("onCancel",function(){return e.onClose()})("onOk",function(){return e.onSubmit()}),t(1,"div",1)(2,"div",2)(3,"input",3,4),c("ngModelChange",function(p){return e.data.ShopID=p}),i(),t(5,"label",5),m(6,"Shop ID"),i()()()()),o&2&&(d("dynamicValidated",e.data.ShopID)("config",e.modalConfig),s(3),d("ngModel",e.data.ShopID))},dependencies:[M,v,S,_],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}"]});let a=n;return a})();var Me=(()=>{let n=class n{constructor(l,o){this.dialogRef=l,this.data=o,this.modalConfig=new f}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new f,this.modalConfig.title="WooCommerce",this.modalConfig.okText="SAVE"}onSubmit(){this.data.TypeID=2,this.dialogRef.close(this.data)}onClose(){this.dialogRef.close()}};n.\u0275fac=function(o){return new(o||n)(g(h),g(O))},n.\u0275cmp=C({type:n,selectors:[["app-modal-dialog-woocommerce"]],decls:17,vars:5,consts:[[3,"dynamicValidated","config","onClose","onCancel","onOk"],["content",""],[1,"form-label-group"],["type","text","id","shopid","placeholder","Shop ID","name","URL","data-toggle","tooltip","title","URL",1,"form-control",3,"ngModel","ngModelChange"],["name","ngModel"],["for","shopid"],["type","text","id","ConsumerKey","placeholder","Consumer Key","name","ConsumerKey","data-toggle","tooltip","title","ConsumerKey",1,"form-control",3,"ngModel","ngModelChange"],["for","ConsumerKey"],["type","text","id","ConsumerSecret","placeholder","Consumer Secret","name","ConsumerSecret","data-toggle","tooltip","title","ConsumerSecret",1,"form-control",3,"ngModel","ngModelChange"],["for","ConsumerSecret"]],template:function(o,e){o&1&&(t(0,"modal-material",0),c("onClose",function(){return e.onClose()})("onCancel",function(){return e.onClose()})("onOk",function(){return e.onSubmit()}),t(1,"div",1)(2,"div",2)(3,"input",3,4),c("ngModelChange",function(p){return e.data.URL=p}),i(),t(5,"label",5),m(6,"URL"),i()(),t(7,"div",2)(8,"input",6,4),c("ngModelChange",function(p){return e.data.ConsumerKey=p}),i(),t(10,"label",7),m(11,"Consumer Key"),i()(),t(12,"div",2)(13,"input",8,4),c("ngModelChange",function(p){return e.data.ConsumerSecret=p}),i(),t(15,"label",9),m(16,"Consumer Secret"),i()()()()),o&2&&(d("dynamicValidated",e.data.ConsumerKey&&e.data.URL&&e.data.ConsumerSecret)("config",e.modalConfig),s(3),d("ngModel",e.data.URL),s(5),d("ngModel",e.data.ConsumerKey),s(5),d("ngModel",e.data.ConsumerSecret))},dependencies:[M,v,S,_],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}"]});let a=n;return a})();export{oe as a,me as b,pe as c,ue as d,Me as e};
@@ -1 +1 @@
1
- import{a as Ne}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-NXHCLVII.js";import{a as O,b as ue,c as ge,d as Ce}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-ZLHGVQE6.js";import{a as he,b as Be}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-I3M6GHUE.js";import{b as Ue}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-QZ6GD3DK.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-OUASU5FP.js";import{a as Re,b as Le}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-BW5REXI6.js";import{a as le}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-GCXKRLIU.js";import{a as _e}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-GF526R3A.js";import{a as me}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-6M2Q3GGB.js";import{a as G}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-Z4L57D42.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-UV6KK4W6.js";import{c as K}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-PFXGXQHO.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-HXRWGEJ5.js";import{a as Me,b as ke}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-RNPQSH4X.js";import{b as B,e as j}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-HUDF4XGA.js";import{b as ce,c as De}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-RWYXA653.js";import{a as de}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-ZRTKOAYD.js";import{a as Oe,b as $e,c as Ae}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-BYPWQ2HT.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-KM23UFSR.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-2GCJVDVN.js";import{d as Ve}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-TAD43MYD.js";import{a as se}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-TPFTT632.js";import{t as pe,u as Ee,v as z,w as Fe}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-V7X66MWE.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-45NXB6RE.js";import{b as ie,c as oe,h as k,k as N,m as ae,u as re,v as Te}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-BREDWZJ7.js";import{c as w}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-YD4CXLB4.js";import{$a as x,B as D,Cb as P,Db as v,Fa as l,Ga as b,Hc as we,Ja as Ie,Lb as Y,Lc as ne,Oa as s,Q as be,Ua as C,X,Xb as $,Za as r,Zb as A,_a as c,_b as U,aa as Q,ab as F,bb as M,bc as te,db as f,ea as V,ec as R,fa as W,fc as L,hb as g,ja as h,jb as p,ka as u,mb as ee,ob as H,pb as m,q,qb as T,rb as I,ub as ye,wb as y,za as E}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-ZHLG7GCJ.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-72VLH7XK.js";function nt(i,a){if(i&1){let n=f();r(0,"button",18),g("click",function(){h(n);let t=p(3);return u(t.openScanDialog())}),x(1,"i",19),m(2," Scan Channel "),c()}}function it(i,a){if(i&1){let n=f();r(0,"button",20),g("click",function(){h(n);let t=p().ngIf,o=p(2);return u(o.onUpdateItems(t))}),x(1,"i",21),m(2," Update "),c()}}function ot(i,a){if(i&1&&(r(0,"div"),C(1,nt,3,0,"button",16)(2,it,3,0,"button",17),c()),i&2){let n=a.ngIf,e=p(2);l(1),s("ngIf",!e.productService.hasSelectionVariant(n)),l(1),s("ngIf",e.productService.hasSelectionVariant(n))}}function at(i,a){if(i&1){let n=f();r(0,"div",22)(1,"app-table",23),g("onToggle",function(t){h(n);let o=p(2);return u(o.onShowDifferencePrice(t))})("onSubmit",function(t){h(n);let o=p(2);return u(o.updatePriceByVariant(t))}),P(2,"async"),c()()}if(i&2){let n=p().ngIf,e=p();l(1),s("showProductToggle",!0)("data",v(2,4,e.paginationService.data$))("channel",n.Options.Channel)("filter",n.Filter)}}function rt(i,a){if(i&1){let n=f();r(0,"span",24),g("click",function(){h(n);let t=p(2);return u(t.getRowCount())}),r(1,"i",25),m(2,"?"),c()()}}function lt(i,a){if(i&1&&(r(0,"span"),m(1),P(2,"number"),c()),i&2){let n=a.ngIf;l(1),T(v(2,1,n))}}function ct(i,a){if(i&1){let n=f();r(0,"a",26),g("click",function(){h(n);let t=p(2);return u(t.onNextPage())}),x(1,"i",27),m(2," Next"),c()}}function st(i,a){if(i&1){let n=f();r(0,"a",28),g("click",function(){h(n);let t=p(2);return u(t.onLastPage())}),x(1,"i",29),m(2," Last"),c()}}function pt(i,a){if(i&1){let n=f();r(0,"mainpanel",1),g("onSubmit",function(t){h(n);let o=p();return u(o.onSearch(t))}),r(1,"actions")(2,"div",2),C(3,ot,3,2,"div",3),P(4,"async"),c()(),r(5,"filters")(6,"div",4)(7,"div")(8,"label"),m(9,"Page Number"),c(),r(10,"input",5),g("ngModelChange",function(t){h(n);let o=p();return u(o.searchFilter.PageNumber=t)}),c()(),r(11,"div")(12,"label"),m(13,"Page Size"),c(),r(14,"input",5),g("ngModelChange",function(t){h(n);let o=p();return u(o.searchFilter.RowCount=t)}),c()()()(),r(15,"content")(16,"div",6)(17,"div",7),C(18,at,3,6,"div",8),P(19,"async"),c(),r(20,"div",9)(21,"div",10)(22,"div",11),m(23),P(24,"number"),P(25,"async"),C(26,rt,3,0,"span",12)(27,lt,3,3,"span",3),P(28,"async"),m(29),c()(),r(30,"div",13),C(31,ct,3,0,"a",14)(32,st,3,0,"a",15),c()()()()()}if(i&2){let n=p(),e;s("pageData",n.pageData)("textButton","Search"),l(3),s("ngIf",v(4,12,n.paginationService.data$)),l(7),s("ngModel",n.searchFilter.PageNumber),l(4),s("ngModel",n.searchFilter.RowCount),l(4),s("ngIf",v(19,14,n.paginationService.data$)),l(5),I(" Showing 1 - ",v(24,16,(e=v(25,18,n.paginationService.data$))==null?null:e.length)," of "),l(3),s("ngIf",n.paginationService.hideCount),l(1),s("ngIf",!n.paginationService.hideCount&&v(28,20,n.allDataCount$)),l(2),I(" records ~ ",n.paginationService.footerPageNumber," Page "),l(2),s("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage),l(1),s("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage)}}var He=(()=>{let a=class a{constructor(e,t,o,d,_){this.http=e,this.toastr=t,this.dialog=o,this.paginationService=d,this.productService=_,this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.filterOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Price",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!0},{Title:"Price Realtime",Url:"/menu/price/realtime",Active:!1}]}}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.getDataAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe(X(e=>{this.channelOptions=e.Options.Channel,e.Filter={PageNumber:e.Filter.PageNumber,RowCount:e.Filter.RowCount,filterModel:1},this.searchFilter=e.Filter,this.paginationService.reloadPagination(this.searchFilter)}))}onShowDifferencePrice(e){this.searchFilter.filterModel=1,e&&(this.searchFilter.filterModel=3),this.paginationService.reloadPagination(this.searchFilter)}onSearch(e){this.searchFilter.text=e,this.paginationService.reloadPagination(this.searchFilter)}openScanDialog(){this.searchFilter.ChannelID=w.GuidEMpty;let e=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(me,{data:{filter:e,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(D(o=>w.IsNotEmpty(o))).subscribe(o=>{this.searchFilter.ChannelID=o.ChannelID,this.searchFilter.ScanFull=o.ScanFull,this.searchFilter.UpdatedProduct=o.UpdatedProduct,this.searchFilter.Async=o.Async,this.scanAll()})}scanAll(){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{let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.initPageLoader(),this.productService.successToastrScanAllProduct(e,t,!this.searchFilter.UpdatedProduct)}})}updatePrice(e){let t=this.productService.selectedVariantProduct(e);if(t.length>0){let d=t.map(S=>({ID:S.ID,Code:S.Code,Price:S.UnitPrice}));var o=this.channelOptions.filter(S=>S.selected).map(S=>S.ID);let _={ListChannelID:o,ListPrice:d};this.http.post("/api/Price/UpdateChannel",_).subscribe(S=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+_.ListPrice.length+" items in "+_.ListChannelID.length+" channels","Success")})}}updatePriceByVariant(e){let t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:e.Price-0,VariantID:e.ID};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(o=>{let d=this.productService.findChannelById(t.ID,this.channelOptions);this.toastr.success("Successfully updated "+e.ItemName+"("+e.VarName+") price in "+d.Name+" to "+t.Price,"Success"),this.paginationService.reloadPagination(this.searchFilter)})}onUpdateItems(e){let t=this.productService.selectedVariantProduct(e);this.dialog.open(he,{data:{selectedItems:t,channels:this.channelOptions},width:"600px"}).afterClosed().pipe(D(o=>o!==void 0)).subscribe(o=>{this.channelOptions=o,this.updatePrice(e)})}getRowCount(){this.paginationService.hideCount=!1,this.allDataCount$=this.http.post(`/api/${this.rowCountAPI}`,{})}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:e=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,e)}})}ngOnDestroy(){this.paginationService.destroy()}};a.\u0275fac=function(t){return new(t||a)(b(j),b(B),b(K),b(_e),b(G))},a.\u0275cmp=V({type:a,selectors:[["app-price-pos-channel"]],decls:2,vars:3,consts:[["headerTitle","Price Comparison",3,"pageData","textButton","onSubmit",4,"ngIf"],["headerTitle","Price Comparison",3,"pageData","textButton","onSubmit"],[1,"d-flex"],[4,"ngIf"],["container",""],["type","number",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],["class","col-md-12",4,"ngIf"],[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"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"showProductToggle","data","channel","filter","onToggle","onSubmit"],[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(t,o){t&1&&(C(0,pt,33,22,"mainpanel",0),P(1,"async")),t&2&&s("ngIf",v(1,1,o.loader$))},dependencies:[U,oe,ae,k,N,z,ge,te,R],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let i=a;return i})();function mt(i,a){if(i&1&&(r(0,"mat-radio-button",3),m(1),c()),i&2){let n=a.$implicit,e=a.index,t=p();s("value",n.Key)("name",t.name)("title",t.tooltipsText[e]?t.tooltipsText[e]:""),l(1),I(" ",n.Value,"")}}var dt=i=>({"border-0 rounded":i}),fe=(()=>{let a=class a{constructor(){this.modelChange=new Ie,this.border=!1,this.tooltipsText=[]}change(e){this.modelChange.emit(e)}};a.\u0275fac=function(t){return new(t||a)},a.\u0275cmp=V({type:a,selectors:[["radio-options"]],inputs:{model:"model",options:"options",border:"border",name:"name",tooltipsText:"tooltipsText"},outputs:{modelChange:"modelChange"},standalone:!0,features:[ye],decls:3,vars:5,consts:[[1,"form-control","h-100",3,"ngClass"],[3,"ngModel","ngModelChange"],["class","me-5","data-toggle","tooltip","data-placement","right",3,"value","name","title",4,"ngFor","ngForOf"],["data-toggle","tooltip","data-placement","right",1,"me-5",3,"value","name","title"]],template:function(t,o){t&1&&(r(0,"div",0)(1,"mat-radio-group",1),g("ngModelChange",function(_){return o.change(_)}),C(2,mt,2,4,"mat-radio-button",2),c()()),t&2&&(s("ngClass",y(3,dt,o.border==!1)),l(1),s("ngModel",o.model),l(1),s("ngForOf",o.options))},dependencies:[L,$,A,Ae,Oe,$e,re,k,N],styles:[".mat-radio-label{margin-top:auto;margin-bottom:auto}"]});let i=a;return i})();function Ct(i,a){if(i&1){let n=f();r(0,"button",18),g("click",function(){h(n);let t=p();return u(t.onUpdateItems())}),x(1,"i",19),m(2," Update "),c()}}function ft(i,a){if(i&1&&(r(0,"th",20),m(1),c()),i&2){let n=a.$implicit;l(1),T(n.Name)}}function xt(i,a){if(i&1){let n=f();r(0,"th")(1,"input",21),g("ngModelChange",function(t){h(n);let o=p();return u(o.checkboxState=t)})("ngModelChange",function(){h(n);let t=p();return u(t.onSelectAllData())}),c()()}if(i&2){let n=p();l(1),s("ngModel",n.checkboxState)}}function St(i,a){i&1&&(F(0),r(1,"th",22),m(2," Expected (POS) "),c(),r(3,"th",22),m(4," Channel "),c(),M())}function Pt(i,a){if(i&1){let n=f();r(0,"img",35),g("click",function(t){h(n);let o=p(3).$implicit,d=p();return u(d.onZoomImage(t,o==null?null:o.ImageUrl))}),c()}if(i&2){let n=p(3).$implicit;ee("src",n==null?null:n.ImageUrl,E)}}function vt(i,a){i&1&&x(0,"img",36)}var bt=i=>({"border-bottom":i});function It(i,a){if(i&1&&(F(0),r(1,"td",30),C(2,Pt,1,1,"img",31)(3,vt,1,0,"ng-template",null,32,Y),c(),r(5,"td",33)(6,"h5",34),m(7),c(),x(8,"br"),r(9,"small"),m(10),c()(),M()),i&2){let n=H(4),e=p().index,t=p().$implicit,o=p();l(1),s("rowSpan",t==null?null:t.Variants.length)("ngClass",y(7,bt,e+1==o.products.length)),l(1),s("ngIf",t==null?null:t.ImageUrl)("ngIfElse",n),l(3),s("rowSpan",t==null?null:t.Variants.length),l(2),T(t==null?null:t.Name),l(3),I("(",t==null?null:t.Category,")")}}function yt(i,a){if(i&1){let n=f();r(0,"td",37)(1,"input",21),g("ngModelChange",function(t){h(n);let o=p().$implicit;return u(o.selected=t)}),c()()}if(i&2){let n=p().$implicit;l(1),s("ngModel",n.selected)}}var wt=i=>({"bg-gradient-warning":i});function Tt(i,a){if(i&1){let n=f();F(0),r(1,"td",40),m(2),P(3,"number"),c(),r(4,"td",41),g("click",function(){let o=h(n).$implicit,d=p(2).$implicit,_=p().$implicit,S=p();return u(S.openTableDialog(d,_,o))}),r(5,"span",42),m(6),P(7,"number"),c(),r(8,"a",43),g("click",function(t){return t==null?null:t.stopPropagation()}),x(9,"i",29),c()(),M()}if(i&2){let n=a.$implicit;l(2),I(" ",v(3,4,n.PriceExpected)," "),l(2),s("ngClass",y(8,wt,n.Price!=n.PriceExpected)),l(2),I(" ",v(7,6,n.Price)," "),l(2),s("href",n.Url,E)}}function Dt(i,a){i&1&&(r(0,"td",44),m(1,"X"),c(),r(2,"td",44),m(3,"X"),c())}function Vt(i,a){if(i&1&&(F(0),C(1,Tt,10,10,"ng-container",38)(2,Dt,4,0,"ng-template",null,39,Y),M()),i&2){let n=a.$implicit,e=H(3),t=p().$implicit,o=p(2);l(1),s("ngIf",o.getItemFromChannel(t,n.ID))("ngIfElse",e)}}var Et=i=>({"text-decoration-line-through":i}),Ye=i=>[i];function Ft(i,a){if(i&1&&(r(0,"tr"),C(1,It,11,9,"ng-container",23),r(2,"td",24),m(3),c(),r(4,"td",25)(5,"span",26),m(6),c(),r(7,"span",27)(8,"a",28),x(9,"i",29),c()()(),C(10,yt,2,1,"ng-template",16)(11,Vt,4,2,"ng-container",17),c()),i&2){let n=a.$implicit,e=a.index,t=p(2);l(1),s("ngIf",e==0),l(2),T(n==null?null:n.Model),l(1),s("matTooltip",n.isDiscontinued?t.discontinuedVariantMsg:""),l(1),s("ngClass",y(8,Et,n.isDiscontinued)),l(1),T(n==null?null:n.Code),l(2),s("href","https://"+t.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),E),l(2),s("ngxPermissionsOnly",y(10,Ye,t.rolePriceEdit)),l(1),s("ngForOf",t.channelOptions)}}function Mt(i,a){if(i&1&&(r(0,"tbody"),C(1,Ft,12,12,"tr",17),c()),i&2){let n=a.$implicit;l(1),s("ngForOf",n.Variants)}}var Ze=(()=>{let a=class a{constructor(e,t,o,d,_){this.http=e,this.toastr=t,this.dialog=o,this.productService=d,this.biggerPictureService=_,this.searchFilter=new Ne,this.products=[],this.checkboxState=!1,this.rolePriceEdit=le.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.initPageLoader(),this.filterTypeOptions=[{Key:O.ALL,Value:"All"},{Key:O.DIFFERENCE,Value:"Difference"}],this.filterType=O.ALL,this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.hostName=d.getHostName()}initPageLoader(){this.http.post("/api/PriceLoader/LoadMultiple",{}).subscribe(e=>{this.channelOptions=e.Options.Channel,this.searchFilter=e.Filter,this.onFilter()})}onSelectAllData(){this.products=this.products.map(e=>(e.Variants&&(e.Variants=e.Variants.map(t=>(t.selected=this.checkboxState,t))),e))}onFilter(e){let t={text:e,filterModel:this.filterType,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount};this.http.post("/api/Price/GetOutletPrice",t).pipe(q(o=>(o.Data=o.Data.map(d=>(d.Variants&&(d.Variants=d.Variants.map(_=>(_.isDiscontinued=_.Discontinued=="Yes",_))),d)),o.Data))).subscribe(o=>{this.products=o})}updatePrice(){let e=this.productService.selectedVariantProduct(this.products);if(e.length>0){let t=e.map(_=>_.ID),d={ListChannelID:this.channelOptions.filter(_=>_.selected).map(_=>_.ID),ListID:t};this.http.post("/api/Price/UpdateChannelOutletPrice",d).subscribe({next:_=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+d.ListID.length+" items in "+d.ListChannelID.length+" channels","Success")},error:_=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(e=>(e.selected=!1,e))}getItemFromChannel(e,t){return e.Channel.find(o=>o.ChannelID==t)}onUpdateItems(){let e=this.productService.selectedVariantProduct(this.products);this.dialog.open(he,{data:{selectedItems:e,channels:this.channelOptions},width:"600px"}).afterClosed().pipe(D(t=>w.IsNotEmpty(t))).subscribe(t=>{this.channelOptions=t,this.updatePrice()})}openTableDialog(e,t,o){let d=JSON.parse(JSON.stringify(e));this.dialog.open(ue,{data:{Name:t.Name,Variant:d,ChannelID:o?.ChannelID,Table:"price",ChannelItemID:o?.ChannelItemID}}).afterClosed().pipe(D(S=>w.IsNotEmpty(S))).subscribe(S=>{this.updateProductPrice(S,o)})}updateProductPrice(e,t){let o={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",o).subscribe(d=>{t.Price=o.Price;let _=this.productService.findChannelById(o.ID,this.channelOptions);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) inventory in ${_.Name} to ${o.Price}`,"Success")})}onZoomImage(e,t){this.biggerPictureService.openBiggerPicture(e,t)}};a.\u0275fac=function(t){return new(t||a)(b(j),b(B),b(K),b(G),b(de))},a.\u0275cmp=V({type:a,selectors:[["app-custom-channel-price"]],decls:30,vars:14,consts:[["headerTitle","Price Comparison",3,"pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit"],["container",""],["name","filterModel",3,"model","options","border","modelChange"],[1,"d-flex"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","5"],["scope","col","colspan","2","class","text-center border-bottom-0 border w-10 text-uppercase",4,"ngFor","ngForOf"],["scope","col","colspan","2",1,"text-center","w-20"],["scope","col",1,"text-start"],["scope","col",1,"text-start","w-10"],[3,"ngxPermissionsOnly"],[4,"ngFor","ngForOf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","w-10","text-uppercase"],["type","checkbox",3,"ngModel","ngModelChange"],[1,"text-end","border-top-0","border","w-10"],[4,"ngIf"],[1,"text-start","border-bottom"],["matTooltipPosition","above",1,"text-start","border-bottom",3,"matTooltip"],[3,"ngClass"],[1,"ms-2"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-center","border-bottom",3,"rowSpan"],[1,"mb-0","item-name"],[1,"border","rounded","w-img","cursor-pointer",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],[4,"ngIf","ngIfElse"],["elseCol",""],[1,"text-end","border"],[1,"text-center","border","pointer","cell-hover",3,"ngClass","click"],[1,"me-2"],["target","_blank",3,"href","click"],[1,"table-white","border","text-end",2,"color","red"]],template:function(t,o){t&1&&(r(0,"mainpanel",0),g("onSubmit",function(_){return o.onFilter(_)}),r(1,"filters")(2,"div",1)(3,"div")(4,"h6"),m(5,"Filter by"),c(),r(6,"radio-options",2),g("modelChange",function(_){return o.filterType=_}),c()()()(),r(7,"actions")(8,"div",3),C(9,Ct,3,0,"button",4),c()(),r(10,"content")(11,"div",5)(12,"div",6)(13,"div",7)(14,"div",8)(15,"table",9)(16,"thead",10)(17,"tr"),x(18,"th",11),C(19,ft,2,1,"th",12),c(),r(20,"tr")(21,"th",13),m(22,"Product"),c(),r(23,"th",14),m(24,"Variant"),c(),r(25,"th",15),m(26,"SKU"),c(),C(27,xt,2,1,"ng-template",16)(28,St,5,0,"ng-container",17),c()(),C(29,Mt,2,1,"tbody",17),c()()()()()()()),t&2&&(s("pageData",o.pageData)("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),l(6),s("model",o.filterType)("options",o.filterTypeOptions)("border",!0),l(3),s("ngIf",o.productService.hasSelectionVariant(o.products)),l(10),s("ngForOf",o.channelOptions),l(8),s("ngxPermissionsOnly",y(12,Ye,o.rolePriceEdit)),l(1),s("ngForOf",o.channelOptions),l(1),s("ngForOf",o.products))},dependencies:[$,A,U,ie,k,N,z,pe,fe,ce,R],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{font-weight:400;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}"]});let i=a;return i})();function kt(i,a){if(i&1){let n=f();r(0,"button",8),g("click",function(){h(n);let t=p(2).ngIf,o=p();return u(o.openScanDialog(t))}),x(1,"i",9),m(2," Scan Channel "),c()}}function Nt(i,a){if(i&1){let n=f();r(0,"button",10),g("click",function(){h(n);let t=p().ngIf,o=p(2);return u(o.updateStock(t))}),x(1,"i",11),m(2," Update "),c()}}function Ot(i,a){if(i&1&&(r(0,"actions")(1,"div",5)(2,"div"),C(3,kt,3,0,"button",6)(4,Nt,3,0,"button",7),c()()()),i&2){let n=a.ngIf,e=p(2);l(3),s("ngIf",!e.productService.hasSelectionVariant(n)),l(1),s("ngIf",e.productService.hasSelectionVariant(n))}}function $t(i,a){if(i&1){let n=f();r(0,"th")(1,"input",32),g("change",function(t){h(n);let o=p().ngIf,d=p(2);return u(d.onSelectAllSKU(t.target.checked,o))}),c()()}}function At(i,a){if(i&1){let n=f();r(0,"input",52),g("ngModelChange",function(t){h(n);let o=p(4).$implicit;return u(o.selected=t)})("ngModelChange",function(){h(n);let t=p(4).$implicit,o=p(3);return u(o.onCheckboxStateProduct(t))}),c()}if(i&2){let n=p(4).$implicit;s("ngModel",n.selected)}}function Ut(i,a){if(i&1&&C(0,At,1,1,"input",51),i&2){let n=p(2).$implicit,e=p().$implicit;s("ngIf",n.Inventory>=0||e.Variants.length>1)}}function Rt(i,a){if(i&1){let n=f();r(0,"img",53),g("click",function(t){h(n);let o=p(3).$implicit,d=p(3);return u(d.onZoomImage(t,o==null?null:o.ImageUrl))}),c()}if(i&2){let n=p(3).$implicit;ee("src",n.ThumbnailUrl,E)}}function Lt(i,a){i&1&&x(0,"img",54)}var ve=i=>[i];function Bt(i,a){if(i&1&&(F(0),r(1,"td",45)(2,"div",46),C(3,Ut,1,1,"ng-template",21)(4,Rt,1,1,"img",47)(5,Lt,1,0,"ng-template",null,48,Y),c()(),r(7,"td",49)(8,"span",50),m(9),c(),x(10,"br"),r(11,"small"),m(12),c()(),M()),i&2){let n=H(6),e=p(2).$implicit,t=p(3);l(1),s("rowSpan",e.Variants.length),l(2),s("ngxPermissionsOnly",y(7,ve,t.rolePriceEdit)),l(1),s("ngIf",e.ThumbnailUrl)("ngIfElse",n),l(3),s("rowSpan",e.Variants.length),l(2),T(e.Name),l(3),I("(",e.Category,")")}}function jt(i,a){if(i&1){let n=f();r(0,"input",57),g("ngModelChange",function(t){h(n);let o=p(2).$implicit;return u(o.selected=t)}),c()}if(i&2){let n=p(2).$implicit;s("ngModel",n.selected)}}function zt(i,a){if(i&1&&(r(0,"td",55),C(1,jt,1,1,"input",56),c()),i&2){let n=p().$implicit;l(1),s("ngIf",n.Inventory>=0)}}function Kt(i,a){if(i&1){let n=f();r(0,"div",58),g("click",function(){h(n);let t=p().$implicit,o=p().$implicit,d=p(2).ngIf,_=p();return u(_.openTableDialog(t,o,d))}),m(1),P(2,"number"),c()}if(i&2){let n=p().$implicit;l(1),I(" ",v(2,1,n.Channel[0]==null?null:n.Channel[0].Price)," ")}}var Gt=i=>({"text-decoration-line-through":i}),Jt=i=>({"bg-gradient-warning":i});function Ht(i,a){if(i&1){let n=f();r(0,"tr"),C(1,Bt,13,9,"ng-container",4),r(2,"td",19),m(3),c(),r(4,"td",33)(5,"span",34),m(6),c(),r(7,"span",35)(8,"a",36),x(9,"i",37),c()()(),C(10,zt,2,1,"ng-template",21),r(11,"td",22),m(12),P(13,"number"),c(),r(14,"td",38),C(15,Kt,3,3,"div",39),c(),r(16,"td")(17,"div",40)(18,"div",41)(19,"a",36),x(20,"i",42),c(),m(21," \xA0\xA0 "),r(22,"span",43),g("click",function(){let o=h(n).$implicit,d=p(4);return u(d.refreshPrice(o))}),x(23,"i",44),c()()()()()}if(i&2){let n=a.$implicit,e=a.index,t=p(4);l(1),s("ngIf",e==0),l(2),T(n.Model),l(1),s("matTooltip",n.isDiscontinued?t.discontinuedVariantMsg:""),l(1),s("ngClass",y(13,Gt,n.isDiscontinued)),l(1),I(" ",n.Code," "),l(2),s("href","https://"+t.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),E),l(2),s("ngxPermissionsOnly",y(15,ve,t.rolePriceEdit)),l(2),I(" ",v(13,11,n.UnitPrice)," "),l(2),s("ngClass",y(17,Jt,n.UnitPrice!=(n.Channel[0]==null?null:n.Channel[0].Price))),l(1),s("ngIf",n.Channel.length>0),l(4),s("href",n.Channel[0]==null?null:n.Channel[0].Url,E)}}function Yt(i,a){if(i&1&&(F(0),C(1,Ht,24,19,"tr",26),M()),i&2){let n=a.$implicit;l(1),s("ngForOf",n.Variants)}}function Zt(i,a){if(i&1){let n=f();r(0,"span",58),g("click",function(){h(n);let t=p(3);return u(t.getRowCount())}),r(1,"i",59),m(2,"?"),c()()}}function qt(i,a){if(i&1&&(r(0,"span"),m(1),P(2,"number"),c()),i&2){let n=a.ngIf;l(1),T(v(2,1,n.Total))}}function Xt(i,a){if(i&1){let n=f();r(0,"a",63),g("click",function(){h(n);let t=p(4);return u(t.onNextPage())}),x(1,"i",64),m(2," Next"),c()}}function Qt(i,a){if(i&1){let n=f();r(0,"a",65),g("click",function(){h(n);let t=p(4);return u(t.onLastPage())}),x(1,"i",66),m(2," Last"),c()}}function Wt(i,a){if(i&1&&(r(0,"div",60),C(1,Xt,3,0,"a",61)(2,Qt,3,0,"a",62),c()),i&2){let n=p(3);l(1),s("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage),l(1),s("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage)}}function en(i,a){if(i&1){let n=f();r(0,"content")(1,"div",12)(2,"div",13)(3,"table",14)(4,"thead",15)(5,"tr")(6,"th",16),m(7," Product "),r(8,"div")(9,"mat-slide-toggle",17),g("ngModelChange",function(t){h(n);let o=p(2);return u(o.toggleDifferentInventory=t)})("toggleChange",function(){h(n);let t=p(2);return u(t.onToggleDifferentInventory())}),r(10,"small",18),m(11,"FILTER DIFFERENT PRICE"),c()()()(),r(12,"th",19),m(13,"Variant"),c(),r(14,"th",20),m(15,"SKU"),c(),C(16,$t,2,0,"ng-template",21),r(17,"th",22),m(18,"POS"),c(),r(19,"th",22)(20,"div",23),g("click",function(){h(n);let t=p(2);return u(t.onChangeChannel())}),x(21,"img",24),m(22),c()(),x(23,"th",25),c()(),r(24,"tbody"),C(25,Yt,2,1,"ng-container",26),c()(),r(26,"div",27)(27,"div",28)(28,"div",29),m(29),P(30,"number"),C(31,Zt,3,0,"span",30)(32,qt,3,3,"span",4),P(33,"async"),m(34),c()(),C(35,Wt,3,2,"div",31),c()()()()}if(i&2){let n=a.ngIf,e=p(2);l(9),s("ngModel",e.toggleDifferentInventory),l(7),s("ngxPermissionsOnly",y(15,ve,e.rolePriceEdit)),l(4),s("matTooltip","Change "+(e.selectedChannel==null?null:e.selectedChannel.Name)),l(1),s("src",e.selectedChannel.logo,E),l(1),I(" ",e.selectedChannel!=null&&e.selectedChannel.Name?e.selectedChannel==null?null:e.selectedChannel.Name:"Choose Channel ..."," "),l(3),s("ngForOf",n),l(4),I(" Showing 1 - ",v(30,11,n==null?null:n.length)," of "),l(2),s("ngIf",e.paginationService.hideCount),l(1),s("ngIf",v(33,13,!e.paginationService.hideCount&&e.allDataCount$)),l(2),I(" records ~ ",e.paginationService.footerPageNumber," Page "),l(1),s("ngIf",n.length>0)}}function tn(i,a){if(i&1){let n=f();r(0,"mainpanel",1),g("textChange",function(t){h(n);let o=p();return u(o.searchFilter.text=t)})("onSubmit",function(){h(n);let t=p();return u(t.search())}),r(1,"filters")(2,"div",2)(3,"div")(4,"label"),m(5,"Page Number"),c(),r(6,"input",3),g("ngModelChange",function(t){h(n);let o=p();return u(o.searchFilter.PageNumber=t)}),c()(),r(7,"div")(8,"label"),m(9,"Page Size"),c(),r(10,"input",3),g("ngModelChange",function(t){h(n);let o=p();return u(o.searchFilter.RowCount=t)}),c()()()(),C(11,Ot,5,2,"actions",4),P(12,"async"),C(13,en,36,17,"content",4),P(14,"async"),c()}if(i&2){let n=p();s("headerTitle",n.pageTitle)("text",n.searchFilter.text),l(6),s("ngModel",n.searchFilter.PageNumber),l(4),s("ngModel",n.searchFilter.RowCount),l(1),s("ngIf",v(12,6,n.data$)),l(2),s("ngIf",v(14,8,n.data$))}}var qe=(()=>{let a=class a{constructor(e,t,o,d,_,S,We){this.http=e,this.paginationService=t,this.toastr=o,this.dialog=d,this.productService=_,this.biggerPictureService=S,this.inventoryService=We,this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.allDataCountEndpoint="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=le.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.hostName=this.productService.getHostName(),this.data$=this.paginationService.data$.pipe(be(1),q(et=>et.map(Z=>(Z.Variants&&(Z.Variants=Z.Variants.map(xe=>(xe.isDiscontinued=xe.Discontinued=="Yes",xe))),Z))))}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe(X(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=O.ALL,this.paginationService.reloadPagination(this.searchFilter),this.channelOptions=e.Options.Channel,this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=O.ALL:this.searchFilter.filterModel=O.DIFFERENCE,this.search()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(t=>(t.selected=e.selected,t))}openScanDialog(e){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=w.GuidEMpty,this.dialog.open(me,{data:{filter:t,channelOptions:e.Options.Channel},width:"600px"}).afterClosed().pipe(D(o=>w.IsNotEmpty(o))).subscribe(o=>{this.searchFilter.ChannelID=o.ChannelID,this.searchFilter.ScanFull=o.ScanFull,this.searchFilter.UpdatedProduct=o.UpdatedProduct,this.searchFilter.Async=o.Async,this.scanAll(e)})}scanAll(e){let t=this.productService.findChannelById(this.searchFilter.ChannelID,e.Options.Channel);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(o=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.initPageLoader(),this.toastr.success(`Successfully scanned from ${t?.Name}`,"Success"))})}updateStock(e){let o=this.productService.selectedVariantProduct(e).map(_=>({ID:_.ID,ChannelID:_.Channel[0].ChannelID,Code:_.Code,Price:_.UnitPrice})),d={ListChannelID:[this.searchFilter.ChannelID],ListPrice:o};this.http.post("/api/Price/UpdateChannel",d).subscribe(_=>{this.search(),this.handlingUpdateStock(_.Response)})}handlingUpdateStock(e){if(e.success_list.length>0||e.failure_list.length>0){let t=e.failure_list,o=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",o,t)}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let t={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",t).subscribe(o=>{this.toastr.success("Successfully updated","Success"),this.search()})}search(){this.paginationService.reloadPagination(this.searchFilter)}getRowCount(){this.paginationService.hideCount=!1,this.allDataCount$=this.http.post(`/API/${this.allDataCountEndpoint}`,this.searchFilter)}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}onLastPage(){this.http.post(`/API/${this.allDataCountEndpoint}`,this.searchFilter).subscribe({next:e=>{this.paginationService.getAllData(this.searchFilter,e.Total)}})}openTableDialog(e,t,o){let d=JSON.parse(JSON.stringify(e));this.dialog.open(ue,{data:{Name:t.Name,Variant:d,ChannelID:d?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:d?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(D(S=>w.IsNotEmpty(S))).subscribe(S=>{this.updateItemAfterDialog(S,o,e)})}updateItemAfterDialog(e,t,o){let d={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",d).subscribe(_=>{let S=this.productService.findChannelById(d.ID,t.Options.Channel);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) inventory in ${S.Name} to ${d.Price}`,"Success"),o.Channel[0]&&(o.Channel[0].Price=d.Price)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID),this.selectedChannel&&(this.selectedChannel.logo=w.getChannelLogoByTypeId(this.selectedChannel.TypeID))}onChangeChannel(){this.dialog.open(Be,{data:{channelOptions:this.channelOptions,selectedChannel:this.selectedChannel}}).afterClosed().pipe(D(e=>w.IsNotEmpty(e))).subscribe(e=>{this.selectedChannel=e,this.searchFilter.ChannelID=e.ID,this.search()})}onSelectAllSKU(e,t){t=t.map(o=>(o.Variants=o.Variants.map(d=>(d.selected=e,d)),o))}onZoomImage(e,t){this.biggerPictureService.openBiggerPicture(e,t)}ngOnDestroy(){this.paginationService.destroy()}};a.\u0275fac=function(t){return new(t||a)(b(j),b(_e),b(B),b(K),b(G),b(de),b(Ce))},a.\u0275cmp=V({type:a,selectors:[["app-price-single-channel"]],decls:2,vars:3,consts:[[3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[3,"headerTitle","text","textChange","onSubmit"],["container",""],["type","number",3,"ngModel","ngModelChange"],[4,"ngIf"],[1,"d-flex"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["class","btn btn-success",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModel","ngModelChange","toggleChange"],[1,"fw-bold"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["matTooltipPosition","above",1,"d-inline-block","text-truncate","mt-3","cursor-pointer",2,"max-width","114px",3,"matTooltip","click"],[2,"width","16px",3,"src"],[2,"width","4%"],[4,"ngFor","ngForOf"],[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"],["style","cursor:pointer",3,"click",4,"ngIf"],["class","btn-group",4,"ngIf"],["type","checkbox",1,"me-3",3,"change"],["matTooltipPosition","above",1,"text-end",3,"matTooltip"],[3,"ngClass"],[1,"ms-2"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-external-link-alt"],[1,"text-end",3,"ngClass"],["style","cursor: pointer;",3,"click",4,"ngIf"],[1,"row"],[1,"col-12","ps-0","d-flex","justify-content-between"],[1,"fas","external-link-custom","fa-lg","fa-external-link-alt"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],["class","border rounded w-img cursor-pointer","style","margin-left: 20px",3,"src","click",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],["type","checkbox","class","me-3",3,"ngModel","ngModelChange",4,"ngIf"],["type","checkbox",1,"me-3",3,"ngModel","ngModelChange"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"align-middle"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],["type","checkbox",3,"ngModel","ngModelChange"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],["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(t,o){t&1&&(C(0,tn,15,10,"mainpanel",0),P(1,"async")),t&2&&s("ngIf",v(1,1,o.loader$))},dependencies:[$,A,U,oe,ae,ie,k,N,z,Re,pe,ce,te,R],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"]});let i=a;return i})();var Xe=(()=>{let a=class a{constructor(){this.priceTabs=[{Title:"Single Channel Comparison",Url:"/menu/price/SingleChannel"},{Title:"Multi Channel Comparison",Url:"/menu/price/pos"},{Title:"Custom Channel Price",Url:"/menu/price/OutletPrice"}]}};a.\u0275fac=function(t){return new(t||a)},a.\u0275cmp=V({type:a,selectors:[["app-price"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,o){t&1&&(r(0,"nav",0)(1,"div",1)(2,"div"),x(3,"nav-tab",2),c()()(),x(4,"router-outlet")),t&2&&(l(3),s("Tabs",o.priceTabs))},dependencies:[Me,we]});let i=a;return i})();var nn=[{path:"",component:Xe,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",component:He,canActivate:[se],data:{title:"Global Price Comparison"}},{path:"OutletPrice",component:Ze,canActivate:[se],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",component:qe,canActivate:[se],data:{title:"Price Single Channel Comparison"}}]}],Qe=(()=>{let a=class a{};a.\u0275fac=function(t){return new(t||a)},a.\u0275mod=W({type:a}),a.\u0275inj=Q({imports:[L,ne.forChild(nn)]});let i=a;return i})();var ui=(()=>{let a=class a{};a.\u0275fac=function(t){return new(t||a)},a.\u0275mod=W({type:a}),a.\u0275inj=Q({providers:[Ce],imports:[L,re,ke,Fe,ne,Ve,Qe,Te,Le,Ue,Ee,fe,ge,De.forChild()]});let i=a;return i})();export{ui as PriceModule};
1
+ import{a as Ne}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-KTBPHH7N.js";import{a as O,b as ue,c as ge,d as Ce}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-NTY552OQ.js";import{a as he,b as Be}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-EHWPM4BE.js";import{b as Ue}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-IYRCZVA4.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-RHYO2A6O.js";import{a as Re,b as Le}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-7KE42BE5.js";import{a as le}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-SINQ7SXI.js";import{a as _e}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-W6QK3KI2.js";import{a as me}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-NJI6OAOU.js";import{a as G}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-JW6NHBN5.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-ZVHCE4K4.js";import{c as K}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-C7F32KU3.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-PP4ELWXY.js";import{a as Me,b as ke}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-MAVB5XKB.js";import{b as B,e as j}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-HUTPG746.js";import{b as ce,c as De}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-PSWRS2QZ.js";import{a as de}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-2CW5UYLD.js";import{a as Oe,b as $e,c as Ae}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-ZQL3IYZ4.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-LX6C545M.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-NG6JQWVZ.js";import{d as Ve}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-O3ASI5PY.js";import{a as se}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-23JYSN6Q.js";import{t as pe,u as Ee,v as z,w as Fe}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-WZRJRVH6.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-LYFRN35D.js";import{b as ie,c as oe,h as k,k as N,m as ae,u as re,v as Te}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-UREGZMHY.js";import{c as w}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-5TEZF6KQ.js";import{$a as x,B as D,Cb as P,Db as v,Fa as l,Ga as b,Hc as we,Ja as Ie,Lb as Y,Lc as ne,Oa as s,Q as be,Ua as C,X,Xb as $,Za as r,Zb as A,_a as c,_b as U,aa as Q,ab as F,bb as M,bc as te,db as f,ea as V,ec as R,fa as W,fc as L,hb as g,ja as h,jb as p,ka as u,mb as ee,ob as H,pb as m,q,qb as T,rb as I,ub as ye,wb as y,za as E}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-TIWU4GET.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-4EVRTQJX.js";function nt(i,a){if(i&1){let n=f();r(0,"button",18),g("click",function(){h(n);let t=p(3);return u(t.openScanDialog())}),x(1,"i",19),m(2," Scan Channel "),c()}}function it(i,a){if(i&1){let n=f();r(0,"button",20),g("click",function(){h(n);let t=p().ngIf,o=p(2);return u(o.onUpdateItems(t))}),x(1,"i",21),m(2," Update "),c()}}function ot(i,a){if(i&1&&(r(0,"div"),C(1,nt,3,0,"button",16)(2,it,3,0,"button",17),c()),i&2){let n=a.ngIf,e=p(2);l(1),s("ngIf",!e.productService.hasSelectionVariant(n)),l(1),s("ngIf",e.productService.hasSelectionVariant(n))}}function at(i,a){if(i&1){let n=f();r(0,"div",22)(1,"app-table",23),g("onToggle",function(t){h(n);let o=p(2);return u(o.onShowDifferencePrice(t))})("onSubmit",function(t){h(n);let o=p(2);return u(o.updatePriceByVariant(t))}),P(2,"async"),c()()}if(i&2){let n=p().ngIf,e=p();l(1),s("showProductToggle",!0)("data",v(2,4,e.paginationService.data$))("channel",n.Options.Channel)("filter",n.Filter)}}function rt(i,a){if(i&1){let n=f();r(0,"span",24),g("click",function(){h(n);let t=p(2);return u(t.getRowCount())}),r(1,"i",25),m(2,"?"),c()()}}function lt(i,a){if(i&1&&(r(0,"span"),m(1),P(2,"number"),c()),i&2){let n=a.ngIf;l(1),T(v(2,1,n))}}function ct(i,a){if(i&1){let n=f();r(0,"a",26),g("click",function(){h(n);let t=p(2);return u(t.onNextPage())}),x(1,"i",27),m(2," Next"),c()}}function st(i,a){if(i&1){let n=f();r(0,"a",28),g("click",function(){h(n);let t=p(2);return u(t.onLastPage())}),x(1,"i",29),m(2," Last"),c()}}function pt(i,a){if(i&1){let n=f();r(0,"mainpanel",1),g("onSubmit",function(t){h(n);let o=p();return u(o.onSearch(t))}),r(1,"actions")(2,"div",2),C(3,ot,3,2,"div",3),P(4,"async"),c()(),r(5,"filters")(6,"div",4)(7,"div")(8,"label"),m(9,"Page Number"),c(),r(10,"input",5),g("ngModelChange",function(t){h(n);let o=p();return u(o.searchFilter.PageNumber=t)}),c()(),r(11,"div")(12,"label"),m(13,"Page Size"),c(),r(14,"input",5),g("ngModelChange",function(t){h(n);let o=p();return u(o.searchFilter.RowCount=t)}),c()()()(),r(15,"content")(16,"div",6)(17,"div",7),C(18,at,3,6,"div",8),P(19,"async"),c(),r(20,"div",9)(21,"div",10)(22,"div",11),m(23),P(24,"number"),P(25,"async"),C(26,rt,3,0,"span",12)(27,lt,3,3,"span",3),P(28,"async"),m(29),c()(),r(30,"div",13),C(31,ct,3,0,"a",14)(32,st,3,0,"a",15),c()()()()()}if(i&2){let n=p(),e;s("pageData",n.pageData)("textButton","Search"),l(3),s("ngIf",v(4,12,n.paginationService.data$)),l(7),s("ngModel",n.searchFilter.PageNumber),l(4),s("ngModel",n.searchFilter.RowCount),l(4),s("ngIf",v(19,14,n.paginationService.data$)),l(5),I(" Showing 1 - ",v(24,16,(e=v(25,18,n.paginationService.data$))==null?null:e.length)," of "),l(3),s("ngIf",n.paginationService.hideCount),l(1),s("ngIf",!n.paginationService.hideCount&&v(28,20,n.allDataCount$)),l(2),I(" records ~ ",n.paginationService.footerPageNumber," Page "),l(2),s("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage),l(1),s("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage)}}var He=(()=>{let a=class a{constructor(e,t,o,d,_){this.http=e,this.toastr=t,this.dialog=o,this.paginationService=d,this.productService=_,this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.filterOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Price",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!0},{Title:"Price Realtime",Url:"/menu/price/realtime",Active:!1}]}}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.getDataAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe(X(e=>{this.channelOptions=e.Options.Channel,e.Filter={PageNumber:e.Filter.PageNumber,RowCount:e.Filter.RowCount,filterModel:1},this.searchFilter=e.Filter,this.paginationService.reloadPagination(this.searchFilter)}))}onShowDifferencePrice(e){this.searchFilter.filterModel=1,e&&(this.searchFilter.filterModel=3),this.paginationService.reloadPagination(this.searchFilter)}onSearch(e){this.searchFilter.text=e,this.paginationService.reloadPagination(this.searchFilter)}openScanDialog(){this.searchFilter.ChannelID=w.GuidEMpty;let e=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(me,{data:{filter:e,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(D(o=>w.IsNotEmpty(o))).subscribe(o=>{this.searchFilter.ChannelID=o.ChannelID,this.searchFilter.ScanFull=o.ScanFull,this.searchFilter.UpdatedProduct=o.UpdatedProduct,this.searchFilter.Async=o.Async,this.scanAll()})}scanAll(){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{let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.initPageLoader(),this.productService.successToastrScanAllProduct(e,t,!this.searchFilter.UpdatedProduct)}})}updatePrice(e){let t=this.productService.selectedVariantProduct(e);if(t.length>0){let d=t.map(S=>({ID:S.ID,Code:S.Code,Price:S.UnitPrice}));var o=this.channelOptions.filter(S=>S.selected).map(S=>S.ID);let _={ListChannelID:o,ListPrice:d};this.http.post("/api/Price/UpdateChannel",_).subscribe(S=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+_.ListPrice.length+" items in "+_.ListChannelID.length+" channels","Success")})}}updatePriceByVariant(e){let t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:e.Price-0,VariantID:e.ID};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(o=>{let d=this.productService.findChannelById(t.ID,this.channelOptions);this.toastr.success("Successfully updated "+e.ItemName+"("+e.VarName+") price in "+d.Name+" to "+t.Price,"Success"),this.paginationService.reloadPagination(this.searchFilter)})}onUpdateItems(e){let t=this.productService.selectedVariantProduct(e);this.dialog.open(he,{data:{selectedItems:t,channels:this.channelOptions},width:"600px"}).afterClosed().pipe(D(o=>o!==void 0)).subscribe(o=>{this.channelOptions=o,this.updatePrice(e)})}getRowCount(){this.paginationService.hideCount=!1,this.allDataCount$=this.http.post(`/api/${this.rowCountAPI}`,{})}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:e=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,e)}})}ngOnDestroy(){this.paginationService.destroy()}};a.\u0275fac=function(t){return new(t||a)(b(j),b(B),b(K),b(_e),b(G))},a.\u0275cmp=V({type:a,selectors:[["app-price-pos-channel"]],decls:2,vars:3,consts:[["headerTitle","Price Comparison",3,"pageData","textButton","onSubmit",4,"ngIf"],["headerTitle","Price Comparison",3,"pageData","textButton","onSubmit"],[1,"d-flex"],[4,"ngIf"],["container",""],["type","number",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],["class","col-md-12",4,"ngIf"],[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"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"showProductToggle","data","channel","filter","onToggle","onSubmit"],[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(t,o){t&1&&(C(0,pt,33,22,"mainpanel",0),P(1,"async")),t&2&&s("ngIf",v(1,1,o.loader$))},dependencies:[U,oe,ae,k,N,z,ge,te,R],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let i=a;return i})();function mt(i,a){if(i&1&&(r(0,"mat-radio-button",3),m(1),c()),i&2){let n=a.$implicit,e=a.index,t=p();s("value",n.Key)("name",t.name)("title",t.tooltipsText[e]?t.tooltipsText[e]:""),l(1),I(" ",n.Value,"")}}var dt=i=>({"border-0 rounded":i}),fe=(()=>{let a=class a{constructor(){this.modelChange=new Ie,this.border=!1,this.tooltipsText=[]}change(e){this.modelChange.emit(e)}};a.\u0275fac=function(t){return new(t||a)},a.\u0275cmp=V({type:a,selectors:[["radio-options"]],inputs:{model:"model",options:"options",border:"border",name:"name",tooltipsText:"tooltipsText"},outputs:{modelChange:"modelChange"},standalone:!0,features:[ye],decls:3,vars:5,consts:[[1,"form-control","h-100",3,"ngClass"],[3,"ngModel","ngModelChange"],["class","me-5","data-toggle","tooltip","data-placement","right",3,"value","name","title",4,"ngFor","ngForOf"],["data-toggle","tooltip","data-placement","right",1,"me-5",3,"value","name","title"]],template:function(t,o){t&1&&(r(0,"div",0)(1,"mat-radio-group",1),g("ngModelChange",function(_){return o.change(_)}),C(2,mt,2,4,"mat-radio-button",2),c()()),t&2&&(s("ngClass",y(3,dt,o.border==!1)),l(1),s("ngModel",o.model),l(1),s("ngForOf",o.options))},dependencies:[L,$,A,Ae,Oe,$e,re,k,N],styles:[".mat-radio-label{margin-top:auto;margin-bottom:auto}"]});let i=a;return i})();function Ct(i,a){if(i&1){let n=f();r(0,"button",18),g("click",function(){h(n);let t=p();return u(t.onUpdateItems())}),x(1,"i",19),m(2," Update "),c()}}function ft(i,a){if(i&1&&(r(0,"th",20),m(1),c()),i&2){let n=a.$implicit;l(1),T(n.Name)}}function xt(i,a){if(i&1){let n=f();r(0,"th")(1,"input",21),g("ngModelChange",function(t){h(n);let o=p();return u(o.checkboxState=t)})("ngModelChange",function(){h(n);let t=p();return u(t.onSelectAllData())}),c()()}if(i&2){let n=p();l(1),s("ngModel",n.checkboxState)}}function St(i,a){i&1&&(F(0),r(1,"th",22),m(2," Expected (POS) "),c(),r(3,"th",22),m(4," Channel "),c(),M())}function Pt(i,a){if(i&1){let n=f();r(0,"img",35),g("click",function(t){h(n);let o=p(3).$implicit,d=p();return u(d.onZoomImage(t,o==null?null:o.ImageUrl))}),c()}if(i&2){let n=p(3).$implicit;ee("src",n==null?null:n.ImageUrl,E)}}function vt(i,a){i&1&&x(0,"img",36)}var bt=i=>({"border-bottom":i});function It(i,a){if(i&1&&(F(0),r(1,"td",30),C(2,Pt,1,1,"img",31)(3,vt,1,0,"ng-template",null,32,Y),c(),r(5,"td",33)(6,"h5",34),m(7),c(),x(8,"br"),r(9,"small"),m(10),c()(),M()),i&2){let n=H(4),e=p().index,t=p().$implicit,o=p();l(1),s("rowSpan",t==null?null:t.Variants.length)("ngClass",y(7,bt,e+1==o.products.length)),l(1),s("ngIf",t==null?null:t.ImageUrl)("ngIfElse",n),l(3),s("rowSpan",t==null?null:t.Variants.length),l(2),T(t==null?null:t.Name),l(3),I("(",t==null?null:t.Category,")")}}function yt(i,a){if(i&1){let n=f();r(0,"td",37)(1,"input",21),g("ngModelChange",function(t){h(n);let o=p().$implicit;return u(o.selected=t)}),c()()}if(i&2){let n=p().$implicit;l(1),s("ngModel",n.selected)}}var wt=i=>({"bg-gradient-warning":i});function Tt(i,a){if(i&1){let n=f();F(0),r(1,"td",40),m(2),P(3,"number"),c(),r(4,"td",41),g("click",function(){let o=h(n).$implicit,d=p(2).$implicit,_=p().$implicit,S=p();return u(S.openTableDialog(d,_,o))}),r(5,"span",42),m(6),P(7,"number"),c(),r(8,"a",43),g("click",function(t){return t==null?null:t.stopPropagation()}),x(9,"i",29),c()(),M()}if(i&2){let n=a.$implicit;l(2),I(" ",v(3,4,n.PriceExpected)," "),l(2),s("ngClass",y(8,wt,n.Price!=n.PriceExpected)),l(2),I(" ",v(7,6,n.Price)," "),l(2),s("href",n.Url,E)}}function Dt(i,a){i&1&&(r(0,"td",44),m(1,"X"),c(),r(2,"td",44),m(3,"X"),c())}function Vt(i,a){if(i&1&&(F(0),C(1,Tt,10,10,"ng-container",38)(2,Dt,4,0,"ng-template",null,39,Y),M()),i&2){let n=a.$implicit,e=H(3),t=p().$implicit,o=p(2);l(1),s("ngIf",o.getItemFromChannel(t,n.ID))("ngIfElse",e)}}var Et=i=>({"text-decoration-line-through":i}),Ye=i=>[i];function Ft(i,a){if(i&1&&(r(0,"tr"),C(1,It,11,9,"ng-container",23),r(2,"td",24),m(3),c(),r(4,"td",25)(5,"span",26),m(6),c(),r(7,"span",27)(8,"a",28),x(9,"i",29),c()()(),C(10,yt,2,1,"ng-template",16)(11,Vt,4,2,"ng-container",17),c()),i&2){let n=a.$implicit,e=a.index,t=p(2);l(1),s("ngIf",e==0),l(2),T(n==null?null:n.Model),l(1),s("matTooltip",n.isDiscontinued?t.discontinuedVariantMsg:""),l(1),s("ngClass",y(8,Et,n.isDiscontinued)),l(1),T(n==null?null:n.Code),l(2),s("href","https://"+t.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),E),l(2),s("ngxPermissionsOnly",y(10,Ye,t.rolePriceEdit)),l(1),s("ngForOf",t.channelOptions)}}function Mt(i,a){if(i&1&&(r(0,"tbody"),C(1,Ft,12,12,"tr",17),c()),i&2){let n=a.$implicit;l(1),s("ngForOf",n.Variants)}}var Ze=(()=>{let a=class a{constructor(e,t,o,d,_){this.http=e,this.toastr=t,this.dialog=o,this.productService=d,this.biggerPictureService=_,this.searchFilter=new Ne,this.products=[],this.checkboxState=!1,this.rolePriceEdit=le.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.initPageLoader(),this.filterTypeOptions=[{Key:O.ALL,Value:"All"},{Key:O.DIFFERENCE,Value:"Difference"}],this.filterType=O.ALL,this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.hostName=d.getHostName()}initPageLoader(){this.http.post("/api/PriceLoader/LoadMultiple",{}).subscribe(e=>{this.channelOptions=e.Options.Channel,this.searchFilter=e.Filter,this.onFilter()})}onSelectAllData(){this.products=this.products.map(e=>(e.Variants&&(e.Variants=e.Variants.map(t=>(t.selected=this.checkboxState,t))),e))}onFilter(e){let t={text:e,filterModel:this.filterType,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount};this.http.post("/api/Price/GetOutletPrice",t).pipe(q(o=>(o.Data=o.Data.map(d=>(d.Variants&&(d.Variants=d.Variants.map(_=>(_.isDiscontinued=_.Discontinued=="Yes",_))),d)),o.Data))).subscribe(o=>{this.products=o})}updatePrice(){let e=this.productService.selectedVariantProduct(this.products);if(e.length>0){let t=e.map(_=>_.ID),d={ListChannelID:this.channelOptions.filter(_=>_.selected).map(_=>_.ID),ListID:t};this.http.post("/api/Price/UpdateChannelOutletPrice",d).subscribe({next:_=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+d.ListID.length+" items in "+d.ListChannelID.length+" channels","Success")},error:_=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(e=>(e.selected=!1,e))}getItemFromChannel(e,t){return e.Channel.find(o=>o.ChannelID==t)}onUpdateItems(){let e=this.productService.selectedVariantProduct(this.products);this.dialog.open(he,{data:{selectedItems:e,channels:this.channelOptions},width:"600px"}).afterClosed().pipe(D(t=>w.IsNotEmpty(t))).subscribe(t=>{this.channelOptions=t,this.updatePrice()})}openTableDialog(e,t,o){let d=JSON.parse(JSON.stringify(e));this.dialog.open(ue,{data:{Name:t.Name,Variant:d,ChannelID:o?.ChannelID,Table:"price",ChannelItemID:o?.ChannelItemID}}).afterClosed().pipe(D(S=>w.IsNotEmpty(S))).subscribe(S=>{this.updateProductPrice(S,o)})}updateProductPrice(e,t){let o={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",o).subscribe(d=>{t.Price=o.Price;let _=this.productService.findChannelById(o.ID,this.channelOptions);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) inventory in ${_.Name} to ${o.Price}`,"Success")})}onZoomImage(e,t){this.biggerPictureService.openBiggerPicture(e,t)}};a.\u0275fac=function(t){return new(t||a)(b(j),b(B),b(K),b(G),b(de))},a.\u0275cmp=V({type:a,selectors:[["app-custom-channel-price"]],decls:30,vars:14,consts:[["headerTitle","Price Comparison",3,"pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit"],["container",""],["name","filterModel",3,"model","options","border","modelChange"],[1,"d-flex"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","5"],["scope","col","colspan","2","class","text-center border-bottom-0 border w-10 text-uppercase",4,"ngFor","ngForOf"],["scope","col","colspan","2",1,"text-center","w-20"],["scope","col",1,"text-start"],["scope","col",1,"text-start","w-10"],[3,"ngxPermissionsOnly"],[4,"ngFor","ngForOf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","w-10","text-uppercase"],["type","checkbox",3,"ngModel","ngModelChange"],[1,"text-end","border-top-0","border","w-10"],[4,"ngIf"],[1,"text-start","border-bottom"],["matTooltipPosition","above",1,"text-start","border-bottom",3,"matTooltip"],[3,"ngClass"],[1,"ms-2"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-center","border-bottom",3,"rowSpan"],[1,"mb-0","item-name"],[1,"border","rounded","w-img","cursor-pointer",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],[4,"ngIf","ngIfElse"],["elseCol",""],[1,"text-end","border"],[1,"text-center","border","pointer","cell-hover",3,"ngClass","click"],[1,"me-2"],["target","_blank",3,"href","click"],[1,"table-white","border","text-end",2,"color","red"]],template:function(t,o){t&1&&(r(0,"mainpanel",0),g("onSubmit",function(_){return o.onFilter(_)}),r(1,"filters")(2,"div",1)(3,"div")(4,"h6"),m(5,"Filter by"),c(),r(6,"radio-options",2),g("modelChange",function(_){return o.filterType=_}),c()()()(),r(7,"actions")(8,"div",3),C(9,Ct,3,0,"button",4),c()(),r(10,"content")(11,"div",5)(12,"div",6)(13,"div",7)(14,"div",8)(15,"table",9)(16,"thead",10)(17,"tr"),x(18,"th",11),C(19,ft,2,1,"th",12),c(),r(20,"tr")(21,"th",13),m(22,"Product"),c(),r(23,"th",14),m(24,"Variant"),c(),r(25,"th",15),m(26,"SKU"),c(),C(27,xt,2,1,"ng-template",16)(28,St,5,0,"ng-container",17),c()(),C(29,Mt,2,1,"tbody",17),c()()()()()()()),t&2&&(s("pageData",o.pageData)("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),l(6),s("model",o.filterType)("options",o.filterTypeOptions)("border",!0),l(3),s("ngIf",o.productService.hasSelectionVariant(o.products)),l(10),s("ngForOf",o.channelOptions),l(8),s("ngxPermissionsOnly",y(12,Ye,o.rolePriceEdit)),l(1),s("ngForOf",o.channelOptions),l(1),s("ngForOf",o.products))},dependencies:[$,A,U,ie,k,N,z,pe,fe,ce,R],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{font-weight:400;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}"]});let i=a;return i})();function kt(i,a){if(i&1){let n=f();r(0,"button",8),g("click",function(){h(n);let t=p(2).ngIf,o=p();return u(o.openScanDialog(t))}),x(1,"i",9),m(2," Scan Channel "),c()}}function Nt(i,a){if(i&1){let n=f();r(0,"button",10),g("click",function(){h(n);let t=p().ngIf,o=p(2);return u(o.updateStock(t))}),x(1,"i",11),m(2," Update "),c()}}function Ot(i,a){if(i&1&&(r(0,"actions")(1,"div",5)(2,"div"),C(3,kt,3,0,"button",6)(4,Nt,3,0,"button",7),c()()()),i&2){let n=a.ngIf,e=p(2);l(3),s("ngIf",!e.productService.hasSelectionVariant(n)),l(1),s("ngIf",e.productService.hasSelectionVariant(n))}}function $t(i,a){if(i&1){let n=f();r(0,"th")(1,"input",32),g("change",function(t){h(n);let o=p().ngIf,d=p(2);return u(d.onSelectAllSKU(t.target.checked,o))}),c()()}}function At(i,a){if(i&1){let n=f();r(0,"input",52),g("ngModelChange",function(t){h(n);let o=p(4).$implicit;return u(o.selected=t)})("ngModelChange",function(){h(n);let t=p(4).$implicit,o=p(3);return u(o.onCheckboxStateProduct(t))}),c()}if(i&2){let n=p(4).$implicit;s("ngModel",n.selected)}}function Ut(i,a){if(i&1&&C(0,At,1,1,"input",51),i&2){let n=p(2).$implicit,e=p().$implicit;s("ngIf",n.Inventory>=0||e.Variants.length>1)}}function Rt(i,a){if(i&1){let n=f();r(0,"img",53),g("click",function(t){h(n);let o=p(3).$implicit,d=p(3);return u(d.onZoomImage(t,o==null?null:o.ImageUrl))}),c()}if(i&2){let n=p(3).$implicit;ee("src",n.ThumbnailUrl,E)}}function Lt(i,a){i&1&&x(0,"img",54)}var ve=i=>[i];function Bt(i,a){if(i&1&&(F(0),r(1,"td",45)(2,"div",46),C(3,Ut,1,1,"ng-template",21)(4,Rt,1,1,"img",47)(5,Lt,1,0,"ng-template",null,48,Y),c()(),r(7,"td",49)(8,"span",50),m(9),c(),x(10,"br"),r(11,"small"),m(12),c()(),M()),i&2){let n=H(6),e=p(2).$implicit,t=p(3);l(1),s("rowSpan",e.Variants.length),l(2),s("ngxPermissionsOnly",y(7,ve,t.rolePriceEdit)),l(1),s("ngIf",e.ThumbnailUrl)("ngIfElse",n),l(3),s("rowSpan",e.Variants.length),l(2),T(e.Name),l(3),I("(",e.Category,")")}}function jt(i,a){if(i&1){let n=f();r(0,"input",57),g("ngModelChange",function(t){h(n);let o=p(2).$implicit;return u(o.selected=t)}),c()}if(i&2){let n=p(2).$implicit;s("ngModel",n.selected)}}function zt(i,a){if(i&1&&(r(0,"td",55),C(1,jt,1,1,"input",56),c()),i&2){let n=p().$implicit;l(1),s("ngIf",n.Inventory>=0)}}function Kt(i,a){if(i&1){let n=f();r(0,"div",58),g("click",function(){h(n);let t=p().$implicit,o=p().$implicit,d=p(2).ngIf,_=p();return u(_.openTableDialog(t,o,d))}),m(1),P(2,"number"),c()}if(i&2){let n=p().$implicit;l(1),I(" ",v(2,1,n.Channel[0]==null?null:n.Channel[0].Price)," ")}}var Gt=i=>({"text-decoration-line-through":i}),Jt=i=>({"bg-gradient-warning":i});function Ht(i,a){if(i&1){let n=f();r(0,"tr"),C(1,Bt,13,9,"ng-container",4),r(2,"td",19),m(3),c(),r(4,"td",33)(5,"span",34),m(6),c(),r(7,"span",35)(8,"a",36),x(9,"i",37),c()()(),C(10,zt,2,1,"ng-template",21),r(11,"td",22),m(12),P(13,"number"),c(),r(14,"td",38),C(15,Kt,3,3,"div",39),c(),r(16,"td")(17,"div",40)(18,"div",41)(19,"a",36),x(20,"i",42),c(),m(21," \xA0\xA0 "),r(22,"span",43),g("click",function(){let o=h(n).$implicit,d=p(4);return u(d.refreshPrice(o))}),x(23,"i",44),c()()()()()}if(i&2){let n=a.$implicit,e=a.index,t=p(4);l(1),s("ngIf",e==0),l(2),T(n.Model),l(1),s("matTooltip",n.isDiscontinued?t.discontinuedVariantMsg:""),l(1),s("ngClass",y(13,Gt,n.isDiscontinued)),l(1),I(" ",n.Code," "),l(2),s("href","https://"+t.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),E),l(2),s("ngxPermissionsOnly",y(15,ve,t.rolePriceEdit)),l(2),I(" ",v(13,11,n.UnitPrice)," "),l(2),s("ngClass",y(17,Jt,n.UnitPrice!=(n.Channel[0]==null?null:n.Channel[0].Price))),l(1),s("ngIf",n.Channel.length>0),l(4),s("href",n.Channel[0]==null?null:n.Channel[0].Url,E)}}function Yt(i,a){if(i&1&&(F(0),C(1,Ht,24,19,"tr",26),M()),i&2){let n=a.$implicit;l(1),s("ngForOf",n.Variants)}}function Zt(i,a){if(i&1){let n=f();r(0,"span",58),g("click",function(){h(n);let t=p(3);return u(t.getRowCount())}),r(1,"i",59),m(2,"?"),c()()}}function qt(i,a){if(i&1&&(r(0,"span"),m(1),P(2,"number"),c()),i&2){let n=a.ngIf;l(1),T(v(2,1,n.Total))}}function Xt(i,a){if(i&1){let n=f();r(0,"a",63),g("click",function(){h(n);let t=p(4);return u(t.onNextPage())}),x(1,"i",64),m(2," Next"),c()}}function Qt(i,a){if(i&1){let n=f();r(0,"a",65),g("click",function(){h(n);let t=p(4);return u(t.onLastPage())}),x(1,"i",66),m(2," Last"),c()}}function Wt(i,a){if(i&1&&(r(0,"div",60),C(1,Xt,3,0,"a",61)(2,Qt,3,0,"a",62),c()),i&2){let n=p(3);l(1),s("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage),l(1),s("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage)}}function en(i,a){if(i&1){let n=f();r(0,"content")(1,"div",12)(2,"div",13)(3,"table",14)(4,"thead",15)(5,"tr")(6,"th",16),m(7," Product "),r(8,"div")(9,"mat-slide-toggle",17),g("ngModelChange",function(t){h(n);let o=p(2);return u(o.toggleDifferentInventory=t)})("toggleChange",function(){h(n);let t=p(2);return u(t.onToggleDifferentInventory())}),r(10,"small",18),m(11,"FILTER DIFFERENT PRICE"),c()()()(),r(12,"th",19),m(13,"Variant"),c(),r(14,"th",20),m(15,"SKU"),c(),C(16,$t,2,0,"ng-template",21),r(17,"th",22),m(18,"POS"),c(),r(19,"th",22)(20,"div",23),g("click",function(){h(n);let t=p(2);return u(t.onChangeChannel())}),x(21,"img",24),m(22),c()(),x(23,"th",25),c()(),r(24,"tbody"),C(25,Yt,2,1,"ng-container",26),c()(),r(26,"div",27)(27,"div",28)(28,"div",29),m(29),P(30,"number"),C(31,Zt,3,0,"span",30)(32,qt,3,3,"span",4),P(33,"async"),m(34),c()(),C(35,Wt,3,2,"div",31),c()()()()}if(i&2){let n=a.ngIf,e=p(2);l(9),s("ngModel",e.toggleDifferentInventory),l(7),s("ngxPermissionsOnly",y(15,ve,e.rolePriceEdit)),l(4),s("matTooltip","Change "+(e.selectedChannel==null?null:e.selectedChannel.Name)),l(1),s("src",e.selectedChannel.logo,E),l(1),I(" ",e.selectedChannel!=null&&e.selectedChannel.Name?e.selectedChannel==null?null:e.selectedChannel.Name:"Choose Channel ..."," "),l(3),s("ngForOf",n),l(4),I(" Showing 1 - ",v(30,11,n==null?null:n.length)," of "),l(2),s("ngIf",e.paginationService.hideCount),l(1),s("ngIf",v(33,13,!e.paginationService.hideCount&&e.allDataCount$)),l(2),I(" records ~ ",e.paginationService.footerPageNumber," Page "),l(1),s("ngIf",n.length>0)}}function tn(i,a){if(i&1){let n=f();r(0,"mainpanel",1),g("textChange",function(t){h(n);let o=p();return u(o.searchFilter.text=t)})("onSubmit",function(){h(n);let t=p();return u(t.search())}),r(1,"filters")(2,"div",2)(3,"div")(4,"label"),m(5,"Page Number"),c(),r(6,"input",3),g("ngModelChange",function(t){h(n);let o=p();return u(o.searchFilter.PageNumber=t)}),c()(),r(7,"div")(8,"label"),m(9,"Page Size"),c(),r(10,"input",3),g("ngModelChange",function(t){h(n);let o=p();return u(o.searchFilter.RowCount=t)}),c()()()(),C(11,Ot,5,2,"actions",4),P(12,"async"),C(13,en,36,17,"content",4),P(14,"async"),c()}if(i&2){let n=p();s("headerTitle",n.pageTitle)("text",n.searchFilter.text),l(6),s("ngModel",n.searchFilter.PageNumber),l(4),s("ngModel",n.searchFilter.RowCount),l(1),s("ngIf",v(12,6,n.data$)),l(2),s("ngIf",v(14,8,n.data$))}}var qe=(()=>{let a=class a{constructor(e,t,o,d,_,S,We){this.http=e,this.paginationService=t,this.toastr=o,this.dialog=d,this.productService=_,this.biggerPictureService=S,this.inventoryService=We,this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.allDataCountEndpoint="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=le.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.hostName=this.productService.getHostName(),this.data$=this.paginationService.data$.pipe(be(1),q(et=>et.map(Z=>(Z.Variants&&(Z.Variants=Z.Variants.map(xe=>(xe.isDiscontinued=xe.Discontinued=="Yes",xe))),Z))))}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe(X(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=O.ALL,this.paginationService.reloadPagination(this.searchFilter),this.channelOptions=e.Options.Channel,this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=O.ALL:this.searchFilter.filterModel=O.DIFFERENCE,this.search()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(t=>(t.selected=e.selected,t))}openScanDialog(e){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=w.GuidEMpty,this.dialog.open(me,{data:{filter:t,channelOptions:e.Options.Channel},width:"600px"}).afterClosed().pipe(D(o=>w.IsNotEmpty(o))).subscribe(o=>{this.searchFilter.ChannelID=o.ChannelID,this.searchFilter.ScanFull=o.ScanFull,this.searchFilter.UpdatedProduct=o.UpdatedProduct,this.searchFilter.Async=o.Async,this.scanAll(e)})}scanAll(e){let t=this.productService.findChannelById(this.searchFilter.ChannelID,e.Options.Channel);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(o=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.initPageLoader(),this.toastr.success(`Successfully scanned from ${t?.Name}`,"Success"))})}updateStock(e){let o=this.productService.selectedVariantProduct(e).map(_=>({ID:_.ID,ChannelID:_.Channel[0].ChannelID,Code:_.Code,Price:_.UnitPrice})),d={ListChannelID:[this.searchFilter.ChannelID],ListPrice:o};this.http.post("/api/Price/UpdateChannel",d).subscribe(_=>{this.search(),this.handlingUpdateStock(_.Response)})}handlingUpdateStock(e){if(e.success_list.length>0||e.failure_list.length>0){let t=e.failure_list,o=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",o,t)}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let t={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",t).subscribe(o=>{this.toastr.success("Successfully updated","Success"),this.search()})}search(){this.paginationService.reloadPagination(this.searchFilter)}getRowCount(){this.paginationService.hideCount=!1,this.allDataCount$=this.http.post(`/API/${this.allDataCountEndpoint}`,this.searchFilter)}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}onLastPage(){this.http.post(`/API/${this.allDataCountEndpoint}`,this.searchFilter).subscribe({next:e=>{this.paginationService.getAllData(this.searchFilter,e.Total)}})}openTableDialog(e,t,o){let d=JSON.parse(JSON.stringify(e));this.dialog.open(ue,{data:{Name:t.Name,Variant:d,ChannelID:d?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:d?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(D(S=>w.IsNotEmpty(S))).subscribe(S=>{this.updateItemAfterDialog(S,o,e)})}updateItemAfterDialog(e,t,o){let d={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",d).subscribe(_=>{let S=this.productService.findChannelById(d.ID,t.Options.Channel);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) inventory in ${S.Name} to ${d.Price}`,"Success"),o.Channel[0]&&(o.Channel[0].Price=d.Price)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID),this.selectedChannel&&(this.selectedChannel.logo=w.getChannelLogoByTypeId(this.selectedChannel.TypeID))}onChangeChannel(){this.dialog.open(Be,{data:{channelOptions:this.channelOptions,selectedChannel:this.selectedChannel}}).afterClosed().pipe(D(e=>w.IsNotEmpty(e))).subscribe(e=>{this.selectedChannel=e,this.searchFilter.ChannelID=e.ID,this.search()})}onSelectAllSKU(e,t){t=t.map(o=>(o.Variants=o.Variants.map(d=>(d.selected=e,d)),o))}onZoomImage(e,t){this.biggerPictureService.openBiggerPicture(e,t)}ngOnDestroy(){this.paginationService.destroy()}};a.\u0275fac=function(t){return new(t||a)(b(j),b(_e),b(B),b(K),b(G),b(de),b(Ce))},a.\u0275cmp=V({type:a,selectors:[["app-price-single-channel"]],decls:2,vars:3,consts:[[3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[3,"headerTitle","text","textChange","onSubmit"],["container",""],["type","number",3,"ngModel","ngModelChange"],[4,"ngIf"],[1,"d-flex"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["class","btn btn-success",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModel","ngModelChange","toggleChange"],[1,"fw-bold"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["matTooltipPosition","above",1,"d-inline-block","text-truncate","mt-3","cursor-pointer",2,"max-width","114px",3,"matTooltip","click"],[2,"width","16px",3,"src"],[2,"width","4%"],[4,"ngFor","ngForOf"],[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"],["style","cursor:pointer",3,"click",4,"ngIf"],["class","btn-group",4,"ngIf"],["type","checkbox",1,"me-3",3,"change"],["matTooltipPosition","above",1,"text-end",3,"matTooltip"],[3,"ngClass"],[1,"ms-2"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-external-link-alt"],[1,"text-end",3,"ngClass"],["style","cursor: pointer;",3,"click",4,"ngIf"],[1,"row"],[1,"col-12","ps-0","d-flex","justify-content-between"],[1,"fas","external-link-custom","fa-lg","fa-external-link-alt"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],["class","border rounded w-img cursor-pointer","style","margin-left: 20px",3,"src","click",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],["type","checkbox","class","me-3",3,"ngModel","ngModelChange",4,"ngIf"],["type","checkbox",1,"me-3",3,"ngModel","ngModelChange"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"align-middle"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],["type","checkbox",3,"ngModel","ngModelChange"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],["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(t,o){t&1&&(C(0,tn,15,10,"mainpanel",0),P(1,"async")),t&2&&s("ngIf",v(1,1,o.loader$))},dependencies:[$,A,U,oe,ae,ie,k,N,z,Re,pe,ce,te,R],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"]});let i=a;return i})();var Xe=(()=>{let a=class a{constructor(){this.priceTabs=[{Title:"Single Channel Comparison",Url:"/menu/price/SingleChannel"},{Title:"Multi Channel Comparison",Url:"/menu/price/pos"},{Title:"Custom Channel Price",Url:"/menu/price/OutletPrice"}]}};a.\u0275fac=function(t){return new(t||a)},a.\u0275cmp=V({type:a,selectors:[["app-price"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,o){t&1&&(r(0,"nav",0)(1,"div",1)(2,"div"),x(3,"nav-tab",2),c()()(),x(4,"router-outlet")),t&2&&(l(3),s("Tabs",o.priceTabs))},dependencies:[Me,we]});let i=a;return i})();var nn=[{path:"",component:Xe,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",component:He,canActivate:[se],data:{title:"Global Price Comparison"}},{path:"OutletPrice",component:Ze,canActivate:[se],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",component:qe,canActivate:[se],data:{title:"Price Single Channel Comparison"}}]}],Qe=(()=>{let a=class a{};a.\u0275fac=function(t){return new(t||a)},a.\u0275mod=W({type:a}),a.\u0275inj=Q({imports:[L,ne.forChild(nn)]});let i=a;return i})();var ui=(()=>{let a=class a{};a.\u0275fac=function(t){return new(t||a)},a.\u0275mod=W({type:a}),a.\u0275inj=Q({providers:[Ce],imports:[L,re,ke,Fe,ne,Ve,Qe,Te,Le,Ue,Ee,fe,ge,De.forChild()]});let i=a;return i})();export{ui as PriceModule};
@@ -1 +1 @@
1
- import{C as st,H as ct,I as dt,J as ht,K as R,P as lt,a as P,t as nt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-45NXB6RE.js";import{b as g,c as at}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-YD4CXLB4.js";import{$ as F,$a as w,A as j,Ac as rt,Ba as K,Bc as ot,Fa as m,Ga as d,Ia as W,Ja as q,La as E,Na as H,Oa as p,Qa as O,Ua as G,Va as J,Za as _,_a as S,aa as D,ba as B,c as M,db as Q,ea as C,fa as A,fc as it,ga as Y,hb as N,ia as L,ja as T,jb as y,ka as k,kb as X,lb as Z,pa as z,pb as tt,qa as U,qb as et,sc as u,tc as h,wc as a,xc as s,yc as b,za as $,zc as c}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-ZHLG7GCJ.js";var ut=["mat-sort-header",""];function gt(r,e){if(r&1){let n=Q();_(0,"div",3),N("@arrowPosition.start",function(){T(n);let i=y();return k(i._disableViewStateAnimation=!0)})("@arrowPosition.done",function(){T(n);let i=y();return k(i._disableViewStateAnimation=!1)}),w(1,"div",4),_(2,"div",5),w(3,"div",6)(4,"div",7)(5,"div",8),S()()}if(r&2){let n=y();p("@arrowOpacity",n._getArrowViewState())("@arrowPosition",n._getArrowViewState())("@allowChildren",n._getArrowDirectionState()),m(2),p("@indicator",n._getArrowDirectionState()),m(1),p("@leftPointer",n._getArrowDirectionState()),m(1),p("@rightPointer",n._getArrowDirectionState())}}var St=["*"];var ft=new B("MAT_SORT_DEFAULT_OPTIONS"),vt=lt(R(class{})),wt=(()=>{let e=class e extends vt{get direction(){return this._direction}set direction(t){this._direction=t}get disableClear(){return this._disableClear}set disableClear(t){this._disableClear=P(t)}constructor(t){super(),this._defaultOptions=t,this.sortables=new Map,this._stateChanges=new M,this.start="asc",this._direction="",this.sortChange=new q}register(t){this.sortables.set(t.id,t)}deregister(t){this.sortables.delete(t.id)}sort(t){this.active!=t.id?(this.active=t.id,this.direction=t.start?t.start:this.start):this.direction=this.getNextSortDirection(t),this.sortChange.emit({active:this.active,direction:this.direction})}getNextSortDirection(t){if(!t)return"";let i=t?.disableClear??this.disableClear??!!this._defaultOptions?.disableClear,o=bt(t.start||this.start,i),l=o.indexOf(this.direction)+1;return l>=o.length&&(l=0),o[l]}ngOnInit(){this._markInitialized()}ngOnChanges(){this._stateChanges.next()}ngOnDestroy(){this._stateChanges.complete()}};e.\u0275fac=function(i){return new(i||e)(d(ft,8))},e.\u0275dir=Y({type:e,selectors:[["","matSort",""]],hostAttrs:[1,"mat-sort"],inputs:{disabled:["matSortDisabled","disabled"],active:["matSortActive","active"],start:["matSortStart","start"],direction:["matSortDirection","direction"],disableClear:["matSortDisableClear","disableClear"]},outputs:{sortChange:"matSortChange"},exportAs:["matSort"],features:[E,L]});let r=e;return r})();function bt(r,e){let n=["asc","desc"];return r=="desc"&&n.reverse(),e||n.push(""),n}var f=dt.ENTERING+" "+ct.STANDARD_CURVE,v={indicator:u("indicator",[s("active-asc, asc",a({transform:"translateY(0px)"})),s("active-desc, desc",a({transform:"translateY(10px)"})),c("active-asc <=> active-desc",h(f))]),leftPointer:u("leftPointer",[s("active-asc, asc",a({transform:"rotate(-45deg)"})),s("active-desc, desc",a({transform:"rotate(45deg)"})),c("active-asc <=> active-desc",h(f))]),rightPointer:u("rightPointer",[s("active-asc, asc",a({transform:"rotate(45deg)"})),s("active-desc, desc",a({transform:"rotate(-45deg)"})),c("active-asc <=> active-desc",h(f))]),arrowOpacity:u("arrowOpacity",[s("desc-to-active, asc-to-active, active",a({opacity:1})),s("desc-to-hint, asc-to-hint, hint",a({opacity:.54})),s("hint-to-desc, active-to-desc, desc, hint-to-asc, active-to-asc, asc, void",a({opacity:0})),c("* => asc, * => desc, * => active, * => hint, * => void",h("0ms")),c("* <=> *",h(f))]),arrowPosition:u("arrowPosition",[c("* => desc-to-hint, * => desc-to-active",h(f,b([a({transform:"translateY(-25%)"}),a({transform:"translateY(0)"})]))),c("* => hint-to-desc, * => active-to-desc",h(f,b([a({transform:"translateY(0)"}),a({transform:"translateY(25%)"})]))),c("* => asc-to-hint, * => asc-to-active",h(f,b([a({transform:"translateY(25%)"}),a({transform:"translateY(0)"})]))),c("* => hint-to-asc, * => active-to-asc",h(f,b([a({transform:"translateY(0)"}),a({transform:"translateY(-25%)"})]))),s("desc-to-hint, asc-to-hint, hint, desc-to-active, asc-to-active, active",a({transform:"translateY(0)"})),s("hint-to-desc, active-to-desc, desc",a({transform:"translateY(-25%)"})),s("hint-to-asc, active-to-asc, asc",a({transform:"translateY(25%)"}))]),allowChildren:u("allowChildren",[c("* <=> *",[ot("@*",rt(),{optional:!0})])])},I=(()=>{let e=class e{constructor(){this.changes=new M}};e.\u0275fac=function(i){return new(i||e)},e.\u0275prov=F({token:e,factory:e.\u0275fac,providedIn:"root"});let r=e;return r})();function Dt(r){return r||new I}var Ct={provide:I,deps:[[new z,new U,I]],useFactory:Dt},At=R(class{}),Lt=(()=>{let e=class e extends At{get sortActionDescription(){return this._sortActionDescription}set sortActionDescription(t){this._updateSortActionDescription(t)}get disableClear(){return this._disableClear}set disableClear(t){this._disableClear=P(t)}constructor(t,i,o,l,x,pt,_t,V){super(),this._intl=t,this._changeDetectorRef=i,this._sort=o,this._columnDef=l,this._focusMonitor=x,this._elementRef=pt,this._ariaDescriber=_t,this._showIndicatorHint=!1,this._viewState={},this._arrowDirection="",this._disableViewStateAnimation=!1,this.arrowPosition="after",this._sortActionDescription="Sort",V?.arrowPosition&&(this.arrowPosition=V?.arrowPosition),this._handleStateChanges()}ngOnInit(){!this.id&&this._columnDef&&(this.id=this._columnDef.name),this._updateArrowDirection(),this._setAnimationTransitionState({toState:this._isSorted()?"active":this._arrowDirection}),this._sort.register(this),this._sortButton=this._elementRef.nativeElement.querySelector(".mat-sort-header-container"),this._updateSortActionDescription(this._sortActionDescription)}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{let i=!!t;i!==this._showIndicatorHint&&(this._setIndicatorHintVisible(i),this._changeDetectorRef.markForCheck())})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef),this._sort.deregister(this),this._rerenderSubscription.unsubscribe()}_setIndicatorHintVisible(t){this._isDisabled()&&t||(this._showIndicatorHint=t,this._isSorted()||(this._updateArrowDirection(),this._showIndicatorHint?this._setAnimationTransitionState({fromState:this._arrowDirection,toState:"hint"}):this._setAnimationTransitionState({fromState:"hint",toState:this._arrowDirection})))}_setAnimationTransitionState(t){this._viewState=t||{},this._disableViewStateAnimation&&(this._viewState={toState:t.toState})}_toggleOnInteraction(){this._sort.sort(this),(this._viewState.toState==="hint"||this._viewState.toState==="active")&&(this._disableViewStateAnimation=!0)}_handleClick(){this._isDisabled()||this._sort.sort(this)}_handleKeydown(t){!this._isDisabled()&&(t.keyCode===32||t.keyCode===13)&&(t.preventDefault(),this._toggleOnInteraction())}_isSorted(){return this._sort.active==this.id&&(this._sort.direction==="asc"||this._sort.direction==="desc")}_getArrowDirectionState(){return`${this._isSorted()?"active-":""}${this._arrowDirection}`}_getArrowViewState(){let t=this._viewState.fromState;return(t?`${t}-to-`:"")+this._viewState.toState}_updateArrowDirection(){this._arrowDirection=this._isSorted()?this._sort.direction:this.start||this._sort.start}_isDisabled(){return this._sort.disabled||this.disabled}_getAriaSortAttribute(){return this._isSorted()?this._sort.direction=="asc"?"ascending":"descending":"none"}_renderArrow(){return!this._isDisabled()||this._isSorted()}_updateSortActionDescription(t){this._sortButton&&(this._ariaDescriber?.removeDescription(this._sortButton,this._sortActionDescription),this._ariaDescriber?.describe(this._sortButton,t)),this._sortActionDescription=t}_handleStateChanges(){this._rerenderSubscription=j(this._sort.sortChange,this._sort._stateChanges,this._intl.changes).subscribe(()=>{this._isSorted()&&(this._updateArrowDirection(),(this._viewState.toState==="hint"||this._viewState.toState==="active")&&(this._disableViewStateAnimation=!0),this._setAnimationTransitionState({fromState:this._arrowDirection,toState:"active"}),this._showIndicatorHint=!1),!this._isSorted()&&this._viewState&&this._viewState.toState==="active"&&(this._disableViewStateAnimation=!1,this._setAnimationTransitionState({fromState:"active",toState:this._arrowDirection})),this._changeDetectorRef.markForCheck()})}};e.\u0275fac=function(i){return new(i||e)(d(I),d(W),d(wt,8),d("MAT_SORT_HEADER_COLUMN_DEF",8),d(st),d(K),d(nt,8),d(ft,8))},e.\u0275cmp=C({type:e,selectors:[["","mat-sort-header",""]],hostAttrs:[1,"mat-sort-header"],hostVars:3,hostBindings:function(i,o){i&1&&N("click",function(){return o._handleClick()})("keydown",function(x){return o._handleKeydown(x)})("mouseenter",function(){return o._setIndicatorHintVisible(!0)})("mouseleave",function(){return o._setIndicatorHintVisible(!1)}),i&2&&(H("aria-sort",o._getAriaSortAttribute()),O("mat-sort-header-disabled",o._isDisabled()))},inputs:{disabled:"disabled",id:["mat-sort-header","id"],arrowPosition:"arrowPosition",start:"start",sortActionDescription:"sortActionDescription",disableClear:"disableClear"},exportAs:["matSortHeader"],features:[E],attrs:ut,ngContentSelectors:St,decls:4,vars:7,consts:[[1,"mat-sort-header-container","mat-focus-indicator"],[1,"mat-sort-header-content"],["class","mat-sort-header-arrow"],[1,"mat-sort-header-arrow"],[1,"mat-sort-header-stem"],[1,"mat-sort-header-indicator"],[1,"mat-sort-header-pointer-left"],[1,"mat-sort-header-pointer-right"],[1,"mat-sort-header-pointer-middle"]],template:function(i,o){i&1&&(X(),_(0,"div",0)(1,"div",1),Z(2),S(),G(3,gt,6,6,"div",2),S()),i&2&&(O("mat-sort-header-sorted",o._isSorted())("mat-sort-header-position-before",o.arrowPosition==="before"),H("tabindex",o._isDisabled()?null:0)("role",o._isDisabled()?null:"button"),m(3),J(3,o._renderArrow()?3:-1))},styles:[".mat-sort-header-container{display:flex;cursor:pointer;align-items:center;letter-spacing:normal;outline:0}[mat-sort-header].cdk-keyboard-focused .mat-sort-header-container,[mat-sort-header].cdk-program-focused .mat-sort-header-container{border-bottom:solid 1px currentColor}.mat-sort-header-disabled .mat-sort-header-container{cursor:default}.mat-sort-header-container::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-sort-header-content{text-align:center;display:flex;align-items:center}.mat-sort-header-position-before{flex-direction:row-reverse}.mat-sort-header-arrow{height:12px;width:12px;min-width:12px;position:relative;display:flex;color:var(--mat-sort-arrow-color);opacity:0}.mat-sort-header-arrow,[dir=rtl] .mat-sort-header-position-before .mat-sort-header-arrow{margin:0 0 0 6px}.mat-sort-header-position-before .mat-sort-header-arrow,[dir=rtl] .mat-sort-header-arrow{margin:0 6px 0 0}.mat-sort-header-stem{background:currentColor;height:10px;width:2px;margin:auto;display:flex;align-items:center}.cdk-high-contrast-active .mat-sort-header-stem{width:0;border-left:solid 2px}.mat-sort-header-indicator{width:100%;height:2px;display:flex;align-items:center;position:absolute;top:0;left:0}.mat-sort-header-pointer-middle{margin:auto;height:2px;width:2px;background:currentColor;transform:rotate(45deg)}.cdk-high-contrast-active .mat-sort-header-pointer-middle{width:0;height:0;border-top:solid 2px;border-left:solid 2px}.mat-sort-header-pointer-left,.mat-sort-header-pointer-right{background:currentColor;width:6px;height:2px;position:absolute;top:0}.cdk-high-contrast-active .mat-sort-header-pointer-left,.cdk-high-contrast-active .mat-sort-header-pointer-right{width:0;height:0;border-left:solid 6px;border-top:solid 2px}.mat-sort-header-pointer-left{transform-origin:right;left:0}.mat-sort-header-pointer-right{transform-origin:left;right:0}"],encapsulation:2,data:{animation:[v.indicator,v.leftPointer,v.rightPointer,v.arrowOpacity,v.arrowPosition,v.allowChildren]},changeDetection:0});let r=e;return r})(),zt=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=A({type:e}),e.\u0275inj=D({providers:[Ct],imports:[ht]});let r=e;return r})();var Gt=(()=>{let e=class e{set typeId(t){this.channelLogo=at.getChannelLogoByTypeId(t),this.initChannelName(t)}constructor(){}initChannelName(t){switch(t){case g.Tokopedia:this.channelName="Tokopedia";break;case g.Tiktok:this.channelName="Tiktok";break;case g.WooCommerce:this.channelName="WooCommerce";break;case g.ShopeeV2:this.channelName="Shopee";break;case g.Lazada:this.channelName="Lazada";break;case g.KalCare:this.channelName="Kalcare";break}}};e.\u0275fac=function(i){return new(i||e)},e.\u0275cmp=C({type:e,selectors:[["app-channel-logo"]],inputs:{typeId:"typeId"},decls:4,vars:2,consts:[[1,"d-flex","align-items-center"],[2,"width","20px",3,"src"],[1,"ms-3","fw-normal"]],template:function(i,o){i&1&&(_(0,"div",0),w(1,"img",1),_(2,"span",2),tt(3),S()()),i&2&&(m(1),p("src",o.channelLogo,$),m(2),et(o.channelName))}});let r=e;return r})();var te=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=A({type:e}),e.\u0275inj=D({imports:[it]});let r=e;return r})();export{wt as a,Lt as b,zt as c,Gt as d,te as e};
1
+ import{C as st,H as ct,I as dt,J as ht,K as R,P as lt,a as P,t as nt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-LYFRN35D.js";import{b as g,c as at}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-5TEZF6KQ.js";import{$ as F,$a as w,A as j,Ac as rt,Ba as K,Bc as ot,Fa as m,Ga as d,Ia as W,Ja as q,La as E,Na as H,Oa as p,Qa as O,Ua as G,Va as J,Za as _,_a as S,aa as D,ba as B,c as M,db as Q,ea as C,fa as A,fc as it,ga as Y,hb as N,ia as L,ja as T,jb as y,ka as k,kb as X,lb as Z,pa as z,pb as tt,qa as U,qb as et,sc as u,tc as h,wc as a,xc as s,yc as b,za as $,zc as c}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-TIWU4GET.js";var ut=["mat-sort-header",""];function gt(r,e){if(r&1){let n=Q();_(0,"div",3),N("@arrowPosition.start",function(){T(n);let i=y();return k(i._disableViewStateAnimation=!0)})("@arrowPosition.done",function(){T(n);let i=y();return k(i._disableViewStateAnimation=!1)}),w(1,"div",4),_(2,"div",5),w(3,"div",6)(4,"div",7)(5,"div",8),S()()}if(r&2){let n=y();p("@arrowOpacity",n._getArrowViewState())("@arrowPosition",n._getArrowViewState())("@allowChildren",n._getArrowDirectionState()),m(2),p("@indicator",n._getArrowDirectionState()),m(1),p("@leftPointer",n._getArrowDirectionState()),m(1),p("@rightPointer",n._getArrowDirectionState())}}var St=["*"];var ft=new B("MAT_SORT_DEFAULT_OPTIONS"),vt=lt(R(class{})),wt=(()=>{let e=class e extends vt{get direction(){return this._direction}set direction(t){this._direction=t}get disableClear(){return this._disableClear}set disableClear(t){this._disableClear=P(t)}constructor(t){super(),this._defaultOptions=t,this.sortables=new Map,this._stateChanges=new M,this.start="asc",this._direction="",this.sortChange=new q}register(t){this.sortables.set(t.id,t)}deregister(t){this.sortables.delete(t.id)}sort(t){this.active!=t.id?(this.active=t.id,this.direction=t.start?t.start:this.start):this.direction=this.getNextSortDirection(t),this.sortChange.emit({active:this.active,direction:this.direction})}getNextSortDirection(t){if(!t)return"";let i=t?.disableClear??this.disableClear??!!this._defaultOptions?.disableClear,o=bt(t.start||this.start,i),l=o.indexOf(this.direction)+1;return l>=o.length&&(l=0),o[l]}ngOnInit(){this._markInitialized()}ngOnChanges(){this._stateChanges.next()}ngOnDestroy(){this._stateChanges.complete()}};e.\u0275fac=function(i){return new(i||e)(d(ft,8))},e.\u0275dir=Y({type:e,selectors:[["","matSort",""]],hostAttrs:[1,"mat-sort"],inputs:{disabled:["matSortDisabled","disabled"],active:["matSortActive","active"],start:["matSortStart","start"],direction:["matSortDirection","direction"],disableClear:["matSortDisableClear","disableClear"]},outputs:{sortChange:"matSortChange"},exportAs:["matSort"],features:[E,L]});let r=e;return r})();function bt(r,e){let n=["asc","desc"];return r=="desc"&&n.reverse(),e||n.push(""),n}var f=dt.ENTERING+" "+ct.STANDARD_CURVE,v={indicator:u("indicator",[s("active-asc, asc",a({transform:"translateY(0px)"})),s("active-desc, desc",a({transform:"translateY(10px)"})),c("active-asc <=> active-desc",h(f))]),leftPointer:u("leftPointer",[s("active-asc, asc",a({transform:"rotate(-45deg)"})),s("active-desc, desc",a({transform:"rotate(45deg)"})),c("active-asc <=> active-desc",h(f))]),rightPointer:u("rightPointer",[s("active-asc, asc",a({transform:"rotate(45deg)"})),s("active-desc, desc",a({transform:"rotate(-45deg)"})),c("active-asc <=> active-desc",h(f))]),arrowOpacity:u("arrowOpacity",[s("desc-to-active, asc-to-active, active",a({opacity:1})),s("desc-to-hint, asc-to-hint, hint",a({opacity:.54})),s("hint-to-desc, active-to-desc, desc, hint-to-asc, active-to-asc, asc, void",a({opacity:0})),c("* => asc, * => desc, * => active, * => hint, * => void",h("0ms")),c("* <=> *",h(f))]),arrowPosition:u("arrowPosition",[c("* => desc-to-hint, * => desc-to-active",h(f,b([a({transform:"translateY(-25%)"}),a({transform:"translateY(0)"})]))),c("* => hint-to-desc, * => active-to-desc",h(f,b([a({transform:"translateY(0)"}),a({transform:"translateY(25%)"})]))),c("* => asc-to-hint, * => asc-to-active",h(f,b([a({transform:"translateY(25%)"}),a({transform:"translateY(0)"})]))),c("* => hint-to-asc, * => active-to-asc",h(f,b([a({transform:"translateY(0)"}),a({transform:"translateY(-25%)"})]))),s("desc-to-hint, asc-to-hint, hint, desc-to-active, asc-to-active, active",a({transform:"translateY(0)"})),s("hint-to-desc, active-to-desc, desc",a({transform:"translateY(-25%)"})),s("hint-to-asc, active-to-asc, asc",a({transform:"translateY(25%)"}))]),allowChildren:u("allowChildren",[c("* <=> *",[ot("@*",rt(),{optional:!0})])])},I=(()=>{let e=class e{constructor(){this.changes=new M}};e.\u0275fac=function(i){return new(i||e)},e.\u0275prov=F({token:e,factory:e.\u0275fac,providedIn:"root"});let r=e;return r})();function Dt(r){return r||new I}var Ct={provide:I,deps:[[new z,new U,I]],useFactory:Dt},At=R(class{}),Lt=(()=>{let e=class e extends At{get sortActionDescription(){return this._sortActionDescription}set sortActionDescription(t){this._updateSortActionDescription(t)}get disableClear(){return this._disableClear}set disableClear(t){this._disableClear=P(t)}constructor(t,i,o,l,x,pt,_t,V){super(),this._intl=t,this._changeDetectorRef=i,this._sort=o,this._columnDef=l,this._focusMonitor=x,this._elementRef=pt,this._ariaDescriber=_t,this._showIndicatorHint=!1,this._viewState={},this._arrowDirection="",this._disableViewStateAnimation=!1,this.arrowPosition="after",this._sortActionDescription="Sort",V?.arrowPosition&&(this.arrowPosition=V?.arrowPosition),this._handleStateChanges()}ngOnInit(){!this.id&&this._columnDef&&(this.id=this._columnDef.name),this._updateArrowDirection(),this._setAnimationTransitionState({toState:this._isSorted()?"active":this._arrowDirection}),this._sort.register(this),this._sortButton=this._elementRef.nativeElement.querySelector(".mat-sort-header-container"),this._updateSortActionDescription(this._sortActionDescription)}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>{let i=!!t;i!==this._showIndicatorHint&&(this._setIndicatorHintVisible(i),this._changeDetectorRef.markForCheck())})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef),this._sort.deregister(this),this._rerenderSubscription.unsubscribe()}_setIndicatorHintVisible(t){this._isDisabled()&&t||(this._showIndicatorHint=t,this._isSorted()||(this._updateArrowDirection(),this._showIndicatorHint?this._setAnimationTransitionState({fromState:this._arrowDirection,toState:"hint"}):this._setAnimationTransitionState({fromState:"hint",toState:this._arrowDirection})))}_setAnimationTransitionState(t){this._viewState=t||{},this._disableViewStateAnimation&&(this._viewState={toState:t.toState})}_toggleOnInteraction(){this._sort.sort(this),(this._viewState.toState==="hint"||this._viewState.toState==="active")&&(this._disableViewStateAnimation=!0)}_handleClick(){this._isDisabled()||this._sort.sort(this)}_handleKeydown(t){!this._isDisabled()&&(t.keyCode===32||t.keyCode===13)&&(t.preventDefault(),this._toggleOnInteraction())}_isSorted(){return this._sort.active==this.id&&(this._sort.direction==="asc"||this._sort.direction==="desc")}_getArrowDirectionState(){return`${this._isSorted()?"active-":""}${this._arrowDirection}`}_getArrowViewState(){let t=this._viewState.fromState;return(t?`${t}-to-`:"")+this._viewState.toState}_updateArrowDirection(){this._arrowDirection=this._isSorted()?this._sort.direction:this.start||this._sort.start}_isDisabled(){return this._sort.disabled||this.disabled}_getAriaSortAttribute(){return this._isSorted()?this._sort.direction=="asc"?"ascending":"descending":"none"}_renderArrow(){return!this._isDisabled()||this._isSorted()}_updateSortActionDescription(t){this._sortButton&&(this._ariaDescriber?.removeDescription(this._sortButton,this._sortActionDescription),this._ariaDescriber?.describe(this._sortButton,t)),this._sortActionDescription=t}_handleStateChanges(){this._rerenderSubscription=j(this._sort.sortChange,this._sort._stateChanges,this._intl.changes).subscribe(()=>{this._isSorted()&&(this._updateArrowDirection(),(this._viewState.toState==="hint"||this._viewState.toState==="active")&&(this._disableViewStateAnimation=!0),this._setAnimationTransitionState({fromState:this._arrowDirection,toState:"active"}),this._showIndicatorHint=!1),!this._isSorted()&&this._viewState&&this._viewState.toState==="active"&&(this._disableViewStateAnimation=!1,this._setAnimationTransitionState({fromState:"active",toState:this._arrowDirection})),this._changeDetectorRef.markForCheck()})}};e.\u0275fac=function(i){return new(i||e)(d(I),d(W),d(wt,8),d("MAT_SORT_HEADER_COLUMN_DEF",8),d(st),d(K),d(nt,8),d(ft,8))},e.\u0275cmp=C({type:e,selectors:[["","mat-sort-header",""]],hostAttrs:[1,"mat-sort-header"],hostVars:3,hostBindings:function(i,o){i&1&&N("click",function(){return o._handleClick()})("keydown",function(x){return o._handleKeydown(x)})("mouseenter",function(){return o._setIndicatorHintVisible(!0)})("mouseleave",function(){return o._setIndicatorHintVisible(!1)}),i&2&&(H("aria-sort",o._getAriaSortAttribute()),O("mat-sort-header-disabled",o._isDisabled()))},inputs:{disabled:"disabled",id:["mat-sort-header","id"],arrowPosition:"arrowPosition",start:"start",sortActionDescription:"sortActionDescription",disableClear:"disableClear"},exportAs:["matSortHeader"],features:[E],attrs:ut,ngContentSelectors:St,decls:4,vars:7,consts:[[1,"mat-sort-header-container","mat-focus-indicator"],[1,"mat-sort-header-content"],["class","mat-sort-header-arrow"],[1,"mat-sort-header-arrow"],[1,"mat-sort-header-stem"],[1,"mat-sort-header-indicator"],[1,"mat-sort-header-pointer-left"],[1,"mat-sort-header-pointer-right"],[1,"mat-sort-header-pointer-middle"]],template:function(i,o){i&1&&(X(),_(0,"div",0)(1,"div",1),Z(2),S(),G(3,gt,6,6,"div",2),S()),i&2&&(O("mat-sort-header-sorted",o._isSorted())("mat-sort-header-position-before",o.arrowPosition==="before"),H("tabindex",o._isDisabled()?null:0)("role",o._isDisabled()?null:"button"),m(3),J(3,o._renderArrow()?3:-1))},styles:[".mat-sort-header-container{display:flex;cursor:pointer;align-items:center;letter-spacing:normal;outline:0}[mat-sort-header].cdk-keyboard-focused .mat-sort-header-container,[mat-sort-header].cdk-program-focused .mat-sort-header-container{border-bottom:solid 1px currentColor}.mat-sort-header-disabled .mat-sort-header-container{cursor:default}.mat-sort-header-container::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-sort-header-content{text-align:center;display:flex;align-items:center}.mat-sort-header-position-before{flex-direction:row-reverse}.mat-sort-header-arrow{height:12px;width:12px;min-width:12px;position:relative;display:flex;color:var(--mat-sort-arrow-color);opacity:0}.mat-sort-header-arrow,[dir=rtl] .mat-sort-header-position-before .mat-sort-header-arrow{margin:0 0 0 6px}.mat-sort-header-position-before .mat-sort-header-arrow,[dir=rtl] .mat-sort-header-arrow{margin:0 6px 0 0}.mat-sort-header-stem{background:currentColor;height:10px;width:2px;margin:auto;display:flex;align-items:center}.cdk-high-contrast-active .mat-sort-header-stem{width:0;border-left:solid 2px}.mat-sort-header-indicator{width:100%;height:2px;display:flex;align-items:center;position:absolute;top:0;left:0}.mat-sort-header-pointer-middle{margin:auto;height:2px;width:2px;background:currentColor;transform:rotate(45deg)}.cdk-high-contrast-active .mat-sort-header-pointer-middle{width:0;height:0;border-top:solid 2px;border-left:solid 2px}.mat-sort-header-pointer-left,.mat-sort-header-pointer-right{background:currentColor;width:6px;height:2px;position:absolute;top:0}.cdk-high-contrast-active .mat-sort-header-pointer-left,.cdk-high-contrast-active .mat-sort-header-pointer-right{width:0;height:0;border-left:solid 6px;border-top:solid 2px}.mat-sort-header-pointer-left{transform-origin:right;left:0}.mat-sort-header-pointer-right{transform-origin:left;right:0}"],encapsulation:2,data:{animation:[v.indicator,v.leftPointer,v.rightPointer,v.arrowOpacity,v.arrowPosition,v.allowChildren]},changeDetection:0});let r=e;return r})(),zt=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=A({type:e}),e.\u0275inj=D({providers:[Ct],imports:[ht]});let r=e;return r})();var Gt=(()=>{let e=class e{set typeId(t){this.channelLogo=at.getChannelLogoByTypeId(t),this.initChannelName(t)}constructor(){}initChannelName(t){switch(t){case g.Tokopedia:this.channelName="Tokopedia";break;case g.Tiktok:this.channelName="Tiktok";break;case g.WooCommerce:this.channelName="WooCommerce";break;case g.ShopeeV2:this.channelName="Shopee";break;case g.Lazada:this.channelName="Lazada";break;case g.KalCare:this.channelName="Kalcare";break}}};e.\u0275fac=function(i){return new(i||e)},e.\u0275cmp=C({type:e,selectors:[["app-channel-logo"]],inputs:{typeId:"typeId"},decls:4,vars:2,consts:[[1,"d-flex","align-items-center"],[2,"width","20px",3,"src"],[1,"ms-3","fw-normal"]],template:function(i,o){i&1&&(_(0,"div",0),w(1,"img",1),_(2,"span",2),tt(3),S()()),i&2&&(m(1),p("src",o.channelLogo,$),m(2),et(o.channelName))}});let r=e;return r})();var te=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=A({type:e}),e.\u0275inj=D({imports:[it]});let r=e;return r})();export{wt as a,Lt as b,zt as c,Gt as d,te as e};
@@ -1 +1 @@
1
- import{J as w,L as q,a as Y}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-45NXB6RE.js";import{$ as M,Ba as j,E as A,Ea as I,Ga as d,I as T,La as z,M as b,Na as H,P as L,Qa as k,Vb as F,X as v,a as y,aa as x,ba as E,ca as g,da as O,ea as P,fa as D,jc as B,kb as W,lb as $,n as f,o as R,oa as U,q as u,qc as V,w as N,xa as m}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-ZHLG7GCJ.js";var tt=["*"],S;function et(){if(S===void 0&&(S=null,typeof window<"u")){let r=window;r.trustedTypes!==void 0&&(S=r.trustedTypes.createPolicy("angular#components",{createHTML:s=>s}))}return S}function _(r){return et()?.createHTML(r)||r}function G(r){return Error(`Unable to find icon with the name "${r}"`)}function nt(){return Error("Could not find HttpClient provider for use with Angular Material icons. Please include the HttpClientModule from @angular/common/http in your app imports.")}function J(r){return Error(`The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was "${r}".`)}function K(r){return Error(`The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was "${r}".`)}var a=class{constructor(s,Z,t){this.url=s,this.svgText=Z,this.options=t}},it=(()=>{let s=class s{constructor(t,e,n,i){this._httpClient=t,this._sanitizer=e,this._errorHandler=i,this._svgIconConfigs=new Map,this._iconSetConfigs=new Map,this._cachedIconsByUrl=new Map,this._inProgressUrlFetches=new Map,this._fontCssClassesByAlias=new Map,this._resolvers=[],this._defaultFontSetClass=["material-icons","mat-ligature-font"],this._document=n}addSvgIcon(t,e,n){return this.addSvgIconInNamespace("",t,e,n)}addSvgIconLiteral(t,e,n){return this.addSvgIconLiteralInNamespace("",t,e,n)}addSvgIconInNamespace(t,e,n,i){return this._addSvgIconConfig(t,e,new a(n,null,i))}addSvgIconResolver(t){return this._resolvers.push(t),this}addSvgIconLiteralInNamespace(t,e,n,i){let o=this._sanitizer.sanitize(m.HTML,n);if(!o)throw K(n);let c=_(o);return this._addSvgIconConfig(t,e,new a("",c,i))}addSvgIconSet(t,e){return this.addSvgIconSetInNamespace("",t,e)}addSvgIconSetLiteral(t,e){return this.addSvgIconSetLiteralInNamespace("",t,e)}addSvgIconSetInNamespace(t,e,n){return this._addSvgIconSetConfig(t,new a(e,null,n))}addSvgIconSetLiteralInNamespace(t,e,n){let i=this._sanitizer.sanitize(m.HTML,e);if(!i)throw K(e);let o=_(i);return this._addSvgIconSetConfig(t,new a("",o,n))}registerFontClassAlias(t,e=t){return this._fontCssClassesByAlias.set(t,e),this}classNameForFontAlias(t){return this._fontCssClassesByAlias.get(t)||t}setDefaultFontSetClass(...t){return this._defaultFontSetClass=t,this}getDefaultFontSetClass(){return this._defaultFontSetClass}getSvgIconFromUrl(t){let e=this._sanitizer.sanitize(m.RESOURCE_URL,t);if(!e)throw J(t);let n=this._cachedIconsByUrl.get(e);return n?f(C(n)):this._loadSvgIconFromConfig(new a(t,null)).pipe(v(i=>this._cachedIconsByUrl.set(e,i)),u(i=>C(i)))}getNamedSvgIcon(t,e=""){let n=Q(e,t),i=this._svgIconConfigs.get(n);if(i)return this._getSvgFromConfig(i);if(i=this._getIconConfigFromResolvers(e,t),i)return this._svgIconConfigs.set(n,i),this._getSvgFromConfig(i);let o=this._iconSetConfigs.get(e);return o?this._getSvgFromIconSetConfigs(t,o):R(G(n))}ngOnDestroy(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}_getSvgFromConfig(t){return t.svgText?f(C(this._svgElementFromConfig(t))):this._loadSvgIconFromConfig(t).pipe(u(e=>C(e)))}_getSvgFromIconSetConfigs(t,e){let n=this._extractIconWithNameFromAnySet(t,e);if(n)return f(n);let i=e.filter(o=>!o.svgText).map(o=>this._loadSvgIconSetFromConfig(o).pipe(A(c=>{let h=`Loading icon set URL: ${this._sanitizer.sanitize(m.RESOURCE_URL,o.url)} failed: ${c.message}`;return this._errorHandler.handleError(new Error(h)),f(null)})));return N(i).pipe(u(()=>{let o=this._extractIconWithNameFromAnySet(t,e);if(!o)throw G(t);return o}))}_extractIconWithNameFromAnySet(t,e){for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.svgText&&i.svgText.toString().indexOf(t)>-1){let o=this._svgElementFromConfig(i),c=this._extractSvgIconFromSet(o,t,i.options);if(c)return c}}return null}_loadSvgIconFromConfig(t){return this._fetchIcon(t).pipe(v(e=>t.svgText=e),u(()=>this._svgElementFromConfig(t)))}_loadSvgIconSetFromConfig(t){return t.svgText?f(null):this._fetchIcon(t).pipe(v(e=>t.svgText=e))}_extractSvgIconFromSet(t,e,n){let i=t.querySelector(`[id="${e}"]`);if(!i)return null;let o=i.cloneNode(!0);if(o.removeAttribute("id"),o.nodeName.toLowerCase()==="svg")return this._setSvgAttributes(o,n);if(o.nodeName.toLowerCase()==="symbol")return this._setSvgAttributes(this._toSvgElement(o),n);let c=this._svgElementFromString(_("<svg></svg>"));return c.appendChild(o),this._setSvgAttributes(c,n)}_svgElementFromString(t){let e=this._document.createElement("DIV");e.innerHTML=t;let n=e.querySelector("svg");if(!n)throw Error("<svg> tag not found");return n}_toSvgElement(t){let e=this._svgElementFromString(_("<svg></svg>")),n=t.attributes;for(let i=0;i<n.length;i++){let{name:o,value:c}=n[i];o!=="id"&&e.setAttribute(o,c)}for(let i=0;i<t.childNodes.length;i++)t.childNodes[i].nodeType===this._document.ELEMENT_NODE&&e.appendChild(t.childNodes[i].cloneNode(!0));return e}_setSvgAttributes(t,e){return t.setAttribute("fit",""),t.setAttribute("height","100%"),t.setAttribute("width","100%"),t.setAttribute("preserveAspectRatio","xMidYMid meet"),t.setAttribute("focusable","false"),e&&e.viewBox&&t.setAttribute("viewBox",e.viewBox),t}_fetchIcon(t){let{url:e,options:n}=t,i=n?.withCredentials??!1;if(!this._httpClient)throw nt();if(e==null)throw Error(`Cannot fetch icon from URL "${e}".`);let o=this._sanitizer.sanitize(m.RESOURCE_URL,e);if(!o)throw J(e);let c=this._inProgressUrlFetches.get(o);if(c)return c;let l=this._httpClient.get(o,{responseType:"text",withCredentials:i}).pipe(u(h=>_(h)),b(()=>this._inProgressUrlFetches.delete(o)),L());return this._inProgressUrlFetches.set(o,l),l}_addSvgIconConfig(t,e,n){return this._svgIconConfigs.set(Q(t,e),n),this}_addSvgIconSetConfig(t,e){let n=this._iconSetConfigs.get(t);return n?n.push(e):this._iconSetConfigs.set(t,[e]),this}_svgElementFromConfig(t){if(!t.svgElement){let e=this._svgElementFromString(t.svgText);this._setSvgAttributes(e,t.options),t.svgElement=e}return t.svgElement}_getIconConfigFromResolvers(t,e){for(let n=0;n<this._resolvers.length;n++){let i=this._resolvers[n](e,t);if(i)return ot(i)?new a(i.url,null,i.options):new a(i,null)}}};s.\u0275fac=function(e){return new(e||s)(g(B,8),g(V),g(F,8),g(I))},s.\u0275prov=M({token:s,factory:s.\u0275fac,providedIn:"root"});let r=s;return r})();function C(r){return r.cloneNode(!0)}function Q(r,s){return r+":"+s}function ot(r){return!!(r.url&&r.options)}var rt=q(class{constructor(r){this._elementRef=r}}),st=new E("MAT_ICON_DEFAULT_OPTIONS"),ct=new E("mat-icon-location",{providedIn:"root",factory:at});function at(){let r=O(F),s=r?r.location:null;return{getPathname:()=>s?s.pathname+s.search:""}}var X=["clip-path","color-profile","src","cursor","fill","filter","marker","marker-start","marker-mid","marker-end","mask","stroke"],lt=X.map(r=>`[${r}]`).join(", "),ht=/^url\(['"]?#(.*?)['"]?\)$/,bt=(()=>{let s=class s extends rt{get inline(){return this._inline}set inline(t){this._inline=Y(t)}get svgIcon(){return this._svgIcon}set svgIcon(t){t!==this._svgIcon&&(t?this._updateSvgIcon(t):this._svgIcon&&this._clearSvgElement(),this._svgIcon=t)}get fontSet(){return this._fontSet}set fontSet(t){let e=this._cleanupFontValue(t);e!==this._fontSet&&(this._fontSet=e,this._updateFontIconClasses())}get fontIcon(){return this._fontIcon}set fontIcon(t){let e=this._cleanupFontValue(t);e!==this._fontIcon&&(this._fontIcon=e,this._updateFontIconClasses())}constructor(t,e,n,i,o,c){super(t),this._iconRegistry=e,this._location=i,this._errorHandler=o,this._inline=!1,this._previousFontSetClass=[],this._currentIconFetch=y.EMPTY,c&&(c.color&&(this.color=this.defaultColor=c.color),c.fontSet&&(this.fontSet=c.fontSet)),n||t.nativeElement.setAttribute("aria-hidden","true")}_splitIconName(t){if(!t)return["",""];let e=t.split(":");switch(e.length){case 1:return["",e[0]];case 2:return e;default:throw Error(`Invalid icon name: "${t}"`)}}ngOnInit(){this._updateFontIconClasses()}ngAfterViewChecked(){let t=this._elementsWithExternalReferences;if(t&&t.size){let e=this._location.getPathname();e!==this._previousPath&&(this._previousPath=e,this._prependPathToReferences(e))}}ngOnDestroy(){this._currentIconFetch.unsubscribe(),this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear()}_usingFontIcon(){return!this.svgIcon}_setSvgElement(t){this._clearSvgElement();let e=this._location.getPathname();this._previousPath=e,this._cacheChildrenWithExternalReferences(t),this._prependPathToReferences(e),this._elementRef.nativeElement.appendChild(t)}_clearSvgElement(){let t=this._elementRef.nativeElement,e=t.childNodes.length;for(this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear();e--;){let n=t.childNodes[e];(n.nodeType!==1||n.nodeName.toLowerCase()==="svg")&&n.remove()}}_updateFontIconClasses(){if(!this._usingFontIcon())return;let t=this._elementRef.nativeElement,e=(this.fontSet?this._iconRegistry.classNameForFontAlias(this.fontSet).split(/ +/):this._iconRegistry.getDefaultFontSetClass()).filter(n=>n.length>0);this._previousFontSetClass.forEach(n=>t.classList.remove(n)),e.forEach(n=>t.classList.add(n)),this._previousFontSetClass=e,this.fontIcon!==this._previousFontIconClass&&!e.includes("mat-ligature-font")&&(this._previousFontIconClass&&t.classList.remove(this._previousFontIconClass),this.fontIcon&&t.classList.add(this.fontIcon),this._previousFontIconClass=this.fontIcon)}_cleanupFontValue(t){return typeof t=="string"?t.trim().split(" ")[0]:t}_prependPathToReferences(t){let e=this._elementsWithExternalReferences;e&&e.forEach((n,i)=>{n.forEach(o=>{i.setAttribute(o.name,`url('${t}#${o.value}')`)})})}_cacheChildrenWithExternalReferences(t){let e=t.querySelectorAll(lt),n=this._elementsWithExternalReferences=this._elementsWithExternalReferences||new Map;for(let i=0;i<e.length;i++)X.forEach(o=>{let c=e[i],l=c.getAttribute(o),h=l?l.match(ht):null;if(h){let p=n.get(c);p||(p=[],n.set(c,p)),p.push({name:o,value:h[1]})}})}_updateSvgIcon(t){if(this._svgNamespace=null,this._svgName=null,this._currentIconFetch.unsubscribe(),t){let[e,n]=this._splitIconName(t);e&&(this._svgNamespace=e),n&&(this._svgName=n),this._currentIconFetch=this._iconRegistry.getNamedSvgIcon(n,e).pipe(T(1)).subscribe(i=>this._setSvgElement(i),i=>{let o=`Error retrieving icon ${e}:${n}! ${i.message}`;this._errorHandler.handleError(new Error(o))})}}};s.\u0275fac=function(e){return new(e||s)(d(j),d(it),U("aria-hidden"),d(ct),d(I),d(st,8))},s.\u0275cmp=P({type:s,selectors:[["mat-icon"]],hostAttrs:["role","img",1,"mat-icon","notranslate"],hostVars:8,hostBindings:function(e,n){e&2&&(H("data-mat-icon-type",n._usingFontIcon()?"font":"svg")("data-mat-icon-name",n._svgName||n.fontIcon)("data-mat-icon-namespace",n._svgNamespace||n.fontSet)("fontIcon",n._usingFontIcon()?n.fontIcon:null),k("mat-icon-inline",n.inline)("mat-icon-no-color",n.color!=="primary"&&n.color!=="accent"&&n.color!=="warn"))},inputs:{color:"color",inline:"inline",svgIcon:"svgIcon",fontSet:"fontSet",fontIcon:"fontIcon"},exportAs:["matIcon"],features:[z],ngContentSelectors:tt,decls:1,vars:0,template:function(e,n){e&1&&(W(),$(0))},styles:["mat-icon,mat-icon.mat-primary,mat-icon.mat-accent,mat-icon.mat-warn{color:var(--mat-icon-color)}.mat-icon{-webkit-user-select:none;user-select:none;background-repeat:no-repeat;display:inline-block;fill:currentColor;height:24px;width:24px;overflow:hidden}.mat-icon.mat-icon-inline{font-size:inherit;height:inherit;line-height:inherit;width:inherit}.mat-icon.mat-ligature-font[fontIcon]::before{content:attr(fontIcon)}[dir=rtl] .mat-icon-rtl-mirror{transform:scale(-1, 1)}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon{display:block}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mat-icon{margin:auto}"],encapsulation:2,changeDetection:0});let r=s;return r})(),Lt=(()=>{let s=class s{};s.\u0275fac=function(e){return new(e||s)},s.\u0275mod=D({type:s}),s.\u0275inj=x({imports:[w,w]});let r=s;return r})();export{bt as a,Lt as b};
1
+ import{J as w,L as q,a as Y}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-LYFRN35D.js";import{$ as M,Ba as j,E as A,Ea as I,Ga as d,I as T,La as z,M as b,Na as H,P as L,Qa as k,Vb as F,X as v,a as y,aa as x,ba as E,ca as g,da as O,ea as P,fa as D,jc as B,kb as W,lb as $,n as f,o as R,oa as U,q as u,qc as V,w as N,xa as m}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.3/Marketplace/chunk-TIWU4GET.js";var tt=["*"],S;function et(){if(S===void 0&&(S=null,typeof window<"u")){let r=window;r.trustedTypes!==void 0&&(S=r.trustedTypes.createPolicy("angular#components",{createHTML:s=>s}))}return S}function _(r){return et()?.createHTML(r)||r}function G(r){return Error(`Unable to find icon with the name "${r}"`)}function nt(){return Error("Could not find HttpClient provider for use with Angular Material icons. Please include the HttpClientModule from @angular/common/http in your app imports.")}function J(r){return Error(`The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was "${r}".`)}function K(r){return Error(`The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was "${r}".`)}var a=class{constructor(s,Z,t){this.url=s,this.svgText=Z,this.options=t}},it=(()=>{let s=class s{constructor(t,e,n,i){this._httpClient=t,this._sanitizer=e,this._errorHandler=i,this._svgIconConfigs=new Map,this._iconSetConfigs=new Map,this._cachedIconsByUrl=new Map,this._inProgressUrlFetches=new Map,this._fontCssClassesByAlias=new Map,this._resolvers=[],this._defaultFontSetClass=["material-icons","mat-ligature-font"],this._document=n}addSvgIcon(t,e,n){return this.addSvgIconInNamespace("",t,e,n)}addSvgIconLiteral(t,e,n){return this.addSvgIconLiteralInNamespace("",t,e,n)}addSvgIconInNamespace(t,e,n,i){return this._addSvgIconConfig(t,e,new a(n,null,i))}addSvgIconResolver(t){return this._resolvers.push(t),this}addSvgIconLiteralInNamespace(t,e,n,i){let o=this._sanitizer.sanitize(m.HTML,n);if(!o)throw K(n);let c=_(o);return this._addSvgIconConfig(t,e,new a("",c,i))}addSvgIconSet(t,e){return this.addSvgIconSetInNamespace("",t,e)}addSvgIconSetLiteral(t,e){return this.addSvgIconSetLiteralInNamespace("",t,e)}addSvgIconSetInNamespace(t,e,n){return this._addSvgIconSetConfig(t,new a(e,null,n))}addSvgIconSetLiteralInNamespace(t,e,n){let i=this._sanitizer.sanitize(m.HTML,e);if(!i)throw K(e);let o=_(i);return this._addSvgIconSetConfig(t,new a("",o,n))}registerFontClassAlias(t,e=t){return this._fontCssClassesByAlias.set(t,e),this}classNameForFontAlias(t){return this._fontCssClassesByAlias.get(t)||t}setDefaultFontSetClass(...t){return this._defaultFontSetClass=t,this}getDefaultFontSetClass(){return this._defaultFontSetClass}getSvgIconFromUrl(t){let e=this._sanitizer.sanitize(m.RESOURCE_URL,t);if(!e)throw J(t);let n=this._cachedIconsByUrl.get(e);return n?f(C(n)):this._loadSvgIconFromConfig(new a(t,null)).pipe(v(i=>this._cachedIconsByUrl.set(e,i)),u(i=>C(i)))}getNamedSvgIcon(t,e=""){let n=Q(e,t),i=this._svgIconConfigs.get(n);if(i)return this._getSvgFromConfig(i);if(i=this._getIconConfigFromResolvers(e,t),i)return this._svgIconConfigs.set(n,i),this._getSvgFromConfig(i);let o=this._iconSetConfigs.get(e);return o?this._getSvgFromIconSetConfigs(t,o):R(G(n))}ngOnDestroy(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}_getSvgFromConfig(t){return t.svgText?f(C(this._svgElementFromConfig(t))):this._loadSvgIconFromConfig(t).pipe(u(e=>C(e)))}_getSvgFromIconSetConfigs(t,e){let n=this._extractIconWithNameFromAnySet(t,e);if(n)return f(n);let i=e.filter(o=>!o.svgText).map(o=>this._loadSvgIconSetFromConfig(o).pipe(A(c=>{let h=`Loading icon set URL: ${this._sanitizer.sanitize(m.RESOURCE_URL,o.url)} failed: ${c.message}`;return this._errorHandler.handleError(new Error(h)),f(null)})));return N(i).pipe(u(()=>{let o=this._extractIconWithNameFromAnySet(t,e);if(!o)throw G(t);return o}))}_extractIconWithNameFromAnySet(t,e){for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.svgText&&i.svgText.toString().indexOf(t)>-1){let o=this._svgElementFromConfig(i),c=this._extractSvgIconFromSet(o,t,i.options);if(c)return c}}return null}_loadSvgIconFromConfig(t){return this._fetchIcon(t).pipe(v(e=>t.svgText=e),u(()=>this._svgElementFromConfig(t)))}_loadSvgIconSetFromConfig(t){return t.svgText?f(null):this._fetchIcon(t).pipe(v(e=>t.svgText=e))}_extractSvgIconFromSet(t,e,n){let i=t.querySelector(`[id="${e}"]`);if(!i)return null;let o=i.cloneNode(!0);if(o.removeAttribute("id"),o.nodeName.toLowerCase()==="svg")return this._setSvgAttributes(o,n);if(o.nodeName.toLowerCase()==="symbol")return this._setSvgAttributes(this._toSvgElement(o),n);let c=this._svgElementFromString(_("<svg></svg>"));return c.appendChild(o),this._setSvgAttributes(c,n)}_svgElementFromString(t){let e=this._document.createElement("DIV");e.innerHTML=t;let n=e.querySelector("svg");if(!n)throw Error("<svg> tag not found");return n}_toSvgElement(t){let e=this._svgElementFromString(_("<svg></svg>")),n=t.attributes;for(let i=0;i<n.length;i++){let{name:o,value:c}=n[i];o!=="id"&&e.setAttribute(o,c)}for(let i=0;i<t.childNodes.length;i++)t.childNodes[i].nodeType===this._document.ELEMENT_NODE&&e.appendChild(t.childNodes[i].cloneNode(!0));return e}_setSvgAttributes(t,e){return t.setAttribute("fit",""),t.setAttribute("height","100%"),t.setAttribute("width","100%"),t.setAttribute("preserveAspectRatio","xMidYMid meet"),t.setAttribute("focusable","false"),e&&e.viewBox&&t.setAttribute("viewBox",e.viewBox),t}_fetchIcon(t){let{url:e,options:n}=t,i=n?.withCredentials??!1;if(!this._httpClient)throw nt();if(e==null)throw Error(`Cannot fetch icon from URL "${e}".`);let o=this._sanitizer.sanitize(m.RESOURCE_URL,e);if(!o)throw J(e);let c=this._inProgressUrlFetches.get(o);if(c)return c;let l=this._httpClient.get(o,{responseType:"text",withCredentials:i}).pipe(u(h=>_(h)),b(()=>this._inProgressUrlFetches.delete(o)),L());return this._inProgressUrlFetches.set(o,l),l}_addSvgIconConfig(t,e,n){return this._svgIconConfigs.set(Q(t,e),n),this}_addSvgIconSetConfig(t,e){let n=this._iconSetConfigs.get(t);return n?n.push(e):this._iconSetConfigs.set(t,[e]),this}_svgElementFromConfig(t){if(!t.svgElement){let e=this._svgElementFromString(t.svgText);this._setSvgAttributes(e,t.options),t.svgElement=e}return t.svgElement}_getIconConfigFromResolvers(t,e){for(let n=0;n<this._resolvers.length;n++){let i=this._resolvers[n](e,t);if(i)return ot(i)?new a(i.url,null,i.options):new a(i,null)}}};s.\u0275fac=function(e){return new(e||s)(g(B,8),g(V),g(F,8),g(I))},s.\u0275prov=M({token:s,factory:s.\u0275fac,providedIn:"root"});let r=s;return r})();function C(r){return r.cloneNode(!0)}function Q(r,s){return r+":"+s}function ot(r){return!!(r.url&&r.options)}var rt=q(class{constructor(r){this._elementRef=r}}),st=new E("MAT_ICON_DEFAULT_OPTIONS"),ct=new E("mat-icon-location",{providedIn:"root",factory:at});function at(){let r=O(F),s=r?r.location:null;return{getPathname:()=>s?s.pathname+s.search:""}}var X=["clip-path","color-profile","src","cursor","fill","filter","marker","marker-start","marker-mid","marker-end","mask","stroke"],lt=X.map(r=>`[${r}]`).join(", "),ht=/^url\(['"]?#(.*?)['"]?\)$/,bt=(()=>{let s=class s extends rt{get inline(){return this._inline}set inline(t){this._inline=Y(t)}get svgIcon(){return this._svgIcon}set svgIcon(t){t!==this._svgIcon&&(t?this._updateSvgIcon(t):this._svgIcon&&this._clearSvgElement(),this._svgIcon=t)}get fontSet(){return this._fontSet}set fontSet(t){let e=this._cleanupFontValue(t);e!==this._fontSet&&(this._fontSet=e,this._updateFontIconClasses())}get fontIcon(){return this._fontIcon}set fontIcon(t){let e=this._cleanupFontValue(t);e!==this._fontIcon&&(this._fontIcon=e,this._updateFontIconClasses())}constructor(t,e,n,i,o,c){super(t),this._iconRegistry=e,this._location=i,this._errorHandler=o,this._inline=!1,this._previousFontSetClass=[],this._currentIconFetch=y.EMPTY,c&&(c.color&&(this.color=this.defaultColor=c.color),c.fontSet&&(this.fontSet=c.fontSet)),n||t.nativeElement.setAttribute("aria-hidden","true")}_splitIconName(t){if(!t)return["",""];let e=t.split(":");switch(e.length){case 1:return["",e[0]];case 2:return e;default:throw Error(`Invalid icon name: "${t}"`)}}ngOnInit(){this._updateFontIconClasses()}ngAfterViewChecked(){let t=this._elementsWithExternalReferences;if(t&&t.size){let e=this._location.getPathname();e!==this._previousPath&&(this._previousPath=e,this._prependPathToReferences(e))}}ngOnDestroy(){this._currentIconFetch.unsubscribe(),this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear()}_usingFontIcon(){return!this.svgIcon}_setSvgElement(t){this._clearSvgElement();let e=this._location.getPathname();this._previousPath=e,this._cacheChildrenWithExternalReferences(t),this._prependPathToReferences(e),this._elementRef.nativeElement.appendChild(t)}_clearSvgElement(){let t=this._elementRef.nativeElement,e=t.childNodes.length;for(this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear();e--;){let n=t.childNodes[e];(n.nodeType!==1||n.nodeName.toLowerCase()==="svg")&&n.remove()}}_updateFontIconClasses(){if(!this._usingFontIcon())return;let t=this._elementRef.nativeElement,e=(this.fontSet?this._iconRegistry.classNameForFontAlias(this.fontSet).split(/ +/):this._iconRegistry.getDefaultFontSetClass()).filter(n=>n.length>0);this._previousFontSetClass.forEach(n=>t.classList.remove(n)),e.forEach(n=>t.classList.add(n)),this._previousFontSetClass=e,this.fontIcon!==this._previousFontIconClass&&!e.includes("mat-ligature-font")&&(this._previousFontIconClass&&t.classList.remove(this._previousFontIconClass),this.fontIcon&&t.classList.add(this.fontIcon),this._previousFontIconClass=this.fontIcon)}_cleanupFontValue(t){return typeof t=="string"?t.trim().split(" ")[0]:t}_prependPathToReferences(t){let e=this._elementsWithExternalReferences;e&&e.forEach((n,i)=>{n.forEach(o=>{i.setAttribute(o.name,`url('${t}#${o.value}')`)})})}_cacheChildrenWithExternalReferences(t){let e=t.querySelectorAll(lt),n=this._elementsWithExternalReferences=this._elementsWithExternalReferences||new Map;for(let i=0;i<e.length;i++)X.forEach(o=>{let c=e[i],l=c.getAttribute(o),h=l?l.match(ht):null;if(h){let p=n.get(c);p||(p=[],n.set(c,p)),p.push({name:o,value:h[1]})}})}_updateSvgIcon(t){if(this._svgNamespace=null,this._svgName=null,this._currentIconFetch.unsubscribe(),t){let[e,n]=this._splitIconName(t);e&&(this._svgNamespace=e),n&&(this._svgName=n),this._currentIconFetch=this._iconRegistry.getNamedSvgIcon(n,e).pipe(T(1)).subscribe(i=>this._setSvgElement(i),i=>{let o=`Error retrieving icon ${e}:${n}! ${i.message}`;this._errorHandler.handleError(new Error(o))})}}};s.\u0275fac=function(e){return new(e||s)(d(j),d(it),U("aria-hidden"),d(ct),d(I),d(st,8))},s.\u0275cmp=P({type:s,selectors:[["mat-icon"]],hostAttrs:["role","img",1,"mat-icon","notranslate"],hostVars:8,hostBindings:function(e,n){e&2&&(H("data-mat-icon-type",n._usingFontIcon()?"font":"svg")("data-mat-icon-name",n._svgName||n.fontIcon)("data-mat-icon-namespace",n._svgNamespace||n.fontSet)("fontIcon",n._usingFontIcon()?n.fontIcon:null),k("mat-icon-inline",n.inline)("mat-icon-no-color",n.color!=="primary"&&n.color!=="accent"&&n.color!=="warn"))},inputs:{color:"color",inline:"inline",svgIcon:"svgIcon",fontSet:"fontSet",fontIcon:"fontIcon"},exportAs:["matIcon"],features:[z],ngContentSelectors:tt,decls:1,vars:0,template:function(e,n){e&1&&(W(),$(0))},styles:["mat-icon,mat-icon.mat-primary,mat-icon.mat-accent,mat-icon.mat-warn{color:var(--mat-icon-color)}.mat-icon{-webkit-user-select:none;user-select:none;background-repeat:no-repeat;display:inline-block;fill:currentColor;height:24px;width:24px;overflow:hidden}.mat-icon.mat-icon-inline{font-size:inherit;height:inherit;line-height:inherit;width:inherit}.mat-icon.mat-ligature-font[fontIcon]::before{content:attr(fontIcon)}[dir=rtl] .mat-icon-rtl-mirror{transform:scale(-1, 1)}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon{display:block}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mat-icon{margin:auto}"],encapsulation:2,changeDetection:0});let r=s;return r})(),Lt=(()=>{let s=class s{};s.\u0275fac=function(e){return new(e||s)},s.\u0275mod=D({type:s}),s.\u0275inj=x({imports:[w,w]});let r=s;return r})();export{bt as a,Lt as b};