marketplacepos 3.20.8 → 3.21.1
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.
- package/Marketplace/{chunk-NREK5LA6.js → chunk-2KLVX7O5.js} +1 -1
- package/Marketplace/{chunk-7RXTYW3B.js → chunk-2YNHF5VE.js} +1 -1
- package/Marketplace/{chunk-AM55EQMX.js → chunk-44RVW2RQ.js} +1 -1
- package/Marketplace/{chunk-EKA76B4K.js → chunk-45ETPFJ5.js} +1 -1
- package/Marketplace/chunk-4GVZ3VRC.js +52 -0
- package/Marketplace/{chunk-OEYCEBSD.js → chunk-5VHCYTXT.js} +1 -1
- package/Marketplace/{chunk-JB2FBPME.js → chunk-AH6VMXET.js} +1 -1
- package/Marketplace/{chunk-RI5C7LLN.js → chunk-BIDA5B2H.js} +1 -1
- package/Marketplace/chunk-CDJSFYAA.js +1 -0
- package/Marketplace/chunk-DMVTFOY7.js +4 -0
- package/Marketplace/{chunk-HZJNPCBI.js → chunk-DOEP2KOD.js} +1 -1
- package/Marketplace/chunk-DY2P6RVD.js +1 -0
- package/Marketplace/{chunk-3YVIB6CC.js → chunk-F4QDIL47.js} +1 -1
- package/Marketplace/{chunk-3SMSJGST.js → chunk-FUVETEZX.js} +1 -1
- package/Marketplace/{chunk-JF52POHG.js → chunk-J3363EHD.js} +1 -1
- package/Marketplace/{chunk-5K4WRBCE.js → chunk-J3Q25CP2.js} +1 -1
- package/Marketplace/{chunk-AHIWTEG3.js → chunk-JHUC34EK.js} +1 -1
- package/Marketplace/{chunk-H3XVRLMZ.js → chunk-LOIHWDCD.js} +1 -1
- package/Marketplace/{chunk-I7KCIWCN.js → chunk-QHBYKGZT.js} +1 -1
- package/Marketplace/{chunk-34PP6HJW.js → chunk-QS5PGQR5.js} +2 -2
- package/Marketplace/{chunk-55NJCTT3.js → chunk-SMJLUQ5C.js} +1 -1
- package/Marketplace/{chunk-H4B5TTCJ.js → chunk-T3L4XLGR.js} +1 -1
- package/Marketplace/{chunk-QE2GPS45.js → chunk-U2PDWSU3.js} +1 -1
- package/Marketplace/{chunk-R2NELHIC.js → chunk-UEUWNU67.js} +1 -1
- package/Marketplace/{chunk-GLBXDNQB.js → chunk-UOX3GFQQ.js} +1 -1
- package/Marketplace/{chunk-5OIZQ4HS.js → chunk-UPLK5B7M.js} +1 -1
- package/Marketplace/{chunk-EGYILQWG.js → chunk-UVOYHHTH.js} +1 -1
- package/Marketplace/{chunk-AR5SSAIO.js → chunk-UW6NE76R.js} +1 -1
- package/Marketplace/{chunk-SWXW6HCG.js → chunk-ZKE4QZNM.js} +1 -1
- package/Marketplace/chunk-ZNVGLDVF.js +9 -0
- package/Marketplace/{chunk-EDIHKCTJ.js → chunk-ZX2VCK6U.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-KXAPH4VR.js → main-IQD6HIQL.js} +1 -1
- package/package.json +1 -1
- package/Marketplace/chunk-5FOPZ5IX.js +0 -4
- package/Marketplace/chunk-5ZUIIYSQ.js +0 -3
- package/Marketplace/chunk-PTFQX4VB.js +0 -1
- package/Marketplace/chunk-SQTY2CZY.js +0 -1
- package/Marketplace/chunk-U2KZLYTH.js +0 -52
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-55NJCTT3.js";import{a as Oe}from"./chunk-65RMQ5Q5.js";import{a as K}from"./chunk-XHAXYWZ7.js";import{a as De,b as Ve,c as X}from"./chunk-MZNSPLFO.js";import{a as _e}from"./chunk-BVIRHZTZ.js";import{a as Me}from"./chunk-JY3L4RUM.js";import{a as Ie}from"./chunk-7KG3DC5J.js";import{b as Ee}from"./chunk-ULELZXI5.js";import{a as Te}from"./chunk-E5BOLHDG.js";import"./chunk-A37OKNC2.js";import"./chunk-C6QIBOCB.js";import{a as we}from"./chunk-7VKIP3Z6.js";import"./chunk-DYLT6RRK.js";import{a as Se,b as ve,c as ye}from"./chunk-GQG2K3LS.js";import{a as Fe}from"./chunk-D76K4RZ7.js";import"./chunk-EIBGI6U2.js";import{g as fe}from"./chunk-5FOPZ5IX.js";import{b as ue,e as ge}from"./chunk-JHYIHRQH.js";import"./chunk-KCDL7SWP.js";import{d as xe,m as Pe,n as be}from"./chunk-4CEFDQPI.js";import{t as j,u as W}from"./chunk-2SC3HO66.js";import"./chunk-DQIP7MCZ.js";import{b as de,h as L,m as U,y as A}from"./chunk-2E5AKA74.js";import{c as J,e as he,f as Ce}from"./chunk-FTHTFVHH.js";import{Ab as ie,B as G,Bc as me,Ec as pe,Fc as $,Ha as T,Ib as z,Ja as l,Jb as p,Ka as P,Kb as oe,Lb as x,Nb as V,Ob as N,Pb as k,Q as q,Qb as re,Rb as B,Tb as F,Ub as ae,X as Y,_a as g,ab as s,ac as S,bc as w,cc as le,da as Q,db as te,dc as H,ga as D,hb as ne,ib as E,kb as M,lb as O,mb as a,nb as c,oa as C,ob as b,pa as f,pb as v,q as Z,qb as y,sb as I,vb as h,vc as ce,xb as m,xc as R,yc as se,za as ee}from"./chunk-ZIZWZZ4E.js";import"./chunk-GNOSNGXM.js";var Ae=(t,r)=>({color:t,"font-weight":r});function je(t,r){if(t&1&&(a(0,"mat-radio-button",2),p(1),c()),t&2){let i=r.$implicit,o=r.index,e=m();te(ae(7,Ae,e.model==i.Key&&e.activeBold?"#0976b4":"",e.model==i.Key&&e.activeBold?"700":"")),s("disabled",e.exception==i.Value)("matTooltip",e.title.length>0?e.title[o]:"")("value",i.Key)("name",e.name),l(),x("",i.Value," ")}}var Ne=(()=>{let r=class r{constructor(){this.disabled=!1,this.modelChange=new ee,this.options=[{Key:!1,Value:"No"},{Key:!0,Value:"Yes"}],this.border=!1,this.name="",this.title=[],this.exception="",this.activeBold=""}change(o){this.modelChange.emit(o)}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=D({type:r,selectors:[["lib-radio-options"]],inputs:{model:"model",disabled:"disabled",options:"options",border:"border",name:"name",title:"title",exception:"exception",activeBold:"activeBold"},outputs:{modelChange:"modelChange"},standalone:!0,features:[B],decls:2,vars:3,consts:[["color","primary",3,"ngModelChange","disabled","ngModel"],["matTooltipPosition","above","class","me-4 mt-1",3,"style","disabled","matTooltip","value","name",4,"ngFor","ngForOf"],["matTooltipPosition","above",1,"me-4","mt-1",3,"disabled","matTooltip","value","name"]],template:function(e,n){e&1&&(a(0,"mat-radio-group",0),h("ngModelChange",function(_){return n.change(_)}),g(1,je,2,10,"mat-radio-button",1),c()),e&2&&(s("disabled",n.disabled)("ngModel",n.model),l(),s("ngForOf",n.options))},dependencies:[$,R,ye,Se,ve,A,L,U,W,j],styles:["html[_ngcontent-%COMP%]{--mdc-radio-state-layer-size: 36px;--mat-radio-touch-target-display: block}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled:checked + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__outer-circle[_ngcontent-%COMP%]{border-color:#0976b4!important}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__inner-circle[_ngcontent-%COMP%]{background-color:#0976b4!important;border-color:#0976b4!important}"]});let t=r;return t})();var ke=t=>[t],We=t=>({"text-decoration-line-through":t}),Ke=t=>({"border-bottom":t}),Ge=t=>({"bg-gradient-warning":t});function ze(t,r){if(t&1){let i=I();v(0),a(1,"div",21)(2,"h6",22),p(3,"Filter by"),c(),a(4,"lib-radio-options",23),k("modelChange",function(e){C(i);let n=m();return N(n.filterType,e)||(n.filterType=e),f(e)}),c()(),y()}if(t&2){let i=m();l(4),V("model",i.filterType),s("options",i.filterTypeOptions)}}function He(t,r){if(t&1){let i=I();a(0,"button",25),h("click",function(){C(i);let e=m().ngIf,n=m();return f(n.onUpdateItems(e))}),b(1,"i",26),p(2," Update "),c()}}function Je(t,r){if(t&1&&(v(0),a(1,"div",4),g(2,He,3,0,"button",24),c(),y()),t&2){let i=r.ngIf,o=m();l(2),s("ngIf",o.productService.hasSelectionVariant(i))}}function Xe(t,r){if(t&1&&(a(0,"th",15)(1,"div",27),b(2,"img",28),a(3,"div",29),p(4),S(5,"stringLimit"),c()()()),t&2){let i=r.$implicit;l(),s("matTooltip",(i.Name==null?null:i.Name.length)>20?i.Name:""),l(),s("src",i==null?null:i.Img,T),l(2),x(" ",le(5,3,i.Name,20)," ")}}function Ze(t,r){if(t&1){let i=I();a(0,"th")(1,"input",30),k("ngModelChange",function(e){C(i);let n=m();return N(n.checkboxState,e)||(n.checkboxState=e),f(e)}),h("ngModelChange",function(){C(i);let e=m();return f(e.onSelectAllData())}),c()()}if(t&2){let i=m();l(),V("ngModel",i.checkboxState)}}function qe(t,r){t&1&&(a(0,"th",31)(1,"span"),p(2,"Expected"),c(),a(3,"span",32),p(4,"(POS)"),c()(),a(5,"th",31),p(6,"Channel"),c())}function Ye(t,r){if(t&1){let i=I();a(0,"img",45),h("click",function(e){C(i);let n=m(3).$implicit,d=m(2);return f(d.onZoomImage(e,n==null?null:n.ImageUrl))}),c()}if(t&2){let i=m(3).$implicit;ie("src",i==null?null:i.ImageUrl,T)}}function Qe(t,r){t&1&&b(0,"img",46)}function et(t,r){if(t&1&&(a(0,"small",44),p(1),c()),t&2){let i=m(3).$implicit;l(),x("(",i==null?null:i.Category,")")}}function tt(t,r){if(t&1&&(v(0),a(1,"td",40),g(2,Ye,1,1,"img",41)(3,Qe,1,0,"ng-template",null,0,H),c(),a(5,"td",42)(6,"h5",43),p(7),c(),g(8,et,2,1,"small",44),c(),y()),t&2){let i=z(4),o=m().$index,e=m().$implicit,n=m().ngIf;l(),s("rowSpan",e==null?null:e.Variants.length)("ngClass",F(7,Ke,o+1==n.length)),l(),s("ngIf",e==null?null:e.ImageUrl)("ngIfElse",i),l(3),s("rowSpan",e==null?null:e.Variants.length),l(2),oe(e==null?null:e.Name),l(),ne(e!=null&&e.Category?8:-1)}}function nt(t,r){if(t&1){let i=I();a(0,"td",47)(1,"input",30),k("ngModelChange",function(e){C(i);let n=m().$implicit;return N(n.selected,e)||(n.selected=e),f(e)}),c()()}if(t&2){let i=m().$implicit;l(),V("ngModel",i.selected)}}function it(t,r){if(t&1){let i=I();v(0),a(1,"td",49),p(2),S(3,"number"),c(),a(4,"td",50),h("click",function(){let e=C(i).$implicit,n=m(2).$implicit,d=m().$implicit,_=m(2);return f(_.openTableDialog(n,d,e))}),a(5,"div",51)(6,"div",52),p(7),S(8,"number"),c(),a(9,"a",53),h("click",function(e){return C(i),f(e==null?null:e.stopPropagation())}),b(10,"i",38),c()()(),y()}if(t&2){let i=r.$implicit;l(2),x(" ",w(3,4,i.PriceExpected)," "),l(2),s("ngClass",F(8,Ge,i.Price!=i.PriceExpected)),l(3),x(" ",w(8,6,i.Price)," "),l(2),s("href",i.Url,T)}}function ot(t,r){t&1&&(a(0,"td",54),p(1," X "),c(),a(2,"td",54),p(3," X "),c())}function rt(t,r){if(t&1&&(v(0),g(1,it,11,10,"ng-container",48)(2,ot,4,0,"ng-template",null,1,H),y()),t&2){let i=r.$implicit,o=z(3),e=m().$implicit,n=m(3);l(),s("ngIf",n.getItemFromChannel(e,i.ID))("ngIfElse",o)}}function at(t,r){if(t&1&&(a(0,"tr"),g(1,tt,9,9,"ng-container",3),a(2,"td",33),p(3),c(),a(4,"td",34)(5,"div",35)(6,"div",36),p(7),c(),a(8,"div",29)(9,"a",37),b(10,"i",38),c()()()(),g(11,nt,2,1,"ng-template",19)(12,rt,4,2,"ng-container",39),c()),t&2){let i=r.$implicit,o=r.$index,e=m(3);l(),s("ngIf",o==0),l(2),x(" ",i==null?null:i.Model," "),l(),s("matTooltip",i.Discontinued?e.discontinuedVariantMsg:""),l(2),s("ngClass",F(8,We,i.Discontinued)),l(),x(" ",i==null?null:i.Code," "),l(2),s("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(i==null?null:i.ID),T),l(2),s("ngxPermissionsOnly",F(10,ke,e.rolePriceEdit)),l(),s("ngForOf",e.channelOptions)}}function lt(t,r){if(t&1&&(a(0,"tbody"),M(1,at,13,12,"tr",null,E),c()),t&2){let i=r.$implicit;l(),O(i.Variants)}}function ct(t,r){if(t&1&&(v(0),M(1,lt,3,0,"tbody",null,E),y()),t&2){let i=r.ngIf;l(),O(i)}}var Zt=(()=>{let r=class r{constructor(o,e,n,d,_,u,Be){this.http=o,this.toastr=e,this.dialog=n,this.productService=d,this.authService=_,this.biggerPictureService=u,this.paginationService=Be,this.infinitePagination=Q(X),this.searchFilter=new Ie,this.checkboxState=!1,this.rolePriceEdit=_e.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.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.filterTypeOptions=[{Key:K.ALL,Value:"All"},{Key:K.DIFFERENCE,Value:"Difference"}],this.filterType=K.ALL,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()}initPagination(){this.infinitePagination.fetchDataEndpoint="Price/GetOutletPrice",this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.infinitePagination.data$.pipe(q(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(Y(o=>{this.searchFilter=o.Filter,this.infinitePagination.reloadPagination(this.searchFilter)}))}onSelectAllData(){this.data$=this.data$.pipe(Z(o=>(o.map(e=>(e.Variants&&(e.Variants=e.Variants.map(n=>(n.selected=this.checkboxState,n))),e)),o)))}onFilter(o){this.searchFilter.text=o;let e={text:o,filterModel:this.filterType,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount};this.infinitePagination.reloadPagination(e)}updatePrice(o){let e=this.productService.selectedVariantProduct(o);if(e.length>0){let n=e.map(u=>u.ID),_={ListChannelID:this.channelOptions.filter(u=>u.selected).map(u=>u.ID),ListID:n};this.http.post("/api/Price/UpdateChannelOutletPrice",_).subscribe({next:u=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+_.ListID.length+" items in "+_.ListChannelID.length+" channels","Success")},error:u=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(o=>(o.selected=!1,o))}getItemFromChannel(o,e){return o.Channel.find(n=>n.ChannelID==e)}onUpdateItems(o){let e=this.productService.selectedVariantProduct(o);this.dialog.open(Oe,{data:{selectedItems:e,channels:this.channelOptions},width:"600px"}).afterClosed().pipe(G(n=>J.IsNotEmpty(n))).subscribe(n=>{this.channelOptions=n,this.updatePrice(o)})}openTableDialog(o,e,n){let d=JSON.parse(JSON.stringify(o));this.dialog.open(De,{data:{Name:e.Name,Variant:d,ChannelID:n?.ChannelID,Table:"price",ChannelItemID:n?.ChannelItemID}}).afterClosed().pipe(G(u=>J.IsNotEmpty(u))).subscribe(u=>{this.updateProductPrice(u,n)})}updateProductPrice(o,e){let n={ID:o.ChannelID,ChannelItemID:o.ChannelItemID,ChannelVariantID:o.ChannelVariationID,Price:parseFloat(o.Price),VariantID:o.ID,SKU:o.Sku};this.http.post("/api/Price/UpdatePriceByID",n).subscribe(d=>{e.Price=n.Price;let _=this.productService.findChannelById(n.ID,this.channelOptions);this.toastr.success(`Successfully updated ${o.ItemName} (${o.VarName}) inventory in ${_.Name} to ${n.Price}`,"Success")})}openExportDialog(){this.dialog.open(Ee,{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(o,e){this.biggerPictureService.openBiggerPicture(o,e)}};r.\u0275fac=function(e){return new(e||r)(P(ge),P(ue),P(xe),P(we),P(fe),P(Fe),P(Me))},r.\u0275cmp=D({type:r,selectors:[["app-custom-channel-price"]],standalone:!0,features:[re([X]),B],decls:38,vars:23,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"],[2,"height","46px"],[1,"mb-3"],["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","border","pointer","cell-hover",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(e,n){e&1&&(a(0,"mainpanel",2),h("onSubmit",function(_){return n.onFilter(_)}),a(1,"filters"),g(2,ze,5,2,"ng-container",3),S(3,"async"),c(),a(4,"actions")(5,"div",4),g(6,Je,3,1,"ng-container",3),S(7,"async"),a(8,"button",5),h("click",function(){return n.openExportDialog()}),b(9,"i",6),a(10,"span"),p(11,"Export"),c()()()(),a(12,"content")(13,"div",7)(14,"div",8)(15,"div",9)(16,"div",10)(17,"table",11)(18,"thead",12)(19,"tr",13),b(20,"th",14),M(21,Xe,6,6,"th",15,E),c(),a(23,"tr")(24,"th",16)(25,"span"),p(26," Product "),c()(),a(27,"th",17),p(28,"Variant"),c(),a(29,"th",18),p(30,"SKU"),c(),g(31,Ze,2,1,"ng-template",19),M(32,qe,7,0,null,null,E),c()(),g(34,ct,3,0,"ng-container",3),S(35,"async"),c(),a(36,"infinite-paginator",20),S(37,"async"),h("onNextPage",function(){return n.infinitePagination.onNextPage(n.searchFilter)})("onLastPage",function(){return n.infinitePagination.onLastPage(n.searchFilter)})("onGetRowCount",function(){return n.infinitePagination.getRowCount(n.searchFilter)}),c()()()()()()()),e&2&&(s("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),l(2),s("ngIf",w(3,13,n.loader$)),l(4),s("ngIf",w(7,15,n.data$)),l(15),O(n.channelOptions),l(10),s("ngxPermissionsOnly",F(21,ke,n.rolePriceEdit)),l(),O(n.channelOptions),l(2),s("ngIf",w(35,17,n.data$)),l(2),s("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",w(37,19,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage()))},dependencies:[$,ce,R,se,me,pe,be,Pe,A,de,L,U,Ve,Ne,W,j,Te,Ce,he],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}"]});let t=r;return t})();export{Zt as CustomChannelPriceComponent};
|
|
1
|
+
import"./chunk-SMJLUQ5C.js";import{a as Oe}from"./chunk-65RMQ5Q5.js";import{a as K}from"./chunk-XHAXYWZ7.js";import{a as De,b as Ve,c as X}from"./chunk-MZNSPLFO.js";import{a as _e}from"./chunk-BVIRHZTZ.js";import{a as Me}from"./chunk-JY3L4RUM.js";import{a as Ie}from"./chunk-7KG3DC5J.js";import{b as Ee}from"./chunk-ULELZXI5.js";import{a as Te}from"./chunk-E5BOLHDG.js";import"./chunk-A37OKNC2.js";import"./chunk-C6QIBOCB.js";import{a as we}from"./chunk-7VKIP3Z6.js";import"./chunk-DYLT6RRK.js";import{a as Se,b as ve,c as ye}from"./chunk-GQG2K3LS.js";import{a as Fe}from"./chunk-D76K4RZ7.js";import"./chunk-EIBGI6U2.js";import{i as fe}from"./chunk-DMVTFOY7.js";import{b as ue,e as ge}from"./chunk-JHYIHRQH.js";import"./chunk-KCDL7SWP.js";import{d as xe,m as Pe,n as be}from"./chunk-4CEFDQPI.js";import{t as j,u as W}from"./chunk-2SC3HO66.js";import"./chunk-DQIP7MCZ.js";import{b as de,h as L,m as U,y as A}from"./chunk-2E5AKA74.js";import{c as J,e as he,f as Ce}from"./chunk-FTHTFVHH.js";import{Ab as ie,B as G,Bc as me,Ec as pe,Fc as $,Ha as T,Ib as z,Ja as l,Jb as p,Ka as P,Kb as oe,Lb as x,Nb as V,Ob as N,Pb as k,Q as q,Qb as re,Rb as B,Tb as F,Ub as ae,X as Y,_a as g,ab as s,ac as S,bc as w,cc as le,da as Q,db as te,dc as H,ga as D,hb as ne,ib as E,kb as M,lb as O,mb as a,nb as c,oa as C,ob as b,pa as f,pb as v,q as Z,qb as y,sb as I,vb as h,vc as ce,xb as m,xc as R,yc as se,za as ee}from"./chunk-ZIZWZZ4E.js";import"./chunk-GNOSNGXM.js";var Ae=(t,r)=>({color:t,"font-weight":r});function je(t,r){if(t&1&&(a(0,"mat-radio-button",2),p(1),c()),t&2){let i=r.$implicit,o=r.index,e=m();te(ae(7,Ae,e.model==i.Key&&e.activeBold?"#0976b4":"",e.model==i.Key&&e.activeBold?"700":"")),s("disabled",e.exception==i.Value)("matTooltip",e.title.length>0?e.title[o]:"")("value",i.Key)("name",e.name),l(),x("",i.Value," ")}}var Ne=(()=>{let r=class r{constructor(){this.disabled=!1,this.modelChange=new ee,this.options=[{Key:!1,Value:"No"},{Key:!0,Value:"Yes"}],this.border=!1,this.name="",this.title=[],this.exception="",this.activeBold=""}change(o){this.modelChange.emit(o)}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=D({type:r,selectors:[["lib-radio-options"]],inputs:{model:"model",disabled:"disabled",options:"options",border:"border",name:"name",title:"title",exception:"exception",activeBold:"activeBold"},outputs:{modelChange:"modelChange"},standalone:!0,features:[B],decls:2,vars:3,consts:[["color","primary",3,"ngModelChange","disabled","ngModel"],["matTooltipPosition","above","class","me-4 mt-1",3,"style","disabled","matTooltip","value","name",4,"ngFor","ngForOf"],["matTooltipPosition","above",1,"me-4","mt-1",3,"disabled","matTooltip","value","name"]],template:function(e,n){e&1&&(a(0,"mat-radio-group",0),h("ngModelChange",function(_){return n.change(_)}),g(1,je,2,10,"mat-radio-button",1),c()),e&2&&(s("disabled",n.disabled)("ngModel",n.model),l(),s("ngForOf",n.options))},dependencies:[$,R,ye,Se,ve,A,L,U,W,j],styles:["html[_ngcontent-%COMP%]{--mdc-radio-state-layer-size: 36px;--mat-radio-touch-target-display: block}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled:checked + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__outer-circle[_ngcontent-%COMP%]{border-color:#0976b4!important}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__inner-circle[_ngcontent-%COMP%]{background-color:#0976b4!important;border-color:#0976b4!important}"]});let t=r;return t})();var ke=t=>[t],We=t=>({"text-decoration-line-through":t}),Ke=t=>({"border-bottom":t}),Ge=t=>({"bg-gradient-warning":t});function ze(t,r){if(t&1){let i=I();v(0),a(1,"div",21)(2,"h6",22),p(3,"Filter by"),c(),a(4,"lib-radio-options",23),k("modelChange",function(e){C(i);let n=m();return N(n.filterType,e)||(n.filterType=e),f(e)}),c()(),y()}if(t&2){let i=m();l(4),V("model",i.filterType),s("options",i.filterTypeOptions)}}function He(t,r){if(t&1){let i=I();a(0,"button",25),h("click",function(){C(i);let e=m().ngIf,n=m();return f(n.onUpdateItems(e))}),b(1,"i",26),p(2," Update "),c()}}function Je(t,r){if(t&1&&(v(0),a(1,"div",4),g(2,He,3,0,"button",24),c(),y()),t&2){let i=r.ngIf,o=m();l(2),s("ngIf",o.productService.hasSelectionVariant(i))}}function Xe(t,r){if(t&1&&(a(0,"th",15)(1,"div",27),b(2,"img",28),a(3,"div",29),p(4),S(5,"stringLimit"),c()()()),t&2){let i=r.$implicit;l(),s("matTooltip",(i.Name==null?null:i.Name.length)>20?i.Name:""),l(),s("src",i==null?null:i.Img,T),l(2),x(" ",le(5,3,i.Name,20)," ")}}function Ze(t,r){if(t&1){let i=I();a(0,"th")(1,"input",30),k("ngModelChange",function(e){C(i);let n=m();return N(n.checkboxState,e)||(n.checkboxState=e),f(e)}),h("ngModelChange",function(){C(i);let e=m();return f(e.onSelectAllData())}),c()()}if(t&2){let i=m();l(),V("ngModel",i.checkboxState)}}function qe(t,r){t&1&&(a(0,"th",31)(1,"span"),p(2,"Expected"),c(),a(3,"span",32),p(4,"(POS)"),c()(),a(5,"th",31),p(6,"Channel"),c())}function Ye(t,r){if(t&1){let i=I();a(0,"img",45),h("click",function(e){C(i);let n=m(3).$implicit,d=m(2);return f(d.onZoomImage(e,n==null?null:n.ImageUrl))}),c()}if(t&2){let i=m(3).$implicit;ie("src",i==null?null:i.ImageUrl,T)}}function Qe(t,r){t&1&&b(0,"img",46)}function et(t,r){if(t&1&&(a(0,"small",44),p(1),c()),t&2){let i=m(3).$implicit;l(),x("(",i==null?null:i.Category,")")}}function tt(t,r){if(t&1&&(v(0),a(1,"td",40),g(2,Ye,1,1,"img",41)(3,Qe,1,0,"ng-template",null,0,H),c(),a(5,"td",42)(6,"h5",43),p(7),c(),g(8,et,2,1,"small",44),c(),y()),t&2){let i=z(4),o=m().$index,e=m().$implicit,n=m().ngIf;l(),s("rowSpan",e==null?null:e.Variants.length)("ngClass",F(7,Ke,o+1==n.length)),l(),s("ngIf",e==null?null:e.ImageUrl)("ngIfElse",i),l(3),s("rowSpan",e==null?null:e.Variants.length),l(2),oe(e==null?null:e.Name),l(),ne(e!=null&&e.Category?8:-1)}}function nt(t,r){if(t&1){let i=I();a(0,"td",47)(1,"input",30),k("ngModelChange",function(e){C(i);let n=m().$implicit;return N(n.selected,e)||(n.selected=e),f(e)}),c()()}if(t&2){let i=m().$implicit;l(),V("ngModel",i.selected)}}function it(t,r){if(t&1){let i=I();v(0),a(1,"td",49),p(2),S(3,"number"),c(),a(4,"td",50),h("click",function(){let e=C(i).$implicit,n=m(2).$implicit,d=m().$implicit,_=m(2);return f(_.openTableDialog(n,d,e))}),a(5,"div",51)(6,"div",52),p(7),S(8,"number"),c(),a(9,"a",53),h("click",function(e){return C(i),f(e==null?null:e.stopPropagation())}),b(10,"i",38),c()()(),y()}if(t&2){let i=r.$implicit;l(2),x(" ",w(3,4,i.PriceExpected)," "),l(2),s("ngClass",F(8,Ge,i.Price!=i.PriceExpected)),l(3),x(" ",w(8,6,i.Price)," "),l(2),s("href",i.Url,T)}}function ot(t,r){t&1&&(a(0,"td",54),p(1," X "),c(),a(2,"td",54),p(3," X "),c())}function rt(t,r){if(t&1&&(v(0),g(1,it,11,10,"ng-container",48)(2,ot,4,0,"ng-template",null,1,H),y()),t&2){let i=r.$implicit,o=z(3),e=m().$implicit,n=m(3);l(),s("ngIf",n.getItemFromChannel(e,i.ID))("ngIfElse",o)}}function at(t,r){if(t&1&&(a(0,"tr"),g(1,tt,9,9,"ng-container",3),a(2,"td",33),p(3),c(),a(4,"td",34)(5,"div",35)(6,"div",36),p(7),c(),a(8,"div",29)(9,"a",37),b(10,"i",38),c()()()(),g(11,nt,2,1,"ng-template",19)(12,rt,4,2,"ng-container",39),c()),t&2){let i=r.$implicit,o=r.$index,e=m(3);l(),s("ngIf",o==0),l(2),x(" ",i==null?null:i.Model," "),l(),s("matTooltip",i.Discontinued?e.discontinuedVariantMsg:""),l(2),s("ngClass",F(8,We,i.Discontinued)),l(),x(" ",i==null?null:i.Code," "),l(2),s("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(i==null?null:i.ID),T),l(2),s("ngxPermissionsOnly",F(10,ke,e.rolePriceEdit)),l(),s("ngForOf",e.channelOptions)}}function lt(t,r){if(t&1&&(a(0,"tbody"),M(1,at,13,12,"tr",null,E),c()),t&2){let i=r.$implicit;l(),O(i.Variants)}}function ct(t,r){if(t&1&&(v(0),M(1,lt,3,0,"tbody",null,E),y()),t&2){let i=r.ngIf;l(),O(i)}}var Zt=(()=>{let r=class r{constructor(o,e,n,d,_,u,Be){this.http=o,this.toastr=e,this.dialog=n,this.productService=d,this.authService=_,this.biggerPictureService=u,this.paginationService=Be,this.infinitePagination=Q(X),this.searchFilter=new Ie,this.checkboxState=!1,this.rolePriceEdit=_e.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.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.filterTypeOptions=[{Key:K.ALL,Value:"All"},{Key:K.DIFFERENCE,Value:"Difference"}],this.filterType=K.ALL,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()}initPagination(){this.infinitePagination.fetchDataEndpoint="Price/GetOutletPrice",this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.infinitePagination.data$.pipe(q(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(Y(o=>{this.searchFilter=o.Filter,this.infinitePagination.reloadPagination(this.searchFilter)}))}onSelectAllData(){this.data$=this.data$.pipe(Z(o=>(o.map(e=>(e.Variants&&(e.Variants=e.Variants.map(n=>(n.selected=this.checkboxState,n))),e)),o)))}onFilter(o){this.searchFilter.text=o;let e={text:o,filterModel:this.filterType,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount};this.infinitePagination.reloadPagination(e)}updatePrice(o){let e=this.productService.selectedVariantProduct(o);if(e.length>0){let n=e.map(u=>u.ID),_={ListChannelID:this.channelOptions.filter(u=>u.selected).map(u=>u.ID),ListID:n};this.http.post("/api/Price/UpdateChannelOutletPrice",_).subscribe({next:u=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+_.ListID.length+" items in "+_.ListChannelID.length+" channels","Success")},error:u=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(o=>(o.selected=!1,o))}getItemFromChannel(o,e){return o.Channel.find(n=>n.ChannelID==e)}onUpdateItems(o){let e=this.productService.selectedVariantProduct(o);this.dialog.open(Oe,{data:{selectedItems:e,channels:this.channelOptions},width:"600px"}).afterClosed().pipe(G(n=>J.IsNotEmpty(n))).subscribe(n=>{this.channelOptions=n,this.updatePrice(o)})}openTableDialog(o,e,n){let d=JSON.parse(JSON.stringify(o));this.dialog.open(De,{data:{Name:e.Name,Variant:d,ChannelID:n?.ChannelID,Table:"price",ChannelItemID:n?.ChannelItemID}}).afterClosed().pipe(G(u=>J.IsNotEmpty(u))).subscribe(u=>{this.updateProductPrice(u,n)})}updateProductPrice(o,e){let n={ID:o.ChannelID,ChannelItemID:o.ChannelItemID,ChannelVariantID:o.ChannelVariationID,Price:parseFloat(o.Price),VariantID:o.ID,SKU:o.Sku};this.http.post("/api/Price/UpdatePriceByID",n).subscribe(d=>{e.Price=n.Price;let _=this.productService.findChannelById(n.ID,this.channelOptions);this.toastr.success(`Successfully updated ${o.ItemName} (${o.VarName}) inventory in ${_.Name} to ${n.Price}`,"Success")})}openExportDialog(){this.dialog.open(Ee,{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(o,e){this.biggerPictureService.openBiggerPicture(o,e)}};r.\u0275fac=function(e){return new(e||r)(P(ge),P(ue),P(xe),P(we),P(fe),P(Fe),P(Me))},r.\u0275cmp=D({type:r,selectors:[["app-custom-channel-price"]],standalone:!0,features:[re([X]),B],decls:38,vars:23,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"],[2,"height","46px"],[1,"mb-3"],["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","border","pointer","cell-hover",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(e,n){e&1&&(a(0,"mainpanel",2),h("onSubmit",function(_){return n.onFilter(_)}),a(1,"filters"),g(2,ze,5,2,"ng-container",3),S(3,"async"),c(),a(4,"actions")(5,"div",4),g(6,Je,3,1,"ng-container",3),S(7,"async"),a(8,"button",5),h("click",function(){return n.openExportDialog()}),b(9,"i",6),a(10,"span"),p(11,"Export"),c()()()(),a(12,"content")(13,"div",7)(14,"div",8)(15,"div",9)(16,"div",10)(17,"table",11)(18,"thead",12)(19,"tr",13),b(20,"th",14),M(21,Xe,6,6,"th",15,E),c(),a(23,"tr")(24,"th",16)(25,"span"),p(26," Product "),c()(),a(27,"th",17),p(28,"Variant"),c(),a(29,"th",18),p(30,"SKU"),c(),g(31,Ze,2,1,"ng-template",19),M(32,qe,7,0,null,null,E),c()(),g(34,ct,3,0,"ng-container",3),S(35,"async"),c(),a(36,"infinite-paginator",20),S(37,"async"),h("onNextPage",function(){return n.infinitePagination.onNextPage(n.searchFilter)})("onLastPage",function(){return n.infinitePagination.onLastPage(n.searchFilter)})("onGetRowCount",function(){return n.infinitePagination.getRowCount(n.searchFilter)}),c()()()()()()()),e&2&&(s("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),l(2),s("ngIf",w(3,13,n.loader$)),l(4),s("ngIf",w(7,15,n.data$)),l(15),O(n.channelOptions),l(10),s("ngxPermissionsOnly",F(21,ke,n.rolePriceEdit)),l(),O(n.channelOptions),l(2),s("ngIf",w(35,17,n.data$)),l(2),s("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",w(37,19,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage()))},dependencies:[$,ce,R,se,me,pe,be,Pe,A,de,L,U,Ve,Ne,W,j,Te,Ce,he],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}"]});let t=r;return t})();export{Zt as CustomChannelPriceComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as N,b as Tt,c as Pe}from"./chunk-EGYILQWG.js";import{a as $}from"./chunk-BGWVHGAY.js";import"./chunk-SQTY2CZY.js";import{a as ve}from"./chunk-JY3L4RUM.js";import{a as Z}from"./chunk-7KG3DC5J.js";import{b as xe}from"./chunk-ULELZXI5.js";import"./chunk-E5BOLHDG.js";import"./chunk-A37OKNC2.js";import{a as re,b as ae}from"./chunk-7YWHTN3X.js";import{e as at}from"./chunk-3YVIB6CC.js";import{f as _e,g as ge,h as Ce,i as fe,j as Se}from"./chunk-KZ6AD6KW.js";import"./chunk-BZPMSXEO.js";import{a as j}from"./chunk-7VKIP3Z6.js";import"./chunk-DYLT6RRK.js";import{a as Ft}from"./chunk-6UDYSYXW.js";import{a as z}from"./chunk-VBCIYCOF.js";import{b as be}from"./chunk-MKJON4UM.js";import{a as me,b as ue}from"./chunk-WKSTGJK5.js";import{a as le,b as ce,c as se}from"./chunk-GQG2K3LS.js";import{a as tt}from"./chunk-EKA76B4K.js";import{a as q}from"./chunk-D6L7HUOY.js";import"./chunk-BTY6PS53.js";import{a as he}from"./chunk-D76K4RZ7.js";import{f as pe,g as de}from"./chunk-EIBGI6U2.js";import{a as rt,b as yt,d as Y,e as qt}from"./chunk-PYD2YWAN.js";import{g as R}from"./chunk-5FOPZ5IX.js";import{b as W,e as K}from"./chunk-JHYIHRQH.js";import"./chunk-KCDL7SWP.js";import{b as te,c as ee,d as J,h as Ot,i as ne,j as ie,m as B,n as oe}from"./chunk-4CEFDQPI.js";import{t as Mt,u as Dt}from"./chunk-2SC3HO66.js";import{P as Qt,X as Xt}from"./chunk-DQIP7MCZ.js";import{b as Zt,c as ot,h as U,m as L,y as wt}from"./chunk-2E5AKA74.js";import{b as H,c as f}from"./chunk-FTHTFVHH.js";import{$c as Yt,B as y,Bc as xt,Cc as zt,Ec as vt,Fc as Pt,Ha as D,Ib as G,Ja as c,Jb as d,Ka as S,Kb as et,Lb as I,Nb as O,Ob as T,Pb as F,Rb as Kt,Sb as X,T as ft,Tb as pt,V as Vt,Va as Ut,Wc as bt,X as $t,Xc as Ht,Yc as it,Zc as It,_a as x,aa as Gt,ab as s,ac as E,bc as V,c as Bt,cc as Jt,da as At,dc as nt,ga as M,ha as Wt,hb as St,mb as a,nb as l,oa as m,ob as g,pa as u,pb as P,q as jt,qb as b,sb as v,vb as C,xb as p,xc as k,yc as A}from"./chunk-ZIZWZZ4E.js";import"./chunk-GNOSNGXM.js";var Ve=()=>["/menu/products/download/by-url"],Ie=(()=>{let r=class r{constructor(){this.productTabs=[{Title:"Sold in Channel",Url:"/menu/products/status/sold-in-channel",Description:"SKU has been mapped between dealpos and marketplace"},{Title:"Not in POS",Url:"/menu/products/status/not-in-pos",Description:"SKU sold in Marketplace but not exist in DEALPOS"},{Title:"Not in Channel",Url:"/menu/products/status/not-in-channel",Description:"SKU has not been sold on one of channels"},{Title:"In POS",Url:"/menu/products/status/in-pos",Description:"All products which is already available in POS"},{Title:"Multiple Listing",Url:"/menu/products/status/duplicate-sku",Description:"SKU(s) which is listed more than one time (one to many)"},{Title:"Channel Statistic",Url:"/menu/products/status/channel-statistic",Description:"Product statistic from each channel obtained from the last product scan"}]}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=M({type:r,selectors:[["app-status"]],decls:13,vars:3,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-flex"],[1,"dropdown-item",3,"routerLink"]],template:function(e,i){e&1&&(a(0,"nav",0)(1,"div",1)(2,"div"),g(3,"nav-tab",2),l()(),a(4,"div")(5,"div",3)(6,"a",4),g(7,"i",5),l(),a(8,"div",6)(9,"div",7)(10,"a",8),d(11,"Download Product By Url"),l()()()()()(),g(12,"router-outlet")),e&2&&(c(3),s("Tabs",i.productTabs),c(7),s("routerLink",X(2,Ve)))},dependencies:[re,Ht,It]});let o=r;return o})();function Ae(o,r){if(o&1&&(a(0,"mat-option",6)(1,"div"),g(2,"img",7),a(3,"span"),d(4),l()()()),o&2){let n=r.$implicit;s("value",n.ChannelID),c(2),s("src",n.logo,D),c(2),et(n.Title)}}var ct=(()=>{let r=class r{constructor(){this.dialogRef=At(te),this.channels=At(ee),this.channelIds=Ut([]),this.channelOptions=Ut([])}ngOnInit(){this.initModalConfig();let t=this.channels.filter((e,i,h)=>h.findIndex(_=>_.ChannelID===e.ChannelID)===i);this.channelOptions.set(t)}initModalConfig(){this.modalConfig=new ne,this.modalConfig.title="Detach Product",this.modalConfig.okText="Save"}onClose(){this.dialogRef.close()}onSave(){let t=this.channels.filter(e=>this.channelIds().includes(e.ChannelID)).map(e=>({ChannelID:e.ChannelID,ChannelItemID:e.ChannelItemID}));this.dialogRef.close(t)}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=M({type:r,selectors:[["app-modal-detach-product"]],standalone:!0,features:[Kt],decls:8,vars:5,consts:[[3,"onClose","onCancel","onOk","dynamicValidated","config"],["content",""],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"ngModelChange","ngModel","multiple"],["class","channel-option",3,"value",4,"ngFor","ngForOf"],[1,"channel-option",3,"value"],[2,"width","18px","margin-right","10px",3,"src"]],template:function(e,i){e&1&&(a(0,"modal-material",0),C("onClose",function(){return i.onClose()})("onCancel",function(){return i.onClose()})("onOk",function(){return i.onSave()}),a(1,"div",1)(2,"div")(3,"label",2),d(4,"Select a Channel"),l(),a(5,"mat-form-field",3)(6,"mat-select",4),F("ngModelChange",function(_){return T(i.channelIds,_)||(i.channelIds=_),_}),x(7,Ae,5,3,"mat-option",5),l()()()()()),e&2&&(s("dynamicValidated",i.channelIds().length>0)("config",i.modalConfig),c(6),O("ngModel",i.channelIds),s("multiple",!0),c(),s("ngForOf",i.channelOptions()))},dependencies:[Pt,k,ie,de,pe,ue,me,Xt,wt,U,L,Dt]});let o=r;return o})();function Ue(o,r){if(o&1){let n=v();a(0,"button",13),C("click",function(){m(n);let e=p();return u(e.onDetachMultipleProduct())}),g(1,"i",14),d(2),l()}if(o&2){let n,t=p();c(2),I("Detach (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function Le(o,r){if(o&1){let n=v();a(0,"button",16),C("click",function(){m(n);let e=p(2);return u(e.onOpenScanDialog())}),g(1,"i",17),d(2," Scan Channel "),l()}}function Re(o,r){if(o&1&&(P(0),x(1,Le,3,0,"button",15),b()),o&2){let n=p();c(),s("ngIf",!n.productService.hasSelection(n.products))}}function Be(o,r){if(o&1){let n=v();P(0),a(1,"button",18),C("click",function(){m(n);let e=p();return u(e.onScanMultipleProduct())}),g(2,"i",17),d(3),l(),b()}if(o&2){let n,t=p();c(3),I(" Scan (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function je(o,r){if(o&1){let n=v();P(0),a(1,"button",19),C("click",function(){m(n);let e=p();return u(e.onUploadMultipleProduct())}),g(2,"i",20),d(3),l(),b()}if(o&2){let n,t=p();c(3),I(" Upload (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function $e(o,r){if(o&1){let n=v();a(0,"div",21)(1,"app-product-card",22),C("onUpload",function(){let e=m(n).$implicit,i=p();return u(i.onUploadToMultipleChannel(e))})("onScan",function(){let e=m(n).$implicit,i=p();return u(i.onScanSingleProduct(e))})("onDescEvent",function(){let e=m(n).index,i=p();return u(i.onOpenDialogVariant(e))})("onCheckBoxChange",function(e){let i=m(n).$implicit;return u(i.selected=e)})("onDetach",function(){let e=m(n).$implicit,i=p();return u(i.onDetachProduct([e]))}),l()()}if(o&2){let n=r.$implicit,t=p();c(),s("productId",n.ID)("title",n==null?null:n.Name)("image",n==null?null:n.ThumbnailUrl)("description",(n==null?null:n.Variants.length)>1?(n==null?null:n.Variants.length)+" Variants":null)("channels",t.productService.getChannelProduct(n))("code",t.getVariantCode(n==null?null:n.Variants))("showCheckBox",(n==null?null:n.Channel.length)<t.channelOptions.length)("scanButton",!0)("uploadButton",n==null?null:n.hasUpload)("imageForZoom",n==null?null:n.ImageUrl)("detachButton",(n==null||n.Channel==null?null:n.Channel.length)>0)}}function Ge(o,r){o&1&&(P(0),a(1,"div",23),g(2,"app-empty-state"),l(),b())}function We(o,r){if(o&1){let n=v();P(0),a(1,"div",24)(2,"div",25)(3,"app-custom-paginator",26),C("next",function(){m(n);let e=p();return u(e.getProducts())})("previous",function(){m(n);let e=p();return u(e.getProducts())}),l()()(),b()}if(o&2){let n=p();c(3),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",!0)}}var Me=(()=>{let r=class r{constructor(t,e,i,h,_,w,st){this.http=t,this.toastr=e,this.dialog=i,this.productService=h,this.authService=_,this.uploadProductService=w,this.route=st,this.searchFilter=new Z,this.products=[],this.rowCount=0,this.multipeScanChannels=[],this.getLoaderPage(),this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}getLoaderPage(){this.productService.LoadInPOS().subscribe(t=>{this.Categories=t.Options.Categories,this.searchFilter.PageNumber=t.Filter.PageNumber,this.searchFilter.RowCount=t.Filter.RowCount,this.searchFilter.ChannelID=null,this.searchFilter.Category=t.Filter.Category,this.searchFilter.PageSize=100,this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[H.Tokopedia,H.Tiktok])}getProducts(){let t={PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Category:this.searchFilter.Category,From:this.startDate,To:this.endDate};this.http.post("/api/product/GetInPOS",t).subscribe(e=>{this.products=e.Data,this.rowCount=e.Total==null?this.searchFilter.RowCount:e.Total.toString(),this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions)})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=f.GuidEMpty,this.dialog.open(N,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>f.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.Async,this.scanAllProduct()})}scanAllProduct(){if(this.searchFilter.ChannelID==null){this.toastr.error("Please Select Channel","Error");return}this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(t=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{this.getLoaderPage();let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,e,!this.searchFilter.UpdatedProduct)}})}onOpenDialogVariant(t){this.dialog.open(Tt,{data:{title:this.products[t].Name,variants:this.products[t].Variants},width:"800px"})}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.uploadProductService.setSelectedProduct(t),this.route.navigate(["/menu/products/upload"])}onUploadToMultipleChannel(t){this.uploadProductService.setSelectedProduct([t]),this.route.navigate(["/menu/products/upload"])}searchProduct(t){this.searchFilter.text=t,this.getProducts()}onScanMultipleProduct(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=f.GuidEMpty;let e=this.productService.filterChannelByTypeId(this.channelOptions,[H.Tokopedia,H.Tiktok]);this.dialog.open(N,{data:{filter:t,channelOptions:e,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(h=>f.IsNotEmpty(h))).subscribe(h=>{this.searchFilter.ChannelID=h.ChannelID,this.searchFilter.ScanFull=h.ScanFull,this.searchFilter.UpdatedProduct=h.UpdatedProduct;let _=this.productService.selectedProduct(this.products),w=this.productService.getVariantCodesProducts(_);this.scanSingleProduct(w)})}onScanSingleProduct(t){let e=JSON.parse(JSON.stringify(this.searchFilter));e.ChannelID=f.GuidEMpty,this.dialog.open(N,{data:{filter:e,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>f.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID;let h=this.productService.getVariantCodesProduct(t);this.scanSingleProduct(h)})}scanSingleProduct(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:e=>{if(e)this.toastr.success("Successfully Scan ","Success");else{let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${i?.Name} `,"Error")}this.searchFilter.ChannelID=f.GuidEMpty,e&&this.getProducts()},error:e=>{this.searchFilter.ChannelID=f.GuidEMpty}})}getVariantCode(t){let e;return t.length>1&&(e=(t[0].model?t[0].model:"")+t[0].Code),t.length==1&&(e=t[0].Code),e}onDetachProduct(t){let e=[];t.forEach(i=>{i.Channel=f.assignChannelLogo(i.Channel),e.push(...i.Channel)}),this.dialog.open(ct,{width:"600px",data:[...e]}).afterClosed().pipe(y(i=>f.IsNotEmpty(i)),ft(i=>this.productService.detachProduct(i))).subscribe(i=>{this.toastr.success(i.Message,Ot.Success),this.getProducts()})}onDetachMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.onDetachProduct(t)}};r.\u0275fac=function(e){return new(e||r)(S(K),S(W),S(J),S(j),S(R),S(at),S(it))},r.\u0275cmp=M({type:r,selectors:[["app-in-pos"]],decls:23,vars:14,consts:[["picker",""],["description","All products which is already available in POS",3,"onSubmit","headerTitle"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","Name","bindValue","Name","placeholder","Select Category",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[1,"mt-5"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"fa-sharp","fa-link-slash","me-2"],["type","button","data-cy","scanSoldinChannel","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onUpload","onScan","onDescEvent","onCheckBoxChange","onDetach","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","detachButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(e,i){if(e&1){let h=v();a(0,"mainpanel",1),C("onSubmit",function(w){return m(h),u(i.searchProduct(w))}),a(1,"actions"),x(2,Ue,3,1,"button",2)(3,Re,2,1,"ng-container",3)(4,Be,4,1,"ng-container",3)(5,je,4,1,"ng-container",3),l(),a(6,"filters")(7,"div")(8,"label",4),d(9,"Category"),l(),a(10,"ng-select",5),C("ngModelChange",function(w){return m(h),u(i.searchFilter.Category=w)}),l()(),a(11,"div",6)(12,"mat-date-range-input",7)(13,"input",8),F("ngModelChange",function(w){return m(h),T(i.startDate,w)||(i.startDate=w),u(w)}),C("click",function(){m(h);let w=G(16);return u(w.open())}),l(),a(14,"input",9),F("ngModelChange",function(w){return m(h),T(i.endDate,w)||(i.endDate=w),u(w)}),C("click",function(){m(h);let w=G(16);return u(w.open())}),l()(),g(15,"mat-date-range-picker",null,0),l()(),a(17,"content")(18,"div",10)(19,"div",11),x(20,$e,2,11,"div",12)(21,Ge,3,0,"ng-container",3),l(),x(22,We,4,4,"ng-container",3),l()()()}if(e&2){let h=G(16);s("headerTitle","In POS ("+i.rowCount+")"),c(2),St(i.productService.hasSelection(i.products)?2:-1),c(),s("ngIf",!i.productService.hasSelection(i.products)),c(),s("ngIf",i.productService.hasSelection(i.products)&&i.multipeScanChannels.length>0),c(),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("items",i.Categories)("ngModel",i.searchFilter.Category),c(2),s("rangePicker",h),c(),O("ngModel",i.startDate),c(),O("ngModel",i.endDate),c(6),s("ngForOf",i.products),c(),s("ngIf",i.products.length==0),c(),s("ngIf",i.products.length>0)}},dependencies:[k,A,ot,U,L,B,Y,z,q,$,Ce,_e,ge,fe],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.img-logo[_ngcontent-%COMP%]{height:24px;width:24px}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}"]});let o=r;return o})();function Ke(o,r){if(o&1){let n=v();a(0,"button",11),C("click",function(){m(n);let e=p();return u(e.onDetachMultipleProduct())}),g(1,"i",12),d(2),l()}if(o&2){let n,t=p();c(2),I("Detach (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function Je(o,r){if(o&1){let n=v();P(0),a(1,"button",13),C("click",function(){m(n);let e=p();return u(e.onOpenScanDialog())}),g(2,"i",14),d(3," Scan Channel "),l(),b()}}function ze(o,r){if(o&1){let n=v();P(0),a(1,"button",15),C("click",function(){m(n);let e=p();return u(e.onScanMultipleProduct())}),g(2,"i",14),d(3),l(),b()}if(o&2){let n=p();c(3),I(" Scan (",n.productService.selectedProduct(n.products).length,") ")}}function He(o,r){if(o&1){let n=v();P(0),a(1,"button",16),C("click",function(){m(n);let e=p();return u(e.onUploadMultipleProduct())}),g(2,"i",17),d(3),l(),b()}if(o&2){let n=p();c(3),I(" Upload (",n.productService.selectedProduct(n.products).length,") ")}}function Ye(o,r){if(o&1&&(a(0,"span",18),g(1,"img",19),l(),d(2)),o&2){let n=r.item;c(),s("src",n.Img,D)("alt",n.Name),c(),I(" ",n.Name," ")}}function Ze(o,r){if(o&1){let n=v();a(0,"div",20)(1,"label",21),d(2,"Item ID"),l(),a(3,"input",22),F("ngModelChange",function(e){m(n);let i=p();return T(i.searchFilter.Item_id,e)||(i.searchFilter.Item_id=e),u(e)}),l()()}if(o&2){let n=p();c(3),O("ngModel",n.searchFilter.Item_id)}}function qe(o,r){if(o&1){let n=v();a(0,"div",23)(1,"app-product-card",24),C("onUpload",function(){let e=m(n).$implicit,i=p();return u(i.onUploadToMultipleChannel(e))})("onDescEvent",function(){let e=m(n).index,i=p();return u(i.onOpenVariantDetail(e))})("onScan",function(){let e=m(n).$implicit,i=p();return u(i.onScanSingleProduct(e))})("onCheckBoxChange",function(e){let i=m(n).$implicit;return u(i.selected=e)})("onDetach",function(){let e=m(n).$implicit,i=p();return u(i.onDetachProduct([e]))}),l()()}if(o&2){let n=r.$implicit,t=p();c(),s("productId",n==null?null:n.ID)("title",n==null?null:n.Name)("image",n==null?null:n.ThumbnailUrl)("description",(n==null||n.Variants==null?null:n.Variants.length)>1?(n==null||n.Variants==null?null:n.Variants.length)+" Variants":null)("channels",t.productService.getChannelProduct(n))("code",t.getVariantCode(n==null?null:n.Variants))("showCheckBox",n==null?null:n.hasScan)("scanButton",!0)("uploadButton",n==null?null:n.hasUpload)("imageForZoom",n==null?null:n.ImageUrl)("detachButton",(n==null||n.Channel==null?null:n.Channel.length)>0)}}function Qe(o,r){o&1&&(P(0),a(1,"div",25),g(2,"app-empty-state"),l(),b())}function Xe(o,r){if(o&1){let n=v();a(0,"div",26)(1,"div",27)(2,"app-custom-paginator",28),C("total",function(){m(n);let e=p();return u(e.getRowCount())})("next",function(){m(n);let e=p();return u(e.getProducts())})("previous",function(){m(n);let e=p();return u(e.getProducts())}),l()()()}if(o&2){let n=p();c(2),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}var De=(()=>{let r=class r{constructor(t,e,i,h,_,w,st,Ct){this.http=t,this.dialog=e,this.toastr=i,this.productService=h,this.activateRouter=_,this.authService=w,this.route=st,this.uploadProductService=Ct,this.searchFilter=new Z,this.products=[],this.rowCount=0,this.hasClickRowCount=!1,this.guidEmpty=f.GuidEMpty,this.multipeScanChannels=[],this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(f.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(e=>{this.searchFilter=e.Filter,e.Filter.ChannelID!=f.GuidEMpty&&(this.searchFilter.ListChannelID=[],this.searchFilter.ListChannelID.push(e.Filter.ChannelID)),this.searchFilter.PageSize=e.Filter.RowCount,this.searchFilter.Item_id="",this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[H.Tokopedia,H.Tiktok])}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Item_id:this.searchFilter.Item_id};this.productService.findAllSoldInChannel(t).subscribe(e=>{this.products=e.Data,this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions),this.products=this.productService.checkProductHasScanButton(this.products,this.channelOptions)})}searchProduct(t){this.searchFilter.text=t,this.hasClickRowCount=!1,this.getProducts()}onOpenVariantDetail(t){let e=this.products[t].Variants;this.dialog.open(Tt,{data:{variants:e,title:this.products[t].Name},width:"800px"})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=f.GuidEMpty,this.dialog.open(N,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>f.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.Async,this.scanAllProduct()})}scanAllProduct(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).pipe(y(e=>e)).subscribe(e=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(e,t,!this.searchFilter.UpdatedProduct),this.initPageLoader(f.GuidEMpty))})}onScanSingleProduct(t){t.Channel=this.productService.getChannelProduct(t);let e=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(N,{data:{filter:e,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>f.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID;let h=this.productService.getVariantCodesProduct(t);this.scanProducts(h)})}onUploadToMultipleChannel(t){this.uploadProductService.setSelectedProduct([t]),this.route.navigate(["/menu/products/upload"])}onScanMultipleProduct(){this.searchFilter.ChannelID=f.GuidEMpty;let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(N,{data:{filter:t,channelOptions:this.multipeScanChannels,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>f.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct;let h=this.productService.selectedProduct(this.products),_=this.productService.getVariantCodesProducts(h);this.scanProducts(_)})}scanProducts(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:e=>{let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);e?this.toastr.success(`Product Successfully scan with ${i?.Name}`,"Success"):this.toastr.error(`This product is not existed in ${i?.Name} `,"Error"),this.searchFilter.ChannelID=f.GuidEMpty,e&&this.getProducts()},error:e=>{this.searchFilter.ChannelID=f.GuidEMpty}})}getVariantCode(t){let e;return t.length>1&&(e=(t[0].model?t[0].model:"")+t[0].Code),t.length==1&&(e=t[0].Code),e}onClearFilterChannel(){this.searchFilter.ChannelID=f.GuidEMpty,this.searchFilter.Item_id=""}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.uploadProductService.setSelectedProduct(t),this.route.navigate(["/menu/products/upload"])}getRowCount(){let t={ListChannelID:this.searchFilter.ListChannelID,text:this.searchFilter.text};this.http.post("/api/product/GetSoldInChannelRowCount",t).subscribe(e=>{this.hasClickRowCount=!0,this.rowCount=e.Total})}onDetachProduct(t){let e=[];t.forEach(i=>{i.Channel=f.assignChannelLogo(i.Channel),e.push(...i.Channel)}),this.dialog.open(ct,{width:"600px",data:[...e]}).afterClosed().pipe(y(i=>f.IsNotEmpty(i)),ft(i=>this.productService.detachProduct(i))).subscribe(i=>{this.toastr.success(i.Message,Ot.Success),this.getProducts()})}onDetachMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.onDetachProduct(t)}};r.\u0275fac=function(e){return new(e||r)(S(K),S(J),S(W),S(j),S(bt),S(R),S(it),S(at))},r.\u0275cmp=M({type:r,selectors:[["app-sold-in-channel"]],decls:19,vars:13,consts:[["description","SKU has been mapped between dealpos and marketplace",3,"onSubmit","headerTitle"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clear","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],["class","mt-5",4,"ngIf"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"fa-sharp","fa-link-slash","me-2"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"mt-5"],[1,"fw-bold"],["type","text","name","Item_id","id","Item_id",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onUpload","onDescEvent","onScan","onCheckBoxChange","onDetach","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","detachButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(e,i){e&1&&(a(0,"mainpanel",0),C("onSubmit",function(_){return i.searchProduct(_)}),a(1,"actions"),x(2,Ke,3,1,"button",1)(3,Je,4,0,"ng-container",2)(4,ze,4,1,"ng-container",2)(5,He,4,1,"ng-container",2),l(),a(6,"filters")(7,"div")(8,"label",3),d(9,"Channel"),l(),a(10,"ng-select",4),C("ngModelChange",function(_){return i.searchFilter.ListChannelID=_})("clear",function(){return i.onClearFilterChannel()}),x(11,Ye,3,3,"ng-template",5),l()(),x(12,Ze,4,1,"div",6),l(),a(13,"content")(14,"div",7)(15,"div",8),x(16,qe,2,11,"div",9)(17,Qe,3,0,"ng-container",2),l(),x(18,Xe,3,4,"div",10),l()()()),e&2&&(s("headerTitle","Sold in Channel"),c(2),St(i.productService.hasSelection(i.products)?2:-1),c(),s("ngIf",!i.productService.hasSelection(i.products)),c(),s("ngIf",i.multipeScanChannels.length>0&&i.productService.hasSelection(i.products)),c(),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("multiple",!0)("items",i.channelOptions)("ngModel",i.searchFilter.ListChannelID),c(2),s("ngIf",i.searchFilter.ListChannelID!=null),c(4),s("ngForOf",i.products),c(),s("ngIf",i.products.length==0),c(),s("ngIf",i.products==null?null:i.products.length))},dependencies:[k,A,ot,U,L,B,Y,rt,yt,z,q,$],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]});let o=r;return o})();function en(o,r){if(o&1){let n=v();a(0,"button",13),C("click",function(){m(n);let e=p(2);return u(e.uploadMultipleProduct())}),g(1,"i",14),d(2),l()}if(o&2){let n=p(2);c(2),I(" upload (",n.selectedProducts==null?null:n.selectedProducts.length,") ")}}function nn(o,r){if(o&1){let n=v();P(0),a(1,"td",29)(2,"input",30),F("ngModelChange",function(e){m(n);let i=p(2).$implicit;return T(i.selected,e)||(i.selected=e),u(e)}),C("ngModelChange",function(){m(n);let e=p(3).ngIf,i=p(3);return u(i.onSelectProduct(e))}),l()(),b()}if(o&2){let n=p(2).$implicit;c(),s("rowSpan",n==null?null:n.Variants.length),c(),O("ngModel",n.selected)}}function on(o,r){if(o&1){let n=v();P(0),a(1,"img",35),C("click",function(e){m(n);let i=p(3).$implicit,h=p(4);return u(h.onZoomImage(e,i==null?null:i.ImageUrl))}),l(),b()}if(o&2){let n=p(3).$implicit;c(),s("src",n==null?null:n.ImageUrl,D)}}function rn(o,r){o&1&&g(0,"img",36)}function an(o,r){if(o&1&&(P(0),a(1,"td",29)(2,"div",31),x(3,on,2,1,"ng-container",11)(4,rn,1,0,"ng-template",null,1,nt),l()(),a(6,"td",32)(7,"h4",33)(8,"span",34),d(9),l()()(),b()),o&2){let n=G(5),t=p(2).$implicit;c(),s("rowSpan",t==null?null:t.Variants.length),c(2),s("ngIf",t==null?null:t.ImageUrl)("ngIfElse",n),c(3),s("rowSpan",t==null?null:t.Variants.length),c(2),s("matTooltip",(t==null||t.Name==null?null:t.Name.length)>50?t==null?null:t.Name:""),c(),I(" ",t==null?null:t.Name," ")}}function ln(o,r){if(o&1&&(a(0,"div")(1,"a",25),g(2,"img",37),l()()),o&2){let n=r.$implicit;c(),s("href",n.URL,D),c(),s("src",n.Img,D)("matTooltip",n.Name)}}function cn(o,r){if(o&1&&(a(0,"div"),g(1,"img",37),l()),o&2){let n=r.$implicit;c(),s("src",n.Img,D)("matTooltip",n.Name)}}function sn(o,r){if(o&1&&(a(0,"tr"),x(1,nn,3,2,"ng-container",12)(2,an,10,6,"ng-container",12),a(3,"td"),d(4),l(),a(5,"td")(6,"span"),d(7),l(),a(8,"span",24)(9,"a",25),g(10,"i",26),l()()(),a(11,"td",27)(12,"div",28),x(13,ln,3,3,"div",23),l()(),a(14,"td",27)(15,"div",28),x(16,cn,2,2,"div",23),l()()()),o&2){let n=r.$implicit,t=r.index,e=p(5);c(),s("ngIf",t==0),c(),s("ngIf",t==0),c(2),I(" ",n.Name," "),c(3),I(" ",n.Code," "),c(2),s("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),D),c(4),s("ngForOf",n==null?null:n.Available),c(3),s("ngForOf",n==null?null:n.NotAvailable)}}function pn(o,r){if(o&1&&(P(0),x(1,sn,17,7,"tr",23),b()),o&2){let n=r.$implicit;c(),s("ngForOf",n.Variants)}}function dn(o,r){if(o&1&&(a(0,"tbody"),x(1,pn,2,1,"ng-container",23),l()),o&2){let n=r.ngIf;c(),s("ngForOf",n)}}function mn(o,r){if(o&1&&(P(0),a(1,"div",15)(2,"table",16)(3,"thead",17)(4,"tr"),g(5,"th",18),a(6,"th",19),d(7,"Product"),l(),a(8,"th",20),d(9,"Variant"),l(),a(10,"th",20),d(11,"SKU"),l(),a(12,"th",21),d(13,"Available In"),l(),a(14,"th",22),d(15,"Not Available In"),l()()(),x(16,dn,2,1,"tbody",12),E(17,"async"),l()(),b()),o&2){let n=p(2);c(16),s("ngIf",V(17,1,n.data$))}}function un(o,r){o&1&&(a(0,"div",38),g(1,"app-empty-state"),l())}function hn(o,r){if(o&1){let n=v();a(0,"span",46),C("click",function(){m(n);let e=p(4);return u(e.getRowCount())}),a(1,"i",47),d(2,"?"),l()()}}function _n(o,r){if(o&1&&(a(0,"span"),d(1),E(2,"number"),l()),o&2){let n=r.ngIf;c(),et(V(2,1,n==null?null:n.Count))}}function gn(o,r){if(o&1){let n=v();a(0,"a",48),C("click",function(){m(n);let e=p(4);return u(e.onNextPage())}),g(1,"i",49),d(2," Next"),l()}}function Cn(o,r){if(o&1){let n=v();a(0,"a",50),C("click",function(){m(n);let e=p(4);return u(e.onLastPage())}),g(1,"i",51),d(2," Last"),l()}}function fn(o,r){if(o&1&&(P(0),a(1,"div",39)(2,"div",40)(3,"div",41),d(4),E(5,"number"),x(6,hn,3,0,"span",42)(7,_n,3,3,"span",12),E(8,"async"),d(9),l()(),a(10,"div",43),x(11,gn,3,0,"a",44)(12,Cn,3,0,"a",45),l()(),b()),o&2){let n=p().ngIf,t=p(2);c(4),I(" Showing 1 - ",V(5,6,n==null?null:n.length)," of "),c(2),s("ngIf",t.paginationService.hideCount),c(),s("ngIf",!t.paginationService.hideCount&&V(8,8,t.rowCount$)),c(2),I(" records ~ ",t.paginationService.footerPageNumber," Page "),c(2),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),c(),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}function Sn(o,r){if(o&1&&(P(0),x(1,fn,13,10,"ng-container",12),b()),o&2){let n=r.ngIf;c(),s("ngIf",(n==null?null:n.length)>0)}}function xn(o,r){if(o&1){let n=v();a(0,"mainpanel",3),C("onSubmit",function(e){m(n);let i=p();return u(i.searchProduct(e))}),a(1,"actions"),x(2,en,3,1,"button",4),a(3,"button",5),C("click",function(){m(n);let e=p();return u(e.openScanDialog())}),g(4,"i",6),d(5," Scan Channel "),l(),a(6,"button",7),C("click",function(){m(n);let e=p();return u(e.openExportDialog())}),g(7,"i",8),a(8,"span"),d(9,"Export"),l()()(),a(10,"content")(11,"div",9)(12,"div",10),x(13,mn,18,3,"ng-container",11),E(14,"async"),x(15,un,2,0,"ng-template",null,0,nt),l(),x(17,Sn,2,1,"ng-container",12),E(18,"async"),l()()()}if(o&2){let n,t=G(16),e=p();s("hideSearchDropdown",!0),c(2),s("ngIf",e.hasSelectionProduct),c(11),s("ngIf",((n=V(14,5,e.data$))==null?null:n.length)>0)("ngIfElse",t),c(4),s("ngIf",V(18,7,e.data$))}}var Oe=(()=>{let r=class r{constructor(t,e,i,h,_,w,st,Ct,Ne){this.http=t,this.dialog=e,this.toastr=i,this.route=h,this.productService=_,this.paginationService=w,this.biggerPictureService=st,this.authService=Ct,this.uploadProductService=Ne,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannelV2",this.hasSelectionProduct=!1,this.selectedProducts=[],this.channelOptions=Ct.getChannels(),this.hostName=this.authService.getDomain()}ngOnInit(){this.initPageLoader(),this.iniData()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.notChannelAPI,this.loader$=this.http.post(`api/${this.loaderAPI}`,{}).pipe($t(t=>{this.filterSearch=t.Filter,this.paginationService.reloadPagination(t.Filter)}))}iniData(){this.data$=this.paginationService.data$.pipe(jt(t=>(t=t.map(e=>(e.Variants=e.Variants.map(i=>(i.Available=this.productService.sortChannel(i.Available),i.NotAvailable=this.productService.sortChannel(i.NotAvailable),i.Available=this.assignLogoChannel(i.Available),i.NotAvailable=this.assignLogoChannel(i.NotAvailable),i)),e.Channel=e?.Variants[0]?.Available,e)),t)))}assignLogoChannel(t){return t=t.map(e=>(e.Img=f.getChannelLogoByTypeId(e.TypeID),e)),t}searchProduct(t){this.filterSearch.text=t,this.paginationService.reloadPagination(this.filterSearch)}scanAllProduct(){let t=this.productService.findChannelById(this.filterSearch.ChannelID,this.channelOptions);this.productService.scanAll(this.filterSearch.ChannelID,this.filterSearch.ScanFull,this.filterSearch.UpdatedProduct,this.filterSearch.Async).subscribe(e=>{this.filterSearch.Async?this.toastr.success("You will be notified when the scan is completed.","Scan Asynchronous"):(this.productService.successToastrScanAllProduct(e,t,!this.filterSearch.UpdatedProduct),this.initPageLoader())})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.filterSearch));t.ChannelID=f.GuidEMpty,this.dialog.open(N,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>f.IsNotEmpty(i))).subscribe(i=>{this.filterSearch.ChannelID=i.ChannelID,this.filterSearch.ScanFull=i.ScanFull,this.filterSearch.UpdatedProduct=i.UpdatedProduct,this.filterSearch.Async=i.Async,this.scanAllProduct()})}getRowCount(){this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`/api/${this.rowCountAPI}`,this.filterSearch)}onNextPage(){this.paginationService.onNextPage(this.filterSearch)}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:t=>{this.filterSearch.PageNumber=1,this.paginationService.getAllData(this.filterSearch,t.Count)}})}onZoomImage(t,e){this.biggerPictureService.openBiggerPicture(t,e)}onSelectProduct(t){this.hasSelectionProduct=this.productService.hasSelection(t),this.selectedProducts=this.productService.selectedProduct(t)}uploadMultipleProduct(){this.uploadProductService.setSelectedProduct(this.selectedProducts),this.route.navigate(["/menu/products/upload"])}ngOnDestroy(){this.paginationService.destroy()}openExportDialog(){this.dialog.open(xe,{data:{title:"Export Not In Channel",pageNumber:this.filterSearch.PageNumber,rowCount:this.filterSearch.RowCount,filterExport:this.filterSearch,getRowCountApi:"product/GetNotInChannelRowCount",exportApi:"product/GetNotInChannelExport"}}).afterClosed().subscribe()}};r.\u0275fac=function(e){return new(e||r)(S(K),S(J),S(W),S(it),S(j),S(ve),S(he),S(R),S(at))},r.\u0275cmp=M({type:r,selectors:[["app-not-in-channel"]],decls:2,vars:3,consts:[["EMPTY",""],["elsePic",""],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"hideSearchDropdown","onSubmit",4,"ngIf"],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"onSubmit","hideSearchDropdown"],["class","btn btn-light shadow rounded ms-2",3,"click",4,"ngIf"],["data-cy","scanNotinChannel","type","button",1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[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"],[4,"ngIf","ngIfElse"],[4,"ngIf"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-md-12"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[2,"width","10px"],["colspan","2",1,"ms-5","text-center",2,"width","450px"],[2,"width","150px"],[2,"width","20%"],[2,"width","16%"],[4,"ngFor","ngForOf"],[1,"ms-1"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"padding-left","0px"],[1,"d-flex","flex-wrap","mb-1"],[1,"text-center",3,"rowSpan"],["type","checkbox",3,"ngModelChange","ngModel"],[2,"padding-right","0px"],[1,"text-start",3,"rowSpan"],[1,"ms-5","fw-normal","text-ellipsis",2,"max-width","26vw !important"],[3,"matTooltip"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],["alt","",1,"channel-logo","cursor-pointer","ms-4","mt-3",3,"src","matTooltip"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(e,i){e&1&&(x(0,xn,19,9,"mainpanel",2),E(1,"async")),e&2&&s("ngIf",V(1,1,i.loader$))},dependencies:[k,A,Zt,U,L,B,Mt,$,xt,vt],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}thead[_ngcontent-%COMP%]{position:sticky;top:0}.channel-logo[_ngcontent-%COMP%]{width:20px}.w-img[_ngcontent-%COMP%]{width:100%}"]});let o=r;return o})();var vn=o=>[o],Pn=()=>[];function bn(o,r){if(o&1){let n=v();a(0,"button",15),C("click",function(){m(n);let e=p();return u(e.openScanDialog())}),g(1,"i",16),d(2," Scan Channel "),l()}}function In(o,r){if(o&1){let n=v();P(0),a(1,"button",17),C("click",function(){m(n);let e=p();return u(e.onDownloadAllProduct("SELECTED"))}),g(2,"i",18),d(3),l(),b()}if(o&2){let n,t=p();c(3),I(" Download (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function wn(o,r){if(o&1&&(a(0,"span",19),g(1,"img",20),l(),d(2)),o&2){let n=r.item;c(),s("src",n.Img,D)("alt",n.Name),c(),I(" ",n.Name," ")}}function yn(o,r){if(o&1){let n=v();a(0,"div",21)(1,"app-product-card",22),C("onCheckBoxChange",function(e){let i=m(n).index,h=p();return u(h.onSelectProduct(e,i))})("onDescEvent",function(){let e=m(n).index,i=p();return u(i.onShowVariantDetail(e))})("onDownload",function(){let e=m(n).$implicit,i=p();return u(i.onDownloadProduct(e))})("onScan",function(){let e=m(n).$implicit,i=p();return u(i.onScanChannel(e))}),l()()}if(o&2){let n=r.$implicit;c(),s("showRedirectIcon",!1)("title",n==null?null:n.Name)("image",n==null?null:n.Image)("imageForZoom",n==null?null:n.Image)("code",n==null?null:n.SKU)("description",(n==null||n.Variant==null?null:n.Variant.length)>0?(n==null||n.Variant==null?null:n.Variant.length)+" Variants":null)("downloadButton",!0)("channels",n!=null&&n.Channel?pt(10,vn,n==null?null:n.Channel):X(12,Pn))("showCheckBox",!0)("scanButton",!0)}}function Mn(o,r){o&1&&(P(0),a(1,"div",23),g(2,"app-empty-state"),l(),b())}function Dn(o,r){if(o&1){let n=v();a(0,"div",24)(1,"div",25)(2,"app-custom-paginator",26),C("total",function(){m(n);let e=p();return u(e.getRowCount())})("next",function(){m(n);let e=p();return u(e.getProducts())})("previous",function(){m(n);let e=p();return u(e.getProducts())}),l()()()}if(o&2){let n=p();c(2),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}var Te=(()=>{let r=class r{constructor(t,e,i,h,_,w){this.http=t,this.dialog=e,this.productService=i,this.toastrService=h,this.activateRouter=_,this.authService=w,this.searchFilter=new Z,this.products=[],this.hasClickRowCount=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(f.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(e=>{this.searchFilter=e.Filter,this.searchFilter.PageSize=e.Filter.RowCount,this.getProducts()})}getProducts(){this.http.post("/api/product/GetProductChannelNotPOS",this.searchFilter).subscribe(t=>{this.products=t.Data,this.mapChannelToProduct(),this.setSkuProduct()})}mapChannelToProduct(){let t;this.products=this.products.map(e=>(t=this.channelOptions.find(i=>i.ID==e.ChannelID),t?e.Channel=JSON.parse(JSON.stringify(t)):e.Channel=null,e)).map(e=>(e.Channel&&(e.Channel.Url=e.Url),e))}setSkuProduct(){this.products=this.products.map(t=>(t?.Variant?.length==0?f.IsNotEmpty(t?.ChannelItemSKU)?t.SKU=t?.ChannelItemSKU:t.SKU="SKU not assigned":t.SKU=t?.Variant[0]?.ChannelVariationSKU?t?.Variant[0]?.ChannelVariationSKU:"SKU not assigned",t))}onSearch(t){this.searchFilter.text=t,this.hasClickRowCount=!1,this.getProducts()}onClearChannelFilter(){this.searchFilter.ChannelID=f.GuidEMpty}onScanAll(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(e=>{this.searchFilter.Async?this.toastrService.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.initPageLoader(f.GuidEMpty),this.productService.successToastrScanAllProduct(e,t,!this.searchFilter.UpdatedProduct)),this.searchFilter.ChannelID=f.GuidEMpty})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=f.GuidEMpty,this.dialog.open(N,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>f.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.Async=i.Async,this.onScanAll()})}onDownloadAllProduct(t){let e;t=="ALL"?e=this.products:e=this.productService.selectedProduct(this.products),e.length>0&&this.productService.downloadMultipleProduct(e).subscribe({next:()=>{this.getProducts()}})}onSelectProduct(t,e){this.products[e].selected=t}onDownloadProduct(t){confirm(`Are you sure you want to Retrieve product ${t?.Name} from ${t?.Channel.Name} to POS?`)&&this.productService.downloadProduct(t).subscribe({next:()=>{this.getProducts()}})}onScanChannel(t){let e=JSON.parse(JSON.stringify(t));delete e.Channel,this.productService.scanCompareToPos([e]).subscribe(i=>{i.Status?(this.initPageLoader(f.GuidEMpty),this.toastrService.success(`product ${t.Name} have been successfully scanned and synchronized with POS`,"Success")):this.toastrService.error(`Product ${t.Name} is not existed in POS`,"Error")})}onShowVariantDetail(t){let e=this.products[t].Variant;e.length>0&&this.dialog.open(Pe,{data:{title:this.products[t].Name,variants:e},width:"30%"})}getRowCount(){let t={ChannelID:this.searchFilter.ChannelID,text:this.searchFilter.text,HaveSku:parseInt(this.searchFilter.HaveSku)};this.http.post("/api/product/GetProductChannelNotPOSRowCount",t).subscribe(e=>{this.hasClickRowCount=!0,this.rowCount=e.Count})}};r.\u0275fac=function(e){return new(e||r)(S(K),S(J),S(j),S(W),S(bt),S(R))},r.\u0275cmp=M({type:r,selectors:[["app-not-in-pos"]],decls:30,vars:13,consts:[["headerTitle","Not in POS","textButton","Search","description","SKU sold in Marketplace but not exist in DEALPOS",3,"onSubmit"],["type","button","data-cy","scanNotInPos","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],[4,"ngIf"],[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",""],[1,"mt-5"],[1,"fw-bold"],["name","haveSKU",1,"form-control","h-100","pt-3","rounded","mt-2",3,"ngModelChange","ngModel"],[1,"me-5",3,"value"],["type","text","name","Item_id","id","Item_id","placeholder","item id",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button","data-cy","scanNotInPos",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","ms-3",3,"click"],[1,"fa","fa-download"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onCheckBoxChange","onDescEvent","onDownload","onScan","showRedirectIcon","title","image","imageForZoom","code","description","downloadButton","channels","showCheckBox","scanButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(e,i){e&1&&(a(0,"mainpanel",0),C("onSubmit",function(_){return i.onSearch(_)}),a(1,"actions"),x(2,bn,3,0,"button",1)(3,In,4,1,"ng-container",2),l(),a(4,"filters")(5,"div")(6,"label",3),d(7,"Channel"),l(),a(8,"ng-select",4),F("ngModelChange",function(_){return T(i.searchFilter.ChannelID,_)||(i.searchFilter.ChannelID=_),_}),x(9,wn,3,3,"ng-template",5),l()(),a(10,"div",6)(11,"label",7),d(12,"SKU Assigned"),l(),a(13,"mat-radio-group",8),F("ngModelChange",function(_){return T(i.searchFilter.HaveSku,_)||(i.searchFilter.HaveSku=_),_}),a(14,"mat-radio-button",9),d(15," All "),l(),a(16,"mat-radio-button",9),d(17," Yes "),l(),a(18,"mat-radio-button",9),d(19," No "),l()()(),a(20,"div",6)(21,"label",7),d(22,"Item ID"),l(),a(23,"input",10),F("ngModelChange",function(_){return T(i.searchFilter.Item_id,_)||(i.searchFilter.Item_id=_),_}),l()()(),a(24,"content")(25,"div",11)(26,"div",12),x(27,yn,2,13,"div",13)(28,Mn,3,0,"ng-container",2),l(),x(29,Dn,3,4,"div",14),l()()()),e&2&&(c(2),s("ngIf",!i.productService.hasSelection(i.products)),c(),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("items",i.channelOptions),O("ngModel",i.searchFilter.ChannelID),c(5),O("ngModel",i.searchFilter.HaveSku),c(),s("value",0),c(2),s("value",1),c(2),s("value",2),c(5),O("ngModel",i.searchFilter.Item_id),c(4),s("ngForOf",i.products),c(),s("ngIf",i.products.length==0),c(),s("ngIf",(i.products==null?null:i.products.length)>0))},dependencies:[k,A,ot,U,L,B,Y,rt,le,ce,z,q,$],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.itemTitle[_ngcontent-%COMP%]{cursor:pointer}"]});let o=r;return o})();function On(o,r){if(o&1&&(a(0,"span",9),g(1,"img",10),l(),d(2)),o&2){let n=r.item,t=p();c(),s("src",t.getChannelLogo(n.TypeID),D),c(),I(" ",n.Name," ")}}function Tn(o,r){if(o&1&&(a(0,"div",11),g(1,"app-duplicate-product-card",12),l()),o&2){let n=r.$implicit,t=r.index;c(),s("imageForZoom",n.ImageUrl)("title",n.Name)("code",n.Code)("id",t)("image",n.ThumbnailURL)("channels",n.Channels)}}function Fn(o,r){o&1&&(P(0),a(1,"div",13),g(2,"app-empty-state"),l(),b())}function En(o,r){if(o&1){let n=v();P(0),a(1,"div",14)(2,"div",15)(3,"app-custom-paginator",16),C("next",function(){m(n);let e=p();return u(e.getProducts())})("previous",function(){m(n);let e=p();return u(e.getProducts())})("total",function(){m(n);let e=p();return u(e.getRowCount())}),l()()(),b()}if(o&2){let n=p();c(3),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickedRowCount)}}var Fe=(()=>{let r=class r{constructor(t,e,i){this.httpService=t,this.productService=e,this.authService=i,this.searchFilter=new Z,this.products=[],this.hasClickedRowCount=!1,this.getPageLoader(),this.channelOptions=i.getChannels()}getPageLoader(){this.productService.loader().subscribe(t=>{this.searchFilter=t.Filter,this.searchFilter.PageSize=t.Filter.RowCount,this.getProducts()})}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,RowCount:this.searchFilter.RowCount,PageNumber:this.searchFilter.PageNumber,text:this.searchFilter.text};this.httpService.post("/api/product/GetDuplicateInChannel",t).subscribe(e=>{this.products=e.Data})}onSearch(t){this.searchFilter.text=t,this.hasClickedRowCount=!1,this.getProducts()}onClearFilter(){this.searchFilter.ChannelID=f.GuidEMpty}getChannelLogo(t){return f.getChannelLogoByTypeId(t)}getRowCount(){let t={text:this.searchFilter.text,ChannelID:this.searchFilter.ChannelID};this.httpService.post("/api/product/GetDuplicateInChannelRowCount",t).subscribe(e=>{this.hasClickedRowCount=!0,this.rowCount=e.Total})}};r.\u0275fac=function(e){return new(e||r)(S(K),S(j),S(R))},r.\u0275cmp=M({type:r,selectors:[["app-duplicate-sku"]],decls:14,vars:7,consts:[["headerTitle","Multiple Listing","textButton"," Search","description","SKU(s) which is listed more than one time (one to many)",3,"onSubmit"],["container",""],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clear","multiple","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid"],[1,"row","mt-8","mx-1"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"imageForZoom","title","code","id","image","channels"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"next","previous","total","filter","totaldata","paginationTotal","hasClicked"]],template:function(e,i){e&1&&(a(0,"mainpanel",0),C("onSubmit",function(_){return i.onSearch(_)}),a(1,"filters")(2,"div",1)(3,"div")(4,"h6",2),d(5,"Channel"),l(),a(6,"ng-select",3),F("ngModelChange",function(_){return T(i.searchFilter.ListChannelID,_)||(i.searchFilter.ListChannelID=_),_}),C("clear",function(){return i.onClearFilter()}),x(7,On,3,2,"ng-template",4),l()()()(),a(8,"content")(9,"div",5)(10,"div",6),x(11,Tn,2,6,"div",7)(12,Fn,3,0,"ng-container",8),l(),x(13,En,4,4,"ng-container",8),l()()()),e&2&&(c(6),s("multiple",!0)("clearable",!0)("items",i.channelOptions),O("ngModel",i.searchFilter.ListChannelID),c(5),s("ngForOf",i.products),c(),s("ngIf",(i.products==null?null:i.products.length)==0),c(),s("ngIf",(i.products==null?null:i.products.length)>0))},dependencies:[k,A,U,L,B,Y,rt,yt,Ft,z,$]});let o=r;return o})();var kn=()=>["/menu/products/status/sold-in-channel"],Ee=o=>({ID:o}),Nn=()=>["/menu/products/status/not-in-pos"];function Vn(o,r){if(o&1&&(P(0),d(1),b()),o&2){let n=p().$implicit;c(),I(" ",n.Count," ")}}function An(o,r){if(o&1){let n=v();a(0,"span",26),C("click",function(){m(n);let e=p().$implicit,i=p(2);return u(i.getLiveProductCount(e.ID,e))}),g(1,"i",27),l()}}function Un(o,r){if(o&1){let n=v();a(0,"tr")(1,"td"),g(2,"img",17),a(3,"span",18),d(4),l()(),a(5,"td",19),x(6,Vn,2,1,"ng-container",6)(7,An,2,0,"ng-template",null,1,nt),l(),a(9,"td",19)(10,"a",20),d(11),E(12,"number"),l()(),a(13,"td",19)(14,"a",20),d(15),E(16,"number"),l()(),a(17,"td"),d(18),E(19,"date"),l(),a(20,"td")(21,"div",21)(22,"button",22),C("click",function(){let e=m(n).$implicit,i=p(2);return u(i.onScanChannel(e))}),g(23,"i",23),d(24," Scan "),l(),a(25,"button",24),C("click",function(){let e=m(n).$implicit,i=p(2);return u(i.onClearCache(e.ID))}),g(26,"i",25),d(27," Clear "),l()()()()}if(o&2){let n=r.$implicit,t=G(8),e=p(2);c(2),s("src",e.getChannelLogo(n.TypeID),D),c(2),et(n.Name),c(2),s("ngIf",n.Count!==void 0)("ngIfElse",t),c(4),s("routerLink",X(18,kn))("queryParams",pt(19,Ee,n.ID)),c(),I(" ",V(12,11,n.SoldInChannel)," "),c(3),s("routerLink",X(21,Nn))("queryParams",pt(22,Ee,n.ID)),c(),I(" ",V(16,13,n.NotInPOS)," "),c(3),I("",n.LastSync?Jt(19,15,n.LastSync,"dd MMM yyyy HH:mm"):"Never"," ")}}function Ln(o,r){if(o&1&&(P(0),a(1,"div",7)(2,"table",8)(3,"thead",9)(4,"tr",10)(5,"th"),d(6,"Channel"),l(),a(7,"th",11),d(8,"Live Product"),l(),a(9,"th",12),d(10,"Sold In Channel"),l(),a(11,"th",13),d(12,"Product Not in POS"),l(),a(13,"th",14),d(14,"Last Sync"),l(),g(15,"th",15),l()(),a(16,"tbody"),x(17,Un,28,24,"tr",16),E(18,"async"),l()()(),b()),o&2){let n,t=p();c(17),s("ngForOf",(n=V(18,1,t.channels$))==null?null:n.Data)}}function Rn(o,r){o&1&&(a(0,"div",28),g(1,"app-empty-state"),l())}var ke=(()=>{let r=class r{constructor(t,e,i,h){this.productService=t,this.toastr=e,this.dialog=i,this.authService=h,this.destroy$=new Bt,this.channelOptions=h.getChannels()}ngOnInit(){this.setObsProductStatistic()}setObsProductStatistic(){this.channels$=this.productService.getProductStatistic()}getLiveProductCount(t,e){this.productService.getTotalProductLive(t).pipe(Vt(this.destroy$)).subscribe(i=>{e.Count=i.Count})}onScanChannel(t){this.dialog.open(N,{width:"700px",data:{channelOptions:this.channelOptions,filter:{ChannelID:t.ID},disabledChannelOption:!0}}).afterClosed().pipe(y(e=>f.IsNotEmpty(e))).subscribe(e=>{this.scanAllProduct(t.ID,e)})}scanAllProduct(t,e){let i=this.productService.findChannelById(t,this.channelOptions);this.productService.scanAll(e.ChannelID,e.ScanFull,e.UpdatedProduct,e.Async).pipe(y(h=>h)).subscribe(h=>{e.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(h,i,!e.UpdatedProduct),this.setObsProductStatistic())})}onClearCache(t){confirm("Are you sure you want to Clear Cache? This Process will remove your product integration to marketplace")&&this.productService.clearCacheChannel(t).pipe(Vt(this.destroy$)).subscribe(i=>{this.toastr.success("Successfully cleared cache","Success"),this.setObsProductStatistic()})}getChannelLogo(t){return f.getChannelLogoByTypeId(t)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};r.\u0275fac=function(e){return new(e||r)(S(j),S(W),S(J),S(R))},r.\u0275cmp=M({type:r,selectors:[["app-channel-statistic"]],decls:9,vars:6,consts:[["EMPTY",""],["QUESTION",""],["headerTitle","Products Statistic",3,"hideSearchBox","hideSearchDropdown"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[1,"text-center",2,"width","13rem"],[1,"text-center",2,"width","9rem"],[1,"text-center",2,"width","14rem"],[2,"width","10rem"],[2,"width","12rem"],[4,"ngFor","ngForOf"],[2,"width","24px","height","24px",3,"src"],[1,"ms-3"],[1,"text-center"],[3,"routerLink","queryParams"],[1,"d-flex","align-items-center","justify-content-center"],[1,"btn","btn-sm","btn-secondary","fs-6",3,"click"],[1,"fa","fa-spinner"],[1,"btn","btn-sm","btn-secondary","fs-6","ms-3",3,"click"],[1,"fa","fa-trash"],["matTooltip","Click to see total live product",1,"cursor-pointer","fs-5","text-primary",3,"click"],[1,"fa-solid","fa-circle-question","cursor"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(e,i){if(e&1&&(a(0,"mainpanel",2)(1,"content")(2,"div",3)(3,"div",4)(4,"div",5),x(5,Ln,19,3,"ng-container",6),E(6,"async"),x(7,Rn,2,0,"ng-template",null,0,nt),l()()()()()),e&2){let h,_=G(8);s("hideSearchBox",!0)("hideSearchDropdown",!0),c(5),s("ngIf",((h=V(6,4,i.channels$))==null||h.Data==null?null:h.Data.length)>0)("ngIfElse",_)}},dependencies:[k,A,B,Mt,It,$,xt,vt,zt]});let o=r;return o})();var Bn=[{component:Ie,path:"",children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:Me,canActivate:[tt],data:{title:"Products in POS"}},{path:"sold-in-channel",component:De,canActivate:[tt],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:Oe,canActivate:[tt],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:Te,canActivate:[tt],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:Fe,canActivate:[tt],data:{title:"Duplicate Sku in Channel"}},{path:"channel-statistic",component:ke,canActivate:[tt],data:{title:"Channel Statistic"}}]}],go=(()=>{let r=class r{};r.\u0275fac=function(e){return new(e||r)},r.\u0275mod=Wt({type:r}),r.\u0275inj=Gt({imports:[Pt,wt,oe,Dt,qt,be,se,ae,Ft,z,q,Yt.forChild(Bn),Se,Qt,ct]});let o=r;return o})();export{go as StatusModule};
|
|
1
|
+
import{a as N,b as Tt,c as Pe}from"./chunk-UVOYHHTH.js";import{a as $}from"./chunk-BGWVHGAY.js";import"./chunk-CDJSFYAA.js";import{a as ve}from"./chunk-JY3L4RUM.js";import{a as Z}from"./chunk-7KG3DC5J.js";import{b as xe}from"./chunk-ULELZXI5.js";import"./chunk-E5BOLHDG.js";import"./chunk-A37OKNC2.js";import{a as re,b as ae}from"./chunk-7YWHTN3X.js";import{e as at}from"./chunk-F4QDIL47.js";import{f as _e,g as ge,h as Ce,i as fe,j as Se}from"./chunk-KZ6AD6KW.js";import"./chunk-BZPMSXEO.js";import{a as j}from"./chunk-7VKIP3Z6.js";import"./chunk-DYLT6RRK.js";import{a as Ft}from"./chunk-6UDYSYXW.js";import{a as z}from"./chunk-VBCIYCOF.js";import{b as be}from"./chunk-MKJON4UM.js";import{a as me,b as ue}from"./chunk-WKSTGJK5.js";import{a as le,b as ce,c as se}from"./chunk-GQG2K3LS.js";import{a as tt}from"./chunk-45ETPFJ5.js";import{a as q}from"./chunk-D6L7HUOY.js";import"./chunk-BTY6PS53.js";import{a as he}from"./chunk-D76K4RZ7.js";import{f as pe,g as de}from"./chunk-EIBGI6U2.js";import{a as rt,b as yt,d as Y,e as qt}from"./chunk-PYD2YWAN.js";import{i as R}from"./chunk-DMVTFOY7.js";import{b as W,e as K}from"./chunk-JHYIHRQH.js";import"./chunk-KCDL7SWP.js";import{b as te,c as ee,d as J,h as Ot,i as ne,j as ie,m as B,n as oe}from"./chunk-4CEFDQPI.js";import{t as Mt,u as Dt}from"./chunk-2SC3HO66.js";import{P as Qt,X as Xt}from"./chunk-DQIP7MCZ.js";import{b as Zt,c as ot,h as U,m as L,y as wt}from"./chunk-2E5AKA74.js";import{b as H,c as f}from"./chunk-FTHTFVHH.js";import{$c as Yt,B as y,Bc as xt,Cc as zt,Ec as vt,Fc as Pt,Ha as D,Ib as G,Ja as c,Jb as d,Ka as S,Kb as et,Lb as I,Nb as O,Ob as T,Pb as F,Rb as Kt,Sb as X,T as ft,Tb as pt,V as Vt,Va as Ut,Wc as bt,X as $t,Xc as Ht,Yc as it,Zc as It,_a as x,aa as Gt,ab as s,ac as E,bc as V,c as Bt,cc as Jt,da as At,dc as nt,ga as M,ha as Wt,hb as St,mb as a,nb as l,oa as m,ob as g,pa as u,pb as P,q as jt,qb as b,sb as v,vb as C,xb as p,xc as k,yc as A}from"./chunk-ZIZWZZ4E.js";import"./chunk-GNOSNGXM.js";var Ve=()=>["/menu/products/download/by-url"],Ie=(()=>{let r=class r{constructor(){this.productTabs=[{Title:"Sold in Channel",Url:"/menu/products/status/sold-in-channel",Description:"SKU has been mapped between dealpos and marketplace"},{Title:"Not in POS",Url:"/menu/products/status/not-in-pos",Description:"SKU sold in Marketplace but not exist in DEALPOS"},{Title:"Not in Channel",Url:"/menu/products/status/not-in-channel",Description:"SKU has not been sold on one of channels"},{Title:"In POS",Url:"/menu/products/status/in-pos",Description:"All products which is already available in POS"},{Title:"Multiple Listing",Url:"/menu/products/status/duplicate-sku",Description:"SKU(s) which is listed more than one time (one to many)"},{Title:"Channel Statistic",Url:"/menu/products/status/channel-statistic",Description:"Product statistic from each channel obtained from the last product scan"}]}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=M({type:r,selectors:[["app-status"]],decls:13,vars:3,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-flex"],[1,"dropdown-item",3,"routerLink"]],template:function(e,i){e&1&&(a(0,"nav",0)(1,"div",1)(2,"div"),g(3,"nav-tab",2),l()(),a(4,"div")(5,"div",3)(6,"a",4),g(7,"i",5),l(),a(8,"div",6)(9,"div",7)(10,"a",8),d(11,"Download Product By Url"),l()()()()()(),g(12,"router-outlet")),e&2&&(c(3),s("Tabs",i.productTabs),c(7),s("routerLink",X(2,Ve)))},dependencies:[re,Ht,It]});let o=r;return o})();function Ae(o,r){if(o&1&&(a(0,"mat-option",6)(1,"div"),g(2,"img",7),a(3,"span"),d(4),l()()()),o&2){let n=r.$implicit;s("value",n.ChannelID),c(2),s("src",n.logo,D),c(2),et(n.Title)}}var ct=(()=>{let r=class r{constructor(){this.dialogRef=At(te),this.channels=At(ee),this.channelIds=Ut([]),this.channelOptions=Ut([])}ngOnInit(){this.initModalConfig();let t=this.channels.filter((e,i,h)=>h.findIndex(_=>_.ChannelID===e.ChannelID)===i);this.channelOptions.set(t)}initModalConfig(){this.modalConfig=new ne,this.modalConfig.title="Detach Product",this.modalConfig.okText="Save"}onClose(){this.dialogRef.close()}onSave(){let t=this.channels.filter(e=>this.channelIds().includes(e.ChannelID)).map(e=>({ChannelID:e.ChannelID,ChannelItemID:e.ChannelItemID}));this.dialogRef.close(t)}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=M({type:r,selectors:[["app-modal-detach-product"]],standalone:!0,features:[Kt],decls:8,vars:5,consts:[[3,"onClose","onCancel","onOk","dynamicValidated","config"],["content",""],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"ngModelChange","ngModel","multiple"],["class","channel-option",3,"value",4,"ngFor","ngForOf"],[1,"channel-option",3,"value"],[2,"width","18px","margin-right","10px",3,"src"]],template:function(e,i){e&1&&(a(0,"modal-material",0),C("onClose",function(){return i.onClose()})("onCancel",function(){return i.onClose()})("onOk",function(){return i.onSave()}),a(1,"div",1)(2,"div")(3,"label",2),d(4,"Select a Channel"),l(),a(5,"mat-form-field",3)(6,"mat-select",4),F("ngModelChange",function(_){return T(i.channelIds,_)||(i.channelIds=_),_}),x(7,Ae,5,3,"mat-option",5),l()()()()()),e&2&&(s("dynamicValidated",i.channelIds().length>0)("config",i.modalConfig),c(6),O("ngModel",i.channelIds),s("multiple",!0),c(),s("ngForOf",i.channelOptions()))},dependencies:[Pt,k,ie,de,pe,ue,me,Xt,wt,U,L,Dt]});let o=r;return o})();function Ue(o,r){if(o&1){let n=v();a(0,"button",13),C("click",function(){m(n);let e=p();return u(e.onDetachMultipleProduct())}),g(1,"i",14),d(2),l()}if(o&2){let n,t=p();c(2),I("Detach (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function Le(o,r){if(o&1){let n=v();a(0,"button",16),C("click",function(){m(n);let e=p(2);return u(e.onOpenScanDialog())}),g(1,"i",17),d(2," Scan Channel "),l()}}function Re(o,r){if(o&1&&(P(0),x(1,Le,3,0,"button",15),b()),o&2){let n=p();c(),s("ngIf",!n.productService.hasSelection(n.products))}}function Be(o,r){if(o&1){let n=v();P(0),a(1,"button",18),C("click",function(){m(n);let e=p();return u(e.onScanMultipleProduct())}),g(2,"i",17),d(3),l(),b()}if(o&2){let n,t=p();c(3),I(" Scan (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function je(o,r){if(o&1){let n=v();P(0),a(1,"button",19),C("click",function(){m(n);let e=p();return u(e.onUploadMultipleProduct())}),g(2,"i",20),d(3),l(),b()}if(o&2){let n,t=p();c(3),I(" Upload (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function $e(o,r){if(o&1){let n=v();a(0,"div",21)(1,"app-product-card",22),C("onUpload",function(){let e=m(n).$implicit,i=p();return u(i.onUploadToMultipleChannel(e))})("onScan",function(){let e=m(n).$implicit,i=p();return u(i.onScanSingleProduct(e))})("onDescEvent",function(){let e=m(n).index,i=p();return u(i.onOpenDialogVariant(e))})("onCheckBoxChange",function(e){let i=m(n).$implicit;return u(i.selected=e)})("onDetach",function(){let e=m(n).$implicit,i=p();return u(i.onDetachProduct([e]))}),l()()}if(o&2){let n=r.$implicit,t=p();c(),s("productId",n.ID)("title",n==null?null:n.Name)("image",n==null?null:n.ThumbnailUrl)("description",(n==null?null:n.Variants.length)>1?(n==null?null:n.Variants.length)+" Variants":null)("channels",t.productService.getChannelProduct(n))("code",t.getVariantCode(n==null?null:n.Variants))("showCheckBox",(n==null?null:n.Channel.length)<t.channelOptions.length)("scanButton",!0)("uploadButton",n==null?null:n.hasUpload)("imageForZoom",n==null?null:n.ImageUrl)("detachButton",(n==null||n.Channel==null?null:n.Channel.length)>0)}}function Ge(o,r){o&1&&(P(0),a(1,"div",23),g(2,"app-empty-state"),l(),b())}function We(o,r){if(o&1){let n=v();P(0),a(1,"div",24)(2,"div",25)(3,"app-custom-paginator",26),C("next",function(){m(n);let e=p();return u(e.getProducts())})("previous",function(){m(n);let e=p();return u(e.getProducts())}),l()()(),b()}if(o&2){let n=p();c(3),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",!0)}}var Me=(()=>{let r=class r{constructor(t,e,i,h,_,w,st){this.http=t,this.toastr=e,this.dialog=i,this.productService=h,this.authService=_,this.uploadProductService=w,this.route=st,this.searchFilter=new Z,this.products=[],this.rowCount=0,this.multipeScanChannels=[],this.getLoaderPage(),this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}getLoaderPage(){this.productService.LoadInPOS().subscribe(t=>{this.Categories=t.Options.Categories,this.searchFilter.PageNumber=t.Filter.PageNumber,this.searchFilter.RowCount=t.Filter.RowCount,this.searchFilter.ChannelID=null,this.searchFilter.Category=t.Filter.Category,this.searchFilter.PageSize=100,this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[H.Tokopedia,H.Tiktok])}getProducts(){let t={PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Category:this.searchFilter.Category,From:this.startDate,To:this.endDate};this.http.post("/api/product/GetInPOS",t).subscribe(e=>{this.products=e.Data,this.rowCount=e.Total==null?this.searchFilter.RowCount:e.Total.toString(),this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions)})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=f.GuidEMpty,this.dialog.open(N,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>f.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.Async,this.scanAllProduct()})}scanAllProduct(){if(this.searchFilter.ChannelID==null){this.toastr.error("Please Select Channel","Error");return}this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(t=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{this.getLoaderPage();let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,e,!this.searchFilter.UpdatedProduct)}})}onOpenDialogVariant(t){this.dialog.open(Tt,{data:{title:this.products[t].Name,variants:this.products[t].Variants},width:"800px"})}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.uploadProductService.setSelectedProduct(t),this.route.navigate(["/menu/products/upload"])}onUploadToMultipleChannel(t){this.uploadProductService.setSelectedProduct([t]),this.route.navigate(["/menu/products/upload"])}searchProduct(t){this.searchFilter.text=t,this.getProducts()}onScanMultipleProduct(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=f.GuidEMpty;let e=this.productService.filterChannelByTypeId(this.channelOptions,[H.Tokopedia,H.Tiktok]);this.dialog.open(N,{data:{filter:t,channelOptions:e,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(h=>f.IsNotEmpty(h))).subscribe(h=>{this.searchFilter.ChannelID=h.ChannelID,this.searchFilter.ScanFull=h.ScanFull,this.searchFilter.UpdatedProduct=h.UpdatedProduct;let _=this.productService.selectedProduct(this.products),w=this.productService.getVariantCodesProducts(_);this.scanSingleProduct(w)})}onScanSingleProduct(t){let e=JSON.parse(JSON.stringify(this.searchFilter));e.ChannelID=f.GuidEMpty,this.dialog.open(N,{data:{filter:e,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>f.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID;let h=this.productService.getVariantCodesProduct(t);this.scanSingleProduct(h)})}scanSingleProduct(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:e=>{if(e)this.toastr.success("Successfully Scan ","Success");else{let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${i?.Name} `,"Error")}this.searchFilter.ChannelID=f.GuidEMpty,e&&this.getProducts()},error:e=>{this.searchFilter.ChannelID=f.GuidEMpty}})}getVariantCode(t){let e;return t.length>1&&(e=(t[0].model?t[0].model:"")+t[0].Code),t.length==1&&(e=t[0].Code),e}onDetachProduct(t){let e=[];t.forEach(i=>{i.Channel=f.assignChannelLogo(i.Channel),e.push(...i.Channel)}),this.dialog.open(ct,{width:"600px",data:[...e]}).afterClosed().pipe(y(i=>f.IsNotEmpty(i)),ft(i=>this.productService.detachProduct(i))).subscribe(i=>{this.toastr.success(i.Message,Ot.Success),this.getProducts()})}onDetachMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.onDetachProduct(t)}};r.\u0275fac=function(e){return new(e||r)(S(K),S(W),S(J),S(j),S(R),S(at),S(it))},r.\u0275cmp=M({type:r,selectors:[["app-in-pos"]],decls:23,vars:14,consts:[["picker",""],["description","All products which is already available in POS",3,"onSubmit","headerTitle"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","Name","bindValue","Name","placeholder","Select Category",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[1,"mt-5"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"fa-sharp","fa-link-slash","me-2"],["type","button","data-cy","scanSoldinChannel","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onUpload","onScan","onDescEvent","onCheckBoxChange","onDetach","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","detachButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(e,i){if(e&1){let h=v();a(0,"mainpanel",1),C("onSubmit",function(w){return m(h),u(i.searchProduct(w))}),a(1,"actions"),x(2,Ue,3,1,"button",2)(3,Re,2,1,"ng-container",3)(4,Be,4,1,"ng-container",3)(5,je,4,1,"ng-container",3),l(),a(6,"filters")(7,"div")(8,"label",4),d(9,"Category"),l(),a(10,"ng-select",5),C("ngModelChange",function(w){return m(h),u(i.searchFilter.Category=w)}),l()(),a(11,"div",6)(12,"mat-date-range-input",7)(13,"input",8),F("ngModelChange",function(w){return m(h),T(i.startDate,w)||(i.startDate=w),u(w)}),C("click",function(){m(h);let w=G(16);return u(w.open())}),l(),a(14,"input",9),F("ngModelChange",function(w){return m(h),T(i.endDate,w)||(i.endDate=w),u(w)}),C("click",function(){m(h);let w=G(16);return u(w.open())}),l()(),g(15,"mat-date-range-picker",null,0),l()(),a(17,"content")(18,"div",10)(19,"div",11),x(20,$e,2,11,"div",12)(21,Ge,3,0,"ng-container",3),l(),x(22,We,4,4,"ng-container",3),l()()()}if(e&2){let h=G(16);s("headerTitle","In POS ("+i.rowCount+")"),c(2),St(i.productService.hasSelection(i.products)?2:-1),c(),s("ngIf",!i.productService.hasSelection(i.products)),c(),s("ngIf",i.productService.hasSelection(i.products)&&i.multipeScanChannels.length>0),c(),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("items",i.Categories)("ngModel",i.searchFilter.Category),c(2),s("rangePicker",h),c(),O("ngModel",i.startDate),c(),O("ngModel",i.endDate),c(6),s("ngForOf",i.products),c(),s("ngIf",i.products.length==0),c(),s("ngIf",i.products.length>0)}},dependencies:[k,A,ot,U,L,B,Y,z,q,$,Ce,_e,ge,fe],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.img-logo[_ngcontent-%COMP%]{height:24px;width:24px}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}"]});let o=r;return o})();function Ke(o,r){if(o&1){let n=v();a(0,"button",11),C("click",function(){m(n);let e=p();return u(e.onDetachMultipleProduct())}),g(1,"i",12),d(2),l()}if(o&2){let n,t=p();c(2),I("Detach (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function Je(o,r){if(o&1){let n=v();P(0),a(1,"button",13),C("click",function(){m(n);let e=p();return u(e.onOpenScanDialog())}),g(2,"i",14),d(3," Scan Channel "),l(),b()}}function ze(o,r){if(o&1){let n=v();P(0),a(1,"button",15),C("click",function(){m(n);let e=p();return u(e.onScanMultipleProduct())}),g(2,"i",14),d(3),l(),b()}if(o&2){let n=p();c(3),I(" Scan (",n.productService.selectedProduct(n.products).length,") ")}}function He(o,r){if(o&1){let n=v();P(0),a(1,"button",16),C("click",function(){m(n);let e=p();return u(e.onUploadMultipleProduct())}),g(2,"i",17),d(3),l(),b()}if(o&2){let n=p();c(3),I(" Upload (",n.productService.selectedProduct(n.products).length,") ")}}function Ye(o,r){if(o&1&&(a(0,"span",18),g(1,"img",19),l(),d(2)),o&2){let n=r.item;c(),s("src",n.Img,D)("alt",n.Name),c(),I(" ",n.Name," ")}}function Ze(o,r){if(o&1){let n=v();a(0,"div",20)(1,"label",21),d(2,"Item ID"),l(),a(3,"input",22),F("ngModelChange",function(e){m(n);let i=p();return T(i.searchFilter.Item_id,e)||(i.searchFilter.Item_id=e),u(e)}),l()()}if(o&2){let n=p();c(3),O("ngModel",n.searchFilter.Item_id)}}function qe(o,r){if(o&1){let n=v();a(0,"div",23)(1,"app-product-card",24),C("onUpload",function(){let e=m(n).$implicit,i=p();return u(i.onUploadToMultipleChannel(e))})("onDescEvent",function(){let e=m(n).index,i=p();return u(i.onOpenVariantDetail(e))})("onScan",function(){let e=m(n).$implicit,i=p();return u(i.onScanSingleProduct(e))})("onCheckBoxChange",function(e){let i=m(n).$implicit;return u(i.selected=e)})("onDetach",function(){let e=m(n).$implicit,i=p();return u(i.onDetachProduct([e]))}),l()()}if(o&2){let n=r.$implicit,t=p();c(),s("productId",n==null?null:n.ID)("title",n==null?null:n.Name)("image",n==null?null:n.ThumbnailUrl)("description",(n==null||n.Variants==null?null:n.Variants.length)>1?(n==null||n.Variants==null?null:n.Variants.length)+" Variants":null)("channels",t.productService.getChannelProduct(n))("code",t.getVariantCode(n==null?null:n.Variants))("showCheckBox",n==null?null:n.hasScan)("scanButton",!0)("uploadButton",n==null?null:n.hasUpload)("imageForZoom",n==null?null:n.ImageUrl)("detachButton",(n==null||n.Channel==null?null:n.Channel.length)>0)}}function Qe(o,r){o&1&&(P(0),a(1,"div",25),g(2,"app-empty-state"),l(),b())}function Xe(o,r){if(o&1){let n=v();a(0,"div",26)(1,"div",27)(2,"app-custom-paginator",28),C("total",function(){m(n);let e=p();return u(e.getRowCount())})("next",function(){m(n);let e=p();return u(e.getProducts())})("previous",function(){m(n);let e=p();return u(e.getProducts())}),l()()()}if(o&2){let n=p();c(2),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}var De=(()=>{let r=class r{constructor(t,e,i,h,_,w,st,Ct){this.http=t,this.dialog=e,this.toastr=i,this.productService=h,this.activateRouter=_,this.authService=w,this.route=st,this.uploadProductService=Ct,this.searchFilter=new Z,this.products=[],this.rowCount=0,this.hasClickRowCount=!1,this.guidEmpty=f.GuidEMpty,this.multipeScanChannels=[],this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(f.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(e=>{this.searchFilter=e.Filter,e.Filter.ChannelID!=f.GuidEMpty&&(this.searchFilter.ListChannelID=[],this.searchFilter.ListChannelID.push(e.Filter.ChannelID)),this.searchFilter.PageSize=e.Filter.RowCount,this.searchFilter.Item_id="",this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[H.Tokopedia,H.Tiktok])}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Item_id:this.searchFilter.Item_id};this.productService.findAllSoldInChannel(t).subscribe(e=>{this.products=e.Data,this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions),this.products=this.productService.checkProductHasScanButton(this.products,this.channelOptions)})}searchProduct(t){this.searchFilter.text=t,this.hasClickRowCount=!1,this.getProducts()}onOpenVariantDetail(t){let e=this.products[t].Variants;this.dialog.open(Tt,{data:{variants:e,title:this.products[t].Name},width:"800px"})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=f.GuidEMpty,this.dialog.open(N,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>f.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.Async,this.scanAllProduct()})}scanAllProduct(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).pipe(y(e=>e)).subscribe(e=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(e,t,!this.searchFilter.UpdatedProduct),this.initPageLoader(f.GuidEMpty))})}onScanSingleProduct(t){t.Channel=this.productService.getChannelProduct(t);let e=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(N,{data:{filter:e,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>f.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID;let h=this.productService.getVariantCodesProduct(t);this.scanProducts(h)})}onUploadToMultipleChannel(t){this.uploadProductService.setSelectedProduct([t]),this.route.navigate(["/menu/products/upload"])}onScanMultipleProduct(){this.searchFilter.ChannelID=f.GuidEMpty;let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(N,{data:{filter:t,channelOptions:this.multipeScanChannels,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>f.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct;let h=this.productService.selectedProduct(this.products),_=this.productService.getVariantCodesProducts(h);this.scanProducts(_)})}scanProducts(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:e=>{let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);e?this.toastr.success(`Product Successfully scan with ${i?.Name}`,"Success"):this.toastr.error(`This product is not existed in ${i?.Name} `,"Error"),this.searchFilter.ChannelID=f.GuidEMpty,e&&this.getProducts()},error:e=>{this.searchFilter.ChannelID=f.GuidEMpty}})}getVariantCode(t){let e;return t.length>1&&(e=(t[0].model?t[0].model:"")+t[0].Code),t.length==1&&(e=t[0].Code),e}onClearFilterChannel(){this.searchFilter.ChannelID=f.GuidEMpty,this.searchFilter.Item_id=""}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.uploadProductService.setSelectedProduct(t),this.route.navigate(["/menu/products/upload"])}getRowCount(){let t={ListChannelID:this.searchFilter.ListChannelID,text:this.searchFilter.text};this.http.post("/api/product/GetSoldInChannelRowCount",t).subscribe(e=>{this.hasClickRowCount=!0,this.rowCount=e.Total})}onDetachProduct(t){let e=[];t.forEach(i=>{i.Channel=f.assignChannelLogo(i.Channel),e.push(...i.Channel)}),this.dialog.open(ct,{width:"600px",data:[...e]}).afterClosed().pipe(y(i=>f.IsNotEmpty(i)),ft(i=>this.productService.detachProduct(i))).subscribe(i=>{this.toastr.success(i.Message,Ot.Success),this.getProducts()})}onDetachMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.onDetachProduct(t)}};r.\u0275fac=function(e){return new(e||r)(S(K),S(J),S(W),S(j),S(bt),S(R),S(it),S(at))},r.\u0275cmp=M({type:r,selectors:[["app-sold-in-channel"]],decls:19,vars:13,consts:[["description","SKU has been mapped between dealpos and marketplace",3,"onSubmit","headerTitle"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clear","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],["class","mt-5",4,"ngIf"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"fa-sharp","fa-link-slash","me-2"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"mt-5"],[1,"fw-bold"],["type","text","name","Item_id","id","Item_id",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onUpload","onDescEvent","onScan","onCheckBoxChange","onDetach","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","detachButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(e,i){e&1&&(a(0,"mainpanel",0),C("onSubmit",function(_){return i.searchProduct(_)}),a(1,"actions"),x(2,Ke,3,1,"button",1)(3,Je,4,0,"ng-container",2)(4,ze,4,1,"ng-container",2)(5,He,4,1,"ng-container",2),l(),a(6,"filters")(7,"div")(8,"label",3),d(9,"Channel"),l(),a(10,"ng-select",4),C("ngModelChange",function(_){return i.searchFilter.ListChannelID=_})("clear",function(){return i.onClearFilterChannel()}),x(11,Ye,3,3,"ng-template",5),l()(),x(12,Ze,4,1,"div",6),l(),a(13,"content")(14,"div",7)(15,"div",8),x(16,qe,2,11,"div",9)(17,Qe,3,0,"ng-container",2),l(),x(18,Xe,3,4,"div",10),l()()()),e&2&&(s("headerTitle","Sold in Channel"),c(2),St(i.productService.hasSelection(i.products)?2:-1),c(),s("ngIf",!i.productService.hasSelection(i.products)),c(),s("ngIf",i.multipeScanChannels.length>0&&i.productService.hasSelection(i.products)),c(),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("multiple",!0)("items",i.channelOptions)("ngModel",i.searchFilter.ListChannelID),c(2),s("ngIf",i.searchFilter.ListChannelID!=null),c(4),s("ngForOf",i.products),c(),s("ngIf",i.products.length==0),c(),s("ngIf",i.products==null?null:i.products.length))},dependencies:[k,A,ot,U,L,B,Y,rt,yt,z,q,$],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]});let o=r;return o})();function en(o,r){if(o&1){let n=v();a(0,"button",13),C("click",function(){m(n);let e=p(2);return u(e.uploadMultipleProduct())}),g(1,"i",14),d(2),l()}if(o&2){let n=p(2);c(2),I(" upload (",n.selectedProducts==null?null:n.selectedProducts.length,") ")}}function nn(o,r){if(o&1){let n=v();P(0),a(1,"td",29)(2,"input",30),F("ngModelChange",function(e){m(n);let i=p(2).$implicit;return T(i.selected,e)||(i.selected=e),u(e)}),C("ngModelChange",function(){m(n);let e=p(3).ngIf,i=p(3);return u(i.onSelectProduct(e))}),l()(),b()}if(o&2){let n=p(2).$implicit;c(),s("rowSpan",n==null?null:n.Variants.length),c(),O("ngModel",n.selected)}}function on(o,r){if(o&1){let n=v();P(0),a(1,"img",35),C("click",function(e){m(n);let i=p(3).$implicit,h=p(4);return u(h.onZoomImage(e,i==null?null:i.ImageUrl))}),l(),b()}if(o&2){let n=p(3).$implicit;c(),s("src",n==null?null:n.ImageUrl,D)}}function rn(o,r){o&1&&g(0,"img",36)}function an(o,r){if(o&1&&(P(0),a(1,"td",29)(2,"div",31),x(3,on,2,1,"ng-container",11)(4,rn,1,0,"ng-template",null,1,nt),l()(),a(6,"td",32)(7,"h4",33)(8,"span",34),d(9),l()()(),b()),o&2){let n=G(5),t=p(2).$implicit;c(),s("rowSpan",t==null?null:t.Variants.length),c(2),s("ngIf",t==null?null:t.ImageUrl)("ngIfElse",n),c(3),s("rowSpan",t==null?null:t.Variants.length),c(2),s("matTooltip",(t==null||t.Name==null?null:t.Name.length)>50?t==null?null:t.Name:""),c(),I(" ",t==null?null:t.Name," ")}}function ln(o,r){if(o&1&&(a(0,"div")(1,"a",25),g(2,"img",37),l()()),o&2){let n=r.$implicit;c(),s("href",n.URL,D),c(),s("src",n.Img,D)("matTooltip",n.Name)}}function cn(o,r){if(o&1&&(a(0,"div"),g(1,"img",37),l()),o&2){let n=r.$implicit;c(),s("src",n.Img,D)("matTooltip",n.Name)}}function sn(o,r){if(o&1&&(a(0,"tr"),x(1,nn,3,2,"ng-container",12)(2,an,10,6,"ng-container",12),a(3,"td"),d(4),l(),a(5,"td")(6,"span"),d(7),l(),a(8,"span",24)(9,"a",25),g(10,"i",26),l()()(),a(11,"td",27)(12,"div",28),x(13,ln,3,3,"div",23),l()(),a(14,"td",27)(15,"div",28),x(16,cn,2,2,"div",23),l()()()),o&2){let n=r.$implicit,t=r.index,e=p(5);c(),s("ngIf",t==0),c(),s("ngIf",t==0),c(2),I(" ",n.Name," "),c(3),I(" ",n.Code," "),c(2),s("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),D),c(4),s("ngForOf",n==null?null:n.Available),c(3),s("ngForOf",n==null?null:n.NotAvailable)}}function pn(o,r){if(o&1&&(P(0),x(1,sn,17,7,"tr",23),b()),o&2){let n=r.$implicit;c(),s("ngForOf",n.Variants)}}function dn(o,r){if(o&1&&(a(0,"tbody"),x(1,pn,2,1,"ng-container",23),l()),o&2){let n=r.ngIf;c(),s("ngForOf",n)}}function mn(o,r){if(o&1&&(P(0),a(1,"div",15)(2,"table",16)(3,"thead",17)(4,"tr"),g(5,"th",18),a(6,"th",19),d(7,"Product"),l(),a(8,"th",20),d(9,"Variant"),l(),a(10,"th",20),d(11,"SKU"),l(),a(12,"th",21),d(13,"Available In"),l(),a(14,"th",22),d(15,"Not Available In"),l()()(),x(16,dn,2,1,"tbody",12),E(17,"async"),l()(),b()),o&2){let n=p(2);c(16),s("ngIf",V(17,1,n.data$))}}function un(o,r){o&1&&(a(0,"div",38),g(1,"app-empty-state"),l())}function hn(o,r){if(o&1){let n=v();a(0,"span",46),C("click",function(){m(n);let e=p(4);return u(e.getRowCount())}),a(1,"i",47),d(2,"?"),l()()}}function _n(o,r){if(o&1&&(a(0,"span"),d(1),E(2,"number"),l()),o&2){let n=r.ngIf;c(),et(V(2,1,n==null?null:n.Count))}}function gn(o,r){if(o&1){let n=v();a(0,"a",48),C("click",function(){m(n);let e=p(4);return u(e.onNextPage())}),g(1,"i",49),d(2," Next"),l()}}function Cn(o,r){if(o&1){let n=v();a(0,"a",50),C("click",function(){m(n);let e=p(4);return u(e.onLastPage())}),g(1,"i",51),d(2," Last"),l()}}function fn(o,r){if(o&1&&(P(0),a(1,"div",39)(2,"div",40)(3,"div",41),d(4),E(5,"number"),x(6,hn,3,0,"span",42)(7,_n,3,3,"span",12),E(8,"async"),d(9),l()(),a(10,"div",43),x(11,gn,3,0,"a",44)(12,Cn,3,0,"a",45),l()(),b()),o&2){let n=p().ngIf,t=p(2);c(4),I(" Showing 1 - ",V(5,6,n==null?null:n.length)," of "),c(2),s("ngIf",t.paginationService.hideCount),c(),s("ngIf",!t.paginationService.hideCount&&V(8,8,t.rowCount$)),c(2),I(" records ~ ",t.paginationService.footerPageNumber," Page "),c(2),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),c(),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}function Sn(o,r){if(o&1&&(P(0),x(1,fn,13,10,"ng-container",12),b()),o&2){let n=r.ngIf;c(),s("ngIf",(n==null?null:n.length)>0)}}function xn(o,r){if(o&1){let n=v();a(0,"mainpanel",3),C("onSubmit",function(e){m(n);let i=p();return u(i.searchProduct(e))}),a(1,"actions"),x(2,en,3,1,"button",4),a(3,"button",5),C("click",function(){m(n);let e=p();return u(e.openScanDialog())}),g(4,"i",6),d(5," Scan Channel "),l(),a(6,"button",7),C("click",function(){m(n);let e=p();return u(e.openExportDialog())}),g(7,"i",8),a(8,"span"),d(9,"Export"),l()()(),a(10,"content")(11,"div",9)(12,"div",10),x(13,mn,18,3,"ng-container",11),E(14,"async"),x(15,un,2,0,"ng-template",null,0,nt),l(),x(17,Sn,2,1,"ng-container",12),E(18,"async"),l()()()}if(o&2){let n,t=G(16),e=p();s("hideSearchDropdown",!0),c(2),s("ngIf",e.hasSelectionProduct),c(11),s("ngIf",((n=V(14,5,e.data$))==null?null:n.length)>0)("ngIfElse",t),c(4),s("ngIf",V(18,7,e.data$))}}var Oe=(()=>{let r=class r{constructor(t,e,i,h,_,w,st,Ct,Ne){this.http=t,this.dialog=e,this.toastr=i,this.route=h,this.productService=_,this.paginationService=w,this.biggerPictureService=st,this.authService=Ct,this.uploadProductService=Ne,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannelV2",this.hasSelectionProduct=!1,this.selectedProducts=[],this.channelOptions=Ct.getChannels(),this.hostName=this.authService.getDomain()}ngOnInit(){this.initPageLoader(),this.iniData()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.notChannelAPI,this.loader$=this.http.post(`api/${this.loaderAPI}`,{}).pipe($t(t=>{this.filterSearch=t.Filter,this.paginationService.reloadPagination(t.Filter)}))}iniData(){this.data$=this.paginationService.data$.pipe(jt(t=>(t=t.map(e=>(e.Variants=e.Variants.map(i=>(i.Available=this.productService.sortChannel(i.Available),i.NotAvailable=this.productService.sortChannel(i.NotAvailable),i.Available=this.assignLogoChannel(i.Available),i.NotAvailable=this.assignLogoChannel(i.NotAvailable),i)),e.Channel=e?.Variants[0]?.Available,e)),t)))}assignLogoChannel(t){return t=t.map(e=>(e.Img=f.getChannelLogoByTypeId(e.TypeID),e)),t}searchProduct(t){this.filterSearch.text=t,this.paginationService.reloadPagination(this.filterSearch)}scanAllProduct(){let t=this.productService.findChannelById(this.filterSearch.ChannelID,this.channelOptions);this.productService.scanAll(this.filterSearch.ChannelID,this.filterSearch.ScanFull,this.filterSearch.UpdatedProduct,this.filterSearch.Async).subscribe(e=>{this.filterSearch.Async?this.toastr.success("You will be notified when the scan is completed.","Scan Asynchronous"):(this.productService.successToastrScanAllProduct(e,t,!this.filterSearch.UpdatedProduct),this.initPageLoader())})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.filterSearch));t.ChannelID=f.GuidEMpty,this.dialog.open(N,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>f.IsNotEmpty(i))).subscribe(i=>{this.filterSearch.ChannelID=i.ChannelID,this.filterSearch.ScanFull=i.ScanFull,this.filterSearch.UpdatedProduct=i.UpdatedProduct,this.filterSearch.Async=i.Async,this.scanAllProduct()})}getRowCount(){this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`/api/${this.rowCountAPI}`,this.filterSearch)}onNextPage(){this.paginationService.onNextPage(this.filterSearch)}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:t=>{this.filterSearch.PageNumber=1,this.paginationService.getAllData(this.filterSearch,t.Count)}})}onZoomImage(t,e){this.biggerPictureService.openBiggerPicture(t,e)}onSelectProduct(t){this.hasSelectionProduct=this.productService.hasSelection(t),this.selectedProducts=this.productService.selectedProduct(t)}uploadMultipleProduct(){this.uploadProductService.setSelectedProduct(this.selectedProducts),this.route.navigate(["/menu/products/upload"])}ngOnDestroy(){this.paginationService.destroy()}openExportDialog(){this.dialog.open(xe,{data:{title:"Export Not In Channel",pageNumber:this.filterSearch.PageNumber,rowCount:this.filterSearch.RowCount,filterExport:this.filterSearch,getRowCountApi:"product/GetNotInChannelRowCount",exportApi:"product/GetNotInChannelExport"}}).afterClosed().subscribe()}};r.\u0275fac=function(e){return new(e||r)(S(K),S(J),S(W),S(it),S(j),S(ve),S(he),S(R),S(at))},r.\u0275cmp=M({type:r,selectors:[["app-not-in-channel"]],decls:2,vars:3,consts:[["EMPTY",""],["elsePic",""],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"hideSearchDropdown","onSubmit",4,"ngIf"],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"onSubmit","hideSearchDropdown"],["class","btn btn-light shadow rounded ms-2",3,"click",4,"ngIf"],["data-cy","scanNotinChannel","type","button",1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[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"],[4,"ngIf","ngIfElse"],[4,"ngIf"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-md-12"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[2,"width","10px"],["colspan","2",1,"ms-5","text-center",2,"width","450px"],[2,"width","150px"],[2,"width","20%"],[2,"width","16%"],[4,"ngFor","ngForOf"],[1,"ms-1"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"padding-left","0px"],[1,"d-flex","flex-wrap","mb-1"],[1,"text-center",3,"rowSpan"],["type","checkbox",3,"ngModelChange","ngModel"],[2,"padding-right","0px"],[1,"text-start",3,"rowSpan"],[1,"ms-5","fw-normal","text-ellipsis",2,"max-width","26vw !important"],[3,"matTooltip"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],["alt","",1,"channel-logo","cursor-pointer","ms-4","mt-3",3,"src","matTooltip"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(e,i){e&1&&(x(0,xn,19,9,"mainpanel",2),E(1,"async")),e&2&&s("ngIf",V(1,1,i.loader$))},dependencies:[k,A,Zt,U,L,B,Mt,$,xt,vt],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}thead[_ngcontent-%COMP%]{position:sticky;top:0}.channel-logo[_ngcontent-%COMP%]{width:20px}.w-img[_ngcontent-%COMP%]{width:100%}"]});let o=r;return o})();var vn=o=>[o],Pn=()=>[];function bn(o,r){if(o&1){let n=v();a(0,"button",15),C("click",function(){m(n);let e=p();return u(e.openScanDialog())}),g(1,"i",16),d(2," Scan Channel "),l()}}function In(o,r){if(o&1){let n=v();P(0),a(1,"button",17),C("click",function(){m(n);let e=p();return u(e.onDownloadAllProduct("SELECTED"))}),g(2,"i",18),d(3),l(),b()}if(o&2){let n,t=p();c(3),I(" Download (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function wn(o,r){if(o&1&&(a(0,"span",19),g(1,"img",20),l(),d(2)),o&2){let n=r.item;c(),s("src",n.Img,D)("alt",n.Name),c(),I(" ",n.Name," ")}}function yn(o,r){if(o&1){let n=v();a(0,"div",21)(1,"app-product-card",22),C("onCheckBoxChange",function(e){let i=m(n).index,h=p();return u(h.onSelectProduct(e,i))})("onDescEvent",function(){let e=m(n).index,i=p();return u(i.onShowVariantDetail(e))})("onDownload",function(){let e=m(n).$implicit,i=p();return u(i.onDownloadProduct(e))})("onScan",function(){let e=m(n).$implicit,i=p();return u(i.onScanChannel(e))}),l()()}if(o&2){let n=r.$implicit;c(),s("showRedirectIcon",!1)("title",n==null?null:n.Name)("image",n==null?null:n.Image)("imageForZoom",n==null?null:n.Image)("code",n==null?null:n.SKU)("description",(n==null||n.Variant==null?null:n.Variant.length)>0?(n==null||n.Variant==null?null:n.Variant.length)+" Variants":null)("downloadButton",!0)("channels",n!=null&&n.Channel?pt(10,vn,n==null?null:n.Channel):X(12,Pn))("showCheckBox",!0)("scanButton",!0)}}function Mn(o,r){o&1&&(P(0),a(1,"div",23),g(2,"app-empty-state"),l(),b())}function Dn(o,r){if(o&1){let n=v();a(0,"div",24)(1,"div",25)(2,"app-custom-paginator",26),C("total",function(){m(n);let e=p();return u(e.getRowCount())})("next",function(){m(n);let e=p();return u(e.getProducts())})("previous",function(){m(n);let e=p();return u(e.getProducts())}),l()()()}if(o&2){let n=p();c(2),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}var Te=(()=>{let r=class r{constructor(t,e,i,h,_,w){this.http=t,this.dialog=e,this.productService=i,this.toastrService=h,this.activateRouter=_,this.authService=w,this.searchFilter=new Z,this.products=[],this.hasClickRowCount=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(f.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(e=>{this.searchFilter=e.Filter,this.searchFilter.PageSize=e.Filter.RowCount,this.getProducts()})}getProducts(){this.http.post("/api/product/GetProductChannelNotPOS",this.searchFilter).subscribe(t=>{this.products=t.Data,this.mapChannelToProduct(),this.setSkuProduct()})}mapChannelToProduct(){let t;this.products=this.products.map(e=>(t=this.channelOptions.find(i=>i.ID==e.ChannelID),t?e.Channel=JSON.parse(JSON.stringify(t)):e.Channel=null,e)).map(e=>(e.Channel&&(e.Channel.Url=e.Url),e))}setSkuProduct(){this.products=this.products.map(t=>(t?.Variant?.length==0?f.IsNotEmpty(t?.ChannelItemSKU)?t.SKU=t?.ChannelItemSKU:t.SKU="SKU not assigned":t.SKU=t?.Variant[0]?.ChannelVariationSKU?t?.Variant[0]?.ChannelVariationSKU:"SKU not assigned",t))}onSearch(t){this.searchFilter.text=t,this.hasClickRowCount=!1,this.getProducts()}onClearChannelFilter(){this.searchFilter.ChannelID=f.GuidEMpty}onScanAll(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(e=>{this.searchFilter.Async?this.toastrService.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.initPageLoader(f.GuidEMpty),this.productService.successToastrScanAllProduct(e,t,!this.searchFilter.UpdatedProduct)),this.searchFilter.ChannelID=f.GuidEMpty})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=f.GuidEMpty,this.dialog.open(N,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>f.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.Async=i.Async,this.onScanAll()})}onDownloadAllProduct(t){let e;t=="ALL"?e=this.products:e=this.productService.selectedProduct(this.products),e.length>0&&this.productService.downloadMultipleProduct(e).subscribe({next:()=>{this.getProducts()}})}onSelectProduct(t,e){this.products[e].selected=t}onDownloadProduct(t){confirm(`Are you sure you want to Retrieve product ${t?.Name} from ${t?.Channel.Name} to POS?`)&&this.productService.downloadProduct(t).subscribe({next:()=>{this.getProducts()}})}onScanChannel(t){let e=JSON.parse(JSON.stringify(t));delete e.Channel,this.productService.scanCompareToPos([e]).subscribe(i=>{i.Status?(this.initPageLoader(f.GuidEMpty),this.toastrService.success(`product ${t.Name} have been successfully scanned and synchronized with POS`,"Success")):this.toastrService.error(`Product ${t.Name} is not existed in POS`,"Error")})}onShowVariantDetail(t){let e=this.products[t].Variant;e.length>0&&this.dialog.open(Pe,{data:{title:this.products[t].Name,variants:e},width:"30%"})}getRowCount(){let t={ChannelID:this.searchFilter.ChannelID,text:this.searchFilter.text,HaveSku:parseInt(this.searchFilter.HaveSku)};this.http.post("/api/product/GetProductChannelNotPOSRowCount",t).subscribe(e=>{this.hasClickRowCount=!0,this.rowCount=e.Count})}};r.\u0275fac=function(e){return new(e||r)(S(K),S(J),S(j),S(W),S(bt),S(R))},r.\u0275cmp=M({type:r,selectors:[["app-not-in-pos"]],decls:30,vars:13,consts:[["headerTitle","Not in POS","textButton","Search","description","SKU sold in Marketplace but not exist in DEALPOS",3,"onSubmit"],["type","button","data-cy","scanNotInPos","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],[4,"ngIf"],[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",""],[1,"mt-5"],[1,"fw-bold"],["name","haveSKU",1,"form-control","h-100","pt-3","rounded","mt-2",3,"ngModelChange","ngModel"],[1,"me-5",3,"value"],["type","text","name","Item_id","id","Item_id","placeholder","item id",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button","data-cy","scanNotInPos",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","ms-3",3,"click"],[1,"fa","fa-download"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onCheckBoxChange","onDescEvent","onDownload","onScan","showRedirectIcon","title","image","imageForZoom","code","description","downloadButton","channels","showCheckBox","scanButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(e,i){e&1&&(a(0,"mainpanel",0),C("onSubmit",function(_){return i.onSearch(_)}),a(1,"actions"),x(2,bn,3,0,"button",1)(3,In,4,1,"ng-container",2),l(),a(4,"filters")(5,"div")(6,"label",3),d(7,"Channel"),l(),a(8,"ng-select",4),F("ngModelChange",function(_){return T(i.searchFilter.ChannelID,_)||(i.searchFilter.ChannelID=_),_}),x(9,wn,3,3,"ng-template",5),l()(),a(10,"div",6)(11,"label",7),d(12,"SKU Assigned"),l(),a(13,"mat-radio-group",8),F("ngModelChange",function(_){return T(i.searchFilter.HaveSku,_)||(i.searchFilter.HaveSku=_),_}),a(14,"mat-radio-button",9),d(15," All "),l(),a(16,"mat-radio-button",9),d(17," Yes "),l(),a(18,"mat-radio-button",9),d(19," No "),l()()(),a(20,"div",6)(21,"label",7),d(22,"Item ID"),l(),a(23,"input",10),F("ngModelChange",function(_){return T(i.searchFilter.Item_id,_)||(i.searchFilter.Item_id=_),_}),l()()(),a(24,"content")(25,"div",11)(26,"div",12),x(27,yn,2,13,"div",13)(28,Mn,3,0,"ng-container",2),l(),x(29,Dn,3,4,"div",14),l()()()),e&2&&(c(2),s("ngIf",!i.productService.hasSelection(i.products)),c(),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("items",i.channelOptions),O("ngModel",i.searchFilter.ChannelID),c(5),O("ngModel",i.searchFilter.HaveSku),c(),s("value",0),c(2),s("value",1),c(2),s("value",2),c(5),O("ngModel",i.searchFilter.Item_id),c(4),s("ngForOf",i.products),c(),s("ngIf",i.products.length==0),c(),s("ngIf",(i.products==null?null:i.products.length)>0))},dependencies:[k,A,ot,U,L,B,Y,rt,le,ce,z,q,$],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.itemTitle[_ngcontent-%COMP%]{cursor:pointer}"]});let o=r;return o})();function On(o,r){if(o&1&&(a(0,"span",9),g(1,"img",10),l(),d(2)),o&2){let n=r.item,t=p();c(),s("src",t.getChannelLogo(n.TypeID),D),c(),I(" ",n.Name," ")}}function Tn(o,r){if(o&1&&(a(0,"div",11),g(1,"app-duplicate-product-card",12),l()),o&2){let n=r.$implicit,t=r.index;c(),s("imageForZoom",n.ImageUrl)("title",n.Name)("code",n.Code)("id",t)("image",n.ThumbnailURL)("channels",n.Channels)}}function Fn(o,r){o&1&&(P(0),a(1,"div",13),g(2,"app-empty-state"),l(),b())}function En(o,r){if(o&1){let n=v();P(0),a(1,"div",14)(2,"div",15)(3,"app-custom-paginator",16),C("next",function(){m(n);let e=p();return u(e.getProducts())})("previous",function(){m(n);let e=p();return u(e.getProducts())})("total",function(){m(n);let e=p();return u(e.getRowCount())}),l()()(),b()}if(o&2){let n=p();c(3),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickedRowCount)}}var Fe=(()=>{let r=class r{constructor(t,e,i){this.httpService=t,this.productService=e,this.authService=i,this.searchFilter=new Z,this.products=[],this.hasClickedRowCount=!1,this.getPageLoader(),this.channelOptions=i.getChannels()}getPageLoader(){this.productService.loader().subscribe(t=>{this.searchFilter=t.Filter,this.searchFilter.PageSize=t.Filter.RowCount,this.getProducts()})}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,RowCount:this.searchFilter.RowCount,PageNumber:this.searchFilter.PageNumber,text:this.searchFilter.text};this.httpService.post("/api/product/GetDuplicateInChannel",t).subscribe(e=>{this.products=e.Data})}onSearch(t){this.searchFilter.text=t,this.hasClickedRowCount=!1,this.getProducts()}onClearFilter(){this.searchFilter.ChannelID=f.GuidEMpty}getChannelLogo(t){return f.getChannelLogoByTypeId(t)}getRowCount(){let t={text:this.searchFilter.text,ChannelID:this.searchFilter.ChannelID};this.httpService.post("/api/product/GetDuplicateInChannelRowCount",t).subscribe(e=>{this.hasClickedRowCount=!0,this.rowCount=e.Total})}};r.\u0275fac=function(e){return new(e||r)(S(K),S(j),S(R))},r.\u0275cmp=M({type:r,selectors:[["app-duplicate-sku"]],decls:14,vars:7,consts:[["headerTitle","Multiple Listing","textButton"," Search","description","SKU(s) which is listed more than one time (one to many)",3,"onSubmit"],["container",""],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clear","multiple","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid"],[1,"row","mt-8","mx-1"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"imageForZoom","title","code","id","image","channels"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"next","previous","total","filter","totaldata","paginationTotal","hasClicked"]],template:function(e,i){e&1&&(a(0,"mainpanel",0),C("onSubmit",function(_){return i.onSearch(_)}),a(1,"filters")(2,"div",1)(3,"div")(4,"h6",2),d(5,"Channel"),l(),a(6,"ng-select",3),F("ngModelChange",function(_){return T(i.searchFilter.ListChannelID,_)||(i.searchFilter.ListChannelID=_),_}),C("clear",function(){return i.onClearFilter()}),x(7,On,3,2,"ng-template",4),l()()()(),a(8,"content")(9,"div",5)(10,"div",6),x(11,Tn,2,6,"div",7)(12,Fn,3,0,"ng-container",8),l(),x(13,En,4,4,"ng-container",8),l()()()),e&2&&(c(6),s("multiple",!0)("clearable",!0)("items",i.channelOptions),O("ngModel",i.searchFilter.ListChannelID),c(5),s("ngForOf",i.products),c(),s("ngIf",(i.products==null?null:i.products.length)==0),c(),s("ngIf",(i.products==null?null:i.products.length)>0))},dependencies:[k,A,U,L,B,Y,rt,yt,Ft,z,$]});let o=r;return o})();var kn=()=>["/menu/products/status/sold-in-channel"],Ee=o=>({ID:o}),Nn=()=>["/menu/products/status/not-in-pos"];function Vn(o,r){if(o&1&&(P(0),d(1),b()),o&2){let n=p().$implicit;c(),I(" ",n.Count," ")}}function An(o,r){if(o&1){let n=v();a(0,"span",26),C("click",function(){m(n);let e=p().$implicit,i=p(2);return u(i.getLiveProductCount(e.ID,e))}),g(1,"i",27),l()}}function Un(o,r){if(o&1){let n=v();a(0,"tr")(1,"td"),g(2,"img",17),a(3,"span",18),d(4),l()(),a(5,"td",19),x(6,Vn,2,1,"ng-container",6)(7,An,2,0,"ng-template",null,1,nt),l(),a(9,"td",19)(10,"a",20),d(11),E(12,"number"),l()(),a(13,"td",19)(14,"a",20),d(15),E(16,"number"),l()(),a(17,"td"),d(18),E(19,"date"),l(),a(20,"td")(21,"div",21)(22,"button",22),C("click",function(){let e=m(n).$implicit,i=p(2);return u(i.onScanChannel(e))}),g(23,"i",23),d(24," Scan "),l(),a(25,"button",24),C("click",function(){let e=m(n).$implicit,i=p(2);return u(i.onClearCache(e.ID))}),g(26,"i",25),d(27," Clear "),l()()()()}if(o&2){let n=r.$implicit,t=G(8),e=p(2);c(2),s("src",e.getChannelLogo(n.TypeID),D),c(2),et(n.Name),c(2),s("ngIf",n.Count!==void 0)("ngIfElse",t),c(4),s("routerLink",X(18,kn))("queryParams",pt(19,Ee,n.ID)),c(),I(" ",V(12,11,n.SoldInChannel)," "),c(3),s("routerLink",X(21,Nn))("queryParams",pt(22,Ee,n.ID)),c(),I(" ",V(16,13,n.NotInPOS)," "),c(3),I("",n.LastSync?Jt(19,15,n.LastSync,"dd MMM yyyy HH:mm"):"Never"," ")}}function Ln(o,r){if(o&1&&(P(0),a(1,"div",7)(2,"table",8)(3,"thead",9)(4,"tr",10)(5,"th"),d(6,"Channel"),l(),a(7,"th",11),d(8,"Live Product"),l(),a(9,"th",12),d(10,"Sold In Channel"),l(),a(11,"th",13),d(12,"Product Not in POS"),l(),a(13,"th",14),d(14,"Last Sync"),l(),g(15,"th",15),l()(),a(16,"tbody"),x(17,Un,28,24,"tr",16),E(18,"async"),l()()(),b()),o&2){let n,t=p();c(17),s("ngForOf",(n=V(18,1,t.channels$))==null?null:n.Data)}}function Rn(o,r){o&1&&(a(0,"div",28),g(1,"app-empty-state"),l())}var ke=(()=>{let r=class r{constructor(t,e,i,h){this.productService=t,this.toastr=e,this.dialog=i,this.authService=h,this.destroy$=new Bt,this.channelOptions=h.getChannels()}ngOnInit(){this.setObsProductStatistic()}setObsProductStatistic(){this.channels$=this.productService.getProductStatistic()}getLiveProductCount(t,e){this.productService.getTotalProductLive(t).pipe(Vt(this.destroy$)).subscribe(i=>{e.Count=i.Count})}onScanChannel(t){this.dialog.open(N,{width:"700px",data:{channelOptions:this.channelOptions,filter:{ChannelID:t.ID},disabledChannelOption:!0}}).afterClosed().pipe(y(e=>f.IsNotEmpty(e))).subscribe(e=>{this.scanAllProduct(t.ID,e)})}scanAllProduct(t,e){let i=this.productService.findChannelById(t,this.channelOptions);this.productService.scanAll(e.ChannelID,e.ScanFull,e.UpdatedProduct,e.Async).pipe(y(h=>h)).subscribe(h=>{e.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(h,i,!e.UpdatedProduct),this.setObsProductStatistic())})}onClearCache(t){confirm("Are you sure you want to Clear Cache? This Process will remove your product integration to marketplace")&&this.productService.clearCacheChannel(t).pipe(Vt(this.destroy$)).subscribe(i=>{this.toastr.success("Successfully cleared cache","Success"),this.setObsProductStatistic()})}getChannelLogo(t){return f.getChannelLogoByTypeId(t)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};r.\u0275fac=function(e){return new(e||r)(S(j),S(W),S(J),S(R))},r.\u0275cmp=M({type:r,selectors:[["app-channel-statistic"]],decls:9,vars:6,consts:[["EMPTY",""],["QUESTION",""],["headerTitle","Products Statistic",3,"hideSearchBox","hideSearchDropdown"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[1,"text-center",2,"width","13rem"],[1,"text-center",2,"width","9rem"],[1,"text-center",2,"width","14rem"],[2,"width","10rem"],[2,"width","12rem"],[4,"ngFor","ngForOf"],[2,"width","24px","height","24px",3,"src"],[1,"ms-3"],[1,"text-center"],[3,"routerLink","queryParams"],[1,"d-flex","align-items-center","justify-content-center"],[1,"btn","btn-sm","btn-secondary","fs-6",3,"click"],[1,"fa","fa-spinner"],[1,"btn","btn-sm","btn-secondary","fs-6","ms-3",3,"click"],[1,"fa","fa-trash"],["matTooltip","Click to see total live product",1,"cursor-pointer","fs-5","text-primary",3,"click"],[1,"fa-solid","fa-circle-question","cursor"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(e,i){if(e&1&&(a(0,"mainpanel",2)(1,"content")(2,"div",3)(3,"div",4)(4,"div",5),x(5,Ln,19,3,"ng-container",6),E(6,"async"),x(7,Rn,2,0,"ng-template",null,0,nt),l()()()()()),e&2){let h,_=G(8);s("hideSearchBox",!0)("hideSearchDropdown",!0),c(5),s("ngIf",((h=V(6,4,i.channels$))==null||h.Data==null?null:h.Data.length)>0)("ngIfElse",_)}},dependencies:[k,A,B,Mt,It,$,xt,vt,zt]});let o=r;return o})();var Bn=[{component:Ie,path:"",children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:Me,canActivate:[tt],data:{title:"Products in POS"}},{path:"sold-in-channel",component:De,canActivate:[tt],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:Oe,canActivate:[tt],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:Te,canActivate:[tt],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:Fe,canActivate:[tt],data:{title:"Duplicate Sku in Channel"}},{path:"channel-statistic",component:ke,canActivate:[tt],data:{title:"Channel Statistic"}}]}],go=(()=>{let r=class r{};r.\u0275fac=function(e){return new(e||r)},r.\u0275mod=Wt({type:r}),r.\u0275inj=Gt({imports:[Pt,wt,oe,Dt,qt,be,se,ae,Ft,z,q,Yt.forChild(Bn),Se,Qt,ct]});let o=r;return o})();export{go as StatusModule};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as Ve}from"./chunk-HCJ6C5OR.js";import"./chunk-XUSY2QT2.js";import{a as L}from"./chunk-QYY5XVLP.js";import{a as H}from"./chunk-XHAXYWZ7.js";import{a as Pe,b as De,c as G}from"./chunk-MZNSPLFO.js";import"./chunk-BVIRHZTZ.js";import{b as Me}from"./chunk-ULELZXI5.js";import{a as Ee}from"./chunk-E5BOLHDG.js";import{a as Te,b as Fe}from"./chunk-A37OKNC2.js";import"./chunk-ZA7FXMFZ.js";import"./chunk-ZX3SBNZT.js";import"./chunk-2FRMUOJY.js";import{a as we}from"./chunk-7VKIP3Z6.js";import"./chunk-DYLT6RRK.js";import{a as be}from"./chunk-D76K4RZ7.js";import"./chunk-EIBGI6U2.js";import{e as ge}from"./chunk-PYD2YWAN.js";import{g as Ce}from"./chunk-5FOPZ5IX.js";import{b as de,e as ue}from"./chunk-JHYIHRQH.js";import"./chunk-KCDL7SWP.js";import{d as Se,l as ye,m as ve,n as Ie}from"./chunk-4CEFDQPI.js";import{t as fe,u as xe}from"./chunk-2SC3HO66.js";import"./chunk-DQIP7MCZ.js";import{b as re,c as se,h as pe,m as ce,o as me,y as _e}from"./chunk-2E5AKA74.js";import{c as v,f as he}from"./chunk-FTHTFVHH.js";import{Ab as q,B as Y,Bc as ie,Cc as oe,Ec as ae,Fc as le,Ha as P,Ib as Q,Ja as s,Jb as c,Ka as w,Kb as k,Lb as M,Nb as b,Ob as T,Pb as F,Q as A,Qb as X,Rb as J,Tb as R,Va as O,X as W,_a as u,ab as m,ac as h,bc as x,cc as N,da as K,dc as z,ga as Z,hb as I,ib as U,kb as $,lb as j,mb as a,nb as r,oa as _,ob as S,pa as d,pb as D,qb as V,sb as y,vb as f,vc as ee,xb as l,xc as te,yc as ne}from"./chunk-ZIZWZZ4E.js";import{a as B}from"./chunk-GNOSNGXM.js";var Ne=o=>({"text-decoration-line-through":o}),Le=o=>({"ms-10":o}),Be=o=>({"bg-gradient-warning":o});function Ae(o,p){if(o&1){let e=y();a(0,"button",38),f("click",function(){_(e);let t=l().ngIf,i=l(2);return d(i.updateStock(t))}),S(1,"i",39),c(2," Update "),r()}}function We(o,p){if(o&1){let e=y();a(0,"div"),u(1,Ae,3,0,"button",35),a(2,"button",36),f("click",function(){_(e);let t=l(2);return d(t.openExportDialog())}),S(3,"i",37),a(4,"span"),c(5,"Export"),r()()()}if(o&2){let e=p.ngIf,n=l(2);s(),m("ngIf",n.productService.hasSelectionVariant(e))}}function Oe(o,p){o&1&&(a(0,"div",40)(1,"span"),c(2," showing only different stock, please press next to populate more data "),r()())}function Ue(o,p){if(o&1){let e=y();a(0,"th")(1,"input",41),F("ngModelChange",function(t){_(e);let i=l(2);return T(i.checkboxState,t)||(i.checkboxState=t),d(t)}),f("ngModelChange",function(){let t=_(e).ngIf,i=l(2);return d(i.onCheckboxStateChange(t))}),r()()}if(o&2){let e=l(2);s(),b("ngModel",e.checkboxState)}}function $e(o,p){o&1&&(a(0,"th",32),c(1," Reserved "),r())}function je(o,p){}function Qe(o,p){if(o&1){let e=y();a(0,"input",60),F("ngModelChange",function(t){_(e);let i=l(3).$implicit;return T(i.selected,t)||(i.selected=t),d(t)}),f("ngModelChange",function(){_(e);let t=l(3).$implicit,i=l(2);return d(i.onCheckboxStateProduct(t))}),r()}if(o&2){let e=l(3).$implicit;b("ngModel",e.selected)}}function ze(o,p){if(o&1){let e=y();a(0,"img",61),f("click",function(t){_(e);let i=l(3).$implicit,C=l(2);return d(C.onZoomImage(t,i==null?null:i.ImageUrl))}),r()}if(o&2){let e=l(3).$implicit;q("src",e==null?null:e.ThumbnailUrl,P)}}function Ge(o,p){o&1&&S(0,"img",57)}function He(o,p){if(o&1&&(S(0,"br"),a(1,"div",62),S(2,"i",63),a(3,"small"),c(4),r()()),o&2){let e=l(3).$implicit;s(4),M("(",e==null?null:e.Category,")")}}function Ye(o,p){if(o&1&&(a(0,"td",53)(1,"div",14),u(2,Qe,1,1,"input",54),a(3,"div",55),u(4,ze,1,1,"img",56)(5,Ge,1,0,"img",57),r()()(),a(6,"td",58)(7,"span",59),c(8),r(),u(9,He,5,1),r()),o&2){let e=l(2).$implicit,n=l(2);m("rowSpan",e==null?null:e.Variants.length),s(2),I(e.Variants.length>1?2:-1),s(),m("ngClass",R(7,Le,e.Variants.length<=1)),s(),I(e!=null&&e.ThumbnailUrl?4:5),s(2),m("rowSpan",e==null?null:e.Variants.length),s(2),k(e==null?null:e.Name),s(),I(e.CategoryID!==null&&e.CategoryID!=n.guidEmpty?9:-1)}}function Ke(o,p){if(o&1){let e=y();a(0,"input",41),F("ngModelChange",function(t){_(e);let i=l(2).$implicit;return T(i.selected,t)||(i.selected=t),d(t)}),r()}if(o&2){let e=l(2).$implicit;b("ngModel",e.selected)}}function Ze(o,p){if(o&1&&u(0,Ke,1,1,"input",47),o&2){let e=l().$implicit;I((e==null?null:e.Inventory)<=1e5?0:-1)}}function qe(o,p){if(o&1){let e=y();a(0,"input",41),F("ngModelChange",function(t){_(e);let i=l().$implicit;return T(i.selected,t)||(i.selected=t),d(t)}),r()}if(o&2){let e=l().$implicit;b("ngModel",e.selected)}}function Xe(o,p){o&1&&(a(0,"div",64),c(1," Not Found "),r())}function Je(o,p){if(o&1&&(a(0,"div")(1,"span",65),c(2),h(3,"number"),r(),c(4," => "),a(5,"span",66),c(6),h(7,"number"),r()()),o&2){let e=l().$implicit;s(2),M(" ",x(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),k(x(7,4,e==null?null:e.Inventory))}}function et(o,p){if(o&1&&(c(0),h(1,"number")),o&2){let e=l().$implicit;M(" ",x(1,1,e==null?null:e.Inventory)," ")}}function tt(o,p){if(o&1&&(D(0),a(1,"div",67)(2,"a",68),S(3,"i",69),r()(),V()),o&2){let e=l().$implicit,n=l(3);s(2),m("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),P)}}function nt(o,p){if(o&1){let e=y();a(0,"span",74),f("click",function(){let t=_(e).ngIf,i=l(2).$implicit,C=l().$implicit,g=l(2);return d(g.openTableDialog(C,i,t))}),c(1),h(2,"number"),r()}if(o&2){let e=l(2).$implicit;s(),M(" ",x(2,1,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function it(o,p){if(o&1){let e=y();a(0,"td",70)(1,"div",48)(2,"div"),u(3,nt,3,3,"span",71),h(4,"async"),r(),a(5,"div",67)(6,"a",68),S(7,"i",69),r()(),a(8,"div",67)(9,"span",72),f("click",function(){_(e);let t=l().$implicit,i=l(3);return d(i.refreshInventory(t==null||t.Channel[0]==null?null:t.Channel[0].ChannelItemID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelVariationID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelID,t==null?null:t.ID))}),S(10,"i",73),r()()()()}if(o&2){let e=l().$implicit,n=l(3);m("ngClass",R(5,Be,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(3),m("ngIf",x(4,3,n.products$)),s(3),m("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,P)}}function ot(o,p){if(o&1&&(D(0),a(1,"span",75),c(2),h(3,"number"),r(),V()),o&2){let e=l(2).$implicit;s(2),M(" (",x(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function at(o,p){o&1&&c(0," - ")}function lt(o,p){if(o&1&&(D(0),a(1,"td",44),u(2,ot,4,3,"ng-container",52)(3,at,1,0,"ng-template",null,1,z),r(),V()),o&2){let e=Q(4),n=l().$implicit;s(2),m("ngIf",n==null||n.Channel[0]==null?null:n.Channel[0].InventoryReserved)("ngIfElse",e)}}function rt(o,p){o&1&&(D(0),c(1," - "),V())}function st(o,p){if(o&1&&(a(0,"span",76),h(1,"date"),c(2),h(3,"date"),r()),o&2){let e=l().$implicit;m("matTooltip",N(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),M(" ",N(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function pt(o,p){if(o&1&&(a(0,"tr"),u(1,Ye,10,9),a(2,"td",43),c(3),r(),a(4,"td",44)(5,"span",45),c(6),r()(),a(7,"td",46),u(8,Ze,1,1)(9,qe,1,1,"input",47),r(),a(10,"td")(11,"div",48),u(12,Xe,2,0,"div",49)(13,Je,8,6,"div")(14,et,2,3)(15,tt,4,1,"ng-container",5),r()(),u(16,it,11,7,"td",50)(17,lt,5,2,"ng-container",5),a(18,"td",51),u(19,rt,2,0,"ng-container",52)(20,st,4,8,"ng-template",null,0,z),r()()),o&2){let e=p.$implicit,n=p.index,t=Q(21),i=l(3);s(),I(n==0?1:-1),s(2),k(e==null?null:e.Model),s(2),m("matTooltip",e.Discontinued?i.discontinuedVariantMsg:"")("ngClass",R(14,Ne,e.Discontinued)),s(),k(e==null?null:e.Code),s(2),I((e==null?null:e.Channel[0].TypeID)==1?8:(e==null?null:e.Inventory)>=0?9:-1),s(4),m("ngIf",(e==null?null:e.I)==null),s(),I((e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)?13:-1),s(),I((e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)?14:-1),s(),m("ngIf",(e==null?null:e.I)!=null),s(),m("ngIf",e==null?null:e.Channel),s(),m("ngIf",i.isShowReservedColumn),s(2),m("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==i.minDate)("ngIfElse",t)}}function ct(o,p){if(o&1&&(a(0,"tbody"),$(1,je,0,0,null,null,U),u(3,pt,22,16,"tr",42),r()),o&2){let e=p.$implicit;s(),j(e.Variants),s(2),m("ngForOf",e.Variants)}}function mt(o,p){if(o&1){let e=y();a(0,"mainpanel",3),f("onSubmit",function(t){_(e);let i=l();return d(i.onSearch(t))}),a(1,"actions")(2,"div",4),u(3,We,6,1,"div",5),h(4,"async"),r()(),a(5,"filters")(6,"div")(7,"label",6),c(8,"Channel"),r(),a(9,"multiwarehouse-tree-select",7),f("onChannelChange",function(t){_(e);let i=l();return d(i.onChannelChange(t))}),r()(),a(10,"div",8)(11,"label",9),c(12,"PageNumber"),r(),a(13,"input",10),F("ngModelChange",function(t){_(e);let i=l();return T(i.searchFilter.PageNumber,t)||(i.searchFilter.PageNumber=t),d(t)}),r()(),a(14,"div",8)(15,"label",11),c(16,"Page Size"),r(),a(17,"input",12),F("ngModelChange",function(t){_(e);let i=l();return T(i.searchFilter.RowCount,t)||(i.searchFilter.RowCount=t),d(t)}),r()(),a(18,"div",8)(19,"label",13),c(20,"Quantity From - To"),r(),a(21,"div",14)(22,"input",15),F("ngModelChange",function(t){_(e);let i=l();return T(i.searchFilter.QuantityFrom,t)||(i.searchFilter.QuantityFrom=t),d(t)}),r(),c(23," - "),a(24,"input",16),F("ngModelChange",function(t){_(e);let i=l();return T(i.searchFilter.QuantityTo,t)||(i.searchFilter.QuantityTo=t),d(t)}),r()()()(),a(25,"content")(26,"div",17)(27,"div",18)(28,"div",19),u(29,Oe,3,0,"div",20),a(30,"table",21)(31,"thead",22)(32,"tr")(33,"th",23),c(34," Product "),S(35,"br"),a(36,"mat-slide-toggle",24),f("toggleChange",function(){_(e);let t=l();return t.showDifferenceStock=!t.showDifferenceStock,d(t.onShowDifferenceStock())}),a(37,"small",13),c(38,"FILTER DIFFERENT INVENTORY"),r()()(),a(39,"th",25),c(40,"Variant"),r(),a(41,"th",26),c(42,"SKU"),r(),u(43,Ue,2,1,"th",5),h(44,"async"),a(45,"th",27),c(46,"POS"),r(),a(47,"th",28)(48,"div",29),f("click",function(){_(e);let t=l();return d(t.openModalFilter())}),S(49,"img",30),a(50,"span",31),c(51),h(52,"stringLimit"),r()()(),u(53,$e,2,0,"th",32),a(54,"th",33),c(55,"Last Sync"),r()()(),$(56,ct,4,1,"tbody",null,U),h(58,"async"),r(),a(59,"infinite-paginator",34),h(60,"async"),f("onNextPage",function(){_(e);let t=l();return d(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){_(e);let t=l();return d(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){_(e);let t=l();return d(t.infinitePagination.getRowCount(t.searchFilter))}),r()()()()()()}if(o&2){let e,n,t,i=l();m("headerTitle","Inventory Comparison")("pageData",i.pageData)("hideSearchBox",!1),s(3),m("ngIf",x(4,21,i.products$)),s(6),m("ngModel",(i.searchFilter==null?null:i.searchFilter.LocationID)||(i.searchFilter==null?null:i.searchFilter.ChannelID)),s(4),b("ngModel",i.searchFilter.PageNumber),s(4),b("ngModel",i.searchFilter.RowCount),s(5),b("ngModel",i.searchFilter.QuantityFrom),s(2),b("ngModel",i.searchFilter.QuantityTo),s(5),m("ngIf",(i.searchFilter==null?null:i.searchFilter.filterModel)==3),s(14),m("ngIf",x(44,23,i.products$)),s(5),m("matTooltip",((e=i.channelIdentity())==null||e.label==null?null:e.label.length)>13?(e=i.channelIdentity())==null?null:e.label:""),s(),m("src",(n=i.channelIdentity())==null?null:n.img,P),s(2),M(" ",N(52,25,(t=i.channelIdentity())==null?null:t.label,13)," "),s(2),I(i.isShowReservedColumn?53:-1),s(3),j(x(58,28,i.products$)),s(3),m("totalData",i.infinitePagination.totalData())("hideCount",i.infinitePagination.hideCount())("rowCount",x(60,30,i.infinitePagination.totalRowCount$))("pageNumber",i.infinitePagination.pageNumber())("disableNextButton",i.infinitePagination.disableNextButton())("goToLastPage",i.infinitePagination.isLastPage())}}var Kt=(()=>{let p=class p{constructor(n,t,i,C,g,E,ke,Re){this.http=n,this.toastr=t,this.dialog=i,this.productService=C,this.authService=g,this.biggerPictureService=E,this.inventoryService=ke,this.mainPanelService=Re,this.infinitePagination=K(G),this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="InventoryLoader/Load",this.fetchApi="Inventory/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.minDate=v.MinDate,this.isShowReservedColumn=!0,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.guidEmpty=v.GuidEMpty,this.selectedChannel=O(null),this.channelIdentity=O({img:null,label:null}),this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]}}ngOnInit(){this.hostName=this.authService.getDomain(),this.initPageLoader(),this.products$=this.infinitePagination.data$.pipe(W(n=>{this.checkShowReservedColumn(n)}),A())}checkShowReservedColumn(n){let t=0,i;n.forEach(C=>{i=C.Variants.find(g=>v.IsNotEmpty(g?.Channel[0]?.InventoryReserved)),i&&(t+=1)}),this.isShowReservedColumn=t>0}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.fetchApi,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/api/${this.loaderApi}`,{}).pipe(A(1),W(n=>{this.searchFilter={RowCount:n.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:n.Filter.ChannelID,LocationID:n.Filter.LocationID},this.initReloadData(),this.showToastrMarketplaceInactive(!n.Filter.IsMarketplaceAppActive)}))}onChannelChange(n){let t=Object.assign({},n);this.selectedChannel.set(t),v.IsEmpty(this.channelIdentity()?.label)&&this.setChannelFilter()}setChannelFilter(){if(this.selectedChannel()){let n=Object.assign({},this.selectedChannel());v.IsNotEmpty(n.parent)?(this.searchFilter.LocationID=n.id,this.searchFilter.ChannelID=n?.parent?.id,n.label=n?.parent?.label+" - "+n?.label,n.img=v.getChannelLogoByTypeId(n?.parent?.typeid)):(this.searchFilter.LocationID=null,n.img=v.getChannelLogoByTypeId(n?.typeid),this.searchFilter.ChannelID=n?.id,this.selectedChannel.set(n)),this.channelIdentity.update(()=>({img:n.img,label:n.label}))}}initReloadData(){this.infinitePagination.reloadPagination(this.searchFilter)}showToastrMarketplaceInactive(n){n&&this.toastr.warning(`Automatic inventory sync disabled.
|
|
1
|
+
import{a as Ve}from"./chunk-HCJ6C5OR.js";import"./chunk-XUSY2QT2.js";import{a as L}from"./chunk-QYY5XVLP.js";import{a as H}from"./chunk-XHAXYWZ7.js";import{a as Pe,b as De,c as G}from"./chunk-MZNSPLFO.js";import"./chunk-BVIRHZTZ.js";import{b as Me}from"./chunk-ULELZXI5.js";import{a as Ee}from"./chunk-E5BOLHDG.js";import{a as Te,b as Fe}from"./chunk-A37OKNC2.js";import"./chunk-ZA7FXMFZ.js";import"./chunk-ZX3SBNZT.js";import"./chunk-2FRMUOJY.js";import{a as we}from"./chunk-7VKIP3Z6.js";import"./chunk-DYLT6RRK.js";import{a as be}from"./chunk-D76K4RZ7.js";import"./chunk-EIBGI6U2.js";import{e as ge}from"./chunk-PYD2YWAN.js";import{i as Ce}from"./chunk-DMVTFOY7.js";import{b as de,e as ue}from"./chunk-JHYIHRQH.js";import"./chunk-KCDL7SWP.js";import{d as Se,l as ye,m as ve,n as Ie}from"./chunk-4CEFDQPI.js";import{t as fe,u as xe}from"./chunk-2SC3HO66.js";import"./chunk-DQIP7MCZ.js";import{b as re,c as se,h as pe,m as ce,o as me,y as _e}from"./chunk-2E5AKA74.js";import{c as v,f as he}from"./chunk-FTHTFVHH.js";import{Ab as q,B as Y,Bc as ie,Cc as oe,Ec as ae,Fc as le,Ha as P,Ib as Q,Ja as s,Jb as c,Ka as w,Kb as k,Lb as M,Nb as b,Ob as T,Pb as F,Q as A,Qb as X,Rb as J,Tb as R,Va as O,X as W,_a as u,ab as m,ac as h,bc as x,cc as N,da as K,dc as z,ga as Z,hb as I,ib as U,kb as $,lb as j,mb as a,nb as r,oa as _,ob as S,pa as d,pb as D,qb as V,sb as y,vb as f,vc as ee,xb as l,xc as te,yc as ne}from"./chunk-ZIZWZZ4E.js";import{a as B}from"./chunk-GNOSNGXM.js";var Ne=o=>({"text-decoration-line-through":o}),Le=o=>({"ms-10":o}),Be=o=>({"bg-gradient-warning":o});function Ae(o,p){if(o&1){let e=y();a(0,"button",38),f("click",function(){_(e);let t=l().ngIf,i=l(2);return d(i.updateStock(t))}),S(1,"i",39),c(2," Update "),r()}}function We(o,p){if(o&1){let e=y();a(0,"div"),u(1,Ae,3,0,"button",35),a(2,"button",36),f("click",function(){_(e);let t=l(2);return d(t.openExportDialog())}),S(3,"i",37),a(4,"span"),c(5,"Export"),r()()()}if(o&2){let e=p.ngIf,n=l(2);s(),m("ngIf",n.productService.hasSelectionVariant(e))}}function Oe(o,p){o&1&&(a(0,"div",40)(1,"span"),c(2," showing only different stock, please press next to populate more data "),r()())}function Ue(o,p){if(o&1){let e=y();a(0,"th")(1,"input",41),F("ngModelChange",function(t){_(e);let i=l(2);return T(i.checkboxState,t)||(i.checkboxState=t),d(t)}),f("ngModelChange",function(){let t=_(e).ngIf,i=l(2);return d(i.onCheckboxStateChange(t))}),r()()}if(o&2){let e=l(2);s(),b("ngModel",e.checkboxState)}}function $e(o,p){o&1&&(a(0,"th",32),c(1," Reserved "),r())}function je(o,p){}function Qe(o,p){if(o&1){let e=y();a(0,"input",60),F("ngModelChange",function(t){_(e);let i=l(3).$implicit;return T(i.selected,t)||(i.selected=t),d(t)}),f("ngModelChange",function(){_(e);let t=l(3).$implicit,i=l(2);return d(i.onCheckboxStateProduct(t))}),r()}if(o&2){let e=l(3).$implicit;b("ngModel",e.selected)}}function ze(o,p){if(o&1){let e=y();a(0,"img",61),f("click",function(t){_(e);let i=l(3).$implicit,C=l(2);return d(C.onZoomImage(t,i==null?null:i.ImageUrl))}),r()}if(o&2){let e=l(3).$implicit;q("src",e==null?null:e.ThumbnailUrl,P)}}function Ge(o,p){o&1&&S(0,"img",57)}function He(o,p){if(o&1&&(S(0,"br"),a(1,"div",62),S(2,"i",63),a(3,"small"),c(4),r()()),o&2){let e=l(3).$implicit;s(4),M("(",e==null?null:e.Category,")")}}function Ye(o,p){if(o&1&&(a(0,"td",53)(1,"div",14),u(2,Qe,1,1,"input",54),a(3,"div",55),u(4,ze,1,1,"img",56)(5,Ge,1,0,"img",57),r()()(),a(6,"td",58)(7,"span",59),c(8),r(),u(9,He,5,1),r()),o&2){let e=l(2).$implicit,n=l(2);m("rowSpan",e==null?null:e.Variants.length),s(2),I(e.Variants.length>1?2:-1),s(),m("ngClass",R(7,Le,e.Variants.length<=1)),s(),I(e!=null&&e.ThumbnailUrl?4:5),s(2),m("rowSpan",e==null?null:e.Variants.length),s(2),k(e==null?null:e.Name),s(),I(e.CategoryID!==null&&e.CategoryID!=n.guidEmpty?9:-1)}}function Ke(o,p){if(o&1){let e=y();a(0,"input",41),F("ngModelChange",function(t){_(e);let i=l(2).$implicit;return T(i.selected,t)||(i.selected=t),d(t)}),r()}if(o&2){let e=l(2).$implicit;b("ngModel",e.selected)}}function Ze(o,p){if(o&1&&u(0,Ke,1,1,"input",47),o&2){let e=l().$implicit;I((e==null?null:e.Inventory)<=1e5?0:-1)}}function qe(o,p){if(o&1){let e=y();a(0,"input",41),F("ngModelChange",function(t){_(e);let i=l().$implicit;return T(i.selected,t)||(i.selected=t),d(t)}),r()}if(o&2){let e=l().$implicit;b("ngModel",e.selected)}}function Xe(o,p){o&1&&(a(0,"div",64),c(1," Not Found "),r())}function Je(o,p){if(o&1&&(a(0,"div")(1,"span",65),c(2),h(3,"number"),r(),c(4," => "),a(5,"span",66),c(6),h(7,"number"),r()()),o&2){let e=l().$implicit;s(2),M(" ",x(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),k(x(7,4,e==null?null:e.Inventory))}}function et(o,p){if(o&1&&(c(0),h(1,"number")),o&2){let e=l().$implicit;M(" ",x(1,1,e==null?null:e.Inventory)," ")}}function tt(o,p){if(o&1&&(D(0),a(1,"div",67)(2,"a",68),S(3,"i",69),r()(),V()),o&2){let e=l().$implicit,n=l(3);s(2),m("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),P)}}function nt(o,p){if(o&1){let e=y();a(0,"span",74),f("click",function(){let t=_(e).ngIf,i=l(2).$implicit,C=l().$implicit,g=l(2);return d(g.openTableDialog(C,i,t))}),c(1),h(2,"number"),r()}if(o&2){let e=l(2).$implicit;s(),M(" ",x(2,1,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function it(o,p){if(o&1){let e=y();a(0,"td",70)(1,"div",48)(2,"div"),u(3,nt,3,3,"span",71),h(4,"async"),r(),a(5,"div",67)(6,"a",68),S(7,"i",69),r()(),a(8,"div",67)(9,"span",72),f("click",function(){_(e);let t=l().$implicit,i=l(3);return d(i.refreshInventory(t==null||t.Channel[0]==null?null:t.Channel[0].ChannelItemID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelVariationID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelID,t==null?null:t.ID))}),S(10,"i",73),r()()()()}if(o&2){let e=l().$implicit,n=l(3);m("ngClass",R(5,Be,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(3),m("ngIf",x(4,3,n.products$)),s(3),m("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,P)}}function ot(o,p){if(o&1&&(D(0),a(1,"span",75),c(2),h(3,"number"),r(),V()),o&2){let e=l(2).$implicit;s(2),M(" (",x(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function at(o,p){o&1&&c(0," - ")}function lt(o,p){if(o&1&&(D(0),a(1,"td",44),u(2,ot,4,3,"ng-container",52)(3,at,1,0,"ng-template",null,1,z),r(),V()),o&2){let e=Q(4),n=l().$implicit;s(2),m("ngIf",n==null||n.Channel[0]==null?null:n.Channel[0].InventoryReserved)("ngIfElse",e)}}function rt(o,p){o&1&&(D(0),c(1," - "),V())}function st(o,p){if(o&1&&(a(0,"span",76),h(1,"date"),c(2),h(3,"date"),r()),o&2){let e=l().$implicit;m("matTooltip",N(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),M(" ",N(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function pt(o,p){if(o&1&&(a(0,"tr"),u(1,Ye,10,9),a(2,"td",43),c(3),r(),a(4,"td",44)(5,"span",45),c(6),r()(),a(7,"td",46),u(8,Ze,1,1)(9,qe,1,1,"input",47),r(),a(10,"td")(11,"div",48),u(12,Xe,2,0,"div",49)(13,Je,8,6,"div")(14,et,2,3)(15,tt,4,1,"ng-container",5),r()(),u(16,it,11,7,"td",50)(17,lt,5,2,"ng-container",5),a(18,"td",51),u(19,rt,2,0,"ng-container",52)(20,st,4,8,"ng-template",null,0,z),r()()),o&2){let e=p.$implicit,n=p.index,t=Q(21),i=l(3);s(),I(n==0?1:-1),s(2),k(e==null?null:e.Model),s(2),m("matTooltip",e.Discontinued?i.discontinuedVariantMsg:"")("ngClass",R(14,Ne,e.Discontinued)),s(),k(e==null?null:e.Code),s(2),I((e==null?null:e.Channel[0].TypeID)==1?8:(e==null?null:e.Inventory)>=0?9:-1),s(4),m("ngIf",(e==null?null:e.I)==null),s(),I((e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)?13:-1),s(),I((e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)?14:-1),s(),m("ngIf",(e==null?null:e.I)!=null),s(),m("ngIf",e==null?null:e.Channel),s(),m("ngIf",i.isShowReservedColumn),s(2),m("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==i.minDate)("ngIfElse",t)}}function ct(o,p){if(o&1&&(a(0,"tbody"),$(1,je,0,0,null,null,U),u(3,pt,22,16,"tr",42),r()),o&2){let e=p.$implicit;s(),j(e.Variants),s(2),m("ngForOf",e.Variants)}}function mt(o,p){if(o&1){let e=y();a(0,"mainpanel",3),f("onSubmit",function(t){_(e);let i=l();return d(i.onSearch(t))}),a(1,"actions")(2,"div",4),u(3,We,6,1,"div",5),h(4,"async"),r()(),a(5,"filters")(6,"div")(7,"label",6),c(8,"Channel"),r(),a(9,"multiwarehouse-tree-select",7),f("onChannelChange",function(t){_(e);let i=l();return d(i.onChannelChange(t))}),r()(),a(10,"div",8)(11,"label",9),c(12,"PageNumber"),r(),a(13,"input",10),F("ngModelChange",function(t){_(e);let i=l();return T(i.searchFilter.PageNumber,t)||(i.searchFilter.PageNumber=t),d(t)}),r()(),a(14,"div",8)(15,"label",11),c(16,"Page Size"),r(),a(17,"input",12),F("ngModelChange",function(t){_(e);let i=l();return T(i.searchFilter.RowCount,t)||(i.searchFilter.RowCount=t),d(t)}),r()(),a(18,"div",8)(19,"label",13),c(20,"Quantity From - To"),r(),a(21,"div",14)(22,"input",15),F("ngModelChange",function(t){_(e);let i=l();return T(i.searchFilter.QuantityFrom,t)||(i.searchFilter.QuantityFrom=t),d(t)}),r(),c(23," - "),a(24,"input",16),F("ngModelChange",function(t){_(e);let i=l();return T(i.searchFilter.QuantityTo,t)||(i.searchFilter.QuantityTo=t),d(t)}),r()()()(),a(25,"content")(26,"div",17)(27,"div",18)(28,"div",19),u(29,Oe,3,0,"div",20),a(30,"table",21)(31,"thead",22)(32,"tr")(33,"th",23),c(34," Product "),S(35,"br"),a(36,"mat-slide-toggle",24),f("toggleChange",function(){_(e);let t=l();return t.showDifferenceStock=!t.showDifferenceStock,d(t.onShowDifferenceStock())}),a(37,"small",13),c(38,"FILTER DIFFERENT INVENTORY"),r()()(),a(39,"th",25),c(40,"Variant"),r(),a(41,"th",26),c(42,"SKU"),r(),u(43,Ue,2,1,"th",5),h(44,"async"),a(45,"th",27),c(46,"POS"),r(),a(47,"th",28)(48,"div",29),f("click",function(){_(e);let t=l();return d(t.openModalFilter())}),S(49,"img",30),a(50,"span",31),c(51),h(52,"stringLimit"),r()()(),u(53,$e,2,0,"th",32),a(54,"th",33),c(55,"Last Sync"),r()()(),$(56,ct,4,1,"tbody",null,U),h(58,"async"),r(),a(59,"infinite-paginator",34),h(60,"async"),f("onNextPage",function(){_(e);let t=l();return d(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){_(e);let t=l();return d(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){_(e);let t=l();return d(t.infinitePagination.getRowCount(t.searchFilter))}),r()()()()()()}if(o&2){let e,n,t,i=l();m("headerTitle","Inventory Comparison")("pageData",i.pageData)("hideSearchBox",!1),s(3),m("ngIf",x(4,21,i.products$)),s(6),m("ngModel",(i.searchFilter==null?null:i.searchFilter.LocationID)||(i.searchFilter==null?null:i.searchFilter.ChannelID)),s(4),b("ngModel",i.searchFilter.PageNumber),s(4),b("ngModel",i.searchFilter.RowCount),s(5),b("ngModel",i.searchFilter.QuantityFrom),s(2),b("ngModel",i.searchFilter.QuantityTo),s(5),m("ngIf",(i.searchFilter==null?null:i.searchFilter.filterModel)==3),s(14),m("ngIf",x(44,23,i.products$)),s(5),m("matTooltip",((e=i.channelIdentity())==null||e.label==null?null:e.label.length)>13?(e=i.channelIdentity())==null?null:e.label:""),s(),m("src",(n=i.channelIdentity())==null?null:n.img,P),s(2),M(" ",N(52,25,(t=i.channelIdentity())==null?null:t.label,13)," "),s(2),I(i.isShowReservedColumn?53:-1),s(3),j(x(58,28,i.products$)),s(3),m("totalData",i.infinitePagination.totalData())("hideCount",i.infinitePagination.hideCount())("rowCount",x(60,30,i.infinitePagination.totalRowCount$))("pageNumber",i.infinitePagination.pageNumber())("disableNextButton",i.infinitePagination.disableNextButton())("goToLastPage",i.infinitePagination.isLastPage())}}var Kt=(()=>{let p=class p{constructor(n,t,i,C,g,E,ke,Re){this.http=n,this.toastr=t,this.dialog=i,this.productService=C,this.authService=g,this.biggerPictureService=E,this.inventoryService=ke,this.mainPanelService=Re,this.infinitePagination=K(G),this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="InventoryLoader/Load",this.fetchApi="Inventory/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.minDate=v.MinDate,this.isShowReservedColumn=!0,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.guidEmpty=v.GuidEMpty,this.selectedChannel=O(null),this.channelIdentity=O({img:null,label:null}),this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]}}ngOnInit(){this.hostName=this.authService.getDomain(),this.initPageLoader(),this.products$=this.infinitePagination.data$.pipe(W(n=>{this.checkShowReservedColumn(n)}),A())}checkShowReservedColumn(n){let t=0,i;n.forEach(C=>{i=C.Variants.find(g=>v.IsNotEmpty(g?.Channel[0]?.InventoryReserved)),i&&(t+=1)}),this.isShowReservedColumn=t>0}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.fetchApi,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/api/${this.loaderApi}`,{}).pipe(A(1),W(n=>{this.searchFilter={RowCount:n.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:n.Filter.ChannelID,LocationID:n.Filter.LocationID},this.initReloadData(),this.showToastrMarketplaceInactive(!n.Filter.IsMarketplaceAppActive)}))}onChannelChange(n){let t=Object.assign({},n);this.selectedChannel.set(t),v.IsEmpty(this.channelIdentity()?.label)&&this.setChannelFilter()}setChannelFilter(){if(this.selectedChannel()){let n=Object.assign({},this.selectedChannel());v.IsNotEmpty(n.parent)?(this.searchFilter.LocationID=n.id,this.searchFilter.ChannelID=n?.parent?.id,n.label=n?.parent?.label+" - "+n?.label,n.img=v.getChannelLogoByTypeId(n?.parent?.typeid)):(this.searchFilter.LocationID=null,n.img=v.getChannelLogoByTypeId(n?.typeid),this.searchFilter.ChannelID=n?.id,this.selectedChannel.set(n)),this.channelIdentity.update(()=>({img:n.img,label:n.label}))}}initReloadData(){this.infinitePagination.reloadPagination(this.searchFilter)}showToastrMarketplaceInactive(n){n&&this.toastr.warning(`Automatic inventory sync disabled.
|
|
2
2
|
Please enable Dealpos X Marketplace Apps integration in POS Configuration`,"Warning")}onSearch(n){this.searchFilter.text=n,this.setChannelFilter(),this.initReloadData()}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(n){let t=this.productService.selectedVariantProduct(n);if(t.length>0){let i=this.searchFilter.LocationID,C=t.map(E=>B({ID:E.ID,Code:E.Code,Inventory:E.Inventory},v.IsNotEmpty(i)&&{LocationID:i})),g={ListChannelID:[this.searchFilter.ChannelID],List:C};this.http.post("/api/Inventory/UpdateChannel",g).subscribe(E=>{this.initReloadData(),this.checkboxState=!1,this.handlingUpdateStock(E)})}}handlingUpdateStock(n){if(n[0]?.Response){let t=n[0]?.Response?.Fail_list,i=n[0]?.Response?.Success_list;this.inventoryService.showToastrUpdateInventory("Stock",i,t)}else this.toastr.error(n[0]?.Exception,"Error")}refreshInventory(n,t,i,C){let g={ChannelItemID:n,ChannelVariationID:t,ChannelID:i,VariantID:C};this.http.post("/api/Inventory/RefreshInventoryChannel",g).subscribe(E=>{this.toastr.success("Successfully updated","Success"),this.initReloadData()})}onCheckboxStateProduct(n){n.Variants=n.Variants.map(t=>(t.Inventory>=0&&(t.selected=n.selected),t))}onCheckboxStateChange(n){n=n.map(t=>(t.Variants=t.Variants.map(i=>(i.selected=this.checkboxState,i)),t))}openTableDialog(n,t,i){this.dialog.open(Pe,{data:{Name:n.Name,Variant:t,ChannelID:t?.Channel[0].ChannelID,Table:"inventory",ChannelItemID:n.ChannelItemID}}).afterClosed().pipe(Y(g=>v.IsNotEmpty(g))).subscribe(g=>{this.updateItemAfterDialog(g)})}updateItemAfterDialog(n){let t=this.searchFilter.LocationID,i=B({ID:n.ChannelID,ChannelItemID:n.ChannelItemID,ChannelVariantID:n.ChannelVariationID,NewQuantity:parseFloat(n.Inventory),VariantID:n.ID,SKU:n.Sku},v.IsNotEmpty(t)&&{LocationID:t});this.http.post("/api/Inventory/UpdateQuantityByItem",i).subscribe(C=>{this.searchFilter.PageNumber=1,this.initReloadData(),this.handlingUpdateStock([C])})}openExportDialog(){this.dialog.open(Me,{data:{title:"Export Inventory Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,QuantityFrom:this.searchFilter.QuantityFrom,QuantityTo:this.searchFilter.QuantityTo,exportApi:"Inventory/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}onShowDifferenceStock(){this.showDifferenceStock?this.searchFilter.filterModel=H.DIFFERENCE:this.searchFilter.filterModel=H.ALL,this.initReloadData()}onZoomImage(n,t){this.biggerPictureService.openBiggerPicture(n,t)}};p.\u0275fac=function(t){return new(t||p)(w(ue),w(de),w(Se),w(we),w(Ce),w(be),w(L),w(ye))},p.\u0275cmp=Z({type:p,selectors:[["app-single-channel-comparison"]],standalone:!0,features:[X([G,L]),J],decls:2,vars:3,consts:[["SYNCDATE",""],["EMPTY_RESERVED",""],["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit",4,"ngIf"],["textButton","Search",3,"onSubmit","headerTitle","pageData","hideSearchBox"],[1,"d-flex"],[4,"ngIf"],["for","channelOptions",1,"fw-bold","mb-2"],["id","channelOptions",3,"onChannelChange","ngModel"],[1,"mt-5"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"mat-mdc-tooltip-trigger","form-control","ng-pristine","ng-valid","ng-touched","mt-3",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"mat-mdc-tooltip-trigger","form-control","ng-pristine","ng-valid","ng-touched","mt-3",3,"ngModelChange","ngModel"],[1,"fw-bold"],[1,"d-flex","align-items-center","justify-content-start"],["type","number","name","QuantityFrom",1,"w-25","me-2","mt-3","form-control",3,"ngModelChange","ngModel"],["type","number","name","QuantityTo",1,"w-25","ms-2","form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["class","alert alert-warning d-flex justify-content-between text-dark","role","alert",4,"ngIf"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","ps-12",2,"width","25%"],[3,"toggleChange"],["scope","col",1,"text-start"],["scope","col",1,"text-end",2,"width","10%"],["scope","col",1,"text-end","w-10",2,"width","8%"],[1,"text-end",2,"width","150px"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],["matTooltip","Reserved Stock","matTooltipPosition","above",1,"text-end",2,"width","80px"],[1,"text-center",2,"width","145px"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],["role","alert",1,"alert","alert-warning","d-flex","justify-content-between","text-dark"],["type","checkbox",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"align-middle"],["type","checkbox",3,"ngModel"],[1,"d-flex","align-items-center","justify-content-end"],["class","text-danger","matTooltip","This product is no longer available in POS","matTooltipPosition","above",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],[1,"text-center"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"width","0%",3,"rowSpan"],["type","checkbox",1,"me-3",3,"ngModel"],[3,"ngClass"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],[1,"d-flex","align-items-center"],["title","Category",1,"fa-solid","fa-tags","me-2",2,"opacity","60%"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],["title","Stock Available"],["title","Inventory below minimum inventory"],[1,"ms-3"],["target","_blank",3,"href"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"text-end",3,"ngClass"],["class","cursor",3,"click",4,"ngIf"],["matTooltip","Refresh stock according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","fa-sync","fa-lg","external-link-custom","pt-1"],[1,"cursor",3,"click"],[1,"text-danger"],["matTooltipShowDelay","500",3,"matTooltip"]],template:function(t,i){t&1&&(u(0,mt,61,32,"mainpanel",2),h(1,"async")),t&2&&m("ngIf",x(1,1,i.loader$))},dependencies:[le,ee,te,ne,ie,ae,oe,Ie,ve,ge,_e,se,me,re,pe,ce,Ee,De,he,Fe,Te,xe,fe,Ve],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}"]});let o=p;return o})();export{Kt as SingleChannelComparisonComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{i as c}from"./chunk-DMVTFOY7.js";import{b as a}from"./chunk-JHYIHRQH.js";import{$ as s,ca as o}from"./chunk-ZIZWZZ4E.js";var d=(()=>{let e=class e{constructor(i,t){this.toastr=i,this.authService=t}canActivate(i,t){let n=JSON.parse(window.localStorage.getItem("user")),l=new Date;if(n!=null){let p=new Date(n.Token.expiredAt);return l<p?!0:(this.onTokenExpired(),!1)}else return this.onTokenExpired(),!1}onTokenExpired(){this.toastr.error("Your session has expired. Please login again.","Session Expired").onShown.subscribe(()=>this.authService.logout())}};e.\u0275fac=function(t){return new(t||e)(o(a),o(c))},e.\u0275prov=s({token:e,factory:e.\u0275fac,providedIn:"root"});let r=e;return r})();export{d as a};
|