marketplacepos 5.48.1 → 5.48.2

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 (50) hide show
  1. package/Marketplace/{chunk-ZRTEGBXK.js → chunk-2IASUYTM.js} +1 -1
  2. package/Marketplace/{chunk-D3VVBQYY.js → chunk-3JYZF65T.js} +1 -1
  3. package/Marketplace/{chunk-SJT5OMJM.js → chunk-3K2EKA5O.js} +1 -1
  4. package/Marketplace/{chunk-KB3CRZC5.js → chunk-5CHTDUME.js} +1 -1
  5. package/Marketplace/{chunk-BYTWGXP7.js → chunk-5KYN6Y7M.js} +1 -1
  6. package/Marketplace/{chunk-MRT6ZM2A.js → chunk-5X2L45XK.js} +1 -1
  7. package/Marketplace/{chunk-AAUBUT4Y.js → chunk-6OIMOM7S.js} +1 -1
  8. package/Marketplace/{chunk-IX6JJ6BJ.js → chunk-7DT7FQ2T.js} +1 -1
  9. package/Marketplace/{chunk-IWFUFVCC.js → chunk-7SB4C4PT.js} +1 -1
  10. package/Marketplace/{chunk-3LTTPECO.js → chunk-ADKAX3OO.js} +1 -1
  11. package/Marketplace/{chunk-6Z2CE7TK.js → chunk-AEVLZ7NS.js} +1 -1
  12. package/Marketplace/{chunk-HUECAZ5I.js → chunk-ALPG22RQ.js} +1 -1
  13. package/Marketplace/{chunk-PUUZQ4N5.js → chunk-B6F5PDL5.js} +1 -1
  14. package/Marketplace/{chunk-IYDRCUIT.js → chunk-C6JHPCLF.js} +1 -1
  15. package/Marketplace/{chunk-CG7UNGPF.js → chunk-CAZ7U2IL.js} +1 -1
  16. package/Marketplace/{chunk-SGTGXMFX.js → chunk-CBU473N2.js} +1 -1
  17. package/Marketplace/{chunk-QSBCJIQ3.js → chunk-CLQGGKN6.js} +1 -1
  18. package/Marketplace/{chunk-JKRH5WGR.js → chunk-DH5CXAEM.js} +1 -1
  19. package/Marketplace/{chunk-RASTACH2.js → chunk-FCFCTT5A.js} +1 -1
  20. package/Marketplace/{chunk-I3Q5TAIL.js → chunk-FRZCC6KZ.js} +1 -1
  21. package/Marketplace/{chunk-Q7MU7DBD.js → chunk-GVI6GJHY.js} +1 -1
  22. package/Marketplace/{chunk-TOATNIRC.js → chunk-GX6JPDQ5.js} +1 -1
  23. package/Marketplace/{chunk-XLNRT52E.js → chunk-H7GV5SNI.js} +1 -1
  24. package/Marketplace/{chunk-ZEF5FMYQ.js → chunk-HKHNRMPT.js} +1 -1
  25. package/Marketplace/{chunk-Q4AWQ7IC.js → chunk-I723PUUO.js} +1 -1
  26. package/Marketplace/{chunk-7WHUYSBD.js → chunk-IDH7MCR3.js} +1 -1
  27. package/Marketplace/{chunk-3TPMCGA5.js → chunk-J6BQDYXO.js} +1 -1
  28. package/Marketplace/{chunk-TLPRODFI.js → chunk-KSVJCX2D.js} +1 -1
  29. package/Marketplace/{chunk-IODYBTLK.js → chunk-KZSTYKIP.js} +1 -1
  30. package/Marketplace/{chunk-IU36PH6K.js → chunk-LABF6W37.js} +1 -1
  31. package/Marketplace/{chunk-NSBKRFO7.js → chunk-M65Z55OS.js} +1 -1
  32. package/Marketplace/{chunk-6ZE3KI6C.js → chunk-MKADKY44.js} +1 -1
  33. package/Marketplace/{chunk-ZVTFMONF.js → chunk-PLLHTY6O.js} +1 -1
  34. package/Marketplace/{chunk-RDS3OGH2.js → chunk-PZKN5FIT.js} +1 -1
  35. package/Marketplace/{chunk-WIYPRMVW.js → chunk-QCV5XC3U.js} +2 -2
  36. package/Marketplace/{chunk-64EV3KZS.js → chunk-RCBY7EIY.js} +1 -1
  37. package/Marketplace/{chunk-RXZ43ZSY.js → chunk-SZVL42NR.js} +1 -1
  38. package/Marketplace/{chunk-SFZDUON5.js → chunk-TIIGDXIJ.js} +2 -2
  39. package/Marketplace/{chunk-BJH4EGMC.js → chunk-UBTALPOC.js} +1 -1
  40. package/Marketplace/{chunk-XF2QZL6C.js → chunk-UCEZJNIL.js} +1 -1
  41. package/Marketplace/{chunk-327AAICB.js → chunk-VYQD3A3M.js} +1 -1
  42. package/Marketplace/{chunk-5G3OIF3V.js → chunk-WRK3ZHRX.js} +1 -1
  43. package/Marketplace/{chunk-GTIJJRTW.js → chunk-X6COQADC.js} +1 -1
  44. package/Marketplace/{chunk-X5X4R6MJ.js → chunk-XDBH7EGC.js} +1 -1
  45. package/Marketplace/{chunk-UIZJMH4U.js → chunk-XK4RP5MQ.js} +1 -1
  46. package/Marketplace/{chunk-GF6B54DH.js → chunk-Y77WYZ6Y.js} +1 -1
  47. package/Marketplace/{chunk-AFCA7VVG.js → chunk-ZUL6ZHSW.js} +1 -1
  48. package/Marketplace/index.html +2 -2
  49. package/Marketplace/{main-T7D6R6TU.js → main-YJKBQ3LW.js} +1 -1
  50. package/package.json +1 -1
@@ -1 +1 @@
1
- import{a as _e}from"./chunk-TYQY4WPY.js";import"./chunk-IM5M2CAI.js";import{a as fe}from"./chunk-UIZJMH4U.js";import{a as ge}from"./chunk-GG3MDS4C.js";import{a as V}from"./chunk-ISMIPSYN.js";import{c as Se,d as O,e as R}from"./chunk-S5R6MCNP.js";import{c as ue,d as Ce}from"./chunk-T7HRAMHR.js";import"./chunk-DAUML5UD.js";import"./chunk-DXYMG6QK.js";import"./chunk-3WRXJBHF.js";import"./chunk-UH5C5HXK.js";import"./chunk-O2YF5VGD.js";import"./chunk-63I3I3MX.js";import{a as me}from"./chunk-ZRTEGBXK.js";import"./chunk-QFSA7CU4.js";import"./chunk-OPXITNRF.js";import"./chunk-5BSPSA4O.js";import"./chunk-FULVA6QB.js";import"./chunk-HPINZVE4.js";import"./chunk-D2J64VUP.js";import"./chunk-6Q6L5NUD.js";import"./chunk-C7N6EI73.js";import"./chunk-GPHNPV7O.js";import"./chunk-3RK6DDJD.js";import"./chunk-4YCSITNV.js";import"./chunk-WHHW4IZT.js";import{a as ie}from"./chunk-ZSUWHVKX.js";import"./chunk-N5AE5WMQ.js";import"./chunk-6OJQRHIZ.js";import"./chunk-AAUBUT4Y.js";import{e as se}from"./chunk-6KWG6O5L.js";import"./chunk-AFDI4TD4.js";import"./chunk-4RG5YR7N.js";import"./chunk-5MV3UFJQ.js";import"./chunk-E6AMKEQR.js";import"./chunk-IGKMJFKP.js";import"./chunk-ITGVXYDV.js";import"./chunk-HK5FXZE4.js";import"./chunk-KJE5GRQ4.js";import"./chunk-4ILDFTIG.js";import"./chunk-A6QXXKPR.js";import{i as N}from"./chunk-Q4AWQ7IC.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-L7WZ6U4T.js";import"./chunk-LOWGZOML.js";import"./chunk-5PMKN6PM.js";import{a as E}from"./chunk-AGBJEXIM.js";import{b as oe,e as re}from"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import{c as _}from"./chunk-JBEKD57G.js";import{d as ce,l as pe,m as he,n as de}from"./chunk-EDEZ3JLR.js";import{A as ne,c as Z,h as $,m as ee,o as te}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import{b as ae,c as le}from"./chunk-ZETUYNFJ.js";import"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{i as X,m as Y}from"./chunk-LNJUGHOX.js";import{$b as F,$c as J,G as k,Gb as A,Ha as y,Mb as G,Mc as v,Qc as b,Rc as I,Sc as T,Tc as K,Zc as Q,bc as M,ea as H,gc as f,hc as s,hd as P,ic as d,id as w,jc as j,ma as W,nb as C,nc as z,oc as q,qc as D,ra as c,vc as S,xa as p,xc as g,ya as h}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import{a as B,b as U}from"./chunk-66YHNWRR.js";var x=(()=>{let l=class l{constructor(){this.authService=c(N),this.channelOptions=this.authService.getChannels()}filterSelectedChannels(n,r){let e=Object.assign([],this.channelOptions),i=[],o;return n.forEach(t=>{o=e.find(u=>u.ID==t?.parent?.id),o&&(o=U(B({},o),{Name:`${t?.parent?.label} - ${t?.label}`,LocationID:t?.id}),i.push(o))}),r.forEach(t=>{o=e.find(u=>u.ID==t.id),o&&i.push(o)}),i}generateFilterLocation(n,r){let e=[],i=[],o=[];return n.length>0?(e=n.map(t=>t.id),i=n.filter(t=>_.IsNotEmpty(t?.parent?.id)).map(t=>t?.parent?.id).filter((t,u,L)=>L.indexOf(t)===u)):(e=[],i=[]),o=r.map(t=>t.id),o=o.concat(i).filter((t,u,L)=>L.indexOf(t)===u),{locationIds:e,channelIds:o}}};l.\u0275fac=function(r){return new(r||l)},l.\u0275prov=W({token:l,factory:l.\u0275fac});let a=l;return a})();var ve=a=>[a];function be(a,l){if(a&1){let m=D();s(0,"button",17),S("click",function(){p(m);let r=g(2),e=g();return h(e.onUpdateItems(r))}),j(1,"i",18),v(2," Update "),d()}}function Ie(a,l){if(a&1&&(z(0),F(1,be,3,0,"button",16),q()),a&2){let m=g(),n=g();C(),M(n.productService.hasSelectionVariant(m)?1:-1)}}function Pe(a,l){if(a&1&&(s(0,"actions")(1,"div",14),G(2,Ie,2,1,"ng-container",15),d()()),a&2){let m=g();C(2),f("ngxPermissionsOnly",J(1,ve,m.inventoryUpdateRole))}}function we(a,l){if(a&1){let m=D();s(0,"app-table",19),S("onToggle",function(r){p(m);let e=g();return h(e.onShowDifferenceStock(r))})("onSubmit",function(r){p(m);let e=g();return h(e.updateStockByVariant(r))}),d()}if(a&2){let m=g();f("data",l)("channel",m.channels())("showProductToggle",!0)("hiddenIPOSInventory",m.searchFilter.HiddenIPOSInventory)}}var pt=(()=>{let l=class l{constructor(){this.http=c(re),this.toastr=c(oe),this.dialog=c(ce),this.productService=c(me),this.authService=c(N),this.mainPanelService=c(pe),this.placeholderService=c(ue),this.paginationService=c(O),this.multiChannelService=c(x),this.updateResHandling=c(R),this.searchFilter={PageNumber:1,RowCount:100},this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.selectedLocations=y([]),this.selectedChannels=y([]),this.channels=y([]),this.inventoryUpdateRole=ie.InventoryUpdate,this.searchPlaceholder=y("Search ..."),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(H(n=>{n.Filter={PageNumber:n.Filter.PageNumber,filterModel:V.ALL,RowCount:n.Filter.PageSize,HiddenIPOSInventory:n.Filter.HiddenIPOSInventory,SearchType:n.Filter.SearchType,NumberFilterComparator:n.Filter.NumberFilterComparator},this.searchFilter=n.Filter,this.initSearchPlaceholder(),this.mainPanelService.openModalFilter()}))}initSearchPlaceholder(){this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(this.searchFilter.SearchType,this.searchFilter.NumberFilterComparator))}onChannelChange(n=[]){let r=n.filter(i=>_.isValidGUID(i.id)==!1),e=n.filter(i=>_.isValidGUID(i.id));this.selectedLocations.set(r),this.selectedChannels.set(e)}onSearch(n){let r=this.multiChannelService.filterSelectedChannels(this.selectedLocations(),this.selectedChannels());this.channels.set(r);let e=this.multiChannelService.generateFilterLocation(this.selectedLocations(),this.selectedChannels());this.searchFilter.ListChannelID=e.channelIds,this.searchFilter.ListLocationID=e.locationIds,this.searchFilter.text=n,this.initSearchPlaceholder(),this.paginationService.reloadPagination(this.searchFilter)}updateStock(n,r){if(n.length>0){let e=[];n.forEach(t=>{t.Channel?.forEach(u=>{e.push({ChannelItemID:u?.ChannelItemID,ChannelVariationID:u?.ChannelVariationID,Inventory:t.Inventory,LocationID:u?.LocationID})})});let o={ListChannelID:r.filter(t=>t.selected).map(t=>t.ID),List:e};this.http.post(E.UpdateInventoryChannel,o).subscribe(t=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+o.List.length+" variants in "+o.ListChannelID.length+" channels","Success")})}}updateStockByVariant(n){let r=n.InventoryMultiwarehouse[0]?.LocationID,e={ID:n.ChannelID,ChannelItemID:n.ChannelItemID,ChannelVariantID:n.ChannelVariationID,NewQuantity:n.Inventory,VariantID:n.ID,SKU:n?.Sku,LocationID:r};this.http.post(E.UpdateUpdateQuantityByItem,e).subscribe(i=>{this.paginationService.reloadPagination(this.searchFilter),this.handlingUpdateStock(i)})}handlingUpdateStock(n){if(n){let r=n?.Response?.Fail_list,e=n?.Response?.Success_list;this.updateResHandling.responseHandling(e,r,"Stock")}else this.toastr.error(n?.Exception,"Error")}onShowDifferenceStock(n){n?this.searchFilter.filterModel=V.DIFFERENCE:this.searchFilter.filterModel=V.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(n){let r=this.productService.selectedVariantProduct(n),e=this.channelOptions.filter(i=>this.channels()?.find(o=>o.ID===i.ID));this.dialog.open(ge,{data:{selectedItems:r,channels:JSON.parse(JSON.stringify(e))},width:"400px"}).afterClosed().pipe(k(i=>_.IsNotEmpty(i))).subscribe(i=>{this.updateStock(r,i)})}};l.\u0275fac=function(r){return new(r||l)},l.\u0275cmp=A({type:l,selectors:[["app-multi-channel-comparison"]],features:[Q([O,x,R])],decls:28,vars:25,consts:[["headerTitle","Inventory Comparison","textButton","Search",3,"onSubmit","hideSearchBox","searchBoxPlaceHolder"],[1,"mb-5"],["for","selectChannel",1,"fw-bold","mb-3"],["id","selectChannel",3,"onChannelChange","multiple"],[3,"numberFilterComparatorChange","searchTypeChange","numberFilterComparatorOptions","numberFilterComparator","searchTypeOptions","searchType"],["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"],["table","inventory",3,"data","channel","showProductToggle","hiddenIPOSInventory"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"d-flex"],[4,"ngxPermissionsOnly"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3"],["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(r,e){if(r&1){let i=D();s(0,"mainpanel",0),S("onSubmit",function(t){return p(i),h(e.onSearch(t))}),F(1,Pe,3,3,"actions"),P(2,"async"),s(3,"filters"),K(4),P(5,"async"),s(6,"div",1)(7,"label",2),v(8,"Channel"),d(),s(9,"multiwarehouse-tree-select",3),S("onChannelChange",function(t){return p(i),h(e.onChannelChange(t))}),d()(),s(10,"div",1)(11,"filter-query-type",4),T("numberFilterComparatorChange",function(t){return p(i),I(e.searchFilter.NumberFilterComparator,t)||(e.searchFilter.NumberFilterComparator=t),h(t)})("searchTypeChange",function(t){return p(i),I(e.searchFilter.SearchType,t)||(e.searchFilter.SearchType=t),h(t)}),d()(),s(12,"div",1)(13,"label",5),v(14,"PageNumber"),d(),s(15,"input",6),T("ngModelChange",function(t){return p(i),I(e.searchFilter.PageNumber,t)||(e.searchFilter.PageNumber=t),h(t)}),d()(),s(16,"div")(17,"label",7),v(18,"Page Size"),d(),s(19,"input",8),T("ngModelChange",function(t){return p(i),I(e.searchFilter.RowCount,t)||(e.searchFilter.RowCount=t),h(t)}),d()()(),s(20,"content")(21,"div",9)(22,"div",10)(23,"div",11),F(24,we,1,4,"app-table",12),P(25,"async"),s(26,"infinite-paginator",13),P(27,"async"),S("onNextPage",function(){return p(i),h(e.paginationService.onNextPage(e.searchFilter))})("onLastPage",function(){return p(i),h(e.paginationService.onLastPage(e.searchFilter))})("onGetRowCount",function(){return p(i),h(e.paginationService.getRowCount(e.searchFilter))}),d()()()()()()}if(r&2){let i,o;f("hideSearchBox",!1)("searchBoxPlaceHolder",e.searchPlaceholder()),C(),M((i=w(2,17,e.paginationService.data$))?1:-1,i);let t=w(5,19,e.loader$);C(8),f("multiple",!0),C(2),f("numberFilterComparatorOptions",t==null||t.Options==null?null:t.Options.SearchComparatorTypeOptions),b("numberFilterComparator",e.searchFilter.NumberFilterComparator),f("searchTypeOptions",t==null||t.Options==null?null:t.Options.SearchSKUOnlyOrSKUNameOptions),b("searchType",e.searchFilter.SearchType),C(4),b("ngModel",e.searchFilter.PageNumber),C(4),b("ngModel",e.searchFilter.RowCount),C(5),M((o=w(25,21,e.paginationService.data$))?24:-1,o),C(2),f("totalData",e.paginationService.totalData())("hideCount",e.paginationService.hideCount())("rowCount",w(27,23,e.paginationService.totalRowCount$))("pageNumber",e.paginationService.pageNumber())("disableNextButton",e.paginationService.disableNextButton())("goToLastPage",e.paginationService.isLastPage())}},dependencies:[Y,de,he,fe,ne,Z,te,$,ee,Se,_e,le,ae,se,Ce,X],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let a=l;return a})();export{pt as MultiChannelComparison};
1
+ import{a as _e}from"./chunk-TYQY4WPY.js";import"./chunk-IM5M2CAI.js";import{a as fe}from"./chunk-XK4RP5MQ.js";import{a as ge}from"./chunk-GG3MDS4C.js";import{a as V}from"./chunk-ISMIPSYN.js";import{c as Se,d as O,e as R}from"./chunk-S5R6MCNP.js";import{c as ue,d as Ce}from"./chunk-T7HRAMHR.js";import"./chunk-DAUML5UD.js";import"./chunk-DXYMG6QK.js";import"./chunk-3WRXJBHF.js";import"./chunk-UH5C5HXK.js";import"./chunk-O2YF5VGD.js";import"./chunk-63I3I3MX.js";import{a as me}from"./chunk-2IASUYTM.js";import"./chunk-QFSA7CU4.js";import"./chunk-OPXITNRF.js";import"./chunk-5BSPSA4O.js";import"./chunk-FULVA6QB.js";import"./chunk-HPINZVE4.js";import"./chunk-D2J64VUP.js";import"./chunk-6Q6L5NUD.js";import"./chunk-C7N6EI73.js";import"./chunk-GPHNPV7O.js";import"./chunk-3RK6DDJD.js";import"./chunk-4YCSITNV.js";import"./chunk-WHHW4IZT.js";import{a as ie}from"./chunk-ZSUWHVKX.js";import"./chunk-N5AE5WMQ.js";import"./chunk-6OJQRHIZ.js";import"./chunk-6OIMOM7S.js";import{e as se}from"./chunk-6KWG6O5L.js";import"./chunk-AFDI4TD4.js";import"./chunk-4RG5YR7N.js";import"./chunk-5MV3UFJQ.js";import"./chunk-E6AMKEQR.js";import"./chunk-IGKMJFKP.js";import"./chunk-ITGVXYDV.js";import"./chunk-HK5FXZE4.js";import"./chunk-KJE5GRQ4.js";import"./chunk-4ILDFTIG.js";import"./chunk-A6QXXKPR.js";import{i as N}from"./chunk-I723PUUO.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-L7WZ6U4T.js";import"./chunk-LOWGZOML.js";import"./chunk-5PMKN6PM.js";import{a as E}from"./chunk-AGBJEXIM.js";import{b as oe,e as re}from"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import{c as _}from"./chunk-JBEKD57G.js";import{d as ce,l as pe,m as he,n as de}from"./chunk-EDEZ3JLR.js";import{A as ne,c as Z,h as $,m as ee,o as te}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import{b as ae,c as le}from"./chunk-ZETUYNFJ.js";import"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{i as X,m as Y}from"./chunk-LNJUGHOX.js";import{$b as F,$c as J,G as k,Gb as A,Ha as y,Mb as G,Mc as v,Qc as b,Rc as I,Sc as T,Tc as K,Zc as Q,bc as M,ea as H,gc as f,hc as s,hd as P,ic as d,id as w,jc as j,ma as W,nb as C,nc as z,oc as q,qc as D,ra as c,vc as S,xa as p,xc as g,ya as h}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import{a as B,b as U}from"./chunk-66YHNWRR.js";var x=(()=>{let l=class l{constructor(){this.authService=c(N),this.channelOptions=this.authService.getChannels()}filterSelectedChannels(n,r){let e=Object.assign([],this.channelOptions),i=[],o;return n.forEach(t=>{o=e.find(u=>u.ID==t?.parent?.id),o&&(o=U(B({},o),{Name:`${t?.parent?.label} - ${t?.label}`,LocationID:t?.id}),i.push(o))}),r.forEach(t=>{o=e.find(u=>u.ID==t.id),o&&i.push(o)}),i}generateFilterLocation(n,r){let e=[],i=[],o=[];return n.length>0?(e=n.map(t=>t.id),i=n.filter(t=>_.IsNotEmpty(t?.parent?.id)).map(t=>t?.parent?.id).filter((t,u,L)=>L.indexOf(t)===u)):(e=[],i=[]),o=r.map(t=>t.id),o=o.concat(i).filter((t,u,L)=>L.indexOf(t)===u),{locationIds:e,channelIds:o}}};l.\u0275fac=function(r){return new(r||l)},l.\u0275prov=W({token:l,factory:l.\u0275fac});let a=l;return a})();var ve=a=>[a];function be(a,l){if(a&1){let m=D();s(0,"button",17),S("click",function(){p(m);let r=g(2),e=g();return h(e.onUpdateItems(r))}),j(1,"i",18),v(2," Update "),d()}}function Ie(a,l){if(a&1&&(z(0),F(1,be,3,0,"button",16),q()),a&2){let m=g(),n=g();C(),M(n.productService.hasSelectionVariant(m)?1:-1)}}function Pe(a,l){if(a&1&&(s(0,"actions")(1,"div",14),G(2,Ie,2,1,"ng-container",15),d()()),a&2){let m=g();C(2),f("ngxPermissionsOnly",J(1,ve,m.inventoryUpdateRole))}}function we(a,l){if(a&1){let m=D();s(0,"app-table",19),S("onToggle",function(r){p(m);let e=g();return h(e.onShowDifferenceStock(r))})("onSubmit",function(r){p(m);let e=g();return h(e.updateStockByVariant(r))}),d()}if(a&2){let m=g();f("data",l)("channel",m.channels())("showProductToggle",!0)("hiddenIPOSInventory",m.searchFilter.HiddenIPOSInventory)}}var pt=(()=>{let l=class l{constructor(){this.http=c(re),this.toastr=c(oe),this.dialog=c(ce),this.productService=c(me),this.authService=c(N),this.mainPanelService=c(pe),this.placeholderService=c(ue),this.paginationService=c(O),this.multiChannelService=c(x),this.updateResHandling=c(R),this.searchFilter={PageNumber:1,RowCount:100},this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.selectedLocations=y([]),this.selectedChannels=y([]),this.channels=y([]),this.inventoryUpdateRole=ie.InventoryUpdate,this.searchPlaceholder=y("Search ..."),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(H(n=>{n.Filter={PageNumber:n.Filter.PageNumber,filterModel:V.ALL,RowCount:n.Filter.PageSize,HiddenIPOSInventory:n.Filter.HiddenIPOSInventory,SearchType:n.Filter.SearchType,NumberFilterComparator:n.Filter.NumberFilterComparator},this.searchFilter=n.Filter,this.initSearchPlaceholder(),this.mainPanelService.openModalFilter()}))}initSearchPlaceholder(){this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(this.searchFilter.SearchType,this.searchFilter.NumberFilterComparator))}onChannelChange(n=[]){let r=n.filter(i=>_.isValidGUID(i.id)==!1),e=n.filter(i=>_.isValidGUID(i.id));this.selectedLocations.set(r),this.selectedChannels.set(e)}onSearch(n){let r=this.multiChannelService.filterSelectedChannels(this.selectedLocations(),this.selectedChannels());this.channels.set(r);let e=this.multiChannelService.generateFilterLocation(this.selectedLocations(),this.selectedChannels());this.searchFilter.ListChannelID=e.channelIds,this.searchFilter.ListLocationID=e.locationIds,this.searchFilter.text=n,this.initSearchPlaceholder(),this.paginationService.reloadPagination(this.searchFilter)}updateStock(n,r){if(n.length>0){let e=[];n.forEach(t=>{t.Channel?.forEach(u=>{e.push({ChannelItemID:u?.ChannelItemID,ChannelVariationID:u?.ChannelVariationID,Inventory:t.Inventory,LocationID:u?.LocationID})})});let o={ListChannelID:r.filter(t=>t.selected).map(t=>t.ID),List:e};this.http.post(E.UpdateInventoryChannel,o).subscribe(t=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+o.List.length+" variants in "+o.ListChannelID.length+" channels","Success")})}}updateStockByVariant(n){let r=n.InventoryMultiwarehouse[0]?.LocationID,e={ID:n.ChannelID,ChannelItemID:n.ChannelItemID,ChannelVariantID:n.ChannelVariationID,NewQuantity:n.Inventory,VariantID:n.ID,SKU:n?.Sku,LocationID:r};this.http.post(E.UpdateUpdateQuantityByItem,e).subscribe(i=>{this.paginationService.reloadPagination(this.searchFilter),this.handlingUpdateStock(i)})}handlingUpdateStock(n){if(n){let r=n?.Response?.Fail_list,e=n?.Response?.Success_list;this.updateResHandling.responseHandling(e,r,"Stock")}else this.toastr.error(n?.Exception,"Error")}onShowDifferenceStock(n){n?this.searchFilter.filterModel=V.DIFFERENCE:this.searchFilter.filterModel=V.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(n){let r=this.productService.selectedVariantProduct(n),e=this.channelOptions.filter(i=>this.channels()?.find(o=>o.ID===i.ID));this.dialog.open(ge,{data:{selectedItems:r,channels:JSON.parse(JSON.stringify(e))},width:"400px"}).afterClosed().pipe(k(i=>_.IsNotEmpty(i))).subscribe(i=>{this.updateStock(r,i)})}};l.\u0275fac=function(r){return new(r||l)},l.\u0275cmp=A({type:l,selectors:[["app-multi-channel-comparison"]],features:[Q([O,x,R])],decls:28,vars:25,consts:[["headerTitle","Inventory Comparison","textButton","Search",3,"onSubmit","hideSearchBox","searchBoxPlaceHolder"],[1,"mb-5"],["for","selectChannel",1,"fw-bold","mb-3"],["id","selectChannel",3,"onChannelChange","multiple"],[3,"numberFilterComparatorChange","searchTypeChange","numberFilterComparatorOptions","numberFilterComparator","searchTypeOptions","searchType"],["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"],["table","inventory",3,"data","channel","showProductToggle","hiddenIPOSInventory"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"d-flex"],[4,"ngxPermissionsOnly"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3"],["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(r,e){if(r&1){let i=D();s(0,"mainpanel",0),S("onSubmit",function(t){return p(i),h(e.onSearch(t))}),F(1,Pe,3,3,"actions"),P(2,"async"),s(3,"filters"),K(4),P(5,"async"),s(6,"div",1)(7,"label",2),v(8,"Channel"),d(),s(9,"multiwarehouse-tree-select",3),S("onChannelChange",function(t){return p(i),h(e.onChannelChange(t))}),d()(),s(10,"div",1)(11,"filter-query-type",4),T("numberFilterComparatorChange",function(t){return p(i),I(e.searchFilter.NumberFilterComparator,t)||(e.searchFilter.NumberFilterComparator=t),h(t)})("searchTypeChange",function(t){return p(i),I(e.searchFilter.SearchType,t)||(e.searchFilter.SearchType=t),h(t)}),d()(),s(12,"div",1)(13,"label",5),v(14,"PageNumber"),d(),s(15,"input",6),T("ngModelChange",function(t){return p(i),I(e.searchFilter.PageNumber,t)||(e.searchFilter.PageNumber=t),h(t)}),d()(),s(16,"div")(17,"label",7),v(18,"Page Size"),d(),s(19,"input",8),T("ngModelChange",function(t){return p(i),I(e.searchFilter.RowCount,t)||(e.searchFilter.RowCount=t),h(t)}),d()()(),s(20,"content")(21,"div",9)(22,"div",10)(23,"div",11),F(24,we,1,4,"app-table",12),P(25,"async"),s(26,"infinite-paginator",13),P(27,"async"),S("onNextPage",function(){return p(i),h(e.paginationService.onNextPage(e.searchFilter))})("onLastPage",function(){return p(i),h(e.paginationService.onLastPage(e.searchFilter))})("onGetRowCount",function(){return p(i),h(e.paginationService.getRowCount(e.searchFilter))}),d()()()()()()}if(r&2){let i,o;f("hideSearchBox",!1)("searchBoxPlaceHolder",e.searchPlaceholder()),C(),M((i=w(2,17,e.paginationService.data$))?1:-1,i);let t=w(5,19,e.loader$);C(8),f("multiple",!0),C(2),f("numberFilterComparatorOptions",t==null||t.Options==null?null:t.Options.SearchComparatorTypeOptions),b("numberFilterComparator",e.searchFilter.NumberFilterComparator),f("searchTypeOptions",t==null||t.Options==null?null:t.Options.SearchSKUOnlyOrSKUNameOptions),b("searchType",e.searchFilter.SearchType),C(4),b("ngModel",e.searchFilter.PageNumber),C(4),b("ngModel",e.searchFilter.RowCount),C(5),M((o=w(25,21,e.paginationService.data$))?24:-1,o),C(2),f("totalData",e.paginationService.totalData())("hideCount",e.paginationService.hideCount())("rowCount",w(27,23,e.paginationService.totalRowCount$))("pageNumber",e.paginationService.pageNumber())("disableNextButton",e.paginationService.disableNextButton())("goToLastPage",e.paginationService.isLastPage())}},dependencies:[Y,de,he,fe,ne,Z,te,$,ee,Se,_e,le,ae,se,Ce,X],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let a=l;return a})();export{pt as MultiChannelComparison};
@@ -1 +1 @@
1
- import{a as U}from"./chunk-BYTWGXP7.js";import"./chunk-3JRUKSV3.js";import"./chunk-SJ5MC42H.js";import"./chunk-4RLWHMI6.js";import"./chunk-NWB7EVME.js";import"./chunk-AFDI4TD4.js";import"./chunk-4RG5YR7N.js";import"./chunk-5MV3UFJQ.js";import"./chunk-E6AMKEQR.js";import"./chunk-IGKMJFKP.js";import"./chunk-ITGVXYDV.js";import"./chunk-HK5FXZE4.js";import"./chunk-KJE5GRQ4.js";import"./chunk-4ILDFTIG.js";import"./chunk-A6QXXKPR.js";import"./chunk-Q4AWQ7IC.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-M4ZE35XK.js";import"./chunk-L7WZ6U4T.js";import"./chunk-LOWGZOML.js";import"./chunk-5PMKN6PM.js";import{a as H}from"./chunk-AGBJEXIM.js";import{e as F}from"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import"./chunk-JBEKD57G.js";import{m as J,n as G}from"./chunk-EDEZ3JLR.js";import{A as j,c as W,h as I,m as R}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import"./chunk-ZETUYNFJ.js";import"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{i as P,k,m as B}from"./chunk-LNJUGHOX.js";import{$b as M,Gb as x,Ha as h,Mc as i,Nc as V,Qc as f,Rc as C,Sc as b,Tc as O,Uc as D,Vc as _,Z as S,bc as N,gc as g,hc as e,hd as v,ic as t,id as y,jc as L,nb as d,qc as T,ra as E,vc as w,xa as p,xc as A,ya as m}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";function q(r,l){if(r&1&&(e(0,"pre",21),i(1),v(2,"json"),t()),r&2){A();let Y=_(25);d(),V(y(2,1,Y))}}function z(r,l){r&1&&(e(0,"p",22),i(1," Your data will be shown here once it's available "),t())}var ce=(()=>{let l=class l{constructor(){this.httpService=E(F),this.selectedChannel=h(null),this.orderNumber=h(null)}initEscrowLog(){this.escrowLog$=this.httpService.post(H.GetEscrowDetail,{ChannelID:this.selectedChannel(),OrderNumber:this.orderNumber()}).pipe(S(1))}copyToClipboard(c){if(!c)return;let s=typeof c=="string"?c:JSON.stringify(c,null,2);navigator.clipboard.writeText(s),alert("Copied to clipboard!")}};l.\u0275fac=function(s){return new(s||l)},l.\u0275cmp=x({type:l,selectors:[["app-escrow-api"]],decls:40,vars:9,consts:[["headerTitle","Origin Escrow Api",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-success","btn-fill","me-3",3,"click"],[1,"fa","fa-search"],[1,"container-fluid","mt-8","px-10"],[1,"row"],[1,"col-7"],[1,"d-flex","align-items-center"],[1,"w-75"],[1,"mb-0","text-muted","fst-italic"],[1,"w-100"],[3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center","mt-3"],["type","text","placeholder","Order Number or Invoice Number",1,"form-control","rounded-1",2,"height","40px",3,"ngModelChange","ngModel"],[1,"row","mt-6"],[1,"col-12"],[1,"card"],[1,"card-header","d-flex","justify-content-between","align-items-center"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group","position-relative"],["id","escrowLogText"],[1,"text-center","my-12","text-muted"]],template:function(s,n){if(s&1){let a=T();e(0,"mainpanel",0)(1,"actions")(2,"button",1),w("click",function(){return p(a),m(n.initEscrowLog())}),L(3,"i",2),i(4," Search "),t()(),e(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h6"),i(12,"Channel"),t(),e(13,"p",8),i(14," View logs related to Escrow API "),t()(),e(15,"div",9)(16,"app-channel-options-v2",10),b("ngModelChange",function(o){return p(a),C(n.selectedChannel,o)||(n.selectedChannel=o),m(o)}),t()()(),e(17,"div",11)(18,"div",7)(19,"h6"),i(20,"Order Number"),t(),e(21,"p",8),i(22," Order or Invoice number from Channel. "),t()(),e(23,"div",9)(24,"input",12),b("ngModelChange",function(o){return p(a),C(n.orderNumber,o)||(n.orderNumber=o),m(o)}),t()()()()(),O(25),v(26,"async"),e(27,"div",13)(28,"div",14)(29,"div",15)(30,"div",16)(31,"h5"),i(32,"Response"),t(),e(33,"button",17),w("click",function(){p(a);let o=_(25);return m(n.copyToClipboard(o))}),i(34," Copy "),t()(),e(35,"div",18)(36,"div",19)(37,"div",20),M(38,q,3,3,"pre",21)(39,z,2,0,"p",22),t()()()()()()()()()}if(s&2){g("hideSearchBox",!0)("hideSearchDropdown",!0),d(16),f("ngModel",n.selectedChannel),d(8),f("ngModel",n.orderNumber),d();let a=D(y(26,6,n.escrowLog$));d(8),g("disabled",!a),d(5),N(a?38:39)}},dependencies:[B,j,W,I,R,G,J,U,P,k],styles:[".container-fluid[_ngcontent-%COMP%]{padding-bottom:1rem}#escrowLogText[_ngcontent-%COMP%]{white-space:pre-wrap;word-break:break-word}"]});let r=l;return r})();export{ce as EscrowApiComponent};
1
+ import{a as U}from"./chunk-5KYN6Y7M.js";import"./chunk-3JRUKSV3.js";import"./chunk-SJ5MC42H.js";import"./chunk-4RLWHMI6.js";import"./chunk-NWB7EVME.js";import"./chunk-AFDI4TD4.js";import"./chunk-4RG5YR7N.js";import"./chunk-5MV3UFJQ.js";import"./chunk-E6AMKEQR.js";import"./chunk-IGKMJFKP.js";import"./chunk-ITGVXYDV.js";import"./chunk-HK5FXZE4.js";import"./chunk-KJE5GRQ4.js";import"./chunk-4ILDFTIG.js";import"./chunk-A6QXXKPR.js";import"./chunk-I723PUUO.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-M4ZE35XK.js";import"./chunk-L7WZ6U4T.js";import"./chunk-LOWGZOML.js";import"./chunk-5PMKN6PM.js";import{a as H}from"./chunk-AGBJEXIM.js";import{e as F}from"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import"./chunk-JBEKD57G.js";import{m as J,n as G}from"./chunk-EDEZ3JLR.js";import{A as j,c as W,h as I,m as R}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import"./chunk-ZETUYNFJ.js";import"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{i as P,k,m as B}from"./chunk-LNJUGHOX.js";import{$b as M,Gb as x,Ha as h,Mc as i,Nc as V,Qc as f,Rc as C,Sc as b,Tc as O,Uc as D,Vc as _,Z as S,bc as N,gc as g,hc as e,hd as v,ic as t,id as y,jc as L,nb as d,qc as T,ra as E,vc as w,xa as p,xc as A,ya as m}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";function q(r,l){if(r&1&&(e(0,"pre",21),i(1),v(2,"json"),t()),r&2){A();let Y=_(25);d(),V(y(2,1,Y))}}function z(r,l){r&1&&(e(0,"p",22),i(1," Your data will be shown here once it's available "),t())}var ce=(()=>{let l=class l{constructor(){this.httpService=E(F),this.selectedChannel=h(null),this.orderNumber=h(null)}initEscrowLog(){this.escrowLog$=this.httpService.post(H.GetEscrowDetail,{ChannelID:this.selectedChannel(),OrderNumber:this.orderNumber()}).pipe(S(1))}copyToClipboard(c){if(!c)return;let s=typeof c=="string"?c:JSON.stringify(c,null,2);navigator.clipboard.writeText(s),alert("Copied to clipboard!")}};l.\u0275fac=function(s){return new(s||l)},l.\u0275cmp=x({type:l,selectors:[["app-escrow-api"]],decls:40,vars:9,consts:[["headerTitle","Origin Escrow Api",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-success","btn-fill","me-3",3,"click"],[1,"fa","fa-search"],[1,"container-fluid","mt-8","px-10"],[1,"row"],[1,"col-7"],[1,"d-flex","align-items-center"],[1,"w-75"],[1,"mb-0","text-muted","fst-italic"],[1,"w-100"],[3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center","mt-3"],["type","text","placeholder","Order Number or Invoice Number",1,"form-control","rounded-1",2,"height","40px",3,"ngModelChange","ngModel"],[1,"row","mt-6"],[1,"col-12"],[1,"card"],[1,"card-header","d-flex","justify-content-between","align-items-center"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group","position-relative"],["id","escrowLogText"],[1,"text-center","my-12","text-muted"]],template:function(s,n){if(s&1){let a=T();e(0,"mainpanel",0)(1,"actions")(2,"button",1),w("click",function(){return p(a),m(n.initEscrowLog())}),L(3,"i",2),i(4," Search "),t()(),e(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h6"),i(12,"Channel"),t(),e(13,"p",8),i(14," View logs related to Escrow API "),t()(),e(15,"div",9)(16,"app-channel-options-v2",10),b("ngModelChange",function(o){return p(a),C(n.selectedChannel,o)||(n.selectedChannel=o),m(o)}),t()()(),e(17,"div",11)(18,"div",7)(19,"h6"),i(20,"Order Number"),t(),e(21,"p",8),i(22," Order or Invoice number from Channel. "),t()(),e(23,"div",9)(24,"input",12),b("ngModelChange",function(o){return p(a),C(n.orderNumber,o)||(n.orderNumber=o),m(o)}),t()()()()(),O(25),v(26,"async"),e(27,"div",13)(28,"div",14)(29,"div",15)(30,"div",16)(31,"h5"),i(32,"Response"),t(),e(33,"button",17),w("click",function(){p(a);let o=_(25);return m(n.copyToClipboard(o))}),i(34," Copy "),t()(),e(35,"div",18)(36,"div",19)(37,"div",20),M(38,q,3,3,"pre",21)(39,z,2,0,"p",22),t()()()()()()()()()}if(s&2){g("hideSearchBox",!0)("hideSearchDropdown",!0),d(16),f("ngModel",n.selectedChannel),d(8),f("ngModel",n.orderNumber),d();let a=D(y(26,6,n.escrowLog$));d(8),g("disabled",!a),d(5),N(a?38:39)}},dependencies:[B,j,W,I,R,G,J,U,P,k],styles:[".container-fluid[_ngcontent-%COMP%]{padding-bottom:1rem}#escrowLogText[_ngcontent-%COMP%]{white-space:pre-wrap;word-break:break-word}"]});let r=l;return r})();export{ce as EscrowApiComponent};
@@ -1,2 +1,2 @@
1
- import"./chunk-E6ZWL77N.js";import"./chunk-O4EO3YBL.js";import{a as je}from"./chunk-3LTTPECO.js";import"./chunk-4VNQYYVV.js";import{b as qe}from"./chunk-ZKIO2ZQ6.js";import{a as g}from"./chunk-XF2QZL6C.js";import"./chunk-ZTHO6JJM.js";import"./chunk-SHUYFOQI.js";import"./chunk-GG3MDS4C.js";import{b as Qe}from"./chunk-O2YF5VGD.js";import{b as Je}from"./chunk-QFSA7CU4.js";import"./chunk-OPXITNRF.js";import{c as We}from"./chunk-5BSPSA4O.js";import"./chunk-FULVA6QB.js";import"./chunk-HPINZVE4.js";import"./chunk-D2J64VUP.js";import"./chunk-6Q6L5NUD.js";import"./chunk-C7N6EI73.js";import"./chunk-GPHNPV7O.js";import"./chunk-3RK6DDJD.js";import{a as Ge}from"./chunk-4YCSITNV.js";import"./chunk-WHHW4IZT.js";import{a as l}from"./chunk-ZSUWHVKX.js";import"./chunk-N5AE5WMQ.js";import{b as ze}from"./chunk-AAUBUT4Y.js";import{a as De,d as Pe,e as A}from"./chunk-6KWG6O5L.js";import{a as Ee}from"./chunk-A6QXXKPR.js";import{b as Se,i as Oe}from"./chunk-Q4AWQ7IC.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-AGBJEXIM.js";import"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import"./chunk-JBEKD57G.js";import{a as ke,h as $e,k as q,n as He}from"./chunk-EDEZ3JLR.js";import{A as L,B as xe,h as ye,m as Me}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import{a as we,b as Te,c as Ie}from"./chunk-ZETUYNFJ.js";import{v as Fe,w as N}from"./chunk-STYL7ETF.js";import{D as Ne,E as Ve,J as Re,N as Ue,O as W,v as Be,w as Le,z as Ae}from"./chunk-XLIPGDSC.js";import{E as _e,F as be,G as Ce,H as ve,I as G,c as he,i as fe,j as ue,m as B}from"./chunk-LNJUGHOX.js";import{$b as w,Bc as ce,Ca as X,Cc as me,Dc as pe,Fd as z,G as Q,Gb as v,Hb as b,Ib as ae,Ic as ge,Jc as E,Lc as $,M as Z,Mb as S,Mc as p,Nc as y,Oc as O,Q as K,Qa as ee,ac as oe,bc as T,ca as Y,dc as re,ec as le,f as F,fc as se,gc as f,hc as r,hd as j,ic as s,id as H,jc as C,lb as te,na as _,nb as d,qc as de,ra as c,sb as k,tb as ie,v as P,vc as I,xa as M,xc as m,ya as x,yb as ne}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import{i as U}from"./chunk-66YHNWRR.js";var V=class{constructor(){this.menus=[{Icon:"fa-solid fa-chart-pie",Title:"Dashboard",Url:"/menu/dashboard",Roles:[l.DashboardView]},{Icon:"fas fa-tag",Title:"Products",Url:"/menu/products",Roles:[l.ProductView]},{Icon:"fas fa-archive",Title:"Inventory",Url:"/menu/inventory",Roles:[l.InventoryView]},{Icon:"fas fa-money-bill-alt",Title:"Price",Url:"/menu/price",Roles:[l.PriceView]},{Icon:"fas fa-shopping-cart",Title:"Order",Url:"/menu/order",Roles:[l.OrderView]},{Icon:"fas fa-cog",Title:"Channel",Url:"/menu/channel",Roles:[l.ChannelView]},{Icon:"fa-solid fa-user",Title:"Users",Url:"/menu/users",Roles:[l.UserView]},{Icon:"fas fa-clipboard-list",Title:"Sync Logs",Url:"/menu/sync-log",Roles:[l.Report]},{Icon:"fas fa-dolly",Title:"Logistic",Url:"/menu/Logistic",Roles:[l.LogisticView]},{Icon:"fas fa-file-alt",Title:"Developer",Url:"/menu/log",Roles:[l.DevView]},{Icon:"fa-solid fa-file-brackets-curly",Title:"JSON Api",Url:"/menu/json-api",Roles:[l.JsonApiView]}]}get getMenu(){return this.menus}};var Ze="mat-badge-content",at=(()=>{class e{static \u0275fac=function(n){return new(n||e)};static \u0275cmp=v({type:e,selectors:[["ng-component"]],decls:0,vars:0,template:function(n,a){},styles:[`.mat-badge{position:relative}.mat-badge.mat-badge{overflow:visible}.mat-badge-content{position:absolute;text-align:center;display:inline-block;transition:transform 200ms ease-in-out;transform:scale(0.6);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;box-sizing:border-box;pointer-events:none;background-color:var(--mat-badge-background-color, var(--mat-sys-error));color:var(--mat-badge-text-color, var(--mat-sys-on-error));font-family:var(--mat-badge-text-font, var(--mat-sys-label-small-font));font-weight:var(--mat-badge-text-weight, var(--mat-sys-label-small-weight));border-radius:var(--mat-badge-container-shape, var(--mat-sys-corner-full))}.mat-badge-above .mat-badge-content{bottom:100%}.mat-badge-below .mat-badge-content{top:100%}.mat-badge-before .mat-badge-content{right:100%}[dir=rtl] .mat-badge-before .mat-badge-content{right:auto;left:100%}.mat-badge-after .mat-badge-content{left:100%}[dir=rtl] .mat-badge-after .mat-badge-content{left:auto;right:100%}@media(forced-colors: active){.mat-badge-content{outline:solid 1px;border-radius:0}}.mat-badge-disabled .mat-badge-content{background-color:var(--mat-badge-disabled-state-background-color, color-mix(in srgb, var(--mat-sys-error) 38%, transparent));color:var(--mat-badge-disabled-state-text-color, var(--mat-sys-on-error))}.mat-badge-hidden .mat-badge-content{display:none}.ng-animate-disabled .mat-badge-content,.mat-badge-content._mat-animation-noopable{transition:none}.mat-badge-content.mat-badge-active{transform:none}.mat-badge-small .mat-badge-content{width:var(--mat-badge-legacy-small-size-container-size, unset);height:var(--mat-badge-legacy-small-size-container-size, unset);min-width:var(--mat-badge-small-size-container-size, 6px);min-height:var(--mat-badge-small-size-container-size, 6px);line-height:var(--mat-badge-small-size-line-height, 6px);padding:var(--mat-badge-small-size-container-padding, 0);font-size:var(--mat-badge-small-size-text-size, 0);margin:var(--mat-badge-small-size-container-offset, -6px 0)}.mat-badge-small.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-small-size-container-overlap-offset, -6px)}.mat-badge-medium .mat-badge-content{width:var(--mat-badge-legacy-container-size, unset);height:var(--mat-badge-legacy-container-size, unset);min-width:var(--mat-badge-container-size, 16px);min-height:var(--mat-badge-container-size, 16px);line-height:var(--mat-badge-line-height, 16px);padding:var(--mat-badge-container-padding, 0 4px);font-size:var(--mat-badge-text-size, var(--mat-sys-label-small-size));margin:var(--mat-badge-container-offset, -12px 0)}.mat-badge-medium.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-container-overlap-offset, -12px)}.mat-badge-large .mat-badge-content{width:var(--mat-badge-legacy-large-size-container-size, unset);height:var(--mat-badge-legacy-large-size-container-size, unset);min-width:var(--mat-badge-large-size-container-size, 16px);min-height:var(--mat-badge-large-size-container-size, 16px);line-height:var(--mat-badge-large-size-line-height, 16px);padding:var(--mat-badge-large-size-container-padding, 0 4px);font-size:var(--mat-badge-large-size-text-size, var(--mat-sys-label-small-size));margin:var(--mat-badge-large-size-container-offset, -12px 0)}.mat-badge-large.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-large-size-container-overlap-offset, -12px)}
2
- `],encapsulation:2,changeDetection:0})}return e})(),Ke=(()=>{class e{_ngZone=c(ie);_elementRef=c(ee);_ariaDescriber=c(Re);_renderer=c(ne);_animationsDisabled=Ue();_idGenerator=c(Ve);get color(){return this._color}set color(i){this._setColor(i),this._color=i}_color="primary";overlap=!0;disabled;position="above after";get content(){return this._content}set content(i){this._updateRenderedContent(i)}_content;get description(){return this._description}set description(i){this._updateDescription(i)}_description;size="medium";hidden;_badgeElement;_inlineBadgeDescription;_isInitialized=!1;_interactivityChecker=c(Ae);_document=c(X);constructor(){let i=c(Be);i.load(at),i.load(Le)}isAbove(){return this.position.indexOf("below")===-1}isAfter(){return this.position.indexOf("before")===-1}getBadgeElement(){return this._badgeElement}ngOnInit(){this._clearExistingBadges(),this.content&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement(),this._updateRenderedContent(this.content)),this._isInitialized=!0}ngOnDestroy(){this._renderer.destroyNode&&(this._renderer.destroyNode(this._badgeElement),this._inlineBadgeDescription?.remove()),this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description)}_isHostInteractive(){return this._interactivityChecker.isFocusable(this._elementRef.nativeElement,{ignoreVisibility:!0})}_createBadgeElement(){let i=this._renderer.createElement("span"),n="mat-badge-active";return i.setAttribute("id",this._idGenerator.getId("mat-badge-content-")),i.setAttribute("aria-hidden","true"),i.classList.add(Ze),this._animationsDisabled&&i.classList.add("_mat-animation-noopable"),this._elementRef.nativeElement.appendChild(i),typeof requestAnimationFrame=="function"&&!this._animationsDisabled?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{i.classList.add(n)})}):i.classList.add(n),i}_updateRenderedContent(i){let n=`${i??""}`.trim();this._isInitialized&&n&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement()),this._badgeElement&&(this._badgeElement.textContent=n),this._content=n}_updateDescription(i){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description),(!i||this._isHostInteractive())&&this._removeInlineDescription(),this._description=i,this._isHostInteractive()?this._ariaDescriber.describe(this._elementRef.nativeElement,i):this._updateInlineDescription()}_updateInlineDescription(){this._inlineBadgeDescription||(this._inlineBadgeDescription=this._document.createElement("span"),this._inlineBadgeDescription.classList.add("cdk-visually-hidden")),this._inlineBadgeDescription.textContent=this.description,this._badgeElement?.appendChild(this._inlineBadgeDescription)}_removeInlineDescription(){this._inlineBadgeDescription?.remove(),this._inlineBadgeDescription=void 0}_setColor(i){let n=this._elementRef.nativeElement.classList;n.remove(`mat-badge-${this._color}`),i&&n.add(`mat-badge-${i}`)}_clearExistingBadges(){let i=this._elementRef.nativeElement.querySelectorAll(`:scope > .${Ze}`);for(let n of Array.from(i))n!==this._badgeElement&&n.remove()}static \u0275fac=function(n){return new(n||e)};static \u0275dir=ae({type:e,selectors:[["","matBadge",""]],hostAttrs:[1,"mat-badge"],hostVars:20,hostBindings:function(n,a){n&2&&E("mat-badge-overlap",a.overlap)("mat-badge-above",a.isAbove())("mat-badge-below",!a.isAbove())("mat-badge-before",!a.isAfter())("mat-badge-after",a.isAfter())("mat-badge-small",a.size==="small")("mat-badge-medium",a.size==="medium")("mat-badge-large",a.size==="large")("mat-badge-hidden",a.hidden||!a.content)("mat-badge-disabled",a.disabled)},inputs:{color:[0,"matBadgeColor","color"],overlap:[2,"matBadgeOverlap","overlap",z],disabled:[2,"matBadgeDisabled","disabled",z],position:[0,"matBadgePosition","position"],content:[0,"matBadge","content"],description:[0,"matBadgeDescription","description"],size:[0,"matBadgeSize","size"],hidden:[2,"matBadgeHidden","hidden",z]}})}return e})(),Ye=(()=>{class e{static \u0275fac=function(n){return new(n||e)};static \u0275mod=b({type:e});static \u0275inj=_({imports:[Ne,W,W]})}return e})();function rt(e,t){if(e&1&&(r(0,"p",21),p(1),s()),e&2){let i=m(3).$implicit;d(),O(" ",i.Title," ")}}function lt(e,t){if(e&1&&(r(0,"p"),p(1),s()),e&2){let i=m(3).$implicit;d(),y(i.Title)}}function st(e,t){if(e&1&&(r(0,"a",18),C(1,"i"),w(2,rt,2,1,"p",21)(3,lt,2,1,"p"),s()),e&2){let i=m(2).$implicit;f("href",i.Url,te),d(),$(i.Icon),d(),T(i.Badge?2:3)}}function dt(e,t){if(e&1&&S(0,st,4,4,"a",20),e&2){let i=m().$implicit;f("ngxPermissionsOnly",i.Roles)}}function ct(e,t){if(e&1&&(r(0,"p",21),p(1),s()),e&2){let i=m(4).$implicit;d(),O(" ",i.Title," ")}}function mt(e,t){if(e&1&&(r(0,"p"),p(1),s()),e&2){let i=m(4).$implicit;d(),y(i.Title)}}function pt(e,t){if(e&1&&(w(0,ct,2,1,"p",21),j(1,"async"),oe(2,mt,2,1,"p")),e&2){let i=m(4);T(H(1,1,i.notifications$)!=0?0:2)}}function gt(e,t){if(e&1&&(r(0,"p"),p(1),s()),e&2){let i=m(3).$implicit;d(),y(i.Title)}}function ht(e,t){if(e&1&&(r(0,"a",19),C(1,"i"),w(2,pt,3,3)(3,gt,2,1,"p"),s()),e&2){let i=m(2).$implicit,n=m();f("matTooltip",n.isCollapseSidebar?i.Title:"")("routerLink",i.Url),d(),$(i.Icon),d(),T(i.Badge?2:3)}}function ft(e,t){if(e&1&&S(0,ht,4,5,"a",22),e&2){let i=m().$implicit;f("ngxPermissionsOnly",i.Roles)}}function ut(e,t){if(e&1&&(r(0,"li",16),w(1,dt,1,1,"a",18)(2,ft,1,1,"a",19),s()),e&2){let i=t.$implicit;d(),T(i.ExternalLink?1:2)}}var Xe=(()=>{let t=class t{constructor(){this.toggleSidebarService=c(ke),this.notificationService=c(ze),this.decodeTokenService=c(Se),this.authService=c(Oe),this.Menu={};let n=this.decodeTokenService;this.isCollapseSidebar=!1,this.token=n.getParseToken(),this.storeName=this.token.StoreName,this.Menu=new V().getMenu,this.toggleState$=this.toggleSidebarService.toggleState$}ngOnInit(){this.initNotifications()}initNotifications(){this.notifications$=this.notificationService.getNotification().pipe(P(n=>n.length))}onLogout(){this.authService.logout()}onCallapseSidebar(){this.isCollapseSidebar=!this.isCollapseSidebar,this.storeName=this.token.StoreName,this.isCollapseSidebar&&(this.storeName=this.getInitialTitle(this.token.StoreName))}getInitialTitle(n){if(n){let a,o=n.split(" ");return o.length==1?a=o[0].substring(0,2):a=o.shift().charAt(0)+o.pop().charAt(0),a}}};t.\u0275fac=function(a){return new(a||t)},t.\u0275cmp=v({type:t,selectors:[["app-menu"]],standalone:!1,decls:29,vars:8,consts:[[1,"wrapper"],["data-color","green",1,"sidebar",3,"ngClass"],[1,"btn-minimize","d-md-block","d-none","p-0","border-0","bg-white",3,"click"],[1,"fas","cursor",3,"ngClass"],[1,"logo"],[1,"navbar","dropdown","bg-transparent","border-0"],["data-bs-toggle","dropdown","aria-expanded","false",1,"simple-text","text-start","dropdown-toggle","d-flex","align-items-center","justify-content-center","cursor-pointer"],[1,"dropdown-menu"],[1,"dropdown-header","text-dark","border-bottom"],[1,"divider","m-0"],["routerLink","/menu/profile",1,"dropdown-item","h5",2,"cursor","pointer"],["aria-hidden","true",1,"fa-user","fas"],[1,"dropdown-item","h5",2,"cursor","pointer",3,"click"],["aria-hidden","true",1,"fas","fa-sign-out-alt"],[1,"sidebar-wrapper"],[1,"nav"],["routerLinkActive","active"],[1,"main-panel"],["target","_blank",1,"nav-link","position-relative","d-block","changelog",3,"href"],["matTooltipPosition","right",1,"nav-link","position-relative","d-block",3,"matTooltip","routerLink"],["class","nav-link position-relative d-block changelog","target","_blank",3,"href",4,"ngxPermissionsOnly"],["matBadge","!","matBadgeColor","warn","matBadgeSize","small",1,"shake-animation"],["class","nav-link position-relative d-block","matTooltipPosition","right",3,"matTooltip","routerLink",4,"ngxPermissionsOnly"]],template:function(a,o){a&1&&(r(0,"div",0),j(1,"async"),r(2,"div",1)(3,"button",2),I("click",function(){return o.onCallapseSidebar()}),C(4,"i",3),s(),r(5,"div",4)(6,"div",5)(7,"a",6),p(8),s(),r(9,"div",7)(10,"div",8),p(11),s(),C(12,"div",9),r(13,"a",10),C(14,"i",11),p(15,"\xA0 "),r(16,"span"),p(17,"My Profile"),s()(),r(18,"a",12),I("click",function(){return o.onLogout()}),C(19,"i",13),p(20,"\xA0 "),r(21,"span"),p(22," Log Out"),s()()()()(),r(23,"div",14)(24,"ul",15),le(25,ut,3,1,"li",16,re),s()()(),r(27,"div",17),C(28,"router-outlet"),s()()),a&2&&(E("nav-open",H(1,6,o.toggleState$)),d(2),f("ngClass",o.isCollapseSidebar?"collapses":""),d(2),f("ngClass",o.isCollapseSidebar?"fa-angle-left":"fa-angle-right"),d(4),O(" ",o.storeName," "),d(3),O(" ",o.token==null?null:o.token.LID," "),d(14),se(o.Menu))},dependencies:[he,_e,Ce,ve,Fe,Ke,Te,fe],styles:["@media (max-width: 468px){.navbar[_ngcontent-%COMP%] .navbar-brand[_ngcontent-%COMP%]{white-space:nowrap;max-width:7em;overflow:hidden;text-overflow:ellipsis}}@media only screen and (min-width: 992px){.sidebar[_ngcontent-%COMP%]{z-index:1050!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%], .sidebar.collapses[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{width:70px;transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%] .simple-text[_ngcontent-%COMP%]{background-color:#ffffff3b;border-radius:20px;height:40px;width:40px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{padding:10px 0 10px 10px!important;height:50px;text-align:center;margin:10px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:none}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{padding-left:70px}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{left:70px!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]{position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1;background-color:#fff;position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border:0;border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;padding:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{cursor:pointer}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1}.full-container[_ngcontent-%COMP%]{padding-top:0!important}} p.shake-animation.mat-badge>span.mat-badge-content{animation:_ngcontent-%COMP%_shake-animation 4.72s ease infinite;font-size:12px;transform-origin:50% 50%;right:-14px!important}@keyframes _ngcontent-%COMP%_shake-animation{0%{transform:translate(0)}1.78571%{transform:translate(5px)}3.57143%{transform:translate(0)}5.35714%{transform:translate(5px)}7.14286%{transform:translate(0)}8.92857%{transform:translate(5px)}10.71429%{transform:translate(0)}to{transform:translate(0)}} .changelog:visited p.shake-animation.mat-badge>span.mat-badge-content{color:#77c425;background-color:#77c425;z-index:-1}@media print{.main-panel[_ngcontent-%COMP%]{padding:0!important}}"]});let e=t;return e})();var u=(e,t)=>U(null,null,function*(){let i=c(we),n=c(be),a=e.data?.roles||[],o=e.data?.redirectUrl||"/";return a.length===0||(yield _t(i,a))?!0:(n.navigate([o]),!1)});function _t(e,t){return U(this,null,function*(){let i=t.map(a=>e.hasPermission(a));return(yield Promise.all(i)).some(a=>a)})}var bt=[{path:"",component:Xe,children:[{path:"",redirectTo:"dashboard",pathMatch:"full"},{path:"profile",loadChildren:()=>import("./chunk-BXYXVBXP.js").then(e=>e.routes),canActivate:[g],data:{title:"My Profile"}},{path:"dashboard",loadChildren:()=>import("./chunk-7GY4O2UX.js").then(e=>e.DashboardModule),canActivate:[g,u,je],data:{title:"Dashboard",roles:[l.DashboardView],redirectUrl:"/menu/products"}},{path:"products",loadChildren:()=>import("./chunk-7WHUYSBD.js").then(e=>e.ProductModule),canActivate:[g,u],data:{title:"Products",roles:[l.ProductView],redirectUrl:"/menu/inventory"}},{path:"inventory",loadChildren:()=>import("./chunk-3TPMCGA5.js").then(e=>e.InventoryRoutingModule),canActivate:[g,u],data:{title:"Inventory",roles:[l.InventoryView],redirectUrl:"/menu/price"}},{path:"price",loadChildren:()=>import("./chunk-AFCA7VVG.js").then(e=>e.PriceRoutingModule),canActivate:[g,u],data:{title:"Price",roles:[l.PriceView],redirectUrl:"/menu/Order"}},{path:"order",loadChildren:()=>import("./chunk-PUUZQ4N5.js").then(e=>e.routes),canActivate:[g],data:{title:"Order"}},{path:"sync-log",loadChildren:()=>import("./chunk-IX6JJ6BJ.js").then(e=>e.ReportModule),canActivate:[g,u],data:{title:"Report",roles:[l.Report],redirectUrl:"/menu/Logistic"}},{path:"Logistic",loadChildren:()=>import("./chunk-SJT5OMJM.js").then(e=>e.LogisticModule),canActivate:[g,u],data:{title:"Logistic",roles:[l.LogisticView],redirectUrl:"/menu/channel"}},{path:"channel",loadChildren:()=>import("./chunk-ZVTFMONF.js").then(e=>e.ChannelsModule),canActivate:[g,u],data:{title:"Marketplace",roles:[l.ChannelView],redirectUrl:"/menu/log"}},{path:"log",loadChildren:()=>import("./chunk-JKRH5WGR.js").then(e=>e.LogsModule),canActivate:[g,u],data:{title:"Orders",roles:[l.DevView]}},{path:"users",loadChildren:()=>import("./chunk-GURSK3ZV.js").then(e=>e.userRoutes),canActivate:[g,u],data:{title:"Users",roles:[l.UserView],redirectUrl:"/menu/dashboard"}},{path:"json-api",loadChildren:()=>import("./chunk-QSBCJIQ3.js").then(e=>e.routes),canActivate:[g],data:{title:"Json API"}}]}],et=(()=>{let t=class t{};t.\u0275fac=function(a){return new(a||t)},t.\u0275mod=b({type:t}),t.\u0275inj=_({imports:[G.forChild(bt),G]});let e=t;return e})();var Ct=["selectId"];function vt(e,t){if(e&1&&(r(0,"span",3),p(1),s()),e&2){let i=t.item,n=m();f("title",i[n.bindLabel]),d(),y(i[n.bindLabel])}}var tt=(()=>{let t=class t{set items(n){this.ngSelectInfiniteScroll.data=n,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}get selected(){return this._selected}set selected(n){this._selected=n,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}constructor(){this.placeholder="",this.bindValue="",this.bindLabel="",this.width="100%",this.clearable=!0,this.parent="body",this.disabled=!1,this.optionTitle=!1,this._selected="",this.ngSelectInfiniteScroll=new J,this.selectedChange=new k,this.selectedLabel=new k,this.onOpen=new k}onOpenSelect(){this.onOpen.emit()}onSelectChange(n){n?(this.selectedChange.emit(n[this.bindValue]),this.selectedLabel.emit(n[this.bindLabel])):(this.selectedChange.emit(null),this.selectedLabel.emit(null))}};t.\u0275fac=function(a){return new(a||t)},t.\u0275cmp=v({type:t,selectors:[["ng-select-infinite"]],viewQuery:function(a,o){if(a&1&&ce(Ct,7),a&2){let h;me(h=pe())&&(o.ngSelectElement=h.first)}},inputs:{placeholder:"placeholder",bindValue:"bindValue",bindLabel:"bindLabel",width:"width",clearable:"clearable",parent:"parent",disabled:"disabled",optionTitle:"optionTitle",items:"items",selected:"selected"},outputs:{selectedChange:"selectedChange",selectedLabel:"selectedLabel",onOpen:"onOpen"},decls:3,vars:12,consts:[["selectId",""],[3,"clear","scrollToEnd","open","change","appendTo","disabled","virtualScroll","typeahead","items","bindLabel","bindValue","placeholder","ngModel","clearable"],["ng-option-tmp",""],[3,"title"]],template:function(a,o){if(a&1){let h=de();r(0,"ng-select",1,0),I("clear",function(){return M(h),x(o.ngSelectInfiniteScroll.onClear())})("scrollToEnd",function(){return M(h),x(o.ngSelectInfiniteScroll.onScrollToEnd())})("open",function(){return M(h),x(o.onOpenSelect())})("change",function(nt){return M(h),x(o.onSelectChange(nt))}),S(2,vt,2,2,"ng-template",2),s()}a&2&&(ge("width",o.width),f("appendTo",o.parent)("disabled",o.disabled)("virtualScroll",!0)("typeahead",o.ngSelectInfiniteScroll.input$)("items",o.ngSelectInfiniteScroll.bufferData)("bindLabel",o.bindLabel)("bindValue",o.bindValue)("placeholder",o.placeholder)("ngModel",o.selected)("clearable",o.clearable))},dependencies:[A,Pe,De,L,ye,Me],encapsulation:2});let e=t;return e})(),J=class{constructor(){this._dataBuffer=[],this._data=[],this._input$=new F,this._destroy$=new F,this._loading=!1,this._bufferSize=50,this.data=[]}onSearch(){this._input$.pipe(Z(200),K(),P(t=>(t&&(t=t.toLowerCase()),this.filterData(t))),Q(t=>t!==void 0),Y(this._destroy$)).subscribe(t=>{this._dataBuffer=t.slice(0,this._bufferSize)})}onClear(){this._dataBuffer=this._data.slice(0,this._bufferSize)}filterData(t){let i=-1,n;return this._data.filter(o=>(n=JSON.stringify(o).toLowerCase(),i=n.indexOf(t),i!==-1||t==null))}get input$(){return this._input$}get bufferData(){return this._dataBuffer}get loading(){return this._loading}set data(t){this._data=t||[],this._dataBuffer=this._data.slice(0,this._bufferSize),this.onSearch()}initSelectedValue(t,i){if(Ee.IsNotEmpty(t)){let n=this._data.filter(a=>a[i].toString().toLowerCase().indexOf(t)!==-1);this._dataBuffer=n.slice(0,this._bufferSize)}}set bufferSize(t){this._bufferSize=t}onScrollToEnd(){this.fetchMore()}fetchMore(){let t=this._dataBuffer.length,i=this._data.slice(t,this._bufferSize+t);this._loading=!0,setTimeout(()=>{this._loading=!1,this._dataBuffer=this._dataBuffer.concat(i)},200)}destroy(){this._destroy$.next(!0),this._destroy$.complete()}};var it=(()=>{let t=class t{};t.\u0275fac=function(a){return new(a||t)},t.\u0275mod=b({type:t}),t.\u0275inj=_({imports:[B,L,$e,We,Je,Ge,qe,Qe,N,q,tt,A,xe]});let e=t;return e})();var bn=(()=>{let t=class t{};t.\u0275fac=function(a){return new(a||t)},t.\u0275mod=b({type:t}),t.\u0275inj=_({providers:[ue],imports:[B,et,He,N,it,Ye,Ie.forChild()]});let e=t;return e})();export{bn as MenuModule};
1
+ import"./chunk-E6ZWL77N.js";import"./chunk-O4EO3YBL.js";import{a as je}from"./chunk-ADKAX3OO.js";import"./chunk-4VNQYYVV.js";import{b as qe}from"./chunk-ZKIO2ZQ6.js";import{a as g}from"./chunk-UCEZJNIL.js";import"./chunk-ZTHO6JJM.js";import"./chunk-SHUYFOQI.js";import"./chunk-GG3MDS4C.js";import{b as Qe}from"./chunk-O2YF5VGD.js";import{b as Je}from"./chunk-QFSA7CU4.js";import"./chunk-OPXITNRF.js";import{c as We}from"./chunk-5BSPSA4O.js";import"./chunk-FULVA6QB.js";import"./chunk-HPINZVE4.js";import"./chunk-D2J64VUP.js";import"./chunk-6Q6L5NUD.js";import"./chunk-C7N6EI73.js";import"./chunk-GPHNPV7O.js";import"./chunk-3RK6DDJD.js";import{a as Ge}from"./chunk-4YCSITNV.js";import"./chunk-WHHW4IZT.js";import{a as l}from"./chunk-ZSUWHVKX.js";import"./chunk-N5AE5WMQ.js";import{b as ze}from"./chunk-6OIMOM7S.js";import{a as De,d as Pe,e as A}from"./chunk-6KWG6O5L.js";import{a as Ee}from"./chunk-A6QXXKPR.js";import{b as Se,i as Oe}from"./chunk-I723PUUO.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-AGBJEXIM.js";import"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import"./chunk-JBEKD57G.js";import{a as ke,h as $e,k as q,n as He}from"./chunk-EDEZ3JLR.js";import{A as L,B as xe,h as ye,m as Me}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import{a as we,b as Te,c as Ie}from"./chunk-ZETUYNFJ.js";import{v as Fe,w as N}from"./chunk-STYL7ETF.js";import{D as Ne,E as Ve,J as Re,N as Ue,O as W,v as Be,w as Le,z as Ae}from"./chunk-XLIPGDSC.js";import{E as _e,F as be,G as Ce,H as ve,I as G,c as he,i as fe,j as ue,m as B}from"./chunk-LNJUGHOX.js";import{$b as w,Bc as ce,Ca as X,Cc as me,Dc as pe,Fd as z,G as Q,Gb as v,Hb as b,Ib as ae,Ic as ge,Jc as E,Lc as $,M as Z,Mb as S,Mc as p,Nc as y,Oc as O,Q as K,Qa as ee,ac as oe,bc as T,ca as Y,dc as re,ec as le,f as F,fc as se,gc as f,hc as r,hd as j,ic as s,id as H,jc as C,lb as te,na as _,nb as d,qc as de,ra as c,sb as k,tb as ie,v as P,vc as I,xa as M,xc as m,ya as x,yb as ne}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import{i as U}from"./chunk-66YHNWRR.js";var V=class{constructor(){this.menus=[{Icon:"fa-solid fa-chart-pie",Title:"Dashboard",Url:"/menu/dashboard",Roles:[l.DashboardView]},{Icon:"fas fa-tag",Title:"Products",Url:"/menu/products",Roles:[l.ProductView]},{Icon:"fas fa-archive",Title:"Inventory",Url:"/menu/inventory",Roles:[l.InventoryView]},{Icon:"fas fa-money-bill-alt",Title:"Price",Url:"/menu/price",Roles:[l.PriceView]},{Icon:"fas fa-shopping-cart",Title:"Order",Url:"/menu/order",Roles:[l.OrderView]},{Icon:"fas fa-cog",Title:"Channel",Url:"/menu/channel",Roles:[l.ChannelView]},{Icon:"fa-solid fa-user",Title:"Users",Url:"/menu/users",Roles:[l.UserView]},{Icon:"fas fa-clipboard-list",Title:"Sync Logs",Url:"/menu/sync-log",Roles:[l.Report]},{Icon:"fas fa-dolly",Title:"Logistic",Url:"/menu/Logistic",Roles:[l.LogisticView]},{Icon:"fas fa-file-alt",Title:"Developer",Url:"/menu/log",Roles:[l.DevView]},{Icon:"fa-solid fa-file-brackets-curly",Title:"JSON Api",Url:"/menu/json-api",Roles:[l.JsonApiView]}]}get getMenu(){return this.menus}};var Ze="mat-badge-content",at=(()=>{class e{static \u0275fac=function(n){return new(n||e)};static \u0275cmp=v({type:e,selectors:[["ng-component"]],decls:0,vars:0,template:function(n,a){},styles:[`.mat-badge{position:relative}.mat-badge.mat-badge{overflow:visible}.mat-badge-content{position:absolute;text-align:center;display:inline-block;transition:transform 200ms ease-in-out;transform:scale(0.6);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;box-sizing:border-box;pointer-events:none;background-color:var(--mat-badge-background-color, var(--mat-sys-error));color:var(--mat-badge-text-color, var(--mat-sys-on-error));font-family:var(--mat-badge-text-font, var(--mat-sys-label-small-font));font-weight:var(--mat-badge-text-weight, var(--mat-sys-label-small-weight));border-radius:var(--mat-badge-container-shape, var(--mat-sys-corner-full))}.mat-badge-above .mat-badge-content{bottom:100%}.mat-badge-below .mat-badge-content{top:100%}.mat-badge-before .mat-badge-content{right:100%}[dir=rtl] .mat-badge-before .mat-badge-content{right:auto;left:100%}.mat-badge-after .mat-badge-content{left:100%}[dir=rtl] .mat-badge-after .mat-badge-content{left:auto;right:100%}@media(forced-colors: active){.mat-badge-content{outline:solid 1px;border-radius:0}}.mat-badge-disabled .mat-badge-content{background-color:var(--mat-badge-disabled-state-background-color, color-mix(in srgb, var(--mat-sys-error) 38%, transparent));color:var(--mat-badge-disabled-state-text-color, var(--mat-sys-on-error))}.mat-badge-hidden .mat-badge-content{display:none}.ng-animate-disabled .mat-badge-content,.mat-badge-content._mat-animation-noopable{transition:none}.mat-badge-content.mat-badge-active{transform:none}.mat-badge-small .mat-badge-content{width:var(--mat-badge-legacy-small-size-container-size, unset);height:var(--mat-badge-legacy-small-size-container-size, unset);min-width:var(--mat-badge-small-size-container-size, 6px);min-height:var(--mat-badge-small-size-container-size, 6px);line-height:var(--mat-badge-small-size-line-height, 6px);padding:var(--mat-badge-small-size-container-padding, 0);font-size:var(--mat-badge-small-size-text-size, 0);margin:var(--mat-badge-small-size-container-offset, -6px 0)}.mat-badge-small.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-small-size-container-overlap-offset, -6px)}.mat-badge-medium .mat-badge-content{width:var(--mat-badge-legacy-container-size, unset);height:var(--mat-badge-legacy-container-size, unset);min-width:var(--mat-badge-container-size, 16px);min-height:var(--mat-badge-container-size, 16px);line-height:var(--mat-badge-line-height, 16px);padding:var(--mat-badge-container-padding, 0 4px);font-size:var(--mat-badge-text-size, var(--mat-sys-label-small-size));margin:var(--mat-badge-container-offset, -12px 0)}.mat-badge-medium.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-container-overlap-offset, -12px)}.mat-badge-large .mat-badge-content{width:var(--mat-badge-legacy-large-size-container-size, unset);height:var(--mat-badge-legacy-large-size-container-size, unset);min-width:var(--mat-badge-large-size-container-size, 16px);min-height:var(--mat-badge-large-size-container-size, 16px);line-height:var(--mat-badge-large-size-line-height, 16px);padding:var(--mat-badge-large-size-container-padding, 0 4px);font-size:var(--mat-badge-large-size-text-size, var(--mat-sys-label-small-size));margin:var(--mat-badge-large-size-container-offset, -12px 0)}.mat-badge-large.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-large-size-container-overlap-offset, -12px)}
2
+ `],encapsulation:2,changeDetection:0})}return e})(),Ke=(()=>{class e{_ngZone=c(ie);_elementRef=c(ee);_ariaDescriber=c(Re);_renderer=c(ne);_animationsDisabled=Ue();_idGenerator=c(Ve);get color(){return this._color}set color(i){this._setColor(i),this._color=i}_color="primary";overlap=!0;disabled;position="above after";get content(){return this._content}set content(i){this._updateRenderedContent(i)}_content;get description(){return this._description}set description(i){this._updateDescription(i)}_description;size="medium";hidden;_badgeElement;_inlineBadgeDescription;_isInitialized=!1;_interactivityChecker=c(Ae);_document=c(X);constructor(){let i=c(Be);i.load(at),i.load(Le)}isAbove(){return this.position.indexOf("below")===-1}isAfter(){return this.position.indexOf("before")===-1}getBadgeElement(){return this._badgeElement}ngOnInit(){this._clearExistingBadges(),this.content&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement(),this._updateRenderedContent(this.content)),this._isInitialized=!0}ngOnDestroy(){this._renderer.destroyNode&&(this._renderer.destroyNode(this._badgeElement),this._inlineBadgeDescription?.remove()),this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description)}_isHostInteractive(){return this._interactivityChecker.isFocusable(this._elementRef.nativeElement,{ignoreVisibility:!0})}_createBadgeElement(){let i=this._renderer.createElement("span"),n="mat-badge-active";return i.setAttribute("id",this._idGenerator.getId("mat-badge-content-")),i.setAttribute("aria-hidden","true"),i.classList.add(Ze),this._animationsDisabled&&i.classList.add("_mat-animation-noopable"),this._elementRef.nativeElement.appendChild(i),typeof requestAnimationFrame=="function"&&!this._animationsDisabled?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{i.classList.add(n)})}):i.classList.add(n),i}_updateRenderedContent(i){let n=`${i??""}`.trim();this._isInitialized&&n&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement()),this._badgeElement&&(this._badgeElement.textContent=n),this._content=n}_updateDescription(i){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description),(!i||this._isHostInteractive())&&this._removeInlineDescription(),this._description=i,this._isHostInteractive()?this._ariaDescriber.describe(this._elementRef.nativeElement,i):this._updateInlineDescription()}_updateInlineDescription(){this._inlineBadgeDescription||(this._inlineBadgeDescription=this._document.createElement("span"),this._inlineBadgeDescription.classList.add("cdk-visually-hidden")),this._inlineBadgeDescription.textContent=this.description,this._badgeElement?.appendChild(this._inlineBadgeDescription)}_removeInlineDescription(){this._inlineBadgeDescription?.remove(),this._inlineBadgeDescription=void 0}_setColor(i){let n=this._elementRef.nativeElement.classList;n.remove(`mat-badge-${this._color}`),i&&n.add(`mat-badge-${i}`)}_clearExistingBadges(){let i=this._elementRef.nativeElement.querySelectorAll(`:scope > .${Ze}`);for(let n of Array.from(i))n!==this._badgeElement&&n.remove()}static \u0275fac=function(n){return new(n||e)};static \u0275dir=ae({type:e,selectors:[["","matBadge",""]],hostAttrs:[1,"mat-badge"],hostVars:20,hostBindings:function(n,a){n&2&&E("mat-badge-overlap",a.overlap)("mat-badge-above",a.isAbove())("mat-badge-below",!a.isAbove())("mat-badge-before",!a.isAfter())("mat-badge-after",a.isAfter())("mat-badge-small",a.size==="small")("mat-badge-medium",a.size==="medium")("mat-badge-large",a.size==="large")("mat-badge-hidden",a.hidden||!a.content)("mat-badge-disabled",a.disabled)},inputs:{color:[0,"matBadgeColor","color"],overlap:[2,"matBadgeOverlap","overlap",z],disabled:[2,"matBadgeDisabled","disabled",z],position:[0,"matBadgePosition","position"],content:[0,"matBadge","content"],description:[0,"matBadgeDescription","description"],size:[0,"matBadgeSize","size"],hidden:[2,"matBadgeHidden","hidden",z]}})}return e})(),Ye=(()=>{class e{static \u0275fac=function(n){return new(n||e)};static \u0275mod=b({type:e});static \u0275inj=_({imports:[Ne,W,W]})}return e})();function rt(e,t){if(e&1&&(r(0,"p",21),p(1),s()),e&2){let i=m(3).$implicit;d(),O(" ",i.Title," ")}}function lt(e,t){if(e&1&&(r(0,"p"),p(1),s()),e&2){let i=m(3).$implicit;d(),y(i.Title)}}function st(e,t){if(e&1&&(r(0,"a",18),C(1,"i"),w(2,rt,2,1,"p",21)(3,lt,2,1,"p"),s()),e&2){let i=m(2).$implicit;f("href",i.Url,te),d(),$(i.Icon),d(),T(i.Badge?2:3)}}function dt(e,t){if(e&1&&S(0,st,4,4,"a",20),e&2){let i=m().$implicit;f("ngxPermissionsOnly",i.Roles)}}function ct(e,t){if(e&1&&(r(0,"p",21),p(1),s()),e&2){let i=m(4).$implicit;d(),O(" ",i.Title," ")}}function mt(e,t){if(e&1&&(r(0,"p"),p(1),s()),e&2){let i=m(4).$implicit;d(),y(i.Title)}}function pt(e,t){if(e&1&&(w(0,ct,2,1,"p",21),j(1,"async"),oe(2,mt,2,1,"p")),e&2){let i=m(4);T(H(1,1,i.notifications$)!=0?0:2)}}function gt(e,t){if(e&1&&(r(0,"p"),p(1),s()),e&2){let i=m(3).$implicit;d(),y(i.Title)}}function ht(e,t){if(e&1&&(r(0,"a",19),C(1,"i"),w(2,pt,3,3)(3,gt,2,1,"p"),s()),e&2){let i=m(2).$implicit,n=m();f("matTooltip",n.isCollapseSidebar?i.Title:"")("routerLink",i.Url),d(),$(i.Icon),d(),T(i.Badge?2:3)}}function ft(e,t){if(e&1&&S(0,ht,4,5,"a",22),e&2){let i=m().$implicit;f("ngxPermissionsOnly",i.Roles)}}function ut(e,t){if(e&1&&(r(0,"li",16),w(1,dt,1,1,"a",18)(2,ft,1,1,"a",19),s()),e&2){let i=t.$implicit;d(),T(i.ExternalLink?1:2)}}var Xe=(()=>{let t=class t{constructor(){this.toggleSidebarService=c(ke),this.notificationService=c(ze),this.decodeTokenService=c(Se),this.authService=c(Oe),this.Menu={};let n=this.decodeTokenService;this.isCollapseSidebar=!1,this.token=n.getParseToken(),this.storeName=this.token.StoreName,this.Menu=new V().getMenu,this.toggleState$=this.toggleSidebarService.toggleState$}ngOnInit(){this.initNotifications()}initNotifications(){this.notifications$=this.notificationService.getNotification().pipe(P(n=>n.length))}onLogout(){this.authService.logout()}onCallapseSidebar(){this.isCollapseSidebar=!this.isCollapseSidebar,this.storeName=this.token.StoreName,this.isCollapseSidebar&&(this.storeName=this.getInitialTitle(this.token.StoreName))}getInitialTitle(n){if(n){let a,o=n.split(" ");return o.length==1?a=o[0].substring(0,2):a=o.shift().charAt(0)+o.pop().charAt(0),a}}};t.\u0275fac=function(a){return new(a||t)},t.\u0275cmp=v({type:t,selectors:[["app-menu"]],standalone:!1,decls:29,vars:8,consts:[[1,"wrapper"],["data-color","green",1,"sidebar",3,"ngClass"],[1,"btn-minimize","d-md-block","d-none","p-0","border-0","bg-white",3,"click"],[1,"fas","cursor",3,"ngClass"],[1,"logo"],[1,"navbar","dropdown","bg-transparent","border-0"],["data-bs-toggle","dropdown","aria-expanded","false",1,"simple-text","text-start","dropdown-toggle","d-flex","align-items-center","justify-content-center","cursor-pointer"],[1,"dropdown-menu"],[1,"dropdown-header","text-dark","border-bottom"],[1,"divider","m-0"],["routerLink","/menu/profile",1,"dropdown-item","h5",2,"cursor","pointer"],["aria-hidden","true",1,"fa-user","fas"],[1,"dropdown-item","h5",2,"cursor","pointer",3,"click"],["aria-hidden","true",1,"fas","fa-sign-out-alt"],[1,"sidebar-wrapper"],[1,"nav"],["routerLinkActive","active"],[1,"main-panel"],["target","_blank",1,"nav-link","position-relative","d-block","changelog",3,"href"],["matTooltipPosition","right",1,"nav-link","position-relative","d-block",3,"matTooltip","routerLink"],["class","nav-link position-relative d-block changelog","target","_blank",3,"href",4,"ngxPermissionsOnly"],["matBadge","!","matBadgeColor","warn","matBadgeSize","small",1,"shake-animation"],["class","nav-link position-relative d-block","matTooltipPosition","right",3,"matTooltip","routerLink",4,"ngxPermissionsOnly"]],template:function(a,o){a&1&&(r(0,"div",0),j(1,"async"),r(2,"div",1)(3,"button",2),I("click",function(){return o.onCallapseSidebar()}),C(4,"i",3),s(),r(5,"div",4)(6,"div",5)(7,"a",6),p(8),s(),r(9,"div",7)(10,"div",8),p(11),s(),C(12,"div",9),r(13,"a",10),C(14,"i",11),p(15,"\xA0 "),r(16,"span"),p(17,"My Profile"),s()(),r(18,"a",12),I("click",function(){return o.onLogout()}),C(19,"i",13),p(20,"\xA0 "),r(21,"span"),p(22," Log Out"),s()()()()(),r(23,"div",14)(24,"ul",15),le(25,ut,3,1,"li",16,re),s()()(),r(27,"div",17),C(28,"router-outlet"),s()()),a&2&&(E("nav-open",H(1,6,o.toggleState$)),d(2),f("ngClass",o.isCollapseSidebar?"collapses":""),d(2),f("ngClass",o.isCollapseSidebar?"fa-angle-left":"fa-angle-right"),d(4),O(" ",o.storeName," "),d(3),O(" ",o.token==null?null:o.token.LID," "),d(14),se(o.Menu))},dependencies:[he,_e,Ce,ve,Fe,Ke,Te,fe],styles:["@media (max-width: 468px){.navbar[_ngcontent-%COMP%] .navbar-brand[_ngcontent-%COMP%]{white-space:nowrap;max-width:7em;overflow:hidden;text-overflow:ellipsis}}@media only screen and (min-width: 992px){.sidebar[_ngcontent-%COMP%]{z-index:1050!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%], .sidebar.collapses[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{width:70px;transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%] .simple-text[_ngcontent-%COMP%]{background-color:#ffffff3b;border-radius:20px;height:40px;width:40px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{padding:10px 0 10px 10px!important;height:50px;text-align:center;margin:10px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:none}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{padding-left:70px}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{left:70px!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]{position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1;background-color:#fff;position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border:0;border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;padding:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{cursor:pointer}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1}.full-container[_ngcontent-%COMP%]{padding-top:0!important}} p.shake-animation.mat-badge>span.mat-badge-content{animation:_ngcontent-%COMP%_shake-animation 4.72s ease infinite;font-size:12px;transform-origin:50% 50%;right:-14px!important}@keyframes _ngcontent-%COMP%_shake-animation{0%{transform:translate(0)}1.78571%{transform:translate(5px)}3.57143%{transform:translate(0)}5.35714%{transform:translate(5px)}7.14286%{transform:translate(0)}8.92857%{transform:translate(5px)}10.71429%{transform:translate(0)}to{transform:translate(0)}} .changelog:visited p.shake-animation.mat-badge>span.mat-badge-content{color:#77c425;background-color:#77c425;z-index:-1}@media print{.main-panel[_ngcontent-%COMP%]{padding:0!important}}"]});let e=t;return e})();var u=(e,t)=>U(null,null,function*(){let i=c(we),n=c(be),a=e.data?.roles||[],o=e.data?.redirectUrl||"/";return a.length===0||(yield _t(i,a))?!0:(n.navigate([o]),!1)});function _t(e,t){return U(this,null,function*(){let i=t.map(a=>e.hasPermission(a));return(yield Promise.all(i)).some(a=>a)})}var bt=[{path:"",component:Xe,children:[{path:"",redirectTo:"dashboard",pathMatch:"full"},{path:"profile",loadChildren:()=>import("./chunk-BXYXVBXP.js").then(e=>e.routes),canActivate:[g],data:{title:"My Profile"}},{path:"dashboard",loadChildren:()=>import("./chunk-7GY4O2UX.js").then(e=>e.DashboardModule),canActivate:[g,u,je],data:{title:"Dashboard",roles:[l.DashboardView],redirectUrl:"/menu/products"}},{path:"products",loadChildren:()=>import("./chunk-IDH7MCR3.js").then(e=>e.ProductModule),canActivate:[g,u],data:{title:"Products",roles:[l.ProductView],redirectUrl:"/menu/inventory"}},{path:"inventory",loadChildren:()=>import("./chunk-J6BQDYXO.js").then(e=>e.InventoryRoutingModule),canActivate:[g,u],data:{title:"Inventory",roles:[l.InventoryView],redirectUrl:"/menu/price"}},{path:"price",loadChildren:()=>import("./chunk-ZUL6ZHSW.js").then(e=>e.PriceRoutingModule),canActivate:[g,u],data:{title:"Price",roles:[l.PriceView],redirectUrl:"/menu/Order"}},{path:"order",loadChildren:()=>import("./chunk-B6F5PDL5.js").then(e=>e.routes),canActivate:[g],data:{title:"Order"}},{path:"sync-log",loadChildren:()=>import("./chunk-7DT7FQ2T.js").then(e=>e.ReportModule),canActivate:[g,u],data:{title:"Report",roles:[l.Report],redirectUrl:"/menu/Logistic"}},{path:"Logistic",loadChildren:()=>import("./chunk-3K2EKA5O.js").then(e=>e.LogisticModule),canActivate:[g,u],data:{title:"Logistic",roles:[l.LogisticView],redirectUrl:"/menu/channel"}},{path:"channel",loadChildren:()=>import("./chunk-PLLHTY6O.js").then(e=>e.ChannelsModule),canActivate:[g,u],data:{title:"Marketplace",roles:[l.ChannelView],redirectUrl:"/menu/log"}},{path:"log",loadChildren:()=>import("./chunk-DH5CXAEM.js").then(e=>e.LogsModule),canActivate:[g,u],data:{title:"Orders",roles:[l.DevView]}},{path:"users",loadChildren:()=>import("./chunk-GURSK3ZV.js").then(e=>e.userRoutes),canActivate:[g,u],data:{title:"Users",roles:[l.UserView],redirectUrl:"/menu/dashboard"}},{path:"json-api",loadChildren:()=>import("./chunk-CLQGGKN6.js").then(e=>e.routes),canActivate:[g],data:{title:"Json API"}}]}],et=(()=>{let t=class t{};t.\u0275fac=function(a){return new(a||t)},t.\u0275mod=b({type:t}),t.\u0275inj=_({imports:[G.forChild(bt),G]});let e=t;return e})();var Ct=["selectId"];function vt(e,t){if(e&1&&(r(0,"span",3),p(1),s()),e&2){let i=t.item,n=m();f("title",i[n.bindLabel]),d(),y(i[n.bindLabel])}}var tt=(()=>{let t=class t{set items(n){this.ngSelectInfiniteScroll.data=n,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}get selected(){return this._selected}set selected(n){this._selected=n,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}constructor(){this.placeholder="",this.bindValue="",this.bindLabel="",this.width="100%",this.clearable=!0,this.parent="body",this.disabled=!1,this.optionTitle=!1,this._selected="",this.ngSelectInfiniteScroll=new J,this.selectedChange=new k,this.selectedLabel=new k,this.onOpen=new k}onOpenSelect(){this.onOpen.emit()}onSelectChange(n){n?(this.selectedChange.emit(n[this.bindValue]),this.selectedLabel.emit(n[this.bindLabel])):(this.selectedChange.emit(null),this.selectedLabel.emit(null))}};t.\u0275fac=function(a){return new(a||t)},t.\u0275cmp=v({type:t,selectors:[["ng-select-infinite"]],viewQuery:function(a,o){if(a&1&&ce(Ct,7),a&2){let h;me(h=pe())&&(o.ngSelectElement=h.first)}},inputs:{placeholder:"placeholder",bindValue:"bindValue",bindLabel:"bindLabel",width:"width",clearable:"clearable",parent:"parent",disabled:"disabled",optionTitle:"optionTitle",items:"items",selected:"selected"},outputs:{selectedChange:"selectedChange",selectedLabel:"selectedLabel",onOpen:"onOpen"},decls:3,vars:12,consts:[["selectId",""],[3,"clear","scrollToEnd","open","change","appendTo","disabled","virtualScroll","typeahead","items","bindLabel","bindValue","placeholder","ngModel","clearable"],["ng-option-tmp",""],[3,"title"]],template:function(a,o){if(a&1){let h=de();r(0,"ng-select",1,0),I("clear",function(){return M(h),x(o.ngSelectInfiniteScroll.onClear())})("scrollToEnd",function(){return M(h),x(o.ngSelectInfiniteScroll.onScrollToEnd())})("open",function(){return M(h),x(o.onOpenSelect())})("change",function(nt){return M(h),x(o.onSelectChange(nt))}),S(2,vt,2,2,"ng-template",2),s()}a&2&&(ge("width",o.width),f("appendTo",o.parent)("disabled",o.disabled)("virtualScroll",!0)("typeahead",o.ngSelectInfiniteScroll.input$)("items",o.ngSelectInfiniteScroll.bufferData)("bindLabel",o.bindLabel)("bindValue",o.bindValue)("placeholder",o.placeholder)("ngModel",o.selected)("clearable",o.clearable))},dependencies:[A,Pe,De,L,ye,Me],encapsulation:2});let e=t;return e})(),J=class{constructor(){this._dataBuffer=[],this._data=[],this._input$=new F,this._destroy$=new F,this._loading=!1,this._bufferSize=50,this.data=[]}onSearch(){this._input$.pipe(Z(200),K(),P(t=>(t&&(t=t.toLowerCase()),this.filterData(t))),Q(t=>t!==void 0),Y(this._destroy$)).subscribe(t=>{this._dataBuffer=t.slice(0,this._bufferSize)})}onClear(){this._dataBuffer=this._data.slice(0,this._bufferSize)}filterData(t){let i=-1,n;return this._data.filter(o=>(n=JSON.stringify(o).toLowerCase(),i=n.indexOf(t),i!==-1||t==null))}get input$(){return this._input$}get bufferData(){return this._dataBuffer}get loading(){return this._loading}set data(t){this._data=t||[],this._dataBuffer=this._data.slice(0,this._bufferSize),this.onSearch()}initSelectedValue(t,i){if(Ee.IsNotEmpty(t)){let n=this._data.filter(a=>a[i].toString().toLowerCase().indexOf(t)!==-1);this._dataBuffer=n.slice(0,this._bufferSize)}}set bufferSize(t){this._bufferSize=t}onScrollToEnd(){this.fetchMore()}fetchMore(){let t=this._dataBuffer.length,i=this._data.slice(t,this._bufferSize+t);this._loading=!0,setTimeout(()=>{this._loading=!1,this._dataBuffer=this._dataBuffer.concat(i)},200)}destroy(){this._destroy$.next(!0),this._destroy$.complete()}};var it=(()=>{let t=class t{};t.\u0275fac=function(a){return new(a||t)},t.\u0275mod=b({type:t}),t.\u0275inj=_({imports:[B,L,$e,We,Je,Ge,qe,Qe,N,q,tt,A,xe]});let e=t;return e})();var bn=(()=>{let t=class t{};t.\u0275fac=function(a){return new(a||t)},t.\u0275mod=b({type:t}),t.\u0275inj=_({providers:[ue],imports:[B,et,He,N,it,Ye,Ie.forChild()]});let e=t;return e})();export{bn as MenuModule};
@@ -1,2 +1,2 @@
1
- import{b as Ft}from"./chunk-E3EBAWLJ.js";import{a as It}from"./chunk-AFIF6VRM.js";import{a as be,b as pt,c as ut,d as ye,e as ve}from"./chunk-NSBKRFO7.js";import"./chunk-5X2E3W32.js";import{a as st,b as Ce,c as mt,d as ge,f as Ct,g as gt,h as Se,i as bt,o as oe}from"./chunk-ZW2TMVZP.js";import{b as vt}from"./chunk-2F4DTZCZ.js";import{a as _t}from"./chunk-36U7D4LI.js";import"./chunk-ZTHO6JJM.js";import"./chunk-SHUYFOQI.js";import{b as ht,d as Te}from"./chunk-FCEXPGTK.js";import{b as xt}from"./chunk-3WRXJBHF.js";import"./chunk-UH5C5HXK.js";import{a as Tt,b as St}from"./chunk-O2YF5VGD.js";import{a as yt}from"./chunk-63I3I3MX.js";import"./chunk-ZRTEGBXK.js";import{a as ft,b as xe}from"./chunk-QFSA7CU4.js";import"./chunk-OPXITNRF.js";import"./chunk-HPINZVE4.js";import"./chunk-D2J64VUP.js";import"./chunk-6Q6L5NUD.js";import"./chunk-C7N6EI73.js";import"./chunk-GPHNPV7O.js";import"./chunk-3RK6DDJD.js";import{a as he}from"./chunk-4YCSITNV.js";import{a as lt,b as dt,f as ct}from"./chunk-WHHW4IZT.js";import"./chunk-ZSUWHVKX.js";import"./chunk-N5AE5WMQ.js";import"./chunk-6OJQRHIZ.js";import{a as at}from"./chunk-FHER4TFY.js";import"./chunk-AAUBUT4Y.js";import{d as G,e as Y}from"./chunk-6KWG6O5L.js";import"./chunk-NWB7EVME.js";import"./chunk-AFDI4TD4.js";import"./chunk-4RG5YR7N.js";import"./chunk-5MV3UFJQ.js";import"./chunk-E6AMKEQR.js";import"./chunk-IGKMJFKP.js";import"./chunk-ITGVXYDV.js";import"./chunk-HK5FXZE4.js";import"./chunk-KJE5GRQ4.js";import"./chunk-4ILDFTIG.js";import"./chunk-A6QXXKPR.js";import"./chunk-Q4AWQ7IC.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-L7WZ6U4T.js";import"./chunk-LOWGZOML.js";import"./chunk-5PMKN6PM.js";import"./chunk-AGBJEXIM.js";import{b as tt,e as ie}from"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import{b as Ee,c as b}from"./chunk-JBEKD57G.js";import{m as nt,n as rt}from"./chunk-EDEZ3JLR.js";import{A as te,B as $,a as Je,c as ee,e as de,h as R,i as H,l as _e,m as qe,n as j,q as W,r as ze,s as X,t as Qe,u as Ze,v as et,z as K}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import"./chunk-ZETUYNFJ.js";import{v as it,w as ot}from"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{i as P,m as I}from"./chunk-LNJUGHOX.js";import{$ as Ge,$b as _,Ad as Ke,Gb as S,Hb as me,Hc as pe,Ic as Me,K as Re,M as $e,Mc as C,Na as N,Nc as Z,Oc as q,Qc as He,Rc as je,Sc as We,Wc as Xe,Z as Q,Zb as Ye,Zc as k,_c as ue,bc as h,ca as le,cc as U,ea as w,ec as L,f as ce,fc as B,g as Be,gc as p,hc as c,hd as F,ic as l,id as A,jc as f,ma as D,na as se,nb as s,qc as M,ra as u,sb as V,sd as fe,td as g,v as O,vc as T,xa as v,xc as d,ya as x}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var J=(function(e){return e[e.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",e[e.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",e[e.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",e[e.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",e[e.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",e})(J||{});var ne=(function(e){return e[e.FORMAT_NORMAL=1]="FORMAT_NORMAL",e[e.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",e})(ne||{});var re=(function(e){return e[e.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",e[e.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",e[e.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",e[e.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",e[e.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",e})(re||{});var De=class extends _e{setValue(o,n){if(o instanceof Date){let i=Math.floor(o.getTime()/1e3);super.setValue(i,n)}else super.setValue(o,n)}},Ne=(()=>{let o=class o{constructor(){this.shopeeUploadService=u(be),this.formBuilder=u(K)}getAttributes(i){return this.shopeeUploadService.getAttributes(i.channelId,i.categoryId).pipe(O(t=>this.setLabelToIndonesian(t)))}setLabelToIndonesian(i=[]){let t,a;return i=i.map(r=>(t=r?.multi_lang?.find(m=>m.language=="id"),r.attribute_value_list=r?.attribute_value_list?.map(m=>(a=m?.multi_lang?.find(y=>y.language=="id"),m.name=a?.value,m)),r.name=t?.value?t?.value:r.name,r)),i}createFormGroup(i){let t=this.formBuilder.group({}),a=[];return i.forEach(r=>{if(a=[],r.mandatory&&a.push(de.required),r?.attribute_info?.format_type==ne.FORMAT_QUANTITATIVE_WITH_UNIT&&r?.attribute_info?.input_type==J.FREE_TEXT_FILED){let m=this.formBuilder.group({unit:new _e(null),value:new _e(null,a)});t.addControl(JSON.stringify(r.attribute_id),m)}else r?.attribute_info?.input_type==J.FREE_TEXT_FILED&&r?.attribute_info?.input_validation_type==re.VALIDATOR_DATE_TYPE?t.addControl(JSON.stringify(r.attribute_id),new De(null,a)):t.addControl(JSON.stringify(r.attribute_id),this.formBuilder.control(null,a))}),t}getFilteredAttributes(i,t){let a=JSON.parse(JSON.stringify(i)),r=Object.keys(t),m=a.filter(y=>r.findIndex(Pe=>parseInt(Pe)==y.attribute_id||y.mandatory)!=-1);return m=this.filterSelectedAttributes(m,t),m}filterSelectedAttributes(i,t){return i.map(r=>{switch(r.attribute_info.input_type){case J.MULTI_COMBO_BOX:b.IsNotEmpty(t[r.attribute_id])?r.attribute_value_list=r.attribute_value_list.filter(m=>t[r.attribute_id]?.findIndex(y=>y==m.value_id)!=-1):r.attribute_value_list=[];break;case J.FREE_TEXT_FILED:r.attribute_info.format_type==ne.FORMAT_QUANTITATIVE_WITH_UNIT?r.attribute_value_list=this.setSelectedQuantitativeAttr(t[r.attribute_id]?.value,t[r.attribute_id]?.unit):r.attribute_info.input_validation_type==re.VALIDATOR_DATE_TYPE?r.attribute_value_list=this.setSelectedDateAttr(t[r.attribute_id]):r.attribute_value_list=this.setSelectedQuantitativeAttr(t[r.attribute_id]);break;default:r.attribute_value_list=r.attribute_value_list.filter(m=>m.value_id==t[r.attribute_id])}return r}).filter(r=>r?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(i,t){let a=[];if(b.IsNotEmpty(i)){let r={value_id:0,original_value_name:JSON.stringify(i)};b.IsNotEmpty(t)&&(r.value_unit=t),a=[r]}return a}setSelectedDateAttr(i){let t=[];return b.IsNotEmpty(i)&&(t=[{value_id:0,original_value_name:JSON.stringify(i)}]),t}};o.\u0275fac=function(t){return new(t||o)},o.\u0275prov=D({token:o,factory:o.\u0275fac});let e=o;return e})();var Ie=(()=>{let o=class o{constructor(){this._calendarHeaderConfig=new Be({hideBtnClear:!1,hideBtnToday:!1}),this.calendarConfig=this._calendarHeaderConfig.value}setHeaderConfig(i){this._calendarHeaderConfig.next(i)}getHeaderConfig$(){return this._calendarHeaderConfig.asObservable()}};o.\u0275fac=function(t){return new(t||o)},o.\u0275prov=D({token:o,factory:o.\u0275fac,providedIn:"root"});let e=o;return e})();var Ut=["class","component ts"];function Lt(e,o){if(e&1){let n=M();c(0,"button",2),T("click",function(){v(n);let t=d(2);return x(t.todayClicked())}),f(1,"i",3),l()}}function Bt(e,o){if(e&1){let n=M();c(0,"button",4),T("click",function(){v(n);let t=d(2);return x(t.clearClicked())}),f(1,"i",5),l()}}function Rt(e,o){if(e&1&&(_(0,Lt,2,0,"button",0),_(1,Bt,2,0,"button",1)),e&2){let n=o;h(n.hideBtnToday?-1:0),s(),h(n.hideBtnClear?-1:1)}}var At=(()=>{let o=class o{constructor(){this._datePicker=u(Se),this._calendar=u(gt),this._dateAdapter=u(Ce),this.calendarService=u(Ie),this._destroyed=new ce;let i=this._calendar,t=u(Ke);i.stateChanges.pipe(le(this._destroyed)).subscribe(a=>t.markForCheck()),this.calendarConfig$=this.calendarService.getHeaderConfig$()}todayClicked(){this._calendar.activeDate=this._dateAdapter.today(),this._datePicker.select(this._dateAdapter.today()),this._datePicker.close()}clearClicked(){this._datePicker.select(null),this._datePicker.close()}ngOnChanges(i){this._calendar.ngOnChanges(i)}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=S({type:o,selectors:[["POS-DatepickerHeader",8,"component","ts"]],standalone:!1,features:[N],attrs:Ut,decls:3,vars:3,consts:[["mat-icon-button","","title","Today"],["mat-icon-button","","title","Clear"],["mat-icon-button","","title","Today",3,"click"],[1,"far","fa-clock",2,"font-size","18px"],["mat-icon-button","","title","Clear",3,"click"],[1,"far","fa-xmark-circle",2,"font-size","18px"]],template:function(t,a){if(t&1&&(c(0,"mat-calendar-header"),_(1,Rt,2,2),F(2,"async"),l()),t&2){let r;s(),h((r=A(2,1,a.calendarConfig$))?1:-1,r)}},dependencies:[ht,Ct,P],encapsulation:2});let e=o;return e})(),kt=(()=>{let o=class o{};o.\u0275fac=function(t){return new(t||o)},o.\u0275mod=me({type:o}),o.\u0275inj=se({providers:[oe],imports:[I,Te,ge,oe,he,xe]});let e=o;return e})();function $t(e,o){if(e&1&&(c(0,"mat-label",2)(1,"span"),C(2),l()()),e&2){let n=d();p("show",n.placeholder),s(2),Z(n.placeholder)}}var Gt={parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"dddd, D MMMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"dddd, D MMMM YYYY",monthYearA11yLabel:"MMMM YYYY"}},Pt=(()=>{let o=class o{set hidelClearBtn(i){this.calendarService.setHeaderConfig({hideBtnClear:i,hideBtnToday:this.calendarService.calendarConfig.hideBtnToday})}change(i){let t=null;i&&(t=i.toDate(),t.setHours(0,0,0,0)),this.onChange(t),this.dateChange.emit(t)}constructor(){this.calendarService=u(Ie),this.headerComponent=At,this.data_cy=g(void 0),this.appearance=g("outline"),this.width=g(void 0),this.isFloatingLabel=g(!0),this.disabled=!1,this.readOnly=g(!1),this.minDateValidation=g(void 0),this.maxDateValidation=g(void 0),this.dateChange=fe(),this.minDate=b.MinDate,this.onChange=i=>{},this.displayToggle=!0}writeValue(i){this.date=i}registerOnChange(i){this.onChange=i}registerOnTouched(i){}setDisabledState(i){this.disabled=i}onOpenDatepicker(){let i=document.getElementById("dropdown-filter");if(i){var t=new bootstrap.Dropdown(i);t&&(t._config.autoClose="inside")}}onCloseDatepicker(){let i=document.getElementById("dropdown-filter");if(i){var t=new bootstrap.Dropdown(i);t&&(t._config.autoClose="outside")}}ngOnDestroy(){this.calendarService.setHeaderConfig({hideBtnClear:!1,hideBtnToday:!1})}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=S({type:o,selectors:[["datepicker"]],inputs:{data_cy:[1,"data_cy"],placeholder:"placeholder",displayToggle:"displayToggle",appearance:[1,"appearance"],width:[1,"width"],isFloatingLabel:[1,"isFloatingLabel"],date:"date",disabled:"disabled",readOnly:[1,"readOnly"],minDateValidation:[1,"minDateValidation"],maxDateValidation:[1,"maxDateValidation"],hidelClearBtn:"hidelClearBtn"},outputs:{dateChange:"dateChange"},standalone:!1,features:[k([{provide:Ce,useClass:It,deps:[st]},{provide:mt,useValue:Gt},{provide:Je,multi:!0,useExisting:o}])],decls:7,vars:17,consts:[["picker1",""],[1,"datepicker",3,"disabled","appearance"],[3,"show"],["matInput","",3,"dateChange","click","matDatepicker","min","max","placeholder","value","disabled","readonly"],["matSuffix","","aria-hidden","true",1,"datepicker-toggle-icon",3,"click"],[1,"fa-regular","fa-angle-down"],[3,"opened","closed","calendarHeaderComponent"]],template:function(t,a){if(t&1){let r=M();c(0,"mat-form-field",1),_(1,$t,3,2,"mat-label",2),c(2,"input",3),T("dateChange",function(y){return v(r),x(a.change(y.value))})("click",function(){v(r);let y=pe(6);return x(y.open())}),l(),c(3,"span",4),T("click",function(){v(r);let y=pe(6);return x(y.open())}),f(4,"i",5),l(),c(5,"mat-datepicker",6,0),T("opened",function(){return v(r),x(a.onOpenDatepicker())})("closed",function(){return v(r),x(a.onCloseDatepicker())}),l()()}if(t&2){let r=pe(6);Me("width",a.width()||100,"%"),p("disabled",a.disabled)("appearance",a.appearance()),s(),h(a.isFloatingLabel()&&a.placeholder?1:-1),s(),p("placeholder",Xe(a.placeholder||""))("matDatepicker",r)("min",a.minDateValidation())("max",a.maxDateValidation())("value",a.date==a.minDate?null:a.date)("disabled",a.disabled)("readonly",a.readOnly()),Ye("data-cy",a.data_cy()),s(),Me("display",a.displayToggle?"unset":"none"),s(2),p("calendarHeaderComponent",a.headerComponent)}},dependencies:[Se,bt,ct,lt,dt,ft],styles:[`.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:3px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{top:28px!important;font-size:16px;color:#9da2a6}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:23px!important;font-size:.875rem;color:#ccc}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}.datepicker .datepicker-toggle-icon{width:28px;height:36px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;margin-right:6px}.datepicker .datepicker-toggle-icon i{font-family:"Font Awesome 6 Pro","Font Awesome 6 Free","Font Awesome 5 Pro","Font Awesome 5 Free";font-weight:400;font-size:16px;line-height:1;color:#6b7280}
1
+ import{b as Ft}from"./chunk-E3EBAWLJ.js";import{a as It}from"./chunk-AFIF6VRM.js";import{a as be,b as pt,c as ut,d as ye,e as ve}from"./chunk-M65Z55OS.js";import"./chunk-5X2E3W32.js";import{a as st,b as Ce,c as mt,d as ge,f as Ct,g as gt,h as Se,i as bt,o as oe}from"./chunk-ZW2TMVZP.js";import{b as vt}from"./chunk-2F4DTZCZ.js";import{a as _t}from"./chunk-36U7D4LI.js";import"./chunk-ZTHO6JJM.js";import"./chunk-SHUYFOQI.js";import{b as ht,d as Te}from"./chunk-FCEXPGTK.js";import{b as xt}from"./chunk-3WRXJBHF.js";import"./chunk-UH5C5HXK.js";import{a as Tt,b as St}from"./chunk-O2YF5VGD.js";import{a as yt}from"./chunk-63I3I3MX.js";import"./chunk-2IASUYTM.js";import{a as ft,b as xe}from"./chunk-QFSA7CU4.js";import"./chunk-OPXITNRF.js";import"./chunk-HPINZVE4.js";import"./chunk-D2J64VUP.js";import"./chunk-6Q6L5NUD.js";import"./chunk-C7N6EI73.js";import"./chunk-GPHNPV7O.js";import"./chunk-3RK6DDJD.js";import{a as he}from"./chunk-4YCSITNV.js";import{a as lt,b as dt,f as ct}from"./chunk-WHHW4IZT.js";import"./chunk-ZSUWHVKX.js";import"./chunk-N5AE5WMQ.js";import"./chunk-6OJQRHIZ.js";import{a as at}from"./chunk-FHER4TFY.js";import"./chunk-6OIMOM7S.js";import{d as G,e as Y}from"./chunk-6KWG6O5L.js";import"./chunk-NWB7EVME.js";import"./chunk-AFDI4TD4.js";import"./chunk-4RG5YR7N.js";import"./chunk-5MV3UFJQ.js";import"./chunk-E6AMKEQR.js";import"./chunk-IGKMJFKP.js";import"./chunk-ITGVXYDV.js";import"./chunk-HK5FXZE4.js";import"./chunk-KJE5GRQ4.js";import"./chunk-4ILDFTIG.js";import"./chunk-A6QXXKPR.js";import"./chunk-I723PUUO.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-L7WZ6U4T.js";import"./chunk-LOWGZOML.js";import"./chunk-5PMKN6PM.js";import"./chunk-AGBJEXIM.js";import{b as tt,e as ie}from"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import{b as Ee,c as b}from"./chunk-JBEKD57G.js";import{m as nt,n as rt}from"./chunk-EDEZ3JLR.js";import{A as te,B as $,a as Je,c as ee,e as de,h as R,i as H,l as _e,m as qe,n as j,q as W,r as ze,s as X,t as Qe,u as Ze,v as et,z as K}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import"./chunk-ZETUYNFJ.js";import{v as it,w as ot}from"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{i as P,m as I}from"./chunk-LNJUGHOX.js";import{$ as Ge,$b as _,Ad as Ke,Gb as S,Hb as me,Hc as pe,Ic as Me,K as Re,M as $e,Mc as C,Na as N,Nc as Z,Oc as q,Qc as He,Rc as je,Sc as We,Wc as Xe,Z as Q,Zb as Ye,Zc as k,_c as ue,bc as h,ca as le,cc as U,ea as w,ec as L,f as ce,fc as B,g as Be,gc as p,hc as c,hd as F,ic as l,id as A,jc as f,ma as D,na as se,nb as s,qc as M,ra as u,sb as V,sd as fe,td as g,v as O,vc as T,xa as v,xc as d,ya as x}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var J=(function(e){return e[e.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",e[e.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",e[e.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",e[e.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",e[e.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",e})(J||{});var ne=(function(e){return e[e.FORMAT_NORMAL=1]="FORMAT_NORMAL",e[e.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",e})(ne||{});var re=(function(e){return e[e.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",e[e.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",e[e.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",e[e.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",e[e.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",e})(re||{});var De=class extends _e{setValue(o,n){if(o instanceof Date){let i=Math.floor(o.getTime()/1e3);super.setValue(i,n)}else super.setValue(o,n)}},Ne=(()=>{let o=class o{constructor(){this.shopeeUploadService=u(be),this.formBuilder=u(K)}getAttributes(i){return this.shopeeUploadService.getAttributes(i.channelId,i.categoryId).pipe(O(t=>this.setLabelToIndonesian(t)))}setLabelToIndonesian(i=[]){let t,a;return i=i.map(r=>(t=r?.multi_lang?.find(m=>m.language=="id"),r.attribute_value_list=r?.attribute_value_list?.map(m=>(a=m?.multi_lang?.find(y=>y.language=="id"),m.name=a?.value,m)),r.name=t?.value?t?.value:r.name,r)),i}createFormGroup(i){let t=this.formBuilder.group({}),a=[];return i.forEach(r=>{if(a=[],r.mandatory&&a.push(de.required),r?.attribute_info?.format_type==ne.FORMAT_QUANTITATIVE_WITH_UNIT&&r?.attribute_info?.input_type==J.FREE_TEXT_FILED){let m=this.formBuilder.group({unit:new _e(null),value:new _e(null,a)});t.addControl(JSON.stringify(r.attribute_id),m)}else r?.attribute_info?.input_type==J.FREE_TEXT_FILED&&r?.attribute_info?.input_validation_type==re.VALIDATOR_DATE_TYPE?t.addControl(JSON.stringify(r.attribute_id),new De(null,a)):t.addControl(JSON.stringify(r.attribute_id),this.formBuilder.control(null,a))}),t}getFilteredAttributes(i,t){let a=JSON.parse(JSON.stringify(i)),r=Object.keys(t),m=a.filter(y=>r.findIndex(Pe=>parseInt(Pe)==y.attribute_id||y.mandatory)!=-1);return m=this.filterSelectedAttributes(m,t),m}filterSelectedAttributes(i,t){return i.map(r=>{switch(r.attribute_info.input_type){case J.MULTI_COMBO_BOX:b.IsNotEmpty(t[r.attribute_id])?r.attribute_value_list=r.attribute_value_list.filter(m=>t[r.attribute_id]?.findIndex(y=>y==m.value_id)!=-1):r.attribute_value_list=[];break;case J.FREE_TEXT_FILED:r.attribute_info.format_type==ne.FORMAT_QUANTITATIVE_WITH_UNIT?r.attribute_value_list=this.setSelectedQuantitativeAttr(t[r.attribute_id]?.value,t[r.attribute_id]?.unit):r.attribute_info.input_validation_type==re.VALIDATOR_DATE_TYPE?r.attribute_value_list=this.setSelectedDateAttr(t[r.attribute_id]):r.attribute_value_list=this.setSelectedQuantitativeAttr(t[r.attribute_id]);break;default:r.attribute_value_list=r.attribute_value_list.filter(m=>m.value_id==t[r.attribute_id])}return r}).filter(r=>r?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(i,t){let a=[];if(b.IsNotEmpty(i)){let r={value_id:0,original_value_name:JSON.stringify(i)};b.IsNotEmpty(t)&&(r.value_unit=t),a=[r]}return a}setSelectedDateAttr(i){let t=[];return b.IsNotEmpty(i)&&(t=[{value_id:0,original_value_name:JSON.stringify(i)}]),t}};o.\u0275fac=function(t){return new(t||o)},o.\u0275prov=D({token:o,factory:o.\u0275fac});let e=o;return e})();var Ie=(()=>{let o=class o{constructor(){this._calendarHeaderConfig=new Be({hideBtnClear:!1,hideBtnToday:!1}),this.calendarConfig=this._calendarHeaderConfig.value}setHeaderConfig(i){this._calendarHeaderConfig.next(i)}getHeaderConfig$(){return this._calendarHeaderConfig.asObservable()}};o.\u0275fac=function(t){return new(t||o)},o.\u0275prov=D({token:o,factory:o.\u0275fac,providedIn:"root"});let e=o;return e})();var Ut=["class","component ts"];function Lt(e,o){if(e&1){let n=M();c(0,"button",2),T("click",function(){v(n);let t=d(2);return x(t.todayClicked())}),f(1,"i",3),l()}}function Bt(e,o){if(e&1){let n=M();c(0,"button",4),T("click",function(){v(n);let t=d(2);return x(t.clearClicked())}),f(1,"i",5),l()}}function Rt(e,o){if(e&1&&(_(0,Lt,2,0,"button",0),_(1,Bt,2,0,"button",1)),e&2){let n=o;h(n.hideBtnToday?-1:0),s(),h(n.hideBtnClear?-1:1)}}var At=(()=>{let o=class o{constructor(){this._datePicker=u(Se),this._calendar=u(gt),this._dateAdapter=u(Ce),this.calendarService=u(Ie),this._destroyed=new ce;let i=this._calendar,t=u(Ke);i.stateChanges.pipe(le(this._destroyed)).subscribe(a=>t.markForCheck()),this.calendarConfig$=this.calendarService.getHeaderConfig$()}todayClicked(){this._calendar.activeDate=this._dateAdapter.today(),this._datePicker.select(this._dateAdapter.today()),this._datePicker.close()}clearClicked(){this._datePicker.select(null),this._datePicker.close()}ngOnChanges(i){this._calendar.ngOnChanges(i)}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=S({type:o,selectors:[["POS-DatepickerHeader",8,"component","ts"]],standalone:!1,features:[N],attrs:Ut,decls:3,vars:3,consts:[["mat-icon-button","","title","Today"],["mat-icon-button","","title","Clear"],["mat-icon-button","","title","Today",3,"click"],[1,"far","fa-clock",2,"font-size","18px"],["mat-icon-button","","title","Clear",3,"click"],[1,"far","fa-xmark-circle",2,"font-size","18px"]],template:function(t,a){if(t&1&&(c(0,"mat-calendar-header"),_(1,Rt,2,2),F(2,"async"),l()),t&2){let r;s(),h((r=A(2,1,a.calendarConfig$))?1:-1,r)}},dependencies:[ht,Ct,P],encapsulation:2});let e=o;return e})(),kt=(()=>{let o=class o{};o.\u0275fac=function(t){return new(t||o)},o.\u0275mod=me({type:o}),o.\u0275inj=se({providers:[oe],imports:[I,Te,ge,oe,he,xe]});let e=o;return e})();function $t(e,o){if(e&1&&(c(0,"mat-label",2)(1,"span"),C(2),l()()),e&2){let n=d();p("show",n.placeholder),s(2),Z(n.placeholder)}}var Gt={parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"dddd, D MMMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"dddd, D MMMM YYYY",monthYearA11yLabel:"MMMM YYYY"}},Pt=(()=>{let o=class o{set hidelClearBtn(i){this.calendarService.setHeaderConfig({hideBtnClear:i,hideBtnToday:this.calendarService.calendarConfig.hideBtnToday})}change(i){let t=null;i&&(t=i.toDate(),t.setHours(0,0,0,0)),this.onChange(t),this.dateChange.emit(t)}constructor(){this.calendarService=u(Ie),this.headerComponent=At,this.data_cy=g(void 0),this.appearance=g("outline"),this.width=g(void 0),this.isFloatingLabel=g(!0),this.disabled=!1,this.readOnly=g(!1),this.minDateValidation=g(void 0),this.maxDateValidation=g(void 0),this.dateChange=fe(),this.minDate=b.MinDate,this.onChange=i=>{},this.displayToggle=!0}writeValue(i){this.date=i}registerOnChange(i){this.onChange=i}registerOnTouched(i){}setDisabledState(i){this.disabled=i}onOpenDatepicker(){let i=document.getElementById("dropdown-filter");if(i){var t=new bootstrap.Dropdown(i);t&&(t._config.autoClose="inside")}}onCloseDatepicker(){let i=document.getElementById("dropdown-filter");if(i){var t=new bootstrap.Dropdown(i);t&&(t._config.autoClose="outside")}}ngOnDestroy(){this.calendarService.setHeaderConfig({hideBtnClear:!1,hideBtnToday:!1})}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=S({type:o,selectors:[["datepicker"]],inputs:{data_cy:[1,"data_cy"],placeholder:"placeholder",displayToggle:"displayToggle",appearance:[1,"appearance"],width:[1,"width"],isFloatingLabel:[1,"isFloatingLabel"],date:"date",disabled:"disabled",readOnly:[1,"readOnly"],minDateValidation:[1,"minDateValidation"],maxDateValidation:[1,"maxDateValidation"],hidelClearBtn:"hidelClearBtn"},outputs:{dateChange:"dateChange"},standalone:!1,features:[k([{provide:Ce,useClass:It,deps:[st]},{provide:mt,useValue:Gt},{provide:Je,multi:!0,useExisting:o}])],decls:7,vars:17,consts:[["picker1",""],[1,"datepicker",3,"disabled","appearance"],[3,"show"],["matInput","",3,"dateChange","click","matDatepicker","min","max","placeholder","value","disabled","readonly"],["matSuffix","","aria-hidden","true",1,"datepicker-toggle-icon",3,"click"],[1,"fa-regular","fa-angle-down"],[3,"opened","closed","calendarHeaderComponent"]],template:function(t,a){if(t&1){let r=M();c(0,"mat-form-field",1),_(1,$t,3,2,"mat-label",2),c(2,"input",3),T("dateChange",function(y){return v(r),x(a.change(y.value))})("click",function(){v(r);let y=pe(6);return x(y.open())}),l(),c(3,"span",4),T("click",function(){v(r);let y=pe(6);return x(y.open())}),f(4,"i",5),l(),c(5,"mat-datepicker",6,0),T("opened",function(){return v(r),x(a.onOpenDatepicker())})("closed",function(){return v(r),x(a.onCloseDatepicker())}),l()()}if(t&2){let r=pe(6);Me("width",a.width()||100,"%"),p("disabled",a.disabled)("appearance",a.appearance()),s(),h(a.isFloatingLabel()&&a.placeholder?1:-1),s(),p("placeholder",Xe(a.placeholder||""))("matDatepicker",r)("min",a.minDateValidation())("max",a.maxDateValidation())("value",a.date==a.minDate?null:a.date)("disabled",a.disabled)("readonly",a.readOnly()),Ye("data-cy",a.data_cy()),s(),Me("display",a.displayToggle?"unset":"none"),s(2),p("calendarHeaderComponent",a.headerComponent)}},dependencies:[Se,bt,ct,lt,dt,ft],styles:[`.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:3px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{top:28px!important;font-size:16px;color:#9da2a6}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:23px!important;font-size:.875rem;color:#ccc}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}.datepicker .datepicker-toggle-icon{width:28px;height:36px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;margin-right:6px}.datepicker .datepicker-toggle-icon i{font-family:"Font Awesome 6 Pro","Font Awesome 6 Free","Font Awesome 5 Pro","Font Awesome 5 Free";font-weight:400;font-size:16px;line-height:1;color:#6b7280}
2
2
  `],encapsulation:2});let e=o;return e})(),Mt=(()=>{let o=class o{};o.\u0275fac=function(t){return new(t||o)},o.\u0275mod=me({type:o}),o.\u0275inj=se({providers:[oe],imports:[I,Te,ge,oe,he,xe,kt,vt]});let e=o;return e})();var Oe=()=>[];function Ht(e,o){e&1&&(c(0,"span",4),C(1,"*"),l())}function jt(e,o){if(e&1&&f(0,"ng-select",5),e&2){let n=d().$implicit;p("multiple",!0)("formControlName",n.attribute_id)("items",n.attribute_value_list?n.attribute_value_list:ue(4,Oe))("placeholder","Pilih "+(n==null?null:n.name))}}function Wt(e,o){if(e&1&&f(0,"input",7),e&2){let n=d(2).$implicit;p("formControlName",n.attribute_id)("placeholder","Isi "+(n==null?null:n.name))}}function Xt(e,o){if(e&1&&(c(0,"option",14),C(1),l()),e&2){let n=o.$implicit;p("value",n),s(),Z(n)}}function Kt(e,o){if(e&1&&(c(0,"div",9),f(1,"input",11),c(2,"select",12)(3,"option",13),C(4,"Unit"),l(),L(5,Xt,2,2,"option",14,U),l()()),e&2){let n=d(3).$implicit;p("formGroupName",n.attribute_id),s(),p("placeholder","Isi "+(n==null?null:n.name)),s(2),p("value",null),s(2),B(n==null||n.attribute_info==null?null:n.attribute_info.attribute_unit_list)}}function Jt(e,o){if(e&1&&f(0,"input",10),e&2){let n=d(3).$implicit;p("formControlName",n.attribute_id)("placeholder","Isi "+(n==null?null:n.name))}}function qt(e,o){if(e&1&&_(0,Kt,7,3,"div",9)(1,Jt,1,2,"input",10),e&2){let n=d(2).$implicit,i=d(2);h((n==null||n.attribute_info==null?null:n.attribute_info.format_type)==i.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function zt(e,o){if(e&1&&f(0,"datepicker",8),e&2){let n=d(2).$implicit;p("formControlName",n.attribute_id)}}function Qt(e,o){if(e&1&&_(0,Wt,1,2,"input",7)(1,qt,2,1)(2,zt,1,1,"datepicker",8),e&2){let n,i=d().$implicit,t=d(2);h((n=i==null||i.attribute_info==null?null:i.attribute_info.input_validation_type)===t.validationType.VALIDATOR_STRING_TYPE?0:n===t.validationType.VALIDATOR_FLOAT_TYPE?1:n===t.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function Zt(e,o){if(e&1&&f(0,"ng-select",6),e&2){let n=d().$implicit;p("formControlName",n.attribute_id)("items",n.attribute_value_list?n.attribute_value_list:ue(3,Oe))("placeholder","Pilih "+(n==null?null:n.name))}}function ei(e,o){if(e&1&&f(0,"ng-select",6),e&2){let n=d().$implicit;p("formControlName",n.attribute_id)("items",n.attribute_value_list?n.attribute_value_list:ue(3,Oe))("placeholder","Pilih "+(n==null?null:n.name))}}function ti(e,o){if(e&1&&(c(0,"div",2)(1,"div",3),_(2,Ht,2,0,"span",4),c(3,"span"),C(4),l()(),_(5,jt,1,5,"ng-select",5)(6,Qt,3,1)(7,Zt,1,4,"ng-select",6)(8,ei,1,4,"ng-select",6),l()),e&2){let n,i=o.$implicit,t=d(2);s(2),h(i.mandatory?2:-1),s(2),q(" ",i==null?null:i.name," "),s(),h((n=i==null||i.attribute_info==null?null:i.attribute_info.input_type)===t.inputType.MULTI_COMBO_BOX?5:n===t.inputType.FREE_TEXT_FILED?6:n===t.inputType.SINGLE_COMBO_BOX?7:8)}}function ii(e,o){if(e&1&&(c(0,"form",0)(1,"div",1),L(2,ti,9,3,"div",2,U),l()()),e&2){let n=d();p("formGroup",n.form),s(2),B(o)}}var Et=(()=>{let o=class o{constructor(){this.formCategoryService=u(Ne),this.channelType=g(void 0),this.categoryId=g(void 0),this.channelId=g(void 0),this.channelProductUpload=g(void 0),this.attributesChanges=new V,this.inputType=J,this.formatType=ne,this.validationType=re}ngOnChanges(){let i=this.categoryId(),t=this.channelId();b.IsNotEmpty(i)&&b.IsNotEmpty(t)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:i,channelId:t,channelType:this.channelType()}).pipe(w(a=>{this.form=this.formCategoryService.createFormGroup(a),this.listenToFormChange(a)}),Q(1)))}listenToFormChange(i){let t=[];this.formSubscription=this.form.valueChanges.subscribe(a=>{t=this.formCategoryService.getFilteredAttributes(i,a),this.attributesChanges.emit(t)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=S({type:o,selectors:[["shopee-attribute-form"]],inputs:{channelType:[1,"channelType"],categoryId:[1,"categoryId"],channelId:[1,"channelId"],channelProductUpload:[1,"channelProductUpload"]},outputs:{attributesChanges:"attributesChanges"},features:[k([Ne]),N],decls:2,vars:3,consts:[[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","value_id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","value_id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"],[1,"attribute-datepicker",3,"formControlName"],[1,"d-flex","align-items-center",3,"formGroupName"],["type","text","autoNum","",1,"form-control",3,"formControlName","placeholder"],["formControlName","value","type","text","autoNum","",1,"form-control","me-1",2,"width","200px",3,"placeholder"],["name","unit","id","unit","formControlName","unit",1,"form-control"],["disabled","","selected","",3,"value"],[3,"value"]],template:function(t,a){if(t&1&&(_(0,ii,4,1,"form",0),F(1,"async")),t&2){let r;h((r=A(1,1,a.attributes$))?0:-1,r)}},dependencies:[I,Y,G,$,j,Ze,et,ee,Qe,R,H,W,X,ze,yt,Mt,Pt,P],styles:["input[_ngcontent-%COMP%], select[_ngcontent-%COMP%]{height:36px;border-radius:4px} datepicker.attribute-datepicker>mat-form-field.mat-mdc-form-field>.mat-mdc-text-field-wrapper{height:36px} datepicker.attribute-datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{padding-top:11px!important;padding-bottom:11px!important;height:36px;min-height:36px!important} datepicker.attribute-datepicker mat-datepicker-toggle>button.mat-mdc-icon-button.mat-mdc-button-base{--mat-icon-button-state-layer-size: 36px}"]});let e=o;return e})();var z=(function(e){return e.TIKTOK_SHOP="TIKTOK_SHOP",e.TOKOPEDIA="TOKOPEDIA",e})(z||{});var we=(()=>{let o=class o{constructor(){this.httpService=u(ie),this.formBuilder=u(K),this.uploadProductService=u(ve)}getAttributes(i,t){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:i},{key:"CategoryID",value:t}]).pipe(Re(r=>this.uploadProductService.selectedProduct$.pipe(O(m=>(r=this.mappingAttributeSalesProperty(r,m),r)))))}mappingAttributeSalesProperty(i,t){let a=0;return i.filter(r=>(r.type=="SALES_PROPERTY"&&(a+=1),a>1?(a=0,!1):!0)).map(r=>(r.type=="SALES_PROPERTY"&&(r.name="Jenis Variant",r.is_multiple_selection=!1,r.is_required=this.isProductHasMoreVariant(t),r.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),r))}isProductHasMoreVariant(i){let t=!1,a=[];return i.forEach(r=>{r.Variants&&a.push(r.Variants.length)}),t=a.some(r=>r>1),t}createFormGroup(i){let t=this.formBuilder.group({}),a=[];return i.forEach(r=>{a=[],r.is_required&&a.push(de.required),t.addControl(r.id,this.formBuilder.control(null,a))}),t.addControl("listingPlatform",this.formBuilder.control([z.TIKTOK_SHOP,z.TOKOPEDIA],[de.required])),t}getFilteredAttributes(i,t){let a=JSON.parse(JSON.stringify(i)),r=Object.keys(t),m=a.filter(y=>r.findIndex(Pe=>parseInt(Pe)==y.id)!=-1);return m=this.filterSelectedAttributes(m,t),m}filterSelectedAttributes(i,t){return i.map(r=>(b.IsNotEmpty(r.values)?r.is_multiple_selection?r.values=r.values.filter(m=>t[r.id]?.includes(m.id)):r.values=r.values.filter(m=>m.id==t[r.id]):t[r.id]&&(r.values=[{id:null,name:t[r.id]}]),r)).filter(r=>r?.values?.length>0)}};o.\u0275fac=function(t){return new(t||o)},o.\u0275prov=D({token:o,factory:o.\u0275fac});let e=o;return e})();function oi(e,o){e&1&&(c(0,"small",5),C(1," Platform is required "),l())}function ni(e,o){e&1&&(c(0,"span",5),C(1,"*"),l())}function ri(e,o){if(e&1&&f(0,"ng-select",6),e&2){let n=d().$implicit;p("multiple",!0)("formControlName",n.id)("items",n.values)("placeholder","Pilih "+(n==null?null:n.name))}}function ai(e,o){if(e&1&&f(0,"ng-select",7),e&2){let n=d().$implicit;p("formControlName",n.id)("items",n.values)("placeholder","Pilih "+(n==null?null:n.name))}}function li(e,o){if(e&1&&f(0,"input",8),e&2){let n=d().$implicit;p("formControlName",n.id)("placeholder",n==null?null:n.name)}}function di(e,o){if(e&1&&(c(0,"small",5),C(1),l()),e&2){let n=d().$implicit;s(),q(" ",n==null?null:n.name," is mandatory ")}}function ci(e,o){if(e&1&&(c(0,"div",2)(1,"div",3),_(2,ni,2,0,"span",5),c(3,"span"),C(4),l()(),_(5,ri,1,4,"ng-select",6)(6,ai,1,3,"ng-select",7)(7,li,1,2,"input",8),_(8,di,2,1,"small",5),l()),e&2){let n=o.$implicit;s(2),h(n.is_required?2:-1),s(2),q(" ",n==null?null:n.name," "),s(),h(n.is_multiple_selection?5:n.values!==null&&n.values.length>0?6:7),s(3),h(n.is_required?8:-1)}}function si(e,o){if(e&1&&(c(0,"form",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"span"),C(5," Platform Options"),l()(),f(6,"ng-select",4),_(7,oi,2,0,"small",5),l(),L(8,ci,9,4,"div",2,U),l()()),e&2){let n,i=d();p("formGroup",i.form),s(6),p("multiple",!0)("items",i.platformOptions)("clearable",!1),s(),h(!(i.form==null||(n=i.form.get("listingPlatform").errors)==null)&&n.required?7:-1),s(),B(o)}}var Dt=(()=>{let o=class o{constructor(){this.tiktokAttributeFormService=u(we),this.channelId=g(void 0),this.categoryId=g(void 0),this.platformChange=fe({alias:"onPlatformChanges"}),this.formSubscription=new ce,this.attributesChanges=new V,this.platformOptions=[{label:"TikTok Shop",value:z.TIKTOK_SHOP},{label:"Tokopedia",value:z.TOKOPEDIA}]}ngOnChanges(){let i=this.categoryId(),t=this.channelId();b.IsNotEmpty(i)&&b.IsNotEmpty(t)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(t,i).pipe(O(a=>a.filter(r=>!(r.type=="PRODUCT_PROPERTY"&&(b.IsEmpty(r.values)||r.values?.length==0)&&r.is_customizable==!1))),w(a=>{this.form=this.tiktokAttributeFormService.createFormGroup(a),this.listenToFormChange(a)}),Q(1)))}listenToFormChange(i){let t=[];this.form.valueChanges.pipe(le(this.formSubscription)).subscribe(a=>{delete a.listingPlatform,t=this.tiktokAttributeFormService.getFilteredAttributes(i,a),this.attributesChanges.emit(t)}),this.form.get("listingPlatform").valueChanges.pipe(Ge(this.form.get("listingPlatform").value),le(this.formSubscription)).subscribe(a=>{this.platformChange.emit(a)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=S({type:o,selectors:[["tiktok-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{platformChange:"onPlatformChanges",attributesChanges:"attributesChanges"},features:[k([we]),N],decls:2,vars:3,consts:[[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","listingPlatform","bindLabel","label","bindValue","value","placeholder","Platform Options",3,"multiple","items","clearable"],[1,"text-danger"],["bindLabel","name","bindValue","id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"]],template:function(t,a){if(t&1&&(_(0,si,10,5,"form",0),F(1,"async")),t&2){let r;h((r=A(1,1,a.attributes$))?0:-1,r)}},dependencies:[I,Y,G,$,j,ee,R,H,W,X,te,P],encapsulation:2});let e=o;return e})();var Ve=(()=>{let o=class o{constructor(){this.woocommerceUploadService=u(ye)}getAttributes(i,t){return this.woocommerceUploadService.getAttributes(i,t).pipe(O(a=>a.map(r=>({key:r.name,label:r.name}))))}};o.\u0275fac=function(t){return new(t||o)},o.\u0275prov=D({token:o,factory:o.\u0275fac});let e=o;return e})();var Nt=(()=>{let o=class o{constructor(){this.wooAttributeFormService=u(Ve),this.channelId=g(),this.categoryId=g(),this.attributesChanges=new V}ngOnChanges(){b.IsNotEmpty(this.categoryId())&&b.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(i){this.attributesChanges.emit([i.key])}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=S({type:o,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[k([Ve]),N],decls:6,vars:3,consts:[[1,"row"],[1,"col-6"],[1,"mb-1"],["bindLabel","label","bindValue","id","placeholder","Pilih Atribut",3,"change","items"]],template:function(t,a){t&1&&(c(0,"div",0)(1,"div",1)(2,"div",2),C(3,"Atribut"),l(),c(4,"ng-select",3),F(5,"async"),T("change",function(m){return a.onSelectAttribute(m)}),l()()()),t&2&&(s(4),p("items",A(5,1,a.attributes$)))},dependencies:[I,te,Y,G,$,P],encapsulation:2});let e=o;return e})();var Ue=(()=>{let o=class o{constructor(){this.httpService=u(ie),this.formBuilder=u(K)}getAttributes(i,t){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:i},{key:"CategoryID",value:t}]).pipe(O(r=>r))}createFormGroup(i){let t=this.formBuilder.group({});return i.forEach(a=>{t.addControl(a.variant,this.formBuilder.control(null))}),t}convertAttributes(i={}){return Object.values(i).filter(a=>a!==null).map(a=>JSON.stringify(a))}};o.\u0275fac=function(t){return new(t||o)},o.\u0275prov=D({token:o,factory:o.\u0275fac});let e=o;return e})();function mi(e,o){if(e&1&&(c(0,"div",2)(1,"div",3),C(2),l(),f(3,"ng-select",4),l()),e&2){let n=o.$implicit;s(2),q(" ",n==null?null:n.variant," "),s(),p("formControlName",n.variant)("items",n.values)("placeholder","Pilih "+(n==null?null:n.variant))}}function pi(e,o){if(e&1&&(c(0,"form",0)(1,"div",1),L(2,mi,4,4,"div",2,U),l()()),e&2){let n=d();p("formGroup",n.form),s(2),B(o)}}var Ot=(()=>{let o=class o{constructor(){this.tokpedAttrFormService=u(Ue),this.channelId=g(void 0),this.categoryId=g(void 0),this.attributesChanges=new V}ngOnInit(){}ngOnChanges(i){let t=this.categoryId(),a=this.channelId();b.IsNotEmpty(t)&&b.IsNotEmpty(a)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(a,t).pipe(w(r=>{this.form=this.tokpedAttrFormService.createFormGroup(r),this.listenToFormChange()})))}listenToFormChange(){let i=[];this.formSubscription=this.form.valueChanges.subscribe(t=>{i=this.tokpedAttrFormService.convertAttributes(t),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=S({type:o,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[k([Ue]),N],decls:2,vars:3,consts:[[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(t,a){if(t&1&&(_(0,pi,4,1,"form",0),F(1,"async")),t&2){let r;h((r=A(1,1,a.attributes$))?0:-1,r)}},dependencies:[I,Y,G,$,j,R,H,W,X,P],encapsulation:2});let e=o;return e})();var Le=(()=>{let o=class o{constructor(){this.httpService=u(ie),this.formBuilder=u(K)}getAttributes(i){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:i}]).pipe(w(a=>(a.Options.StatusOptions=a.Options.Status.map(r=>({id:r,name:r})),a)))}createFormGroup(i){let t=this.formBuilder.group({});return Object.keys(i.Attribute).forEach(r=>{t.addControl(r,this.formBuilder.control(null))}),t}};o.\u0275fac=function(t){return new(t||o)},o.\u0275prov=D({token:o,factory:o.\u0275fac});let e=o;return e})();function ui(e,o){if(e&1&&(c(0,"form",0)(1,"div",1)(2,"div",2)(3,"div",3),C(4," Brand "),l(),f(5,"input",4),l(),c(6,"div",5)(7,"div",3),C(8," Product Type "),l(),f(9,"input",6),l(),c(10,"div",5)(11,"div",3),C(12," Status "),l(),f(13,"ng-select",7),l()()()),e&2){let n=d();p("formGroup",n.form),s(13),p("items",o.Options.StatusOptions)}}var wt=(()=>{let o=class o{constructor(){this.channelId=g(void 0),this.attributesChanges=new V,this.shopifyFormService=u(Le)}ngOnChanges(i){i.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId()).pipe(w(t=>{this.form=this.shopifyFormService.createFormGroup(t),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe($e(500)).subscribe(i=>{this.attributesChanges.emit([i])})}ngOnDestroy(){this.formSubscription.unsubscribe()}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=S({type:o,selectors:[["shopify-attribute-form"]],inputs:{channelId:[1,"channelId"]},outputs:{attributesChanges:"attributesChanges"},features:[k([Le]),N],decls:2,vars:3,consts:[[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","Brand","type","text","placeholder","brand",1,"form-control"],[1,"col-6"],["formControlName","ProductType","type","text","placeholder","Product Type",1,"form-control"],["formControlName","Status","bindLabel","name","bindValue","id","placeholder","Status",3,"items"]],template:function(t,a){if(t&1&&(_(0,ui,14,2,"form",0),F(1,"async")),t&2){let r;h((r=A(1,1,a.attributes$))?0:-1,r)}},dependencies:[I,$,j,ee,R,H,W,X,Y,G,P],encapsulation:2});let e=o;return e})();function fi(e,o){if(e&1&&(c(0,"div",6),f(1,"app-product-card",9),l()),e&2){let n=o.$implicit;s(),p("productId",n==null?null:n.ID)("title",n==null?null:n.Name)("image",n==null?null:n.ThumbnailUrl)("description",(n==null||n.Variants==null?null:n.Variants.length)>1?(n==null||n.Variants==null?null:n.Variants.length)+" Variants":null)("imageForZoom",n==null?null:n.ImageUrl)("code",n==null||n.Variants[0]==null?null:n.Variants[0].Code)("showFooter",!1)}}function _i(e,o){if(e&1){let n=M();c(0,"mat-checkbox",21),We("ngModelChange",function(t){v(n);let a=d().$implicit;return je(a.selected,t)||(a.selected=t),x(t)}),T("ngModelChange",function(){let t=v(n),a=d(),r=a.$implicit,m=a.$index,y=d();return x(y.onSelectChannel(r,m,t))}),l()}if(e&2){let n=d().$implicit;He("ngModel",n.selected)}}function hi(e,o){if(e&1&&(c(0,"div",18),f(1,"input",22),l()),e&2){let n=d().$implicit,i=d();p("matTooltip",n.type==i.channelType.Shopify||n.type==i.channelType.ShopifyV2?"Cannot change category, please change category in admin.shopify.com":n.type==i.channelType.Plugo?"You can change the category after the product has been uploaded to the Plugo Dashboard.":"")}}function Ci(e,o){if(e&1){let n=M();c(0,"app-channel-category-select",23),T("selectedCategory",function(t){v(n);let a=d().$index,r=d();return x(r.onCategoryChange(a,t))}),l()}if(e&2){let n=d().$implicit,i=d();p("disabled",!n.selected||n.selected&&n.type==i.channelType.Lazada)("channelId",n.id)("channelType",n.type)("categoryId",n.categoryId)}}function gi(e,o){if(e&1){let n=M();c(0,"shopee-attribute-form",27),T("attributesChanges",function(t){v(n);let a=d(2).$index,r=d();return x(r.onAttributesChange(a,t))}),l()}if(e&2){let n=d(2).$implicit;p("categoryId",n.categoryId)("channelId",n.id)("channelType",n.type)}}function bi(e,o){if(e&1){let n=M();c(0,"tiktok-attribute-form",28),T("attributesChanges",function(t){v(n);let a=d(2).$index,r=d();return x(r.onAttributesChange(a,t))})("onPlatformChanges",function(t){v(n);let a=d(2).$index,r=d();return x(r.onPlatformChange(a,t))}),l()}if(e&2){let n=d(2).$implicit;p("categoryId",n.categoryId)("channelId",n.id)}}function yi(e,o){if(e&1){let n=M();c(0,"wooocommerce-attribute-form",29),T("attributesChanges",function(t){v(n);let a=d(2).$index,r=d();return x(r.onAttributesChange(a,t))}),l()}if(e&2){let n=d(2).$implicit;p("categoryId",n.categoryId)("channelId",n.id)}}function vi(e,o){if(e&1){let n=M();c(0,"tokopedia-attribute-form",29),T("attributesChanges",function(t){v(n);let a=d(2).$index,r=d();return x(r.onAttributesChange(a,t))}),l()}if(e&2){let n=d(2).$implicit;p("categoryId",n.categoryId)("channelId",n.id)}}function xi(e,o){if(e&1&&(c(0,"div",20)(1,"div",24),_(2,gi,1,3,"shopee-attribute-form",25)(3,bi,1,2,"tiktok-attribute-form",26)(4,yi,1,2,"wooocommerce-attribute-form",26)(5,vi,1,2,"tokopedia-attribute-form",26),l()()),e&2){let n,i=d().$implicit,t=d();s(2),h((n=i.type)===t.channelType.Shopee?2:n===t.channelType.Tiktok?3:n===t.channelType.WooCommerce?4:n===t.channelType.Tokopedia?5:-1)}}function Ti(e,o){if(e&1){let n=M();c(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",30),T("attributesChanges",function(t){v(n);let a=d().$index,r=d();return x(r.onAttributesChange(a,t))}),l()()()}if(e&2){let n=d().$implicit;s(2),p("channelId",n.id)}}function Si(e,o){if(e&1&&(c(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),_(6,_i,1,1,"mat-checkbox",14),F(7,"async"),l(),c(8,"div"),f(9,"app-channel-logo",15),l(),c(10,"div",16)(11,"span"),C(12),l()()()(),c(13,"div",12)(14,"div",17),_(15,hi,2,1,"div",18)(16,Ci,1,4,"app-channel-category-select",19),l()()(),_(17,xi,6,1,"div",20)(18,Ti,3,1,"div",20),l()()),e&2){let n,i=o.$implicit,t=d();s(6),h((n=A(7,8,t.defaultCategories$))?6:-1,n),s(3),p("typeId",i.type)("showChannelName",!1),s(),p("matTooltip",i.name)("matTooltipShowDelay",2500),s(2),Z(i.name),s(3),h(i.type==t.channelType.Shopify||i.type==t.channelType.Plugo||i.type==t.channelType.ShopifyV2?15:16),s(2),h(i.categoryId&&t.channelType.Lazada!=i.type&&i.selected?17:(t.channelType.Shopify==i.type||i.type==t.channelType.ShopifyV2)&&i.selected?18:-1)}}var Sr=(()=>{let o=class o{constructor(){this.toastr=u(tt),this.uploadProductService=u(ve),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=Ee,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(Q(1))}onCategoryChange(i,t){this.channelProductUploads.update(a=>a.map((r,m)=>(m==i&&(r.categoryId=t,r.attributes=[]),r)))}onPlatformChange(i,t){this.channelProductUploads.update(a=>a.map((r,m)=>(m==i&&(r.listing_platforms=t),r)))}onAttributesChange(i,t){this.channelProductUploads.update(a=>a.map((r,m)=>(m==i&&(r.attributes=t),r)))}tiktokPlatformChanges(i,t){this.channelProductUploads.update(a=>a.map((r,m)=>(m==i&&(r.listing_platforms=t),r)))}onSelectChannel(i,t,a){this.channelProductUploads.update(r=>r.map((m,y)=>{if(y==t&&i.selected){let ke=this.findCategoryByChannelId(i.id,a);m.categoryId=ke?.DefaultCategoryID}return y==t&&!i.selected&&(m.categoryId=null),m}))}findCategoryByChannelId(i,t){return t.find(a=>a.ID===i)}onUploadProduct(){if(this.checkTiktokPlatform()==!1){this.toastr.error("Please select at least one platform for TikTok channel","Platform is Required");return}this.uploadProductService.onUploadProduct(this.channelProductUploads())}checkTiktokPlatform(){return this.channelProductUploads().every(t=>t.type==Ee.Tiktok&&b.IsNotEmpty(t?.categoryId)?t.listing_platforms.length>0:!0)}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=S({type:o,selectors:[["app-product-upload"]],features:[k([be,pt,ut,ye])],decls:17,vars:5,consts:[["headerTitle","Upload Product To Channel",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-upload"],[1,"container-fluid","mt-6"],[1,"ps-3","mt-8","pb-5","fw-medium"],[1,"row","mb-10","ps-3"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"ps-3","mb-8","border-bottom","pb-5","fw-medium"],[1,"row","mb-6"],[3,"productId","title","image","description","imageForZoom","code","showFooter"],[1,"col-12"],[1,"row"],[1,"col-3"],[1,"d-flex","align-items-center"],["color","primary",1,"example-margin",3,"ngModel"],[3,"typeId","showChannelName"],[2,"overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"matTooltip","matTooltipShowDelay"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip"],[3,"disabled","channelId","channelType","categoryId"],[1,"row","my-3"],["color","primary",1,"example-margin",3,"ngModelChange","ngModel"],["disabled","","type","text","placeholder","Category Unavailable",1,"form-control","rounded-1",2,"height","35px"],[3,"selectedCategory","disabled","channelId","channelType","categoryId"],[1,"col-12","ps-11"],[3,"categoryId","channelId","channelType"],[3,"categoryId","channelId"],[3,"attributesChanges","categoryId","channelId","channelType"],[3,"attributesChanges","onPlatformChanges","categoryId","channelId"],[3,"attributesChanges","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(t,a){if(t&1&&(c(0,"mainpanel",0)(1,"actions")(2,"button",1),T("click",function(){return a.onUploadProduct()}),f(3,"i",2),C(4," Upload "),l()(),c(5,"content")(6,"div",3)(7,"h3",4),C(8,"Product To Upload"),l(),c(9,"div",5),L(10,fi,2,7,"div",6,U),F(12,"async"),l(),c(13,"h3",7),C(14,"Channel To Upload"),l(),L(15,Si,19,10,"div",8,U),l()()()),t&2){let r;p("hideSearchBox",!0)("hideSearchDropdown",!0),s(2),p("disabled",((r=a.channelProductUploads())==null?null:r.length)==0),s(8),B(A(12,3,a.selectedProducts$)),s(5),B(a.channelProductUploads())}},dependencies:[I,xt,rt,nt,St,Tt,at,te,R,qe,ot,it,Dt,Nt,Ot,wt,_t,Ft,Et,P],encapsulation:2});let e=o;return e})();export{Sr as ProductUploadComponent};
@@ -1 +1 @@
1
- import{i as h}from"./chunk-Q4AWQ7IC.js";import{b as p}from"./chunk-OXWPYJNB.js";import{a as u}from"./chunk-ZETUYNFJ.js";import{F as l}from"./chunk-LNJUGHOX.js";import{ma as c,qa as t}from"./chunk-ZYJ6LAJ3.js";var g=(()=>{let e=class e{constructor(s,i,r,n){this.toastr=s,this.authService=i,this.router=r,this.permissionService=n}canActivate(s,i){let r=JSON.parse(window.localStorage.getItem("user")),n=new Date,a=!1;if(r!=null){let m=new Date(r?.Token?.expiredAt);n<m?a=!0:(this.authService.logout(),this.onTokenExpired())}else this.router.navigate([""]),this.onTokenExpired();return a}onTokenExpired(){this.toastr.error("Your session has expired. Please login again.","Session Expired")}};e.\u0275fac=function(i){return new(i||e)(t(p),t(h),t(l),t(u))},e.\u0275prov=c({token:e,factory:e.\u0275fac,providedIn:"root"});let o=e;return o})();export{g as a};
1
+ import{i as h}from"./chunk-I723PUUO.js";import{b as p}from"./chunk-OXWPYJNB.js";import{a as u}from"./chunk-ZETUYNFJ.js";import{F as l}from"./chunk-LNJUGHOX.js";import{ma as c,qa as t}from"./chunk-ZYJ6LAJ3.js";var g=(()=>{let e=class e{constructor(s,i,r,n){this.toastr=s,this.authService=i,this.router=r,this.permissionService=n}canActivate(s,i){let r=JSON.parse(window.localStorage.getItem("user")),n=new Date,a=!1;if(r!=null){let m=new Date(r?.Token?.expiredAt);n<m?a=!0:(this.authService.logout(),this.onTokenExpired())}else this.router.navigate([""]),this.onTokenExpired();return a}onTokenExpired(){this.toastr.error("Your session has expired. Please login again.","Session Expired")}};e.\u0275fac=function(i){return new(i||e)(t(p),t(h),t(l),t(u))},e.\u0275prov=c({token:e,factory:e.\u0275fac,providedIn:"root"});let o=e;return o})();export{g as a};
@@ -1 +1 @@
1
- import{a as de,b as pe,c as se}from"./chunk-ILW6ZFFV.js";import{a as ue}from"./chunk-IODYBTLK.js";import{a as P}from"./chunk-Q7MU7DBD.js";import{a as ce}from"./chunk-S7CKRTJV.js";import{a as ae}from"./chunk-7JQEF4XX.js";import"./chunk-AFIF6VRM.js";import"./chunk-ZW2TMVZP.js";import"./chunk-ZTHO6JJM.js";import"./chunk-SHUYFOQI.js";import"./chunk-FCEXPGTK.js";import"./chunk-QFSA7CU4.js";import"./chunk-OPXITNRF.js";import"./chunk-HPINZVE4.js";import"./chunk-D2J64VUP.js";import"./chunk-6Q6L5NUD.js";import"./chunk-C7N6EI73.js";import"./chunk-GPHNPV7O.js";import"./chunk-3RK6DDJD.js";import"./chunk-4YCSITNV.js";import"./chunk-WHHW4IZT.js";import"./chunk-N5AE5WMQ.js";import"./chunk-6OJQRHIZ.js";import{a as me}from"./chunk-BYTWGXP7.js";import"./chunk-3JRUKSV3.js";import"./chunk-SJ5MC42H.js";import"./chunk-4RLWHMI6.js";import"./chunk-NWB7EVME.js";import{a as le}from"./chunk-PDCVMSLL.js";import"./chunk-AFDI4TD4.js";import"./chunk-4RG5YR7N.js";import"./chunk-5MV3UFJQ.js";import"./chunk-E6AMKEQR.js";import"./chunk-IGKMJFKP.js";import"./chunk-ITGVXYDV.js";import"./chunk-HK5FXZE4.js";import"./chunk-KJE5GRQ4.js";import"./chunk-4ILDFTIG.js";import"./chunk-A6QXXKPR.js";import"./chunk-Q4AWQ7IC.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-M4ZE35XK.js";import"./chunk-L7WZ6U4T.js";import"./chunk-LOWGZOML.js";import"./chunk-5PMKN6PM.js";import"./chunk-AGBJEXIM.js";import"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import"./chunk-JBEKD57G.js";import{m as re,n as oe}from"./chunk-EDEZ3JLR.js";import{A as te,c as Y,h as Z,m as $,o as ee}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import"./chunk-ZETUYNFJ.js";import{v as ie,w as ne}from"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{i as J,j as K,l as Q,m as X}from"./chunk-LNJUGHOX.js";import{$b as y,$c as q,Gb as I,Ha as W,Lc as A,Mc as a,Nc as w,Oc as E,Qc as f,Rc as h,Sc as v,Tc as R,Uc as H,Vc as j,Z as O,Zc as U,bc as b,cc as B,ec as k,fc as z,gc as C,hc as t,hd as x,ic as i,id as V,jc as g,jd as G,lb as D,nb as r,qc as M,ra as F,vc as T,xa as c,xc as _,ya as u}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import{a as L,b as N}from"./chunk-66YHNWRR.js";var Ce=o=>({"td-cell-hover":o});function ge(o,m){if(o&1&&g(0,"variants-dropdown",31),o&2){let e=_().$implicit;C("variants",e==null?null:e.Variants)}}function _e(o,m){if(o&1&&g(0,"variant-with-image",32),o&2){let e=_().$implicit;C("variant",e==null?null:e.Variants[0])}}function fe(o,m){if(o&1&&(t(0,"span"),a(1),i()),o&2){let e=_().$implicit;r(),E("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function he(o,m){if(o&1&&(t(0,"tr")(1,"td")(2,"div",24),g(3,"img",25),x(4,"channelImage"),t(5,"div",26)(6,"div"),a(7),i(),t(8,"small",27)(9,"span"),a(10),i()()()()(),t(11,"td")(12,"div",28)(13,"div",29)(14,"div"),g(15,"order-link",30),i()(),t(16,"small"),a(17),x(18,"date"),i()()(),t(19,"td"),a(20),i(),t(21,"td"),y(22,ge,1,1,"variants-dropdown",31)(23,_e,1,1,"variant-with-image",32),i(),t(24,"td",33),a(25),x(26,"number"),i(),t(27,"td")(28,"div",28)(29,"div",29)(30,"span"),a(31),i(),y(32,fe,2,1,"span"),i(),t(33,"small"),a(34),i()()()()),o&2){let e=m.$implicit;r(3),C("src",V(4,14,e==null?null:e.MarketType),D)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),r(4),w(e.Outlet),r(3),w(e.ChannelName),r(5),C("order",e),r(2),E(" ",G(18,16,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),r(3),w(e.Customer),r(),A(q(21,Ce,(e.Variants==null?null:e.Variants.length)>1)),r(),b((e.Variants==null?null:e.Variants.length)>1?22:23),r(3),w(V(26,19,e.Amount)),r(6),w(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),r(),b(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?32:-1),r(2),E(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," ")}}function ve(o,m){if(o&1){let e=M();t(0,"div",15)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),a(5,"Outlet"),i(),t(6,"th",20),a(7,"Number"),i(),t(8,"th",20),a(9,"Customer"),i(),t(10,"th"),a(11,"Items"),i(),t(12,"th",21),a(13,"Amount"),i(),t(14,"th",22),a(15,"Shipping"),i()()(),t(16,"tbody"),k(17,he,35,23,"tr",null,B),i()(),t(19,"app-custom-paginator",23),T("next",function(){c(e);let p=_();return u(p.initCompletedOrders())})("previous",function(){c(e);let p=_();return u(p.initCompletedOrders())}),i()()}if(o&2){let e=_(),d=j(0);r(17),z(d),r(2),C("filter",e.filter())("totaldata",d==null?null:d.length)}}function Se(o,m){o&1&&(t(0,"div",16),g(1,"app-empty-state"),i())}var je=(()=>{let m=class m{constructor(){this.orderService=F(P),this.filter=W({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:d=>{this.initFromDate(d)},error:d=>{console.error("Error fetching default date:",d),this.initFromDate(null)}})}initFromDate(d){this.filter.update(p=>N(L({},p),{From:d})),this.initCompletedOrders()}initCompletedOrders(){this.completedOrders$=this.orderService.getCompletedOrders(this.filter()).pipe(O(1))}};m.\u0275fac=function(p){return new(p||m)},m.\u0275cmp=I({type:m,selectors:[["app-completed"]],features:[U([P])],decls:34,vars:11,consts:[["headerTitle","Completed","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-regular","fa-tv","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","200px"],[1,"text-end",2,"width","100px"],[2,"width","100px"],["rowCountApi","/api/orders/completedcount",3,"next","previous","filter","totaldata"],[1,"d-flex","align-items-center","gap-3"],[2,"width","20px","height","20px",3,"src","alt"],[1,"lh-base"],[1,"d-flex","align-items-center","gap-2"],[1,"lh-sm"],[1,"d-flex","align-items-end","gap-2"],[2,"font-size","14px",3,"order"],[3,"variants"],[3,"variant"],[1,"text-end"]],template:function(p,l){if(p&1){let s=M();R(0),x(1,"async"),t(2,"mainpanel",0),T("onSubmit",function(){return c(s),u(l.initCompletedOrders())}),v("textChange",function(n){return c(s),h(l.filter().Number,n)||(l.filter().Number=n),u(n)}),t(3,"actions")(4,"a",1),g(5,"i",2),t(6,"span"),a(7,"Order Fulfillment Display"),i()()(),t(8,"filters")(9,"div")(10,"label",3),a(11,"Channel"),i(),t(12,"app-channel-options-v2",4),v("ngModelChange",function(n){return c(s),h(l.filter().ListChannelID,n)||(l.filter().ListChannelID=n),u(n)}),i()(),t(13,"div",5)(14,"label",3),a(15,"From/To"),i(),t(16,"div",6)(17,"datepicker",7),v("dateChange",function(n){return c(s),h(l.filter().From,n)||(l.filter().From=n),u(n)}),i()(),t(18,"div")(19,"datepicker",8),v("dateChange",function(n){return c(s),h(l.filter().To,n)||(l.filter().To=n),u(n)}),i()()(),t(20,"div",5)(21,"label",9),a(22,"Page Number"),i(),t(23,"input",10),v("ngModelChange",function(n){return c(s),h(l.filter().PageNumber,n)||(l.filter().PageNumber=n),u(n)}),i()(),t(24,"div",5)(25,"label",9),a(26,"Page Size"),i(),t(27,"input",11),v("ngModelChange",function(n){return c(s),h(l.filter().PageSize,n)||(l.filter().PageSize=n),u(n)}),i()()(),t(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),y(32,ve,20,2,"div",15)(33,Se,2,0,"div",16),i()()()()()}if(p&2){let s=H(V(1,8,l.completedOrders$));r(2),f("text",l.filter().Number),r(10),C("multiple",!0),f("ngModel",l.filter().ListChannelID),r(5),f("date",l.filter().From),r(2),f("date",l.filter().To),r(4),f("ngModel",l.filter().PageNumber),r(4),f("ngModel",l.filter().PageSize),r(5),b((s==null?null:s.length)>0?32:33)}},dependencies:[X,oe,re,ae,le,te,Y,ee,Z,$,pe,se,ce,ne,ie,ue,me,J,Q,K,de],encapsulation:2});let o=m;return o})();export{je as CompletedComponent};
1
+ import{a as de,b as pe,c as se}from"./chunk-ILW6ZFFV.js";import{a as ue}from"./chunk-KZSTYKIP.js";import{a as P}from"./chunk-GVI6GJHY.js";import{a as ce}from"./chunk-S7CKRTJV.js";import{a as ae}from"./chunk-7JQEF4XX.js";import"./chunk-AFIF6VRM.js";import"./chunk-ZW2TMVZP.js";import"./chunk-ZTHO6JJM.js";import"./chunk-SHUYFOQI.js";import"./chunk-FCEXPGTK.js";import"./chunk-QFSA7CU4.js";import"./chunk-OPXITNRF.js";import"./chunk-HPINZVE4.js";import"./chunk-D2J64VUP.js";import"./chunk-6Q6L5NUD.js";import"./chunk-C7N6EI73.js";import"./chunk-GPHNPV7O.js";import"./chunk-3RK6DDJD.js";import"./chunk-4YCSITNV.js";import"./chunk-WHHW4IZT.js";import"./chunk-N5AE5WMQ.js";import"./chunk-6OJQRHIZ.js";import{a as me}from"./chunk-5KYN6Y7M.js";import"./chunk-3JRUKSV3.js";import"./chunk-SJ5MC42H.js";import"./chunk-4RLWHMI6.js";import"./chunk-NWB7EVME.js";import{a as le}from"./chunk-PDCVMSLL.js";import"./chunk-AFDI4TD4.js";import"./chunk-4RG5YR7N.js";import"./chunk-5MV3UFJQ.js";import"./chunk-E6AMKEQR.js";import"./chunk-IGKMJFKP.js";import"./chunk-ITGVXYDV.js";import"./chunk-HK5FXZE4.js";import"./chunk-KJE5GRQ4.js";import"./chunk-4ILDFTIG.js";import"./chunk-A6QXXKPR.js";import"./chunk-I723PUUO.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-M4ZE35XK.js";import"./chunk-L7WZ6U4T.js";import"./chunk-LOWGZOML.js";import"./chunk-5PMKN6PM.js";import"./chunk-AGBJEXIM.js";import"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import"./chunk-JBEKD57G.js";import{m as re,n as oe}from"./chunk-EDEZ3JLR.js";import{A as te,c as Y,h as Z,m as $,o as ee}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import"./chunk-ZETUYNFJ.js";import{v as ie,w as ne}from"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{i as J,j as K,l as Q,m as X}from"./chunk-LNJUGHOX.js";import{$b as y,$c as q,Gb as I,Ha as W,Lc as A,Mc as a,Nc as w,Oc as E,Qc as f,Rc as h,Sc as v,Tc as R,Uc as H,Vc as j,Z as O,Zc as U,bc as b,cc as B,ec as k,fc as z,gc as C,hc as t,hd as x,ic as i,id as V,jc as g,jd as G,lb as D,nb as r,qc as M,ra as F,vc as T,xa as c,xc as _,ya as u}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import{a as L,b as N}from"./chunk-66YHNWRR.js";var Ce=o=>({"td-cell-hover":o});function ge(o,m){if(o&1&&g(0,"variants-dropdown",31),o&2){let e=_().$implicit;C("variants",e==null?null:e.Variants)}}function _e(o,m){if(o&1&&g(0,"variant-with-image",32),o&2){let e=_().$implicit;C("variant",e==null?null:e.Variants[0])}}function fe(o,m){if(o&1&&(t(0,"span"),a(1),i()),o&2){let e=_().$implicit;r(),E("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function he(o,m){if(o&1&&(t(0,"tr")(1,"td")(2,"div",24),g(3,"img",25),x(4,"channelImage"),t(5,"div",26)(6,"div"),a(7),i(),t(8,"small",27)(9,"span"),a(10),i()()()()(),t(11,"td")(12,"div",28)(13,"div",29)(14,"div"),g(15,"order-link",30),i()(),t(16,"small"),a(17),x(18,"date"),i()()(),t(19,"td"),a(20),i(),t(21,"td"),y(22,ge,1,1,"variants-dropdown",31)(23,_e,1,1,"variant-with-image",32),i(),t(24,"td",33),a(25),x(26,"number"),i(),t(27,"td")(28,"div",28)(29,"div",29)(30,"span"),a(31),i(),y(32,fe,2,1,"span"),i(),t(33,"small"),a(34),i()()()()),o&2){let e=m.$implicit;r(3),C("src",V(4,14,e==null?null:e.MarketType),D)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),r(4),w(e.Outlet),r(3),w(e.ChannelName),r(5),C("order",e),r(2),E(" ",G(18,16,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),r(3),w(e.Customer),r(),A(q(21,Ce,(e.Variants==null?null:e.Variants.length)>1)),r(),b((e.Variants==null?null:e.Variants.length)>1?22:23),r(3),w(V(26,19,e.Amount)),r(6),w(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),r(),b(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?32:-1),r(2),E(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," ")}}function ve(o,m){if(o&1){let e=M();t(0,"div",15)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),a(5,"Outlet"),i(),t(6,"th",20),a(7,"Number"),i(),t(8,"th",20),a(9,"Customer"),i(),t(10,"th"),a(11,"Items"),i(),t(12,"th",21),a(13,"Amount"),i(),t(14,"th",22),a(15,"Shipping"),i()()(),t(16,"tbody"),k(17,he,35,23,"tr",null,B),i()(),t(19,"app-custom-paginator",23),T("next",function(){c(e);let p=_();return u(p.initCompletedOrders())})("previous",function(){c(e);let p=_();return u(p.initCompletedOrders())}),i()()}if(o&2){let e=_(),d=j(0);r(17),z(d),r(2),C("filter",e.filter())("totaldata",d==null?null:d.length)}}function Se(o,m){o&1&&(t(0,"div",16),g(1,"app-empty-state"),i())}var je=(()=>{let m=class m{constructor(){this.orderService=F(P),this.filter=W({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:d=>{this.initFromDate(d)},error:d=>{console.error("Error fetching default date:",d),this.initFromDate(null)}})}initFromDate(d){this.filter.update(p=>N(L({},p),{From:d})),this.initCompletedOrders()}initCompletedOrders(){this.completedOrders$=this.orderService.getCompletedOrders(this.filter()).pipe(O(1))}};m.\u0275fac=function(p){return new(p||m)},m.\u0275cmp=I({type:m,selectors:[["app-completed"]],features:[U([P])],decls:34,vars:11,consts:[["headerTitle","Completed","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-regular","fa-tv","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","200px"],[1,"text-end",2,"width","100px"],[2,"width","100px"],["rowCountApi","/api/orders/completedcount",3,"next","previous","filter","totaldata"],[1,"d-flex","align-items-center","gap-3"],[2,"width","20px","height","20px",3,"src","alt"],[1,"lh-base"],[1,"d-flex","align-items-center","gap-2"],[1,"lh-sm"],[1,"d-flex","align-items-end","gap-2"],[2,"font-size","14px",3,"order"],[3,"variants"],[3,"variant"],[1,"text-end"]],template:function(p,l){if(p&1){let s=M();R(0),x(1,"async"),t(2,"mainpanel",0),T("onSubmit",function(){return c(s),u(l.initCompletedOrders())}),v("textChange",function(n){return c(s),h(l.filter().Number,n)||(l.filter().Number=n),u(n)}),t(3,"actions")(4,"a",1),g(5,"i",2),t(6,"span"),a(7,"Order Fulfillment Display"),i()()(),t(8,"filters")(9,"div")(10,"label",3),a(11,"Channel"),i(),t(12,"app-channel-options-v2",4),v("ngModelChange",function(n){return c(s),h(l.filter().ListChannelID,n)||(l.filter().ListChannelID=n),u(n)}),i()(),t(13,"div",5)(14,"label",3),a(15,"From/To"),i(),t(16,"div",6)(17,"datepicker",7),v("dateChange",function(n){return c(s),h(l.filter().From,n)||(l.filter().From=n),u(n)}),i()(),t(18,"div")(19,"datepicker",8),v("dateChange",function(n){return c(s),h(l.filter().To,n)||(l.filter().To=n),u(n)}),i()()(),t(20,"div",5)(21,"label",9),a(22,"Page Number"),i(),t(23,"input",10),v("ngModelChange",function(n){return c(s),h(l.filter().PageNumber,n)||(l.filter().PageNumber=n),u(n)}),i()(),t(24,"div",5)(25,"label",9),a(26,"Page Size"),i(),t(27,"input",11),v("ngModelChange",function(n){return c(s),h(l.filter().PageSize,n)||(l.filter().PageSize=n),u(n)}),i()()(),t(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),y(32,ve,20,2,"div",15)(33,Se,2,0,"div",16),i()()()()()}if(p&2){let s=H(V(1,8,l.completedOrders$));r(2),f("text",l.filter().Number),r(10),C("multiple",!0),f("ngModel",l.filter().ListChannelID),r(5),f("date",l.filter().From),r(2),f("date",l.filter().To),r(4),f("ngModel",l.filter().PageNumber),r(4),f("ngModel",l.filter().PageSize),r(5),b((s==null?null:s.length)>0?32:33)}},dependencies:[X,oe,re,ae,le,te,Y,ee,Z,$,pe,se,ce,ne,ie,ue,me,J,Q,K,de],encapsulation:2});let o=m;return o})();export{je as CompletedComponent};
@@ -1 +1 @@
1
- import{a as pe,b as se,c as ue}from"./chunk-ILW6ZFFV.js";import{a as _e}from"./chunk-IODYBTLK.js";import{a as A}from"./chunk-Q7MU7DBD.js";import{a as ce}from"./chunk-S7CKRTJV.js";import{a as me}from"./chunk-7JQEF4XX.js";import"./chunk-AFIF6VRM.js";import"./chunk-ZW2TMVZP.js";import"./chunk-ZTHO6JJM.js";import"./chunk-SHUYFOQI.js";import"./chunk-FCEXPGTK.js";import"./chunk-QFSA7CU4.js";import"./chunk-OPXITNRF.js";import"./chunk-HPINZVE4.js";import"./chunk-D2J64VUP.js";import"./chunk-6Q6L5NUD.js";import"./chunk-C7N6EI73.js";import"./chunk-GPHNPV7O.js";import"./chunk-3RK6DDJD.js";import"./chunk-4YCSITNV.js";import"./chunk-WHHW4IZT.js";import"./chunk-N5AE5WMQ.js";import"./chunk-6OJQRHIZ.js";import{a as de}from"./chunk-BYTWGXP7.js";import"./chunk-3JRUKSV3.js";import"./chunk-SJ5MC42H.js";import"./chunk-4RLWHMI6.js";import"./chunk-NWB7EVME.js";import{a as ae}from"./chunk-PDCVMSLL.js";import"./chunk-AFDI4TD4.js";import"./chunk-4RG5YR7N.js";import"./chunk-5MV3UFJQ.js";import"./chunk-E6AMKEQR.js";import"./chunk-IGKMJFKP.js";import"./chunk-ITGVXYDV.js";import"./chunk-HK5FXZE4.js";import"./chunk-KJE5GRQ4.js";import"./chunk-4ILDFTIG.js";import"./chunk-A6QXXKPR.js";import"./chunk-Q4AWQ7IC.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-M4ZE35XK.js";import"./chunk-L7WZ6U4T.js";import"./chunk-LOWGZOML.js";import"./chunk-5PMKN6PM.js";import"./chunk-AGBJEXIM.js";import"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import"./chunk-JBEKD57G.js";import{m as le,n as oe}from"./chunk-EDEZ3JLR.js";import{A as ie,c as Z,h as $,m as ee,o as te}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import"./chunk-ZETUYNFJ.js";import{v as ne,w as re}from"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{i as K,j as Q,l as X,m as Y}from"./chunk-LNJUGHOX.js";import{$b as y,$c as G,Gb as D,Ha as O,Lc as z,Mc as a,Nc as b,Oc as V,Qc as C,Rc as h,Sc as S,Tc as R,Uc as H,Vc as j,Z as N,Zc as U,_c as q,bc as x,cc as I,ec as B,fc as k,gc as _,hc as t,hd as w,ic as i,id as E,jc as f,jd as J,lb as W,nb as l,qc as M,ra as F,vc as T,xa as u,xc as g,ya as c}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import{a as P,b as L}from"./chunk-66YHNWRR.js";var fe=()=>[],ge=r=>({"td-cell-hover":r});function Ce(r,m){if(r&1&&f(0,"variants-dropdown",27),r&2){let e=g().$implicit;_("variants",e==null?null:e.Variants)}}function he(r,m){if(r&1&&f(0,"variant-with-image",28),r&2){let e=g().$implicit;_("variant",e==null?null:e.Variants[0])}}function Se(r,m){if(r&1&&(t(0,"span"),a(1),i()),r&2){let e=g().$implicit;l(),V("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function ve(r,m){if(r&1&&(t(0,"tr")(1,"td")(2,"div",23)(3,"div",24)(4,"div"),f(5,"img",25),w(6,"channelImage"),i(),t(7,"div"),f(8,"order-link",26),i()(),t(9,"small"),a(10),w(11,"date"),i()()(),t(12,"td"),a(13),i(),t(14,"td"),y(15,Ce,1,1,"variants-dropdown",27)(16,he,1,1,"variant-with-image",28),i(),t(17,"td"),a(18),w(19,"number"),i(),t(20,"td")(21,"div",23)(22,"div",24)(23,"span"),a(24),i(),y(25,Se,2,1,"span"),i(),t(26,"small"),a(27),i()()()()),r&2){let e=m.$implicit;l(5),_("src",E(6,12,e==null?null:e.MarketType),W)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),l(3),_("order",e),l(2),V(" ",J(11,14,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),l(3),b(e.Customer),l(),z(G(19,ge,(e.Variants==null?null:e.Variants.length)>1)),l(),x((e.Variants==null?null:e.Variants.length)>1?15:16),l(3),b(E(19,17,e.Amount)),l(6),b(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),l(),x(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?25:-1),l(2),V(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," ")}}function we(r,m){if(r&1){let e=M();t(0,"div",15)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),a(5,"Number"),i(),t(6,"th",20),a(7,"Customer"),i(),t(8,"th"),a(9,"Items"),i(),t(10,"th",21),a(11,"Amount"),i(),t(12,"th",21),a(13,"Shipping"),i()()(),t(14,"tbody"),B(15,ve,28,21,"tr",null,I),i()(),t(17,"app-custom-paginator",22),T("next",function(){u(e);let p=g();return c(p.initAllOrders())})("previous",function(){u(e);let p=g();return c(p.initAllOrders())}),i()()}if(r&2){let e=g(),d=j(0);l(15),k(d),l(2),_("filter",e.filter())("totaldata",d==null?null:d.length)}}function ye(r,m){r&1&&(t(0,"div",16),f(1,"app-empty-state"),i())}var qe=(()=>{let m=class m{constructor(){this.orderService=F(A),this.filter=O({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:d=>{this.initFromDate(d)},error:d=>{console.error("Error fetching default date:",d),this.initFromDate(null)}})}initFromDate(d){this.filter.update(p=>L(P({},p),{From:d})),this.initAllOrders()}initAllOrders(){this.allOrders$=this.orderService.getAllOrders(this.filter()).pipe(N(1))}};m.\u0275fac=function(p){return new(p||m)},m.\u0275cmp=D({type:m,selectors:[["app-all"]],features:[U([A])],decls:34,vars:12,consts:[["headerTitle","Completed","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],["rowCountApi","/api/orders/allcount",3,"next","previous","filter","totaldata"],[1,"lh-sm"],[1,"d-flex","align-items-end","gap-2"],[2,"width","14px","padding-bottom","2.5px",3,"src","alt"],[3,"order"],[3,"variants"],[3,"variant"]],template:function(p,o){if(p&1){let s=M();R(0),w(1,"async"),t(2,"mainpanel",0),T("onSubmit",function(){return u(s),c(o.initAllOrders())}),S("textChange",function(n){return u(s),h(o.filter().Number,n)||(o.filter().Number=n),c(n)}),t(3,"actions")(4,"a",1),f(5,"i",2),t(6,"span"),a(7,"Order Fulfillment Display"),i()()(),t(8,"filters")(9,"div")(10,"label",3),a(11,"Channel"),i(),t(12,"app-channel-options-v2",4),S("ngModelChange",function(n){return u(s),h(o.filter().ListChannelID,n)||(o.filter().ListChannelID=n),c(n)}),i()(),t(13,"div",5)(14,"label",3),a(15,"From/To"),i(),t(16,"div",6)(17,"datepicker",7),S("dateChange",function(n){return u(s),h(o.filter().From,n)||(o.filter().From=n),c(n)}),i()(),t(18,"div")(19,"datepicker",8),S("dateChange",function(n){return u(s),h(o.filter().To,n)||(o.filter().To=n),c(n)}),i()()(),t(20,"div",5)(21,"label",9),a(22,"Page Number"),i(),t(23,"input",10),S("ngModelChange",function(n){return u(s),h(o.filter().PageNumber,n)||(o.filter().PageNumber=n),c(n)}),i()(),t(24,"div",5)(25,"label",9),a(26,"Page Size"),i(),t(27,"input",11),S("ngModelChange",function(n){return u(s),h(o.filter().PageSize,n)||(o.filter().PageSize=n),c(n)}),i()()(),t(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),y(32,we,18,2,"div",15)(33,ye,2,0,"div",16),i()()()()()}if(p&2){let s=H(E(1,8,o.allOrders$)||q(11,fe));l(2),C("text",o.filter().Number),l(10),_("multiple",!0),C("ngModel",o.filter().ListChannelID),l(5),C("date",o.filter().From),l(2),C("date",o.filter().To),l(4),C("ngModel",o.filter().PageNumber),l(4),C("ngModel",o.filter().PageSize),l(5),x((s==null?null:s.length)>0?32:33)}},dependencies:[Y,oe,le,me,ae,ie,Z,te,$,ee,se,ue,ce,re,ne,_e,de,K,X,Q,pe],encapsulation:2});let r=m;return r})();export{qe as AllComponent};
1
+ import{a as pe,b as se,c as ue}from"./chunk-ILW6ZFFV.js";import{a as _e}from"./chunk-KZSTYKIP.js";import{a as A}from"./chunk-GVI6GJHY.js";import{a as ce}from"./chunk-S7CKRTJV.js";import{a as me}from"./chunk-7JQEF4XX.js";import"./chunk-AFIF6VRM.js";import"./chunk-ZW2TMVZP.js";import"./chunk-ZTHO6JJM.js";import"./chunk-SHUYFOQI.js";import"./chunk-FCEXPGTK.js";import"./chunk-QFSA7CU4.js";import"./chunk-OPXITNRF.js";import"./chunk-HPINZVE4.js";import"./chunk-D2J64VUP.js";import"./chunk-6Q6L5NUD.js";import"./chunk-C7N6EI73.js";import"./chunk-GPHNPV7O.js";import"./chunk-3RK6DDJD.js";import"./chunk-4YCSITNV.js";import"./chunk-WHHW4IZT.js";import"./chunk-N5AE5WMQ.js";import"./chunk-6OJQRHIZ.js";import{a as de}from"./chunk-5KYN6Y7M.js";import"./chunk-3JRUKSV3.js";import"./chunk-SJ5MC42H.js";import"./chunk-4RLWHMI6.js";import"./chunk-NWB7EVME.js";import{a as ae}from"./chunk-PDCVMSLL.js";import"./chunk-AFDI4TD4.js";import"./chunk-4RG5YR7N.js";import"./chunk-5MV3UFJQ.js";import"./chunk-E6AMKEQR.js";import"./chunk-IGKMJFKP.js";import"./chunk-ITGVXYDV.js";import"./chunk-HK5FXZE4.js";import"./chunk-KJE5GRQ4.js";import"./chunk-4ILDFTIG.js";import"./chunk-A6QXXKPR.js";import"./chunk-I723PUUO.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-M4ZE35XK.js";import"./chunk-L7WZ6U4T.js";import"./chunk-LOWGZOML.js";import"./chunk-5PMKN6PM.js";import"./chunk-AGBJEXIM.js";import"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import"./chunk-JBEKD57G.js";import{m as le,n as oe}from"./chunk-EDEZ3JLR.js";import{A as ie,c as Z,h as $,m as ee,o as te}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import"./chunk-ZETUYNFJ.js";import{v as ne,w as re}from"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{i as K,j as Q,l as X,m as Y}from"./chunk-LNJUGHOX.js";import{$b as y,$c as G,Gb as D,Ha as O,Lc as z,Mc as a,Nc as b,Oc as V,Qc as C,Rc as h,Sc as S,Tc as R,Uc as H,Vc as j,Z as N,Zc as U,_c as q,bc as x,cc as I,ec as B,fc as k,gc as _,hc as t,hd as w,ic as i,id as E,jc as f,jd as J,lb as W,nb as l,qc as M,ra as F,vc as T,xa as u,xc as g,ya as c}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import{a as P,b as L}from"./chunk-66YHNWRR.js";var fe=()=>[],ge=r=>({"td-cell-hover":r});function Ce(r,m){if(r&1&&f(0,"variants-dropdown",27),r&2){let e=g().$implicit;_("variants",e==null?null:e.Variants)}}function he(r,m){if(r&1&&f(0,"variant-with-image",28),r&2){let e=g().$implicit;_("variant",e==null?null:e.Variants[0])}}function Se(r,m){if(r&1&&(t(0,"span"),a(1),i()),r&2){let e=g().$implicit;l(),V("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function ve(r,m){if(r&1&&(t(0,"tr")(1,"td")(2,"div",23)(3,"div",24)(4,"div"),f(5,"img",25),w(6,"channelImage"),i(),t(7,"div"),f(8,"order-link",26),i()(),t(9,"small"),a(10),w(11,"date"),i()()(),t(12,"td"),a(13),i(),t(14,"td"),y(15,Ce,1,1,"variants-dropdown",27)(16,he,1,1,"variant-with-image",28),i(),t(17,"td"),a(18),w(19,"number"),i(),t(20,"td")(21,"div",23)(22,"div",24)(23,"span"),a(24),i(),y(25,Se,2,1,"span"),i(),t(26,"small"),a(27),i()()()()),r&2){let e=m.$implicit;l(5),_("src",E(6,12,e==null?null:e.MarketType),W)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),l(3),_("order",e),l(2),V(" ",J(11,14,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),l(3),b(e.Customer),l(),z(G(19,ge,(e.Variants==null?null:e.Variants.length)>1)),l(),x((e.Variants==null?null:e.Variants.length)>1?15:16),l(3),b(E(19,17,e.Amount)),l(6),b(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),l(),x(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?25:-1),l(2),V(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," ")}}function we(r,m){if(r&1){let e=M();t(0,"div",15)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),a(5,"Number"),i(),t(6,"th",20),a(7,"Customer"),i(),t(8,"th"),a(9,"Items"),i(),t(10,"th",21),a(11,"Amount"),i(),t(12,"th",21),a(13,"Shipping"),i()()(),t(14,"tbody"),B(15,ve,28,21,"tr",null,I),i()(),t(17,"app-custom-paginator",22),T("next",function(){u(e);let p=g();return c(p.initAllOrders())})("previous",function(){u(e);let p=g();return c(p.initAllOrders())}),i()()}if(r&2){let e=g(),d=j(0);l(15),k(d),l(2),_("filter",e.filter())("totaldata",d==null?null:d.length)}}function ye(r,m){r&1&&(t(0,"div",16),f(1,"app-empty-state"),i())}var qe=(()=>{let m=class m{constructor(){this.orderService=F(A),this.filter=O({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:d=>{this.initFromDate(d)},error:d=>{console.error("Error fetching default date:",d),this.initFromDate(null)}})}initFromDate(d){this.filter.update(p=>L(P({},p),{From:d})),this.initAllOrders()}initAllOrders(){this.allOrders$=this.orderService.getAllOrders(this.filter()).pipe(N(1))}};m.\u0275fac=function(p){return new(p||m)},m.\u0275cmp=D({type:m,selectors:[["app-all"]],features:[U([A])],decls:34,vars:12,consts:[["headerTitle","Completed","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],["rowCountApi","/api/orders/allcount",3,"next","previous","filter","totaldata"],[1,"lh-sm"],[1,"d-flex","align-items-end","gap-2"],[2,"width","14px","padding-bottom","2.5px",3,"src","alt"],[3,"order"],[3,"variants"],[3,"variant"]],template:function(p,o){if(p&1){let s=M();R(0),w(1,"async"),t(2,"mainpanel",0),T("onSubmit",function(){return u(s),c(o.initAllOrders())}),S("textChange",function(n){return u(s),h(o.filter().Number,n)||(o.filter().Number=n),c(n)}),t(3,"actions")(4,"a",1),f(5,"i",2),t(6,"span"),a(7,"Order Fulfillment Display"),i()()(),t(8,"filters")(9,"div")(10,"label",3),a(11,"Channel"),i(),t(12,"app-channel-options-v2",4),S("ngModelChange",function(n){return u(s),h(o.filter().ListChannelID,n)||(o.filter().ListChannelID=n),c(n)}),i()(),t(13,"div",5)(14,"label",3),a(15,"From/To"),i(),t(16,"div",6)(17,"datepicker",7),S("dateChange",function(n){return u(s),h(o.filter().From,n)||(o.filter().From=n),c(n)}),i()(),t(18,"div")(19,"datepicker",8),S("dateChange",function(n){return u(s),h(o.filter().To,n)||(o.filter().To=n),c(n)}),i()()(),t(20,"div",5)(21,"label",9),a(22,"Page Number"),i(),t(23,"input",10),S("ngModelChange",function(n){return u(s),h(o.filter().PageNumber,n)||(o.filter().PageNumber=n),c(n)}),i()(),t(24,"div",5)(25,"label",9),a(26,"Page Size"),i(),t(27,"input",11),S("ngModelChange",function(n){return u(s),h(o.filter().PageSize,n)||(o.filter().PageSize=n),c(n)}),i()()(),t(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),y(32,we,18,2,"div",15)(33,ye,2,0,"div",16),i()()()()()}if(p&2){let s=H(E(1,8,o.allOrders$)||q(11,fe));l(2),C("text",o.filter().Number),l(10),_("multiple",!0),C("ngModel",o.filter().ListChannelID),l(5),C("date",o.filter().From),l(2),C("date",o.filter().To),l(4),C("ngModel",o.filter().PageNumber),l(4),C("ngModel",o.filter().PageSize),l(5),x((s==null?null:s.length)>0?32:33)}},dependencies:[Y,oe,le,me,ae,ie,Z,te,$,ee,se,ue,ce,re,ne,_e,de,K,X,Q,pe],encapsulation:2});let r=m;return r})();export{qe as AllComponent};