marketplacepos 5.46.2 → 5.46.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/Marketplace/{chunk-CBJR2A72.js → chunk-2GS6DJ33.js} +1 -1
  2. package/Marketplace/chunk-2REDCSBO.js +1 -0
  3. package/Marketplace/{chunk-BAXQ2L7B.js → chunk-2WHJU6CS.js} +1 -1
  4. package/Marketplace/{chunk-FNU2TKTQ.js → chunk-32YMOC74.js} +1 -1
  5. package/Marketplace/{chunk-WAKKUK6E.js → chunk-34DHFHCG.js} +1 -1
  6. package/Marketplace/{chunk-CWXOXH6M.js → chunk-4L5TB6FG.js} +1 -1
  7. package/Marketplace/{chunk-FGFIV3VO.js → chunk-57MSCWQ4.js} +1 -1
  8. package/Marketplace/{chunk-Z67623R4.js → chunk-5BCJEYHC.js} +1 -1
  9. package/Marketplace/chunk-5G2U27IM.js +1 -0
  10. package/Marketplace/chunk-5JBIRETU.js +1 -0
  11. package/Marketplace/chunk-5KMDUD2M.js +1 -0
  12. package/Marketplace/{chunk-PL3Q6PGC.js → chunk-5RAWBW2Q.js} +1 -1
  13. package/Marketplace/{chunk-II5QZVLR.js → chunk-6DYFCRDG.js} +1 -1
  14. package/Marketplace/{chunk-PLHWGG4D.js → chunk-6K6XBSWF.js} +2 -2
  15. package/Marketplace/chunk-7ZMHGW2W.js +1 -0
  16. package/Marketplace/{chunk-72OHPB5Q.js → chunk-AR6PLQ6X.js} +2 -2
  17. package/Marketplace/{chunk-3BALA33G.js → chunk-B3HL4DNT.js} +1 -1
  18. package/Marketplace/{chunk-BDKGOINV.js → chunk-BG4CT2T7.js} +1 -1
  19. package/Marketplace/chunk-BIHR6KWH.js +1 -0
  20. package/Marketplace/{chunk-CGEIIRYF.js → chunk-BPAZ4TES.js} +1 -1
  21. package/Marketplace/chunk-BVPWV5YO.js +3 -0
  22. package/Marketplace/{chunk-3YP6ORBR.js → chunk-C7YK5TDP.js} +1 -1
  23. package/Marketplace/{chunk-B2WOBUES.js → chunk-CZBE6NFO.js} +1 -1
  24. package/Marketplace/{chunk-WAZXTB4X.js → chunk-DGIH7HSJ.js} +1 -1
  25. package/Marketplace/chunk-DLZRRLED.js +1 -0
  26. package/Marketplace/chunk-DZJWZ52D.js +1 -0
  27. package/Marketplace/{chunk-HGZ5B6WR.js → chunk-EEZKQOJW.js} +1 -1
  28. package/Marketplace/{chunk-AMYZMAYI.js → chunk-F4X5RWKY.js} +1 -1
  29. package/Marketplace/chunk-FF4PEO2O.js +1 -0
  30. package/Marketplace/chunk-FY73EXB5.js +1 -0
  31. package/Marketplace/{chunk-3434HH7H.js → chunk-GCOS7VK3.js} +1 -1
  32. package/Marketplace/chunk-GHFADTRR.js +1 -0
  33. package/Marketplace/chunk-HGDEIMTN.js +1 -0
  34. package/Marketplace/{chunk-LCZ6SUUA.js → chunk-HGGI2V4H.js} +1 -1
  35. package/Marketplace/{chunk-YXBR6VYQ.js → chunk-HS64MICX.js} +1 -1
  36. package/Marketplace/chunk-IJVKHW3C.js +1 -0
  37. package/Marketplace/{chunk-ZLNAFA4X.js → chunk-KEQ7PUNM.js} +1 -1
  38. package/Marketplace/chunk-KVOROMP7.js +1 -0
  39. package/Marketplace/{chunk-XXAV6VNB.js → chunk-LRKVYKNL.js} +1 -1
  40. package/Marketplace/{chunk-3GRC47DP.js → chunk-NABJFAKJ.js} +1 -1
  41. package/Marketplace/{chunk-PE4SWUEZ.js → chunk-NLJHQ4MQ.js} +1 -1
  42. package/Marketplace/{chunk-CIPLCKUF.js → chunk-NRUVGW2I.js} +1 -1
  43. package/Marketplace/{chunk-CBAQUD22.js → chunk-NTWV33QC.js} +1 -1
  44. package/Marketplace/{chunk-FYRDNKYT.js → chunk-P35PCOWA.js} +1 -1
  45. package/Marketplace/{chunk-HITTNWB6.js → chunk-PHLSX23M.js} +1 -1
  46. package/Marketplace/{chunk-6VZVNRUE.js → chunk-PNF6K247.js} +2 -2
  47. package/Marketplace/chunk-QNX7E4P2.js +1 -0
  48. package/Marketplace/chunk-QTTNQJAK.js +1 -0
  49. package/Marketplace/chunk-RI627B2Z.js +1 -0
  50. package/Marketplace/{chunk-UHJEXTOG.js → chunk-RU43F4UK.js} +1 -1
  51. package/Marketplace/chunk-RXQX7567.js +1 -0
  52. package/Marketplace/{chunk-LFGPYQCI.js → chunk-SBLG2UP7.js} +1 -1
  53. package/Marketplace/chunk-SWV5QK47.js +5 -0
  54. package/Marketplace/{chunk-A57T33JT.js → chunk-T4OUIM2Z.js} +1 -1
  55. package/Marketplace/chunk-TEJITT3W.js +1 -0
  56. package/Marketplace/{chunk-YA3VMYDA.js → chunk-TFM5EMU4.js} +1 -1
  57. package/Marketplace/{chunk-NWWYOZ4V.js → chunk-TKV7XWBT.js} +1 -1
  58. package/Marketplace/{chunk-SZGOLKC6.js → chunk-TYSVSEYQ.js} +1 -1
  59. package/Marketplace/chunk-UBA54WUZ.js +1 -0
  60. package/Marketplace/{chunk-6RMBCW2O.js → chunk-UWC2EVFY.js} +1 -1
  61. package/Marketplace/{chunk-OE7TF7SI.js → chunk-W4MTON2T.js} +1 -1
  62. package/Marketplace/{chunk-OVPVQS4J.js → chunk-WIMLQM6B.js} +1 -1
  63. package/Marketplace/{chunk-RJ5D24ZW.js → chunk-WY37QAZ4.js} +1 -1
  64. package/Marketplace/{chunk-77MWKV5I.js → chunk-XSJBP4EN.js} +2 -2
  65. package/Marketplace/{chunk-OHSVQSCM.js → chunk-YJKAX7P2.js} +1 -1
  66. package/Marketplace/{chunk-QSHR75ZI.js → chunk-ZKROHCYD.js} +1 -1
  67. package/Marketplace/chunk-ZMF3NFLA.js +1 -0
  68. package/Marketplace/index.html +2 -2
  69. package/Marketplace/main-QTIXFWWZ.js +1 -0
  70. package/package.json +1 -1
  71. package/Marketplace/chunk-45FZJ4W3.js +0 -1
  72. package/Marketplace/chunk-4DMKVXM7.js +0 -1
  73. package/Marketplace/chunk-4JQLXONG.js +0 -1
  74. package/Marketplace/chunk-7AZDAPB7.js +0 -1
  75. package/Marketplace/chunk-7F74QXF6.js +0 -1
  76. package/Marketplace/chunk-7VLMA7MW.js +0 -1
  77. package/Marketplace/chunk-GPX77ZSI.js +0 -1
  78. package/Marketplace/chunk-GRQD4D2I.js +0 -1
  79. package/Marketplace/chunk-NDLOPOFD.js +0 -1
  80. package/Marketplace/chunk-OEAOBG75.js +0 -1
  81. package/Marketplace/chunk-OHVOVAKD.js +0 -1
  82. package/Marketplace/chunk-P5YM6T6I.js +0 -1
  83. package/Marketplace/chunk-PW42BQIY.js +0 -1
  84. package/Marketplace/chunk-Q2B5GUDO.js +0 -1
  85. package/Marketplace/chunk-QVP2CM7Y.js +0 -5
  86. package/Marketplace/chunk-RM2OSYMV.js +0 -1
  87. package/Marketplace/chunk-TM6DZ3ZF.js +0 -1
  88. package/Marketplace/chunk-UX3OTI5X.js +0 -1
  89. package/Marketplace/chunk-V6GFM5AQ.js +0 -1
  90. package/Marketplace/chunk-WEYKQCVQ.js +0 -1
  91. package/Marketplace/chunk-WWLC64XZ.js +0 -3
  92. package/Marketplace/chunk-XPBMYV5W.js +0 -1
  93. package/Marketplace/chunk-Z3J3CSGS.js +0 -1
  94. package/Marketplace/main-FUX6VJVF.js +0 -1
@@ -0,0 +1 @@
1
+ import{a as fe,b as _e}from"./chunk-FGRPTNDB.js";import{a as ge}from"./chunk-EHBCYQSG.js";import{a as pe}from"./chunk-A44LN77B.js";import{a as le,b as se}from"./chunk-PQQSREEC.js";import{b as de}from"./chunk-GRYGUILI.js";import{b as me}from"./chunk-OXWPLJEW.js";import"./chunk-HVCIQI7B.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import{a as ue}from"./chunk-EEZKQOJW.js";import{a as he}from"./chunk-RGAWEFPQ.js";import{c as Ce,d as B,e as U}from"./chunk-TKV7XWBT.js";import"./chunk-YTCIQBSO.js";import"./chunk-LYPHZP72.js";import"./chunk-EPBVNII2.js";import"./chunk-UZWED4UK.js";import"./chunk-4YRBARG2.js";import"./chunk-5CKVZBHM.js";import"./chunk-BKRCW7SH.js";import"./chunk-RGAKHXPF.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-RHHHL4OR.js";import{a as ce}from"./chunk-NLJHQ4MQ.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import"./chunk-UMP6ZMEJ.js";import"./chunk-YQLOB7IQ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import{na as re}from"./chunk-RC5PUUVM.js";import"./chunk-JVNHFIYT.js";import"./chunk-C7YK5TDP.js";import"./chunk-UWC2EVFY.js";import"./chunk-ACIMXBIC.js";import{i as O}from"./chunk-BVPWV5YO.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import{a as k}from"./chunk-CGOB6Y3X.js";import{b as ee,e as te}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{c as $}from"./chunk-RXQX7567.js";import{d as ie,l as ne,m as oe,n as ae}from"./chunk-HJXYT6MI.js";import{A as N,a as X,c as Y,h as E,m as L,o as Z}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{g as q,j as K,m as Q,n as D}from"./chunk-FXQKRJWU.js";import{$c as v,G as W,Gb as T,Gc as C,Hc as A,Kb as H,Kc as _,Lc as P,Mb as f,Mc as w,Nc as J,Oa as V,Qc as F,Ra as M,Yb as m,Z as j,ad as x,dc as z,ea as G,ic as r,jc as p,kc as y,oc as I,pa as S,pb as R,rb as d,tc as u,uc as h,xb as b,ya as l,za as s}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";function be(o,g){if(o&1&&(r(0,"div",6),y(1,"img",7),r(2,"div"),C(3),p()()),o&2){let e=g.$implicit;d(),m("src",e.logo,R),d(2),A(e.Name)}}function ye(o,g){if(o&1){let e=I();r(0,"p-multiselect",4,0),u("click",function(){l(e);let t=h();return s(t.onClickSelect())}),w("ngModelChange",function(t){l(e);let n=h();return P(n.selectedChannels,t)||(n.selectedChannels=t),s(t)}),u("ngModelChange",function(t){l(e);let n=h();return s(n.onChannelChange(t))}),f(2,be,4,2,"ng-template",5),p()}if(o&2){let e=h();m("options",e.options())("placeholder",e.placeholder()),_("ngModel",e.selectedChannels),m("showClear",e.clearable())("autofocusFilter",!0)("maxSelectedLabels",e.maxSelectedLabels())}}function Ie(o,g){if(o&1&&(r(0,"div",6),y(1,"img",7),r(2,"div"),C(3),p()()),o&2){let e=g.$implicit;d(),m("src",e.logo,R),d(2),A(e.Name)}}function Ve(o,g){if(o&1){let e=I();r(0,"p-select",8,1),u("click",function(){l(e);let t=h();return s(t.onClickSelect())}),w("ngModelChange",function(t){l(e);let n=h();return P(n.selectedChannels,t)||(n.selectedChannels=t),s(t)}),u("ngModelChange",function(t){l(e);let n=h();return s(n.onChannelChange(t))}),f(2,Ie,4,2,"ng-template",5),p()}if(o&2){let e=h();m("options",e.options())("placeholder",e.placeholder()),_("ngModel",e.selectedChannels),m("showClear",e.clearable())("autofocusFilter",!0)("filter",!0)}}var Pe=(()=>{class o extends pe{constructor(){super(),this.authService=S(O),this.multiple=V(!1),this.clearable=V(!0),this.placeholder=V("Select Channels"),this.options=M(this.authService.getChannels()),this.maxSelectedLabels=V(6),this.onChange=e=>{}}ngAfterViewInit(){this.initTopPosition()}onChannelChange(e){this.onChange(e)}onClickSelect(){setTimeout(()=>{this.adjustOverlayPosition()},0)}writeValue(e){this.selectedChannels=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){}static{this.\u0275fac=function(i){return new(i||o)}}static{this.\u0275cmp=T({type:o,selectors:[["app-channel-options-v2"]],inputs:{multiple:[1,"multiple"],clearable:[1,"clearable"],placeholder:[1,"placeholder"],maxSelectedLabels:[1,"maxSelectedLabels"]},features:[F([{provide:X,multi:!0,useExisting:o}]),H],decls:2,vars:1,consts:[["multiSelect",""],["select",""],["optionLabel","Name","optionValue","ID","display","chip","id","multiSelect","appendTo","body",1,"w-100",2,"--p-multiselect-padding-y","12px",3,"options","placeholder","ngModel","showClear","autofocusFilter","maxSelectedLabels"],["optionLabel","Name","optionValue","ID","appendTo","body",1,"w-100",2,"--p-select-padding-y","12px",3,"options","placeholder","ngModel","showClear","autofocusFilter","filter"],["optionLabel","Name","optionValue","ID","display","chip","id","multiSelect","appendTo","body",1,"w-100",2,"--p-multiselect-padding-y","12px",3,"click","ngModelChange","options","placeholder","ngModel","showClear","autofocusFilter","maxSelectedLabels"],["pTemplate","item"],[1,"d-flex","align-items-center","gap-2"],[2,"width","18px",3,"src"],["optionLabel","Name","optionValue","ID","appendTo","body",1,"w-100",2,"--p-select-padding-y","12px",3,"click","ngModelChange","options","placeholder","ngModel","showClear","autofocusFilter","filter"]],template:function(i,t){i&1&&f(0,ye,3,6,"p-multiselect",2)(1,Ve,3,6,"p-select",3),i&2&&z(t.multiple()?0:1)},dependencies:[D,_e,fe,re,me,N,E,L,se,le],encapsulation:2})}}return o})();function Me(o,g){if(o&1){let e=I();r(0,"button",16),u("click",function(){l(e);let t=h().ngIf,n=h();return s(n.onUpdateItems(t))}),y(1,"i",17),C(2," Update "),p()}}function ve(o,g){if(o&1&&(r(0,"div"),f(1,Me,3,0,"button",15),p()),o&2){let e=g.ngIf,i=h();d(),m("ngIf",i.productService.hasSelectionVariant(e))}}var mt=(()=>{class o{constructor(e,i,t,n,c){this.http=e,this.toastr=i,this.dialog=t,this.productService=n,this.authService=c,this.infinitePagination=S(B),this.updateResHandling=S(U),this.mainPanelService=S(ne),this.channelOptions=M([]),this.searchFilter=M({PageNumber:1,RowCount:50,filterModel:1,text:"",ListChannelID:[]}),this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.data$=this.infinitePagination.data$.pipe(j())}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.getDataAPI,this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe(G(e=>{e.Filter={PageNumber:e.Filter.PageNumber,RowCount:e.Filter.RowCount,filterModel:1},this.searchFilter.set(e.Filter),this.mainPanelService.openModalFilter()}))}onShowDifferencePrice(e){let i=1;e&&(i=3),this.searchFilter.update(t=>(t.filterModel=i,t)),this.infinitePagination.reloadPagination(this.searchFilter())}onSearch(e){this.searchFilter.update(i=>(i.text=e,i)),this.infinitePagination.reloadPagination(this.searchFilter()),this.filterSelectedChannels()}onUpdateItems(e){let i=JSON.parse(JSON.stringify(this.channelOptions())),t=this.productService.selectedVariantProduct(e);this.dialog.open(he,{data:{title:"Updating Price",selectedItems:t,channels:i},width:"400px"}).afterClosed().pipe(W(n=>$.IsNotEmpty(n))).subscribe(n=>{this.channelOptions.set(n),this.updatePrice(e)})}filterSelectedChannels(){let i=this.authService.getChannels().filter(t=>this.searchFilter().ListChannelID?.indexOf(t.ID)!==-1);this.channelOptions.set(i)}updatePrice(e){let i=this.productService.selectedVariantProduct(e);if(i.length>0){let t=i.map(a=>({ID:a.ID,Code:a.Code,Price:a.UnitPrice})),c={ListChannelID:this.getSelectedChannels().map(a=>a.ID),ListPrice:t};this.http.post(k.UpdateChannelPrice,c).subscribe(a=>{this.infinitePagination.reloadPagination(this.searchFilter()),this.handlingUpdatePrice(a),this.resetSelectedChannels()})}}updatePriceByVariant(e){let i={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:e.Price-0,VariantID:e.ID};this.http.post(k.UpdatePriceById,i).subscribe(t=>{this.infinitePagination.reloadPagination(this.searchFilter()),this.handlingUpdatePrice(t)})}handlingUpdatePrice(e){let i=e?.Response?.success_list,t=e?.Response?.failure_list,n=this.getSelectedChannels();i?.length>0||t?.length>0?this.updateResHandling.responseHandling(i,t,"Price",n):this.toastr.error(e[0]?.Exception,"Error")}openExportDialog(){this.dialog.open(de,{data:{title:"Export Multi Channel Comparison",pageNumber:this.searchFilter().PageNumber,rowCount:this.searchFilter().RowCount,filterExport:this.searchFilter(),getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportMultipleChannelComparison"}}).afterClosed().subscribe()}resetSelectedChannels(){this.channelOptions.update(e=>(e.forEach(i=>{i.selected=!1}),e))}getSelectedChannels(){return this.channelOptions().filter(e=>e.selected)}static{this.\u0275fac=function(i){return new(i||o)(b(te),b(ee),b(ie),b(ce),b(O))}}static{this.\u0275cmp=T({type:o,selectors:[["app-price-pos-channel"]],features:[F([B,Q,ge,U])],decls:32,vars:23,consts:[["headerTitle","Price Comparison","textButton","Search",3,"onSubmit"],[1,"d-flex"],[4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"mb-5"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"onToggle","onSubmit","showProductToggle","data","channel","hiddenIPOSInventory"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"]],template:function(i,t){if(i&1){let n=I();J(0),v(1,"async"),r(2,"mainpanel",0),u("onSubmit",function(a){return l(n),s(t.onSearch(a))}),r(3,"actions")(4,"div",1),f(5,ve,2,1,"div",2),v(6,"async"),r(7,"button",3),u("click",function(){return l(n),s(t.openExportDialog())}),y(8,"i",4),r(9,"span"),C(10,"Export"),p()()()(),r(11,"filters")(12,"div",5)(13,"label",6),C(14,"Channel"),p(),r(15,"app-channel-options-v2",7),w("ngModelChange",function(a){return l(n),P(t.searchFilter().ListChannelID,a)||(t.searchFilter().ListChannelID=a),s(a)}),p()(),r(16,"div",5)(17,"label",8),C(18,"Page Number"),p(),r(19,"input",9),w("ngModelChange",function(a){return l(n),P(t.searchFilter().PageNumber,a)||(t.searchFilter().PageNumber=a),s(a)}),p()(),r(20,"div")(21,"label",8),C(22,"Page Size"),p(),r(23,"input",9),w("ngModelChange",function(a){return l(n),P(t.searchFilter().RowCount,a)||(t.searchFilter().RowCount=a),s(a)}),p()()(),r(24,"content")(25,"div",10)(26,"div",11)(27,"div",12)(28,"app-table",13),v(29,"async"),u("onToggle",function(a){return l(n),s(t.onShowDifferencePrice(a))})("onSubmit",function(a){return l(n),s(t.updatePriceByVariant(a))}),p(),r(30,"infinite-paginator",14),v(31,"async"),u("onNextPage",function(){return l(n),s(t.infinitePagination.onNextPage(t.searchFilter()))})("onLastPage",function(){return l(n),s(t.infinitePagination.onLastPage(t.searchFilter()))})("onGetRowCount",function(){return l(n),s(t.infinitePagination.getRowCount(t.searchFilter()))}),p()()()()()()}i&2&&(x(1,15,t.loader$),d(5),m("ngIf",x(6,17,t.data$)),d(10),m("multiple",!0),_("ngModel",t.searchFilter().ListChannelID),d(4),_("ngModel",t.searchFilter().PageNumber),d(4),_("ngModel",t.searchFilter().RowCount),d(5),m("showProductToggle",!0)("data",x(29,19,t.data$))("channel",t.channelOptions())("hiddenIPOSInventory",!1),d(2),m("totalData",t.infinitePagination.totalData())("hideCount",t.infinitePagination.hideCount())("rowCount",x(31,21,t.infinitePagination.totalRowCount$))("pageNumber",t.infinitePagination.pageNumber())("disableNextButton",t.infinitePagination.disableNextButton())("goToLastPage",t.infinitePagination.isLastPage()))},dependencies:[D,q,K,N,Y,Z,E,L,Ce,ae,oe,ue,Pe],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]})}}return o})();export{mt as PricePosChannelComponent};
@@ -0,0 +1 @@
1
+ import{a as Q}from"./chunk-4L5TB6FG.js";import{a as J}from"./chunk-C7YK5TDP.js";import{a as z}from"./chunk-GHFADTRR.js";import{a as q}from"./chunk-LDL3A7NM.js";import"./chunk-BVPWV5YO.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import{a as y}from"./chunk-CGOB6Y3X.js";import{e as H}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import"./chunk-PYXL7UF7.js";import"./chunk-RXQX7567.js";import{m as Z,n as j}from"./chunk-HJXYT6MI.js";import{A as G,h as W,m as $}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{H as N,J as O,j as A,m as R,n as F}from"./chunk-FXQKRJWU.js";import{$c as w,Gb as b,Gc as a,Hc as g,Kc as K,Lc as P,Mb as k,Mc as T,Nc as B,Ra as D,Yb as s,Z as V,ad as v,dc as U,ec as I,gc as E,hc as L,ic as e,jc as t,kc as c,oc as x,pa as C,pb as M,rb as l,tc as S,uc as _,ya as m,za as u}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";function X(o,h){if(o&1){let i=x();e(0,"img",21),S("click",function(r){m(i);let n=_().$implicit,d=_();return u(d.onZoomImage(r,n==null?null:n.ImageUrl))}),t()}if(o&2){let i=_().$implicit;s("src",i==null?null:i.ThumbnailUrl,M)}}function Y(o,h){o&1&&c(0,"img",17)}function ee(o,h){if(o&1&&(e(0,"tr")(1,"td")(2,"div",15),k(3,X,1,1,"img",16)(4,Y,1,0,"img",17),t()(),e(5,"td"),a(6),t(),e(7,"td"),a(8),t(),e(9,"td")(10,"div",18),c(11,"app-channel-logo",19),e(12,"span"),a(13),t()()(),e(14,"td",20),a(15),w(16,"number"),t()()),o&2){let i=h.$implicit;l(3),U(i.ImageUrl?3:4),l(3),g(i.Name),l(2),g(i.SKU),l(3),s("typeId",i.TypeID),l(2),g(i.ChannelName),l(2),g(v(16,6,i.Count))}}var xe=(()=>{class o{constructor(){this.httpService=C(H),this.biggerPictureService=C(J),this.filter=D({PageNumber:1,RowCount:20,ListChannelID:[]}),this.rowCountApi=y.GetMultilistingSKUCount,this.initMultipleListingSKU()}initMultipleListingSKU(){this.multipleListingSKU$=this.httpService.post(y.GetMultiListingSKU,this.filter()).pipe(V(1))}onZoomImage(i,p){this.biggerPictureService.openBiggerPicture(i,p)}static{this.\u0275fac=function(p){return new(p||o)}}static{this.\u0275cmp=b({type:o,selectors:[["app-duplicate-sku-v2"]],decls:33,vars:8,consts:[["headerTitle","Duplicate SKU","description","SKU(s) which is listed more than one time (one to many)",3,"onSubmit","hideSearchBox"],["routerLink","/menu/products/status/duplicate-sku",1,"d-flex","align-items-center","gap-2","btn","btn-outline-secondary","btn-lg"],[1,"fa-solid","fa-credit-card"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"container-fluid"],[1,"row","mt-6"],[1,"col-12"],[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[2,"width","200px"],[2,"width","250px"],[1,"text-end",2,"width","50px"],[3,"next","previous","filter","totaldata","rowCountApi"],[2,"padding-right","0px"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],[1,"d-flex","align-items-center"],[3,"typeId"],[1,"text-end"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"click","src"]],template:function(p,r){if(p&1){let n=x();B(0),w(1,"async"),e(2,"mainpanel",0),S("onSubmit",function(){return m(n),u(r.initMultipleListingSKU())}),e(3,"actions")(4,"a",1),c(5,"i",2),e(6,"span"),a(7,"Card View"),t()()(),e(8,"filters")(9,"div")(10,"label",3),a(11,"Channel"),t(),e(12,"channel-select-options",4),T("ngModelChange",function(f){return m(n),P(r.filter().ListChannelID,f)||(r.filter().ListChannelID=f),u(f)}),t()()(),e(13,"content")(14,"div",5)(15,"div",6)(16,"div",7)(17,"table",8)(18,"thead",9)(19,"tr"),c(20,"th",10),e(21,"th"),a(22,"Product"),t(),e(23,"th",11),a(24,"SKU"),t(),e(25,"th",12),a(26,"Channel"),t(),e(27,"th",13),a(28,"Count"),t()()(),e(29,"tbody"),E(30,ee,17,8,"tr",null,I),t()(),e(32,"app-custom-paginator",14),S("next",function(){return m(n),u(r.initMultipleListingSKU())})("previous",function(){return m(n),u(r.initMultipleListingSKU())}),t()()()()()()}if(p&2){let n=v(1,6,r.multipleListingSKU$);l(2),s("hideSearchBox",!0),l(10),s("multiple",!0),K("ngModel",r.filter().ListChannelID),l(18),L(n==null?null:n.Data),l(2),s("filter",r.filter())("totaldata",n==null||n.Data==null?null:n.Data.length)("rowCountApi",r.rowCountApi)}},dependencies:[F,A,R,j,Z,q,O,N,z,Q,G,W,$],encapsulation:2})}}return o})();export{xe as DuplicateSkuV2Component};
@@ -1 +1 @@
1
- import{i as u}from"./chunk-WWLC64XZ.js";import{b as l}from"./chunk-WN5DZGA4.js";import{a as p}from"./chunk-ERXVXBTU.js";import{G as c}from"./chunk-FXQKRJWU.js";import{ja as a,oa as t}from"./chunk-OJMQBH6T.js";var S=(()=>{class e{constructor(o,i,r,s){this.toastr=o,this.authService=i,this.router=r,this.permissionService=s}canActivate(o,i){let r=JSON.parse(window.localStorage.getItem("user")),s=new Date,n=!1;if(r!=null){let h=new Date(r?.Token?.expiredAt);s<h?n=!0:(this.authService.logout(),this.onTokenExpired())}else this.router.navigate([""]),this.onTokenExpired();return n}onTokenExpired(){this.toastr.error("Your session has expired. Please login again.","Session Expired")}static{this.\u0275fac=function(i){return new(i||e)(t(l),t(u),t(c),t(p))}}static{this.\u0275prov=a({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();export{S as a};
1
+ import{i as u}from"./chunk-BVPWV5YO.js";import{b as l}from"./chunk-WN5DZGA4.js";import{a as p}from"./chunk-ERXVXBTU.js";import{G as c}from"./chunk-FXQKRJWU.js";import{ja as a,oa as t}from"./chunk-OJMQBH6T.js";var S=(()=>{class e{constructor(o,i,r,s){this.toastr=o,this.authService=i,this.router=r,this.permissionService=s}canActivate(o,i){let r=JSON.parse(window.localStorage.getItem("user")),s=new Date,n=!1;if(r!=null){let h=new Date(r?.Token?.expiredAt);s<h?n=!0:(this.authService.logout(),this.onTokenExpired())}else this.router.navigate([""]),this.onTokenExpired();return n}onTokenExpired(){this.toastr.error("Your session has expired. Please login again.","Session Expired")}static{this.\u0275fac=function(i){return new(i||e)(t(l),t(u),t(c),t(p))}}static{this.\u0275prov=a({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();export{S as a};
@@ -1 +1 @@
1
- import{a as de,b as pe,c as se}from"./chunk-UHJEXTOG.js";import{a as ce}from"./chunk-WAKKUK6E.js";import{a as A}from"./chunk-QSHR75ZI.js";import{a as ue}from"./chunk-67HPC5Y3.js";import{a as ae}from"./chunk-OLANEXLB.js";import"./chunk-PFY5UG5D.js";import"./chunk-KS7ACI26.js";import"./chunk-3GDM5JNY.js";import"./chunk-XXT6F2ZS.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import"./chunk-JVNHFIYT.js";import{a as me}from"./chunk-CWXOXH6M.js";import"./chunk-3YP6ORBR.js";import{a as oe}from"./chunk-LDL3A7NM.js";import"./chunk-WWLC64XZ.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import"./chunk-PYXL7UF7.js";import"./chunk-PW42BQIY.js";import{m as re,n as le}from"./chunk-HJXYT6MI.js";import{A as te,c as Y,h as Z,m as $,o as ee}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import{r as ie,s as ne}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{j as J,k as K,m as Q,n as X}from"./chunk-FXQKRJWU.js";import{$c as v,Gb as W,Gc as a,Hc as x,Ic as b,Kc as f,Lc as g,Mb as w,Mc as C,Nc as z,Oc as R,Pc as H,Qc as j,Ra as N,Rc as U,Sc as q,Yb as u,Z as L,ac as D,ad as V,bd as G,dc as y,ec as I,gc as B,hc as k,ic as t,jc as i,kc as c,oc as E,pa as F,pb as O,rb as o,tc as M,uc as _,ya as p,za as s}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{a as T,b as P}from"./chunk-66YHNWRR.js";var _e=()=>[],fe=r=>({"td-cell-hover":r});function ge(r,h){if(r&1&&c(0,"variants-dropdown",27),r&2){let e=_().$implicit;u("variants",e==null?null:e.Variants)}}function Ce(r,h){if(r&1&&c(0,"variant-with-image",28),r&2){let e=_().$implicit;u("variant",e==null?null:e.Variants[0])}}function he(r,h){if(r&1&&(t(0,"span"),a(1),i()),r&2){let e=_().$implicit;o(),b("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function Se(r,h){if(r&1&&(t(0,"tr")(1,"td")(2,"div",23)(3,"div",24)(4,"div"),c(5,"img",25),v(6,"channelImage"),i(),t(7,"div"),c(8,"order-link",26),i()(),t(9,"small"),a(10),v(11,"date"),i()()(),t(12,"td"),a(13),i(),t(14,"td"),w(15,ge,1,1,"variants-dropdown",27)(16,Ce,1,1,"variant-with-image",28),i(),t(17,"td"),a(18),v(19,"number"),i(),t(20,"td")(21,"div",23)(22,"div",24)(23,"span"),a(24),i(),w(25,he,2,1,"span"),i(),t(26,"small"),a(27),i()()()()),r&2){let e=h.$implicit;o(5),u("src",V(6,12,e==null?null:e.MarketType),O)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),o(3),u("order",e),o(2),b(" ",G(11,14,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),o(3),x(e.Customer),o(),D(q(19,fe,(e.Variants==null?null:e.Variants.length)>1)),o(),y((e.Variants==null?null:e.Variants.length)>1?15:16),o(3),x(V(19,17,e.Amount)),o(6),x(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),o(),y(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?25:-1),o(2),b(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," ")}}function ve(r,h){if(r&1){let e=E();t(0,"div",15)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),a(5,"Number"),i(),t(6,"th",20),a(7,"Customer"),i(),t(8,"th"),a(9,"Items"),i(),t(10,"th",21),a(11,"Amount"),i(),t(12,"th",21),a(13,"Shipping"),i()()(),t(14,"tbody"),B(15,Se,28,21,"tr",null,I),i()(),t(17,"app-custom-paginator",22),M("next",function(){p(e);let n=_();return s(n.initAllOrders())})("previous",function(){p(e);let n=_();return s(n.initAllOrders())}),i()()}if(r&2){let e=_(),m=H(0);o(15),k(m),o(2),u("filter",e.filter())("totaldata",m==null?null:m.length)}}function we(r,h){r&1&&(t(0,"div",16),c(1,"app-empty-state"),i())}var Ue=(()=>{class r{constructor(){this.orderService=F(A),this.filter=N({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:e=>{this.initFromDate(e)},error:e=>{console.error("Error fetching default date:",e),this.initFromDate(null)}})}initFromDate(e){this.filter.update(m=>P(T({},m),{From:e})),this.initAllOrders()}initAllOrders(){this.allOrders$=this.orderService.getAllOrders(this.filter()).pipe(L(1))}static{this.\u0275fac=function(m){return new(m||r)}}static{this.\u0275cmp=W({type:r,selectors:[["app-all"]],features:[j([A])],decls:34,vars:12,consts:[["headerTitle","Completed","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],["rowCountApi","/api/orders/allcount",3,"next","previous","filter","totaldata"],[1,"lh-sm"],[1,"d-flex","align-items-end","gap-2"],[2,"width","14px","padding-bottom","2.5px",3,"src","alt"],[3,"order"],[3,"variants"],[3,"variant"]],template:function(m,n){if(m&1){let d=E();z(0),v(1,"async"),t(2,"mainpanel",0),M("onSubmit",function(){return p(d),s(n.initAllOrders())}),C("textChange",function(l){return p(d),g(n.filter().Number,l)||(n.filter().Number=l),s(l)}),t(3,"actions")(4,"a",1),c(5,"i",2),t(6,"span"),a(7,"Order Fulfillment Display"),i()()(),t(8,"filters")(9,"div")(10,"label",3),a(11,"Channel"),i(),t(12,"channel-select-options",4),C("ngModelChange",function(l){return p(d),g(n.filter().ListChannelID,l)||(n.filter().ListChannelID=l),s(l)}),i()(),t(13,"div",5)(14,"label",3),a(15,"From/To"),i(),t(16,"div",6)(17,"datepicker",7),C("dateChange",function(l){return p(d),g(n.filter().From,l)||(n.filter().From=l),s(l)}),i()(),t(18,"div")(19,"datepicker",8),C("dateChange",function(l){return p(d),g(n.filter().To,l)||(n.filter().To=l),s(l)}),i()()(),t(20,"div",5)(21,"label",9),a(22,"Page Number"),i(),t(23,"input",10),C("ngModelChange",function(l){return p(d),g(n.filter().PageNumber,l)||(n.filter().PageNumber=l),s(l)}),i()(),t(24,"div",5)(25,"label",9),a(26,"Page Size"),i(),t(27,"input",11),C("ngModelChange",function(l){return p(d),g(n.filter().PageSize,l)||(n.filter().PageSize=l),s(l)}),i()()(),t(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),w(32,ve,18,2,"div",15)(33,we,2,0,"div",16),i()()()()()}if(m&2){let d=R(V(1,8,n.allOrders$)||U(11,_e));o(2),f("text",n.filter().Number),o(10),u("multiple",!0),f("ngModel",n.filter().ListChannelID),o(5),f("date",n.filter().From),o(2),f("date",n.filter().To),o(4),f("ngModel",n.filter().PageNumber),o(4),f("ngModel",n.filter().PageSize),o(5),y((d==null?null:d.length)>0?32:33)}},dependencies:[X,J,Q,K,le,re,ae,oe,te,Y,ee,Z,$,de,pe,se,ue,me,ne,ie,ce],encapsulation:2})}}return r})();export{Ue as AllComponent};
1
+ import{a as de,b as pe,c as se}from"./chunk-RU43F4UK.js";import{a as ce}from"./chunk-34DHFHCG.js";import{a as A}from"./chunk-ZKROHCYD.js";import{a as ue}from"./chunk-67HPC5Y3.js";import{a as ae}from"./chunk-OLANEXLB.js";import"./chunk-PFY5UG5D.js";import"./chunk-KS7ACI26.js";import"./chunk-3GDM5JNY.js";import"./chunk-XXT6F2ZS.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import"./chunk-JVNHFIYT.js";import{a as me}from"./chunk-4L5TB6FG.js";import"./chunk-C7YK5TDP.js";import"./chunk-ACIMXBIC.js";import{a as oe}from"./chunk-LDL3A7NM.js";import"./chunk-BVPWV5YO.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import"./chunk-PYXL7UF7.js";import"./chunk-RXQX7567.js";import{m as re,n as le}from"./chunk-HJXYT6MI.js";import{A as te,c as Y,h as Z,m as $,o as ee}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import{r as ie,s as ne}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{j as J,k as K,m as Q,n as X}from"./chunk-FXQKRJWU.js";import{$c as v,Gb as W,Gc as a,Hc as x,Ic as b,Kc as f,Lc as g,Mb as w,Mc as C,Nc as z,Oc as R,Pc as H,Qc as j,Ra as N,Rc as U,Sc as q,Yb as u,Z as L,ac as D,ad as V,bd as G,dc as y,ec as I,gc as B,hc as k,ic as t,jc as i,kc as c,oc as E,pa as F,pb as O,rb as o,tc as M,uc as _,ya as p,za as s}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{a as T,b as P}from"./chunk-66YHNWRR.js";var _e=()=>[],fe=r=>({"td-cell-hover":r});function ge(r,h){if(r&1&&c(0,"variants-dropdown",27),r&2){let e=_().$implicit;u("variants",e==null?null:e.Variants)}}function Ce(r,h){if(r&1&&c(0,"variant-with-image",28),r&2){let e=_().$implicit;u("variant",e==null?null:e.Variants[0])}}function he(r,h){if(r&1&&(t(0,"span"),a(1),i()),r&2){let e=_().$implicit;o(),b("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function Se(r,h){if(r&1&&(t(0,"tr")(1,"td")(2,"div",23)(3,"div",24)(4,"div"),c(5,"img",25),v(6,"channelImage"),i(),t(7,"div"),c(8,"order-link",26),i()(),t(9,"small"),a(10),v(11,"date"),i()()(),t(12,"td"),a(13),i(),t(14,"td"),w(15,ge,1,1,"variants-dropdown",27)(16,Ce,1,1,"variant-with-image",28),i(),t(17,"td"),a(18),v(19,"number"),i(),t(20,"td")(21,"div",23)(22,"div",24)(23,"span"),a(24),i(),w(25,he,2,1,"span"),i(),t(26,"small"),a(27),i()()()()),r&2){let e=h.$implicit;o(5),u("src",V(6,12,e==null?null:e.MarketType),O)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),o(3),u("order",e),o(2),b(" ",G(11,14,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),o(3),x(e.Customer),o(),D(q(19,fe,(e.Variants==null?null:e.Variants.length)>1)),o(),y((e.Variants==null?null:e.Variants.length)>1?15:16),o(3),x(V(19,17,e.Amount)),o(6),x(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),o(),y(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?25:-1),o(2),b(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," ")}}function ve(r,h){if(r&1){let e=E();t(0,"div",15)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),a(5,"Number"),i(),t(6,"th",20),a(7,"Customer"),i(),t(8,"th"),a(9,"Items"),i(),t(10,"th",21),a(11,"Amount"),i(),t(12,"th",21),a(13,"Shipping"),i()()(),t(14,"tbody"),B(15,Se,28,21,"tr",null,I),i()(),t(17,"app-custom-paginator",22),M("next",function(){p(e);let n=_();return s(n.initAllOrders())})("previous",function(){p(e);let n=_();return s(n.initAllOrders())}),i()()}if(r&2){let e=_(),m=H(0);o(15),k(m),o(2),u("filter",e.filter())("totaldata",m==null?null:m.length)}}function we(r,h){r&1&&(t(0,"div",16),c(1,"app-empty-state"),i())}var Ue=(()=>{class r{constructor(){this.orderService=F(A),this.filter=N({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:e=>{this.initFromDate(e)},error:e=>{console.error("Error fetching default date:",e),this.initFromDate(null)}})}initFromDate(e){this.filter.update(m=>P(T({},m),{From:e})),this.initAllOrders()}initAllOrders(){this.allOrders$=this.orderService.getAllOrders(this.filter()).pipe(L(1))}static{this.\u0275fac=function(m){return new(m||r)}}static{this.\u0275cmp=W({type:r,selectors:[["app-all"]],features:[j([A])],decls:34,vars:12,consts:[["headerTitle","Completed","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],["rowCountApi","/api/orders/allcount",3,"next","previous","filter","totaldata"],[1,"lh-sm"],[1,"d-flex","align-items-end","gap-2"],[2,"width","14px","padding-bottom","2.5px",3,"src","alt"],[3,"order"],[3,"variants"],[3,"variant"]],template:function(m,n){if(m&1){let d=E();z(0),v(1,"async"),t(2,"mainpanel",0),M("onSubmit",function(){return p(d),s(n.initAllOrders())}),C("textChange",function(l){return p(d),g(n.filter().Number,l)||(n.filter().Number=l),s(l)}),t(3,"actions")(4,"a",1),c(5,"i",2),t(6,"span"),a(7,"Order Fulfillment Display"),i()()(),t(8,"filters")(9,"div")(10,"label",3),a(11,"Channel"),i(),t(12,"channel-select-options",4),C("ngModelChange",function(l){return p(d),g(n.filter().ListChannelID,l)||(n.filter().ListChannelID=l),s(l)}),i()(),t(13,"div",5)(14,"label",3),a(15,"From/To"),i(),t(16,"div",6)(17,"datepicker",7),C("dateChange",function(l){return p(d),g(n.filter().From,l)||(n.filter().From=l),s(l)}),i()(),t(18,"div")(19,"datepicker",8),C("dateChange",function(l){return p(d),g(n.filter().To,l)||(n.filter().To=l),s(l)}),i()()(),t(20,"div",5)(21,"label",9),a(22,"Page Number"),i(),t(23,"input",10),C("ngModelChange",function(l){return p(d),g(n.filter().PageNumber,l)||(n.filter().PageNumber=l),s(l)}),i()(),t(24,"div",5)(25,"label",9),a(26,"Page Size"),i(),t(27,"input",11),C("ngModelChange",function(l){return p(d),g(n.filter().PageSize,l)||(n.filter().PageSize=l),s(l)}),i()()(),t(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),w(32,ve,18,2,"div",15)(33,we,2,0,"div",16),i()()()()()}if(m&2){let d=R(V(1,8,n.allOrders$)||U(11,_e));o(2),f("text",n.filter().Number),o(10),u("multiple",!0),f("ngModel",n.filter().ListChannelID),o(5),f("date",n.filter().From),o(2),f("date",n.filter().To),o(4),f("ngModel",n.filter().PageNumber),o(4),f("ngModel",n.filter().PageSize),o(5),y((d==null?null:d.length)>0?32:33)}},dependencies:[X,J,Q,K,le,re,ae,oe,te,Y,ee,Z,$,de,pe,se,ue,me,ne,ie,ce],encapsulation:2})}}return r})();export{Ue as AllComponent};
@@ -1,2 +1,2 @@
1
- import"./chunk-RJ5D24ZW.js";import"./chunk-FGFIV3VO.js";import{a as Ge}from"./chunk-CIPLCKUF.js";import"./chunk-PE5AFID4.js";import{c as qe}from"./chunk-KSHWHTCH.js";import{b as Je}from"./chunk-RAQRGWCZ.js";import"./chunk-HVCIQI7B.js";import{a as h}from"./chunk-PL3Q6PGC.js";import"./chunk-3GDM5JNY.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import"./chunk-RGAWEFPQ.js";import{b as Ye}from"./chunk-LYPHZP72.js";import{b as Qe}from"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import{a as We}from"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import{a as r}from"./chunk-UMP6ZMEJ.js";import"./chunk-JVNHFIYT.js";import{b as Ae}from"./chunk-6RMBCW2O.js";import{b as Te,i as Pe}from"./chunk-WWLC64XZ.js";import"./chunk-Z3ITXK3D.js";import{a as De}from"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{a as ke,d as ze,e as V}from"./chunk-PYXL7UF7.js";import"./chunk-PW42BQIY.js";import{a as Ne,h as je,k as Q,n as He}from"./chunk-HJXYT6MI.js";import{A as R,B as Ie,h as xe,m as Se}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import{a as we,b as Oe,c as Ee}from"./chunk-ERXVXBTU.js";import{r as Fe,s as U}from"./chunk-MFQQEEHJ.js";import{B as $e,M as J,m as Le,n as Be,q as Re,u as Ve,v as Ue}from"./chunk-GZKOMS4T.js";import{F as Ce,G as ve,H as Me,I as ye,J as q,a as ge,d as he,f as fe,g as ue,j as _e,k as be,n as y}from"./chunk-FXQKRJWU.js";import{$c as H,Ac as ce,Bc as me,Cc as pe,Fc as A,G as Z,Gb as v,Gc as p,Hb as b,Hc as M,Ib as re,Ic as w,Ka as P,La as te,M as K,Mb as f,Pa as ie,Q as X,Xa as ne,Yb as c,Zb as le,_b as k,ac as G,ad as W,ca as ee,cd as L,dc as se,f as j,ic as o,jc as s,ka as _,kc as C,lc as z,mc as N,oc as de,od as B,pa as g,pb as ae,rb as l,tc as T,uc as m,v as D,wb as oe,xb as I,ya as x,za as S}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{i as F}from"./chunk-66YHNWRR.js";var $=class{constructor(){this.menus=[{Icon:"fa-solid fa-chart-pie",Title:"Dashboard",Url:"/menu/dashboard",Roles:[r.DashboardView]},{Icon:"fas fa-tag",Title:"Products",Url:"/menu/products",Roles:[r.ProductView]},{Icon:"fas fa-archive",Title:"Inventory",Url:"/menu/inventory",Roles:[r.InventoryView]},{Icon:"fas fa-money-bill-alt",Title:"Price",Url:"/menu/price",Roles:[r.PriceView]},{Icon:"fas fa-shopping-cart",Title:"Order",Url:"/menu/order",Roles:[r.OrderView]},{Icon:"fas fa-cog",Title:"Channel",Url:"/menu/channel",Roles:[r.ChannelView]},{Icon:"fa-solid fa-user",Title:"Users",Url:"/menu/users",Roles:[r.UserView]},{Icon:"fas fa-clipboard-list",Title:"Sync Logs",Url:"/menu/sync-log",Roles:[r.Report]},{Icon:"fas fa-dolly",Title:"Logistic",Url:"/menu/Logistic",Roles:[r.LogisticView]},{Icon:"fas fa-file-alt",Title:"Developer",Url:"/menu/log",Roles:[r.DevView]},{Icon:"fa-solid fa-file-brackets-curly",Title:"JSON Api",Url:"/menu/json-api",Roles:[r.JsonApiView]}]}get getMenu(){return this.menus}};var Ze="mat-badge-content",ot=(()=>{class e{static \u0275fac=function(i){return new(i||e)};static \u0275cmp=v({type:e,selectors:[["ng-component"]],decls:0,vars:0,template:function(i,n){},styles:[`.mat-badge{position:relative}.mat-badge.mat-badge{overflow:visible}.mat-badge-content{position:absolute;text-align:center;display:inline-block;transition:transform 200ms ease-in-out;transform:scale(0.6);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;box-sizing:border-box;pointer-events:none;background-color:var(--mat-badge-background-color, var(--mat-sys-error));color:var(--mat-badge-text-color, var(--mat-sys-on-error));font-family:var(--mat-badge-text-font, var(--mat-sys-label-small-font));font-weight:var(--mat-badge-text-weight, var(--mat-sys-label-small-weight));border-radius:var(--mat-badge-container-shape, var(--mat-sys-corner-full))}.mat-badge-above .mat-badge-content{bottom:100%}.mat-badge-below .mat-badge-content{top:100%}.mat-badge-before .mat-badge-content{right:100%}[dir=rtl] .mat-badge-before .mat-badge-content{right:auto;left:100%}.mat-badge-after .mat-badge-content{left:100%}[dir=rtl] .mat-badge-after .mat-badge-content{left:auto;right:100%}@media(forced-colors: active){.mat-badge-content{outline:solid 1px;border-radius:0}}.mat-badge-disabled .mat-badge-content{background-color:var(--mat-badge-disabled-state-background-color, color-mix(in srgb, var(--mat-sys-error) 38%, transparent));color:var(--mat-badge-disabled-state-text-color, var(--mat-sys-on-error))}.mat-badge-hidden .mat-badge-content{display:none}.ng-animate-disabled .mat-badge-content,.mat-badge-content._mat-animation-noopable{transition:none}.mat-badge-content.mat-badge-active{transform:none}.mat-badge-small .mat-badge-content{width:var(--mat-badge-legacy-small-size-container-size, unset);height:var(--mat-badge-legacy-small-size-container-size, unset);min-width:var(--mat-badge-small-size-container-size, 6px);min-height:var(--mat-badge-small-size-container-size, 6px);line-height:var(--mat-badge-small-size-line-height, 6px);padding:var(--mat-badge-small-size-container-padding, 0);font-size:var(--mat-badge-small-size-text-size, 0);margin:var(--mat-badge-small-size-container-offset, -6px 0)}.mat-badge-small.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-small-size-container-overlap-offset, -6px)}.mat-badge-medium .mat-badge-content{width:var(--mat-badge-legacy-container-size, unset);height:var(--mat-badge-legacy-container-size, unset);min-width:var(--mat-badge-container-size, 16px);min-height:var(--mat-badge-container-size, 16px);line-height:var(--mat-badge-line-height, 16px);padding:var(--mat-badge-container-padding, 0 4px);font-size:var(--mat-badge-text-size, var(--mat-sys-label-small-size));margin:var(--mat-badge-container-offset, -12px 0)}.mat-badge-medium.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-container-overlap-offset, -12px)}.mat-badge-large .mat-badge-content{width:var(--mat-badge-legacy-large-size-container-size, unset);height:var(--mat-badge-legacy-large-size-container-size, unset);min-width:var(--mat-badge-large-size-container-size, 16px);min-height:var(--mat-badge-large-size-container-size, 16px);line-height:var(--mat-badge-large-size-line-height, 16px);padding:var(--mat-badge-large-size-container-padding, 0 4px);font-size:var(--mat-badge-large-size-text-size, var(--mat-sys-label-small-size));margin:var(--mat-badge-large-size-container-offset, -12px 0)}.mat-badge-large.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-large-size-container-overlap-offset, -12px)}
2
- `],encapsulation:2,changeDetection:0})}return e})(),Ke=(()=>{class e{_ngZone=g(te);_elementRef=g(ie);_ariaDescriber=g($e);_renderer=g(oe);_animationMode=g(ne,{optional:!0});_idGenerator=g(Ue);get color(){return this._color}set color(t){this._setColor(t),this._color=t}_color="primary";overlap=!0;disabled;position="above after";get content(){return this._content}set content(t){this._updateRenderedContent(t)}_content;get description(){return this._description}set description(t){this._updateDescription(t)}_description;size="medium";hidden;_badgeElement;_inlineBadgeDescription;_isInitialized=!1;_interactivityChecker=g(Re);_document=g(ge);constructor(){let t=g(Le);t.load(ot),t.load(Be)}isAbove(){return this.position.indexOf("below")===-1}isAfter(){return this.position.indexOf("before")===-1}getBadgeElement(){return this._badgeElement}ngOnInit(){this._clearExistingBadges(),this.content&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement(),this._updateRenderedContent(this.content)),this._isInitialized=!0}ngOnDestroy(){this._renderer.destroyNode&&(this._renderer.destroyNode(this._badgeElement),this._inlineBadgeDescription?.remove()),this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description)}_isHostInteractive(){return this._interactivityChecker.isFocusable(this._elementRef.nativeElement,{ignoreVisibility:!0})}_createBadgeElement(){let t=this._renderer.createElement("span"),i="mat-badge-active";return t.setAttribute("id",this._idGenerator.getId("mat-badge-content-")),t.setAttribute("aria-hidden","true"),t.classList.add(Ze),this._animationMode==="NoopAnimations"&&t.classList.add("_mat-animation-noopable"),this._elementRef.nativeElement.appendChild(t),typeof requestAnimationFrame=="function"&&this._animationMode!=="NoopAnimations"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{t.classList.add(i)})}):t.classList.add(i),t}_updateRenderedContent(t){let i=`${t??""}`.trim();this._isInitialized&&i&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement()),this._badgeElement&&(this._badgeElement.textContent=i),this._content=i}_updateDescription(t){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description),(!t||this._isHostInteractive())&&this._removeInlineDescription(),this._description=t,this._isHostInteractive()?this._ariaDescriber.describe(this._elementRef.nativeElement,t):this._updateInlineDescription()}_updateInlineDescription(){this._inlineBadgeDescription||(this._inlineBadgeDescription=this._document.createElement("span"),this._inlineBadgeDescription.classList.add("cdk-visually-hidden")),this._inlineBadgeDescription.textContent=this.description,this._badgeElement?.appendChild(this._inlineBadgeDescription)}_removeInlineDescription(){this._inlineBadgeDescription?.remove(),this._inlineBadgeDescription=void 0}_setColor(t){let i=this._elementRef.nativeElement.classList;i.remove(`mat-badge-${this._color}`),t&&i.add(`mat-badge-${t}`)}_clearExistingBadges(){let t=this._elementRef.nativeElement.querySelectorAll(`:scope > .${Ze}`);for(let i of Array.from(t))i!==this._badgeElement&&i.remove()}static \u0275fac=function(i){return new(i||e)};static \u0275dir=re({type:e,selectors:[["","matBadge",""]],hostAttrs:[1,"mat-badge"],hostVars:20,hostBindings:function(i,n){i&2&&k("mat-badge-overlap",n.overlap)("mat-badge-above",n.isAbove())("mat-badge-below",!n.isAbove())("mat-badge-before",!n.isAfter())("mat-badge-after",n.isAfter())("mat-badge-small",n.size==="small")("mat-badge-medium",n.size==="medium")("mat-badge-large",n.size==="large")("mat-badge-hidden",n.hidden||!n.content)("mat-badge-disabled",n.disabled)},inputs:{color:[0,"matBadgeColor","color"],overlap:[2,"matBadgeOverlap","overlap",B],disabled:[2,"matBadgeDisabled","disabled",B],position:[0,"matBadgePosition","position"],content:[0,"matBadge","content"],description:[0,"matBadgeDescription","description"],size:[0,"matBadgeSize","size"],hidden:[2,"matBadgeHidden","hidden",B]}})}return e})(),Xe=(()=>{class e{static \u0275fac=function(i){return new(i||e)};static \u0275mod=b({type:e});static \u0275inj=_({imports:[Ve,J,J]})}return e})();function lt(e,a){if(e&1&&(z(0),o(1,"p",25),p(2),s(),N()),e&2){let t=m(3).$implicit;l(2),w(" ",t.Title," ")}}function st(e,a){if(e&1&&(o(0,"p"),p(1),s()),e&2){let t=m(3).$implicit;l(),M(t.Title)}}function dt(e,a){if(e&1&&(o(0,"a",24),C(1,"i"),f(2,lt,3,1,"ng-container",22)(3,st,2,1,"ng-template",null,1,L),s()),e&2){let t=A(4),i=m(2).$implicit;c("href",i.Url,ae),l(),G(i.Icon),l(),c("ngIf",i.Badge)("ngIfElse",t)}}function ct(e,a){if(e&1&&(z(0),f(1,dt,5,5,"a",23),N()),e&2){let t=m().$implicit;l(),c("ngxPermissionsOnly",t.Roles)}}function mt(e,a){if(e&1&&(o(0,"p",25),p(1),s()),e&2){let t=m(4).$implicit;l(),w(" ",t.Title," ")}}function pt(e,a){if(e&1&&(o(0,"p"),p(1),s()),e&2){let t=m(4).$implicit;l(),M(t.Title)}}function gt(e,a){if(e&1&&(z(0),f(1,mt,2,1,"p",25),H(2,"async"),f(3,pt,2,1,"p"),N()),e&2){let t=m(4);l(),se(W(2,1,t.notifications$)!=0?1:3)}}function ht(e,a){if(e&1&&(o(0,"p"),p(1),s()),e&2){let t=m(3).$implicit;l(),M(t.Title)}}function ft(e,a){if(e&1&&(o(0,"a",27),C(1,"i"),f(2,gt,4,3,"ng-container",22)(3,ht,2,1,"ng-template",null,2,L),s()),e&2){let t=A(4),i=m(2).$implicit,n=m();c("matTooltip",n.isCollapseSidebar?i.Title:"")("routerLink",i.Url),l(),G(i.Icon),l(),c("ngIf",i.Badge)("ngIfElse",t)}}function ut(e,a){if(e&1&&f(0,ft,5,6,"a",26),e&2){let t=m().$implicit;c("ngxPermissionsOnly",t.Roles)}}function _t(e,a){if(e&1&&(o(0,"li",21),f(1,ct,2,1,"ng-container",22)(2,ut,1,1,"ng-template",null,0,L),s()),e&2){let t=a.$implicit,i=A(3);l(),c("ngIf",t.ExternalLink)("ngIfElse",i)}}var et=(()=>{class e{constructor(t,i,n,d){this.toggleSidebarService=t,this.notificationService=i,this.decodeTokenService=n,this.authService=d,this.Menu={},this.isCollapseSidebar=!1,this.token=n.getParseToken(),this.storeName=this.token.StoreName,this.Menu=new $().getMenu,this.toggleState$=this.toggleSidebarService.toggleState$}ngOnInit(){this.initNotifications()}initNotifications(){this.notifications$=this.notificationService.getNotification().pipe(D(t=>t.length))}onLogout(){this.authService.logout()}onCallapseSidebar(){this.isCollapseSidebar=!this.isCollapseSidebar,this.storeName=this.token.StoreName,this.isCollapseSidebar&&(this.storeName=this.getInitialTitle(this.token.StoreName))}getInitialTitle(t){if(t){let i,n=t.split(" ");return n.length==1?i=n[0].substring(0,2):i=n.shift().charAt(0)+n.pop().charAt(0),i}}static{this.\u0275fac=function(i){return new(i||e)(I(Ne),I(Ae),I(Te),I(Pe))}}static{this.\u0275cmp=v({type:e,selectors:[["app-menu"]],standalone:!1,decls:28,vars:9,consts:[["DEFAULT_ROUTE",""],["NO_BADGE",""],["WITHOUT_BADGE",""],[1,"wrapper"],["data-color","green",1,"sidebar",3,"ngClass"],[1,"btn-minimize","d-md-block","d-none","p-0","border-0","bg-white",3,"click"],[1,"fas","cursor",3,"ngClass"],[1,"logo"],[1,"navbar","dropdown","bg-transparent","border-0"],["data-bs-toggle","dropdown","aria-expanded","false",1,"simple-text","text-start","dropdown-toggle","d-flex","align-items-center","justify-content-center","cursor-pointer"],[1,"dropdown-menu"],[1,"dropdown-header","text-dark","border-bottom"],[1,"divider","m-0"],["routerLink","/menu/profile",1,"dropdown-item","h5",2,"cursor","pointer"],["aria-hidden","true",1,"fa-user","fas"],[1,"dropdown-item","h5",2,"cursor","pointer",3,"click"],["aria-hidden","true",1,"fas","fa-sign-out-alt"],[1,"sidebar-wrapper"],[1,"nav"],["routerLinkActive","active",4,"ngFor","ngForOf"],[1,"main-panel"],["routerLinkActive","active"],[4,"ngIf","ngIfElse"],["class","nav-link position-relative d-block changelog","target","_blank",3,"href",4,"ngxPermissionsOnly"],["target","_blank",1,"nav-link","position-relative","d-block","changelog",3,"href"],["matBadge","!","matBadgeColor","warn","matBadgeSize","small",1,"shake-animation"],["class","nav-link position-relative d-block","matTooltipPosition","right",3,"matTooltip","routerLink",4,"ngxPermissionsOnly"],["matTooltipPosition","right",1,"nav-link","position-relative","d-block",3,"matTooltip","routerLink"]],template:function(i,n){i&1&&(o(0,"div",3),H(1,"async"),o(2,"div",4)(3,"button",5),T("click",function(){return n.onCallapseSidebar()}),C(4,"i",6),s(),o(5,"div",7)(6,"div",8)(7,"a",9),p(8),s(),o(9,"div",10)(10,"div",11),p(11),s(),C(12,"div",12),o(13,"a",13),C(14,"i",14),p(15,"\xA0 "),o(16,"span"),p(17,"My Profile"),s()(),o(18,"a",15),T("click",function(){return n.onLogout()}),C(19,"i",16),p(20,"\xA0 "),o(21,"span"),p(22," Log Out"),s()()()()(),o(23,"div",17)(24,"ul",18),f(25,_t,4,2,"li",19),s()()(),o(26,"div",20),C(27,"router-outlet"),s()()),i&2&&(k("nav-open",W(1,7,n.toggleState$)),l(2),c("ngClass",n.isCollapseSidebar?"collapses":""),l(2),c("ngClass",n.isCollapseSidebar?"fa-angle-left":"fa-angle-right"),l(4),w(" ",n.storeName," "),l(3),w(" ",n.token==null?null:n.token.LID," "),l(14),c("ngForOf",n.Menu))},dependencies:[he,fe,ue,Ce,Me,ye,Fe,Ke,Oe,_e],styles:["@media (max-width: 468px){.navbar[_ngcontent-%COMP%] .navbar-brand[_ngcontent-%COMP%]{white-space:nowrap;max-width:7em;overflow:hidden;text-overflow:ellipsis}}@media only screen and (min-width: 992px){.sidebar[_ngcontent-%COMP%]{z-index:1050!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%], .sidebar.collapses[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{width:70px;transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%] .simple-text[_ngcontent-%COMP%]{background-color:#ffffff3b;border-radius:20px;height:40px;width:40px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{padding:10px 0 10px 10px!important;height:50px;text-align:center;margin:10px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:none}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{padding-left:70px}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{left:70px!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]{position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1;background-color:#fff;position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border:0;border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;padding:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{cursor:pointer}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1}.full-container[_ngcontent-%COMP%]{padding-top:0!important}} p.shake-animation.mat-badge>span.mat-badge-content{animation:_ngcontent-%COMP%_shake-animation 4.72s ease infinite;font-size:12px;transform-origin:50% 50%;right:-14px!important}@keyframes _ngcontent-%COMP%_shake-animation{0%{transform:translate(0)}1.78571%{transform:translate(5px)}3.57143%{transform:translate(0)}5.35714%{transform:translate(5px)}7.14286%{transform:translate(0)}8.92857%{transform:translate(5px)}10.71429%{transform:translate(0)}to{transform:translate(0)}} .changelog:visited p.shake-animation.mat-badge>span.mat-badge-content{color:#77c425;background-color:#77c425;z-index:-1}@media print{.main-panel[_ngcontent-%COMP%]{padding:0!important}}"]})}}return e})();var u=(e,a)=>F(null,null,function*(){let t=g(we),i=g(ve),n=e.data?.roles||[],d=e.data?.redirectUrl||"/";return n.length===0||(yield bt(t,n))?!0:(i.navigate([d]),!1)});function bt(e,a){return F(this,null,function*(){let t=a.map(n=>e.hasPermission(n));return(yield Promise.all(t)).some(n=>n)})}var Ct=[{path:"",component:et,children:[{path:"",redirectTo:"dashboard",pathMatch:"full"},{path:"profile",loadChildren:()=>import("./chunk-CVM573KF.js").then(e=>e.routes),canActivate:[h],data:{title:"My Profile"}},{path:"dashboard",loadChildren:()=>import("./chunk-HITTNWB6.js").then(e=>e.DashboardModule),canActivate:[h,u,Ge],data:{title:"Dashboard",roles:[r.DashboardView],redirectUrl:"/menu/products"}},{path:"products",loadChildren:()=>import("./chunk-7AZDAPB7.js").then(e=>e.ProductModule),canActivate:[h,u],data:{title:"Products",roles:[r.ProductView],redirectUrl:"/menu/inventory"}},{path:"inventory",loadChildren:()=>import("./chunk-UX3OTI5X.js").then(e=>e.InventoryRoutingModule),canActivate:[h,u],data:{title:"Inventory",roles:[r.InventoryView],redirectUrl:"/menu/price"}},{path:"price",loadChildren:()=>import("./chunk-NDLOPOFD.js").then(e=>e.PriceRoutingModule),canActivate:[h,u],data:{title:"Price",roles:[r.PriceView],redirectUrl:"/menu/Order"}},{path:"order",loadChildren:()=>import("./chunk-OHSVQSCM.js").then(e=>e.routes),canActivate:[h],data:{title:"Order"}},{path:"sync-log",loadChildren:()=>import("./chunk-GPX77ZSI.js").then(e=>e.ReportModule),canActivate:[h,u],data:{title:"Report",roles:[r.Report],redirectUrl:"/menu/Logistic"}},{path:"Logistic",loadChildren:()=>import("./chunk-7F74QXF6.js").then(e=>e.LogisticModule),canActivate:[h,u],data:{title:"Logistic",roles:[r.LogisticView],redirectUrl:"/menu/channel"}},{path:"channel",loadChildren:()=>import("./chunk-AMYZMAYI.js").then(e=>e.ChannelsModule),canActivate:[h,u],data:{title:"Marketplace",roles:[r.ChannelView],redirectUrl:"/menu/log"}},{path:"log",loadChildren:()=>import("./chunk-3GRC47DP.js").then(e=>e.LogsModule),canActivate:[h,u],data:{title:"Orders",roles:[r.DevView]}},{path:"users",loadChildren:()=>import("./chunk-OE7TF7SI.js").then(e=>e.userRoutes),canActivate:[h,u],data:{title:"Users",roles:[r.UserView],redirectUrl:"/menu/dashboard"}},{path:"json-api",loadChildren:()=>import("./chunk-7VLMA7MW.js").then(e=>e.routes),canActivate:[h],data:{title:"Json API"}}]}],tt=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=b({type:e})}static{this.\u0275inj=_({imports:[q.forChild(Ct),q]})}}return e})();var Mt=["selectId"];function yt(e,a){if(e&1&&(o(0,"span",3),p(1),s()),e&2){let t=a.item,i=m();c("title",t[i.bindLabel]),l(),M(t[i.bindLabel])}}var it=(()=>{class e{set items(t){this.ngSelectInfiniteScroll.data=t,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}get selected(){return this._selected}set selected(t){this._selected=t,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}constructor(){this.placeholder="",this.bindValue="",this.bindLabel="",this.width="100%",this.clearable=!0,this.parent="body",this.disabled=!1,this.optionTitle=!1,this._selected="",this.ngSelectInfiniteScroll=new Y,this.selectedChange=new P,this.selectedLabel=new P,this.onOpen=new P}onOpenSelect(){this.onOpen.emit()}onSelectChange(t){t?(this.selectedChange.emit(t[this.bindValue]),this.selectedLabel.emit(t[this.bindLabel])):(this.selectedChange.emit(null),this.selectedLabel.emit(null))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["ng-select-infinite"]],viewQuery:function(i,n){if(i&1&&ce(Mt,7),i&2){let d;me(d=pe())&&(n.ngSelectElement=d.first)}},inputs:{placeholder:"placeholder",bindValue:"bindValue",bindLabel:"bindLabel",width:"width",clearable:"clearable",parent:"parent",disabled:"disabled",optionTitle:"optionTitle",items:"items",selected:"selected"},outputs:{selectedChange:"selectedChange",selectedLabel:"selectedLabel",onOpen:"onOpen"},decls:3,vars:12,consts:[["selectId",""],[3,"clear","scrollToEnd","open","change","appendTo","disabled","virtualScroll","typeahead","items","bindLabel","bindValue","placeholder","ngModel","clearable"],["ng-option-tmp",""],[3,"title"]],template:function(i,n){if(i&1){let d=de();o(0,"ng-select",1,0),T("clear",function(){return x(d),S(n.ngSelectInfiniteScroll.onClear())})("scrollToEnd",function(){return x(d),S(n.ngSelectInfiniteScroll.onScrollToEnd())})("open",function(){return x(d),S(n.onOpenSelect())})("change",function(at){return x(d),S(n.onSelectChange(at))}),f(2,yt,2,2,"ng-template",2),s()}i&2&&(le("width",n.width),c("appendTo",n.parent)("disabled",n.disabled)("virtualScroll",!0)("typeahead",n.ngSelectInfiniteScroll.input$)("items",n.ngSelectInfiniteScroll.bufferData)("bindLabel",n.bindLabel)("bindValue",n.bindValue)("placeholder",n.placeholder)("ngModel",n.selected)("clearable",n.clearable))},dependencies:[y,V,ze,ke,R,xe,Se],encapsulation:2})}}return e})(),Y=class{constructor(){this._dataBuffer=[],this._data=[],this._input$=new j,this._destroy$=new j,this._loading=!1,this._bufferSize=50,this.data=[]}onSearch(){this._input$.pipe(K(200),X(),D(a=>(a&&(a=a.toLowerCase()),this.filterData(a))),Z(a=>a!==void 0),ee(this._destroy$)).subscribe(a=>{this._dataBuffer=a.slice(0,this._bufferSize)})}onClear(){this._dataBuffer=this._data.slice(0,this._bufferSize)}filterData(a){let t=-1,i;return this._data.filter(d=>(i=JSON.stringify(d).toLowerCase(),t=i.indexOf(a),t!==-1||a==null))}get input$(){return this._input$}get bufferData(){return this._dataBuffer}get loading(){return this._loading}set data(a){this._data=a||[],this._dataBuffer=this._data.slice(0,this._bufferSize),this.onSearch()}initSelectedValue(a,t){if(De.IsNotEmpty(a)){let i=this._data.filter(n=>n[t].toString().toLowerCase().indexOf(a)!==-1);this._dataBuffer=i.slice(0,this._bufferSize)}}set bufferSize(a){this._bufferSize=a}onScrollToEnd(){this.fetchMore()}fetchMore(){let a=this._dataBuffer.length,t=this._data.slice(a,this._bufferSize+a);this._loading=!0,setTimeout(()=>{this._loading=!1,this._dataBuffer=this._dataBuffer.concat(t)},200)}destroy(){this._destroy$.next(!0),this._destroy$.complete()}};var nt=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=b({type:e})}static{this.\u0275inj=_({imports:[y,R,je,qe,Qe,We,Je,Ye,U,Q,it,V,Ie]})}}return e})();var un=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=b({type:e})}static{this.\u0275inj=_({providers:[be],imports:[y,tt,He,U,nt,Xe,Ee.forChild()]})}}return e})();export{un as MenuModule};
1
+ import"./chunk-WY37QAZ4.js";import"./chunk-57MSCWQ4.js";import{a as Ge}from"./chunk-NRUVGW2I.js";import"./chunk-PE5AFID4.js";import{c as qe}from"./chunk-KSHWHTCH.js";import{b as Je}from"./chunk-RAQRGWCZ.js";import"./chunk-HVCIQI7B.js";import{a as h}from"./chunk-5RAWBW2Q.js";import"./chunk-3GDM5JNY.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import"./chunk-RGAWEFPQ.js";import{b as Ye}from"./chunk-LYPHZP72.js";import{b as Qe}from"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import{a as We}from"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import{a as r}from"./chunk-UMP6ZMEJ.js";import"./chunk-JVNHFIYT.js";import{b as Ae}from"./chunk-UWC2EVFY.js";import{a as Ne}from"./chunk-ACIMXBIC.js";import{b as Te,i as De}from"./chunk-BVPWV5YO.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{a as Pe,d as ke,e as V}from"./chunk-PYXL7UF7.js";import"./chunk-RXQX7567.js";import{a as ze,h as je,k as Q,n as He}from"./chunk-HJXYT6MI.js";import{A as R,B as Ie,h as xe,m as Se}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import{a as we,b as Oe,c as Ee}from"./chunk-ERXVXBTU.js";import{r as Fe,s as U}from"./chunk-MFQQEEHJ.js";import{B as $e,M as J,m as Le,n as Be,q as Re,u as Ve,v as Ue}from"./chunk-GZKOMS4T.js";import{F as Ce,G as ve,H as Me,I as ye,J as q,a as ge,d as he,f as fe,g as ue,j as _e,k as be,n as y}from"./chunk-FXQKRJWU.js";import{$c as H,Ac as ce,Bc as me,Cc as pe,Fc as A,G as Z,Gb as v,Gc as p,Hb as b,Hc as M,Ib as re,Ic as w,Ka as P,La as te,M as K,Mb as f,Pa as ie,Q as X,Xa as ne,Yb as c,Zb as le,_b as k,ac as G,ad as W,ca as ee,cd as L,dc as se,f as j,ic as o,jc as s,ka as _,kc as C,lc as z,mc as N,oc as de,od as B,pa as g,pb as ae,rb as l,tc as T,uc as m,v as D,wb as oe,xb as I,ya as x,za as S}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{i as F}from"./chunk-66YHNWRR.js";var $=class{constructor(){this.menus=[{Icon:"fa-solid fa-chart-pie",Title:"Dashboard",Url:"/menu/dashboard",Roles:[r.DashboardView]},{Icon:"fas fa-tag",Title:"Products",Url:"/menu/products",Roles:[r.ProductView]},{Icon:"fas fa-archive",Title:"Inventory",Url:"/menu/inventory",Roles:[r.InventoryView]},{Icon:"fas fa-money-bill-alt",Title:"Price",Url:"/menu/price",Roles:[r.PriceView]},{Icon:"fas fa-shopping-cart",Title:"Order",Url:"/menu/order",Roles:[r.OrderView]},{Icon:"fas fa-cog",Title:"Channel",Url:"/menu/channel",Roles:[r.ChannelView]},{Icon:"fa-solid fa-user",Title:"Users",Url:"/menu/users",Roles:[r.UserView]},{Icon:"fas fa-clipboard-list",Title:"Sync Logs",Url:"/menu/sync-log",Roles:[r.Report]},{Icon:"fas fa-dolly",Title:"Logistic",Url:"/menu/Logistic",Roles:[r.LogisticView]},{Icon:"fas fa-file-alt",Title:"Developer",Url:"/menu/log",Roles:[r.DevView]},{Icon:"fa-solid fa-file-brackets-curly",Title:"JSON Api",Url:"/menu/json-api",Roles:[r.JsonApiView]}]}get getMenu(){return this.menus}};var Ze="mat-badge-content",ot=(()=>{class e{static \u0275fac=function(i){return new(i||e)};static \u0275cmp=v({type:e,selectors:[["ng-component"]],decls:0,vars:0,template:function(i,n){},styles:[`.mat-badge{position:relative}.mat-badge.mat-badge{overflow:visible}.mat-badge-content{position:absolute;text-align:center;display:inline-block;transition:transform 200ms ease-in-out;transform:scale(0.6);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;box-sizing:border-box;pointer-events:none;background-color:var(--mat-badge-background-color, var(--mat-sys-error));color:var(--mat-badge-text-color, var(--mat-sys-on-error));font-family:var(--mat-badge-text-font, var(--mat-sys-label-small-font));font-weight:var(--mat-badge-text-weight, var(--mat-sys-label-small-weight));border-radius:var(--mat-badge-container-shape, var(--mat-sys-corner-full))}.mat-badge-above .mat-badge-content{bottom:100%}.mat-badge-below .mat-badge-content{top:100%}.mat-badge-before .mat-badge-content{right:100%}[dir=rtl] .mat-badge-before .mat-badge-content{right:auto;left:100%}.mat-badge-after .mat-badge-content{left:100%}[dir=rtl] .mat-badge-after .mat-badge-content{left:auto;right:100%}@media(forced-colors: active){.mat-badge-content{outline:solid 1px;border-radius:0}}.mat-badge-disabled .mat-badge-content{background-color:var(--mat-badge-disabled-state-background-color, color-mix(in srgb, var(--mat-sys-error) 38%, transparent));color:var(--mat-badge-disabled-state-text-color, var(--mat-sys-on-error))}.mat-badge-hidden .mat-badge-content{display:none}.ng-animate-disabled .mat-badge-content,.mat-badge-content._mat-animation-noopable{transition:none}.mat-badge-content.mat-badge-active{transform:none}.mat-badge-small .mat-badge-content{width:var(--mat-badge-legacy-small-size-container-size, unset);height:var(--mat-badge-legacy-small-size-container-size, unset);min-width:var(--mat-badge-small-size-container-size, 6px);min-height:var(--mat-badge-small-size-container-size, 6px);line-height:var(--mat-badge-small-size-line-height, 6px);padding:var(--mat-badge-small-size-container-padding, 0);font-size:var(--mat-badge-small-size-text-size, 0);margin:var(--mat-badge-small-size-container-offset, -6px 0)}.mat-badge-small.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-small-size-container-overlap-offset, -6px)}.mat-badge-medium .mat-badge-content{width:var(--mat-badge-legacy-container-size, unset);height:var(--mat-badge-legacy-container-size, unset);min-width:var(--mat-badge-container-size, 16px);min-height:var(--mat-badge-container-size, 16px);line-height:var(--mat-badge-line-height, 16px);padding:var(--mat-badge-container-padding, 0 4px);font-size:var(--mat-badge-text-size, var(--mat-sys-label-small-size));margin:var(--mat-badge-container-offset, -12px 0)}.mat-badge-medium.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-container-overlap-offset, -12px)}.mat-badge-large .mat-badge-content{width:var(--mat-badge-legacy-large-size-container-size, unset);height:var(--mat-badge-legacy-large-size-container-size, unset);min-width:var(--mat-badge-large-size-container-size, 16px);min-height:var(--mat-badge-large-size-container-size, 16px);line-height:var(--mat-badge-large-size-line-height, 16px);padding:var(--mat-badge-large-size-container-padding, 0 4px);font-size:var(--mat-badge-large-size-text-size, var(--mat-sys-label-small-size));margin:var(--mat-badge-large-size-container-offset, -12px 0)}.mat-badge-large.mat-badge-overlap .mat-badge-content{margin:var(--mat-badge-large-size-container-overlap-offset, -12px)}
2
+ `],encapsulation:2,changeDetection:0})}return e})(),Ke=(()=>{class e{_ngZone=g(te);_elementRef=g(ie);_ariaDescriber=g($e);_renderer=g(oe);_animationMode=g(ne,{optional:!0});_idGenerator=g(Ue);get color(){return this._color}set color(t){this._setColor(t),this._color=t}_color="primary";overlap=!0;disabled;position="above after";get content(){return this._content}set content(t){this._updateRenderedContent(t)}_content;get description(){return this._description}set description(t){this._updateDescription(t)}_description;size="medium";hidden;_badgeElement;_inlineBadgeDescription;_isInitialized=!1;_interactivityChecker=g(Re);_document=g(ge);constructor(){let t=g(Le);t.load(ot),t.load(Be)}isAbove(){return this.position.indexOf("below")===-1}isAfter(){return this.position.indexOf("before")===-1}getBadgeElement(){return this._badgeElement}ngOnInit(){this._clearExistingBadges(),this.content&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement(),this._updateRenderedContent(this.content)),this._isInitialized=!0}ngOnDestroy(){this._renderer.destroyNode&&(this._renderer.destroyNode(this._badgeElement),this._inlineBadgeDescription?.remove()),this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description)}_isHostInteractive(){return this._interactivityChecker.isFocusable(this._elementRef.nativeElement,{ignoreVisibility:!0})}_createBadgeElement(){let t=this._renderer.createElement("span"),i="mat-badge-active";return t.setAttribute("id",this._idGenerator.getId("mat-badge-content-")),t.setAttribute("aria-hidden","true"),t.classList.add(Ze),this._animationMode==="NoopAnimations"&&t.classList.add("_mat-animation-noopable"),this._elementRef.nativeElement.appendChild(t),typeof requestAnimationFrame=="function"&&this._animationMode!=="NoopAnimations"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{t.classList.add(i)})}):t.classList.add(i),t}_updateRenderedContent(t){let i=`${t??""}`.trim();this._isInitialized&&i&&!this._badgeElement&&(this._badgeElement=this._createBadgeElement()),this._badgeElement&&(this._badgeElement.textContent=i),this._content=i}_updateDescription(t){this._ariaDescriber.removeDescription(this._elementRef.nativeElement,this.description),(!t||this._isHostInteractive())&&this._removeInlineDescription(),this._description=t,this._isHostInteractive()?this._ariaDescriber.describe(this._elementRef.nativeElement,t):this._updateInlineDescription()}_updateInlineDescription(){this._inlineBadgeDescription||(this._inlineBadgeDescription=this._document.createElement("span"),this._inlineBadgeDescription.classList.add("cdk-visually-hidden")),this._inlineBadgeDescription.textContent=this.description,this._badgeElement?.appendChild(this._inlineBadgeDescription)}_removeInlineDescription(){this._inlineBadgeDescription?.remove(),this._inlineBadgeDescription=void 0}_setColor(t){let i=this._elementRef.nativeElement.classList;i.remove(`mat-badge-${this._color}`),t&&i.add(`mat-badge-${t}`)}_clearExistingBadges(){let t=this._elementRef.nativeElement.querySelectorAll(`:scope > .${Ze}`);for(let i of Array.from(t))i!==this._badgeElement&&i.remove()}static \u0275fac=function(i){return new(i||e)};static \u0275dir=re({type:e,selectors:[["","matBadge",""]],hostAttrs:[1,"mat-badge"],hostVars:20,hostBindings:function(i,n){i&2&&k("mat-badge-overlap",n.overlap)("mat-badge-above",n.isAbove())("mat-badge-below",!n.isAbove())("mat-badge-before",!n.isAfter())("mat-badge-after",n.isAfter())("mat-badge-small",n.size==="small")("mat-badge-medium",n.size==="medium")("mat-badge-large",n.size==="large")("mat-badge-hidden",n.hidden||!n.content)("mat-badge-disabled",n.disabled)},inputs:{color:[0,"matBadgeColor","color"],overlap:[2,"matBadgeOverlap","overlap",B],disabled:[2,"matBadgeDisabled","disabled",B],position:[0,"matBadgePosition","position"],content:[0,"matBadge","content"],description:[0,"matBadgeDescription","description"],size:[0,"matBadgeSize","size"],hidden:[2,"matBadgeHidden","hidden",B]}})}return e})(),Xe=(()=>{class e{static \u0275fac=function(i){return new(i||e)};static \u0275mod=b({type:e});static \u0275inj=_({imports:[Ve,J,J]})}return e})();function lt(e,a){if(e&1&&(z(0),o(1,"p",25),p(2),s(),N()),e&2){let t=m(3).$implicit;l(2),w(" ",t.Title," ")}}function st(e,a){if(e&1&&(o(0,"p"),p(1),s()),e&2){let t=m(3).$implicit;l(),M(t.Title)}}function dt(e,a){if(e&1&&(o(0,"a",24),C(1,"i"),f(2,lt,3,1,"ng-container",22)(3,st,2,1,"ng-template",null,1,L),s()),e&2){let t=A(4),i=m(2).$implicit;c("href",i.Url,ae),l(),G(i.Icon),l(),c("ngIf",i.Badge)("ngIfElse",t)}}function ct(e,a){if(e&1&&(z(0),f(1,dt,5,5,"a",23),N()),e&2){let t=m().$implicit;l(),c("ngxPermissionsOnly",t.Roles)}}function mt(e,a){if(e&1&&(o(0,"p",25),p(1),s()),e&2){let t=m(4).$implicit;l(),w(" ",t.Title," ")}}function pt(e,a){if(e&1&&(o(0,"p"),p(1),s()),e&2){let t=m(4).$implicit;l(),M(t.Title)}}function gt(e,a){if(e&1&&(z(0),f(1,mt,2,1,"p",25),H(2,"async"),f(3,pt,2,1,"p"),N()),e&2){let t=m(4);l(),se(W(2,1,t.notifications$)!=0?1:3)}}function ht(e,a){if(e&1&&(o(0,"p"),p(1),s()),e&2){let t=m(3).$implicit;l(),M(t.Title)}}function ft(e,a){if(e&1&&(o(0,"a",27),C(1,"i"),f(2,gt,4,3,"ng-container",22)(3,ht,2,1,"ng-template",null,2,L),s()),e&2){let t=A(4),i=m(2).$implicit,n=m();c("matTooltip",n.isCollapseSidebar?i.Title:"")("routerLink",i.Url),l(),G(i.Icon),l(),c("ngIf",i.Badge)("ngIfElse",t)}}function ut(e,a){if(e&1&&f(0,ft,5,6,"a",26),e&2){let t=m().$implicit;c("ngxPermissionsOnly",t.Roles)}}function _t(e,a){if(e&1&&(o(0,"li",21),f(1,ct,2,1,"ng-container",22)(2,ut,1,1,"ng-template",null,0,L),s()),e&2){let t=a.$implicit,i=A(3);l(),c("ngIf",t.ExternalLink)("ngIfElse",i)}}var et=(()=>{class e{constructor(t,i,n,d){this.toggleSidebarService=t,this.notificationService=i,this.decodeTokenService=n,this.authService=d,this.Menu={},this.isCollapseSidebar=!1,this.token=n.getParseToken(),this.storeName=this.token.StoreName,this.Menu=new $().getMenu,this.toggleState$=this.toggleSidebarService.toggleState$}ngOnInit(){this.initNotifications()}initNotifications(){this.notifications$=this.notificationService.getNotification().pipe(D(t=>t.length))}onLogout(){this.authService.logout()}onCallapseSidebar(){this.isCollapseSidebar=!this.isCollapseSidebar,this.storeName=this.token.StoreName,this.isCollapseSidebar&&(this.storeName=this.getInitialTitle(this.token.StoreName))}getInitialTitle(t){if(t){let i,n=t.split(" ");return n.length==1?i=n[0].substring(0,2):i=n.shift().charAt(0)+n.pop().charAt(0),i}}static{this.\u0275fac=function(i){return new(i||e)(I(ze),I(Ae),I(Te),I(De))}}static{this.\u0275cmp=v({type:e,selectors:[["app-menu"]],standalone:!1,decls:28,vars:9,consts:[["DEFAULT_ROUTE",""],["NO_BADGE",""],["WITHOUT_BADGE",""],[1,"wrapper"],["data-color","green",1,"sidebar",3,"ngClass"],[1,"btn-minimize","d-md-block","d-none","p-0","border-0","bg-white",3,"click"],[1,"fas","cursor",3,"ngClass"],[1,"logo"],[1,"navbar","dropdown","bg-transparent","border-0"],["data-bs-toggle","dropdown","aria-expanded","false",1,"simple-text","text-start","dropdown-toggle","d-flex","align-items-center","justify-content-center","cursor-pointer"],[1,"dropdown-menu"],[1,"dropdown-header","text-dark","border-bottom"],[1,"divider","m-0"],["routerLink","/menu/profile",1,"dropdown-item","h5",2,"cursor","pointer"],["aria-hidden","true",1,"fa-user","fas"],[1,"dropdown-item","h5",2,"cursor","pointer",3,"click"],["aria-hidden","true",1,"fas","fa-sign-out-alt"],[1,"sidebar-wrapper"],[1,"nav"],["routerLinkActive","active",4,"ngFor","ngForOf"],[1,"main-panel"],["routerLinkActive","active"],[4,"ngIf","ngIfElse"],["class","nav-link position-relative d-block changelog","target","_blank",3,"href",4,"ngxPermissionsOnly"],["target","_blank",1,"nav-link","position-relative","d-block","changelog",3,"href"],["matBadge","!","matBadgeColor","warn","matBadgeSize","small",1,"shake-animation"],["class","nav-link position-relative d-block","matTooltipPosition","right",3,"matTooltip","routerLink",4,"ngxPermissionsOnly"],["matTooltipPosition","right",1,"nav-link","position-relative","d-block",3,"matTooltip","routerLink"]],template:function(i,n){i&1&&(o(0,"div",3),H(1,"async"),o(2,"div",4)(3,"button",5),T("click",function(){return n.onCallapseSidebar()}),C(4,"i",6),s(),o(5,"div",7)(6,"div",8)(7,"a",9),p(8),s(),o(9,"div",10)(10,"div",11),p(11),s(),C(12,"div",12),o(13,"a",13),C(14,"i",14),p(15,"\xA0 "),o(16,"span"),p(17,"My Profile"),s()(),o(18,"a",15),T("click",function(){return n.onLogout()}),C(19,"i",16),p(20,"\xA0 "),o(21,"span"),p(22," Log Out"),s()()()()(),o(23,"div",17)(24,"ul",18),f(25,_t,4,2,"li",19),s()()(),o(26,"div",20),C(27,"router-outlet"),s()()),i&2&&(k("nav-open",W(1,7,n.toggleState$)),l(2),c("ngClass",n.isCollapseSidebar?"collapses":""),l(2),c("ngClass",n.isCollapseSidebar?"fa-angle-left":"fa-angle-right"),l(4),w(" ",n.storeName," "),l(3),w(" ",n.token==null?null:n.token.LID," "),l(14),c("ngForOf",n.Menu))},dependencies:[he,fe,ue,Ce,Me,ye,Fe,Ke,Oe,_e],styles:["@media (max-width: 468px){.navbar[_ngcontent-%COMP%] .navbar-brand[_ngcontent-%COMP%]{white-space:nowrap;max-width:7em;overflow:hidden;text-overflow:ellipsis}}@media only screen and (min-width: 992px){.sidebar[_ngcontent-%COMP%]{z-index:1050!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%], .sidebar.collapses[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{width:70px;transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%] .simple-text[_ngcontent-%COMP%]{background-color:#ffffff3b;border-radius:20px;height:40px;width:40px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{padding:10px 0 10px 10px!important;height:50px;text-align:center;margin:10px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:none}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{padding-left:70px}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{left:70px!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]{position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1;background-color:#fff;position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border:0;border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;padding:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{cursor:pointer}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1}.full-container[_ngcontent-%COMP%]{padding-top:0!important}} p.shake-animation.mat-badge>span.mat-badge-content{animation:_ngcontent-%COMP%_shake-animation 4.72s ease infinite;font-size:12px;transform-origin:50% 50%;right:-14px!important}@keyframes _ngcontent-%COMP%_shake-animation{0%{transform:translate(0)}1.78571%{transform:translate(5px)}3.57143%{transform:translate(0)}5.35714%{transform:translate(5px)}7.14286%{transform:translate(0)}8.92857%{transform:translate(5px)}10.71429%{transform:translate(0)}to{transform:translate(0)}} .changelog:visited p.shake-animation.mat-badge>span.mat-badge-content{color:#77c425;background-color:#77c425;z-index:-1}@media print{.main-panel[_ngcontent-%COMP%]{padding:0!important}}"]})}}return e})();var u=(e,a)=>F(null,null,function*(){let t=g(we),i=g(ve),n=e.data?.roles||[],d=e.data?.redirectUrl||"/";return n.length===0||(yield bt(t,n))?!0:(i.navigate([d]),!1)});function bt(e,a){return F(this,null,function*(){let t=a.map(n=>e.hasPermission(n));return(yield Promise.all(t)).some(n=>n)})}var Ct=[{path:"",component:et,children:[{path:"",redirectTo:"dashboard",pathMatch:"full"},{path:"profile",loadChildren:()=>import("./chunk-CVM573KF.js").then(e=>e.routes),canActivate:[h],data:{title:"My Profile"}},{path:"dashboard",loadChildren:()=>import("./chunk-PHLSX23M.js").then(e=>e.DashboardModule),canActivate:[h,u,Ge],data:{title:"Dashboard",roles:[r.DashboardView],redirectUrl:"/menu/products"}},{path:"products",loadChildren:()=>import("./chunk-BIHR6KWH.js").then(e=>e.ProductModule),canActivate:[h,u],data:{title:"Products",roles:[r.ProductView],redirectUrl:"/menu/inventory"}},{path:"inventory",loadChildren:()=>import("./chunk-KVOROMP7.js").then(e=>e.InventoryRoutingModule),canActivate:[h,u],data:{title:"Inventory",roles:[r.InventoryView],redirectUrl:"/menu/price"}},{path:"price",loadChildren:()=>import("./chunk-TEJITT3W.js").then(e=>e.PriceRoutingModule),canActivate:[h,u],data:{title:"Price",roles:[r.PriceView],redirectUrl:"/menu/Order"}},{path:"order",loadChildren:()=>import("./chunk-YJKAX7P2.js").then(e=>e.routes),canActivate:[h],data:{title:"Order"}},{path:"sync-log",loadChildren:()=>import("./chunk-5G2U27IM.js").then(e=>e.ReportModule),canActivate:[h,u],data:{title:"Report",roles:[r.Report],redirectUrl:"/menu/Logistic"}},{path:"Logistic",loadChildren:()=>import("./chunk-FY73EXB5.js").then(e=>e.LogisticModule),canActivate:[h,u],data:{title:"Logistic",roles:[r.LogisticView],redirectUrl:"/menu/channel"}},{path:"channel",loadChildren:()=>import("./chunk-F4X5RWKY.js").then(e=>e.ChannelsModule),canActivate:[h,u],data:{title:"Marketplace",roles:[r.ChannelView],redirectUrl:"/menu/log"}},{path:"log",loadChildren:()=>import("./chunk-NABJFAKJ.js").then(e=>e.LogsModule),canActivate:[h,u],data:{title:"Orders",roles:[r.DevView]}},{path:"users",loadChildren:()=>import("./chunk-W4MTON2T.js").then(e=>e.userRoutes),canActivate:[h,u],data:{title:"Users",roles:[r.UserView],redirectUrl:"/menu/dashboard"}},{path:"json-api",loadChildren:()=>import("./chunk-7ZMHGW2W.js").then(e=>e.routes),canActivate:[h],data:{title:"Json API"}}]}],tt=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=b({type:e})}static{this.\u0275inj=_({imports:[q.forChild(Ct),q]})}}return e})();var Mt=["selectId"];function yt(e,a){if(e&1&&(o(0,"span",3),p(1),s()),e&2){let t=a.item,i=m();c("title",t[i.bindLabel]),l(),M(t[i.bindLabel])}}var it=(()=>{class e{set items(t){this.ngSelectInfiniteScroll.data=t,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}get selected(){return this._selected}set selected(t){this._selected=t,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}constructor(){this.placeholder="",this.bindValue="",this.bindLabel="",this.width="100%",this.clearable=!0,this.parent="body",this.disabled=!1,this.optionTitle=!1,this._selected="",this.ngSelectInfiniteScroll=new Y,this.selectedChange=new P,this.selectedLabel=new P,this.onOpen=new P}onOpenSelect(){this.onOpen.emit()}onSelectChange(t){t?(this.selectedChange.emit(t[this.bindValue]),this.selectedLabel.emit(t[this.bindLabel])):(this.selectedChange.emit(null),this.selectedLabel.emit(null))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["ng-select-infinite"]],viewQuery:function(i,n){if(i&1&&ce(Mt,7),i&2){let d;me(d=pe())&&(n.ngSelectElement=d.first)}},inputs:{placeholder:"placeholder",bindValue:"bindValue",bindLabel:"bindLabel",width:"width",clearable:"clearable",parent:"parent",disabled:"disabled",optionTitle:"optionTitle",items:"items",selected:"selected"},outputs:{selectedChange:"selectedChange",selectedLabel:"selectedLabel",onOpen:"onOpen"},decls:3,vars:12,consts:[["selectId",""],[3,"clear","scrollToEnd","open","change","appendTo","disabled","virtualScroll","typeahead","items","bindLabel","bindValue","placeholder","ngModel","clearable"],["ng-option-tmp",""],[3,"title"]],template:function(i,n){if(i&1){let d=de();o(0,"ng-select",1,0),T("clear",function(){return x(d),S(n.ngSelectInfiniteScroll.onClear())})("scrollToEnd",function(){return x(d),S(n.ngSelectInfiniteScroll.onScrollToEnd())})("open",function(){return x(d),S(n.onOpenSelect())})("change",function(at){return x(d),S(n.onSelectChange(at))}),f(2,yt,2,2,"ng-template",2),s()}i&2&&(le("width",n.width),c("appendTo",n.parent)("disabled",n.disabled)("virtualScroll",!0)("typeahead",n.ngSelectInfiniteScroll.input$)("items",n.ngSelectInfiniteScroll.bufferData)("bindLabel",n.bindLabel)("bindValue",n.bindValue)("placeholder",n.placeholder)("ngModel",n.selected)("clearable",n.clearable))},dependencies:[y,V,ke,Pe,R,xe,Se],encapsulation:2})}}return e})(),Y=class{constructor(){this._dataBuffer=[],this._data=[],this._input$=new j,this._destroy$=new j,this._loading=!1,this._bufferSize=50,this.data=[]}onSearch(){this._input$.pipe(K(200),X(),D(a=>(a&&(a=a.toLowerCase()),this.filterData(a))),Z(a=>a!==void 0),ee(this._destroy$)).subscribe(a=>{this._dataBuffer=a.slice(0,this._bufferSize)})}onClear(){this._dataBuffer=this._data.slice(0,this._bufferSize)}filterData(a){let t=-1,i;return this._data.filter(d=>(i=JSON.stringify(d).toLowerCase(),t=i.indexOf(a),t!==-1||a==null))}get input$(){return this._input$}get bufferData(){return this._dataBuffer}get loading(){return this._loading}set data(a){this._data=a||[],this._dataBuffer=this._data.slice(0,this._bufferSize),this.onSearch()}initSelectedValue(a,t){if(Ne.IsNotEmpty(a)){let i=this._data.filter(n=>n[t].toString().toLowerCase().indexOf(a)!==-1);this._dataBuffer=i.slice(0,this._bufferSize)}}set bufferSize(a){this._bufferSize=a}onScrollToEnd(){this.fetchMore()}fetchMore(){let a=this._dataBuffer.length,t=this._data.slice(a,this._bufferSize+a);this._loading=!0,setTimeout(()=>{this._loading=!1,this._dataBuffer=this._dataBuffer.concat(t)},200)}destroy(){this._destroy$.next(!0),this._destroy$.complete()}};var nt=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=b({type:e})}static{this.\u0275inj=_({imports:[y,R,je,qe,Qe,We,Je,Ye,U,Q,it,V,Ie]})}}return e})();var un=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=b({type:e})}static{this.\u0275inj=_({providers:[be],imports:[y,tt,He,U,nt,Xe,Ee.forChild()]})}}return e})();export{un as MenuModule};
@@ -0,0 +1 @@
1
+ import{a as o}from"./chunk-5RAWBW2Q.js";import{a as s,b as l}from"./chunk-WRJFUNM3.js";import"./chunk-BVPWV5YO.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import"./chunk-RXQX7567.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{F as c,J as d}from"./chunk-FXQKRJWU.js";import{Gb as a,Yb as i,ic as p,jc as m,kc as n,rb as r}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var f=(()=>{class t{constructor(){this.tabs=[{Title:"Origin Order API",Url:"/menu/json-api/order-api"},{Title:"Origin Product API",Url:"/menu/json-api/product-api"},{Title:"Origin Escrow API",Url:"/menu/json-api/escrow-api"}]}static{this.\u0275fac=function(e){return new(e||t)}}static{this.\u0275cmp=a({type:t,selectors:[["app-json-api"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(e,v){e&1&&(p(0,"nav",0)(1,"div",1)(2,"div"),n(3,"nav-tab",2),m()()(),n(4,"router-outlet")),e&2&&(r(3),i("Tabs",v.tabs))},dependencies:[l,s,d,c],encapsulation:2})}}return t})(),g=[{path:"",component:f,children:[{path:"",redirectTo:"order-api",pathMatch:"full"},{path:"order-api",loadComponent(){return import("./chunk-HGDEIMTN.js").then(t=>t.OrderApiComponent)},canActivate:[o],data:{title:"Order API"}},{path:"product-api",loadComponent(){return import("./chunk-RI627B2Z.js").then(t=>t.ProductApiComponent)},canActivate:[o],data:{title:"Product API"}},{path:"escrow-api",loadComponent(){return import("./chunk-DZJWZ52D.js").then(t=>t.EscrowApiComponent)},canActivate:[o],data:{title:"Escrow API"}}]}];export{f as JsonApiComponent,g as routes};
@@ -1,2 +1,2 @@
1
- import{b as Et}from"./chunk-3BALA33G.js";import"./chunk-OXWPLJEW.js";import{a as kt}from"./chunk-PFY5UG5D.js";import{a as Te,b as ht,c as gt,d as xe,e as Ie}from"./chunk-4DMKVXM7.js";import"./chunk-WAZXTB4X.js";import{a as ut,b as be,c as ft,d as ye,f as yt,g as vt,h as Fe,i as Tt,o as ae}from"./chunk-KS7ACI26.js";import{b as It}from"./chunk-PHUHUFYL.js";import{a as Ct}from"./chunk-BAXQ2L7B.js";import"./chunk-3GDM5JNY.js";import{b as bt,d as Se}from"./chunk-XXT6F2ZS.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import{b as St}from"./chunk-2O4IEGGR.js";import"./chunk-VFATXJRG.js";import{a as Ft,b as At}from"./chunk-LYPHZP72.js";import"./chunk-EPBVNII2.js";import"./chunk-UZWED4UK.js";import"./chunk-4YRBARG2.js";import"./chunk-5CKVZBHM.js";import"./chunk-BKRCW7SH.js";import"./chunk-RGAKHXPF.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import{a as xt}from"./chunk-RHHHL4OR.js";import"./chunk-PE4SWUEZ.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import{a as _t,b as ve}from"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import{a as Ce}from"./chunk-HIC5QC3Y.js";import{a as pt,b as mt,f as dt}from"./chunk-JBT7GBCM.js";import"./chunk-UMP6ZMEJ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import"./chunk-JVNHFIYT.js";import"./chunk-3YP6ORBR.js";import{a as st}from"./chunk-RM2OSYMV.js";import"./chunk-6RMBCW2O.js";import"./chunk-WWLC64XZ.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import{b as ot,e as re}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{d as H,e as Y}from"./chunk-PYXL7UF7.js";import{b as De,c as h}from"./chunk-PW42BQIY.js";import{m as lt,n as ct}from"./chunk-HJXYT6MI.js";import{A as oe,B as G,a as Qe,c as ne,e as me,h as $,i as W,l as ge,m as Ze,n as X,q as K,r as et,s as J,t as tt,u as it,v as nt,z as q}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import{r as rt,s as at}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{g as A,j as k,n as T}from"./chunk-FXQKRJWU.js";import{$ as Ye,$c as x,Fc as _e,Gb as v,Gc as f,Hb as fe,Hc as ie,Ic as Q,K as Ge,Ka as D,Kc as Ke,Lc as Je,M as He,Mb as _,Mc as qe,Na as je,Oa as Me,Qc as F,Rc as he,Xb as We,Yb as s,Z as te,Zb as Oe,ad as I,ca as pe,dc as S,ea as U,ec as B,f as de,g as $e,gc as L,hc as R,ic as p,ja as M,jc as a,jd as ze,ka as ue,kc as d,lc as N,mc as w,oc as E,pa as u,rb as c,tc as y,uc as l,v as V,xa as O,xb as j,xc as Xe,ya as C,za as b}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var z=function(t){return t[t.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",t[t.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",t[t.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",t[t.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",t[t.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",t}(z||{});var le=function(t){return t[t.FORMAT_NORMAL=1]="FORMAT_NORMAL",t[t.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",t}(le||{});var ce=function(t){return t[t.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",t[t.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",t[t.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",t[t.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",t[t.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",t}(ce||{});var Ne=class extends ge{setValue(m,e){if(m instanceof Date){let i=Math.floor(m.getTime()/1e3);super.setValue(i,e)}else super.setValue(m,e)}},we=(()=>{class t{constructor(){this.shopeeUploadService=u(Te),this.formBuilder=u(q)}getAttributes(e){return this.shopeeUploadService.getAttributes(e.channelId,e.categoryId).pipe(V(i=>this.setLabelToIndonesian(i)))}setLabelToIndonesian(e=[]){let i,n;return e=e.map(o=>(i=o?.multi_lang?.find(r=>r.language=="id"),o.attribute_value_list=o?.attribute_value_list?.map(r=>(n=r?.multi_lang?.find(g=>g.language=="id"),r.name=n?.value,r)),o.name=i?.value?i?.value:o.name,o)),e}createFormGroup(e){let i=this.formBuilder.group({}),n=[];return e.forEach(o=>{if(n=[],o.mandatory&&n.push(me.required),o?.attribute_info?.format_type==le.FORMAT_QUANTITATIVE_WITH_UNIT&&o?.attribute_info?.input_type==z.FREE_TEXT_FILED){let r=this.formBuilder.group({unit:new ge(null),value:new ge(null,n)});i.addControl(JSON.stringify(o.attribute_id),r)}else o?.attribute_info?.input_type==z.FREE_TEXT_FILED&&o?.attribute_info?.input_validation_type==ce.VALIDATOR_DATE_TYPE?i.addControl(JSON.stringify(o.attribute_id),new Ne(null,n)):i.addControl(JSON.stringify(o.attribute_id),this.formBuilder.control(null,n))}),i}getFilteredAttributes(e,i){let n=JSON.parse(JSON.stringify(e)),o=Object.keys(i),r=n.filter(g=>o.findIndex(Pe=>parseInt(Pe)==g.attribute_id||g.mandatory)!=-1);return r=this.filterSelectedAttributes(r,i),r}filterSelectedAttributes(e,i){return e.map(o=>{switch(o.attribute_info.input_type){case z.MULTI_COMBO_BOX:h.IsNotEmpty(i[o.attribute_id])?o.attribute_value_list=o.attribute_value_list.filter(r=>i[o.attribute_id]?.findIndex(g=>g==r.value_id)!=-1):o.attribute_value_list=[];break;case z.FREE_TEXT_FILED:o.attribute_info.format_type==le.FORMAT_QUANTITATIVE_WITH_UNIT?o.attribute_value_list=this.setSelectedQuantitativeAttr(i[o.attribute_id]?.value,i[o.attribute_id]?.unit):o.attribute_info.input_validation_type==ce.VALIDATOR_DATE_TYPE?o.attribute_value_list=this.setSelectedDateAttr(i[o.attribute_id]):o.attribute_value_list=this.setSelectedQuantitativeAttr(i[o.attribute_id]);break;default:o.attribute_value_list=o.attribute_value_list.filter(r=>r.value_id==i[o.attribute_id])}return o}).filter(o=>o?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(e,i){let n=[];if(h.IsNotEmpty(e)){let o={value_id:0,original_value_name:JSON.stringify(e)};h.IsNotEmpty(i)&&(o.value_unit=i),n=[o]}return n}setSelectedDateAttr(e){let i=[];return h.IsNotEmpty(e)&&(i=[{value_id:0,original_value_name:JSON.stringify(e)}]),i}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=M({token:t,factory:t.\u0275fac})}}return t})();var Ae=(()=>{class t{constructor(){this._calendarHeaderConfig=new $e({hideBtnClear:!1,hideBtnToday:!1}),this.calendarConfig=this._calendarHeaderConfig.value}setHeaderConfig(e){this._calendarHeaderConfig.next(e)}getHeaderConfig$(){return this._calendarHeaderConfig.asObservable()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=M({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var $t=["class","component ts"];function Gt(t,m){if(t&1){let e=E();p(0,"button",3),y("click",function(){C(e);let n=l(2);return b(n.todayClicked())}),d(1,"i",4),a()}}function Ht(t,m){if(t&1){let e=E();p(0,"button",5),y("click",function(){C(e);let n=l(2);return b(n.clearClicked())}),d(1,"i",6),a()}}function Yt(t,m){if(t&1&&(N(0),_(1,Gt,2,0,"button",1)(2,Ht,2,0,"button",2),w()),t&2){let e=m.ngIf;c(),s("ngIf",!e.hideBtnToday),c(),s("ngIf",!e.hideBtnClear)}}var Mt=(()=>{class t{constructor(e,i,n,o,r){this._datePicker=e,this._calendar=i,this._dateAdapter=n,this.calendarService=o,this._destroyed=new de,i.stateChanges.pipe(pe(this._destroyed)).subscribe(g=>r.markForCheck()),this.calendarConfig$=this.calendarService.getHeaderConfig$()}todayClicked(){this._calendar.activeDate=this._dateAdapter.today(),this._datePicker.select(this._dateAdapter.today()),this._datePicker.close()}clearClicked(){this._datePicker.select(null),this._datePicker.close()}ngOnChanges(e){this._calendar.ngOnChanges(e)}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}static{this.\u0275fac=function(i){return new(i||t)(j(Fe),j(vt),j(be),j(Ae),j(ze))}}static{this.\u0275cmp=v({type:t,selectors:[["POS-DatepickerHeader",8,"component","ts"]],standalone:!1,features:[O],attrs:$t,decls:3,vars:3,consts:[[4,"ngIf"],["mat-icon-button","","title","Today",3,"click",4,"ngIf"],["mat-icon-button","","title","Clear",3,"click",4,"ngIf"],["mat-icon-button","","title","Today",3,"click"],[1,"far","fa-clock",2,"font-size","18px"],["mat-icon-button","","title","Clear",3,"click"],[1,"far","fa-xmark-circle",2,"font-size","18px"]],template:function(i,n){i&1&&(p(0,"mat-calendar-header"),_(1,Yt,3,2,"ng-container",0),x(2,"async"),a()),i&2&&(c(),s("ngIf",I(2,1,n.calendarConfig$)))},dependencies:[A,bt,yt,k],encapsulation:2})}}return t})(),Ot=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=fe({type:t})}static{this.\u0275inj=ue({providers:[ae],imports:[T,Se,ye,ae,Ce,ve]})}}return t})();function jt(t,m){if(t&1&&(p(0,"mat-label",7)(1,"span"),f(2),a()()),t&2){let e=l();s("show",e.placeholder),c(2),ie(e.placeholder)}}var Wt={parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"dddd, D MMMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"dddd, D MMMM YYYY",monthYearA11yLabel:"MMMM YYYY"}},Dt=(()=>{class t{set hidelClearBtn(e){this.calendarService.setHeaderConfig({hideBtnClear:e,hideBtnToday:this.calendarService.calendarConfig.hideBtnToday})}change(e){let i=null;e&&(i=e.toDate(),i.setHours(0,0,0,0)),this.onChange(i),this.dateChange.emit(i)}constructor(e){this.calendarService=e,this.headerComponent=Mt,this.appearance="outline",this.isFloatingLabel=!0,this.disabled=!1,this.readOnly=!1,this.dateChange=new D,this.minDate=h.MinDate,this.onChange=i=>{},this.displayToggle=!0}writeValue(e){this.date=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){this.disabled=e}onOpenDatepicker(){let e=document.getElementById("dropdown-filter");if(e){var i=new bootstrap.Dropdown(e);i&&(i._config.autoClose="inside")}}onCloseDatepicker(){let e=document.getElementById("dropdown-filter");if(e){var i=new bootstrap.Dropdown(e);i&&(i._config.autoClose="outside")}}ngOnDestroy(){this.calendarService.setHeaderConfig({hideBtnClear:!1,hideBtnToday:!1})}static{this.\u0275fac=function(i){return new(i||t)(j(Ae))}}static{this.\u0275cmp=v({type:t,selectors:[["datepicker"]],inputs:{data_cy:"data_cy",placeholder:"placeholder",displayToggle:"displayToggle",appearance:"appearance",width:"width",isFloatingLabel:"isFloatingLabel",date:"date",disabled:"disabled",readOnly:"readOnly",minDateValidation:"minDateValidation",maxDateValidation:"maxDateValidation",hidelClearBtn:"hidelClearBtn"},outputs:{dateChange:"dateChange"},standalone:!1,features:[F([{provide:be,useClass:kt,deps:[ut]},{provide:ft,useValue:Wt},{provide:Qe,multi:!0,useExisting:t}])],decls:7,vars:16,consts:[["picker1",""],[1,"datepicker",3,"disabled","appearance"],[3,"show",4,"ngIf"],["matInput","",3,"dateChange","click","matDatepicker","min","max","placeholder","value","disabled","readonly"],["matSuffix","","aria-hidden","true",1,"datepicker-toggle-icon",3,"click"],[1,"fa-regular","fa-angle-down"],[3,"opened","closed","calendarHeaderComponent"],[3,"show"]],template:function(i,n){if(i&1){let o=E();p(0,"mat-form-field",1),_(1,jt,3,2,"mat-label",2),p(2,"input",3),y("dateChange",function(g){return C(o),b(n.change(g.value))})("click",function(){C(o);let g=_e(6);return b(g.open())}),a(),p(3,"span",4),y("click",function(){C(o);let g=_e(6);return b(g.open())}),d(4,"i",5),a(),p(5,"mat-datepicker",6,0),y("opened",function(){return C(o),b(n.onOpenDatepicker())})("closed",function(){return C(o),b(n.onCloseDatepicker())}),a()()}if(i&2){let o=_e(6);Oe("width",n.width||100,"%"),s("disabled",n.disabled)("appearance",n.appearance),c(),s("ngIf",n.isFloatingLabel&&n.placeholder),c(),Xe("placeholder",n.placeholder||""),s("matDatepicker",o)("min",n.minDateValidation)("max",n.maxDateValidation)("value",n.date==n.minDate?null:n.date)("disabled",n.disabled)("readonly",n.readOnly),We("data-cy",n.data_cy),c(),Oe("display",n.displayToggle?"unset":"none"),c(2),s("calendarHeaderComponent",n.headerComponent)}},dependencies:[A,Fe,Tt,dt,pt,mt,_t],styles:[`.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:3px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{top:28px!important;font-size:16px;color:#9da2a6}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:23px!important;font-size:.875rem;color:#ccc}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}.datepicker .datepicker-toggle-icon{width:28px;height:36px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;margin-right:6px}.datepicker .datepicker-toggle-icon i{font-family:"Font Awesome 6 Pro","Font Awesome 6 Free","Font Awesome 5 Pro","Font Awesome 5 Free";font-weight:400;font-size:16px;line-height:1;color:#6b7280}
2
- `],encapsulation:2})}}return t})(),Nt=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=fe({type:t})}static{this.\u0275inj=ue({providers:[ae],imports:[T,Se,ye,ae,Ce,ve,Ot,It]})}}return t})();var Ve=()=>[];function Kt(t,m){t&1&&(p(0,"span",5),f(1,"*"),a())}function Jt(t,m){if(t&1&&d(0,"ng-select",6),t&2){let e=l().$implicit;s("multiple",!0)("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:he(4,Ve))("placeholder","Pilih "+(e==null?null:e.name))}}function qt(t,m){if(t&1&&d(0,"input",8),t&2){let e=l(2).$implicit;s("formControlName",e.attribute_id)("placeholder","Isi "+(e==null?null:e.name))}}function zt(t,m){if(t&1&&(p(0,"option",15),f(1),a()),t&2){let e=m.$implicit;s("value",e),c(),ie(e)}}function Qt(t,m){if(t&1&&(p(0,"div",10),d(1,"input",12),p(2,"select",13)(3,"option",14),f(4,"Unit"),a(),L(5,zt,2,2,"option",15,B),a()()),t&2){let e=l(3).$implicit;s("formGroupName",e.attribute_id),c(),s("placeholder","Isi "+(e==null?null:e.name)),c(2),s("value",null),c(2),R(e==null||e.attribute_info==null?null:e.attribute_info.attribute_unit_list)}}function Zt(t,m){if(t&1&&d(0,"input",11),t&2){let e=l(3).$implicit;s("formControlName",e.attribute_id)("placeholder","Isi "+(e==null?null:e.name))}}function ei(t,m){if(t&1&&_(0,Qt,7,3,"div",10)(1,Zt,1,2,"input",11),t&2){let e=l(2).$implicit,i=l(2);S((e==null||e.attribute_info==null?null:e.attribute_info.format_type)==i.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function ti(t,m){if(t&1&&d(0,"datepicker",9),t&2){let e=l(2).$implicit;s("formControlName",e.attribute_id)}}function ii(t,m){if(t&1&&_(0,qt,1,2,"input",8)(1,ei,2,1)(2,ti,1,1,"datepicker",9),t&2){let e,i=l().$implicit,n=l(2);S((e=i==null||i.attribute_info==null?null:i.attribute_info.input_validation_type)===n.validationType.VALIDATOR_STRING_TYPE?0:e===n.validationType.VALIDATOR_FLOAT_TYPE?1:e===n.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function ni(t,m){if(t&1&&d(0,"ng-select",7),t&2){let e=l().$implicit;s("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:he(3,Ve))("placeholder","Pilih "+(e==null?null:e.name))}}function oi(t,m){if(t&1&&d(0,"ng-select",7),t&2){let e=l().$implicit;s("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:he(3,Ve))("placeholder","Pilih "+(e==null?null:e.name))}}function ri(t,m){if(t&1&&(p(0,"div",3)(1,"div",4),_(2,Kt,2,0,"span",5),p(3,"span"),f(4),a()(),_(5,Jt,1,5,"ng-select",6)(6,ii,3,1)(7,ni,1,4,"ng-select",7)(8,oi,1,4,"ng-select",7),a()),t&2){let e,i=m.$implicit,n=l(2);c(2),S(i.mandatory?2:-1),c(2),Q(" ",i==null?null:i.name," "),c(),S((e=i==null||i.attribute_info==null?null:i.attribute_info.input_type)===n.inputType.MULTI_COMBO_BOX?5:e===n.inputType.FREE_TEXT_FILED?6:e===n.inputType.SINGLE_COMBO_BOX?7:8)}}function ai(t,m){if(t&1&&(N(0),p(1,"form",1)(2,"div",2),L(3,ri,9,3,"div",3,B),a()(),w()),t&2){let e=m.ngIf,i=l();c(),s("formGroup",i.form),c(2),R(e)}}var wt=(()=>{class t{constructor(){this.formCategoryService=u(we),this.attributesChanges=new D,this.inputType=z,this.formatType=le,this.validationType=ce}ngOnChanges(){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:this.categoryId,channelId:this.channelId,channelType:this.channelType}).pipe(U(e=>{this.form=this.formCategoryService.createFormGroup(e),this.listenToFormChange(e)}),te(1)))}listenToFormChange(e){let i=[];this.formSubscription=this.form.valueChanges.subscribe(n=>{i=this.formCategoryService.getFilteredAttributes(e,n),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["shopee-attribute-form"]],inputs:{channelType:"channelType",categoryId:"categoryId",channelId:"channelId",channelProductUpload:"channelProductUpload"},outputs:{attributesChanges:"attributesChanges"},features:[F([we]),O],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","value_id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","value_id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"],[1,"attribute-datepicker",3,"formControlName"],[1,"d-flex","align-items-center",3,"formGroupName"],["type","text","autoNum","",1,"form-control",3,"formControlName","placeholder"],["formControlName","value","type","text","autoNum","",1,"form-control","me-1",2,"width","200px",3,"placeholder"],["name","unit","id","unit","formControlName","unit",1,"form-control"],["disabled","","selected","",3,"value"],[3,"value"]],template:function(i,n){i&1&&(_(0,ai,5,1,"ng-container",0),x(1,"async")),i&2&&s("ngIf",I(1,1,n.attributes$))},dependencies:[T,A,k,Y,H,G,X,it,nt,ne,tt,$,W,K,J,et,xt,Nt,Dt],styles:["input[_ngcontent-%COMP%], select[_ngcontent-%COMP%]{height:36px;border-radius:4px} datepicker.attribute-datepicker>mat-form-field.mat-mdc-form-field>.mat-mdc-text-field-wrapper{height:36px} datepicker.attribute-datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{padding-top:11px!important;padding-bottom:11px!important;height:36px;min-height:36px!important} datepicker.attribute-datepicker mat-datepicker-toggle>button.mat-mdc-icon-button.mat-mdc-button-base{--mdc-icon-button-state-layer-size: 36px}"]})}}return t})();var ee=function(t){return t.TIKTOK_SHOP="TIKTOK_SHOP",t.TOKOPEDIA="TOKOPEDIA",t}(ee||{});var Ue=(()=>{class t{constructor(){this.httpService=u(re),this.formBuilder=u(q),this.uploadProductService=u(Ie)}getAttributes(e,i){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:e},{key:"CategoryID",value:i}]).pipe(Ge(o=>this.uploadProductService.selectedProduct$.pipe(V(r=>(o=this.mappingAttributeSalesProperty(o,r),o)))))}mappingAttributeSalesProperty(e,i){let n=0;return e.filter(o=>(o.type=="SALES_PROPERTY"&&(n+=1),n>1?(n=0,!1):!0)).map(o=>(o.type=="SALES_PROPERTY"&&(o.name="Jenis Variant",o.is_multiple_selection=!1,o.is_required=this.isProductHasMoreVariant(i),o.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),o))}isProductHasMoreVariant(e){let i=!1,n=[];return e.forEach(o=>{o.Variants&&n.push(o.Variants.length)}),i=n.some(o=>o>1),i}createFormGroup(e){let i=this.formBuilder.group({}),n=[];return e.forEach(o=>{n=[],o.is_required&&n.push(me.required),i.addControl(o.id,this.formBuilder.control(null,n))}),i.addControl("listingPlatform",this.formBuilder.control([ee.TIKTOK_SHOP,ee.TOKOPEDIA],[me.required])),i}getFilteredAttributes(e,i){let n=JSON.parse(JSON.stringify(e)),o=Object.keys(i),r=n.filter(g=>o.findIndex(Pe=>parseInt(Pe)==g.id)!=-1);return r=this.filterSelectedAttributes(r,i),r}filterSelectedAttributes(e,i){return e.map(o=>(h.IsNotEmpty(o.values)?o.is_multiple_selection?o.values=o.values.filter(r=>i[o.id]?.includes(r.id)):o.values=o.values.filter(r=>r.id==i[o.id]):i[o.id]&&(o.values=[{id:null,name:i[o.id]}]),o)).filter(o=>o?.values?.length>0)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=M({token:t,factory:t.\u0275fac})}}return t})();function li(t,m){t&1&&(p(0,"small",6),f(1," Platform is required "),a())}function ci(t,m){t&1&&(p(0,"span",6),f(1,"*"),a())}function si(t,m){if(t&1&&d(0,"ng-select",7),t&2){let e=l().$implicit;s("multiple",!0)("formControlName",e.id)("items",e.values)("placeholder","Pilih "+(e==null?null:e.name))}}function pi(t,m){if(t&1&&d(0,"ng-select",8),t&2){let e=l().$implicit;s("formControlName",e.id)("items",e.values)("placeholder","Pilih "+(e==null?null:e.name))}}function mi(t,m){if(t&1&&d(0,"input",9),t&2){let e=l().$implicit;s("formControlName",e.id)("placeholder",e==null?null:e.name)}}function di(t,m){if(t&1&&(p(0,"small",6),f(1),a()),t&2){let e=l().$implicit;c(),Q(" ",e==null?null:e.name," is mandatory ")}}function ui(t,m){if(t&1&&(p(0,"div",3)(1,"div",4),_(2,ci,2,0,"span",6),p(3,"span"),f(4),a()(),_(5,si,1,4,"ng-select",7)(6,pi,1,3,"ng-select",8)(7,mi,1,2,"input",9)(8,di,2,1,"small",6),a()),t&2){let e=m.$implicit;c(2),S(e.is_required?2:-1),c(2),Q(" ",e==null?null:e.name," "),c(),S(e.is_multiple_selection?5:e.values!==null&&e.values.length>0?6:7),c(3),S(e.is_required?8:-1)}}function fi(t,m){if(t&1&&(N(0),p(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"span"),f(6," Platform Options"),a()(),d(7,"ng-select",5),_(8,li,2,0,"small",6),a(),L(9,ui,9,4,"div",3,B),a()(),w()),t&2){let e,i=m.ngIf,n=l();c(),s("formGroup",n.form),c(6),s("multiple",!0)("items",n.platformOptions)("clearable",!1),c(),S(!(n.form==null||(e=n.form.get("listingPlatform").errors)==null)&&e.required?8:-1),c(),R(i)}}var Vt=(()=>{class t{constructor(){this.tiktokAttributeFormService=u(Ue),this.platformChange=je({alias:"onPlatformChanges"}),this.formSubscription=new de,this.attributesChanges=new D,this.platformOptions=[{label:"TikTok Shop",value:ee.TIKTOK_SHOP},{label:"Tokopedia",value:ee.TOKOPEDIA}]}ngOnChanges(){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(this.channelId,this.categoryId).pipe(V(e=>e.filter(i=>!(i.type=="PRODUCT_PROPERTY"&&(h.IsEmpty(i.values)||i.values?.length==0)&&i.is_customizable==!1))),U(e=>{this.form=this.tiktokAttributeFormService.createFormGroup(e),this.listenToFormChange(e)}),te(1)))}listenToFormChange(e){let i=[];this.form.valueChanges.pipe(pe(this.formSubscription)).subscribe(n=>{delete n.listingPlatform,i=this.tiktokAttributeFormService.getFilteredAttributes(e,n),this.attributesChanges.emit(i)}),this.form.get("listingPlatform").valueChanges.pipe(Ye(this.form.get("listingPlatform").value),pe(this.formSubscription)).subscribe(n=>{this.platformChange.emit(n)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["tiktok-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{platformChange:"onPlatformChanges",attributesChanges:"attributesChanges"},features:[F([Ue]),O],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","listingPlatform","bindLabel","label","bindValue","value","placeholder","Platform Options",3,"multiple","items","clearable"],[1,"text-danger"],["bindLabel","name","bindValue","id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"]],template:function(i,n){i&1&&(_(0,fi,11,5,"ng-container",0),x(1,"async")),i&2&&s("ngIf",I(1,1,n.attributes$))},dependencies:[T,A,k,Y,H,G,X,ne,$,W,K,J,oe],encapsulation:2})}}return t})();var Be=(()=>{class t{constructor(){this.woocommerceUploadService=u(xe)}getAttributes(e,i){return this.woocommerceUploadService.getAttributes(e,i).pipe(V(n=>n.map(o=>({key:o.name,label:o.name}))))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=M({token:t,factory:t.\u0275fac})}}return t})();var Ut=(()=>{class t{constructor(){this.wooAttributeFormService=u(Be),this.channelId=Me(),this.categoryId=Me(),this.attributesChanges=new D}ngOnChanges(){h.IsNotEmpty(this.categoryId())&&h.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(e){this.attributesChanges.emit([e.key])}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[F([Be]),O],decls:6,vars:3,consts:[[1,"row"],[1,"col-6"],[1,"mb-1"],["bindLabel","label","bindValue","id","placeholder","Pilih Atribut",3,"change","items"]],template:function(i,n){i&1&&(p(0,"div",0)(1,"div",1)(2,"div",2),f(3,"Atribut"),a(),p(4,"ng-select",3),x(5,"async"),y("change",function(r){return n.onSelectAttribute(r)}),a()()()),i&2&&(c(4),s("items",I(5,1,n.attributes$)))},dependencies:[T,k,oe,Y,H,G],encapsulation:2})}}return t})();var Le=(()=>{class t{constructor(){this.httpService=u(re),this.formBuilder=u(q)}getAttributes(e,i){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:e},{key:"CategoryID",value:i}]).pipe(V(o=>o))}createFormGroup(e){let i=this.formBuilder.group({});return e.forEach(n=>{i.addControl(n.variant,this.formBuilder.control(null))}),i}convertAttributes(e={}){return Object.values(e).filter(n=>n!==null).map(n=>JSON.stringify(n))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=M({token:t,factory:t.\u0275fac})}}return t})();function _i(t,m){if(t&1&&(p(0,"div",3)(1,"div",4),f(2),a(),d(3,"ng-select",5),a()),t&2){let e=m.$implicit;c(2),Q(" ",e==null?null:e.variant," "),c(),s("formControlName",e.variant)("items",e.values)("placeholder","Pilih "+(e==null?null:e.variant))}}function hi(t,m){if(t&1&&(N(0),p(1,"form",1)(2,"div",2),L(3,_i,4,4,"div",3,B),a()(),w()),t&2){let e=m.ngIf,i=l();c(),s("formGroup",i.form),c(2),R(e)}}var Bt=(()=>{class t{constructor(){this.tokpedAttrFormService=u(Le),this.attributesChanges=new D}ngOnInit(){}ngOnChanges(e){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(this.channelId,this.categoryId).pipe(U(i=>{this.form=this.tokpedAttrFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){let e=[];this.formSubscription=this.form.valueChanges.subscribe(i=>{e=this.tokpedAttrFormService.convertAttributes(i),this.attributesChanges.emit(e)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[F([Le]),O],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(i,n){i&1&&(_(0,hi,5,1,"ng-container",0),x(1,"async")),i&2&&s("ngIf",I(1,1,n.attributes$))},dependencies:[T,A,k,Y,H,G,X,$,W,K,J],encapsulation:2})}}return t})();var Re=(()=>{class t{constructor(){this.httpService=u(re),this.formBuilder=u(q)}getAttributes(e){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:e}]).pipe(U(n=>(n.Options.StatusOptions=n.Options.Status.map(o=>({id:o,name:o})),n)))}createFormGroup(e){let i=this.formBuilder.group({});return Object.keys(e.Attribute).forEach(o=>{i.addControl(o,this.formBuilder.control(null))}),i}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=M({token:t,factory:t.\u0275fac})}}return t})();function gi(t,m){if(t&1&&(N(0),p(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4),f(5," Brand "),a(),d(6,"input",5),a(),p(7,"div",6)(8,"div",4),f(9," Product Type "),a(),d(10,"input",7),a(),p(11,"div",6)(12,"div",4),f(13," Status "),a(),d(14,"ng-select",8),a()()(),w()),t&2){let e=m.ngIf,i=l();c(),s("formGroup",i.form),c(13),s("items",e.Options.StatusOptions)}}var Lt=(()=>{class t{constructor(){this.attributesChanges=new D,this.shopifyFormService=u(Re)}ngOnChanges(e){e.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId).pipe(U(i=>{this.form=this.shopifyFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(He(500)).subscribe(e=>{this.attributesChanges.emit([e])})}ngOnDestroy(){this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["shopify-attribute-form"]],inputs:{channelId:"channelId"},outputs:{attributesChanges:"attributesChanges"},features:[F([Re]),O],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","Brand","type","text","placeholder","brand",1,"form-control"],[1,"col-6"],["formControlName","ProductType","type","text","placeholder","Product Type",1,"form-control"],["formControlName","Status","bindLabel","name","bindValue","id","placeholder","Status",3,"items"]],template:function(i,n){i&1&&(_(0,gi,15,2,"ng-container",0),x(1,"async")),i&2&&s("ngIf",I(1,1,n.attributes$))},dependencies:[T,A,k,G,X,ne,$,W,K,J,Y,H],encapsulation:2})}}return t})();function Ci(t,m){if(t&1&&(p(0,"div",6),d(1,"app-product-card",9),a()),t&2){let e=m.$implicit;c(),s("productId",e==null?null:e.ID)("title",e==null?null:e.Name)("image",e==null?null:e.ThumbnailUrl)("description",(e==null||e.Variants==null?null:e.Variants.length)>1?(e==null||e.Variants==null?null:e.Variants.length)+" Variants":null)("imageForZoom",e==null?null:e.ImageUrl)("code",e==null||e.Variants[0]==null?null:e.Variants[0].Code)("showFooter",!1)}}function bi(t,m){if(t&1){let e=E();N(0),p(1,"mat-checkbox",21),qe("ngModelChange",function(n){C(e);let o=l().$implicit;return Je(o.selected,n)||(o.selected=n),b(n)}),y("ngModelChange",function(){let n=C(e).ngIf,o=l(),r=o.$implicit,g=o.$index,se=l();return b(se.onSelectChannel(r,g,n))}),a(),w()}if(t&2){let e=l().$implicit;c(),Ke("ngModel",e.selected)}}function yi(t,m){if(t&1&&(p(0,"div",18),d(1,"input",22),a()),t&2){let e=l().$implicit,i=l();s("matTooltip",e.type==i.channelType.Shopify?"Cannot change category, please change category in admin.shopify.com":e.type==i.channelType.Plugo?"You can change the category after the product has been uploaded to the Plugo Dashboard.":"")}}function vi(t,m){if(t&1){let e=E();p(0,"app-channel-category-select",23),y("selectedCategory",function(n){C(e);let o=l().$index,r=l();return b(r.onCategoryChange(o,n))}),a()}if(t&2){let e=l().$implicit,i=l();s("disabled",!e.selected||e.selected&&e.type==i.channelType.Lazada)("channelId",e.id)("channelType",e.type)("categoryId",e.categoryId)}}function Ti(t,m){if(t&1){let e=E();p(0,"shopee-attribute-form",27),y("attributesChanges",function(n){C(e);let o=l(2).$index,r=l();return b(r.onAttributesChange(o,n))}),a()}if(t&2){let e=l(2).$implicit;s("categoryId",e.categoryId)("channelId",e.id)("channelType",e.type)}}function xi(t,m){if(t&1){let e=E();p(0,"tiktok-attribute-form",28),y("attributesChanges",function(n){C(e);let o=l(2).$index,r=l();return b(r.onAttributesChange(o,n))})("onPlatformChanges",function(n){C(e);let o=l(2).$index,r=l();return b(r.onPlatformChange(o,n))}),a()}if(t&2){let e=l(2).$implicit;s("categoryId",e.categoryId)("channelId",e.id)}}function Ii(t,m){if(t&1){let e=E();p(0,"wooocommerce-attribute-form",29),y("attributesChanges",function(n){C(e);let o=l(2).$index,r=l();return b(r.onAttributesChange(o,n))}),a()}if(t&2){let e=l(2).$implicit;s("categoryId",e.categoryId)("channelId",e.id)}}function Si(t,m){if(t&1){let e=E();p(0,"tokopedia-attribute-form",29),y("attributesChanges",function(n){C(e);let o=l(2).$index,r=l();return b(r.onAttributesChange(o,n))}),a()}if(t&2){let e=l(2).$implicit;s("categoryId",e.categoryId)("channelId",e.id)}}function Fi(t,m){if(t&1&&(p(0,"div",20)(1,"div",24),_(2,Ti,1,3,"shopee-attribute-form",25)(3,xi,1,2,"tiktok-attribute-form",26)(4,Ii,1,2,"wooocommerce-attribute-form",26)(5,Si,1,2,"tokopedia-attribute-form",26),a()()),t&2){let e,i=l().$implicit,n=l();c(2),S((e=i.type)===n.channelType.Shopee?2:e===n.channelType.Tiktok?3:e===n.channelType.WooCommerce?4:e===n.channelType.Tokopedia?5:-1)}}function Ai(t,m){if(t&1){let e=E();p(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",30),y("attributesChanges",function(n){C(e);let o=l().$index,r=l();return b(r.onAttributesChange(o,n))}),a()()()}if(t&2){let e=l().$implicit;c(2),s("channelId",e.id)}}function ki(t,m){if(t&1&&(p(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),_(6,bi,2,1,"ng-container",14),x(7,"async"),a(),p(8,"div"),d(9,"app-channel-logo",15),a(),p(10,"div",16)(11,"span"),f(12),a()()()(),p(13,"div",12)(14,"div",17),_(15,yi,2,1,"div",18)(16,vi,1,4,"app-channel-category-select",19),a()()(),_(17,Fi,6,1,"div",20)(18,Ai,3,1,"div",20),a()()),t&2){let e=m.$implicit,i=l();c(6),s("ngIf",I(7,8,i.defaultCategories$)),c(3),s("typeId",e.type)("showChannelName",!1),c(),s("matTooltip",e.name)("matTooltipShowDelay",2500),c(2),ie(e.name),c(3),S(e.type==i.channelType.Shopify||e.type==i.channelType.Plugo?15:16),c(2),S(e.categoryId&&i.channelType.Lazada!=e.type&&e.selected?17:i.channelType.Shopify==e.type&&e.selected?18:-1)}}var Ar=(()=>{class t{constructor(){this.toastr=u(ot),this.uploadProductService=u(Ie),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=De,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(te(1))}onCategoryChange(e,i){this.channelProductUploads.update(n=>n.map((o,r)=>(r==e&&(o.categoryId=i,o.attributes=[]),o)))}onPlatformChange(e,i){this.channelProductUploads.update(n=>n.map((o,r)=>(r==e&&(o.listing_platforms=i),o)))}onAttributesChange(e,i){this.channelProductUploads.update(n=>n.map((o,r)=>(r==e&&(o.attributes=i),o)))}tiktokPlatformChanges(e,i){this.channelProductUploads.update(n=>n.map((o,r)=>(r==e&&(o.listing_platforms=i),o)))}onSelectChannel(e,i,n){this.channelProductUploads.update(o=>o.map((r,g)=>{if(g==i&&e.selected){let se=this.findCategoryByChannelId(e.id,n);r.categoryId=se?.DefaultCategoryID}return g==i&&!e.selected&&(r.categoryId=null),r}))}findCategoryByChannelId(e,i){return i.find(n=>n.ID===e)}onUploadProduct(){if(this.checkTiktokPlatform()==!1){this.toastr.error("Please select at least one platform for TikTok channel","Platform is Required");return}this.uploadProductService.onUploadProduct(this.channelProductUploads())}checkTiktokPlatform(){return this.channelProductUploads().every(i=>i.type==De.Tiktok&&h.IsNotEmpty(i?.categoryId)?i.listing_platforms.length>0:!0)}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["app-product-upload"]],features:[F([Te,ht,gt,xe])],decls:17,vars:5,consts:[["headerTitle","Upload Product To Channel",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-upload"],[1,"container-fluid","mt-6"],[1,"ps-3","mt-8","pb-5","fw-medium"],[1,"row","mb-10","ps-3"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"ps-3","mb-8","border-bottom","pb-5","fw-medium"],[1,"row","mb-6"],[3,"productId","title","image","description","imageForZoom","code","showFooter"],[1,"col-12"],[1,"row"],[1,"col-3"],[1,"d-flex","align-items-center"],[4,"ngIf"],[3,"typeId","showChannelName"],[2,"overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"matTooltip","matTooltipShowDelay"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip"],[3,"disabled","channelId","channelType","categoryId"],[1,"row","my-3"],["color","primary",1,"example-margin",3,"ngModelChange","ngModel"],["disabled","","type","text","placeholder","Category Unavailable",1,"form-control","rounded-1",2,"height","35px"],[3,"selectedCategory","disabled","channelId","channelType","categoryId"],[1,"col-12","ps-11"],[3,"categoryId","channelId","channelType"],[3,"categoryId","channelId"],[3,"attributesChanges","categoryId","channelId","channelType"],[3,"attributesChanges","onPlatformChanges","categoryId","channelId"],[3,"attributesChanges","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(i,n){if(i&1&&(p(0,"mainpanel",0)(1,"actions")(2,"button",1),y("click",function(){return n.onUploadProduct()}),d(3,"i",2),f(4," Upload "),a()(),p(5,"content")(6,"div",3)(7,"h3",4),f(8,"Product To Upload"),a(),p(9,"div",5),L(10,Ci,2,7,"div",6,B),x(12,"async"),a(),p(13,"h3",7),f(14,"Channel To Upload"),a(),L(15,ki,19,10,"div",8,B),a()()()),i&2){let o;s("hideSearchBox",!0)("hideSearchDropdown",!0),c(2),s("disabled",((o=n.channelProductUploads())==null?null:o.length)==0),c(8),R(I(12,3,n.selectedProducts$)),c(5),R(n.channelProductUploads())}},dependencies:[T,A,k,St,ct,lt,At,Ft,st,oe,$,Ze,at,rt,Vt,Ut,Bt,Lt,Ct,Et,wt],encapsulation:2})}}return t})();export{Ar as ProductUploadComponent};
1
+ import{b as Et}from"./chunk-B3HL4DNT.js";import"./chunk-OXWPLJEW.js";import{a as kt}from"./chunk-PFY5UG5D.js";import{a as Te,b as ht,c as gt,d as xe,e as Ie}from"./chunk-FF4PEO2O.js";import"./chunk-DGIH7HSJ.js";import{a as ut,b as be,c as ft,d as ye,f as yt,g as vt,h as Fe,i as Tt,o as ae}from"./chunk-KS7ACI26.js";import{b as It}from"./chunk-PHUHUFYL.js";import{a as Ct}from"./chunk-2WHJU6CS.js";import"./chunk-3GDM5JNY.js";import{b as bt,d as Se}from"./chunk-XXT6F2ZS.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import{b as St}from"./chunk-2O4IEGGR.js";import"./chunk-VFATXJRG.js";import{a as Ft,b as At}from"./chunk-LYPHZP72.js";import"./chunk-EPBVNII2.js";import"./chunk-UZWED4UK.js";import"./chunk-4YRBARG2.js";import"./chunk-5CKVZBHM.js";import"./chunk-BKRCW7SH.js";import"./chunk-RGAKHXPF.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import{a as xt}from"./chunk-RHHHL4OR.js";import"./chunk-NLJHQ4MQ.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import{a as _t,b as ve}from"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import{a as Ce}from"./chunk-HIC5QC3Y.js";import{a as st,b as mt,f as dt}from"./chunk-JBT7GBCM.js";import"./chunk-UMP6ZMEJ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import"./chunk-JVNHFIYT.js";import"./chunk-C7YK5TDP.js";import{a as pt}from"./chunk-GHFADTRR.js";import"./chunk-UWC2EVFY.js";import"./chunk-ACIMXBIC.js";import"./chunk-BVPWV5YO.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import{b as ot,e as re}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{d as H,e as Y}from"./chunk-PYXL7UF7.js";import{b as De,c as h}from"./chunk-RXQX7567.js";import{m as lt,n as ct}from"./chunk-HJXYT6MI.js";import{A as oe,B as G,a as Qe,c as ne,e as me,h as $,i as W,l as ge,m as Ze,n as X,q as K,r as et,s as J,t as tt,u as it,v as nt,z as q}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import{r as rt,s as at}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{g as A,j as k,n as T}from"./chunk-FXQKRJWU.js";import{$ as Ye,$c as x,Fc as _e,Gb as v,Gc as f,Hb as fe,Hc as ie,Ic as Q,K as Ge,Ka as D,Kc as Ke,Lc as Je,M as He,Mb as _,Mc as qe,Na as je,Oa as Me,Qc as F,Rc as he,Xb as We,Yb as p,Z as te,Zb as Oe,ad as I,ca as se,dc as S,ea as U,ec as B,f as de,g as $e,gc as L,hc as R,ic as s,ja as M,jc as a,jd as ze,ka as ue,kc as d,lc as N,mc as w,oc as E,pa as u,rb as c,tc as y,uc as l,v as V,xa as O,xb as j,xc as Xe,ya as C,za as b}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var z=function(t){return t[t.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",t[t.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",t[t.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",t[t.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",t[t.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",t}(z||{});var le=function(t){return t[t.FORMAT_NORMAL=1]="FORMAT_NORMAL",t[t.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",t}(le||{});var ce=function(t){return t[t.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",t[t.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",t[t.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",t[t.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",t[t.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",t}(ce||{});var Ne=class extends ge{setValue(m,e){if(m instanceof Date){let i=Math.floor(m.getTime()/1e3);super.setValue(i,e)}else super.setValue(m,e)}},we=(()=>{class t{constructor(){this.shopeeUploadService=u(Te),this.formBuilder=u(q)}getAttributes(e){return this.shopeeUploadService.getAttributes(e.channelId,e.categoryId).pipe(V(i=>this.setLabelToIndonesian(i)))}setLabelToIndonesian(e=[]){let i,n;return e=e.map(o=>(i=o?.multi_lang?.find(r=>r.language=="id"),o.attribute_value_list=o?.attribute_value_list?.map(r=>(n=r?.multi_lang?.find(g=>g.language=="id"),r.name=n?.value,r)),o.name=i?.value?i?.value:o.name,o)),e}createFormGroup(e){let i=this.formBuilder.group({}),n=[];return e.forEach(o=>{if(n=[],o.mandatory&&n.push(me.required),o?.attribute_info?.format_type==le.FORMAT_QUANTITATIVE_WITH_UNIT&&o?.attribute_info?.input_type==z.FREE_TEXT_FILED){let r=this.formBuilder.group({unit:new ge(null),value:new ge(null,n)});i.addControl(JSON.stringify(o.attribute_id),r)}else o?.attribute_info?.input_type==z.FREE_TEXT_FILED&&o?.attribute_info?.input_validation_type==ce.VALIDATOR_DATE_TYPE?i.addControl(JSON.stringify(o.attribute_id),new Ne(null,n)):i.addControl(JSON.stringify(o.attribute_id),this.formBuilder.control(null,n))}),i}getFilteredAttributes(e,i){let n=JSON.parse(JSON.stringify(e)),o=Object.keys(i),r=n.filter(g=>o.findIndex(Pe=>parseInt(Pe)==g.attribute_id||g.mandatory)!=-1);return r=this.filterSelectedAttributes(r,i),r}filterSelectedAttributes(e,i){return e.map(o=>{switch(o.attribute_info.input_type){case z.MULTI_COMBO_BOX:h.IsNotEmpty(i[o.attribute_id])?o.attribute_value_list=o.attribute_value_list.filter(r=>i[o.attribute_id]?.findIndex(g=>g==r.value_id)!=-1):o.attribute_value_list=[];break;case z.FREE_TEXT_FILED:o.attribute_info.format_type==le.FORMAT_QUANTITATIVE_WITH_UNIT?o.attribute_value_list=this.setSelectedQuantitativeAttr(i[o.attribute_id]?.value,i[o.attribute_id]?.unit):o.attribute_info.input_validation_type==ce.VALIDATOR_DATE_TYPE?o.attribute_value_list=this.setSelectedDateAttr(i[o.attribute_id]):o.attribute_value_list=this.setSelectedQuantitativeAttr(i[o.attribute_id]);break;default:o.attribute_value_list=o.attribute_value_list.filter(r=>r.value_id==i[o.attribute_id])}return o}).filter(o=>o?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(e,i){let n=[];if(h.IsNotEmpty(e)){let o={value_id:0,original_value_name:JSON.stringify(e)};h.IsNotEmpty(i)&&(o.value_unit=i),n=[o]}return n}setSelectedDateAttr(e){let i=[];return h.IsNotEmpty(e)&&(i=[{value_id:0,original_value_name:JSON.stringify(e)}]),i}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=M({token:t,factory:t.\u0275fac})}}return t})();var Ae=(()=>{class t{constructor(){this._calendarHeaderConfig=new $e({hideBtnClear:!1,hideBtnToday:!1}),this.calendarConfig=this._calendarHeaderConfig.value}setHeaderConfig(e){this._calendarHeaderConfig.next(e)}getHeaderConfig$(){return this._calendarHeaderConfig.asObservable()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=M({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var $t=["class","component ts"];function Gt(t,m){if(t&1){let e=E();s(0,"button",3),y("click",function(){C(e);let n=l(2);return b(n.todayClicked())}),d(1,"i",4),a()}}function Ht(t,m){if(t&1){let e=E();s(0,"button",5),y("click",function(){C(e);let n=l(2);return b(n.clearClicked())}),d(1,"i",6),a()}}function Yt(t,m){if(t&1&&(N(0),_(1,Gt,2,0,"button",1)(2,Ht,2,0,"button",2),w()),t&2){let e=m.ngIf;c(),p("ngIf",!e.hideBtnToday),c(),p("ngIf",!e.hideBtnClear)}}var Mt=(()=>{class t{constructor(e,i,n,o,r){this._datePicker=e,this._calendar=i,this._dateAdapter=n,this.calendarService=o,this._destroyed=new de,i.stateChanges.pipe(se(this._destroyed)).subscribe(g=>r.markForCheck()),this.calendarConfig$=this.calendarService.getHeaderConfig$()}todayClicked(){this._calendar.activeDate=this._dateAdapter.today(),this._datePicker.select(this._dateAdapter.today()),this._datePicker.close()}clearClicked(){this._datePicker.select(null),this._datePicker.close()}ngOnChanges(e){this._calendar.ngOnChanges(e)}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}static{this.\u0275fac=function(i){return new(i||t)(j(Fe),j(vt),j(be),j(Ae),j(ze))}}static{this.\u0275cmp=v({type:t,selectors:[["POS-DatepickerHeader",8,"component","ts"]],standalone:!1,features:[O],attrs:$t,decls:3,vars:3,consts:[[4,"ngIf"],["mat-icon-button","","title","Today",3,"click",4,"ngIf"],["mat-icon-button","","title","Clear",3,"click",4,"ngIf"],["mat-icon-button","","title","Today",3,"click"],[1,"far","fa-clock",2,"font-size","18px"],["mat-icon-button","","title","Clear",3,"click"],[1,"far","fa-xmark-circle",2,"font-size","18px"]],template:function(i,n){i&1&&(s(0,"mat-calendar-header"),_(1,Yt,3,2,"ng-container",0),x(2,"async"),a()),i&2&&(c(),p("ngIf",I(2,1,n.calendarConfig$)))},dependencies:[A,bt,yt,k],encapsulation:2})}}return t})(),Ot=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=fe({type:t})}static{this.\u0275inj=ue({providers:[ae],imports:[T,Se,ye,ae,Ce,ve]})}}return t})();function jt(t,m){if(t&1&&(s(0,"mat-label",7)(1,"span"),f(2),a()()),t&2){let e=l();p("show",e.placeholder),c(2),ie(e.placeholder)}}var Wt={parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"dddd, D MMMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"dddd, D MMMM YYYY",monthYearA11yLabel:"MMMM YYYY"}},Dt=(()=>{class t{set hidelClearBtn(e){this.calendarService.setHeaderConfig({hideBtnClear:e,hideBtnToday:this.calendarService.calendarConfig.hideBtnToday})}change(e){let i=null;e&&(i=e.toDate(),i.setHours(0,0,0,0)),this.onChange(i),this.dateChange.emit(i)}constructor(e){this.calendarService=e,this.headerComponent=Mt,this.appearance="outline",this.isFloatingLabel=!0,this.disabled=!1,this.readOnly=!1,this.dateChange=new D,this.minDate=h.MinDate,this.onChange=i=>{},this.displayToggle=!0}writeValue(e){this.date=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){this.disabled=e}onOpenDatepicker(){let e=document.getElementById("dropdown-filter");if(e){var i=new bootstrap.Dropdown(e);i&&(i._config.autoClose="inside")}}onCloseDatepicker(){let e=document.getElementById("dropdown-filter");if(e){var i=new bootstrap.Dropdown(e);i&&(i._config.autoClose="outside")}}ngOnDestroy(){this.calendarService.setHeaderConfig({hideBtnClear:!1,hideBtnToday:!1})}static{this.\u0275fac=function(i){return new(i||t)(j(Ae))}}static{this.\u0275cmp=v({type:t,selectors:[["datepicker"]],inputs:{data_cy:"data_cy",placeholder:"placeholder",displayToggle:"displayToggle",appearance:"appearance",width:"width",isFloatingLabel:"isFloatingLabel",date:"date",disabled:"disabled",readOnly:"readOnly",minDateValidation:"minDateValidation",maxDateValidation:"maxDateValidation",hidelClearBtn:"hidelClearBtn"},outputs:{dateChange:"dateChange"},standalone:!1,features:[F([{provide:be,useClass:kt,deps:[ut]},{provide:ft,useValue:Wt},{provide:Qe,multi:!0,useExisting:t}])],decls:7,vars:16,consts:[["picker1",""],[1,"datepicker",3,"disabled","appearance"],[3,"show",4,"ngIf"],["matInput","",3,"dateChange","click","matDatepicker","min","max","placeholder","value","disabled","readonly"],["matSuffix","","aria-hidden","true",1,"datepicker-toggle-icon",3,"click"],[1,"fa-regular","fa-angle-down"],[3,"opened","closed","calendarHeaderComponent"],[3,"show"]],template:function(i,n){if(i&1){let o=E();s(0,"mat-form-field",1),_(1,jt,3,2,"mat-label",2),s(2,"input",3),y("dateChange",function(g){return C(o),b(n.change(g.value))})("click",function(){C(o);let g=_e(6);return b(g.open())}),a(),s(3,"span",4),y("click",function(){C(o);let g=_e(6);return b(g.open())}),d(4,"i",5),a(),s(5,"mat-datepicker",6,0),y("opened",function(){return C(o),b(n.onOpenDatepicker())})("closed",function(){return C(o),b(n.onCloseDatepicker())}),a()()}if(i&2){let o=_e(6);Oe("width",n.width||100,"%"),p("disabled",n.disabled)("appearance",n.appearance),c(),p("ngIf",n.isFloatingLabel&&n.placeholder),c(),Xe("placeholder",n.placeholder||""),p("matDatepicker",o)("min",n.minDateValidation)("max",n.maxDateValidation)("value",n.date==n.minDate?null:n.date)("disabled",n.disabled)("readonly",n.readOnly),We("data-cy",n.data_cy),c(),Oe("display",n.displayToggle?"unset":"none"),c(2),p("calendarHeaderComponent",n.headerComponent)}},dependencies:[A,Fe,Tt,dt,st,mt,_t],styles:[`.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:3px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{top:28px!important;font-size:16px;color:#9da2a6}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:23px!important;font-size:.875rem;color:#ccc}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}.datepicker .datepicker-toggle-icon{width:28px;height:36px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;margin-right:6px}.datepicker .datepicker-toggle-icon i{font-family:"Font Awesome 6 Pro","Font Awesome 6 Free","Font Awesome 5 Pro","Font Awesome 5 Free";font-weight:400;font-size:16px;line-height:1;color:#6b7280}
2
+ `],encapsulation:2})}}return t})(),Nt=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=fe({type:t})}static{this.\u0275inj=ue({providers:[ae],imports:[T,Se,ye,ae,Ce,ve,Ot,It]})}}return t})();var Ve=()=>[];function Kt(t,m){t&1&&(s(0,"span",5),f(1,"*"),a())}function Jt(t,m){if(t&1&&d(0,"ng-select",6),t&2){let e=l().$implicit;p("multiple",!0)("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:he(4,Ve))("placeholder","Pilih "+(e==null?null:e.name))}}function qt(t,m){if(t&1&&d(0,"input",8),t&2){let e=l(2).$implicit;p("formControlName",e.attribute_id)("placeholder","Isi "+(e==null?null:e.name))}}function zt(t,m){if(t&1&&(s(0,"option",15),f(1),a()),t&2){let e=m.$implicit;p("value",e),c(),ie(e)}}function Qt(t,m){if(t&1&&(s(0,"div",10),d(1,"input",12),s(2,"select",13)(3,"option",14),f(4,"Unit"),a(),L(5,zt,2,2,"option",15,B),a()()),t&2){let e=l(3).$implicit;p("formGroupName",e.attribute_id),c(),p("placeholder","Isi "+(e==null?null:e.name)),c(2),p("value",null),c(2),R(e==null||e.attribute_info==null?null:e.attribute_info.attribute_unit_list)}}function Zt(t,m){if(t&1&&d(0,"input",11),t&2){let e=l(3).$implicit;p("formControlName",e.attribute_id)("placeholder","Isi "+(e==null?null:e.name))}}function ei(t,m){if(t&1&&_(0,Qt,7,3,"div",10)(1,Zt,1,2,"input",11),t&2){let e=l(2).$implicit,i=l(2);S((e==null||e.attribute_info==null?null:e.attribute_info.format_type)==i.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function ti(t,m){if(t&1&&d(0,"datepicker",9),t&2){let e=l(2).$implicit;p("formControlName",e.attribute_id)}}function ii(t,m){if(t&1&&_(0,qt,1,2,"input",8)(1,ei,2,1)(2,ti,1,1,"datepicker",9),t&2){let e,i=l().$implicit,n=l(2);S((e=i==null||i.attribute_info==null?null:i.attribute_info.input_validation_type)===n.validationType.VALIDATOR_STRING_TYPE?0:e===n.validationType.VALIDATOR_FLOAT_TYPE?1:e===n.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function ni(t,m){if(t&1&&d(0,"ng-select",7),t&2){let e=l().$implicit;p("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:he(3,Ve))("placeholder","Pilih "+(e==null?null:e.name))}}function oi(t,m){if(t&1&&d(0,"ng-select",7),t&2){let e=l().$implicit;p("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:he(3,Ve))("placeholder","Pilih "+(e==null?null:e.name))}}function ri(t,m){if(t&1&&(s(0,"div",3)(1,"div",4),_(2,Kt,2,0,"span",5),s(3,"span"),f(4),a()(),_(5,Jt,1,5,"ng-select",6)(6,ii,3,1)(7,ni,1,4,"ng-select",7)(8,oi,1,4,"ng-select",7),a()),t&2){let e,i=m.$implicit,n=l(2);c(2),S(i.mandatory?2:-1),c(2),Q(" ",i==null?null:i.name," "),c(),S((e=i==null||i.attribute_info==null?null:i.attribute_info.input_type)===n.inputType.MULTI_COMBO_BOX?5:e===n.inputType.FREE_TEXT_FILED?6:e===n.inputType.SINGLE_COMBO_BOX?7:8)}}function ai(t,m){if(t&1&&(N(0),s(1,"form",1)(2,"div",2),L(3,ri,9,3,"div",3,B),a()(),w()),t&2){let e=m.ngIf,i=l();c(),p("formGroup",i.form),c(2),R(e)}}var wt=(()=>{class t{constructor(){this.formCategoryService=u(we),this.attributesChanges=new D,this.inputType=z,this.formatType=le,this.validationType=ce}ngOnChanges(){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:this.categoryId,channelId:this.channelId,channelType:this.channelType}).pipe(U(e=>{this.form=this.formCategoryService.createFormGroup(e),this.listenToFormChange(e)}),te(1)))}listenToFormChange(e){let i=[];this.formSubscription=this.form.valueChanges.subscribe(n=>{i=this.formCategoryService.getFilteredAttributes(e,n),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["shopee-attribute-form"]],inputs:{channelType:"channelType",categoryId:"categoryId",channelId:"channelId",channelProductUpload:"channelProductUpload"},outputs:{attributesChanges:"attributesChanges"},features:[F([we]),O],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","value_id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","value_id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"],[1,"attribute-datepicker",3,"formControlName"],[1,"d-flex","align-items-center",3,"formGroupName"],["type","text","autoNum","",1,"form-control",3,"formControlName","placeholder"],["formControlName","value","type","text","autoNum","",1,"form-control","me-1",2,"width","200px",3,"placeholder"],["name","unit","id","unit","formControlName","unit",1,"form-control"],["disabled","","selected","",3,"value"],[3,"value"]],template:function(i,n){i&1&&(_(0,ai,5,1,"ng-container",0),x(1,"async")),i&2&&p("ngIf",I(1,1,n.attributes$))},dependencies:[T,A,k,Y,H,G,X,it,nt,ne,tt,$,W,K,J,et,xt,Nt,Dt],styles:["input[_ngcontent-%COMP%], select[_ngcontent-%COMP%]{height:36px;border-radius:4px} datepicker.attribute-datepicker>mat-form-field.mat-mdc-form-field>.mat-mdc-text-field-wrapper{height:36px} datepicker.attribute-datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{padding-top:11px!important;padding-bottom:11px!important;height:36px;min-height:36px!important} datepicker.attribute-datepicker mat-datepicker-toggle>button.mat-mdc-icon-button.mat-mdc-button-base{--mdc-icon-button-state-layer-size: 36px}"]})}}return t})();var ee=function(t){return t.TIKTOK_SHOP="TIKTOK_SHOP",t.TOKOPEDIA="TOKOPEDIA",t}(ee||{});var Ue=(()=>{class t{constructor(){this.httpService=u(re),this.formBuilder=u(q),this.uploadProductService=u(Ie)}getAttributes(e,i){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:e},{key:"CategoryID",value:i}]).pipe(Ge(o=>this.uploadProductService.selectedProduct$.pipe(V(r=>(o=this.mappingAttributeSalesProperty(o,r),o)))))}mappingAttributeSalesProperty(e,i){let n=0;return e.filter(o=>(o.type=="SALES_PROPERTY"&&(n+=1),n>1?(n=0,!1):!0)).map(o=>(o.type=="SALES_PROPERTY"&&(o.name="Jenis Variant",o.is_multiple_selection=!1,o.is_required=this.isProductHasMoreVariant(i),o.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),o))}isProductHasMoreVariant(e){let i=!1,n=[];return e.forEach(o=>{o.Variants&&n.push(o.Variants.length)}),i=n.some(o=>o>1),i}createFormGroup(e){let i=this.formBuilder.group({}),n=[];return e.forEach(o=>{n=[],o.is_required&&n.push(me.required),i.addControl(o.id,this.formBuilder.control(null,n))}),i.addControl("listingPlatform",this.formBuilder.control([ee.TIKTOK_SHOP,ee.TOKOPEDIA],[me.required])),i}getFilteredAttributes(e,i){let n=JSON.parse(JSON.stringify(e)),o=Object.keys(i),r=n.filter(g=>o.findIndex(Pe=>parseInt(Pe)==g.id)!=-1);return r=this.filterSelectedAttributes(r,i),r}filterSelectedAttributes(e,i){return e.map(o=>(h.IsNotEmpty(o.values)?o.is_multiple_selection?o.values=o.values.filter(r=>i[o.id]?.includes(r.id)):o.values=o.values.filter(r=>r.id==i[o.id]):i[o.id]&&(o.values=[{id:null,name:i[o.id]}]),o)).filter(o=>o?.values?.length>0)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=M({token:t,factory:t.\u0275fac})}}return t})();function li(t,m){t&1&&(s(0,"small",6),f(1," Platform is required "),a())}function ci(t,m){t&1&&(s(0,"span",6),f(1,"*"),a())}function pi(t,m){if(t&1&&d(0,"ng-select",7),t&2){let e=l().$implicit;p("multiple",!0)("formControlName",e.id)("items",e.values)("placeholder","Pilih "+(e==null?null:e.name))}}function si(t,m){if(t&1&&d(0,"ng-select",8),t&2){let e=l().$implicit;p("formControlName",e.id)("items",e.values)("placeholder","Pilih "+(e==null?null:e.name))}}function mi(t,m){if(t&1&&d(0,"input",9),t&2){let e=l().$implicit;p("formControlName",e.id)("placeholder",e==null?null:e.name)}}function di(t,m){if(t&1&&(s(0,"small",6),f(1),a()),t&2){let e=l().$implicit;c(),Q(" ",e==null?null:e.name," is mandatory ")}}function ui(t,m){if(t&1&&(s(0,"div",3)(1,"div",4),_(2,ci,2,0,"span",6),s(3,"span"),f(4),a()(),_(5,pi,1,4,"ng-select",7)(6,si,1,3,"ng-select",8)(7,mi,1,2,"input",9)(8,di,2,1,"small",6),a()),t&2){let e=m.$implicit;c(2),S(e.is_required?2:-1),c(2),Q(" ",e==null?null:e.name," "),c(),S(e.is_multiple_selection?5:e.values!==null&&e.values.length>0?6:7),c(3),S(e.is_required?8:-1)}}function fi(t,m){if(t&1&&(N(0),s(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"span"),f(6," Platform Options"),a()(),d(7,"ng-select",5),_(8,li,2,0,"small",6),a(),L(9,ui,9,4,"div",3,B),a()(),w()),t&2){let e,i=m.ngIf,n=l();c(),p("formGroup",n.form),c(6),p("multiple",!0)("items",n.platformOptions)("clearable",!1),c(),S(!(n.form==null||(e=n.form.get("listingPlatform").errors)==null)&&e.required?8:-1),c(),R(i)}}var Vt=(()=>{class t{constructor(){this.tiktokAttributeFormService=u(Ue),this.platformChange=je({alias:"onPlatformChanges"}),this.formSubscription=new de,this.attributesChanges=new D,this.platformOptions=[{label:"TikTok Shop",value:ee.TIKTOK_SHOP},{label:"Tokopedia",value:ee.TOKOPEDIA}]}ngOnChanges(){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(this.channelId,this.categoryId).pipe(V(e=>e.filter(i=>!(i.type=="PRODUCT_PROPERTY"&&(h.IsEmpty(i.values)||i.values?.length==0)&&i.is_customizable==!1))),U(e=>{this.form=this.tiktokAttributeFormService.createFormGroup(e),this.listenToFormChange(e)}),te(1)))}listenToFormChange(e){let i=[];this.form.valueChanges.pipe(se(this.formSubscription)).subscribe(n=>{delete n.listingPlatform,i=this.tiktokAttributeFormService.getFilteredAttributes(e,n),this.attributesChanges.emit(i)}),this.form.get("listingPlatform").valueChanges.pipe(Ye(this.form.get("listingPlatform").value),se(this.formSubscription)).subscribe(n=>{this.platformChange.emit(n)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["tiktok-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{platformChange:"onPlatformChanges",attributesChanges:"attributesChanges"},features:[F([Ue]),O],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","listingPlatform","bindLabel","label","bindValue","value","placeholder","Platform Options",3,"multiple","items","clearable"],[1,"text-danger"],["bindLabel","name","bindValue","id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"]],template:function(i,n){i&1&&(_(0,fi,11,5,"ng-container",0),x(1,"async")),i&2&&p("ngIf",I(1,1,n.attributes$))},dependencies:[T,A,k,Y,H,G,X,ne,$,W,K,J,oe],encapsulation:2})}}return t})();var Be=(()=>{class t{constructor(){this.woocommerceUploadService=u(xe)}getAttributes(e,i){return this.woocommerceUploadService.getAttributes(e,i).pipe(V(n=>n.map(o=>({key:o.name,label:o.name}))))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=M({token:t,factory:t.\u0275fac})}}return t})();var Ut=(()=>{class t{constructor(){this.wooAttributeFormService=u(Be),this.channelId=Me(),this.categoryId=Me(),this.attributesChanges=new D}ngOnChanges(){h.IsNotEmpty(this.categoryId())&&h.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(e){this.attributesChanges.emit([e.key])}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[F([Be]),O],decls:6,vars:3,consts:[[1,"row"],[1,"col-6"],[1,"mb-1"],["bindLabel","label","bindValue","id","placeholder","Pilih Atribut",3,"change","items"]],template:function(i,n){i&1&&(s(0,"div",0)(1,"div",1)(2,"div",2),f(3,"Atribut"),a(),s(4,"ng-select",3),x(5,"async"),y("change",function(r){return n.onSelectAttribute(r)}),a()()()),i&2&&(c(4),p("items",I(5,1,n.attributes$)))},dependencies:[T,k,oe,Y,H,G],encapsulation:2})}}return t})();var Le=(()=>{class t{constructor(){this.httpService=u(re),this.formBuilder=u(q)}getAttributes(e,i){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:e},{key:"CategoryID",value:i}]).pipe(V(o=>o))}createFormGroup(e){let i=this.formBuilder.group({});return e.forEach(n=>{i.addControl(n.variant,this.formBuilder.control(null))}),i}convertAttributes(e={}){return Object.values(e).filter(n=>n!==null).map(n=>JSON.stringify(n))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=M({token:t,factory:t.\u0275fac})}}return t})();function _i(t,m){if(t&1&&(s(0,"div",3)(1,"div",4),f(2),a(),d(3,"ng-select",5),a()),t&2){let e=m.$implicit;c(2),Q(" ",e==null?null:e.variant," "),c(),p("formControlName",e.variant)("items",e.values)("placeholder","Pilih "+(e==null?null:e.variant))}}function hi(t,m){if(t&1&&(N(0),s(1,"form",1)(2,"div",2),L(3,_i,4,4,"div",3,B),a()(),w()),t&2){let e=m.ngIf,i=l();c(),p("formGroup",i.form),c(2),R(e)}}var Bt=(()=>{class t{constructor(){this.tokpedAttrFormService=u(Le),this.attributesChanges=new D}ngOnInit(){}ngOnChanges(e){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(this.channelId,this.categoryId).pipe(U(i=>{this.form=this.tokpedAttrFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){let e=[];this.formSubscription=this.form.valueChanges.subscribe(i=>{e=this.tokpedAttrFormService.convertAttributes(i),this.attributesChanges.emit(e)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[F([Le]),O],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(i,n){i&1&&(_(0,hi,5,1,"ng-container",0),x(1,"async")),i&2&&p("ngIf",I(1,1,n.attributes$))},dependencies:[T,A,k,Y,H,G,X,$,W,K,J],encapsulation:2})}}return t})();var Re=(()=>{class t{constructor(){this.httpService=u(re),this.formBuilder=u(q)}getAttributes(e){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:e}]).pipe(U(n=>(n.Options.StatusOptions=n.Options.Status.map(o=>({id:o,name:o})),n)))}createFormGroup(e){let i=this.formBuilder.group({});return Object.keys(e.Attribute).forEach(o=>{i.addControl(o,this.formBuilder.control(null))}),i}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=M({token:t,factory:t.\u0275fac})}}return t})();function gi(t,m){if(t&1&&(N(0),s(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4),f(5," Brand "),a(),d(6,"input",5),a(),s(7,"div",6)(8,"div",4),f(9," Product Type "),a(),d(10,"input",7),a(),s(11,"div",6)(12,"div",4),f(13," Status "),a(),d(14,"ng-select",8),a()()(),w()),t&2){let e=m.ngIf,i=l();c(),p("formGroup",i.form),c(13),p("items",e.Options.StatusOptions)}}var Lt=(()=>{class t{constructor(){this.attributesChanges=new D,this.shopifyFormService=u(Re)}ngOnChanges(e){e.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId).pipe(U(i=>{this.form=this.shopifyFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(He(500)).subscribe(e=>{this.attributesChanges.emit([e])})}ngOnDestroy(){this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["shopify-attribute-form"]],inputs:{channelId:"channelId"},outputs:{attributesChanges:"attributesChanges"},features:[F([Re]),O],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","Brand","type","text","placeholder","brand",1,"form-control"],[1,"col-6"],["formControlName","ProductType","type","text","placeholder","Product Type",1,"form-control"],["formControlName","Status","bindLabel","name","bindValue","id","placeholder","Status",3,"items"]],template:function(i,n){i&1&&(_(0,gi,15,2,"ng-container",0),x(1,"async")),i&2&&p("ngIf",I(1,1,n.attributes$))},dependencies:[T,A,k,G,X,ne,$,W,K,J,Y,H],encapsulation:2})}}return t})();function Ci(t,m){if(t&1&&(s(0,"div",6),d(1,"app-product-card",9),a()),t&2){let e=m.$implicit;c(),p("productId",e==null?null:e.ID)("title",e==null?null:e.Name)("image",e==null?null:e.ThumbnailUrl)("description",(e==null||e.Variants==null?null:e.Variants.length)>1?(e==null||e.Variants==null?null:e.Variants.length)+" Variants":null)("imageForZoom",e==null?null:e.ImageUrl)("code",e==null||e.Variants[0]==null?null:e.Variants[0].Code)("showFooter",!1)}}function bi(t,m){if(t&1){let e=E();N(0),s(1,"mat-checkbox",21),qe("ngModelChange",function(n){C(e);let o=l().$implicit;return Je(o.selected,n)||(o.selected=n),b(n)}),y("ngModelChange",function(){let n=C(e).ngIf,o=l(),r=o.$implicit,g=o.$index,pe=l();return b(pe.onSelectChannel(r,g,n))}),a(),w()}if(t&2){let e=l().$implicit;c(),Ke("ngModel",e.selected)}}function yi(t,m){if(t&1&&(s(0,"div",18),d(1,"input",22),a()),t&2){let e=l().$implicit,i=l();p("matTooltip",e.type==i.channelType.Shopify||e.type==i.channelType.ShopifyV2?"Cannot change category, please change category in admin.shopify.com":e.type==i.channelType.Plugo?"You can change the category after the product has been uploaded to the Plugo Dashboard.":"")}}function vi(t,m){if(t&1){let e=E();s(0,"app-channel-category-select",23),y("selectedCategory",function(n){C(e);let o=l().$index,r=l();return b(r.onCategoryChange(o,n))}),a()}if(t&2){let e=l().$implicit,i=l();p("disabled",!e.selected||e.selected&&e.type==i.channelType.Lazada)("channelId",e.id)("channelType",e.type)("categoryId",e.categoryId)}}function Ti(t,m){if(t&1){let e=E();s(0,"shopee-attribute-form",27),y("attributesChanges",function(n){C(e);let o=l(2).$index,r=l();return b(r.onAttributesChange(o,n))}),a()}if(t&2){let e=l(2).$implicit;p("categoryId",e.categoryId)("channelId",e.id)("channelType",e.type)}}function xi(t,m){if(t&1){let e=E();s(0,"tiktok-attribute-form",28),y("attributesChanges",function(n){C(e);let o=l(2).$index,r=l();return b(r.onAttributesChange(o,n))})("onPlatformChanges",function(n){C(e);let o=l(2).$index,r=l();return b(r.onPlatformChange(o,n))}),a()}if(t&2){let e=l(2).$implicit;p("categoryId",e.categoryId)("channelId",e.id)}}function Ii(t,m){if(t&1){let e=E();s(0,"wooocommerce-attribute-form",29),y("attributesChanges",function(n){C(e);let o=l(2).$index,r=l();return b(r.onAttributesChange(o,n))}),a()}if(t&2){let e=l(2).$implicit;p("categoryId",e.categoryId)("channelId",e.id)}}function Si(t,m){if(t&1){let e=E();s(0,"tokopedia-attribute-form",29),y("attributesChanges",function(n){C(e);let o=l(2).$index,r=l();return b(r.onAttributesChange(o,n))}),a()}if(t&2){let e=l(2).$implicit;p("categoryId",e.categoryId)("channelId",e.id)}}function Fi(t,m){if(t&1&&(s(0,"div",20)(1,"div",24),_(2,Ti,1,3,"shopee-attribute-form",25)(3,xi,1,2,"tiktok-attribute-form",26)(4,Ii,1,2,"wooocommerce-attribute-form",26)(5,Si,1,2,"tokopedia-attribute-form",26),a()()),t&2){let e,i=l().$implicit,n=l();c(2),S((e=i.type)===n.channelType.Shopee?2:e===n.channelType.Tiktok?3:e===n.channelType.WooCommerce?4:e===n.channelType.Tokopedia?5:-1)}}function Ai(t,m){if(t&1){let e=E();s(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",30),y("attributesChanges",function(n){C(e);let o=l().$index,r=l();return b(r.onAttributesChange(o,n))}),a()()()}if(t&2){let e=l().$implicit;c(2),p("channelId",e.id)}}function ki(t,m){if(t&1&&(s(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),_(6,bi,2,1,"ng-container",14),x(7,"async"),a(),s(8,"div"),d(9,"app-channel-logo",15),a(),s(10,"div",16)(11,"span"),f(12),a()()()(),s(13,"div",12)(14,"div",17),_(15,yi,2,1,"div",18)(16,vi,1,4,"app-channel-category-select",19),a()()(),_(17,Fi,6,1,"div",20)(18,Ai,3,1,"div",20),a()()),t&2){let e=m.$implicit,i=l();c(6),p("ngIf",I(7,8,i.defaultCategories$)),c(3),p("typeId",e.type)("showChannelName",!1),c(),p("matTooltip",e.name)("matTooltipShowDelay",2500),c(2),ie(e.name),c(3),S(e.type==i.channelType.Shopify||e.type==i.channelType.Plugo||e.type==i.channelType.ShopifyV2?15:16),c(2),S(e.categoryId&&i.channelType.Lazada!=e.type&&e.selected?17:(i.channelType.Shopify==e.type||e.type==i.channelType.ShopifyV2)&&e.selected?18:-1)}}var Ar=(()=>{class t{constructor(){this.toastr=u(ot),this.uploadProductService=u(Ie),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=De,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(te(1))}onCategoryChange(e,i){this.channelProductUploads.update(n=>n.map((o,r)=>(r==e&&(o.categoryId=i,o.attributes=[]),o)))}onPlatformChange(e,i){this.channelProductUploads.update(n=>n.map((o,r)=>(r==e&&(o.listing_platforms=i),o)))}onAttributesChange(e,i){this.channelProductUploads.update(n=>n.map((o,r)=>(r==e&&(o.attributes=i),o)))}tiktokPlatformChanges(e,i){this.channelProductUploads.update(n=>n.map((o,r)=>(r==e&&(o.listing_platforms=i),o)))}onSelectChannel(e,i,n){this.channelProductUploads.update(o=>o.map((r,g)=>{if(g==i&&e.selected){let pe=this.findCategoryByChannelId(e.id,n);r.categoryId=pe?.DefaultCategoryID}return g==i&&!e.selected&&(r.categoryId=null),r}))}findCategoryByChannelId(e,i){return i.find(n=>n.ID===e)}onUploadProduct(){if(this.checkTiktokPlatform()==!1){this.toastr.error("Please select at least one platform for TikTok channel","Platform is Required");return}this.uploadProductService.onUploadProduct(this.channelProductUploads())}checkTiktokPlatform(){return this.channelProductUploads().every(i=>i.type==De.Tiktok&&h.IsNotEmpty(i?.categoryId)?i.listing_platforms.length>0:!0)}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["app-product-upload"]],features:[F([Te,ht,gt,xe])],decls:17,vars:5,consts:[["headerTitle","Upload Product To Channel",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-upload"],[1,"container-fluid","mt-6"],[1,"ps-3","mt-8","pb-5","fw-medium"],[1,"row","mb-10","ps-3"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"ps-3","mb-8","border-bottom","pb-5","fw-medium"],[1,"row","mb-6"],[3,"productId","title","image","description","imageForZoom","code","showFooter"],[1,"col-12"],[1,"row"],[1,"col-3"],[1,"d-flex","align-items-center"],[4,"ngIf"],[3,"typeId","showChannelName"],[2,"overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"matTooltip","matTooltipShowDelay"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip"],[3,"disabled","channelId","channelType","categoryId"],[1,"row","my-3"],["color","primary",1,"example-margin",3,"ngModelChange","ngModel"],["disabled","","type","text","placeholder","Category Unavailable",1,"form-control","rounded-1",2,"height","35px"],[3,"selectedCategory","disabled","channelId","channelType","categoryId"],[1,"col-12","ps-11"],[3,"categoryId","channelId","channelType"],[3,"categoryId","channelId"],[3,"attributesChanges","categoryId","channelId","channelType"],[3,"attributesChanges","onPlatformChanges","categoryId","channelId"],[3,"attributesChanges","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(i,n){if(i&1&&(s(0,"mainpanel",0)(1,"actions")(2,"button",1),y("click",function(){return n.onUploadProduct()}),d(3,"i",2),f(4," Upload "),a()(),s(5,"content")(6,"div",3)(7,"h3",4),f(8,"Product To Upload"),a(),s(9,"div",5),L(10,Ci,2,7,"div",6,B),x(12,"async"),a(),s(13,"h3",7),f(14,"Channel To Upload"),a(),L(15,ki,19,10,"div",8,B),a()()()),i&2){let o;p("hideSearchBox",!0)("hideSearchDropdown",!0),c(2),p("disabled",((o=n.channelProductUploads())==null?null:o.length)==0),c(8),R(I(12,3,n.selectedProducts$)),c(5),R(n.channelProductUploads())}},dependencies:[T,A,k,St,ct,lt,At,Ft,pt,oe,$,Ze,at,rt,Vt,Ut,Bt,Lt,Ct,Et,wt],encapsulation:2})}}return t})();export{Ar as ProductUploadComponent};
@@ -1 +1 @@
1
- import{a as ie,b as oe}from"./chunk-OXWPLJEW.js";import{a as ee,b as te}from"./chunk-2O4IEGGR.js";import{na as Z}from"./chunk-RC5PUUVM.js";import{e as Q}from"./chunk-WN5DZGA4.js";import{b as g,c as r}from"./chunk-PW42BQIY.js";import{A as K,a as H,h as J,m as $}from"./chunk-5PS6ZS3N.js";import{r as X,s as Y}from"./chunk-MFQQEEHJ.js";import{i as R,j as U,n as q}from"./chunk-FXQKRJWU.js";import{$c as G,Fc as L,Gb as A,Gc as x,Ic as V,Ka as F,Kc as D,Lc as P,Mb as m,Mc as z,Qc as W,Ra as b,Yb as u,Z as S,aa as p,ad as j,cd as B,dc as M,ea as s,g as c,ia as k,ic as y,ja as I,jc as _,nc as w,oc as O,pa as f,q as l,rb as T,tc as E,uc as n,xa as N,ya as C,za as h}from"./chunk-OJMQBH6T.js";var ae=(()=>{class o{constructor(){this.httpService=f(Q),this.shopeeCategories=new c({data:[],isFirstLoad:!1}),this.tiktokCategories=new c({data:[],isFirstLoad:!1}),this.lazadaCategories=new c({data:[],isFirstLoad:!1}),this.tokopediaCategories=new c({data:[],isFirstLoad:!1}),this.wooCommerceCategories=new c({data:[],isFirstLoad:!1})}getCategories(e,i){switch(e){case g.Shopee:return this.shopeeCategories.asObservable().pipe(p(t=>t.isFirstLoad?l(t.data):this.getShopeeCategories(i)));case g.Tiktok:return this.tiktokCategories.asObservable().pipe(p(t=>t.isFirstLoad?l(t.data):this.getTiktokCategories(i)));case g.Lazada:return this.lazadaCategories.asObservable().pipe(p(t=>t.isFirstLoad?l(t.data):this.getLazadaCategories(i)));case g.Tokopedia:return this.tokopediaCategories.asObservable().pipe(p(t=>t.isFirstLoad?l(t.data):this.getTokopediaCategories(i)));case g.WooCommerce:return this.wooCommerceCategories.asObservable().pipe(p(t=>t.isFirstLoad?l(t.data):this.getWooCommerceCategories(i)));default:return l([])}}getShopeeCategories(e){return this.httpService.get("api/product/shopee/GetCategories",[{key:"ID",value:e}]).pipe(s(t=>{let a={data:t,isFirstLoad:!0};this.shopeeCategories.next(a)}))}getTiktokCategories(e){return this.httpService.get("api/product/tiktok/GetCategories",[{key:"ID",value:e}]).pipe(s(t=>{let a={data:t,isFirstLoad:!0};this.tiktokCategories.next(a)}))}getLazadaCategories(e){return this.httpService.get("api/product/lazada/GetCategories",[{key:"ID",value:e}]).pipe(s(t=>{let a={data:t,isFirstLoad:!0};this.lazadaCategories.next(a)}))}getTokopediaCategories(e){return this.httpService.get("api/product/tokopedia/GetCategories",[{key:"ID",value:e}]).pipe(s(t=>{let a={data:t,isFirstLoad:!0};this.tokopediaCategories.next(a)}))}getWooCommerceCategories(e){return this.httpService.get("api/product/woo/GetCategories",[{key:"ID",value:e}]).pipe(s(t=>{let a={data:t,isFirstLoad:!0};this.wooCommerceCategories.next(a)}))}searchByIdWithParentDFS(e,i){let t=[...e];for(;t.length>0;){let a=t.pop();if(a.id===JSON.stringify(i))return a;if(a.children&&a.children.length>0)for(let v of a.children)v.parent=a,t.push(v)}return null}searchSelectAbleNode(e){let i=null;if(e.selectable)return e;let t=e.children?e.children:[];if(t.length==0)return e;for(let a of t){if(a.children.length==0&&a.selectable)return a;if(i=this.searchSelectAbleNode(a),i)return i}return i}generateCategoryLabel(e){let i="";return e?i=r.getLabelPathTree(e):i="Select a Category",i}static{this.\u0275fac=function(i){return new(i||o)}}static{this.\u0275prov=I({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();function ne(o,d){o&1&&w(0)}function se(o,d){if(o&1&&(y(0,"p-floatLabel",1),m(1,ne,1,0,"ng-container",2),y(2,"label",3),x(3,"Category"),_()()),o&2){n();let e=L(3);T(),u("ngTemplateOutlet",e)}}function le(o,d){o&1&&w(0)}function ce(o,d){if(o&1&&m(0,le,1,0,"ng-container",2),o&2){n();let e=L(3);u("ngTemplateOutlet",e)}}function pe(o,d){if(o&1&&(y(0,"div",6),x(1),_()),o&2){let e=n(2);u("matTooltip",e.selectedCategoryLabel()),T(),V(" ",e.selectedCategoryLabel()," ")}}function ge(o,d){if(o&1){let e=O();y(0,"p-treeSelect",4),G(1,"async"),z("ngModelChange",function(t){C(e);let a=n();return P(a.selectedNode,t)||(a.selectedNode=t),h(t)}),E("click",function(){C(e);let t=n();return h(t.onClickSelect())})("onNodeSelect",function(t){C(e);let a=n();return h(a.onNodeSelect(t))})("onClear",function(){C(e);let t=n();return h(t.onNodeUnselect())}),m(2,pe,2,2,"ng-template",5),_()}if(o&2){let e=n();D("ngModel",e.selectedNode),u("filter",!0)("options",j(1,5,e.categories$))("showClear",e.showClear)("disabled",e.disabled)}}var Pe=(()=>{class o{constructor(){this.categoryService=f(ae),this.showClear=!1,this.showLabel=!1,this.disabled=!1,this.selectedCategory=new F,this.selectedCategoryLabel=b("Select a Category"),this.selectedNode=b(null),this.onChange=e=>{},this.onTouched=()=>{}}ngOnChanges(e){let i=e?.categoryId?.previousValue,t=e?.categoryId?.currentValue;r.IsEmpty(i)&&r.IsNotEmpty(t)&&this.initCategories(),r.IsEmpty(t)&&r.IsNotEmpty(i)&&this.generateCategoryLabel(null)}initCategories(){this.categories$=this.categoryService.getCategories(this.channelType,this.channelId).pipe(s(e=>this.setDefaultCategory(e)),S(1))}setDefaultCategory(e){try{let i=this.categoryService.searchByIdWithParentDFS(e,this.categoryId);i&&(this.generateCategoryLabel(i),this.selectedNode.set(i))}catch(i){console.error(i)}}onClickSelect(){this.disabled==!1&&(this.categories$=this.categoryService.getCategories(this.channelType,this.channelId).pipe(S(1)))}onNodeSelect(e){let i=this.categoryService.searchSelectAbleNode(e.node);this.selectedCategoryLabel.set(r.getLabelPathTree(i));let t=parseInt(i.id);this.onChange(t),this.selectedCategory.emit(t)}onNodeUnselect(){this.selectedCategoryLabel.set("Select a Category"),this.selectedCategory.emit(null)}generateCategoryLabel(e){e?this.selectedCategoryLabel.set(r.getLabelPathTree(e)):this.selectedCategoryLabel.set("Select a Category")}writeValue(e){r.IsNotEmpty(e)&&(this.categoryId=e,this.initCategories())}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.disabled=e}static{this.\u0275fac=function(i){return new(i||o)}}static{this.\u0275cmp=A({type:o,selectors:[["app-channel-category-select"]],inputs:{channelId:"channelId",channelType:"channelType",categoryId:"categoryId",showClear:"showClear",showLabel:"showLabel",disabled:"disabled"},outputs:{selectedCategory:"selectedCategory"},features:[W([{provide:H,useExisting:k(()=>o),multi:!0}]),N],decls:4,vars:1,consts:[["categorySelectTemplate",""],["variant","on",1,"w-100"],[4,"ngTemplateOutlet"],["for","selectCategory",1,"tree-category-label"],["appendTo","body","containerStyleClass","w-100","placeholder","Select a Category","id","selectCategory","inputId","selectCategory",3,"ngModelChange","click","onNodeSelect","onClear","ngModel","filter","options","showClear","disabled"],["pTemplate","value"],["matTooltipPosition","above",3,"matTooltip"]],template:function(i,t){i&1&&m(0,se,4,1,"p-floatLabel",1)(1,ce,1,1,"ng-container")(2,ge,3,7,"ng-template",null,0,B),i&2&&M(t.showLabel?0:1)},dependencies:[q,R,U,te,ee,Z,Y,X,K,J,$,oe,ie],styles:[".p-overlay.p-component{z-index:10000000000000000000000!important} .p-treeselect-panel .p-treeselect-items-wrapper .p-tree{padding-left:4px!important} .p-inputwrapper-filled~label.tree-category-label{left:.5rem!important}"]})}}return o})();export{ae as a,Pe as b};
1
+ import{a as ie,b as oe}from"./chunk-OXWPLJEW.js";import{a as ee,b as te}from"./chunk-2O4IEGGR.js";import{na as Z}from"./chunk-RC5PUUVM.js";import{e as Q}from"./chunk-WN5DZGA4.js";import{b as g,c as r}from"./chunk-RXQX7567.js";import{A as K,a as H,h as J,m as $}from"./chunk-5PS6ZS3N.js";import{r as X,s as Y}from"./chunk-MFQQEEHJ.js";import{i as R,j as U,n as q}from"./chunk-FXQKRJWU.js";import{$c as G,Fc as L,Gb as A,Gc as x,Ic as V,Ka as F,Kc as D,Lc as P,Mb as m,Mc as z,Qc as W,Ra as b,Yb as u,Z as S,aa as p,ad as j,cd as B,dc as M,ea as s,g as c,ia as k,ic as y,ja as I,jc as _,nc as w,oc as O,pa as f,q as l,rb as T,tc as E,uc as n,xa as N,ya as C,za as h}from"./chunk-OJMQBH6T.js";var ae=(()=>{class o{constructor(){this.httpService=f(Q),this.shopeeCategories=new c({data:[],isFirstLoad:!1}),this.tiktokCategories=new c({data:[],isFirstLoad:!1}),this.lazadaCategories=new c({data:[],isFirstLoad:!1}),this.tokopediaCategories=new c({data:[],isFirstLoad:!1}),this.wooCommerceCategories=new c({data:[],isFirstLoad:!1})}getCategories(e,i){switch(e){case g.Shopee:return this.shopeeCategories.asObservable().pipe(p(t=>t.isFirstLoad?l(t.data):this.getShopeeCategories(i)));case g.Tiktok:return this.tiktokCategories.asObservable().pipe(p(t=>t.isFirstLoad?l(t.data):this.getTiktokCategories(i)));case g.Lazada:return this.lazadaCategories.asObservable().pipe(p(t=>t.isFirstLoad?l(t.data):this.getLazadaCategories(i)));case g.Tokopedia:return this.tokopediaCategories.asObservable().pipe(p(t=>t.isFirstLoad?l(t.data):this.getTokopediaCategories(i)));case g.WooCommerce:return this.wooCommerceCategories.asObservable().pipe(p(t=>t.isFirstLoad?l(t.data):this.getWooCommerceCategories(i)));default:return l([])}}getShopeeCategories(e){return this.httpService.get("api/product/shopee/GetCategories",[{key:"ID",value:e}]).pipe(s(t=>{let a={data:t,isFirstLoad:!0};this.shopeeCategories.next(a)}))}getTiktokCategories(e){return this.httpService.get("api/product/tiktok/GetCategories",[{key:"ID",value:e}]).pipe(s(t=>{let a={data:t,isFirstLoad:!0};this.tiktokCategories.next(a)}))}getLazadaCategories(e){return this.httpService.get("api/product/lazada/GetCategories",[{key:"ID",value:e}]).pipe(s(t=>{let a={data:t,isFirstLoad:!0};this.lazadaCategories.next(a)}))}getTokopediaCategories(e){return this.httpService.get("api/product/tokopedia/GetCategories",[{key:"ID",value:e}]).pipe(s(t=>{let a={data:t,isFirstLoad:!0};this.tokopediaCategories.next(a)}))}getWooCommerceCategories(e){return this.httpService.get("api/product/woo/GetCategories",[{key:"ID",value:e}]).pipe(s(t=>{let a={data:t,isFirstLoad:!0};this.wooCommerceCategories.next(a)}))}searchByIdWithParentDFS(e,i){let t=[...e];for(;t.length>0;){let a=t.pop();if(a.id===JSON.stringify(i))return a;if(a.children&&a.children.length>0)for(let v of a.children)v.parent=a,t.push(v)}return null}searchSelectAbleNode(e){let i=null;if(e.selectable)return e;let t=e.children?e.children:[];if(t.length==0)return e;for(let a of t){if(a.children.length==0&&a.selectable)return a;if(i=this.searchSelectAbleNode(a),i)return i}return i}generateCategoryLabel(e){let i="";return e?i=r.getLabelPathTree(e):i="Select a Category",i}static{this.\u0275fac=function(i){return new(i||o)}}static{this.\u0275prov=I({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();function ne(o,d){o&1&&w(0)}function se(o,d){if(o&1&&(y(0,"p-floatLabel",1),m(1,ne,1,0,"ng-container",2),y(2,"label",3),x(3,"Category"),_()()),o&2){n();let e=L(3);T(),u("ngTemplateOutlet",e)}}function le(o,d){o&1&&w(0)}function ce(o,d){if(o&1&&m(0,le,1,0,"ng-container",2),o&2){n();let e=L(3);u("ngTemplateOutlet",e)}}function pe(o,d){if(o&1&&(y(0,"div",6),x(1),_()),o&2){let e=n(2);u("matTooltip",e.selectedCategoryLabel()),T(),V(" ",e.selectedCategoryLabel()," ")}}function ge(o,d){if(o&1){let e=O();y(0,"p-treeSelect",4),G(1,"async"),z("ngModelChange",function(t){C(e);let a=n();return P(a.selectedNode,t)||(a.selectedNode=t),h(t)}),E("click",function(){C(e);let t=n();return h(t.onClickSelect())})("onNodeSelect",function(t){C(e);let a=n();return h(a.onNodeSelect(t))})("onClear",function(){C(e);let t=n();return h(t.onNodeUnselect())}),m(2,pe,2,2,"ng-template",5),_()}if(o&2){let e=n();D("ngModel",e.selectedNode),u("filter",!0)("options",j(1,5,e.categories$))("showClear",e.showClear)("disabled",e.disabled)}}var Pe=(()=>{class o{constructor(){this.categoryService=f(ae),this.showClear=!1,this.showLabel=!1,this.disabled=!1,this.selectedCategory=new F,this.selectedCategoryLabel=b("Select a Category"),this.selectedNode=b(null),this.onChange=e=>{},this.onTouched=()=>{}}ngOnChanges(e){let i=e?.categoryId?.previousValue,t=e?.categoryId?.currentValue;r.IsEmpty(i)&&r.IsNotEmpty(t)&&this.initCategories(),r.IsEmpty(t)&&r.IsNotEmpty(i)&&this.generateCategoryLabel(null)}initCategories(){this.categories$=this.categoryService.getCategories(this.channelType,this.channelId).pipe(s(e=>this.setDefaultCategory(e)),S(1))}setDefaultCategory(e){try{let i=this.categoryService.searchByIdWithParentDFS(e,this.categoryId);i&&(this.generateCategoryLabel(i),this.selectedNode.set(i))}catch(i){console.error(i)}}onClickSelect(){this.disabled==!1&&(this.categories$=this.categoryService.getCategories(this.channelType,this.channelId).pipe(S(1)))}onNodeSelect(e){let i=this.categoryService.searchSelectAbleNode(e.node);this.selectedCategoryLabel.set(r.getLabelPathTree(i));let t=parseInt(i.id);this.onChange(t),this.selectedCategory.emit(t)}onNodeUnselect(){this.selectedCategoryLabel.set("Select a Category"),this.selectedCategory.emit(null)}generateCategoryLabel(e){e?this.selectedCategoryLabel.set(r.getLabelPathTree(e)):this.selectedCategoryLabel.set("Select a Category")}writeValue(e){r.IsNotEmpty(e)&&(this.categoryId=e,this.initCategories())}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.disabled=e}static{this.\u0275fac=function(i){return new(i||o)}}static{this.\u0275cmp=A({type:o,selectors:[["app-channel-category-select"]],inputs:{channelId:"channelId",channelType:"channelType",categoryId:"categoryId",showClear:"showClear",showLabel:"showLabel",disabled:"disabled"},outputs:{selectedCategory:"selectedCategory"},features:[W([{provide:H,useExisting:k(()=>o),multi:!0}]),N],decls:4,vars:1,consts:[["categorySelectTemplate",""],["variant","on",1,"w-100"],[4,"ngTemplateOutlet"],["for","selectCategory",1,"tree-category-label"],["appendTo","body","containerStyleClass","w-100","placeholder","Select a Category","id","selectCategory","inputId","selectCategory",3,"ngModelChange","click","onNodeSelect","onClear","ngModel","filter","options","showClear","disabled"],["pTemplate","value"],["matTooltipPosition","above",3,"matTooltip"]],template:function(i,t){i&1&&m(0,se,4,1,"p-floatLabel",1)(1,ce,1,1,"ng-container")(2,ge,3,7,"ng-template",null,0,B),i&2&&M(t.showLabel?0:1)},dependencies:[q,R,U,te,ee,Z,Y,X,K,J,$,oe,ie],styles:[".p-overlay.p-component{z-index:10000000000000000000000!important} .p-treeselect-panel .p-treeselect-items-wrapper .p-tree{padding-left:4px!important} .p-inputwrapper-filled~label.tree-category-label{left:.5rem!important}"]})}}return o})();export{ae as a,Pe as b};
@@ -1 +1 @@
1
- import{a as mt}from"./chunk-7KG3DC5J.js";import{b as lt}from"./chunk-6RMBCW2O.js";import{a as st}from"./chunk-LDL3A7NM.js";import{i as it}from"./chunk-WWLC64XZ.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import{e as et}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{a as nt,b as ot,d as at,e as rt}from"./chunk-PYXL7UF7.js";import{c as tt}from"./chunk-PW42BQIY.js";import{m as ct,n as pt}from"./chunk-HJXYT6MI.js";import{A as Z,h as X,m as Y}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{H as K,J as Q,d as A,f as j,g as U,j as W,k as q,m as J,n as G}from"./chunk-FXQKRJWU.js";import{$c as s,Fc as R,Gb as L,Gc as l,Hc as N,Ic as y,Kc as $,Lc as O,Mb as d,Mc as V,Rc as B,Sc as k,Tc as H,Yb as c,Z as b,ad as u,bd as T,ca as D,cd as z,f as w,ic as n,jc as o,kc as v,lc as f,mc as g,ob as M,oc as P,pb as I,rb as a,tc as E,uc as m,v as _,xb as S,xc as F,ya as h,za as C}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var ft=(i,p)=>({"bg-gradient-danger":i,"bg-gradient-warning":p}),gt=()=>["/menu/products/status/notification/detail"],ut=i=>({ID:i});function _t(i,p){if(i&1&&(n(0,"span",15),v(1,"img",16),o(),l(2)),i&2){let t=p.item;a(),c("src",t.Img,I)("alt",t.Name),a(),y(" ",t.Name," ")}}function ht(i,p){if(i&1&&(f(0),l(1),s(2,"number"),n(3,"span"),l(4,"s"),o(),g()),i&2){let t=m().$implicit;a(),y(" ",T(2,1,t.DurationInSecond,"1.1-1")," ")}}function Ct(i,p){i&1&&l(0," - ")}function St(i,p){if(i&1&&(f(0),n(1,"tr",17)(2,"td")(3,"a",18),v(4,"img",19),n(5,"span"),l(6),o()()(),n(7,"td")(8,"b"),l(9),o(),v(10,"div",20),o(),n(11,"td"),d(12,ht,5,4,"ng-container",21)(13,Ct,1,0,"ng-template",null,0,z),o(),n(15,"td"),l(16),o(),n(17,"td"),l(18),s(19,"date"),o()(),g()),i&2){let t=p.$implicit,e=R(14);a(),c("ngClass",H(14,ft,t.Status==1,t.Status==0)),a(2),c("routerLink",B(17,gt))("queryParams",k(18,ut,t.ID)),a(),F("src",t.Img,I),a(2),N(t.Name),a(3),N(t.Label),a(),c("innerHTML",t.Message,M),a(2),c("ngIf",t.DurationInSecond)("ngIfElse",e),a(4),N(t.StatusLabel),a(2),y(" ",T(19,11,t.Created,"dd MMM yyyy HH:mm")," ")}}function vt(i,p){if(i&1){let t=P();f(0),n(1,"div",7)(2,"div",22)(3,"app-custom-paginator",23),s(4,"async"),s(5,"async"),E("total",function(){h(t);let r=m(2);return C(r.getRowCount())})("next",function(){h(t);let r=m(2);return C(r.getNotifications())})("previous",function(){h(t);let r=m(2);return C(r.getNotifications())}),o()()(),g()}if(i&2){let t=m().ngIf,e=m();a(3),c("filter",e.filter)("totaldata",t==null?null:t.length)("paginationTotal",u(4,4,e.rowCount$))("hasClicked",u(5,6,e.rowCount$))}}function Nt(i,p){if(i&1&&(f(0),d(1,vt,6,8,"ng-container",14),g()),i&2){let t=p.ngIf;a(),c("ngIf",t.length>0)}}var Ht=(()=>{class i{constructor(t,e,r){this.http=t,this.notificationService=e,this.authService=r,this.filter=new mt,this.destroy$=new w,this.channelOptions=r.getChannels()}ngOnInit(){this.notificationService.clearNotification(),this.initPageLoader(),this.subscribeNotification()}subscribeNotification(){this.notificationService.getNotification().pipe(D(this.destroy$)).subscribe(t=>{t.length>0&&(this.getNotifications(),this.notificationService.clearNotification())})}initPageLoader(){this.http.post("/api/notification/Load",{}).subscribe(t=>{this.filter=t.Filter,this.filter.PageSize=this.filter.RowCount,this.getNotifications()})}onFilter(){this.rowCount$=null,this.getNotifications()}getNotifications(){let t={ChannelID:this.filter.ChannelID,RowCount:this.filter.PageSize,PageNumber:this.filter.PageNumber};this.notifications$=this.http.post("/api/notification/Get",t).pipe(_(e=>e.Data),_(e=>(e=this.setChannelLogoToNotifications(e),e=this.setTimeToSecond(e),e)),b(1))}setTimeToSecond(t){return t=t.map(e=>(e.DurationInSecond=parseInt(e.Duration)/1e3,e)),t}setChannelLogoToNotifications(t){return t=t.map(e=>(e.Img=tt.getChannelLogoByTypeId(e.TypeID),e)),t}getRowCount(){let t={ChannelID:this.filter.ChannelID};this.rowCount$=this.http.post("/api/notification/RowCount",t).pipe(_(e=>e.Count),b(1))}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(e){return new(e||i)(S(et),S(lt),S(it))}}static{this.\u0275cmp=L({type:i,selectors:[["app-notification"]],decls:33,vars:9,consts:[["timeNotAvailable",""],["headerTitle","Product Scan Job","hideSearchBox","true",3,"onSubmit"],["routerLink","/menu/products/status/notificationV2",1,"btn","btn-outline-secondary","btn-lg"],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[3,"ngClass"],[3,"routerLink","queryParams"],["alt","",1,"channelLogo-md","me-4",3,"src"],[3,"innerHTML"],[4,"ngIf","ngIfElse"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(e,r){e&1&&(n(0,"mainpanel",1),E("onSubmit",function(){return r.onFilter()}),n(1,"actions")(2,"a",2),l(3," Scan Job V2 "),o()(),n(4,"filters")(5,"div")(6,"h6",3),l(7,"Channel"),o(),n(8,"ng-select",4),V("ngModelChange",function(x){return O(r.filter.ChannelID,x)||(r.filter.ChannelID=x),x}),d(9,_t,3,3,"ng-template",5),o()()(),n(10,"content")(11,"div",6)(12,"div",7)(13,"div",8)(14,"div",9)(15,"table",10)(16,"thead",11)(17,"tr",12)(18,"th"),l(19,"Channel"),o(),n(20,"th"),l(21,"Process"),o(),n(22,"th"),l(23,"Duration"),o(),n(24,"th"),l(25,"Status"),o(),n(26,"th"),l(27,"Created"),o()()(),n(28,"tbody"),d(29,St,20,20,"ng-container",13),s(30,"async"),o()()()()(),d(31,Nt,2,1,"ng-container",14),s(32,"async"),o()()()),e&2&&(a(8),c("clearable",!0)("items",r.channelOptions),$("ngModel",r.filter.ChannelID),a(21),c("ngForOf",u(30,5,r.notifications$)),a(2),c("ngIf",u(32,7,r.notifications$)))},dependencies:[G,A,j,U,W,J,q,Z,X,Y,pt,ct,st,rt,at,nt,ot,Q,K],encapsulation:2})}}return i})();export{Ht as NotificationComponent};
1
+ import{a as mt}from"./chunk-7KG3DC5J.js";import{b as lt}from"./chunk-UWC2EVFY.js";import"./chunk-ACIMXBIC.js";import{a as st}from"./chunk-LDL3A7NM.js";import{i as it}from"./chunk-BVPWV5YO.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import{e as et}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{a as nt,b as ot,d as at,e as rt}from"./chunk-PYXL7UF7.js";import{c as tt}from"./chunk-RXQX7567.js";import{m as ct,n as pt}from"./chunk-HJXYT6MI.js";import{A as Z,h as X,m as Y}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{H as K,J as Q,d as A,f as j,g as U,j as W,k as q,m as J,n as G}from"./chunk-FXQKRJWU.js";import{$c as s,Fc as R,Gb as L,Gc as l,Hc as N,Ic as y,Kc as $,Lc as O,Mb as d,Mc as V,Rc as B,Sc as k,Tc as H,Yb as c,Z as b,ad as u,bd as T,ca as D,cd as z,f as w,ic as n,jc as o,kc as v,lc as f,mc as g,ob as M,oc as P,pb as I,rb as a,tc as E,uc as m,v as _,xb as S,xc as F,ya as h,za as C}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var ft=(i,p)=>({"bg-gradient-danger":i,"bg-gradient-warning":p}),gt=()=>["/menu/products/status/notification/detail"],ut=i=>({ID:i});function _t(i,p){if(i&1&&(n(0,"span",15),v(1,"img",16),o(),l(2)),i&2){let t=p.item;a(),c("src",t.Img,I)("alt",t.Name),a(),y(" ",t.Name," ")}}function ht(i,p){if(i&1&&(f(0),l(1),s(2,"number"),n(3,"span"),l(4,"s"),o(),g()),i&2){let t=m().$implicit;a(),y(" ",T(2,1,t.DurationInSecond,"1.1-1")," ")}}function Ct(i,p){i&1&&l(0," - ")}function St(i,p){if(i&1&&(f(0),n(1,"tr",17)(2,"td")(3,"a",18),v(4,"img",19),n(5,"span"),l(6),o()()(),n(7,"td")(8,"b"),l(9),o(),v(10,"div",20),o(),n(11,"td"),d(12,ht,5,4,"ng-container",21)(13,Ct,1,0,"ng-template",null,0,z),o(),n(15,"td"),l(16),o(),n(17,"td"),l(18),s(19,"date"),o()(),g()),i&2){let t=p.$implicit,e=R(14);a(),c("ngClass",H(14,ft,t.Status==1,t.Status==0)),a(2),c("routerLink",B(17,gt))("queryParams",k(18,ut,t.ID)),a(),F("src",t.Img,I),a(2),N(t.Name),a(3),N(t.Label),a(),c("innerHTML",t.Message,M),a(2),c("ngIf",t.DurationInSecond)("ngIfElse",e),a(4),N(t.StatusLabel),a(2),y(" ",T(19,11,t.Created,"dd MMM yyyy HH:mm")," ")}}function vt(i,p){if(i&1){let t=P();f(0),n(1,"div",7)(2,"div",22)(3,"app-custom-paginator",23),s(4,"async"),s(5,"async"),E("total",function(){h(t);let r=m(2);return C(r.getRowCount())})("next",function(){h(t);let r=m(2);return C(r.getNotifications())})("previous",function(){h(t);let r=m(2);return C(r.getNotifications())}),o()()(),g()}if(i&2){let t=m().ngIf,e=m();a(3),c("filter",e.filter)("totaldata",t==null?null:t.length)("paginationTotal",u(4,4,e.rowCount$))("hasClicked",u(5,6,e.rowCount$))}}function Nt(i,p){if(i&1&&(f(0),d(1,vt,6,8,"ng-container",14),g()),i&2){let t=p.ngIf;a(),c("ngIf",t.length>0)}}var Ht=(()=>{class i{constructor(t,e,r){this.http=t,this.notificationService=e,this.authService=r,this.filter=new mt,this.destroy$=new w,this.channelOptions=r.getChannels()}ngOnInit(){this.notificationService.clearNotification(),this.initPageLoader(),this.subscribeNotification()}subscribeNotification(){this.notificationService.getNotification().pipe(D(this.destroy$)).subscribe(t=>{t.length>0&&(this.getNotifications(),this.notificationService.clearNotification())})}initPageLoader(){this.http.post("/api/notification/Load",{}).subscribe(t=>{this.filter=t.Filter,this.filter.PageSize=this.filter.RowCount,this.getNotifications()})}onFilter(){this.rowCount$=null,this.getNotifications()}getNotifications(){let t={ChannelID:this.filter.ChannelID,RowCount:this.filter.PageSize,PageNumber:this.filter.PageNumber};this.notifications$=this.http.post("/api/notification/Get",t).pipe(_(e=>e.Data),_(e=>(e=this.setChannelLogoToNotifications(e),e=this.setTimeToSecond(e),e)),b(1))}setTimeToSecond(t){return t=t.map(e=>(e.DurationInSecond=parseInt(e.Duration)/1e3,e)),t}setChannelLogoToNotifications(t){return t=t.map(e=>(e.Img=tt.getChannelLogoByTypeId(e.TypeID),e)),t}getRowCount(){let t={ChannelID:this.filter.ChannelID};this.rowCount$=this.http.post("/api/notification/RowCount",t).pipe(_(e=>e.Count),b(1))}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(e){return new(e||i)(S(et),S(lt),S(it))}}static{this.\u0275cmp=L({type:i,selectors:[["app-notification"]],decls:33,vars:9,consts:[["timeNotAvailable",""],["headerTitle","Product Scan Job","hideSearchBox","true",3,"onSubmit"],["routerLink","/menu/products/status/notificationV2",1,"btn","btn-outline-secondary","btn-lg"],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[3,"ngClass"],[3,"routerLink","queryParams"],["alt","",1,"channelLogo-md","me-4",3,"src"],[3,"innerHTML"],[4,"ngIf","ngIfElse"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(e,r){e&1&&(n(0,"mainpanel",1),E("onSubmit",function(){return r.onFilter()}),n(1,"actions")(2,"a",2),l(3," Scan Job V2 "),o()(),n(4,"filters")(5,"div")(6,"h6",3),l(7,"Channel"),o(),n(8,"ng-select",4),V("ngModelChange",function(x){return O(r.filter.ChannelID,x)||(r.filter.ChannelID=x),x}),d(9,_t,3,3,"ng-template",5),o()()(),n(10,"content")(11,"div",6)(12,"div",7)(13,"div",8)(14,"div",9)(15,"table",10)(16,"thead",11)(17,"tr",12)(18,"th"),l(19,"Channel"),o(),n(20,"th"),l(21,"Process"),o(),n(22,"th"),l(23,"Duration"),o(),n(24,"th"),l(25,"Status"),o(),n(26,"th"),l(27,"Created"),o()()(),n(28,"tbody"),d(29,St,20,20,"ng-container",13),s(30,"async"),o()()()()(),d(31,Nt,2,1,"ng-container",14),s(32,"async"),o()()()),e&2&&(a(8),c("clearable",!0)("items",r.channelOptions),$("ngModel",r.filter.ChannelID),a(21),c("ngForOf",u(30,5,r.notifications$)),a(2),c("ngIf",u(32,7,r.notifications$)))},dependencies:[G,A,j,U,W,J,q,Z,X,Y,pt,ct,st,rt,at,nt,ot,Q,K],encapsulation:2})}}return i})();export{Ht as NotificationComponent};
@@ -0,0 +1 @@
1
+ import{a as b}from"./chunk-GH5FTODR.js";import{a as h}from"./chunk-BPAZ4TES.js";import{a as m}from"./chunk-NRUVGW2I.js";import"./chunk-PE5AFID4.js";import{c as M}from"./chunk-KSHWHTCH.js";import{b as O}from"./chunk-ABYG6YZT.js";import"./chunk-RAQRGWCZ.js";import"./chunk-HVCIQI7B.js";import{a}from"./chunk-5RAWBW2Q.js";import{a as P}from"./chunk-2WHJU6CS.js";import"./chunk-3GDM5JNY.js";import"./chunk-XXT6F2ZS.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import"./chunk-UMP6ZMEJ.js";import"./chunk-JVNHFIYT.js";import"./chunk-C7YK5TDP.js";import{a as C}from"./chunk-LDL3A7NM.js";import"./chunk-BVPWV5YO.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{e as g}from"./chunk-PYXL7UF7.js";import"./chunk-RXQX7567.js";import{n as f}from"./chunk-HJXYT6MI.js";import{A as u}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import{s}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{F as l,J as i,n as r}from"./chunk-FXQKRJWU.js";import{Gb as d,Hb as e,ka as n,kc as c}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var _=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=d({type:t,selectors:[["app-products"]],standalone:!1,decls:1,vars:0,template:function(o,v){o&1&&c(0,"router-outlet")},dependencies:[l],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]})}}return t})();var y=[{path:"",component:_,children:[{path:"",redirectTo:"status",pathMatch:"full"},{path:"status",loadChildren:()=>import("./chunk-PNF6K247.js").then(t=>t.StatusModule),canActivate:[a,m]},{path:"download",loadChildren:()=>import("./chunk-SWV5QK47.js").then(t=>t.DownloadModule),canActivate:[a,m]},{path:"upload",loadComponent:()=>import("./chunk-AR6PLQ6X.js").then(t=>t.ProductUploadComponent),data:{title:"Upload Product"},canActivate:[a,m]}]}],w=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275mod=e({type:t})}static{this.\u0275inj=n({imports:[r,i.forChild(y)]})}}return t})();var X=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275mod=e({type:t})}static{this.\u0275inj=n({imports:[r,u,i,w,s,f,g,O,C,M,P,h,b]})}}return t})();export{X as ProductModule};