marketplacepos 3.20.5 → 3.20.6

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 (31) hide show
  1. package/Marketplace/{chunk-BARICLUB.js → chunk-3CZEM6ET.js} +1 -1
  2. package/Marketplace/{chunk-HQ2NK4T7.js → chunk-43IEC5QK.js} +1 -1
  3. package/Marketplace/{chunk-COAD3DY5.js → chunk-5E3UEBK4.js} +1 -1
  4. package/Marketplace/{chunk-BAP3IJF6.js → chunk-5KL4F7HS.js} +1 -1
  5. package/Marketplace/{chunk-3HIQR6S5.js → chunk-6SKHSR2X.js} +1 -1
  6. package/Marketplace/{chunk-UTP5O3JL.js → chunk-A7JXR4HQ.js} +1 -1
  7. package/Marketplace/{chunk-3VGAURY3.js → chunk-CDQ6EQHB.js} +1 -1
  8. package/Marketplace/{chunk-LF7UA3W4.js → chunk-CU6NK6JI.js} +1 -1
  9. package/Marketplace/{chunk-5CRDOJPK.js → chunk-DPKLBQVH.js} +1 -1
  10. package/Marketplace/{chunk-OMR5REL2.js → chunk-EYSFFDPA.js} +1 -1
  11. package/Marketplace/{chunk-HMRV5GCL.js → chunk-FGAYWPRX.js} +1 -1
  12. package/Marketplace/{chunk-GOV3GQ7Y.js → chunk-FZHHIISR.js} +1 -1
  13. package/Marketplace/{chunk-ELNSUKXK.js → chunk-G7OHABN6.js} +1 -1
  14. package/Marketplace/{chunk-REVVSWD3.js → chunk-I7FLAWCU.js} +1 -1
  15. package/Marketplace/{chunk-HNI6GED7.js → chunk-KIQU6QLP.js} +1 -1
  16. package/Marketplace/{chunk-HTFZRZEI.js → chunk-LXL5OGMB.js} +1 -1
  17. package/Marketplace/{chunk-EKFFWAOD.js → chunk-M2JMF4Q2.js} +1 -1
  18. package/Marketplace/{chunk-2ORRMEZR.js → chunk-MVZIK2UR.js} +1 -1
  19. package/Marketplace/{chunk-62AUVNTW.js → chunk-N7LA3PAK.js} +1 -1
  20. package/Marketplace/{chunk-G5TWCIEM.js → chunk-O636C3DS.js} +1 -1
  21. package/Marketplace/{chunk-5GZGQTZO.js → chunk-QOITECN4.js} +1 -1
  22. package/Marketplace/{chunk-JAASJQ7I.js → chunk-R5PDV676.js} +1 -1
  23. package/Marketplace/{chunk-2LWHDKOC.js → chunk-SHR75DME.js} +1 -1
  24. package/Marketplace/{chunk-AGTLQ7PH.js → chunk-SKNEISMT.js} +1 -1
  25. package/Marketplace/{chunk-ZPUEDBNZ.js → chunk-VOIT7VXD.js} +1 -1
  26. package/Marketplace/{chunk-LWMWPW7O.js → chunk-XRVQ2WEG.js} +1 -1
  27. package/Marketplace/{chunk-SAGRGMBL.js → chunk-ZCD2PCBL.js} +1 -1
  28. package/Marketplace/{chunk-6LC5LHS7.js → chunk-ZPGUQ2BI.js} +1 -1
  29. package/Marketplace/index.html +2 -2
  30. package/Marketplace/{main-CMQW2MZJ.js → main-KYZAMEYA.js} +1 -1
  31. package/package.json +1 -1
@@ -1 +1 @@
1
- import{a as he}from"./chunk-MZNSPLFO.js";import{a as oe}from"./chunk-BVIRHZTZ.js";import{a as fe}from"./chunk-E5BOLHDG.js";import{a as xe,b as Ce}from"./chunk-A37OKNC2.js";import{c as ue}from"./chunk-DYLT6RRK.js";import{a as ge}from"./chunk-D76K4RZ7.js";import{g as de}from"./chunk-EIBGI6U2.js";import{g as ce}from"./chunk-5GZGQTZO.js";import{d as pe,g as se}from"./chunk-4CEFDQPI.js";import{t as _e,u as me}from"./chunk-2SC3HO66.js";import{b as ee,h as te,m as ne,y as ie}from"./chunk-2E5AKA74.js";import{c as re,e as le,f as ae}from"./chunk-FTHTFVHH.js";import{Ab as H,Ac as G,Ec as J,Fc as Q,Ha as v,Ib as b,Ja as a,Jb as s,Ka as F,Kb as k,Lb as S,Nb as O,Ob as D,Pb as N,Rb as Z,Tb as T,V as z,_a as p,ab as m,ac as $,bc as j,c as W,cc as q,dc as y,ga as A,hb as P,ib as E,kb as M,lb as V,mb as c,nb as _,oa as g,ob as I,pa as u,pb as x,qb as C,rb as R,sb as f,vb as h,vc as K,xa as B,xb as r,xc as X,yc as Y,za as U}from"./chunk-ZIZWZZ4E.js";var L=t=>[t],Te=t=>({"text-decoration-line-through":t}),be=t=>({"ms-10":t}),Se=t=>({"bg-gradient-warning":t});function ve(t,l){if(t&1){let n=f();c(0,"mat-slide-toggle",13),h("toggleChange",function(){g(n);let e=r();return e.toggleStatus=!e.toggleStatus,u(e.onToggle())}),c(1,"small",14),s(2),_()()}if(t&2){let n=r();a(2),S(" ",n.productToggleTitle?n.productToggleTitle:"FILTER DIFFERENT INVENTORY"," ")}}function Ie(t,l){if(t&1){let n=f();c(0,"th")(1,"input",16),N("ngModelChange",function(e){g(n);let o=r(2);return D(o.checkboxState,e)||(o.checkboxState=e),u(e)}),h("ngModelChange",function(){g(n);let e=r(2);return u(e.onCheckboxStateChange())}),_()()}if(t&2){let n=r(2);a(),O("ngModel",n.checkboxState)}}function ye(t,l){if(t&1&&(p(0,Ie,2,1,"ng-template",15),c(1,"th",11),s(2,"POS"),_()),t&2){let n=r();m("ngxPermissionsOnly",T(1,L,n.rolePriceEdit))}}function we(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),s(6),$(7,"stringLimit"),_()()()(),C()),t&2){let n=l.$implicit;a(3),m("matTooltip",(n.Name==null?null:n.Name.length)>20?n.Name:""),a(),m("src",n==null?null:n.Img,v),a(2),S(" ",q(7,3,n.Name,20)," ")}}function Fe(t,l){t&1&&R(0)}function Pe(t,l){if(t&1&&(x(0),p(1,Fe,1,0,"ng-container",34),C()),t&2){r();let n=b(7);a(),m("ngTemplateOutlet",n)}}function Ee(t,l){t&1&&R(0)}function Me(t,l){if(t&1&&p(0,Ee,1,0,"ng-container",34),t&2){r(2);let n=b(7);m("ngTemplateOutlet",n)}}function Ve(t,l){if(t&1&&p(0,Me,1,1,"ng-template",15),t&2){let n=r(4);m("ngxPermissionsOnly",T(1,L,n.rolePriceEdit))}}function ke(t,l){if(t&1){let n=f();x(0),c(1,"input",35),N("ngModelChange",function(e){g(n);let o=r(4).$implicit;return D(o.selected,e)||(o.selected=e),u(e)}),h("ngModelChange",function(){g(n);let e=r(4).$implicit,o=r();return u(o.onCheckboxStateProduct(e.ID))}),_(),C()}if(t&2){let n=r(4).$implicit;a(),O("ngModel",n.selected)}}function Oe(t,l){if(t&1&&p(0,ke,2,1,"ng-container",22),t&2){let n=r(3).$implicit;m("ngIf",(n==null||n.Variants==null?null:n.Variants.length)>1)}}function De(t,l){if(t&1){let n=f();x(0),c(1,"img",36),h("click",function(e){g(n);let o=r(3).$implicit,d=r();return u(d.onZoomImage(e,o==null?null:o.ImageUrl))}),_(),C()}if(t&2){let n=r(3).$implicit;a(),H("src",n==null?null:n.ThumbnailUrl,v)}}function Ne(t,l){t&1&&I(0,"img",37)}function $e(t,l){if(t&1&&(x(0),c(1,"td",29)(2,"div",30),p(3,Pe,2,1,"ng-container",31)(4,Ve,1,3,"ng-template",null,0,y)(6,Oe,1,1,"ng-template",null,1,y),c(8,"div",26),p(9,De,2,1,"ng-container",31)(10,Ne,1,0,"ng-template",null,2,y),_()()(),c(12,"td",32)(13,"div"),s(14),_(),c(15,"small",33),s(16),_()(),C()),t&2){let n=b(5),i=b(11),e=r(2).$implicit,o=r();a(),m("rowSpan",e==null?null:e.Variants.length),a(2),m("ngIf",o.table=="inventory")("ngIfElse",n),a(5),m("ngClass",T(9,be,(e==null||e.Variants==null?null:e.Variants.length)<=1)),a(),m("ngIf",e==null?null:e.ThumbnailUrl)("ngIfElse",i),a(3),m("rowSpan",e==null?null:e.Variants.length),a(2),k(e==null?null:e.Name),a(2),S("(",e==null?null:e.Category,")")}}function Be(t,l){if(t&1){let n=f();c(0,"input",16),N("ngModelChange",function(e){g(n);let o=r(3).$implicit;return D(o.selected,e)||(o.selected=e),u(e)}),_()}if(t&2){let n=r(3).$implicit;O("ngModel",n.selected)}}function Ue(t,l){if(t&1&&(c(0,"td",38),p(1,Be,1,1,"input",39),_()),t&2){let n=r(2).$implicit,i=r(2);a(),m("ngIf",i.printPOS(n)>=0||i.table=="price")}}function Re(t,l){if(t&1&&(p(0,Ue,2,1,"ng-template",15),c(1,"td",24),s(2),$(3,"number"),_()),t&2){let n=r().$implicit,i=r(2);m("ngxPermissionsOnly",T(4,L,i.rolePriceEdit)),a(2),k(j(3,2,i.printPOS(n)))}}function je(t,l){if(t&1){let n=f();x(0),c(1,"td",40),h("click",function(){g(n);let e=r().$implicit,o=r().$implicit,d=r().$implicit,w=r();return u(w.openTableDialog(d.Name,o,e.ID,d.ChannelItemID))}),c(2,"div",30)(3,"div",41),s(4),$(5,"number"),_(),c(6,"a",42),h("click",function(e){return g(n),u(e==null?null:e.stopPropagation())}),I(7,"i",28),_()()(),C()}if(t&2){let n=l.$implicit,i=r(2).$implicit,e=r(2);a(),m("ngClass",T(5,Se,e.printPOS(i)!=e.printItem(n)&&e.hiddenIPOSInventory()==!1)),a(3),S(" ",j(5,3,e.printItem(n))," "),a(2),m("href",n.Url,v)}}function Le(t,l){t&1&&(c(0,"td",43)(1,"div",30)(2,"span"),s(3,"X"),_()()())}function We(t,l){if(t&1&&p(0,je,8,7,"ng-container",31)(1,Le,4,0,"ng-template",null,3,y),t&2){let n=l.$implicit,i=b(2),e=r().$implicit,o=r(2);m("ngIf",o.getItemFromChannel(e,n))("ngIfElse",i)}}function ze(t,l){if(t&1&&(c(0,"tr"),p(1,$e,17,11,"ng-container",22),c(2,"td",23),s(3),_(),c(4,"td",24)(5,"div",25)(6,"div",26),s(7),_(),c(8,"div",21)(9,"a",27),I(10,"i",28),_()()()(),p(11,Re,4,6),M(12,We,3,2,null,null,E),_()),t&2){let n=l.$implicit,i=l.$index,e=r(2);a(),m("ngIf",i==0),a(2),k(n==null?null:n.Model),a(2),m("matTooltip",n.Discontinued?e.discontinuedVariantMsg:""),a(),m("ngClass",T(7,Te,n.Discontinued)),a(),S(" ",n.Code," "),a(2),m("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),v),a(2),P(e.hiddenIPOSInventory()==!1?11:-1),a(),V(e.channel)}}function Ae(t,l){if(t&1&&(c(0,"tbody"),M(1,ze,14,9,"tr",null,E),_()),t&2){let n=l.$implicit;a(),V(n.Variants)}}var ht=(()=>{let l=class l{constructor(i,e,o){this.dialog=i,this.biggerPictureService=e,this.authService=o,this.showProductToggle=!1,this.multiwarehouse=B(!1),this.hiddenIPOSInventory=B(!1),this.toggleStatus=!1,this.checkboxState=!1,this.rolePriceEdit=oe.price,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 U,this.destroy$=new W,this.toggle=new U,this.hostName=this.authService.getDomain()}ngOnInit(){this.table=="inventory"?this.stockHeader="Stock":this.table=="price"&&(this.stockHeader="Price")}onCheckboxStateProduct(i){let e=this.data.filter(o=>o.ID==i);e.length>0&&(e=e.map(o=>(o.Variants=o.Variants.map(d=>(d.selected=o.selected,d)),o)))}onCheckboxStateChange(){this.data=this.data.map(i=>(i.Variants=i.Variants.map(e=>(e.selected=this.checkboxState,e)),i))}getItemFromChannel(i,e){return i.Channel.find(d=>re.IsNotEmpty(e.LocationID)?d.LocationID==e.LocationID:d.ChannelID==e.ID)}printItem(i){if(this.table=="inventory")return i.Inventory;if(this.table=="price")return i.Price}openTableDialog(i,e,o,d){this.dialog.open(he,{data:{Name:i,Variant:e,ChannelID:o,Table:this.table,ChannelItemID:d}}).afterClosed().pipe(z(this.destroy$)).subscribe(w=>{w!=null&&this.onSubmit.emit(w)})}printPOS(i){return this.table=="inventory"?i.Inventory?i.Inventory:0:this.table=="price"?i.UnitPrice:null}onToggle(){this.toggle.emit(this.toggleStatus)}onZoomImage(i,e){this.biggerPictureService.openBiggerPicture(i,e)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};l.\u0275fac=function(e){return new(e||l)(F(pe),F(ge),F(ce))},l.\u0275cmp=A({type:l,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"},standalone:!0,features:[Z],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,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"text-center",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-center"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"padding-left","0px",3,"rowSpan"],[1,"mt-1"],[4,"ngTemplateOutlet"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],[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"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],[1,"p-0","pointer","cell-hover",3,"click","ngClass"],[1,"me-2","mt-1"],["target","_blank",3,"click","href"],[1,"table-white","text-center",2,"color","red"]],template:function(e,o){e&1&&(c(0,"div",4)(1,"table",5)(2,"thead",6)(3,"tr")(4,"th",7)(5,"div",8)(6,"div"),s(7,"Product"),_(),p(8,ve,3,1,"mat-slide-toggle",9),_()(),c(9,"th",10),s(10,"Variant"),_(),c(11,"th",11),s(12,"SKU"),_(),p(13,ye,3,3)(14,we,8,6,"ng-container",12),_()(),M(15,Ae,3,0,"tbody",null,E),_()()),e&2&&(a(8),P(o.showProductToggle?8:-1),a(5),P(o.hiddenIPOSInventory()==!1?13:-1),a(),m("ngForOf",o.channel),a(),V(o.data))},dependencies:[Q,K,X,Y,G,J,ie,ee,te,ne,Ce,xe,se,de,ue,ae,le,me,_e,fe],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}"]});let t=l;return t})();export{ht as a};
1
+ import{a as he}from"./chunk-MZNSPLFO.js";import{a as oe}from"./chunk-BVIRHZTZ.js";import{a as fe}from"./chunk-E5BOLHDG.js";import{a as xe,b as Ce}from"./chunk-A37OKNC2.js";import{c as ue}from"./chunk-DYLT6RRK.js";import{a as ge}from"./chunk-D76K4RZ7.js";import{g as de}from"./chunk-EIBGI6U2.js";import{g as ce}from"./chunk-QOITECN4.js";import{d as pe,g as se}from"./chunk-4CEFDQPI.js";import{t as _e,u as me}from"./chunk-2SC3HO66.js";import{b as ee,h as te,m as ne,y as ie}from"./chunk-2E5AKA74.js";import{c as re,e as le,f as ae}from"./chunk-FTHTFVHH.js";import{Ab as H,Ac as G,Ec as J,Fc as Q,Ha as v,Ib as b,Ja as a,Jb as s,Ka as F,Kb as k,Lb as S,Nb as O,Ob as D,Pb as N,Rb as Z,Tb as T,V as z,_a as p,ab as m,ac as $,bc as j,c as W,cc as q,dc as y,ga as A,hb as P,ib as E,kb as M,lb as V,mb as c,nb as _,oa as g,ob as I,pa as u,pb as x,qb as C,rb as R,sb as f,vb as h,vc as K,xa as B,xb as r,xc as X,yc as Y,za as U}from"./chunk-ZIZWZZ4E.js";var L=t=>[t],Te=t=>({"text-decoration-line-through":t}),be=t=>({"ms-10":t}),Se=t=>({"bg-gradient-warning":t});function ve(t,l){if(t&1){let n=f();c(0,"mat-slide-toggle",13),h("toggleChange",function(){g(n);let e=r();return e.toggleStatus=!e.toggleStatus,u(e.onToggle())}),c(1,"small",14),s(2),_()()}if(t&2){let n=r();a(2),S(" ",n.productToggleTitle?n.productToggleTitle:"FILTER DIFFERENT INVENTORY"," ")}}function Ie(t,l){if(t&1){let n=f();c(0,"th")(1,"input",16),N("ngModelChange",function(e){g(n);let o=r(2);return D(o.checkboxState,e)||(o.checkboxState=e),u(e)}),h("ngModelChange",function(){g(n);let e=r(2);return u(e.onCheckboxStateChange())}),_()()}if(t&2){let n=r(2);a(),O("ngModel",n.checkboxState)}}function ye(t,l){if(t&1&&(p(0,Ie,2,1,"ng-template",15),c(1,"th",11),s(2,"POS"),_()),t&2){let n=r();m("ngxPermissionsOnly",T(1,L,n.rolePriceEdit))}}function we(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),s(6),$(7,"stringLimit"),_()()()(),C()),t&2){let n=l.$implicit;a(3),m("matTooltip",(n.Name==null?null:n.Name.length)>20?n.Name:""),a(),m("src",n==null?null:n.Img,v),a(2),S(" ",q(7,3,n.Name,20)," ")}}function Fe(t,l){t&1&&R(0)}function Pe(t,l){if(t&1&&(x(0),p(1,Fe,1,0,"ng-container",34),C()),t&2){r();let n=b(7);a(),m("ngTemplateOutlet",n)}}function Ee(t,l){t&1&&R(0)}function Me(t,l){if(t&1&&p(0,Ee,1,0,"ng-container",34),t&2){r(2);let n=b(7);m("ngTemplateOutlet",n)}}function Ve(t,l){if(t&1&&p(0,Me,1,1,"ng-template",15),t&2){let n=r(4);m("ngxPermissionsOnly",T(1,L,n.rolePriceEdit))}}function ke(t,l){if(t&1){let n=f();x(0),c(1,"input",35),N("ngModelChange",function(e){g(n);let o=r(4).$implicit;return D(o.selected,e)||(o.selected=e),u(e)}),h("ngModelChange",function(){g(n);let e=r(4).$implicit,o=r();return u(o.onCheckboxStateProduct(e.ID))}),_(),C()}if(t&2){let n=r(4).$implicit;a(),O("ngModel",n.selected)}}function Oe(t,l){if(t&1&&p(0,ke,2,1,"ng-container",22),t&2){let n=r(3).$implicit;m("ngIf",(n==null||n.Variants==null?null:n.Variants.length)>1)}}function De(t,l){if(t&1){let n=f();x(0),c(1,"img",36),h("click",function(e){g(n);let o=r(3).$implicit,d=r();return u(d.onZoomImage(e,o==null?null:o.ImageUrl))}),_(),C()}if(t&2){let n=r(3).$implicit;a(),H("src",n==null?null:n.ThumbnailUrl,v)}}function Ne(t,l){t&1&&I(0,"img",37)}function $e(t,l){if(t&1&&(x(0),c(1,"td",29)(2,"div",30),p(3,Pe,2,1,"ng-container",31)(4,Ve,1,3,"ng-template",null,0,y)(6,Oe,1,1,"ng-template",null,1,y),c(8,"div",26),p(9,De,2,1,"ng-container",31)(10,Ne,1,0,"ng-template",null,2,y),_()()(),c(12,"td",32)(13,"div"),s(14),_(),c(15,"small",33),s(16),_()(),C()),t&2){let n=b(5),i=b(11),e=r(2).$implicit,o=r();a(),m("rowSpan",e==null?null:e.Variants.length),a(2),m("ngIf",o.table=="inventory")("ngIfElse",n),a(5),m("ngClass",T(9,be,(e==null||e.Variants==null?null:e.Variants.length)<=1)),a(),m("ngIf",e==null?null:e.ThumbnailUrl)("ngIfElse",i),a(3),m("rowSpan",e==null?null:e.Variants.length),a(2),k(e==null?null:e.Name),a(2),S("(",e==null?null:e.Category,")")}}function Be(t,l){if(t&1){let n=f();c(0,"input",16),N("ngModelChange",function(e){g(n);let o=r(3).$implicit;return D(o.selected,e)||(o.selected=e),u(e)}),_()}if(t&2){let n=r(3).$implicit;O("ngModel",n.selected)}}function Ue(t,l){if(t&1&&(c(0,"td",38),p(1,Be,1,1,"input",39),_()),t&2){let n=r(2).$implicit,i=r(2);a(),m("ngIf",i.printPOS(n)>=0||i.table=="price")}}function Re(t,l){if(t&1&&(p(0,Ue,2,1,"ng-template",15),c(1,"td",24),s(2),$(3,"number"),_()),t&2){let n=r().$implicit,i=r(2);m("ngxPermissionsOnly",T(4,L,i.rolePriceEdit)),a(2),k(j(3,2,i.printPOS(n)))}}function je(t,l){if(t&1){let n=f();x(0),c(1,"td",40),h("click",function(){g(n);let e=r().$implicit,o=r().$implicit,d=r().$implicit,w=r();return u(w.openTableDialog(d.Name,o,e.ID,d.ChannelItemID))}),c(2,"div",30)(3,"div",41),s(4),$(5,"number"),_(),c(6,"a",42),h("click",function(e){return g(n),u(e==null?null:e.stopPropagation())}),I(7,"i",28),_()()(),C()}if(t&2){let n=l.$implicit,i=r(2).$implicit,e=r(2);a(),m("ngClass",T(5,Se,e.printPOS(i)!=e.printItem(n)&&e.hiddenIPOSInventory()==!1)),a(3),S(" ",j(5,3,e.printItem(n))," "),a(2),m("href",n.Url,v)}}function Le(t,l){t&1&&(c(0,"td",43)(1,"div",30)(2,"span"),s(3,"X"),_()()())}function We(t,l){if(t&1&&p(0,je,8,7,"ng-container",31)(1,Le,4,0,"ng-template",null,3,y),t&2){let n=l.$implicit,i=b(2),e=r().$implicit,o=r(2);m("ngIf",o.getItemFromChannel(e,n))("ngIfElse",i)}}function ze(t,l){if(t&1&&(c(0,"tr"),p(1,$e,17,11,"ng-container",22),c(2,"td",23),s(3),_(),c(4,"td",24)(5,"div",25)(6,"div",26),s(7),_(),c(8,"div",21)(9,"a",27),I(10,"i",28),_()()()(),p(11,Re,4,6),M(12,We,3,2,null,null,E),_()),t&2){let n=l.$implicit,i=l.$index,e=r(2);a(),m("ngIf",i==0),a(2),k(n==null?null:n.Model),a(2),m("matTooltip",n.Discontinued?e.discontinuedVariantMsg:""),a(),m("ngClass",T(7,Te,n.Discontinued)),a(),S(" ",n.Code," "),a(2),m("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),v),a(2),P(e.hiddenIPOSInventory()==!1?11:-1),a(),V(e.channel)}}function Ae(t,l){if(t&1&&(c(0,"tbody"),M(1,ze,14,9,"tr",null,E),_()),t&2){let n=l.$implicit;a(),V(n.Variants)}}var ht=(()=>{let l=class l{constructor(i,e,o){this.dialog=i,this.biggerPictureService=e,this.authService=o,this.showProductToggle=!1,this.multiwarehouse=B(!1),this.hiddenIPOSInventory=B(!1),this.toggleStatus=!1,this.checkboxState=!1,this.rolePriceEdit=oe.price,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 U,this.destroy$=new W,this.toggle=new U,this.hostName=this.authService.getDomain()}ngOnInit(){this.table=="inventory"?this.stockHeader="Stock":this.table=="price"&&(this.stockHeader="Price")}onCheckboxStateProduct(i){let e=this.data.filter(o=>o.ID==i);e.length>0&&(e=e.map(o=>(o.Variants=o.Variants.map(d=>(d.selected=o.selected,d)),o)))}onCheckboxStateChange(){this.data=this.data.map(i=>(i.Variants=i.Variants.map(e=>(e.selected=this.checkboxState,e)),i))}getItemFromChannel(i,e){return i.Channel.find(d=>re.IsNotEmpty(e.LocationID)?d.LocationID==e.LocationID:d.ChannelID==e.ID)}printItem(i){if(this.table=="inventory")return i.Inventory;if(this.table=="price")return i.Price}openTableDialog(i,e,o,d){this.dialog.open(he,{data:{Name:i,Variant:e,ChannelID:o,Table:this.table,ChannelItemID:d}}).afterClosed().pipe(z(this.destroy$)).subscribe(w=>{w!=null&&this.onSubmit.emit(w)})}printPOS(i){return this.table=="inventory"?i.Inventory?i.Inventory:0:this.table=="price"?i.UnitPrice:null}onToggle(){this.toggle.emit(this.toggleStatus)}onZoomImage(i,e){this.biggerPictureService.openBiggerPicture(i,e)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};l.\u0275fac=function(e){return new(e||l)(F(pe),F(ge),F(ce))},l.\u0275cmp=A({type:l,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"},standalone:!0,features:[Z],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,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"text-center",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-center"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"padding-left","0px",3,"rowSpan"],[1,"mt-1"],[4,"ngTemplateOutlet"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],[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"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],[1,"p-0","pointer","cell-hover",3,"click","ngClass"],[1,"me-2","mt-1"],["target","_blank",3,"click","href"],[1,"table-white","text-center",2,"color","red"]],template:function(e,o){e&1&&(c(0,"div",4)(1,"table",5)(2,"thead",6)(3,"tr")(4,"th",7)(5,"div",8)(6,"div"),s(7,"Product"),_(),p(8,ve,3,1,"mat-slide-toggle",9),_()(),c(9,"th",10),s(10,"Variant"),_(),c(11,"th",11),s(12,"SKU"),_(),p(13,ye,3,3)(14,we,8,6,"ng-container",12),_()(),M(15,Ae,3,0,"tbody",null,E),_()()),e&2&&(a(8),P(o.showProductToggle?8:-1),a(5),P(o.hiddenIPOSInventory()==!1?13:-1),a(),m("ngForOf",o.channel),a(),V(o.data))},dependencies:[Q,K,X,Y,G,J,ie,ee,te,ne,Ce,xe,se,de,ue,ae,le,me,_e,fe],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}"]});let t=l;return t})();export{ht as a};