marketplacepos 5.48.2 → 5.48.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/Marketplace/{chunk-H7GV5SNI.js → chunk-2XYIINPQ.js} +1 -1
  2. package/Marketplace/{chunk-CAZ7U2IL.js → chunk-4JRHCYVO.js} +1 -1
  3. package/Marketplace/{chunk-6OIMOM7S.js → chunk-4UPWMQJX.js} +1 -1
  4. package/Marketplace/{chunk-ADKAX3OO.js → chunk-5NFLGFHD.js} +1 -1
  5. package/Marketplace/{chunk-Y77WYZ6Y.js → chunk-5QQCKNH2.js} +1 -1
  6. package/Marketplace/{chunk-XK4RP5MQ.js → chunk-6FAJM27Z.js} +1 -1
  7. package/Marketplace/{chunk-ALPG22RQ.js → chunk-77NAUG5Y.js} +1 -1
  8. package/Marketplace/{chunk-HKHNRMPT.js → chunk-7CYONN5M.js} +1 -1
  9. package/Marketplace/{chunk-FRZCC6KZ.js → chunk-A62IPN6W.js} +1 -1
  10. package/Marketplace/{chunk-5KYN6Y7M.js → chunk-B5AYTAZQ.js} +1 -1
  11. package/Marketplace/{chunk-SZVL42NR.js → chunk-BNAARI67.js} +1 -1
  12. package/Marketplace/{chunk-KZSTYKIP.js → chunk-BTSGHYIF.js} +1 -1
  13. package/Marketplace/{chunk-UCEZJNIL.js → chunk-BUY4AAHK.js} +1 -1
  14. package/Marketplace/{chunk-CLQGGKN6.js → chunk-DCAYH4J7.js} +1 -1
  15. package/Marketplace/{chunk-B6F5PDL5.js → chunk-F7I7HQGQ.js} +1 -1
  16. package/Marketplace/chunk-F7JWZJVZ.js +1 -0
  17. package/Marketplace/{chunk-PLLHTY6O.js → chunk-FQQOS3AF.js} +1 -1
  18. package/Marketplace/{chunk-M65Z55OS.js → chunk-GFVJVBGH.js} +1 -1
  19. package/Marketplace/{chunk-RCBY7EIY.js → chunk-GWYT3CQM.js} +1 -1
  20. package/Marketplace/{chunk-AEVLZ7NS.js → chunk-HANPHNZU.js} +1 -1
  21. package/Marketplace/{chunk-7SB4C4PT.js → chunk-HCR33US3.js} +1 -1
  22. package/Marketplace/{chunk-I723PUUO.js → chunk-HF4T6G54.js} +1 -1
  23. package/Marketplace/{chunk-QCV5XC3U.js → chunk-HUZZJ34K.js} +2 -2
  24. package/Marketplace/{chunk-CBU473N2.js → chunk-IFP44BTX.js} +1 -1
  25. package/Marketplace/chunk-IGS6BEII.js +1 -0
  26. package/Marketplace/{chunk-3JYZF65T.js → chunk-KNPQ6DPC.js} +1 -1
  27. package/Marketplace/{chunk-UBTALPOC.js → chunk-KOQGQF2L.js} +1 -1
  28. package/Marketplace/{chunk-KSVJCX2D.js → chunk-M2FDHHOH.js} +1 -1
  29. package/Marketplace/chunk-MQRQ3LOB.js +1 -0
  30. package/Marketplace/{chunk-TIIGDXIJ.js → chunk-NN6DSN34.js} +2 -2
  31. package/Marketplace/{chunk-2IASUYTM.js → chunk-OR34CB7O.js} +1 -1
  32. package/Marketplace/{chunk-7DT7FQ2T.js → chunk-PHTDDNER.js} +1 -1
  33. package/Marketplace/{chunk-5CHTDUME.js → chunk-PL2WVYMI.js} +1 -1
  34. package/Marketplace/{chunk-DH5CXAEM.js → chunk-QMC2DZIB.js} +1 -1
  35. package/Marketplace/{chunk-PZKN5FIT.js → chunk-QQY7JGZW.js} +1 -1
  36. package/Marketplace/{chunk-ZUL6ZHSW.js → chunk-SZVJOKAX.js} +1 -1
  37. package/Marketplace/{chunk-J6BQDYXO.js → chunk-U6KJZIHD.js} +1 -1
  38. package/Marketplace/{chunk-GVI6GJHY.js → chunk-WFXKYFBX.js} +1 -1
  39. package/Marketplace/{chunk-C6JHPCLF.js → chunk-WPKFNEM6.js} +1 -1
  40. package/Marketplace/{chunk-FCFCTT5A.js → chunk-X2RNU4B3.js} +1 -1
  41. package/Marketplace/{chunk-3K2EKA5O.js → chunk-X7JNYYQS.js} +1 -1
  42. package/Marketplace/{chunk-MKADKY44.js → chunk-XMN2RKK3.js} +1 -1
  43. package/Marketplace/{chunk-IDH7MCR3.js → chunk-YF56YLYK.js} +1 -1
  44. package/Marketplace/chunk-YLQKFPMU.js +1 -0
  45. package/Marketplace/chunk-YN55P3QH.js +1 -0
  46. package/Marketplace/{chunk-GX6JPDQ5.js → chunk-YQWENM2M.js} +1 -1
  47. package/Marketplace/{chunk-LABF6W37.js → chunk-Z5D5R7AO.js} +1 -1
  48. package/Marketplace/index.html +2 -2
  49. package/Marketplace/{main-YJKBQ3LW.js → main-BI4BOJO4.js} +1 -1
  50. package/package.json +1 -1
  51. package/Marketplace/chunk-5X2L45XK.js +0 -1
  52. package/Marketplace/chunk-VYQD3A3M.js +0 -1
  53. package/Marketplace/chunk-WRK3ZHRX.js +0 -1
  54. package/Marketplace/chunk-X6COQADC.js +0 -1
  55. package/Marketplace/chunk-XDBH7EGC.js +0 -1
@@ -1 +1 @@
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
+ import{a as _e}from"./chunk-TYQY4WPY.js";import"./chunk-IM5M2CAI.js";import{a as fe}from"./chunk-6FAJM27Z.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-OR34CB7O.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-4UPWMQJX.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-HF4T6G54.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{b as w}from"./chunk-6OIMOM7S.js";import"./chunk-A6QXXKPR.js";import"./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{m as k,n as B}from"./chunk-EDEZ3JLR.js";import"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import"./chunk-ZETUYNFJ.js";import"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{D as P,G as T,I as R,i as M,j as y,l as I,m as g}from"./chunk-LNJUGHOX.js";import{$b as c,Gb as E,Mc as i,Nc as l,Oc as D,aa as C,bc as p,gc as _,hc as t,hd as v,ic as e,id as b,jd as x,nb as d,ra as u,v as h,xc as f}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";function L(a,o){if(a&1&&(t(0,"div",9)(1,"div",12)(2,"div",6)(3,"h5"),i(4,"Perflog"),e()(),t(5,"div",7)(6,"div",13)(7,"div",14)(8,"pre"),i(9),e()()()()()()),a&2){let n=f();d(9),l(n.Perflog)}}function N(a,o){if(a&1&&(t(0,"div",15)(1,"div",12)(2,"div",6)(3,"h5"),i(4,"StackTrace"),e()(),t(5,"div",7)(6,"div",13)(7,"div",14)(8,"pre"),i(9),e()()()()()()),a&2){let n=f();d(9),l(n==null?null:n.StackTrace)}}function A(a,o){if(a&1&&(t(0,"mainpanel",0)(1,"actions")(2,"a",1),i(3,"Back"),e()(),t(4,"content")(5,"div",2)(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"h5"),i(11,"General"),e()(),t(12,"div",7)(13,"div",8)(14,"div",9)(15,"div",10)(16,"label"),i(17,"Created Date"),e(),t(18,"div")(19,"span"),i(20),v(21,"date"),e()()()(),t(22,"div",9)(23,"div",10)(24,"label"),i(25,"Status"),e(),t(26,"div")(27,"span"),i(28),e()()()()(),t(29,"div",11)(30,"div",9)(31,"div",10)(32,"label"),i(33,"Duration"),e(),t(34,"div")(35,"span"),i(36),v(37,"number"),e()()()(),t(38,"div",9)(39,"div",10)(40,"label"),i(41,"Label"),e(),t(42,"div")(43,"span"),i(44),e()()()()()()()()(),t(45,"div",3)(46,"div",9)(47,"div",12)(48,"div",6)(49,"h5"),i(50,"Message"),e()(),t(51,"div",7)(52,"div",13)(53,"div",14)(54,"pre"),i(55),e()()()()()(),c(56,L,10,1,"div",9),c(57,N,10,1,"div",15),e()()()()),a&2){let n=o;_("headerTitle","Notification "+n.Name)("hideSearchBox",!0)("hideSearchDropdown",!0),d(20),l(x(21,10,n.Created,"dd MMM yyyy HH:mm:ss")),d(8),l(n.StatusLabel),d(8),D("",x(37,13,n.DurationInSecond,"1.1-1")," s"),d(8),l(n.Label),d(11),l(n.Message),d(),p(n!=null&&n.Perflog?56:-1),d(),p(n!=null&&n.StackTrace?57:-1)}}var V=(()=>{let o=class o{constructor(){this.activatedRoute=u(P),this.notificationService=u(w)}ngOnInit(){this.notification$=this.activatedRoute.queryParams.pipe(C(s=>{let r=s.ID;return this.notificationService.getNotificationDetail(r).pipe(h(m=>(m.DurationInSecond=parseInt(m.Duration)/1e3,m)))}))}};o.\u0275fac=function(r){return new(r||o)},o.\u0275cmp=E({type:o,selectors:[["app-detail"]],decls:2,vars:3,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/products/status/notification",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-8"],[1,"row"],[1,"col-12"],[1,"card","mb-8"],[1,"card-header"],[1,"card-body"],[1,"row","mt-6"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-4"],[1,"card"],[1,"col-sm-12","mt-2"],[1,"form-group"],[1,"col-sm-12"]],template:function(r,m){if(r&1&&(c(0,A,58,16,"mainpanel",0),v(1,"async")),r&2){let S;p((S=b(1,1,m.notification$))?0:-1,S)}},dependencies:[g,B,k,R,T,M,I,y],encapsulation:2});let a=o;return a})();export{V as DetailComponent};
1
+ import{b as w}from"./chunk-4UPWMQJX.js";import"./chunk-A6QXXKPR.js";import"./chunk-HF4T6G54.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{m as k,n as B}from"./chunk-EDEZ3JLR.js";import"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import"./chunk-ZETUYNFJ.js";import"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{D as P,G as T,I as R,i as M,j as y,l as I,m as g}from"./chunk-LNJUGHOX.js";import{$b as c,Gb as E,Mc as i,Nc as l,Oc as D,aa as C,bc as p,gc as _,hc as t,hd as v,ic as e,id as b,jd as x,nb as d,ra as u,v as h,xc as f}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";function L(a,o){if(a&1&&(t(0,"div",9)(1,"div",12)(2,"div",6)(3,"h5"),i(4,"Perflog"),e()(),t(5,"div",7)(6,"div",13)(7,"div",14)(8,"pre"),i(9),e()()()()()()),a&2){let n=f();d(9),l(n.Perflog)}}function N(a,o){if(a&1&&(t(0,"div",15)(1,"div",12)(2,"div",6)(3,"h5"),i(4,"StackTrace"),e()(),t(5,"div",7)(6,"div",13)(7,"div",14)(8,"pre"),i(9),e()()()()()()),a&2){let n=f();d(9),l(n==null?null:n.StackTrace)}}function A(a,o){if(a&1&&(t(0,"mainpanel",0)(1,"actions")(2,"a",1),i(3,"Back"),e()(),t(4,"content")(5,"div",2)(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"h5"),i(11,"General"),e()(),t(12,"div",7)(13,"div",8)(14,"div",9)(15,"div",10)(16,"label"),i(17,"Created Date"),e(),t(18,"div")(19,"span"),i(20),v(21,"date"),e()()()(),t(22,"div",9)(23,"div",10)(24,"label"),i(25,"Status"),e(),t(26,"div")(27,"span"),i(28),e()()()()(),t(29,"div",11)(30,"div",9)(31,"div",10)(32,"label"),i(33,"Duration"),e(),t(34,"div")(35,"span"),i(36),v(37,"number"),e()()()(),t(38,"div",9)(39,"div",10)(40,"label"),i(41,"Label"),e(),t(42,"div")(43,"span"),i(44),e()()()()()()()()(),t(45,"div",3)(46,"div",9)(47,"div",12)(48,"div",6)(49,"h5"),i(50,"Message"),e()(),t(51,"div",7)(52,"div",13)(53,"div",14)(54,"pre"),i(55),e()()()()()(),c(56,L,10,1,"div",9),c(57,N,10,1,"div",15),e()()()()),a&2){let n=o;_("headerTitle","Notification "+n.Name)("hideSearchBox",!0)("hideSearchDropdown",!0),d(20),l(x(21,10,n.Created,"dd MMM yyyy HH:mm:ss")),d(8),l(n.StatusLabel),d(8),D("",x(37,13,n.DurationInSecond,"1.1-1")," s"),d(8),l(n.Label),d(11),l(n.Message),d(),p(n!=null&&n.Perflog?56:-1),d(),p(n!=null&&n.StackTrace?57:-1)}}var V=(()=>{let o=class o{constructor(){this.activatedRoute=u(P),this.notificationService=u(w)}ngOnInit(){this.notification$=this.activatedRoute.queryParams.pipe(C(s=>{let r=s.ID;return this.notificationService.getNotificationDetail(r).pipe(h(m=>(m.DurationInSecond=parseInt(m.Duration)/1e3,m)))}))}};o.\u0275fac=function(r){return new(r||o)},o.\u0275cmp=E({type:o,selectors:[["app-detail"]],decls:2,vars:3,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/products/status/notification",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-8"],[1,"row"],[1,"col-12"],[1,"card","mb-8"],[1,"card-header"],[1,"card-body"],[1,"row","mt-6"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-4"],[1,"card"],[1,"col-sm-12","mt-2"],[1,"form-group"],[1,"col-sm-12"]],template:function(r,m){if(r&1&&(c(0,A,58,16,"mainpanel",0),v(1,"async")),r&2){let S;p((S=b(1,1,m.notification$))?0:-1,S)}},dependencies:[g,B,k,R,T,M,I,y],encapsulation:2});let a=o;return a})();export{V as DetailComponent};
@@ -1 +1 @@
1
- import{a as b}from"./chunk-S7CKRTJV.js";import"./chunk-AFIF6VRM.js";import"./chunk-ZW2TMVZP.js";import{a as I}from"./chunk-UCEZJNIL.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{a as ce,b as fe}from"./chunk-A7PUMY67.js";import"./chunk-N5AE5WMQ.js";import"./chunk-A6QXXKPR.js";import"./chunk-I723PUUO.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-AGBJEXIM.js";import{e as pe}from"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import{c as f}from"./chunk-JBEKD57G.js";import{m as w,n as he}from"./chunk-EDEZ3JLR.js";import{A as se}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import"./chunk-ZETUYNFJ.js";import"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{E as le,G as me,I as de,i as oe,j as D,l as re,m as ae}from"./chunk-LNJUGHOX.js";import{$b as _,Gb as v,Hb as $,Lc as te,Mc as c,Nc as U,Oc as J,Qc as y,Rc as C,Sc as g,Wc as Q,Z as z,_c as ie,bc as S,cc as ee,dc as V,dd as ne,ea as q,ec as A,fc as G,gc as p,hc as r,hd as x,ic as l,id as k,jc as T,lb as j,ma as X,na as Y,nb as m,od as H,qa as Z,ra as h,td as K,vc as P,xc as u}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var ue=(()=>{let o=class o{constructor(){this.reportTabs=[{Title:"1.Create Order",Url:"/menu/sync-log/order/sync-order"},{Title:"2.Convert Order To Invoice",Url:"/menu/sync-log/order/convert-to-invoice"},{Title:"3.Create Invoice",Url:"/menu/sync-log/order/invoice"},{Title:"4.Create Outbound Logistic",Url:"/menu/sync-log/order/delivery"},{Title:"5.Add Payment",Url:"/menu/sync-log/order/payment"},{Title:"6.Void Invoice",Url:"/menu/sync-log/order/void-invoice"},{Title:"All",Url:"/menu/sync-log/order/all"}]}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=v({type:o,selectors:[["app-order"]],standalone:!1,decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,i){t&1&&(r(0,"nav",0)(1,"div",1)(2,"div"),T(3,"nav-tab",2),l()()(),T(4,"router-outlet")),t&2&&(m(3),p("Tabs",i.reportTabs))},dependencies:[ce,le],styles:[".dropdown[_ngcontent-%COMP%] .dropdown-menu.report.show[_ngcontent-%COMP%]{top:100%!important;transform:none!important;z-index:10000;cursor:pointer;right:-50%}"]});let n=o;return n})();var F=class{};var E=(()=>{let o=class o{constructor(e){this.http=e}GetLoader(){return this.http.post("/api/Report/GetLoader",{})}GetSyncOrder(e){return new Promise((t,i)=>{this.http.post("/api/Report/Salesorder",JSON.stringify(e)).subscribe(s=>{t(s)})})}GetSyncInvoice(e){return new Promise((t,i)=>{this.http.post("/api/Report/CreateInvoice",JSON.stringify(e)).subscribe(s=>{t(s)})})}GetSyncVoidInvoice(e){return new Promise((t,i)=>{this.http.post("/api/Report/Void",JSON.stringify(e)).subscribe(s=>{t(s)})})}GetSyncConvertInvoice(e){return new Promise((t,i)=>{this.http.post("/api/Report/ConvertToInvoice",JSON.stringify(e)).subscribe(s=>{t(s)})})}GetSyncDelivery(e){return new Promise((t,i)=>{this.http.post("/api/Report/Delivery",JSON.stringify(e)).subscribe(s=>{t(s)})})}GetSyncPayment(e){return new Promise((t,i)=>{this.http.post("/api/Report/Payment",JSON.stringify(e)).subscribe(s=>{t(s)})})}getAllReport(e){return this.http.post("/api/Report/all",JSON.stringify(e))}};o.\u0275fac=function(t){return new(t||o)(Z(pe))},o.\u0275prov=X({token:o,factory:o.\u0275fac,providedIn:"root"});let n=o;return n})();var O=(function(n){return n[n.OK=200]="OK",n[n.BAD_REQUEST=400]="BAD_REQUEST",n[n.CONFLICT=409]="CONFLICT",n[n.NOT_FOUND=404]="NOT_FOUND",n[n.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",n})(O||{});var De=()=>["/menu/log/order"],we=(n,o,d,e,t)=>({responseCode:n,From:o,to:d,actionType:e,ChannelID:t});function Ee(n,o){if(n&1&&(r(0,"th",4)(1,"div",5)(2,"h4"),c(3),l(),r(4,"small",6),c(5),l()()()),n&2){let d=o.$implicit,e=u();m(3),U(d),m(),te(e.getTextBgColor(d)),m(),U(e.getHeaderStatusDesc(d))}}function Re(n,o){if(n&1&&(r(0,"a",10),c(1),x(2,"number"),l()),n&2){let d=u().$implicit,e=u().$implicit,t=u();p("routerLink",ie(5,De))("queryParams",ne(6,we,d.Key,t.fromQueryParam,t.toQueryParam,t.type(),e.ChannelID)),m(),J(" ",k(2,3,d.Value)," ")}}function Le(n,o){n&1&&(r(0,"span",11),c(1,"-"),l())}function Oe(n,o){if(n&1&&(r(0,"td",9),_(1,Re,3,12,"a",10)(2,Le,2,0,"span",11),l()),n&2){let d=o.$implicit;m(),S(d.Value?1:2)}}function Ie(n,o){if(n&1&&(r(0,"tr")(1,"td")(2,"a",7),T(3,"img",8),l()(),r(4,"td")(5,"div")(6,"a",7),c(7),l()(),r(8,"div"),c(9),l()(),A(10,Oe,3,1,"td",9,ee),l()),n&2){let d=o.$implicit,e=u();m(2),p("href",Q(d.Url),j),m(),p("src",e.getChannelLogo(d.Type),j),m(3),p("href",Q(d.Url),j),m(),U(d.Name),m(2),U(d.Url),m(),G(d.list)}}function Me(n,o){if(n&1&&(r(0,"td",9)(1,"div",14),c(2),x(3,"number"),l()()),n&2){let d=o.$implicit;m(2),J(" ",k(3,1,d.total)," ")}}function xe(n,o){if(n&1&&(r(0,"tfoot")(1,"tr")(2,"td",12)(3,"div",13),c(4,"Total"),l()(),A(5,Me,4,3,"td",9,V),l()()),n&2){let d=u();m(5),G(d.logsCalculation())}}var R=(()=>{let o=class o{constructor(){this.header=K([]),this.result=K([]),this.orderedHeader=H(()=>this.header().sort((e,t)=>e-t)),this.logsOrdered=H(()=>{let e=this.result();return e=e.map(t=>(this.orderedHeader().forEach(i=>{t.list.findIndex(a=>a.Key===i)===-1&&t.list.push({Key:i,Value:0}),t.list.sort((a,W)=>a.Key-W.Key)}),t)),e}),this.logsCalculation=H(()=>{let e=this.concatStatusCode(),t=[];return this.orderedHeader().forEach(i=>{let a=e.filter(W=>W.Key===i).reduce((W,be)=>W+be.Value,0);t.push({status:i,total:a})}),t}),this.type=K(null),this.headerStatus=O,this.listCalculationStatusCode=[]}set from(e){e&&(this.fromQueryParam=new Date(e).toJSON().toString())}set to(e){e&&(this.toQueryParam=new Date(e).toJSON().toString())}getHeaderStatusDesc(e){let t=null;switch(e){case O.BAD_REQUEST:t="BAD REQUEST";break;case O.CONFLICT:t="CONFLICT";break;case O.INTERNAL_SERVER_ERROR:t="INTERNAL SERVER ERROR";break;case O.NOT_FOUND:t="NOT FOUND";break;default:t="OK";break}return t}getTextBgColor(e){let t=null;switch(e){case O.OK:t="bg-success";break;case O.INTERNAL_SERVER_ERROR:t="bg-danger";break;default:t="bg-warning";break}return t}getChannelLogo(e){return f.getChannelLogoByTypeId(e)}concatStatusCode(){return this.logsOrdered().map(e=>e.list).reduce((e,t)=>[...e,...t],[])}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=v({type:o,selectors:[["app-table-report"]],inputs:{header:[1,"header"],result:[1,"result"],from:"from",to:"to",type:[1,"type"]},standalone:!1,decls:12,vars:1,consts:[[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","0%"],[2,"width","5%"],[1,"text-start",2,"width","10%"],[1,"d-block"],[1,"text-white","p-1","rounded","response-desc"],["target","_blank",3,"href"],[2,"width","24px","height","24px",3,"src"],[1,"text-start"],[1,"h3","text-primary","fw-bold","ms-1",3,"routerLink","queryParams"],[1,"h3","fw-bold","ms-1"],["colspan","2"],[1,"text-center","h3","fw-bold"],[1,"d-inline-block","h3","text-primary","fw-bold","ms-1"]],template:function(t,i){t&1&&(r(0,"table",0)(1,"thead",1)(2,"tr"),T(3,"th",2),r(4,"th",3),c(5,"Channel"),l(),A(6,Ee,6,4,"th",4,V),l()(),r(8,"tbody"),A(9,Ie,12,7,"tr",null,V),l(),_(11,xe,7,0,"tfoot"),l()),t&2&&(m(6),G(i.orderedHeader()),m(3),G(i.logsOrdered()),m(2),S(i.logsCalculation().length>0?11:-1))},dependencies:[me,re],styles:[".response-desc[_ngcontent-%COMP%]{font-size:12px}"]});let n=o;return n})();function ke(n,o){if(n&1&&(r(0,"div",6)(1,"div",7),T(2,"app-table-report",8),l()()),n&2){let d=u();m(2),p("result",d.result)("header",d.header)("from",d.filter.From)("to",d.filter.To)("type",0)}}var ye=(()=>{let o=class o{constructor(){this.http=h(E),this.datePipe=h(D),this.filter=new F,this.pageTitle="New Order";let e=new Date;this.maxDate=e,this.minDate=f.addDays(e,6),this.filter.From=e,this.filter.To=e,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),t=this.datePipe.transform(this.filter.From,e),i=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.pageTitle=`New Order (${e==null?"":t+"-"} ${i})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncOrder(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=v({type:o,selectors:[["app-sales-order"]],standalone:!1,decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(t,i){t&1&&(r(0,"mainpanel",0),P("onSubmit",function(){return i.getChannelLogs()}),r(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),l(),r(5,"div",2)(6,"datepicker",3),g("dateChange",function(a){return C(i.filter.From,a)||(i.filter.From=a),a}),l()(),r(7,"div")(8,"datepicker",4),g("dateChange",function(a){return C(i.filter.To,a)||(i.filter.To=a),a}),l()()()(),r(9,"content")(10,"div",5),_(11,ke,3,5,"div",6),l()()()),t&2&&(p("headerTitle",i.pageTitle)("hideSearchBox",!0),m(6),y("date",i.filter.From),m(2),y("date",i.filter.To),m(3),S(i.result?11:-1))},dependencies:[w,b,R],encapsulation:2});let n=o;return n})();function Be(n,o){if(n&1&&(r(0,"div",6)(1,"div",7),T(2,"app-table-report",8),l()()),n&2){let d=u();m(2),p("result",d.result)("header",d.header)("from",d.filter.From)("to",d.filter.To)("type",1)}}var Ce=(()=>{let o=class o{constructor(){this.http=h(E),this.datePipe=h(D),this.filter=new F,this.PageTitle="Ready to Ship";let e=new Date;this.maxDate=e,this.minDate=f.addDays(e,6),this.filter.From=e,this.filter.To=e,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),t=this.datePipe.transform(this.filter.From,e),i=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Ready to Ship (${e==null?"":t+"-"} ${i})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=v({type:o,selectors:[["app-invoice"]],standalone:!1,decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(t,i){t&1&&(r(0,"mainpanel",0),P("onSubmit",function(){return i.onFilter()}),r(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),l(),r(5,"div",2)(6,"datepicker",3),g("dateChange",function(a){return C(i.filter.From,a)||(i.filter.From=a),a}),l()(),r(7,"div")(8,"datepicker",4),g("dateChange",function(a){return C(i.filter.To,a)||(i.filter.To=a),a}),l()()()(),r(9,"content")(10,"div",5),_(11,Be,3,5,"div",6),l()()()),t&2&&(p("headerTitle",i.PageTitle)("hideSearchBox",!0),m(6),y("date",i.filter.From),m(2),y("date",i.filter.To),m(3),S(i.result?11:-1))},dependencies:[w,b,R],encapsulation:2});let n=o;return n})();function Ne(n,o){if(n&1&&(r(0,"div",7)(1,"div",8),T(2,"app-table-report",9),l()()),n&2){let d=u();m(2),p("result",d.result)("header",d.header)("from",d.filter.From)("to",d.filter.To)("type",3)}}var ge=(()=>{let o=class o{constructor(){this.http=h(E),this.datePipe=h(D),this.filter=new F;let e=new Date;this.maxDate=e,this.minDate=f.addDays(e,6),this.filter.From=e,this.filter.To=e,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),t=this.datePipe.transform(this.filter.From,e),i=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Shipped (${e==null?"":t+"-"} ${i})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncDelivery(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=v({type:o,selectors:[["app-delivery"]],standalone:!1,decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"filterDate"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(t,i){t&1&&(r(0,"mainpanel",0),P("onSubmit",function(){return i.onFilter()}),r(1,"filters")(2,"div",1)(3,"label",2),c(4,"From/To"),l(),r(5,"div",3)(6,"datepicker",4),g("dateChange",function(a){return C(i.filter.From,a)||(i.filter.From=a),a}),l()(),r(7,"div")(8,"datepicker",5),g("dateChange",function(a){return C(i.filter.To,a)||(i.filter.To=a),a}),l()()()(),r(9,"content")(10,"div",6),_(11,Ne,3,5,"div",7),l()()()),t&2&&(p("headerTitle",i.PageTitle)("hideSearchBox",!0),m(6),y("date",i.filter.From),m(2),y("date",i.filter.To),m(3),S(i.result?11:-1))},dependencies:[w,b,R],encapsulation:2});let n=o;return n})();function We(n,o){if(n&1&&(r(0,"div",6)(1,"div",7),T(2,"app-table-report",8),l()()),n&2){let d=u();m(2),p("result",d.result)("header",d.header)("from",d.filter.From)("to",d.filter.To)("type",4)}}var Te=(()=>{let o=class o{constructor(){this.http=h(E),this.datePipe=h(D),this.filter=new F,this.PageTitle="Completed";let e=new Date;this.minDate=f.addDays(e,6),this.filter.From=e,this.filter.To=e,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),t=this.datePipe.transform(this.filter.From,e),i=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Completed (${e==null?"":t+"-"} ${i})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncPayment(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=v({type:o,selectors:[["app-payment"]],standalone:!1,decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(t,i){t&1&&(r(0,"mainpanel",0),P("onSubmit",function(){return i.onFilter()}),r(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),l(),r(5,"div",2)(6,"datepicker",3),g("dateChange",function(a){return C(i.filter.From,a)||(i.filter.From=a),a}),l()(),r(7,"div")(8,"datepicker",4),g("dateChange",function(a){return C(i.filter.To,a)||(i.filter.To=a),a}),l()()()(),r(9,"content")(10,"div",5),_(11,We,3,5,"div",6),l()()()),t&2&&(p("headerTitle",i.PageTitle)("hideSearchBox",!0),m(6),y("date",i.filter.From),m(2),y("date",i.filter.To),m(3),S(i.result?11:-1))},dependencies:[w,b,R],encapsulation:2});let n=o;return n})();function Ae(n,o){}function Ge(n,o){if(n&1&&(r(0,"div",6)(1,"div",7),T(2,"app-table-report",8),l()()),n&2){let d=o,e=u();m(2),p("result",d.Body)("header",d.Header)("from",e.filter==null?null:e.filter.From)("to",e.filter==null?null:e.filter.To)}}var ve=(()=>{let o=class o{constructor(){this.reportOrderService=h(E),this.datePipe=h(D),this.filter=new F}ngOnInit(){this.initFilter(),this.initLoader()}initFilter(){let e=new Date;this.minDate=f.addDays(e,6),this.filter.From=e,this.filter.To=e,this.updatePageTitle()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),t=this.datePipe.transform(this.filter.From,e),i=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.pageTitle=`All (${e==null?"":t+"-"} ${i})`}initLoader(){this.pageLoader$=this.reportOrderService.GetLoader().pipe(q(e=>{this.filter=e,this.updatePageTitle(),this.initData()}))}initData(){this.reportData$=this.reportOrderService.getAllReport(this.filter).pipe(z())}onFilter(){this.updatePageTitle(),this.initData()}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=v({type:o,selectors:[["app-all"]],standalone:!1,decls:15,vars:10,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to"]],template:function(t,i){if(t&1&&(r(0,"mainpanel",0),P("onSubmit",function(){return i.onFilter()}),r(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),l(),r(5,"div",2)(6,"datepicker",3),g("dateChange",function(a){return C(i.filter.From,a)||(i.filter.From=a),a}),l()(),r(7,"div")(8,"datepicker",4),g("dateChange",function(a){return C(i.filter.To,a)||(i.filter.To=a),a}),l()()()(),r(9,"content")(10,"div",5),_(11,Ae,0,0),x(12,"async"),_(13,Ge,3,4,"div",6),x(14,"async"),l()()()),t&2){let s;p("headerTitle",i.pageTitle)("hideSearchBox",!0),m(6),y("date",i.filter.From),m(2),y("date",i.filter.To),m(3),S(k(12,6,i.pageLoader$)?11:-1),m(2),S((s=k(14,8,i.reportData$))?13:-1,s)}},dependencies:[w,b,R,oe],encapsulation:2});let n=o;return n})();function Ue(n,o){if(n&1&&(r(0,"div",6)(1,"div",7),T(2,"app-table-report",8),l()()),n&2){let d=u();m(2),p("result",d.result)("header",d.header)("from",d.filter.From)("to",d.filter.To)("type",1)}}var _e=(()=>{let o=class o{constructor(){this.http=h(E),this.datePipe=h(D),this.filter=new F,this.PageTitle="Convert Sales Order To Invoice";let e=new Date;this.maxDate=e,this.minDate=f.addDays(e,6),this.filter.From=e,this.filter.To=e,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),t=this.datePipe.transform(this.filter.From,e),i=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Convert Sales Order To Invoice (${e==null?"":t+"-"} ${i})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=v({type:o,selectors:[["app-convert-invoice"]],standalone:!1,decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(t,i){t&1&&(r(0,"mainpanel",0),P("onSubmit",function(){return i.onFilter()}),r(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),l(),r(5,"div",2)(6,"datepicker",3),g("dateChange",function(a){return C(i.filter.From,a)||(i.filter.From=a),a}),l()(),r(7,"div")(8,"datepicker",4),g("dateChange",function(a){return C(i.filter.To,a)||(i.filter.To=a),a}),l()()()(),r(9,"content")(10,"div",5),_(11,Ue,3,5,"div",6),l()()()),t&2&&(p("headerTitle",i.PageTitle)("hideSearchBox",!0),m(6),y("date",i.filter.From),m(2),y("date",i.filter.To),m(3),S(i.result?11:-1))},dependencies:[w,b,R],encapsulation:2});let n=o;return n})();function je(n,o){if(n&1&&(r(0,"div",6)(1,"div",7),T(2,"app-table-report",8),l()()),n&2){let d=u();m(2),p("result",d.result)("header",d.header)("from",d.filter.From)("to",d.filter.To)("type",1)}}var Se=(()=>{let o=class o{constructor(){this.http=h(E),this.datePipe=h(D),this.filter=new F,this.PageTitle="Ready to Ship";let e=new Date;this.maxDate=e,this.minDate=f.addDays(e,6),this.filter.From=e,this.filter.To=e,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),t=this.datePipe.transform(this.filter.From,e),i=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Ready to Ship (${e==null?"":t+"-"} ${i})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=v({type:o,selectors:[["app-void-invoice"]],standalone:!1,decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(t,i){t&1&&(r(0,"mainpanel",0),P("onSubmit",function(){return i.onFilter()}),r(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),l(),r(5,"div",2)(6,"datepicker",3),g("dateChange",function(a){return C(i.filter.From,a)||(i.filter.From=a),a}),l()(),r(7,"div")(8,"datepicker",4),g("dateChange",function(a){return C(i.filter.To,a)||(i.filter.To=a),a}),l()()()(),r(9,"content")(10,"div",5),_(11,je,3,5,"div",6),l()()()),t&2&&(p("headerTitle",i.PageTitle)("hideSearchBox",!0),m(6),y("date",i.filter.From),m(2),y("date",i.filter.To),m(3),S(i.result?11:-1))},dependencies:[w,b,R],encapsulation:2});let n=o;return n})();var Ve=[{path:"",component:ue,children:[{path:"",redirectTo:"all",pathMatch:"full"},{path:"sync-order",component:ye,canActivate:[I],data:{title:"Sync Order"}},{path:"convert-to-invoice",component:_e,canActivate:[I],data:{title:"Sync Convert to Invoice"}},{path:"invoice",component:Ce,canActivate:[I],data:{title:"Sync Invoice"}},{path:"delivery",component:ge,canActivate:[I],data:{title:"Sync Delivery"}},{path:"payment",component:Te,canActivate:[I],data:{title:"Sync Payment"}},{path:"void-invoice",component:Se,canActivate:[I],data:{title:"Sync void invoice"}},{path:"all",component:ve,canActivate:[I],data:{title:"All Report"}}]}],hi=(()=>{let o=class o{};o.\u0275fac=function(t){return new(t||o)},o.\u0275mod=$({type:o}),o.\u0275inj=Y({imports:[ae,fe,se,he,b,de.forChild(Ve)]});let n=o;return n})();export{hi as OrderModule};
1
+ import{a as b}from"./chunk-S7CKRTJV.js";import"./chunk-AFIF6VRM.js";import"./chunk-ZW2TMVZP.js";import{a as I}from"./chunk-BUY4AAHK.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{a as ce,b as fe}from"./chunk-A7PUMY67.js";import"./chunk-N5AE5WMQ.js";import"./chunk-A6QXXKPR.js";import"./chunk-HF4T6G54.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-AGBJEXIM.js";import{e as pe}from"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import{c as f}from"./chunk-JBEKD57G.js";import{m as w,n as he}from"./chunk-EDEZ3JLR.js";import{A as se}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import"./chunk-ZETUYNFJ.js";import"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{E as le,G as me,I as de,i as oe,j as D,l as re,m as ae}from"./chunk-LNJUGHOX.js";import{$b as _,Gb as v,Hb as $,Lc as te,Mc as c,Nc as U,Oc as J,Qc as y,Rc as C,Sc as g,Wc as Q,Z as z,_c as ie,bc as S,cc as ee,dc as V,dd as ne,ea as q,ec as A,fc as G,gc as p,hc as r,hd as x,ic as l,id as k,jc as T,lb as j,ma as X,na as Y,nb as m,od as H,qa as Z,ra as h,td as K,vc as P,xc as u}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var ue=(()=>{let o=class o{constructor(){this.reportTabs=[{Title:"1.Create Order",Url:"/menu/sync-log/order/sync-order"},{Title:"2.Convert Order To Invoice",Url:"/menu/sync-log/order/convert-to-invoice"},{Title:"3.Create Invoice",Url:"/menu/sync-log/order/invoice"},{Title:"4.Create Outbound Logistic",Url:"/menu/sync-log/order/delivery"},{Title:"5.Add Payment",Url:"/menu/sync-log/order/payment"},{Title:"6.Void Invoice",Url:"/menu/sync-log/order/void-invoice"},{Title:"All",Url:"/menu/sync-log/order/all"}]}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=v({type:o,selectors:[["app-order"]],standalone:!1,decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,i){t&1&&(r(0,"nav",0)(1,"div",1)(2,"div"),T(3,"nav-tab",2),l()()(),T(4,"router-outlet")),t&2&&(m(3),p("Tabs",i.reportTabs))},dependencies:[ce,le],styles:[".dropdown[_ngcontent-%COMP%] .dropdown-menu.report.show[_ngcontent-%COMP%]{top:100%!important;transform:none!important;z-index:10000;cursor:pointer;right:-50%}"]});let n=o;return n})();var F=class{};var E=(()=>{let o=class o{constructor(e){this.http=e}GetLoader(){return this.http.post("/api/Report/GetLoader",{})}GetSyncOrder(e){return new Promise((t,i)=>{this.http.post("/api/Report/Salesorder",JSON.stringify(e)).subscribe(s=>{t(s)})})}GetSyncInvoice(e){return new Promise((t,i)=>{this.http.post("/api/Report/CreateInvoice",JSON.stringify(e)).subscribe(s=>{t(s)})})}GetSyncVoidInvoice(e){return new Promise((t,i)=>{this.http.post("/api/Report/Void",JSON.stringify(e)).subscribe(s=>{t(s)})})}GetSyncConvertInvoice(e){return new Promise((t,i)=>{this.http.post("/api/Report/ConvertToInvoice",JSON.stringify(e)).subscribe(s=>{t(s)})})}GetSyncDelivery(e){return new Promise((t,i)=>{this.http.post("/api/Report/Delivery",JSON.stringify(e)).subscribe(s=>{t(s)})})}GetSyncPayment(e){return new Promise((t,i)=>{this.http.post("/api/Report/Payment",JSON.stringify(e)).subscribe(s=>{t(s)})})}getAllReport(e){return this.http.post("/api/Report/all",JSON.stringify(e))}};o.\u0275fac=function(t){return new(t||o)(Z(pe))},o.\u0275prov=X({token:o,factory:o.\u0275fac,providedIn:"root"});let n=o;return n})();var O=(function(n){return n[n.OK=200]="OK",n[n.BAD_REQUEST=400]="BAD_REQUEST",n[n.CONFLICT=409]="CONFLICT",n[n.NOT_FOUND=404]="NOT_FOUND",n[n.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",n})(O||{});var De=()=>["/menu/log/order"],we=(n,o,d,e,t)=>({responseCode:n,From:o,to:d,actionType:e,ChannelID:t});function Ee(n,o){if(n&1&&(r(0,"th",4)(1,"div",5)(2,"h4"),c(3),l(),r(4,"small",6),c(5),l()()()),n&2){let d=o.$implicit,e=u();m(3),U(d),m(),te(e.getTextBgColor(d)),m(),U(e.getHeaderStatusDesc(d))}}function Re(n,o){if(n&1&&(r(0,"a",10),c(1),x(2,"number"),l()),n&2){let d=u().$implicit,e=u().$implicit,t=u();p("routerLink",ie(5,De))("queryParams",ne(6,we,d.Key,t.fromQueryParam,t.toQueryParam,t.type(),e.ChannelID)),m(),J(" ",k(2,3,d.Value)," ")}}function Le(n,o){n&1&&(r(0,"span",11),c(1,"-"),l())}function Oe(n,o){if(n&1&&(r(0,"td",9),_(1,Re,3,12,"a",10)(2,Le,2,0,"span",11),l()),n&2){let d=o.$implicit;m(),S(d.Value?1:2)}}function Ie(n,o){if(n&1&&(r(0,"tr")(1,"td")(2,"a",7),T(3,"img",8),l()(),r(4,"td")(5,"div")(6,"a",7),c(7),l()(),r(8,"div"),c(9),l()(),A(10,Oe,3,1,"td",9,ee),l()),n&2){let d=o.$implicit,e=u();m(2),p("href",Q(d.Url),j),m(),p("src",e.getChannelLogo(d.Type),j),m(3),p("href",Q(d.Url),j),m(),U(d.Name),m(2),U(d.Url),m(),G(d.list)}}function Me(n,o){if(n&1&&(r(0,"td",9)(1,"div",14),c(2),x(3,"number"),l()()),n&2){let d=o.$implicit;m(2),J(" ",k(3,1,d.total)," ")}}function xe(n,o){if(n&1&&(r(0,"tfoot")(1,"tr")(2,"td",12)(3,"div",13),c(4,"Total"),l()(),A(5,Me,4,3,"td",9,V),l()()),n&2){let d=u();m(5),G(d.logsCalculation())}}var R=(()=>{let o=class o{constructor(){this.header=K([]),this.result=K([]),this.orderedHeader=H(()=>this.header().sort((e,t)=>e-t)),this.logsOrdered=H(()=>{let e=this.result();return e=e.map(t=>(this.orderedHeader().forEach(i=>{t.list.findIndex(a=>a.Key===i)===-1&&t.list.push({Key:i,Value:0}),t.list.sort((a,W)=>a.Key-W.Key)}),t)),e}),this.logsCalculation=H(()=>{let e=this.concatStatusCode(),t=[];return this.orderedHeader().forEach(i=>{let a=e.filter(W=>W.Key===i).reduce((W,be)=>W+be.Value,0);t.push({status:i,total:a})}),t}),this.type=K(null),this.headerStatus=O,this.listCalculationStatusCode=[]}set from(e){e&&(this.fromQueryParam=new Date(e).toJSON().toString())}set to(e){e&&(this.toQueryParam=new Date(e).toJSON().toString())}getHeaderStatusDesc(e){let t=null;switch(e){case O.BAD_REQUEST:t="BAD REQUEST";break;case O.CONFLICT:t="CONFLICT";break;case O.INTERNAL_SERVER_ERROR:t="INTERNAL SERVER ERROR";break;case O.NOT_FOUND:t="NOT FOUND";break;default:t="OK";break}return t}getTextBgColor(e){let t=null;switch(e){case O.OK:t="bg-success";break;case O.INTERNAL_SERVER_ERROR:t="bg-danger";break;default:t="bg-warning";break}return t}getChannelLogo(e){return f.getChannelLogoByTypeId(e)}concatStatusCode(){return this.logsOrdered().map(e=>e.list).reduce((e,t)=>[...e,...t],[])}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=v({type:o,selectors:[["app-table-report"]],inputs:{header:[1,"header"],result:[1,"result"],from:"from",to:"to",type:[1,"type"]},standalone:!1,decls:12,vars:1,consts:[[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","0%"],[2,"width","5%"],[1,"text-start",2,"width","10%"],[1,"d-block"],[1,"text-white","p-1","rounded","response-desc"],["target","_blank",3,"href"],[2,"width","24px","height","24px",3,"src"],[1,"text-start"],[1,"h3","text-primary","fw-bold","ms-1",3,"routerLink","queryParams"],[1,"h3","fw-bold","ms-1"],["colspan","2"],[1,"text-center","h3","fw-bold"],[1,"d-inline-block","h3","text-primary","fw-bold","ms-1"]],template:function(t,i){t&1&&(r(0,"table",0)(1,"thead",1)(2,"tr"),T(3,"th",2),r(4,"th",3),c(5,"Channel"),l(),A(6,Ee,6,4,"th",4,V),l()(),r(8,"tbody"),A(9,Ie,12,7,"tr",null,V),l(),_(11,xe,7,0,"tfoot"),l()),t&2&&(m(6),G(i.orderedHeader()),m(3),G(i.logsOrdered()),m(2),S(i.logsCalculation().length>0?11:-1))},dependencies:[me,re],styles:[".response-desc[_ngcontent-%COMP%]{font-size:12px}"]});let n=o;return n})();function ke(n,o){if(n&1&&(r(0,"div",6)(1,"div",7),T(2,"app-table-report",8),l()()),n&2){let d=u();m(2),p("result",d.result)("header",d.header)("from",d.filter.From)("to",d.filter.To)("type",0)}}var ye=(()=>{let o=class o{constructor(){this.http=h(E),this.datePipe=h(D),this.filter=new F,this.pageTitle="New Order";let e=new Date;this.maxDate=e,this.minDate=f.addDays(e,6),this.filter.From=e,this.filter.To=e,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),t=this.datePipe.transform(this.filter.From,e),i=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.pageTitle=`New Order (${e==null?"":t+"-"} ${i})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncOrder(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=v({type:o,selectors:[["app-sales-order"]],standalone:!1,decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(t,i){t&1&&(r(0,"mainpanel",0),P("onSubmit",function(){return i.getChannelLogs()}),r(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),l(),r(5,"div",2)(6,"datepicker",3),g("dateChange",function(a){return C(i.filter.From,a)||(i.filter.From=a),a}),l()(),r(7,"div")(8,"datepicker",4),g("dateChange",function(a){return C(i.filter.To,a)||(i.filter.To=a),a}),l()()()(),r(9,"content")(10,"div",5),_(11,ke,3,5,"div",6),l()()()),t&2&&(p("headerTitle",i.pageTitle)("hideSearchBox",!0),m(6),y("date",i.filter.From),m(2),y("date",i.filter.To),m(3),S(i.result?11:-1))},dependencies:[w,b,R],encapsulation:2});let n=o;return n})();function Be(n,o){if(n&1&&(r(0,"div",6)(1,"div",7),T(2,"app-table-report",8),l()()),n&2){let d=u();m(2),p("result",d.result)("header",d.header)("from",d.filter.From)("to",d.filter.To)("type",1)}}var Ce=(()=>{let o=class o{constructor(){this.http=h(E),this.datePipe=h(D),this.filter=new F,this.PageTitle="Ready to Ship";let e=new Date;this.maxDate=e,this.minDate=f.addDays(e,6),this.filter.From=e,this.filter.To=e,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),t=this.datePipe.transform(this.filter.From,e),i=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Ready to Ship (${e==null?"":t+"-"} ${i})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=v({type:o,selectors:[["app-invoice"]],standalone:!1,decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(t,i){t&1&&(r(0,"mainpanel",0),P("onSubmit",function(){return i.onFilter()}),r(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),l(),r(5,"div",2)(6,"datepicker",3),g("dateChange",function(a){return C(i.filter.From,a)||(i.filter.From=a),a}),l()(),r(7,"div")(8,"datepicker",4),g("dateChange",function(a){return C(i.filter.To,a)||(i.filter.To=a),a}),l()()()(),r(9,"content")(10,"div",5),_(11,Be,3,5,"div",6),l()()()),t&2&&(p("headerTitle",i.PageTitle)("hideSearchBox",!0),m(6),y("date",i.filter.From),m(2),y("date",i.filter.To),m(3),S(i.result?11:-1))},dependencies:[w,b,R],encapsulation:2});let n=o;return n})();function Ne(n,o){if(n&1&&(r(0,"div",7)(1,"div",8),T(2,"app-table-report",9),l()()),n&2){let d=u();m(2),p("result",d.result)("header",d.header)("from",d.filter.From)("to",d.filter.To)("type",3)}}var ge=(()=>{let o=class o{constructor(){this.http=h(E),this.datePipe=h(D),this.filter=new F;let e=new Date;this.maxDate=e,this.minDate=f.addDays(e,6),this.filter.From=e,this.filter.To=e,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),t=this.datePipe.transform(this.filter.From,e),i=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Shipped (${e==null?"":t+"-"} ${i})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncDelivery(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=v({type:o,selectors:[["app-delivery"]],standalone:!1,decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"filterDate"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(t,i){t&1&&(r(0,"mainpanel",0),P("onSubmit",function(){return i.onFilter()}),r(1,"filters")(2,"div",1)(3,"label",2),c(4,"From/To"),l(),r(5,"div",3)(6,"datepicker",4),g("dateChange",function(a){return C(i.filter.From,a)||(i.filter.From=a),a}),l()(),r(7,"div")(8,"datepicker",5),g("dateChange",function(a){return C(i.filter.To,a)||(i.filter.To=a),a}),l()()()(),r(9,"content")(10,"div",6),_(11,Ne,3,5,"div",7),l()()()),t&2&&(p("headerTitle",i.PageTitle)("hideSearchBox",!0),m(6),y("date",i.filter.From),m(2),y("date",i.filter.To),m(3),S(i.result?11:-1))},dependencies:[w,b,R],encapsulation:2});let n=o;return n})();function We(n,o){if(n&1&&(r(0,"div",6)(1,"div",7),T(2,"app-table-report",8),l()()),n&2){let d=u();m(2),p("result",d.result)("header",d.header)("from",d.filter.From)("to",d.filter.To)("type",4)}}var Te=(()=>{let o=class o{constructor(){this.http=h(E),this.datePipe=h(D),this.filter=new F,this.PageTitle="Completed";let e=new Date;this.minDate=f.addDays(e,6),this.filter.From=e,this.filter.To=e,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),t=this.datePipe.transform(this.filter.From,e),i=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Completed (${e==null?"":t+"-"} ${i})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncPayment(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=v({type:o,selectors:[["app-payment"]],standalone:!1,decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(t,i){t&1&&(r(0,"mainpanel",0),P("onSubmit",function(){return i.onFilter()}),r(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),l(),r(5,"div",2)(6,"datepicker",3),g("dateChange",function(a){return C(i.filter.From,a)||(i.filter.From=a),a}),l()(),r(7,"div")(8,"datepicker",4),g("dateChange",function(a){return C(i.filter.To,a)||(i.filter.To=a),a}),l()()()(),r(9,"content")(10,"div",5),_(11,We,3,5,"div",6),l()()()),t&2&&(p("headerTitle",i.PageTitle)("hideSearchBox",!0),m(6),y("date",i.filter.From),m(2),y("date",i.filter.To),m(3),S(i.result?11:-1))},dependencies:[w,b,R],encapsulation:2});let n=o;return n})();function Ae(n,o){}function Ge(n,o){if(n&1&&(r(0,"div",6)(1,"div",7),T(2,"app-table-report",8),l()()),n&2){let d=o,e=u();m(2),p("result",d.Body)("header",d.Header)("from",e.filter==null?null:e.filter.From)("to",e.filter==null?null:e.filter.To)}}var ve=(()=>{let o=class o{constructor(){this.reportOrderService=h(E),this.datePipe=h(D),this.filter=new F}ngOnInit(){this.initFilter(),this.initLoader()}initFilter(){let e=new Date;this.minDate=f.addDays(e,6),this.filter.From=e,this.filter.To=e,this.updatePageTitle()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),t=this.datePipe.transform(this.filter.From,e),i=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.pageTitle=`All (${e==null?"":t+"-"} ${i})`}initLoader(){this.pageLoader$=this.reportOrderService.GetLoader().pipe(q(e=>{this.filter=e,this.updatePageTitle(),this.initData()}))}initData(){this.reportData$=this.reportOrderService.getAllReport(this.filter).pipe(z())}onFilter(){this.updatePageTitle(),this.initData()}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=v({type:o,selectors:[["app-all"]],standalone:!1,decls:15,vars:10,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to"]],template:function(t,i){if(t&1&&(r(0,"mainpanel",0),P("onSubmit",function(){return i.onFilter()}),r(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),l(),r(5,"div",2)(6,"datepicker",3),g("dateChange",function(a){return C(i.filter.From,a)||(i.filter.From=a),a}),l()(),r(7,"div")(8,"datepicker",4),g("dateChange",function(a){return C(i.filter.To,a)||(i.filter.To=a),a}),l()()()(),r(9,"content")(10,"div",5),_(11,Ae,0,0),x(12,"async"),_(13,Ge,3,4,"div",6),x(14,"async"),l()()()),t&2){let s;p("headerTitle",i.pageTitle)("hideSearchBox",!0),m(6),y("date",i.filter.From),m(2),y("date",i.filter.To),m(3),S(k(12,6,i.pageLoader$)?11:-1),m(2),S((s=k(14,8,i.reportData$))?13:-1,s)}},dependencies:[w,b,R,oe],encapsulation:2});let n=o;return n})();function Ue(n,o){if(n&1&&(r(0,"div",6)(1,"div",7),T(2,"app-table-report",8),l()()),n&2){let d=u();m(2),p("result",d.result)("header",d.header)("from",d.filter.From)("to",d.filter.To)("type",1)}}var _e=(()=>{let o=class o{constructor(){this.http=h(E),this.datePipe=h(D),this.filter=new F,this.PageTitle="Convert Sales Order To Invoice";let e=new Date;this.maxDate=e,this.minDate=f.addDays(e,6),this.filter.From=e,this.filter.To=e,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),t=this.datePipe.transform(this.filter.From,e),i=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Convert Sales Order To Invoice (${e==null?"":t+"-"} ${i})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=v({type:o,selectors:[["app-convert-invoice"]],standalone:!1,decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(t,i){t&1&&(r(0,"mainpanel",0),P("onSubmit",function(){return i.onFilter()}),r(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),l(),r(5,"div",2)(6,"datepicker",3),g("dateChange",function(a){return C(i.filter.From,a)||(i.filter.From=a),a}),l()(),r(7,"div")(8,"datepicker",4),g("dateChange",function(a){return C(i.filter.To,a)||(i.filter.To=a),a}),l()()()(),r(9,"content")(10,"div",5),_(11,Ue,3,5,"div",6),l()()()),t&2&&(p("headerTitle",i.PageTitle)("hideSearchBox",!0),m(6),y("date",i.filter.From),m(2),y("date",i.filter.To),m(3),S(i.result?11:-1))},dependencies:[w,b,R],encapsulation:2});let n=o;return n})();function je(n,o){if(n&1&&(r(0,"div",6)(1,"div",7),T(2,"app-table-report",8),l()()),n&2){let d=u();m(2),p("result",d.result)("header",d.header)("from",d.filter.From)("to",d.filter.To)("type",1)}}var Se=(()=>{let o=class o{constructor(){this.http=h(E),this.datePipe=h(D),this.filter=new F,this.PageTitle="Ready to Ship";let e=new Date;this.maxDate=e,this.minDate=f.addDays(e,6),this.filter.From=e,this.filter.To=e,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),t=this.datePipe.transform(this.filter.From,e),i=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Ready to Ship (${e==null?"":t+"-"} ${i})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=v({type:o,selectors:[["app-void-invoice"]],standalone:!1,decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(t,i){t&1&&(r(0,"mainpanel",0),P("onSubmit",function(){return i.onFilter()}),r(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),l(),r(5,"div",2)(6,"datepicker",3),g("dateChange",function(a){return C(i.filter.From,a)||(i.filter.From=a),a}),l()(),r(7,"div")(8,"datepicker",4),g("dateChange",function(a){return C(i.filter.To,a)||(i.filter.To=a),a}),l()()()(),r(9,"content")(10,"div",5),_(11,je,3,5,"div",6),l()()()),t&2&&(p("headerTitle",i.PageTitle)("hideSearchBox",!0),m(6),y("date",i.filter.From),m(2),y("date",i.filter.To),m(3),S(i.result?11:-1))},dependencies:[w,b,R],encapsulation:2});let n=o;return n})();var Ve=[{path:"",component:ue,children:[{path:"",redirectTo:"all",pathMatch:"full"},{path:"sync-order",component:ye,canActivate:[I],data:{title:"Sync Order"}},{path:"convert-to-invoice",component:_e,canActivate:[I],data:{title:"Sync Convert to Invoice"}},{path:"invoice",component:Ce,canActivate:[I],data:{title:"Sync Invoice"}},{path:"delivery",component:ge,canActivate:[I],data:{title:"Sync Delivery"}},{path:"payment",component:Te,canActivate:[I],data:{title:"Sync Payment"}},{path:"void-invoice",component:Se,canActivate:[I],data:{title:"Sync void invoice"}},{path:"all",component:ve,canActivate:[I],data:{title:"All Report"}}]}],hi=(()=>{let o=class o{};o.\u0275fac=function(t){return new(t||o)},o.\u0275mod=$({type:o}),o.\u0275inj=Y({imports:[ae,fe,se,he,b,de.forChild(Ve)]});let n=o;return n})();export{hi as OrderModule};
@@ -1,4 +1,4 @@
1
- import{a as x}from"./chunk-QXRG5XYP.js";import{a as Xe,b as ye,c as Ye,d as Qe,e as we,f as et,g as Se,h as tt,i as Q,j as ve,k as R}from"./chunk-RXLMJGUY.js";import{a as ot}from"./chunk-AGBJEXIM.js";import{e as oe}from"./chunk-OXWPYJNB.js";import{b as me,c as F}from"./chunk-JBEKD57G.js";import{b as rt}from"./chunk-YTHY4IFS.js";import{a as nt}from"./chunk-ZETUYNFJ.js";import{F as Ze,n as Ge,o as Je}from"./chunk-LNJUGHOX.js";import{Ca as Ve,F as Le,G as Ue,Ha as ne,Hb as q,La as qe,O as he,S as $e,T as He,Va as z,Z as pe,aa as B,ba as fe,c as m,ea as Y,f as Ne,ga as We,ha as Ke,j as Be,k as Me,ma as T,n as Z,na as K,o as re,p as M,pa as P,q as X,qa as g,ra as O,tb as V,ua as ge,v as j,w as Fe,wa as ze,zd as H}from"./chunk-ZYJ6LAJ3.js";import{b as w}from"./chunk-WFMAM73Y.js";import{a as de,i as k}from"./chunk-66YHNWRR.js";var it={production:!0,version:"5.48.2",firebaseConfig:{apiKey:"AIzaSyDnnitFXpM8TglWKNpzu4ChgF98n25Rgvw",authDomain:"auth.dealpos.com",projectId:"devops-signin",storageBucket:"devops-signin.appspot.com",messagingSenderId:"412465165194",appId:"1:412465165194:web:03d806f6b6ab6f8b460e73",measurementId:"G-MNDBRJ5XZD"},news:"https://changelog.dealpos.app/umbraco/delivery/api/v2/content?fetch=children:omni&sort=sortOrder:asc"};var Ct="firebase",Dt="11.10.0";Q(Ct,Dt,"app");var G=new We("ANGULARFIRE2_VERSION");var st=(r,o)=>{let s=o?[o]:tt(),e=[];return s.forEach(t=>{t.container.getProvider(r).instances.forEach(i=>{e.includes(i)||e.push(i)})}),e},ke=(function(r){return r[r.SILENT=0]="SILENT",r[r.WARN=1]="WARN",r[r.VERBOSE=2]="VERBOSE",r})(ke||{}),Lr=H()&&typeof Zone<"u"?ke.WARN:ke.SILENT;var ie=class{zone;delegate;constructor(o,s=Me){this.zone=o,this.delegate=s}now(){return this.delegate.now()}schedule(o,s,e){let t=this.zone,n=function(i){t?t.runGuarded(()=>{o.apply(this,[i])}):o.apply(this,[i])};return this.delegate.schedule(n,s,e)}},Ae=(()=>{class r{outsideAngular;insideAngular;constructor(){let s=O(V);this.outsideAngular=s.runOutsideAngular(()=>new ie(typeof Zone>"u"?void 0:Zone.current)),this.insideAngular=s.run(()=>new ie(typeof Zone>"u"?void 0:Zone.current,Be))}static \u0275fac=function(e){return new(e||r)};static \u0275prov=T({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var xt=new Map,Rt={activated:!1,tokenObservers:[]},_t={initialized:!1,enabled:!1};function _(r){return xt.get(r)||Object.assign({},Rt)}function ut(){return _t}var jt="https://content-firebaseappcheck.googleapis.com/v1";var Ot="exchangeDebugToken",at={OFFSET_DURATION:300*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:960*1e3},Zr=1440*60*1e3;var Ie=class{constructor(o,s,e,t,n){if(this.operation=o,this.retryPolicy=s,this.getWaitDuration=e,this.lowerBound=t,this.upperBound=n,this.pending=null,this.nextErrorWaitInterval=t,t>n)throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}process(o){return k(this,null,function*(){this.stop();try{this.pending=new ye,this.pending.promise.catch(s=>{}),yield Nt(this.getNextRun(o)),this.pending.resolve(),yield this.pending.promise,this.pending=new ye,this.pending.promise.catch(s=>{}),yield this.operation(),this.pending.resolve(),yield this.pending.promise,this.process(!0).catch(()=>{})}catch(s){this.retryPolicy(s)?this.process(!1).catch(()=>{}):this.stop()}})}getNextRun(o){if(o)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{let s=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),s}}};function Nt(r){return new Promise(o=>{setTimeout(o,r)})}var Bt={"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.","initial-throttle":"{$httpStatus} error. Attempts allowed again after {$time}",throttled:"Requests throttled due to previous {$httpStatus} error. Attempts allowed again after {$time}"},U=new Qe("appCheck","AppCheck",Bt);function dt(r){if(!_(r).activated)throw U.create("use-before-activation",{appName:r.name})}function ht(e,t){return k(this,arguments,function*({url:r,body:o},s){let n={"Content-Type":"application/json"},i=s.getImmediate({optional:!0});if(i){let h=yield i.getHeartbeatsHeader();h&&(n["X-Firebase-Client"]=h)}let a={method:"POST",body:JSON.stringify(o),headers:n},l;try{l=yield fetch(r,a)}catch(h){throw U.create("fetch-network-error",{originalErrorMessage:h?.message})}if(l.status!==200)throw U.create("fetch-status-error",{httpStatus:l.status});let c;try{c=yield l.json()}catch(h){throw U.create("fetch-parse-error",{originalErrorMessage:h?.message})}let u=c.ttl.match(/^([\d.]+)(s)$/);if(!u||!u[2]||isNaN(Number(u[1])))throw U.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${c.ttl}`});let f=Number(u[1])*1e3,d=Date.now();return{token:c.token,expireTimeMillis:d+f,issuedAtTimeMillis:d}})}function pt(r,o){let{projectId:s,appId:e,apiKey:t}=r.options;return{url:`${jt}/projects/${s}/apps/${e}:${Ot}?key=${t}`,body:{debug_token:o}}}var Mt="firebase-app-check-database",Ft=1,Te="firebase-app-check-store";var se=null;function Lt(){return se||(se=new Promise((r,o)=>{try{let s=indexedDB.open(Mt,Ft);s.onsuccess=e=>{r(e.target.result)},s.onerror=e=>{var t;o(U.create("storage-open",{originalErrorMessage:(t=e.target.error)===null||t===void 0?void 0:t.message}))},s.onupgradeneeded=e=>{let t=e.target.result;switch(e.oldVersion){case 0:t.createObjectStore(Te,{keyPath:"compositeKey"})}}}catch(s){o(U.create("storage-open",{originalErrorMessage:s?.message}))}}),se)}function Ut(r,o){return $t(Ht(r),o)}function $t(r,o){return k(this,null,function*(){let e=(yield Lt()).transaction(Te,"readwrite"),n=e.objectStore(Te).put({compositeKey:r,value:o});return new Promise((i,a)=>{n.onsuccess=l=>{i()},e.onerror=l=>{var c;a(U.create("storage-set",{originalErrorMessage:(c=l.target.error)===null||c===void 0?void 0:c.message}))}})})}function Ht(r){return`${r.options.appId}-${r.name}`}var ee=new et("@firebase/app-check");function be(r,o){return Ye()?Ut(r,o).catch(s=>{ee.warn(`Failed to write token to IndexedDB. Error: ${s}`)}):Promise.resolve()}function ft(){return ut().enabled}function gt(){return k(this,null,function*(){let r=ut();if(r.enabled&&r.token)return r.token.promise;throw Error(`
1
+ import{a as x}from"./chunk-QXRG5XYP.js";import{a as Xe,b as ye,c as Ye,d as Qe,e as we,f as et,g as Se,h as tt,i as Q,j as ve,k as R}from"./chunk-RXLMJGUY.js";import{a as ot}from"./chunk-AGBJEXIM.js";import{e as oe}from"./chunk-OXWPYJNB.js";import{b as me,c as F}from"./chunk-JBEKD57G.js";import{b as rt}from"./chunk-YTHY4IFS.js";import{a as nt}from"./chunk-ZETUYNFJ.js";import{F as Ze,n as Ge,o as Je}from"./chunk-LNJUGHOX.js";import{Ca as Ve,F as Le,G as Ue,Ha as ne,Hb as q,La as qe,O as he,S as $e,T as He,Va as z,Z as pe,aa as B,ba as fe,c as m,ea as Y,f as Ne,ga as We,ha as Ke,j as Be,k as Me,ma as T,n as Z,na as K,o as re,p as M,pa as P,q as X,qa as g,ra as O,tb as V,ua as ge,v as j,w as Fe,wa as ze,zd as H}from"./chunk-ZYJ6LAJ3.js";import{b as w}from"./chunk-WFMAM73Y.js";import{a as de,i as k}from"./chunk-66YHNWRR.js";var it={production:!0,version:"5.48.3",firebaseConfig:{apiKey:"AIzaSyDnnitFXpM8TglWKNpzu4ChgF98n25Rgvw",authDomain:"auth.dealpos.com",projectId:"devops-signin",storageBucket:"devops-signin.appspot.com",messagingSenderId:"412465165194",appId:"1:412465165194:web:03d806f6b6ab6f8b460e73",measurementId:"G-MNDBRJ5XZD"},news:"https://changelog.dealpos.app/umbraco/delivery/api/v2/content?fetch=children:omni&sort=sortOrder:asc"};var Ct="firebase",Dt="11.10.0";Q(Ct,Dt,"app");var G=new We("ANGULARFIRE2_VERSION");var st=(r,o)=>{let s=o?[o]:tt(),e=[];return s.forEach(t=>{t.container.getProvider(r).instances.forEach(i=>{e.includes(i)||e.push(i)})}),e},ke=(function(r){return r[r.SILENT=0]="SILENT",r[r.WARN=1]="WARN",r[r.VERBOSE=2]="VERBOSE",r})(ke||{}),Lr=H()&&typeof Zone<"u"?ke.WARN:ke.SILENT;var ie=class{zone;delegate;constructor(o,s=Me){this.zone=o,this.delegate=s}now(){return this.delegate.now()}schedule(o,s,e){let t=this.zone,n=function(i){t?t.runGuarded(()=>{o.apply(this,[i])}):o.apply(this,[i])};return this.delegate.schedule(n,s,e)}},Ae=(()=>{class r{outsideAngular;insideAngular;constructor(){let s=O(V);this.outsideAngular=s.runOutsideAngular(()=>new ie(typeof Zone>"u"?void 0:Zone.current)),this.insideAngular=s.run(()=>new ie(typeof Zone>"u"?void 0:Zone.current,Be))}static \u0275fac=function(e){return new(e||r)};static \u0275prov=T({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var xt=new Map,Rt={activated:!1,tokenObservers:[]},_t={initialized:!1,enabled:!1};function _(r){return xt.get(r)||Object.assign({},Rt)}function ut(){return _t}var jt="https://content-firebaseappcheck.googleapis.com/v1";var Ot="exchangeDebugToken",at={OFFSET_DURATION:300*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:960*1e3},Zr=1440*60*1e3;var Ie=class{constructor(o,s,e,t,n){if(this.operation=o,this.retryPolicy=s,this.getWaitDuration=e,this.lowerBound=t,this.upperBound=n,this.pending=null,this.nextErrorWaitInterval=t,t>n)throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}process(o){return k(this,null,function*(){this.stop();try{this.pending=new ye,this.pending.promise.catch(s=>{}),yield Nt(this.getNextRun(o)),this.pending.resolve(),yield this.pending.promise,this.pending=new ye,this.pending.promise.catch(s=>{}),yield this.operation(),this.pending.resolve(),yield this.pending.promise,this.process(!0).catch(()=>{})}catch(s){this.retryPolicy(s)?this.process(!1).catch(()=>{}):this.stop()}})}getNextRun(o){if(o)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{let s=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),s}}};function Nt(r){return new Promise(o=>{setTimeout(o,r)})}var Bt={"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.","initial-throttle":"{$httpStatus} error. Attempts allowed again after {$time}",throttled:"Requests throttled due to previous {$httpStatus} error. Attempts allowed again after {$time}"},U=new Qe("appCheck","AppCheck",Bt);function dt(r){if(!_(r).activated)throw U.create("use-before-activation",{appName:r.name})}function ht(e,t){return k(this,arguments,function*({url:r,body:o},s){let n={"Content-Type":"application/json"},i=s.getImmediate({optional:!0});if(i){let h=yield i.getHeartbeatsHeader();h&&(n["X-Firebase-Client"]=h)}let a={method:"POST",body:JSON.stringify(o),headers:n},l;try{l=yield fetch(r,a)}catch(h){throw U.create("fetch-network-error",{originalErrorMessage:h?.message})}if(l.status!==200)throw U.create("fetch-status-error",{httpStatus:l.status});let c;try{c=yield l.json()}catch(h){throw U.create("fetch-parse-error",{originalErrorMessage:h?.message})}let u=c.ttl.match(/^([\d.]+)(s)$/);if(!u||!u[2]||isNaN(Number(u[1])))throw U.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${c.ttl}`});let f=Number(u[1])*1e3,d=Date.now();return{token:c.token,expireTimeMillis:d+f,issuedAtTimeMillis:d}})}function pt(r,o){let{projectId:s,appId:e,apiKey:t}=r.options;return{url:`${jt}/projects/${s}/apps/${e}:${Ot}?key=${t}`,body:{debug_token:o}}}var Mt="firebase-app-check-database",Ft=1,Te="firebase-app-check-store";var se=null;function Lt(){return se||(se=new Promise((r,o)=>{try{let s=indexedDB.open(Mt,Ft);s.onsuccess=e=>{r(e.target.result)},s.onerror=e=>{var t;o(U.create("storage-open",{originalErrorMessage:(t=e.target.error)===null||t===void 0?void 0:t.message}))},s.onupgradeneeded=e=>{let t=e.target.result;switch(e.oldVersion){case 0:t.createObjectStore(Te,{keyPath:"compositeKey"})}}}catch(s){o(U.create("storage-open",{originalErrorMessage:s?.message}))}}),se)}function Ut(r,o){return $t(Ht(r),o)}function $t(r,o){return k(this,null,function*(){let e=(yield Lt()).transaction(Te,"readwrite"),n=e.objectStore(Te).put({compositeKey:r,value:o});return new Promise((i,a)=>{n.onsuccess=l=>{i()},e.onerror=l=>{var c;a(U.create("storage-set",{originalErrorMessage:(c=l.target.error)===null||c===void 0?void 0:c.message}))}})})}function Ht(r){return`${r.options.appId}-${r.name}`}var ee=new et("@firebase/app-check");function be(r,o){return Ye()?Ut(r,o).catch(s=>{ee.warn(`Failed to write token to IndexedDB. Error: ${s}`)}):Promise.resolve()}function ft(){return ut().enabled}function gt(){return k(this,null,function*(){let r=ut();if(r.enabled&&r.token)return r.token.promise;throw Error(`
2
2
  Can't get debug token in production mode.
3
3
  `)})}var Wt={error:"UNKNOWN_ERROR"};function Kt(r){return Xe.encodeString(JSON.stringify(r),!1)}function Ce(r,o=!1,s=!1){return k(this,null,function*(){let e=r.app;dt(e);let t=_(e),n=t.token,i;if(n&&!te(n)&&(t.token=void 0,n=void 0),!n){let c=yield t.cachedTokenPromise;c&&(te(c)?n=c:yield be(e,void 0))}if(!o&&n&&te(n))return{token:n.token};let a=!1;if(ft())try{t.exchangeTokenPromise||(t.exchangeTokenPromise=ht(pt(e,yield gt()),r.heartbeatServiceProvider).finally(()=>{t.exchangeTokenPromise=void 0}),a=!0);let c=yield t.exchangeTokenPromise;return yield be(e,c),t.token=c,{token:c.token}}catch(c){return c.code==="appCheck/throttled"||c.code==="appCheck/initial-throttle"?ee.warn(c.message):s&&ee.error(c),Ee(c)}try{t.exchangeTokenPromise||(t.exchangeTokenPromise=t.provider.getToken().finally(()=>{t.exchangeTokenPromise=void 0}),a=!0),n=yield _(e).exchangeTokenPromise}catch(c){c.code==="appCheck/throttled"||c.code==="appCheck/initial-throttle"?ee.warn(c.message):s&&ee.error(c),i=c}let l;return n?i?te(n)?l={token:n.token,internalError:i}:l=Ee(i):(l={token:n.token},t.token=n,yield be(e,n)):l=Ee(i),a&&Gt(e,l),l})}function zt(r){return k(this,null,function*(){let o=r.app;dt(o);let{provider:s}=_(o);if(ft()){let e=yield gt(),{token:t}=yield ht(pt(o,e),r.heartbeatServiceProvider);return{token:t}}else{let{token:e}=yield s.getToken();return{token:e}}})}function Vt(r,o,s,e){let{app:t}=r,n=_(t),i={next:s,error:e,type:o};if(n.tokenObservers=[...n.tokenObservers,i],n.token&&te(n.token)){let a=n.token;Promise.resolve().then(()=>{s({token:a.token}),ct(r)}).catch(()=>{})}n.cachedTokenPromise.then(()=>ct(r))}function mt(r,o){let s=_(r),e=s.tokenObservers.filter(t=>t.next!==o);e.length===0&&s.tokenRefresher&&s.tokenRefresher.isRunning()&&s.tokenRefresher.stop(),s.tokenObservers=e}function ct(r){let{app:o}=r,s=_(o),e=s.tokenRefresher;e||(e=qt(r),s.tokenRefresher=e),!e.isRunning()&&s.isTokenAutoRefreshEnabled&&e.start()}function qt(r){let{app:o}=r;return new Ie(()=>k(null,null,function*(){let s=_(o),e;if(s.token?e=yield Ce(r,!0):e=yield Ce(r),e.error)throw e.error;if(e.internalError)throw e.internalError}),()=>!0,()=>{let s=_(o);if(s.token){let e=s.token.issuedAtTimeMillis+(s.token.expireTimeMillis-s.token.issuedAtTimeMillis)*.5+3e5,t=s.token.expireTimeMillis-300*1e3;return e=Math.min(e,t),Math.max(0,e-Date.now())}else return 0},at.RETRIAL_MIN_WAIT,at.RETRIAL_MAX_WAIT)}function Gt(r,o){let s=_(r).tokenObservers;for(let e of s)try{e.type==="EXTERNAL"&&o.error!=null?e.error(o.error):e.next(o)}catch{}}function te(r){return r.expireTimeMillis-Date.now()>0}function Ee(r){return{token:Kt(Wt),error:r}}var De=class{constructor(o,s){this.app=o,this.heartbeatServiceProvider=s}_delete(){let{tokenObservers:o}=_(this.app);for(let s of o)mt(this.app,s.next);return Promise.resolve()}};function Jt(r,o){return new De(r,o)}function Zt(r){return{getToken:o=>Ce(r,o),getLimitedUseToken:()=>zt(r),addTokenListener:o=>Vt(r,"INTERNAL",o),removeTokenListener:o=>mt(r.app,o)}}var Xt="@firebase/app-check",Yt="0.10.1";var Qt="app-check",lt="app-check-internal";function er(){Se(new we(Qt,r=>{let o=r.getProvider("app").getImmediate(),s=r.getProvider("heartbeat");return Jt(o,s)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((r,o,s)=>{r.getProvider(lt).initialize()})),Se(new we(lt,r=>{let o=r.getProvider("app-check").getImmediate();return Zt(o)},"PUBLIC").setInstantiationMode("EXPLICIT")),Q(Xt,Yt)}er();var tr="app-check";var ae=class{constructor(){return st(tr)}};var rr=["localhost","0.0.0.0","127.0.0.1"],hn=typeof window<"u"&&rr.includes(window.location.hostname);var yt=(()=>{let o=class o{constructor(){}getParseToken(){let e=JSON.parse(window.localStorage.getItem("user"));return this.ParseToken(e.Token.access_token)}GetRoles(){let t=this.getParseToken()["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"];return typeof t=="string"&&(t=[t]),t||[]}ParseToken(e){try{let n=e.split(".")[0].replace("-","+").replace("_","/"),i=JSON.parse(window.atob(n)),l=e.split(".")[1].replace("-","+").replace("_","/"),c=JSON.parse(window.atob(l));return c.header=i,c}catch{return!1}}};o.\u0275fac=function(t){return new(t||o)},o.\u0275prov=T({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var ir="firebase",sr="11.10.0";R.registerVersion(ir,sr,"app-compat");var ar=["ngOnDestroy"],St=(r,o,s,e={})=>new Proxy(r,{get:(t,n)=>s.runOutsideAngular(()=>{if(r[n])return e?.spy?.get&&e.spy.get(n,r[n]),r[n];if(ar.indexOf(n)>-1)return()=>{};let i=o.toPromise().then(a=>{let l=a?.[n];return typeof l=="function"?l.bind(a):l?.then?l.then(c=>s.run(()=>c)):s.run(()=>l)});return new Proxy(()=>{},{get:(a,l)=>i[l],apply:(a,l,c)=>i.then(u=>{let f=u?.(...c);return e?.spy?.apply&&e.spy.apply(n,c,f),f})})})});var ce=class{constructor(o){return o}},le=new P("angularfire2.app.options"),ue=new P("angularfire2.app.name");function Pe(r,o,s){let e=typeof s=="string"&&s||"[DEFAULT]",t=typeof s=="object"&&s||{};t.name=t.name||e;let i=R.apps.filter(a=>a&&a.name===t.name)[0]||o.runOutsideAngular(()=>R.initializeApp(r,t));try{if(JSON.stringify(r)!==JSON.stringify(i.options)){let a=!!module.hot;cr("error",`${i.name} Firebase App already initialized with different options${a?", you may need to reload as Firebase is not HMR aware.":"."}`)}}catch{}return new ce(i)}var cr=(r,...o)=>{H()&&typeof console<"u"&&console[r](...o)},lr={provide:ce,useFactory:Pe,deps:[le,V,[new qe,ue]]},ii=(()=>{class r{static initializeApp(s,e){return{ngModule:r,providers:[{provide:le,useValue:s},{provide:ue,useValue:e}]}}constructor(s){R.registerVersion("angularfire",G.full,"core"),R.registerVersion("angularfire",G.full,"app-compat"),R.registerVersion("angular",Ke.full,s.toString())}static \u0275fac=function(e){return new(e||r)(g(z))};static \u0275mod=q({type:r});static \u0275inj=K({providers:[lr]})}return r})();function vt(r,o,s,e,t){let[,n,i]=globalThis.\u0275AngularfireInstanceCache.find(a=>a[0]===r)||[];if(n)return ur(t,i)||(wt("error",`${o} was already initialized on the ${s} Firebase App with different settings.${dr?" You may need to reload as Firebase is not HMR aware.":""}`),wt("warn",{is:t,was:i})),n;{let a=e();return globalThis.\u0275AngularfireInstanceCache.push([r,a,t]),a}}function ur(r,o){try{return r.toString()===o.toString()}catch{return r===o}}var dr=typeof module<"u"&&!!module.hot,wt=(r,...o)=>{H()&&typeof console<"u"&&console[r](...o)};globalThis.\u0275AngularfireInstanceCache||=[];var hr=new P("angularfire2.auth.use-emulator"),pr=new P("angularfire2.auth.settings"),fr=new P("angularfire2.auth.tenant-id"),gr=new P("angularfire2.auth.langugage-code"),mr=new P("angularfire2.auth.use-device-language"),yr=new P("angularfire.auth.persistence"),wr=(r,o,s,e,t,n,i,a)=>vt(`${r.name}.auth`,"AngularFireAuth",r.name,()=>{let l=o.runOutsideAngular(()=>r.auth());if(s&&l.useEmulator(...s),e&&(l.tenantId=e),l.languageCode=t,n&&l.useDeviceLanguage(),i)for(let[c,u]of Object.entries(i))l.settings[c]=u;return a&&l.setPersistence(a),l},[s,e,t,n,i,a]),xe=(()=>{class r{injector=O(ge);authState;idToken;user;idTokenResult;credential;constructor(s,e,t,n,i,a,l,c,u,f,d,h){let p=new Ne,y=X(void 0).pipe(Z(i.outsideAngular),B(()=>n.runOutsideAngular(()=>import("./chunk-XRLXIT7I.js"))),j(()=>Pe(s,n,e)),j(C=>wr(C,n,a,c,u,f,l,d)),pe({bufferSize:1,refCount:!1}));if(Je(t))this.authState=this.user=this.idToken=this.idTokenResult=this.credential=X(null);else{y.pipe(He()).subscribe();let C=y.pipe(B(I=>I.getRedirectResult().then(N=>N,()=>null)),rt(this.injector),pe({bufferSize:1,refCount:!1})),W=y.pipe(B(I=>new m(N=>({unsubscribe:n.runOutsideAngular(()=>I.onAuthStateChanged($=>N.next($),$=>N.error($),()=>N.complete()))})))),J=y.pipe(B(I=>new m(N=>({unsubscribe:n.runOutsideAngular(()=>I.onIdTokenChanged($=>N.next($),$=>N.error($),()=>N.complete()))}))));this.authState=C.pipe(fe(W),re(i.outsideAngular),Z(i.insideAngular)),this.user=C.pipe(fe(J),re(i.outsideAngular),Z(i.insideAngular)),this.idToken=this.user.pipe(B(I=>I?M(I.getIdToken()):X(null))),this.idTokenResult=this.user.pipe(B(I=>I?M(I.getIdTokenResult()):X(null))),this.credential=Le(C,p,this.authState.pipe(Ue(I=>!I))).pipe(j(I=>I?.user?I:null),re(i.outsideAngular),Z(i.insideAngular))}return St(this,y,n,{spy:{apply:(C,W,J)=>{(C.startsWith("signIn")||C.startsWith("createUser"))&&J.then(I=>p.next(I))}}})}static \u0275fac=function(e){return new(e||r)(g(le),g(ue,8),g(z),g(V),g(Ae),g(hr,8),g(pr,8),g(fr,8),g(gr,8),g(mr,8),g(yr,8),g(ae,8))};static \u0275prov=T({token:r,factory:r.\u0275fac,providedIn:"any"})}return r})(),ki=(()=>{class r{constructor(){R.registerVersion("angularfire",G.full,"auth-compat")}static \u0275fac=function(e){return new(e||r)};static \u0275mod=q({type:r});static \u0275inj=K({providers:[xe]})}return r})();var A=(function(r){return r.readonly="readonly",r.readwrite="readwrite",r})(A||{}),kt=new P(null),At=new P("Indexed DB"),vr=new P("Server Indexed DB");function kr(r,o){return r.objectStoreNames.contains(o)}function D(r,o,s){if(!r){s("You need to use the openDatabase function to create a database before you query it!");return}kr(r,o)||s(`objectStore does not exists: ${o}`)}function b(r,o){let s=r.transaction(o.storeName,o.dbMode);return s.onerror=o.error,s.onabort=o.abort,s}function E(r,o,s,e){return{storeName:o,dbMode:r,error:t=>{s(t)},abort:t=>{s(t)}}}var _e=[];function S(r,o,s,e){return new Promise((t,n)=>{r||n("IndexedDB not available");let i=r.open(o,s),a;i.onsuccess=()=>{a=i.result,_e.push(a),t(a)},i.onerror=()=>{n(`IndexedDB error: ${i.error}`)},typeof e=="function"&&(i.onupgradeneeded=l=>{e(l,a)})})}function Re(r,o,s,e,t){return k(this,null,function*(){return new Promise((n,i)=>{if(!r)return;let a=r.open(o,s);a.onupgradeneeded=l=>k(null,null,function*(){let c=l.target.result,u=e.map(d=>k(null,null,function*(){if(!c.objectStoreNames.contains(d.store)){let h=c.createObjectStore(d.store,d.storeConfig);for(let p of d.storeSchema)h.createIndex(p.name,p.keypath,p.options)}}));yield Promise.all(u);let f=t&&t();if(f){let d=Object.keys(f).map(h=>parseInt(h,10)).filter(h=>h>l.oldVersion).sort((h,p)=>h-p);for(let h of d)f[h](c,a.transaction)}c.close(),n()}),a.onsuccess=l=>{l.target.result.close(),n()},a.onerror=l=>{i(l)}})})}function Ar(r,o,s){if(!r||!o||!s)throw Error('Params: "dbName", "version", "storeName" are mandatory.');return new m(e=>{try{let t=o+1,n=indexedDB.open(r,t);n.onupgradeneeded=i=>{let a=i.target.result;a.deleteObjectStore(s),a.close(),console.log("onupgradeneeded"),e.next(),e.complete()},n.onerror=i=>e.error(i)}catch(t){e.error(t)}})}function br(r){return new Promise((o,s)=>{if(!r){s(new Error("No database to close"));return}try{r.close(),o()}catch(e){s(`Error closing database: ${e}`)}})}function v(){return function(r,o,s){let e=s.value;return s.value=function(...t){let n=e.apply(this,t);return n instanceof m?n.pipe($e(()=>k(this,null,function*(){let i=_e.map(a=>k(this,null,function*(){yield br(a)}));yield Promise.all(i),_e.length=0}))):n},s}}var Oe=(()=>{let o=class o{constructor(e,t){this.dbConfigs=e,this.indexedDB=t,this.defaultDatabaseName=null,Object.values(this.dbConfigs).forEach((n,i,a)=>this.instanciateConfig(n,a.length===1))}instanciateConfig(e,t){return k(this,null,function*(){if(!e.name)throw new Error("NgxIndexedDB: Please, provide the dbName in the configuration");if((e.isDefault??!1)&&this.defaultDatabaseName)throw new Error("NgxIndexedDB: Only one database can be set as default");((e.isDefault??!1)&&!this.defaultDatabaseName||t)&&(this.defaultDatabaseName=e.name,this.selectedDb=e.name),yield Re(this.indexedDB,e.name,e.version,e.objectStoresMeta,e.migrationFactory),S(this.indexedDB,e.name).then(n=>{n.version!==e.version&&(H()&&(console.warn(`
4
4
  Your DB Config doesn't match the most recent version of the DB with name ${e.name}, please update it