marketplacepos 5.37.4 → 5.37.5

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 (35) hide show
  1. package/Marketplace/{chunk-H5DKI4F4.js → chunk-32V6XHOM.js} +1 -1
  2. package/Marketplace/{chunk-7EO5MRBU.js → chunk-3RGBGL3B.js} +1 -1
  3. package/Marketplace/{chunk-PNPQ4ROP.js → chunk-4EIP5A7W.js} +1 -1
  4. package/Marketplace/{chunk-7CIOGSCS.js → chunk-4Y3XPT4V.js} +1 -1
  5. package/Marketplace/{chunk-AMVY4XMB.js → chunk-6VWDQYTK.js} +1 -1
  6. package/Marketplace/{chunk-IPEOCIUA.js → chunk-7NN7LEU4.js} +1 -1
  7. package/Marketplace/{chunk-F3YTGLZT.js → chunk-AQ527QZ4.js} +1 -1
  8. package/Marketplace/{chunk-K3RLIVYF.js → chunk-BL7RQYYI.js} +1 -1
  9. package/Marketplace/{chunk-MH5AVQJR.js → chunk-CE2YFM5W.js} +2 -2
  10. package/Marketplace/{chunk-YE6BUIS7.js → chunk-CKCOOEQG.js} +1 -1
  11. package/Marketplace/{chunk-JTETVWNX.js → chunk-CPU3RPB6.js} +1 -1
  12. package/Marketplace/{chunk-VOCVNYLC.js → chunk-CQ5QKLSV.js} +1 -1
  13. package/Marketplace/{chunk-LBCJNHNR.js → chunk-DNBZJ62Q.js} +1 -1
  14. package/Marketplace/{chunk-7W2EWSOP.js → chunk-E2KCDO25.js} +1 -1
  15. package/Marketplace/{chunk-RX6VZ4IG.js → chunk-GC2HU6DG.js} +1 -1
  16. package/Marketplace/{chunk-3DEMAMTN.js → chunk-H2ETKTF2.js} +1 -1
  17. package/Marketplace/{chunk-ZEWJSXKY.js → chunk-HA4UOTDV.js} +1 -1
  18. package/Marketplace/{chunk-6ZT6G6ZX.js → chunk-OPZWOT5F.js} +1 -1
  19. package/Marketplace/{chunk-K27IWV7V.js → chunk-PRUGNP4D.js} +1 -1
  20. package/Marketplace/{chunk-O55WNQN7.js → chunk-PU65Z74E.js} +1 -1
  21. package/Marketplace/{chunk-SE5GYDNR.js → chunk-PXXXV722.js} +1 -1
  22. package/Marketplace/{chunk-GVAPYZ7X.js → chunk-Q2CPBWY3.js} +1 -1
  23. package/Marketplace/{chunk-RDBEJJXU.js → chunk-T2G6LONF.js} +1 -1
  24. package/Marketplace/{chunk-RG5P2GM3.js → chunk-TABEGCJE.js} +1 -1
  25. package/Marketplace/{chunk-XDB5B4VD.js → chunk-TUYBRQVT.js} +1 -1
  26. package/Marketplace/{chunk-74EGQDBL.js → chunk-TY6N4JRI.js} +1 -1
  27. package/Marketplace/{chunk-T2UNTDY6.js → chunk-UIDU76VX.js} +1 -1
  28. package/Marketplace/{chunk-JNMDGK2M.js → chunk-UVMSTT2I.js} +1 -1
  29. package/Marketplace/{chunk-76DD4KTI.js → chunk-VDUN2ZDO.js} +1 -1
  30. package/Marketplace/{chunk-2IHMLXWJ.js → chunk-WYV5N2CX.js} +1 -1
  31. package/Marketplace/{chunk-2Y4PYWHB.js → chunk-Z2Y7D4DZ.js} +1 -1
  32. package/Marketplace/{chunk-WU7L6NYM.js → chunk-ZWKNMFWZ.js} +2 -2
  33. package/Marketplace/index.html +3 -3
  34. package/Marketplace/{main-6QPEM5JQ.js → main-GAY5QK22.js} +1 -1
  35. package/package.json +1 -1
@@ -1 +1 @@
1
- import{a as oe}from"./chunk-6HVHZ3HN.js";import{b as ae}from"./chunk-5BTJTFLF.js";import{a as le,b as re}from"./chunk-WYOXUN3H.js";import"./chunk-23MIIDCT.js";import"./chunk-SD7UKXTX.js";import"./chunk-E24BKGBJ.js";import"./chunk-VKJAFLQ6.js";import"./chunk-TY4H2W6F.js";import"./chunk-SDUUFQUI.js";import"./chunk-R5IDWUP6.js";import"./chunk-4RAOUTR2.js";import{a as Y,b as Z,d as ee,e as te}from"./chunk-TTAS23MO.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import{j as X}from"./chunk-7CIOGSCS.js";import{e as Q}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{l as ne,m as ie}from"./chunk-XOT2SZPE.js";import"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{h as H,m as U,y as G}from"./chunk-AI4XRCAL.js";import{c as K}from"./chunk-W6T7TOHE.js";import{j as V,k as J,l as W,n as k}from"./chunk-B6POIFQM.js";import{Eb as P,Ec as p,Fc as C,Gc as y,Ic as j,Jc as O,Kb as u,Kc as q,Mc as z,Wb as d,Xc as m,Yc as c,Z as M,Zc as A,aa as D,bc as R,cc as B,ec as T,fc as $,g as L,gc as i,hc as a,ic as f,ja as w,mc as F,ob as S,pa as g,qb as l,rc as v,sc as x,v as I,ya as E,za as N}from"./chunk-EIQCOZF5.js";import{a as _}from"./chunk-K2H6WANG.js";var b=(()=>{class n{constructor(){this.httpService=g(Q),this._pageination=new L({PageNumber:1,RowCount:100,ChannelID:null}),this.filter$=this._pageination.asObservable(),this.log$=this.filter$.pipe(D(e=>this.getLogs$(e).pipe()))}getLogs$(e){return this.httpService.post("/api/Channel/GetChannelLogPaged",e)}onPaginationChange(e){let t=this._pageination.value;t.PageNumber=e.pageIndex+1,this._pageination.next(t)}onFilter(e){let t=this._pageination.value;t.PageNumber=1,t=_(_({},t),e),this._pageination.next(t)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=w({token:n,factory:n.\u0275fac})}}return n})();function me(n,h){if(n&1&&(i(0,"span",10),f(1,"img",11),a(),p(2)),n&2){let e=h.item;l(),d("src",e.Img,S)("alt",e.Name),l(),y(" ",e.Name," ")}}function se(n,h){if(n&1&&(i(0,"tr")(1,"td"),f(2,"img",17),i(3,"span"),p(4),a()(),i(5,"td"),p(6),m(7,"json"),a(),i(8,"td"),p(9),m(10,"json"),a(),i(11,"td"),p(12),m(13,"date"),a()()),n&2){let e=h.$implicit;l(2),d("src",e.Img,S),l(2),y(" ",e.ChannelName," "),l(2),C(c(7,5,e.Request)),l(3),C(c(10,7,e.Response)),l(3),C(A(13,9,e.Created,"dd-MM-yyyy hh:mm:ss"))}}function ce(n,h){if(n&1){let e=F();i(0,"div",8)(1,"table",12)(2,"thead")(3,"tr",13)(4,"th",14),p(5,"Channel"),a(),i(6,"th"),p(7,"Request"),a(),i(8,"th"),p(9,"Response"),a(),i(10,"th",15),p(11,"Created"),a()()(),i(12,"tbody"),T(13,se,14,12,"tr",null,B),m(15,"async"),a()(),i(16,"mat-paginator",16),m(17,"async"),m(18,"async"),m(19,"async"),m(20,"async"),v("page",function(r){E(e);let o=x();return N(o.channelLogService.onPaginationChange(r))}),a()()}if(n&2){let e,t,r,o,s=x();l(13),$((e=c(15,3,s.channelLogs$))==null?null:e.Data),l(3),d("length",(t=c(17,5,s.channelLogs$))==null?null:t.Count)("pageSize",(r=c(18,7,s.filter$))==null?null:r.RowCount)("pageIndex",(o=c(19,9,s.filter$))!=null&&o.PageNumber?0:((o=c(20,11,s.filter$))==null?null:o.PageNumber)-1)}}function de(n,h){n&1&&(i(0,"div",9),f(1,"app-empty-state"),a())}var Oe=(()=>{class n{constructor(){this.channelLogService=g(b),this.authService=g(X),this.channelOptions=this.authService.getChannels(),this.channelLogs$=this.channelLogService.log$.pipe(I(e=>(e.Data?e.Data=e.Data.map(t=>(t.Response=t.Response?JSON.parse(t.Response):"",t.Request=t.Request?JSON.parse(t.Request):"",t.Img=K.getChannelLogoByTypeId(t.TypeID),t)):e.Data=[],e)),M(1)),this.filter$=this.channelLogService.filter$}onSubmitFilter(){this.channelLogService.onFilter({ChannelID:this.channelID})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=P({type:n,selectors:[["app-channel-log"]],features:[z([b])],decls:15,vars:7,consts:[["headerTitle","Authorization Log",3,"onSubmit","hideSearchBox"],["container",""],[1,"fw-bold","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,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[3,"page","length","pageSize","pageIndex"],[1,"me-2",2,"width","25px",3,"src"]],template:function(t,r){if(t&1&&(i(0,"mainpanel",0),v("onSubmit",function(){return r.onSubmitFilter()}),i(1,"filters")(2,"div",1)(3,"div")(4,"label",2),p(5,"Channel"),a(),i(6,"ng-select",3),q("ngModelChange",function(s){return O(r.channelID,s)||(r.channelID=s),s}),u(7,me,3,3,"ng-template",4),a()()()(),i(8,"content")(9,"div",5)(10,"div",6)(11,"div",7),u(12,ce,21,13,"div",8),m(13,"async"),u(14,de,2,0,"div",9),a()()()()()),t&2){let o;d("hideSearchBox",!0),l(6),d("clearable",!0)("items",r.channelOptions),j("ngModel",r.channelID),l(6),R(((o=c(13,5,r.channelLogs$))==null||o.Data==null?null:o.Data.length)>0?12:14)}},dependencies:[k,V,W,J,ie,ne,oe,re,le,ae,te,ee,Y,Z,G,H,U],encapsulation:2})}}return n})();export{Oe as ChannelLogComponent};
1
+ import{a as oe}from"./chunk-6HVHZ3HN.js";import{b as ae}from"./chunk-5BTJTFLF.js";import{a as le,b as re}from"./chunk-WYOXUN3H.js";import"./chunk-23MIIDCT.js";import"./chunk-SD7UKXTX.js";import"./chunk-E24BKGBJ.js";import"./chunk-VKJAFLQ6.js";import"./chunk-TY4H2W6F.js";import"./chunk-SDUUFQUI.js";import"./chunk-R5IDWUP6.js";import"./chunk-4RAOUTR2.js";import{a as Y,b as Z,d as ee,e as te}from"./chunk-TTAS23MO.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import{j as X}from"./chunk-4Y3XPT4V.js";import{e as Q}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{l as ne,m as ie}from"./chunk-XOT2SZPE.js";import"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{h as H,m as U,y as G}from"./chunk-AI4XRCAL.js";import{c as K}from"./chunk-W6T7TOHE.js";import{j as V,k as J,l as W,n as k}from"./chunk-B6POIFQM.js";import{Eb as P,Ec as p,Fc as C,Gc as y,Ic as j,Jc as O,Kb as u,Kc as q,Mc as z,Wb as d,Xc as m,Yc as c,Z as M,Zc as A,aa as D,bc as R,cc as B,ec as T,fc as $,g as L,gc as i,hc as a,ic as f,ja as w,mc as F,ob as S,pa as g,qb as l,rc as v,sc as x,v as I,ya as E,za as N}from"./chunk-EIQCOZF5.js";import{a as _}from"./chunk-K2H6WANG.js";var b=(()=>{class n{constructor(){this.httpService=g(Q),this._pageination=new L({PageNumber:1,RowCount:100,ChannelID:null}),this.filter$=this._pageination.asObservable(),this.log$=this.filter$.pipe(D(e=>this.getLogs$(e).pipe()))}getLogs$(e){return this.httpService.post("/api/Channel/GetChannelLogPaged",e)}onPaginationChange(e){let t=this._pageination.value;t.PageNumber=e.pageIndex+1,this._pageination.next(t)}onFilter(e){let t=this._pageination.value;t.PageNumber=1,t=_(_({},t),e),this._pageination.next(t)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=w({token:n,factory:n.\u0275fac})}}return n})();function me(n,h){if(n&1&&(i(0,"span",10),f(1,"img",11),a(),p(2)),n&2){let e=h.item;l(),d("src",e.Img,S)("alt",e.Name),l(),y(" ",e.Name," ")}}function se(n,h){if(n&1&&(i(0,"tr")(1,"td"),f(2,"img",17),i(3,"span"),p(4),a()(),i(5,"td"),p(6),m(7,"json"),a(),i(8,"td"),p(9),m(10,"json"),a(),i(11,"td"),p(12),m(13,"date"),a()()),n&2){let e=h.$implicit;l(2),d("src",e.Img,S),l(2),y(" ",e.ChannelName," "),l(2),C(c(7,5,e.Request)),l(3),C(c(10,7,e.Response)),l(3),C(A(13,9,e.Created,"dd-MM-yyyy hh:mm:ss"))}}function ce(n,h){if(n&1){let e=F();i(0,"div",8)(1,"table",12)(2,"thead")(3,"tr",13)(4,"th",14),p(5,"Channel"),a(),i(6,"th"),p(7,"Request"),a(),i(8,"th"),p(9,"Response"),a(),i(10,"th",15),p(11,"Created"),a()()(),i(12,"tbody"),T(13,se,14,12,"tr",null,B),m(15,"async"),a()(),i(16,"mat-paginator",16),m(17,"async"),m(18,"async"),m(19,"async"),m(20,"async"),v("page",function(r){E(e);let o=x();return N(o.channelLogService.onPaginationChange(r))}),a()()}if(n&2){let e,t,r,o,s=x();l(13),$((e=c(15,3,s.channelLogs$))==null?null:e.Data),l(3),d("length",(t=c(17,5,s.channelLogs$))==null?null:t.Count)("pageSize",(r=c(18,7,s.filter$))==null?null:r.RowCount)("pageIndex",(o=c(19,9,s.filter$))!=null&&o.PageNumber?0:((o=c(20,11,s.filter$))==null?null:o.PageNumber)-1)}}function de(n,h){n&1&&(i(0,"div",9),f(1,"app-empty-state"),a())}var Oe=(()=>{class n{constructor(){this.channelLogService=g(b),this.authService=g(X),this.channelOptions=this.authService.getChannels(),this.channelLogs$=this.channelLogService.log$.pipe(I(e=>(e.Data?e.Data=e.Data.map(t=>(t.Response=t.Response?JSON.parse(t.Response):"",t.Request=t.Request?JSON.parse(t.Request):"",t.Img=K.getChannelLogoByTypeId(t.TypeID),t)):e.Data=[],e)),M(1)),this.filter$=this.channelLogService.filter$}onSubmitFilter(){this.channelLogService.onFilter({ChannelID:this.channelID})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=P({type:n,selectors:[["app-channel-log"]],features:[z([b])],decls:15,vars:7,consts:[["headerTitle","Authorization Log",3,"onSubmit","hideSearchBox"],["container",""],[1,"fw-bold","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,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[3,"page","length","pageSize","pageIndex"],[1,"me-2",2,"width","25px",3,"src"]],template:function(t,r){if(t&1&&(i(0,"mainpanel",0),v("onSubmit",function(){return r.onSubmitFilter()}),i(1,"filters")(2,"div",1)(3,"div")(4,"label",2),p(5,"Channel"),a(),i(6,"ng-select",3),q("ngModelChange",function(s){return O(r.channelID,s)||(r.channelID=s),s}),u(7,me,3,3,"ng-template",4),a()()()(),i(8,"content")(9,"div",5)(10,"div",6)(11,"div",7),u(12,ce,21,13,"div",8),m(13,"async"),u(14,de,2,0,"div",9),a()()()()()),t&2){let o;d("hideSearchBox",!0),l(6),d("clearable",!0)("items",r.channelOptions),j("ngModel",r.channelID),l(6),R(((o=c(13,5,r.channelLogs$))==null||o.Data==null?null:o.Data.length)>0?12:14)}},dependencies:[k,V,W,J,ie,ne,oe,re,le,ae,te,ee,Y,Z,G,H,U],encapsulation:2})}}return n})();export{Oe as ChannelLogComponent};
@@ -1,4 +1,4 @@
1
- import{a as Ke,b as G,c as He}from"./chunk-WHFC7TE4.js";import"./chunk-WBVTRQFG.js";import{a as $e,b as ze,c as Ye,e as Ge,f as Ue,g as je}from"./chunk-VAPIXIJ3.js";import"./chunk-3NMGN7IE.js";import"./chunk-B5JAZPVU.js";import"./chunk-OS53H77X.js";import{i as We,j as Re,k as Le,l as Be,m as Ae}from"./chunk-VOISFPEM.js";import{a as Ne}from"./chunk-EXFL3GUX.js";import"./chunk-6A4PYMCJ.js";import{a as Fe,b as Oe,c as ke}from"./chunk-K5CKXDIJ.js";import"./chunk-SD7UKXTX.js";import"./chunk-VKJAFLQ6.js";import"./chunk-SDUUFQUI.js";import"./chunk-HPS3WVU5.js";import"./chunk-4RAOUTR2.js";import{c as Te,d as be,e as Ee}from"./chunk-TTAS23MO.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import{h as Z,j as ee}from"./chunk-7CIOGSCS.js";import{b as xe,e as De}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{l as Me,m as Ve}from"./chunk-XOT2SZPE.js";import{r as Pe,s as Ie}from"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{c as Se,h as Ce,m as ve,y as ye}from"./chunk-AI4XRCAL.js";import{b as X,c as x}from"./chunk-W6T7TOHE.js";import{H as we,J as ge,d as R,f as L,g as B,j as J,k as q,n as F}from"./chunk-B6POIFQM.js";import{Ac as ue,Dc as T,Eb as M,Ec as l,Fc as V,Gc as C,Ic as E,Jc as P,Ka as j,Kb as w,Kc as I,Mc as K,Na as O,Oc as he,Pc as fe,Qa as _,Wb as d,Xc as W,Yc as Y,Z as $,Zc as _e,_c as H,aa as oe,bc as b,ea as z,gc as a,hc as r,ic as S,ja as le,jc as k,kc as N,m as ae,mc as y,ob as pe,od as Q,pa as v,qb as o,rc as g,sc as u,v as U,vc as se,wc as de,ya as m,yc as me,za as c,zc as ce}from"./chunk-EIQCOZF5.js";import{a as ne,b as re}from"./chunk-K2H6WANG.js";var Xe=t=>({"over-due":t});function Ze(t,s){if(t&1&&(a(0,"tr",8)(1,"td"),l(2),r(),a(3,"td"),l(4),r(),a(5,"td"),l(6),r(),a(7,"td"),l(8),r()()),t&2){let e=s.$implicit,n=s.index;d("ngClass",he(5,Xe,e.Exception)),o(2),V(n+1),o(2),V(e.Number),o(2),V(e.Status),o(2),V(e.Exception)}}function et(t,s){if(t&1&&(k(0),w(1,Ze,9,7,"tr",7),N()),t&2){let e,n=u();o(),d("ngForOf",(e=n.downloadResult())==null?null:e.Body)}}function tt(t,s){t&1&&(a(0,"tr",9)(1,"td",10)(2,"div",11),S(3,"i",12),r(),a(4,"h4",13),l(5," There is no order to processed "),r()()())}var Qe=(()=>{class t{constructor(){this.downloadResult=O()}ngOnInit(){}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=M({type:t,selectors:[["complete-step"]],inputs:{downloadResult:[1,"downloadResult"]},decls:16,vars:2,consts:[["EMPTY_DOWNLOAD",""],[1,"row","pt-2"],[1,"col-md-12"],[1,"table"],[1,"thead-light"],["width","1%"],[4,"ngIf","ngIfElse"],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"],[1,"text-center"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"]],template:function(n,i){if(n&1&&(a(0,"div",1)(1,"div",2)(2,"table",3)(3,"thead",4)(4,"tr"),S(5,"th",5),a(6,"th"),l(7,"Order Number"),r(),a(8,"th"),l(9,"Status"),r(),a(10,"th"),l(11,"Exception"),r()()(),a(12,"tbody"),w(13,et,2,1,"ng-container",6)(14,tt,6,0,"ng-template",null,0,H),r()()()()),n&2){let p,h=T(15);o(13),d("ngIf",((p=i.downloadResult())==null||p.Body==null?null:p.Body.length)>0)("ngIfElse",h)}},dependencies:[F,R,L,B],encapsulation:2})}}return t})();var A=(()=>{class t{constructor(){this.httpService=v(De),this.toastr=v(xe),this.datePipe=v(q)}gerChannelDetailById(e){return this.httpService.post(Z.GetChannelDetail,{ID:e})}getOrderPreview(e){return this.httpService.post(Z.GetOrderPreviewV2,e)}getDownloadOrder(e){return this.httpService.post(Z.GetDownloadOrderV2,e)}onPreviewOrder(e){return this.validateDatePreview(e)?this.getOrderPreview(e).pipe(z(n=>{n.Data?.length===0&&this.toastrEmptyPreview(e)})):ae}toastrEmptyPreview(e){let n=this.datePipe.transform(e.From,"dd MMM yyyy"),i=this.datePipe.transform(e.To,"dd MMM yyyy"),p=e.TimeFrom?e.TimeFrom:"",h=e.TimeTo?e.TimeTo:"";this.toastr.info(`There is no orders from ${n} ${p} to ${i} ${h}!`,"No Orders!")}validateDatePreview(e){let n=!0;return e.downloadType==!0?x.getDaysDiff(e?.From,e?.To)+1>7&&(this.toastr.warning("Dates cannot be more than 7 days apart!","Warning"),n=!1):x.getDaysDiff(e?.From,e?.To)+1>14&&(this.toastr.warning("Dates cannot be more than 14 days apart!","Warning"),n=!1),n}getDateTitle(e,n){let i=x.formatTitleFromDate(new Date(e),new Date(n)),p=this.datePipe.transform(e,i),h=this.datePipe.transform(n,"dd MMM yyyy");return`${i==null?"":p+"-"} ${h}`}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=le({token:t,factory:t.\u0275fac})}}return t})();function it(t,s){if(t&1&&(a(0,"ng-option",13),S(1,"img",14),l(2),r()),t&2){let e=s.$implicit;d("value",e.ID),o(),d("src",e==null?null:e.Img,pe),o(),C("",e.Name," ")}}function nt(t,s){if(t&1){let e=y();a(0,"div",8)(1,"div",4)(2,"h5"),l(3,"Type"),r(),a(4,"p",5),l(5,"Select Type want to download"),r()(),a(6,"div",4)(7,"div",15)(8,"div")(9,"mat-radio-group",16),I("ngModelChange",function(i){m(e);let p=u();return P(p.downloadType,i)||(p.downloadType=i),c(i)}),g("ngModelChange",function(){m(e);let i=u();return c(i.onDownloadTypeChange())}),a(10,"mat-radio-button",17),l(11," Orders "),r(),a(12,"mat-radio-button",18),l(13," Disbursement "),r()()()(),a(14,"div",19)(15,"div",20),S(16,"i",21),r(),a(17,"p",22),l(18," If there are completed transactions, to obtain payment and service fee, you need to download disbursement. "),r()()()()}if(t&2){let e=u();o(9),E("ngModel",e.downloadType),o(),d("value",!1),o(2),d("value",!0)}}function rt(t,s){t&1&&(a(0,"p",5),l(1," Select Disbursement date "),a(2,"span",23),l(3,"(payment date / order complete date)"),r(),l(4," of the channel you want to download (Max 1 Week). "),r())}function at(t,s){t&1&&(a(0,"p",5),l(1," Select transaction date of the channel you want to download (Max 2 Weeks) "),r())}function ot(t,s){if(t&1){let e=y();a(0,"div",12)(1,"app-timepicker",24),I("timeChange",function(i){m(e);let p=u();return P(p.startTime,i)||(p.startTime=i),c(i)}),g("timeChange",function(){m(e);let i=u();return c(i.onStartTimeChange())}),r(),a(2,"span",25),l(3,"-"),r(),a(4,"app-timepicker",24),I("timeChange",function(i){m(e);let p=u();return P(p.endTime,i)||(p.endTime=i),c(i)}),g("timeChange",function(){m(e);let i=u();return c(i.onEndTimeChange())}),r()()}if(t&2){let e=u();o(),E("time",e.startTime),o(3),E("time",e.endTime)}}var Je=(()=>{class t{constructor(){this.reset=O(!1),this.authService=v(ee),this.downloadService=v(A),this.downloadType=_(!1),this.selectedChannelId=_(null),this.channelOptions=_(this.authService.getChannels()),this.channelType=X,this.selectedChannel=_(null),this.showTimePicker=_(!1),this.startDate=_(null),this.endDate=_(null),this.startTime=_("00:00"),this.endTime=_("23:59"),this.filterData=new j,Q(()=>{this.reset()&&this.resetFilter()},{allowSignalWrites:!0})}resetFilter(){this.selectedChannelId.update(()=>null),this.startDate.update(()=>null),this.endDate.update(()=>null),this.startTime.update(()=>null),this.endTime.update(()=>null),this.downloadType.update(()=>!1),this.selectedChannel.update(()=>null),this.showTimePicker.update(()=>!1),this.channelDetail$=null}onSelectChannel(){this.selectedChannel.update(()=>this.channelOptions().find(e=>e.ID===this.selectedChannelId())),this.selectedChannel()?this.channelDetail$=this.downloadService.gerChannelDetailById(this.selectedChannelId()).pipe(U(e=>e?.Model),$(1)):this.channelDetail$=null,this.emitFilterData()}onFilterDateChange(){let e=1;this.startDate()&&this.endDate()&&(e=x.getDaysDiff(this.startDate(),this.endDate())),this.showTimePicker.update(()=>e==0),this.emitFilterData()}onDownloadTypeChange(){this.emitFilterData()}onStartTimeChange(){this.emitFilterData()}onEndTimeChange(){this.emitFilterData()}emitFilterData(){this.filterData.emit({channelId:this.selectedChannelId(),startDate:this.startDate(),endDate:this.endDate(),downloadType:this.downloadType(),startTime:this.startTime(),endTime:this.endTime()})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=M({type:t,selectors:[["filter-step"]],inputs:{reset:[1,"reset"]},outputs:{filterData:"onFilterChange"},features:[K([A])],decls:27,vars:11,consts:[["picker",""],[1,"row","pt-2",2,"width","63%","margin-right","40px"],[1,"col-12"],[1,"row"],[1,"col-6"],[1,"text-muted"],["appendTo","body","placeholder","Select Channel",3,"ngModelChange","clearable","ngModel"],[3,"value",4,"ngFor","ngForOf"],[1,"row","mt-6"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"mt-8"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"form-label-group","radio","download-type",2,"margin-bottom","0px"],["name","dowloadType",3,"ngModelChange","ngModel"],["matTooltip","Download from Create sales order until create logistics status",1,"me-5",3,"value"],["matTooltip","Download only Payment and write off",1,"me-5",3,"value"],[1,"d-flex","border","mb-4","pt-6","px-6","mt-3",2,"background","#1f87ac0a","border-radius","5px"],[1,"me-3","pt-1"],[1,"fa","fa-lightbulb","fs-5"],[1,"mb-6"],[1,"fw-bold"],[3,"timeChange","time"],[1,"mx-4"]],template:function(n,i){if(n&1){let p=y();a(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"h5"),l(5,"Select a Channel"),r(),a(6,"p",5),l(7,"Select Channel want to download order"),r()(),a(8,"div",4)(9,"ng-select",6),I("ngModelChange",function(f){return m(p),P(i.selectedChannelId,f)||(i.selectedChannelId=f),c(f)}),g("ngModelChange",function(){return m(p),c(i.onSelectChannel())}),w(10,it,3,3,"ng-option",7),r()()(),w(11,nt,19,3,"div",8),W(12,"async"),a(13,"div",8)(14,"div",4)(15,"h5"),l(16,"Date Range"),r(),w(17,rt,5,0,"p",5)(18,at,2,0,"p",5),r(),a(19,"div",4)(20,"div",2)(21,"mat-date-range-input",9)(22,"input",10),I("ngModelChange",function(f){return m(p),P(i.startDate,f)||(i.startDate=f),c(f)}),g("click",function(){m(p);let f=T(25);return c(f.open())}),r(),a(23,"input",11),I("ngModelChange",function(f){return m(p),P(i.endDate,f)||(i.endDate=f),c(f)}),g("click",function(){m(p);let f=T(25);return c(f.open())})("ngModelChange",function(){return m(p),c(i.onFilterDateChange())}),r()(),S(24,"mat-date-range-picker",null,0),r(),w(26,ot,5,2,"div",12),r()()()()}if(n&2){let p,h,f=T(25);o(9),d("clearable",!1),E("ngModel",i.selectedChannelId),o(),d("ngForOf",i.channelOptions()),o(),b((p=Y(12,9,i.channelDetail$))!=null&&p.ServiceFeeWriteOff&&((p=i.selectedChannel())==null?null:p.TypeID)==i.channelType.Tokopedia?11:-1),o(6),b(i.downloadType()&&((h=i.selectedChannel())==null?null:h.TypeID)==i.channelType.Tokopedia?17:18),o(4),d("rangePicker",f),o(),E("ngModel",i.startDate),o(),E("ngModel",i.endDate),o(3),b(i.showTimePicker()?26:-1)}},dependencies:[F,L,J,Ee,be,Te,ke,Fe,Oe,ye,Se,Ce,ve,He,Be,We,Ae,Re,Le],styles:[".vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}.mt-1rem[_ngcontent-%COMP%]{margin-top:1rem}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}.form-label-group.radio.download-type[_ngcontent-%COMP%]{height:45.5938px!important;border-radius:.375rem!important}"]})}}return t})();var D=function(t){return t.ALL="all",t.SYNC="sync",t.WRONG="wrong",t.UNSYNC="unsync",t}(D||{});var lt=(t,s)=>({"over-due-today":t,"over-due":s});function pt(t,s){if(t&1&&(a(0,"th",21),l(1),r()),t&2){let e=u();o(),C(" ",e.selectedChannel()?"Created Date":"Last Status Update"," ")}}function st(t,s){if(t&1&&(a(0,"td"),l(1),W(2,"date"),r()),t&2){let e=u().$implicit;o(),C(" ",_e(2,1,e.Modified,"dd MMM yyyy HH:mm:ss")," ")}}function dt(t,s){if(t&1&&(a(0,"span"),l(1),r()),t&2){let e=u().$implicit;o(),C(" ",e.ActionString," ")}}function mt(t,s){if(t&1&&(a(0,"li"),l(1),r()),t&2){let e=s.$implicit;o(),C(" ",e," ")}}function ct(t,s){if(t&1&&(a(0,"ul",27),w(1,mt,2,1,"li",22),r()),t&2){let e=u().$implicit;o(),d("ngForOf",e.ActionString)}}function ut(t,s){if(t&1&&(a(0,"span",28),S(1,"i",29),r()),t&2){let e=u().$implicit;de("title","Delivery : ",e.DeliveryState,`
1
+ import{a as Ke,b as G,c as He}from"./chunk-WHFC7TE4.js";import"./chunk-WBVTRQFG.js";import{a as $e,b as ze,c as Ye,e as Ge,f as Ue,g as je}from"./chunk-VAPIXIJ3.js";import"./chunk-3NMGN7IE.js";import"./chunk-B5JAZPVU.js";import"./chunk-OS53H77X.js";import{i as We,j as Re,k as Le,l as Be,m as Ae}from"./chunk-VOISFPEM.js";import{a as Ne}from"./chunk-EXFL3GUX.js";import"./chunk-6A4PYMCJ.js";import{a as Fe,b as Oe,c as ke}from"./chunk-K5CKXDIJ.js";import"./chunk-SD7UKXTX.js";import"./chunk-VKJAFLQ6.js";import"./chunk-SDUUFQUI.js";import"./chunk-HPS3WVU5.js";import"./chunk-4RAOUTR2.js";import{c as Te,d as be,e as Ee}from"./chunk-TTAS23MO.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import{h as Z,j as ee}from"./chunk-4Y3XPT4V.js";import{b as xe,e as De}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{l as Me,m as Ve}from"./chunk-XOT2SZPE.js";import{r as Pe,s as Ie}from"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{c as Se,h as Ce,m as ve,y as ye}from"./chunk-AI4XRCAL.js";import{b as X,c as x}from"./chunk-W6T7TOHE.js";import{H as we,J as ge,d as R,f as L,g as B,j as J,k as q,n as F}from"./chunk-B6POIFQM.js";import{Ac as ue,Dc as T,Eb as M,Ec as l,Fc as V,Gc as C,Ic as E,Jc as P,Ka as j,Kb as w,Kc as I,Mc as K,Na as O,Oc as he,Pc as fe,Qa as _,Wb as d,Xc as W,Yc as Y,Z as $,Zc as _e,_c as H,aa as oe,bc as b,ea as z,gc as a,hc as r,ic as S,ja as le,jc as k,kc as N,m as ae,mc as y,ob as pe,od as Q,pa as v,qb as o,rc as g,sc as u,v as U,vc as se,wc as de,ya as m,yc as me,za as c,zc as ce}from"./chunk-EIQCOZF5.js";import{a as ne,b as re}from"./chunk-K2H6WANG.js";var Xe=t=>({"over-due":t});function Ze(t,s){if(t&1&&(a(0,"tr",8)(1,"td"),l(2),r(),a(3,"td"),l(4),r(),a(5,"td"),l(6),r(),a(7,"td"),l(8),r()()),t&2){let e=s.$implicit,n=s.index;d("ngClass",he(5,Xe,e.Exception)),o(2),V(n+1),o(2),V(e.Number),o(2),V(e.Status),o(2),V(e.Exception)}}function et(t,s){if(t&1&&(k(0),w(1,Ze,9,7,"tr",7),N()),t&2){let e,n=u();o(),d("ngForOf",(e=n.downloadResult())==null?null:e.Body)}}function tt(t,s){t&1&&(a(0,"tr",9)(1,"td",10)(2,"div",11),S(3,"i",12),r(),a(4,"h4",13),l(5," There is no order to processed "),r()()())}var Qe=(()=>{class t{constructor(){this.downloadResult=O()}ngOnInit(){}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=M({type:t,selectors:[["complete-step"]],inputs:{downloadResult:[1,"downloadResult"]},decls:16,vars:2,consts:[["EMPTY_DOWNLOAD",""],[1,"row","pt-2"],[1,"col-md-12"],[1,"table"],[1,"thead-light"],["width","1%"],[4,"ngIf","ngIfElse"],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"],[1,"text-center"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"]],template:function(n,i){if(n&1&&(a(0,"div",1)(1,"div",2)(2,"table",3)(3,"thead",4)(4,"tr"),S(5,"th",5),a(6,"th"),l(7,"Order Number"),r(),a(8,"th"),l(9,"Status"),r(),a(10,"th"),l(11,"Exception"),r()()(),a(12,"tbody"),w(13,et,2,1,"ng-container",6)(14,tt,6,0,"ng-template",null,0,H),r()()()()),n&2){let p,h=T(15);o(13),d("ngIf",((p=i.downloadResult())==null||p.Body==null?null:p.Body.length)>0)("ngIfElse",h)}},dependencies:[F,R,L,B],encapsulation:2})}}return t})();var A=(()=>{class t{constructor(){this.httpService=v(De),this.toastr=v(xe),this.datePipe=v(q)}gerChannelDetailById(e){return this.httpService.post(Z.GetChannelDetail,{ID:e})}getOrderPreview(e){return this.httpService.post(Z.GetOrderPreviewV2,e)}getDownloadOrder(e){return this.httpService.post(Z.GetDownloadOrderV2,e)}onPreviewOrder(e){return this.validateDatePreview(e)?this.getOrderPreview(e).pipe(z(n=>{n.Data?.length===0&&this.toastrEmptyPreview(e)})):ae}toastrEmptyPreview(e){let n=this.datePipe.transform(e.From,"dd MMM yyyy"),i=this.datePipe.transform(e.To,"dd MMM yyyy"),p=e.TimeFrom?e.TimeFrom:"",h=e.TimeTo?e.TimeTo:"";this.toastr.info(`There is no orders from ${n} ${p} to ${i} ${h}!`,"No Orders!")}validateDatePreview(e){let n=!0;return e.downloadType==!0?x.getDaysDiff(e?.From,e?.To)+1>7&&(this.toastr.warning("Dates cannot be more than 7 days apart!","Warning"),n=!1):x.getDaysDiff(e?.From,e?.To)+1>14&&(this.toastr.warning("Dates cannot be more than 14 days apart!","Warning"),n=!1),n}getDateTitle(e,n){let i=x.formatTitleFromDate(new Date(e),new Date(n)),p=this.datePipe.transform(e,i),h=this.datePipe.transform(n,"dd MMM yyyy");return`${i==null?"":p+"-"} ${h}`}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=le({token:t,factory:t.\u0275fac})}}return t})();function it(t,s){if(t&1&&(a(0,"ng-option",13),S(1,"img",14),l(2),r()),t&2){let e=s.$implicit;d("value",e.ID),o(),d("src",e==null?null:e.Img,pe),o(),C("",e.Name," ")}}function nt(t,s){if(t&1){let e=y();a(0,"div",8)(1,"div",4)(2,"h5"),l(3,"Type"),r(),a(4,"p",5),l(5,"Select Type want to download"),r()(),a(6,"div",4)(7,"div",15)(8,"div")(9,"mat-radio-group",16),I("ngModelChange",function(i){m(e);let p=u();return P(p.downloadType,i)||(p.downloadType=i),c(i)}),g("ngModelChange",function(){m(e);let i=u();return c(i.onDownloadTypeChange())}),a(10,"mat-radio-button",17),l(11," Orders "),r(),a(12,"mat-radio-button",18),l(13," Disbursement "),r()()()(),a(14,"div",19)(15,"div",20),S(16,"i",21),r(),a(17,"p",22),l(18," If there are completed transactions, to obtain payment and service fee, you need to download disbursement. "),r()()()()}if(t&2){let e=u();o(9),E("ngModel",e.downloadType),o(),d("value",!1),o(2),d("value",!0)}}function rt(t,s){t&1&&(a(0,"p",5),l(1," Select Disbursement date "),a(2,"span",23),l(3,"(payment date / order complete date)"),r(),l(4," of the channel you want to download (Max 1 Week). "),r())}function at(t,s){t&1&&(a(0,"p",5),l(1," Select transaction date of the channel you want to download (Max 2 Weeks) "),r())}function ot(t,s){if(t&1){let e=y();a(0,"div",12)(1,"app-timepicker",24),I("timeChange",function(i){m(e);let p=u();return P(p.startTime,i)||(p.startTime=i),c(i)}),g("timeChange",function(){m(e);let i=u();return c(i.onStartTimeChange())}),r(),a(2,"span",25),l(3,"-"),r(),a(4,"app-timepicker",24),I("timeChange",function(i){m(e);let p=u();return P(p.endTime,i)||(p.endTime=i),c(i)}),g("timeChange",function(){m(e);let i=u();return c(i.onEndTimeChange())}),r()()}if(t&2){let e=u();o(),E("time",e.startTime),o(3),E("time",e.endTime)}}var Je=(()=>{class t{constructor(){this.reset=O(!1),this.authService=v(ee),this.downloadService=v(A),this.downloadType=_(!1),this.selectedChannelId=_(null),this.channelOptions=_(this.authService.getChannels()),this.channelType=X,this.selectedChannel=_(null),this.showTimePicker=_(!1),this.startDate=_(null),this.endDate=_(null),this.startTime=_("00:00"),this.endTime=_("23:59"),this.filterData=new j,Q(()=>{this.reset()&&this.resetFilter()},{allowSignalWrites:!0})}resetFilter(){this.selectedChannelId.update(()=>null),this.startDate.update(()=>null),this.endDate.update(()=>null),this.startTime.update(()=>null),this.endTime.update(()=>null),this.downloadType.update(()=>!1),this.selectedChannel.update(()=>null),this.showTimePicker.update(()=>!1),this.channelDetail$=null}onSelectChannel(){this.selectedChannel.update(()=>this.channelOptions().find(e=>e.ID===this.selectedChannelId())),this.selectedChannel()?this.channelDetail$=this.downloadService.gerChannelDetailById(this.selectedChannelId()).pipe(U(e=>e?.Model),$(1)):this.channelDetail$=null,this.emitFilterData()}onFilterDateChange(){let e=1;this.startDate()&&this.endDate()&&(e=x.getDaysDiff(this.startDate(),this.endDate())),this.showTimePicker.update(()=>e==0),this.emitFilterData()}onDownloadTypeChange(){this.emitFilterData()}onStartTimeChange(){this.emitFilterData()}onEndTimeChange(){this.emitFilterData()}emitFilterData(){this.filterData.emit({channelId:this.selectedChannelId(),startDate:this.startDate(),endDate:this.endDate(),downloadType:this.downloadType(),startTime:this.startTime(),endTime:this.endTime()})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=M({type:t,selectors:[["filter-step"]],inputs:{reset:[1,"reset"]},outputs:{filterData:"onFilterChange"},features:[K([A])],decls:27,vars:11,consts:[["picker",""],[1,"row","pt-2",2,"width","63%","margin-right","40px"],[1,"col-12"],[1,"row"],[1,"col-6"],[1,"text-muted"],["appendTo","body","placeholder","Select Channel",3,"ngModelChange","clearable","ngModel"],[3,"value",4,"ngFor","ngForOf"],[1,"row","mt-6"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"mt-8"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"form-label-group","radio","download-type",2,"margin-bottom","0px"],["name","dowloadType",3,"ngModelChange","ngModel"],["matTooltip","Download from Create sales order until create logistics status",1,"me-5",3,"value"],["matTooltip","Download only Payment and write off",1,"me-5",3,"value"],[1,"d-flex","border","mb-4","pt-6","px-6","mt-3",2,"background","#1f87ac0a","border-radius","5px"],[1,"me-3","pt-1"],[1,"fa","fa-lightbulb","fs-5"],[1,"mb-6"],[1,"fw-bold"],[3,"timeChange","time"],[1,"mx-4"]],template:function(n,i){if(n&1){let p=y();a(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"h5"),l(5,"Select a Channel"),r(),a(6,"p",5),l(7,"Select Channel want to download order"),r()(),a(8,"div",4)(9,"ng-select",6),I("ngModelChange",function(f){return m(p),P(i.selectedChannelId,f)||(i.selectedChannelId=f),c(f)}),g("ngModelChange",function(){return m(p),c(i.onSelectChannel())}),w(10,it,3,3,"ng-option",7),r()()(),w(11,nt,19,3,"div",8),W(12,"async"),a(13,"div",8)(14,"div",4)(15,"h5"),l(16,"Date Range"),r(),w(17,rt,5,0,"p",5)(18,at,2,0,"p",5),r(),a(19,"div",4)(20,"div",2)(21,"mat-date-range-input",9)(22,"input",10),I("ngModelChange",function(f){return m(p),P(i.startDate,f)||(i.startDate=f),c(f)}),g("click",function(){m(p);let f=T(25);return c(f.open())}),r(),a(23,"input",11),I("ngModelChange",function(f){return m(p),P(i.endDate,f)||(i.endDate=f),c(f)}),g("click",function(){m(p);let f=T(25);return c(f.open())})("ngModelChange",function(){return m(p),c(i.onFilterDateChange())}),r()(),S(24,"mat-date-range-picker",null,0),r(),w(26,ot,5,2,"div",12),r()()()()}if(n&2){let p,h,f=T(25);o(9),d("clearable",!1),E("ngModel",i.selectedChannelId),o(),d("ngForOf",i.channelOptions()),o(),b((p=Y(12,9,i.channelDetail$))!=null&&p.ServiceFeeWriteOff&&((p=i.selectedChannel())==null?null:p.TypeID)==i.channelType.Tokopedia?11:-1),o(6),b(i.downloadType()&&((h=i.selectedChannel())==null?null:h.TypeID)==i.channelType.Tokopedia?17:18),o(4),d("rangePicker",f),o(),E("ngModel",i.startDate),o(),E("ngModel",i.endDate),o(3),b(i.showTimePicker()?26:-1)}},dependencies:[F,L,J,Ee,be,Te,ke,Fe,Oe,ye,Se,Ce,ve,He,Be,We,Ae,Re,Le],styles:[".vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}.mt-1rem[_ngcontent-%COMP%]{margin-top:1rem}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}.form-label-group.radio.download-type[_ngcontent-%COMP%]{height:45.5938px!important;border-radius:.375rem!important}"]})}}return t})();var D=function(t){return t.ALL="all",t.SYNC="sync",t.WRONG="wrong",t.UNSYNC="unsync",t}(D||{});var lt=(t,s)=>({"over-due-today":t,"over-due":s});function pt(t,s){if(t&1&&(a(0,"th",21),l(1),r()),t&2){let e=u();o(),C(" ",e.selectedChannel()?"Created Date":"Last Status Update"," ")}}function st(t,s){if(t&1&&(a(0,"td"),l(1),W(2,"date"),r()),t&2){let e=u().$implicit;o(),C(" ",_e(2,1,e.Modified,"dd MMM yyyy HH:mm:ss")," ")}}function dt(t,s){if(t&1&&(a(0,"span"),l(1),r()),t&2){let e=u().$implicit;o(),C(" ",e.ActionString," ")}}function mt(t,s){if(t&1&&(a(0,"li"),l(1),r()),t&2){let e=s.$implicit;o(),C(" ",e," ")}}function ct(t,s){if(t&1&&(a(0,"ul",27),w(1,mt,2,1,"li",22),r()),t&2){let e=u().$implicit;o(),d("ngForOf",e.ActionString)}}function ut(t,s){if(t&1&&(a(0,"span",28),S(1,"i",29),r()),t&2){let e=u().$implicit;de("title","Delivery : ",e.DeliveryState,`
2
2
  Payment : `,e.PaymentState,"")}}function ht(t,s){if(t&1&&(a(0,"tr")(1,"td"),l(2),r(),a(3,"td"),l(4),r(),w(5,st,3,4,"td",23),a(6,"td")(7,"span"),l(8),r(),l(9),r(),a(10,"td",24)(11,"span"),l(12),r(),l(13),r(),a(14,"td"),w(15,dt,2,1,"span",23)(16,ct,2,1,"ul",25),r(),a(17,"td"),w(18,ut,2,3,"span",26),r()()),t&2){let e,n=s.$implicit,i=s.index,p=u(2);o(2),V(i+1),o(2),V(n.Number),o(),d("ngIf",((e=p.selectedChannel())==null?null:e.TypeID)!=p.channelType.Shopee&&((e=p.selectedChannel())==null?null:e.TypeID)!==p.channelType.Tiktok),o(3),C("",n.ChannelStatus," - "),o(),C("",n.ChannelStatusDescription," "),o(),d("ngClass",fe(12,lt,(n==null?null:n.Action)==p.actionPreviewOrder.Update,(n==null?null:n.Action)==p.actionPreviewOrder.New))("matTooltip",n.POSStatus==91||n.POSStatusDescription=="Conflict"?"There is a missed status at POS, usually fulfillment has not been recorded but the payment has been recorded":""),o(2),C("",n.POSStatus," - "),o(),C("",n.POSStatusDescription," "),o(2),d("ngIf",n.ActionString.length==1),o(),d("ngIf",n.ActionString.length>1),o(2),d("ngIf",n.ChannelStatus!=99&&n.POSStatus!=99)}}function ft(t,s){if(t&1&&(k(0),w(1,ht,19,15,"tr",22),N()),t&2){let e=u();o(),d("ngForOf",e.displayPreviewData())}}function _t(t,s){t&1&&(a(0,"tr",30)(1,"td",31)(2,"div",32),S(3,"i",33),r(),a(4,"h4",34),l(5," There is no order to processed "),r()()())}var qe=(()=>{class t{constructor(){this.orderPreview=O(),this.selectedChannel=O(),this.channelType=X,this.allData=_(0),this.syncData=_(0),this.wrongData=_(0),this.unsyncData=_(0),this.pillStatus=_(D.ALL),this.actionPreviewOrder=G,this.previewStatus=D,this.displayPreviewData=_([]),this.exportOrders=new j,Q(()=>{this.orderPreview()&&(this.filterPreviewData(D.ALL),this.initLengthStatusData())},{allowSignalWrites:!0})}filterPreviewData(e){this.pillStatus.update(()=>e),this.displayPreviewData.update(()=>this.filterDataByStatus(e))}initLengthStatusData(){this.wrongData.update(()=>this.filterDataByStatus(D.WRONG).length),this.syncData.update(()=>this.filterDataByStatus(D.SYNC).length),this.allData.update(()=>this.orderPreview().length),this.unsyncData.update(()=>this.filterDataByStatus(D.UNSYNC).length)}filterDataByStatus(e){let n=[];switch(e){case D.ALL:n=this.orderPreview();break;case D.SYNC:n=this.orderPreview().filter(i=>i.Action==G.DoNothing);break;case D.WRONG:n=this.orderPreview().filter(i=>i.Action==G.Update);break;case D.UNSYNC:n=this.orderPreview().filter(i=>i.Action==G.New);break}return n}onExportOrders(){this.exportOrders.emit()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=M({type:t,selectors:[["preview-step"]],inputs:{orderPreview:[1,"orderPreview"],selectedChannel:[1,"selectedChannel"]},outputs:{exportOrders:"onExportOrders"},decls:41,vars:11,consts:[["EMPTY",""],[1,"row","pt-2"],[1,"col-md-12"],[1,"row","mx-1","mb-5"],[1,"col-12","d-flex","justify-content-between","align-items-end",2,"padding-left","0px","padding-right","0px"],[1,"nav","nav-pills"],[1,"nav-item","me-3"],[1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],[1,"nav-item","mx-3"],["matTooltip","All Invoice which is already available in POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["matTooltip","Invoices that have different status between marketplace and POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["matTooltip","Invoices which is not exist in POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["type","button",1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"table"],[1,"thead-light"],["width","1%"],["width","25%"],["width","15%",4,"ngIf"],["width","10%"],[4,"ngIf","ngIfElse"],["width","15%"],[4,"ngFor","ngForOf"],[4,"ngIf"],["matTooltipClass","custom-width-tooltip",3,"ngClass","matTooltip"],["class","ps-5",4,"ngIf"],[3,"title",4,"ngIf"],[1,"ps-5"],[3,"title"],[1,"fas","fa-info-circle","ms-2"],[1,"text-center"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"]],template:function(n,i){if(n&1){let p=y();a(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"div")(5,"ul",5)(6,"li",6)(7,"button",7),g("click",function(){return m(p),c(i.filterPreviewData(i.previewStatus.ALL))}),l(8),r()(),a(9,"li",8)(10,"button",9),g("click",function(){return m(p),c(i.filterPreviewData(i.previewStatus.SYNC))}),l(11),r()(),a(12,"li",8)(13,"button",10),g("click",function(){return m(p),c(i.filterPreviewData(i.previewStatus.WRONG))}),l(14),r()(),a(15,"li",8)(16,"button",11),g("click",function(){return m(p),c(i.filterPreviewData(i.previewStatus.UNSYNC))}),l(17),r()()()(),a(18,"div")(19,"button",12),g("click",function(){return m(p),c(i.onExportOrders())}),S(20,"i",13),a(21,"span"),l(22,"Export"),r()()()()(),a(23,"table",14)(24,"thead",15)(25,"tr"),S(26,"th",16),a(27,"th",17),l(28,"Number"),r(),w(29,pt,2,1,"th",18),a(30,"th",19),l(31,"Channel Status"),r(),a(32,"th",19),l(33,"POS Status"),r(),a(34,"th"),l(35,"Action"),r(),S(36,"th",16),r()(),a(37,"tbody"),w(38,ft,2,1,"ng-container",20)(39,_t,6,0,"ng-template",null,0,H),r()()()()}if(n&2){let p,h,f=T(40);o(7),d("ngClass",i.pillStatus()=="all"?"btn-secondary text-white":"btn-outline-dark"),o(),C(" All (",i.allData(),") "),o(2),d("ngClass",i.pillStatus()=="sync"?"btn-success":"btn-outline-success"),o(),C(" Existing (",i.syncData(),") "),o(2),d("ngClass",i.pillStatus()=="wrong"?"btn-warning text-white":"btn-outline-warning"),o(),C(" Wrong Status (",i.wrongData(),") "),o(2),d("ngClass",i.pillStatus()=="unsync"?"btn-danger":"btn-outline-danger"),o(),C(" Missing (",i.unsyncData(),") "),o(12),d("ngIf",((p=i.selectedChannel())==null?null:p.TypeID)!=i.channelType.Shopee&&((p=i.selectedChannel())==null?null:p.TypeID)!==i.channelType.Tiktok),o(9),d("ngIf",((h=i.displayPreviewData())==null?null:h.length)>0)("ngIfElse",f)}},dependencies:[F,R,L,B,q,Ie,Pe],encapsulation:2})}}return t})();var wt=["stepper"];function gt(t,s){t&1&&(a(0,"a",2),l(1," Download V1 "),r())}function St(t,s){if(t&1){let e=y();a(0,"div",3)(1,"button",20),g("click",function(){m(e);let i=u();return c(i.onStepperBack())}),l(2," Back "),r(),a(3,"button",21),g("click",function(){m(e);let i=u();return c(i.onNextStep())}),l(4," Next "),r()()}if(t&2){let e=u();o(3),d("disabled",e.disabledNextFilter())}}function Ct(t,s){if(t&1){let e=y();a(0,"button",22),g("click",function(){m(e);let i=u();return c(i.onNextStep())}),l(1," Next "),r()}if(t&2){let e=u();d("disabled",e.disabledNextFilter())}}function vt(t,s){if(t&1){let e=y();a(0,"button",23),g("click",function(){m(e);let i=u();return c(i.onNewDownload())}),S(1,"i",24),l(2," New "),r()}}function yt(t,s){t&1&&(S(0,"i",25),a(1,"span"),l(2,"Filter"),r())}function xt(t,s){t&1&&(S(0,"i",26),a(1,"span"),l(2,"Preview"),r())}function Dt(t,s){if(t&1){let e=y();k(0),a(1,"preview-step",27),g("onExportOrders",function(){m(e);let i=u();return c(i.onExportOrders())}),r(),N()}if(t&2){let e=s.ngIf;o(),d("orderPreview",e)}}function Tt(t,s){t&1&&(S(0,"i",28),a(1,"span"),l(2,"Finish"),r())}function bt(t,s){if(t&1&&(k(0),S(1,"complete-step",29),N()),t&2){let e=s.ngIf;o(),d("downloadResult",e)}}function Et(t,s){t&1&&(a(0,"h6"),l(1,"1"),r())}function Pt(t,s){t&1&&(a(0,"h6"),l(1,"2"),r())}function It(t,s){t&1&&(a(0,"h6"),l(1,"3"),r())}var $i=(()=>{class t{constructor(){this.downloadService=v(A),this.orderService=v(Ke),this.productService=v(Ne),this.authService=v(ee),this.stepperSelectedIndex=_(0),this.disabledNextFilter=_(!0),this.isResetFilter=_(!1),this.pageTitle=_("Download to POS"),this.cacheKey=_(x.GuidEMpty)}onFilterChange(e){this.filter=e,this.validateDisabledNext()}validateDisabledNext(){this.disabledNextFilter.update(()=>x.IsEmpty(this.filter?.channelId)||!x.isValidDate(this.filter.startDate)||!x.isValidDate(this.filter.endDate))}onNextStep(){switch(this.stepper.selectedIndex){case 0:this.onPreview();let e=this.productService.findChannelById(this.filter.channelId,this.authService.getChannels());this.setPageTitle(`Preview ${e?.Name}`);break;case 1:this.onDownload(),this.setPageTitle("Download");break}}onStepperNext(){this.stepper.selected.completed=!0,this.stepper.next()}onPreview(){let e={ID:this.filter.channelId,From:this.filter.startDate,To:this.filter.endDate,IsDisbursement:this.filter.downloadType};x.IsNotEmpty(this.filter.startTime)&&(e=re(ne({},e),{TimeFrom:this.filter.startTime+":00",TimeTo:this.filter.endTime+":00"})),this.orderPreview$=this.downloadService.onPreviewOrder(e).pipe(z(n=>{n.Data?.length>0&&(this.cacheKey.update(()=>n.CacheKey),this.onStepperNext())}),U(n=>n.Data),$(1))}onExportOrders(){let e={ID:this.filter.channelId,From:this.filter.startDate?JSON.stringify(this.filter.startDate):null,To:this.filter.endDate?JSON.stringify(this.filter.endDate):null},n=`Orders ${this.downloadService.getDateTitle(this.filter.startDate,this.filter.endDate)}`;this.orderService.exportOrders(e,n).subscribe()}onDownload(){let e={ID:this.filter.channelId,From:this.filter.startDate,To:this.filter.endDate,ListPreview:[],IsDisbursement:this.filter.downloadType,CacheKey:this.cacheKey()};this.downloadPreview$=this.orderPreview$.pipe(oe(n=>(e.ListPreview=n,this.downloadService.getDownloadOrder(e))),z(()=>{this.onStepperNext()}),$(1))}setPageTitle(e){this.pageTitle.update(()=>`
3
3
  ${e} (${this.downloadService.getDateTitle(this.filter.startDate,this.filter.endDate)})
4
4
  `)}onStepperBack(){this.stepper.previous(),this.pageTitle.update(()=>"Download to POS")}onNewDownload(){this.isResetFilter.update(()=>!0),this.stepper.reset(),this.stepperSelectedIndex.update(()=>0),this.orderPreview$=null,this.downloadPreview$=null,this.pageTitle.update(()=>"Download to POS")}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=M({type:t,selectors:[["app-download-v2"]],viewQuery:function(n,i){if(n&1&&me(wt,5),n&2){let p;ce(p=ue())&&(i.stepper=p.first)}},features:[K([A,{provide:$e,useValue:{displayDefaultIndicatorType:!1}}])],decls:27,vars:21,consts:[["stepper",""],[3,"hideSearchBox","hideSearchDropdown","headerTitle","description"],["routerLink","/menu/Order/Download/V1",1,"btn","btn-outline-secondary","btn-fill","me-3"],[1,"btn-group","me-3"],["type","button",1,"btn","btn-outline-secondary","btn-fill","me-3","bg-success","text-white",3,"disabled"],[1,"btn","btn-outline-secondary","btn-fill"],[1,"container-fluid","pt-5","mt-5"],[1,"row"],[1,"col-12"],[1,"d-flex","justify-content-center"],["linear","",1,"w-100","stepper-download",3,"selectedIndexChange","ngClass","selectedIndex"],["state","filter",3,"completed","editable"],["matStepLabel",""],[1,"w-100",3,"onFilterChange","reset"],["state","preview",3,"editable","completed"],[4,"ngIf"],["state","finish"],["matStepperIcon","filter"],["matStepperIcon","preview"],["matStepperIcon","finish"],[1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-outline-secondary","bg-success","text-white",3,"click","disabled"],["type","button",1,"btn","btn-outline-secondary","btn-fill","me-3","bg-success","text-white",3,"click","disabled"],[1,"btn","btn-outline-secondary","btn-fill",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],[1,"fa-solid","fa-filter","me-3"],[1,"fa-solid","fa-file","me-3"],[3,"onExportOrders","orderPreview"],[1,"fa-solid","fa-flag","me-3"],[3,"downloadResult"]],template:function(n,i){if(n&1){let p=y();a(0,"mainpanel",1)(1,"actions"),w(2,gt,2,0,"a",2)(3,St,5,1,"div",3)(4,Ct,2,1,"button",4)(5,vt,3,0,"button",5),r(),a(6,"content")(7,"div",6)(8,"div",7)(9,"div",8)(10,"div",9)(11,"mat-stepper",10,0),I("selectedIndexChange",function(f){return m(p),P(i.stepperSelectedIndex,f)||(i.stepperSelectedIndex=f),c(f)}),a(13,"mat-step",11),w(14,yt,3,0,"ng-template",12),a(15,"filter-step",13),g("onFilterChange",function(f){return m(p),c(i.onFilterChange(f))}),r()(),a(16,"mat-step",14),w(17,xt,3,0,"ng-template",12)(18,Dt,2,1,"ng-container",15),W(19,"async"),r(),a(20,"mat-step",16),w(21,Tt,3,0,"ng-template",12)(22,bt,2,1,"ng-container",15),W(23,"async"),r(),w(24,Et,2,0,"ng-template",17)(25,Pt,2,0,"ng-template",18)(26,It,2,0,"ng-template",19),r()()()()()()()}if(n&2){let p=T(12);d("hideSearchBox",!0)("hideSearchDropdown",!0)("headerTitle",i.pageTitle())("description",i.pageTitle()),o(2),b(i.stepperSelectedIndex()==0?2:-1),o(),b(i.stepperSelectedIndex()==1?3:-1),o(),b(i.stepperSelectedIndex()==0?4:-1),o(),b(i.stepperSelectedIndex()==2?5:-1),o(6),se("ngClass","last-edited-step-"+p.selectedIndex),E("selectedIndex",i.stepperSelectedIndex),o(2),d("completed",!1)("editable",i.stepperSelectedIndex()!=2),o(2),d("reset",i.isResetFilter()),o(),d("editable",i.stepperSelectedIndex()!=2)("completed",!1),o(2),d("ngIf",Y(19,17,i.orderPreview$)),o(4),d("ngIf",Y(23,19,i.downloadPreview$))}},dependencies:[F,R,B,J,Qe,Je,qe,je,Ge,ze,Ue,Ye,Ve,Me,ge,we],styles:[`@import"https://fonts.googleapis.com/icon?family=Material+Icons";.vertical-radio{display:flex;flex-direction:column;margin:15px 0}.mt-1rem{margin-top:1rem}.dateRange{padding-top:.8rem;padding-bottom:.8rem}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container{position:relative;width:60%;left:18%}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container>div.mat-horizontal-stepper-content:nth-child(1){display:flex;justify-content:left}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container{margin-top:30px}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container>mat-step-header.mat-horizontal-stepper-header{pointer-events:none!important}.form-label-group.radio.download-type{height:45.5938px!important;border-radius:.375rem!important}
@@ -1 +1 @@
1
- import{b as Qt}from"./chunk-K64ATXFK.js";import{a as Xt,b as Jt}from"./chunk-YQSHLQDX.js";import"./chunk-OVYL7SOO.js";import{b as Wt}from"./chunk-VGXNA5KN.js";import"./chunk-KII7SEQ6.js";import"./chunk-B5JAZPVU.js";import{a as Yt,b as Ht}from"./chunk-RNWWVG3M.js";import"./chunk-OS53H77X.js";import{a as $t,b as Lt}from"./chunk-5BTJTFLF.js";import{a as ct,b as Rt,c as Bt,d as mt,e as pt}from"./chunk-6ZT6G6ZX.js";import"./chunk-T7KM2WP6.js";import"./chunk-VOISFPEM.js";import"./chunk-WNAVUGZ4.js";import{a as jt}from"./chunk-UOAYF4SW.js";import"./chunk-EXFL3GUX.js";import"./chunk-BSATGCWC.js";import"./chunk-6A4PYMCJ.js";import"./chunk-3RK6DDJD.js";import{a as Gt}from"./chunk-67USXWWF.js";import"./chunk-E24BKGBJ.js";import"./chunk-VKJAFLQ6.js";import"./chunk-TY4H2W6F.js";import"./chunk-VYKDVKG3.js";import"./chunk-SDUUFQUI.js";import"./chunk-HPS3WVU5.js";import"./chunk-R5IDWUP6.js";import"./chunk-4RAOUTR2.js";import{d as L,e as R}from"./chunk-TTAS23MO.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import"./chunk-7CIOGSCS.js";import{e as et}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{l as Ut,m as Vt}from"./chunk-XOT2SZPE.js";import{r as Mt,s as Dt}from"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{c as K,e as lt,h as V,i as Y,l as ft,m as Et,n as H,p as X,q as Nt,r as J,s as Pt,t as kt,u as Ot,x as Q,y as tt,z as $}from"./chunk-AI4XRCAL.js";import{b as wt,c as h}from"./chunk-W6T7TOHE.js";import{g as U,j as T,n as S}from"./chunk-B6POIFQM.js";import{Eb as v,Ec as _,Fc as rt,Gc as q,Ic as It,Jc as Ft,K as Tt,Ka as P,Kb as f,Kc as At,M as St,Mc as x,Na as _t,Nc as at,Wb as m,Xc as b,Yc as y,Z,bc as g,cc as k,ea as A,ec as O,fc as w,gc as p,hc as l,ic as d,ja as E,jc as M,kc as D,mc as W,pa as u,qb as s,rc as I,sc as r,v as F,xa as N,ya as G,za as j}from"./chunk-EIQCOZF5.js";import"./chunk-K2H6WANG.js";var z=function(e){return e[e.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",e[e.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",e[e.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",e[e.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",e[e.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",e}(z||{});var it=function(e){return e[e.FORMAT_NORMAL=1]="FORMAT_NORMAL",e[e.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",e}(it||{});var ht=(()=>{class e{constructor(){this.shopeeUploadService=u(ct),this.formBuilder=u(Q)}getAttributes(t){return this.shopeeUploadService.getAttributes(t.channelId,t.categoryId).pipe(F(i=>this.setLabelToIndonesian(i)))}setLabelToIndonesian(t=[]){let i,n;return t=t.map(o=>(i=o?.multi_lang?.find(a=>a.language=="id"),o.attribute_value_list=o?.attribute_value_list?.map(a=>(n=a?.multi_lang?.find(C=>C.language=="id"),a.name=n?.value,a)),o.name=i?.value?i?.value:o.name,o)),t}createFormGroup(t){let i=this.formBuilder.group({}),n=[];return t.forEach(o=>{if(n=[],o.mandatory&&n.push(lt.required),o?.attribute_info?.format_type==it.FORMAT_QUANTITATIVE_WITH_UNIT&&o?.attribute_info?.input_type==z.FREE_TEXT_FILED){let a=this.formBuilder.group({unit:new ft(null),value:new ft(null,n)});i.addControl(JSON.stringify(o.attribute_id),a)}else i.addControl(JSON.stringify(o.attribute_id),this.formBuilder.control(null,n))}),i}getFilteredAttributes(t,i){let n=JSON.parse(JSON.stringify(t)),o=Object.keys(i),a=n.filter(C=>o.findIndex(dt=>parseInt(dt)==C.attribute_id||C.mandatory)!=-1);return a=this.filterSelectedAttributes(a,i),a}filterSelectedAttributes(t,i){return t.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(a=>i[o.attribute_id]?.findIndex(C=>C==a.value_id)!=-1):o.attribute_value_list=[];break;case z.FREE_TEXT_FILED:o.attribute_info.format_type==it.FORMAT_QUANTITATIVE_WITH_UNIT?o.attribute_value_list=this.setSelectedQuantitativeAttr(i[o.attribute_id]?.value,i[o.attribute_id]?.unit):h.IsNotEmpty(i[o.attribute_id])&&(o.attribute_value_list=[{value_id:0,name:i[o.attribute_id]}]);break;default:o.attribute_value_list=o.attribute_value_list.filter(a=>a.value_id==i[o.attribute_id])}return o}).filter(o=>o?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(t,i){let n=[];return h.IsNotEmpty(t)&&(n=[{value_id:0,original_value_name:JSON.stringify(t),value_unit:i}]),n}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();var Ct=function(e){return e[e.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",e[e.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",e[e.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",e[e.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",e[e.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",e}(Ct||{});var gt=()=>[];function ee(e,c){e&1&&(p(0,"span",5),_(1,"*"),l())}function ie(e,c){if(e&1&&d(0,"ng-select",6),e&2){let t=r().$implicit;m("multiple",!0)("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:at(4,gt))("placeholder","Pilih "+(t==null?null:t.name))}}function oe(e,c){if(e&1&&d(0,"input",8),e&2){let t=r(2).$implicit;m("formControlName",t.attribute_id)("placeholder","Isi "+(t==null?null:t.name))}}function ne(e,c){if(e&1&&(p(0,"option",15),_(1),l()),e&2){let t=c.$implicit;m("value",t),s(),rt(t)}}function re(e,c){if(e&1&&(p(0,"div",10),d(1,"input",12),p(2,"select",13)(3,"option",14),_(4,"Unit"),l(),O(5,ne,2,2,"option",15,k),l()()),e&2){let t=r(3).$implicit;m("formGroupName",t.attribute_id),s(),m("placeholder","Isi "+(t==null?null:t.name)),s(2),m("value",null),s(2),w(t==null||t.attribute_info==null?null:t.attribute_info.attribute_unit_list)}}function ae(e,c){if(e&1&&d(0,"input",11),e&2){let t=r(3).$implicit;m("formControlName",t.attribute_id)("placeholder","Isi "+(t==null?null:t.name))}}function le(e,c){if(e&1&&f(0,re,7,3,"div",10)(1,ae,1,2,"input",11),e&2){let t=r(2).$implicit,i=r(2);g((t==null||t.attribute_info==null?null:t.attribute_info.format_type)==i.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function ce(e,c){if(e&1&&d(0,"datepicker",9),e&2){let t=r(2).$implicit;m("formControlName",t.attribute_id)}}function me(e,c){if(e&1&&f(0,oe,1,2,"input",8)(1,le,2,1)(2,ce,1,1,"datepicker",9),e&2){let t,i=r().$implicit,n=r(2);g((t=i==null||i.attribute_info==null?null:i.attribute_info.input_validation_type)===n.validationType.VALIDATOR_STRING_TYPE?0:t===n.validationType.VALIDATOR_FLOAT_TYPE?1:t===n.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function pe(e,c){if(e&1&&d(0,"ng-select",7),e&2){let t=r().$implicit;m("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:at(3,gt))("placeholder","Pilih "+(t==null?null:t.name))}}function se(e,c){if(e&1&&d(0,"ng-select",7),e&2){let t=r().$implicit;m("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:at(3,gt))("placeholder","Pilih "+(t==null?null:t.name))}}function ue(e,c){if(e&1&&(p(0,"div",3)(1,"div",4),f(2,ee,2,0,"span",5),p(3,"span"),_(4),l()(),f(5,ie,1,5,"ng-select",6)(6,me,3,1)(7,pe,1,4,"ng-select",7)(8,se,1,4,"ng-select",7),l()),e&2){let t,i=c.$implicit,n=r(2);s(2),g(i.mandatory?2:-1),s(2),q(" ",i==null?null:i.name," "),s(),g((t=i==null||i.attribute_info==null?null:i.attribute_info.input_type)===n.inputType.MULTI_COMBO_BOX?5:t===n.inputType.FREE_TEXT_FILED?6:t===n.inputType.SINGLE_COMBO_BOX?7:8)}}function de(e,c){if(e&1&&(M(0),p(1,"form",1)(2,"div",2),O(3,ue,9,3,"div",3,k),l()(),D()),e&2){let t=c.ngIf,i=r();s(),m("formGroup",i.form),s(2),w(t)}}var qt=(()=>{class e{constructor(){this.formCategoryService=u(ht),this.attributesChanges=new P,this.inputType=z,this.formatType=it,this.validationType=Ct}ngOnChanges(){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:this.categoryId,channelId:this.channelId,channelType:this.channelType}).pipe(A(t=>{this.form=this.formCategoryService.createFormGroup(t),this.listenToFormChange(t)}),Z(1)))}listenToFormChange(t){let i=[];this.formSubscription=this.form.valueChanges.subscribe(n=>{i=this.formCategoryService.getFilteredAttributes(t,n),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["shopee-attribute-form"]],inputs:{channelType:"channelType",categoryId:"categoryId",channelId:"channelId",channelProductUpload:"channelProductUpload"},outputs:{attributesChanges:"attributesChanges"},features:[x([ht]),N],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&&(f(0,de,5,1,"ng-container",0),b(1,"async")),i&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,U,T,R,L,$,H,kt,Ot,K,Pt,V,Y,X,J,Nt,jt,Jt,Xt],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 e})();var bt=(()=>{class e{constructor(){this.httpService=u(et),this.formBuilder=u(Q),this.uploadProductService=u(pt)}getAttributes(t,i){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:i}]).pipe(Tt(o=>this.uploadProductService.selectedProduct$.pipe(F(a=>(o=this.mappingAttributeSalesProperty(o,a),o)))))}mappingAttributeSalesProperty(t,i){let n=0;return t.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(t){let i=!1,n=[];return t.forEach(o=>{o.Variants&&n.push(o.Variants.length)}),i=n.some(o=>o>1),i}createFormGroup(t){let i=this.formBuilder.group({}),n=[];return t.forEach(o=>{n=[],o.is_required&&n.push(lt.required),i.addControl(o.id,this.formBuilder.control(null,n))}),i}getFilteredAttributes(t,i){let n=JSON.parse(JSON.stringify(t)),o=Object.keys(i),a=n.filter(C=>o.findIndex(dt=>parseInt(dt)==C.id)!=-1);return a=this.filterSelectedAttributes(a,i),a}filterSelectedAttributes(t,i){return t.map(o=>(h.IsNotEmpty(o.values)?o.is_multiple_selection?o.values=o.values.filter(a=>i[o.id]?.includes(a.id)):o.values=o.values.filter(a=>a.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||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();function _e(e,c){e&1&&(p(0,"span",5),_(1,"*"),l())}function fe(e,c){if(e&1&&d(0,"ng-select",6),e&2){let t=r().$implicit;m("multiple",!0)("formControlName",t.id)("items",t.values)("placeholder","Pilih "+(t==null?null:t.name))}}function he(e,c){if(e&1&&d(0,"ng-select",7),e&2){let t=r().$implicit;m("formControlName",t.id)("items",t.values)("placeholder","Pilih "+(t==null?null:t.name))}}function Ce(e,c){if(e&1&&d(0,"input",8),e&2){let t=r().$implicit;m("formControlName",t.id)("placeholder",t==null?null:t.name)}}function ge(e,c){if(e&1&&(p(0,"small",5),_(1),l()),e&2){let t=r().$implicit;s(),q(" ",t==null?null:t.name," is mandatory ")}}function be(e,c){if(e&1&&(p(0,"div",3)(1,"div",4),f(2,_e,2,0,"span",5),p(3,"span"),_(4),l()(),f(5,fe,1,4,"ng-select",6)(6,he,1,3,"ng-select",7)(7,Ce,1,2,"input",8)(8,ge,2,1,"small",5),l()),e&2){let t=c.$implicit;s(2),g(t.is_required?2:-1),s(2),q(" ",t==null?null:t.name," "),s(),g(t.is_multiple_selection?5:t.values!==null&&t.values.length>0?6:7),s(3),g(t.is_required?8:-1)}}function ye(e,c){if(e&1&&(M(0),p(1,"form",1)(2,"div",2),O(3,be,9,4,"div",3,k),l()(),D()),e&2){let t=c.ngIf,i=r();s(),m("formGroup",i.form),s(2),w(t)}}var zt=(()=>{class e{constructor(){this.tiktokAttributeFormService=u(bt),this.attributesChanges=new P}ngOnChanges(){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(this.channelId,this.categoryId).pipe(F(t=>t.filter(i=>!(i.type=="PRODUCT_PROPERTY"&&(h.IsEmpty(i.values)||i.values?.length==0)&&i.is_customizable==!1))),A(t=>{this.form=this.tiktokAttributeFormService.createFormGroup(t),this.listenToFormChange(t)}),Z(1)))}listenToFormChange(t){let i=[];this.formSubscription=this.form.valueChanges.subscribe(n=>{i=this.tiktokAttributeFormService.getFilteredAttributes(t,n),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["tiktok-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[x([bt]),N],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","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&&(f(0,ye,5,1,"ng-container",0),b(1,"async")),i&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,U,T,R,L,$,H,K,V,Y,X,J,tt],encapsulation:2})}}return e})();var yt=(()=>{class e{constructor(){this.woocommerceUploadService=u(mt)}getAttributes(t,i){return this.woocommerceUploadService.getAttributes(t,i).pipe(F(n=>n.map(o=>({key:o.name,label:o.name}))))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();var Zt=(()=>{class e{constructor(){this.wooAttributeFormService=u(yt),this.channelId=_t(),this.categoryId=_t(),this.attributesChanges=new P}ngOnChanges(){h.IsNotEmpty(this.categoryId())&&h.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(t){this.attributesChanges.emit([t.key])}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[x([yt]),N],decls:6,vars:3,consts:[[1,"row"],[1,"col-6"],[1,"mb-1"],["bindLabel","label","bindValue","id","placeholder","Pilih Atribut",3,"change","items"]],template:function(i,n){i&1&&(p(0,"div",0)(1,"div",1)(2,"div",2),_(3,"Atribut"),l(),p(4,"ng-select",3),b(5,"async"),I("change",function(a){return n.onSelectAttribute(a)}),l()()()),i&2&&(s(4),m("items",y(5,1,n.attributes$)))},dependencies:[S,T,tt,R,L,$],encapsulation:2})}}return e})();var vt=(()=>{class e{constructor(){this.httpService=u(et),this.formBuilder=u(Q)}getAttributes(t,i){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:i}]).pipe(F(o=>o))}createFormGroup(t){let i=this.formBuilder.group({});return t.forEach(n=>{i.addControl(n.variant,this.formBuilder.control(null))}),i}convertAttributes(t={}){return Object.values(t).filter(n=>n!==null).map(n=>JSON.stringify(n))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();function ve(e,c){if(e&1&&(p(0,"div",3)(1,"div",4),_(2),l(),d(3,"ng-select",5),l()),e&2){let t=c.$implicit;s(2),q(" ",t==null?null:t.variant," "),s(),m("formControlName",t.variant)("items",t.values)("placeholder","Pilih "+(t==null?null:t.variant))}}function xe(e,c){if(e&1&&(M(0),p(1,"form",1)(2,"div",2),O(3,ve,4,4,"div",3,k),l()(),D()),e&2){let t=c.ngIf,i=r();s(),m("formGroup",i.form),s(2),w(t)}}var Kt=(()=>{class e{constructor(){this.tokpedAttrFormService=u(vt),this.attributesChanges=new P}ngOnInit(){}ngOnChanges(t){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(this.channelId,this.categoryId).pipe(A(i=>{this.form=this.tokpedAttrFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){let t=[];this.formSubscription=this.form.valueChanges.subscribe(i=>{t=this.tokpedAttrFormService.convertAttributes(i),this.attributesChanges.emit(t)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[x([vt]),N],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&&(f(0,xe,5,1,"ng-container",0),b(1,"async")),i&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,U,T,R,L,$,H,V,Y,X,J],encapsulation:2})}}return e})();var xt=(()=>{class e{constructor(){this.httpService=u(et),this.formBuilder=u(Q)}getAttributes(t){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:t}]).pipe(A(n=>(n.Options.StatusOptions=n.Options.Status.map(o=>({id:o,name:o})),n)))}createFormGroup(t){let i=this.formBuilder.group({});return Object.keys(t.Attribute).forEach(o=>{i.addControl(o,this.formBuilder.control(null))}),i}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();function Te(e,c){if(e&1&&(M(0),p(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4),_(5," Brand "),l(),d(6,"input",5),l(),p(7,"div",6)(8,"div",4),_(9," Product Type "),l(),d(10,"input",7),l(),p(11,"div",6)(12,"div",4),_(13," Status "),l(),d(14,"ng-select",8),l()()(),D()),e&2){let t=c.ngIf,i=r();s(),m("formGroup",i.form),s(13),m("items",t.Options.StatusOptions)}}var te=(()=>{class e{constructor(){this.attributesChanges=new P,this.shopifyFormService=u(xt)}ngOnChanges(t){t.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId).pipe(A(i=>{this.form=this.shopifyFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(St(500)).subscribe(t=>{this.attributesChanges.emit([t])})}ngOnDestroy(){this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["shopify-attribute-form"]],inputs:{channelId:"channelId"},outputs:{attributesChanges:"attributesChanges"},features:[x([xt]),N],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&&(f(0,Te,15,2,"ng-container",0),b(1,"async")),i&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,U,T,$,H,K,V,Y,X,J,R,L],encapsulation:2})}}return e})();function Se(e,c){if(e&1&&(p(0,"div",6),d(1,"app-product-card",9),l()),e&2){let t=c.$implicit;s(),m("productId",t==null?null:t.ID)("title",t==null?null:t.Name)("image",t==null?null:t.ThumbnailUrl)("description",(t==null||t.Variants==null?null:t.Variants.length)>1?(t==null||t.Variants==null?null:t.Variants.length)+" Variants":null)("imageForZoom",t==null?null:t.ImageUrl)("code",t==null||t.Variants[0]==null?null:t.Variants[0].Code)("showFooter",!1)}}function Ie(e,c){if(e&1){let t=W();M(0),p(1,"mat-checkbox",21),At("ngModelChange",function(n){G(t);let o=r().$implicit;return Ft(o.selected,n)||(o.selected=n),j(n)}),I("ngModelChange",function(){let n=G(t).ngIf,o=r(),a=o.$implicit,C=o.$index,ot=r();return j(ot.onSelectChannel(a,C,n))}),l(),D()}if(e&2){let t=r().$implicit;s(),It("ngModel",t.selected)}}function Fe(e,c){if(e&1&&(p(0,"div",18),d(1,"input",22),l()),e&2){let t=r().$implicit,i=r();m("matTooltip",t.type==i.channelType.Shopify?"Cannot change category, please change category in admin.shopify.com":t.type==i.channelType.Plugo?"You can change the category after the product has been uploaded to the Plugo Dashboard.":"")}}function Ae(e,c){if(e&1){let t=W();p(0,"app-channel-category-select",23),I("selectedCategory",function(n){G(t);let o=r().$index,a=r();return j(a.onCategoryChange(o,n))}),l()}if(e&2){let t=r().$implicit,i=r();m("disabled",!t.selected||t.selected&&t.type==i.channelType.Lazada)("channelId",t.id)("channelType",t.type)("categoryId",t.categoryId)}}function Ee(e,c){if(e&1){let t=W();p(0,"shopee-attribute-form",27),I("attributesChanges",function(n){G(t);let o=r(2).$index,a=r();return j(a.onAttributesChange(o,n))}),l()}if(e&2){let t=r(2).$implicit;m("categoryId",t.categoryId)("channelId",t.id)("channelType",t.type)}}function Ne(e,c){if(e&1){let t=W();p(0,"tiktok-attribute-form",28),I("attributesChanges",function(n){G(t);let o=r(2).$index,a=r();return j(a.onAttributesChange(o,n))}),l()}if(e&2){let t=r(2).$implicit;m("categoryId",t.categoryId)("channelId",t.id)}}function Pe(e,c){if(e&1){let t=W();p(0,"wooocommerce-attribute-form",28),I("attributesChanges",function(n){G(t);let o=r(2).$index,a=r();return j(a.onAttributesChange(o,n))}),l()}if(e&2){let t=r(2).$implicit;m("categoryId",t.categoryId)("channelId",t.id)}}function ke(e,c){if(e&1){let t=W();p(0,"tokopedia-attribute-form",28),I("attributesChanges",function(n){G(t);let o=r(2).$index,a=r();return j(a.onAttributesChange(o,n))}),l()}if(e&2){let t=r(2).$implicit;m("categoryId",t.categoryId)("channelId",t.id)}}function Oe(e,c){if(e&1&&(p(0,"div",20)(1,"div",24),f(2,Ee,1,3,"shopee-attribute-form",25)(3,Ne,1,2,"tiktok-attribute-form",26)(4,Pe,1,2,"wooocommerce-attribute-form",26)(5,ke,1,2,"tokopedia-attribute-form",26),l()()),e&2){let t,i=r().$implicit,n=r();s(2),g((t=i.type)===n.channelType.Shopee?2:t===n.channelType.Tiktok?3:t===n.channelType.WooCommerce?4:t===n.channelType.Tokopedia?5:-1)}}function we(e,c){if(e&1){let t=W();p(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",29),I("attributesChanges",function(n){G(t);let o=r().$index,a=r();return j(a.onAttributesChange(o,n))}),l()()()}if(e&2){let t=r().$implicit;s(2),m("channelId",t.id)}}function Me(e,c){if(e&1&&(p(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),f(6,Ie,2,1,"ng-container",14),b(7,"async"),l(),p(8,"div"),d(9,"app-channel-logo",15),l(),p(10,"div",16)(11,"span"),_(12),l()()()(),p(13,"div",12)(14,"div",17),f(15,Fe,2,1,"div",18)(16,Ae,1,4,"app-channel-category-select",19),l()()(),f(17,Oe,6,1,"div",20)(18,we,3,1,"div",20),l()()),e&2){let t=c.$implicit,i=r();s(6),m("ngIf",y(7,8,i.defaultCategories$)),s(3),m("typeId",t.type)("showChannelName",!1),s(),m("matTooltip",t.name)("matTooltipShowDelay",2500),s(2),rt(t.name),s(3),g(t.type==i.channelType.Shopify||t.type==i.channelType.Plugo?15:16),s(2),g(t.categoryId&&i.channelType.Lazada!=t.type&&t.selected?17:i.channelType.Shopify==t.type&&t.selected?18:-1)}}var zo=(()=>{class e{constructor(){this.uploadProductService=u(pt),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=wt,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(Z(1))}onCategoryChange(t,i){this.channelProductUploads.update(n=>n.map((o,a)=>(a==t&&(o.categoryId=i,o.attributes=[]),o)))}onAttributesChange(t,i){this.channelProductUploads.update(n=>n.map((o,a)=>(a==t&&(o.attributes=i),o)))}onSelectChannel(t,i,n){this.channelProductUploads.update(o=>o.map((a,C)=>{if(C==i&&t.selected){let ot=this.findCategoryByChannelId(t.id,n);a.categoryId=ot?.DefaultCategoryID}return C==i&&!t.selected&&(a.categoryId=null),a}))}findCategoryByChannelId(t,i){return i.find(n=>n.ID===t)}onUploadProduct(){this.uploadProductService.onUploadProduct(this.channelProductUploads())}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["app-product-upload"]],features:[x([ct,Rt,Bt,mt])],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","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(i,n){if(i&1&&(p(0,"mainpanel",0)(1,"actions")(2,"button",1),I("click",function(){return n.onUploadProduct()}),d(3,"i",2),_(4," Upload "),l()(),p(5,"content")(6,"div",3)(7,"h3",4),_(8,"Product To Upload"),l(),p(9,"div",5),O(10,Se,2,7,"div",6,k),b(12,"async"),l(),p(13,"h3",7),_(14,"Channel To Upload"),l(),O(15,Me,19,10,"div",8,k),l()()()),i&2){let o;m("hideSearchBox",!0)("hideSearchDropdown",!0),s(2),m("disabled",((o=n.channelProductUploads())==null?null:o.length)==0),s(8),w(y(12,3,n.selectedProducts$)),s(5),w(n.channelProductUploads())}},dependencies:[S,U,T,Wt,Vt,Ut,Ht,Yt,Lt,$t,tt,V,Et,Dt,Mt,qt,zt,Zt,Kt,te,Gt,Qt],encapsulation:2})}}return e})();export{zo as ProductUploadComponent};
1
+ import{b as Qt}from"./chunk-K64ATXFK.js";import{a as Xt,b as Jt}from"./chunk-YQSHLQDX.js";import"./chunk-OVYL7SOO.js";import{b as Wt}from"./chunk-VGXNA5KN.js";import"./chunk-KII7SEQ6.js";import"./chunk-B5JAZPVU.js";import{a as Yt,b as Ht}from"./chunk-RNWWVG3M.js";import"./chunk-OS53H77X.js";import{a as $t,b as Lt}from"./chunk-5BTJTFLF.js";import{a as ct,b as Rt,c as Bt,d as mt,e as pt}from"./chunk-OPZWOT5F.js";import"./chunk-T7KM2WP6.js";import"./chunk-VOISFPEM.js";import"./chunk-WNAVUGZ4.js";import{a as jt}from"./chunk-UOAYF4SW.js";import"./chunk-EXFL3GUX.js";import"./chunk-BSATGCWC.js";import"./chunk-6A4PYMCJ.js";import"./chunk-3RK6DDJD.js";import{a as Gt}from"./chunk-67USXWWF.js";import"./chunk-E24BKGBJ.js";import"./chunk-VKJAFLQ6.js";import"./chunk-TY4H2W6F.js";import"./chunk-VYKDVKG3.js";import"./chunk-SDUUFQUI.js";import"./chunk-HPS3WVU5.js";import"./chunk-R5IDWUP6.js";import"./chunk-4RAOUTR2.js";import{d as L,e as R}from"./chunk-TTAS23MO.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import"./chunk-4Y3XPT4V.js";import{e as et}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{l as Ut,m as Vt}from"./chunk-XOT2SZPE.js";import{r as Mt,s as Dt}from"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{c as K,e as lt,h as V,i as Y,l as ft,m as Et,n as H,p as X,q as Nt,r as J,s as Pt,t as kt,u as Ot,x as Q,y as tt,z as $}from"./chunk-AI4XRCAL.js";import{b as wt,c as h}from"./chunk-W6T7TOHE.js";import{g as U,j as T,n as S}from"./chunk-B6POIFQM.js";import{Eb as v,Ec as _,Fc as rt,Gc as q,Ic as It,Jc as Ft,K as Tt,Ka as P,Kb as f,Kc as At,M as St,Mc as x,Na as _t,Nc as at,Wb as m,Xc as b,Yc as y,Z,bc as g,cc as k,ea as A,ec as O,fc as w,gc as p,hc as l,ic as d,ja as E,jc as M,kc as D,mc as W,pa as u,qb as s,rc as I,sc as r,v as F,xa as N,ya as G,za as j}from"./chunk-EIQCOZF5.js";import"./chunk-K2H6WANG.js";var z=function(e){return e[e.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",e[e.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",e[e.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",e[e.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",e[e.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",e}(z||{});var it=function(e){return e[e.FORMAT_NORMAL=1]="FORMAT_NORMAL",e[e.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",e}(it||{});var ht=(()=>{class e{constructor(){this.shopeeUploadService=u(ct),this.formBuilder=u(Q)}getAttributes(t){return this.shopeeUploadService.getAttributes(t.channelId,t.categoryId).pipe(F(i=>this.setLabelToIndonesian(i)))}setLabelToIndonesian(t=[]){let i,n;return t=t.map(o=>(i=o?.multi_lang?.find(a=>a.language=="id"),o.attribute_value_list=o?.attribute_value_list?.map(a=>(n=a?.multi_lang?.find(C=>C.language=="id"),a.name=n?.value,a)),o.name=i?.value?i?.value:o.name,o)),t}createFormGroup(t){let i=this.formBuilder.group({}),n=[];return t.forEach(o=>{if(n=[],o.mandatory&&n.push(lt.required),o?.attribute_info?.format_type==it.FORMAT_QUANTITATIVE_WITH_UNIT&&o?.attribute_info?.input_type==z.FREE_TEXT_FILED){let a=this.formBuilder.group({unit:new ft(null),value:new ft(null,n)});i.addControl(JSON.stringify(o.attribute_id),a)}else i.addControl(JSON.stringify(o.attribute_id),this.formBuilder.control(null,n))}),i}getFilteredAttributes(t,i){let n=JSON.parse(JSON.stringify(t)),o=Object.keys(i),a=n.filter(C=>o.findIndex(dt=>parseInt(dt)==C.attribute_id||C.mandatory)!=-1);return a=this.filterSelectedAttributes(a,i),a}filterSelectedAttributes(t,i){return t.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(a=>i[o.attribute_id]?.findIndex(C=>C==a.value_id)!=-1):o.attribute_value_list=[];break;case z.FREE_TEXT_FILED:o.attribute_info.format_type==it.FORMAT_QUANTITATIVE_WITH_UNIT?o.attribute_value_list=this.setSelectedQuantitativeAttr(i[o.attribute_id]?.value,i[o.attribute_id]?.unit):h.IsNotEmpty(i[o.attribute_id])&&(o.attribute_value_list=[{value_id:0,name:i[o.attribute_id]}]);break;default:o.attribute_value_list=o.attribute_value_list.filter(a=>a.value_id==i[o.attribute_id])}return o}).filter(o=>o?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(t,i){let n=[];return h.IsNotEmpty(t)&&(n=[{value_id:0,original_value_name:JSON.stringify(t),value_unit:i}]),n}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();var Ct=function(e){return e[e.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",e[e.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",e[e.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",e[e.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",e[e.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",e}(Ct||{});var gt=()=>[];function ee(e,c){e&1&&(p(0,"span",5),_(1,"*"),l())}function ie(e,c){if(e&1&&d(0,"ng-select",6),e&2){let t=r().$implicit;m("multiple",!0)("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:at(4,gt))("placeholder","Pilih "+(t==null?null:t.name))}}function oe(e,c){if(e&1&&d(0,"input",8),e&2){let t=r(2).$implicit;m("formControlName",t.attribute_id)("placeholder","Isi "+(t==null?null:t.name))}}function ne(e,c){if(e&1&&(p(0,"option",15),_(1),l()),e&2){let t=c.$implicit;m("value",t),s(),rt(t)}}function re(e,c){if(e&1&&(p(0,"div",10),d(1,"input",12),p(2,"select",13)(3,"option",14),_(4,"Unit"),l(),O(5,ne,2,2,"option",15,k),l()()),e&2){let t=r(3).$implicit;m("formGroupName",t.attribute_id),s(),m("placeholder","Isi "+(t==null?null:t.name)),s(2),m("value",null),s(2),w(t==null||t.attribute_info==null?null:t.attribute_info.attribute_unit_list)}}function ae(e,c){if(e&1&&d(0,"input",11),e&2){let t=r(3).$implicit;m("formControlName",t.attribute_id)("placeholder","Isi "+(t==null?null:t.name))}}function le(e,c){if(e&1&&f(0,re,7,3,"div",10)(1,ae,1,2,"input",11),e&2){let t=r(2).$implicit,i=r(2);g((t==null||t.attribute_info==null?null:t.attribute_info.format_type)==i.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function ce(e,c){if(e&1&&d(0,"datepicker",9),e&2){let t=r(2).$implicit;m("formControlName",t.attribute_id)}}function me(e,c){if(e&1&&f(0,oe,1,2,"input",8)(1,le,2,1)(2,ce,1,1,"datepicker",9),e&2){let t,i=r().$implicit,n=r(2);g((t=i==null||i.attribute_info==null?null:i.attribute_info.input_validation_type)===n.validationType.VALIDATOR_STRING_TYPE?0:t===n.validationType.VALIDATOR_FLOAT_TYPE?1:t===n.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function pe(e,c){if(e&1&&d(0,"ng-select",7),e&2){let t=r().$implicit;m("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:at(3,gt))("placeholder","Pilih "+(t==null?null:t.name))}}function se(e,c){if(e&1&&d(0,"ng-select",7),e&2){let t=r().$implicit;m("formControlName",t.attribute_id)("items",t.attribute_value_list?t.attribute_value_list:at(3,gt))("placeholder","Pilih "+(t==null?null:t.name))}}function ue(e,c){if(e&1&&(p(0,"div",3)(1,"div",4),f(2,ee,2,0,"span",5),p(3,"span"),_(4),l()(),f(5,ie,1,5,"ng-select",6)(6,me,3,1)(7,pe,1,4,"ng-select",7)(8,se,1,4,"ng-select",7),l()),e&2){let t,i=c.$implicit,n=r(2);s(2),g(i.mandatory?2:-1),s(2),q(" ",i==null?null:i.name," "),s(),g((t=i==null||i.attribute_info==null?null:i.attribute_info.input_type)===n.inputType.MULTI_COMBO_BOX?5:t===n.inputType.FREE_TEXT_FILED?6:t===n.inputType.SINGLE_COMBO_BOX?7:8)}}function de(e,c){if(e&1&&(M(0),p(1,"form",1)(2,"div",2),O(3,ue,9,3,"div",3,k),l()(),D()),e&2){let t=c.ngIf,i=r();s(),m("formGroup",i.form),s(2),w(t)}}var qt=(()=>{class e{constructor(){this.formCategoryService=u(ht),this.attributesChanges=new P,this.inputType=z,this.formatType=it,this.validationType=Ct}ngOnChanges(){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:this.categoryId,channelId:this.channelId,channelType:this.channelType}).pipe(A(t=>{this.form=this.formCategoryService.createFormGroup(t),this.listenToFormChange(t)}),Z(1)))}listenToFormChange(t){let i=[];this.formSubscription=this.form.valueChanges.subscribe(n=>{i=this.formCategoryService.getFilteredAttributes(t,n),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["shopee-attribute-form"]],inputs:{channelType:"channelType",categoryId:"categoryId",channelId:"channelId",channelProductUpload:"channelProductUpload"},outputs:{attributesChanges:"attributesChanges"},features:[x([ht]),N],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&&(f(0,de,5,1,"ng-container",0),b(1,"async")),i&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,U,T,R,L,$,H,kt,Ot,K,Pt,V,Y,X,J,Nt,jt,Jt,Xt],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 e})();var bt=(()=>{class e{constructor(){this.httpService=u(et),this.formBuilder=u(Q),this.uploadProductService=u(pt)}getAttributes(t,i){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:i}]).pipe(Tt(o=>this.uploadProductService.selectedProduct$.pipe(F(a=>(o=this.mappingAttributeSalesProperty(o,a),o)))))}mappingAttributeSalesProperty(t,i){let n=0;return t.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(t){let i=!1,n=[];return t.forEach(o=>{o.Variants&&n.push(o.Variants.length)}),i=n.some(o=>o>1),i}createFormGroup(t){let i=this.formBuilder.group({}),n=[];return t.forEach(o=>{n=[],o.is_required&&n.push(lt.required),i.addControl(o.id,this.formBuilder.control(null,n))}),i}getFilteredAttributes(t,i){let n=JSON.parse(JSON.stringify(t)),o=Object.keys(i),a=n.filter(C=>o.findIndex(dt=>parseInt(dt)==C.id)!=-1);return a=this.filterSelectedAttributes(a,i),a}filterSelectedAttributes(t,i){return t.map(o=>(h.IsNotEmpty(o.values)?o.is_multiple_selection?o.values=o.values.filter(a=>i[o.id]?.includes(a.id)):o.values=o.values.filter(a=>a.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||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();function _e(e,c){e&1&&(p(0,"span",5),_(1,"*"),l())}function fe(e,c){if(e&1&&d(0,"ng-select",6),e&2){let t=r().$implicit;m("multiple",!0)("formControlName",t.id)("items",t.values)("placeholder","Pilih "+(t==null?null:t.name))}}function he(e,c){if(e&1&&d(0,"ng-select",7),e&2){let t=r().$implicit;m("formControlName",t.id)("items",t.values)("placeholder","Pilih "+(t==null?null:t.name))}}function Ce(e,c){if(e&1&&d(0,"input",8),e&2){let t=r().$implicit;m("formControlName",t.id)("placeholder",t==null?null:t.name)}}function ge(e,c){if(e&1&&(p(0,"small",5),_(1),l()),e&2){let t=r().$implicit;s(),q(" ",t==null?null:t.name," is mandatory ")}}function be(e,c){if(e&1&&(p(0,"div",3)(1,"div",4),f(2,_e,2,0,"span",5),p(3,"span"),_(4),l()(),f(5,fe,1,4,"ng-select",6)(6,he,1,3,"ng-select",7)(7,Ce,1,2,"input",8)(8,ge,2,1,"small",5),l()),e&2){let t=c.$implicit;s(2),g(t.is_required?2:-1),s(2),q(" ",t==null?null:t.name," "),s(),g(t.is_multiple_selection?5:t.values!==null&&t.values.length>0?6:7),s(3),g(t.is_required?8:-1)}}function ye(e,c){if(e&1&&(M(0),p(1,"form",1)(2,"div",2),O(3,be,9,4,"div",3,k),l()(),D()),e&2){let t=c.ngIf,i=r();s(),m("formGroup",i.form),s(2),w(t)}}var zt=(()=>{class e{constructor(){this.tiktokAttributeFormService=u(bt),this.attributesChanges=new P}ngOnChanges(){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(this.channelId,this.categoryId).pipe(F(t=>t.filter(i=>!(i.type=="PRODUCT_PROPERTY"&&(h.IsEmpty(i.values)||i.values?.length==0)&&i.is_customizable==!1))),A(t=>{this.form=this.tiktokAttributeFormService.createFormGroup(t),this.listenToFormChange(t)}),Z(1)))}listenToFormChange(t){let i=[];this.formSubscription=this.form.valueChanges.subscribe(n=>{i=this.tiktokAttributeFormService.getFilteredAttributes(t,n),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["tiktok-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[x([bt]),N],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","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&&(f(0,ye,5,1,"ng-container",0),b(1,"async")),i&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,U,T,R,L,$,H,K,V,Y,X,J,tt],encapsulation:2})}}return e})();var yt=(()=>{class e{constructor(){this.woocommerceUploadService=u(mt)}getAttributes(t,i){return this.woocommerceUploadService.getAttributes(t,i).pipe(F(n=>n.map(o=>({key:o.name,label:o.name}))))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();var Zt=(()=>{class e{constructor(){this.wooAttributeFormService=u(yt),this.channelId=_t(),this.categoryId=_t(),this.attributesChanges=new P}ngOnChanges(){h.IsNotEmpty(this.categoryId())&&h.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(t){this.attributesChanges.emit([t.key])}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[x([yt]),N],decls:6,vars:3,consts:[[1,"row"],[1,"col-6"],[1,"mb-1"],["bindLabel","label","bindValue","id","placeholder","Pilih Atribut",3,"change","items"]],template:function(i,n){i&1&&(p(0,"div",0)(1,"div",1)(2,"div",2),_(3,"Atribut"),l(),p(4,"ng-select",3),b(5,"async"),I("change",function(a){return n.onSelectAttribute(a)}),l()()()),i&2&&(s(4),m("items",y(5,1,n.attributes$)))},dependencies:[S,T,tt,R,L,$],encapsulation:2})}}return e})();var vt=(()=>{class e{constructor(){this.httpService=u(et),this.formBuilder=u(Q)}getAttributes(t,i){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:i}]).pipe(F(o=>o))}createFormGroup(t){let i=this.formBuilder.group({});return t.forEach(n=>{i.addControl(n.variant,this.formBuilder.control(null))}),i}convertAttributes(t={}){return Object.values(t).filter(n=>n!==null).map(n=>JSON.stringify(n))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();function ve(e,c){if(e&1&&(p(0,"div",3)(1,"div",4),_(2),l(),d(3,"ng-select",5),l()),e&2){let t=c.$implicit;s(2),q(" ",t==null?null:t.variant," "),s(),m("formControlName",t.variant)("items",t.values)("placeholder","Pilih "+(t==null?null:t.variant))}}function xe(e,c){if(e&1&&(M(0),p(1,"form",1)(2,"div",2),O(3,ve,4,4,"div",3,k),l()(),D()),e&2){let t=c.ngIf,i=r();s(),m("formGroup",i.form),s(2),w(t)}}var Kt=(()=>{class e{constructor(){this.tokpedAttrFormService=u(vt),this.attributesChanges=new P}ngOnInit(){}ngOnChanges(t){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(this.channelId,this.categoryId).pipe(A(i=>{this.form=this.tokpedAttrFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){let t=[];this.formSubscription=this.form.valueChanges.subscribe(i=>{t=this.tokpedAttrFormService.convertAttributes(i),this.attributesChanges.emit(t)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[x([vt]),N],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&&(f(0,xe,5,1,"ng-container",0),b(1,"async")),i&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,U,T,R,L,$,H,V,Y,X,J],encapsulation:2})}}return e})();var xt=(()=>{class e{constructor(){this.httpService=u(et),this.formBuilder=u(Q)}getAttributes(t){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:t}]).pipe(A(n=>(n.Options.StatusOptions=n.Options.Status.map(o=>({id:o,name:o})),n)))}createFormGroup(t){let i=this.formBuilder.group({});return Object.keys(t.Attribute).forEach(o=>{i.addControl(o,this.formBuilder.control(null))}),i}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=E({token:e,factory:e.\u0275fac})}}return e})();function Te(e,c){if(e&1&&(M(0),p(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4),_(5," Brand "),l(),d(6,"input",5),l(),p(7,"div",6)(8,"div",4),_(9," Product Type "),l(),d(10,"input",7),l(),p(11,"div",6)(12,"div",4),_(13," Status "),l(),d(14,"ng-select",8),l()()(),D()),e&2){let t=c.ngIf,i=r();s(),m("formGroup",i.form),s(13),m("items",t.Options.StatusOptions)}}var te=(()=>{class e{constructor(){this.attributesChanges=new P,this.shopifyFormService=u(xt)}ngOnChanges(t){t.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId).pipe(A(i=>{this.form=this.shopifyFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(St(500)).subscribe(t=>{this.attributesChanges.emit([t])})}ngOnDestroy(){this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["shopify-attribute-form"]],inputs:{channelId:"channelId"},outputs:{attributesChanges:"attributesChanges"},features:[x([xt]),N],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&&(f(0,Te,15,2,"ng-container",0),b(1,"async")),i&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,U,T,$,H,K,V,Y,X,J,R,L],encapsulation:2})}}return e})();function Se(e,c){if(e&1&&(p(0,"div",6),d(1,"app-product-card",9),l()),e&2){let t=c.$implicit;s(),m("productId",t==null?null:t.ID)("title",t==null?null:t.Name)("image",t==null?null:t.ThumbnailUrl)("description",(t==null||t.Variants==null?null:t.Variants.length)>1?(t==null||t.Variants==null?null:t.Variants.length)+" Variants":null)("imageForZoom",t==null?null:t.ImageUrl)("code",t==null||t.Variants[0]==null?null:t.Variants[0].Code)("showFooter",!1)}}function Ie(e,c){if(e&1){let t=W();M(0),p(1,"mat-checkbox",21),At("ngModelChange",function(n){G(t);let o=r().$implicit;return Ft(o.selected,n)||(o.selected=n),j(n)}),I("ngModelChange",function(){let n=G(t).ngIf,o=r(),a=o.$implicit,C=o.$index,ot=r();return j(ot.onSelectChannel(a,C,n))}),l(),D()}if(e&2){let t=r().$implicit;s(),It("ngModel",t.selected)}}function Fe(e,c){if(e&1&&(p(0,"div",18),d(1,"input",22),l()),e&2){let t=r().$implicit,i=r();m("matTooltip",t.type==i.channelType.Shopify?"Cannot change category, please change category in admin.shopify.com":t.type==i.channelType.Plugo?"You can change the category after the product has been uploaded to the Plugo Dashboard.":"")}}function Ae(e,c){if(e&1){let t=W();p(0,"app-channel-category-select",23),I("selectedCategory",function(n){G(t);let o=r().$index,a=r();return j(a.onCategoryChange(o,n))}),l()}if(e&2){let t=r().$implicit,i=r();m("disabled",!t.selected||t.selected&&t.type==i.channelType.Lazada)("channelId",t.id)("channelType",t.type)("categoryId",t.categoryId)}}function Ee(e,c){if(e&1){let t=W();p(0,"shopee-attribute-form",27),I("attributesChanges",function(n){G(t);let o=r(2).$index,a=r();return j(a.onAttributesChange(o,n))}),l()}if(e&2){let t=r(2).$implicit;m("categoryId",t.categoryId)("channelId",t.id)("channelType",t.type)}}function Ne(e,c){if(e&1){let t=W();p(0,"tiktok-attribute-form",28),I("attributesChanges",function(n){G(t);let o=r(2).$index,a=r();return j(a.onAttributesChange(o,n))}),l()}if(e&2){let t=r(2).$implicit;m("categoryId",t.categoryId)("channelId",t.id)}}function Pe(e,c){if(e&1){let t=W();p(0,"wooocommerce-attribute-form",28),I("attributesChanges",function(n){G(t);let o=r(2).$index,a=r();return j(a.onAttributesChange(o,n))}),l()}if(e&2){let t=r(2).$implicit;m("categoryId",t.categoryId)("channelId",t.id)}}function ke(e,c){if(e&1){let t=W();p(0,"tokopedia-attribute-form",28),I("attributesChanges",function(n){G(t);let o=r(2).$index,a=r();return j(a.onAttributesChange(o,n))}),l()}if(e&2){let t=r(2).$implicit;m("categoryId",t.categoryId)("channelId",t.id)}}function Oe(e,c){if(e&1&&(p(0,"div",20)(1,"div",24),f(2,Ee,1,3,"shopee-attribute-form",25)(3,Ne,1,2,"tiktok-attribute-form",26)(4,Pe,1,2,"wooocommerce-attribute-form",26)(5,ke,1,2,"tokopedia-attribute-form",26),l()()),e&2){let t,i=r().$implicit,n=r();s(2),g((t=i.type)===n.channelType.Shopee?2:t===n.channelType.Tiktok?3:t===n.channelType.WooCommerce?4:t===n.channelType.Tokopedia?5:-1)}}function we(e,c){if(e&1){let t=W();p(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",29),I("attributesChanges",function(n){G(t);let o=r().$index,a=r();return j(a.onAttributesChange(o,n))}),l()()()}if(e&2){let t=r().$implicit;s(2),m("channelId",t.id)}}function Me(e,c){if(e&1&&(p(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),f(6,Ie,2,1,"ng-container",14),b(7,"async"),l(),p(8,"div"),d(9,"app-channel-logo",15),l(),p(10,"div",16)(11,"span"),_(12),l()()()(),p(13,"div",12)(14,"div",17),f(15,Fe,2,1,"div",18)(16,Ae,1,4,"app-channel-category-select",19),l()()(),f(17,Oe,6,1,"div",20)(18,we,3,1,"div",20),l()()),e&2){let t=c.$implicit,i=r();s(6),m("ngIf",y(7,8,i.defaultCategories$)),s(3),m("typeId",t.type)("showChannelName",!1),s(),m("matTooltip",t.name)("matTooltipShowDelay",2500),s(2),rt(t.name),s(3),g(t.type==i.channelType.Shopify||t.type==i.channelType.Plugo?15:16),s(2),g(t.categoryId&&i.channelType.Lazada!=t.type&&t.selected?17:i.channelType.Shopify==t.type&&t.selected?18:-1)}}var zo=(()=>{class e{constructor(){this.uploadProductService=u(pt),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=wt,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(Z(1))}onCategoryChange(t,i){this.channelProductUploads.update(n=>n.map((o,a)=>(a==t&&(o.categoryId=i,o.attributes=[]),o)))}onAttributesChange(t,i){this.channelProductUploads.update(n=>n.map((o,a)=>(a==t&&(o.attributes=i),o)))}onSelectChannel(t,i,n){this.channelProductUploads.update(o=>o.map((a,C)=>{if(C==i&&t.selected){let ot=this.findCategoryByChannelId(t.id,n);a.categoryId=ot?.DefaultCategoryID}return C==i&&!t.selected&&(a.categoryId=null),a}))}findCategoryByChannelId(t,i){return i.find(n=>n.ID===t)}onUploadProduct(){this.uploadProductService.onUploadProduct(this.channelProductUploads())}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=v({type:e,selectors:[["app-product-upload"]],features:[x([ct,Rt,Bt,mt])],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","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(i,n){if(i&1&&(p(0,"mainpanel",0)(1,"actions")(2,"button",1),I("click",function(){return n.onUploadProduct()}),d(3,"i",2),_(4," Upload "),l()(),p(5,"content")(6,"div",3)(7,"h3",4),_(8,"Product To Upload"),l(),p(9,"div",5),O(10,Se,2,7,"div",6,k),b(12,"async"),l(),p(13,"h3",7),_(14,"Channel To Upload"),l(),O(15,Me,19,10,"div",8,k),l()()()),i&2){let o;m("hideSearchBox",!0)("hideSearchDropdown",!0),s(2),m("disabled",((o=n.channelProductUploads())==null?null:o.length)==0),s(8),w(y(12,3,n.selectedProducts$)),s(5),w(n.channelProductUploads())}},dependencies:[S,U,T,Wt,Vt,Ut,Ht,Yt,Lt,$t,tt,V,Et,Dt,Mt,qt,zt,Zt,Kt,te,Gt,Qt],encapsulation:2})}}return e})();export{zo as ProductUploadComponent};
@@ -1,3 +1,3 @@
1
- import{e as te}from"./chunk-JSPVOV7M.js";import{a as $e,b as ge,c as ze,d as Ke,e as me,f as Ge,g as Se,h as Ve,i as q,j as Ae,k as y}from"./chunk-V5WYSCVT.js";import{b as fe,c as ee,d as Je}from"./chunk-W6T7TOHE.js";import{G as He,L as qe,n as Fe,o as Ue,p as We}from"./chunk-B6POIFQM.js";import{$c as Be,F as je,Fb as W,G as Oe,La as F,O as ue,T as Ne,Va as U,Z as de,aa as _,ad as Le,ba as he,c as g,ea as G,ed as V,f as Y,j as Re,ja as k,k as _e,ka as B,ma as T,n as z,o as Q,oa as h,p as x,pa as L,q as K,qa as Me,ua as pe,v as D,w as xe}from"./chunk-EIQCOZF5.js";import{a as le,i as b}from"./chunk-K2H6WANG.js";var Ze={production:!0,version:"5.37.4",firebaseConfig:{apiKey:"AIzaSyDnnitFXpM8TglWKNpzu4ChgF98n25Rgvw",authDomain:"auth.dealpos.com",projectId:"devops-signin",storageBucket:"devops-signin.appspot.com",messagingSenderId:"412465165194",appId:"1:412465165194:web:03d806f6b6ab6f8b460e73",measurementId:"G-MNDBRJ5XZD"},news:"https://changelog.dealpos.app/umbraco/delivery/api/v2/content?fetch=children:omni&sort=sortOrder:asc"};var At="firebase",vt="11.10.0";q(At,vt,"app");var H=new Be("ANGULARFIRE2_VERSION");var Xe=(t,a)=>{let e=a?[a]:Ve(),n=[];return e.forEach(r=>{r.container.getProvider(t).instances.forEach(i=>{n.includes(i)||n.push(i)})}),n},ve=function(t){return t[t.SILENT=0]="SILENT",t[t.WARN=1]="WARN",t[t.VERBOSE=2]="VERBOSE",t}(ve||{}),Pn=V()&&typeof Zone<"u"?ve.WARN:ve.SILENT;var ne=class{zone;delegate;constructor(a,e=_e){this.zone=a,this.delegate=e}now(){return this.delegate.now()}schedule(a,e,n){let r=this.zone,o=function(i){r?r.runGuarded(()=>{a.apply(this,[i])}):a.apply(this,[i])};return this.delegate.schedule(o,e,n)}},we=(()=>{class t{outsideAngular;insideAngular;constructor(){let e=L(F);this.outsideAngular=e.runOutsideAngular(()=>new ne(typeof Zone>"u"?void 0:Zone.current)),this.insideAngular=e.run(()=>new ne(typeof Zone>"u"?void 0:Zone.current,Re))}static \u0275fac=function(n){return new(n||t)};static \u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var kt=new Map,It={activated:!1,tokenObservers:[]},bt={initialized:!1,enabled:!1};function C(t){return kt.get(t)||Object.assign({},It)}function tt(){return bt}var Tt="https://content-firebaseappcheck.googleapis.com/v1";var Et="exchangeDebugToken",Ye={OFFSET_DURATION:5*60*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:16*60*1e3},Fn=24*60*60*1e3;var be=class{constructor(a,e,n,r,o){if(this.operation=a,this.retryPolicy=e,this.getWaitDuration=n,this.lowerBound=r,this.upperBound=o,this.pending=null,this.nextErrorWaitInterval=r,r>o)throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}process(a){return b(this,null,function*(){this.stop();try{this.pending=new ge,this.pending.promise.catch(e=>{}),yield yt(this.getNextRun(a)),this.pending.resolve(),yield this.pending.promise,this.pending=new ge,this.pending.promise.catch(e=>{}),yield this.operation(),this.pending.resolve(),yield this.pending.promise,this.process(!0).catch(()=>{})}catch(e){this.retryPolicy(e)?this.process(!1).catch(()=>{}):this.stop()}})}getNextRun(a){if(a)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{let e=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),e}}};function yt(t){return new Promise(a=>{setTimeout(a,t)})}var Ct={"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.","initial-throttle":"{$httpStatus} error. Attempts allowed again after {$time}",throttled:"Requests throttled due to previous {$httpStatus} error. Attempts allowed again after {$time}"},O=new Ke("appCheck","AppCheck",Ct);function nt(t){if(!C(t).activated)throw O.create("use-before-activation",{appName:t.name})}function rt(n,r){return b(this,arguments,function*({url:t,body:a},e){let o={"Content-Type":"application/json"},i=e.getImmediate({optional:!0});if(i){let f=yield i.getHeartbeatsHeader();f&&(o["X-Firebase-Client"]=f)}let s={method:"POST",body:JSON.stringify(a),headers:o},l;try{l=yield fetch(t,s)}catch(f){throw O.create("fetch-network-error",{originalErrorMessage:f?.message})}if(l.status!==200)throw O.create("fetch-status-error",{httpStatus:l.status});let c;try{c=yield l.json()}catch(f){throw O.create("fetch-parse-error",{originalErrorMessage:f?.message})}let d=c.ttl.match(/^([\d.]+)(s)$/);if(!d||!d[2]||isNaN(Number(d[1])))throw O.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${c.ttl}`});let u=Number(d[1])*1e3,p=Date.now();return{token:c.token,expireTimeMillis:p+u,issuedAtTimeMillis:p}})}function ot(t,a){let{projectId:e,appId:n,apiKey:r}=t.options;return{url:`${Tt}/projects/${e}/apps/${n}:${Et}?key=${r}`,body:{debug_token:a}}}var Pt="firebase-app-check-database",Dt=1,Te="firebase-app-check-store";var re=null;function Rt(){return re||(re=new Promise((t,a)=>{try{let e=indexedDB.open(Pt,Dt);e.onsuccess=n=>{t(n.target.result)},e.onerror=n=>{var r;a(O.create("storage-open",{originalErrorMessage:(r=n.target.error)===null||r===void 0?void 0:r.message}))},e.onupgradeneeded=n=>{let r=n.target.result;switch(n.oldVersion){case 0:r.createObjectStore(Te,{keyPath:"compositeKey"})}}}catch(e){a(O.create("storage-open",{originalErrorMessage:e?.message}))}}),re)}function _t(t,a){return xt(jt(t),a)}function xt(t,a){return b(this,null,function*(){let n=(yield Rt()).transaction(Te,"readwrite"),o=n.objectStore(Te).put({compositeKey:t,value:a});return new Promise((i,s)=>{o.onsuccess=l=>{i()},n.onerror=l=>{var c;s(O.create("storage-set",{originalErrorMessage:(c=l.target.error)===null||c===void 0?void 0:c.message}))}})})}function jt(t){return`${t.options.appId}-${t.name}`}var J=new Ge("@firebase/app-check");function ke(t,a){return ze()?_t(t,a).catch(e=>{J.warn(`Failed to write token to IndexedDB. Error: ${e}`)}):Promise.resolve()}function it(){return tt().enabled}function at(){return b(this,null,function*(){let t=tt();if(t.enabled&&t.token)return t.token.promise;throw Error(`
1
+ import{e as te}from"./chunk-JSPVOV7M.js";import{a as $e,b as ge,c as ze,d as Ke,e as me,f as Ge,g as Se,h as Ve,i as q,j as Ae,k as y}from"./chunk-V5WYSCVT.js";import{b as fe,c as ee,d as Je}from"./chunk-W6T7TOHE.js";import{G as He,L as qe,n as Fe,o as Ue,p as We}from"./chunk-B6POIFQM.js";import{$c as Be,F as je,Fb as W,G as Oe,La as F,O as ue,T as Ne,Va as U,Z as de,aa as _,ad as Le,ba as he,c as g,ea as G,ed as V,f as Y,j as Re,ja as k,k as _e,ka as B,ma as T,n as z,o as Q,oa as h,p as x,pa as L,q as K,qa as Me,ua as pe,v as D,w as xe}from"./chunk-EIQCOZF5.js";import{a as le,i as b}from"./chunk-K2H6WANG.js";var Ze={production:!0,version:"5.37.5",firebaseConfig:{apiKey:"AIzaSyDnnitFXpM8TglWKNpzu4ChgF98n25Rgvw",authDomain:"auth.dealpos.com",projectId:"devops-signin",storageBucket:"devops-signin.appspot.com",messagingSenderId:"412465165194",appId:"1:412465165194:web:03d806f6b6ab6f8b460e73",measurementId:"G-MNDBRJ5XZD"},news:"https://changelog.dealpos.app/umbraco/delivery/api/v2/content?fetch=children:omni&sort=sortOrder:asc"};var At="firebase",vt="11.10.0";q(At,vt,"app");var H=new Be("ANGULARFIRE2_VERSION");var Xe=(t,a)=>{let e=a?[a]:Ve(),n=[];return e.forEach(r=>{r.container.getProvider(t).instances.forEach(i=>{n.includes(i)||n.push(i)})}),n},ve=function(t){return t[t.SILENT=0]="SILENT",t[t.WARN=1]="WARN",t[t.VERBOSE=2]="VERBOSE",t}(ve||{}),Pn=V()&&typeof Zone<"u"?ve.WARN:ve.SILENT;var ne=class{zone;delegate;constructor(a,e=_e){this.zone=a,this.delegate=e}now(){return this.delegate.now()}schedule(a,e,n){let r=this.zone,o=function(i){r?r.runGuarded(()=>{a.apply(this,[i])}):a.apply(this,[i])};return this.delegate.schedule(o,e,n)}},we=(()=>{class t{outsideAngular;insideAngular;constructor(){let e=L(F);this.outsideAngular=e.runOutsideAngular(()=>new ne(typeof Zone>"u"?void 0:Zone.current)),this.insideAngular=e.run(()=>new ne(typeof Zone>"u"?void 0:Zone.current,Re))}static \u0275fac=function(n){return new(n||t)};static \u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var kt=new Map,It={activated:!1,tokenObservers:[]},bt={initialized:!1,enabled:!1};function C(t){return kt.get(t)||Object.assign({},It)}function tt(){return bt}var Tt="https://content-firebaseappcheck.googleapis.com/v1";var Et="exchangeDebugToken",Ye={OFFSET_DURATION:5*60*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:16*60*1e3},Fn=24*60*60*1e3;var be=class{constructor(a,e,n,r,o){if(this.operation=a,this.retryPolicy=e,this.getWaitDuration=n,this.lowerBound=r,this.upperBound=o,this.pending=null,this.nextErrorWaitInterval=r,r>o)throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}process(a){return b(this,null,function*(){this.stop();try{this.pending=new ge,this.pending.promise.catch(e=>{}),yield yt(this.getNextRun(a)),this.pending.resolve(),yield this.pending.promise,this.pending=new ge,this.pending.promise.catch(e=>{}),yield this.operation(),this.pending.resolve(),yield this.pending.promise,this.process(!0).catch(()=>{})}catch(e){this.retryPolicy(e)?this.process(!1).catch(()=>{}):this.stop()}})}getNextRun(a){if(a)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{let e=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),e}}};function yt(t){return new Promise(a=>{setTimeout(a,t)})}var Ct={"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.","initial-throttle":"{$httpStatus} error. Attempts allowed again after {$time}",throttled:"Requests throttled due to previous {$httpStatus} error. Attempts allowed again after {$time}"},O=new Ke("appCheck","AppCheck",Ct);function nt(t){if(!C(t).activated)throw O.create("use-before-activation",{appName:t.name})}function rt(n,r){return b(this,arguments,function*({url:t,body:a},e){let o={"Content-Type":"application/json"},i=e.getImmediate({optional:!0});if(i){let f=yield i.getHeartbeatsHeader();f&&(o["X-Firebase-Client"]=f)}let s={method:"POST",body:JSON.stringify(a),headers:o},l;try{l=yield fetch(t,s)}catch(f){throw O.create("fetch-network-error",{originalErrorMessage:f?.message})}if(l.status!==200)throw O.create("fetch-status-error",{httpStatus:l.status});let c;try{c=yield l.json()}catch(f){throw O.create("fetch-parse-error",{originalErrorMessage:f?.message})}let d=c.ttl.match(/^([\d.]+)(s)$/);if(!d||!d[2]||isNaN(Number(d[1])))throw O.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${c.ttl}`});let u=Number(d[1])*1e3,p=Date.now();return{token:c.token,expireTimeMillis:p+u,issuedAtTimeMillis:p}})}function ot(t,a){let{projectId:e,appId:n,apiKey:r}=t.options;return{url:`${Tt}/projects/${e}/apps/${n}:${Et}?key=${r}`,body:{debug_token:a}}}var Pt="firebase-app-check-database",Dt=1,Te="firebase-app-check-store";var re=null;function Rt(){return re||(re=new Promise((t,a)=>{try{let e=indexedDB.open(Pt,Dt);e.onsuccess=n=>{t(n.target.result)},e.onerror=n=>{var r;a(O.create("storage-open",{originalErrorMessage:(r=n.target.error)===null||r===void 0?void 0:r.message}))},e.onupgradeneeded=n=>{let r=n.target.result;switch(n.oldVersion){case 0:r.createObjectStore(Te,{keyPath:"compositeKey"})}}}catch(e){a(O.create("storage-open",{originalErrorMessage:e?.message}))}}),re)}function _t(t,a){return xt(jt(t),a)}function xt(t,a){return b(this,null,function*(){let n=(yield Rt()).transaction(Te,"readwrite"),o=n.objectStore(Te).put({compositeKey:t,value:a});return new Promise((i,s)=>{o.onsuccess=l=>{i()},n.onerror=l=>{var c;s(O.create("storage-set",{originalErrorMessage:(c=l.target.error)===null||c===void 0?void 0:c.message}))}})})}function jt(t){return`${t.options.appId}-${t.name}`}var J=new Ge("@firebase/app-check");function ke(t,a){return ze()?_t(t,a).catch(e=>{J.warn(`Failed to write token to IndexedDB. Error: ${e}`)}):Promise.resolve()}function it(){return tt().enabled}function at(){return b(this,null,function*(){let t=tt();if(t.enabled&&t.token)return t.token.promise;throw Error(`
2
2
  Can't get debug token in production mode.
3
3
  `)})}var Ot={error:"UNKNOWN_ERROR"};function Nt(t){return $e.encodeString(JSON.stringify(t),!1)}function Ee(t,a=!1,e=!1){return b(this,null,function*(){let n=t.app;nt(n);let r=C(n),o=r.token,i;if(o&&!Z(o)&&(r.token=void 0,o=void 0),!o){let c=yield r.cachedTokenPromise;c&&(Z(c)?o=c:yield ke(n,void 0))}if(!a&&o&&Z(o))return{token:o.token};let s=!1;if(it())try{r.exchangeTokenPromise||(r.exchangeTokenPromise=rt(ot(n,yield at()),t.heartbeatServiceProvider).finally(()=>{r.exchangeTokenPromise=void 0}),s=!0);let c=yield r.exchangeTokenPromise;return yield ke(n,c),r.token=c,{token:c.token}}catch(c){return c.code==="appCheck/throttled"||c.code==="appCheck/initial-throttle"?J.warn(c.message):e&&J.error(c),Ie(c)}try{r.exchangeTokenPromise||(r.exchangeTokenPromise=r.provider.getToken().finally(()=>{r.exchangeTokenPromise=void 0}),s=!0),o=yield C(n).exchangeTokenPromise}catch(c){c.code==="appCheck/throttled"||c.code==="appCheck/initial-throttle"?J.warn(c.message):e&&J.error(c),i=c}let l;return o?i?Z(o)?l={token:o.token,internalError:i}:l=Ie(i):(l={token:o.token},r.token=o,yield ke(n,o)):l=Ie(i),s&&Ft(n,l),l})}function Mt(t){return b(this,null,function*(){let a=t.app;nt(a);let{provider:e}=C(a);if(it()){let n=yield at(),{token:r}=yield rt(ot(a,n),t.heartbeatServiceProvider);return{token:r}}else{let{token:n}=yield e.getToken();return{token:n}}})}function Bt(t,a,e,n){let{app:r}=t,o=C(r),i={next:e,error:n,type:a};if(o.tokenObservers=[...o.tokenObservers,i],o.token&&Z(o.token)){let s=o.token;Promise.resolve().then(()=>{e({token:s.token}),Qe(t)}).catch(()=>{})}o.cachedTokenPromise.then(()=>Qe(t))}function st(t,a){let e=C(t),n=e.tokenObservers.filter(r=>r.next!==a);n.length===0&&e.tokenRefresher&&e.tokenRefresher.isRunning()&&e.tokenRefresher.stop(),e.tokenObservers=n}function Qe(t){let{app:a}=t,e=C(a),n=e.tokenRefresher;n||(n=Lt(t),e.tokenRefresher=n),!n.isRunning()&&e.isTokenAutoRefreshEnabled&&n.start()}function Lt(t){let{app:a}=t;return new be(()=>b(null,null,function*(){let e=C(a),n;if(e.token?n=yield Ee(t,!0):n=yield Ee(t),n.error)throw n.error;if(n.internalError)throw n.internalError}),()=>!0,()=>{let e=C(a);if(e.token){let n=e.token.issuedAtTimeMillis+(e.token.expireTimeMillis-e.token.issuedAtTimeMillis)*.5+3e5,r=e.token.expireTimeMillis-5*60*1e3;return n=Math.min(n,r),Math.max(0,n-Date.now())}else return 0},Ye.RETRIAL_MIN_WAIT,Ye.RETRIAL_MAX_WAIT)}function Ft(t,a){let e=C(t).tokenObservers;for(let n of e)try{n.type==="EXTERNAL"&&a.error!=null?n.error(a.error):n.next(a)}catch{}}function Z(t){return t.expireTimeMillis-Date.now()>0}function Ie(t){return{token:Nt(Ot),error:t}}var ye=class{constructor(a,e){this.app=a,this.heartbeatServiceProvider=e}_delete(){let{tokenObservers:a}=C(this.app);for(let e of a)st(this.app,e.next);return Promise.resolve()}};function Ut(t,a){return new ye(t,a)}function Wt(t){return{getToken:a=>Ee(t,a),getLimitedUseToken:()=>Mt(t),addTokenListener:a=>Bt(t,"INTERNAL",a),removeTokenListener:a=>st(t.app,a)}}var Ht="@firebase/app-check",$t="0.10.1";var zt="app-check",et="app-check-internal";function Kt(){Se(new me(zt,t=>{let a=t.getProvider("app").getImmediate(),e=t.getProvider("heartbeat");return Ut(a,e)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((t,a,e)=>{t.getProvider(et).initialize()})),Se(new me(et,t=>{let a=t.getProvider("app-check").getImmediate();return Wt(a)},"PUBLIC").setInstantiationMode("EXPLICIT")),q(Ht,$t)}Kt();var Gt="app-check";var oe=class{constructor(){return Xe(Gt)}};var Vt=["localhost","0.0.0.0","127.0.0.1"],er=typeof window<"u"&&Vt.includes(window.location.hostname);var E=function(t){return t.USER="user",t.CHANNELS="channels",t.AUTHORIZATION="Authorization",t.INTERCOM="Intercom",t}(E||{});var ct=(()=>{class t{constructor(){}getParseToken(){let e=JSON.parse(window.localStorage.getItem("user"));return this.ParseToken(e.Token.access_token)}GetRoles(){let n=this.getParseToken()["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"];return n||[]}ParseToken(e){try{let r=e.split(".")[0].replace("-","+").replace("_","/"),o=JSON.parse(window.atob(r)),s=e.split(".")[1].replace("-","+").replace("_","/"),l=JSON.parse(window.atob(s));return l.header=o,l}catch{return!1}}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Zt="firebase",Xt="11.10.0";y.registerVersion(Zt,Xt,"app-compat");var Yt=["ngOnDestroy"],ut=(t,a,e,n={})=>new Proxy(t,{get:(r,o)=>e.runOutsideAngular(()=>{if(t[o])return n?.spy?.get&&n.spy.get(o,t[o]),t[o];if(Yt.indexOf(o)>-1)return()=>{};let i=a.toPromise().then(s=>{let l=s?.[o];return typeof l=="function"?l.bind(s):l?.then?l.then(c=>e.run(()=>c)):e.run(()=>l)});return new Proxy(()=>{},{get:(s,l)=>i[l],apply:(s,l,c)=>i.then(d=>{let u=d?.(...c);return n?.spy?.apply&&n.spy.apply(o,c,u),u})})})});var ie=class{constructor(a){return a}},ae=new T("angularfire2.app.options"),se=new T("angularfire2.app.name");function Ce(t,a,e){let n=typeof e=="string"&&e||"[DEFAULT]",r=typeof e=="object"&&e||{};r.name=r.name||n;let i=y.apps.filter(s=>s&&s.name===r.name)[0]||a.runOutsideAngular(()=>y.initializeApp(t,r));try{if(JSON.stringify(t)!==JSON.stringify(i.options)){let s=!!module.hot;Qt("error",`${i.name} Firebase App already initialized with different options${s?", you may need to reload as Firebase is not HMR aware.":"."}`)}}catch{}return new ie(i)}var Qt=(t,...a)=>{V()&&typeof console<"u"&&console[t](...a)},en={provide:ie,useFactory:Ce,deps:[ae,F,[new Me,se]]},qo=(()=>{class t{static initializeApp(e,n){return{ngModule:t,providers:[{provide:ae,useValue:e},{provide:se,useValue:n}]}}constructor(e){y.registerVersion("angularfire",H.full,"core"),y.registerVersion("angularfire",H.full,"app-compat"),y.registerVersion("angular",Le.full,e.toString())}static \u0275fac=function(n){return new(n||t)(h(U))};static \u0275mod=W({type:t});static \u0275inj=B({providers:[en]})}return t})();function dt(t,a,e,n,r){let[,o,i]=globalThis.\u0275AngularfireInstanceCache.find(s=>s[0]===t)||[];if(o)return tn(r,i)||(lt("error",`${a} was already initialized on the ${e} Firebase App with different settings.${nn?" You may need to reload as Firebase is not HMR aware.":""}`),lt("warn",{is:r,was:i})),o;{let s=n();return globalThis.\u0275AngularfireInstanceCache.push([t,s,r]),s}}function tn(t,a){try{return t.toString()===a.toString()}catch{return t===a}}var nn=typeof module<"u"&&!!module.hot,lt=(t,...a)=>{V()&&typeof console<"u"&&console[t](...a)};globalThis.\u0275AngularfireInstanceCache||=[];var rn=new T("angularfire2.auth.use-emulator"),on=new T("angularfire2.auth.settings"),an=new T("angularfire2.auth.tenant-id"),sn=new T("angularfire2.auth.langugage-code"),cn=new T("angularfire2.auth.use-device-language"),ln=new T("angularfire.auth.persistence"),un=(t,a,e,n,r,o,i,s)=>dt(`${t.name}.auth`,"AngularFireAuth",t.name,()=>{let l=a.runOutsideAngular(()=>t.auth());if(e&&l.useEmulator(...e),n&&(l.tenantId=n),l.languageCode=r,o&&l.useDeviceLanguage(),i)for(let[c,d]of Object.entries(i))l.settings[c]=d;return s&&l.setPersistence(s),l},[e,n,r,o,i,s]),Pe=(()=>{class t{injector=L(pe);authState;idToken;user;idTokenResult;credential;constructor(e,n,r,o,i,s,l,c,d,u,p,f){let $=new Y,N=K(void 0).pipe(z(i.outsideAngular),_(()=>o.runOutsideAngular(()=>import("./chunk-IIJMZKPL.js"))),D(()=>Ce(e,o,n)),D(P=>un(P,o,s,c,d,u,l,p)),de({bufferSize:1,refCount:!1}));if(We(r))this.authState=this.user=this.idToken=this.idTokenResult=this.credential=K(null);else{N.pipe(Ne()).subscribe();let P=N.pipe(_(S=>S.getRedirectResult().then(R=>R,()=>null)),qe(this.injector),de({bufferSize:1,refCount:!1})),X=N.pipe(_(S=>new g(R=>({unsubscribe:o.runOutsideAngular(()=>S.onAuthStateChanged(M=>R.next(M),M=>R.error(M),()=>R.complete()))})))),ce=N.pipe(_(S=>new g(R=>({unsubscribe:o.runOutsideAngular(()=>S.onIdTokenChanged(M=>R.next(M),M=>R.error(M),()=>R.complete()))}))));this.authState=P.pipe(he(X),Q(i.outsideAngular),z(i.insideAngular)),this.user=P.pipe(he(ce),Q(i.outsideAngular),z(i.insideAngular)),this.idToken=this.user.pipe(_(S=>S?x(S.getIdToken()):K(null))),this.idTokenResult=this.user.pipe(_(S=>S?x(S.getIdTokenResult()):K(null))),this.credential=je(P,$,this.authState.pipe(Oe(S=>!S))).pipe(D(S=>S?.user?S:null),Q(i.outsideAngular),z(i.insideAngular))}return ut(this,N,o,{spy:{apply:(P,X,ce)=>{(P.startsWith("signIn")||P.startsWith("createUser"))&&ce.then(S=>$.next(S))}}})}static \u0275fac=function(n){return new(n||t)(h(ae),h(se,8),h(U),h(F),h(we),h(rn,8),h(on,8),h(an,8),h(sn,8),h(cn,8),h(ln,8),h(oe,8))};static \u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"any"})}return t})(),ui=(()=>{class t{constructor(){y.registerVersion("angularfire",H.full,"auth-compat")}static \u0275fac=function(n){return new(n||t)};static \u0275mod=W({type:t});static \u0275inj=B({providers:[Pe]})}return t})();function m(t,a,e,n){return new Promise((r,o)=>{t||o("IndexedDB not available");let i=t.open(a,e),s;i.onsuccess=l=>{s=i.result,r(s)},i.onerror=l=>{o(`IndexedDB error: ${i.error}`)},typeof n=="function"&&(i.onupgradeneeded=l=>{n(l,s)})})}function ht(t,a,e,n,r){if(!t)return;let o=t.open(a,e);o.onupgradeneeded=i=>{let s=i.target.result;n.forEach(c=>{if(!s.objectStoreNames.contains(c.store)){let d=s.createObjectStore(c.store,c.storeConfig);c.storeSchema.forEach(u=>{d.createIndex(u.name,u.keypath,u.options)})}});let l=r&&r();l&&Object.keys(l).map(c=>parseInt(c,10)).filter(c=>c>i.oldVersion).sort((c,d)=>c-d).forEach(c=>{l[c](s,o.transaction)}),s.close()},o.onsuccess=i=>{i.target.result.close()}}function hn(t,a,e){if(!t||!a||!e)throw Error('Params: "dbName", "version", "storeName" are mandatory.');return new g(n=>{try{let r=a+1,o=indexedDB.open(t,r);o.onupgradeneeded=i=>{let s=i.target.result;s.deleteObjectStore(e),s.close(),console.log("onupgradeneeded"),n.next(!0),n.complete()},o.onerror=i=>n.error(i)}catch(r){n.error(r)}})}function pn(t,a){return t.objectStoreNames.contains(a)}function I(t,a,e){t||e("You need to use the openDatabase function to create a database before you query it!"),pn(t,a)||e(`objectStore does not exists: ${a}`)}function v(t,a){let e=t.transaction(a.storeName,a.dbMode);return e.onerror=a.error,e.onabort=a.abort,e}function w(t,a,e,n){return{storeName:a,dbMode:t,error:r=>{e(r)},abort:r=>{e(r)}}}var A=function(t){return t.readonly="readonly",t.readwrite="readwrite",t}(A||{}),pt=new T(null),De=(()=>{class t{constructor(e,n){if(this.dbConfig=e,this.platformId=n,!e.name)throw new Error("NgxIndexedDB: Please, provide the dbName in the configuration");if(!e.version)throw new Error("NgxIndexedDB: Please, provide the db version in the configuration");this.isBrowser=Ue(this.platformId),this.isBrowser&&(this.indexedDB=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,ht(this.indexedDB,e.name,e.version,e.objectStoresMeta,e.migrationFactory),m(this.indexedDB,e.name).then(r=>{r.version!==e.version&&(this.dbConfig.version=r.version)}))}createObjectStore(e,n){let r=[e];ht(this.indexedDB,this.dbConfig.name,++this.dbConfig.version,r,n)}add(e,n,r){return new g(o=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{let l=v(i,w(A.readwrite,e,d=>o.error(d))).objectStore(e),c=r?l.add(n,r):l.add(n);c.onsuccess=d=>b(this,null,function*(){let u=d.target.result,p=l.get(u);p.onsuccess=f=>{o.next(f.target.result),o.complete()}})}).catch(i=>o.error(i))})}bulkAdd(e,n){let r=new Promise((o,i)=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{let c=v(s,w(A.readwrite,e,o,i)).objectStore(e),d=n.map(u=>new Promise((p,f)=>{let $=u.key;delete u.key;let N=$?c.add(u,$):c.add(u);N.onsuccess=P=>{let X=P.target.result;p(X)}}));o(Promise.all(d))}).catch(s=>i(s))});return x(r)}bulkDelete(e,n){let r=n.map(o=>new Promise((i,s)=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(l=>{let c=v(l,w(A.readwrite,e,s,i));c.objectStore(e).delete(o),c.oncomplete=()=>{this.getAll(e).pipe(ue(1)).subscribe(u=>{i(u)})}}).catch(l=>s(l))}));return x(Promise.all(r))}getByKey(e,n){return new g(r=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{let l=v(o,w(A.readonly,e,r.error)).objectStore(e).get(n);l.onsuccess=c=>{r.next(c.target.result),r.complete()},l.onerror=c=>{r.error(c)}}).catch(o=>r.error(o))})}bulkGet(e,n){let r=n.map(o=>this.getByKey(e,o));return new g(o=>{xe(r).subscribe(i=>{o.next(i),o.complete()})})}getByID(e,n){return new g(r=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{I(o,e,c=>r.error(c));let l=v(o,w(A.readonly,e,r.error,r.next)).objectStore(e).get(n);l.onsuccess=c=>{r.next(c.target.result)}}).catch(o=>r.error(o))})}getByIndex(e,n,r){return new g(o=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{I(i,e,u=>o.error(u));let d=v(i,w(A.readonly,e,o.error)).objectStore(e).index(n).get(r);d.onsuccess=u=>{o.next(u.target.result),o.complete()}}).catch(i=>o.error(i))})}getAll(e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(r=>{I(r,e,l=>n.error(l));let s=v(r,w(A.readonly,e,n.error,n.next)).objectStore(e).getAll();s.onerror=l=>{n.error(l)},s.onsuccess=({target:{result:l}})=>{n.next(l),n.complete()}}).catch(r=>n.error(r))})}update(e,n){return new g(r=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{I(o,e,c=>r.error(c));let s=v(o,w(A.readwrite,e,c=>r.error(c))).objectStore(e),l=s.put(n);l.onsuccess=c=>b(this,null,function*(){let d=c.target.result,u=s.get(d);u.onsuccess=p=>{r.next(p.target.result),r.complete()}})}).catch(o=>r.error(o))})}delete(e,n){return new g(r=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{I(o,e,l=>r.error(l));let i=v(o,w(A.readwrite,e,l=>r.error(l)));i.objectStore(e).delete(n),i.oncomplete=()=>{this.getAll(e).pipe(ue(1)).subscribe(l=>{r.next(l),r.complete()})}}).catch(o=>r.error(o))})}deleteByKey(e,n){return new g(r=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{I(o,e,l=>r.error(l));let i=v(o,w(A.readwrite,e,l=>r.error(l))),s=i.objectStore(e);i.oncomplete=()=>{r.next(!0),r.complete()},s.delete(n)}).catch(o=>r.error(o))})}clear(e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(r=>{I(r,e,s=>n.error(s));let o=v(r,w(A.readwrite,e,s=>n.error(s)));o.objectStore(e).clear(),o.oncomplete=()=>{n.next(!0),n.complete()}}).catch(r=>n.error(r))})}deleteDatabase(){return new g(e=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(n=>b(this,null,function*(){yield n.close();let r=this.indexedDB.deleteDatabase(this.dbConfig.name);r.onsuccess=()=>{e.next(!0),e.complete()},r.onerror=o=>e.error(o),r.onblocked=()=>{throw new Error("Unable to delete database because it's blocked")}})).catch(n=>e.error(n))})}openCursor(e,n){return new g(r=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{I(o,e,c=>r.error(c));let s=v(o,w(A.readonly,e,r.error)).objectStore(e),l=n===void 0?s.openCursor():s.openCursor(n);l.onsuccess=c=>{r.next(c),r.complete()}}).catch(o=>r.error(o))})}openCursorByIndex(e,n,r,o=A.readonly){let i=new Y;return m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{I(s,e,p=>{i.error(p)});let u=v(s,w(o,e,p=>{i.error(p)},()=>{i.next()})).objectStore(e).index(n).openCursor(r);u.onsuccess=p=>{i.next(p)}}).catch(s=>i.error(s)),i}getAllByIndex(e,n,r){let o=[];return new g(i=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{I(s,e,p=>i.error(p));let u=v(s,w(A.readonly,e,i.error)).objectStore(e).index(n).openCursor(r);u.onsuccess=p=>{let f=p.target.result;f?(o.push(f.value),f.continue()):(i.next(o),i.complete())}}).catch(s=>i.error(s))})}getAllKeysByIndex(e,n,r){let o=[];return new g(i=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{I(s,e,p=>i.error(p));let u=v(s,w(A.readonly,e,i.error)).objectStore(e).index(n).openKeyCursor(r);u.onsuccess=p=>{let f=p.target.result;f?(o.push({primaryKey:f.primaryKey,key:f.key}),f.continue()):(i.next(o),i.complete())}}).catch(s=>i.error(s))})}count(e,n){return new g(r=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{I(o,e,c=>r.error(c));let l=v(o,w(A.readonly,e,r.error)).objectStore(e).count(n);l.onerror=c=>r.error(c),l.onsuccess=c=>{r.next(c.target.result),r.complete()}}).catch(o=>r.error(o))})}countByIndex(e,n,r){return new g(o=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{I(i,e,u=>o.error(u));let d=v(i,w(A.readonly,e,o.error)).objectStore(e).index(n).count(r);d.onerror=u=>o.error(u),d.onsuccess=u=>{o.next(u.target.result),o.complete()}}).catch(i=>o.error(i))})}deleteObjectStore(e){return hn(this.dbConfig.name,++this.dbConfig.version,e)}}return t.\u0275fac=function(e){return new(e||t)(h(pt),h(U))},t.\u0275prov=k({token:t,factory:t.\u0275fac}),t})(),Ai=(()=>{class t{static forRoot(e){return{ngModule:t,providers:[De,{provide:pt,useValue:e}]}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=W({type:t}),t.\u0275inj=B({imports:[[Fe]]}),t})();var ft=(()=>{class t{constructor(e){this.db=e,this.DATABASE="Categories"}saveCategoriesByChannelType(e,n){let r=this.getKey(n);return this.db.add(this.DATABASE,e,r).pipe(D(o=>e))}getCategoriesByChannelType(e){let n=this.getKey(e);return this.db.getByKey(this.DATABASE,n)}getKey(e){let n="";switch(e){case fe.Lazada:n="Lazada";break;case fe.Tokopedia:n="Tokopedia";break}return n}clearDatabase(){this.db.clear(this.DATABASE)}getHostName(){let e=localStorage.getItem("Authorization");return this.hostName=JSON.parse(e)?.Host,this.hostName}static{this.\u0275fac=function(n){return new(n||t)(h(De))}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var gt=(()=>{class t{constructor(){}inititalizeIntercom(){let e=this.getFromLocalStorage();e?.Enabled&&window.Intercom("boot",{app_id:"xv1oomgl",name:e.Name,email:e.Email,created_at:e.Created,user_hash:e.Hash})}shutdown(){this.getFromLocalStorage()?.Enabled&&(window.Intercom("shutdown"),this.clearStorage())}clearStorage(){localStorage.removeItem("Intercom")}updateLocalStorage(e){let n={Enabled:!0};e&&(n=le(le({},n),e)),localStorage.setItem("Intercom",JSON.stringify(n))}getFromLocalStorage(){let e=localStorage.getItem("Intercom");return JSON.parse(e)}hideLauncher(){let e=this.getFromLocalStorage();e?.Enabled&&(window.Intercom("update",{app_id:"xv1oomgl",hide_default_launcher:!0}),e.hide_default_launcher=!0,this.updateLocalStorage(e))}showLauncher(){let e=this.getFromLocalStorage();e?.Enabled&&(window.Intercom("update",{app_id:"xv1oomgl",hide_default_launcher:!1}),e.hide_default_launcher=!1,this.updateLocalStorage(e))}isHideLauncher(){let e=this.getFromLocalStorage();return ee.IsEmpty(e?.hide_default_launcher)?!1:e?.hide_default_launcher}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var mt=(()=>{class t{static{this.SubmitConfig="/api/Channel/SubmitConfig"}static{this.PosAccountTest="/api/POSAccount/Test"}static{this.PosAccountRemove="/api/POSAccount/Remove"}static{this.PosAccountGetConfig="/api/ChannelLoader/GetConfig"}static{this.ChannelGetLastSyncByID="/api/Channel/GetLastSyncByID"}static{this.GetChannel="/api/Channel/GetChannel"}static{this.GetChannelLoader="/api/ChannelLoader/GetChannelLoader"}static{this.TestShopID="/api/Channel/TestShopID"}static{this.UpdateChannelIndex="/api/Channel/UpdateChannelIndex"}static{this.DeleteChannel="/api/Channel/DeleteChannel"}static{this.GetRegisterByOutletName="/api/Channel/GetRegistersByOutletOrder"}static{this.GetChannelRowCount="/api/Channel/GetCountChannel"}static{this.GetChannelWarehouse="/api/Channel/GetChannelWarehouseLocation"}static{this.UnSynchronizedWarehouse="/api/Channel/UnSynchronizedWarehouse"}static{this.GetChannelDetail="/api/ChannelLoader/GetChannelView"}static{this.GetOrderPreview="/api/Orders/Preview"}static{this.GetOrderPreviewV2="/api/Orders/PreviewV2"}static{this.GetDownloadOrder="/api/Orders/Download"}static{this.GetDownloadOrderV2="/api/Orders/DownloadV2"}static{this.ShopeeV2_URL="/api/ChannelAuthorization/ShopeeV2_URL"}static{this.Tiktok_URL="/api/ChannelAuthorization/Tiktok_URL"}static{this.Lazada_URL="/api/ChannelAuthorization/Lazada_URL"}static{this.AddTokopedia="/api/ChannelAdd/Tokopedia"}static{this.AddShopify="/api/ChannelAdd/AddShopify"}static{this.AddWoocommerce="/api/ChannelAdd/AddWooCommerce"}static{this.AddPlugo="/api/ChannelAdd/Plugo"}static{this.UploadPlugoProduct="/api/product/plugo/AddProduct"}static{this.RefreshToken="/api/RefreshToken"}static{this.RefreshInventory="/api/Inventory/RefreshInventory"}}return t})();var St=(()=>{class t{constructor(){this.httpService=L(te)}refreshToken(){return this.httpService.get(mt.RefreshToken).pipe(G(e=>{this.updateTokenInLocalStorage(e)}))}updateTokenInLocalStorage(e){this.saveUserToLocalStorage(e),this.saveChannelsToLocalStorage(e.Channels)}saveUserToLocalStorage(e){let n=JSON.stringify(e);localStorage.setItem(E.USER,n)}getUser(){let e=localStorage.getItem(E.USER);return e?JSON.parse(e):null}saveChannelsToLocalStorage(e){let n=JSON.stringify(e);localStorage.setItem(E.CHANNELS,n)}getChannels(){let e=localStorage.getItem(E.CHANNELS);return e?JSON.parse(e):[]}clearStorage(){localStorage.removeItem(E.USER),localStorage.removeItem(E.CHANNELS)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Fi=(()=>{class t{constructor(e,n,r,o,i,s,l,c){this.httpService=e,this.tokenDecodeService=n,this.afAuth=r,this.ngxPermission=o,this.localDataService=i,this.router=s,this.intercomService=l,this.tokenService=c}login(e){return this.httpService.post("/api/token/Login",e).pipe(G(n=>{this.setLocalStorage(n,e.Host,e.Username),this.loadPermissions()}))}getNews(){return this.httpService.get(Ze.news).pipe(D(e=>e?.items?.map(n=>n?.properties)))}loginWithGoogle(e,n){e.preventDefault();let r=new Ae;return r.setCustomParameters({prompt:"select_account"}),x(this.afAuth.signInWithPopup(r)).pipe(D(o=>o.credential),D(o=>o.idToken),_(o=>this.httpService.post("/api/token/LoginWithSocialProvider",JSON.stringify({IDToken:o,Host:n}))),G(o=>{this.setLocalStorage(o,n,null),this.loadPermissions()}))}setLocalStorage(e,n,r){this.tokenService.updateTokenInLocalStorage(e),localStorage.setItem(E.AUTHORIZATION,JSON.stringify({Host:n,username:r})),this.intercomService.updateLocalStorage(e.IntercomWidget),this.intercomService.inititalizeIntercom()}loadPermissions(){this.ngxPermission.loadPermissions([]);let e=localStorage.getItem(E.USER);if(ee.IsNotEmpty(e)){let n=this.tokenDecodeService.GetRoles();this.ngxPermission.loadPermissions(n)}}getChannels(){return this.tokenService.getChannels()}logout(){this.clearLocalStorage(),this.ngxPermission.flushPermissions()}isActiveToken(){let e=this.tokenService.getUser(),n=new Date;if(e!=null){let r=new Date(e.Token.expiredAt);return n<r?!0:(this.clearLocalStorage(),!1)}else return!1}getDomain(){if(!this.domain){let e=localStorage.getItem(E.AUTHORIZATION);this.domain="https://"+JSON.parse(e).Host}return this.domain}clearLocalStorage(){this.domain=null,this.tokenService.clearStorage(),this.intercomService.shutdown(),this.localDataService.clearDatabase(),this.router.navigate([""])}static{this.\u0275fac=function(n){return new(n||t)(h(te),h(ct),h(Pe),h(Je),h(ft),h(He),h(gt),h(St))}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();export{Ze as a,E as b,ct as c,qo as d,ui as e,Ai as f,ft as g,mt as h,St as i,Fi as j};
@@ -1 +1 @@
1
- import{a as pt}from"./chunk-JNMDGK2M.js";import{a as Ct}from"./chunk-23MIIDCT.js";import{a as mt,b as ct}from"./chunk-K5CKXDIJ.js";import{c as ft}from"./chunk-E24BKGBJ.js";import{f as ht}from"./chunk-4RAOUTR2.js";import{b as D,c as P,i as E,j as k}from"./chunk-XOT2SZPE.js";import{r as O}from"./chunk-AKJ4I7KF.js";import{h as dt,m as st}from"./chunk-AI4XRCAL.js";import{b as s,c as f}from"./chunk-W6T7TOHE.js";import{G as rt,d as W,f as B,g as K,j as ot,m as lt}from"./chunk-B6POIFQM.js";import{Dc as it,Eb as T,Ec as r,Fc as u,Gc as y,Ic as V,Jc as N,Kb as g,Kc as U,Oc as R,Qa as Z,Vb as j,Wb as d,Xc as I,Yc as x,Z as Q,_c as at,bc as z,cc as tt,ec as et,fc as nt,gc as a,hc as l,ic as _,jc as G,kc as H,mc as F,ob as b,pa as X,qb as o,rc as S,sc as h,v as q,wb as C,ya as A,za as L}from"./chunk-EIQCOZF5.js";function Mt(e,p){if(e&1&&(a(0,"mat-option",10)(1,"div",11),_(2,"img",12),a(3,"span"),r(4),l()()()),e&2){let t=p.$implicit;d("value",t.ID)("disabled",t.disabled),o(),d("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),o(),d("src",t.Img,b),o(2),u(t.Name)}}function bt(e,p){if(e&1){let t=F();a(0,"div",13)(1,"label",14),r(2,"Scan Type"),l(),a(3,"mat-radio-group",15),U("ngModelChange",function(i){A(t);let m=h();return N(m.filter.ScanFull,i)||(m.filter.ScanFull=i),L(i)}),a(4,"mat-radio-button",16),r(5," Full (Include Inactive Products) "),l(),a(6,"mat-radio-button",17),r(7," Active "),l()()()}if(e&2){let t=h();o(3),V("ngModel",t.filter.ScanFull),o(),d("value",!0),o(2),d("value",!1)}}function Tt(e,p){e&1&&(a(0,"span"),r(1,"Never"),l())}function It(e,p){if(e&1&&(a(0,"span"),r(1),I(2,"async"),l()),e&2){let t=h(2);o(),u(x(2,1,t.lastSync$))}}function xt(e,p){if(e&1){let t=F();a(0,"div",8)(1,"label",3)(2,"span",18),r(3,"Last Scan:"),l(),g(4,Tt,2,0,"span"),I(5,"async"),g(6,It,3,3,"span"),l(),a(7,"mat-radio-group",19),U("ngModelChange",function(i){A(t);let m=h();return N(m.filter.UpdatedProduct,i)||(m.filter.UpdatedProduct=i),L(i)}),a(8,"mat-radio-button",20),r(9," Scan All Products "),l(),a(10,"mat-radio-button",21),r(11),l()()()}if(e&2){let t=h();o(4),z(x(5,6,t.lastSync$)==null?4:6),o(3),V("ngModel",t.filter.UpdatedProduct),o(),d("value",!1),o(2),d("value",!0)("matTooltip",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Use Tokopedia URL for mapping SKU between POS and Tokopedia":"Scan only products that have been updated since the last channel scan"),o(),y(" ",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Product Download By URL":"Scan Updated Products"," ")}}function Ot(e,p){if(e&1){let t=F();a(0,"div",8)(1,"label",3),r(2," Scan Option "),l(),a(3,"mat-radio-group",22),U("ngModelChange",function(i){A(t);let m=h();return N(m.filter.Async,i)||(m.filter.Async=i),L(i)}),a(4,"mat-radio-button",23),r(5," Asynchronous (Get Notified when Complete) "),l(),a(6,"mat-radio-button",24),r(7," Synchronous (Wait until Complete) "),l()()()}if(e&2){let t=h();o(3),V("ngModel",t.filter.Async),o(),d("value",!0),o(2),d("value",!1)}}var Xt=(()=>{class e{constructor(t,n,i){this.dialogRef=t,this.data=n,this.router=i,this.channelService=X(pt),this.channelType=s,this.disabledChannelOption=!1,this.filter={ChannelID:f.GuidEMpty,ScanFull:!0,UpdatedProduct:!1,Async:!1},this.isSingleChannel=f.IsNotEmpty(n.isSingleChannel)?this.data.isSingleChannel:!1,this.disabledChannelOption=f.IsEmpty(n.disabledChannelOption)?!1:this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new E,this.modalConfig.title=this.isSingleChannel?"Scan Single Product":"Scan Channel Marketplace",this.modalConfig.bodyScrollable=!0}initFilter(){this.filter.ChannelID=this.data?.filter?.ChannelID}initChannelOptions(){this.channelOptions=JSON.parse(JSON.stringify(this.data.channelOptions)),this.isSingleChannel&&(this.channelOptions=this.channelOptions.map(t=>(t.disabled=!0,(t.TypeID==s.Tiktok||t.TypeID==s.Tokopedia||t.TypeID==s.Lazada||t.TypeID==s.WooCommerce)&&(t.disabled=!1),t)).sort(t=>t.disabled?1:-1))}onSelectChannel(t){let n=this.filterChannelById(t);this.selectedChannel=n,this.filter.Async=!0,this.iniHasScanUpdate(),this.getLastSync(t)}getLastSync(t){this.lastSync$=this.channelService.getLastSync(t).pipe(q(n=>(this.selectedChannel.LastSync=n.LastSync,this.setDefaultConfigUpdate(),f.IsNotEmpty(n.LastSync)?f.convertToReadableDate(n.LastSync):null)),Q(1))}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&f.IsNotEmpty(this.selectedChannel.LastSync)&&(this.selectedChannel.TypeID==s.Shopee||this.selectedChannel.TypeID==s.Tiktok||this.selectedChannel.TypeID==s.Lazada)&&(this.filter.UpdatedProduct=!0)}iniHasScanUpdate(){this.selectedChannel?.TypeID!=s.WooCommerce&&this.selectedChannel?.TypeID!=s.KalCare&&this.selectedChannel?.TypeID!=s.None&&!this.isSingleChannel?this.hasScanUpdate=!0:this.hasScanUpdate=!1}filterChannelById(t){let n;return this.channelOptions&&(n=this.channelOptions.find(i=>i.ID==t)),n}submit(){this.selectedChannel.TypeID==s.Tokopedia&&this.filter.UpdatedProduct?this.router.navigate(["/menu/products/download/by-url"]).then(()=>{this.dialogRef.close()}):this.dialogRef.close(this.filter)}isNotEmpty(t){return f.IsNotEmpty(t)}onClose(){this.dialogRef.close()}static{this.\u0275fac=function(n){return new(n||e)(C(D),C(P),C(rt))}}static{this.\u0275cmp=T({type:e,selectors:[["app-scan-dialog"]],standalone:!1,decls:11,vars:8,consts:[[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[1,"mx-4"],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"ngModelChange","disabled","ngModel"],["class","channel-option",3,"value","disabled",4,"ngFor","ngForOf"],["class","mt-4",4,"ngIf"],[1,"mt-8"],["class","mt-8",4,"ngIf"],[1,"channel-option",3,"value","disabled"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],[2,"width","18px","margin-right","10px",3,"src"],[1,"mt-4"],[1,"mb-2","fw-bold","mt-3"],["name","scanType",1,"form-control","h-100","round",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Full Scan Product",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Only Active Product",1,"me-5",3,"value"],[1,"me-2"],["name","ScanFull",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Scan product from beginning ( use this if you haven't scanned at all)",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above",1,"me-5",3,"value","matTooltip"],["name","Async",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltip","Scan is running in the background, status will be visible in the notification menu","matTooltipPosition","above",1,"me-5",3,"value"],[1,"me-5",3,"value"]],template:function(n,i){n&1&&(a(0,"modal-material",0),S("onOk",function(){return i.submit()})("onClose",function(){return i.onClose()})("onCancel",function(){return i.onClose()}),a(1,"div",1)(2,"div",2)(3,"label",3),r(4,"Select a Channel"),l(),a(5,"mat-form-field",4)(6,"mat-select",5),U("ngModelChange",function(c){return N(i.filter.ChannelID,c)||(i.filter.ChannelID=c),c}),S("ngModelChange",function(c){return i.onSelectChannel(c)}),g(7,Mt,5,5,"mat-option",6),l()(),g(8,bt,8,3,"div",7)(9,xt,12,8,"div",8)(10,Ot,8,3,"div",9),l()()()),n&2&&(d("dynamicValidated",i.isNotEmpty(i.filter.ChannelID))("config",i.modalConfig),o(6),d("disabled",i.disabledChannelOption),V("ngModel",i.filter.ChannelID),o(),d("ngForOf",i.channelOptions),o(),d("ngIf",!i.isSingleChannel&&i.isNotEmpty(i.filter.ChannelID)),o(),z(i.hasScanUpdate&&i.selectedChannel?9:-1),o(),d("ngIf",!i.isSingleChannel&&i.isNotEmpty(i.filter.ChannelID)))},dependencies:[B,K,dt,st,mt,ct,ht,Ct,ft,O,k,ot],encapsulation:2})}}return e})();var v=function(e){return e.Tokopedia="https://seller.tokopedia.com",e.Shoope="https://seller.shopee.co.id",e.Tiktok="https://seller-id.tiktok.com",e.WooCommerce="https://woocommerce.dealpos.app",e.Lazada="https://sellercenter.lazada.co.id",e}(v||{});var Dt=e=>({"is-disabled":e});function Pt(e,p){if(e&1&&(G(0),a(1,"tr")(2,"td",11),r(3),l(),a(4,"td",11),r(5),l(),a(6,"td",12)(7,"p",13),r(8,"Product Not in Channel!"),l()()(),H()),e&2){let t=h().$implicit;o(3),y(" ",t==null?null:t.Model,""),o(2),y(" ",t==null?null:t.Code,"")}}function Et(e,p){if(e&1&&(a(0,"td",11),r(1),l()),e&2){let t=h(3).$implicit;j("rowspan",t.Channel.length),o(),y(" ",t==null?null:t.Model,"")}}function kt(e,p){if(e&1&&(a(0,"td",11),r(1),l()),e&2){let t=h(3).$implicit;j("rowspan",t.Channel.length),o(),y(" ",t==null?null:t.Code,"")}}function wt(e,p){if(e&1&&(a(0,"tr"),g(1,Et,2,2,"td",14)(2,kt,2,2,"td",14),a(3,"td",11)(4,"div",15)(5,"a",16),_(6,"img",17),l(),a(7,"div",18),r(8),l()()(),a(9,"td",11),r(10),I(11,"number"),l(),a(12,"td",19),r(13),I(14,"number"),l(),a(15,"td",19)(16,"a",20),_(17,"i",21),a(18,"span",22),r(19,"Edit"),l()()()()),e&2){let t=p.$implicit,n=p.index,i=h(3);o(),d("ngIf",n==0),o(),d("ngIf",n==0),o(3),d("href",t.Url,b)("title",t.Title),o(),d("src",i.getChannelLogo(t.TypeID),b),o(),d("matTooltip",(t==null||t.Name==null?null:t.Name.length)>55?t==null?null:t.Name:""),o(),y(" ",t.Name," "),o(2),u(x(11,12,t.Price)),o(3),u(x(14,14,t.Inventory)),o(3),d("href",i.getHyperlinkSellerCenter(t),b)("ngClass",R(16,Dt,t.TypeID==i.channelType.KalCare))("matTooltip",t.TypeID!=i.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function Vt(e,p){if(e&1&&g(0,wt,20,18,"tr",9),e&2){let t=h().$implicit;d("ngForOf",t==null?null:t.Channel)}}function Nt(e,p){if(e&1&&(G(0),g(1,Pt,9,2,"ng-container",10)(2,Vt,1,1,"ng-template",null,0,at),H()),e&2){let t=p.$implicit,n=it(3);o(),d("ngIf",!t.Channel||t.Channel.length<1)("ngIfElse",n)}}var le=(()=>{class e{constructor(t,n){this.data=t,this.dialogRef=n,this.channelType=s,this.variants=t.variants,this.title=t.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new E,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideCancel=!0,this.modalConfig.hideOk=!0}getChannelLogo(t){return f.getChannelLogoByTypeId(t)}getHyperlinkSellerCenter(t){let n="javascript:void(0)";switch(t.TypeID){case s.Shopee:n=`${v.Shoope}/portal/product/${t.ChannelItemID}`;break;case s.Tiktok:n=`${v.Tiktok}/product/edit/${t.ChannelItemID}`;break;case s.Tokopedia:n=`${v.Tokopedia}/edit-product/${t.ChannelItemID}`;break;case s.WooCommerce:n=`${v.WooCommerce}/wp-admin/post.php?post=${t.ChannelItemID}&action=edit`;break;case s.Lazada:n=`${v.Lazada}/apps/product/publish?productId=${t.ChannelItemID}`;break}return n}static{this.\u0275fac=function(n){return new(n||e)(C(P),C(D))}}static{this.\u0275cmp=T({type:e,selectors:[["app-modal-variant"]],standalone:!1,decls:22,vars:2,consts:[["printChannelModal",""],[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"text-start","sticky-top"],["matTooltip","Variant from POS",1,"fas","fa-info-circle","ms-1"],["matTooltip","Product and Variant from each Channel",1,"fas","fa-info-circle","ms-1"],[1,"text-start","sticky-top",2,"width","0%"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],[1,"text-start"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-start",4,"ngIf"],[1,"d-flex"],["target","_blank",1,"me-1",3,"href","title"],[2,"width","20px","height","20px",3,"src"],[1,"text-ellipsis","ps-2",2,"max-width","18vw",3,"matTooltip"],[1,"text-center"],["target","_blank",1,"btn","btn-small","btn-light","px-4","py-2",3,"href","ngClass","matTooltip"],[1,"fa-solid","fa-pencil","me-2",2,"font-size","10px"],[1,"fs-6"]],template:function(n,i){n&1&&(a(0,"modal-material",1),S("onCancel",function(){return i.dialogRef.close()}),a(1,"div",2)(2,"table",3)(3,"thead",4)(4,"tr")(5,"th",5),r(6," VARIANT "),a(7,"sup"),_(8,"i",6),l()(),a(9,"th",5),r(10,"SKU"),l(),a(11,"th",5),r(12," PRODUCT "),a(13,"sup"),_(14,"i",7),l()(),a(15,"th",5),r(16,"PRICE"),l(),a(17,"th",8),r(18,"INVENTORY"),l(),_(19,"th",5),l()(),a(20,"tbody"),g(21,Nt,4,2,"ng-container",9),l()()()()),n&2&&(d("config",i.modalConfig),o(21),d("ngForOf",i.variants))},dependencies:[W,B,K,O,k,lt],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#fff!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}a.is-disabled[_ngcontent-%COMP%]{color:gray;cursor:default}a.is-disabled[_ngcontent-%COMP%]:hover{text-decoration:none}"]})}}return e})();var Ut=e=>({"bg-gradient-warning":e});function At(e,p){if(e&1&&(a(0,"tr",5)(1,"td"),r(2),l(),a(3,"td",6),r(4),l()()),e&2){let t=p.$implicit;d("matTooltip",t.duplicateMessage),o(2),u(t==null?null:t.Name),o(),d("ngClass",R(4,Ut,t.isDuplicate)),o(),u(t!=null&&t.ChannelVariationSKU?t==null?null:t.ChannelVariationSKU:"Not Assigned")}}var fe=(()=>{class e{constructor(t,n){this.data=t,this.dialogRef=n,this.variants=Z([])}ngOnInit(){this.initModalConfig(),this.initVariants()}initVariants(){let t=this.data?.variants,n={},i=[],m=t.filter(c=>f.IsEmpty(c.ChannelVariationSKU));t.filter(c=>f.IsNotEmpty(c.ChannelVariationSKU)).forEach((c,M,J)=>{n[c.ChannelVariationSKU]=J.filter(w=>w.ChannelVariationSKU===c.ChannelVariationSKU)}),Object.keys(n).forEach(c=>{n[c].length>1&&(n[c]=n[c].map((M,J,w)=>{let Y=`SKU ${M.ChannelVariationSKU} is duplicated with variant`;return w.forEach(($,vt)=>{$.Name!==M.Name&&(Y+=` ${w.length>2?$.Name+(vt!==w.length-1?",":""):$.Name}`)}),M.duplicateMessage=Y,M.isDuplicate=!0,M})),i.push(...n[c])}),i.push(...m),this.variants.set(i)}initModalConfig(){this.modalConfig=new E,this.modalConfig.title=this.data?.title,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0,this.modalConfig.bodyScrollable=!0}static{this.\u0275fac=function(n){return new(n||e)(C(P),C(D))}}static{this.\u0275cmp=T({type:e,selectors:[["app-modal-variants"]],standalone:!1,decls:12,vars:1,consts:[[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"sticky-top"],["matTooltipPosition","above",3,"matTooltip"],[3,"ngClass"]],template:function(n,i){n&1&&(a(0,"modal-material",0),S("onCancel",function(){return i.dialogRef.close()}),a(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4),r(6,"Variant"),l(),a(7,"th",4),r(8,"SKU"),l()()(),a(9,"tbody"),et(10,At,5,6,"tr",5,tt),l()()()()),n&2&&(d("config",i.modalConfig),o(10),nt(i.variants()))},dependencies:[W,O,k],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#f6f6f6!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}"]})}}return e})();export{Xt as a,le as b,fe as c};
1
+ import{a as pt}from"./chunk-UVMSTT2I.js";import{a as Ct}from"./chunk-23MIIDCT.js";import{a as mt,b as ct}from"./chunk-K5CKXDIJ.js";import{c as ft}from"./chunk-E24BKGBJ.js";import{f as ht}from"./chunk-4RAOUTR2.js";import{b as D,c as P,i as E,j as k}from"./chunk-XOT2SZPE.js";import{r as O}from"./chunk-AKJ4I7KF.js";import{h as dt,m as st}from"./chunk-AI4XRCAL.js";import{b as s,c as f}from"./chunk-W6T7TOHE.js";import{G as rt,d as W,f as B,g as K,j as ot,m as lt}from"./chunk-B6POIFQM.js";import{Dc as it,Eb as T,Ec as r,Fc as u,Gc as y,Ic as V,Jc as N,Kb as g,Kc as U,Oc as R,Qa as Z,Vb as j,Wb as d,Xc as I,Yc as x,Z as Q,_c as at,bc as z,cc as tt,ec as et,fc as nt,gc as a,hc as l,ic as _,jc as G,kc as H,mc as F,ob as b,pa as X,qb as o,rc as S,sc as h,v as q,wb as C,ya as A,za as L}from"./chunk-EIQCOZF5.js";function Mt(e,p){if(e&1&&(a(0,"mat-option",10)(1,"div",11),_(2,"img",12),a(3,"span"),r(4),l()()()),e&2){let t=p.$implicit;d("value",t.ID)("disabled",t.disabled),o(),d("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),o(),d("src",t.Img,b),o(2),u(t.Name)}}function bt(e,p){if(e&1){let t=F();a(0,"div",13)(1,"label",14),r(2,"Scan Type"),l(),a(3,"mat-radio-group",15),U("ngModelChange",function(i){A(t);let m=h();return N(m.filter.ScanFull,i)||(m.filter.ScanFull=i),L(i)}),a(4,"mat-radio-button",16),r(5," Full (Include Inactive Products) "),l(),a(6,"mat-radio-button",17),r(7," Active "),l()()()}if(e&2){let t=h();o(3),V("ngModel",t.filter.ScanFull),o(),d("value",!0),o(2),d("value",!1)}}function Tt(e,p){e&1&&(a(0,"span"),r(1,"Never"),l())}function It(e,p){if(e&1&&(a(0,"span"),r(1),I(2,"async"),l()),e&2){let t=h(2);o(),u(x(2,1,t.lastSync$))}}function xt(e,p){if(e&1){let t=F();a(0,"div",8)(1,"label",3)(2,"span",18),r(3,"Last Scan:"),l(),g(4,Tt,2,0,"span"),I(5,"async"),g(6,It,3,3,"span"),l(),a(7,"mat-radio-group",19),U("ngModelChange",function(i){A(t);let m=h();return N(m.filter.UpdatedProduct,i)||(m.filter.UpdatedProduct=i),L(i)}),a(8,"mat-radio-button",20),r(9," Scan All Products "),l(),a(10,"mat-radio-button",21),r(11),l()()()}if(e&2){let t=h();o(4),z(x(5,6,t.lastSync$)==null?4:6),o(3),V("ngModel",t.filter.UpdatedProduct),o(),d("value",!1),o(2),d("value",!0)("matTooltip",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Use Tokopedia URL for mapping SKU between POS and Tokopedia":"Scan only products that have been updated since the last channel scan"),o(),y(" ",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Product Download By URL":"Scan Updated Products"," ")}}function Ot(e,p){if(e&1){let t=F();a(0,"div",8)(1,"label",3),r(2," Scan Option "),l(),a(3,"mat-radio-group",22),U("ngModelChange",function(i){A(t);let m=h();return N(m.filter.Async,i)||(m.filter.Async=i),L(i)}),a(4,"mat-radio-button",23),r(5," Asynchronous (Get Notified when Complete) "),l(),a(6,"mat-radio-button",24),r(7," Synchronous (Wait until Complete) "),l()()()}if(e&2){let t=h();o(3),V("ngModel",t.filter.Async),o(),d("value",!0),o(2),d("value",!1)}}var Xt=(()=>{class e{constructor(t,n,i){this.dialogRef=t,this.data=n,this.router=i,this.channelService=X(pt),this.channelType=s,this.disabledChannelOption=!1,this.filter={ChannelID:f.GuidEMpty,ScanFull:!0,UpdatedProduct:!1,Async:!1},this.isSingleChannel=f.IsNotEmpty(n.isSingleChannel)?this.data.isSingleChannel:!1,this.disabledChannelOption=f.IsEmpty(n.disabledChannelOption)?!1:this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new E,this.modalConfig.title=this.isSingleChannel?"Scan Single Product":"Scan Channel Marketplace",this.modalConfig.bodyScrollable=!0}initFilter(){this.filter.ChannelID=this.data?.filter?.ChannelID}initChannelOptions(){this.channelOptions=JSON.parse(JSON.stringify(this.data.channelOptions)),this.isSingleChannel&&(this.channelOptions=this.channelOptions.map(t=>(t.disabled=!0,(t.TypeID==s.Tiktok||t.TypeID==s.Tokopedia||t.TypeID==s.Lazada||t.TypeID==s.WooCommerce)&&(t.disabled=!1),t)).sort(t=>t.disabled?1:-1))}onSelectChannel(t){let n=this.filterChannelById(t);this.selectedChannel=n,this.filter.Async=!0,this.iniHasScanUpdate(),this.getLastSync(t)}getLastSync(t){this.lastSync$=this.channelService.getLastSync(t).pipe(q(n=>(this.selectedChannel.LastSync=n.LastSync,this.setDefaultConfigUpdate(),f.IsNotEmpty(n.LastSync)?f.convertToReadableDate(n.LastSync):null)),Q(1))}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&f.IsNotEmpty(this.selectedChannel.LastSync)&&(this.selectedChannel.TypeID==s.Shopee||this.selectedChannel.TypeID==s.Tiktok||this.selectedChannel.TypeID==s.Lazada)&&(this.filter.UpdatedProduct=!0)}iniHasScanUpdate(){this.selectedChannel?.TypeID!=s.WooCommerce&&this.selectedChannel?.TypeID!=s.KalCare&&this.selectedChannel?.TypeID!=s.None&&!this.isSingleChannel?this.hasScanUpdate=!0:this.hasScanUpdate=!1}filterChannelById(t){let n;return this.channelOptions&&(n=this.channelOptions.find(i=>i.ID==t)),n}submit(){this.selectedChannel.TypeID==s.Tokopedia&&this.filter.UpdatedProduct?this.router.navigate(["/menu/products/download/by-url"]).then(()=>{this.dialogRef.close()}):this.dialogRef.close(this.filter)}isNotEmpty(t){return f.IsNotEmpty(t)}onClose(){this.dialogRef.close()}static{this.\u0275fac=function(n){return new(n||e)(C(D),C(P),C(rt))}}static{this.\u0275cmp=T({type:e,selectors:[["app-scan-dialog"]],standalone:!1,decls:11,vars:8,consts:[[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[1,"mx-4"],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"ngModelChange","disabled","ngModel"],["class","channel-option",3,"value","disabled",4,"ngFor","ngForOf"],["class","mt-4",4,"ngIf"],[1,"mt-8"],["class","mt-8",4,"ngIf"],[1,"channel-option",3,"value","disabled"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],[2,"width","18px","margin-right","10px",3,"src"],[1,"mt-4"],[1,"mb-2","fw-bold","mt-3"],["name","scanType",1,"form-control","h-100","round",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Full Scan Product",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Only Active Product",1,"me-5",3,"value"],[1,"me-2"],["name","ScanFull",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Scan product from beginning ( use this if you haven't scanned at all)",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above",1,"me-5",3,"value","matTooltip"],["name","Async",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltip","Scan is running in the background, status will be visible in the notification menu","matTooltipPosition","above",1,"me-5",3,"value"],[1,"me-5",3,"value"]],template:function(n,i){n&1&&(a(0,"modal-material",0),S("onOk",function(){return i.submit()})("onClose",function(){return i.onClose()})("onCancel",function(){return i.onClose()}),a(1,"div",1)(2,"div",2)(3,"label",3),r(4,"Select a Channel"),l(),a(5,"mat-form-field",4)(6,"mat-select",5),U("ngModelChange",function(c){return N(i.filter.ChannelID,c)||(i.filter.ChannelID=c),c}),S("ngModelChange",function(c){return i.onSelectChannel(c)}),g(7,Mt,5,5,"mat-option",6),l()(),g(8,bt,8,3,"div",7)(9,xt,12,8,"div",8)(10,Ot,8,3,"div",9),l()()()),n&2&&(d("dynamicValidated",i.isNotEmpty(i.filter.ChannelID))("config",i.modalConfig),o(6),d("disabled",i.disabledChannelOption),V("ngModel",i.filter.ChannelID),o(),d("ngForOf",i.channelOptions),o(),d("ngIf",!i.isSingleChannel&&i.isNotEmpty(i.filter.ChannelID)),o(),z(i.hasScanUpdate&&i.selectedChannel?9:-1),o(),d("ngIf",!i.isSingleChannel&&i.isNotEmpty(i.filter.ChannelID)))},dependencies:[B,K,dt,st,mt,ct,ht,Ct,ft,O,k,ot],encapsulation:2})}}return e})();var v=function(e){return e.Tokopedia="https://seller.tokopedia.com",e.Shoope="https://seller.shopee.co.id",e.Tiktok="https://seller-id.tiktok.com",e.WooCommerce="https://woocommerce.dealpos.app",e.Lazada="https://sellercenter.lazada.co.id",e}(v||{});var Dt=e=>({"is-disabled":e});function Pt(e,p){if(e&1&&(G(0),a(1,"tr")(2,"td",11),r(3),l(),a(4,"td",11),r(5),l(),a(6,"td",12)(7,"p",13),r(8,"Product Not in Channel!"),l()()(),H()),e&2){let t=h().$implicit;o(3),y(" ",t==null?null:t.Model,""),o(2),y(" ",t==null?null:t.Code,"")}}function Et(e,p){if(e&1&&(a(0,"td",11),r(1),l()),e&2){let t=h(3).$implicit;j("rowspan",t.Channel.length),o(),y(" ",t==null?null:t.Model,"")}}function kt(e,p){if(e&1&&(a(0,"td",11),r(1),l()),e&2){let t=h(3).$implicit;j("rowspan",t.Channel.length),o(),y(" ",t==null?null:t.Code,"")}}function wt(e,p){if(e&1&&(a(0,"tr"),g(1,Et,2,2,"td",14)(2,kt,2,2,"td",14),a(3,"td",11)(4,"div",15)(5,"a",16),_(6,"img",17),l(),a(7,"div",18),r(8),l()()(),a(9,"td",11),r(10),I(11,"number"),l(),a(12,"td",19),r(13),I(14,"number"),l(),a(15,"td",19)(16,"a",20),_(17,"i",21),a(18,"span",22),r(19,"Edit"),l()()()()),e&2){let t=p.$implicit,n=p.index,i=h(3);o(),d("ngIf",n==0),o(),d("ngIf",n==0),o(3),d("href",t.Url,b)("title",t.Title),o(),d("src",i.getChannelLogo(t.TypeID),b),o(),d("matTooltip",(t==null||t.Name==null?null:t.Name.length)>55?t==null?null:t.Name:""),o(),y(" ",t.Name," "),o(2),u(x(11,12,t.Price)),o(3),u(x(14,14,t.Inventory)),o(3),d("href",i.getHyperlinkSellerCenter(t),b)("ngClass",R(16,Dt,t.TypeID==i.channelType.KalCare))("matTooltip",t.TypeID!=i.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function Vt(e,p){if(e&1&&g(0,wt,20,18,"tr",9),e&2){let t=h().$implicit;d("ngForOf",t==null?null:t.Channel)}}function Nt(e,p){if(e&1&&(G(0),g(1,Pt,9,2,"ng-container",10)(2,Vt,1,1,"ng-template",null,0,at),H()),e&2){let t=p.$implicit,n=it(3);o(),d("ngIf",!t.Channel||t.Channel.length<1)("ngIfElse",n)}}var le=(()=>{class e{constructor(t,n){this.data=t,this.dialogRef=n,this.channelType=s,this.variants=t.variants,this.title=t.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new E,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideCancel=!0,this.modalConfig.hideOk=!0}getChannelLogo(t){return f.getChannelLogoByTypeId(t)}getHyperlinkSellerCenter(t){let n="javascript:void(0)";switch(t.TypeID){case s.Shopee:n=`${v.Shoope}/portal/product/${t.ChannelItemID}`;break;case s.Tiktok:n=`${v.Tiktok}/product/edit/${t.ChannelItemID}`;break;case s.Tokopedia:n=`${v.Tokopedia}/edit-product/${t.ChannelItemID}`;break;case s.WooCommerce:n=`${v.WooCommerce}/wp-admin/post.php?post=${t.ChannelItemID}&action=edit`;break;case s.Lazada:n=`${v.Lazada}/apps/product/publish?productId=${t.ChannelItemID}`;break}return n}static{this.\u0275fac=function(n){return new(n||e)(C(P),C(D))}}static{this.\u0275cmp=T({type:e,selectors:[["app-modal-variant"]],standalone:!1,decls:22,vars:2,consts:[["printChannelModal",""],[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"text-start","sticky-top"],["matTooltip","Variant from POS",1,"fas","fa-info-circle","ms-1"],["matTooltip","Product and Variant from each Channel",1,"fas","fa-info-circle","ms-1"],[1,"text-start","sticky-top",2,"width","0%"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],[1,"text-start"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-start",4,"ngIf"],[1,"d-flex"],["target","_blank",1,"me-1",3,"href","title"],[2,"width","20px","height","20px",3,"src"],[1,"text-ellipsis","ps-2",2,"max-width","18vw",3,"matTooltip"],[1,"text-center"],["target","_blank",1,"btn","btn-small","btn-light","px-4","py-2",3,"href","ngClass","matTooltip"],[1,"fa-solid","fa-pencil","me-2",2,"font-size","10px"],[1,"fs-6"]],template:function(n,i){n&1&&(a(0,"modal-material",1),S("onCancel",function(){return i.dialogRef.close()}),a(1,"div",2)(2,"table",3)(3,"thead",4)(4,"tr")(5,"th",5),r(6," VARIANT "),a(7,"sup"),_(8,"i",6),l()(),a(9,"th",5),r(10,"SKU"),l(),a(11,"th",5),r(12," PRODUCT "),a(13,"sup"),_(14,"i",7),l()(),a(15,"th",5),r(16,"PRICE"),l(),a(17,"th",8),r(18,"INVENTORY"),l(),_(19,"th",5),l()(),a(20,"tbody"),g(21,Nt,4,2,"ng-container",9),l()()()()),n&2&&(d("config",i.modalConfig),o(21),d("ngForOf",i.variants))},dependencies:[W,B,K,O,k,lt],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#fff!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}a.is-disabled[_ngcontent-%COMP%]{color:gray;cursor:default}a.is-disabled[_ngcontent-%COMP%]:hover{text-decoration:none}"]})}}return e})();var Ut=e=>({"bg-gradient-warning":e});function At(e,p){if(e&1&&(a(0,"tr",5)(1,"td"),r(2),l(),a(3,"td",6),r(4),l()()),e&2){let t=p.$implicit;d("matTooltip",t.duplicateMessage),o(2),u(t==null?null:t.Name),o(),d("ngClass",R(4,Ut,t.isDuplicate)),o(),u(t!=null&&t.ChannelVariationSKU?t==null?null:t.ChannelVariationSKU:"Not Assigned")}}var fe=(()=>{class e{constructor(t,n){this.data=t,this.dialogRef=n,this.variants=Z([])}ngOnInit(){this.initModalConfig(),this.initVariants()}initVariants(){let t=this.data?.variants,n={},i=[],m=t.filter(c=>f.IsEmpty(c.ChannelVariationSKU));t.filter(c=>f.IsNotEmpty(c.ChannelVariationSKU)).forEach((c,M,J)=>{n[c.ChannelVariationSKU]=J.filter(w=>w.ChannelVariationSKU===c.ChannelVariationSKU)}),Object.keys(n).forEach(c=>{n[c].length>1&&(n[c]=n[c].map((M,J,w)=>{let Y=`SKU ${M.ChannelVariationSKU} is duplicated with variant`;return w.forEach(($,vt)=>{$.Name!==M.Name&&(Y+=` ${w.length>2?$.Name+(vt!==w.length-1?",":""):$.Name}`)}),M.duplicateMessage=Y,M.isDuplicate=!0,M})),i.push(...n[c])}),i.push(...m),this.variants.set(i)}initModalConfig(){this.modalConfig=new E,this.modalConfig.title=this.data?.title,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0,this.modalConfig.bodyScrollable=!0}static{this.\u0275fac=function(n){return new(n||e)(C(P),C(D))}}static{this.\u0275cmp=T({type:e,selectors:[["app-modal-variants"]],standalone:!1,decls:12,vars:1,consts:[[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"sticky-top"],["matTooltipPosition","above",3,"matTooltip"],[3,"ngClass"]],template:function(n,i){n&1&&(a(0,"modal-material",0),S("onCancel",function(){return i.dialogRef.close()}),a(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4),r(6,"Variant"),l(),a(7,"th",4),r(8,"SKU"),l()()(),a(9,"tbody"),et(10,At,5,6,"tr",5,tt),l()()()()),n&2&&(d("config",i.modalConfig),o(10),nt(i.variants()))},dependencies:[W,O,k],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#f6f6f6!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}"]})}}return e})();export{Xt as a,le as b,fe as c};
@@ -1 +1 @@
1
- import{a as ie}from"./chunk-6HVHZ3HN.js";import{a as ae,b as le}from"./chunk-YQSHLQDX.js";import"./chunk-OVYL7SOO.js";import"./chunk-T7KM2WP6.js";import"./chunk-VOISFPEM.js";import"./chunk-BSATGCWC.js";import"./chunk-6A4PYMCJ.js";import"./chunk-3RK6DDJD.js";import{a as oe,b as re}from"./chunk-WYOXUN3H.js";import"./chunk-23MIIDCT.js";import"./chunk-SD7UKXTX.js";import"./chunk-E24BKGBJ.js";import"./chunk-VKJAFLQ6.js";import"./chunk-TY4H2W6F.js";import"./chunk-SDUUFQUI.js";import"./chunk-HPS3WVU5.js";import"./chunk-R5IDWUP6.js";import"./chunk-4RAOUTR2.js";import{a as X,b as Z,d as $,e as ee}from"./chunk-TTAS23MO.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import{j as Q}from"./chunk-7CIOGSCS.js";import{e as K}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{l as te,m as ne}from"./chunk-XOT2SZPE.js";import"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{c as j,h as q,m as G,o as H,y as Y}from"./chunk-AI4XRCAL.js";import{c as J}from"./chunk-W6T7TOHE.js";import{H as A,J as U,f as W,g as F,k as B,m as k,n as z}from"./chunk-B6POIFQM.js";import{Dc as P,Eb as M,Ec as l,Fc as S,Gc as y,Ic as c,Jc as u,Kb as w,Kc as h,Oc as I,Wb as m,Xc as L,Yc as N,Zc as V,_c as R,gc as t,hc as n,ic as C,jc as T,kc as x,mc as O,ob as b,qb as r,rc as E,sc as v,wb as D,ya as p,za as s}from"./chunk-EIQCOZF5.js";import"./chunk-K2H6WANG.js";var de=a=>({ID:a});function me(a,f){if(a&1&&(t(0,"span",17),C(1,"img",18),n(),l(2)),a&2){let e=f.item;r(),m("src",e.Img,b)("alt",e.Name),r(),y(" ",e.Name," ")}}function pe(a,f){if(a&1&&(t(0,"tr")(1,"td"),l(2),n(),t(3,"td"),C(4,"img",28),n(),t(5,"td"),l(6),n(),t(7,"td",29)(8,"a",30),l(9),L(10,"number"),n()(),t(11,"td"),l(12),n(),t(13,"td"),l(14),L(15,"date"),n()()),a&2){let e=f.$implicit;r(2),S(e._source.ChannelName),r(2),m("src",e.logo,b),r(2),S(e._source.DateRange),r(2),m("queryParams",I(12,de,e._source.ID)),r(),y(" ",N(10,7,e._source.CountOrder)," "),r(3),S(e._source.UserLogin),r(2),y(" ",V(15,9,e._source["@timestamp_received"],"dd MMM yyyy hh:mm")," ")}}function se(a,f){if(a&1){let e=O();T(0),t(1,"div",19)(2,"table",20)(3,"thead")(4,"tr",21)(5,"th",22),l(6,"Channel"),n(),t(7,"th",23),l(8,"Type"),n(),t(9,"th",24),l(10,"Download Date Range"),n(),t(11,"th",25),l(12,"Count"),n(),t(13,"th"),l(14,"User Login"),n(),t(15,"th"),l(16,"Created"),n()()(),t(17,"tbody"),w(18,pe,16,14,"tr",26),n()(),t(19,"mat-paginator",27),E("page",function(i){p(e);let d=v();return s(d.onPaginationChange(i))}),n()(),x()}if(a&2){let e=v();r(18),m("ngForOf",e.downloadOrders),r(),m("length",e.paginationTotal)("pageSize",e.paginationPageSize)("pageIndex",(e.filter==null?null:e.filter.PageNumber)==0?0:(e.filter==null?null:e.filter.PageNumber)-1)}}function ge(a,f){a&1&&(t(0,"div",31),C(1,"app-empty-state"),n())}var Ie=(()=>{class a{constructor(e,g){this.http=e,this.authService=g,this.filter={PageNumber:0,RowCount:20,ChannelID:"",From:"",To:""},this.channelOptions=this.authService.getChannels(),this.onGetLoader()}onGetLoader(){this.http.post("/api/OrdersLoader/OrderLogsLoader",{}).subscribe(e=>{this.filter=e.Filter,this.getDownloadOrders()})}getDownloadOrders(){this.http.post("api/Orders/OrderLogsPaged",this.filter).subscribe(e=>{this.downloadOrders=e.hits,this.setChannelLogo(),this.paginationTotal=e.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}setChannelLogo(){this.downloadOrders=this.downloadOrders.map(e=>(e.logo=J.getChannelLogoByTypeId(e._source.TypeID),e))}onPaginationChange(e){this.filter.PageNumber=e.pageIndex+1,this.getDownloadOrders()}static{this.\u0275fac=function(g){return new(g||a)(D(K),D(Q))}}static{this.\u0275cmp=M({type:a,selectors:[["app-download-order-log"]],decls:29,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","Download Order Log",3,"onSubmit","hideSearchBox"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold","mb-1"],[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","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[2,"width","200px"],[1,"text-end",2,"width","200px"],[4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],[2,"width","25px",3,"src"],[1,"text-end"],["routerLink","/menu/Order/Download_Order_Log/Detail",3,"queryParams"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(g,i){if(g&1){let d=O();t(0,"mainpanel",1),E("onSubmit",function(){return p(d),s(i.getDownloadOrders())}),t(1,"filters")(2,"div")(3,"label",2),l(4,"Channel"),n(),t(5,"ng-select",3),h("ngModelChange",function(o){return p(d),u(i.filter.ChannelID,o)||(i.filter.ChannelID=o),s(o)}),w(6,me,3,3,"ng-template",4),n()(),t(7,"div",5)(8,"label",6),l(9,"From/To"),n(),t(10,"div",7)(11,"datepicker",8),h("dateChange",function(o){return p(d),u(i.filter.From,o)||(i.filter.From=o),s(o)}),n()(),t(12,"div")(13,"datepicker",9),h("dateChange",function(o){return p(d),u(i.filter.To,o)||(i.filter.To=o),s(o)}),n()()(),t(14,"div",5)(15,"label",10),l(16,"Page Number"),n(),t(17,"input",11),h("ngModelChange",function(o){return p(d),u(i.filter.PageNumber,o)||(i.filter.PageNumber=o),s(o)}),n()(),t(18,"div",5)(19,"label",10),l(20,"Page Size"),n(),t(21,"input",12),h("ngModelChange",function(o){return p(d),u(i.filter.RowCount,o)||(i.filter.RowCount=o),s(o)}),n()()(),t(22,"content")(23,"div",13)(24,"div",14)(25,"div",15),w(26,se,20,4,"ng-container",16)(27,ge,2,0,"ng-template",null,0,R),n()()()()()}if(g&2){let d=P(28);m("hideSearchBox",!0),r(5),m("clearable",!0)("items",i.channelOptions),c("ngModel",i.filter.ChannelID),r(6),c("date",i.filter.From),r(2),c("date",i.filter.To),r(4),c("ngModel",i.filter.PageNumber),r(4),c("ngModel",i.filter.RowCount),r(5),m("ngIf",(i.downloadOrders==null?null:i.downloadOrders.length)>0)("ngIfElse",d)}},dependencies:[z,W,F,k,B,re,oe,ne,te,ee,$,X,Z,Y,j,H,q,G,le,ae,U,A,ie],encapsulation:2})}}return a})();export{Ie as DownloadOrderLogComponent};
1
+ import{a as ie}from"./chunk-6HVHZ3HN.js";import{a as ae,b as le}from"./chunk-YQSHLQDX.js";import"./chunk-OVYL7SOO.js";import"./chunk-T7KM2WP6.js";import"./chunk-VOISFPEM.js";import"./chunk-BSATGCWC.js";import"./chunk-6A4PYMCJ.js";import"./chunk-3RK6DDJD.js";import{a as oe,b as re}from"./chunk-WYOXUN3H.js";import"./chunk-23MIIDCT.js";import"./chunk-SD7UKXTX.js";import"./chunk-E24BKGBJ.js";import"./chunk-VKJAFLQ6.js";import"./chunk-TY4H2W6F.js";import"./chunk-SDUUFQUI.js";import"./chunk-HPS3WVU5.js";import"./chunk-R5IDWUP6.js";import"./chunk-4RAOUTR2.js";import{a as X,b as Z,d as $,e as ee}from"./chunk-TTAS23MO.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import{j as Q}from"./chunk-4Y3XPT4V.js";import{e as K}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{l as te,m as ne}from"./chunk-XOT2SZPE.js";import"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{c as j,h as q,m as G,o as H,y as Y}from"./chunk-AI4XRCAL.js";import{c as J}from"./chunk-W6T7TOHE.js";import{H as A,J as U,f as W,g as F,k as B,m as k,n as z}from"./chunk-B6POIFQM.js";import{Dc as P,Eb as M,Ec as l,Fc as S,Gc as y,Ic as c,Jc as u,Kb as w,Kc as h,Oc as I,Wb as m,Xc as L,Yc as N,Zc as V,_c as R,gc as t,hc as n,ic as C,jc as T,kc as x,mc as O,ob as b,qb as r,rc as E,sc as v,wb as D,ya as p,za as s}from"./chunk-EIQCOZF5.js";import"./chunk-K2H6WANG.js";var de=a=>({ID:a});function me(a,f){if(a&1&&(t(0,"span",17),C(1,"img",18),n(),l(2)),a&2){let e=f.item;r(),m("src",e.Img,b)("alt",e.Name),r(),y(" ",e.Name," ")}}function pe(a,f){if(a&1&&(t(0,"tr")(1,"td"),l(2),n(),t(3,"td"),C(4,"img",28),n(),t(5,"td"),l(6),n(),t(7,"td",29)(8,"a",30),l(9),L(10,"number"),n()(),t(11,"td"),l(12),n(),t(13,"td"),l(14),L(15,"date"),n()()),a&2){let e=f.$implicit;r(2),S(e._source.ChannelName),r(2),m("src",e.logo,b),r(2),S(e._source.DateRange),r(2),m("queryParams",I(12,de,e._source.ID)),r(),y(" ",N(10,7,e._source.CountOrder)," "),r(3),S(e._source.UserLogin),r(2),y(" ",V(15,9,e._source["@timestamp_received"],"dd MMM yyyy hh:mm")," ")}}function se(a,f){if(a&1){let e=O();T(0),t(1,"div",19)(2,"table",20)(3,"thead")(4,"tr",21)(5,"th",22),l(6,"Channel"),n(),t(7,"th",23),l(8,"Type"),n(),t(9,"th",24),l(10,"Download Date Range"),n(),t(11,"th",25),l(12,"Count"),n(),t(13,"th"),l(14,"User Login"),n(),t(15,"th"),l(16,"Created"),n()()(),t(17,"tbody"),w(18,pe,16,14,"tr",26),n()(),t(19,"mat-paginator",27),E("page",function(i){p(e);let d=v();return s(d.onPaginationChange(i))}),n()(),x()}if(a&2){let e=v();r(18),m("ngForOf",e.downloadOrders),r(),m("length",e.paginationTotal)("pageSize",e.paginationPageSize)("pageIndex",(e.filter==null?null:e.filter.PageNumber)==0?0:(e.filter==null?null:e.filter.PageNumber)-1)}}function ge(a,f){a&1&&(t(0,"div",31),C(1,"app-empty-state"),n())}var Ie=(()=>{class a{constructor(e,g){this.http=e,this.authService=g,this.filter={PageNumber:0,RowCount:20,ChannelID:"",From:"",To:""},this.channelOptions=this.authService.getChannels(),this.onGetLoader()}onGetLoader(){this.http.post("/api/OrdersLoader/OrderLogsLoader",{}).subscribe(e=>{this.filter=e.Filter,this.getDownloadOrders()})}getDownloadOrders(){this.http.post("api/Orders/OrderLogsPaged",this.filter).subscribe(e=>{this.downloadOrders=e.hits,this.setChannelLogo(),this.paginationTotal=e.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}setChannelLogo(){this.downloadOrders=this.downloadOrders.map(e=>(e.logo=J.getChannelLogoByTypeId(e._source.TypeID),e))}onPaginationChange(e){this.filter.PageNumber=e.pageIndex+1,this.getDownloadOrders()}static{this.\u0275fac=function(g){return new(g||a)(D(K),D(Q))}}static{this.\u0275cmp=M({type:a,selectors:[["app-download-order-log"]],decls:29,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","Download Order Log",3,"onSubmit","hideSearchBox"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold","mb-1"],[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","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[2,"width","200px"],[1,"text-end",2,"width","200px"],[4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],[2,"width","25px",3,"src"],[1,"text-end"],["routerLink","/menu/Order/Download_Order_Log/Detail",3,"queryParams"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(g,i){if(g&1){let d=O();t(0,"mainpanel",1),E("onSubmit",function(){return p(d),s(i.getDownloadOrders())}),t(1,"filters")(2,"div")(3,"label",2),l(4,"Channel"),n(),t(5,"ng-select",3),h("ngModelChange",function(o){return p(d),u(i.filter.ChannelID,o)||(i.filter.ChannelID=o),s(o)}),w(6,me,3,3,"ng-template",4),n()(),t(7,"div",5)(8,"label",6),l(9,"From/To"),n(),t(10,"div",7)(11,"datepicker",8),h("dateChange",function(o){return p(d),u(i.filter.From,o)||(i.filter.From=o),s(o)}),n()(),t(12,"div")(13,"datepicker",9),h("dateChange",function(o){return p(d),u(i.filter.To,o)||(i.filter.To=o),s(o)}),n()()(),t(14,"div",5)(15,"label",10),l(16,"Page Number"),n(),t(17,"input",11),h("ngModelChange",function(o){return p(d),u(i.filter.PageNumber,o)||(i.filter.PageNumber=o),s(o)}),n()(),t(18,"div",5)(19,"label",10),l(20,"Page Size"),n(),t(21,"input",12),h("ngModelChange",function(o){return p(d),u(i.filter.RowCount,o)||(i.filter.RowCount=o),s(o)}),n()()(),t(22,"content")(23,"div",13)(24,"div",14)(25,"div",15),w(26,se,20,4,"ng-container",16)(27,ge,2,0,"ng-template",null,0,R),n()()()()()}if(g&2){let d=P(28);m("hideSearchBox",!0),r(5),m("clearable",!0)("items",i.channelOptions),c("ngModel",i.filter.ChannelID),r(6),c("date",i.filter.From),r(2),c("date",i.filter.To),r(4),c("ngModel",i.filter.PageNumber),r(4),c("ngModel",i.filter.RowCount),r(5),m("ngIf",(i.downloadOrders==null?null:i.downloadOrders.length)>0)("ngIfElse",d)}},dependencies:[z,W,F,k,B,re,oe,ne,te,ee,$,X,Z,Y,j,H,q,G,le,ae,U,A,ie],encapsulation:2})}}return a})();export{Ie as DownloadOrderLogComponent};
@@ -1 +1 @@
1
- import{b as c}from"./chunk-ARIW575T.js";import{a as l}from"./chunk-SE5GYDNR.js";import"./chunk-7CIOGSCS.js";import"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import{m as u}from"./chunk-XOT2SZPE.js";import"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{y as s}from"./chunk-AI4XRCAL.js";import"./chunk-W6T7TOHE.js";import{F as a,J as n,n as i}from"./chunk-B6POIFQM.js";import{Eb as p,Fb as r,ic as d,ka as e}from"./chunk-EIQCOZF5.js";import"./chunk-K2H6WANG.js";var M=(()=>{class t{constructor(){}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=p({type:t,selectors:[["app-report"]],standalone:!1,decls:1,vars:0,template:function(o,C){o&1&&d(0,"router-outlet")},dependencies:[a],styles:["ul[_ngcontent-%COMP%] > li.dropdown-item[_ngcontent-%COMP%]{font-size:.6875rem!important}"]})}}return t})();var R=[{path:"",component:M,children:[{path:"",redirectTo:"order",pathMatch:"full"},{path:"order",loadChildren:()=>import("./chunk-K27IWV7V.js").then(t=>t.OrderModule),canActivate:[l]}]}],h=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275mod=r({type:t})}static{this.\u0275inj=e({imports:[i,n.forChild(R)]})}}return t})();var S=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275mod=r({type:t})}static{this.\u0275inj=e({imports:[i,c,h,s,u,n]})}}return t})();export{S as ReportModule};
1
+ import{b as c}from"./chunk-ARIW575T.js";import{a as l}from"./chunk-PXXXV722.js";import"./chunk-4Y3XPT4V.js";import"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import{m as u}from"./chunk-XOT2SZPE.js";import"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{y as s}from"./chunk-AI4XRCAL.js";import"./chunk-W6T7TOHE.js";import{F as a,J as n,n as i}from"./chunk-B6POIFQM.js";import{Eb as p,Fb as r,ic as d,ka as e}from"./chunk-EIQCOZF5.js";import"./chunk-K2H6WANG.js";var M=(()=>{class t{constructor(){}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=p({type:t,selectors:[["app-report"]],standalone:!1,decls:1,vars:0,template:function(o,C){o&1&&d(0,"router-outlet")},dependencies:[a],styles:["ul[_ngcontent-%COMP%] > li.dropdown-item[_ngcontent-%COMP%]{font-size:.6875rem!important}"]})}}return t})();var R=[{path:"",component:M,children:[{path:"",redirectTo:"order",pathMatch:"full"},{path:"order",loadChildren:()=>import("./chunk-PRUGNP4D.js").then(t=>t.OrderModule),canActivate:[l]}]}],h=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275mod=r({type:t})}static{this.\u0275inj=e({imports:[i,n.forChild(R)]})}}return t})();var S=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275mod=r({type:t})}static{this.\u0275inj=e({imports:[i,c,h,s,u,n]})}}return t})();export{S as ReportModule};