marketplacepos 5.43.4 → 5.43.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 (74) hide show
  1. package/Marketplace/{chunk-YRFZDTXH.js → chunk-2Y2VSIHL.js} +1 -1
  2. package/Marketplace/{chunk-7UWULSSK.js → chunk-3MUVNECT.js} +1 -1
  3. package/Marketplace/{chunk-Q6TBOHRA.js → chunk-3TX6JLFF.js} +1 -1
  4. package/Marketplace/{chunk-CATX24UZ.js → chunk-46CA5SER.js} +1 -1
  5. package/Marketplace/{chunk-G6X5CZ34.js → chunk-4JKDNUTX.js} +1 -1
  6. package/Marketplace/{chunk-BLXMX3JN.js → chunk-4Q35WLYQ.js} +1 -1
  7. package/Marketplace/{chunk-ZHZMT7GZ.js → chunk-5DG3HADY.js} +1 -1
  8. package/Marketplace/{chunk-V3NCYRCF.js → chunk-5HO2IJ47.js} +1 -1
  9. package/Marketplace/{chunk-C4XFI4J7.js → chunk-7AQ244V7.js} +1 -1
  10. package/Marketplace/chunk-AJL3CYNX.js +1 -0
  11. package/Marketplace/{chunk-JHEGROJF.js → chunk-BQVXVM7F.js} +1 -1
  12. package/Marketplace/{chunk-2CBZOVID.js → chunk-BRTYGXCD.js} +1 -1
  13. package/Marketplace/{chunk-74FAXIJ6.js → chunk-BXVG56VT.js} +1 -1
  14. package/Marketplace/{chunk-ISRFFTGW.js → chunk-BZIF3CQ5.js} +1 -1
  15. package/Marketplace/chunk-CROOKZYC.js +1 -0
  16. package/Marketplace/{chunk-FNEDIIIS.js → chunk-CRUPQQ56.js} +1 -1
  17. package/Marketplace/{chunk-2YTIJJIP.js → chunk-DEJVMFIS.js} +1 -1
  18. package/Marketplace/chunk-DFMLZFNU.js +1 -0
  19. package/Marketplace/{chunk-32WYK3BN.js → chunk-DRMAONR7.js} +1 -1
  20. package/Marketplace/{chunk-53FUEOBJ.js → chunk-ELDFGVXL.js} +1 -1
  21. package/Marketplace/{chunk-K2GYNGBL.js → chunk-EZY2ATQQ.js} +1 -1
  22. package/Marketplace/{chunk-5DODHGO5.js → chunk-FVFKSAIS.js} +1 -1
  23. package/Marketplace/{chunk-MQQD4OJO.js → chunk-GQLSQKDI.js} +1 -1
  24. package/Marketplace/{chunk-PP3PVKNQ.js → chunk-HFGJVJO2.js} +1 -1
  25. package/Marketplace/chunk-IONDX3X4.js +2 -0
  26. package/Marketplace/chunk-JMPW6NPQ.js +7 -0
  27. package/Marketplace/{chunk-GS3A2D4O.js → chunk-JSZ2HWK6.js} +1 -1
  28. package/Marketplace/{chunk-YMMOJKVP.js → chunk-KFNKVXCN.js} +1 -1
  29. package/Marketplace/{chunk-P42VFND7.js → chunk-KUW2UF4E.js} +1 -1
  30. package/Marketplace/{chunk-MQD5HJA6.js → chunk-LB7PE76T.js} +1 -1
  31. package/Marketplace/{chunk-T6SBAKYS.js → chunk-LRR6JS6H.js} +1 -1
  32. package/Marketplace/{chunk-64IHCPTX.js → chunk-M3XHIUXS.js} +1 -1
  33. package/Marketplace/{chunk-EK4VKN7N.js → chunk-MCOWAYNM.js} +1 -1
  34. package/Marketplace/{chunk-ONLHWPKX.js → chunk-MOR4ZQ3B.js} +1 -1
  35. package/Marketplace/chunk-NKBQM2CA.js +1 -0
  36. package/Marketplace/chunk-NQ4I4MFR.js +1 -0
  37. package/Marketplace/chunk-OPXWL5G6.js +1 -0
  38. package/Marketplace/{chunk-227LB3XT.js → chunk-PFRHV7VB.js} +1 -1
  39. package/Marketplace/{chunk-YB65PX7S.js → chunk-QINGXOOA.js} +1 -1
  40. package/Marketplace/{chunk-JTIFX4RL.js → chunk-QQ5LLQNX.js} +2 -2
  41. package/Marketplace/{chunk-JFUCAI5X.js → chunk-QZEHOQYW.js} +1 -1
  42. package/Marketplace/{chunk-YT3P3EBI.js → chunk-RIR77G7B.js} +1 -1
  43. package/Marketplace/{chunk-43XFDAKY.js → chunk-RVGDKAUB.js} +1 -1
  44. package/Marketplace/{chunk-FTGUKCA5.js → chunk-RXIOO5CN.js} +1 -1
  45. package/Marketplace/{chunk-UWIHXA2S.js → chunk-TAA75BNT.js} +1 -1
  46. package/Marketplace/chunk-TBG76OM6.js +1 -0
  47. package/Marketplace/{chunk-PVY6MYHG.js → chunk-TDZ7YWEM.js} +1 -1
  48. package/Marketplace/{chunk-S5SDX7ZG.js → chunk-USNELOQD.js} +1 -1
  49. package/Marketplace/{chunk-VYIEJVSJ.js → chunk-V6MTRLRN.js} +1 -1
  50. package/Marketplace/{chunk-S2HNMEC2.js → chunk-WAFTFIDQ.js} +1 -1
  51. package/Marketplace/chunk-WDJS26KO.js +1 -0
  52. package/Marketplace/{chunk-3ASK736S.js → chunk-WYEAWOUO.js} +1 -1
  53. package/Marketplace/{chunk-6LN62T32.js → chunk-WZD7N5DN.js} +1 -1
  54. package/Marketplace/{chunk-KDEVWOVI.js → chunk-Y32UC4LV.js} +1 -1
  55. package/Marketplace/chunk-Y77CFR5W.js +1 -0
  56. package/Marketplace/{chunk-5TIGE5UP.js → chunk-YYA3EM3E.js} +1 -1
  57. package/Marketplace/{chunk-Q2U3MMNW.js → chunk-Z2NHQWEV.js} +1 -1
  58. package/Marketplace/{chunk-H4OBICY5.js → chunk-Z5NWWPJP.js} +1 -1
  59. package/Marketplace/{chunk-ADDTLV5D.js → chunk-ZMBJFK7P.js} +2 -2
  60. package/Marketplace/{chunk-GA7T6FWT.js → chunk-ZTKQ3U35.js} +1 -1
  61. package/Marketplace/index.html +2 -2
  62. package/Marketplace/{main-ZMGZIM3D.js → main-ISCOUMZ4.js} +1 -1
  63. package/package.json +1 -1
  64. package/Marketplace/chunk-BTHDOSGS.js +0 -1
  65. package/Marketplace/chunk-DDV4X5WD.js +0 -7
  66. package/Marketplace/chunk-IGXU4VAO.js +0 -1
  67. package/Marketplace/chunk-IRK2APYZ.js +0 -1
  68. package/Marketplace/chunk-JWARXDWM.js +0 -1
  69. package/Marketplace/chunk-LUVP4A3V.js +0 -1
  70. package/Marketplace/chunk-ORD5Z4XI.js +0 -1
  71. package/Marketplace/chunk-R4GAF5EA.js +0 -1
  72. package/Marketplace/chunk-XUL4LU4R.js +0 -1
  73. package/Marketplace/chunk-Y2QG7YNG.js +0 -2
  74. package/Marketplace/chunk-YUCD4HRB.js +0 -1
@@ -1 +1 @@
1
- import{a as D}from"./chunk-G6X5CZ34.js";import{a as fe}from"./chunk-NS46QSCM.js";import"./chunk-SM3P57SO.js";import{a as U}from"./chunk-5DIRXS7I.js";import"./chunk-ECRWEMEV.js";import"./chunk-LZCEM2PC.js";import{a as re}from"./chunk-Z3ITXK3D.js";import{a as pe}from"./chunk-ACIMXBIC.js";import"./chunk-V3NCYRCF.js";import{c as oe}from"./chunk-PW42BQIY.js";import{b as le,c as se}from"./chunk-SWQXSJ7O.js";import{b as ae}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as me,n as ue}from"./chunk-CLER2MX6.js";import{A as ie}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{r as de,s as ce}from"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{E as Y,G as ee,H as te,J as ne,d as K,g as Q,j as W,m as X,n as P}from"./chunk-M2FCTYGU.js";import{$c as _,Gb as x,Gc as s,Hc as h,Ic as z,Jb as L,Mb as m,Nc as q,Oc as $,Pc as C,Qc as j,Sc as I,Tc as J,Yb as p,Z as V,aa as w,ac as S,ad as y,dc as T,ec as k,gc as A,hc as H,ic as a,jc as l,kc as u,lc as g,mc as v,ob as F,oc as B,pa as b,rb as r,rd as Z,tc as G,uc as c,v as M,ya as N,za as R}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import{a as E,b as O}from"./chunk-66YHNWRR.js";var ge=(()=>{class t{transform(e){return typeof e=="number"&&(e=e.toString()),e!=null?e.replace(/\n/g,"<br />"):e}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275pipe=L({name:"newlines",type:t,pure:!0})}}return t})();var Ce=t=>({disabled:t}),_e=(t,d)=>({labelFilledInput:t,labelEmptyInput:d});function ye(t,d){if(t&1&&(a(0,"p"),s(1),_(2,"number"),l()),t&2){let e=c();r(),h(e.inputValueType()==="number"?y(2,1,e.inputValue):e.inputValue)}}function xe(t,d){if(t&1&&(u(0,"p",3),_(1,"newlines")),t&2){let e=c();p("innerHTML",y(1,1,e.inputValue),F)}}function Ie(t,d){if(t&1&&(g(0),s(1),v()),t&2){let e=c();r(),z(" ",e.labelValue," ")}}var ve=(()=>{class t{constructor(){this.inputValue="",this.labelValue="",this.inputType="input",this.labelVisible=!0,this.disabled=!1,this.class="mb-6",this.tooltip="",this.isInputFilled=!1,this.isNotEmpty=pe.IsNotEmpty}inputValueType(){return typeof this.inputValue}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=x({type:t,selectors:[["lib-info-page-input"]],inputs:{inputValue:"inputValue",labelValue:"labelValue",inputType:"inputType",labelVisible:"labelVisible",disabled:"disabled",class:"class",tooltip:"tooltip"},decls:5,vars:14,consts:[["matTooltipPosition","above",3,"ngClass","matTooltip"],[4,"ngIf"],[3,"innerHTML",4,"ngIf"],[3,"innerHTML"]],template:function(o,n){o&1&&(a(0,"div",0),m(1,ye,3,3,"p",1)(2,xe,2,3,"p",2),a(3,"label"),m(4,Ie,2,1,"ng-container",1),l()()),o&2&&(S(n.class),p("ngClass",I(9,Ce,n.disabled))("matTooltip",n.tooltip),r(),p("ngIf",n.isNotEmpty(n.inputValue)&&n.inputType=="input"),r(),p("ngIf",n.isNotEmpty(n.inputValue)&&n.inputType=="textarea"),r(),S(J(11,_e,n.isNotEmpty(n.inputValue),!n.isNotEmpty(n.inputValue))),r(),p("ngIf",n.labelVisible))},dependencies:[P,K,Q,X,ge,ce,de],styles:["div[_ngcontent-%COMP%]{border:1px solid #ced4da;position:relative;margin-bottom:1rem;border-radius:.25rem!important}p[_ngcontent-%COMP%]{margin-top:18px;margin-bottom:18px;padding-left:.75rem!important;font-size:.875rem}.labelFilledInput[_ngcontent-%COMP%]{position:absolute;top:-10px;left:10px;background:#fff;padding-left:4px;padding-right:4px;font-size:.75rem!important;color:#9da2a6}.labelEmptyInput[_ngcontent-%COMP%]{margin-top:18px;margin-bottom:18px;padding-left:.75rem!important;font-size:.875rem;color:#ccc}.disabled[_ngcontent-%COMP%]{background-color:#e9ecef;opacity:1}"]})}}return t})();var Pe=t=>({ID:t});function Me(t,d){if(t&1){let e=B();a(0,"button",24),G("click",function(){N(e);let n=c(2),i=C(0);return R(n.onDeleteUser(i==null||i.selectedUser==null?null:i.selectedUser.ID))}),u(1,"i",25),s(2," Delete "),l()}}function Se(t,d){if(t&1&&(g(0),m(1,Me,3,0,"button",23),v()),t&2){let e,o=c(),n=C(0);r(),T((n==null||n.selectedUser==null?null:n.selectedUser.Name)!==((e=o.currentLoginUser())==null?null:e.username)?1:-1)}}function Te(t,d){if(t&1&&(g(0),a(1,"a",26),u(2,"i",27),s(3," Edit "),l(),v()),t&2){c();let e=C(0);r(),p("queryParams",I(1,Pe,e==null||e.selectedUser==null?null:e.selectedUser.ID))}}function Ue(t,d){t&1&&(a(0,"div",20),s(1," All channels assigned to this user "),l())}function De(t,d){if(t&1&&u(0,"p-chip",28),t&2){let e=d.$implicit;p("label",e.Name)("image",e.logo)("alt",e.Name)}}function Ee(t,d){if(t&1&&A(0,De,1,3,"p-chip",28,k),t&2){c();let e=C(0);H(e==null?null:e.selectedChannels)}}var ot=(()=>{class t{constructor(){this.userService=b(D),this.activatedRoute=b(Y),this.toastService=b(ae),this.router=b(ee),this.userLoader$=this.activatedRoute.queryParams.pipe(w(e=>{let o=e.ID||null;return this.userService.getUserFormLoader(o).pipe(V(1),M(n=>(n.Options.Channels=oe.assignChannelLogo(n.Options.Channels),n)))}),M(e=>{let o=e.Options.Users.find(f=>f.ID===e.Form?.ID),n=e.Options.Groups.find(f=>f.ID===e.Form?.GroupID),i=e.Options.Channels.filter(f=>e.UserChannels?.includes(f.ID));return O(E({},e),{selectedUser:o||null,selectedGroup:n||null,selectedChannels:i||[],DownloadOrderDaysRange:e.Form?.DownloadOrderDaysRange||"0"})})),this.userEditRole=U.UserEdit,this.userDeleteRole=U.UserDelete,this.currentLoginUser=Z(()=>{let e=localStorage.getItem(re.AUTHORIZATION);return e?JSON.parse(e):null})}onDeleteUser(e){confirm("Are you sure you want to delete this user?")&&this.userService.deleteUsers([e]).subscribe({next:()=>{this.router.navigate(["/menu/users/users"]),this.toastService.success("User deleted successfully","Success")}})}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-user-info"]],features:[j([D])],decls:50,vars:12,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","group","aria-label","User Actions",1,"btn-group"],[4,"ngxPermissionsOnly"],[1,"container-fluid","py-5","bg-light-gray"],[1,"row","mt-8"],[1,"col-12"],[1,"card"],[1,"card-header"],[1,"card-body","mt-8","pb-4"],[1,"row"],[1,"col-6"],[1,"info-label-group"],["id","myTab","role","tablist",1,"nav","nav-tabs"],["role","presentation",1,"nav-item"],["id","channel-tab","data-bs-toggle","tab","data-bs-target","#channel-tab-pane","type","button","role","tab","aria-controls","channel-tab-pane","aria-selected","true",1,"nav-link","active"],["id","restriction-tab","data-bs-toggle","tab","data-bs-target","#restriction-tab-pane","type","button","role","tab","aria-controls","restriction-tab-pane","aria-selected","false",1,"nav-link"],[1,"card","rounded-0","border-top-0"],[1,"card-body","pb-4"],["id","myTabContent",1,"tab-content"],["id","channel-tab-pane","role","tabpanel","aria-labelledby","channel-tab","tabindex","0",1,"tab-pane","fade","show","active"],[1,"text-center","fs-5","opacity-50"],["id","restriction-tab-pane","role","tabpanel","aria-labelledby","restriction-tab-pane","tabindex","1",1,"tab-pane","fade"],["tooltip","How many days of past orders this user can download.","labelValue","Download Order Days Range","inputType","input",3,"inputValue"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],[1,"fa","fa-trash","me-1"],["role","button","routerLink","/menu/users/users/form",1,"btn","btn-outline-secondary",3,"queryParams"],[1,"fa","fa-edit","me-1"],[1,"me-3","mb-3",2,"--p-chip-image-width","1.2rem","--p-chip-image-height","1.2rem","--p-chip-padding-x","1rem","--p-chip-padding-y","0.5rem","--p-chip-border-radius","0.5rem","--p-chip-font-size","1.2rem",3,"label","image","alt"]],template:function(o,n){if(o&1&&(q(0),_(1,"async"),a(2,"mainpanel",0)(3,"actions")(4,"div",1),m(5,Se,2,1,"ng-container",2)(6,Te,4,3,"ng-container",2),l()(),a(7,"content")(8,"div",3)(9,"div",4)(10,"div",5)(11,"div",6)(12,"div",7)(13,"h3"),s(14,"User Information"),l()(),a(15,"div",8)(16,"div",9)(17,"div",10)(18,"div",11)(19,"label"),s(20,"Selected User"),l(),a(21,"div")(22,"span"),s(23),l()()()(),a(24,"div",10)(25,"div",11)(26,"label"),s(27,"Selected Group"),l(),a(28,"div")(29,"span"),s(30),l()()()()()()()()(),a(31,"div",9)(32,"div",5)(33,"ul",12)(34,"li",13)(35,"button",14),s(36," Channels Filter "),l()(),a(37,"li",13)(38,"button",15),s(39," Restriction "),l()()(),a(40,"div",16)(41,"div",17)(42,"div",18)(43,"div",19),m(44,Ue,2,0,"div",20)(45,Ee,2,0),l(),a(46,"div",21)(47,"div",9)(48,"div",10),u(49,"lib-info-page-input",22),l()()()()()()()()()()()),o&2){let i=$(y(1,9,n.userLoader$));r(2),p("headerTitle",(i==null||i.selectedUser==null?null:i.selectedUser.Name)+" Info")("hideSearchBox",!0)("hideSearchDropdown",!0),r(3),p("ngxPermissionsOnly",n.userDeleteRole),r(),p("ngxPermissionsOnly",n.userEditRole),r(17),h(i==null||i.selectedUser==null?null:i.selectedUser.Name),r(7),h(i==null||i.selectedGroup==null?null:i.selectedGroup.Name),r(14),T((i==null||i.selectedChannels==null?null:i.selectedChannels.length)===0?44:45),r(5),p("inputValue",i==null?null:i.DownloadOrderDaysRange)}},dependencies:[P,W,ue,me,ie,ne,te,fe,se,le,ve],styles:[".nav-tabs[_ngcontent-%COMP%] .nav-link.active[_ngcontent-%COMP%]:hover, .nav-tabs[_ngcontent-%COMP%] .nav-link.active[_ngcontent-%COMP%]:focus, .nav-tabs[_ngcontent-%COMP%] .nav-item.show[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]:hover, .nav-tabs[_ngcontent-%COMP%] .nav-item.show[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]:focus{background-color:#fff!important;border-color:#dee2e6 #dee2e6 #fff}"]})}}return t})();export{ot as UserInfoComponent};
1
+ import{a as D}from"./chunk-4JKDNUTX.js";import{a as fe}from"./chunk-NS46QSCM.js";import"./chunk-SM3P57SO.js";import{a as U}from"./chunk-5DIRXS7I.js";import"./chunk-ECRWEMEV.js";import"./chunk-LZCEM2PC.js";import{a as re}from"./chunk-Z3ITXK3D.js";import{a as pe}from"./chunk-ACIMXBIC.js";import"./chunk-5HO2IJ47.js";import{c as oe}from"./chunk-PW42BQIY.js";import{b as le,c as se}from"./chunk-SWQXSJ7O.js";import{b as ae}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as me,n as ue}from"./chunk-CLER2MX6.js";import{A as ie}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{r as de,s as ce}from"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{E as Y,G as ee,H as te,J as ne,d as K,g as Q,j as W,m as X,n as P}from"./chunk-M2FCTYGU.js";import{$c as _,Gb as x,Gc as s,Hc as h,Ic as z,Jb as L,Mb as m,Nc as q,Oc as $,Pc as C,Qc as j,Sc as I,Tc as J,Yb as p,Z as V,aa as w,ac as S,ad as y,dc as T,ec as k,gc as A,hc as H,ic as a,jc as l,kc as u,lc as g,mc as v,ob as F,oc as B,pa as b,rb as r,rd as Z,tc as G,uc as c,v as M,ya as N,za as R}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import{a as E,b as O}from"./chunk-66YHNWRR.js";var ge=(()=>{class t{transform(e){return typeof e=="number"&&(e=e.toString()),e!=null?e.replace(/\n/g,"<br />"):e}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275pipe=L({name:"newlines",type:t,pure:!0})}}return t})();var Ce=t=>({disabled:t}),_e=(t,d)=>({labelFilledInput:t,labelEmptyInput:d});function ye(t,d){if(t&1&&(a(0,"p"),s(1),_(2,"number"),l()),t&2){let e=c();r(),h(e.inputValueType()==="number"?y(2,1,e.inputValue):e.inputValue)}}function xe(t,d){if(t&1&&(u(0,"p",3),_(1,"newlines")),t&2){let e=c();p("innerHTML",y(1,1,e.inputValue),F)}}function Ie(t,d){if(t&1&&(g(0),s(1),v()),t&2){let e=c();r(),z(" ",e.labelValue," ")}}var ve=(()=>{class t{constructor(){this.inputValue="",this.labelValue="",this.inputType="input",this.labelVisible=!0,this.disabled=!1,this.class="mb-6",this.tooltip="",this.isInputFilled=!1,this.isNotEmpty=pe.IsNotEmpty}inputValueType(){return typeof this.inputValue}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=x({type:t,selectors:[["lib-info-page-input"]],inputs:{inputValue:"inputValue",labelValue:"labelValue",inputType:"inputType",labelVisible:"labelVisible",disabled:"disabled",class:"class",tooltip:"tooltip"},decls:5,vars:14,consts:[["matTooltipPosition","above",3,"ngClass","matTooltip"],[4,"ngIf"],[3,"innerHTML",4,"ngIf"],[3,"innerHTML"]],template:function(o,n){o&1&&(a(0,"div",0),m(1,ye,3,3,"p",1)(2,xe,2,3,"p",2),a(3,"label"),m(4,Ie,2,1,"ng-container",1),l()()),o&2&&(S(n.class),p("ngClass",I(9,Ce,n.disabled))("matTooltip",n.tooltip),r(),p("ngIf",n.isNotEmpty(n.inputValue)&&n.inputType=="input"),r(),p("ngIf",n.isNotEmpty(n.inputValue)&&n.inputType=="textarea"),r(),S(J(11,_e,n.isNotEmpty(n.inputValue),!n.isNotEmpty(n.inputValue))),r(),p("ngIf",n.labelVisible))},dependencies:[P,K,Q,X,ge,ce,de],styles:["div[_ngcontent-%COMP%]{border:1px solid #ced4da;position:relative;margin-bottom:1rem;border-radius:.25rem!important}p[_ngcontent-%COMP%]{margin-top:18px;margin-bottom:18px;padding-left:.75rem!important;font-size:.875rem}.labelFilledInput[_ngcontent-%COMP%]{position:absolute;top:-10px;left:10px;background:#fff;padding-left:4px;padding-right:4px;font-size:.75rem!important;color:#9da2a6}.labelEmptyInput[_ngcontent-%COMP%]{margin-top:18px;margin-bottom:18px;padding-left:.75rem!important;font-size:.875rem;color:#ccc}.disabled[_ngcontent-%COMP%]{background-color:#e9ecef;opacity:1}"]})}}return t})();var Pe=t=>({ID:t});function Me(t,d){if(t&1){let e=B();a(0,"button",24),G("click",function(){N(e);let n=c(2),i=C(0);return R(n.onDeleteUser(i==null||i.selectedUser==null?null:i.selectedUser.ID))}),u(1,"i",25),s(2," Delete "),l()}}function Se(t,d){if(t&1&&(g(0),m(1,Me,3,0,"button",23),v()),t&2){let e,o=c(),n=C(0);r(),T((n==null||n.selectedUser==null?null:n.selectedUser.Name)!==((e=o.currentLoginUser())==null?null:e.username)?1:-1)}}function Te(t,d){if(t&1&&(g(0),a(1,"a",26),u(2,"i",27),s(3," Edit "),l(),v()),t&2){c();let e=C(0);r(),p("queryParams",I(1,Pe,e==null||e.selectedUser==null?null:e.selectedUser.ID))}}function Ue(t,d){t&1&&(a(0,"div",20),s(1," All channels assigned to this user "),l())}function De(t,d){if(t&1&&u(0,"p-chip",28),t&2){let e=d.$implicit;p("label",e.Name)("image",e.logo)("alt",e.Name)}}function Ee(t,d){if(t&1&&A(0,De,1,3,"p-chip",28,k),t&2){c();let e=C(0);H(e==null?null:e.selectedChannels)}}var ot=(()=>{class t{constructor(){this.userService=b(D),this.activatedRoute=b(Y),this.toastService=b(ae),this.router=b(ee),this.userLoader$=this.activatedRoute.queryParams.pipe(w(e=>{let o=e.ID||null;return this.userService.getUserFormLoader(o).pipe(V(1),M(n=>(n.Options.Channels=oe.assignChannelLogo(n.Options.Channels),n)))}),M(e=>{let o=e.Options.Users.find(f=>f.ID===e.Form?.ID),n=e.Options.Groups.find(f=>f.ID===e.Form?.GroupID),i=e.Options.Channels.filter(f=>e.UserChannels?.includes(f.ID));return O(E({},e),{selectedUser:o||null,selectedGroup:n||null,selectedChannels:i||[],DownloadOrderDaysRange:e.Form?.DownloadOrderDaysRange||"0"})})),this.userEditRole=U.UserEdit,this.userDeleteRole=U.UserDelete,this.currentLoginUser=Z(()=>{let e=localStorage.getItem(re.AUTHORIZATION);return e?JSON.parse(e):null})}onDeleteUser(e){confirm("Are you sure you want to delete this user?")&&this.userService.deleteUsers([e]).subscribe({next:()=>{this.router.navigate(["/menu/users/users"]),this.toastService.success("User deleted successfully","Success")}})}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-user-info"]],features:[j([D])],decls:50,vars:12,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","group","aria-label","User Actions",1,"btn-group"],[4,"ngxPermissionsOnly"],[1,"container-fluid","py-5","bg-light-gray"],[1,"row","mt-8"],[1,"col-12"],[1,"card"],[1,"card-header"],[1,"card-body","mt-8","pb-4"],[1,"row"],[1,"col-6"],[1,"info-label-group"],["id","myTab","role","tablist",1,"nav","nav-tabs"],["role","presentation",1,"nav-item"],["id","channel-tab","data-bs-toggle","tab","data-bs-target","#channel-tab-pane","type","button","role","tab","aria-controls","channel-tab-pane","aria-selected","true",1,"nav-link","active"],["id","restriction-tab","data-bs-toggle","tab","data-bs-target","#restriction-tab-pane","type","button","role","tab","aria-controls","restriction-tab-pane","aria-selected","false",1,"nav-link"],[1,"card","rounded-0","border-top-0"],[1,"card-body","pb-4"],["id","myTabContent",1,"tab-content"],["id","channel-tab-pane","role","tabpanel","aria-labelledby","channel-tab","tabindex","0",1,"tab-pane","fade","show","active"],[1,"text-center","fs-5","opacity-50"],["id","restriction-tab-pane","role","tabpanel","aria-labelledby","restriction-tab-pane","tabindex","1",1,"tab-pane","fade"],["tooltip","How many days of past orders this user can download.","labelValue","Download Order Days Range","inputType","input",3,"inputValue"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],[1,"fa","fa-trash","me-1"],["role","button","routerLink","/menu/users/users/form",1,"btn","btn-outline-secondary",3,"queryParams"],[1,"fa","fa-edit","me-1"],[1,"me-3","mb-3",2,"--p-chip-image-width","1.2rem","--p-chip-image-height","1.2rem","--p-chip-padding-x","1rem","--p-chip-padding-y","0.5rem","--p-chip-border-radius","0.5rem","--p-chip-font-size","1.2rem",3,"label","image","alt"]],template:function(o,n){if(o&1&&(q(0),_(1,"async"),a(2,"mainpanel",0)(3,"actions")(4,"div",1),m(5,Se,2,1,"ng-container",2)(6,Te,4,3,"ng-container",2),l()(),a(7,"content")(8,"div",3)(9,"div",4)(10,"div",5)(11,"div",6)(12,"div",7)(13,"h3"),s(14,"User Information"),l()(),a(15,"div",8)(16,"div",9)(17,"div",10)(18,"div",11)(19,"label"),s(20,"Selected User"),l(),a(21,"div")(22,"span"),s(23),l()()()(),a(24,"div",10)(25,"div",11)(26,"label"),s(27,"Selected Group"),l(),a(28,"div")(29,"span"),s(30),l()()()()()()()()(),a(31,"div",9)(32,"div",5)(33,"ul",12)(34,"li",13)(35,"button",14),s(36," Channels Filter "),l()(),a(37,"li",13)(38,"button",15),s(39," Restriction "),l()()(),a(40,"div",16)(41,"div",17)(42,"div",18)(43,"div",19),m(44,Ue,2,0,"div",20)(45,Ee,2,0),l(),a(46,"div",21)(47,"div",9)(48,"div",10),u(49,"lib-info-page-input",22),l()()()()()()()()()()()),o&2){let i=$(y(1,9,n.userLoader$));r(2),p("headerTitle",(i==null||i.selectedUser==null?null:i.selectedUser.Name)+" Info")("hideSearchBox",!0)("hideSearchDropdown",!0),r(3),p("ngxPermissionsOnly",n.userDeleteRole),r(),p("ngxPermissionsOnly",n.userEditRole),r(17),h(i==null||i.selectedUser==null?null:i.selectedUser.Name),r(7),h(i==null||i.selectedGroup==null?null:i.selectedGroup.Name),r(14),T((i==null||i.selectedChannels==null?null:i.selectedChannels.length)===0?44:45),r(5),p("inputValue",i==null?null:i.DownloadOrderDaysRange)}},dependencies:[P,W,ue,me,ie,ne,te,fe,se,le,ve],styles:[".nav-tabs[_ngcontent-%COMP%] .nav-link.active[_ngcontent-%COMP%]:hover, .nav-tabs[_ngcontent-%COMP%] .nav-link.active[_ngcontent-%COMP%]:focus, .nav-tabs[_ngcontent-%COMP%] .nav-item.show[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]:hover, .nav-tabs[_ngcontent-%COMP%] .nav-item.show[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]:focus{background-color:#fff!important;border-color:#dee2e6 #dee2e6 #fff}"]})}}return t})();export{ot as UserInfoComponent};
@@ -0,0 +1 @@
1
+ import{b as Me}from"./chunk-PFB7XEYZ.js";import"./chunk-UEPQYAWE.js";import{a as Ae,b as Pe,c as ke,d as ie,e as oe}from"./chunk-JSZ2HWK6.js";import{a as we}from"./chunk-YHKEECJR.js";import{a as Ne,b as Ue}from"./chunk-BFU7VKO3.js";import{b as Ee}from"./chunk-OC2FBL33.js";import"./chunk-NS46QSCM.js";import"./chunk-JMPW6NPQ.js";import"./chunk-SYUFPF3D.js";import"./chunk-5OHRA4AS.js";import"./chunk-3BT5DR3X.js";import"./chunk-DRHWRRQV.js";import"./chunk-EH6HWI3G.js";import"./chunk-E3ROEHBW.js";import"./chunk-OLOIQI4D.js";import"./chunk-IA6KOBDJ.js";import"./chunk-RECNBAEB.js";import"./chunk-SN4AOGQK.js";import"./chunk-SB7NWPDS.js";import"./chunk-AYPY47VM.js";import"./chunk-SM3P57SO.js";import"./chunk-5DIRXS7I.js";import"./chunk-OZ7LWNOK.js";import"./chunk-ECRWEMEV.js";import"./chunk-LZCEM2PC.js";import{a as Fe,b as Te}from"./chunk-M7NQID2Z.js";import"./chunk-CMTBBXR5.js";import"./chunk-USNELOQD.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import{d as O,e as B}from"./chunk-5JVEEL2T.js";import{b as be,c as _}from"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-DRMAONR7.js";import"./chunk-AEOSNAHH.js";import{e as K}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as Se,n as Ie}from"./chunk-CLER2MX6.js";import{A as Z,B as D,c as te,e as ge,h as $,i as H,m as ye,n as q,q as z,s as J,z as Y}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{r as ve,s as xe}from"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{g as V,j as x,n as S}from"./chunk-M2FCTYGU.js";import{$c as g,Gb as b,Gc as u,Hc as fe,Ic as Q,K as de,Ka as w,Kc as he,Lc as _e,M as ue,Mb as h,Mc as Ce,Oa as re,Qc as v,Yb as m,Z as ee,ad as y,dc as E,ea as A,ec as j,gc as R,hc as L,ic as l,ja as P,jc as r,kc as f,lc as N,mc as U,oc as M,pa as d,rb as s,tc as C,uc as a,v as T,xa as k,ya as I,za as F}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var ae=(()=>{class i{constructor(){this.httpService=d(K),this.formBuilder=d(Y),this.uploadProductService=d(oe)}getAttributes(e,t){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:e},{key:"CategoryID",value:t}]).pipe(de(o=>this.uploadProductService.selectedProduct$.pipe(T(c=>(o=this.mappingAttributeSalesProperty(o,c),o)))))}mappingAttributeSalesProperty(e,t){let n=0;return e.filter(o=>(o.type=="SALES_PROPERTY"&&(n+=1),n>1?(n=0,!1):!0)).map(o=>(o.type=="SALES_PROPERTY"&&(o.name="Jenis Variant",o.is_multiple_selection=!1,o.is_required=this.isProductHasMoreVariant(t),o.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),o))}isProductHasMoreVariant(e){let t=!1,n=[];return e.forEach(o=>{o.Variants&&n.push(o.Variants.length)}),t=n.some(o=>o>1),t}createFormGroup(e){let t=this.formBuilder.group({}),n=[];return e.forEach(o=>{n=[],o.is_required&&n.push(ge.required),t.addControl(o.id,this.formBuilder.control(null,n))}),t}getFilteredAttributes(e,t){let n=JSON.parse(JSON.stringify(e)),o=Object.keys(t),c=n.filter(W=>o.findIndex(Be=>parseInt(Be)==W.id)!=-1);return c=this.filterSelectedAttributes(c,t),c}filterSelectedAttributes(e,t){return e.map(o=>(_.IsNotEmpty(o.values)?o.is_multiple_selection?o.values=o.values.filter(c=>t[o.id]?.includes(c.id)):o.values=o.values.filter(c=>c.id==t[o.id]):t[o.id]&&(o.values=[{id:null,name:t[o.id]}]),o)).filter(o=>o?.values?.length>0)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=P({token:i,factory:i.\u0275fac})}}return i})();function Ge(i,p){i&1&&(l(0,"span",5),u(1,"*"),r())}function je(i,p){if(i&1&&f(0,"ng-select",6),i&2){let e=a().$implicit;m("multiple",!0)("formControlName",e.id)("items",e.values)("placeholder","Pilih "+(e==null?null:e.name))}}function Re(i,p){if(i&1&&f(0,"ng-select",7),i&2){let e=a().$implicit;m("formControlName",e.id)("items",e.values)("placeholder","Pilih "+(e==null?null:e.name))}}function Le(i,p){if(i&1&&f(0,"input",8),i&2){let e=a().$implicit;m("formControlName",e.id)("placeholder",e==null?null:e.name)}}function We(i,p){if(i&1&&(l(0,"small",5),u(1),r()),i&2){let e=a().$implicit;s(),Q(" ",e==null?null:e.name," is mandatory ")}}function He(i,p){if(i&1&&(l(0,"div",3)(1,"div",4),h(2,Ge,2,0,"span",5),l(3,"span"),u(4),r()(),h(5,je,1,4,"ng-select",6)(6,Re,1,3,"ng-select",7)(7,Le,1,2,"input",8)(8,We,2,1,"small",5),r()),i&2){let e=p.$implicit;s(2),E(e.is_required?2:-1),s(2),Q(" ",e==null?null:e.name," "),s(),E(e.is_multiple_selection?5:e.values!==null&&e.values.length>0?6:7),s(3),E(e.is_required?8:-1)}}function qe(i,p){if(i&1&&(N(0),l(1,"form",1)(2,"div",2),R(3,He,9,4,"div",3,j),r()(),U()),i&2){let e=p.ngIf,t=a();s(),m("formGroup",t.form),s(2),L(e)}}var Ve=(()=>{class i{constructor(){this.tiktokAttributeFormService=d(ae),this.attributesChanges=new w}ngOnChanges(){_.IsNotEmpty(this.categoryId)&&_.IsNotEmpty(this.channelId)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(this.channelId,this.categoryId).pipe(T(e=>e.filter(t=>!(t.type=="PRODUCT_PROPERTY"&&(_.IsEmpty(t.values)||t.values?.length==0)&&t.is_customizable==!1))),A(e=>{this.form=this.tiktokAttributeFormService.createFormGroup(e),this.listenToFormChange(e)}),ee(1)))}listenToFormChange(e){let t=[];this.formSubscription=this.form.valueChanges.subscribe(n=>{t=this.tiktokAttributeFormService.getFilteredAttributes(e,n),this.attributesChanges.emit(t)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=b({type:i,selectors:[["tiktok-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[v([ae]),k],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(t,n){t&1&&(h(0,qe,5,1,"ng-container",0),g(1,"async")),t&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,V,x,B,O,D,q,te,$,H,z,J,Z],encapsulation:2})}}return i})();var se=(()=>{class i{constructor(){this.woocommerceUploadService=d(ie)}getAttributes(e,t){return this.woocommerceUploadService.getAttributes(e,t).pipe(T(n=>n.map(o=>({key:o.name,label:o.name}))))}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=P({token:i,factory:i.\u0275fac})}}return i})();var $e=(()=>{class i{constructor(){this.wooAttributeFormService=d(se),this.channelId=re(),this.categoryId=re(),this.attributesChanges=new w}ngOnChanges(){_.IsNotEmpty(this.categoryId())&&_.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(e){this.attributesChanges.emit([e.key])}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=b({type:i,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[v([se]),k],decls:6,vars:3,consts:[[1,"row"],[1,"col-6"],[1,"mb-1"],["bindLabel","label","bindValue","id","placeholder","Pilih Atribut",3,"change","items"]],template:function(t,n){t&1&&(l(0,"div",0)(1,"div",1)(2,"div",2),u(3,"Atribut"),r(),l(4,"ng-select",3),g(5,"async"),C("change",function(c){return n.onSelectAttribute(c)}),r()()()),t&2&&(s(4),m("items",y(5,1,n.attributes$)))},dependencies:[S,x,Z,B,O,D],encapsulation:2})}}return i})();var me=(()=>{class i{constructor(){this.httpService=d(K),this.formBuilder=d(Y)}getAttributes(e,t){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:e},{key:"CategoryID",value:t}]).pipe(T(o=>o))}createFormGroup(e){let t=this.formBuilder.group({});return e.forEach(n=>{t.addControl(n.variant,this.formBuilder.control(null))}),t}convertAttributes(e={}){return Object.values(e).filter(n=>n!==null).map(n=>JSON.stringify(n))}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=P({token:i,factory:i.\u0275fac})}}return i})();function ze(i,p){if(i&1&&(l(0,"div",3)(1,"div",4),u(2),r(),f(3,"ng-select",5),r()),i&2){let e=p.$implicit;s(2),Q(" ",e==null?null:e.variant," "),s(),m("formControlName",e.variant)("items",e.values)("placeholder","Pilih "+(e==null?null:e.variant))}}function Je(i,p){if(i&1&&(N(0),l(1,"form",1)(2,"div",2),R(3,ze,4,4,"div",3,j),r()(),U()),i&2){let e=p.ngIf,t=a();s(),m("formGroup",t.form),s(2),L(e)}}var De=(()=>{class i{constructor(){this.tokpedAttrFormService=d(me),this.attributesChanges=new w}ngOnInit(){}ngOnChanges(e){_.IsNotEmpty(this.categoryId)&&_.IsNotEmpty(this.channelId)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(this.channelId,this.categoryId).pipe(A(t=>{this.form=this.tokpedAttrFormService.createFormGroup(t),this.listenToFormChange()})))}listenToFormChange(){let e=[];this.formSubscription=this.form.valueChanges.subscribe(t=>{e=this.tokpedAttrFormService.convertAttributes(t),this.attributesChanges.emit(e)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=b({type:i,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[v([me]),k],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(t,n){t&1&&(h(0,Je,5,1,"ng-container",0),g(1,"async")),t&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,V,x,B,O,D,q,$,H,z,J],encapsulation:2})}}return i})();var pe=(()=>{class i{constructor(){this.httpService=d(K),this.formBuilder=d(Y)}getAttributes(e){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:e}]).pipe(A(n=>(n.Options.StatusOptions=n.Options.Status.map(o=>({id:o,name:o})),n)))}createFormGroup(e){let t=this.formBuilder.group({});return Object.keys(e.Attribute).forEach(o=>{t.addControl(o,this.formBuilder.control(null))}),t}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=P({token:i,factory:i.\u0275fac})}}return i})();function Ye(i,p){if(i&1&&(N(0),l(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4),u(5," Brand "),r(),f(6,"input",5),r(),l(7,"div",6)(8,"div",4),u(9," Product Type "),r(),f(10,"input",7),r(),l(11,"div",6)(12,"div",4),u(13," Status "),r(),f(14,"ng-select",8),r()()(),U()),i&2){let e=p.ngIf,t=a();s(),m("formGroup",t.form),s(13),m("items",e.Options.StatusOptions)}}var Oe=(()=>{class i{constructor(){this.attributesChanges=new w,this.shopifyFormService=d(pe)}ngOnChanges(e){e.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId).pipe(A(t=>{this.form=this.shopifyFormService.createFormGroup(t),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(ue(500)).subscribe(e=>{this.attributesChanges.emit([e])})}ngOnDestroy(){this.formSubscription.unsubscribe()}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=b({type:i,selectors:[["shopify-attribute-form"]],inputs:{channelId:"channelId"},outputs:{attributesChanges:"attributesChanges"},features:[v([pe]),k],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(t,n){t&1&&(h(0,Ye,15,2,"ng-container",0),g(1,"async")),t&2&&m("ngIf",y(1,1,n.attributes$))},dependencies:[S,V,x,D,q,te,$,H,z,J,B,O],encapsulation:2})}}return i})();function Ze(i,p){if(i&1&&(l(0,"div",6),f(1,"app-product-card",9),r()),i&2){let e=p.$implicit;s(),m("productId",e==null?null:e.ID)("title",e==null?null:e.Name)("image",e==null?null:e.ThumbnailUrl)("description",(e==null||e.Variants==null?null:e.Variants.length)>1?(e==null||e.Variants==null?null:e.Variants.length)+" Variants":null)("imageForZoom",e==null?null:e.ImageUrl)("code",e==null||e.Variants[0]==null?null:e.Variants[0].Code)("showFooter",!1)}}function Ke(i,p){if(i&1){let e=M();N(0),l(1,"mat-checkbox",21),Ce("ngModelChange",function(n){I(e);let o=a().$implicit;return _e(o.selected,n)||(o.selected=n),F(n)}),C("ngModelChange",function(){let n=I(e).ngIf,o=a(),c=o.$implicit,W=o.$index,X=a();return F(X.onSelectChannel(c,W,n))}),r(),U()}if(i&2){let e=a().$implicit;s(),he("ngModel",e.selected)}}function Qe(i,p){if(i&1&&(l(0,"div",18),f(1,"input",22),r()),i&2){let e=a().$implicit,t=a();m("matTooltip",e.type==t.channelType.Shopify?"Cannot change category, please change category in admin.shopify.com":e.type==t.channelType.Plugo?"You can change the category after the product has been uploaded to the Plugo Dashboard.":"")}}function Xe(i,p){if(i&1){let e=M();l(0,"app-channel-category-select",23),C("selectedCategory",function(n){I(e);let o=a().$index,c=a();return F(c.onCategoryChange(o,n))}),r()}if(i&2){let e=a().$implicit,t=a();m("disabled",!e.selected||e.selected&&e.type==t.channelType.Lazada)("channelId",e.id)("channelType",e.type)("categoryId",e.categoryId)}}function et(i,p){if(i&1){let e=M();l(0,"shopee-attribute-form",27),C("attributesChanges",function(n){I(e);let o=a(2).$index,c=a();return F(c.onAttributesChange(o,n))}),r()}if(i&2){let e=a(2).$implicit;m("categoryId",e.categoryId)("channelId",e.id)("channelType",e.type)}}function tt(i,p){if(i&1){let e=M();l(0,"tiktok-attribute-form",28),C("attributesChanges",function(n){I(e);let o=a(2).$index,c=a();return F(c.onAttributesChange(o,n))}),r()}if(i&2){let e=a(2).$implicit;m("categoryId",e.categoryId)("channelId",e.id)}}function it(i,p){if(i&1){let e=M();l(0,"wooocommerce-attribute-form",28),C("attributesChanges",function(n){I(e);let o=a(2).$index,c=a();return F(c.onAttributesChange(o,n))}),r()}if(i&2){let e=a(2).$implicit;m("categoryId",e.categoryId)("channelId",e.id)}}function ot(i,p){if(i&1){let e=M();l(0,"tokopedia-attribute-form",28),C("attributesChanges",function(n){I(e);let o=a(2).$index,c=a();return F(c.onAttributesChange(o,n))}),r()}if(i&2){let e=a(2).$implicit;m("categoryId",e.categoryId)("channelId",e.id)}}function nt(i,p){if(i&1&&(l(0,"div",20)(1,"div",24),h(2,et,1,3,"shopee-attribute-form",25)(3,tt,1,2,"tiktok-attribute-form",26)(4,it,1,2,"wooocommerce-attribute-form",26)(5,ot,1,2,"tokopedia-attribute-form",26),r()()),i&2){let e,t=a().$implicit,n=a();s(2),E((e=t.type)===n.channelType.Shopee?2:e===n.channelType.Tiktok?3:e===n.channelType.WooCommerce?4:e===n.channelType.Tokopedia?5:-1)}}function rt(i,p){if(i&1){let e=M();l(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",29),C("attributesChanges",function(n){I(e);let o=a().$index,c=a();return F(c.onAttributesChange(o,n))}),r()()()}if(i&2){let e=a().$implicit;s(2),m("channelId",e.id)}}function at(i,p){if(i&1&&(l(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),h(6,Ke,2,1,"ng-container",14),g(7,"async"),r(),l(8,"div"),f(9,"app-channel-logo",15),r(),l(10,"div",16)(11,"span"),u(12),r()()()(),l(13,"div",12)(14,"div",17),h(15,Qe,2,1,"div",18)(16,Xe,1,4,"app-channel-category-select",19),r()()(),h(17,nt,6,1,"div",20)(18,rt,3,1,"div",20),r()()),i&2){let e=p.$implicit,t=a();s(6),m("ngIf",y(7,8,t.defaultCategories$)),s(3),m("typeId",e.type)("showChannelName",!1),s(),m("matTooltip",e.name)("matTooltipShowDelay",2500),s(2),fe(e.name),s(3),E(e.type==t.channelType.Shopify||e.type==t.channelType.Plugo?15:16),s(2),E(e.categoryId&&t.channelType.Lazada!=e.type&&e.selected?17:t.channelType.Shopify==e.type&&e.selected?18:-1)}}var qi=(()=>{class i{constructor(){this.uploadProductService=d(oe),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=be,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(ee(1))}onCategoryChange(e,t){this.channelProductUploads.update(n=>n.map((o,c)=>(c==e&&(o.categoryId=t,o.attributes=[]),o)))}onAttributesChange(e,t){this.channelProductUploads.update(n=>n.map((o,c)=>(c==e&&(o.attributes=t),o)))}onSelectChannel(e,t,n){this.channelProductUploads.update(o=>o.map((c,W)=>{if(W==t&&e.selected){let X=this.findCategoryByChannelId(e.id,n);c.categoryId=X?.DefaultCategoryID}return W==t&&!e.selected&&(c.categoryId=null),c}))}findCategoryByChannelId(e,t){return t.find(n=>n.ID===e)}onUploadProduct(){this.uploadProductService.onUploadProduct(this.channelProductUploads())}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=b({type:i,selectors:[["app-product-upload"]],features:[v([Ae,Pe,ke,ie])],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(t,n){if(t&1&&(l(0,"mainpanel",0)(1,"actions")(2,"button",1),C("click",function(){return n.onUploadProduct()}),f(3,"i",2),u(4," Upload "),r()(),l(5,"content")(6,"div",3)(7,"h3",4),u(8,"Product To Upload"),r(),l(9,"div",5),R(10,Ze,2,7,"div",6,j),g(12,"async"),r(),l(13,"h3",7),u(14,"Channel To Upload"),r(),R(15,at,19,10,"div",8,j),r()()()),t&2){let o;m("hideSearchBox",!0)("hideSearchDropdown",!0),s(2),m("disabled",((o=n.channelProductUploads())==null?null:o.length)==0),s(8),L(y(12,3,n.selectedProducts$)),s(5),L(n.channelProductUploads())}},dependencies:[S,V,x,Ee,Ie,Se,Ue,Ne,Te,Fe,Z,$,ye,xe,ve,Ve,$e,De,Oe,we,Me],encapsulation:2})}}return i})();export{qi as ProductUploadComponent};
@@ -1 +1 @@
1
- import{a as ae}from"./chunk-MQQD4OJO.js";import{a as le}from"./chunk-CATX24UZ.js";import{a as oe}from"./chunk-66MLRB2J.js";import"./chunk-M5JQ7BGW.js";import{a as re}from"./chunk-EPVCMYCI.js";import"./chunk-JDIBETL5.js";import"./chunk-L7K5HOBY.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import"./chunk-H3J5OAIG.js";import"./chunk-AQTXFEBA.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import"./chunk-5OHRA4AS.js";import"./chunk-3BT5DR3X.js";import"./chunk-3RK6DDJD.js";import"./chunk-J2KWRDVH.js";import"./chunk-7SVF5UPT.js";import{a as te,b as ie}from"./chunk-M7NQID2Z.js";import"./chunk-CMTBBXR5.js";import{a as ne}from"./chunk-WPW3D4MQ.js";import"./chunk-S5SDX7ZG.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import{a as X}from"./chunk-V3NCYRCF.js";import"./chunk-5JVEEL2T.js";import"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-AEOSNAHH.js";import{e as Q}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as $,n as ee}from"./chunk-CLER2MX6.js";import{A as K,c as G,h as U,m as q,o as J}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{r as Y,s as Z}from"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{j as z,k as j,m as H,n as R}from"./chunk-M2FCTYGU.js";import{$c as w,Gb as O,Gc as m,Hc as h,Kc as c,Lc as u,Mb as W,Mc as C,Nc as B,Oc as D,Pc as F,Ra as V,Yb as g,Z as T,ad as M,bd as A,dc as I,ec as L,gc as N,hc as k,ic as e,ja as P,jc as t,kc as _,oc as v,pa as y,rb as a,tc as x,uc as S,v as E,ya as p,za as s}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var me=(()=>{class r{constructor(){this.httpService=y(Q)}getCancelledOrders(l){return this.httpService.post(X.GetCancelled,l).pipe(E(o=>o.Data))}static{this.\u0275fac=function(o){return new(o||r)}}static{this.\u0275prov=P({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();function pe(r,b){if(r&1&&(e(0,"tr")(1,"td"),m(2),t(),e(3,"td"),_(4,"order-link",26),t(),e(5,"td"),m(6),t(),e(7,"td"),m(8),w(9,"number"),t(),e(10,"td"),m(11),w(12,"date"),t(),e(13,"td"),_(14,"app-channel-logo",27),t()()),r&2){let l=b.$implicit;a(2),h(l.Outlet),a(2),g("order",l),a(2),h(l.Customer),a(2),h(M(9,6,l.Amount)),a(3),h(A(12,8,l.Created,"dd MMM yyyy HH:mm")),a(3),g("typeId",l==null?null:l.TypeID)}}function se(r,b){if(r&1){let l=v();e(0,"div",15)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),m(5,"Outlet"),t(),e(6,"th",21),m(7,"Order number"),t(),e(8,"th"),m(9,"Customer"),t(),e(10,"th",22),m(11,"Amount"),t(),e(12,"th",23),m(13," Created On "),t(),e(14,"th",24),m(15,"Channel"),t()()(),e(16,"tbody"),N(17,pe,15,11,"tr",null,L),t()(),e(19,"app-custom-paginator",25),x("next",function(){p(l);let i=S();return s(i.initCancelledOrders())})("previous",function(){p(l);let i=S();return s(i.initCancelledOrders())}),t()()}if(r&2){let l=S(),o=F(0);a(17),k(o),a(2),g("filter",l.filter())("totaldata",o==null?null:o.length)("paginationTotal",o==null?null:o.length)("hasClicked",!0)("nextButtonAlwaysVisible",!0)}}function ce(r,b){r&1&&(e(0,"div",16),_(1,"app-empty-state"),t())}var Ae=(()=>{class r{constructor(){this.cancelledService=y(me),this.filter=V({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){this.initCancelledOrders()}initCancelledOrders(){this.cancelledOrders$=this.cancelledService.getCancelledOrders(this.filter()).pipe(T(1))}static{this.\u0275fac=function(o){return new(o||r)}}static{this.\u0275cmp=O({type:r,selectors:[["app-cancelled"]],decls:34,vars:11,consts:[["headerTitle","Cancelled","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-regular","fa-tv","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","created",2,"width","130px"],[2,"width","130px"],[3,"next","previous","filter","totaldata","paginationTotal","hasClicked","nextButtonAlwaysVisible"],[3,"order"],[3,"typeId"]],template:function(o,i){if(o&1){let d=v();B(0),w(1,"async"),e(2,"mainpanel",0),x("onSubmit",function(){return p(d),s(i.initCancelledOrders())}),C("textChange",function(n){return p(d),u(i.filter().Number,n)||(i.filter().Number=n),s(n)}),e(3,"actions")(4,"a",1),_(5,"i",2),e(6,"span"),m(7,"Order Fulfillment Display"),t()()(),e(8,"filters")(9,"div")(10,"label",3),m(11,"From/To"),t(),e(12,"channel-select-options",4),C("ngModelChange",function(n){return p(d),u(i.filter().ListChannelID,n)||(i.filter().ListChannelID=n),s(n)}),t()(),e(13,"div",5)(14,"label",3),m(15,"From/To"),t(),e(16,"div",6)(17,"datepicker",7),C("dateChange",function(n){return p(d),u(i.filter().From,n)||(i.filter().From=n),s(n)}),t()(),e(18,"div")(19,"datepicker",8),C("dateChange",function(n){return p(d),u(i.filter().To,n)||(i.filter().To=n),s(n)}),t()()(),e(20,"div",5)(21,"label",9),m(22,"Page Number"),t(),e(23,"input",10),C("ngModelChange",function(n){return p(d),u(i.filter().PageNumber,n)||(i.filter().PageNumber=n),s(n)}),t()(),e(24,"div",5)(25,"label",9),m(26,"Page Size"),t(),e(27,"input",11),C("ngModelChange",function(n){return p(d),u(i.filter().PageSize,n)||(i.filter().PageSize=n),s(n)}),t()()(),e(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),W(32,se,20,5,"div",15)(33,ce,2,0,"div",16),t()()()()()}if(o&2){let d=D(M(1,8,i.cancelledOrders$));a(2),c("text",i.filter().Number),a(10),g("multiple",!0),c("ngModel",i.filter().ListChannelID),a(5),c("date",i.filter().From),a(2),c("date",i.filter().To),a(4),c("ngModel",i.filter().PageNumber),a(4),c("ngModel",i.filter().PageSize),a(5),I((d==null?null:d.length)>0?32:33)}},dependencies:[R,z,H,j,ee,$,re,ne,K,G,J,U,q,oe,le,Z,Y,ae,ie,te],encapsulation:2})}}return r})();export{Ae as CancelledComponent};
1
+ import{a as ae}from"./chunk-GQLSQKDI.js";import{a as le}from"./chunk-46CA5SER.js";import{a as oe}from"./chunk-66MLRB2J.js";import"./chunk-M5JQ7BGW.js";import{a as re}from"./chunk-EPVCMYCI.js";import"./chunk-JDIBETL5.js";import"./chunk-L7K5HOBY.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import"./chunk-H3J5OAIG.js";import"./chunk-AQTXFEBA.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import"./chunk-5OHRA4AS.js";import"./chunk-3BT5DR3X.js";import"./chunk-3RK6DDJD.js";import"./chunk-J2KWRDVH.js";import"./chunk-7SVF5UPT.js";import{a as te,b as ie}from"./chunk-M7NQID2Z.js";import"./chunk-CMTBBXR5.js";import{a as ne}from"./chunk-WPW3D4MQ.js";import"./chunk-USNELOQD.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import{a as X}from"./chunk-5HO2IJ47.js";import"./chunk-5JVEEL2T.js";import"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-AEOSNAHH.js";import{e as Q}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as $,n as ee}from"./chunk-CLER2MX6.js";import{A as K,c as G,h as U,m as q,o as J}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{r as Y,s as Z}from"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{j as z,k as j,m as H,n as R}from"./chunk-M2FCTYGU.js";import{$c as w,Gb as O,Gc as m,Hc as h,Kc as c,Lc as u,Mb as W,Mc as C,Nc as B,Oc as D,Pc as F,Ra as V,Yb as g,Z as T,ad as M,bd as A,dc as I,ec as L,gc as N,hc as k,ic as e,ja as P,jc as t,kc as _,oc as v,pa as y,rb as a,tc as x,uc as S,v as E,ya as p,za as s}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var me=(()=>{class r{constructor(){this.httpService=y(Q)}getCancelledOrders(l){return this.httpService.post(X.GetCancelled,l).pipe(E(o=>o.Data))}static{this.\u0275fac=function(o){return new(o||r)}}static{this.\u0275prov=P({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();function pe(r,b){if(r&1&&(e(0,"tr")(1,"td"),m(2),t(),e(3,"td"),_(4,"order-link",26),t(),e(5,"td"),m(6),t(),e(7,"td"),m(8),w(9,"number"),t(),e(10,"td"),m(11),w(12,"date"),t(),e(13,"td"),_(14,"app-channel-logo",27),t()()),r&2){let l=b.$implicit;a(2),h(l.Outlet),a(2),g("order",l),a(2),h(l.Customer),a(2),h(M(9,6,l.Amount)),a(3),h(A(12,8,l.Created,"dd MMM yyyy HH:mm")),a(3),g("typeId",l==null?null:l.TypeID)}}function se(r,b){if(r&1){let l=v();e(0,"div",15)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),m(5,"Outlet"),t(),e(6,"th",21),m(7,"Order number"),t(),e(8,"th"),m(9,"Customer"),t(),e(10,"th",22),m(11,"Amount"),t(),e(12,"th",23),m(13," Created On "),t(),e(14,"th",24),m(15,"Channel"),t()()(),e(16,"tbody"),N(17,pe,15,11,"tr",null,L),t()(),e(19,"app-custom-paginator",25),x("next",function(){p(l);let i=S();return s(i.initCancelledOrders())})("previous",function(){p(l);let i=S();return s(i.initCancelledOrders())}),t()()}if(r&2){let l=S(),o=F(0);a(17),k(o),a(2),g("filter",l.filter())("totaldata",o==null?null:o.length)("paginationTotal",o==null?null:o.length)("hasClicked",!0)("nextButtonAlwaysVisible",!0)}}function ce(r,b){r&1&&(e(0,"div",16),_(1,"app-empty-state"),t())}var Ae=(()=>{class r{constructor(){this.cancelledService=y(me),this.filter=V({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){this.initCancelledOrders()}initCancelledOrders(){this.cancelledOrders$=this.cancelledService.getCancelledOrders(this.filter()).pipe(T(1))}static{this.\u0275fac=function(o){return new(o||r)}}static{this.\u0275cmp=O({type:r,selectors:[["app-cancelled"]],decls:34,vars:11,consts:[["headerTitle","Cancelled","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-regular","fa-tv","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","created",2,"width","130px"],[2,"width","130px"],[3,"next","previous","filter","totaldata","paginationTotal","hasClicked","nextButtonAlwaysVisible"],[3,"order"],[3,"typeId"]],template:function(o,i){if(o&1){let d=v();B(0),w(1,"async"),e(2,"mainpanel",0),x("onSubmit",function(){return p(d),s(i.initCancelledOrders())}),C("textChange",function(n){return p(d),u(i.filter().Number,n)||(i.filter().Number=n),s(n)}),e(3,"actions")(4,"a",1),_(5,"i",2),e(6,"span"),m(7,"Order Fulfillment Display"),t()()(),e(8,"filters")(9,"div")(10,"label",3),m(11,"From/To"),t(),e(12,"channel-select-options",4),C("ngModelChange",function(n){return p(d),u(i.filter().ListChannelID,n)||(i.filter().ListChannelID=n),s(n)}),t()(),e(13,"div",5)(14,"label",3),m(15,"From/To"),t(),e(16,"div",6)(17,"datepicker",7),C("dateChange",function(n){return p(d),u(i.filter().From,n)||(i.filter().From=n),s(n)}),t()(),e(18,"div")(19,"datepicker",8),C("dateChange",function(n){return p(d),u(i.filter().To,n)||(i.filter().To=n),s(n)}),t()()(),e(20,"div",5)(21,"label",9),m(22,"Page Number"),t(),e(23,"input",10),C("ngModelChange",function(n){return p(d),u(i.filter().PageNumber,n)||(i.filter().PageNumber=n),s(n)}),t()(),e(24,"div",5)(25,"label",9),m(26,"Page Size"),t(),e(27,"input",11),C("ngModelChange",function(n){return p(d),u(i.filter().PageSize,n)||(i.filter().PageSize=n),s(n)}),t()()(),e(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),W(32,se,20,5,"div",15)(33,ce,2,0,"div",16),t()()()()()}if(o&2){let d=D(M(1,8,i.cancelledOrders$));a(2),c("text",i.filter().Number),a(10),g("multiple",!0),c("ngModel",i.filter().ListChannelID),a(5),c("date",i.filter().From),a(2),c("date",i.filter().To),a(4),c("ngModel",i.filter().PageNumber),a(4),c("ngModel",i.filter().PageSize),a(5),I((d==null?null:d.length)>0?32:33)}},dependencies:[R,z,H,j,ee,$,re,ne,K,G,J,U,q,oe,le,Z,Y,ae,ie,te],encapsulation:2})}}return r})();export{Ae as CancelledComponent};
@@ -1,3 +1,3 @@
1
- import{a as T}from"./chunk-Z3ITXK3D.js";import{a as Qe}from"./chunk-ACIMXBIC.js";import{a as Ke,b as me,c as ze,d as Ve,e as Se,f as qe,g as ve,h as Ge,i as G,j as Ae,k as y}from"./chunk-TGMCGROM.js";import{a as Ye}from"./chunk-V3NCYRCF.js";import{b as ge,c as ee}from"./chunk-PW42BQIY.js";import{a as Xe}from"./chunk-SWQXSJ7O.js";import{a as Je}from"./chunk-AEOSNAHH.js";import{e as te}from"./chunk-JXSBFTQM.js";import{b as Ze}from"./chunk-ATZ475FN.js";import{G as We,n as $e,o as Ue,p as He}from"./chunk-M2FCTYGU.js";import{F as Oe,G as Me,Hb as U,La as L,O as ue,Ra as fe,T as Ne,Wa as $,Z as de,aa as x,ba as he,c as g,dd as Fe,ea as V,ed as Le,f as Y,id as q,j as xe,ja as k,k as Re,ka as B,ma as b,n as K,o as Q,oa as h,p as R,pa as F,q as z,qa as Be,ua as pe,v as D,w as je}from"./chunk-B7KTCPKC.js";import{a as le,i as I}from"./chunk-66YHNWRR.js";var et={production:!0,version:"5.43.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 wt="firebase",kt="11.10.0";G(wt,kt,"app");var H=new Fe("ANGULARFIRE2_VERSION");var tt=(r,s)=>{let e=s?[s]:Ge(),t=[];return e.forEach(n=>{n.container.getProvider(r).instances.forEach(i=>{t.includes(i)||t.push(i)})}),t},we=function(r){return r[r.SILENT=0]="SILENT",r[r.WARN=1]="WARN",r[r.VERBOSE=2]="VERBOSE",r}(we||{}),Pr=q()&&typeof Zone<"u"?we.WARN:we.SILENT;var re=class{zone;delegate;constructor(s,e=Re){this.zone=s,this.delegate=e}now(){return this.delegate.now()}schedule(s,e,t){let n=this.zone,o=function(i){n?n.runGuarded(()=>{s.apply(this,[i])}):s.apply(this,[i])};return this.delegate.schedule(o,e,t)}},ke=(()=>{class r{outsideAngular;insideAngular;constructor(){let e=F(L);this.outsideAngular=e.runOutsideAngular(()=>new re(typeof Zone>"u"?void 0:Zone.current)),this.insideAngular=e.run(()=>new re(typeof Zone>"u"?void 0:Zone.current,xe))}static \u0275fac=function(t){return new(t||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var It=new Map,bt={activated:!1,tokenObservers:[]},Tt={initialized:!1,enabled:!1};function C(r){return It.get(r)||Object.assign({},bt)}function it(){return Tt}var yt="https://content-firebaseappcheck.googleapis.com/v1";var Ct="exchangeDebugToken",rt={OFFSET_DURATION:5*60*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:16*60*1e3},Lr=24*60*60*1e3;var be=class{constructor(s,e,t,n,o){if(this.operation=s,this.retryPolicy=e,this.getWaitDuration=t,this.lowerBound=n,this.upperBound=o,this.pending=null,this.nextErrorWaitInterval=n,n>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(s){return I(this,null,function*(){this.stop();try{this.pending=new me,this.pending.promise.catch(e=>{}),yield Pt(this.getNextRun(s)),this.pending.resolve(),yield this.pending.promise,this.pending=new me,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(s){if(s)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 Pt(r){return new Promise(s=>{setTimeout(s,r)})}var Dt={"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}"},j=new Ve("appCheck","AppCheck",Dt);function st(r){if(!C(r).activated)throw j.create("use-before-activation",{appName:r.name})}function at(t,n){return I(this,arguments,function*({url:r,body:s},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 a={method:"POST",body:JSON.stringify(s),headers:o},l;try{l=yield fetch(r,a)}catch(f){throw j.create("fetch-network-error",{originalErrorMessage:f?.message})}if(l.status!==200)throw j.create("fetch-status-error",{httpStatus:l.status});let c;try{c=yield l.json()}catch(f){throw j.create("fetch-parse-error",{originalErrorMessage:f?.message})}let d=c.ttl.match(/^([\d.]+)(s)$/);if(!d||!d[2]||isNaN(Number(d[1])))throw j.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 ct(r,s){let{projectId:e,appId:t,apiKey:n}=r.options;return{url:`${yt}/projects/${e}/apps/${t}:${Ct}?key=${n}`,body:{debug_token:s}}}var _t="firebase-app-check-database",xt=1,Te="firebase-app-check-store";var ne=null;function Rt(){return ne||(ne=new Promise((r,s)=>{try{let e=indexedDB.open(_t,xt);e.onsuccess=t=>{r(t.target.result)},e.onerror=t=>{var n;s(j.create("storage-open",{originalErrorMessage:(n=t.target.error)===null||n===void 0?void 0:n.message}))},e.onupgradeneeded=t=>{let n=t.target.result;switch(t.oldVersion){case 0:n.createObjectStore(Te,{keyPath:"compositeKey"})}}}catch(e){s(j.create("storage-open",{originalErrorMessage:e?.message}))}}),ne)}function jt(r,s){return Ot(Mt(r),s)}function Ot(r,s){return I(this,null,function*(){let t=(yield Rt()).transaction(Te,"readwrite"),o=t.objectStore(Te).put({compositeKey:r,value:s});return new Promise((i,a)=>{o.onsuccess=l=>{i()},t.onerror=l=>{var c;a(j.create("storage-set",{originalErrorMessage:(c=l.target.error)===null||c===void 0?void 0:c.message}))}})})}function Mt(r){return`${r.options.appId}-${r.name}`}var Z=new qe("@firebase/app-check");function Ee(r,s){return ze()?jt(r,s).catch(e=>{Z.warn(`Failed to write token to IndexedDB. Error: ${e}`)}):Promise.resolve()}function lt(){return it().enabled}function ut(){return I(this,null,function*(){let r=it();if(r.enabled&&r.token)return r.token.promise;throw Error(`
1
+ import{a as T}from"./chunk-Z3ITXK3D.js";import{a as Qe}from"./chunk-ACIMXBIC.js";import{a as Ke,b as me,c as ze,d as Ve,e as Se,f as qe,g as ve,h as Ge,i as G,j as Ae,k as y}from"./chunk-TGMCGROM.js";import{a as Ye}from"./chunk-5HO2IJ47.js";import{b as ge,c as ee}from"./chunk-PW42BQIY.js";import{a as Xe}from"./chunk-SWQXSJ7O.js";import{a as Je}from"./chunk-AEOSNAHH.js";import{e as te}from"./chunk-JXSBFTQM.js";import{b as Ze}from"./chunk-ATZ475FN.js";import{G as We,n as $e,o as Ue,p as He}from"./chunk-M2FCTYGU.js";import{F as Oe,G as Me,Hb as U,La as L,O as ue,Ra as fe,T as Ne,Wa as $,Z as de,aa as x,ba as he,c as g,dd as Fe,ea as V,ed as Le,f as Y,id as q,j as xe,ja as k,k as Re,ka as B,ma as b,n as K,o as Q,oa as h,p as R,pa as F,q as z,qa as Be,ua as pe,v as D,w as je}from"./chunk-B7KTCPKC.js";import{a as le,i as I}from"./chunk-66YHNWRR.js";var et={production:!0,version:"5.43.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 wt="firebase",kt="11.10.0";G(wt,kt,"app");var H=new Fe("ANGULARFIRE2_VERSION");var tt=(r,s)=>{let e=s?[s]:Ge(),t=[];return e.forEach(n=>{n.container.getProvider(r).instances.forEach(i=>{t.includes(i)||t.push(i)})}),t},we=function(r){return r[r.SILENT=0]="SILENT",r[r.WARN=1]="WARN",r[r.VERBOSE=2]="VERBOSE",r}(we||{}),Pr=q()&&typeof Zone<"u"?we.WARN:we.SILENT;var re=class{zone;delegate;constructor(s,e=Re){this.zone=s,this.delegate=e}now(){return this.delegate.now()}schedule(s,e,t){let n=this.zone,o=function(i){n?n.runGuarded(()=>{s.apply(this,[i])}):s.apply(this,[i])};return this.delegate.schedule(o,e,t)}},ke=(()=>{class r{outsideAngular;insideAngular;constructor(){let e=F(L);this.outsideAngular=e.runOutsideAngular(()=>new re(typeof Zone>"u"?void 0:Zone.current)),this.insideAngular=e.run(()=>new re(typeof Zone>"u"?void 0:Zone.current,xe))}static \u0275fac=function(t){return new(t||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var It=new Map,bt={activated:!1,tokenObservers:[]},Tt={initialized:!1,enabled:!1};function C(r){return It.get(r)||Object.assign({},bt)}function it(){return Tt}var yt="https://content-firebaseappcheck.googleapis.com/v1";var Ct="exchangeDebugToken",rt={OFFSET_DURATION:5*60*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:16*60*1e3},Lr=24*60*60*1e3;var be=class{constructor(s,e,t,n,o){if(this.operation=s,this.retryPolicy=e,this.getWaitDuration=t,this.lowerBound=n,this.upperBound=o,this.pending=null,this.nextErrorWaitInterval=n,n>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(s){return I(this,null,function*(){this.stop();try{this.pending=new me,this.pending.promise.catch(e=>{}),yield Pt(this.getNextRun(s)),this.pending.resolve(),yield this.pending.promise,this.pending=new me,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(s){if(s)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 Pt(r){return new Promise(s=>{setTimeout(s,r)})}var Dt={"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}"},j=new Ve("appCheck","AppCheck",Dt);function st(r){if(!C(r).activated)throw j.create("use-before-activation",{appName:r.name})}function at(t,n){return I(this,arguments,function*({url:r,body:s},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 a={method:"POST",body:JSON.stringify(s),headers:o},l;try{l=yield fetch(r,a)}catch(f){throw j.create("fetch-network-error",{originalErrorMessage:f?.message})}if(l.status!==200)throw j.create("fetch-status-error",{httpStatus:l.status});let c;try{c=yield l.json()}catch(f){throw j.create("fetch-parse-error",{originalErrorMessage:f?.message})}let d=c.ttl.match(/^([\d.]+)(s)$/);if(!d||!d[2]||isNaN(Number(d[1])))throw j.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 ct(r,s){let{projectId:e,appId:t,apiKey:n}=r.options;return{url:`${yt}/projects/${e}/apps/${t}:${Ct}?key=${n}`,body:{debug_token:s}}}var _t="firebase-app-check-database",xt=1,Te="firebase-app-check-store";var ne=null;function Rt(){return ne||(ne=new Promise((r,s)=>{try{let e=indexedDB.open(_t,xt);e.onsuccess=t=>{r(t.target.result)},e.onerror=t=>{var n;s(j.create("storage-open",{originalErrorMessage:(n=t.target.error)===null||n===void 0?void 0:n.message}))},e.onupgradeneeded=t=>{let n=t.target.result;switch(t.oldVersion){case 0:n.createObjectStore(Te,{keyPath:"compositeKey"})}}}catch(e){s(j.create("storage-open",{originalErrorMessage:e?.message}))}}),ne)}function jt(r,s){return Ot(Mt(r),s)}function Ot(r,s){return I(this,null,function*(){let t=(yield Rt()).transaction(Te,"readwrite"),o=t.objectStore(Te).put({compositeKey:r,value:s});return new Promise((i,a)=>{o.onsuccess=l=>{i()},t.onerror=l=>{var c;a(j.create("storage-set",{originalErrorMessage:(c=l.target.error)===null||c===void 0?void 0:c.message}))}})})}function Mt(r){return`${r.options.appId}-${r.name}`}var Z=new qe("@firebase/app-check");function Ee(r,s){return ze()?jt(r,s).catch(e=>{Z.warn(`Failed to write token to IndexedDB. Error: ${e}`)}):Promise.resolve()}function lt(){return it().enabled}function ut(){return I(this,null,function*(){let r=it();if(r.enabled&&r.token)return r.token.promise;throw Error(`
2
2
  Can't get debug token in production mode.
3
3
  `)})}var Nt={error:"UNKNOWN_ERROR"};function Bt(r){return Ke.encodeString(JSON.stringify(r),!1)}function ye(r,s=!1,e=!1){return I(this,null,function*(){let t=r.app;st(t);let n=C(t),o=n.token,i;if(o&&!J(o)&&(n.token=void 0,o=void 0),!o){let c=yield n.cachedTokenPromise;c&&(J(c)?o=c:yield Ee(t,void 0))}if(!s&&o&&J(o))return{token:o.token};let a=!1;if(lt())try{n.exchangeTokenPromise||(n.exchangeTokenPromise=at(ct(t,yield ut()),r.heartbeatServiceProvider).finally(()=>{n.exchangeTokenPromise=void 0}),a=!0);let c=yield n.exchangeTokenPromise;return yield Ee(t,c),n.token=c,{token:c.token}}catch(c){return c.code==="appCheck/throttled"||c.code==="appCheck/initial-throttle"?Z.warn(c.message):e&&Z.error(c),Ie(c)}try{n.exchangeTokenPromise||(n.exchangeTokenPromise=n.provider.getToken().finally(()=>{n.exchangeTokenPromise=void 0}),a=!0),o=yield C(t).exchangeTokenPromise}catch(c){c.code==="appCheck/throttled"||c.code==="appCheck/initial-throttle"?Z.warn(c.message):e&&Z.error(c),i=c}let l;return o?i?J(o)?l={token:o.token,internalError:i}:l=Ie(i):(l={token:o.token},n.token=o,yield Ee(t,o)):l=Ie(i),a&&Ut(t,l),l})}function Ft(r){return I(this,null,function*(){let s=r.app;st(s);let{provider:e}=C(s);if(lt()){let t=yield ut(),{token:n}=yield at(ct(s,t),r.heartbeatServiceProvider);return{token:n}}else{let{token:t}=yield e.getToken();return{token:t}}})}function Lt(r,s,e,t){let{app:n}=r,o=C(n),i={next:e,error:t,type:s};if(o.tokenObservers=[...o.tokenObservers,i],o.token&&J(o.token)){let a=o.token;Promise.resolve().then(()=>{e({token:a.token}),nt(r)}).catch(()=>{})}o.cachedTokenPromise.then(()=>nt(r))}function dt(r,s){let e=C(r),t=e.tokenObservers.filter(n=>n.next!==s);t.length===0&&e.tokenRefresher&&e.tokenRefresher.isRunning()&&e.tokenRefresher.stop(),e.tokenObservers=t}function nt(r){let{app:s}=r,e=C(s),t=e.tokenRefresher;t||(t=$t(r),e.tokenRefresher=t),!t.isRunning()&&e.isTokenAutoRefreshEnabled&&t.start()}function $t(r){let{app:s}=r;return new be(()=>I(null,null,function*(){let e=C(s),t;if(e.token?t=yield ye(r,!0):t=yield ye(r),t.error)throw t.error;if(t.internalError)throw t.internalError}),()=>!0,()=>{let e=C(s);if(e.token){let t=e.token.issuedAtTimeMillis+(e.token.expireTimeMillis-e.token.issuedAtTimeMillis)*.5+3e5,n=e.token.expireTimeMillis-5*60*1e3;return t=Math.min(t,n),Math.max(0,t-Date.now())}else return 0},rt.RETRIAL_MIN_WAIT,rt.RETRIAL_MAX_WAIT)}function Ut(r,s){let e=C(r).tokenObservers;for(let t of e)try{t.type==="EXTERNAL"&&s.error!=null?t.error(s.error):t.next(s)}catch{}}function J(r){return r.expireTimeMillis-Date.now()>0}function Ie(r){return{token:Bt(Nt),error:r}}var Ce=class{constructor(s,e){this.app=s,this.heartbeatServiceProvider=e}_delete(){let{tokenObservers:s}=C(this.app);for(let e of s)dt(this.app,e.next);return Promise.resolve()}};function Ht(r,s){return new Ce(r,s)}function Wt(r){return{getToken:s=>ye(r,s),getLimitedUseToken:()=>Ft(r),addTokenListener:s=>Lt(r,"INTERNAL",s),removeTokenListener:s=>dt(r.app,s)}}var Kt="@firebase/app-check",zt="0.10.1";var Vt="app-check",ot="app-check-internal";function qt(){ve(new Se(Vt,r=>{let s=r.getProvider("app").getImmediate(),e=r.getProvider("heartbeat");return Ht(s,e)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((r,s,e)=>{r.getProvider(ot).initialize()})),ve(new Se(ot,r=>{let s=r.getProvider("app-check").getImmediate();return Wt(s)},"PUBLIC").setInstantiationMode("EXPLICIT")),G(Kt,zt)}qt();var Gt="app-check";var oe=class{constructor(){return tt(Gt)}};var Zt=["localhost","0.0.0.0","127.0.0.1"],en=typeof window<"u"&&Zt.includes(window.location.hostname);var Xt="firebase",Yt="11.10.0";y.registerVersion(Xt,Yt,"app-compat");var Qt=["ngOnDestroy"],pt=(r,s,e,t={})=>new Proxy(r,{get:(n,o)=>e.runOutsideAngular(()=>{if(r[o])return t?.spy?.get&&t.spy.get(o,r[o]),r[o];if(Qt.indexOf(o)>-1)return()=>{};let i=s.toPromise().then(a=>{let l=a?.[o];return typeof l=="function"?l.bind(a):l?.then?l.then(c=>e.run(()=>c)):e.run(()=>l)});return new Proxy(()=>{},{get:(a,l)=>i[l],apply:(a,l,c)=>i.then(d=>{let u=d?.(...c);return t?.spy?.apply&&t.spy.apply(o,c,u),u})})})});var ie=class{constructor(s){return s}},se=new b("angularfire2.app.options"),ae=new b("angularfire2.app.name");function Pe(r,s,e){let t=typeof e=="string"&&e||"[DEFAULT]",n=typeof e=="object"&&e||{};n.name=n.name||t;let i=y.apps.filter(a=>a&&a.name===n.name)[0]||s.runOutsideAngular(()=>y.initializeApp(r,n));try{if(JSON.stringify(r)!==JSON.stringify(i.options)){let a=!!module.hot;er("error",`${i.name} Firebase App already initialized with different options${a?", you may need to reload as Firebase is not HMR aware.":"."}`)}}catch{}return new ie(i)}var er=(r,...s)=>{q()&&typeof console<"u"&&console[r](...s)},tr={provide:ie,useFactory:Pe,deps:[se,L,[new Be,ae]]},Go=(()=>{class r{static initializeApp(e,t){return{ngModule:r,providers:[{provide:se,useValue:e},{provide:ae,useValue:t}]}}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(t){return new(t||r)(h($))};static \u0275mod=U({type:r});static \u0275inj=B({providers:[tr]})}return r})();function ft(r,s,e,t,n){let[,o,i]=globalThis.\u0275AngularfireInstanceCache.find(a=>a[0]===r)||[];if(o)return rr(n,i)||(ht("error",`${s} was already initialized on the ${e} Firebase App with different settings.${nr?" You may need to reload as Firebase is not HMR aware.":""}`),ht("warn",{is:n,was:i})),o;{let a=t();return globalThis.\u0275AngularfireInstanceCache.push([r,a,n]),a}}function rr(r,s){try{return r.toString()===s.toString()}catch{return r===s}}var nr=typeof module<"u"&&!!module.hot,ht=(r,...s)=>{q()&&typeof console<"u"&&console[r](...s)};globalThis.\u0275AngularfireInstanceCache||=[];var or=new b("angularfire2.auth.use-emulator"),ir=new b("angularfire2.auth.settings"),sr=new b("angularfire2.auth.tenant-id"),ar=new b("angularfire2.auth.langugage-code"),cr=new b("angularfire2.auth.use-device-language"),lr=new b("angularfire.auth.persistence"),ur=(r,s,e,t,n,o,i,a)=>ft(`${r.name}.auth`,"AngularFireAuth",r.name,()=>{let l=s.runOutsideAngular(()=>r.auth());if(e&&l.useEmulator(...e),t&&(l.tenantId=t),l.languageCode=n,o&&l.useDeviceLanguage(),i)for(let[c,d]of Object.entries(i))l.settings[c]=d;return a&&l.setPersistence(a),l},[e,t,n,o,i,a]),De=(()=>{class r{injector=F(pe);authState;idToken;user;idTokenResult;credential;constructor(e,t,n,o,i,a,l,c,d,u,p,f){let W=new Y,O=z(void 0).pipe(K(i.outsideAngular),x(()=>o.runOutsideAngular(()=>import("./chunk-GCECFUOP.js"))),D(()=>Pe(e,o,t)),D(P=>ur(P,o,a,c,d,u,l,p)),de({bufferSize:1,refCount:!1}));if(He(n))this.authState=this.user=this.idToken=this.idTokenResult=this.credential=z(null);else{O.pipe(Ne()).subscribe();let P=O.pipe(x(S=>S.getRedirectResult().then(_=>_,()=>null)),Ze(this.injector),de({bufferSize:1,refCount:!1})),X=O.pipe(x(S=>new g(_=>({unsubscribe:o.runOutsideAngular(()=>S.onAuthStateChanged(M=>_.next(M),M=>_.error(M),()=>_.complete()))})))),ce=O.pipe(x(S=>new g(_=>({unsubscribe:o.runOutsideAngular(()=>S.onIdTokenChanged(M=>_.next(M),M=>_.error(M),()=>_.complete()))}))));this.authState=P.pipe(he(X),Q(i.outsideAngular),K(i.insideAngular)),this.user=P.pipe(he(ce),Q(i.outsideAngular),K(i.insideAngular)),this.idToken=this.user.pipe(x(S=>S?R(S.getIdToken()):z(null))),this.idTokenResult=this.user.pipe(x(S=>S?R(S.getIdTokenResult()):z(null))),this.credential=Oe(P,W,this.authState.pipe(Me(S=>!S))).pipe(D(S=>S?.user?S:null),Q(i.outsideAngular),K(i.insideAngular))}return pt(this,O,o,{spy:{apply:(P,X,ce)=>{(P.startsWith("signIn")||P.startsWith("createUser"))&&ce.then(S=>W.next(S))}}})}static \u0275fac=function(t){return new(t||r)(h(se),h(ae,8),h($),h(L),h(ke),h(or,8),h(ir,8),h(sr,8),h(ar,8),h(cr,8),h(lr,8),h(oe,8))};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"any"})}return r})(),ui=(()=>{class r{constructor(){y.registerVersion("angularfire",H.full,"auth-compat")}static \u0275fac=function(t){return new(t||r)};static \u0275mod=U({type:r});static \u0275inj=B({providers:[De]})}return r})();function m(r,s,e,t){return new Promise((n,o)=>{r||o("IndexedDB not available");let i=r.open(s,e),a;i.onsuccess=l=>{a=i.result,n(a)},i.onerror=l=>{o(`IndexedDB error: ${i.error}`)},typeof t=="function"&&(i.onupgradeneeded=l=>{t(l,a)})})}function gt(r,s,e,t,n){if(!r)return;let o=r.open(s,e);o.onupgradeneeded=i=>{let a=i.target.result;t.forEach(c=>{if(!a.objectStoreNames.contains(c.store)){let d=a.createObjectStore(c.store,c.storeConfig);c.storeSchema.forEach(u=>{d.createIndex(u.name,u.keypath,u.options)})}});let l=n&&n();l&&Object.keys(l).map(c=>parseInt(c,10)).filter(c=>c>i.oldVersion).sort((c,d)=>c-d).forEach(c=>{l[c](a,o.transaction)}),a.close()},o.onsuccess=i=>{i.target.result.close()}}function hr(r,s,e){if(!r||!s||!e)throw Error('Params: "dbName", "version", "storeName" are mandatory.');return new g(t=>{try{let n=s+1,o=indexedDB.open(r,n);o.onupgradeneeded=i=>{let a=i.target.result;a.deleteObjectStore(e),a.close(),console.log("onupgradeneeded"),t.next(!0),t.complete()},o.onerror=i=>t.error(i)}catch(n){t.error(n)}})}function pr(r,s){return r.objectStoreNames.contains(s)}function E(r,s,e){r||e("You need to use the openDatabase function to create a database before you query it!"),pr(r,s)||e(`objectStore does not exists: ${s}`)}function A(r,s){let e=r.transaction(s.storeName,s.dbMode);return e.onerror=s.error,e.onabort=s.abort,e}function w(r,s,e,t){return{storeName:s,dbMode:r,error:n=>{e(n)},abort:n=>{e(n)}}}var v=function(r){return r.readonly="readonly",r.readwrite="readwrite",r}(v||{}),mt=new b(null),_e=(()=>{class r{constructor(e,t){if(this.dbConfig=e,this.platformId=t,!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,gt(this.indexedDB,e.name,e.version,e.objectStoresMeta,e.migrationFactory),m(this.indexedDB,e.name).then(n=>{n.version!==e.version&&(this.dbConfig.version=n.version)}))}createObjectStore(e,t){let n=[e];gt(this.indexedDB,this.dbConfig.name,++this.dbConfig.version,n,t)}add(e,t,n){return new g(o=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{let l=A(i,w(v.readwrite,e,d=>o.error(d))).objectStore(e),c=n?l.add(t,n):l.add(t);c.onsuccess=d=>I(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,t){let n=new Promise((o,i)=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{let c=A(a,w(v.readwrite,e,o,i)).objectStore(e),d=t.map(u=>new Promise((p,f)=>{let W=u.key;delete u.key;let O=W?c.add(u,W):c.add(u);O.onsuccess=P=>{let X=P.target.result;p(X)}}));o(Promise.all(d))}).catch(a=>i(a))});return R(n)}bulkDelete(e,t){let n=t.map(o=>new Promise((i,a)=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(l=>{let c=A(l,w(v.readwrite,e,a,i));c.objectStore(e).delete(o),c.oncomplete=()=>{this.getAll(e).pipe(ue(1)).subscribe(u=>{i(u)})}}).catch(l=>a(l))}));return R(Promise.all(n))}getByKey(e,t){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{let l=A(o,w(v.readonly,e,n.error)).objectStore(e).get(t);l.onsuccess=c=>{n.next(c.target.result),n.complete()},l.onerror=c=>{n.error(c)}}).catch(o=>n.error(o))})}bulkGet(e,t){let n=t.map(o=>this.getByKey(e,o));return new g(o=>{je(n).subscribe(i=>{o.next(i),o.complete()})})}getByID(e,t){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{E(o,e,c=>n.error(c));let l=A(o,w(v.readonly,e,n.error,n.next)).objectStore(e).get(t);l.onsuccess=c=>{n.next(c.target.result)}}).catch(o=>n.error(o))})}getByIndex(e,t,n){return new g(o=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{E(i,e,u=>o.error(u));let d=A(i,w(v.readonly,e,o.error)).objectStore(e).index(t).get(n);d.onsuccess=u=>{o.next(u.target.result),o.complete()}}).catch(i=>o.error(i))})}getAll(e){return new g(t=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(n=>{E(n,e,l=>t.error(l));let a=A(n,w(v.readonly,e,t.error,t.next)).objectStore(e).getAll();a.onerror=l=>{t.error(l)},a.onsuccess=({target:{result:l}})=>{t.next(l),t.complete()}}).catch(n=>t.error(n))})}update(e,t){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{E(o,e,c=>n.error(c));let a=A(o,w(v.readwrite,e,c=>n.error(c))).objectStore(e),l=a.put(t);l.onsuccess=c=>I(this,null,function*(){let d=c.target.result,u=a.get(d);u.onsuccess=p=>{n.next(p.target.result),n.complete()}})}).catch(o=>n.error(o))})}delete(e,t){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{E(o,e,l=>n.error(l));let i=A(o,w(v.readwrite,e,l=>n.error(l)));i.objectStore(e).delete(t),i.oncomplete=()=>{this.getAll(e).pipe(ue(1)).subscribe(l=>{n.next(l),n.complete()})}}).catch(o=>n.error(o))})}deleteByKey(e,t){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{E(o,e,l=>n.error(l));let i=A(o,w(v.readwrite,e,l=>n.error(l))),a=i.objectStore(e);i.oncomplete=()=>{n.next(!0),n.complete()},a.delete(t)}).catch(o=>n.error(o))})}clear(e){return new g(t=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(n=>{E(n,e,a=>t.error(a));let o=A(n,w(v.readwrite,e,a=>t.error(a)));o.objectStore(e).clear(),o.oncomplete=()=>{t.next(!0),t.complete()}}).catch(n=>t.error(n))})}deleteDatabase(){return new g(e=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(t=>I(this,null,function*(){yield t.close();let n=this.indexedDB.deleteDatabase(this.dbConfig.name);n.onsuccess=()=>{e.next(!0),e.complete()},n.onerror=o=>e.error(o),n.onblocked=()=>{throw new Error("Unable to delete database because it's blocked")}})).catch(t=>e.error(t))})}openCursor(e,t){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{E(o,e,c=>n.error(c));let a=A(o,w(v.readonly,e,n.error)).objectStore(e),l=t===void 0?a.openCursor():a.openCursor(t);l.onsuccess=c=>{n.next(c),n.complete()}}).catch(o=>n.error(o))})}openCursorByIndex(e,t,n,o=v.readonly){let i=new Y;return m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{E(a,e,p=>{i.error(p)});let u=A(a,w(o,e,p=>{i.error(p)},()=>{i.next()})).objectStore(e).index(t).openCursor(n);u.onsuccess=p=>{i.next(p)}}).catch(a=>i.error(a)),i}getAllByIndex(e,t,n){let o=[];return new g(i=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{E(a,e,p=>i.error(p));let u=A(a,w(v.readonly,e,i.error)).objectStore(e).index(t).openCursor(n);u.onsuccess=p=>{let f=p.target.result;f?(o.push(f.value),f.continue()):(i.next(o),i.complete())}}).catch(a=>i.error(a))})}getAllKeysByIndex(e,t,n){let o=[];return new g(i=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{E(a,e,p=>i.error(p));let u=A(a,w(v.readonly,e,i.error)).objectStore(e).index(t).openKeyCursor(n);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(a=>i.error(a))})}count(e,t){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(o=>{E(o,e,c=>n.error(c));let l=A(o,w(v.readonly,e,n.error)).objectStore(e).count(t);l.onerror=c=>n.error(c),l.onsuccess=c=>{n.next(c.target.result),n.complete()}}).catch(o=>n.error(o))})}countByIndex(e,t,n){return new g(o=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{E(i,e,u=>o.error(u));let d=A(i,w(v.readonly,e,o.error)).objectStore(e).index(t).count(n);d.onerror=u=>o.error(u),d.onsuccess=u=>{o.next(u.target.result),o.complete()}}).catch(i=>o.error(i))})}deleteObjectStore(e){return hr(this.dbConfig.name,++this.dbConfig.version,e)}}return r.\u0275fac=function(e){return new(e||r)(h(mt),h($))},r.\u0275prov=k({token:r,factory:r.\u0275fac}),r})(),vi=(()=>{class r{static forRoot(e){return{ngModule:r,providers:[_e,{provide:mt,useValue:e}]}}}return r.\u0275fac=function(e){return new(e||r)},r.\u0275mod=U({type:r}),r.\u0275inj=B({imports:[[$e]]}),r})();var St=(()=>{class r{constructor(e){this.db=e,this.DATABASE="Categories"}saveCategoriesByChannelType(e,t){let n=this.getKey(t);return this.db.add(this.DATABASE,e,n).pipe(D(o=>e))}getCategoriesByChannelType(e){let t=this.getKey(e);return this.db.getByKey(this.DATABASE,t)}getKey(e){let t="";switch(e){case ge.Lazada:t="Lazada";break;case ge.Tokopedia:t="Tokopedia";break}return t}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(t){return new(t||r)(h(_e))}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var vt=(()=>{class r{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 t={Enabled:!0};e&&(t=le(le({},t),e)),localStorage.setItem("Intercom",JSON.stringify(t))}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(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var At=(()=>{class r{constructor(){this.httpService=F(te),this.currentUser=fe(null),this.tokenValue=fe(null)}refreshToken(){return this.httpService.get(Ye.RefreshToken).pipe(V(e=>{this.updateTokenInLocalStorage(e)}))}updateTokenInLocalStorage(e){this.saveUserToLocalStorage(e),this.saveChannelsToLocalStorage(e.Channels)}saveUserToLocalStorage(e){let t=JSON.stringify(e);localStorage.setItem(T.USER,t)}getUser(){if(this.currentUser())return this.currentUser();{let e=localStorage.getItem(T.USER);return this.currentUser.set(e?JSON.parse(e):null),this.currentUser()}}getTokenValue(){let e=this.getUser();if(!this.tokenValue()){let t=Qe.parseJwt(e?.Token.access_token);this.tokenValue.set(t)}return this.tokenValue()}saveChannelsToLocalStorage(e){let t=JSON.stringify(e);localStorage.setItem(T.CHANNELS,t)}getChannels(){let e=localStorage.getItem(T.CHANNELS);return e?JSON.parse(e):[]}clearStorage(){localStorage.removeItem(T.USER),localStorage.removeItem(T.CHANNELS),this.currentUser.set(null),this.tokenValue.set(null)}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var $i=(()=>{class r{constructor(e,t,n,o,i,a,l,c){this.httpService=e,this.tokenDecodeService=t,this.afAuth=n,this.ngxPermission=o,this.localDataService=i,this.router=a,this.intercomService=l,this.tokenService=c}login(e){return this.httpService.post("/api/token/Login",e).pipe(V(t=>{this.setLocalStorage(t,e.Host,e.Username),this.loadPermissions()}))}getNews(){return this.httpService.get(et.news).pipe(D(e=>e?.items?.map(t=>t?.properties)))}loginWithGoogle(e,t){e.preventDefault();let n=new Ae;return n.setCustomParameters({prompt:"select_account"}),R(this.afAuth.signInWithPopup(n)).pipe(D(o=>o.credential),D(o=>o.idToken),x(o=>this.httpService.post("/api/token/LoginWithSocialProvider",JSON.stringify({IDToken:o,Host:t}))),V(o=>{this.setLocalStorage(o,t,null),this.loadPermissions()}))}setLocalStorage(e,t,n){this.tokenService.updateTokenInLocalStorage(e),localStorage.setItem(T.AUTHORIZATION,JSON.stringify({Host:t,username:n})),this.intercomService.updateLocalStorage(e.IntercomWidget),this.intercomService.inititalizeIntercom()}loadPermissions(){this.ngxPermission.loadPermissions([]);let e=localStorage.getItem(T.USER);if(ee.IsNotEmpty(e)){let t=this.tokenDecodeService.GetRoles();this.ngxPermission.loadPermissions(t)}}getChannels(){return this.tokenService.getChannels()}logout(){this.clearLocalStorage(),this.ngxPermission.flushPermissions()}isActiveToken(){let e=this.tokenService.getUser(),t=new Date;if(e!=null){let n=new Date(e.Token.expiredAt);return t<n?!0:(this.clearLocalStorage(),!1)}else return!1}getDomain(){if(!this.domain){let e=localStorage.getItem(T.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(t){return new(t||r)(h(te),h(Je),h(De),h(Xe),h(St),h(We),h(vt),h(At))}}static{this.\u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();export{et as a,Go as b,ui as c,vi as d,St as e,vt as f,At as g,$i as h};
@@ -1 +1 @@
1
- import{a as r}from"./chunk-227LB3XT.js";import{a as C}from"./chunk-5KS4WK6H.js";import{a as h,b as y}from"./chunk-HYJVHRMN.js";import"./chunk-S5SDX7ZG.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-V3NCYRCF.js";import"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-AEOSNAHH.js";import"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import"./chunk-ATZ475FN.js";import"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{F as v,J as o,n}from"./chunk-M2FCTYGU.js";import{Gb as l,Hb as s,Qc as f,Yb as u,ic as c,jc as d,ka as m,kc as i,rb as p}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var M=(()=>{class e{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"},{Title:"Different Inventory",Url:"/menu/inventory/channel_summary"}]}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=l({type:e,selectors:[["app-inventory"]],features:[f([C])],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,b){t&1&&(c(0,"nav",0)(1,"div",1)(2,"div"),i(3,"nav-tab",2),d()()(),i(4,"router-outlet")),t&2&&(p(3),u("Tabs",b.inventoryTabs))},dependencies:[n,y,h,o,v],encapsulation:2})}}return e})();var g=[{path:"",component:M,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-R4GAF5EA.js").then(e=>e.MultiChannelComparison)},canActivate:[r],data:{title:"Inventory Comparison"}},{path:"bychannel",loadComponent(){return import("./chunk-Y2QG7YNG.js").then(e=>e.SingleChannelComparisonComponent)},canActivate:[r],data:{title:"Inventory Comparison"}},{path:"channel_summary",loadComponent(){return import("./chunk-74FAXIJ6.js").then(e=>e.ChannelSummaryComponent)},canActivate:[r],data:{title:"Different Inventory"}}]}],E=(()=>{class e{static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275mod=s({type:e})}static{this.\u0275inj=m({imports:[n,o.forChild(g)]})}}return e})();export{E as InventoryRoutingModule};
1
+ import{a as r}from"./chunk-PFRHV7VB.js";import{a as C}from"./chunk-5KS4WK6H.js";import{a as h,b as y}from"./chunk-HYJVHRMN.js";import"./chunk-USNELOQD.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-AEOSNAHH.js";import"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import"./chunk-ATZ475FN.js";import"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{F as v,J as o,n}from"./chunk-M2FCTYGU.js";import{Gb as l,Hb as s,Qc as f,Yb as u,ic as c,jc as d,ka as m,kc as i,rb as p}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var M=(()=>{class e{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"},{Title:"Different Inventory",Url:"/menu/inventory/channel_summary"}]}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=l({type:e,selectors:[["app-inventory"]],features:[f([C])],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,b){t&1&&(c(0,"nav",0)(1,"div",1)(2,"div"),i(3,"nav-tab",2),d()()(),i(4,"router-outlet")),t&2&&(p(3),u("Tabs",b.inventoryTabs))},dependencies:[n,y,h,o,v],encapsulation:2})}}return e})();var g=[{path:"",component:M,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-Y77CFR5W.js").then(e=>e.MultiChannelComparison)},canActivate:[r],data:{title:"Inventory Comparison"}},{path:"bychannel",loadComponent(){return import("./chunk-IONDX3X4.js").then(e=>e.SingleChannelComparisonComponent)},canActivate:[r],data:{title:"Inventory Comparison"}},{path:"channel_summary",loadComponent(){return import("./chunk-BXVG56VT.js").then(e=>e.ChannelSummaryComponent)},canActivate:[r],data:{title:"Different Inventory"}}]}],E=(()=>{class e{static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275mod=s({type:e})}static{this.\u0275inj=m({imports:[n,o.forChild(g)]})}}return e})();export{E as InventoryRoutingModule};
@@ -1 +1 @@
1
- import{a as o}from"./chunk-227LB3XT.js";import{a as s,b as l}from"./chunk-HYJVHRMN.js";import"./chunk-S5SDX7ZG.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-V3NCYRCF.js";import"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-AEOSNAHH.js";import"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import"./chunk-ATZ475FN.js";import"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{F as c,J as d}from"./chunk-M2FCTYGU.js";import{Gb as a,Yb as i,ic as p,jc as m,kc as n,rb as r}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var f=(()=>{class t{constructor(){this.tabs=[{Title:"Origin Order API",Url:"/menu/json-api/order-api"},{Title:"Origin Product API",Url:"/menu/json-api/product-api"},{Title:"Origin Escrow API",Url:"/menu/json-api/escrow-api"}]}static{this.\u0275fac=function(e){return new(e||t)}}static{this.\u0275cmp=a({type:t,selectors:[["app-json-api"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(e,v){e&1&&(p(0,"nav",0)(1,"div",1)(2,"div"),n(3,"nav-tab",2),m()()(),n(4,"router-outlet")),e&2&&(r(3),i("Tabs",v.tabs))},dependencies:[l,s,d,c],encapsulation:2})}}return t})(),g=[{path:"",component:f,children:[{path:"",redirectTo:"order-api",pathMatch:"full"},{path:"order-api",loadComponent(){return import("./chunk-2CBZOVID.js").then(t=>t.OrderApiComponent)},canActivate:[o],data:{title:"Order API"}},{path:"product-api",loadComponent(){return import("./chunk-T6SBAKYS.js").then(t=>t.ProductApiComponent)},canActivate:[o],data:{title:"Product API"}},{path:"escrow-api",loadComponent(){return import("./chunk-JFUCAI5X.js").then(t=>t.EscrowApiComponent)},canActivate:[o],data:{title:"Escrow API"}}]}];export{f as JsonApiComponent,g as routes};
1
+ import{a as o}from"./chunk-PFRHV7VB.js";import{a as s,b as l}from"./chunk-HYJVHRMN.js";import"./chunk-USNELOQD.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-AEOSNAHH.js";import"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import"./chunk-ATZ475FN.js";import"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{F as c,J as d}from"./chunk-M2FCTYGU.js";import{Gb as a,Yb as i,ic as p,jc as m,kc as n,rb as r}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var f=(()=>{class t{constructor(){this.tabs=[{Title:"Origin Order API",Url:"/menu/json-api/order-api"},{Title:"Origin Product API",Url:"/menu/json-api/product-api"},{Title:"Origin Escrow API",Url:"/menu/json-api/escrow-api"}]}static{this.\u0275fac=function(e){return new(e||t)}}static{this.\u0275cmp=a({type:t,selectors:[["app-json-api"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(e,v){e&1&&(p(0,"nav",0)(1,"div",1)(2,"div"),n(3,"nav-tab",2),m()()(),n(4,"router-outlet")),e&2&&(r(3),i("Tabs",v.tabs))},dependencies:[l,s,d,c],encapsulation:2})}}return t})(),g=[{path:"",component:f,children:[{path:"",redirectTo:"order-api",pathMatch:"full"},{path:"order-api",loadComponent(){return import("./chunk-BRTYGXCD.js").then(t=>t.OrderApiComponent)},canActivate:[o],data:{title:"Order API"}},{path:"product-api",loadComponent(){return import("./chunk-LRR6JS6H.js").then(t=>t.ProductApiComponent)},canActivate:[o],data:{title:"Product API"}},{path:"escrow-api",loadComponent(){return import("./chunk-QZEHOQYW.js").then(t=>t.EscrowApiComponent)},canActivate:[o],data:{title:"Escrow API"}}]}];export{f as JsonApiComponent,g as routes};
@@ -0,0 +1 @@
1
+ import{a as M}from"./chunk-7AQ244V7.js";import{a as Ve,b as Te}from"./chunk-RMCAWPWK.js";import"./chunk-3LRWABHB.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import{a as E}from"./chunk-XHAXYWZ7.js";import{a as De,b as Ee,c as Me,d as U}from"./chunk-UDIDZKN6.js";import"./chunk-M5XGP4SG.js";import{a as be,b as Fe}from"./chunk-CIIO2CJ6.js";import"./chunk-H3J5OAIG.js";import"./chunk-AQTXFEBA.js";import{a as ve}from"./chunk-JMPW6NPQ.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import{a as ye}from"./chunk-SYUFPF3D.js";import"./chunk-5OHRA4AS.js";import"./chunk-3BT5DR3X.js";import"./chunk-3RK6DDJD.js";import"./chunk-J2KWRDVH.js";import"./chunk-7SVF5UPT.js";import{a as se}from"./chunk-5DIRXS7I.js";import"./chunk-CMTBBXR5.js";import{h as he}from"./chunk-USNELOQD.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import{a as Ce,b as ue,d as xe,e as fe}from"./chunk-5JVEEL2T.js";import{c as pe}from"./chunk-PW42BQIY.js";import{b as de,c as ge}from"./chunk-SWQXSJ7O.js";import"./chunk-DRMAONR7.js";import"./chunk-AEOSNAHH.js";import{b as _e,e as me}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{d as Pe,l as Se,m as Ie,n as we}from"./chunk-CLER2MX6.js";import{A as ce,b as ie,c as oe,h as ae,m as re,o as le}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{d as X,g as Y,j as ee,m as D,n as te,q as ne}from"./chunk-M2FCTYGU.js";import{$c as y,Fc as H,G as W,Gb as z,Gc as d,Hc as R,Ic as b,Kc as I,Lc as w,Mb as h,Mc as v,Qc as J,Sc as T,Yb as m,Z as A,ad as F,bd as Z,cd as Q,dc as P,ea as $,ec as N,gc as k,hc as L,ic as a,jc as c,kc as S,lc as G,mc as q,oc as x,pa as j,pb as V,rb as l,tc as C,uc as r,xb as u,xc as K,ya as p,za as _}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var B=i=>[i],Re=i=>({"text-decoration-line-through":i}),Ue=i=>({"bg-gradient-warning":i});function Be(i,s){if(i&1&&(a(0,"span",10),S(1,"img",11),c(),d(2)),i&2){let e=s.item;l(),m("src",e==null?null:e.Img,V),l(),b(" ",e.Name," ")}}function Oe(i,s){if(i&1){let e=x();a(0,"button",16),C("click",function(){p(e);let t=r().ngIf,o=r(2);return _(o.updateStock(t))}),S(1,"i",17),d(2," Update "),c()}}function We(i,s){if(i&1){let e=x();a(0,"actions")(1,"div",12),h(2,Oe,3,0,"button",13),a(3,"button",14),C("click",function(){p(e);let t=r(2);return _(t.openExportDialog())}),S(4,"i",15),a(5,"span"),d(6,"Export"),c()()()()}if(i&2){let e=s.ngIf,n=r(2);l(2),m("ngIf",n.productService.hasSelectionVariant(e))}}function Ae(i,s){if(i&1){let e=x();a(0,"th")(1,"input",32),C("change",function(t){p(e);let o=r().ngIf,g=r(2);return _(g.onSelectAllSKU(t.target.checked,o))}),c()()}}function $e(i,s){if(i&1){let e=x();a(0,"input",49),v("ngModelChange",function(t){p(e);let o=r(4).$implicit;return w(o.selected,t)||(o.selected=t),_(t)}),C("ngModelChange",function(){p(e);let t=r(4).$implicit,o=r(3);return _(o.onCheckboxStateProduct(t))}),c()}if(i&2){let e=r(4).$implicit;I("ngModel",e.selected)}}function je(i,s){if(i&1&&h(0,$e,1,1,"ng-template",26),i&2){let e=r(6);m("ngxPermissionsOnly",T(1,B,e.rolePriceEdit))}}function ze(i,s){if(i&1){let e=x();G(0),a(1,"img",50),C("click",function(t){p(e);let o=r(3).$implicit,g=r(3);return _(g.onZoomImage(t,o==null?null:o.ImageUrl))}),c(),q()}if(i&2){let e=r(3).$implicit;l(),K("src",e.ThumbnailUrl,V)}}function Ge(i,s){i&1&&S(0,"img",51)}function qe(i,s){if(i&1&&(a(0,"small",48),d(1),c()),i&2){let e=r(3).$implicit;l(),b("(",e.Category,")")}}function Ke(i,s){if(i&1&&(a(0,"td",44)(1,"div",35),h(2,je,1,3,null,26),a(3,"div"),h(4,ze,2,1,"ng-container",45)(5,Ge,1,0,"ng-template",null,0,Q),c()()(),a(7,"td",46)(8,"span",47),d(9),c(),h(10,qe,2,1,"small",48),c()),i&2){let e=H(6),n=r(2).$implicit;m("rowSpan",n.Variants.length),l(2),P((n.Variants==null?null:n.Variants.length)>1?2:-1),l(2),m("ngIf",n.ThumbnailUrl)("ngIfElse",e),l(3),m("rowSpan",n.Variants.length),l(2),R(n.Name),l(),P(n.Category?10:-1)}}function He(i,s){if(i&1){let e=x();a(0,"input",54),v("ngModelChange",function(t){p(e);let o=r(2).$implicit;return w(o.selected,t)||(o.selected=t),_(t)}),c()}if(i&2){let e=r(2).$implicit;I("ngModel",e.selected)}}function Je(i,s){if(i&1&&(a(0,"td",52),h(1,He,1,1,"input",53),c()),i&2){let e=r().$implicit;l(),P(e.UnitPrice>=0?1:-1)}}function Ze(i,s){i&1&&(a(0,"div",36),d(1," Not Found "),c())}function Qe(i,s){if(i&1&&(a(0,"div"),d(1),y(2,"number"),c()),i&2){let e=r().$implicit;l(),b(" ",F(2,1,e.UnitPrice)," ")}}function Xe(i,s){if(i&1&&(a(0,"div",37)(1,"a",40),S(2,"i",55),c()()),i&2){let e=r().$implicit,n=r(4);l(),m("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),V)}}function Ye(i,s){if(i&1){let e=x();a(0,"div",56),C("click",function(){p(e);let t=r().$implicit,o=r().$implicit,g=r(2).ngIf,f=r();return _(f.openTableDialog(t,o,g))}),d(1),y(2,"number"),c()}if(i&2){let e=r().$implicit;l(),b(" ",F(2,1,e.Channel[0]==null?null:e.Channel[0].Price)," ")}}function et(i,s){if(i&1){let e=x();a(0,"tr",33),h(1,Ke,11,7),a(2,"td",24),d(3),c(),a(4,"td",27)(5,"span",34),d(6),c()(),h(7,Je,2,1,"ng-template",26),a(8,"td",27)(9,"div",35),h(10,Ze,2,0,"div",36)(11,Qe,3,3,"div")(12,Xe,3,1,"div",37),c()(),a(13,"td",38)(14,"div",35),h(15,Ye,3,3,"div",39),a(16,"div",37)(17,"a",40),S(18,"i",41),c()(),a(19,"div",37)(20,"div",42),C("click",function(){let t=p(e).$implicit,o=r(4);return _(o.refreshPrice(t))}),S(21,"i",43),c()()()()()}if(i&2){let e=s.$implicit,n=s.$index,t=r(4);l(),P(n==0?1:-1),l(2),R(e.Model),l(2),m("matTooltip",e.Discontinued?t.discontinuedVariantMsg:"")("ngClass",T(12,Re,e.Discontinued)),l(),b(" ",e.Code," "),l(),m("ngxPermissionsOnly",T(14,B,t.rolePriceEdit)),l(3),P((e.Channel[0]==null?null:e.Channel[0].Description)!=null?10:-1),l(),P((e.Channel[0]==null?null:e.Channel[0].Description)==null?11:-1),l(),P((e.Channel[0]==null?null:e.Channel[0].Description)==null?12:-1),l(),m("ngClass",T(16,Ue,e.UnitPrice!=(e.Channel[0]==null?null:e.Channel[0].Price))),l(2),P(e.Channel.length>0?15:-1),l(2),m("href",e.Channel[0]==null?null:e.Channel[0].Url,V)}}function tt(i,s){if(i&1&&k(0,et,22,18,"tr",33,N),i&2){let e=s.$implicit;L(e.Variants)}}function nt(i,s){if(i&1){let e=x();a(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),a(8,"div")(9,"mat-slide-toggle",23),v("ngModelChange",function(t){p(e);let o=r(2);return w(o.toggleDifferentInventory,t)||(o.toggleDifferentInventory=t),_(t)}),C("toggleChange",function(){p(e);let t=r(2);return _(t.onToggleDifferentInventory())}),a(10,"small",7),d(11,"FILTER DIFFERENT PRICE"),c()()()(),a(12,"th",24),d(13,"Variant"),c(),a(14,"th",25),d(15,"SKU"),c(),h(16,Ae,2,0,"ng-template",26),a(17,"th",27),d(18,"POS"),c(),a(19,"th",27)(20,"div",28),C("click",function(){p(e);let t=r(2);return _(t.openModalFilter())}),S(21,"img",29),a(22,"span",30),d(23),y(24,"stringLimit"),c()()()()(),a(25,"tbody"),k(26,tt,2,0,null,null,N),c()(),a(28,"infinite-paginator",31),y(29,"async"),C("onNextPage",function(){p(e);let t=r(2);return _(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){p(e);let t=r(2);return _(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){p(e);let t=r(2);return _(t.infinitePagination.getRowCount(t.searchFilter))}),c()()()()}if(i&2){let e=s.ngIf,n=r(2);l(9),I("ngModel",n.toggleDifferentInventory),l(7),m("ngxPermissionsOnly",T(16,B,n.rolePriceEdit)),l(4),m("matTooltip",(n.selectedChannel==null||n.selectedChannel.Name==null?null:n.selectedChannel.Name.length)>=20?n.selectedChannel==null?null:n.selectedChannel.Name:""),l(),m("src",n.selectedChannel==null?null:n.selectedChannel.Img,V),l(2),b(" ",Z(24,11,n.selectedChannel==null?null:n.selectedChannel.Name,20)," "),l(3),L(e),l(2),m("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",F(29,14,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage())}}function it(i,s){if(i&1){let e=x();a(0,"mainpanel",2),v("textChange",function(t){p(e);let o=r();return w(o.searchFilter.text,t)||(o.searchFilter.text=t),_(t)}),C("onSubmit",function(){p(e);let t=r();return _(t.onSearch())}),a(1,"filters")(2,"div")(3,"label",3),d(4,"Channel"),c(),a(5,"ng-select",4),v("ngModelChange",function(t){p(e);let o=r();return w(o.searchFilter.ChannelID,t)||(o.searchFilter.ChannelID=t),_(t)}),h(6,Be,3,2,"ng-template",5),c()(),a(7,"div",6)(8,"label",7),d(9,"Page Number"),c(),a(10,"input",8),v("ngModelChange",function(t){p(e);let o=r();return w(o.searchFilter.PageNumber,t)||(o.searchFilter.PageNumber=t),_(t)}),c()(),a(11,"div",6)(12,"label",7),d(13,"Page Size"),c(),a(14,"input",8),v("ngModelChange",function(t){p(e);let o=r();return w(o.searchFilter.RowCount,t)||(o.searchFilter.RowCount=t),_(t)}),c()()(),h(15,We,7,1,"actions",9),y(16,"async"),h(17,nt,30,18,"content",9),y(18,"async"),c()}if(i&2){let e=r();m("headerTitle",e.pageTitle),I("text",e.searchFilter.text),l(5),m("clearable",!1)("items",e.channelOptions),I("ngModel",e.searchFilter.ChannelID),l(5),I("ngModel",e.searchFilter.PageNumber),l(4),I("ngModel",e.searchFilter.RowCount),l(),m("ngIf",F(16,9,e.data$)),l(2),m("ngIf",F(18,11,e.data$))}}var Wt=(()=>{class i{constructor(e,n,t,o,g,f,O,Ne,ke,Le){this.http=e,this.toastr=n,this.dialog=t,this.productService=o,this.biggerPictureService=g,this.inventoryService=f,this.authService=O,this.mainPanelService=Ne,this.exportService=ke,this.decimalPipe=Le,this.infinitePagination=j(U),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=se.PriceUpdate,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.hostName=this.authService.getDomain(),this.data$=this.infinitePagination.data$.pipe(A(1)),this.channelOptions=O.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe($(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=E.ALL,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=E.ALL:this.searchFilter.filterModel=E.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let t=this.productService.selectedVariantProduct(e).map(g=>({ID:g.ID,ChannelID:g.Channel[0].ChannelID,Code:g.Code,Price:g.UnitPrice})),o={ListChannelID:[this.searchFilter.ChannelID],ListPrice:t};this.http.post("/api/Price/UpdateChannel",o).subscribe(g=>{this.onSearch(),this.handlingUpdateStock(g.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let n=e.failure_list,t=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",t,n)}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let n={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",n).subscribe(t=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openTableDialog(e,n,t){let o=JSON.parse(JSON.stringify(e));this.dialog.open(De,{data:{Name:n.Name,Variant:o,ChannelID:o?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:o?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(W(f=>pe.IsNotEmpty(f))).subscribe(f=>{this.updateItemAfterDialog(f,e)})}updateItemAfterDialog(e,n){let t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(o=>{let g=this.productService.findChannelById(t.ID,this.channelOptions),f=t.Price?this.decimalPipe.transform(t.Price):t.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${g.Name} to ${f}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=t.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(t=>(t.Variants=t.Variants.map(o=>(o.selected=e,o)),t))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}openExportDialog(){this.dialog.open(Te,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}static{this.\u0275fac=function(n){return new(n||i)(u(me),u(_e),u(Pe),u(ve),u(ye),u(M),u(he),u(Se),u(Ve),u(D))}}static{this.\u0275cmp=z({type:i,selectors:[["app-price-single-channel"]],features:[J([U,M,ne("https://res.cloudinary.com/"),D])],decls:2,vars:3,consts:[["elsePic",""],["class","single-price",3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[1,"single-price",3,"textChange","onSubmit","headerTitle","text"],[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"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src"],[1,"d-flex"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModelChange","toggleChange","ngModel"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-solid","fa-arrow-up-right-from-square"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[4,"ngIf","ngIfElse"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","8px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","8px"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"cursor","pointer",3,"click"]],template:function(n,t){n&1&&(h(0,it,19,13,"mainpanel",1),y(1,"async")),n&2&&m("ngIf",F(1,1,t.loader$))},dependencies:[te,X,Y,ee,D,we,Ie,fe,xe,Ce,ue,ce,oe,le,ie,ae,re,Ee,Me,ge,de,Fe,be],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"],changeDetection:0})}}return i})();export{Wt as PriceSingleChannelComponent};
@@ -1 +1 @@
1
- import{a as ce,b as ue,c as _e}from"./chunk-V5BKQSAT.js";import{a as fe}from"./chunk-MQQD4OJO.js";import{a as de}from"./chunk-CATX24UZ.js";import{a as se}from"./chunk-66MLRB2J.js";import"./chunk-M5JQ7BGW.js";import{a as pe}from"./chunk-EPVCMYCI.js";import"./chunk-JDIBETL5.js";import"./chunk-L7K5HOBY.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import"./chunk-H3J5OAIG.js";import"./chunk-AQTXFEBA.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import"./chunk-5OHRA4AS.js";import"./chunk-3BT5DR3X.js";import"./chunk-3RK6DDJD.js";import"./chunk-J2KWRDVH.js";import"./chunk-7SVF5UPT.js";import"./chunk-CMTBBXR5.js";import{a as me}from"./chunk-WPW3D4MQ.js";import"./chunk-S5SDX7ZG.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import{a as ne}from"./chunk-V3NCYRCF.js";import"./chunk-5JVEEL2T.js";import"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-AEOSNAHH.js";import{e as ie}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as oe,n as ae}from"./chunk-CLER2MX6.js";import{A as te,c as Y,h as Z,m as $,o as ee}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{r as re,s as le}from"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{j as J,k as K,m as Q,n as X}from"./chunk-M2FCTYGU.js";import{$c as w,Gb as N,Gc as a,Hc as v,Ic as B,Kc as f,Lc as g,Mb as x,Mc as C,Nc as z,Oc as j,Pc as H,Qc as R,Ra as O,Rc as U,Sc as G,Yb as c,Z as P,ac as W,ad as A,bd as q,dc as b,ec as I,gc as D,hc as k,ic as t,ja as L,jc as n,kc as u,oc as V,pa as y,pb as F,rb as o,tc as M,uc as _,v as T,ya as d,za as s}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var E=(()=>{class i{constructor(){this.httpService=y(ie)}getAllOrders(e){return this.httpService.post(ne.GetAll,e).pipe(T(m=>m.Data))}static{this.\u0275fac=function(m){return new(m||i)}}static{this.\u0275prov=L({token:i,factory:i.\u0275fac})}}return i})();var Ce=()=>[],he=i=>({"td-cell-hover":i});function Se(i,h){if(i&1&&u(0,"variants-dropdown",27),i&2){let e=_().$implicit;c("variants",e==null?null:e.Variants)}}function ve(i,h){if(i&1&&u(0,"variant-with-image",28),i&2){let e=_().$implicit;c("variant",e==null?null:e.Variants[0])}}function we(i,h){if(i&1&&(t(0,"span"),a(1),n()),i&2){let e=_().$implicit;o(),v(e.LogisticService==null?null:e.LogisticService.Option)}}function ye(i,h){if(i&1&&(t(0,"tr")(1,"td")(2,"div",23)(3,"div",24)(4,"div"),u(5,"img",25),w(6,"channelImage"),n(),t(7,"div"),u(8,"order-link",26),n()(),t(9,"small"),a(10),w(11,"date"),n()()(),t(12,"td"),a(13),n(),t(14,"td"),x(15,Se,1,1,"variants-dropdown",27)(16,ve,1,1,"variant-with-image",28),n(),t(17,"td"),a(18),w(19,"number"),n(),t(20,"td")(21,"span"),a(22),n(),x(23,we,2,1,"span"),n()()),i&2){let e=h.$implicit;o(5),c("src",A(6,11,e==null?null:e.MarketType),F)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),o(3),c("order",e),o(2),B(" ",q(11,13,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),o(3),v(e.Customer),o(),W(G(18,he,(e.Variants==null?null:e.Variants.length)>1)),o(),b((e.Variants==null?null:e.Variants.length)>1?15:16),o(3),v(A(19,16,e.Amount)),o(4),v(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),o(),b(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?23:-1)}}function xe(i,h){if(i&1){let e=V();t(0,"div",15)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),a(5,"Number"),n(),t(6,"th",20),a(7,"Customer"),n(),t(8,"th"),a(9,"Items"),n(),t(10,"th",21),a(11,"Amount"),n(),t(12,"th",21),a(13,"Shipping"),n()()(),t(14,"tbody"),D(15,ye,24,20,"tr",null,I),n()(),t(17,"app-custom-paginator",22),M("next",function(){d(e);let r=_();return s(r.initAllOrders())})("previous",function(){d(e);let r=_();return s(r.initAllOrders())}),n()()}if(i&2){let e=_(),m=H(0);o(15),k(m),o(2),c("filter",e.filter())("totaldata",m==null?null:m.length)}}function be(i,h){i&1&&(t(0,"div",16),u(1,"app-empty-state"),n())}var Ze=(()=>{class i{constructor(){this.allService=y(E),this.filter=O({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){this.initAllOrders()}initAllOrders(){this.allOrders$=this.allService.getAllOrders(this.filter()).pipe(P(1))}static{this.\u0275fac=function(m){return new(m||i)}}static{this.\u0275cmp=N({type:i,selectors:[["app-all"]],features:[R([E])],decls:34,vars:12,consts:[["headerTitle","Completed","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],["rowCountApi","/api/orders/allcount",3,"next","previous","filter","totaldata"],[1,"lh-sm"],[1,"d-flex","align-items-end","gap-2"],[2,"width","14px","padding-bottom","2.5px",3,"src","alt"],[3,"order"],[3,"variants"],[3,"variant"]],template:function(m,r){if(m&1){let p=V();z(0),w(1,"async"),t(2,"mainpanel",0),M("onSubmit",function(){return d(p),s(r.initAllOrders())}),C("textChange",function(l){return d(p),g(r.filter().Number,l)||(r.filter().Number=l),s(l)}),t(3,"actions")(4,"a",1),u(5,"i",2),t(6,"span"),a(7,"Order Fulfillment Display"),n()()(),t(8,"filters")(9,"div")(10,"label",3),a(11,"From/To"),n(),t(12,"channel-select-options",4),C("ngModelChange",function(l){return d(p),g(r.filter().ListChannelID,l)||(r.filter().ListChannelID=l),s(l)}),n()(),t(13,"div",5)(14,"label",3),a(15,"From/To"),n(),t(16,"div",6)(17,"datepicker",7),C("dateChange",function(l){return d(p),g(r.filter().From,l)||(r.filter().From=l),s(l)}),n()(),t(18,"div")(19,"datepicker",8),C("dateChange",function(l){return d(p),g(r.filter().To,l)||(r.filter().To=l),s(l)}),n()()(),t(20,"div",5)(21,"label",9),a(22,"Page Number"),n(),t(23,"input",10),C("ngModelChange",function(l){return d(p),g(r.filter().PageNumber,l)||(r.filter().PageNumber=l),s(l)}),n()(),t(24,"div",5)(25,"label",9),a(26,"Page Size"),n(),t(27,"input",11),C("ngModelChange",function(l){return d(p),g(r.filter().PageSize,l)||(r.filter().PageSize=l),s(l)}),n()()(),t(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),x(32,xe,18,2,"div",15)(33,be,2,0,"div",16),n()()()()()}if(m&2){let p=j(A(1,8,r.allOrders$)||U(11,Ce));o(2),f("text",r.filter().Number),o(10),c("multiple",!0),f("ngModel",r.filter().ListChannelID),o(5),f("date",r.filter().From),o(2),f("date",r.filter().To),o(4),f("ngModel",r.filter().PageNumber),o(4),f("ngModel",r.filter().PageSize),o(5),b((p==null?null:p.length)>0?32:33)}},dependencies:[X,J,Q,K,ae,oe,pe,me,te,Y,ee,Z,$,ce,ue,_e,se,de,le,re,fe],encapsulation:2})}}return i})();export{Ze as AllComponent};
1
+ import{a as ce,b as ue,c as _e}from"./chunk-V5BKQSAT.js";import{a as fe}from"./chunk-GQLSQKDI.js";import{a as de}from"./chunk-46CA5SER.js";import{a as se}from"./chunk-66MLRB2J.js";import"./chunk-M5JQ7BGW.js";import{a as pe}from"./chunk-EPVCMYCI.js";import"./chunk-JDIBETL5.js";import"./chunk-L7K5HOBY.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import"./chunk-H3J5OAIG.js";import"./chunk-AQTXFEBA.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import"./chunk-5OHRA4AS.js";import"./chunk-3BT5DR3X.js";import"./chunk-3RK6DDJD.js";import"./chunk-J2KWRDVH.js";import"./chunk-7SVF5UPT.js";import"./chunk-CMTBBXR5.js";import{a as me}from"./chunk-WPW3D4MQ.js";import"./chunk-USNELOQD.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import{a as ne}from"./chunk-5HO2IJ47.js";import"./chunk-5JVEEL2T.js";import"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-AEOSNAHH.js";import{e as ie}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as oe,n as ae}from"./chunk-CLER2MX6.js";import{A as te,c as Y,h as Z,m as $,o as ee}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{r as re,s as le}from"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{j as J,k as K,m as Q,n as X}from"./chunk-M2FCTYGU.js";import{$c as w,Gb as N,Gc as a,Hc as v,Ic as B,Kc as f,Lc as g,Mb as x,Mc as C,Nc as z,Oc as j,Pc as H,Qc as R,Ra as O,Rc as U,Sc as G,Yb as c,Z as P,ac as W,ad as A,bd as q,dc as b,ec as I,gc as D,hc as k,ic as t,ja as L,jc as n,kc as u,oc as V,pa as y,pb as F,rb as o,tc as M,uc as _,v as T,ya as d,za as s}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var E=(()=>{class i{constructor(){this.httpService=y(ie)}getAllOrders(e){return this.httpService.post(ne.GetAll,e).pipe(T(m=>m.Data))}static{this.\u0275fac=function(m){return new(m||i)}}static{this.\u0275prov=L({token:i,factory:i.\u0275fac})}}return i})();var Ce=()=>[],he=i=>({"td-cell-hover":i});function Se(i,h){if(i&1&&u(0,"variants-dropdown",27),i&2){let e=_().$implicit;c("variants",e==null?null:e.Variants)}}function ve(i,h){if(i&1&&u(0,"variant-with-image",28),i&2){let e=_().$implicit;c("variant",e==null?null:e.Variants[0])}}function we(i,h){if(i&1&&(t(0,"span"),a(1),n()),i&2){let e=_().$implicit;o(),v(e.LogisticService==null?null:e.LogisticService.Option)}}function ye(i,h){if(i&1&&(t(0,"tr")(1,"td")(2,"div",23)(3,"div",24)(4,"div"),u(5,"img",25),w(6,"channelImage"),n(),t(7,"div"),u(8,"order-link",26),n()(),t(9,"small"),a(10),w(11,"date"),n()()(),t(12,"td"),a(13),n(),t(14,"td"),x(15,Se,1,1,"variants-dropdown",27)(16,ve,1,1,"variant-with-image",28),n(),t(17,"td"),a(18),w(19,"number"),n(),t(20,"td")(21,"span"),a(22),n(),x(23,we,2,1,"span"),n()()),i&2){let e=h.$implicit;o(5),c("src",A(6,11,e==null?null:e.MarketType),F)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),o(3),c("order",e),o(2),B(" ",q(11,13,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),o(3),v(e.Customer),o(),W(G(18,he,(e.Variants==null?null:e.Variants.length)>1)),o(),b((e.Variants==null?null:e.Variants.length)>1?15:16),o(3),v(A(19,16,e.Amount)),o(4),v(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),o(),b(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?23:-1)}}function xe(i,h){if(i&1){let e=V();t(0,"div",15)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),a(5,"Number"),n(),t(6,"th",20),a(7,"Customer"),n(),t(8,"th"),a(9,"Items"),n(),t(10,"th",21),a(11,"Amount"),n(),t(12,"th",21),a(13,"Shipping"),n()()(),t(14,"tbody"),D(15,ye,24,20,"tr",null,I),n()(),t(17,"app-custom-paginator",22),M("next",function(){d(e);let r=_();return s(r.initAllOrders())})("previous",function(){d(e);let r=_();return s(r.initAllOrders())}),n()()}if(i&2){let e=_(),m=H(0);o(15),k(m),o(2),c("filter",e.filter())("totaldata",m==null?null:m.length)}}function be(i,h){i&1&&(t(0,"div",16),u(1,"app-empty-state"),n())}var Ze=(()=>{class i{constructor(){this.allService=y(E),this.filter=O({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){this.initAllOrders()}initAllOrders(){this.allOrders$=this.allService.getAllOrders(this.filter()).pipe(P(1))}static{this.\u0275fac=function(m){return new(m||i)}}static{this.\u0275cmp=N({type:i,selectors:[["app-all"]],features:[R([E])],decls:34,vars:12,consts:[["headerTitle","Completed","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],["rowCountApi","/api/orders/allcount",3,"next","previous","filter","totaldata"],[1,"lh-sm"],[1,"d-flex","align-items-end","gap-2"],[2,"width","14px","padding-bottom","2.5px",3,"src","alt"],[3,"order"],[3,"variants"],[3,"variant"]],template:function(m,r){if(m&1){let p=V();z(0),w(1,"async"),t(2,"mainpanel",0),M("onSubmit",function(){return d(p),s(r.initAllOrders())}),C("textChange",function(l){return d(p),g(r.filter().Number,l)||(r.filter().Number=l),s(l)}),t(3,"actions")(4,"a",1),u(5,"i",2),t(6,"span"),a(7,"Order Fulfillment Display"),n()()(),t(8,"filters")(9,"div")(10,"label",3),a(11,"From/To"),n(),t(12,"channel-select-options",4),C("ngModelChange",function(l){return d(p),g(r.filter().ListChannelID,l)||(r.filter().ListChannelID=l),s(l)}),n()(),t(13,"div",5)(14,"label",3),a(15,"From/To"),n(),t(16,"div",6)(17,"datepicker",7),C("dateChange",function(l){return d(p),g(r.filter().From,l)||(r.filter().From=l),s(l)}),n()(),t(18,"div")(19,"datepicker",8),C("dateChange",function(l){return d(p),g(r.filter().To,l)||(r.filter().To=l),s(l)}),n()()(),t(20,"div",5)(21,"label",9),a(22,"Page Number"),n(),t(23,"input",10),C("ngModelChange",function(l){return d(p),g(r.filter().PageNumber,l)||(r.filter().PageNumber=l),s(l)}),n()(),t(24,"div",5)(25,"label",9),a(26,"Page Size"),n(),t(27,"input",11),C("ngModelChange",function(l){return d(p),g(r.filter().PageSize,l)||(r.filter().PageSize=l),s(l)}),n()()(),t(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),x(32,xe,18,2,"div",15)(33,be,2,0,"div",16),n()()()()()}if(m&2){let p=j(A(1,8,r.allOrders$)||U(11,Ce));o(2),f("text",r.filter().Number),o(10),c("multiple",!0),f("ngModel",r.filter().ListChannelID),o(5),f("date",r.filter().From),o(2),f("date",r.filter().To),o(4),f("ngModel",r.filter().PageNumber),o(4),f("ngModel",r.filter().PageSize),o(5),b((p==null?null:p.length)>0?32:33)}},dependencies:[X,J,Q,K,ae,oe,pe,me,te,Y,ee,Z,$,ce,ue,_e,se,de,le,re,fe],encapsulation:2})}}return i})();export{Ze as AllComponent};
@@ -1 +1 @@
1
- import{a as Te,b as be}from"./chunk-UDIDZKN6.js";import{a as Ce,b as fe}from"./chunk-CIIO2CJ6.js";import{b as xe}from"./chunk-H3J5OAIG.js";import{a as he}from"./chunk-SYUFPF3D.js";import{a as ue}from"./chunk-J2KWRDVH.js";import{a as F}from"./chunk-5DIRXS7I.js";import{h as pe}from"./chunk-S5SDX7ZG.js";import{c as ae}from"./chunk-PW42BQIY.js";import{a as le,b as ce,c as _e}from"./chunk-SWQXSJ7O.js";import{d as de,h as ge}from"./chunk-CLER2MX6.js";import{A as re,b as ne,h as ie,m as oe}from"./chunk-6QYD6NIJ.js";import{r as se,s as me}from"./chunk-YCH6HHU3.js";import{d as Y,f as G,g as J,i as Q,m as ee,n as te}from"./chunk-M2FCTYGU.js";import{$c as $,Fc as b,Gb as Z,Gc as m,Hc as O,Ic as y,Ka as R,Kc as k,Lc as D,Mb as s,Mc as N,Oa as j,Ra as B,Sc as T,Tc as K,Yb as p,ad as W,bd as X,ca as A,cd as w,dc as S,ec as E,f as z,gc as M,hc as V,ic as c,jc as _,kc as I,lc as x,mc as h,nc as L,oc as C,pa as H,pb as v,rb as a,tc as f,uc as o,xb as P,xc as q,ya as d,za as g}from"./chunk-B7KTCPKC.js";var U=t=>[t],ve=t=>({"text-decoration-line-through":t}),Se=t=>({"text-danger":t}),Ie=(t,l)=>({"bg-gradient-warning":t,"cell-hover pointer":l});function we(t,l){if(t&1){let e=C();c(0,"mat-slide-toggle",13),f("toggleChange",function(){d(e);let n=o();return n.toggleStatus=!n.toggleStatus,g(n.onToggle())}),c(1,"small",14),m(2),_()()}if(t&2){let e=o();a(2),y(" ",e.productToggleTitle?e.productToggleTitle:"FILTER DIFFERENT INVENTORY"," ")}}function Fe(t,l){if(t&1){let e=C();c(0,"th")(1,"input",16),N("ngModelChange",function(n){d(e);let r=o(2);return D(r.checkboxState,n)||(r.checkboxState=n),g(n)}),f("ngModelChange",function(){d(e);let n=o(2);return g(n.onCheckboxStateChange())}),_()()}if(t&2){let e=o(2);a(),k("ngModel",e.checkboxState)}}function Pe(t,l){if(t&1&&(s(0,Fe,2,1,"ng-template",15),c(1,"th",11),m(2,"POS"),_()),t&2){let e=o();p("ngxPermissionsOnly",T(1,U,e.rolePriceEdit))}}function Ee(t,l){if(t&1&&(x(0),c(1,"th",17)(2,"div",18)(3,"div",19),I(4,"img",20),c(5,"div",21),m(6),$(7,"stringLimit"),_()()()(),h()),t&2){let e=l.$implicit;a(3),p("matTooltip",(e.Name==null?null:e.Name.length)>20?e.Name:""),a(),p("src",e==null?null:e.Img,v),a(2),y(" ",X(7,3,e.Name,20)," ")}}function Me(t,l){t&1&&L(0)}function Ve(t,l){if(t&1&&s(0,Me,1,0,"ng-container",33),t&2){o(2);let e=b(7);p("ngTemplateOutlet",e)}}function Oe(t,l){if(t&1&&(x(0),s(1,Ve,1,1,"ng-template",15),h()),t&2){let e=o(4);a(),p("ngxPermissionsOnly",T(1,U,e.roleInventoryUpdate))}}function ke(t,l){t&1&&L(0)}function De(t,l){if(t&1&&s(0,ke,1,0,"ng-container",33),t&2){o(2);let e=b(7);p("ngTemplateOutlet",e)}}function Ne(t,l){if(t&1&&s(0,De,1,1,"ng-template",15),t&2){let e=o(4);p("ngxPermissionsOnly",T(1,U,e.rolePriceEdit))}}function $e(t,l){if(t&1){let e=C();x(0),c(1,"div")(2,"input",34),N("ngModelChange",function(n){d(e);let r=o(4).$implicit;return D(r.selected,n)||(r.selected=n),g(n)}),f("ngModelChange",function(){d(e);let n=o(4).$implicit,r=o();return g(r.onCheckboxStateProduct(n.ID))}),_()(),h()}if(t&2){let e=o(4).$implicit;a(2),k("ngModel",e.selected),p("disabled",!(e!=null&&e.Category))}}function Ue(t,l){if(t&1&&s(0,$e,3,2,"ng-container",22),t&2){let e=o(3).$implicit;p("ngIf",(e==null||e.Variants==null?null:e.Variants.length)>1)}}function Re(t,l){if(t&1){let e=C();x(0),c(1,"img",35),f("click",function(n){d(e);let r=o(3).$implicit,u=o();return g(u.onZoomImage(n,r==null?null:r.ImageUrl))}),_(),h()}if(t&2){let e=o(3).$implicit;a(),q("src",e==null?null:e.ThumbnailUrl,v)}}function je(t,l){t&1&&I(0,"img",36)}function Be(t,l){if(t&1&&(x(0),c(1,"td",28)(2,"div",29),s(3,Oe,2,3,"ng-container",30)(4,Ne,1,3,"ng-template",null,0,w)(6,Ue,1,1,"ng-template",null,1,w),c(8,"div"),s(9,Re,2,1,"ng-container",30)(10,je,1,0,"ng-template",null,2,w),_()()(),c(12,"td",31)(13,"div"),m(14),_(),c(15,"small",32),m(16),_()(),h()),t&2){let e=b(5),i=b(11),n=o(2).$implicit,r=o();a(),p("rowSpan",n==null?null:n.Variants.length),a(2),p("ngIf",r.table=="inventory")("ngIfElse",e),a(6),p("ngIf",n==null?null:n.ThumbnailUrl)("ngIfElse",i),a(3),p("rowSpan",n==null?null:n.Variants.length),a(2),O(n==null?null:n.Name),a(),p("ngClass",T(9,Se,!(n!=null&&n.Category))),a(),y("(",n!=null&&n.Category?n==null?null:n.Category:"Not Found In POS",")")}}function Le(t,l){if(t&1&&(c(0,"a",27),I(1,"i",37),_()),t&2){let e=o().$implicit,i=o(2);p("href",i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),v)}}function We(t,l){if(t&1){let e=C();c(0,"input",40),N("ngModelChange",function(n){d(e);let r=o(3).$implicit;return D(r.selected,n)||(r.selected=n),g(n)}),_()}if(t&2){let e=o(3).$implicit,i=o().$implicit;k("ngModel",e.selected),p("disabled",!(i!=null&&i.Category))}}function ze(t,l){if(t&1&&(c(0,"td",38),s(1,We,1,2,"input",39),_()),t&2){let e=o(2).$implicit,i=o(2);a(),p("ngIf",i.printPOS(e)>=0||i.table=="price")}}function Ae(t,l){if(t&1&&(s(0,ze,2,1,"ng-template",15),c(1,"td",24),m(2),$(3,"number"),_()),t&2){let e=o().$implicit,i=o(2);p("ngxPermissionsOnly",T(4,U,i.rolePriceEdit)),a(2),O(W(3,2,i.printPOS(e)))}}function He(t,l){if(t&1){let e=C();x(0),c(1,"td",41),f("click",function(){d(e);let n=o().$implicit,r=o().$implicit,u=o().$implicit,ye=o();return g(ye.onUpdateData(u.Name,r,n.ID,u.ChannelItemID))}),c(2,"div",42)(3,"div",43),m(4),$(5,"number"),_(),c(6,"a",44),f("click",function(n){return d(e),g(n==null?null:n.stopPropagation())}),I(7,"i",37),_()()(),h()}if(t&2){let e=l.$implicit,i=o(2).$implicit,n=o(2);a(),p("ngClass",K(5,Ie,n.printPOS(i)!=n.printItem(e)&&n.hiddenIPOSInventory()==!1,n.hasPriceEdit()&&n.table=="price"||n.hasInventoryEdit()&&n.table=="inventory")),a(3),y(" ",W(5,3,n.printItem(e))," "),a(2),p("href",e.Url,v)}}function Ze(t,l){t&1&&(c(0,"td",45)(1,"div",42)(2,"span"),m(3,"X"),_()()())}function qe(t,l){if(t&1&&s(0,He,8,8,"ng-container",30)(1,Ze,4,0,"ng-template",null,3,w),t&2){let e=l.$implicit,i=b(2),n=o().$implicit,r=o(2);p("ngIf",r.getItemFromChannel(n,e))("ngIfElse",i)}}function Ke(t,l){if(t&1&&(c(0,"tr"),s(1,Be,17,11,"ng-container",22),c(2,"td",23),m(3),_(),c(4,"td",24)(5,"div",25)(6,"div",26),m(7),_(),c(8,"div",21),s(9,Le,2,1,"a",27),_()()(),s(10,Ae,4,6),M(11,qe,3,2,null,null,E),_()),t&2){let e=l.$implicit,i=l.$index,n=o().$implicit,r=o();a(),p("ngIf",i==0),a(2),O(e==null?null:e.Model),a(2),p("matTooltip",e.Discontinued?r.discontinuedVariantMsg:""),a(),p("ngClass",T(7,ve,e.Discontinued)),a(),y(" ",e.Code," "),a(2),S(n.Category?9:-1),a(),S(r.hiddenIPOSInventory()==!1?10:-1),a(),V(r.channel)}}function Xe(t,l){if(t&1&&(c(0,"tbody"),M(1,Ke,13,9,"tr",null,E),_()),t&2){let e=l.$implicit;a(),V(e.Variants)}}var yt=(()=>{class t{constructor(e,i,n){this.dialog=e,this.biggerPictureService=i,this.authService=n,this.permissionsService=H(le),this.showProductToggle=!1,this.multiwarehouse=j(!1),this.hiddenIPOSInventory=j(!1),this.toggleStatus=!1,this.checkboxState=!1,this.rolePriceEdit=F.PriceUpdate,this.roleInventoryUpdate=F.InventoryUpdate,this.hasPriceEdit=B(!1),this.hasInventoryEdit=B(!1),this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.onSubmit=new R,this.destroy$=new z,this.toggle=new R,this.hostName=this.authService.getDomain()}ngOnInit(){this.initRoles(),this.table=="inventory"?this.stockHeader="Stock":this.table=="price"&&(this.stockHeader="Price")}initRoles(){this.permissionsService.hasPermission(F.InventoryUpdate).then(e=>this.hasInventoryEdit.set(e)),this.permissionsService.hasPermission(F.PriceUpdate).then(e=>this.hasPriceEdit.set(e))}onCheckboxStateProduct(e){let i=this.data.filter(n=>n.ID==e);i.length>0&&(i=i.map(n=>(n.Variants=n.Variants.map(r=>(r.selected=n.selected,r)),n)))}onCheckboxStateChange(){this.data=this.data.map(e=>(e.Variants=e.Variants.map(i=>(i.selected=this.checkboxState,i)),e))}getItemFromChannel(e,i){return e.Channel.find(r=>ae.IsNotEmpty(i.LocationID)?r.LocationID==i.LocationID:r.ChannelID==i.ID)}printItem(e){if(this.table=="inventory")return e.Inventory;if(this.table=="price")return e.Price}onUpdateData(e,i,n,r){this.hasPriceEdit()&&this.table=="price"&&this.onOpenDialogUpdate(e,i,n,r),this.hasInventoryEdit()&&this.table=="inventory"&&this.onOpenDialogUpdate(e,i,n,r)}onOpenDialogUpdate(e,i,n,r){this.dialog.open(Te,{data:{Name:e,Variant:i,ChannelID:n,Table:this.table,ChannelItemID:r}}).afterClosed().pipe(A(this.destroy$)).subscribe(u=>{u!=null&&this.onSubmit.emit(u)})}printPOS(e){return this.table=="inventory"?e.Inventory?e.Inventory:0:this.table=="price"?e.UnitPrice:null}onToggle(){this.toggle.emit(this.toggleStatus)}onZoomImage(e,i){this.biggerPictureService.openBiggerPicture(e,i)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(i){return new(i||t)(P(de),P(he),P(pe))}}static{this.\u0275cmp=Z({type:t,selectors:[["app-table"]],inputs:{data:"data",table:"table",channel:"channel",showProductToggle:"showProductToggle",productToggleTitle:"productToggleTitle",multiwarehouse:[1,"multiwarehouse"],hiddenIPOSInventory:[1,"hiddenIPOSInventory"]},outputs:{onSubmit:"onSubmit",toggle:"onToggle"},decls:17,vars:3,consts:[["PRICE",""],["checkbox_update",""],["elsePic",""],["elseCol",""],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","w-25"],[1,"w-100"],[2,"width","200px"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[4,"ngFor","ngForOf"],[2,"width","200px",3,"toggleChange"],[1,"fw-bold"],[3,"ngxPermissionsOnly"],["type","checkbox",3,"ngModelChange","ngModel"],["scope","col"],[1,"w-100","d-flex","align-items-center","justify-content-center"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],[4,"ngIf"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-end",3,"matTooltip"],[3,"ngClass"],["target","_blank",3,"href"],[1,"text-center",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-end"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"padding-left","0px",3,"rowSpan"],[1,"mt-1",3,"ngClass"],[4,"ngTemplateOutlet"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel","disabled"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"align-middle"],["type","checkbox",3,"ngModel","disabled","ngModelChange",4,"ngIf"],["type","checkbox",3,"ngModelChange","ngModel","disabled"],[1,"p-0",3,"click","ngClass"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2","mt-1"],["target","_blank",3,"click","href"],[1,"table-white","text-center",2,"color","red"]],template:function(i,n){i&1&&(c(0,"div",4)(1,"table",5)(2,"thead",6)(3,"tr")(4,"th",7)(5,"div",8)(6,"div"),m(7,"Product"),_(),s(8,we,3,1,"mat-slide-toggle",9),_()(),c(9,"th",10),m(10,"Variant"),_(),c(11,"th",11),m(12,"SKU"),_(),s(13,Pe,3,3)(14,Ee,8,6,"ng-container",12),_()(),M(15,Xe,3,0,"tbody",null,E),_()()),i&2&&(a(8),S(n.showProductToggle?8:-1),a(5),S(n.hiddenIPOSInventory()==!1?13:-1),a(),p("ngForOf",n.channel),a(),V(n.data))},dependencies:[te,Y,G,J,Q,ee,re,ne,ie,oe,fe,Ce,ge,ue,xe,_e,ce,me,se,be],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}.text-wrapping[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:88px}.cell-hover[_ngcontent-%COMP%]{width:400px!important}"]})}}return t})();export{yt as a};
1
+ import{a as Te,b as be}from"./chunk-UDIDZKN6.js";import{a as Ce,b as fe}from"./chunk-CIIO2CJ6.js";import{b as xe}from"./chunk-H3J5OAIG.js";import{a as he}from"./chunk-SYUFPF3D.js";import{a as ue}from"./chunk-J2KWRDVH.js";import{a as F}from"./chunk-5DIRXS7I.js";import{h as pe}from"./chunk-USNELOQD.js";import{c as ae}from"./chunk-PW42BQIY.js";import{a as le,b as ce,c as _e}from"./chunk-SWQXSJ7O.js";import{d as de,h as ge}from"./chunk-CLER2MX6.js";import{A as re,b as ne,h as ie,m as oe}from"./chunk-6QYD6NIJ.js";import{r as se,s as me}from"./chunk-YCH6HHU3.js";import{d as Y,f as G,g as J,i as Q,m as ee,n as te}from"./chunk-M2FCTYGU.js";import{$c as $,Fc as b,Gb as Z,Gc as m,Hc as O,Ic as y,Ka as R,Kc as k,Lc as D,Mb as s,Mc as N,Oa as j,Ra as B,Sc as T,Tc as K,Yb as p,ad as W,bd as X,ca as A,cd as w,dc as S,ec as E,f as z,gc as M,hc as V,ic as c,jc as _,kc as I,lc as x,mc as h,nc as L,oc as C,pa as H,pb as v,rb as a,tc as f,uc as o,xb as P,xc as q,ya as d,za as g}from"./chunk-B7KTCPKC.js";var U=t=>[t],ve=t=>({"text-decoration-line-through":t}),Se=t=>({"text-danger":t}),Ie=(t,l)=>({"bg-gradient-warning":t,"cell-hover pointer":l});function we(t,l){if(t&1){let e=C();c(0,"mat-slide-toggle",13),f("toggleChange",function(){d(e);let n=o();return n.toggleStatus=!n.toggleStatus,g(n.onToggle())}),c(1,"small",14),m(2),_()()}if(t&2){let e=o();a(2),y(" ",e.productToggleTitle?e.productToggleTitle:"FILTER DIFFERENT INVENTORY"," ")}}function Fe(t,l){if(t&1){let e=C();c(0,"th")(1,"input",16),N("ngModelChange",function(n){d(e);let r=o(2);return D(r.checkboxState,n)||(r.checkboxState=n),g(n)}),f("ngModelChange",function(){d(e);let n=o(2);return g(n.onCheckboxStateChange())}),_()()}if(t&2){let e=o(2);a(),k("ngModel",e.checkboxState)}}function Pe(t,l){if(t&1&&(s(0,Fe,2,1,"ng-template",15),c(1,"th",11),m(2,"POS"),_()),t&2){let e=o();p("ngxPermissionsOnly",T(1,U,e.rolePriceEdit))}}function Ee(t,l){if(t&1&&(x(0),c(1,"th",17)(2,"div",18)(3,"div",19),I(4,"img",20),c(5,"div",21),m(6),$(7,"stringLimit"),_()()()(),h()),t&2){let e=l.$implicit;a(3),p("matTooltip",(e.Name==null?null:e.Name.length)>20?e.Name:""),a(),p("src",e==null?null:e.Img,v),a(2),y(" ",X(7,3,e.Name,20)," ")}}function Me(t,l){t&1&&L(0)}function Ve(t,l){if(t&1&&s(0,Me,1,0,"ng-container",33),t&2){o(2);let e=b(7);p("ngTemplateOutlet",e)}}function Oe(t,l){if(t&1&&(x(0),s(1,Ve,1,1,"ng-template",15),h()),t&2){let e=o(4);a(),p("ngxPermissionsOnly",T(1,U,e.roleInventoryUpdate))}}function ke(t,l){t&1&&L(0)}function De(t,l){if(t&1&&s(0,ke,1,0,"ng-container",33),t&2){o(2);let e=b(7);p("ngTemplateOutlet",e)}}function Ne(t,l){if(t&1&&s(0,De,1,1,"ng-template",15),t&2){let e=o(4);p("ngxPermissionsOnly",T(1,U,e.rolePriceEdit))}}function $e(t,l){if(t&1){let e=C();x(0),c(1,"div")(2,"input",34),N("ngModelChange",function(n){d(e);let r=o(4).$implicit;return D(r.selected,n)||(r.selected=n),g(n)}),f("ngModelChange",function(){d(e);let n=o(4).$implicit,r=o();return g(r.onCheckboxStateProduct(n.ID))}),_()(),h()}if(t&2){let e=o(4).$implicit;a(2),k("ngModel",e.selected),p("disabled",!(e!=null&&e.Category))}}function Ue(t,l){if(t&1&&s(0,$e,3,2,"ng-container",22),t&2){let e=o(3).$implicit;p("ngIf",(e==null||e.Variants==null?null:e.Variants.length)>1)}}function Re(t,l){if(t&1){let e=C();x(0),c(1,"img",35),f("click",function(n){d(e);let r=o(3).$implicit,u=o();return g(u.onZoomImage(n,r==null?null:r.ImageUrl))}),_(),h()}if(t&2){let e=o(3).$implicit;a(),q("src",e==null?null:e.ThumbnailUrl,v)}}function je(t,l){t&1&&I(0,"img",36)}function Be(t,l){if(t&1&&(x(0),c(1,"td",28)(2,"div",29),s(3,Oe,2,3,"ng-container",30)(4,Ne,1,3,"ng-template",null,0,w)(6,Ue,1,1,"ng-template",null,1,w),c(8,"div"),s(9,Re,2,1,"ng-container",30)(10,je,1,0,"ng-template",null,2,w),_()()(),c(12,"td",31)(13,"div"),m(14),_(),c(15,"small",32),m(16),_()(),h()),t&2){let e=b(5),i=b(11),n=o(2).$implicit,r=o();a(),p("rowSpan",n==null?null:n.Variants.length),a(2),p("ngIf",r.table=="inventory")("ngIfElse",e),a(6),p("ngIf",n==null?null:n.ThumbnailUrl)("ngIfElse",i),a(3),p("rowSpan",n==null?null:n.Variants.length),a(2),O(n==null?null:n.Name),a(),p("ngClass",T(9,Se,!(n!=null&&n.Category))),a(),y("(",n!=null&&n.Category?n==null?null:n.Category:"Not Found In POS",")")}}function Le(t,l){if(t&1&&(c(0,"a",27),I(1,"i",37),_()),t&2){let e=o().$implicit,i=o(2);p("href",i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),v)}}function We(t,l){if(t&1){let e=C();c(0,"input",40),N("ngModelChange",function(n){d(e);let r=o(3).$implicit;return D(r.selected,n)||(r.selected=n),g(n)}),_()}if(t&2){let e=o(3).$implicit,i=o().$implicit;k("ngModel",e.selected),p("disabled",!(i!=null&&i.Category))}}function ze(t,l){if(t&1&&(c(0,"td",38),s(1,We,1,2,"input",39),_()),t&2){let e=o(2).$implicit,i=o(2);a(),p("ngIf",i.printPOS(e)>=0||i.table=="price")}}function Ae(t,l){if(t&1&&(s(0,ze,2,1,"ng-template",15),c(1,"td",24),m(2),$(3,"number"),_()),t&2){let e=o().$implicit,i=o(2);p("ngxPermissionsOnly",T(4,U,i.rolePriceEdit)),a(2),O(W(3,2,i.printPOS(e)))}}function He(t,l){if(t&1){let e=C();x(0),c(1,"td",41),f("click",function(){d(e);let n=o().$implicit,r=o().$implicit,u=o().$implicit,ye=o();return g(ye.onUpdateData(u.Name,r,n.ID,u.ChannelItemID))}),c(2,"div",42)(3,"div",43),m(4),$(5,"number"),_(),c(6,"a",44),f("click",function(n){return d(e),g(n==null?null:n.stopPropagation())}),I(7,"i",37),_()()(),h()}if(t&2){let e=l.$implicit,i=o(2).$implicit,n=o(2);a(),p("ngClass",K(5,Ie,n.printPOS(i)!=n.printItem(e)&&n.hiddenIPOSInventory()==!1,n.hasPriceEdit()&&n.table=="price"||n.hasInventoryEdit()&&n.table=="inventory")),a(3),y(" ",W(5,3,n.printItem(e))," "),a(2),p("href",e.Url,v)}}function Ze(t,l){t&1&&(c(0,"td",45)(1,"div",42)(2,"span"),m(3,"X"),_()()())}function qe(t,l){if(t&1&&s(0,He,8,8,"ng-container",30)(1,Ze,4,0,"ng-template",null,3,w),t&2){let e=l.$implicit,i=b(2),n=o().$implicit,r=o(2);p("ngIf",r.getItemFromChannel(n,e))("ngIfElse",i)}}function Ke(t,l){if(t&1&&(c(0,"tr"),s(1,Be,17,11,"ng-container",22),c(2,"td",23),m(3),_(),c(4,"td",24)(5,"div",25)(6,"div",26),m(7),_(),c(8,"div",21),s(9,Le,2,1,"a",27),_()()(),s(10,Ae,4,6),M(11,qe,3,2,null,null,E),_()),t&2){let e=l.$implicit,i=l.$index,n=o().$implicit,r=o();a(),p("ngIf",i==0),a(2),O(e==null?null:e.Model),a(2),p("matTooltip",e.Discontinued?r.discontinuedVariantMsg:""),a(),p("ngClass",T(7,ve,e.Discontinued)),a(),y(" ",e.Code," "),a(2),S(n.Category?9:-1),a(),S(r.hiddenIPOSInventory()==!1?10:-1),a(),V(r.channel)}}function Xe(t,l){if(t&1&&(c(0,"tbody"),M(1,Ke,13,9,"tr",null,E),_()),t&2){let e=l.$implicit;a(),V(e.Variants)}}var yt=(()=>{class t{constructor(e,i,n){this.dialog=e,this.biggerPictureService=i,this.authService=n,this.permissionsService=H(le),this.showProductToggle=!1,this.multiwarehouse=j(!1),this.hiddenIPOSInventory=j(!1),this.toggleStatus=!1,this.checkboxState=!1,this.rolePriceEdit=F.PriceUpdate,this.roleInventoryUpdate=F.InventoryUpdate,this.hasPriceEdit=B(!1),this.hasInventoryEdit=B(!1),this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.onSubmit=new R,this.destroy$=new z,this.toggle=new R,this.hostName=this.authService.getDomain()}ngOnInit(){this.initRoles(),this.table=="inventory"?this.stockHeader="Stock":this.table=="price"&&(this.stockHeader="Price")}initRoles(){this.permissionsService.hasPermission(F.InventoryUpdate).then(e=>this.hasInventoryEdit.set(e)),this.permissionsService.hasPermission(F.PriceUpdate).then(e=>this.hasPriceEdit.set(e))}onCheckboxStateProduct(e){let i=this.data.filter(n=>n.ID==e);i.length>0&&(i=i.map(n=>(n.Variants=n.Variants.map(r=>(r.selected=n.selected,r)),n)))}onCheckboxStateChange(){this.data=this.data.map(e=>(e.Variants=e.Variants.map(i=>(i.selected=this.checkboxState,i)),e))}getItemFromChannel(e,i){return e.Channel.find(r=>ae.IsNotEmpty(i.LocationID)?r.LocationID==i.LocationID:r.ChannelID==i.ID)}printItem(e){if(this.table=="inventory")return e.Inventory;if(this.table=="price")return e.Price}onUpdateData(e,i,n,r){this.hasPriceEdit()&&this.table=="price"&&this.onOpenDialogUpdate(e,i,n,r),this.hasInventoryEdit()&&this.table=="inventory"&&this.onOpenDialogUpdate(e,i,n,r)}onOpenDialogUpdate(e,i,n,r){this.dialog.open(Te,{data:{Name:e,Variant:i,ChannelID:n,Table:this.table,ChannelItemID:r}}).afterClosed().pipe(A(this.destroy$)).subscribe(u=>{u!=null&&this.onSubmit.emit(u)})}printPOS(e){return this.table=="inventory"?e.Inventory?e.Inventory:0:this.table=="price"?e.UnitPrice:null}onToggle(){this.toggle.emit(this.toggleStatus)}onZoomImage(e,i){this.biggerPictureService.openBiggerPicture(e,i)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(i){return new(i||t)(P(de),P(he),P(pe))}}static{this.\u0275cmp=Z({type:t,selectors:[["app-table"]],inputs:{data:"data",table:"table",channel:"channel",showProductToggle:"showProductToggle",productToggleTitle:"productToggleTitle",multiwarehouse:[1,"multiwarehouse"],hiddenIPOSInventory:[1,"hiddenIPOSInventory"]},outputs:{onSubmit:"onSubmit",toggle:"onToggle"},decls:17,vars:3,consts:[["PRICE",""],["checkbox_update",""],["elsePic",""],["elseCol",""],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","w-25"],[1,"w-100"],[2,"width","200px"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[4,"ngFor","ngForOf"],[2,"width","200px",3,"toggleChange"],[1,"fw-bold"],[3,"ngxPermissionsOnly"],["type","checkbox",3,"ngModelChange","ngModel"],["scope","col"],[1,"w-100","d-flex","align-items-center","justify-content-center"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],[4,"ngIf"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-end",3,"matTooltip"],[3,"ngClass"],["target","_blank",3,"href"],[1,"text-center",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-end"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"padding-left","0px",3,"rowSpan"],[1,"mt-1",3,"ngClass"],[4,"ngTemplateOutlet"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel","disabled"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"align-middle"],["type","checkbox",3,"ngModel","disabled","ngModelChange",4,"ngIf"],["type","checkbox",3,"ngModelChange","ngModel","disabled"],[1,"p-0",3,"click","ngClass"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2","mt-1"],["target","_blank",3,"click","href"],[1,"table-white","text-center",2,"color","red"]],template:function(i,n){i&1&&(c(0,"div",4)(1,"table",5)(2,"thead",6)(3,"tr")(4,"th",7)(5,"div",8)(6,"div"),m(7,"Product"),_(),s(8,we,3,1,"mat-slide-toggle",9),_()(),c(9,"th",10),m(10,"Variant"),_(),c(11,"th",11),m(12,"SKU"),_(),s(13,Pe,3,3)(14,Ee,8,6,"ng-container",12),_()(),M(15,Xe,3,0,"tbody",null,E),_()()),i&2&&(a(8),S(n.showProductToggle?8:-1),a(5),S(n.hiddenIPOSInventory()==!1?13:-1),a(),p("ngForOf",n.channel),a(),V(n.data))},dependencies:[te,Y,G,J,Q,ee,re,ne,ie,oe,fe,Ce,ge,ue,xe,_e,ce,me,se,be],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}.text-wrapping[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:88px}.cell-hover[_ngcontent-%COMP%]{width:400px!important}"]})}}return t})();export{yt as a};
@@ -1 +1 @@
1
- import{c as ht}from"./chunk-MHCAI6KP.js";import"./chunk-3LRWABHB.js";import"./chunk-G47XGOST.js";import{b as ut}from"./chunk-CIIO2CJ6.js";import"./chunk-5OHRA4AS.js";import"./chunk-3BT5DR3X.js";import{a as Z}from"./chunk-5DIRXS7I.js";import"./chunk-CMTBBXR5.js";import{h as rt}from"./chunk-S5SDX7ZG.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-V3NCYRCF.js";import{a as st,b as at,d as lt,e as ct}from"./chunk-5JVEEL2T.js";import{b as h,c as tt}from"./chunk-PW42BQIY.js";import{b as nt,c as ot}from"./chunk-SWQXSJ7O.js";import"./chunk-AEOSNAHH.js";import{b as et,e as it}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as dt,n as gt}from"./chunk-CLER2MX6.js";import{A as Y,h as Q,m as X}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{r as mt,s as pt}from"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{J as y,f as J,g as G,j as q,n as L}from"./chunk-M2FCTYGU.js";import{$c as C,Fc as P,Gb as V,Gc as a,Hb as S,Hc as u,Ic as W,Kc as w,Lc as D,Mb as g,Mc as R,Nc as $,Oc as A,Pc as H,Sc as z,Yb as l,Z as M,aa as F,ad as x,cd as U,ea as k,ic as o,jc as r,ka as f,kc as j,lc as T,mc as N,oc as O,pb as K,q as B,rb as s,tc as I,uc as c,v,xb as _,ya as b,za as E}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var Ct=e=>[e];function xt(e,m){if(e&1&&(o(0,"span",15),j(1,"img",16),r(),o(2,"span"),a(3),r()),e&2){let t=m.item;s(),l("src",t.Img,K)("alt",t.Name),s(2),W(" ",t.Name," ")}}function Lt(e,m){if(e&1){let t=O();T(0),$(1),C(2,"async"),o(3,"a",17),I("click",function(){b(t);let n=H(1),p=c();return E(p.submitLogistics(n))}),a(4,"Submit"),r(),N()}if(e&2){let t=c();s(),A(x(2,0,t.logisticServices$))}}function yt(e,m){}function vt(e,m){if(e&1){let t=O();o(0,"ng-select",20),R("ngModelChange",function(n){b(t);let p=c(2).$implicit;return D(p.ProductSKU,n)||(p.ProductSKU=n),E(n)}),r()}if(e&2){let t=c().ngIf,i=c().$implicit;w("ngModel",i.ProductSKU),l("items",t)}}function Mt(e,m){if(e&1&&(o(0,"span"),a(1),r()),e&2){let t=c(2).$implicit;s(),u(t.ProductSKU||"-")}}function bt(e,m){if(e&1&&(T(0),g(1,yt,0,0,"ng-template",19)(2,vt,1,2,"ng-template",null,0,U)(4,Mt,2,1,"ng-template",null,1,U),N()),e&2){let t=P(3),i=P(5),n=c(2);s(),l("ngxPermissionsOnly",z(3,Ct,n.logisticEditRole))("ngxPermissionsOnlyThen",t)("ngxPermissionsOnlyElse",i)}}function Et(e,m){if(e&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td"),a(4),r(),o(5,"td"),a(6),r(),o(7,"td"),g(8,bt,6,5,"ng-container",18),C(9,"async"),r()()),e&2){let t=m.$implicit,i=c();s(2),u(t.Name),s(2),u(t.Service),s(2),u(t.TypeString),s(2),l("ngIf",x(9,4,i.logisticOptions$))}}var _t=(()=>{class e{constructor(t,i,n){this.http=t,this.toastr=i,this.authService=n,this.filter={ChannelID:""},this.logisticEditRole=Z.LogisticUpdate,this.channelOptions=this.authService.getChannels(),this.initUnsupportedChannel(),this.initLoader()}initUnsupportedChannel(){let t=[h.WooCommerce,h.Lazada,h.Shopify,h.Plugo,h.Tokopedia];this.channelOptions=this.channelOptions.map(i=>(t.forEach(n=>{i.TypeID===n&&(i.disabled=!0)}),i))}initLoader(){this.http.post("/api/Logistic/Load",{}).subscribe(t=>{this.filter=t.Filter,this.channelName=this.channelOptions[0].Name,this.initLogisticServiceOptions(),this.getLogisticService()})}initLogisticServiceOptions(){this.logisticOptions$=this.http.get("/api/Logistic/OptionLogisticsService").pipe(M(1))}submitLogistics(t){this.clonedLogisticServices$.pipe(v(i=>t.map(n=>(i.findIndex(d=>d.Name===n.Name&&d.ProductSKU==n.ProductSKU)==-1&&(n.IsChange=!0),n))),F(i=>this.http.post("/api/Logistic/Submit",i))).subscribe(()=>{this.toastr.success("Logistic service updated successfully.","Success"),this.getLogisticService()})}getLogisticService(){this.iniTitle(),this.logisticServices$=this.http.post("/api/Logistic/Get",this.filter).pipe(v(t=>t.map(i=>(i.ProductSKU=tt.IsEmpty(i.ProductSKU)?null:i.ProductSKU,i))),k(t=>{let i=JSON.parse(JSON.stringify(t));this.clonedLogisticServices$=B(i)}),M(1))}iniTitle(){let t=this.channelOptions.find(i=>i.ID==this.filter.ChannelID);this.channelName=t?t.Name:null}static{this.\u0275fac=function(i){return new(i||e)(_(it),_(et),_(rt))}}static{this.\u0275cmp=V({type:e,selectors:[["app-logistic"]],standalone:!1,decls:28,vars:9,consts:[["thenBlock",""],["elseBlock",""],["hideSearchBox","true","searchBoxPlaceHolder","Enter Number...",3,"onSubmit","headerTitle","hideSearchDropdown"],[1,"mb-2","fw-bold"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[4,"ngxPermissionsOnly"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[1,"me-2"],[2,"width","18px",3,"src","alt"],["role","button","data-toggle","tooltip","data-placement","top","matTooltip","enter Logistic for recorded",1,"btn","btn-success","btn-fill","btn-lg","text-white",3,"click"],[4,"ngIf"],[3,"ngxPermissionsOnly","ngxPermissionsOnlyThen","ngxPermissionsOnlyElse"],["placeholder","Logistic Service Code","bindLabel","Name","bindValue","Code",1,"w-75",3,"ngModelChange","ngModel","items"]],template:function(i,n){i&1&&(o(0,"mainpanel",2),I("onSubmit",function(){return n.getLogisticService()}),o(1,"filters")(2,"div")(3,"label",3),a(4,"Select a Channel"),r(),o(5,"ng-select",4),R("ngModelChange",function(d){return D(n.filter.ChannelID,d)||(n.filter.ChannelID=d),d}),g(6,xt,4,3,"ng-template",5),r()()(),o(7,"actions"),g(8,Lt,5,3,"ng-container",6),r(),o(9,"content")(10,"div",7)(11,"div",8)(12,"div",9)(13,"div",10)(14,"table",11)(15,"thead",12)(16,"tr",13)(17,"th"),a(18,"Logistic"),r(),o(19,"th"),a(20,"Service"),r(),o(21,"th"),a(22,"Type"),r(),o(23,"th"),a(24,"Logistic Service"),r()()(),o(25,"tbody"),g(26,Et,10,6,"tr",14),C(27,"async"),r()()()()()()()()),i&2&&(l("headerTitle","Logistic Courier - "+n.channelName)("hideSearchDropdown",!1),s(5),l("clearable",!1)("items",n.channelOptions),w("ngModel",n.filter.ChannelID),s(3),l("ngxPermissionsOnly",n.logisticEditRole),s(18),l("ngForOf",x(27,7,n.logisticServices$)))},dependencies:[J,G,Q,X,dt,lt,st,at,mt,nt,q],encapsulation:2})}}return e})();var Tt=[{path:"",component:_t}],St=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=S({type:e})}static{this.\u0275inj=f({imports:[L,y.forChild(Tt)]})}}return e})();var oe=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=S({type:e})}static{this.\u0275inj=f({imports:[L,y,St,Y,gt,ct,ut,ht,pt,ot]})}}return e})();export{oe as LogisticModule};
1
+ import{c as ht}from"./chunk-MHCAI6KP.js";import"./chunk-3LRWABHB.js";import"./chunk-G47XGOST.js";import{b as ut}from"./chunk-CIIO2CJ6.js";import"./chunk-5OHRA4AS.js";import"./chunk-3BT5DR3X.js";import{a as Z}from"./chunk-5DIRXS7I.js";import"./chunk-CMTBBXR5.js";import{h as rt}from"./chunk-USNELOQD.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import{a as st,b as at,d as lt,e as ct}from"./chunk-5JVEEL2T.js";import{b as h,c as tt}from"./chunk-PW42BQIY.js";import{b as nt,c as ot}from"./chunk-SWQXSJ7O.js";import"./chunk-AEOSNAHH.js";import{b as et,e as it}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as dt,n as gt}from"./chunk-CLER2MX6.js";import{A as Y,h as Q,m as X}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{r as mt,s as pt}from"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{J as y,f as J,g as G,j as q,n as L}from"./chunk-M2FCTYGU.js";import{$c as C,Fc as P,Gb as V,Gc as a,Hb as S,Hc as u,Ic as W,Kc as w,Lc as D,Mb as g,Mc as R,Nc as $,Oc as A,Pc as H,Sc as z,Yb as l,Z as M,aa as F,ad as x,cd as U,ea as k,ic as o,jc as r,ka as f,kc as j,lc as T,mc as N,oc as O,pb as K,q as B,rb as s,tc as I,uc as c,v,xb as _,ya as b,za as E}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var Ct=e=>[e];function xt(e,m){if(e&1&&(o(0,"span",15),j(1,"img",16),r(),o(2,"span"),a(3),r()),e&2){let t=m.item;s(),l("src",t.Img,K)("alt",t.Name),s(2),W(" ",t.Name," ")}}function Lt(e,m){if(e&1){let t=O();T(0),$(1),C(2,"async"),o(3,"a",17),I("click",function(){b(t);let n=H(1),p=c();return E(p.submitLogistics(n))}),a(4,"Submit"),r(),N()}if(e&2){let t=c();s(),A(x(2,0,t.logisticServices$))}}function yt(e,m){}function vt(e,m){if(e&1){let t=O();o(0,"ng-select",20),R("ngModelChange",function(n){b(t);let p=c(2).$implicit;return D(p.ProductSKU,n)||(p.ProductSKU=n),E(n)}),r()}if(e&2){let t=c().ngIf,i=c().$implicit;w("ngModel",i.ProductSKU),l("items",t)}}function Mt(e,m){if(e&1&&(o(0,"span"),a(1),r()),e&2){let t=c(2).$implicit;s(),u(t.ProductSKU||"-")}}function bt(e,m){if(e&1&&(T(0),g(1,yt,0,0,"ng-template",19)(2,vt,1,2,"ng-template",null,0,U)(4,Mt,2,1,"ng-template",null,1,U),N()),e&2){let t=P(3),i=P(5),n=c(2);s(),l("ngxPermissionsOnly",z(3,Ct,n.logisticEditRole))("ngxPermissionsOnlyThen",t)("ngxPermissionsOnlyElse",i)}}function Et(e,m){if(e&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td"),a(4),r(),o(5,"td"),a(6),r(),o(7,"td"),g(8,bt,6,5,"ng-container",18),C(9,"async"),r()()),e&2){let t=m.$implicit,i=c();s(2),u(t.Name),s(2),u(t.Service),s(2),u(t.TypeString),s(2),l("ngIf",x(9,4,i.logisticOptions$))}}var _t=(()=>{class e{constructor(t,i,n){this.http=t,this.toastr=i,this.authService=n,this.filter={ChannelID:""},this.logisticEditRole=Z.LogisticUpdate,this.channelOptions=this.authService.getChannels(),this.initUnsupportedChannel(),this.initLoader()}initUnsupportedChannel(){let t=[h.WooCommerce,h.Lazada,h.Shopify,h.Plugo,h.Tokopedia];this.channelOptions=this.channelOptions.map(i=>(t.forEach(n=>{i.TypeID===n&&(i.disabled=!0)}),i))}initLoader(){this.http.post("/api/Logistic/Load",{}).subscribe(t=>{this.filter=t.Filter,this.channelName=this.channelOptions[0].Name,this.initLogisticServiceOptions(),this.getLogisticService()})}initLogisticServiceOptions(){this.logisticOptions$=this.http.get("/api/Logistic/OptionLogisticsService").pipe(M(1))}submitLogistics(t){this.clonedLogisticServices$.pipe(v(i=>t.map(n=>(i.findIndex(d=>d.Name===n.Name&&d.ProductSKU==n.ProductSKU)==-1&&(n.IsChange=!0),n))),F(i=>this.http.post("/api/Logistic/Submit",i))).subscribe(()=>{this.toastr.success("Logistic service updated successfully.","Success"),this.getLogisticService()})}getLogisticService(){this.iniTitle(),this.logisticServices$=this.http.post("/api/Logistic/Get",this.filter).pipe(v(t=>t.map(i=>(i.ProductSKU=tt.IsEmpty(i.ProductSKU)?null:i.ProductSKU,i))),k(t=>{let i=JSON.parse(JSON.stringify(t));this.clonedLogisticServices$=B(i)}),M(1))}iniTitle(){let t=this.channelOptions.find(i=>i.ID==this.filter.ChannelID);this.channelName=t?t.Name:null}static{this.\u0275fac=function(i){return new(i||e)(_(it),_(et),_(rt))}}static{this.\u0275cmp=V({type:e,selectors:[["app-logistic"]],standalone:!1,decls:28,vars:9,consts:[["thenBlock",""],["elseBlock",""],["hideSearchBox","true","searchBoxPlaceHolder","Enter Number...",3,"onSubmit","headerTitle","hideSearchDropdown"],[1,"mb-2","fw-bold"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[4,"ngxPermissionsOnly"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[1,"me-2"],[2,"width","18px",3,"src","alt"],["role","button","data-toggle","tooltip","data-placement","top","matTooltip","enter Logistic for recorded",1,"btn","btn-success","btn-fill","btn-lg","text-white",3,"click"],[4,"ngIf"],[3,"ngxPermissionsOnly","ngxPermissionsOnlyThen","ngxPermissionsOnlyElse"],["placeholder","Logistic Service Code","bindLabel","Name","bindValue","Code",1,"w-75",3,"ngModelChange","ngModel","items"]],template:function(i,n){i&1&&(o(0,"mainpanel",2),I("onSubmit",function(){return n.getLogisticService()}),o(1,"filters")(2,"div")(3,"label",3),a(4,"Select a Channel"),r(),o(5,"ng-select",4),R("ngModelChange",function(d){return D(n.filter.ChannelID,d)||(n.filter.ChannelID=d),d}),g(6,xt,4,3,"ng-template",5),r()()(),o(7,"actions"),g(8,Lt,5,3,"ng-container",6),r(),o(9,"content")(10,"div",7)(11,"div",8)(12,"div",9)(13,"div",10)(14,"table",11)(15,"thead",12)(16,"tr",13)(17,"th"),a(18,"Logistic"),r(),o(19,"th"),a(20,"Service"),r(),o(21,"th"),a(22,"Type"),r(),o(23,"th"),a(24,"Logistic Service"),r()()(),o(25,"tbody"),g(26,Et,10,6,"tr",14),C(27,"async"),r()()()()()()()()),i&2&&(l("headerTitle","Logistic Courier - "+n.channelName)("hideSearchDropdown",!1),s(5),l("clearable",!1)("items",n.channelOptions),w("ngModel",n.filter.ChannelID),s(3),l("ngxPermissionsOnly",n.logisticEditRole),s(18),l("ngForOf",x(27,7,n.logisticServices$)))},dependencies:[J,G,Q,X,dt,lt,st,at,mt,nt,q],encapsulation:2})}}return e})();var Tt=[{path:"",component:_t}],St=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=S({type:e})}static{this.\u0275inj=f({imports:[L,y.forChild(Tt)]})}}return e})();var oe=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=S({type:e})}static{this.\u0275inj=f({imports:[L,y,St,Y,gt,ct,ut,ht,pt,ot]})}}return e})();export{oe as LogisticModule};
@@ -0,0 +1 @@
1
+ import{a as he}from"./chunk-WZD7N5DN.js";import{a as pe}from"./chunk-3NMM37H7.js";import"./chunk-BFU7VKO3.js";import{a as de}from"./chunk-SRVGUGY2.js";import{a as D}from"./chunk-XHAXYWZ7.js";import{c as me,d as R}from"./chunk-UDIDZKN6.js";import"./chunk-M5XGP4SG.js";import"./chunk-CIIO2CJ6.js";import"./chunk-H3J5OAIG.js";import"./chunk-AQTXFEBA.js";import"./chunk-OC2FBL33.js";import"./chunk-NS46QSCM.js";import{a as ce}from"./chunk-JMPW6NPQ.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import"./chunk-SYUFPF3D.js";import"./chunk-5OHRA4AS.js";import"./chunk-3BT5DR3X.js";import"./chunk-EH6HWI3G.js";import"./chunk-E3ROEHBW.js";import"./chunk-OLOIQI4D.js";import"./chunk-IA6KOBDJ.js";import"./chunk-RECNBAEB.js";import"./chunk-SN4AOGQK.js";import"./chunk-SB7NWPDS.js";import"./chunk-AYPY47VM.js";import"./chunk-SM3P57SO.js";import"./chunk-5KS4WK6H.js";import"./chunk-3RK6DDJD.js";import"./chunk-J2KWRDVH.js";import"./chunk-7SVF5UPT.js";import{a as ee}from"./chunk-5DIRXS7I.js";import"./chunk-OZ7LWNOK.js";import"./chunk-ECRWEMEV.js";import"./chunk-LZCEM2PC.js";import"./chunk-CMTBBXR5.js";import{h as w}from"./chunk-USNELOQD.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import{c as C}from"./chunk-PW42BQIY.js";import{b as ie,c as ae}from"./chunk-SWQXSJ7O.js";import"./chunk-DRMAONR7.js";import"./chunk-AEOSNAHH.js";import{b as te,e as ne}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{d as oe,l as re,m as le,n as se}from"./chunk-CLER2MX6.js";import{A as Z,c as K,h as q,m as X,o as Y}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{g as $,j as Q,n as J}from"./chunk-M2FCTYGU.js";import{$c as I,G as U,Gb as A,Gc as v,Kc as T,Lc as E,Mb as u,Mc as x,Qc as H,Ra as M,Sc as z,Yb as h,ad as y,ea as k,ic as s,ja as j,jc as p,kc as G,lc as N,mc as F,nc as W,oc as L,pa as S,rb as c,tc as g,uc as m,xb as d,ya as b,za as P}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import{a as V,b as B}from"./chunk-66YHNWRR.js";var O=(()=>{class o{constructor(){this.authService=S(w),this.channelOptions=this.authService.getChannels()}filterSelectedChannels(t,i){let e=Object.assign([],this.channelOptions),n=[],a;return t.forEach(r=>{a=e.find(l=>l.ID==r?.parent?.id),a&&(a=B(V({},a),{Name:`${r?.parent?.label} - ${r?.label}`,LocationID:r?.id}),n.push(a))}),i.forEach(r=>{a=e.find(l=>l.ID==r.id),a&&n.push(a)}),n}generateFilterLocation(t,i){let e=[],n=[],a=[];return t.length>0?(e=t.map(r=>r.id),n=t.filter(r=>C.IsNotEmpty(r?.parent?.id)).map(r=>r?.parent?.id).filter((r,l,_)=>_.indexOf(r)===l)):(e=[],n=[]),a=i.map(r=>r.id),a=a.concat(n).filter((r,l,_)=>_.indexOf(r)===l),{locationIds:e,channelIds:a}}static{this.\u0275fac=function(i){return new(i||o)}}static{this.\u0275prov=j({token:o,factory:o.\u0275fac})}}return o})();var ge=o=>[o];function Ce(o,f){if(o&1){let t=L();s(0,"button",16),g("click",function(){b(t);let e=m(2).ngIf,n=m();return P(n.onUpdateItems(e))}),G(1,"i",17),v(2," Update "),p()}}function fe(o,f){if(o&1&&(N(0),u(1,Ce,3,0,"button",15),F()),o&2){let t=m().ngIf,i=m();c(),h("ngIf",i.productService.hasSelectionVariant(t))}}function _e(o,f){if(o&1&&(s(0,"actions")(1,"div",13),u(2,fe,2,1,"ng-container",14),p()()),o&2){let t=m();c(2),h("ngxPermissionsOnly",z(1,ge,t.inventoryUpdateRole))}}function Se(o,f){o&1&&W(0)}function ve(o,f){if(o&1){let t=L();N(0),s(1,"app-table",18),g("onToggle",function(e){b(t);let n=m();return P(n.onShowDifferenceStock(e))})("onSubmit",function(e){b(t);let n=m();return P(n.updateStockByVariant(e))}),p(),F()}if(o&2){let t=f.ngIf,i=m();c(),h("data",t)("channel",i.channels())("showProductToggle",!0)("hiddenIPOSInventory",i.searchFilter.HiddenIPOSInventory)}}var et=(()=>{class o{constructor(t,i,e,n,a,r){this.http=t,this.toastr=i,this.dialog=e,this.productService=n,this.authService=a,this.mainPanelService=r,this.paginationService=S(R),this.multiChannelService=S(O),this.searchFilter={PageNumber:1,RowCount:100},this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.selectedLocations=M([]),this.selectedChannels=M([]),this.channels=M([]),this.inventoryUpdateRole=ee.InventoryUpdate,this.pageData={Title:"Inventory",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory/pos",Active:!0},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.paginationService.fethRowCountEndpoint=this.allDataCountEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(k(t=>{t.Filter={PageNumber:t.Filter.PageNumber,filterModel:D.ALL,RowCount:t.Filter.PageSize,HiddenIPOSInventory:t.Filter.HiddenIPOSInventory},this.searchFilter=t.Filter,this.mainPanelService.openModalFilter()}))}onChannelChange(t=[]){let i=t.filter(n=>C.isValidGUID(n.id)==!1),e=t.filter(n=>C.isValidGUID(n.id));this.selectedLocations.set(i),this.selectedChannels.set(e)}onSearch(t){let i=this.multiChannelService.filterSelectedChannels(this.selectedLocations(),this.selectedChannels());this.channels.set(i);let e=this.multiChannelService.generateFilterLocation(this.selectedLocations(),this.selectedChannels());this.searchFilter.ListChannelID=e.channelIds,this.searchFilter.ListLocationID=e.locationIds,this.searchFilter.text=t,this.paginationService.reloadPagination(this.searchFilter)}updateStock(t,i){let e=this.productService.selectedVariantProduct(t);if(e.length>0){let n=[];e.forEach(l=>{l.Channel?.forEach(_=>{n.push({ID:l.ID,Code:l.Code,Inventory:l.Inventory,LocationID:_.LocationID})})});let r={ListChannelID:i.filter(l=>l.selected).map(l=>l.ID),List:n};this.http.post("/api/Inventory/UpdateChannel",r).subscribe(l=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+r.List.length+" variants in "+r.ListChannelID.length+" channels","Success")})}}updateStockByVariant(t){let i={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku,LocationID:t.LocationID};this.http.post("/api/Inventory/UpdateQuantityByItem",i).subscribe(e=>{this.paginationService.reloadPagination(this.searchFilter);let n=this.productService.findChannelById(i.ID,this.channelOptions);this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+n.Name+" to "+i.NewQuantity,"Success")})}onShowDifferenceStock(t){t?this.searchFilter.filterModel=D.DIFFERENCE:this.searchFilter.filterModel=D.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(t){let i=this.productService.selectedVariantProduct(t),e=this.channelOptions.filter(n=>this.channels()?.find(a=>a.ID===n.ID));this.dialog.open(pe,{data:{selectedItems:i,channels:JSON.parse(JSON.stringify(e))},width:"400px"}).afterClosed().pipe(U(n=>C.IsNotEmpty(n))).subscribe(n=>{this.updateStock(t,n)})}static{this.\u0275fac=function(i){return new(i||o)(d(ne),d(te),d(oe),d(ce),d(w),d(re))}}static{this.\u0275cmp=A({type:o,selectors:[["app-multi-channel-comparison"]],features:[H([R,O])],decls:26,vars:22,consts:[["headerTitle","Inventory Comparison","textButton","Search",3,"onSubmit","pageData","hideSearchBox"],[4,"ngIf"],["for","selectChannel",1,"fw-bold","mb-3"],["id","selectChannel",3,"onChannelChange","multiple"],[1,"mt-5"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"d-flex"],[4,"ngxPermissionsOnly"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"onToggle","onSubmit","data","channel","showProductToggle","hiddenIPOSInventory"]],template:function(i,e){i&1&&(s(0,"mainpanel",0),g("onSubmit",function(a){return e.onSearch(a)}),u(1,_e,3,3,"actions",1),I(2,"async"),s(3,"filters"),u(4,Se,1,0,"ng-container",1),I(5,"async"),s(6,"div")(7,"label",2),v(8,"Channel"),p(),s(9,"multiwarehouse-tree-select",3),g("onChannelChange",function(a){return e.onChannelChange(a)}),p()(),s(10,"div",4)(11,"label",5),v(12,"PageNumber"),p(),s(13,"input",6),x("ngModelChange",function(a){return E(e.searchFilter.PageNumber,a)||(e.searchFilter.PageNumber=a),a}),p()(),s(14,"div",4)(15,"label",7),v(16,"Page Size"),p(),s(17,"input",8),x("ngModelChange",function(a){return E(e.searchFilter.RowCount,a)||(e.searchFilter.RowCount=a),a}),p()()(),s(18,"content")(19,"div",9)(20,"div",10)(21,"div",11),u(22,ve,2,4,"ng-container",1),I(23,"async"),s(24,"infinite-paginator",12),I(25,"async"),g("onNextPage",function(){return e.paginationService.onNextPage(e.searchFilter)})("onLastPage",function(){return e.paginationService.onLastPage(e.searchFilter)})("onGetRowCount",function(){return e.paginationService.getRowCount(e.searchFilter)}),p()()()()()()),i&2&&(h("pageData",e.pageData)("hideSearchBox",!1),c(),h("ngIf",y(2,14,e.paginationService.data$)),c(3),h("ngIf",y(5,16,e.loader$)),c(5),h("multiple",!0),c(4),T("ngModel",e.searchFilter.PageNumber),c(4),T("ngModel",e.searchFilter.RowCount),c(5),h("ngIf",y(23,18,e.paginationService.data$)),c(2),h("totalData",e.paginationService.totalData())("hideCount",e.paginationService.hideCount())("rowCount",y(25,20,e.paginationService.totalRowCount$))("pageNumber",e.paginationService.pageNumber())("disableNextButton",e.paginationService.disableNextButton())("goToLastPage",e.paginationService.isLastPage()))},dependencies:[J,$,Q,se,le,he,Z,K,Y,q,X,me,de,ae,ie],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]})}}return o})();export{et as MultiChannelComparison};