marketplacepos 5.41.3 → 5.41.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/Marketplace/{chunk-PVUSCHKJ.js → chunk-3CZJUTLZ.js} +1 -1
  2. package/Marketplace/{chunk-CTN7GW4H.js → chunk-4S4G5UPJ.js} +1 -1
  3. package/Marketplace/{chunk-VWFLNITX.js → chunk-5FEQZAWX.js} +1 -1
  4. package/Marketplace/chunk-742J5UZZ.js +1 -0
  5. package/Marketplace/{chunk-4NRAXW65.js → chunk-7G53KEUW.js} +1 -1
  6. package/Marketplace/{chunk-X3LH2IJE.js → chunk-7P3SGW2P.js} +1 -1
  7. package/Marketplace/{chunk-4AMQ66FW.js → chunk-AIIRPK4M.js} +1 -1
  8. package/Marketplace/{chunk-GJOCO2OS.js → chunk-B54QGLED.js} +2 -2
  9. package/Marketplace/{chunk-REFJUWLL.js → chunk-BG6DO7RW.js} +1 -1
  10. package/Marketplace/{chunk-GSPHYK6J.js → chunk-DVE7IIN7.js} +1 -1
  11. package/Marketplace/{chunk-DRSUXHAY.js → chunk-E3HHEPKQ.js} +1 -1
  12. package/Marketplace/{chunk-GBXNTL4E.js → chunk-E6HA2AGS.js} +1 -1
  13. package/Marketplace/{chunk-5S6SIKR7.js → chunk-EYNCNJ3I.js} +1 -1
  14. package/Marketplace/{chunk-VAU6MFH7.js → chunk-FX6CFPPN.js} +1 -1
  15. package/Marketplace/{chunk-3E5FYRN4.js → chunk-G5CQLP7H.js} +1 -1
  16. package/Marketplace/{chunk-NMJGLMWI.js → chunk-GCJBQRHI.js} +1 -1
  17. package/Marketplace/chunk-HMB7FZD7.js +1 -0
  18. package/Marketplace/{chunk-6AKFGBPY.js → chunk-HNYOBOEW.js} +2 -2
  19. package/Marketplace/{chunk-PJ72KMDS.js → chunk-HUMGZRJQ.js} +1 -1
  20. package/Marketplace/{chunk-IEYFOHME.js → chunk-ICSMRW7O.js} +1 -1
  21. package/Marketplace/{chunk-BIQHA7UA.js → chunk-ITTRZMEX.js} +1 -1
  22. package/Marketplace/{chunk-DI4V7KMK.js → chunk-JTZJTXCN.js} +1 -1
  23. package/Marketplace/{chunk-4XMCJ7I5.js → chunk-K3FQGMAY.js} +1 -1
  24. package/Marketplace/{chunk-CMCNEAGC.js → chunk-KC2DJUBC.js} +1 -1
  25. package/Marketplace/{chunk-GSH5BYZ6.js → chunk-KOJ2R5XW.js} +1 -1
  26. package/Marketplace/{chunk-JDEKWXPV.js → chunk-L4JWBBBC.js} +1 -1
  27. package/Marketplace/{chunk-CHZLFJFI.js → chunk-LEMNVA5V.js} +2 -2
  28. package/Marketplace/{chunk-3PNMJUYQ.js → chunk-LFJIZAV2.js} +2 -2
  29. package/Marketplace/chunk-LJTMOYLO.js +1 -0
  30. package/Marketplace/{chunk-26DZ5AMC.js → chunk-O5SSMLCS.js} +1 -1
  31. package/Marketplace/{chunk-YR2WEZDG.js → chunk-OAS72QB2.js} +1 -1
  32. package/Marketplace/{chunk-RIYAYANU.js → chunk-OAVAVDIP.js} +1 -1
  33. package/Marketplace/chunk-PQ6Z7K5L.js +1 -0
  34. package/Marketplace/{chunk-DZ2EE5MV.js → chunk-PZTMYAA7.js} +1 -1
  35. package/Marketplace/{chunk-U5VX6JLT.js → chunk-QJFAPDI7.js} +1 -1
  36. package/Marketplace/{chunk-ZHUHOS5T.js → chunk-REYGC4GG.js} +1 -1
  37. package/Marketplace/{chunk-RBC7ADJF.js → chunk-S7LCZRSD.js} +1 -1
  38. package/Marketplace/{chunk-AWDLMHBL.js → chunk-SL4ID42P.js} +1 -1
  39. package/Marketplace/chunk-SZ6MQ6EW.js +1 -0
  40. package/Marketplace/{chunk-VJKFHBPN.js → chunk-TXPNZLOJ.js} +1 -1
  41. package/Marketplace/{chunk-AMXLXRQK.js → chunk-TZXF4K2V.js} +1 -1
  42. package/Marketplace/{chunk-5KMCSNS6.js → chunk-UUUVVJG4.js} +1 -1
  43. package/Marketplace/{chunk-CPAHXWMO.js → chunk-VDSO2BHA.js} +1 -1
  44. package/Marketplace/{chunk-HKYVBAMV.js → chunk-XFCMKJV6.js} +1 -1
  45. package/Marketplace/{chunk-Q2R4GEW5.js → chunk-Y7VC2AGS.js} +1 -1
  46. package/Marketplace/{chunk-7XREAR3H.js → chunk-YPM6IC2W.js} +1 -1
  47. package/Marketplace/chunk-Z46DDENN.js +1 -0
  48. package/Marketplace/index.html +2 -2
  49. package/Marketplace/{main-CCWBPZQH.js → main-5HHAD6NX.js} +1 -1
  50. package/package.json +1 -1
  51. package/Marketplace/chunk-2G6NLWKN.js +0 -1
  52. package/Marketplace/chunk-4RTZASVJ.js +0 -1
  53. package/Marketplace/chunk-CYZQNZDB.js +0 -1
  54. package/Marketplace/chunk-JFJCXZD3.js +0 -1
  55. package/Marketplace/chunk-KQOYVGBL.js +0 -1
@@ -0,0 +1 @@
1
+ import{a as He}from"./chunk-PQ6Z7K5L.js";import{a as Te}from"./chunk-4S4G5UPJ.js";import"./chunk-MS4AQ6UA.js";import{a as K}from"./chunk-ZD5LURJS.js";import{a as De,b as Oe}from"./chunk-VSEWXNVC.js";import{a as ze}from"./chunk-PPDHTO44.js";import{a as at}from"./chunk-7KG3DC5J.js";import{b as Ge}from"./chunk-ICSMRW7O.js";import"./chunk-YXFTLQ5M.js";import{a as we,b as Me}from"./chunk-OE2JYQHN.js";import{e as xt}from"./chunk-AIIRPK4M.js";import{a as Ne}from"./chunk-VETHPEVU.js";import{i as Re,j as Be,k as je,l as $e,m as We}from"./chunk-75BDXSG3.js";import"./chunk-6NNAICJE.js";import"./chunk-LPXBSHUI.js";import"./chunk-D54NUPYF.js";import{a as H}from"./chunk-EGTYAIU5.js";import"./chunk-7TWBIV3T.js";import"./chunk-J7AGLBPL.js";import"./chunk-6ALHX2I4.js";import"./chunk-4G3QN54S.js";import"./chunk-3RK6DDJD.js";import{a as Gt}from"./chunk-J3P46Z53.js";import{a as q}from"./chunk-4ASUM4N5.js";import{b as Ke}from"./chunk-7FUVW73P.js";import{a as Ae,b as Ue}from"./chunk-M3SJUKTG.js";import{a as $t,b as Wt,c as Ee}from"./chunk-GHQH62TZ.js";import"./chunk-CH2MLZU7.js";import{a as st}from"./chunk-YPM6IC2W.js";import{a as rt}from"./chunk-62PFQNHJ.js";import{c as Fe,f as Ve}from"./chunk-Q72ZXPDP.js";import"./chunk-MNFHFW3E.js";import"./chunk-ZZVNB72Q.js";import{a as Le}from"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import{a as jt}from"./chunk-RIHLYYZU.js";import{f as ke}from"./chunk-Q2OEJFVT.js";import{a as gt,b as Lt,d as nt,e as xe}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{j as Se,l as G}from"./chunk-LEMNVA5V.js";import{b as $,e as W}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{b as Ct,c as ft,d as Z,e as ye,f as ve,g as be,h as Pe,i as Rt,j as St,k as Bt,m as z,n as Ie}from"./chunk-ITTRZMEX.js";import{r as it,s as ot}from"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{b as fe,c as ht,h as U,m as L,y as _t}from"./chunk-DPLEMBB4.js";import{b as I,c as f}from"./chunk-PXB4YEY3.js";import{E as At,F as ge,G as et,H as Ut,J as Ce,d as Nt,f as A,g as V,j as mt,k as _e,m as ut,n as Y}from"./chunk-GPEVUTDI.js";import{$c as he,Dc as B,Eb as M,Ec as p,Fb as de,Fc as N,G as F,Gc as y,Ic as T,Jc as D,Ka as It,Kb as C,Kc as O,Pc as ct,Qa as wt,Qc as Q,Rc as Xt,Tc as ue,Vb as Yt,Wb as l,Xb as pe,Z as re,Zc as k,_c as E,aa as Ft,ad as j,bc as lt,ca as Jt,cc as Zt,ea as le,ec as qt,f as ae,fc as Qt,gc as o,hc as a,ic as _,jc as b,ka as ce,kc as P,mc as x,nb as se,ob as w,pa as tt,qb as r,rc as g,sc as s,tc as me,uc as Vt,v as Et,wb as S,ya as m,za as u}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var ln=()=>["/menu/products/download/by-url"],Je=(()=>{class i{constructor(){this.productTabs=[{Title:"Sold in Channel",Url:"/menu/products/status/sold-in-channel",Description:"SKU has been mapped between dealpos and marketplace"},{Title:"Not in POS",Url:"/menu/products/status/not-in-pos",Description:"SKU sold in Marketplace but not exist in DEALPOS"},{Title:"Not in Channel",Url:"/menu/products/status/not-in-channel",Description:"SKU has not been sold on one of channels"},{Title:"In POS",Url:"/menu/products/status/in-pos",Description:"All products which is already available in POS"},{Title:"Multiple Listing",Url:"/menu/products/status/duplicate-sku",Description:"SKU(s) which is listed more than one time (one to many)"},{Title:"Channel Statistic",Url:"/menu/products/status/channel-statistic",Description:"Product statistic from each channel obtained from the last product scan"}]}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=M({type:i,selectors:[["app-status"]],standalone:!1,decls:13,vars:3,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-flex"],[1,"dropdown-item",3,"routerLink"]],template:function(n,e){n&1&&(o(0,"nav",0)(1,"div",1)(2,"div"),_(3,"nav-tab",2),a()(),o(4,"div")(5,"div",3)(6,"a",4),_(7,"i",5),a(),o(8,"div",6)(9,"div",7)(10,"a",8),p(11,"Download Product By Url"),a()()()()()(),_(12,"router-outlet")),n&2&&(r(3),l("Tabs",e.productTabs),r(7),l("routerLink",ct(2,ln)))},dependencies:[we,ge,Ut],encapsulation:2})}}return i})();function cn(i,d){if(i&1&&(o(0,"div",10),_(1,"img",11),o(2,"span"),p(3),a()()),i&2){let t=d.$implicit;l("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),r(),l("src",t.Img,w),r(2),N(t.Name)}}function sn(i,d){if(i&1&&(o(0,"div",10),_(1,"img",11),o(2,"span"),p(3),a()()),i&2){let t=d.$implicit;l("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),r(),l("src",t.Img,w),r(2),N(t.Name)}}function dn(i,d){if(i&1&&(o(0,"div",10),_(1,"img",11),o(2,"span"),p(3),a()()),i&2){let t=d.$implicit;l("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),r(),l("src",t.Img,w),r(2),N(t.Name)}}function pn(i,d){if(i&1){let t=x();o(0,"div",12)(1,"label",13),p(2,"Scan Type"),a(),o(3,"mat-radio-group",14),O("ngModelChange",function(e){m(t);let c=s();return D(c.filter.ScanFull,e)||(c.filter.ScanFull=e),u(e)}),o(4,"mat-radio-button",15),p(5," Full (Include Inactive Products) "),a(),o(6,"mat-radio-button",16),p(7," Active "),a()()()}if(i&2){let t=s();r(3),T("ngModel",t.filter.ScanFull),r(),l("value",!0),r(2),l("value",!1)}}function mn(i,d){i&1&&(o(0,"span"),p(1,"Never"),a())}function un(i,d){if(i&1&&(o(0,"span"),p(1),k(2,"async"),a()),i&2){let t=s(2);r(),N(E(2,1,t.lastSync$))}}function hn(i,d){if(i&1){let t=x();o(0,"div",8)(1,"label",5)(2,"span",17),p(3,"Last Scan:"),a(),C(4,mn,2,0,"span"),k(5,"async"),C(6,un,3,3,"span"),a(),o(7,"mat-radio-group",18),O("ngModelChange",function(e){m(t);let c=s();return D(c.filter.UpdatedProduct,e)||(c.filter.UpdatedProduct=e),u(e)}),o(8,"mat-radio-button",19),p(9," Scan All Products "),a(),o(10,"mat-radio-button",20),p(11),a()()()}if(i&2){let t=s();r(4),lt(E(5,6,t.lastSync$)==null?4:6),r(3),T("ngModel",t.filter.UpdatedProduct),r(),l("value",!1),r(2),l("value",!0)("matTooltip",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Use Tokopedia URL for mapping SKU between POS and Tokopedia":"Scan only products that have been updated since the last channel scan"),r(),y(" ",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Product Download By URL":"Scan Updated Products"," ")}}function _n(i,d){if(i&1){let t=x();o(0,"div",8)(1,"label",5),p(2," Scan Option "),a(),o(3,"mat-radio-group",21),O("ngModelChange",function(e){m(t);let c=s();return D(c.filter.Async,e)||(c.filter.Async=e),u(e)}),o(4,"mat-radio-button",22),p(5," Asynchronous (Get Notified when Complete) "),a(),o(6,"mat-radio-button",23),p(7," Synchronous (Wait until Complete) "),a()()()}if(i&2){let t=s();r(3),T("ngModel",t.filter.Async),r(),l("value",!0),r(2),l("value",!1)}}var R=(()=>{class i{constructor(t,n,e){this.dialogRef=t,this.data=n,this.router=e,this.channelService=tt(Te),this.channelType=I,this.disabledChannelOption=!1,this.filter={ChannelID:f.GuidEMpty,ScanFull:!1,UpdatedProduct:!1,Async:!1},this.isSingleChannel=f.IsNotEmpty(n.isSingleChannel)?this.data.isSingleChannel:!1,this.disabledChannelOption=f.IsEmpty(n.disabledChannelOption)?!1:this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new St,this.modalConfig.title=this.isSingleChannel?"Scan Single Product":"Scan Channel Marketplace",this.modalConfig.bodyScrollable=!0}initFilter(){this.filter.ChannelID=this.data?.filter?.ChannelID}initChannelOptions(){this.channelOptions=JSON.parse(JSON.stringify(this.data.channelOptions)),this.isSingleChannel&&(this.channelOptions=this.channelOptions.map(t=>(t.disabled=!0,(t.TypeID==I.Tiktok||t.TypeID==I.Tokopedia||t.TypeID==I.Lazada||t.TypeID==I.WooCommerce)&&(t.disabled=!1),t)).sort(t=>t.disabled?1:-1))}onSelectChannel(t){let n=this.filterChannelById(t);this.selectedChannel=n,this.filter.Async=!0,this.iniHasScanUpdate(),this.getLastSync(t)}getLastSync(t){this.lastSync$=this.channelService.getLastSync(t).pipe(Et(n=>(this.selectedChannel.LastSync=n.LastSync,this.setDefaultConfigUpdate(),f.IsNotEmpty(n.LastSync)?f.convertToReadableDate(n.LastSync):null)),re(1))}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&f.IsNotEmpty(this.selectedChannel.LastSync)&&(this.selectedChannel.TypeID==I.Shopee||this.selectedChannel.TypeID==I.Tiktok||this.selectedChannel.TypeID==I.Lazada)&&(this.filter.UpdatedProduct=!0)}iniHasScanUpdate(){this.selectedChannel?.TypeID!=I.WooCommerce&&this.selectedChannel?.TypeID!=I.KalCare&&this.selectedChannel?.TypeID!=I.None&&!this.isSingleChannel?this.hasScanUpdate=!0:this.hasScanUpdate=!1}filterChannelById(t){let n;return this.channelOptions&&(n=this.channelOptions.find(e=>e.ID==t)),n}submit(){this.selectedChannel.TypeID==I.Tokopedia&&this.filter.UpdatedProduct?this.router.navigate(["/menu/products/download/by-url"]).then(()=>{this.dialogRef.close()}):this.dialogRef.close(this.filter)}isNotEmpty(t){return f.IsNotEmpty(t)}onClose(){this.dialogRef.close()}static{this.\u0275fac=function(n){return new(n||i)(S(Ct),S(ft),S(et))}}static{this.\u0275cmp=M({type:i,selectors:[["app-scan-dialog"]],decls:15,vars:8,consts:[["selectedItem",""],["item",""],[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[1,"mx-4"],[1,"mb-2","fw-bold"],["optionLabel","Name","optionValue","ID","placeholder","Select a Channel","appendTo","body","filterBy","Name",1,"w-100",2,"--p-select-padding-y","0.75rem",3,"ngModelChange","options","ngModel","filter"],["class","mt-4",4,"ngIf"],[1,"mt-8"],["class","mt-8",4,"ngIf"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],[2,"width","18px","margin-right","10px",3,"src"],[1,"mt-4"],[1,"mb-2","fw-bold","mt-3"],["name","scanType",1,"form-control","h-100","rounded-1",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Full Scan Product",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Only Active Product",1,"me-5",3,"value"],[1,"me-2"],["name","ScanFull",1,"form-control","h-100","rounded-1",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Scan product from beginning ( use this if you haven't scanned at all)",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above",1,"me-5",3,"value","matTooltip"],["name","Async",1,"form-control","h-100","rounded-1",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltip","Scan is running in the background, status will be visible in the notification menu","matTooltipPosition","above",1,"me-5",3,"value"],[1,"me-5",3,"value"]],template:function(n,e){if(n&1){let c=x();o(0,"modal-material",2),g("onOk",function(){return m(c),u(e.submit())})("onClose",function(){return m(c),u(e.onClose())})("onCancel",function(){return m(c),u(e.onClose())}),o(1,"div",3)(2,"div",4)(3,"label",5),p(4,"Select a Channel"),a(),o(5,"p-select",6),O("ngModelChange",function(v){return m(c),D(e.filter.ChannelID,v)||(e.filter.ChannelID=v),u(v)}),g("ngModelChange",function(v){return m(c),u(e.onSelectChannel(v))}),C(6,cn,4,3,"ng-template",null,0,j)(8,sn,4,3,"ng-template",null,1,j)(10,dn,4,3,"ng-template",null,1,j),a(),C(12,pn,8,3,"div",7)(13,hn,12,8,"div",8)(14,_n,8,3,"div",9),a()()()}n&2&&(l("dynamicValidated",e.isNotEmpty(e.filter.ChannelID))("config",e.modalConfig),r(5),l("options",e.channelOptions),T("ngModel",e.filter.ChannelID),l("filter",!0),r(7),l("ngIf",!e.isSingleChannel&&e.isNotEmpty(e.filter.ChannelID)),r(),lt(e.hasScanUpdate&&e.selectedChannel?13:-1),r(),l("ngIf",!e.isSingleChannel&&e.isNotEmpty(e.filter.ChannelID)))},dependencies:[Y,V,mt,Oe,De,_t,U,L,Bt,jt,Wt,ot,it,Ve,$t],encapsulation:2})}}return i})();var pt=function(i){return i.Tokopedia="https://seller.tokopedia.com",i.Shoope="https://seller.shopee.co.id",i.Tiktok="https://seller-id.tiktok.com",i.WooCommerce="https://woocommerce.dealpos.app",i.Lazada="https://sellercenter.lazada.co.id",i}(pt||{});var ee={Success:"Success",Info:"Info",Warning:"Warning",Error:"Error"};var gn=[[["header"]],[["content"]],[["footer"]]],Cn=["header","content","footer"],fn=(i,d)=>({bodyScrollable:i,hideScrollbar:d}),Sn=(i,d,t,n)=>({"bg-success":i,"bg-warning":d,"bg-info":t,"bg-danger":n}),xn=i=>({"mx-auto":i}),yn=(i,d)=>({"show-footer":i,"p-0":d});function vn(i,d){if(i&1){let t=x();o(0,"div",8),g("click",function(){m(t);let e=s();return u(e.onBack.emit())}),o(1,"a",9),_(2,"i",10),a()()}}function bn(i,d){if(i&1){let t=x();o(0,"div")(1,"a",11),g("click",function(){m(t);let e=s();return u(e.onClose.emit())}),_(2,"i",12),a()()}}function Pn(i,d){if(i&1){let t=x();o(0,"a",16),g("click",function(){m(t);let e=s(2);return u(e.onCancel.emit())}),p(1),a()}if(i&2){let t=s(2);r(),y(" ",t.config!=null&&t.config.cancelText?t.config==null?null:t.config.cancelText:"Cancel","")}}function In(i,d){if(i&1){let t=x();o(0,"button",17),g("click",function(){m(t);let e=s(2);return u(e.onOk.emit())})("keyup.F2",function(){m(t);let e=s(2);return u(e.onOk.emit())}),a()}if(i&2){let t=s(2);l("disabled",!(t.config!=null&&t.config.validated)||!t.dynamicValidated)("innerHTML",t.config!=null&&t.config.okText?t.config==null?null:t.config.okText:"Ok (F2)",se)}}function wn(i,d){if(i&1&&(o(0,"mat-dialog-actions",13),Vt(1,2),C(2,Pn,2,1,"a",14)(3,In,1,2,"button",15),a()),i&2){let t=s();r(2),l("ngIf",!(t.config!=null&&t.config.hideCancel)),r(),l("ngIf",!(t.config!=null&&t.config.hideOk))}}var ne=class{constructor(){this.title="New Modal",this.okText="Ok (F2)",this.cancelText="Cancel",this.hideFooter=!1,this.hideCancel=!1,this.hideOk=!1,this.hideClose=!1,this.eMoney=!1,this.headerType=ee.Success,this.validated=!0,this.customWidth="initial",this.bodyScrollable=!1,this.hideScrollbar=!1,this.disableKeyup=!1,this.noPadding=!1}},Ye=(()=>{class i{constructor(){this.dynamicValidated=!0,this.onOk=new It,this.onCancel=new It,this.onClose=new It,this.onBack=new It,this.headerType=ee}ngOnInit(){this.config==null&&(this.config=new ne)}onKeyup(t){this.config?.disableKeyup||(t.code=="F2"&&this.onOk.emit("F2"),(t.code=="Enter"||t.code=="NumpadEnter")&&this.onOk.emit("Enter"))}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=M({type:i,selectors:[["modal-material"]],inputs:{config:"config",dynamicValidated:"dynamicValidated"},outputs:{onOk:"onOk",onCancel:"onCancel",onClose:"onClose",onBack:"onBack"},ngContentSelectors:Cn,decls:11,vars:23,consts:[["id","modal_material",1,"modal-material","d-flex","align-items-start","flex-column","position-relative","maxHeight",3,"keyup","ngClass"],["mat-dialog-title","",1,"d-flex","w-100","justify-content-between","modal-header","position-relative",3,"ngClass"],["class","back-button position-absolute pointer d-print-none",3,"click",4,"ngIf"],[1,"d-flex","flex-row","d-print-none","align-items-center",3,"ngClass"],[1,"fw-normal"],[4,"ngIf"],[1,"modal-body","w-100",3,"ngClass"],["class","w-100 py-7 border-top d-flex justify-content-end d-print-none",4,"ngIf"],[1,"back-button","position-absolute","pointer","d-print-none",3,"click"],[1,"btn","back-button"],[1,"fa-solid","fa-arrow-left"],[1,"btn-light-blue","btn-sm","pointer","close",3,"click"],[1,"fa-solid","fa-xmark","fa-lg","text-primary"],[1,"w-100","py-7","border-top","d-flex","justify-content-end","d-print-none"],["class","btn btn-light-blue text-primary btn-lg fw-bold mx-3",3,"click",4,"ngIf"],["class","btn btn-light-blue me-6 text-primary btn-lg fw-bold mx-3","data-cy","btn-ok",3,"disabled","innerHTML","click","keyup.F2",4,"ngIf"],[1,"btn","btn-light-blue","text-primary","btn-lg","fw-bold","mx-3",3,"click"],["data-cy","btn-ok",1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3",3,"click","keyup.F2","disabled","innerHTML"]],template:function(n,e){n&1&&(me(gn),o(0,"div",0),g("keyup",function(h){return e.onKeyup(h)}),o(1,"div",1),C(2,vn,3,0,"div",2),o(3,"div",3)(4,"h4",4),p(5),a(),Vt(6),a(),C(7,bn,3,0,"div",5),a(),o(8,"mat-dialog-content",6),Vt(9,1),a(),C(10,wn,4,2,"mat-dialog-actions",7),a()),n&2&&(pe("width",e.config==null?null:e.config.customWidth),l("ngClass",Xt(10,fn,e.config==null?null:e.config.bodyScrollable,e.config==null?null:e.config.hideScrollbar)),r(),l("ngClass",ue(13,Sn,e.headerType.Success==(e.config==null?null:e.config.headerType),e.headerType.Warning==(e.config==null?null:e.config.headerType),e.headerType.Info==(e.config==null?null:e.config.headerType),e.headerType.Error==(e.config==null?null:e.config.headerType))),r(),l("ngIf",e.config==null?null:e.config.eMoney),r(),l("ngClass",Q(18,xn,e.config==null?null:e.config.eMoney)),r(2),N(e.config==null?null:e.config.title),r(2),l("ngIf",!(e.config!=null&&e.config.hideClose)),r(),l("ngClass",Xt(20,yn,!(e.config!=null&&e.config.hideFooter),e.config==null?null:e.config.noPadding)),r(2),l("ngIf",!(e.config!=null&&e.config.hideFooter)))},dependencies:[Y,Nt,V,Pe,ye,be,ve],styles:[".mat-mdc-dialog-container{padding:0!important;border-radius:4px!important;overflow:visible!important} .mat-mdc-dialog-container [mat-dialog-title]{color:#fff;padding:15px;border:none}@media print{ .mat-mdc-dialog-container{box-shadow:unset;width:100vw}}@media print{ .cdk-overlay-pane{position:absolute!important;top:-30px;max-width:100vw!important}.modal-body[_ngcontent-%COMP%]{width:100vw!important}}body.modal-body[_ngcontent-%COMP%]{height:100%;overflow-y:hidden}mat-dialog-actions[_ngcontent-%COMP%]{bottom:15px}mat-dialog-actions[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{padding:15px!important;margin-right:12px}mat-dialog-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:15px!important}mat-dialog-actions[_ngcontent-%COMP%] .more[_ngcontent-%COMP%]{margin-right:auto;margin-top:-1rem;padding-top:.4rem!important;margin-left:1rem}.back-button[_ngcontent-%COMP%]{top:5px;left:0}.close[_ngcontent-%COMP%]{padding:.4rem .5rem}.no-padding[_ngcontent-%COMP%]{padding:0}.modal-material[_ngcontent-%COMP%]{width:40vw}@media (max-width: 992px){.modal-material[_ngcontent-%COMP%]{width:50vw!important}}@media (max-width: 576px){ .dialog-filter .modal-material{width:100%!important} .dialog-filter mat-dialog-actions{position:sticky;bottom:0;background:#fff} .dialog-filter .modal-material.d-flex.align-items-start.flex-column.position-relative.maxHeight.bodyScrollable.maxHeight.bodyScrollable .modal-body{max-height:100%!important;overflow-y:auto}}.maxHeight.bodyScrollable[_ngcontent-%COMP%] .modal-body[_ngcontent-%COMP%]{max-height:450px;overflow-y:auto}.modal-header[_ngcontent-%COMP%], .modal-footer[_ngcontent-%COMP%], .modal-footer[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{padding:15px}.modal-dialog[_ngcontent-%COMP%]{max-width:none}.modal-content[_ngcontent-%COMP%]{width:auto;margin:auto;max-width:850px}.maxHeight[_ngcontent-%COMP%] .modal-body[_ngcontent-%COMP%]{max-height:450px;overflow:auto}.modal-body[_ngcontent-%COMP%]{padding:1rem}.modal-body[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{display:block}.modal-body[_ngcontent-%COMP%] .more[_ngcontent-%COMP%]{margin:0;position:absolute;bottom:-20px}.modal-body[_ngcontent-%COMP%] input[type=text][_ngcontent-%COMP%], .modal-body[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%], .modal-body[_ngcontent-%COMP%] input[type=password][_ngcontent-%COMP%]{border:1px solid #c8d3df;padding:5px 7px}.modal-body[_ngcontent-%COMP%] table[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{width:330px;height:90px}"]})}}return i})();var Mn=i=>({"is-disabled":i});function Tn(i,d){if(i&1&&(b(0),o(1,"tr")(2,"td",10),p(3),a(),o(4,"td",10),p(5),a(),o(6,"td",11)(7,"p",12),p(8,"Product Not in Channel!"),a()()(),P()),i&2){let t=s().$implicit;r(3),y(" ",t==null?null:t.Model," "),r(2),y(" ",t==null?null:t.Code," ")}}function Dn(i,d){if(i&1&&(o(0,"td",10),p(1),a()),i&2){let t=s(3).$implicit;Yt("rowspan",t.Channel.length),r(),y(" ",t==null?null:t.Model," ")}}function On(i,d){if(i&1&&(o(0,"td",10),p(1),a()),i&2){let t=s(3).$implicit;Yt("rowspan",t.Channel.length),r(),y(" ",t==null?null:t.Code," ")}}function kn(i,d){if(i&1){let t=x();o(0,"tr"),C(1,Dn,2,2,"td",13)(2,On,2,2,"td",13),o(3,"td",10)(4,"div",14)(5,"a",15),_(6,"img",16),a(),o(7,"div",17),p(8),a()()(),o(9,"td",10),p(10),k(11,"number"),a(),o(12,"td",18),p(13),k(14,"number"),a(),o(15,"td",19)(16,"div",20)(17,"button",21),g("click",function(){let e=m(t).$implicit,c=s(2).$implicit,h=s();return u(h.onDetach(e,c))}),_(18,"i",22),o(19,"span",23),p(20,"Detach"),a()(),o(21,"a",24),_(22,"i",25),o(23,"span",23),p(24,"Edit"),a()()()()()}if(i&2){let t=d.$implicit,n=d.$index,e=s(3);r(),l("ngIf",n==0),r(),l("ngIf",n==0),r(3),l("href",t.Url,w)("title",t.Title),r(),l("src",e.getChannelLogo(t.TypeID),w),r(),l("matTooltip",(t==null||t.Name==null?null:t.Name.length)>40?t==null?null:t.Name:""),r(),y(" ",t.Name," "),r(2),N(E(11,12,t.Price)),r(3),N(E(14,14,t.Inventory)),r(8),l("href",e.getHyperlinkSellerCenter(t),w)("ngClass",Q(16,Mn,t.TypeID==e.channelType.KalCare))("matTooltip",t.TypeID!=e.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function En(i,d){if(i&1&&qt(0,kn,25,18,"tr",null,Zt),i&2){let t=s().$implicit;Qt(t==null?null:t.Channel)}}function Fn(i,d){if(i&1&&C(0,Tn,9,2,"ng-container",9)(1,En,2,0,"ng-template",null,0,j),i&2){let t=d.$implicit,n=B(2);l("ngIf",!t.Channel||t.Channel.length<1)("ngIfElse",n)}}var zt=(()=>{class i{constructor(t,n){this.data=t,this.dialogRef=n,this.httpService=tt(W),this.toastr=tt($),this.variants=wt([]),this.channelType=I,this.variants.set(this.data.variants),this.title=t.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new St,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideFooter=!0,this.modalConfig.customWidth="850px"}onDetach(t,n){let e={ChannelID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariationID:t.ChannelVariationID};this.httpService.post(Se.DetachVariant,[e]).subscribe(c=>{this.toastr.success(c.Message,"Success"),this.updateVariantAfterDetach(n,t.ChannelVariationID)})}updateVariantAfterDetach(t,n){this.variants.update(e=>{let c=e.findIndex(h=>h.ID===t.ID);return c!==-1&&(e[c].Channel=e[c].Channel.filter(h=>h.ChannelVariationID!==n)),[...e]})}getChannelLogo(t){return f.getChannelLogoByTypeId(t)}getHyperlinkSellerCenter(t){let n="javascript:void(0)";switch(t.TypeID){case I.Shopee:n=`${pt.Shoope}/portal/product/${t.ChannelItemID}`;break;case I.Tiktok:n=`${pt.Tiktok}/product/edit/${t.ChannelItemID}`;break;case I.Tokopedia:n=`${pt.Tokopedia}/edit-product/${t.ChannelItemID}`;break;case I.WooCommerce:n=`${pt.WooCommerce}/wp-admin/post.php?post=${t.ChannelItemID}&action=edit`;break;case I.Lazada:n=`${pt.Lazada}/apps/product/publish?productId=${t.ChannelItemID}`;break}return n}static{this.\u0275fac=function(n){return new(n||i)(S(ft),S(Ct))}}static{this.\u0275cmp=M({type:i,selectors:[["app-modal-variant"]],decls:27,vars:1,consts:[["printChannelModal",""],[3,"onClose","onCancel","config"],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"text-start","sticky-top"],[1,"d-flex","align-items-center"],["matTooltip","Variant from POS",1,"fas","fa-info-circle","ms-1"],["matTooltip","Product and Variant from each Channel",1,"fas","fa-info-circle","ms-1"],[1,"text-start","sticky-top",2,"width","0%"],[4,"ngIf","ngIfElse"],[1,"text-start"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-start",4,"ngIf"],[1,"d-flex"],["target","_blank",1,"me-1",3,"href","title"],[2,"width","20px","height","20px",3,"src"],[1,"text-ellipsis","ps-2",2,"max-width","18vw",3,"matTooltip"],[1,"text-center"],[1,"text-end"],[1,"d-flex","align-items-center","justify-content-end"],[1,"btn","btn-small","btn-light","px-4","py-2","me-3",3,"click"],[1,"fa-sharp","fa-link-slash","me-2",2,"font-size","10px"],[1,"fs-6"],["target","_blank",1,"btn","btn-small","btn-light","px-4","py-2",3,"href","ngClass","matTooltip"],[1,"fa-solid","fa-edit","me-2",2,"font-size","10px"]],template:function(n,e){n&1&&(o(0,"modal-material",1),g("onClose",function(){return e.dialogRef.close()})("onCancel",function(){return e.dialogRef.close()}),o(1,"content")(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4)(6,"div",5)(7,"span"),p(8,"VARIANT"),a(),o(9,"sup"),_(10,"i",6),a()()(),o(11,"th",4),p(12,"SKU"),a(),o(13,"th",4)(14,"div",5)(15,"span"),p(16,"PRODUCT"),a(),o(17,"sup"),_(18,"i",7),a()()(),o(19,"th",4),p(20,"PRICE"),a(),o(21,"th",8),p(22,"INVENTORY"),a(),_(23,"th",4),a()(),o(24,"tbody"),qt(25,Fn,3,2,null,null,Zt),a()()()()),n&2&&(l("config",e.modalConfig),r(25),Qt(e.variants()))},dependencies:[Y,Nt,V,ut,ot,it,Ye],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#fff!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}a.is-disabled[_ngcontent-%COMP%]{color:gray;cursor:default}a.is-disabled[_ngcontent-%COMP%]:hover{text-decoration:none}"]})}}return i})();function Vn(i,d){if(i&1&&(o(0,"mat-option",6)(1,"div"),_(2,"img",7),o(3,"span"),p(4),a()()()),i&2){let t=d.$implicit;l("value",t.ChannelID),r(2),l("src",t.logo,w),r(2),N(t.Title)}}var bt=(()=>{class i{constructor(){this.dialogRef=tt(Ct),this.channels=tt(ft),this.channelIds=wt([]),this.channelOptions=wt([])}ngOnInit(){this.initModalConfig();let t=this.channels.filter((n,e,c)=>c.findIndex(h=>h.ChannelID===n.ChannelID)===e);this.channelOptions.set(t)}initModalConfig(){this.modalConfig=new St,this.modalConfig.title="Detach Product",this.modalConfig.okText="Save"}onClose(){this.dialogRef.close()}onSave(){let t=this.channels.filter(n=>this.channelIds().includes(n.ChannelID)).map(n=>({ChannelID:n.ChannelID,ChannelItemID:n.ChannelItemID}));this.dialogRef.close(t)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=M({type:i,selectors:[["app-modal-detach-product"]],decls:8,vars:5,consts:[[3,"onClose","onCancel","onOk","dynamicValidated","config"],["content",""],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"ngModelChange","ngModel","multiple"],["class","channel-option",3,"value",4,"ngFor","ngForOf"],[1,"channel-option",3,"value"],[2,"width","18px","margin-right","10px",3,"src"]],template:function(n,e){n&1&&(o(0,"modal-material",0),g("onClose",function(){return e.onClose()})("onCancel",function(){return e.onClose()})("onOk",function(){return e.onSave()}),o(1,"div",1)(2,"div")(3,"label",2),p(4,"Select a Channel"),a(),o(5,"mat-form-field",3)(6,"mat-select",4),O("ngModelChange",function(h){return D(e.channelIds,h)||(e.channelIds=h),h}),C(7,Vn,5,3,"mat-option",5),a()()()()()),n&2&&(l("dynamicValidated",e.channelIds().length>0)("config",e.modalConfig),r(6),T("ngModel",e.channelIds),l("multiple",!0),r(),l("ngForOf",e.channelOptions()))},dependencies:[Y,A,Bt,jt,ke,Ue,Ae,Fe,_t,U,L,ot],encapsulation:2})}}return i})();function Nn(i,d){if(i&1){let t=x();o(0,"button",13),g("click",function(){m(t);let e=s();return u(e.onDetachMultipleProduct())}),_(1,"i",14),p(2),a()}if(i&2){let t,n=s();r(2),y("Detach (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function An(i,d){if(i&1){let t=x();o(0,"button",16),g("click",function(){m(t);let e=s(2);return u(e.onOpenScanDialog())}),_(1,"i",17),p(2," Scan Channel "),a()}}function Un(i,d){if(i&1&&(b(0),C(1,An,3,0,"button",15),P()),i&2){let t=s();r(),l("ngIf",!t.productService.hasSelection(t.products))}}function Ln(i,d){if(i&1){let t=x();b(0),o(1,"button",18),g("click",function(){m(t);let e=s();return u(e.onScanMultipleProduct())}),_(2,"i",17),p(3),a(),P()}if(i&2){let t,n=s();r(3),y(" Scan (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function Rn(i,d){if(i&1){let t=x();b(0),o(1,"button",19),g("click",function(){m(t);let e=s();return u(e.onUploadMultipleProduct())}),_(2,"i",20),p(3),a(),P()}if(i&2){let t,n=s();r(3),y(" Upload (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function Bn(i,d){if(i&1){let t=x();o(0,"div",21)(1,"app-product-card",22),g("onUpload",function(){let e=m(t).$implicit,c=s();return u(c.onUploadToMultipleChannel(e))})("onScan",function(){let e=m(t).$implicit,c=s();return u(c.onScanSingleProduct(e))})("onDescEvent",function(){let e=m(t).index,c=s();return u(c.onOpenDialogVariant(e))})("onCheckBoxChange",function(e){let c=m(t).$implicit;return u(c.selected=e)})("onDetach",function(){let e=m(t).$implicit,c=s();return u(c.onDetachProduct([e]))}),a()()}if(i&2){let t=d.$implicit,n=s();r(),l("productId",t.ID)("title",t==null?null:t.Name)("image",t==null?null:t.ThumbnailUrl)("description",(t==null||t.Variants==null?null:t.Variants.length)>1?(t==null||t.Variants==null?null:t.Variants.length)+" Variants":null)("channels",n.productService.getChannelProduct(t))("code",n.getVariantCode(t==null?null:t.Variants))("showCheckBox",(t==null?null:t.Channel.length)<n.channelOptions.length)("scanButton",!0)("uploadButton",t==null?null:t.hasUpload)("imageForZoom",t==null?null:t.ImageUrl)("detachButton",(t==null||t.Channel==null?null:t.Channel.length)>0)}}function jn(i,d){i&1&&(b(0),o(1,"div",23),_(2,"app-empty-state"),a(),P())}function $n(i,d){if(i&1){let t=x();b(0),o(1,"div",24)(2,"div",25)(3,"app-custom-paginator",26),g("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())}),a()()(),P()}if(i&2){let t=s();r(3),l("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",!0)("nextButtonAlwaysVisible",!0)}}var Qe=(()=>{class i{constructor(t,n,e,c,h,v,Pt){this.http=t,this.toastr=n,this.dialog=e,this.productService=c,this.authService=h,this.uploadProductService=v,this.route=Pt,this.searchFilter=new at,this.products=[],this.rowCount=0,this.multipeScanChannels=[],this.getLoaderPage(),this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}getLoaderPage(){this.productService.LoadInPOS().subscribe(t=>{this.Categories=t.Options.Categories,this.searchFilter.PageNumber=t.Filter.PageNumber,this.searchFilter.RowCount=t.Filter.RowCount,this.searchFilter.ChannelID=null,this.searchFilter.Category=t.Filter.Category,this.searchFilter.PageSize=100,this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[I.Tokopedia,I.Tiktok])}getProducts(){let t={PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Category:this.searchFilter.Category,From:this.startDate,To:this.endDate};this.http.post("/api/product/GetInPOS",t).subscribe(n=>{this.products=n.Data,this.rowCount=n.Total==null?this.searchFilter.RowCount:n.Total.toString(),this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions)})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=f.GuidEMpty,this.dialog.open(R,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(F(e=>f.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.UpdatedProduct=e.UpdatedProduct,this.searchFilter.Async=e.Async,this.scanAllProduct()})}scanAllProduct(){if(this.searchFilter.ChannelID==null){this.toastr.error("Please Select Channel","Error");return}this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(t=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{this.getLoaderPage();let n=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,n,!this.searchFilter.UpdatedProduct)}})}onOpenDialogVariant(t){let n=this.products[t]?.Variants||[];this.dialog.open(zt,{data:{title:this.products[t].Name,variants:n}})}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.uploadProductService.setSelectedProduct(t),this.route.navigate(["/menu/products/upload"])}onUploadToMultipleChannel(t){this.uploadProductService.setSelectedProduct([t]),this.route.navigate(["/menu/products/upload"])}searchProduct(t){this.searchFilter.text=t,this.getProducts()}onScanMultipleProduct(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=f.GuidEMpty;let n=this.productService.filterChannelByTypeId(this.channelOptions,[I.Tokopedia,I.Tiktok]);this.dialog.open(R,{data:{filter:t,channelOptions:n,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(F(c=>f.IsNotEmpty(c))).subscribe(c=>{this.searchFilter.ChannelID=c.ChannelID,this.searchFilter.ScanFull=c.ScanFull,this.searchFilter.UpdatedProduct=c.UpdatedProduct;let h=this.productService.selectedProduct(this.products),v=this.productService.getVariantCodesProducts(h);this.scanSingleProduct(v)})}onScanSingleProduct(t){let n=JSON.parse(JSON.stringify(this.searchFilter));n.ChannelID=f.GuidEMpty,this.dialog.open(R,{data:{filter:n,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(F(e=>f.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID;let c=this.productService.getVariantCodesProduct(t);this.scanSingleProduct(c)})}scanSingleProduct(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:n=>{if(n)this.toastr.success("Successfully Scan ","Success");else{let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${e?.Name} `,"Error")}this.searchFilter.ChannelID=f.GuidEMpty,n&&this.getProducts()},error:n=>{this.searchFilter.ChannelID=f.GuidEMpty}})}getVariantCode(t=[]){let n;return t?.length>1&&(n=(t[0].model?t[0].model:"")+t[0].Code),t?.length==1&&(n=t[0].Code),n}onDetachProduct(t){let n=[];t.forEach(e=>{e.Channel=f.assignChannelLogo(e.Channel),n.push(...e.Channel)}),this.dialog.open(bt,{width:"600px",data:[...n]}).afterClosed().pipe(F(e=>f.IsNotEmpty(e)),Ft(e=>this.productService.detachProduct(e))).subscribe(e=>{this.toastr.success(e.Message,Rt.Success),this.getProducts()})}onDetachMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.onDetachProduct(t)}static{this.\u0275fac=function(n){return new(n||i)(S(W),S($),S(Z),S(H),S(G),S(xt),S(et))}}static{this.\u0275cmp=M({type:i,selectors:[["app-in-pos"]],standalone:!1,decls:23,vars:14,consts:[["picker",""],["description","All products which is already available in POS",3,"onSubmit","headerTitle"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","Name","bindValue","Name","placeholder","Select Category",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[1,"mt-5"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"fa-sharp","fa-link-slash","me-2"],["type","button","data-cy","scanSoldinChannel","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onUpload","onScan","onDescEvent","onCheckBoxChange","onDetach","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","detachButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"next","previous","filter","totaldata","paginationTotal","hasClicked","nextButtonAlwaysVisible"]],template:function(n,e){if(n&1){let c=x();o(0,"mainpanel",1),g("onSubmit",function(v){return m(c),u(e.searchProduct(v))}),o(1,"actions"),C(2,Nn,3,1,"button",2)(3,Un,2,1,"ng-container",3)(4,Ln,4,1,"ng-container",3)(5,Rn,4,1,"ng-container",3),a(),o(6,"filters")(7,"div")(8,"label",4),p(9,"Category"),a(),o(10,"ng-select",5),g("ngModelChange",function(v){return m(c),u(e.searchFilter.Category=v)}),a()(),o(11,"div",6)(12,"mat-date-range-input",7)(13,"input",8),O("ngModelChange",function(v){return m(c),D(e.startDate,v)||(e.startDate=v),u(v)}),g("click",function(){m(c);let v=B(16);return u(v.open())}),a(),o(14,"input",9),O("ngModelChange",function(v){return m(c),D(e.endDate,v)||(e.endDate=v),u(v)}),g("click",function(){m(c);let v=B(16);return u(v.open())}),a()(),_(15,"mat-date-range-picker",null,0),a()(),o(17,"content")(18,"div",10)(19,"div",11),C(20,Bn,2,11,"div",12)(21,jn,3,0,"ng-container",3),a(),C(22,$n,4,5,"ng-container",3),a()()()}if(n&2){let c=B(16);l("headerTitle","In POS ("+e.rowCount+")"),r(2),lt(e.productService.hasSelection(e.products)?2:-1),r(),l("ngIf",!e.productService.hasSelection(e.products)),r(),l("ngIf",e.productService.hasSelection(e.products)&&e.multipeScanChannels.length>0),r(),l("ngIf",e.productService.hasSelection(e.products)),r(5),l("clearable",!0)("items",e.Categories)("ngModel",e.searchFilter.Category),r(2),l("rangePicker",c),r(),T("ngModel",e.startDate),r(),T("ngModel",e.endDate),r(6),l("ngForOf",e.products),r(),l("ngIf",e.products.length==0),r(),l("ngIf",e.products.length>0)}},dependencies:[A,V,ht,U,L,z,nt,q,rt,K,Re,Be,je,$e],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.img-logo[_ngcontent-%COMP%]{height:24px;width:24px}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}"]})}}return i})();function Wn(i,d){if(i&1){let t=x();o(0,"button",11),g("click",function(){m(t);let e=s();return u(e.onDetachMultipleProduct())}),_(1,"i",12),p(2),a()}if(i&2){let t,n=s();r(2),y("Detach (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function Gn(i,d){if(i&1){let t=x();b(0),o(1,"button",13),g("click",function(){m(t);let e=s();return u(e.onOpenScanDialog())}),_(2,"i",14),p(3," Scan Channel "),a(),P()}}function zn(i,d){if(i&1){let t=x();b(0),o(1,"button",15),g("click",function(){m(t);let e=s();return u(e.onScanMultipleProduct())}),_(2,"i",14),p(3),a(),P()}if(i&2){let t=s();r(3),y(" Scan (",t.productService.selectedProduct(t.products).length,") ")}}function Hn(i,d){if(i&1){let t=x();b(0),o(1,"button",16),g("click",function(){m(t);let e=s();return u(e.onUploadMultipleProduct())}),_(2,"i",17),p(3),a(),P()}if(i&2){let t=s();r(3),y(" Upload (",t.productService.selectedProduct(t.products).length,") ")}}function Kn(i,d){if(i&1&&(o(0,"span",18),_(1,"img",19),a(),p(2)),i&2){let t=d.item;r(),l("src",t.Img,w)("alt",t.Name),r(),y(" ",t.Name," ")}}function Jn(i,d){if(i&1){let t=x();o(0,"div",20)(1,"label",21),p(2,"Item ID"),a(),o(3,"input",22),O("ngModelChange",function(e){m(t);let c=s();return D(c.searchFilter.Item_id,e)||(c.searchFilter.Item_id=e),u(e)}),a()()}if(i&2){let t=s();r(3),T("ngModel",t.searchFilter.Item_id)}}function Yn(i,d){if(i&1){let t=x();o(0,"div",23)(1,"app-product-card",24),g("onUpload",function(){let e=m(t).$implicit,c=s();return u(c.onUploadToMultipleChannel(e))})("onDescEvent",function(){let e=m(t).index,c=s();return u(c.onOpenVariantDetail(e))})("onScan",function(){let e=m(t).$implicit,c=s();return u(c.onScanSingleProduct(e))})("onCheckBoxChange",function(e){let c=m(t).$implicit;return u(c.selected=e)})("onDetach",function(){let e=m(t).$implicit,c=s();return u(c.onDetachProduct([e]))}),a()()}if(i&2){let t=d.$implicit,n=s();r(),l("productId",t==null?null:t.ID)("title",t==null?null:t.Name)("image",t==null?null:t.ThumbnailUrl)("description",(t==null||t.Variants==null?null:t.Variants.length)>1?(t==null||t.Variants==null?null:t.Variants.length)+" Variants":null)("channels",n.productService.getChannelProduct(t))("code",n.getVariantCode(t==null?null:t.Variants))("showCheckBox",t==null?null:t.hasScan)("scanButton",!0)("uploadButton",t==null?null:t.hasUpload)("imageForZoom",t==null?null:t.ImageUrl)("detachButton",(t==null||t.Channel==null?null:t.Channel.length)>0)}}function Zn(i,d){i&1&&(b(0),o(1,"div",25),_(2,"app-empty-state"),a(),P())}function qn(i,d){if(i&1){let t=x();o(0,"div",26)(1,"div",27)(2,"app-custom-paginator",28),g("total",function(){m(t);let e=s();return u(e.getRowCount())})("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())}),a()()()}if(i&2){let t=s();r(2),l("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",t.hasClickRowCount)}}var Xe=(()=>{class i{constructor(t,n,e,c,h,v,Pt,kt){this.http=t,this.dialog=n,this.toastr=e,this.productService=c,this.activateRouter=h,this.authService=v,this.route=Pt,this.uploadProductService=kt,this.searchFilter=new at,this.products=[],this.rowCount=0,this.hasClickRowCount=!1,this.guidEmpty=f.GuidEMpty,this.multipeScanChannels=[],this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(f.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(n=>{this.searchFilter=n.Filter,n.Filter.ChannelID!=f.GuidEMpty&&(this.searchFilter.ListChannelID=[],this.searchFilter.ListChannelID.push(n.Filter.ChannelID)),this.searchFilter.PageSize=n.Filter.RowCount,this.searchFilter.Item_id="",this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[I.Tokopedia,I.Tiktok])}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Item_id:this.searchFilter.Item_id};this.productService.findAllSoldInChannel(t).subscribe(n=>{this.products=n.Data,this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions),this.products=this.productService.checkProductHasScanButton(this.products,this.channelOptions)})}searchProduct(t){this.searchFilter.text=t,this.hasClickRowCount=!1,this.getProducts()}onOpenVariantDetail(t){let n=this.products[t].Variants;this.dialog.open(zt,{data:{variants:n,title:this.products[t].Name}})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=f.GuidEMpty,this.dialog.open(R,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(F(e=>f.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.UpdatedProduct=e.UpdatedProduct,this.searchFilter.Async=e.Async,this.scanAllProduct()})}scanAllProduct(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).pipe(F(n=>n)).subscribe(n=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(n,t,!this.searchFilter.UpdatedProduct),this.initPageLoader(f.GuidEMpty))})}onScanSingleProduct(t){t.Channel=this.productService.getChannelProduct(t);let n=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(R,{data:{filter:n,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(F(e=>f.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID;let c=this.productService.getVariantCodesProduct(t);this.scanProducts(c)})}onUploadToMultipleChannel(t){this.uploadProductService.setSelectedProduct([t]),this.route.navigate(["/menu/products/upload"])}onScanMultipleProduct(){this.searchFilter.ChannelID=f.GuidEMpty;let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(R,{data:{filter:t,channelOptions:this.multipeScanChannels,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(F(e=>f.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.UpdatedProduct=e.UpdatedProduct;let c=this.productService.selectedProduct(this.products),h=this.productService.getVariantCodesProducts(c);this.scanProducts(h)})}scanProducts(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:n=>{let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);n?this.toastr.success(`Product Successfully scan with ${e?.Name}`,"Success"):this.toastr.error(`This product is not existed in ${e?.Name} `,"Error"),this.searchFilter.ChannelID=f.GuidEMpty,n&&this.getProducts()},error:n=>{this.searchFilter.ChannelID=f.GuidEMpty}})}getVariantCode(t){let n;return t.length>1&&(n=(t[0].model?t[0].model:"")+t[0].Code),t.length==1&&(n=t[0].Code),n}onClearFilterChannel(){this.searchFilter.ChannelID=f.GuidEMpty,this.searchFilter.Item_id=""}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.uploadProductService.setSelectedProduct(t),this.route.navigate(["/menu/products/upload"])}getRowCount(){let t={ListChannelID:this.searchFilter.ListChannelID,text:this.searchFilter.text};this.http.post("/api/product/GetSoldInChannelRowCount",t).subscribe(n=>{this.hasClickRowCount=!0,this.rowCount=n.Total})}onDetachProduct(t){let n=[];t.forEach(e=>{e.Channel=f.assignChannelLogo(e.Channel),n.push(...e.Channel)}),this.dialog.open(bt,{width:"600px",data:[...n]}).afterClosed().pipe(F(e=>f.IsNotEmpty(e)),Ft(e=>this.productService.detachProduct(e))).subscribe(e=>{this.toastr.success(e.Message,Rt.Success),this.getProducts()})}onDetachMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.onDetachProduct(t)}static{this.\u0275fac=function(n){return new(n||i)(S(W),S(Z),S($),S(H),S(At),S(G),S(et),S(xt))}}static{this.\u0275cmp=M({type:i,selectors:[["app-sold-in-channel"]],standalone:!1,decls:19,vars:13,consts:[["description","SKU has been mapped between dealpos and marketplace",3,"onSubmit","headerTitle"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clear","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],["class","mt-5",4,"ngIf"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"fa-sharp","fa-link-slash","me-2"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"mt-5"],[1,"fw-bold"],["type","text","name","Item_id","id","Item_id",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onUpload","onDescEvent","onScan","onCheckBoxChange","onDetach","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","detachButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(n,e){n&1&&(o(0,"mainpanel",0),g("onSubmit",function(h){return e.searchProduct(h)}),o(1,"actions"),C(2,Wn,3,1,"button",1)(3,Gn,4,0,"ng-container",2)(4,zn,4,1,"ng-container",2)(5,Hn,4,1,"ng-container",2),a(),o(6,"filters")(7,"div")(8,"label",3),p(9,"Channel"),a(),o(10,"ng-select",4),g("ngModelChange",function(h){return e.searchFilter.ListChannelID=h})("clear",function(){return e.onClearFilterChannel()}),C(11,Kn,3,3,"ng-template",5),a()(),C(12,Jn,4,1,"div",6),a(),o(13,"content")(14,"div",7)(15,"div",8),C(16,Yn,2,11,"div",9)(17,Zn,3,0,"ng-container",2),a(),C(18,qn,3,4,"div",10),a()()()),n&2&&(l("headerTitle","Sold in Channel"),r(2),lt(e.productService.hasSelection(e.products)?2:-1),r(),l("ngIf",!e.productService.hasSelection(e.products)),r(),l("ngIf",e.multipeScanChannels.length>0&&e.productService.hasSelection(e.products)),r(),l("ngIf",e.productService.hasSelection(e.products)),r(5),l("clearable",!0)("multiple",!0)("items",e.channelOptions)("ngModel",e.searchFilter.ListChannelID),r(2),l("ngIf",e.searchFilter.ListChannelID!=null),r(4),l("ngForOf",e.products),r(),l("ngIf",e.products.length==0),r(),l("ngIf",e.products==null?null:e.products.length))},dependencies:[A,V,ht,U,L,z,nt,gt,Lt,q,rt,K],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]})}}return i})();function Qn(i,d){if(i&1){let t=x();o(0,"button",13),g("click",function(){m(t);let e=s(2);return u(e.uploadMultipleProduct())}),_(1,"i",14),p(2),a()}if(i&2){let t=s(2);r(2),y(" upload (",t.selectedProducts==null?null:t.selectedProducts.length,") ")}}function Xn(i,d){if(i&1){let t=x();b(0),o(1,"td",29)(2,"input",30),O("ngModelChange",function(e){m(t);let c=s(2).$implicit;return D(c.selected,e)||(c.selected=e),u(e)}),g("ngModelChange",function(){m(t);let e=s(3).ngIf,c=s(3);return u(c.onSelectProduct(e))}),a()(),P()}if(i&2){let t=s(2).$implicit;r(),l("rowSpan",t==null?null:t.Variants.length),r(),T("ngModel",t.selected)}}function ti(i,d){if(i&1){let t=x();b(0),o(1,"img",35),g("click",function(e){m(t);let c=s(3).$implicit,h=s(4);return u(h.onZoomImage(e,c==null?null:c.ImageUrl))}),a(),P()}if(i&2){let t=s(3).$implicit;r(),l("src",t==null?null:t.ImageUrl,w)}}function ei(i,d){i&1&&_(0,"img",36)}function ni(i,d){if(i&1&&(b(0),o(1,"td",29)(2,"div",31),C(3,ti,2,1,"ng-container",11)(4,ei,1,0,"ng-template",null,1,j),a()(),o(6,"td",32)(7,"h4",33)(8,"span",34),p(9),a()()(),P()),i&2){let t=B(5),n=s(2).$implicit;r(),l("rowSpan",n==null?null:n.Variants.length),r(2),l("ngIf",n==null?null:n.ImageUrl)("ngIfElse",t),r(3),l("rowSpan",n==null?null:n.Variants.length),r(2),l("matTooltip",(n==null||n.Name==null?null:n.Name.length)>50?n==null?null:n.Name:""),r(),y(" ",n==null?null:n.Name," ")}}function ii(i,d){if(i&1&&(o(0,"div")(1,"a",25),_(2,"img",37),a()()),i&2){let t=d.$implicit;r(),l("href",t.URL,w),r(),l("src",t.Img,w)("matTooltip",t.Name)}}function oi(i,d){if(i&1&&(o(0,"div"),_(1,"img",37),a()),i&2){let t=d.$implicit;r(),l("src",t.Img,w)("matTooltip",t.Name)}}function ai(i,d){if(i&1&&(o(0,"tr"),C(1,Xn,3,2,"ng-container",12)(2,ni,10,6,"ng-container",12),o(3,"td"),p(4),a(),o(5,"td")(6,"span"),p(7),a(),o(8,"span",24)(9,"a",25),_(10,"i",26),a()()(),o(11,"td",27)(12,"div",28),C(13,ii,3,3,"div",23),a()(),o(14,"td",27)(15,"div",28),C(16,oi,2,2,"div",23),a()()()),i&2){let t=d.$implicit,n=d.index,e=s(5);r(),l("ngIf",n==0),r(),l("ngIf",n==0),r(2),y(" ",t.Name," "),r(3),y(" ",t.Code," "),r(2),l("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),w),r(4),l("ngForOf",t==null?null:t.Available),r(3),l("ngForOf",t==null?null:t.NotAvailable)}}function ri(i,d){if(i&1&&(b(0),C(1,ai,17,7,"tr",23),P()),i&2){let t=d.$implicit;r(),l("ngForOf",t.Variants)}}function li(i,d){if(i&1&&(o(0,"tbody"),C(1,ri,2,1,"ng-container",23),a()),i&2){let t=d.ngIf;r(),l("ngForOf",t)}}function ci(i,d){if(i&1&&(b(0),o(1,"div",15)(2,"table",16)(3,"thead",17)(4,"tr"),_(5,"th",18),o(6,"th",19),p(7,"Product"),a(),o(8,"th",20),p(9,"Variant"),a(),o(10,"th",20),p(11,"SKU"),a(),o(12,"th",21),p(13,"Available In"),a(),o(14,"th",22),p(15,"Not Available In"),a()()(),C(16,li,2,1,"tbody",12),k(17,"async"),a()(),P()),i&2){let t=s(2);r(16),l("ngIf",E(17,1,t.data$))}}function si(i,d){i&1&&(o(0,"div",38),_(1,"app-empty-state"),a())}function di(i,d){if(i&1){let t=x();o(0,"span",46),g("click",function(){m(t);let e=s(4);return u(e.getRowCount())}),o(1,"i",47),p(2,"?"),a()()}}function pi(i,d){if(i&1&&(o(0,"span"),p(1),k(2,"number"),a()),i&2){let t=d.ngIf;r(),N(E(2,1,t==null?null:t.Count))}}function mi(i,d){if(i&1){let t=x();o(0,"a",48),g("click",function(){m(t);let e=s(4);return u(e.onNextPage())}),_(1,"i",49),p(2," Next"),a()}}function ui(i,d){if(i&1){let t=x();o(0,"a",50),g("click",function(){m(t);let e=s(4);return u(e.onLastPage())}),_(1,"i",51),p(2," Last"),a()}}function hi(i,d){if(i&1&&(b(0),o(1,"div",39)(2,"div",40)(3,"div",41),p(4),k(5,"number"),C(6,di,3,0,"span",42)(7,pi,3,3,"span",12),k(8,"async"),p(9),a()(),o(10,"div",43),C(11,mi,3,0,"a",44)(12,ui,3,0,"a",45),a()(),P()),i&2){let t=s().ngIf,n=s(2);r(4),y(" Showing 1 - ",E(5,6,t==null?null:t.length)," of "),r(2),l("ngIf",n.paginationService.hideCount),r(),l("ngIf",!n.paginationService.hideCount&&E(8,8,n.rowCount$)),r(2),y(" records ~ ",n.paginationService.footerPageNumber," Page "),r(2),l("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage),r(),l("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage)}}function _i(i,d){if(i&1&&(b(0),C(1,hi,13,10,"ng-container",12),P()),i&2){let t=d.ngIf;r(),l("ngIf",(t==null?null:t.length)>0)}}function gi(i,d){if(i&1){let t=x();o(0,"mainpanel",3),g("onSubmit",function(e){m(t);let c=s();return u(c.searchProduct(e))}),o(1,"actions"),C(2,Qn,3,1,"button",4),o(3,"button",5),g("click",function(){m(t);let e=s();return u(e.openScanDialog())}),_(4,"i",6),p(5," Scan Channel "),a(),o(6,"button",7),g("click",function(){m(t);let e=s();return u(e.openExportDialog())}),_(7,"i",8),o(8,"span"),p(9,"Export"),a()()(),o(10,"content")(11,"div",9)(12,"div",10),C(13,ci,18,3,"ng-container",11),k(14,"async"),C(15,si,2,0,"ng-template",null,0,j),a(),C(17,_i,2,1,"ng-container",12),k(18,"async"),a()()()}if(i&2){let t,n=B(16),e=s();l("hideSearchDropdown",!0),r(2),l("ngIf",e.hasSelectionProduct),r(11),l("ngIf",((t=E(14,5,e.data$))==null?null:t.length)>0)("ngIfElse",n),r(4),l("ngIf",E(18,7,e.data$))}}var tn=(()=>{class i{constructor(t,n,e,c,h,v,Pt,kt,rn){this.http=t,this.dialog=n,this.toastr=e,this.route=c,this.productService=h,this.paginationService=v,this.biggerPictureService=Pt,this.authService=kt,this.uploadProductService=rn,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannelV2",this.hasSelectionProduct=!1,this.selectedProducts=[],this.channelOptions=kt.getChannels(),this.hostName=this.authService.getDomain()}ngOnInit(){this.initPageLoader(),this.iniData()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.notChannelAPI,this.loader$=this.http.post(`api/${this.loaderAPI}`,{}).pipe(le(t=>{this.filterSearch=t.Filter,this.paginationService.reloadPagination(t.Filter)}))}iniData(){this.data$=this.paginationService.data$.pipe(Et(t=>(t=t.map(n=>(n.Variants=n.Variants.map(e=>(e.Available=this.productService.sortChannel(e.Available),e.NotAvailable=this.productService.sortChannel(e.NotAvailable),e.Available=this.assignLogoChannel(e.Available),e.NotAvailable=this.assignLogoChannel(e.NotAvailable),e)),n.Channel=n?.Variants[0]?.Available,n)),t)))}assignLogoChannel(t){return t=t.map(n=>(n.Img=f.getChannelLogoByTypeId(n.TypeID),n)),t}searchProduct(t){this.filterSearch.text=t,this.paginationService.reloadPagination(this.filterSearch)}scanAllProduct(){let t=this.productService.findChannelById(this.filterSearch.ChannelID,this.channelOptions);this.productService.scanAll(this.filterSearch.ChannelID,this.filterSearch.ScanFull,this.filterSearch.UpdatedProduct,this.filterSearch.Async).subscribe(n=>{this.filterSearch.Async?this.toastr.success("You will be notified when the scan is completed.","Scan Asynchronous"):(this.productService.successToastrScanAllProduct(n,t,!this.filterSearch.UpdatedProduct),this.initPageLoader())})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.filterSearch));t.ChannelID=f.GuidEMpty,this.dialog.open(R,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(F(e=>f.IsNotEmpty(e))).subscribe(e=>{this.filterSearch.ChannelID=e.ChannelID,this.filterSearch.ScanFull=e.ScanFull,this.filterSearch.UpdatedProduct=e.UpdatedProduct,this.filterSearch.Async=e.Async,this.scanAllProduct()})}getRowCount(){this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`/api/${this.rowCountAPI}`,this.filterSearch)}onNextPage(){this.paginationService.onNextPage(this.filterSearch)}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:t=>{this.filterSearch.PageNumber=1,this.paginationService.getAllData(this.filterSearch,t.Count)}})}onZoomImage(t,n){this.biggerPictureService.openBiggerPicture(t,n)}onSelectProduct(t){this.hasSelectionProduct=this.productService.hasSelection(t),this.selectedProducts=this.productService.selectedProduct(t)}uploadMultipleProduct(){this.uploadProductService.setSelectedProduct(this.selectedProducts),this.route.navigate(["/menu/products/upload"])}ngOnDestroy(){this.paginationService.destroy()}openExportDialog(){this.dialog.open(Ge,{data:{title:"Export Not In Channel",pageNumber:this.filterSearch.PageNumber,rowCount:this.filterSearch.RowCount,filterExport:this.filterSearch,getRowCountApi:"product/GetNotInChannelRowCount",exportApi:"product/GetNotInChannelExport"}}).afterClosed().subscribe()}static{this.\u0275fac=function(n){return new(n||i)(S(W),S(Z),S($),S(et),S(H),S(ze),S(Le),S(G),S(xt))}}static{this.\u0275cmp=M({type:i,selectors:[["app-not-in-channel"]],standalone:!1,decls:2,vars:3,consts:[["EMPTY",""],["elsePic",""],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"hideSearchDropdown","onSubmit",4,"ngIf"],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"onSubmit","hideSearchDropdown"],["class","btn btn-light shadow rounded ms-2",3,"click",4,"ngIf"],["data-cy","scanNotinChannel","type","button",1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[4,"ngIf","ngIfElse"],[4,"ngIf"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-md-12"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[2,"width","10px"],["colspan","2",1,"ms-5","text-center",2,"width","450px"],[2,"width","150px"],[2,"width","20%"],[2,"width","16%"],[4,"ngFor","ngForOf"],[1,"ms-1"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"padding-left","0px"],[1,"d-flex","flex-wrap","mb-1"],[1,"text-center",3,"rowSpan"],["type","checkbox",3,"ngModelChange","ngModel"],[2,"padding-right","0px"],[1,"text-start",3,"rowSpan"],[1,"ms-5","fw-normal","text-ellipsis",2,"max-width","26vw !important"],[3,"matTooltip"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],["alt","",1,"channel-logo","cursor-pointer","ms-4","mt-3",3,"src","matTooltip"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[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"],[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(n,e){n&1&&(C(0,gi,19,9,"mainpanel",2),k(1,"async")),n&2&&l("ngIf",E(1,1,e.loader$))},dependencies:[A,V,fe,U,L,z,it,K,mt,ut],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}thead[_ngcontent-%COMP%]{position:sticky;top:0}.channel-logo[_ngcontent-%COMP%]{width:20px}.w-img[_ngcontent-%COMP%]{width:100%}"]})}}return i})();var Ci=i=>[i],fi=()=>[];function Si(i,d){if(i&1){let t=x();o(0,"button",15),g("click",function(){m(t);let e=s();return u(e.openScanDialog())}),_(1,"i",16),p(2," Scan Channel "),a()}}function xi(i,d){if(i&1){let t=x();b(0),o(1,"button",17),g("click",function(){m(t);let e=s();return u(e.onDownloadAllProduct("SELECTED"))}),_(2,"i",18),p(3),a(),P()}if(i&2){let t,n=s();r(3),y(" Download (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function yi(i,d){if(i&1&&(o(0,"span",19),_(1,"img",20),a(),p(2)),i&2){let t=d.item;r(),l("src",t.Img,w)("alt",t.Name),r(),y(" ",t.Name," ")}}function vi(i,d){if(i&1){let t=x();o(0,"div",21)(1,"app-product-card",22),g("onCheckBoxChange",function(e){let c=m(t).index,h=s();return u(h.onSelectProduct(e,c))})("onDescEvent",function(){let e=m(t).index,c=s();return u(c.onShowVariantDetail(e))})("onDownload",function(){let e=m(t).$implicit,c=s();return u(c.onDownloadProduct(e))})("onScan",function(){let e=m(t).$implicit,c=s();return u(c.onScanChannel(e))}),a()()}if(i&2){let t=d.$implicit;r(),l("showRedirectIcon",!1)("title",t==null?null:t.Name)("image",t==null?null:t.Image)("imageForZoom",t==null?null:t.Image)("code",t==null?null:t.SKU)("description",(t==null||t.Variant==null?null:t.Variant.length)>0?(t==null||t.Variant==null?null:t.Variant.length)+" Variants":null)("downloadButton",!0)("channels",t!=null&&t.Channel?Q(10,Ci,t==null?null:t.Channel):ct(12,fi))("showCheckBox",!0)("scanButton",!0)}}function bi(i,d){i&1&&(b(0),o(1,"div",23),_(2,"app-empty-state"),a(),P())}function Pi(i,d){if(i&1){let t=x();o(0,"div",24)(1,"div",25)(2,"app-custom-paginator",26),g("total",function(){m(t);let e=s();return u(e.getRowCount())})("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())}),a()()()}if(i&2){let t=s();r(2),l("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",t.hasClickRowCount)}}var en=(()=>{class i{constructor(t,n,e,c,h,v){this.http=t,this.dialog=n,this.productService=e,this.toastrService=c,this.activateRouter=h,this.authService=v,this.searchFilter=new at,this.products=[],this.hasClickRowCount=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(f.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(n=>{this.searchFilter=n.Filter,this.searchFilter.PageSize=n.Filter.RowCount,this.getProducts()})}getProducts(){this.http.post("/api/product/GetProductChannelNotPOS",this.searchFilter).subscribe(t=>{this.products=t.Data,this.mapChannelToProduct(),this.setSkuProduct()})}mapChannelToProduct(){let t;this.products=this.products.map(n=>(t=this.channelOptions.find(e=>e.ID==n.ChannelID),t?n.Channel=JSON.parse(JSON.stringify(t)):n.Channel=null,n)).map(n=>(n.Channel&&(n.Channel.Url=n.Url),n))}setSkuProduct(){this.products=this.products.map(t=>(t?.Variant?.length==0?f.IsNotEmpty(t?.ChannelItemSKU)?t.SKU=t?.ChannelItemSKU:t.SKU="SKU not assigned":t.SKU=t?.Variant[0]?.ChannelVariationSKU?t?.Variant[0]?.ChannelVariationSKU:"SKU not assigned",t))}onSearch(t){this.searchFilter.text=t,this.hasClickRowCount=!1,this.getProducts()}onClearChannelFilter(){this.searchFilter.ChannelID=f.GuidEMpty}onScanAll(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(n=>{this.searchFilter.Async?this.toastrService.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.initPageLoader(f.GuidEMpty),this.productService.successToastrScanAllProduct(n,t,!this.searchFilter.UpdatedProduct)),this.searchFilter.ChannelID=f.GuidEMpty})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=f.GuidEMpty,this.dialog.open(R,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(F(e=>f.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.UpdatedProduct=e.UpdatedProduct,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.Async=e.Async,this.onScanAll()})}onDownloadAllProduct(t){let n;t=="ALL"?n=this.products:n=this.productService.selectedProduct(this.products),n.length>0&&this.productService.downloadMultipleProduct(n).subscribe({next:()=>{this.getProducts()}})}onSelectProduct(t,n){this.products[n].selected=t}onDownloadProduct(t){confirm(`Are you sure you want to Retrieve product ${t?.Name} from ${t?.Channel.Name} to POS?`)&&this.productService.downloadProduct(t).subscribe({next:()=>{this.getProducts()}})}onScanChannel(t){let n=JSON.parse(JSON.stringify(t));delete n.Channel,this.productService.scanCompareToPos([n]).subscribe(e=>{e.Status?(this.initPageLoader(f.GuidEMpty),this.toastrService.success(`product ${t.Name} have been successfully scanned and synchronized with POS`,"Success")):this.toastrService.error(`Product ${t.Name} is not existed in POS`,"Error")})}onShowVariantDetail(t){let n=this.products[t].Variant;n.length>0&&this.dialog.open(He,{data:{title:this.products[t].Name,variants:n},width:"30%"})}getRowCount(){let t={ChannelID:this.searchFilter.ChannelID,text:this.searchFilter.text,HaveSku:parseInt(this.searchFilter.HaveSku)};this.http.post("/api/product/GetProductChannelNotPOSRowCount",t).subscribe(n=>{this.hasClickRowCount=!0,this.rowCount=n.Count})}static{this.\u0275fac=function(n){return new(n||i)(S(W),S(Z),S(H),S($),S(At),S(G))}}static{this.\u0275cmp=M({type:i,selectors:[["app-not-in-pos"]],standalone:!1,decls:30,vars:13,consts:[["headerTitle","Not in POS","textButton","Search","description","SKU sold in Marketplace but not exist in DEALPOS",3,"onSubmit"],["type","button","data-cy","scanNotInPos","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],[4,"ngIf"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp",""],[1,"mt-5"],[1,"fw-bold"],["name","haveSKU",1,"form-control","h-100","pt-3","rounded","mt-2",3,"ngModelChange","ngModel"],[1,"me-5",3,"value"],["type","text","name","Item_id","id","Item_id","placeholder","item id",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button","data-cy","scanNotInPos",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","ms-3",3,"click"],[1,"fa","fa-download"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onCheckBoxChange","onDescEvent","onDownload","onScan","showRedirectIcon","title","image","imageForZoom","code","description","downloadButton","channels","showCheckBox","scanButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(n,e){n&1&&(o(0,"mainpanel",0),g("onSubmit",function(h){return e.onSearch(h)}),o(1,"actions"),C(2,Si,3,0,"button",1)(3,xi,4,1,"ng-container",2),a(),o(4,"filters")(5,"div")(6,"label",3),p(7,"Channel"),a(),o(8,"ng-select",4),O("ngModelChange",function(h){return D(e.searchFilter.ChannelID,h)||(e.searchFilter.ChannelID=h),h}),C(9,yi,3,3,"ng-template",5),a()(),o(10,"div",6)(11,"label",7),p(12,"SKU Assigned"),a(),o(13,"mat-radio-group",8),O("ngModelChange",function(h){return D(e.searchFilter.HaveSku,h)||(e.searchFilter.HaveSku=h),h}),o(14,"mat-radio-button",9),p(15," All "),a(),o(16,"mat-radio-button",9),p(17," Yes "),a(),o(18,"mat-radio-button",9),p(19," No "),a()()(),o(20,"div",6)(21,"label",7),p(22,"Item ID"),a(),o(23,"input",10),O("ngModelChange",function(h){return D(e.searchFilter.Item_id,h)||(e.searchFilter.Item_id=h),h}),a()()(),o(24,"content")(25,"div",11)(26,"div",12),C(27,vi,2,13,"div",13)(28,bi,3,0,"ng-container",2),a(),C(29,Pi,3,4,"div",14),a()()()),n&2&&(r(2),l("ngIf",!e.productService.hasSelection(e.products)),r(),l("ngIf",e.productService.hasSelection(e.products)),r(5),l("clearable",!0)("items",e.channelOptions),T("ngModel",e.searchFilter.ChannelID),r(5),T("ngModel",e.searchFilter.HaveSku),r(),l("value",0),r(2),l("value",1),r(2),l("value",2),r(5),T("ngModel",e.searchFilter.Item_id),r(4),l("ngForOf",e.products),r(),l("ngIf",e.products.length==0),r(),l("ngIf",(e.products==null?null:e.products.length)>0))},dependencies:[A,V,ht,U,L,z,nt,gt,$t,Wt,q,rt,K],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.itemTitle[_ngcontent-%COMP%]{cursor:pointer}"]})}}return i})();function Ii(i,d){if(i&1&&(o(0,"span",9),_(1,"img",10),a(),p(2)),i&2){let t=d.item,n=s();r(),l("src",n.getChannelLogo(t.TypeID),w),r(),y(" ",t.Name," ")}}function wi(i,d){if(i&1&&(o(0,"div",11),_(1,"app-duplicate-product-card",12),a()),i&2){let t=d.$implicit,n=d.index;r(),l("imageForZoom",t.ImageUrl)("title",t.Name)("code",t.Code)("id",n)("image",t.ThumbnailURL)("channels",t.Channels)}}function Mi(i,d){i&1&&(b(0),o(1,"div",13),_(2,"app-empty-state"),a(),P())}function Ti(i,d){if(i&1){let t=x();b(0),o(1,"div",14)(2,"div",15)(3,"app-custom-paginator",16),g("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())})("total",function(){m(t);let e=s();return u(e.getRowCount())}),a()()(),P()}if(i&2){let t=s();r(3),l("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",t.hasClickedRowCount)}}var nn=(()=>{class i{constructor(t,n,e){this.httpService=t,this.productService=n,this.authService=e,this.searchFilter=new at,this.products=[],this.hasClickedRowCount=!1,this.getPageLoader(),this.channelOptions=e.getChannels()}getPageLoader(){this.productService.loader().subscribe(t=>{this.searchFilter=t.Filter,this.searchFilter.PageSize=t.Filter.RowCount,this.getProducts()})}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,RowCount:this.searchFilter.RowCount,PageNumber:this.searchFilter.PageNumber,text:this.searchFilter.text};this.httpService.post("/api/product/GetDuplicateInChannel",t).subscribe(n=>{this.products=n.Data})}onSearch(t){this.searchFilter.text=t,this.hasClickedRowCount=!1,this.getProducts()}onClearFilter(){this.searchFilter.ChannelID=f.GuidEMpty}getChannelLogo(t){return f.getChannelLogoByTypeId(t)}getRowCount(){let t={text:this.searchFilter.text,ChannelID:this.searchFilter.ChannelID};this.httpService.post("/api/product/GetDuplicateInChannelRowCount",t).subscribe(n=>{this.hasClickedRowCount=!0,this.rowCount=n.Total})}static{this.\u0275fac=function(n){return new(n||i)(S(W),S(H),S(G))}}static{this.\u0275cmp=M({type:i,selectors:[["app-duplicate-sku"]],standalone:!1,decls:14,vars:7,consts:[["headerTitle","Multiple Listing","textButton"," Search","description","SKU(s) which is listed more than one time (one to many)",3,"onSubmit"],["container",""],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clear","multiple","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid"],[1,"row","mt-8","mx-1"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"imageForZoom","title","code","id","image","channels"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"next","previous","total","filter","totaldata","paginationTotal","hasClicked"]],template:function(n,e){n&1&&(o(0,"mainpanel",0),g("onSubmit",function(h){return e.onSearch(h)}),o(1,"filters")(2,"div",1)(3,"div")(4,"h6",2),p(5,"Channel"),a(),o(6,"ng-select",3),O("ngModelChange",function(h){return D(e.searchFilter.ListChannelID,h)||(e.searchFilter.ListChannelID=h),h}),g("clear",function(){return e.onClearFilter()}),C(7,Ii,3,2,"ng-template",4),a()()()(),o(8,"content")(9,"div",5)(10,"div",6),C(11,wi,2,6,"div",7)(12,Mi,3,0,"ng-container",8),a(),C(13,Ti,4,4,"ng-container",8),a()()()),n&2&&(r(6),l("multiple",!0)("clearable",!0)("items",e.channelOptions),T("ngModel",e.searchFilter.ListChannelID),r(5),l("ngForOf",e.products),r(),l("ngIf",(e.products==null?null:e.products.length)==0),r(),l("ngIf",(e.products==null?null:e.products.length)>0))},dependencies:[A,V,U,L,z,nt,gt,Lt,Gt,q,K],encapsulation:2})}}return i})();var Di=()=>["/menu/products/status/sold-in-channel"],on=i=>({ID:i}),Oi=()=>["/menu/products/status/not-in-pos"];function ki(i,d){if(i&1&&(b(0),p(1),P()),i&2){let t=s().$implicit;r(),y(" ",t.Count," ")}}function Ei(i,d){if(i&1){let t=x();o(0,"span",26),g("click",function(){m(t);let e=s().$implicit,c=s(2);return u(c.getLiveProductCount(e.ID,e))}),_(1,"i",27),a()}}function Fi(i,d){if(i&1){let t=x();o(0,"tr")(1,"td"),_(2,"img",17),o(3,"span",18),p(4),a()(),o(5,"td",19),C(6,ki,2,1,"ng-container",6)(7,Ei,2,0,"ng-template",null,1,j),a(),o(9,"td",19)(10,"a",20),p(11),k(12,"number"),a()(),o(13,"td",19)(14,"a",20),p(15),k(16,"number"),a()(),o(17,"td"),p(18),k(19,"date"),a(),o(20,"td")(21,"div",21)(22,"button",22),g("click",function(){let e=m(t).$implicit,c=s(2);return u(c.onScanChannel(e))}),_(23,"i",23),p(24," Scan "),a(),o(25,"button",24),g("click",function(){let e=m(t).$implicit,c=s(2);return u(c.onClearCache(e.ID))}),_(26,"i",25),p(27," Clear "),a()()()()}if(i&2){let t=d.$implicit,n=B(8),e=s(2);r(2),l("src",e.getChannelLogo(t.TypeID),w),r(2),N(t.Name),r(2),l("ngIf",t.Count!==void 0)("ngIfElse",n),r(4),l("routerLink",ct(18,Di))("queryParams",Q(19,on,t.ID)),r(),y(" ",E(12,11,t.SoldInChannel)," "),r(3),l("routerLink",ct(21,Oi))("queryParams",Q(22,on,t.ID)),r(),y(" ",E(16,13,t.NotInPOS)," "),r(3),y("",t.LastSync?he(19,15,t.LastSync,"dd MMM yyyy HH:mm"):"Never"," ")}}function Vi(i,d){if(i&1&&(b(0),o(1,"div",7)(2,"table",8)(3,"thead",9)(4,"tr",10)(5,"th"),p(6,"Channel"),a(),o(7,"th",11),p(8,"Live Product"),a(),o(9,"th",12),p(10,"Sold In Channel"),a(),o(11,"th",13),p(12,"Product Not in POS"),a(),o(13,"th",14),p(14,"Last Sync"),a(),_(15,"th",15),a()(),o(16,"tbody"),C(17,Fi,28,24,"tr",16),k(18,"async"),a()()(),P()),i&2){let t,n=s();r(17),l("ngForOf",(t=E(18,1,n.channels$))==null?null:t.Data)}}function Ni(i,d){i&1&&(o(0,"div",28),_(1,"app-empty-state"),a())}var an=(()=>{class i{constructor(t,n,e,c){this.productService=t,this.toastr=n,this.dialog=e,this.authService=c,this.destroy$=new ae,this.channelOptions=c.getChannels()}ngOnInit(){this.setObsProductStatistic()}setObsProductStatistic(){this.channels$=this.productService.getProductStatistic()}getLiveProductCount(t,n){this.productService.getTotalProductLive(t).pipe(Jt(this.destroy$)).subscribe(e=>{n.Count=e.Count})}onScanChannel(t){this.dialog.open(R,{width:"700px",data:{channelOptions:this.channelOptions,filter:{ChannelID:t.ID},disabledChannelOption:!0}}).afterClosed().pipe(F(n=>f.IsNotEmpty(n))).subscribe(n=>{this.scanAllProduct(t.ID,n)})}scanAllProduct(t,n){let e=this.productService.findChannelById(t,this.channelOptions);this.productService.scanAll(n.ChannelID,n.ScanFull,n.UpdatedProduct,n.Async).pipe(F(c=>c)).subscribe(c=>{n.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(c,e,!n.UpdatedProduct),this.setObsProductStatistic())})}onClearCache(t){confirm("Are you sure you want to Clear Cache? This Process will remove your product integration to marketplace")&&this.productService.clearCacheChannel(t).pipe(Jt(this.destroy$)).subscribe(e=>{this.toastr.success("Successfully cleared cache","Success"),this.setObsProductStatistic()})}getChannelLogo(t){return f.getChannelLogoByTypeId(t)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(n){return new(n||i)(S(H),S($),S(Z),S(G))}}static{this.\u0275cmp=M({type:i,selectors:[["app-channel-statistic"]],standalone:!1,decls:9,vars:6,consts:[["EMPTY",""],["QUESTION",""],["headerTitle","Products Statistic",3,"hideSearchBox","hideSearchDropdown"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[1,"text-center",2,"width","13rem"],[1,"text-center",2,"width","9rem"],[1,"text-center",2,"width","14rem"],[2,"width","10rem"],[2,"width","12rem"],[4,"ngFor","ngForOf"],[2,"width","24px","height","24px",3,"src"],[1,"ms-3"],[1,"text-center"],[3,"routerLink","queryParams"],[1,"d-flex","align-items-center","justify-content-center"],[1,"btn","btn-sm","btn-secondary","fs-6",3,"click"],[1,"fa","fa-spinner"],[1,"btn","btn-sm","btn-secondary","fs-6","ms-3",3,"click"],[1,"fa","fa-trash"],["matTooltip","Click to see total live product",1,"cursor-pointer","fs-5","text-primary",3,"click"],[1,"fa-solid","fa-circle-question","cursor"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(n,e){if(n&1&&(o(0,"mainpanel",2)(1,"content")(2,"div",3)(3,"div",4)(4,"div",5),C(5,Vi,19,3,"ng-container",6),k(6,"async"),C(7,Ni,2,0,"ng-template",null,0,j),a()()()()()),n&2){let c,h=B(8);l("hideSearchBox",!0)("hideSearchDropdown",!0),r(5),l("ngIf",((c=E(6,4,e.channels$))==null||c.Data==null?null:c.Data.length)>0)("ngIfElse",h)}},dependencies:[A,V,z,it,Ut,K,mt,ut,_e],encapsulation:2})}}return i})();var Ai=[{component:Je,path:"",children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:Qe,canActivate:[st],data:{title:"Products in POS"}},{path:"sold-in-channel",component:Xe,canActivate:[st],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:tn,canActivate:[st],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:en,canActivate:[st],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:nn,canActivate:[st],data:{title:"Duplicate Sku in Channel"}},{path:"channel-statistic",component:an,canActivate:[st],data:{title:"Channel Statistic"}}]}],nr=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=de({type:i})}static{this.\u0275inj=ce({imports:[Y,_t,Ie,ot,xe,Ke,Ee,Me,Gt,q,rt,Ce.forChild(Ai),We,Ne,bt]})}}return i})();export{nr as StatusModule};
@@ -1 +1 @@
1
- import{a as O}from"./chunk-UBMI3NQH.js";import{a as P}from"./chunk-J3P46Z53.js";import{a as M}from"./chunk-4ASUM4N5.js";import{b as h}from"./chunk-7FUVW73P.js";import"./chunk-M3SJUKTG.js";import{c as f}from"./chunk-GHQH62TZ.js";import"./chunk-CH2MLZU7.js";import{a}from"./chunk-7XREAR3H.js";import{a as C}from"./chunk-62PFQNHJ.js";import"./chunk-Q72ZXPDP.js";import"./chunk-MNFHFW3E.js";import"./chunk-ZZVNB72Q.js";import"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import{e as u}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import"./chunk-CHZLFJFI.js";import"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{m as g}from"./chunk-BIQHA7UA.js";import{s}from"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{y as l}from"./chunk-DPLEMBB4.js";import"./chunk-PXB4YEY3.js";import{F as c,J as i,n as r}from"./chunk-GPEVUTDI.js";import{Eb as p,Fb as e,ic as d,ka as n}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var x=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=p({type:t,selectors:[["app-products"]],standalone:!1,decls:1,vars:0,template:function(o,y){o&1&&d(0,"router-outlet")},dependencies:[c],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]})}}return t})();var w=[{path:"",component:x,children:[{path:"",redirectTo:"status",pathMatch:"full"},{path:"status",loadChildren:()=>import("./chunk-CYZQNZDB.js").then(t=>t.StatusModule),canActivate:[a]},{path:"download",loadChildren:()=>import("./chunk-VJKFHBPN.js").then(t=>t.DownloadModule),canActivate:[a]},{path:"upload",loadComponent:()=>import("./chunk-JFJCXZD3.js").then(t=>t.ProductUploadComponent),data:{title:"Upload Product"},canActivate:[a]}]}],_=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275mod=e({type:t})}static{this.\u0275inj=n({imports:[r,i.forChild(w)]})}}return t})();var V=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275mod=e({type:t})}static{this.\u0275inj=n({imports:[r,l,i,_,s,g,u,h,M,f,C,P,O]})}}return t})();export{V as ProductModule};
1
+ import{a as O}from"./chunk-UBMI3NQH.js";import{a as P}from"./chunk-J3P46Z53.js";import{a as M}from"./chunk-4ASUM4N5.js";import{b as h}from"./chunk-7FUVW73P.js";import"./chunk-M3SJUKTG.js";import{c as f}from"./chunk-GHQH62TZ.js";import"./chunk-CH2MLZU7.js";import{a}from"./chunk-YPM6IC2W.js";import{a as C}from"./chunk-62PFQNHJ.js";import"./chunk-Q72ZXPDP.js";import"./chunk-MNFHFW3E.js";import"./chunk-ZZVNB72Q.js";import"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import{e as u}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import"./chunk-LEMNVA5V.js";import"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{n as g}from"./chunk-ITTRZMEX.js";import{s}from"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{y as l}from"./chunk-DPLEMBB4.js";import"./chunk-PXB4YEY3.js";import{F as c,J as i,n as r}from"./chunk-GPEVUTDI.js";import{Eb as p,Fb as e,ic as d,ka as n}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var x=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=p({type:t,selectors:[["app-products"]],standalone:!1,decls:1,vars:0,template:function(o,y){o&1&&d(0,"router-outlet")},dependencies:[c],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]})}}return t})();var w=[{path:"",component:x,children:[{path:"",redirectTo:"status",pathMatch:"full"},{path:"status",loadChildren:()=>import("./chunk-LJTMOYLO.js").then(t=>t.StatusModule),canActivate:[a]},{path:"download",loadChildren:()=>import("./chunk-TXPNZLOJ.js").then(t=>t.DownloadModule),canActivate:[a]},{path:"upload",loadComponent:()=>import("./chunk-HMB7FZD7.js").then(t=>t.ProductUploadComponent),data:{title:"Upload Product"},canActivate:[a]}]}],_=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275mod=e({type:t})}static{this.\u0275inj=n({imports:[r,i.forChild(w)]})}}return t})();var V=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275mod=e({type:t})}static{this.\u0275inj=n({imports:[r,l,i,_,s,g,u,h,M,f,C,P,O]})}}return t})();export{V as ProductModule};
@@ -1 +1 @@
1
- import{a as R}from"./chunk-OLSC6KHB.js";import{b as V,c as A,i as D,j as P}from"./chunk-BIQHA7UA.js";import{h as U,m as b}from"./chunk-DPLEMBB4.js";import{Eb as f,Ec as g,Fc as k,Ic as I,Jc as O,Kb as u,Kc as T,Wb as c,bc as M,cc as y,ec as w,fc as v,gc as l,hc as r,ic as S,mc as p,ob as _,qb as a,rc as h,sc as x,wb as m,ya as s,za as d}from"./chunk-T5ONJF63.js";function j(o,C){if(o&1){let e=p();l(0,"span")(1,"mat-checkbox",4),h("change",function(t){s(e);let i=x();return d(i.onSelectAll(t==null?null:t.checked))}),l(2,"h5",5),g(3,"Select All"),r()()()}}function E(o,C){if(o&1){let e=p();l(0,"li")(1,"mat-checkbox",6),T("ngModelChange",function(t){let i=s(e).$implicit;return O(i.selected,t)||(i.selected=t),d(t)}),l(2,"div",7),S(3,"img",8),l(4,"h5",9),g(5),r()()()()}if(o&2){let e=C.$implicit;a(),I("ngModel",e.selected),a(2),c("src",e.Img,_),a(2),k(e.Name)}}var q=(()=>{class o{constructor(e,n){this.data=e,this.dialogRef=n,this.selectedItems=this.data.selectedItems,this.channels=this.data.channels}ngOnInit(){this.initModalConfig()}initModalConfig(){let e=this.data.title?this.data.title:"Updating Inventory";this.modalConfig=new D,this.modalConfig.title=e}onSelectAll(e){this.channels=this.channels.map(n=>(n.selected=e,n))}onOk(){this.dialogRef.close(this.channels)}onClose(){this.dialogRef.close()}getSelectedChannel(){return this.channels.filter(e=>e.selected)}static{this.\u0275fac=function(n){return new(n||o)(m(A),m(V))}}static{this.\u0275cmp=f({type:o,selectors:[["app-modal-update-channels"]],standalone:!1,decls:7,vars:3,consts:[[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[2,"overflow-y","auto","max-height","28rem"],[1,"no-bullet",2,"margin-bottom","0px !important","overflow","hidden"],["color","primary",1,"me-6",3,"change"],[1,"fw-light"],["color","primary",3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center"],[1,"channelLogo-md",3,"src"],[1,"fw-light","ms-2","my-auto"]],template:function(n,t){if(n&1&&(l(0,"modal-material",0),h("onOk",function(){return t.onOk()})("onClose",function(){return t.onClose()})("onCancel",function(){return t.onClose()}),l(1,"div",1)(2,"div",2),u(3,j,4,0,"span"),l(4,"ul",3),w(5,E,6,3,"li",null,y),r()()()()),n&2){let i;c("dynamicValidated",((i=t.getSelectedChannel())==null?null:i.length)>0)("config",t.modalConfig),a(3),M((t.channels==null?null:t.channels.length)>1?3:-1),a(2),v(t.channels)}},dependencies:[U,b,R,P],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}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}"]})}}return o})();export{q as a};
1
+ import{a as R}from"./chunk-OLSC6KHB.js";import{b as V,c as A,j as D,k as P}from"./chunk-ITTRZMEX.js";import{h as U,m as b}from"./chunk-DPLEMBB4.js";import{Eb as f,Ec as g,Fc as k,Ic as I,Jc as O,Kb as u,Kc as T,Wb as c,bc as M,cc as y,ec as w,fc as v,gc as l,hc as r,ic as S,mc as p,ob as _,qb as a,rc as h,sc as x,wb as m,ya as s,za as d}from"./chunk-T5ONJF63.js";function j(o,C){if(o&1){let e=p();l(0,"span")(1,"mat-checkbox",4),h("change",function(t){s(e);let i=x();return d(i.onSelectAll(t==null?null:t.checked))}),l(2,"h5",5),g(3,"Select All"),r()()()}}function E(o,C){if(o&1){let e=p();l(0,"li")(1,"mat-checkbox",6),T("ngModelChange",function(t){let i=s(e).$implicit;return O(i.selected,t)||(i.selected=t),d(t)}),l(2,"div",7),S(3,"img",8),l(4,"h5",9),g(5),r()()()()}if(o&2){let e=C.$implicit;a(),I("ngModel",e.selected),a(2),c("src",e.Img,_),a(2),k(e.Name)}}var q=(()=>{class o{constructor(e,n){this.data=e,this.dialogRef=n,this.selectedItems=this.data.selectedItems,this.channels=this.data.channels}ngOnInit(){this.initModalConfig()}initModalConfig(){let e=this.data.title?this.data.title:"Updating Inventory";this.modalConfig=new D,this.modalConfig.title=e}onSelectAll(e){this.channels=this.channels.map(n=>(n.selected=e,n))}onOk(){this.dialogRef.close(this.channels)}onClose(){this.dialogRef.close()}getSelectedChannel(){return this.channels.filter(e=>e.selected)}static{this.\u0275fac=function(n){return new(n||o)(m(A),m(V))}}static{this.\u0275cmp=f({type:o,selectors:[["app-modal-update-channels"]],standalone:!1,decls:7,vars:3,consts:[[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[2,"overflow-y","auto","max-height","28rem"],[1,"no-bullet",2,"margin-bottom","0px !important","overflow","hidden"],["color","primary",1,"me-6",3,"change"],[1,"fw-light"],["color","primary",3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center"],[1,"channelLogo-md",3,"src"],[1,"fw-light","ms-2","my-auto"]],template:function(n,t){if(n&1&&(l(0,"modal-material",0),h("onOk",function(){return t.onOk()})("onClose",function(){return t.onClose()})("onCancel",function(){return t.onClose()}),l(1,"div",1)(2,"div",2),u(3,j,4,0,"span"),l(4,"ul",3),w(5,E,6,3,"li",null,y),r()()()()),n&2){let i;c("dynamicValidated",((i=t.getSelectedChannel())==null?null:i.length)>0)("config",t.modalConfig),a(3),M((t.channels==null?null:t.channels.length)>1?3:-1),a(2),v(t.channels)}},dependencies:[U,b,R,P],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}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}"]})}}return o})();export{q as a};
@@ -1 +1 @@
1
- import{a as ce}from"./chunk-XM6GN4VF.js";import"./chunk-7477X7LJ.js";import{a as le}from"./chunk-CMCNEAGC.js";import{a as re}from"./chunk-YR2WEZDG.js";import{a as D}from"./chunk-XHAXYWZ7.js";import{c as se,d as E}from"./chunk-4XMCJ7I5.js";import"./chunk-YXFTLQ5M.js";import"./chunk-MATSRG2L.js";import"./chunk-V2OJQHE3.js";import"./chunk-6XFYITUD.js";import"./chunk-OLSC6KHB.js";import"./chunk-LPXBSHUI.js";import"./chunk-D54NUPYF.js";import{a as oe}from"./chunk-EGTYAIU5.js";import"./chunk-7TWBIV3T.js";import"./chunk-J7AGLBPL.js";import"./chunk-6ALHX2I4.js";import"./chunk-4G3QN54S.js";import"./chunk-3RK6DDJD.js";import"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{l as M}from"./chunk-CHZLFJFI.js";import{b as Z,e as ee}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{d as te,k as ne,l as ie,m as ae}from"./chunk-BIQHA7UA.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{c as J,h as K,m as q,o as X,y as Y}from"./chunk-DPLEMBB4.js";import{c as g}from"./chunk-PXB4YEY3.js";import{g as z,j as $,n as Q}from"./chunk-GPEVUTDI.js";import{Eb as j,Ec as I,G as x,Ic as F,Jc as L,Kb as _,Kc as T,Oc as H,Qa as w,Wb as h,Zc as v,_c as y,ea as B,gc as s,hc as c,ic as A,ja as k,jc as U,kc as G,lc as W,mc as N,pa as S,qb as p,rc as u,sc as m,wb as d,ya as b,za as P}from"./chunk-T5ONJF63.js";import{a as O,b as R}from"./chunk-K2H6WANG.js";var V=(()=>{class r{constructor(){this.authService=S(M),this.channelOptions=this.authService.getChannels()}filterSelectedChannels(t,i){let e=Object.assign([],this.channelOptions),n=[],a;return t.forEach(o=>{a=e.find(l=>l.ID==o?.parent?.id),a&&(a=R(O({},a),{Name:`${o?.parent?.label} - ${o?.label}`,LocationID:o?.id}),n.push(a))}),i.forEach(o=>{a=e.find(l=>l.ID==o.id),a&&n.push(a)}),n}generateFilterLocation(t,i){let e=[],n=[],a=[];return t.length>0?(e=t.map(o=>o.id),n=t.filter(o=>g.IsNotEmpty(o?.parent?.id)).map(o=>o?.parent?.id).filter((o,l,f)=>f.indexOf(o)===l)):(e=[],n=[]),a=i.map(o=>o.id),a=a.concat(n).filter((o,l,f)=>f.indexOf(o)===l),{locationIds:e,channelIds:a}}static{this.\u0275fac=function(i){return new(i||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();function he(r,C){if(r&1){let t=N();s(0,"button",15),u("click",function(){b(t);let e=m().ngIf,n=m();return P(n.onUpdateItems(e))}),A(1,"i",16),I(2," Update "),c()}}function de(r,C){if(r&1&&(s(0,"actions")(1,"div",13),_(2,he,3,0,"button",14),c()()),r&2){let t=C.ngIf,i=m();p(2),h("ngIf",i.productService.hasSelectionVariant(t))}}function me(r,C){r&1&&W(0)}function ue(r,C){if(r&1){let t=N();U(0),s(1,"app-table",17),u("onToggle",function(e){b(t);let n=m();return P(n.onShowDifferenceStock(e))})("onSubmit",function(e){b(t);let n=m();return P(n.updateStockByVariant(e))}),c(),G()}if(r&2){let t=C.ngIf,i=m();p(),h("data",t)("channel",i.channels())("showProductToggle",!0)("hiddenIPOSInventory",i.searchFilter.HiddenIPOSInventory)}}var ze=(()=>{class r{constructor(t,i,e,n,a,o){this.http=t,this.toastr=i,this.dialog=e,this.productService=n,this.authService=a,this.mainPanelService=o,this.paginationService=S(E),this.multiChannelService=S(V),this.searchFilter={PageNumber:1,RowCount:100},this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.selectedLocations=w([]),this.selectedChannels=w([]),this.channels=w([]),this.pageData={Title:"Inventory",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory/pos",Active:!0},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.paginationService.fethRowCountEndpoint=this.allDataCountEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(B(t=>{t.Filter={PageNumber:t.Filter.PageNumber,filterModel:D.ALL,RowCount:t.Filter.PageSize,HiddenIPOSInventory:t.Filter.HiddenIPOSInventory},this.searchFilter=t.Filter,this.mainPanelService.openModalFilter()}))}onChannelChange(t=[]){let i=t.filter(n=>g.isValidGUID(n.id)==!1),e=t.filter(n=>g.isValidGUID(n.id));this.selectedLocations.set(i),this.selectedChannels.set(e)}onSearch(t){let i=this.multiChannelService.filterSelectedChannels(this.selectedLocations(),this.selectedChannels());this.channels.set(i);let e=this.multiChannelService.generateFilterLocation(this.selectedLocations(),this.selectedChannels());this.searchFilter.ListChannelID=e.channelIds,this.searchFilter.ListLocationID=e.locationIds,this.searchFilter.text=t,this.paginationService.reloadPagination(this.searchFilter)}updateStock(t,i){let e=this.productService.selectedVariantProduct(t);if(e.length>0){let n=[];e.forEach(l=>{l.Channel?.forEach(f=>{n.push({ID:l.ID,Code:l.Code,Inventory:l.Inventory,LocationID:f.LocationID})})});let o={ListChannelID:i.filter(l=>l.selected).map(l=>l.ID),List:n};this.http.post("/api/Inventory/UpdateChannel",o).subscribe(l=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+o.List.length+" variants in "+o.ListChannelID.length+" channels","Success")})}}updateStockByVariant(t){let i={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku,LocationID:t.LocationID};this.http.post("/api/Inventory/UpdateQuantityByItem",i).subscribe(e=>{this.paginationService.reloadPagination(this.searchFilter);let n=this.productService.findChannelById(i.ID,this.channelOptions);this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+n.Name+" to "+i.NewQuantity,"Success")})}onShowDifferenceStock(t){t?this.searchFilter.filterModel=D.DIFFERENCE:this.searchFilter.filterModel=D.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(t){let i=this.productService.selectedVariantProduct(t),e=this.channelOptions.filter(n=>this.channels()?.find(a=>a.ID===n.ID));this.dialog.open(re,{data:{selectedItems:i,channels:JSON.parse(JSON.stringify(e))},width:"400px"}).afterClosed().pipe(x(n=>g.IsNotEmpty(n))).subscribe(n=>{this.updateStock(t,n)})}static{this.\u0275fac=function(i){return new(i||r)(d(ee),d(Z),d(te),d(oe),d(M),d(ne))}}static{this.\u0275cmp=j({type:r,selectors:[["app-multi-channel-comparison"]],features:[H([E,V])],decls:26,vars:22,consts:[["headerTitle","Inventory Comparison","textButton","Search",3,"onSubmit","pageData","hideSearchBox"],[4,"ngIf"],["for","selectChannel",1,"fw-bold","mb-3"],["id","selectChannel",3,"onChannelChange","multiple"],[1,"mt-5"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"d-flex"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"onToggle","onSubmit","data","channel","showProductToggle","hiddenIPOSInventory"]],template:function(i,e){i&1&&(s(0,"mainpanel",0),u("onSubmit",function(a){return e.onSearch(a)}),_(1,de,3,1,"actions",1),v(2,"async"),s(3,"filters"),_(4,me,1,0,"ng-container",1),v(5,"async"),s(6,"div")(7,"label",2),I(8,"Channel"),c(),s(9,"multiwarehouse-tree-select",3),u("onChannelChange",function(a){return e.onChannelChange(a)}),c()(),s(10,"div",4)(11,"label",5),I(12,"PageNumber"),c(),s(13,"input",6),T("ngModelChange",function(a){return L(e.searchFilter.PageNumber,a)||(e.searchFilter.PageNumber=a),a}),c()(),s(14,"div",4)(15,"label",7),I(16,"Page Size"),c(),s(17,"input",8),T("ngModelChange",function(a){return L(e.searchFilter.RowCount,a)||(e.searchFilter.RowCount=a),a}),c()()(),s(18,"content")(19,"div",9)(20,"div",10)(21,"div",11),_(22,ue,2,4,"ng-container",1),v(23,"async"),s(24,"infinite-paginator",12),v(25,"async"),u("onNextPage",function(){return e.paginationService.onNextPage(e.searchFilter)})("onLastPage",function(){return e.paginationService.onLastPage(e.searchFilter)})("onGetRowCount",function(){return e.paginationService.getRowCount(e.searchFilter)}),c()()()()()()),i&2&&(h("pageData",e.pageData)("hideSearchBox",!1),p(),h("ngIf",y(2,14,e.paginationService.data$)),p(3),h("ngIf",y(5,16,e.loader$)),p(5),h("multiple",!0),p(4),F("ngModel",e.searchFilter.PageNumber),p(4),F("ngModel",e.searchFilter.RowCount),p(5),h("ngIf",y(23,18,e.paginationService.data$)),p(2),h("totalData",e.paginationService.totalData())("hideCount",e.paginationService.hideCount())("rowCount",y(25,20,e.paginationService.totalRowCount$))("pageNumber",e.paginationService.pageNumber())("disableNextButton",e.paginationService.disableNextButton())("goToLastPage",e.paginationService.isLastPage()))},dependencies:[Q,z,$,ae,ie,le,Y,J,X,K,q,se,ce],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]})}}return r})();export{ze as MultiChannelComparison};
1
+ import{a as ce}from"./chunk-XM6GN4VF.js";import"./chunk-7477X7LJ.js";import{a as le}from"./chunk-KC2DJUBC.js";import{a as re}from"./chunk-OAS72QB2.js";import{a as D}from"./chunk-XHAXYWZ7.js";import{c as se,d as E}from"./chunk-K3FQGMAY.js";import"./chunk-YXFTLQ5M.js";import"./chunk-MATSRG2L.js";import"./chunk-V2OJQHE3.js";import"./chunk-6XFYITUD.js";import"./chunk-OLSC6KHB.js";import"./chunk-LPXBSHUI.js";import"./chunk-D54NUPYF.js";import{a as oe}from"./chunk-EGTYAIU5.js";import"./chunk-7TWBIV3T.js";import"./chunk-J7AGLBPL.js";import"./chunk-6ALHX2I4.js";import"./chunk-4G3QN54S.js";import"./chunk-3RK6DDJD.js";import"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{l as M}from"./chunk-LEMNVA5V.js";import{b as Z,e as ee}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{d as te,l as ne,m as ie,n as ae}from"./chunk-ITTRZMEX.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{c as J,h as K,m as q,o as X,y as Y}from"./chunk-DPLEMBB4.js";import{c as g}from"./chunk-PXB4YEY3.js";import{g as z,j as $,n as Q}from"./chunk-GPEVUTDI.js";import{Eb as j,Ec as I,G as x,Ic as F,Jc as L,Kb as _,Kc as T,Oc as H,Qa as w,Wb as h,Zc as v,_c as y,ea as B,gc as s,hc as c,ic as A,ja as k,jc as U,kc as G,lc as W,mc as N,pa as S,qb as p,rc as u,sc as m,wb as d,ya as b,za as P}from"./chunk-T5ONJF63.js";import{a as O,b as R}from"./chunk-K2H6WANG.js";var V=(()=>{class r{constructor(){this.authService=S(M),this.channelOptions=this.authService.getChannels()}filterSelectedChannels(t,i){let e=Object.assign([],this.channelOptions),n=[],a;return t.forEach(o=>{a=e.find(l=>l.ID==o?.parent?.id),a&&(a=R(O({},a),{Name:`${o?.parent?.label} - ${o?.label}`,LocationID:o?.id}),n.push(a))}),i.forEach(o=>{a=e.find(l=>l.ID==o.id),a&&n.push(a)}),n}generateFilterLocation(t,i){let e=[],n=[],a=[];return t.length>0?(e=t.map(o=>o.id),n=t.filter(o=>g.IsNotEmpty(o?.parent?.id)).map(o=>o?.parent?.id).filter((o,l,f)=>f.indexOf(o)===l)):(e=[],n=[]),a=i.map(o=>o.id),a=a.concat(n).filter((o,l,f)=>f.indexOf(o)===l),{locationIds:e,channelIds:a}}static{this.\u0275fac=function(i){return new(i||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac})}}return r})();function he(r,C){if(r&1){let t=N();s(0,"button",15),u("click",function(){b(t);let e=m().ngIf,n=m();return P(n.onUpdateItems(e))}),A(1,"i",16),I(2," Update "),c()}}function de(r,C){if(r&1&&(s(0,"actions")(1,"div",13),_(2,he,3,0,"button",14),c()()),r&2){let t=C.ngIf,i=m();p(2),h("ngIf",i.productService.hasSelectionVariant(t))}}function me(r,C){r&1&&W(0)}function ue(r,C){if(r&1){let t=N();U(0),s(1,"app-table",17),u("onToggle",function(e){b(t);let n=m();return P(n.onShowDifferenceStock(e))})("onSubmit",function(e){b(t);let n=m();return P(n.updateStockByVariant(e))}),c(),G()}if(r&2){let t=C.ngIf,i=m();p(),h("data",t)("channel",i.channels())("showProductToggle",!0)("hiddenIPOSInventory",i.searchFilter.HiddenIPOSInventory)}}var ze=(()=>{class r{constructor(t,i,e,n,a,o){this.http=t,this.toastr=i,this.dialog=e,this.productService=n,this.authService=a,this.mainPanelService=o,this.paginationService=S(E),this.multiChannelService=S(V),this.searchFilter={PageNumber:1,RowCount:100},this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.selectedLocations=w([]),this.selectedChannels=w([]),this.channels=w([]),this.pageData={Title:"Inventory",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory/pos",Active:!0},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.paginationService.fethRowCountEndpoint=this.allDataCountEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(B(t=>{t.Filter={PageNumber:t.Filter.PageNumber,filterModel:D.ALL,RowCount:t.Filter.PageSize,HiddenIPOSInventory:t.Filter.HiddenIPOSInventory},this.searchFilter=t.Filter,this.mainPanelService.openModalFilter()}))}onChannelChange(t=[]){let i=t.filter(n=>g.isValidGUID(n.id)==!1),e=t.filter(n=>g.isValidGUID(n.id));this.selectedLocations.set(i),this.selectedChannels.set(e)}onSearch(t){let i=this.multiChannelService.filterSelectedChannels(this.selectedLocations(),this.selectedChannels());this.channels.set(i);let e=this.multiChannelService.generateFilterLocation(this.selectedLocations(),this.selectedChannels());this.searchFilter.ListChannelID=e.channelIds,this.searchFilter.ListLocationID=e.locationIds,this.searchFilter.text=t,this.paginationService.reloadPagination(this.searchFilter)}updateStock(t,i){let e=this.productService.selectedVariantProduct(t);if(e.length>0){let n=[];e.forEach(l=>{l.Channel?.forEach(f=>{n.push({ID:l.ID,Code:l.Code,Inventory:l.Inventory,LocationID:f.LocationID})})});let o={ListChannelID:i.filter(l=>l.selected).map(l=>l.ID),List:n};this.http.post("/api/Inventory/UpdateChannel",o).subscribe(l=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+o.List.length+" variants in "+o.ListChannelID.length+" channels","Success")})}}updateStockByVariant(t){let i={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku,LocationID:t.LocationID};this.http.post("/api/Inventory/UpdateQuantityByItem",i).subscribe(e=>{this.paginationService.reloadPagination(this.searchFilter);let n=this.productService.findChannelById(i.ID,this.channelOptions);this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+n.Name+" to "+i.NewQuantity,"Success")})}onShowDifferenceStock(t){t?this.searchFilter.filterModel=D.DIFFERENCE:this.searchFilter.filterModel=D.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(t){let i=this.productService.selectedVariantProduct(t),e=this.channelOptions.filter(n=>this.channels()?.find(a=>a.ID===n.ID));this.dialog.open(re,{data:{selectedItems:i,channels:JSON.parse(JSON.stringify(e))},width:"400px"}).afterClosed().pipe(x(n=>g.IsNotEmpty(n))).subscribe(n=>{this.updateStock(t,n)})}static{this.\u0275fac=function(i){return new(i||r)(d(ee),d(Z),d(te),d(oe),d(M),d(ne))}}static{this.\u0275cmp=j({type:r,selectors:[["app-multi-channel-comparison"]],features:[H([E,V])],decls:26,vars:22,consts:[["headerTitle","Inventory Comparison","textButton","Search",3,"onSubmit","pageData","hideSearchBox"],[4,"ngIf"],["for","selectChannel",1,"fw-bold","mb-3"],["id","selectChannel",3,"onChannelChange","multiple"],[1,"mt-5"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"d-flex"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"onToggle","onSubmit","data","channel","showProductToggle","hiddenIPOSInventory"]],template:function(i,e){i&1&&(s(0,"mainpanel",0),u("onSubmit",function(a){return e.onSearch(a)}),_(1,de,3,1,"actions",1),v(2,"async"),s(3,"filters"),_(4,me,1,0,"ng-container",1),v(5,"async"),s(6,"div")(7,"label",2),I(8,"Channel"),c(),s(9,"multiwarehouse-tree-select",3),u("onChannelChange",function(a){return e.onChannelChange(a)}),c()(),s(10,"div",4)(11,"label",5),I(12,"PageNumber"),c(),s(13,"input",6),T("ngModelChange",function(a){return L(e.searchFilter.PageNumber,a)||(e.searchFilter.PageNumber=a),a}),c()(),s(14,"div",4)(15,"label",7),I(16,"Page Size"),c(),s(17,"input",8),T("ngModelChange",function(a){return L(e.searchFilter.RowCount,a)||(e.searchFilter.RowCount=a),a}),c()()(),s(18,"content")(19,"div",9)(20,"div",10)(21,"div",11),_(22,ue,2,4,"ng-container",1),v(23,"async"),s(24,"infinite-paginator",12),v(25,"async"),u("onNextPage",function(){return e.paginationService.onNextPage(e.searchFilter)})("onLastPage",function(){return e.paginationService.onLastPage(e.searchFilter)})("onGetRowCount",function(){return e.paginationService.getRowCount(e.searchFilter)}),c()()()()()()),i&2&&(h("pageData",e.pageData)("hideSearchBox",!1),p(),h("ngIf",y(2,14,e.paginationService.data$)),p(3),h("ngIf",y(5,16,e.loader$)),p(5),h("multiple",!0),p(4),F("ngModel",e.searchFilter.PageNumber),p(4),F("ngModel",e.searchFilter.RowCount),p(5),h("ngIf",y(23,18,e.paginationService.data$)),p(2),h("totalData",e.paginationService.totalData())("hideCount",e.paginationService.hideCount())("rowCount",y(25,20,e.paginationService.totalRowCount$))("pageNumber",e.paginationService.pageNumber())("disableNextButton",e.paginationService.disableNextButton())("goToLastPage",e.paginationService.isLastPage()))},dependencies:[Q,z,$,ae,ie,le,Y,J,X,K,q,se,ce],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]})}}return r})();export{ze as MultiChannelComparison};
@@ -0,0 +1 @@
1
+ import{b as E,c as I,j as K,k as T}from"./chunk-ITTRZMEX.js";import{r as x}from"./chunk-TMFFA26Y.js";import{c as f}from"./chunk-PXB4YEY3.js";import{d as V}from"./chunk-GPEVUTDI.js";import{Eb as b,Ec as m,Fc as h,Qa as _,Qc as S,Wb as p,cc as O,ec as v,fc as P,gc as o,hc as l,qb as d,rc as y,wb as g}from"./chunk-T5ONJF63.js";var N=i=>({"bg-gradient-warning":i});function D(i,U){if(i&1&&(o(0,"tr",5)(1,"td"),m(2),l(),o(3,"td",6),m(4),l()()),i&2){let t=U.$implicit;p("matTooltip",t.duplicateMessage),d(2),h(t==null?null:t.Name),d(),p("ngClass",S(4,N,t.isDuplicate)),d(),h(t!=null&&t.ChannelVariationSKU?t==null?null:t.ChannelVariationSKU:"Not Assigned")}}var z=(()=>{class i{constructor(t,e){this.data=t,this.dialogRef=e,this.variants=_([])}ngOnInit(){this.initModalConfig(),this.initVariants()}initVariants(){let t=this.data?.variants,e={},a=[],C=t.filter(n=>f.IsEmpty(n.ChannelVariationSKU));t.filter(n=>f.IsNotEmpty(n.ChannelVariationSKU)).forEach((n,r,M)=>{e[n.ChannelVariationSKU]=M.filter(s=>s.ChannelVariationSKU===n.ChannelVariationSKU)}),Object.keys(e).forEach(n=>{e[n].length>1&&(e[n]=e[n].map((r,M,s)=>{let u=`SKU ${r.ChannelVariationSKU} is duplicated with variant`;return s.forEach((c,k)=>{c.Name!==r.Name&&(u+=` ${s.length>2?c.Name+(k!==s.length-1?",":""):c.Name}`)}),r.duplicateMessage=u,r.isDuplicate=!0,r})),a.push(...e[n])}),a.push(...C),this.variants.set(a)}initModalConfig(){this.modalConfig=new K,this.modalConfig.title=this.data?.title,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0,this.modalConfig.bodyScrollable=!0}static{this.\u0275fac=function(e){return new(e||i)(g(I),g(E))}}static{this.\u0275cmp=b({type:i,selectors:[["app-modal-variants"]],standalone:!1,decls:12,vars:1,consts:[[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"sticky-top"],["matTooltipPosition","above",3,"matTooltip"],[3,"ngClass"]],template:function(e,a){e&1&&(o(0,"modal-material",0),y("onCancel",function(){return a.dialogRef.close()}),o(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4),m(6,"Variant"),l(),o(7,"th",4),m(8,"SKU"),l()()(),o(9,"tbody"),v(10,D,5,6,"tr",5,O),l()()()()),e&2&&(p("config",a.modalConfig),d(10),P(a.variants()))},dependencies:[V,x,T],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#f6f6f6!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}"]})}}return i})();export{z as a};
@@ -1 +1 @@
1
- import{a as _}from"./chunk-GBABJLPQ.js";import"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import{l as A,m as L}from"./chunk-BIQHA7UA.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import"./chunk-DPLEMBB4.js";import{E as R,H as b,J as M,g as I,j as g,k as x,l as D,m as E,n as C}from"./chunk-GPEVUTDI.js";import{$c as v,Eb as h,Ec as o,Fc as p,Gc as S,Kb as f,Wb as c,Z as y,Zc as l,_c as s,gc as i,hc as n,qb as a,v as u,wb as m}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";function P(r,B){if(r&1&&(i(0,"div",3)(1,"div",4)(2,"div",5)(3,"div",6)(4,"div",7)(5,"h5"),o(6,"General"),n()(),i(7,"div",8)(8,"div",9)(9,"div",10)(10,"div",11)(11,"label"),o(12,"Created"),n(),i(13,"div")(14,"span"),o(15),l(16,"date"),n()()()(),i(17,"div",10)(18,"div",11)(19,"label"),o(20,"Duration"),n(),i(21,"div")(22,"span"),o(23),l(24,"number"),n()()()(),i(25,"div",10)(26,"div",11)(27,"label"),o(28,"Response Code"),n(),i(29,"div")(30,"span"),o(31),n()()()()()()()()(),i(32,"div",4)(33,"div",10)(34,"div",6)(35,"div",7)(36,"h5"),o(37,"Request"),n()(),i(38,"div",8)(39,"div",12)(40,"div",13)(41,"pre"),o(42),l(43,"json"),n()()()()()(),i(44,"div",10)(45,"div",6)(46,"div",7)(47,"h5"),o(48,"Response"),n()(),i(49,"div",8)(50,"div",14)(51,"div",13)(52,"pre"),o(53),l(54,"json"),n()()()()()()()()),r&2){let e=B.ngIf;a(15),p(v(16,5,e==null?null:e._source["@timestamp"],"dd MMM yyyy HH:mm:ss")),a(8),S("",v(24,8,e==null?null:e.DurationInSecond,"1.1-1")," s"),a(8),p(e==null?null:e.respCode),a(11),p(s(43,11,e==null?null:e.req)),a(11),p(s(54,13,e==null?null:e.res))}}var $=(()=>{class r{constructor(e,t){this.inventoryAsyncServiceLog=e,this.activatedRoute=t}ngOnInit(){let e=this.activatedRoute.snapshot.queryParams;this.initInventoryLog(e?.ID)}initInventoryLog(e){this.inventoryLog$=this.inventoryAsyncServiceLog.getInventoryAsyncLogDetail(e).pipe(u(t=>{let d=JSON.parse(t.hits[0]._source?.log?.response);return t.hits[0].DurationInSecond=parseInt(d.Duration)/1e3,t.hits[0].respCode=d?.StatusCode,t.hits[0].req=JSON.parse(t.hits[0]._source?.log?.request),t.hits[0].res=d,t?.hits[0]}),y(1))}static{this.\u0275fac=function(t){return new(t||r)(m(_),m(R))}}static{this.\u0275cmp=h({type:r,selectors:[["app-inventory-async-detail"]],decls:7,vars:5,consts:[["headerTitle","Product Inventory Sync Detail",3,"hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/inventory",1,"btn","btn-secondary","btn-fill","btn-lg","me-2"],["class","container-fluid mt-3",4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"row","mt-7"],[1,"col-sm-6"],[1,"info-label-group"],[1,"col-sm-12"],[1,"form-group"],[1,"col-sm-12","mt-2"]],template:function(t,d){t&1&&(i(0,"mainpanel",0)(1,"actions")(2,"a",1),o(3,"Back"),n()(),i(4,"content"),f(5,P,55,15,"div",2),l(6,"async"),n()()),t&2&&(c("hideSearchBox",!0)("hideSearchDropdown",!0),a(5),c("ngIf",s(6,3,d.inventoryLog$)))},dependencies:[C,I,g,D,E,x,L,A,M,b],encapsulation:2})}}return r})();export{$ as InventoryAsyncDetailComponent};
1
+ import{a as _}from"./chunk-GBABJLPQ.js";import"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import{m as A,n as L}from"./chunk-ITTRZMEX.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import"./chunk-DPLEMBB4.js";import{E as R,H as b,J as M,g as I,j as g,k as x,l as D,m as E,n as C}from"./chunk-GPEVUTDI.js";import{$c as v,Eb as h,Ec as o,Fc as p,Gc as S,Kb as f,Wb as c,Z as y,Zc as l,_c as s,gc as i,hc as n,qb as a,v as u,wb as m}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";function P(r,B){if(r&1&&(i(0,"div",3)(1,"div",4)(2,"div",5)(3,"div",6)(4,"div",7)(5,"h5"),o(6,"General"),n()(),i(7,"div",8)(8,"div",9)(9,"div",10)(10,"div",11)(11,"label"),o(12,"Created"),n(),i(13,"div")(14,"span"),o(15),l(16,"date"),n()()()(),i(17,"div",10)(18,"div",11)(19,"label"),o(20,"Duration"),n(),i(21,"div")(22,"span"),o(23),l(24,"number"),n()()()(),i(25,"div",10)(26,"div",11)(27,"label"),o(28,"Response Code"),n(),i(29,"div")(30,"span"),o(31),n()()()()()()()()(),i(32,"div",4)(33,"div",10)(34,"div",6)(35,"div",7)(36,"h5"),o(37,"Request"),n()(),i(38,"div",8)(39,"div",12)(40,"div",13)(41,"pre"),o(42),l(43,"json"),n()()()()()(),i(44,"div",10)(45,"div",6)(46,"div",7)(47,"h5"),o(48,"Response"),n()(),i(49,"div",8)(50,"div",14)(51,"div",13)(52,"pre"),o(53),l(54,"json"),n()()()()()()()()),r&2){let e=B.ngIf;a(15),p(v(16,5,e==null?null:e._source["@timestamp"],"dd MMM yyyy HH:mm:ss")),a(8),S("",v(24,8,e==null?null:e.DurationInSecond,"1.1-1")," s"),a(8),p(e==null?null:e.respCode),a(11),p(s(43,11,e==null?null:e.req)),a(11),p(s(54,13,e==null?null:e.res))}}var $=(()=>{class r{constructor(e,t){this.inventoryAsyncServiceLog=e,this.activatedRoute=t}ngOnInit(){let e=this.activatedRoute.snapshot.queryParams;this.initInventoryLog(e?.ID)}initInventoryLog(e){this.inventoryLog$=this.inventoryAsyncServiceLog.getInventoryAsyncLogDetail(e).pipe(u(t=>{let d=JSON.parse(t.hits[0]._source?.log?.response);return t.hits[0].DurationInSecond=parseInt(d.Duration)/1e3,t.hits[0].respCode=d?.StatusCode,t.hits[0].req=JSON.parse(t.hits[0]._source?.log?.request),t.hits[0].res=d,t?.hits[0]}),y(1))}static{this.\u0275fac=function(t){return new(t||r)(m(_),m(R))}}static{this.\u0275cmp=h({type:r,selectors:[["app-inventory-async-detail"]],decls:7,vars:5,consts:[["headerTitle","Product Inventory Sync Detail",3,"hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/inventory",1,"btn","btn-secondary","btn-fill","btn-lg","me-2"],["class","container-fluid mt-3",4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"row","mt-7"],[1,"col-sm-6"],[1,"info-label-group"],[1,"col-sm-12"],[1,"form-group"],[1,"col-sm-12","mt-2"]],template:function(t,d){t&1&&(i(0,"mainpanel",0)(1,"actions")(2,"a",1),o(3,"Back"),n()(),i(4,"content"),f(5,P,55,15,"div",2),l(6,"async"),n()()),t&2&&(c("hideSearchBox",!0)("hideSearchDropdown",!0),a(5),c("ngIf",s(6,3,d.inventoryLog$)))},dependencies:[C,I,g,D,E,x,L,A,M,b],encapsulation:2})}}return r})();export{$ as InventoryAsyncDetailComponent};
@@ -1 +1 @@
1
- import{b as ae}from"./chunk-YXFTLQ5M.js";import{c as re}from"./chunk-GHQH62TZ.js";import"./chunk-CH2MLZU7.js";import"./chunk-G6EG5QJS.js";import{a as X,b as Y,d as Z,e as ee}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-QCZIDOKW.js";import{l as Q}from"./chunk-CHZLFJFI.js";import{b as G,e as q}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{l as ne,m as oe}from"./chunk-BIQHA7UA.js";import{r as te,s as ie}from"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{h as A,m as H,y as z}from"./chunk-DPLEMBB4.js";import{b as d,c as J}from"./chunk-PXB4YEY3.js";import{J as b,f as W,g as $,j as k,n as v}from"./chunk-GPEVUTDI.js";import{Eb as V,Ec as s,Fb as S,Fc as _,Gc as B,Ic as O,Jc as P,Kb as g,Kc as D,Wb as l,Z as M,Zc as C,_c as L,aa as F,ea as R,gc as o,hc as r,ic as j,jc as I,ka as u,kc as T,mc as w,ob as K,q as U,qb as a,rc as E,sc as h,v as y,wb as f,ya as x,za as N}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";function me(i,m){if(i&1&&(o(0,"span",13),j(1,"img",14),r(),o(2,"span"),s(3),r()),i&2){let t=m.item;a(),l("src",t.Img,K)("alt",t.Name),a(2),B(" ",t.Name," ")}}function pe(i,m){if(i&1){let t=w();I(0),o(1,"a",15),E("click",function(){let n=x(t).ngIf,c=h();return N(c.submitLogistics(n))}),s(2,"Submit"),r(),T()}}function de(i,m){if(i&1){let t=w();I(0),o(1,"ng-select",16),D("ngModelChange",function(n){x(t);let c=h().$implicit;return P(c.ProductSKU,n)||(c.ProductSKU=n),N(n)}),r(),T()}if(i&2){let t=m.ngIf,e=h().$implicit;a(),O("ngModel",e.ProductSKU),l("items",t)}}function ge(i,m){if(i&1&&(o(0,"tr")(1,"td"),s(2),r(),o(3,"td"),s(4),r(),o(5,"td"),s(6),r(),o(7,"td"),g(8,de,2,2,"ng-container",4),C(9,"async"),r()()),i&2){let t=m.$implicit,e=h();a(2),_(t.Name),a(2),_(t.Service),a(2),_(t.TypeString),a(2),l("ngIf",L(9,4,e.logisticOptions$))}}var le=(()=>{class i{constructor(t,e,n){this.http=t,this.toastr=e,this.authService=n,this.filter={ChannelID:""},this.channelOptions=this.authService.getChannels(),this.initUnsupportedChannel(),this.initLoader()}initUnsupportedChannel(){let t=[d.WooCommerce,d.Lazada,d.Shopify,d.Plugo,d.Tokopedia];this.channelOptions=this.channelOptions.map(e=>(t.forEach(n=>{e.TypeID===n&&(e.disabled=!0)}),e))}initLoader(){this.http.post("/api/Logistic/Load",{}).subscribe(t=>{this.filter=t.Filter,this.channelName=this.channelOptions[0].Name,this.initLogisticServiceOptions(),this.getLogisticService()})}initLogisticServiceOptions(){this.logisticOptions$=this.http.get("/api/Logistic/OptionLogisticsService").pipe(M(1))}submitLogistics(t){this.clonedLogisticServices$.pipe(y(e=>t.map(n=>(e.findIndex(p=>p.Name===n.Name&&p.ProductSKU==n.ProductSKU)==-1&&(n.IsChange=!0),n))),F(e=>this.http.post("/api/Logistic/Submit",e))).subscribe(()=>{this.toastr.success("Logistic service updated successfully.","Success"),this.getLogisticService()})}getLogisticService(){this.iniTitle(),this.logisticServices$=this.http.post("/api/Logistic/Get",this.filter).pipe(y(t=>t.map(e=>(e.ProductSKU=J.IsEmpty(e.ProductSKU)?null:e.ProductSKU,e))),R(t=>{let e=JSON.parse(JSON.stringify(t));this.clonedLogisticServices$=U(e)}),M(1))}iniTitle(){let t=this.channelOptions.find(e=>e.ID==this.filter.ChannelID);this.channelName=t?t.Name:null}static{this.\u0275fac=function(e){return new(e||i)(f(q),f(G),f(Q))}}static{this.\u0275cmp=V({type:i,selectors:[["app-logistic"]],standalone:!1,decls:29,vars:11,consts:[["hideSearchBox","true","searchBoxPlaceHolder","Enter Number...",3,"onSubmit","headerTitle","hideSearchDropdown"],[1,"mb-2","fw-bold"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[1,"me-2"],[2,"width","18px",3,"src","alt"],["role","button","data-toggle","tooltip","data-placement","top","matTooltip","enter Logistic for recorded",1,"btn","btn-success","btn-fill","btn-lg","text-white",3,"click"],["placeholder","Logistic Service Code","bindLabel","Name","bindValue","Code",1,"w-75",3,"ngModelChange","ngModel","items"]],template:function(e,n){e&1&&(o(0,"mainpanel",0),E("onSubmit",function(){return n.getLogisticService()}),o(1,"filters")(2,"div")(3,"label",1),s(4,"Select a Channel"),r(),o(5,"ng-select",2),D("ngModelChange",function(p){return P(n.filter.ChannelID,p)||(n.filter.ChannelID=p),p}),g(6,me,4,3,"ng-template",3),r()()(),o(7,"actions"),g(8,pe,3,0,"ng-container",4),C(9,"async"),r(),o(10,"content")(11,"div",5)(12,"div",6)(13,"div",7)(14,"div",8)(15,"table",9)(16,"thead",10)(17,"tr",11)(18,"th"),s(19,"Logistic"),r(),o(20,"th"),s(21,"Service"),r(),o(22,"th"),s(23,"Type"),r(),o(24,"th"),s(25,"Logistic Service"),r()()(),o(26,"tbody"),g(27,ge,10,6,"tr",12),C(28,"async"),r()()()()()()()()),e&2&&(l("headerTitle","Logistic Courier - "+n.channelName)("hideSearchDropdown",!1),a(5),l("clearable",!1)("items",n.channelOptions),O("ngModel",n.filter.ChannelID),a(3),l("ngIf",L(9,7,n.logisticServices$)),a(19),l("ngForOf",L(28,9,n.logisticServices$)))},dependencies:[W,$,A,H,ne,Z,X,Y,te,k],encapsulation:2})}}return i})();var he=[{path:"",component:le}],ce=(()=>{class i{static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275mod=S({type:i})}static{this.\u0275inj=u({imports:[v,b.forChild(he)]})}}return i})();var $e=(()=>{class i{static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275mod=S({type:i})}static{this.\u0275inj=u({imports:[v,b,ce,z,oe,ee,ae,re,ie]})}}return i})();export{$e as LogisticModule};
1
+ import{b as ae}from"./chunk-YXFTLQ5M.js";import{c as re}from"./chunk-GHQH62TZ.js";import"./chunk-CH2MLZU7.js";import"./chunk-G6EG5QJS.js";import{a as X,b as Y,d as Z,e as ee}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-QCZIDOKW.js";import{l as Q}from"./chunk-LEMNVA5V.js";import{b as G,e as q}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{m as ne,n as oe}from"./chunk-ITTRZMEX.js";import{r as te,s as ie}from"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{h as A,m as H,y as z}from"./chunk-DPLEMBB4.js";import{b as d,c as J}from"./chunk-PXB4YEY3.js";import{J as b,f as W,g as $,j as k,n as v}from"./chunk-GPEVUTDI.js";import{Eb as V,Ec as s,Fb as S,Fc as _,Gc as B,Ic as O,Jc as P,Kb as g,Kc as D,Wb as l,Z as M,Zc as C,_c as L,aa as F,ea as R,gc as o,hc as r,ic as j,jc as I,ka as u,kc as T,mc as w,ob as K,q as U,qb as a,rc as E,sc as h,v as y,wb as f,ya as x,za as N}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";function me(i,m){if(i&1&&(o(0,"span",13),j(1,"img",14),r(),o(2,"span"),s(3),r()),i&2){let t=m.item;a(),l("src",t.Img,K)("alt",t.Name),a(2),B(" ",t.Name," ")}}function pe(i,m){if(i&1){let t=w();I(0),o(1,"a",15),E("click",function(){let n=x(t).ngIf,c=h();return N(c.submitLogistics(n))}),s(2,"Submit"),r(),T()}}function de(i,m){if(i&1){let t=w();I(0),o(1,"ng-select",16),D("ngModelChange",function(n){x(t);let c=h().$implicit;return P(c.ProductSKU,n)||(c.ProductSKU=n),N(n)}),r(),T()}if(i&2){let t=m.ngIf,e=h().$implicit;a(),O("ngModel",e.ProductSKU),l("items",t)}}function ge(i,m){if(i&1&&(o(0,"tr")(1,"td"),s(2),r(),o(3,"td"),s(4),r(),o(5,"td"),s(6),r(),o(7,"td"),g(8,de,2,2,"ng-container",4),C(9,"async"),r()()),i&2){let t=m.$implicit,e=h();a(2),_(t.Name),a(2),_(t.Service),a(2),_(t.TypeString),a(2),l("ngIf",L(9,4,e.logisticOptions$))}}var le=(()=>{class i{constructor(t,e,n){this.http=t,this.toastr=e,this.authService=n,this.filter={ChannelID:""},this.channelOptions=this.authService.getChannels(),this.initUnsupportedChannel(),this.initLoader()}initUnsupportedChannel(){let t=[d.WooCommerce,d.Lazada,d.Shopify,d.Plugo,d.Tokopedia];this.channelOptions=this.channelOptions.map(e=>(t.forEach(n=>{e.TypeID===n&&(e.disabled=!0)}),e))}initLoader(){this.http.post("/api/Logistic/Load",{}).subscribe(t=>{this.filter=t.Filter,this.channelName=this.channelOptions[0].Name,this.initLogisticServiceOptions(),this.getLogisticService()})}initLogisticServiceOptions(){this.logisticOptions$=this.http.get("/api/Logistic/OptionLogisticsService").pipe(M(1))}submitLogistics(t){this.clonedLogisticServices$.pipe(y(e=>t.map(n=>(e.findIndex(p=>p.Name===n.Name&&p.ProductSKU==n.ProductSKU)==-1&&(n.IsChange=!0),n))),F(e=>this.http.post("/api/Logistic/Submit",e))).subscribe(()=>{this.toastr.success("Logistic service updated successfully.","Success"),this.getLogisticService()})}getLogisticService(){this.iniTitle(),this.logisticServices$=this.http.post("/api/Logistic/Get",this.filter).pipe(y(t=>t.map(e=>(e.ProductSKU=J.IsEmpty(e.ProductSKU)?null:e.ProductSKU,e))),R(t=>{let e=JSON.parse(JSON.stringify(t));this.clonedLogisticServices$=U(e)}),M(1))}iniTitle(){let t=this.channelOptions.find(e=>e.ID==this.filter.ChannelID);this.channelName=t?t.Name:null}static{this.\u0275fac=function(e){return new(e||i)(f(q),f(G),f(Q))}}static{this.\u0275cmp=V({type:i,selectors:[["app-logistic"]],standalone:!1,decls:29,vars:11,consts:[["hideSearchBox","true","searchBoxPlaceHolder","Enter Number...",3,"onSubmit","headerTitle","hideSearchDropdown"],[1,"mb-2","fw-bold"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[1,"me-2"],[2,"width","18px",3,"src","alt"],["role","button","data-toggle","tooltip","data-placement","top","matTooltip","enter Logistic for recorded",1,"btn","btn-success","btn-fill","btn-lg","text-white",3,"click"],["placeholder","Logistic Service Code","bindLabel","Name","bindValue","Code",1,"w-75",3,"ngModelChange","ngModel","items"]],template:function(e,n){e&1&&(o(0,"mainpanel",0),E("onSubmit",function(){return n.getLogisticService()}),o(1,"filters")(2,"div")(3,"label",1),s(4,"Select a Channel"),r(),o(5,"ng-select",2),D("ngModelChange",function(p){return P(n.filter.ChannelID,p)||(n.filter.ChannelID=p),p}),g(6,me,4,3,"ng-template",3),r()()(),o(7,"actions"),g(8,pe,3,0,"ng-container",4),C(9,"async"),r(),o(10,"content")(11,"div",5)(12,"div",6)(13,"div",7)(14,"div",8)(15,"table",9)(16,"thead",10)(17,"tr",11)(18,"th"),s(19,"Logistic"),r(),o(20,"th"),s(21,"Service"),r(),o(22,"th"),s(23,"Type"),r(),o(24,"th"),s(25,"Logistic Service"),r()()(),o(26,"tbody"),g(27,ge,10,6,"tr",12),C(28,"async"),r()()()()()()()()),e&2&&(l("headerTitle","Logistic Courier - "+n.channelName)("hideSearchDropdown",!1),a(5),l("clearable",!1)("items",n.channelOptions),O("ngModel",n.filter.ChannelID),a(3),l("ngIf",L(9,7,n.logisticServices$)),a(19),l("ngForOf",L(28,9,n.logisticServices$)))},dependencies:[W,$,A,H,ne,Z,X,Y,te,k],encapsulation:2})}}return i})();var he=[{path:"",component:le}],ce=(()=>{class i{static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275mod=S({type:i})}static{this.\u0275inj=u({imports:[v,b.forChild(he)]})}}return i})();var $e=(()=>{class i{static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275mod=S({type:i})}static{this.\u0275inj=u({imports:[v,b,ce,z,oe,ee,ae,re,ie]})}}return i})();export{$e as LogisticModule};
@@ -1 +1 @@
1
- import{a as X}from"./chunk-CMCNEAGC.js";import{a as Q}from"./chunk-YR2WEZDG.js";import{c as Y,d as D}from"./chunk-4XMCJ7I5.js";import{b as K}from"./chunk-IEYFOHME.js";import"./chunk-YXFTLQ5M.js";import"./chunk-OLSC6KHB.js";import{a as J}from"./chunk-EGTYAIU5.js";import"./chunk-7TWBIV3T.js";import"./chunk-J7AGLBPL.js";import"./chunk-6ALHX2I4.js";import"./chunk-3RK6DDJD.js";import"./chunk-CH2MLZU7.js";import"./chunk-ZZVNB72Q.js";import"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{l as $}from"./chunk-CHZLFJFI.js";import{b as G,e as W}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{d as H,l as q,m as z}from"./chunk-BIQHA7UA.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{c as B,h as O,m as U,o as j,y as k}from"./chunk-DPLEMBB4.js";import"./chunk-PXB4YEY3.js";import{g as R,j as L,m as x,n as A}from"./chunk-GPEVUTDI.js";import{Eb as N,Ec as g,G as V,Ic as S,Jc as v,Kb as f,Kc as y,Oc as E,Wb as u,Z as T,Zc as _,_c as C,ea as F,gc as a,hc as p,ic as I,mc as b,pa as M,qb as d,rc as P,sc as o,wb as h,ya as s,za as l}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";function Z(r,w){if(r&1){let e=b();a(0,"button",15),P("click",function(){s(e);let t=o().ngIf,n=o(2);return l(n.onUpdateItems(t))}),I(1,"i",16),g(2," Update "),p()}}function ee(r,w){if(r&1&&(a(0,"div"),f(1,Z,3,0,"button",14),p()),r&2){let e=w.ngIf,i=o(2);d(),u("ngIf",i.productService.hasSelectionVariant(e))}}function te(r,w){if(r&1){let e=b();a(0,"mainpanel",1),P("onSubmit",function(t){s(e);let n=o();return l(n.onSearch(t))}),a(1,"actions")(2,"div",2),f(3,ee,2,1,"div",3),_(4,"async"),a(5,"button",4),P("click",function(){s(e);let t=o();return l(t.openExportDialog())}),I(6,"i",5),a(7,"span"),g(8,"Export"),p()()()(),a(9,"filters")(10,"div")(11,"label",6),g(12,"Page Number"),p(),a(13,"input",7),y("ngModelChange",function(t){s(e);let n=o();return v(n.searchFilter.PageNumber,t)||(n.searchFilter.PageNumber=t),l(t)}),p()(),a(14,"div",8)(15,"label",6),g(16,"Page Size"),p(),a(17,"input",7),y("ngModelChange",function(t){s(e);let n=o();return v(n.searchFilter.RowCount,t)||(n.searchFilter.RowCount=t),l(t)}),p()()(),a(18,"content")(19,"div",9)(20,"div",10)(21,"div",11)(22,"app-table",12),_(23,"async"),P("onToggle",function(t){s(e);let n=o();return l(n.onShowDifferencePrice(t))})("onSubmit",function(t){s(e);let n=o();return l(n.updatePriceByVariant(t))}),p(),a(24,"infinite-paginator",13),_(25,"async"),P("onNextPage",function(){s(e);let t=o();return l(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){s(e);let t=o();return l(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){s(e);let t=o();return l(t.infinitePagination.getRowCount(t.searchFilter))}),p()()()()()()}if(r&2){let e=o();u("textButton","Search"),d(3),u("ngIf",C(4,14,e.data$)),d(10),S("ngModel",e.searchFilter.PageNumber),d(4),S("ngModel",e.searchFilter.RowCount),d(5),u("showProductToggle",!0)("data",C(23,16,e.data$))("channel",e.channelOptions)("hiddenIPOSInventory",!1),d(2),u("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",C(25,18,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}var be=(()=>{class r{constructor(e,i,t,n,m,c){this.http=e,this.toastr=i,this.dialog=t,this.productService=n,this.authService=m,this.decimalPipe=c,this.infinitePagination=M(D),this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.data$=this.infinitePagination.data$.pipe(T()),this.pageData={Title:"Price",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!0},{Title:"Price Realtime",Url:"/menu/price/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.getDataAPI,this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe(F(e=>{e.Filter={PageNumber:e.Filter.PageNumber,RowCount:e.Filter.RowCount,filterModel:1},this.searchFilter=e.Filter,this.infinitePagination.reloadPagination(this.searchFilter)}))}onShowDifferencePrice(e){this.searchFilter.filterModel=1,e&&(this.searchFilter.filterModel=3),this.infinitePagination.reloadPagination(this.searchFilter)}onSearch(e){this.searchFilter.text=e,this.infinitePagination.reloadPagination(this.searchFilter)}updatePrice(e){let i=this.productService.selectedVariantProduct(e);if(i.length>0){let n=i.map(c=>({ID:c.ID,Code:c.Code,Price:c.UnitPrice}));var t=this.channelOptions.filter(c=>c.selected).map(c=>c.ID);let m={ListChannelID:t,ListPrice:n};this.http.post("/api/Price/UpdateChannel",m).subscribe(c=>{this.infinitePagination.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+m.ListPrice.length+" items in "+m.ListChannelID.length+" channels","Success")})}}updatePriceByVariant(e){let i={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:e.Price-0,VariantID:e.ID};this.http.post("/api/Price/UpdatePriceByID",i).subscribe(t=>{let n=this.productService.findChannelById(i.ID,this.channelOptions),m=i.Price?this.decimalPipe.transform(i.Price):i.Price;this.toastr.success("Successfully updated "+e.ItemName+"("+e.VarName+") price in "+n.Name+" to "+m,"Success"),this.infinitePagination.reloadPagination(this.searchFilter)})}onUpdateItems(e){let i=this.productService.selectedVariantProduct(e);this.dialog.open(Q,{data:{title:"Updating Price",selectedItems:i,channels:this.channelOptions},width:"400px"}).afterClosed().pipe(V(t=>t!==void 0)).subscribe(t=>{this.channelOptions=t,this.updatePrice(e)})}openExportDialog(){this.dialog.open(K,{data:{title:"Export Multi Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportMultipleChannelComparison"}}).afterClosed().subscribe()}static{this.\u0275fac=function(i){return new(i||r)(h(W),h(G),h(H),h(J),h($),h(x))}}static{this.\u0275cmp=N({type:r,selectors:[["app-price-pos-channel"]],features:[E([D,x])],decls:2,vars:3,consts:[["headerTitle","Price Comparison",3,"textButton","onSubmit",4,"ngIf"],["headerTitle","Price Comparison",3,"onSubmit","textButton"],[1,"d-flex"],[4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"mt-5"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"onToggle","onSubmit","showProductToggle","data","channel","hiddenIPOSInventory"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"]],template:function(i,t){i&1&&(f(0,te,26,20,"mainpanel",0),_(1,"async")),i&2&&u("ngIf",C(1,1,t.loader$))},dependencies:[A,R,L,k,B,j,O,U,Y,z,q,X],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]})}}return r})();export{be as PricePosChannelComponent};
1
+ import{a as X}from"./chunk-KC2DJUBC.js";import{a as Q}from"./chunk-OAS72QB2.js";import{c as Y,d as D}from"./chunk-K3FQGMAY.js";import{b as K}from"./chunk-ICSMRW7O.js";import"./chunk-YXFTLQ5M.js";import"./chunk-OLSC6KHB.js";import{a as J}from"./chunk-EGTYAIU5.js";import"./chunk-7TWBIV3T.js";import"./chunk-J7AGLBPL.js";import"./chunk-6ALHX2I4.js";import"./chunk-3RK6DDJD.js";import"./chunk-CH2MLZU7.js";import"./chunk-ZZVNB72Q.js";import"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{l as $}from"./chunk-LEMNVA5V.js";import{b as G,e as W}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{d as H,m as q,n as z}from"./chunk-ITTRZMEX.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{c as B,h as O,m as U,o as j,y as k}from"./chunk-DPLEMBB4.js";import"./chunk-PXB4YEY3.js";import{g as R,j as L,m as x,n as A}from"./chunk-GPEVUTDI.js";import{Eb as N,Ec as g,G as V,Ic as S,Jc as v,Kb as f,Kc as y,Oc as E,Wb as u,Z as T,Zc as _,_c as C,ea as F,gc as a,hc as p,ic as I,mc as b,pa as M,qb as d,rc as P,sc as o,wb as h,ya as s,za as l}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";function Z(r,w){if(r&1){let e=b();a(0,"button",15),P("click",function(){s(e);let t=o().ngIf,n=o(2);return l(n.onUpdateItems(t))}),I(1,"i",16),g(2," Update "),p()}}function ee(r,w){if(r&1&&(a(0,"div"),f(1,Z,3,0,"button",14),p()),r&2){let e=w.ngIf,i=o(2);d(),u("ngIf",i.productService.hasSelectionVariant(e))}}function te(r,w){if(r&1){let e=b();a(0,"mainpanel",1),P("onSubmit",function(t){s(e);let n=o();return l(n.onSearch(t))}),a(1,"actions")(2,"div",2),f(3,ee,2,1,"div",3),_(4,"async"),a(5,"button",4),P("click",function(){s(e);let t=o();return l(t.openExportDialog())}),I(6,"i",5),a(7,"span"),g(8,"Export"),p()()()(),a(9,"filters")(10,"div")(11,"label",6),g(12,"Page Number"),p(),a(13,"input",7),y("ngModelChange",function(t){s(e);let n=o();return v(n.searchFilter.PageNumber,t)||(n.searchFilter.PageNumber=t),l(t)}),p()(),a(14,"div",8)(15,"label",6),g(16,"Page Size"),p(),a(17,"input",7),y("ngModelChange",function(t){s(e);let n=o();return v(n.searchFilter.RowCount,t)||(n.searchFilter.RowCount=t),l(t)}),p()()(),a(18,"content")(19,"div",9)(20,"div",10)(21,"div",11)(22,"app-table",12),_(23,"async"),P("onToggle",function(t){s(e);let n=o();return l(n.onShowDifferencePrice(t))})("onSubmit",function(t){s(e);let n=o();return l(n.updatePriceByVariant(t))}),p(),a(24,"infinite-paginator",13),_(25,"async"),P("onNextPage",function(){s(e);let t=o();return l(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){s(e);let t=o();return l(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){s(e);let t=o();return l(t.infinitePagination.getRowCount(t.searchFilter))}),p()()()()()()}if(r&2){let e=o();u("textButton","Search"),d(3),u("ngIf",C(4,14,e.data$)),d(10),S("ngModel",e.searchFilter.PageNumber),d(4),S("ngModel",e.searchFilter.RowCount),d(5),u("showProductToggle",!0)("data",C(23,16,e.data$))("channel",e.channelOptions)("hiddenIPOSInventory",!1),d(2),u("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",C(25,18,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}var be=(()=>{class r{constructor(e,i,t,n,m,c){this.http=e,this.toastr=i,this.dialog=t,this.productService=n,this.authService=m,this.decimalPipe=c,this.infinitePagination=M(D),this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.data$=this.infinitePagination.data$.pipe(T()),this.pageData={Title:"Price",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!0},{Title:"Price Realtime",Url:"/menu/price/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.getDataAPI,this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe(F(e=>{e.Filter={PageNumber:e.Filter.PageNumber,RowCount:e.Filter.RowCount,filterModel:1},this.searchFilter=e.Filter,this.infinitePagination.reloadPagination(this.searchFilter)}))}onShowDifferencePrice(e){this.searchFilter.filterModel=1,e&&(this.searchFilter.filterModel=3),this.infinitePagination.reloadPagination(this.searchFilter)}onSearch(e){this.searchFilter.text=e,this.infinitePagination.reloadPagination(this.searchFilter)}updatePrice(e){let i=this.productService.selectedVariantProduct(e);if(i.length>0){let n=i.map(c=>({ID:c.ID,Code:c.Code,Price:c.UnitPrice}));var t=this.channelOptions.filter(c=>c.selected).map(c=>c.ID);let m={ListChannelID:t,ListPrice:n};this.http.post("/api/Price/UpdateChannel",m).subscribe(c=>{this.infinitePagination.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+m.ListPrice.length+" items in "+m.ListChannelID.length+" channels","Success")})}}updatePriceByVariant(e){let i={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:e.Price-0,VariantID:e.ID};this.http.post("/api/Price/UpdatePriceByID",i).subscribe(t=>{let n=this.productService.findChannelById(i.ID,this.channelOptions),m=i.Price?this.decimalPipe.transform(i.Price):i.Price;this.toastr.success("Successfully updated "+e.ItemName+"("+e.VarName+") price in "+n.Name+" to "+m,"Success"),this.infinitePagination.reloadPagination(this.searchFilter)})}onUpdateItems(e){let i=this.productService.selectedVariantProduct(e);this.dialog.open(Q,{data:{title:"Updating Price",selectedItems:i,channels:this.channelOptions},width:"400px"}).afterClosed().pipe(V(t=>t!==void 0)).subscribe(t=>{this.channelOptions=t,this.updatePrice(e)})}openExportDialog(){this.dialog.open(K,{data:{title:"Export Multi Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportMultipleChannelComparison"}}).afterClosed().subscribe()}static{this.\u0275fac=function(i){return new(i||r)(h(W),h(G),h(H),h(J),h($),h(x))}}static{this.\u0275cmp=N({type:r,selectors:[["app-price-pos-channel"]],features:[E([D,x])],decls:2,vars:3,consts:[["headerTitle","Price Comparison",3,"textButton","onSubmit",4,"ngIf"],["headerTitle","Price Comparison",3,"onSubmit","textButton"],[1,"d-flex"],[4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"mt-5"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"onToggle","onSubmit","showProductToggle","data","channel","hiddenIPOSInventory"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"]],template:function(i,t){i&1&&(f(0,te,26,20,"mainpanel",0),_(1,"async")),i&2&&u("ngIf",C(1,1,t.loader$))},dependencies:[A,R,L,k,B,j,O,U,Y,z,q,X],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]})}}return r})();export{be as PricePosChannelComponent};