marketplacepos 5.43.8 → 5.43.9

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 (67) hide show
  1. package/Marketplace/{chunk-Z5NWWPJP.js → chunk-2ITJ4DPG.js} +4 -4
  2. package/Marketplace/{chunk-DJLBMG6O.js → chunk-2UCPBIOZ.js} +1 -1
  3. package/Marketplace/{chunk-HIAUMXPO.js → chunk-37ZTEPCA.js} +1 -1
  4. package/Marketplace/{chunk-YHKEECJR.js → chunk-3B2PNJWF.js} +1 -1
  5. package/Marketplace/{chunk-CMLFTAEA.js → chunk-3FDTU6XX.js} +1 -1
  6. package/Marketplace/{chunk-ZAJW3O5K.js → chunk-476VORY6.js} +1 -1
  7. package/Marketplace/{chunk-SEN46Y6T.js → chunk-4QFQSMCD.js} +1 -1
  8. package/Marketplace/{chunk-UDIDZKN6.js → chunk-5BSS4CVK.js} +1 -1
  9. package/Marketplace/{chunk-VEPPBK2Y.js → chunk-5LMIOXNX.js} +1 -1
  10. package/Marketplace/chunk-7PN4XLNE.js +1 -0
  11. package/Marketplace/{chunk-JUIKFEYB.js → chunk-7TZVISSD.js} +1 -1
  12. package/Marketplace/{chunk-FBDQLWJX.js → chunk-BRI2WDZ5.js} +1 -1
  13. package/Marketplace/{chunk-RC4S5BM5.js → chunk-DMU3IXDC.js} +1 -1
  14. package/Marketplace/{chunk-6GSTYF5H.js → chunk-DPE3IM5A.js} +1 -1
  15. package/Marketplace/{chunk-BQVXVM7F.js → chunk-EOZ2J2CF.js} +2 -2
  16. package/Marketplace/{chunk-EM443W7B.js → chunk-EY2JCLRQ.js} +2 -2
  17. package/Marketplace/{chunk-T6LQ7WTR.js → chunk-GFJ2PTHZ.js} +1 -1
  18. package/Marketplace/{chunk-DEJVMFIS.js → chunk-GH57P6KF.js} +1 -1
  19. package/Marketplace/{chunk-HCQDRRUB.js → chunk-GVULJZIG.js} +1 -1
  20. package/Marketplace/chunk-GZZULDDB.js +1 -0
  21. package/Marketplace/{chunk-EHJ5CYUT.js → chunk-H22ULYCV.js} +1 -1
  22. package/Marketplace/{chunk-WPWN2PNK.js → chunk-IA7AHP7C.js} +2 -2
  23. package/Marketplace/{chunk-KFNKVXCN.js → chunk-IVHM5DMM.js} +1 -1
  24. package/Marketplace/{chunk-Y4X2G3D4.js → chunk-IYDKWIZE.js} +1 -1
  25. package/Marketplace/{chunk-Q3IZXH7X.js → chunk-KEUKEBMY.js} +1 -1
  26. package/Marketplace/{chunk-WRRVCTKT.js → chunk-KWDFFHTV.js} +1 -1
  27. package/Marketplace/{chunk-5W5H64GB.js → chunk-LE4MX5H2.js} +1 -1
  28. package/Marketplace/{chunk-NU2AT65H.js → chunk-LKUIHFXN.js} +1 -1
  29. package/Marketplace/{chunk-AQGYDN3B.js → chunk-MQY7U3MF.js} +1 -1
  30. package/Marketplace/{chunk-EIWYK5TA.js → chunk-MTSGSFEV.js} +1 -1
  31. package/Marketplace/{chunk-4TCVWLGV.js → chunk-NEENWUEW.js} +1 -1
  32. package/Marketplace/{chunk-H7A64RRL.js → chunk-O7GJ2IQZ.js} +1 -1
  33. package/Marketplace/{chunk-MCOWAYNM.js → chunk-ONMIDN4J.js} +1 -1
  34. package/Marketplace/{chunk-VWYHEJLH.js → chunk-OPYL4IAL.js} +1 -1
  35. package/Marketplace/{chunk-EAKQWIS7.js → chunk-PDJ2XCYS.js} +1 -1
  36. package/Marketplace/{chunk-YFSXR7TL.js → chunk-Q7P5KBPH.js} +2 -2
  37. package/Marketplace/{chunk-OGX774CC.js → chunk-QS4VZEY6.js} +1 -1
  38. package/Marketplace/chunk-RMR3C4TT.js +1 -0
  39. package/Marketplace/{chunk-5J2P4G7C.js → chunk-RWOAVYTX.js} +1 -1
  40. package/Marketplace/{chunk-ZVVPREHB.js → chunk-STACT5DW.js} +1 -1
  41. package/Marketplace/{chunk-KXD6CZ7T.js → chunk-TBA2O4W7.js} +1 -1
  42. package/Marketplace/chunk-TEKUG5ZU.js +1 -0
  43. package/Marketplace/{chunk-NC3Y335Z.js → chunk-U23XMVSL.js} +1 -1
  44. package/Marketplace/{chunk-XT4STZN6.js → chunk-UCA5RNCO.js} +1 -1
  45. package/Marketplace/{chunk-5DIRXS7I.js → chunk-UMP6ZMEJ.js} +1 -1
  46. package/Marketplace/{chunk-4FDSLLEW.js → chunk-VUTDYXBC.js} +1 -1
  47. package/Marketplace/{chunk-SDRFBNFF.js → chunk-WAWTQ57P.js} +1 -1
  48. package/Marketplace/chunk-WIAQQWWF.js +1 -0
  49. package/Marketplace/chunk-WUF2BP4O.js +1 -0
  50. package/Marketplace/{chunk-TAA75BNT.js → chunk-XBUZ27V4.js} +1 -1
  51. package/Marketplace/{chunk-6CRGHPSR.js → chunk-XQM5PYIP.js} +1 -1
  52. package/Marketplace/chunk-YQEJLTF7.js +1 -0
  53. package/Marketplace/{chunk-UAYWO75X.js → chunk-Z6AT4GBY.js} +1 -1
  54. package/Marketplace/{chunk-5DG3HADY.js → chunk-ZUEJZI4O.js} +1 -1
  55. package/Marketplace/chunk-ZZKMIPQN.js +1 -0
  56. package/Marketplace/{chunk-IBVAAGUH.js → chunk-ZZS2X4HD.js} +1 -1
  57. package/Marketplace/index.html +2 -2
  58. package/Marketplace/{main-Y4LW42EY.js → main-553UOJOV.js} +1 -1
  59. package/package.json +1 -1
  60. package/Marketplace/chunk-2WE5VQIB.js +0 -1
  61. package/Marketplace/chunk-74NKCY42.js +0 -1
  62. package/Marketplace/chunk-A4BNLR77.js +0 -1
  63. package/Marketplace/chunk-GVQNFCWT.js +0 -1
  64. package/Marketplace/chunk-HYJVHRMN.js +0 -1
  65. package/Marketplace/chunk-I6FCMA5P.js +0 -1
  66. package/Marketplace/chunk-ICZU6TYQ.js +0 -1
  67. package/Marketplace/chunk-KZ7INCKP.js +0 -1
@@ -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-YFSXR7TL.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-5BSS4CVK.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-UMP6ZMEJ.js";import{h as pe}from"./chunk-Q7P5KBPH.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};
@@ -0,0 +1 @@
1
+ import{a as Re,b as Ne,c as Le}from"./chunk-V5BKQSAT.js";import{a as Ae}from"./chunk-GVULJZIG.js";import{a as Ie}from"./chunk-UCA5RNCO.js";import{a as Ve}from"./chunk-66MLRB2J.js";import"./chunk-M5JQ7BGW.js";import{a as Ee}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 Fe}from"./chunk-WPW3D4MQ.js";import{g as xe}from"./chunk-Q7P5KBPH.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import{a as M}from"./chunk-5HO2IJ47.js";import{c as Z,d as $,e as ee}from"./chunk-5JVEEL2T.js";import{b as C,c as K}from"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-AEOSNAHH.js";import{b as Te,e as G}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{b as te,c as ie,d as we,e as ne,f as oe,g as Oe,h as re,m as Me,n as Pe}from"./chunk-CLER2MX6.js";import{A as V,c as ke,h as H,m as U,o as ve}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{r as be,s as De}from"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{j as Ce,k as z,m as ye,n as O}from"./chunk-M2FCTYGU.js";import{$c as b,G as ae,Gb as D,Gc as a,Hc as y,Ic as B,Kc as k,Lc as v,Mb as E,Mc as T,Na as q,Nc as ue,Oa as J,Oc as he,Pc as ge,Qc as fe,Ra as S,Rc as _e,Sc as Se,Yb as u,Z as me,_b as le,aa as pe,ac as de,ad as Q,bd as I,dc as P,ec as N,gc as L,hc as A,ic as o,ja as F,jc as r,kc as x,oc as w,pa as c,pb as ce,rb as p,rd as X,tc as d,uc as h,v as j,ya as f,za as _}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import{a as W,b as Y}from"./chunk-66YHNWRR.js";function Je(n,g){if(n&1){let e=w();o(0,"div",10),d("click",function(){f(e);let i=h();return _(i.onSelectDelivery("DROP_OFF"))}),o(1,"div",11),x(2,"i",12),o(3,"h3",13),a(4,"Drop off"),r()(),o(5,"p",14),a(6," You can drop off your package at the nearest shipping counter in your city. "),r()()}if(n&2){let e=h();le("text-muted",e.selectedDelivery()&&e.selectedDelivery()==="PICK_UP")("selected",e.selectedDelivery()==="DROP_OFF")}}function Qe(n,g){if(n&1){let e=w();o(0,"div",10),d("click",function(){f(e);let i=h();return _(i.onSelectDelivery("PICK_UP"))}),o(1,"div",11),x(2,"i",15),o(3,"h3",16),a(4,"Pick up"),r()(),o(5,"p",17),a(6," The courier will collect the package from your address. "),r()()}if(n&2){let e=h();le("text-muted",e.selectedDelivery()&&e.selectedDelivery()==="DROP_OFF")("selected",e.selectedDelivery()==="PICK_UP")}}var We=(()=>{class n{constructor(){this.data=c(ie),this.dialogRef=c(te),this.selectedDelivery=S("DROP_OFF"),this.showPickup=S(!0),this.showDropOff=S(!0),this.initOptionsCondition()}onSelectDelivery(e){this.selectedDelivery.set(e)}initOptionsCondition(){switch(this.data.channelType){case C.Shopee:break;case C.Tiktok:this.showPickup.set(this.data.options?.Form?.information?.can_pickup),this.showDropOff.set(this.data.options?.Form?.information?.can_drop_off);break}}onConfirm(){this.dialogRef.close(this.selectedDelivery())}onClose(){this.dialogRef.close()}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=D({type:n,selectors:[["app-delivery-dialog"]],decls:16,vars:2,consts:[["mat-dialog-title","",1,"mt-12","mb-8"],[1,"d-flex","justify-content-between","align-items-start","lh-lg"],[1,"ms-2"],[1,"text-secondary-emphasis"],[1,"fa-solid","fa-xmark","text-muted","cursor-pointer","fs-3",3,"click"],[1,"pb-0"],[1,"d-flex","align-items-center","justify-content-center","gap-12"],["role","button",1,"delivery-option","d-flex","flex-column","align-items-center","justify-content-center","p-4","cursor-pointer",3,"text-muted","selected"],[1,"d-flex","justify-content-end",2,"margin-top","1.5rem"],[1,"btn","btn-light-blue","me-3","text-primary","btn-lg","fw-bold","mx-3","py-6",2,"width","70px",3,"click"],["role","button",1,"delivery-option","d-flex","flex-column","align-items-center","justify-content-center","p-4","cursor-pointer",3,"click"],[1,"text-center"],[1,"fa-solid","fa-cart-shopping-fast","fa-4x"],[1,"mt-4","titlew"],[1,"text-center","mt-4","lh-sm","subtitlew"],[1,"fa-solid","fa-hand-holding-box","fa-4x"],[1,"mt-4"],[1,"text-center","mt-4","lh-sm"]],template:function(t,i){t&1&&(o(0,"div",0)(1,"div",1)(2,"div",2)(3,"h2"),a(4,"Delivery Order"),r(),o(5,"div",3),a(6,"Your selected order(s) will be set to"),r()(),o(7,"div")(8,"i",4),d("click",function(){return i.onClose()}),r()()()(),o(9,"mat-dialog-content",5)(10,"div",6),E(11,Je,7,4,"div",7)(12,Qe,7,4,"div",7),r(),o(13,"div",8)(14,"button",9),d("click",function(){return i.onConfirm()}),a(15," OK "),r()()()),t&2&&(p(11),P(i.showPickup()?11:-1),p(),P(i.showDropOff()?12:-1))},dependencies:[O,re,ne,oe],styles:[".delivery-option[_ngcontent-%COMP%]{width:14rem;height:12rem;border:1px solid #656565}.delivery-option[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:0}.delivery-option.text-muted[_ngcontent-%COMP%]{border-color:#000;color:#000}.delivery-option.selected[_ngcontent-%COMP%]{color:#5e9708;border-color:#5e9708}.delivery-option.selected[_ngcontent-%COMP%] .titlew[_ngcontent-%COMP%]{color:#5e9708;font-weight:700}.delivery-option.selected[_ngcontent-%COMP%] .subtitlew[_ngcontent-%COMP%]{color:#5e9708}"]})}}return n})();function Ze(n,g){if(n&1&&(o(0,"ng-option",3),a(1),r()),n&2){let e=g.$implicit;u("value",e==null?null:e.address_id)("matTooltip",e==null?null:e.address),p(),y(e==null?null:e.address)}}function $e(n,g){if(n&1&&(o(0,"ng-option",6)(1,"span",7),a(2),b(3,"date"),r(),o(4,"span"),a(5),r()()),n&2){let e=g.$implicit;u("value",e==null?null:e.pickup_time_id),p(2),y(I(3,3,e==null?null:e.date,"d MMMM")),p(3),y(e==null?null:e.time_text)}}var ze=(()=>{class n{constructor(){this.shippingOptions=J(),this.onFormChanges=q(),this.addressList=X(()=>this.shippingOptions()?.response?.pickup?.address_list||[]),this.selectedShipping=S(null),this.timeOptions=S(this.convertTimestampToDate(this.addressList()[0]?.time_slot_list||[])),this.pickupTime=S(null)}onAddressChange(e){let t=this.addressList().find(i=>i.address_id===e);this.timeOptions.set(this.convertTimestampToDate(t?.time_slot_list||[])),this.pickupTime.set(null)}onValueChanges(){this.onFormChanges.emit({address_id:this.selectedShipping(),pickup_time_id:this.pickupTime()})}convertTimestampToDate(e){return e.map(t=>{let i=new Date(t.date*1e3);return Y(W({},t),{date:i})})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=D({type:n,selectors:[["shopee-pickup"]],inputs:{shippingOptions:[1,"shippingOptions"]},outputs:{onFormChanges:"onFormChanges"},decls:12,vars:4,consts:[[1,"mb-6"],["for","address",1,"mb-2","text-muted"],["id","address","placeholder","Select Address to Pickup","appendTo","body",1,"shipping-timepicker",3,"ngModelChange","clearable","ngModel"],[3,"value","matTooltip"],["for","timepicker",1,"mb-2","text-muted"],["id","timepicker","placeholder","Select Date Pickup","appendTo","body",1,"shipping-timepicker",3,"ngModelChange","clearable","ngModel"],[3,"value"],[1,"me-2"]],template:function(t,i){t&1&&(o(0,"div",0)(1,"label",1),a(2,"Address"),r(),o(3,"ng-select",2),T("ngModelChange",function(s){return v(i.selectedShipping,s)||(i.selectedShipping=s),s}),d("ngModelChange",function(s){return i.onAddressChange(s),i.onValueChanges()}),L(4,Ze,2,3,"ng-option",3,N),r()(),o(6,"div",0)(7,"label",4),a(8,"Date"),r(),o(9,"ng-select",5),T("ngModelChange",function(s){return v(i.pickupTime,s)||(i.pickupTime=s),s}),d("ngModelChange",function(){return i.onValueChanges()}),L(10,$e,6,6,"ng-option",6,N),r()()),t&2&&(p(3),u("clearable",!1),k("ngModel",i.selectedShipping),p(),A(i.addressList()),p(5),u("clearable",!1),k("ngModel",i.pickupTime),p(),A(i.timeOptions()))},dependencies:[O,z,ee,$,Z,V,H,U,De,be],encapsulation:2})}}return n})();function et(n,g){if(n&1&&(o(0,"ng-option",3)(1,"span",4),a(2),b(3,"date"),r(),o(4,"span"),a(5),b(6,"date"),r(),o(7,"span",5),a(8,"-"),r(),o(9,"span"),a(10),b(11,"date"),r()()),n&2){let e=g.$implicit,t=g.$index;u("value",t),p(2),y(I(3,4,e==null?null:e.start_date,"d MMMM")),p(3),y(I(6,7,e==null?null:e.start_date,"HH:mm")),p(5),y(I(11,10,e==null?null:e.end_date,"HH:mm"))}}var He=(()=>{class n{constructor(){this.shippingOptions=J(),this.onFormChanges=q(),this.timeOptions=X(()=>this.shippingOptions()?.Options?.pickup_slots),this.selectedTimeIndex=S(null)}onValueChanges(){let e=this.timeOptions()[this.selectedTimeIndex()];this.onFormChanges.emit({start_time:e?.start_time,end_time:e?.end_time})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=D({type:n,selectors:[["tiktok-pickup"]],inputs:{shippingOptions:[1,"shippingOptions"]},outputs:{onFormChanges:"onFormChanges"},decls:6,vars:2,consts:[[1,"mb-6"],["for","timepicker",1,"mb-2","text-muted"],["id","timepicker","placeholder","Select Time Pickup","appendTo","body",1,"shipping-timepicker",3,"ngModelChange","clearable","ngModel"],[3,"value"],[1,"me-2"],[1,"mx-1"]],template:function(t,i){t&1&&(o(0,"div",0)(1,"label",1),a(2,"Time"),r(),o(3,"ng-select",2),T("ngModelChange",function(s){return v(i.selectedTimeIndex,s)||(i.selectedTimeIndex=s),s}),d("ngModelChange",function(){return i.onValueChanges()}),L(4,et,12,13,"ng-option",3,N),r()()),t&2&&(p(3),u("clearable",!1),k("ngModel",i.selectedTimeIndex),p(),A(i.timeOptions()))},dependencies:[O,z,ee,$,Z,V,H,U],encapsulation:2})}}return n})();function tt(n,g){if(n&1){let e=w();o(0,"shopee-pickup",10),d("onFormChanges",function(i){f(e);let l=h();return _(l.onFormChanges(i))}),r()}if(n&2){let e=h();u("shippingOptions",e.dialogData.shippingOptions)}}function it(n,g){if(n&1){let e=w();o(0,"tiktok-pickup",10),d("onFormChanges",function(i){f(e);let l=h();return _(l.onFormChanges(i))}),r()}if(n&2){let e=h();u("shippingOptions",e.dialogData.shippingOptions)}}var Ue=(()=>{class n{constructor(){this.dialogRef=c(te),this.dialogData=c(ie),this.shippingOptions=S(this.dialogData.shippingOptions),this.channelType=S(this.dialogData.channelType),this.order=S(this.dialogData.order),this.channelTypeEnum=C,this.pickupData=S(null)}onFormChanges(e){this.pickupData.set(e)}onClose(){this.dialogRef.close()}onSave(){let e=this.generatePickupData();this.dialogRef.close(e)}generatePickupData(){switch(this.channelType()){case C.Shopee:return{OrderNumber:this.order().Number,ShopID:this.order().ShopID,pickup:this.pickupData()};case C.Tiktok:return{handover_method:"PICKUP",PackageID:this.shippingOptions().Form?.information?.PackageID,ShopID:this.order().ShopID,pickup_slot:this.pickupData()}}}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=D({type:n,selectors:[["app-pickup-dialog"]],decls:21,vars:2,consts:[["mat-dialog-title","",1,"mt-12","mb-6"],[1,"d-flex","justify-content-between","align-items-start","lh-lg"],[1,"lh-base","mt-6"],[1,"text-muted","fs-6"],["role","button",1,"fa-solid","fa-xmark","text-muted","cursor-pointer","fs-3",3,"click"],[2,"padding-bottom","10px"],[3,"shippingOptions"],[1,"d-flex","justify-content-end","align-items-center","w-100","pe-8","mb-4"],[1,"btn","btn-outline-secondary","me-4",2,"width","70px",3,"click"],[1,"btn","btn-success",2,"width","70px",3,"click"],[3,"onFormChanges","shippingOptions"]],template:function(t,i){if(t&1&&(o(0,"div",0)(1,"div",1)(2,"div")(3,"h3"),a(4,"Set Pickup"),r(),o(5,"div",2)(6,"div",3),a(7,"Shipping Method"),r(),o(8,"div",3),a(9),r()()(),o(10,"div")(11,"i",4),d("click",function(){return i.onClose()}),r()()()(),o(12,"mat-dialog-content",5),E(13,tt,1,1,"shopee-pickup",6)(14,it,1,1,"tiktok-pickup",6),r(),o(15,"mat-dialog-actions")(16,"div",7)(17,"button",8),d("click",function(){return i.onClose()}),a(18," Cancel "),r(),o(19,"button",9),d("click",function(){return i.onSave()}),a(20," Ok "),r()()()),t&2){let l,s;p(9),B(" ",!((l=i.order())==null||l.LogisticService==null)&&l.LogisticService.Name?(l=i.order())==null||l.LogisticService==null?null:l.LogisticService.Name:"-"," "),p(4),P((s=i.channelType())===i.channelTypeEnum.Shopee?13:s===i.channelTypeEnum.Tiktok?14:-1)}},dependencies:[O,re,ne,Oe,oe,V,ze,He],styles:['ng-select.shipping-timepicker .ng-arrow{border:none!important;width:0;height:0} ng-select.shipping-timepicker .ng-arrow-wrapper{width:28px;display:flex;align-items:center;justify-content:center} ng-select.shipping-timepicker .ng-arrow-wrapper:after{content:"\\f107";font-family:"Font Awesome 6 Pro","Font Awesome 6 Free","Font Awesome 5 Pro","Font Awesome 5 Free";font-style:normal;font-weight:400!important;font-size:16px;line-height:1;display:inline-block;color:#6b7280;pointer-events:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:auto}.label-opacity[_ngcontent-%COMP%]{opacity:.7}']})}}return n})();var se=(()=>{class n{constructor(){this.httpService=c(G)}getReadyToShipOrders(e){return this.httpService.post(M.GetToShip,e).pipe(j(t=>t?.Data))}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=F({token:n,factory:n.\u0275fac})}}return n})();var Ke=(()=>{class n{constructor(){this.httpService=c(G)}getShippingOptions(e,t){return this.httpService.post(M.GetTiktokShippingOptions,{OrderNumber:e,ShopID:t}).pipe(j(i=>this.formatDatePickUpOptions(i)))}pickupOrder(e){return this.httpService.post(M.TiktokSelectShipping,e)}dropOffOrder(e,t){let i={handover_method:"DROP_OFF",PackageID:e,ShopID:t};return this.httpService.post(M.TiktokSelectShipping,i)}formatDatePickUpOptions(e){return e?.Options?.pickup_slots&&(e.Options.pickup_slots=e?.Options?.pickup_slots.map(t=>{let i=K.convertTimestampToDate(t.start_time),l=K.convertTimestampToDate(t.end_time);return t.start_date=i,t.end_date=l,t})),e}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=F({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var Ge=(()=>{class n{constructor(){this.httpService=c(G)}getShippingOptions(e,t){return this.httpService.post(M.GetShopeeShippingOptions,{OrderNumber:e,ShopID:t})}pickupOrder(e){return this.httpService.post(M.ShopeeSelectShipping,e)}dropOffOrder(e,t){let i={OrderNumber:e,ShopID:t,dropoff:{}};return this.httpService.post(M.ShopeeSelectShipping,i)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=F({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var Ye=(()=>{class n{constructor(){this.shopeeShippingService=c(Ge),this.tiktokShippingService=c(Ke)}getShippingOptions(e,t,i){switch(i){case C.Shopee:return this.getShopeeShippingOptions(e,t);case C.Tiktok:return this.getTiktokShippingOptions(e,t)}}pickupOrder(e,t){switch(e.MarketType){case C.Shopee:return this.shopeeShippingService.pickupOrder(t);case C.Tiktok:return this.tiktokShippingService.pickupOrder(t)}}dropOffOrder(e,t){switch(e.MarketType){case C.Shopee:return this.shopeeShippingService.dropOffOrder(e.Number,e.ShopID);case C.Tiktok:let i=t?.Form?.information?.PackageID;return this.tiktokShippingService.dropOffOrder(i,e.ShopID)}}getShopeeShippingOptions(e,t){return this.shopeeShippingService.getShippingOptions(e,t)}getTiktokShippingOptions(e,t){return this.tiktokShippingService.getShippingOptions(e,t)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=F({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var nt=()=>[],ot=n=>({"td-cell-hover":n});function rt(n,g){if(n&1&&x(0,"variants-dropdown",30),n&2){let e=h().$implicit;u("variants",e==null?null:e.Variants)}}function at(n,g){if(n&1&&x(0,"variant-with-image",31),n&2){let e=h().$implicit;u("variant",e==null?null:e.Variants[0])}}function pt(n,g){if(n&1&&(o(0,"span"),a(1),r()),n&2){let e=h().$implicit;p(),B("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function lt(n,g){if(n&1){let e=w();o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"div",26)(5,"div",27)(6,"div"),x(7,"img",28),b(8,"channelImage"),r(),o(9,"div"),x(10,"order-link",29),r()(),o(11,"small"),a(12),b(13,"date"),r()()(),o(14,"td"),a(15),r(),o(16,"td"),E(17,rt,1,1,"variants-dropdown",30)(18,at,1,1,"variant-with-image",31),r(),o(19,"td",32),a(20),b(21,"number"),r(),o(22,"td")(23,"div",26)(24,"div",27)(25,"span"),a(26),r(),E(27,pt,2,1,"span"),r(),o(28,"small"),a(29),r()()(),o(30,"td",33)(31,"button",34),d("click",function(){let i=f(e).$implicit,l=h(2);return _(l.onSetFulfillment(i))}),a(32," Set Fulfillment "),r()()()}if(n&2){let e=g.$implicit;p(2),y(e.Outlet),p(5),u("src",Q(8,13,e==null?null:e.MarketType),ce)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),p(3),u("order",e),p(2),B(" ",I(13,15,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),p(3),y(e.Customer),p(),de(Se(20,ot,(e.Variants==null?null:e.Variants.length)>1)),p(),P((e.Variants==null?null:e.Variants.length)>1?17:18),p(3),y(Q(21,18,e.Amount)),p(6),y(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),p(),P(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?27:-1),p(2),B(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," ")}}function st(n,g){if(n&1){let e=w();o(0,"div",15)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),a(5,"Outlet"),r(),o(6,"th",21),a(7,"Number"),r(),o(8,"th",21),a(9,"Customer"),r(),o(10,"th"),a(11,"Items"),r(),o(12,"th",22),a(13,"Amount"),r(),o(14,"th",23),a(15,"Shipping"),r(),x(16,"th",24),r()(),o(17,"tbody"),L(18,lt,33,22,"tr",null,N),r()(),o(20,"app-custom-paginator",25),d("next",function(){f(e);let i=h();return _(i.initReadyToShip())})("previous",function(){f(e);let i=h();return _(i.initReadyToShip())}),r()()}if(n&2){let e=h(),t=ge(0);p(18),A(t),p(2),u("filter",e.filter())("totaldata",t==null?null:t.length)}}function mt(n,g){n&1&&(o(0,"div",16),x(1,"app-empty-state"),r())}var Ri=(()=>{class n{constructor(){this.readyToShipService=c(se),this.dialog=c(we),this.pickupService=c(Ye),this.toastr=c(Te),this.tokenService=c(xe),this.filter=S({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){let e=this.tokenService.getTokenValue(),t=Number(e?.orddfl??0),i=new Date,l=t===0?null:new Date(i.setDate(i.getDate()-t));this.filter.update(s=>Y(W({},s),{From:l})),this.initReadyToShip()}initReadyToShip(){this.readyToShip$=this.readyToShipService.getReadyToShipOrders(this.filter()).pipe(me(1))}onFilterChange(e){this.filter.update(t=>W(W({},t),e))}getOrderDefaultValue(){return this.tokenService.getTokenValue()?.orddfl??null}onSetFulfillment(e){this.pickupService.getShippingOptions(e.Number,e.ShopID,e.MarketType).pipe(pe(t=>this.dialog.open(We,{height:"400px",width:"530px",data:{options:t,channelType:e.MarketType}}).afterClosed().pipe(ae(i=>K.IsNotEmpty(i)),j(i=>({type:i,order:e,options:t}))))).subscribe(t=>{t.type=="PICK_UP"?this.onSelectPickup(t.order,t.options):this.onSelectDropOff(t.order,t.options)})}onSelectPickup(e,t){this.dialog.open(Ue,{width:"530px",data:{order:e,shippingOptions:t,channelType:e.MarketType},disableClose:!0}).afterClosed().pipe(ae(i=>K.IsNotEmpty(i)),pe(i=>this.pickupService.pickupOrder(e,i))).subscribe(()=>{this.toastr.success("Pickup order created successfully","Success"),this.initReadyToShip()})}onSelectDropOff(e,t){this.pickupService.dropOffOrder(e,t).subscribe(()=>{this.toastr.success("Drop-off order created successfully","Success"),this.initReadyToShip()})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=D({type:n,selectors:[["app-ready-to-ship"]],features:[fe([se])],decls:34,vars:12,consts:[["headerTitle","To Ship","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-regular","fa-tv","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","100px"],[2,"width","250px"],[1,"text-end",2,"width","150px"],[2,"width","150px"],[2,"width","160px"],["rowCountApi","/api/orders/toshipcount",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"],[2,"font-size","14px",3,"order"],[3,"variants"],[3,"variant"],[1,"text-end"],[1,"actions-cell"],[1,"btn","btn-success","btn-sm",2,"--bs-btn-padding-y","0.25rem","--bs-btn-padding-x","0.5rem","--bs-btn-font-size","0.75rem",3,"click"]],template:function(t,i){if(t&1){let l=w();ue(0),b(1,"async"),o(2,"mainpanel",0),d("onSubmit",function(){return f(l),_(i.initReadyToShip())}),T("textChange",function(m){return f(l),v(i.filter().Number,m)||(i.filter().Number=m),_(m)}),o(3,"actions")(4,"a",1),x(5,"i",2),o(6,"span"),a(7,"Order Fulfillment Display"),r()()(),o(8,"filters")(9,"div")(10,"label",3),a(11,"From/To"),r(),o(12,"channel-select-options",4),T("ngModelChange",function(m){return f(l),v(i.filter().ListChannelID,m)||(i.filter().ListChannelID=m),_(m)}),r()(),o(13,"div",5)(14,"label",3),a(15,"From/To"),r(),o(16,"div",6)(17,"datepicker",7),T("dateChange",function(m){return f(l),v(i.filter().From,m)||(i.filter().From=m),_(m)}),r()(),o(18,"div")(19,"datepicker",8),T("dateChange",function(m){return f(l),v(i.filter().To,m)||(i.filter().To=m),_(m)}),r()()(),o(20,"div",5)(21,"label",9),a(22,"Page Number"),r(),o(23,"input",10),T("ngModelChange",function(m){return f(l),v(i.filter().PageNumber,m)||(i.filter().PageNumber=m),_(m)}),r()(),o(24,"div",5)(25,"label",9),a(26,"Page Size"),r(),o(27,"input",11),T("ngModelChange",function(m){return f(l),v(i.filter().PageSize,m)||(i.filter().PageSize=m),_(m)}),r()()(),o(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),E(32,st,21,2,"div",15)(33,mt,2,0,"div",16),r()()()()()}if(t&2){let l=he(Q(1,8,i.readyToShip$)||_e(11,nt));p(2),k("text",i.filter().Number),p(10),u("multiple",!0),k("ngModel",i.filter().ListChannelID),p(5),k("date",i.filter().From),p(2),k("date",i.filter().To),p(4),k("ngModel",i.filter().PageNumber),p(4),k("ngModel",i.filter().PageSize),p(5),P(l.length>0?32:33)}},dependencies:[O,Ce,ye,z,Pe,Me,Ee,Fe,V,ke,ve,H,U,Re,Ne,Le,Ve,Ie,Ae],styles:[".actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{opacity:0;visibility:hidden;transition:opacity .12s ease-in-out}tr[_ngcontent-%COMP%]:hover .actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%]:hover .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%]:focus-within .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]:focus{opacity:1;visibility:visible}"]})}}return n})();export{Ri as ReadyToShipComponent};
@@ -1 +1 @@
1
- import{a as ae}from"./chunk-66MLRB2J.js";import"./chunk-M5JQ7BGW.js";import{a as ie}from"./chunk-EPVCMYCI.js";import{a as oe,b as re}from"./chunk-6FY74YFQ.js";import"./chunk-7ZXNQAAU.js";import"./chunk-JDIBETL5.js";import"./chunk-L7K5HOBY.js";import"./chunk-3LRWABHB.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{h as Q}from"./chunk-YFSXR7TL.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import{a as X,b as Z,d as $,e as ee}from"./chunk-5JVEEL2T.js";import{c as J}from"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-AEOSNAHH.js";import{e as K}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as te,n as ne}from"./chunk-CLER2MX6.js";import{A as Y,c as j,h as q,m as G,o as H}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{H as A,J as U,f as W,g as F,k as B,m as k,n as z}from"./chunk-M2FCTYGU.js";import{$c as L,Fc as P,Gb as T,Gc as l,Hc as S,Ic as y,Kc as c,Lc as u,Mb as w,Mc as h,Sc as I,Yb as m,ad as N,bd as V,cd as R,ic as t,jc as n,kc as C,lc as M,mc as x,oc as O,pb as b,rb as r,tc as E,uc as v,xb as D,ya as p,za as s}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var le=a=>({ID:a});function de(a,f){if(a&1&&(t(0,"span",17),C(1,"img",18),n(),l(2)),a&2){let e=f.item;r(),m("src",e.Img,b)("alt",e.Name),r(),y(" ",e.Name," ")}}function me(a,f){if(a&1&&(t(0,"tr")(1,"td"),l(2),n(),t(3,"td"),C(4,"img",28),n(),t(5,"td"),l(6),n(),t(7,"td",29)(8,"a",30),l(9),L(10,"number"),n()(),t(11,"td"),l(12),n(),t(13,"td"),l(14),L(15,"date"),n()()),a&2){let e=f.$implicit;r(2),S(e._source.ChannelName),r(2),m("src",e.logo,b),r(2),S(e._source.DateRange),r(2),m("queryParams",I(12,le,e._source.ID)),r(),y(" ",N(10,7,e._source.CountOrder)," "),r(3),S(e._source.UserLogin),r(2),y(" ",V(15,9,e._source["@timestamp_received"],"dd MMM yyyy hh:mm")," ")}}function pe(a,f){if(a&1){let e=O();M(0),t(1,"div",19)(2,"table",20)(3,"thead")(4,"tr",21)(5,"th",22),l(6,"Channel"),n(),t(7,"th",23),l(8,"Type"),n(),t(9,"th",24),l(10,"Download Date Range"),n(),t(11,"th",25),l(12,"Count"),n(),t(13,"th"),l(14,"User Login"),n(),t(15,"th"),l(16,"Created"),n()()(),t(17,"tbody"),w(18,me,16,14,"tr",26),n()(),t(19,"mat-paginator",27),E("page",function(i){p(e);let d=v();return s(d.onPaginationChange(i))}),n()(),x()}if(a&2){let e=v();r(18),m("ngForOf",e.downloadOrders),r(),m("length",e.paginationTotal)("pageSize",e.paginationPageSize)("pageIndex",(e.filter==null?null:e.filter.PageNumber)==0?0:(e.filter==null?null:e.filter.PageNumber)-1)}}function se(a,f){a&1&&(t(0,"div",31),C(1,"app-empty-state"),n())}var xe=(()=>{class a{constructor(e,g){this.http=e,this.authService=g,this.filter={PageNumber:0,RowCount:20,ChannelID:"",From:"",To:""},this.channelOptions=this.authService.getChannels(),this.onGetLoader()}onGetLoader(){this.http.post("/api/OrdersLoader/OrderLogsLoader",{}).subscribe(e=>{this.filter=e.Filter,this.getDownloadOrders()})}getDownloadOrders(){this.http.post("api/Orders/OrderLogsPaged",this.filter).subscribe(e=>{this.downloadOrders=e.hits,this.setChannelLogo(),this.paginationTotal=e.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}setChannelLogo(){this.downloadOrders=this.downloadOrders.map(e=>(e.logo=J.getChannelLogoByTypeId(e._source.TypeID),e))}onPaginationChange(e){this.filter.PageNumber=e.pageIndex+1,this.getDownloadOrders()}static{this.\u0275fac=function(g){return new(g||a)(D(K),D(Q))}}static{this.\u0275cmp=T({type:a,selectors:[["app-download-order-log"]],decls:29,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","Download Order Log",3,"onSubmit","hideSearchBox"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[2,"width","200px"],[1,"text-end",2,"width","200px"],[4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],[2,"width","25px",3,"src"],[1,"text-end"],["routerLink","/menu/Order/Download_Order_Log/Detail",3,"queryParams"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(g,i){if(g&1){let d=O();t(0,"mainpanel",1),E("onSubmit",function(){return p(d),s(i.getDownloadOrders())}),t(1,"filters")(2,"div")(3,"label",2),l(4,"Channel"),n(),t(5,"ng-select",3),h("ngModelChange",function(o){return p(d),u(i.filter.ChannelID,o)||(i.filter.ChannelID=o),s(o)}),w(6,de,3,3,"ng-template",4),n()(),t(7,"div",5)(8,"label",6),l(9,"From/To"),n(),t(10,"div",7)(11,"datepicker",8),h("dateChange",function(o){return p(d),u(i.filter.From,o)||(i.filter.From=o),s(o)}),n()(),t(12,"div")(13,"datepicker",9),h("dateChange",function(o){return p(d),u(i.filter.To,o)||(i.filter.To=o),s(o)}),n()()(),t(14,"div",5)(15,"label",10),l(16,"Page Number"),n(),t(17,"input",11),h("ngModelChange",function(o){return p(d),u(i.filter.PageNumber,o)||(i.filter.PageNumber=o),s(o)}),n()(),t(18,"div",5)(19,"label",10),l(20,"Page Size"),n(),t(21,"input",12),h("ngModelChange",function(o){return p(d),u(i.filter.RowCount,o)||(i.filter.RowCount=o),s(o)}),n()()(),t(22,"content")(23,"div",13)(24,"div",14)(25,"div",15),w(26,pe,20,4,"ng-container",16)(27,se,2,0,"ng-template",null,0,R),n()()()()()}if(g&2){let d=P(28);m("hideSearchBox",!0),r(5),m("clearable",!0)("items",i.channelOptions),c("ngModel",i.filter.ChannelID),r(6),c("date",i.filter.From),r(2),c("date",i.filter.To),r(4),c("ngModel",i.filter.PageNumber),r(4),c("ngModel",i.filter.RowCount),r(5),m("ngIf",(i.downloadOrders==null?null:i.downloadOrders.length)>0)("ngIfElse",d)}},dependencies:[z,W,F,k,B,re,oe,ne,te,ee,$,X,Z,Y,j,H,q,G,ae,U,A,ie],encapsulation:2})}}return a})();export{xe as DownloadOrderLogComponent};
1
+ import{a as ae}from"./chunk-66MLRB2J.js";import"./chunk-M5JQ7BGW.js";import{a as ie}from"./chunk-EPVCMYCI.js";import{a as oe,b as re}from"./chunk-6FY74YFQ.js";import"./chunk-7ZXNQAAU.js";import"./chunk-JDIBETL5.js";import"./chunk-L7K5HOBY.js";import"./chunk-3LRWABHB.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{h as Q}from"./chunk-Q7P5KBPH.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import{a as X,b as Z,d as $,e as ee}from"./chunk-5JVEEL2T.js";import{c as J}from"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-AEOSNAHH.js";import{e as K}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as te,n as ne}from"./chunk-CLER2MX6.js";import{A as Y,c as j,h as q,m as G,o as H}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{H as A,J as U,f as W,g as F,k as B,m as k,n as z}from"./chunk-M2FCTYGU.js";import{$c as L,Fc as P,Gb as T,Gc as l,Hc as S,Ic as y,Kc as c,Lc as u,Mb as w,Mc as h,Sc as I,Yb as m,ad as N,bd as V,cd as R,ic as t,jc as n,kc as C,lc as M,mc as x,oc as O,pb as b,rb as r,tc as E,uc as v,xb as D,ya as p,za as s}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var le=a=>({ID:a});function de(a,f){if(a&1&&(t(0,"span",17),C(1,"img",18),n(),l(2)),a&2){let e=f.item;r(),m("src",e.Img,b)("alt",e.Name),r(),y(" ",e.Name," ")}}function me(a,f){if(a&1&&(t(0,"tr")(1,"td"),l(2),n(),t(3,"td"),C(4,"img",28),n(),t(5,"td"),l(6),n(),t(7,"td",29)(8,"a",30),l(9),L(10,"number"),n()(),t(11,"td"),l(12),n(),t(13,"td"),l(14),L(15,"date"),n()()),a&2){let e=f.$implicit;r(2),S(e._source.ChannelName),r(2),m("src",e.logo,b),r(2),S(e._source.DateRange),r(2),m("queryParams",I(12,le,e._source.ID)),r(),y(" ",N(10,7,e._source.CountOrder)," "),r(3),S(e._source.UserLogin),r(2),y(" ",V(15,9,e._source["@timestamp_received"],"dd MMM yyyy hh:mm")," ")}}function pe(a,f){if(a&1){let e=O();M(0),t(1,"div",19)(2,"table",20)(3,"thead")(4,"tr",21)(5,"th",22),l(6,"Channel"),n(),t(7,"th",23),l(8,"Type"),n(),t(9,"th",24),l(10,"Download Date Range"),n(),t(11,"th",25),l(12,"Count"),n(),t(13,"th"),l(14,"User Login"),n(),t(15,"th"),l(16,"Created"),n()()(),t(17,"tbody"),w(18,me,16,14,"tr",26),n()(),t(19,"mat-paginator",27),E("page",function(i){p(e);let d=v();return s(d.onPaginationChange(i))}),n()(),x()}if(a&2){let e=v();r(18),m("ngForOf",e.downloadOrders),r(),m("length",e.paginationTotal)("pageSize",e.paginationPageSize)("pageIndex",(e.filter==null?null:e.filter.PageNumber)==0?0:(e.filter==null?null:e.filter.PageNumber)-1)}}function se(a,f){a&1&&(t(0,"div",31),C(1,"app-empty-state"),n())}var xe=(()=>{class a{constructor(e,g){this.http=e,this.authService=g,this.filter={PageNumber:0,RowCount:20,ChannelID:"",From:"",To:""},this.channelOptions=this.authService.getChannels(),this.onGetLoader()}onGetLoader(){this.http.post("/api/OrdersLoader/OrderLogsLoader",{}).subscribe(e=>{this.filter=e.Filter,this.getDownloadOrders()})}getDownloadOrders(){this.http.post("api/Orders/OrderLogsPaged",this.filter).subscribe(e=>{this.downloadOrders=e.hits,this.setChannelLogo(),this.paginationTotal=e.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}setChannelLogo(){this.downloadOrders=this.downloadOrders.map(e=>(e.logo=J.getChannelLogoByTypeId(e._source.TypeID),e))}onPaginationChange(e){this.filter.PageNumber=e.pageIndex+1,this.getDownloadOrders()}static{this.\u0275fac=function(g){return new(g||a)(D(K),D(Q))}}static{this.\u0275cmp=T({type:a,selectors:[["app-download-order-log"]],decls:29,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","Download Order Log",3,"onSubmit","hideSearchBox"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[2,"width","200px"],[1,"text-end",2,"width","200px"],[4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],[2,"width","25px",3,"src"],[1,"text-end"],["routerLink","/menu/Order/Download_Order_Log/Detail",3,"queryParams"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(g,i){if(g&1){let d=O();t(0,"mainpanel",1),E("onSubmit",function(){return p(d),s(i.getDownloadOrders())}),t(1,"filters")(2,"div")(3,"label",2),l(4,"Channel"),n(),t(5,"ng-select",3),h("ngModelChange",function(o){return p(d),u(i.filter.ChannelID,o)||(i.filter.ChannelID=o),s(o)}),w(6,de,3,3,"ng-template",4),n()(),t(7,"div",5)(8,"label",6),l(9,"From/To"),n(),t(10,"div",7)(11,"datepicker",8),h("dateChange",function(o){return p(d),u(i.filter.From,o)||(i.filter.From=o),s(o)}),n()(),t(12,"div")(13,"datepicker",9),h("dateChange",function(o){return p(d),u(i.filter.To,o)||(i.filter.To=o),s(o)}),n()()(),t(14,"div",5)(15,"label",10),l(16,"Page Number"),n(),t(17,"input",11),h("ngModelChange",function(o){return p(d),u(i.filter.PageNumber,o)||(i.filter.PageNumber=o),s(o)}),n()(),t(18,"div",5)(19,"label",10),l(20,"Page Size"),n(),t(21,"input",12),h("ngModelChange",function(o){return p(d),u(i.filter.RowCount,o)||(i.filter.RowCount=o),s(o)}),n()()(),t(22,"content")(23,"div",13)(24,"div",14)(25,"div",15),w(26,pe,20,4,"ng-container",16)(27,se,2,0,"ng-template",null,0,R),n()()()()()}if(g&2){let d=P(28);m("hideSearchBox",!0),r(5),m("clearable",!0)("items",i.channelOptions),c("ngModel",i.filter.ChannelID),r(6),c("date",i.filter.From),r(2),c("date",i.filter.To),r(4),c("ngModel",i.filter.PageNumber),r(4),c("ngModel",i.filter.RowCount),r(5),m("ngIf",(i.downloadOrders==null?null:i.downloadOrders.length)>0)("ngIfElse",d)}},dependencies:[z,W,F,k,B,re,oe,ne,te,ee,$,X,Z,Y,j,H,q,G,ae,U,A,ie],encapsulation:2})}}return a})();export{xe as DownloadOrderLogComponent};
@@ -1 +1 @@
1
- import{h as k}from"./chunk-YFSXR7TL.js";import{a as A,b as F,d as U,e as W}from"./chunk-5JVEEL2T.js";import{A as L,a as D,h as V,m as I}from"./chunk-6QYD6NIJ.js";import{n as E}from"./chunk-M2FCTYGU.js";import{Gb as M,Gc as p,Ic as f,Kc as O,Lc as T,Mb as u,Mc as N,Oa as d,Qc as w,Yb as s,dc as y,ic as a,jc as o,kc as h,oc as x,pa as S,pb as g,rb as r,tc as C,uc as _,ya as v,za as b}from"./chunk-B7KTCPKC.js";function z(t,m){if(t&1&&(a(0,"span",3),h(1,"img",4),o(),a(2,"span"),p(3),o()),t&2){let e=m.item;r(),s("src",e==null?null:e.Img,g),r(2),f(" ",e.Name," ")}}function P(t,m){if(t&1){let e=x();a(0,"span",6),C("click",function(){v(e);let n=_(),c=n.item,l=n.clear;return b(l(c))}),p(1,"x"),o()}}function j(t,m){if(t&1&&(a(0,"span",3),h(1,"img",4),o(),a(2,"span"),p(3),o(),u(4,P,2,0,"span",5)),t&2){let e=m.item,i=_();r(),s("src",e==null?null:e.Img,g),r(2),f(" ",e.Name," "),r(),y(i.clearable()?4:-1)}}var Y=(()=>{class t{constructor(){this.authService=S(k),this.multiple=d(!1),this.clearable=d(!0),this.options=this.authService.getChannels(),this.onChange=e=>{}}onChannelChange(e){this.onChange(e)}writeValue(e){this.selectedChannels=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=M({type:t,selectors:[["channel-select-options"]],inputs:{multiple:[1,"multiple"],clearable:[1,"clearable"]},features:[w([{provide:D,multi:!0,useExisting:t}])],decls:3,vars:4,consts:[["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel","multiple"],["ng-option-tmp",""],["ng-label-tmp",""],[1,"me-2"],[2,"width","18px",3,"src"],["aria-hidden","true",1,"ng-value-icon","right"],["aria-hidden","true",1,"ng-value-icon","right",3,"click"]],template:function(i,n){i&1&&(a(0,"ng-select",0),N("ngModelChange",function(l){return T(n.selectedChannels,l)||(n.selectedChannels=l),l}),C("ngModelChange",function(l){return n.onChannelChange(l)}),u(1,z,4,2,"ng-template",1)(2,j,5,3,"ng-template",2),o()),i&2&&(s("clearable",n.clearable())("items",n.options),O("ngModel",n.selectedChannels),s("multiple",n.multiple()))},dependencies:[E,W,U,A,F,L,V,I],encapsulation:2})}}return t})();export{Y as a};
1
+ import{h as k}from"./chunk-Q7P5KBPH.js";import{a as A,b as F,d as U,e as W}from"./chunk-5JVEEL2T.js";import{A as L,a as D,h as V,m as I}from"./chunk-6QYD6NIJ.js";import{n as E}from"./chunk-M2FCTYGU.js";import{Gb as M,Gc as p,Ic as f,Kc as O,Lc as T,Mb as u,Mc as N,Oa as d,Qc as w,Yb as s,dc as y,ic as a,jc as o,kc as h,oc as x,pa as S,pb as g,rb as r,tc as C,uc as _,ya as v,za as b}from"./chunk-B7KTCPKC.js";function z(t,m){if(t&1&&(a(0,"span",3),h(1,"img",4),o(),a(2,"span"),p(3),o()),t&2){let e=m.item;r(),s("src",e==null?null:e.Img,g),r(2),f(" ",e.Name," ")}}function P(t,m){if(t&1){let e=x();a(0,"span",6),C("click",function(){v(e);let n=_(),c=n.item,l=n.clear;return b(l(c))}),p(1,"x"),o()}}function j(t,m){if(t&1&&(a(0,"span",3),h(1,"img",4),o(),a(2,"span"),p(3),o(),u(4,P,2,0,"span",5)),t&2){let e=m.item,i=_();r(),s("src",e==null?null:e.Img,g),r(2),f(" ",e.Name," "),r(),y(i.clearable()?4:-1)}}var Y=(()=>{class t{constructor(){this.authService=S(k),this.multiple=d(!1),this.clearable=d(!0),this.options=this.authService.getChannels(),this.onChange=e=>{}}onChannelChange(e){this.onChange(e)}writeValue(e){this.selectedChannels=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=M({type:t,selectors:[["channel-select-options"]],inputs:{multiple:[1,"multiple"],clearable:[1,"clearable"]},features:[w([{provide:D,multi:!0,useExisting:t}])],decls:3,vars:4,consts:[["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel","multiple"],["ng-option-tmp",""],["ng-label-tmp",""],[1,"me-2"],[2,"width","18px",3,"src"],["aria-hidden","true",1,"ng-value-icon","right"],["aria-hidden","true",1,"ng-value-icon","right",3,"click"]],template:function(i,n){i&1&&(a(0,"ng-select",0),N("ngModelChange",function(l){return T(n.selectedChannels,l)||(n.selectedChannels=l),l}),C("ngModelChange",function(l){return n.onChannelChange(l)}),u(1,z,4,2,"ng-template",1)(2,j,5,3,"ng-template",2),o()),i&2&&(s("clearable",n.clearable())("items",n.options),O("ngModel",n.selectedChannels),s("multiple",n.multiple()))},dependencies:[E,W,U,A,F,L,V,I],encapsulation:2})}}return t})();export{Y as a};
@@ -1 +1 @@
1
- var r=function(e){return e.DashboardView="Dashboard",e.ProductView="ProdV",e.ProductScan="ProdSC",e.ProductDetach="ProdDet",e.ProductDownload="ProdDwn",e.ProductUpload="ProdUpd",e.InventoryView="Iview",e.InventoryUpdate="InventoryUpd",e.PriceView="Pview",e.PriceUpdate="PriceUpd",e.OrderView="OrderView",e.Fulfillment="Fulfillment",e.DownloadOrder="DownloadOrder",e.Report="Report",e.LogisticView="LogView",e.LogisticUpdate="LogUpdate",e.ChannelView="ChannelView",e.ChannelAdd="ChannelAdd",e.ChannelEdit="ChannelEdit",e.ChannelDelete="ChannelDelete",e.DevView="DevView",e.UserView="UsrView",e.UserAdd="UsrCreate",e.UserEdit="UsrEdit",e.UserDelete="UsrDelete",e.JsonApiView="JsonApi",e}(r||{});export{r as a};
1
+ var r=function(e){return e.DashboardView="Dashboard",e.ProductView="ProdV",e.ProductScan="ProdSC",e.ProductDetach="ProdDet",e.ProductDownload="ProdDwn",e.ProductUpload="ProdUpd",e.InventoryView="Iview",e.InventoryUpdate="InventoryUpd",e.PriceView="Pview",e.PriceUpdate="PriceUpd",e.OrderView="OrderView",e.Fulfillment="Fulfillment",e.DownloadOrder="DownloadOrder",e.Report="Report",e.LogisticView="LogView",e.LogisticUpdate="LogUpdate",e.ChannelView="ChannelView",e.ChannelAdd="ChannelAdd",e.ChannelEdit="ChannelEdit",e.ChannelDelete="ChannelDelete",e.DevView="DevView",e.UserView="UsrView",e.UserInvite="UsrCreate",e.UserEdit="UsrEdit",e.UserDelete="UsrDelete",e.JsonApiView="JsonApi",e}(r||{});export{r as a};
@@ -1 +1 @@
1
- import{a as G}from"./chunk-XT4STZN6.js";import"./chunk-YFSXR7TL.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import{a as F}from"./chunk-5HO2IJ47.js";import"./chunk-5JVEEL2T.js";import"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-AEOSNAHH.js";import{e as j}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as H,n as J}from"./chunk-CLER2MX6.js";import{A as R,c as k,h as B,m as W}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{j as D,l as I,n as P}from"./chunk-M2FCTYGU.js";import{$c as b,Gb as S,Gc as i,Hc as N,Kc as g,Lc as f,Mb as x,Mc as C,Nc as O,Oc as V,Pc as _,Ra as w,Yb as m,Z as v,ad as y,dc as M,ic as e,jc as t,kc as L,oc as T,pa as E,rb as p,tc as h,uc as A,ya as d,za as s}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";function Y(n,U){if(n&1&&(e(0,"pre",21),i(1),b(2,"json"),t()),n&2){A();let l=_(25);p(),N(y(2,1,l))}}function q(n,U){n&1&&(e(0,"p",22),i(1," Your data will be shown here once it's available "),t())}var pe=(()=>{class n{constructor(){this.httpService=E(j),this.selectedChannel=w(null),this.orderNumber=w(null)}initEscrowLog(){this.escrowLog$=this.httpService.post(F.GetEscrowDetail,{ChannelID:this.selectedChannel(),OrderNumber:this.orderNumber()}).pipe(v(1))}copyToClipboard(l){if(!l)return;let c=typeof l=="string"?l:JSON.stringify(l,null,2);navigator.clipboard.writeText(c),alert("Copied to clipboard!")}static{this.\u0275fac=function(c){return new(c||n)}}static{this.\u0275cmp=S({type:n,selectors:[["app-escrow-api"]],decls:40,vars:10,consts:[["headerTitle","Origin Escrow Api",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-success","btn-fill","me-3",3,"click"],[1,"fa","fa-search"],[1,"container-fluid","mt-8","px-10"],[1,"row"],[1,"col-7"],[1,"d-flex","align-items-center"],[1,"w-75"],[1,"mb-0","text-muted","fst-italic"],[1,"w-100"],[3,"ngModelChange","ngModel","onlyInputTypeID"],[1,"d-flex","align-items-center","mt-3"],["type","text","placeholder","Order Number or Invoice Number",1,"form-control",3,"ngModelChange","ngModel"],[1,"row","mt-6"],[1,"col-12"],[1,"card"],[1,"card-header","d-flex","justify-content-between","align-items-center"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group","position-relative"],["id","escrowLogText"],[1,"text-center","my-12","text-muted"]],template:function(c,o){if(c&1){let a=T();e(0,"mainpanel",0)(1,"actions")(2,"button",1),h("click",function(){return d(a),s(o.initEscrowLog())}),L(3,"i",2),i(4," Search "),t()(),e(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h6"),i(12,"Channel"),t(),e(13,"p",8),i(14," View logs related to Escrow API "),t()(),e(15,"div",9)(16,"channel-select-options",10),C("ngModelChange",function(r){return d(a),f(o.selectedChannel,r)||(o.selectedChannel=r),s(r)}),t()()(),e(17,"div",11)(18,"div",7)(19,"h6"),i(20,"Order Number"),t(),e(21,"p",8),i(22," Order or Invoice number from Channel. "),t()(),e(23,"div",9)(24,"input",12),C("ngModelChange",function(r){return d(a),f(o.orderNumber,r)||(o.orderNumber=r),s(r)}),t()()()()(),O(25),b(26,"async"),e(27,"div",13)(28,"div",14)(29,"div",15)(30,"div",16)(31,"h5"),i(32,"Response"),t(),e(33,"button",17),h("click",function(){d(a);let r=_(25);return s(o.copyToClipboard(r))}),i(34," Copy "),t()(),e(35,"div",18)(36,"div",19)(37,"div",20),x(38,Y,3,3,"pre",21)(39,q,2,0,"p",22),t()()()()()()()()()}if(c&2){m("hideSearchBox",!0)("hideSearchDropdown",!0),p(16),g("ngModel",o.selectedChannel),m("onlyInputTypeID",5),p(8),g("ngModel",o.orderNumber),p();let a=V(y(26,7,o.escrowLog$));p(8),m("disabled",!a),p(5),M(a?38:39)}},dependencies:[P,D,I,R,k,B,W,J,H,G],styles:[".container-fluid[_ngcontent-%COMP%]{padding-bottom:1rem}#escrowLogText[_ngcontent-%COMP%]{white-space:pre-wrap;word-break:break-word}"]})}}return n})();export{pe as EscrowApiComponent};
1
+ import{a as G}from"./chunk-UCA5RNCO.js";import"./chunk-Q7P5KBPH.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import{a as F}from"./chunk-5HO2IJ47.js";import"./chunk-5JVEEL2T.js";import"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-AEOSNAHH.js";import{e as j}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as H,n as J}from"./chunk-CLER2MX6.js";import{A as R,c as k,h as B,m as W}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{j as D,l as I,n as P}from"./chunk-M2FCTYGU.js";import{$c as b,Gb as S,Gc as i,Hc as N,Kc as g,Lc as f,Mb as x,Mc as C,Nc as O,Oc as V,Pc as _,Ra as w,Yb as m,Z as v,ad as y,dc as M,ic as e,jc as t,kc as L,oc as T,pa as E,rb as p,tc as h,uc as A,ya as d,za as s}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";function Y(n,U){if(n&1&&(e(0,"pre",21),i(1),b(2,"json"),t()),n&2){A();let l=_(25);p(),N(y(2,1,l))}}function q(n,U){n&1&&(e(0,"p",22),i(1," Your data will be shown here once it's available "),t())}var pe=(()=>{class n{constructor(){this.httpService=E(j),this.selectedChannel=w(null),this.orderNumber=w(null)}initEscrowLog(){this.escrowLog$=this.httpService.post(F.GetEscrowDetail,{ChannelID:this.selectedChannel(),OrderNumber:this.orderNumber()}).pipe(v(1))}copyToClipboard(l){if(!l)return;let c=typeof l=="string"?l:JSON.stringify(l,null,2);navigator.clipboard.writeText(c),alert("Copied to clipboard!")}static{this.\u0275fac=function(c){return new(c||n)}}static{this.\u0275cmp=S({type:n,selectors:[["app-escrow-api"]],decls:40,vars:10,consts:[["headerTitle","Origin Escrow Api",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-success","btn-fill","me-3",3,"click"],[1,"fa","fa-search"],[1,"container-fluid","mt-8","px-10"],[1,"row"],[1,"col-7"],[1,"d-flex","align-items-center"],[1,"w-75"],[1,"mb-0","text-muted","fst-italic"],[1,"w-100"],[3,"ngModelChange","ngModel","onlyInputTypeID"],[1,"d-flex","align-items-center","mt-3"],["type","text","placeholder","Order Number or Invoice Number",1,"form-control",3,"ngModelChange","ngModel"],[1,"row","mt-6"],[1,"col-12"],[1,"card"],[1,"card-header","d-flex","justify-content-between","align-items-center"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group","position-relative"],["id","escrowLogText"],[1,"text-center","my-12","text-muted"]],template:function(c,o){if(c&1){let a=T();e(0,"mainpanel",0)(1,"actions")(2,"button",1),h("click",function(){return d(a),s(o.initEscrowLog())}),L(3,"i",2),i(4," Search "),t()(),e(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h6"),i(12,"Channel"),t(),e(13,"p",8),i(14," View logs related to Escrow API "),t()(),e(15,"div",9)(16,"channel-select-options",10),C("ngModelChange",function(r){return d(a),f(o.selectedChannel,r)||(o.selectedChannel=r),s(r)}),t()()(),e(17,"div",11)(18,"div",7)(19,"h6"),i(20,"Order Number"),t(),e(21,"p",8),i(22," Order or Invoice number from Channel. "),t()(),e(23,"div",9)(24,"input",12),C("ngModelChange",function(r){return d(a),f(o.orderNumber,r)||(o.orderNumber=r),s(r)}),t()()()()(),O(25),b(26,"async"),e(27,"div",13)(28,"div",14)(29,"div",15)(30,"div",16)(31,"h5"),i(32,"Response"),t(),e(33,"button",17),h("click",function(){d(a);let r=_(25);return s(o.copyToClipboard(r))}),i(34," Copy "),t()(),e(35,"div",18)(36,"div",19)(37,"div",20),x(38,Y,3,3,"pre",21)(39,q,2,0,"p",22),t()()()()()()()()()}if(c&2){m("hideSearchBox",!0)("hideSearchDropdown",!0),p(16),g("ngModel",o.selectedChannel),m("onlyInputTypeID",5),p(8),g("ngModel",o.orderNumber),p();let a=V(y(26,7,o.escrowLog$));p(8),m("disabled",!a),p(5),M(a?38:39)}},dependencies:[P,D,I,R,k,B,W,J,H,G],styles:[".container-fluid[_ngcontent-%COMP%]{padding-bottom:1rem}#escrowLogText[_ngcontent-%COMP%]{white-space:pre-wrap;word-break:break-word}"]})}}return n})();export{pe as EscrowApiComponent};
@@ -1 +1 @@
1
- import{a as Le}from"./chunk-VKMFDXJJ.js";import{a as Be}from"./chunk-XT4STZN6.js";import{a as De}from"./chunk-CROPN4YC.js";import"./chunk-MHCAI6KP.js";import{a as Me}from"./chunk-3NMM37H7.js";import"./chunk-BFU7VKO3.js";import{b as Ve}from"./chunk-RMCAWPWK.js";import"./chunk-3LRWABHB.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import{a as L}from"./chunk-XHAXYWZ7.js";import{a as Ne,b as ke,c as Oe,d as W}from"./chunk-UDIDZKN6.js";import"./chunk-M5XGP4SG.js";import"./chunk-CIIO2CJ6.js";import"./chunk-H3J5OAIG.js";import"./chunk-AQTXFEBA.js";import{a as Fe}from"./chunk-UAYWO75X.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import{a as Te}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 he}from"./chunk-5DIRXS7I.js";import"./chunk-CMTBBXR5.js";import{a as Ee}from"./chunk-7KG3DC5J.js";import{h as Se}from"./chunk-YFSXR7TL.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import"./chunk-5JVEEL2T.js";import{c as O}from"./chunk-PW42BQIY.js";import{a as fe,b as xe,c as Pe}from"./chunk-SWQXSJ7O.js";import"./chunk-DRMAONR7.js";import"./chunk-AEOSNAHH.js";import{b as ge,e as Ce}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{d as we,m as ve,n as ye}from"./chunk-CLER2MX6.js";import{A as ue,b as me,h as de,m as _e}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{r as Ie,s as be}from"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{d as re,f as ae,g as le,j as ce,m as se,n as pe}from"./chunk-M2FCTYGU.js";import{$c as f,Fc as U,G as B,Gb as Z,Gc as m,Hc as Y,Ic as y,Kc as D,Lc as M,Mb as g,Mc as N,Nc as ee,Oc as te,Pc as A,Qc as ne,Ra as X,Sc as k,Tc as ie,Yb as p,Z as R,ad as I,bd as oe,cd as j,dc as q,ea as J,ec as F,gc as T,hc as V,ic as o,jc as a,kc as P,lc as w,mc as v,oc as S,p as K,pa as $,pb as E,rb as r,tc as C,uc as s,v as H,xb as x,xc as Q,ya as _,za as u}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import{a as G,b as z}from"./chunk-66YHNWRR.js";var Re=n=>[n],$e=n=>({"text-decoration-line-through":n}),Ue=n=>({"border-bottom":n}),Ae=(n,c)=>({"bg-gradient-warning":n,"border pointer cell-hover":c});function je(n,c){if(n&1){let e=S();w(0),o(1,"div")(2,"label",21),m(3,"Channel"),a(),o(4,"channel-select-options",22),N("ngModelChange",function(t){_(e);let l=s();return M(l.searchFilter.ListChannelID,t)||(l.searchFilter.ListChannelID=t),u(t)}),a()(),o(5,"div",23)(6,"label",24),m(7,"Filter by"),a(),o(8,"lib-radio-options",25),N("modelChange",function(t){_(e);let l=s();return M(l.searchFilter.filterModel,t)||(l.searchFilter.filterModel=t),u(t)}),a()(),v()}if(n&2){let e=s();r(4),p("multiple",!0),D("ngModel",e.searchFilter.ListChannelID),r(4),D("model",e.searchFilter.filterModel),p("options",e.filterTypeOptions)}}function We(n,c){if(n&1){let e=S();o(0,"button",27),C("click",function(){_(e);let t=s().ngIf,l=s();return u(l.onUpdateItems(t))}),P(1,"i",28),m(2," Update "),a()}}function Ge(n,c){if(n&1&&(w(0),o(1,"div",4),g(2,We,3,0,"button",26),a(),v()),n&2){let e=c.ngIf,i=s();r(2),p("ngIf",i.productService.hasSelectionVariant(e))}}function ze(n,c){if(n&1&&(o(0,"th",15)(1,"div",29),P(2,"img",30),o(3,"div",31),m(4),f(5,"stringLimit"),a()()()),n&2){let e=c.$implicit;r(),p("matTooltip",(e.Name==null?null:e.Name.length)>20?e.Name:""),r(),p("src",e==null?null:e.Img,E),r(2),y(" ",oe(5,3,e.Name,20)," ")}}function Ke(n,c){if(n&1){let e=S();o(0,"th")(1,"input",32),N("ngModelChange",function(t){_(e);let l=s();return M(l.checkboxState,t)||(l.checkboxState=t),u(t)}),C("ngModelChange",function(){_(e);let t=s();return u(t.onSelectAllData())}),a()()}if(n&2){let e=s();r(),D("ngModel",e.checkboxState)}}function He(n,c){n&1&&(o(0,"th",33)(1,"span"),m(2,"Expected"),a(),o(3,"span",34),m(4,"(POS)"),a()(),o(5,"th",33),m(6,"Channel"),a())}function Je(n,c){if(n&1){let e=S();o(0,"img",47),C("click",function(t){_(e);let l=s(3).$implicit,d=s(2);return u(d.onZoomImage(t,l==null?null:l.ImageUrl))}),a()}if(n&2){let e=s(3).$implicit;Q("src",e==null?null:e.ImageUrl,E)}}function Xe(n,c){n&1&&P(0,"img",48)}function Ze(n,c){if(n&1&&(o(0,"small",46),m(1),a()),n&2){let e=s(3).$implicit;r(),y("(",e==null?null:e.Category,")")}}function qe(n,c){if(n&1&&(w(0),o(1,"td",42),g(2,Je,1,1,"img",43)(3,Xe,1,0,"ng-template",null,0,j),a(),o(5,"td",44)(6,"h5",45),m(7),a(),g(8,Ze,2,1,"small",46),a(),v()),n&2){let e=U(4),i=s().$index,t=s().$implicit,l=s().ngIf;r(),p("rowSpan",t==null?null:t.Variants.length)("ngClass",k(7,Ue,i+1==l.length)),r(),p("ngIf",t==null?null:t.ImageUrl)("ngIfElse",e),r(3),p("rowSpan",t==null?null:t.Variants.length),r(2),Y(t==null?null:t.Name),r(),q(t!=null&&t.Category?8:-1)}}function Qe(n,c){if(n&1){let e=S();o(0,"td",49)(1,"input",32),N("ngModelChange",function(t){_(e);let l=s().$implicit;return M(l.selected,t)||(l.selected=t),u(t)}),a()()}if(n&2){let e=s().$implicit;r(),D("ngModel",e.selected)}}function Ye(n,c){if(n&1){let e=S();w(0),o(1,"td",51),m(2),f(3,"number"),a(),o(4,"td",52),C("click",function(){let t=_(e).$implicit,l=s(2).$implicit,d=s().$implicit,h=s(2),b=A(0);return u(h.openTableDialog(l,d,t,b))}),o(5,"div",53)(6,"div",54),m(7),f(8,"number"),a(),o(9,"a",55),C("click",function(t){return _(e),u(t==null?null:t.stopPropagation())}),P(10,"i",40),a()()(),v()}if(n&2){let e=c.$implicit;s(5);let i=A(0);r(2),y(" ",I(3,4,e.PriceExpected)," "),r(2),p("ngClass",ie(8,Ae,e.Price!=e.PriceExpected,i)),r(3),y(" ",I(8,6,e.Price)," "),r(2),p("href",e.Url,E)}}function et(n,c){n&1&&(o(0,"td",56),m(1," X "),a(),o(2,"td",56),m(3," X "),a())}function tt(n,c){if(n&1&&(w(0),g(1,Ye,11,11,"ng-container",50)(2,et,4,0,"ng-template",null,1,j),v()),n&2){let e=c.$implicit,i=U(3),t=s().$implicit,l=s(3);r(),p("ngIf",l.getItemFromChannel(t,e.ID))("ngIfElse",i)}}function nt(n,c){if(n&1&&(o(0,"tr"),g(1,qe,9,9,"ng-container",3),o(2,"td",35),m(3),a(),o(4,"td",36)(5,"div",37)(6,"div",38),m(7),a(),o(8,"div",31)(9,"a",39),P(10,"i",40),a()()()(),g(11,Qe,2,1,"ng-template",19)(12,tt,4,2,"ng-container",41),a()),n&2){let e=c.$implicit,i=c.$index,t=s(3);r(),p("ngIf",i==0),r(2),y(" ",e==null?null:e.Model," "),r(),p("matTooltip",e.Discontinued?t.discontinuedVariantMsg:""),r(2),p("ngClass",k(8,$e,e.Discontinued)),r(),y(" ",e==null?null:e.Code," "),r(2),p("href",t.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),E),r(2),p("ngxPermissionsOnly",k(10,Re,t.rolePriceEdit)),r(),p("ngForOf",t.channels())}}function it(n,c){if(n&1&&(o(0,"tbody"),T(1,nt,13,12,"tr",null,F),a()),n&2){let e=c.$implicit;r(),V(e.Variants)}}function ot(n,c){if(n&1&&(w(0),T(1,it,3,0,"tbody",null,F),v()),n&2){let e=c.ngIf;r(),V(e)}}var Ut=(()=>{class n{constructor(e,i,t,l,d,h,b){this.http=e,this.toastr=i,this.dialog=t,this.productService=l,this.authService=d,this.biggerPictureService=h,this.paginationService=b,this.infinitePagination=$(W),this.permissionService=$(fe),this.searchFilter=new Ee,this.checkboxState=!1,this.rolePriceEdit=he.PriceUpdate,this.hasRolePriceEdit=K(this.permissionService.hasPermission(this.rolePriceEdit)),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.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.channels=X([]),this.filterTypeOptions=[{Key:L.ALL,Value:"All"},{Key:L.DIFFERENCE,Value:"Difference"}],this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPagination(),this.initChannelTable()}initChannelTable(){let e=this.searchFilter.ListChannelID,i=[];O.IsEmpty(e)||e?.length==0?i=this.channelOptions:i=this.channelOptions.filter(t=>e.findIndex(l=>l==t.ID)>-1),this.channels.update(()=>i)}initPagination(){this.infinitePagination.fetchDataEndpoint="Price/GetOutletPrice",this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.infinitePagination.data$.pipe(R(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(J(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=L.ALL,this.infinitePagination.reloadPagination(this.searchFilter)}),R(1))}onSelectAllData(){this.data$=this.data$.pipe(H(e=>(e.map(i=>(i.Variants&&(i.Variants=i.Variants.map(t=>(t.selected=this.checkboxState,t))),i)),e)))}onFilter(e){this.searchFilter.text=e;let i=z(G({},this.searchFilter),{text:e,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount});this.initChannelTable(),this.infinitePagination.reloadPagination(i)}updatePrice(e){let i=this.productService.selectedVariantProduct(e);if(i.length>0){let t=i.map(h=>h.ID),d={ListChannelID:this.channelOptions.filter(h=>h.selected).map(h=>h.ID),ListID:t};this.http.post("/api/Price/UpdateChannelOutletPrice",d).subscribe({next:h=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+d.ListID.length+" items in "+d.ListChannelID.length+" channels","Success")},error:h=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(e=>(e.selected=!1,e))}getItemFromChannel(e,i){return e.Channel.find(t=>t.ChannelID==i)}onUpdateItems(e){let i=this.productService.selectedVariantProduct(e);this.dialog.open(Me,{data:{title:"Updating Price",selectedItems:i,channels:this.channelOptions},width:"400px"}).afterClosed().pipe(B(t=>O.IsNotEmpty(t))).subscribe(t=>{this.channelOptions=t,this.updatePrice(e)})}openTableDialog(e,i,t,l){if(l){let d=JSON.parse(JSON.stringify(e));this.dialog.open(Ne,{data:{Name:i.Name,Variant:d,ChannelID:t?.ChannelID,Table:"price",ChannelItemID:t?.ChannelItemID}}).afterClosed().pipe(B(b=>O.IsNotEmpty(b))).subscribe(b=>{this.updateProductPrice(b,t)})}}updateProductPrice(e,i){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(l=>{i.Price=t.Price;let d=this.productService.findChannelById(t.ID,this.channelOptions);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) inventory in ${d.Name} to ${t.Price}`,"Success")})}openExportDialog(){this.dialog.open(Ve,{data:{title:"Export Custom Channel Price",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportOutletPrice"}}).afterClosed().subscribe()}onZoomImage(e,i){this.biggerPictureService.openBiggerPicture(e,i)}static{this.\u0275fac=function(i){return new(i||n)(x(Ce),x(ge),x(we),x(Fe),x(Se),x(Te),x(De))}}static{this.\u0275cmp=Z({type:n,selectors:[["app-custom-channel-price"]],features:[ne([W])],decls:40,vars:26,consts:[["elsePic",""],["elseCol",""],["headerTitle","Price Comparison",3,"onSubmit","hideSearchBox","hideSearchDropdown","textButton"],[4,"ngIf"],[1,"d-flex"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"channel-column"],["colspan","5"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","text-uppercase"],["scope","col","colspan","2",1,"text-center","w-25"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[3,"ngxPermissionsOnly"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5",2,"height","46px"],[1,"fw-bold","mb-2","d-block"],["name","filterModel",3,"modelChange","model","options"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],["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"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"text-end","border-top-0","border","w-10"],[1,"ms-1"],[1,"text-start","border-bottom"],["matTooltipPosition","above",1,"text-end","border-bottom",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],[3,"ngClass"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[4,"ngFor","ngForOf"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],[1,"text-start","border-bottom",2,"padding-left","0px",3,"rowSpan"],[1,"mb-0","item-name"],[1,"mt-1"],[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,"align-middle"],[4,"ngIf","ngIfElse"],[1,"text-end","border"],[1,"text-center",3,"click","ngClass"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2"],["target","_blank",3,"click","href"],[1,"table-white","border","text-end",2,"color","red"]],template:function(i,t){if(i&1){let l=S();ee(0),f(1,"async"),o(2,"mainpanel",2),C("onSubmit",function(h){return _(l),u(t.onFilter(h))}),o(3,"filters"),g(4,je,9,4,"ng-container",3),f(5,"async"),a(),o(6,"actions")(7,"div",4),g(8,Ge,3,1,"ng-container",3),f(9,"async"),o(10,"button",5),C("click",function(){return _(l),u(t.openExportDialog())}),P(11,"i",6),o(12,"span"),m(13,"Export"),a()()()(),o(14,"content")(15,"div",7)(16,"div",8)(17,"div",9)(18,"div",10)(19,"table",11)(20,"thead",12)(21,"tr",13),P(22,"th",14),T(23,ze,6,6,"th",15,F),a(),o(25,"tr")(26,"th",16)(27,"span"),m(28," Product "),a()(),o(29,"th",17),m(30,"Variant"),a(),o(31,"th",18),m(32,"SKU"),a(),g(33,Ke,2,1,"ng-template",19),T(34,He,7,0,null,null,F),a()(),g(36,ot,3,0,"ng-container",3),f(37,"async"),a(),o(38,"infinite-paginator",20),f(39,"async"),C("onNextPage",function(){return _(l),u(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){return _(l),u(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){return _(l),u(t.infinitePagination.getRowCount(t.searchFilter))}),a()()()()()()()}i&2&&(te(I(1,13,t.hasRolePriceEdit)),r(2),p("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),r(2),p("ngIf",I(5,16,t.loader$)),r(4),p("ngIf",I(9,18,t.data$)),r(15),V(t.channels()),r(10),p("ngxPermissionsOnly",k(24,Re,t.rolePriceEdit)),r(),V(t.channels()),r(2),p("ngIf",I(37,20,t.data$)),r(2),p("totalData",t.infinitePagination.totalData())("hideCount",t.infinitePagination.hideCount())("rowCount",I(39,22,t.infinitePagination.totalRowCount$))("pageNumber",t.infinitePagination.pageNumber())("disableNextButton",t.infinitePagination.disableNextButton())("goToLastPage",t.infinitePagination.isLastPage()))},dependencies:[pe,re,ae,le,ce,se,ye,ve,ue,me,de,_e,Oe,Le,be,Ie,ke,Pe,xe,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%]{font-weight:400;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}"]})}}return n})();export{Ut as CustomChannelPriceComponent};
1
+ import{a as Le}from"./chunk-VKMFDXJJ.js";import{a as Be}from"./chunk-UCA5RNCO.js";import{a as De}from"./chunk-CROPN4YC.js";import"./chunk-MHCAI6KP.js";import{a as Me}from"./chunk-3NMM37H7.js";import"./chunk-BFU7VKO3.js";import{b as Ve}from"./chunk-RMCAWPWK.js";import"./chunk-3LRWABHB.js";import"./chunk-74IXJYWO.js";import"./chunk-G47XGOST.js";import{a as L}from"./chunk-XHAXYWZ7.js";import{a as Ne,b as ke,c as Oe,d as W}from"./chunk-5BSS4CVK.js";import"./chunk-M5XGP4SG.js";import"./chunk-CIIO2CJ6.js";import"./chunk-H3J5OAIG.js";import"./chunk-AQTXFEBA.js";import{a as Fe}from"./chunk-Z6AT4GBY.js";import"./chunk-SDUUFQUI.js";import"./chunk-IL5JIRWJ.js";import{a as Te}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 he}from"./chunk-UMP6ZMEJ.js";import"./chunk-CMTBBXR5.js";import{a as Ee}from"./chunk-7KG3DC5J.js";import{h as Se}from"./chunk-Q7P5KBPH.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-5HO2IJ47.js";import"./chunk-5JVEEL2T.js";import{c as O}from"./chunk-PW42BQIY.js";import{a as fe,b as xe,c as Pe}from"./chunk-SWQXSJ7O.js";import"./chunk-DRMAONR7.js";import"./chunk-AEOSNAHH.js";import{b as ge,e as Ce}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{d as we,m as ve,n as ye}from"./chunk-CLER2MX6.js";import{A as ue,b as me,h as de,m as _e}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{r as Ie,s as be}from"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{d as re,f as ae,g as le,j as ce,m as se,n as pe}from"./chunk-M2FCTYGU.js";import{$c as f,Fc as U,G as B,Gb as Z,Gc as m,Hc as Y,Ic as y,Kc as D,Lc as M,Mb as g,Mc as N,Nc as ee,Oc as te,Pc as A,Qc as ne,Ra as X,Sc as k,Tc as ie,Yb as p,Z as R,ad as I,bd as oe,cd as j,dc as q,ea as J,ec as F,gc as T,hc as V,ic as o,jc as a,kc as P,lc as w,mc as v,oc as S,p as K,pa as $,pb as E,rb as r,tc as C,uc as s,v as H,xb as x,xc as Q,ya as _,za as u}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import{a as G,b as z}from"./chunk-66YHNWRR.js";var Re=n=>[n],$e=n=>({"text-decoration-line-through":n}),Ue=n=>({"border-bottom":n}),Ae=(n,c)=>({"bg-gradient-warning":n,"border pointer cell-hover":c});function je(n,c){if(n&1){let e=S();w(0),o(1,"div")(2,"label",21),m(3,"Channel"),a(),o(4,"channel-select-options",22),N("ngModelChange",function(t){_(e);let l=s();return M(l.searchFilter.ListChannelID,t)||(l.searchFilter.ListChannelID=t),u(t)}),a()(),o(5,"div",23)(6,"label",24),m(7,"Filter by"),a(),o(8,"lib-radio-options",25),N("modelChange",function(t){_(e);let l=s();return M(l.searchFilter.filterModel,t)||(l.searchFilter.filterModel=t),u(t)}),a()(),v()}if(n&2){let e=s();r(4),p("multiple",!0),D("ngModel",e.searchFilter.ListChannelID),r(4),D("model",e.searchFilter.filterModel),p("options",e.filterTypeOptions)}}function We(n,c){if(n&1){let e=S();o(0,"button",27),C("click",function(){_(e);let t=s().ngIf,l=s();return u(l.onUpdateItems(t))}),P(1,"i",28),m(2," Update "),a()}}function Ge(n,c){if(n&1&&(w(0),o(1,"div",4),g(2,We,3,0,"button",26),a(),v()),n&2){let e=c.ngIf,i=s();r(2),p("ngIf",i.productService.hasSelectionVariant(e))}}function ze(n,c){if(n&1&&(o(0,"th",15)(1,"div",29),P(2,"img",30),o(3,"div",31),m(4),f(5,"stringLimit"),a()()()),n&2){let e=c.$implicit;r(),p("matTooltip",(e.Name==null?null:e.Name.length)>20?e.Name:""),r(),p("src",e==null?null:e.Img,E),r(2),y(" ",oe(5,3,e.Name,20)," ")}}function Ke(n,c){if(n&1){let e=S();o(0,"th")(1,"input",32),N("ngModelChange",function(t){_(e);let l=s();return M(l.checkboxState,t)||(l.checkboxState=t),u(t)}),C("ngModelChange",function(){_(e);let t=s();return u(t.onSelectAllData())}),a()()}if(n&2){let e=s();r(),D("ngModel",e.checkboxState)}}function He(n,c){n&1&&(o(0,"th",33)(1,"span"),m(2,"Expected"),a(),o(3,"span",34),m(4,"(POS)"),a()(),o(5,"th",33),m(6,"Channel"),a())}function Je(n,c){if(n&1){let e=S();o(0,"img",47),C("click",function(t){_(e);let l=s(3).$implicit,d=s(2);return u(d.onZoomImage(t,l==null?null:l.ImageUrl))}),a()}if(n&2){let e=s(3).$implicit;Q("src",e==null?null:e.ImageUrl,E)}}function Xe(n,c){n&1&&P(0,"img",48)}function Ze(n,c){if(n&1&&(o(0,"small",46),m(1),a()),n&2){let e=s(3).$implicit;r(),y("(",e==null?null:e.Category,")")}}function qe(n,c){if(n&1&&(w(0),o(1,"td",42),g(2,Je,1,1,"img",43)(3,Xe,1,0,"ng-template",null,0,j),a(),o(5,"td",44)(6,"h5",45),m(7),a(),g(8,Ze,2,1,"small",46),a(),v()),n&2){let e=U(4),i=s().$index,t=s().$implicit,l=s().ngIf;r(),p("rowSpan",t==null?null:t.Variants.length)("ngClass",k(7,Ue,i+1==l.length)),r(),p("ngIf",t==null?null:t.ImageUrl)("ngIfElse",e),r(3),p("rowSpan",t==null?null:t.Variants.length),r(2),Y(t==null?null:t.Name),r(),q(t!=null&&t.Category?8:-1)}}function Qe(n,c){if(n&1){let e=S();o(0,"td",49)(1,"input",32),N("ngModelChange",function(t){_(e);let l=s().$implicit;return M(l.selected,t)||(l.selected=t),u(t)}),a()()}if(n&2){let e=s().$implicit;r(),D("ngModel",e.selected)}}function Ye(n,c){if(n&1){let e=S();w(0),o(1,"td",51),m(2),f(3,"number"),a(),o(4,"td",52),C("click",function(){let t=_(e).$implicit,l=s(2).$implicit,d=s().$implicit,h=s(2),b=A(0);return u(h.openTableDialog(l,d,t,b))}),o(5,"div",53)(6,"div",54),m(7),f(8,"number"),a(),o(9,"a",55),C("click",function(t){return _(e),u(t==null?null:t.stopPropagation())}),P(10,"i",40),a()()(),v()}if(n&2){let e=c.$implicit;s(5);let i=A(0);r(2),y(" ",I(3,4,e.PriceExpected)," "),r(2),p("ngClass",ie(8,Ae,e.Price!=e.PriceExpected,i)),r(3),y(" ",I(8,6,e.Price)," "),r(2),p("href",e.Url,E)}}function et(n,c){n&1&&(o(0,"td",56),m(1," X "),a(),o(2,"td",56),m(3," X "),a())}function tt(n,c){if(n&1&&(w(0),g(1,Ye,11,11,"ng-container",50)(2,et,4,0,"ng-template",null,1,j),v()),n&2){let e=c.$implicit,i=U(3),t=s().$implicit,l=s(3);r(),p("ngIf",l.getItemFromChannel(t,e.ID))("ngIfElse",i)}}function nt(n,c){if(n&1&&(o(0,"tr"),g(1,qe,9,9,"ng-container",3),o(2,"td",35),m(3),a(),o(4,"td",36)(5,"div",37)(6,"div",38),m(7),a(),o(8,"div",31)(9,"a",39),P(10,"i",40),a()()()(),g(11,Qe,2,1,"ng-template",19)(12,tt,4,2,"ng-container",41),a()),n&2){let e=c.$implicit,i=c.$index,t=s(3);r(),p("ngIf",i==0),r(2),y(" ",e==null?null:e.Model," "),r(),p("matTooltip",e.Discontinued?t.discontinuedVariantMsg:""),r(2),p("ngClass",k(8,$e,e.Discontinued)),r(),y(" ",e==null?null:e.Code," "),r(2),p("href",t.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),E),r(2),p("ngxPermissionsOnly",k(10,Re,t.rolePriceEdit)),r(),p("ngForOf",t.channels())}}function it(n,c){if(n&1&&(o(0,"tbody"),T(1,nt,13,12,"tr",null,F),a()),n&2){let e=c.$implicit;r(),V(e.Variants)}}function ot(n,c){if(n&1&&(w(0),T(1,it,3,0,"tbody",null,F),v()),n&2){let e=c.ngIf;r(),V(e)}}var Ut=(()=>{class n{constructor(e,i,t,l,d,h,b){this.http=e,this.toastr=i,this.dialog=t,this.productService=l,this.authService=d,this.biggerPictureService=h,this.paginationService=b,this.infinitePagination=$(W),this.permissionService=$(fe),this.searchFilter=new Ee,this.checkboxState=!1,this.rolePriceEdit=he.PriceUpdate,this.hasRolePriceEdit=K(this.permissionService.hasPermission(this.rolePriceEdit)),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.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.channels=X([]),this.filterTypeOptions=[{Key:L.ALL,Value:"All"},{Key:L.DIFFERENCE,Value:"Difference"}],this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPagination(),this.initChannelTable()}initChannelTable(){let e=this.searchFilter.ListChannelID,i=[];O.IsEmpty(e)||e?.length==0?i=this.channelOptions:i=this.channelOptions.filter(t=>e.findIndex(l=>l==t.ID)>-1),this.channels.update(()=>i)}initPagination(){this.infinitePagination.fetchDataEndpoint="Price/GetOutletPrice",this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.infinitePagination.data$.pipe(R(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(J(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=L.ALL,this.infinitePagination.reloadPagination(this.searchFilter)}),R(1))}onSelectAllData(){this.data$=this.data$.pipe(H(e=>(e.map(i=>(i.Variants&&(i.Variants=i.Variants.map(t=>(t.selected=this.checkboxState,t))),i)),e)))}onFilter(e){this.searchFilter.text=e;let i=z(G({},this.searchFilter),{text:e,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount});this.initChannelTable(),this.infinitePagination.reloadPagination(i)}updatePrice(e){let i=this.productService.selectedVariantProduct(e);if(i.length>0){let t=i.map(h=>h.ID),d={ListChannelID:this.channelOptions.filter(h=>h.selected).map(h=>h.ID),ListID:t};this.http.post("/api/Price/UpdateChannelOutletPrice",d).subscribe({next:h=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+d.ListID.length+" items in "+d.ListChannelID.length+" channels","Success")},error:h=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(e=>(e.selected=!1,e))}getItemFromChannel(e,i){return e.Channel.find(t=>t.ChannelID==i)}onUpdateItems(e){let i=this.productService.selectedVariantProduct(e);this.dialog.open(Me,{data:{title:"Updating Price",selectedItems:i,channels:this.channelOptions},width:"400px"}).afterClosed().pipe(B(t=>O.IsNotEmpty(t))).subscribe(t=>{this.channelOptions=t,this.updatePrice(e)})}openTableDialog(e,i,t,l){if(l){let d=JSON.parse(JSON.stringify(e));this.dialog.open(Ne,{data:{Name:i.Name,Variant:d,ChannelID:t?.ChannelID,Table:"price",ChannelItemID:t?.ChannelItemID}}).afterClosed().pipe(B(b=>O.IsNotEmpty(b))).subscribe(b=>{this.updateProductPrice(b,t)})}}updateProductPrice(e,i){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(l=>{i.Price=t.Price;let d=this.productService.findChannelById(t.ID,this.channelOptions);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) inventory in ${d.Name} to ${t.Price}`,"Success")})}openExportDialog(){this.dialog.open(Ve,{data:{title:"Export Custom Channel Price",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportOutletPrice"}}).afterClosed().subscribe()}onZoomImage(e,i){this.biggerPictureService.openBiggerPicture(e,i)}static{this.\u0275fac=function(i){return new(i||n)(x(Ce),x(ge),x(we),x(Fe),x(Se),x(Te),x(De))}}static{this.\u0275cmp=Z({type:n,selectors:[["app-custom-channel-price"]],features:[ne([W])],decls:40,vars:26,consts:[["elsePic",""],["elseCol",""],["headerTitle","Price Comparison",3,"onSubmit","hideSearchBox","hideSearchDropdown","textButton"],[4,"ngIf"],[1,"d-flex"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"channel-column"],["colspan","5"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","text-uppercase"],["scope","col","colspan","2",1,"text-center","w-25"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[3,"ngxPermissionsOnly"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5",2,"height","46px"],[1,"fw-bold","mb-2","d-block"],["name","filterModel",3,"modelChange","model","options"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],["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"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"text-end","border-top-0","border","w-10"],[1,"ms-1"],[1,"text-start","border-bottom"],["matTooltipPosition","above",1,"text-end","border-bottom",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],[3,"ngClass"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[4,"ngFor","ngForOf"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],[1,"text-start","border-bottom",2,"padding-left","0px",3,"rowSpan"],[1,"mb-0","item-name"],[1,"mt-1"],[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,"align-middle"],[4,"ngIf","ngIfElse"],[1,"text-end","border"],[1,"text-center",3,"click","ngClass"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2"],["target","_blank",3,"click","href"],[1,"table-white","border","text-end",2,"color","red"]],template:function(i,t){if(i&1){let l=S();ee(0),f(1,"async"),o(2,"mainpanel",2),C("onSubmit",function(h){return _(l),u(t.onFilter(h))}),o(3,"filters"),g(4,je,9,4,"ng-container",3),f(5,"async"),a(),o(6,"actions")(7,"div",4),g(8,Ge,3,1,"ng-container",3),f(9,"async"),o(10,"button",5),C("click",function(){return _(l),u(t.openExportDialog())}),P(11,"i",6),o(12,"span"),m(13,"Export"),a()()()(),o(14,"content")(15,"div",7)(16,"div",8)(17,"div",9)(18,"div",10)(19,"table",11)(20,"thead",12)(21,"tr",13),P(22,"th",14),T(23,ze,6,6,"th",15,F),a(),o(25,"tr")(26,"th",16)(27,"span"),m(28," Product "),a()(),o(29,"th",17),m(30,"Variant"),a(),o(31,"th",18),m(32,"SKU"),a(),g(33,Ke,2,1,"ng-template",19),T(34,He,7,0,null,null,F),a()(),g(36,ot,3,0,"ng-container",3),f(37,"async"),a(),o(38,"infinite-paginator",20),f(39,"async"),C("onNextPage",function(){return _(l),u(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){return _(l),u(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){return _(l),u(t.infinitePagination.getRowCount(t.searchFilter))}),a()()()()()()()}i&2&&(te(I(1,13,t.hasRolePriceEdit)),r(2),p("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),r(2),p("ngIf",I(5,16,t.loader$)),r(4),p("ngIf",I(9,18,t.data$)),r(15),V(t.channels()),r(10),p("ngxPermissionsOnly",k(24,Re,t.rolePriceEdit)),r(),V(t.channels()),r(2),p("ngIf",I(37,20,t.data$)),r(2),p("totalData",t.infinitePagination.totalData())("hideCount",t.infinitePagination.hideCount())("rowCount",I(39,22,t.infinitePagination.totalRowCount$))("pageNumber",t.infinitePagination.pageNumber())("disableNextButton",t.infinitePagination.disableNextButton())("goToLastPage",t.infinitePagination.isLastPage()))},dependencies:[pe,re,ae,le,ce,se,ye,ve,ue,me,de,_e,Oe,Le,be,Ie,ke,Pe,xe,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%]{font-weight:400;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}"]})}}return n})();export{Ut as CustomChannelPriceComponent};
@@ -0,0 +1 @@
1
+ import{a as t}from"./chunk-UMP6ZMEJ.js";import{a as u,b as c}from"./chunk-7PN4XLNE.js";import"./chunk-SWQXSJ7O.js";import"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{F as s,J as p,n as d}from"./chunk-M2FCTYGU.js";import{Gb as i,Yb as l,ic as a,jc as m,kc as r,rb as n}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var w=(()=>{class e{constructor(){this.tabs=[{Title:"All",Url:"/menu/orderV2/all"},{Title:"To Ship",Url:"/menu/orderV2/to-ship"},{Title:"Awaiting Collection",Url:"/menu/orderV2/awaiting-collection"},{Title:"Shipped",Url:"/menu/orderV2/shipped"},{Title:"Completed",Url:"/menu/orderV2/completed"},{Title:"Cancelled",Url:"/menu/orderV2/cancelled"},{Title:"Download",Url:"/menu/orderV2/download",Permissions:[t.DownloadOrder]},{Title:"Log",Url:"/menu/orderV2/log",Permissions:[t.DownloadOrder]}]}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=i({type:e,selectors:[["app-orders-v2"]],decls:5,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs","usePermissions"]],template:function(o,v){o&1&&(a(0,"nav",0)(1,"div",1)(2,"div"),r(3,"nav-tab",2),m()()(),r(4,"router-outlet")),o&2&&(n(3),l("Tabs",v.tabs)("usePermissions",!0))},dependencies:[d,p,s,c,u],encapsulation:2})}}return e})();export{w as OrdersV2Component};
@@ -0,0 +1 @@
1
+ import{a as fe,b as Ce,c as _e}from"./chunk-V5BKQSAT.js";import{a as ge}from"./chunk-GVULJZIG.js";import{a as ce}from"./chunk-UCA5RNCO.js";import{a as ue}from"./chunk-66MLRB2J.js";import"./chunk-M5JQ7BGW.js";import{a as se}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 pe}from"./chunk-WPW3D4MQ.js";import{g as re}from"./chunk-Q7P5KBPH.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import{a as oe}from"./chunk-5HO2IJ47.js";import"./chunk-5JVEEL2T.js";import"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-AEOSNAHH.js";import{e as ne}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as me,n as de}from"./chunk-CLER2MX6.js";import{A as ie,c as Z,h as $,m as ee,o as te}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{r as le,s as ae}from"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{j as K,k as Q,m as X,n as Y}from"./chunk-M2FCTYGU.js";import{$c as y,Gb as W,Gc as a,Hc as w,Ic as V,Kc as _,Lc as g,Mb as x,Mc as h,Nc as j,Oc as H,Pc as U,Qc as G,Ra as F,Sc as q,Yb as u,Z as k,ac as B,ad as E,bd as J,dc as b,ec as z,gc as A,hc as R,ic as t,ja as D,jc as i,kc as f,oc as T,pa as v,pb as I,rb as l,tc as M,uc as C,v as N,ya as p,za as s}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import{a as L,b as O}from"./chunk-66YHNWRR.js";var P=(()=>{class n{constructor(){this.httpService=v(ne)}getCompletedOrders(e){return this.httpService.post(oe.GetCompleted,e).pipe(N(m=>m?.Data||[]))}static{this.\u0275fac=function(m){return new(m||n)}}static{this.\u0275prov=D({token:n,factory:n.\u0275fac})}}return n})();var Se=n=>({"td-cell-hover":n});function ve(n,S){if(n&1&&f(0,"variants-dropdown",29),n&2){let e=C().$implicit;u("variants",e==null?null:e.Variants)}}function we(n,S){if(n&1&&f(0,"variant-with-image",30),n&2){let e=C().$implicit;u("variant",e==null?null:e.Variants[0])}}function ye(n,S){if(n&1&&(t(0,"span"),a(1),i()),n&2){let e=C().$implicit;l(),V("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function xe(n,S){if(n&1&&(t(0,"tr")(1,"td"),a(2),i(),t(3,"td")(4,"div",25)(5,"div",26)(6,"div"),f(7,"img",27),y(8,"channelImage"),i(),t(9,"div"),f(10,"order-link",28),i()(),t(11,"small"),a(12),y(13,"date"),i()()(),t(14,"td"),a(15),i(),t(16,"td"),x(17,ve,1,1,"variants-dropdown",29)(18,we,1,1,"variant-with-image",30),i(),t(19,"td",31),a(20),y(21,"number"),i(),t(22,"td")(23,"div",25)(24,"div",26)(25,"span"),a(26),i(),x(27,ye,2,1,"span"),i(),t(28,"small"),a(29),i()()()()),n&2){let e=S.$implicit;l(2),w(e.Outlet),l(5),u("src",E(8,13,e==null?null:e.MarketType),I)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),l(3),u("order",e),l(2),V(" ",J(13,15,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),l(3),w(e.Customer),l(),B(q(20,Se,(e.Variants==null?null:e.Variants.length)>1)),l(),b((e.Variants==null?null:e.Variants.length)>1?17:18),l(3),w(E(21,18,e.Amount)),l(6),w(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),l(),b(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?27:-1),l(2),V(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," ")}}function be(n,S){if(n&1){let e=T();t(0,"div",15)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),a(5,"Outlet"),i(),t(6,"th",21),a(7,"Number"),i(),t(8,"th",21),a(9,"Customer"),i(),t(10,"th"),a(11,"Items"),i(),t(12,"th",22),a(13,"Amount"),i(),t(14,"th",23),a(15,"Shipping"),i()()(),t(16,"tbody"),A(17,xe,30,22,"tr",null,z),i()(),t(19,"app-custom-paginator",24),M("next",function(){p(e);let o=C();return s(o.initCompletedOrders())})("previous",function(){p(e);let o=C();return s(o.initCompletedOrders())}),i()()}if(n&2){let e=C(),m=U(0);l(17),R(m),l(2),u("filter",e.filter())("totaldata",m==null?null:m.length)}}function Ve(n,S){n&1&&(t(0,"div",16),f(1,"app-empty-state"),i())}var et=(()=>{class n{constructor(){this.completedService=v(P),this.tokenService=v(re),this.filter=F({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){let e=this.tokenService.getTokenValue(),m=Number(e?.orddfl??0),o=new Date,d=m===0?null:new Date(o.setDate(o.getDate()-m));this.filter.update(c=>O(L({},c),{From:d})),this.initCompletedOrders()}initCompletedOrders(){this.completedOrders$=this.completedService.getCompletedOrders(this.filter()).pipe(k(1))}getOrderDefaultValue(){return this.tokenService.getTokenValue()?.orddfl??null}static{this.\u0275fac=function(m){return new(m||n)}}static{this.\u0275cmp=W({type:n,selectors:[["app-completed"]],features:[G([P])],decls:34,vars:11,consts:[["headerTitle","Completed","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-regular","fa-tv","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","100px"],[2,"width","250px"],[1,"text-end",2,"width","150px"],[2,"width","150px"],["rowCountApi","/api/orders/completedcount",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"],[2,"font-size","14px",3,"order"],[3,"variants"],[3,"variant"],[1,"text-end"]],template:function(m,o){if(m&1){let d=T();j(0),y(1,"async"),t(2,"mainpanel",0),M("onSubmit",function(){return p(d),s(o.initCompletedOrders())}),h("textChange",function(r){return p(d),g(o.filter().Number,r)||(o.filter().Number=r),s(r)}),t(3,"actions")(4,"a",1),f(5,"i",2),t(6,"span"),a(7,"Order Fulfillment Display"),i()()(),t(8,"filters")(9,"div")(10,"label",3),a(11,"From/To"),i(),t(12,"channel-select-options",4),h("ngModelChange",function(r){return p(d),g(o.filter().ListChannelID,r)||(o.filter().ListChannelID=r),s(r)}),i()(),t(13,"div",5)(14,"label",3),a(15,"From/To"),i(),t(16,"div",6)(17,"datepicker",7),h("dateChange",function(r){return p(d),g(o.filter().From,r)||(o.filter().From=r),s(r)}),i()(),t(18,"div")(19,"datepicker",8),h("dateChange",function(r){return p(d),g(o.filter().To,r)||(o.filter().To=r),s(r)}),i()()(),t(20,"div",5)(21,"label",9),a(22,"Page Number"),i(),t(23,"input",10),h("ngModelChange",function(r){return p(d),g(o.filter().PageNumber,r)||(o.filter().PageNumber=r),s(r)}),i()(),t(24,"div",5)(25,"label",9),a(26,"Page Size"),i(),t(27,"input",11),h("ngModelChange",function(r){return p(d),g(o.filter().PageSize,r)||(o.filter().PageSize=r),s(r)}),i()()(),t(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),x(32,be,20,2,"div",15)(33,Ve,2,0,"div",16),i()()()()()}if(m&2){let d=H(E(1,8,o.completedOrders$));l(2),_("text",o.filter().Number),l(10),u("multiple",!0),_("ngModel",o.filter().ListChannelID),l(5),_("date",o.filter().From),l(2),_("date",o.filter().To),l(4),_("ngModel",o.filter().PageNumber),l(4),_("ngModel",o.filter().PageSize),l(5),b((d==null?null:d.length)>0?32:33)}},dependencies:[Y,K,X,Q,de,me,se,pe,ie,Z,te,$,ee,fe,Ce,_e,ue,ce,ae,le,ge],encapsulation:2})}}return n})();export{et as CompletedComponent};
@@ -1 +1 @@
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};
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-UMP6ZMEJ.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};
@@ -1,4 +1,4 @@
1
- import{a as ne,b as oe,c as re,d as ae,e as le,f as pe,g as se}from"./chunk-6W6DKFRE.js";import{b as ie}from"./chunk-7UHCDGAA.js";import"./chunk-G47XGOST.js";import"./chunk-IL5JIRWJ.js";import"./chunk-3BT5DR3X.js";import{a as X}from"./chunk-T6LQ7WTR.js";import{a as Y,b as Z}from"./chunk-HYJVHRMN.js";import"./chunk-CMTBBXR5.js";import{h as Q}from"./chunk-YFSXR7TL.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{e as J}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as ee,n as te}from"./chunk-CLER2MX6.js";import{A as q,c as G,h as z,m as K}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{F as W,H as j,J as $,f as x,g as V,h as A,n as H}from"./chunk-M2FCTYGU.js";import{Fc as v,Gb as C,Gc as p,Hb as k,Hc as B,Ic as L,Ka as M,Kc as O,Lc as F,Mb as m,Mc as R,Qc as P,Sc as w,Yb as l,ic as n,ja as I,jc as i,ka as T,kc as c,lc as f,mc as _,oa as U,ob as N,oc as S,rb as a,tc as y,uc as d,xb as D,ya as g,za as h}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var _e=e=>[e];function ge(e,s){if(e&1&&(f(0),n(1,"a",9),p(2),i(),_()),e&2){let t=s.$implicit;a(),l("routerLink",w(2,_e,t.url)),a(),L(" ",t.title,"")}}var ce=(()=>{class e{constructor(){this.tabs=[{Title:"Download By Url",Url:"/menu/products/download/by-url",Description:"Download products information by product URL as a parameter"}],this.moreMenu=[{title:"Sold In Channel",url:"/menu/products/status/sold-in-channel"},{title:"In POS",url:"/menu/products/status/in-pos"},{title:"Not In Channel",url:"/menu/products/status/not-in-channel"},{title:"Duplicate SKU",url:"/menu/products/status/duplicate-sku"}]}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=C({type:e,selectors:[["app-download"]],standalone:!1,decls:12,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-block"],[4,"ngFor","ngForOf"],[1,"dropdown-item",3,"routerLink"]],template:function(o,r){o&1&&(n(0,"nav",0)(1,"div",1)(2,"div"),c(3,"nav-tab",2),i()(),n(4,"div")(5,"div",3)(6,"a",4),c(7,"i",5),i(),n(8,"div",6)(9,"div",7),m(10,ge,3,4,"ng-container",8),i()()()()(),c(11,"router-outlet")),o&2&&(a(3),l("Tabs",r.tabs),a(7),l("ngForOf",r.moreMenu))},dependencies:[x,Y,W,j],encapsulation:2})}}return e})();var E=(()=>{class e{constructor(t){this.httpService=t}download(t){return this.httpService.post("/api/Product/downloadurl",t)}static{this.\u0275fac=function(o){return new(o||e)(U(J))}}static{this.\u0275prov=I({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var Se=e=>({"background-color":e});function Ce(e,s){if(e&1&&(n(0,"th"),p(1),i()),e&2){let t=s.$implicit;a(),B(t.column)}}function ye(e,s){if(e&1&&(f(0),n(1,"td"),c(2,"span",6),i(),_()),e&2){let t=s.$implicit,o=d().$implicit;a(2),l("innerHTML",o[t.prop],N)}}function ve(e,s){if(e&1&&(n(0,"tr",5),m(1,ye,3,1,"ng-container",3),i()),e&2){let t=s.$implicit,o=d();l("ngStyle",w(2,Se,t.Status>200?"#F4D6D5":"#DEE9C9")),a(),l("ngForOf",o.configs)}}var de=(()=>{class e{constructor(){this.eventClose=new M}ngOnInit(){}onClose(){this.eventClose.emit()}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=C({type:e,selectors:[["app-response-api-list"]],inputs:{configs:"configs",data:"data",status:"status"},outputs:{eventClose:"onClose"},standalone:!1,decls:7,vars:2,consts:[[1,"table-responsive"],[1,"table"],[1,"thead-light"],[4,"ngFor","ngForOf"],[3,"ngStyle",4,"ngFor","ngForOf"],[3,"ngStyle"],[3,"innerHTML"]],template:function(o,r){o&1&&(n(0,"div",0)(1,"table",1)(2,"thead",2)(3,"tr"),m(4,Ce,2,1,"th",3),i()(),n(5,"tbody"),m(6,ve,2,4,"tr",4),i()()()),o&2&&(a(4),l("ngForOf",r.configs),a(2),l("ngForOf",r.data))},dependencies:[x,A],encapsulation:2})}}return e})();function xe(e,s){if(e&1){let t=S();f(0),n(1,"button",15),y("click",function(){g(t);let r=d(),u=v(11);return h(r.onNewStepperState(u))}),c(2,"i",16),p(3," New "),i(),_()}}function be(e,s){if(e&1){let t=S();f(0),n(1,"button",15),y("click",function(){g(t),d();let r=v(11);return h(r.previous())}),p(2," Back "),i(),_()}}function Ee(e,s){if(e&1){let t=S();f(0),n(1,"button",17),y("click",function(){g(t);let r=d(),u=v(11);return h(r.onStepperNext(u))}),p(2," Next "),i(),_()}}function De(e,s){if(e&1){let t=S();f(0),n(1,"button",18),y("click",function(){g(t);let r=d(),u=v(11);return h(r.onSubmit(u))}),p(2,"Download"),i(),_()}if(e&2){let t=d();a(),l("disabled",!t.urls)}}function Ie(e,s){e&1&&(c(0,"i",19),n(1,"span"),p(2,"Instruction"),i())}function Te(e,s){e&1&&(n(0,"div",20)(1,"div",21)(2,"div",22)(3,"h4",23),p(4,"Note"),i()(),n(5,"div",24)(6,"ol",25)(7,"li"),p(8," Use this form to Download Products from Tokopedia using product URL "),i(),n(9,"li"),p(10," Copy Product URL from "),n(11,"a",26),p(12,"https://seller.tokopedia.com/ "),i(),p(13," and paste in this form "),i(),n(14,"li"),p(15," Use New Line when you want to input several product URLs "),i()()()()())}function Ue(e,s){e&1&&(c(0,"i",27),n(1,"span"),p(2,"Download"),i())}function Me(e,s){if(e&1){let t=S();n(0,"div",20)(1,"textarea",28),R("ngModelChange",function(r){g(t);let u=d();return F(u.urls,r)||(u.urls=r),h(r)}),i()()}if(e&2){let t=d();a(),l("placeholder",t.urlPlaceholder),O("ngModel",t.urls)}}function Ne(e,s){e&1&&(c(0,"i",29),n(1,"span"),p(2,"Finish"),i())}function ke(e,s){if(e&1&&(n(0,"div",20),c(1,"app-response-api-list",30),i()),e&2){let t=d();a(),l("data",t.downloadResponses)("configs",t.configs)}}function Be(e,s){e&1&&(n(0,"h6"),p(1,"1"),i())}function Le(e,s){e&1&&(n(0,"h6"),p(1,"2"),i())}function Oe(e,s){e&1&&(n(0,"h6"),p(1,"3"),i())}var ue=(()=>{class e{constructor(t,o){this.downloadService=t,this.authService=o,this.configs=[{column:"Url",prop:"URL"},{column:"POS",prop:"Name"},{column:"Exception",prop:"Message"}],this.downloadResponses=[],this.stepperState="DOWNLOAD",this.urlPlaceholder=`https://tokopedia.com/tokoriyanadi/kaos-polos-biru
1
+ import{a as ne,b as oe,c as re,d as ae,e as le,f as pe,g as se}from"./chunk-6W6DKFRE.js";import{b as ie}from"./chunk-7UHCDGAA.js";import"./chunk-G47XGOST.js";import"./chunk-IL5JIRWJ.js";import"./chunk-3BT5DR3X.js";import{a as X}from"./chunk-GFJ2PTHZ.js";import{a as Y,b as Z}from"./chunk-7PN4XLNE.js";import"./chunk-CMTBBXR5.js";import{h as Q}from"./chunk-Q7P5KBPH.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{e as J}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as ee,n as te}from"./chunk-CLER2MX6.js";import{A as q,c as G,h as z,m as K}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{F as W,H as j,J as $,f as x,g as V,h as A,n as H}from"./chunk-M2FCTYGU.js";import{Fc as v,Gb as C,Gc as p,Hb as k,Hc as B,Ic as L,Ka as M,Kc as O,Lc as F,Mb as m,Mc as R,Qc as P,Sc as w,Yb as l,ic as n,ja as I,jc as i,ka as T,kc as c,lc as f,mc as _,oa as U,ob as N,oc as S,rb as a,tc as y,uc as d,xb as D,ya as g,za as h}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var _e=e=>[e];function ge(e,s){if(e&1&&(f(0),n(1,"a",9),p(2),i(),_()),e&2){let t=s.$implicit;a(),l("routerLink",w(2,_e,t.url)),a(),L(" ",t.title,"")}}var ce=(()=>{class e{constructor(){this.tabs=[{Title:"Download By Url",Url:"/menu/products/download/by-url",Description:"Download products information by product URL as a parameter"}],this.moreMenu=[{title:"Sold In Channel",url:"/menu/products/status/sold-in-channel"},{title:"In POS",url:"/menu/products/status/in-pos"},{title:"Not In Channel",url:"/menu/products/status/not-in-channel"},{title:"Duplicate SKU",url:"/menu/products/status/duplicate-sku"}]}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=C({type:e,selectors:[["app-download"]],standalone:!1,decls:12,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-block"],[4,"ngFor","ngForOf"],[1,"dropdown-item",3,"routerLink"]],template:function(o,r){o&1&&(n(0,"nav",0)(1,"div",1)(2,"div"),c(3,"nav-tab",2),i()(),n(4,"div")(5,"div",3)(6,"a",4),c(7,"i",5),i(),n(8,"div",6)(9,"div",7),m(10,ge,3,4,"ng-container",8),i()()()()(),c(11,"router-outlet")),o&2&&(a(3),l("Tabs",r.tabs),a(7),l("ngForOf",r.moreMenu))},dependencies:[x,Y,W,j],encapsulation:2})}}return e})();var E=(()=>{class e{constructor(t){this.httpService=t}download(t){return this.httpService.post("/api/Product/downloadurl",t)}static{this.\u0275fac=function(o){return new(o||e)(U(J))}}static{this.\u0275prov=I({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var Se=e=>({"background-color":e});function Ce(e,s){if(e&1&&(n(0,"th"),p(1),i()),e&2){let t=s.$implicit;a(),B(t.column)}}function ye(e,s){if(e&1&&(f(0),n(1,"td"),c(2,"span",6),i(),_()),e&2){let t=s.$implicit,o=d().$implicit;a(2),l("innerHTML",o[t.prop],N)}}function ve(e,s){if(e&1&&(n(0,"tr",5),m(1,ye,3,1,"ng-container",3),i()),e&2){let t=s.$implicit,o=d();l("ngStyle",w(2,Se,t.Status>200?"#F4D6D5":"#DEE9C9")),a(),l("ngForOf",o.configs)}}var de=(()=>{class e{constructor(){this.eventClose=new M}ngOnInit(){}onClose(){this.eventClose.emit()}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=C({type:e,selectors:[["app-response-api-list"]],inputs:{configs:"configs",data:"data",status:"status"},outputs:{eventClose:"onClose"},standalone:!1,decls:7,vars:2,consts:[[1,"table-responsive"],[1,"table"],[1,"thead-light"],[4,"ngFor","ngForOf"],[3,"ngStyle",4,"ngFor","ngForOf"],[3,"ngStyle"],[3,"innerHTML"]],template:function(o,r){o&1&&(n(0,"div",0)(1,"table",1)(2,"thead",2)(3,"tr"),m(4,Ce,2,1,"th",3),i()(),n(5,"tbody"),m(6,ve,2,4,"tr",4),i()()()),o&2&&(a(4),l("ngForOf",r.configs),a(2),l("ngForOf",r.data))},dependencies:[x,A],encapsulation:2})}}return e})();function xe(e,s){if(e&1){let t=S();f(0),n(1,"button",15),y("click",function(){g(t);let r=d(),u=v(11);return h(r.onNewStepperState(u))}),c(2,"i",16),p(3," New "),i(),_()}}function be(e,s){if(e&1){let t=S();f(0),n(1,"button",15),y("click",function(){g(t),d();let r=v(11);return h(r.previous())}),p(2," Back "),i(),_()}}function Ee(e,s){if(e&1){let t=S();f(0),n(1,"button",17),y("click",function(){g(t);let r=d(),u=v(11);return h(r.onStepperNext(u))}),p(2," Next "),i(),_()}}function De(e,s){if(e&1){let t=S();f(0),n(1,"button",18),y("click",function(){g(t);let r=d(),u=v(11);return h(r.onSubmit(u))}),p(2,"Download"),i(),_()}if(e&2){let t=d();a(),l("disabled",!t.urls)}}function Ie(e,s){e&1&&(c(0,"i",19),n(1,"span"),p(2,"Instruction"),i())}function Te(e,s){e&1&&(n(0,"div",20)(1,"div",21)(2,"div",22)(3,"h4",23),p(4,"Note"),i()(),n(5,"div",24)(6,"ol",25)(7,"li"),p(8," Use this form to Download Products from Tokopedia using product URL "),i(),n(9,"li"),p(10," Copy Product URL from "),n(11,"a",26),p(12,"https://seller.tokopedia.com/ "),i(),p(13," and paste in this form "),i(),n(14,"li"),p(15," Use New Line when you want to input several product URLs "),i()()()()())}function Ue(e,s){e&1&&(c(0,"i",27),n(1,"span"),p(2,"Download"),i())}function Me(e,s){if(e&1){let t=S();n(0,"div",20)(1,"textarea",28),R("ngModelChange",function(r){g(t);let u=d();return F(u.urls,r)||(u.urls=r),h(r)}),i()()}if(e&2){let t=d();a(),l("placeholder",t.urlPlaceholder),O("ngModel",t.urls)}}function Ne(e,s){e&1&&(c(0,"i",29),n(1,"span"),p(2,"Finish"),i())}function ke(e,s){if(e&1&&(n(0,"div",20),c(1,"app-response-api-list",30),i()),e&2){let t=d();a(),l("data",t.downloadResponses)("configs",t.configs)}}function Be(e,s){e&1&&(n(0,"h6"),p(1,"1"),i())}function Le(e,s){e&1&&(n(0,"h6"),p(1,"2"),i())}function Oe(e,s){e&1&&(n(0,"h6"),p(1,"3"),i())}var ue=(()=>{class e{constructor(t,o){this.downloadService=t,this.authService=o,this.configs=[{column:"Url",prop:"URL"},{column:"POS",prop:"Name"},{column:"Exception",prop:"Message"}],this.downloadResponses=[],this.stepperState="DOWNLOAD",this.urlPlaceholder=`https://tokopedia.com/tokoriyanadi/kaos-polos-biru
2
2
  https://tokopedia.com/tokoriyanadi/Celana-Chinos-Coklat`,this.currentDomain=this.authService.getDomain()}onStepperChange(t){this.stepperState=t.selectedStep.state}onSubmit(t){let o=this.urls.split(/\r?\n/);this.downloadService.download(o).subscribe(r=>{this.downloadResponses=r,this.mappingLinkToProduct(),this.onStepperNext(t)})}mappingLinkToProduct(){this.downloadResponses=this.downloadResponses.map(t=>(t.Name=t?.Name?`<a href="${this.currentDomain}/menu/Products/Catalog/Products/Info?ID=${t.ID}" target="_blank">
3
3
  ${t?.Name}
4
4
  </a>`:"-",t))}onNewStepperState(t){this.downloadResponses=[],this.urls=null,this.stepperState="DOWNLOAD",t.reset(),this.onStepperNext(t)}onStepperNext(t){t.selected.completed=!0,t.next()}static{this.\u0275fac=function(o){return new(o||e)(D(E),D(Q))}}static{this.\u0275cmp=C({type:e,selectors:[["app-by-url"]],standalone:!1,features:[P([{provide:ne,useValue:{displayDefaultIndicatorType:!1}}])],decls:24,vars:11,consts:[["stepper",""],["headerTitle","Tokopedia - Product Download By Url",3,"hideSearchBox","hideSearchDropdown"],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-12"],["linear","",1,"stepper-downloadByUrl",3,"selectionChange","selectedIndex"],["state","GUIDE",3,"editable","completed"],["matStepLabel",""],["matStepContent",""],["state","DOWNLOAD",3,"editable","completed"],["state","FINISH"],["matStepperIcon","GUIDE"],["matStepperIcon","DOWNLOAD"],["matStepperIcon","FINISH"],[1,"btn","btn-outline-secondary","btn-fill","btn-lg",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],["type","button",1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-3",3,"click"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","text-white","ms-3",3,"click","disabled"],[1,"fa-solid","fa-info","me-3"],[1,"mt-8"],[1,"card","border","w-50"],[1,"card-header","py-6"],[1,"text-primary"],[1,"card-body",2,"padding-left","0px"],[1,"mt-6"],["href","https://seller.tokopedia.com","target","_blank"],[1,"fa-solid","fa-download","me-3"],["name","url","cols","30","rows","25",1,"form-control",3,"ngModelChange","placeholder","ngModel"],[1,"fa-sharp","fa-solid","fa-flag","me-3"],["status","error",3,"data","configs"]],template:function(o,r){if(o&1){let u=S();n(0,"mainpanel",1)(1,"actions"),m(2,xe,4,0,"ng-container",2)(3,be,3,0,"ng-container",2)(4,Ee,3,0,"ng-container",2)(5,De,3,1,"ng-container",2),i(),n(6,"content")(7,"div",3)(8,"div",4)(9,"div",5)(10,"mat-stepper",6,0),y("selectionChange",function(fe){return g(u),h(r.onStepperChange(fe))}),n(12,"mat-step",7),m(13,Ie,3,0,"ng-template",8)(14,Te,16,0,"ng-template",9),i(),n(15,"mat-step",10),m(16,Ue,3,0,"ng-template",8)(17,Me,2,2,"ng-template",9),i(),n(18,"mat-step",11),m(19,Ne,3,0,"ng-template",8)(20,ke,2,2,"ng-template",9),i(),m(21,Be,2,0,"ng-template",12)(22,Le,2,0,"ng-template",13)(23,Oe,2,0,"ng-template",14),i()()()()()()}o&2&&(l("hideSearchBox",!0)("hideSearchDropdown",!0),a(2),l("ngIf",r.stepperState=="FINISH"),a(),l("ngIf",r.stepperState=="DOWNLOAD"),a(),l("ngIf",r.stepperState=="GUIDE"),a(),l("ngIf",r.stepperState=="DOWNLOAD"),a(5),l("selectedIndex",1),a(2),l("editable",r.stepperState!="FINISH")("completed",!0),a(3),l("editable",r.stepperState!="FINISH")("completed",!1))},dependencies:[V,G,z,K,ee,le,oe,pe,re,ae,de],styles:[`@import"https://fonts.googleapis.com/icon?family=Material+Icons";.card-header{background-color:#00000008}mat-stepper.stepper-downloadByUrl>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container{position:relative;width:60%;left:18%}
@@ -0,0 +1 @@
1
+ import{a as _e,b as he,c as Se}from"./chunk-V5BKQSAT.js";import{a as we}from"./chunk-GVULJZIG.js";import{a as ge}from"./chunk-UCA5RNCO.js";import{a as Ce}from"./chunk-722SRHLY.js";import{a as fe}from"./chunk-66MLRB2J.js";import"./chunk-M5JQ7BGW.js";import{a as ue}from"./chunk-EPVCMYCI.js";import"./chunk-JDIBETL5.js";import"./chunk-L7K5HOBY.js";import"./chunk-BFU7VKO3.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 de}from"./chunk-WPW3D4MQ.js";import{g as le}from"./chunk-Q7P5KBPH.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import{a as ae}from"./chunk-5HO2IJ47.js";import"./chunk-5JVEEL2T.js";import{b as v}from"./chunk-PW42BQIY.js";import"./chunk-SWQXSJ7O.js";import"./chunk-AEOSNAHH.js";import{b as oe,e as re}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as ce,n as se}from"./chunk-CLER2MX6.js";import{A as ne,c as $,h as ee,m as te,o as ie}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{r as me,s as pe}from"./chunk-YCH6HHU3.js";import"./chunk-B73M3AMU.js";import{j as Q,k as X,m as Y,n as Z}from"./chunk-M2FCTYGU.js";import{$c as y,Gb as O,Gc as l,Hc as b,Ic as E,Kc as _,Lc as h,Mb as x,Mc as S,Nc as H,Oc as U,Pc as G,Qc as q,Ra as F,Sc as J,Yb as C,Z as D,ac as B,ad as k,bd as K,dc as T,ec as z,gc as R,hc as j,ic as t,ja as I,jc as i,kc as d,oc as V,pa as f,pb as W,rb as a,tc as L,uc as g,v as N,ya as c,za as s}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import{a as M,b as P}from"./chunk-66YHNWRR.js";var A=(()=>{class n{constructor(){this.httpService=f(re),this.shippingLabelService=f(Ce),this.toastrService=f(oe)}getAwaitingCollectionOrders(e){return this.httpService.post(ae.GetAwaitingCollection,e).pipe(N(m=>m?.Data))}printShippingLabel(e){switch(e?.MarketType){case v.Shopee:this.shippingLabelService.printShippingLabelShopee(e.Number,e.ShopID);break;case v.Tiktok:this.shippingLabelService.printShippingLabelTiktok(e.Number,e.ShopID);break;case v.Tokopedia:this.shippingLabelService.printShippingLabelTokopedia(e.Number);break;case v.Lazada:this.shippingLabelService.printShippingLabelLazada(e.Number,e.ShopID);break;case v.Shopify:this.toastrService.error("Shopify not supported","Error Not supported");break}}static{this.\u0275fac=function(m){return new(m||n)}}static{this.\u0275prov=I({token:n,factory:n.\u0275fac})}}return n})();var be=n=>({"td-cell-hover":n});function ye(n,w){if(n&1&&d(0,"variants-dropdown",30),n&2){let e=g().$implicit;C("variants",e==null?null:e.Variants)}}function xe(n,w){if(n&1&&d(0,"variant-with-image",31),n&2){let e=g().$implicit;C("variant",e==null?null:e.Variants[0])}}function Te(n,w){if(n&1&&(t(0,"span"),l(1),i()),n&2){let e=g().$implicit;a(),E("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function Ve(n,w){if(n&1){let e=V();t(0,"tr")(1,"td"),l(2),i(),t(3,"td")(4,"div",26)(5,"div",27)(6,"div"),d(7,"img",28),y(8,"channelImage"),i(),t(9,"div"),d(10,"order-link",29),i()(),t(11,"small"),l(12),y(13,"date"),i()()(),t(14,"td"),l(15),i(),t(16,"td"),x(17,ye,1,1,"variants-dropdown",30)(18,xe,1,1,"variant-with-image",31),i(),t(19,"td",32),l(20),y(21,"number"),i(),t(22,"td")(23,"div",26)(24,"div",27)(25,"span"),l(26),i(),x(27,Te,2,1,"span"),i(),t(28,"small"),l(29),i()()(),t(30,"td",33)(31,"button",34),L("click",function(){let o=c(e).$implicit,p=g(2);return s(p.onPrintShippingLabel(o))}),d(32,"i",35),i()()()}if(n&2){let e=w.$implicit;a(2),b(e.Outlet),a(5),C("src",k(8,13,e==null?null:e.MarketType),W)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),a(3),C("order",e),a(2),E(" ",K(13,15,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),a(3),b(e.Customer),a(),B(J(20,be,(e.Variants==null?null:e.Variants.length)>1)),a(),T((e.Variants==null?null:e.Variants.length)>1?17:18),a(3),b(k(21,18,e.Amount)),a(6),b(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),a(),T(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?27:-1),a(2),E(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," ")}}function Le(n,w){if(n&1){let e=V();t(0,"div",15)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),l(5,"Outlet"),i(),t(6,"th",21),l(7,"Number"),i(),t(8,"th",21),l(9,"Customer"),i(),t(10,"th"),l(11,"Items"),i(),t(12,"th",22),l(13,"Amount"),i(),t(14,"th",23),l(15,"Shipping"),i(),d(16,"th",24),i()(),t(17,"tbody"),R(18,Ve,33,22,"tr",null,z),i()(),t(20,"app-custom-paginator",25),L("next",function(){c(e);let o=g();return s(o.initAwaitingCollection())})("previous",function(){c(e);let o=g();return s(o.initAwaitingCollection())}),i()()}if(n&2){let e=g(),m=G(0);a(18),j(m),a(2),C("filter",e.filter())("totaldata",m==null?null:m.length)}}function Ee(n,w){n&1&&(t(0,"div",16),d(1,"app-empty-state"),i())}var at=(()=>{class n{constructor(){this.awaitingCollectionService=f(A),this.tokenService=f(le),this.filter=F({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){let e=this.tokenService.getTokenValue(),m=Number(e?.orddfl??0),o=new Date,p=m===0?null:new Date(o.setDate(o.getDate()-m));this.filter.update(u=>P(M({},u),{From:p})),this.initAwaitingCollection()}initAwaitingCollection(){this.awaitingCollections$=this.awaitingCollectionService.getAwaitingCollectionOrders(this.filter()).pipe(D(1))}getOrderDefaultValue(){return this.tokenService.getTokenValue()?.orddfl??null}onPrintShippingLabel(e){this.awaitingCollectionService.printShippingLabel(e)}static{this.\u0275fac=function(m){return new(m||n)}}static{this.\u0275cmp=O({type:n,selectors:[["app-awaiting-collection"]],features:[q([A])],decls:34,vars:11,consts:[["headerTitle","Awaiting Collection","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-regular","fa-tv","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","100px"],[2,"width","250px"],[1,"text-end",2,"width","150px"],[2,"width","150px"],[2,"width","10px"],["rowCountApi","/api/orders/awaitingcollectioncount",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"],[2,"font-size","14px",3,"order"],[3,"variants"],[3,"variant"],[1,"text-end"],[1,"text-end","td-cell-hover"],["type","button","aria-label","Print order","title","Print","matTooltip","Print shipping label",1,"btn","p-0","border-0","bg-transparent",3,"click"],[1,"fa-solid","fa-print","fs-3"]],template:function(m,o){if(m&1){let p=V();H(0),y(1,"async"),t(2,"mainpanel",0),L("onSubmit",function(){return c(p),s(o.initAwaitingCollection())}),S("textChange",function(r){return c(p),h(o.filter().Number,r)||(o.filter().Number=r),s(r)}),t(3,"actions")(4,"a",1),d(5,"i",2),t(6,"span"),l(7,"Order Fulfillment Display"),i()()(),t(8,"filters")(9,"div")(10,"label",3),l(11,"From/To"),i(),t(12,"channel-select-options",4),S("ngModelChange",function(r){return c(p),h(o.filter().ListChannelID,r)||(o.filter().ListChannelID=r),s(r)}),i()(),t(13,"div",5)(14,"label",3),l(15,"From/To"),i(),t(16,"div",6)(17,"datepicker",7),S("dateChange",function(r){return c(p),h(o.filter().From,r)||(o.filter().From=r),s(r)}),i()(),t(18,"div")(19,"datepicker",8),S("dateChange",function(r){return c(p),h(o.filter().To,r)||(o.filter().To=r),s(r)}),i()()(),t(20,"div",5)(21,"label",9),l(22,"Page Number"),i(),t(23,"input",10),S("ngModelChange",function(r){return c(p),h(o.filter().PageNumber,r)||(o.filter().PageNumber=r),s(r)}),i()(),t(24,"div",5)(25,"label",9),l(26,"Page Size"),i(),t(27,"input",11),S("ngModelChange",function(r){return c(p),h(o.filter().PageSize,r)||(o.filter().PageSize=r),s(r)}),i()()(),t(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),x(32,Le,21,2,"div",15)(33,Ee,2,0,"div",16),i()()()()()}if(m&2){let p=U(k(1,8,o.awaitingCollections$));a(2),_("text",o.filter().Number),a(10),C("multiple",!0),_("ngModel",o.filter().ListChannelID),a(5),_("date",o.filter().From),a(2),_("date",o.filter().To),a(4),_("ngModel",o.filter().PageNumber),a(4),_("ngModel",o.filter().PageSize),a(5),T((p==null?null:p.length)>0?32:33)}},dependencies:[Z,Q,Y,X,se,ce,ue,de,ne,$,ie,ee,te,_e,he,Se,fe,ge,pe,me,we],encapsulation:2})}}return n})();export{at as AwaitingCollectionComponent};
@@ -1,4 +1,4 @@
1
- import{h as m}from"./chunk-YFSXR7TL.js";import{a as d}from"./chunk-5HO2IJ47.js";import{c as o}from"./chunk-PW42BQIY.js";import{a as I}from"./chunk-DRMAONR7.js";import{b as g,e as C}from"./chunk-JXSBFTQM.js";import{J as h,ea as l,ja as S,oa as u,pa as f,r as c}from"./chunk-B7KTCPKC.js";var N=(()=>{class i{constructor(t,e,s){this.httpService=t,this.toastrService=e,this.notificationService=s,this.authService=f(m),this.channelOptions=this.authService.getChannels()}loader(t=o.GuidEMpty){return this.httpService.post("/api/product/Load",{ID:t})}LoadInPOS(t=o.GuidEMpty){return this.httpService.post("/api/product/LoadInPOS",{ID:t})}filterChannelByTypeId(t,e){return t.filter(s=>e.findIndex(n=>s.TypeID==n)!==-1)}getProductStatistic(){return this.httpService.post("/api/product/ProductStatistic",{})}getTotalProductLive(t){let e={ID:t};return this.httpService.post("/api/product/TotalProductLive",e)}clearCacheChannel(t){let e={ID:t};return this.httpService.post("/api/Channel/ClearCacheChannel",e)}detachProduct(t){return this.httpService.post("/api/product/Detach",t)}uploadSingleProduct(t,e){let s={Channel:e,Products:t};return this.httpService.post("api/product/UploadMultipleChannel",s).pipe(l(n=>{this.showToastrSuccessUploadSingle(n,t[0])}),h(n=>(this.showToastErrorUploadSingle(n,t[0]),c(()=>new Error(n)))))}uploadMultipleProduct(t,e){let s={Channel:e,Products:t};return this.httpService.post("api/product/UploadMultipleProductAndMultipleChannel",s).pipe(l(n=>{this.showToastrUploadMultiple(n.Message)}),h(n=>(this.showToastrUploadMultiple(n.error?.Message),c(()=>new Error(n)))))}uploadNotInChannel(t,e){let s={Products:t,Channel:e};return this.httpService.post("/api/product/UploadProductNotInChannelToChannel",s).pipe(l(n=>{this.showToastrUploadMultiple(n)}),h(n=>(this.showToastrUploadMultiple(n.error?.Message),c(()=>new Error(n)))))}scanSingle(t,e){let s={ID:t,SKU:e};return this.httpService.post("/api/product/ScanSingle",s)}scanNotInChannel(t){let e={ID:t};return this.httpService.post("/api/product/ScanNotinChannel",e)}findAllSoldInChannel(t){return this.httpService.post("/api/product/GetSoldInChannel",t)}scanAll(t,e,s,n=!1){let a={ID:t,ScanFull:e,UpdatedProduct:s,Async:n};return this.httpService.post("/api/product/ScanOptimized",a)}scanAsyncProductV2(t,e,s){let n={ID:t,ScanFull:e?1:0,UpdatedProduct:s,Async:!0};return this.httpService.post(d.ScanAsyncProductV2,n).pipe(l(a=>{this.notificationService.subscribeToJobGroup(a.JobID)}))}scanSyncProductV2(t,e,s){let n={ID:t,ScanFull:e,UpdatedProduct:s,Async:!1};return this.httpService.post(d.ScanSyncProductV2,n)}scanProductV2(t,e,s,n=!1){return n?this.scanAsyncProductV2(t,e,s).pipe(l(()=>{this.toastrService.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"})})):this.scanSyncProductV2(t,e,s).pipe(l(a=>{let r=this.findChannelById(t,this.channelOptions);this.successToastrScanAllProduct(a,r,!s)}))}scanCompareToPos(t){return this.httpService.post("/api/product/CompareMarketplaceToPOS",t)}getVariantCodesProduct(t){return(t.Variants||[]).map(n=>n.Code)}downloadMultipleProduct(t){let e=t.map(s=>({ChannelItemID:s.ChannelItemID,ChannelID:s.ChannelID}));return this.httpService.post("/api/product/DownloadMultipleProductFromChannel",e).pipe(l(s=>{this.toastrService.success(`${s.Count} products downloaded to POS`,"Download Complete")}))}downloadProduct(t){let e={ChannelItemID:t.ChannelItemID,ChannelID:t.ChannelID};return this.httpService.post("/api/product/DownloadProductFromChannel",e).pipe(l(()=>{this.toastrService.success("Product successfully downloaded to POS","Download Complete")}))}getVariantCodesProducts(t=[]){let e=[];return t.forEach(s=>{s.Variants.forEach(n=>{e=[...e,n.Code]})}),e}filterUnselectedChannel(t,e){let s=[];t.forEach(a=>{s=[...s,...a.Channel]});let n;if(!s||s.length==0)n=e;else{let a=[];n=e.filter(r=>(a=s.filter(p=>p.ChannelID==r.ID),a.length!==t.length))}return n}findChannelById(t,e){return e.find(s=>s.ID==t)}sortChannel(t=[]){return t.sort((e,s)=>e.TypeID<s.TypeID?1:e.TypeID===s.TypeID?0:-1)}hasSelection(t=[]){return this.selectedProduct(t).length>0}selectedProduct(t=[]){return t.filter(e=>e.selected)}hasSelectionVariant(t){return this.selectedVariantProduct(t).length>0}selectedVariantProduct(t){let e=[];return t.forEach(s=>{e=[...e,...s.Variants!=null?s.Variants.filter(n=>n.selected):""]}),e}getChannelProduct(t){let e=t.Variants||[],s=[];for(let n of e)if(n.Channel!=null)for(let a of n.Channel)s.filter(r=>r.ChannelID==a.ChannelID).length==0&&s.push(a);return this.sortChannel(s)}successToastrScanAllProduct(t,e,s){let n=t.InChannel?t?.InChannel?.Product:0,a=t?.NotInPOS?.Product?t?.NotInPOS?.Product:0,r=o.IsNotEmpty(t.LastUpdate)?o.convertToReadableDate(t.LastUpdate):null;s?this.toastrService.success(`
1
+ import{h as m}from"./chunk-Q7P5KBPH.js";import{a as d}from"./chunk-5HO2IJ47.js";import{c as o}from"./chunk-PW42BQIY.js";import{a as I}from"./chunk-DRMAONR7.js";import{b as g,e as C}from"./chunk-JXSBFTQM.js";import{J as h,ea as l,ja as S,oa as u,pa as f,r as c}from"./chunk-B7KTCPKC.js";var N=(()=>{class i{constructor(t,e,s){this.httpService=t,this.toastrService=e,this.notificationService=s,this.authService=f(m),this.channelOptions=this.authService.getChannels()}loader(t=o.GuidEMpty){return this.httpService.post("/api/product/Load",{ID:t})}LoadInPOS(t=o.GuidEMpty){return this.httpService.post("/api/product/LoadInPOS",{ID:t})}filterChannelByTypeId(t,e){return t.filter(s=>e.findIndex(n=>s.TypeID==n)!==-1)}getProductStatistic(){return this.httpService.post("/api/product/ProductStatistic",{})}getTotalProductLive(t){let e={ID:t};return this.httpService.post("/api/product/TotalProductLive",e)}clearCacheChannel(t){let e={ID:t};return this.httpService.post("/api/Channel/ClearCacheChannel",e)}detachProduct(t){return this.httpService.post("/api/product/Detach",t)}uploadSingleProduct(t,e){let s={Channel:e,Products:t};return this.httpService.post("api/product/UploadMultipleChannel",s).pipe(l(n=>{this.showToastrSuccessUploadSingle(n,t[0])}),h(n=>(this.showToastErrorUploadSingle(n,t[0]),c(()=>new Error(n)))))}uploadMultipleProduct(t,e){let s={Channel:e,Products:t};return this.httpService.post("api/product/UploadMultipleProductAndMultipleChannel",s).pipe(l(n=>{this.showToastrUploadMultiple(n.Message)}),h(n=>(this.showToastrUploadMultiple(n.error?.Message),c(()=>new Error(n)))))}uploadNotInChannel(t,e){let s={Products:t,Channel:e};return this.httpService.post("/api/product/UploadProductNotInChannelToChannel",s).pipe(l(n=>{this.showToastrUploadMultiple(n)}),h(n=>(this.showToastrUploadMultiple(n.error?.Message),c(()=>new Error(n)))))}scanSingle(t,e){let s={ID:t,SKU:e};return this.httpService.post("/api/product/ScanSingle",s)}scanNotInChannel(t){let e={ID:t};return this.httpService.post("/api/product/ScanNotinChannel",e)}findAllSoldInChannel(t){return this.httpService.post("/api/product/GetSoldInChannel",t)}scanAll(t,e,s,n=!1){let a={ID:t,ScanFull:e,UpdatedProduct:s,Async:n};return this.httpService.post("/api/product/ScanOptimized",a)}scanAsyncProductV2(t,e,s){let n={ID:t,ScanFull:e?1:0,UpdatedProduct:s,Async:!0};return this.httpService.post(d.ScanAsyncProductV2,n).pipe(l(a=>{this.notificationService.subscribeToJobGroup(a.JobID)}))}scanSyncProductV2(t,e,s){let n={ID:t,ScanFull:e,UpdatedProduct:s,Async:!1};return this.httpService.post(d.ScanSyncProductV2,n)}scanProductV2(t,e,s,n=!1){return n?this.scanAsyncProductV2(t,e,s).pipe(l(()=>{this.toastrService.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"})})):this.scanSyncProductV2(t,e,s).pipe(l(a=>{let r=this.findChannelById(t,this.channelOptions);this.successToastrScanAllProduct(a,r,!s)}))}scanCompareToPos(t){return this.httpService.post("/api/product/CompareMarketplaceToPOS",t)}getVariantCodesProduct(t){return(t.Variants||[]).map(n=>n.Code)}downloadMultipleProduct(t){let e=t.map(s=>({ChannelItemID:s.ChannelItemID,ChannelID:s.ChannelID}));return this.httpService.post("/api/product/DownloadMultipleProductFromChannel",e).pipe(l(s=>{this.toastrService.success(`${s.Count} products downloaded to POS`,"Download Complete")}))}downloadProduct(t){let e={ChannelItemID:t.ChannelItemID,ChannelID:t.ChannelID};return this.httpService.post("/api/product/DownloadProductFromChannel",e).pipe(l(()=>{this.toastrService.success("Product successfully downloaded to POS","Download Complete")}))}getVariantCodesProducts(t=[]){let e=[];return t.forEach(s=>{s.Variants.forEach(n=>{e=[...e,n.Code]})}),e}filterUnselectedChannel(t,e){let s=[];t.forEach(a=>{s=[...s,...a.Channel]});let n;if(!s||s.length==0)n=e;else{let a=[];n=e.filter(r=>(a=s.filter(p=>p.ChannelID==r.ID),a.length!==t.length))}return n}findChannelById(t,e){return e.find(s=>s.ID==t)}sortChannel(t=[]){return t.sort((e,s)=>e.TypeID<s.TypeID?1:e.TypeID===s.TypeID?0:-1)}hasSelection(t=[]){return this.selectedProduct(t).length>0}selectedProduct(t=[]){return t.filter(e=>e.selected)}hasSelectionVariant(t){return this.selectedVariantProduct(t).length>0}selectedVariantProduct(t){let e=[];return t.forEach(s=>{e=[...e,...s.Variants!=null?s.Variants.filter(n=>n.selected):""]}),e}getChannelProduct(t){let e=t.Variants||[],s=[];for(let n of e)if(n.Channel!=null)for(let a of n.Channel)s.filter(r=>r.ChannelID==a.ChannelID).length==0&&s.push(a);return this.sortChannel(s)}successToastrScanAllProduct(t,e,s){let n=t.InChannel?t?.InChannel?.Product:0,a=t?.NotInPOS?.Product?t?.NotInPOS?.Product:0,r=o.IsNotEmpty(t.LastUpdate)?o.convertToReadableDate(t.LastUpdate):null;s?this.toastrService.success(`
2
2
  ${a+n} product updates in ${e.Name} </br>
3
3
  (${n} In Channel + ${a} Not In Pos)
4
4
  ${o.IsNotEmpty(r)?"since "+r:""}