marketplacepos 2.9.7 → 2.9.8

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.
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[478],{9478:(Ke,Z,r)=>{r.r(Z),r.d(Z,{PriceModule:()=>$e});var _=r(6814),y=r(6027),m=r(4387),C=r(9790),h=r(6223),q=r(4807),e=r(5879);let E=(()=>{var o;class l{constructor(){this.priceTabs=[{Title:"Single Channel Comparison",Url:"/menu/price/SingleChannel"},{Title:"Multi Channel Comparison",Url:"/menu/price/pos"},{Title:"Custom Channel Price",Url:"/menu/price/OutletPrice"}]}}return(o=l).\u0275fac=function(n){return new(n||o)},o.\u0275cmp=e.Xpm({type:o,selectors:[["app-price"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,i){1&n&&(e.TgZ(0,"nav",0)(1,"div",1)(2,"div"),e._UZ(3,"nav-tab",2),e.qZA()()(),e._UZ(4,"router-outlet")),2&n&&(e.xp6(3),e.Q6J("Tabs",i.priceTabs))},dependencies:[y.e,C.lC]}),l})();var w=r(2383),A=r(7797),F=r(9397),d=r(2181),g=r(5802),f=r(9659),x=r(9229),P=r(7700),N=r(8695),b=r(5993),D=r(6026);function V(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"button",18),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(3);return e.KtG(i.openScanDialog())}),e._UZ(1,"i",19),e._uU(2," Scan Channel "),e.qZA()}}function Y(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"button",20),e.NdJ("click",function(){e.CHM(t);const i=e.oxw().ngIf,a=e.oxw(2);return e.KtG(a.onUpdateItems(i))}),e._UZ(1,"i",21),e._uU(2," Update "),e.qZA()}}function $(o,l){if(1&o&&(e.TgZ(0,"div"),e.YNc(1,V,3,0,"button",16),e.YNc(2,Y,3,0,"button",17),e.qZA()),2&o){const t=l.ngIf,n=e.oxw(2);e.xp6(1),e.Q6J("ngIf",!n.productService.hasSelectionVariant(t)),e.xp6(1),e.Q6J("ngIf",n.productService.hasSelectionVariant(t))}}function K(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"div",22)(1,"app-table",23),e.NdJ("onToggle",function(i){e.CHM(t);const a=e.oxw(2);return e.KtG(a.onShowDifferencePrice(i))})("onSubmit",function(i){e.CHM(t);const a=e.oxw(2);return e.KtG(a.updatePriceByVariant(i))}),e.ALo(2,"async"),e.qZA()()}if(2&o){const t=e.oxw().ngIf,n=e.oxw();e.xp6(1),e.Q6J("showProductToggle",!0)("data",e.lcZ(2,4,n.paginationService.data$))("channel",t.Options.Channel)("filter",t.Filter)}}function G(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"span",24),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.getRowCount())}),e.TgZ(1,"i",25),e._uU(2,"?"),e.qZA()()}}function R(o,l){if(1&o&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"number"),e.qZA()),2&o){const t=l.ngIf;e.xp6(1),e.Oqu(e.lcZ(2,1,t))}}function H(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"a",26),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.onNextPage())}),e._UZ(1,"i",27),e._uU(2," Next"),e.qZA()}}function B(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"a",28),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.onLastPage())}),e._UZ(1,"i",29),e._uU(2," Last"),e.qZA()}}function j(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"mainpanel",1),e.NdJ("onSubmit",function(i){e.CHM(t);const a=e.oxw();return e.KtG(a.onSearch(i))}),e.TgZ(1,"actions")(2,"div",2),e.YNc(3,$,3,2,"div",3),e.ALo(4,"async"),e.qZA()(),e.TgZ(5,"filters")(6,"div",4)(7,"div")(8,"label"),e._uU(9,"Page Number"),e.qZA(),e.TgZ(10,"input",5),e.NdJ("ngModelChange",function(i){e.CHM(t);const a=e.oxw();return e.KtG(a.searchFilter.PageNumber=i)}),e.qZA()(),e.TgZ(11,"div")(12,"label"),e._uU(13,"Page Size"),e.qZA(),e.TgZ(14,"input",5),e.NdJ("ngModelChange",function(i){e.CHM(t);const a=e.oxw();return e.KtG(a.searchFilter.RowCount=i)}),e.qZA()()()(),e.TgZ(15,"content")(16,"div",6)(17,"div",7),e.YNc(18,K,3,6,"div",8),e.ALo(19,"async"),e.qZA(),e.TgZ(20,"div",9)(21,"div",10)(22,"div",11),e._uU(23),e.ALo(24,"number"),e.ALo(25,"async"),e.YNc(26,G,3,0,"span",12),e.YNc(27,R,3,3,"span",3),e.ALo(28,"async"),e._uU(29),e.qZA()(),e.TgZ(30,"div",13),e.YNc(31,H,3,0,"a",14),e.YNc(32,B,3,0,"a",15),e.qZA()()()()()}if(2&o){const t=e.oxw();let n;e.Q6J("pageData",t.pageData)("textButton","Search"),e.xp6(3),e.Q6J("ngIf",e.lcZ(4,12,t.paginationService.data$)),e.xp6(7),e.Q6J("ngModel",t.searchFilter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.searchFilter.RowCount),e.xp6(4),e.Q6J("ngIf",e.lcZ(19,14,t.paginationService.data$)),e.xp6(5),e.hij(" Showing 1 - ",e.lcZ(24,16,null==(n=e.lcZ(25,18,t.paginationService.data$))?null:n.length)," of "),e.xp6(3),e.Q6J("ngIf",t.paginationService.hideCount),e.xp6(1),e.Q6J("ngIf",!t.paginationService.hideCount&&e.lcZ(28,20,t.allDataCount$)),e.xp6(2),e.hij(" records ~ ",t.paginationService.footerPageNumber," Page "),e.xp6(2),e.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),e.xp6(1),e.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}let z=(()=>{var o;class l{constructor(n,i,a,c,s){this.http=n,this.toastr=i,this.dialog=a,this.paginationService=c,this.productService=s,this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.filterOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Price",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!0},{Title:"Price Realtime",Url:"/menu/price/realtime",Active:!1}]}}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.getDataAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe((0,F.b)(n=>{this.channelOptions=n.Options.Channel,n.Filter={PageNumber:n.Filter.PageNumber,RowCount:n.Filter.RowCount,filterModel:1},this.searchFilter=n.Filter,this.paginationService.reloadPagination(this.searchFilter)}))}onShowDifferencePrice(n){this.searchFilter.filterModel=1,n&&(this.searchFilter.filterModel=3),this.paginationService.reloadPagination(this.searchFilter)}onSearch(n){this.searchFilter.text=n,this.paginationService.reloadPagination(this.searchFilter)}openScanDialog(){this.searchFilter.ChannelID=g.g.GuidEMpty;let n=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(w.j,{data:{filter:n,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe((0,d.h)(a=>g.g.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ChannelID=a.ChannelID,this.searchFilter.ScanFull=a.ScanFull,this.searchFilter.UpdatedProduct=a.UpdatedProduct,this.searchFilter.Async=a.Async,this.scanAll()})}scanAll(){this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(n=>{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{let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.initPageLoader(),this.productService.successToastrScanAllProduct(n,i,!this.searchFilter.UpdatedProduct)}})}updatePrice(n){let i=this.productService.selectedVariantProduct(n);if(i.length>0){let c=i.map(p=>({ID:p.ID,Code:p.Code,Price:p.UnitPrice})),s={ListChannelID:this.channelOptions.filter(p=>p.selected).map(p=>p.ID),ListPrice:c};this.http.post("/api/Price/UpdateChannel",s).subscribe(p=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+s.ListPrice.length+" items in "+s.ListChannelID.length+" channels","Success")})}}updatePriceByVariant(n){let i={ID:n.ChannelID,ChannelItemID:n.ChannelItemID,ChannelVariantID:n.ChannelVariationID,Price:n.Price-0,VariantID:n.ID};this.http.post("/api/Price/UpdatePriceByID",i).subscribe(a=>{let c=this.productService.findChannelById(i.ID,this.channelOptions);this.toastr.success("Successfully updated "+n.ItemName+"("+n.VarName+") price in "+c.Name+" to "+i.Price,"Success"),this.paginationService.reloadPagination(this.searchFilter)})}onUpdateItems(n){const i=this.productService.selectedVariantProduct(n);this.dialog.open(A.j,{data:{selectedItems:i,channels:this.channelOptions},width:"600px"}).afterClosed().pipe((0,d.h)(a=>void 0!==a)).subscribe(a=>{this.channelOptions=a,this.updatePrice(n)})}getRowCount(){this.paginationService.hideCount=!1,this.allDataCount$=this.http.post(`/api/${this.rowCountAPI}`,{})}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:n=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,n)}})}ngOnDestroy(){this.paginationService.destroy()}}return(o=l).\u0275fac=function(n){return new(n||o)(e.Y36(f.O),e.Y36(x._W),e.Y36(P.uw),e.Y36(N.b),e.Y36(b.M))},o.\u0275cmp=e.Xpm({type:o,selectors:[["app-price-pos-channel"]],decls:2,vars:3,consts:[["headerTitle","Price Comparison",3,"pageData","textButton","onSubmit",4,"ngIf"],["headerTitle","Price Comparison",3,"pageData","textButton","onSubmit"],[1,"d-flex"],[4,"ngIf"],["container",""],["type","number",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],["class","col-md-12",4,"ngIf"],[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"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"showProductToggle","data","channel","filter","onToggle","onSubmit"],[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(n,i){1&n&&(e.YNc(0,j,33,22,"mainpanel",0),e.ALo(1,"async")),2&n&&e.Q6J("ngIf",e.lcZ(1,1,i.loader$))},dependencies:[_.O5,h.Fj,h.wV,h.JJ,h.On,m.p,D.a,_.Ov,_.JJ],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]}),l})();var u=r(4910),J=r(236),W=r(5623),M=r(7826),U=r(278),I=r(7466);function X(o,l){if(1&o&&(e.TgZ(0,"mat-radio-button",3),e._uU(1),e.qZA()),2&o){const t=l.$implicit,n=l.index,i=e.oxw();e.Q6J("value",t.Key)("name",i.name)("title",i.tooltipsText[n]?i.tooltipsText[n]:""),e.xp6(1),e.hij(" ",t.Value,"")}}const ee=function(o){return{"border-0 rounded":o}};let O=(()=>{var o;class l{constructor(){this.modelChange=new e.vpe,this.border=!1,this.tooltipsText=[]}change(n){this.modelChange.emit(n)}}return(o=l).\u0275fac=function(n){return new(n||o)},o.\u0275cmp=e.Xpm({type:o,selectors:[["radio-options"]],inputs:{model:"model",options:"options",border:"border",name:"name",tooltipsText:"tooltipsText"},outputs:{modelChange:"modelChange"},standalone:!0,features:[e.jDz],decls:3,vars:5,consts:[[1,"form-control","h-100",3,"ngClass"],[3,"ngModel","ngModelChange"],["class","me-5","data-toggle","tooltip","data-placement","right",3,"value","name","title",4,"ngFor","ngForOf"],["data-toggle","tooltip","data-placement","right",1,"me-5",3,"value","name","title"]],template:function(n,i){1&n&&(e.TgZ(0,"div",0)(1,"mat-radio-group",1),e.NdJ("ngModelChange",function(c){return i.change(c)}),e.YNc(2,X,2,4,"mat-radio-button",2),e.qZA()()),2&n&&(e.Q6J("ngClass",e.VKq(3,ee,0==i.border)),e.xp6(1),e.Q6J("ngModel",i.model),e.xp6(1),e.Q6J("ngForOf",i.options))},dependencies:[_.ez,_.mk,_.sg,I.Fk,I.VQ,I.U0,h.u5,h.JJ,h.On],styles:[".mat-radio-label{margin-top:auto;margin-bottom:auto}"]}),l})();var T=r(621);function ne(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"button",18),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.onUpdateItems())}),e._UZ(1,"i",19),e._uU(2," Update "),e.qZA()}}function te(o,l){if(1&o&&(e.TgZ(0,"th",20),e._uU(1),e.qZA()),2&o){const t=l.$implicit;e.xp6(1),e.Oqu(t.Name)}}function ie(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"th")(1,"input",21),e.NdJ("ngModelChange",function(i){e.CHM(t);const a=e.oxw();return e.KtG(a.checkboxState=i)})("ngModelChange",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.onSelectAllData())}),e.qZA()()}if(2&o){const t=e.oxw();e.xp6(1),e.Q6J("ngModel",t.checkboxState)}}function oe(o,l){1&o&&(e.ynx(0),e.TgZ(1,"th",22),e._uU(2," Expected (POS) "),e.qZA(),e.TgZ(3,"th",22),e._uU(4," Channel "),e.qZA(),e.BQk())}function ae(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"img",33),e.NdJ("click",function(i){e.CHM(t);const a=e.oxw(3).$implicit,c=e.oxw();return e.KtG(c.onZoomImage(i,null==a?null:a.ImageUrl))}),e.qZA()}if(2&o){const t=e.oxw(3).$implicit;e.s9C("src",null==t?null:t.ImageUrl,e.LSH)}}function le(o,l){1&o&&e._UZ(0,"img",34)}const ce=function(o){return{"border-bottom":o}};function re(o,l){if(1&o&&(e.ynx(0),e.TgZ(1,"td",28),e.YNc(2,ae,1,1,"img",29),e.YNc(3,le,1,0,"ng-template",null,30,e.W1O),e.qZA(),e.TgZ(5,"td",31)(6,"h5",32),e._uU(7),e.qZA(),e._UZ(8,"br"),e.TgZ(9,"small"),e._uU(10),e.qZA()(),e.BQk()),2&o){const t=e.MAs(4),n=e.oxw().index,i=e.oxw().$implicit,a=e.oxw();e.xp6(1),e.Q6J("rowSpan",null==i?null:i.Variants.length)("ngClass",e.VKq(7,ce,n+1==a.products.length)),e.xp6(1),e.Q6J("ngIf",null==i?null:i.ImageUrl)("ngIfElse",t),e.xp6(3),e.Q6J("rowSpan",null==i?null:i.Variants.length),e.xp6(2),e.Oqu(null==i?null:i.Name),e.xp6(3),e.hij("(",null==i?null:i.Category,")")}}function se(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"td",35)(1,"input",21),e.NdJ("ngModelChange",function(i){e.CHM(t);const a=e.oxw().$implicit;return e.KtG(a.selected=i)}),e.qZA()()}if(2&o){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngModel",t.selected)}}const pe=function(o){return{"bg-gradient-warning":o}};function _e(o,l){if(1&o){const t=e.EpF();e.ynx(0),e.TgZ(1,"td",38),e._uU(2),e.ALo(3,"number"),e.qZA(),e.TgZ(4,"td",39),e.NdJ("click",function(){const a=e.CHM(t).$implicit,c=e.oxw(2).$implicit,s=e.oxw().$implicit,p=e.oxw();return e.KtG(p.openTableDialog(c,s,a))}),e.TgZ(5,"span",40),e._uU(6),e.ALo(7,"number"),e.qZA(),e.TgZ(8,"a",41),e.NdJ("click",function(i){return null==i?null:i.stopPropagation()}),e._UZ(9,"i",27),e.qZA()(),e.BQk()}if(2&o){const t=l.$implicit;e.xp6(2),e.hij(" ",e.lcZ(3,4,t.PriceExpected)," "),e.xp6(2),e.Q6J("ngClass",e.VKq(8,pe,t.Price!=t.PriceExpected)),e.xp6(2),e.hij(" ",e.lcZ(7,6,t.Price)," "),e.xp6(2),e.Q6J("href",t.Url,e.LSH)}}function he(o,l){1&o&&(e.TgZ(0,"td",42),e._uU(1,"X"),e.qZA(),e.TgZ(2,"td",42),e._uU(3,"X"),e.qZA())}function ge(o,l){if(1&o&&(e.ynx(0),e.YNc(1,_e,10,10,"ng-container",36),e.YNc(2,he,4,0,"ng-template",null,37,e.W1O),e.BQk()),2&o){const t=l.$implicit,n=e.MAs(3),i=e.oxw().$implicit,a=e.oxw(2);e.xp6(1),e.Q6J("ngIf",a.getItemFromChannel(i,t.ID))("ngIfElse",n)}}const k=function(o){return[o]};function de(o,l){if(1&o&&(e.TgZ(0,"tr"),e.YNc(1,re,11,9,"ng-container",23),e.TgZ(2,"td",24),e._uU(3),e.qZA(),e.TgZ(4,"td",24)(5,"span"),e._uU(6),e.qZA(),e.TgZ(7,"span",25)(8,"a",26),e._UZ(9,"i",27),e.qZA()()(),e.YNc(10,se,2,1,"ng-template",16),e.YNc(11,ge,4,2,"ng-container",17),e.qZA()),2&o){const t=l.$implicit,n=l.index,i=e.oxw(2);e.xp6(1),e.Q6J("ngIf",0==n),e.xp6(2),e.Oqu(null==t?null:t.Model),e.xp6(3),e.Oqu(null==t?null:t.Code),e.xp6(2),e.Q6J("href","https://"+i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(null==t?null:t.ID),e.LSH),e.xp6(2),e.Q6J("ngxPermissionsOnly",e.VKq(6,k,i.rolePriceEdit)),e.xp6(1),e.Q6J("ngForOf",i.channelOptions)}}function ue(o,l){if(1&o&&(e.TgZ(0,"tbody"),e.YNc(1,de,12,8,"tr",17),e.qZA()),2&o){const t=l.$implicit;e.xp6(1),e.Q6J("ngForOf",t.Variants)}}let me=(()=>{var o;class l{constructor(n,i,a,c,s){this.http=n,this.toastr=i,this.dialog=a,this.productService=c,this.biggerPictureService=s,this.searchFilter=new W.k,this.products=[],this.checkboxState=!1,this.rolePriceEdit=M.G.price,this.initPageLoader(),this.filterTypeOptions=[{Key:u.v.ALL,Value:"All"},{Key:u.v.DIFFERENCE,Value:"Difference"}],this.filterType=u.v.ALL,this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.hostName=c.getHostName()}initPageLoader(){this.http.post("/api/PriceLoader/LoadMultiple",{}).subscribe(n=>{this.channelOptions=n.Options.Channel,this.searchFilter=n.Filter,this.onFilter()})}onSelectAllData(){this.products=this.products.map(n=>(n.Variants&&(n.Variants=n.Variants.map(i=>(i.selected=this.checkboxState,i))),n))}onFilter(n){this.http.post("/api/Price/GetOutletPrice",{text:n,filterModel:this.filterType,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount}).subscribe(a=>{this.products=a.Data})}updatePrice(){let n=this.productService.selectedVariantProduct(this.products);if(n.length>0){let i=n.map(s=>s.ID),c={ListChannelID:this.channelOptions.filter(s=>s.selected).map(s=>s.ID),ListID:i};this.http.post("/api/Price/UpdateChannelOutletPrice",c).subscribe({next:s=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+c.ListID.length+" items in "+c.ListChannelID.length+" channels","Success")},error:s=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(n=>(n.selected=!1,n))}getItemFromChannel(n,i){return n.Channel.find(a=>a.ChannelID==i)}onUpdateItems(){const n=this.productService.selectedVariantProduct(this.products);this.dialog.open(A.j,{data:{selectedItems:n,channels:this.channelOptions},width:"600px"}).afterClosed().pipe((0,d.h)(i=>g.g.IsNotEmpty(i))).subscribe(i=>{this.channelOptions=i,this.updatePrice()})}openTableDialog(n,i,a){let c=JSON.parse(JSON.stringify(n));this.dialog.open(J.k,{data:{Name:i.Name,Variant:c,ChannelID:a?.ChannelID,Table:"price",ChannelItemID:a?.ChannelItemID}}).afterClosed().pipe((0,d.h)(p=>g.g.IsNotEmpty(p))).subscribe(p=>{this.updateProductPrice(p,a)})}updateProductPrice(n,i){let a={ID:n.ChannelID,ChannelItemID:n.ChannelItemID,ChannelVariantID:n.ChannelVariationID,Price:parseFloat(n.Price),VariantID:n.ID,SKU:n.Sku};this.http.post("/api/Price/UpdatePriceByID",a).subscribe(c=>{i.Price=a.Price;const s=this.productService.findChannelById(a.ID,this.channelOptions);this.toastr.success(`Successfully updated ${n.ItemName} (${n.VarName}) inventory in ${s.Name} to ${a.Price}`,"Success")})}onZoomImage(n,i){this.biggerPictureService.openBiggerPicture(n,i)}}return(o=l).\u0275fac=function(n){return new(n||o)(e.Y36(f.O),e.Y36(x._W),e.Y36(P.uw),e.Y36(b.M),e.Y36(U.k))},o.\u0275cmp=e.Xpm({type:o,selectors:[["app-custom-channel-price"]],decls:30,vars:14,consts:[["headerTitle","Price Comparison",3,"pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit"],["container",""],["name","filterModel",3,"model","options","border","modelChange"],[1,"d-flex"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","5"],["scope","col","colspan","2","class","text-center border-bottom-0 border w-10 text-uppercase",4,"ngFor","ngForOf"],["scope","col","colspan","2",1,"text-center","w-20"],["scope","col",1,"text-start"],["scope","col",1,"text-start","w-10"],[3,"ngxPermissionsOnly"],[4,"ngFor","ngForOf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","w-10","text-uppercase"],["type","checkbox",3,"ngModel","ngModelChange"],[1,"text-end","border-top-0","border","w-10"],[4,"ngIf"],[1,"text-start","border-bottom"],[1,"ms-2"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-center","border-bottom",3,"rowSpan"],[1,"mb-0","item-name"],[1,"border","rounded","w-img","cursor-pointer",3,"src","click"],["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"],["elseCol",""],[1,"text-end","border"],[1,"text-center","border","pointer","cell-hover",3,"ngClass","click"],[1,"me-2"],["target","_blank",3,"href","click"],[1,"table-white","border","text-end",2,"color","red"]],template:function(n,i){1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(c){return i.onFilter(c)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Filter by"),e.qZA(),e.TgZ(6,"radio-options",2),e.NdJ("modelChange",function(c){return i.filterType=c}),e.qZA()()()(),e.TgZ(7,"actions")(8,"div",3),e.YNc(9,ne,3,0,"button",4),e.qZA()(),e.TgZ(10,"content")(11,"div",5)(12,"div",6)(13,"div",7)(14,"div",8)(15,"table",9)(16,"thead",10)(17,"tr"),e._UZ(18,"th",11),e.YNc(19,te,2,1,"th",12),e.qZA(),e.TgZ(20,"tr")(21,"th",13),e._uU(22,"Product"),e.qZA(),e.TgZ(23,"th",14),e._uU(24,"Variant"),e.qZA(),e.TgZ(25,"th",15),e._uU(26,"SKU"),e.qZA(),e.YNc(27,ie,2,1,"ng-template",16),e.YNc(28,oe,5,0,"ng-container",17),e.qZA()(),e.YNc(29,ue,2,1,"tbody",17),e.qZA()()()()()()()),2&n&&(e.Q6J("pageData",i.pageData)("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),e.xp6(6),e.Q6J("model",i.filterType)("options",i.filterTypeOptions)("border",!0),e.xp6(3),e.Q6J("ngIf",i.productService.hasSelectionVariant(i.products)),e.xp6(10),e.Q6J("ngForOf",i.channelOptions),e.xp6(8),e.Q6J("ngxPermissionsOnly",e.VKq(12,k,i.rolePriceEdit)),e.xp6(1),e.Q6J("ngForOf",i.channelOptions),e.xp6(1),e.Q6J("ngForOf",i.products))},dependencies:[_.mk,_.sg,_.O5,h.Wl,h.JJ,h.On,m.p,O,T.gE,_.JJ],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}"]}),l})();var Ce=r(2729),L=r(2599),Q=r(2596);function fe(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"button",8),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2).ngIf,a=e.oxw();return e.KtG(a.openScanDialog(i))}),e._UZ(1,"i",9),e._uU(2," Scan Channel "),e.qZA()}}function xe(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"button",10),e.NdJ("click",function(){e.CHM(t);const i=e.oxw().ngIf,a=e.oxw(2);return e.KtG(a.updateStock(i))}),e._UZ(1,"i",11),e._uU(2," Update "),e.qZA()}}function Pe(o,l){if(1&o&&(e.TgZ(0,"actions")(1,"div",5)(2,"div"),e.YNc(3,fe,3,0,"button",6),e.YNc(4,xe,3,0,"button",7),e.qZA()()()),2&o){const t=l.ngIf,n=e.oxw(2);e.xp6(3),e.Q6J("ngIf",!n.productService.hasSelectionVariant(t)),e.xp6(1),e.Q6J("ngIf",n.productService.hasSelectionVariant(t))}}function be(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"th")(1,"input",32),e.NdJ("change",function(i){e.CHM(t);const a=e.oxw().ngIf,c=e.oxw(2);return e.KtG(c.onSelectAllSKU(i.target.checked,a))}),e.qZA()()}}function Ie(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"input",50),e.NdJ("ngModelChange",function(i){e.CHM(t);const a=e.oxw(4).$implicit;return e.KtG(a.selected=i)})("ngModelChange",function(){e.CHM(t);const i=e.oxw(4).$implicit,a=e.oxw(3);return e.KtG(a.onCheckboxStateProduct(i))}),e.qZA()}if(2&o){const t=e.oxw(4).$implicit;e.Q6J("ngModel",t.selected)}}function Te(o,l){if(1&o&&e.YNc(0,Ie,1,1,"input",49),2&o){const t=e.oxw(2).$implicit,n=e.oxw().$implicit;e.Q6J("ngIf",t.Inventory>=0||n.Variants.length>1)}}function Se(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"img",51),e.NdJ("click",function(i){e.CHM(t);const a=e.oxw(3).$implicit,c=e.oxw(3);return e.KtG(c.onZoomImage(i,null==a?null:a.ImageUrl))}),e.qZA()}if(2&o){const t=e.oxw(3).$implicit;e.s9C("src",t.ThumbnailUrl,e.LSH)}}function ve(o,l){1&o&&e._UZ(0,"img",52)}const S=function(o){return[o]};function Ze(o,l){if(1&o&&(e.ynx(0),e.TgZ(1,"td",43)(2,"div",44),e.YNc(3,Te,1,1,"ng-template",21),e.YNc(4,Se,1,1,"img",45),e.YNc(5,ve,1,0,"ng-template",null,46,e.W1O),e.qZA()(),e.TgZ(7,"td",47)(8,"span",48),e._uU(9),e.qZA(),e._UZ(10,"br"),e.TgZ(11,"small"),e._uU(12),e.qZA()(),e.BQk()),2&o){const t=e.MAs(6),n=e.oxw(2).$implicit,i=e.oxw(3);e.xp6(1),e.Q6J("rowSpan",n.Variants.length),e.xp6(2),e.Q6J("ngxPermissionsOnly",e.VKq(7,S,i.rolePriceEdit)),e.xp6(1),e.Q6J("ngIf",n.ThumbnailUrl)("ngIfElse",t),e.xp6(3),e.Q6J("rowSpan",n.Variants.length),e.xp6(2),e.Oqu(n.Name),e.xp6(3),e.hij("(",n.Category,")")}}function ye(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"input",55),e.NdJ("ngModelChange",function(i){e.CHM(t);const a=e.oxw(2).$implicit;return e.KtG(a.selected=i)}),e.qZA()}if(2&o){const t=e.oxw(2).$implicit;e.Q6J("ngModel",t.selected)}}function we(o,l){if(1&o&&(e.TgZ(0,"td",53),e.YNc(1,ye,1,1,"input",54),e.qZA()),2&o){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngIf",t.Inventory>=0)}}function Ae(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"div",56),e.NdJ("click",function(){e.CHM(t);const i=e.oxw().$implicit,a=e.oxw().$implicit,c=e.oxw(2).ngIf,s=e.oxw();return e.KtG(s.openTableDialog(i,a,c))}),e._uU(1),e.ALo(2,"number"),e.qZA()}if(2&o){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.lcZ(2,1,null==t.Channel[0]?null:t.Channel[0].Price)," ")}}const Fe=function(o){return{"bg-gradient-warning":o}};function Ne(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"tr"),e.YNc(1,Ze,13,9,"ng-container",4),e.TgZ(2,"td",19),e._uU(3),e.qZA(),e.TgZ(4,"td",22)(5,"span"),e._uU(6),e.qZA(),e.TgZ(7,"span",33)(8,"a",34),e._UZ(9,"i",35),e.qZA()()(),e.YNc(10,we,2,1,"ng-template",21),e.TgZ(11,"td",22),e._uU(12),e.ALo(13,"number"),e.qZA(),e.TgZ(14,"td",36),e.YNc(15,Ae,3,3,"div",37),e.qZA(),e.TgZ(16,"td")(17,"div",38)(18,"div",39)(19,"a",34),e._UZ(20,"i",40),e.qZA(),e._uU(21," \xa0\xa0 "),e.TgZ(22,"span",41),e.NdJ("click",function(){const a=e.CHM(t).$implicit,c=e.oxw(4);return e.KtG(c.refreshPrice(a))}),e._UZ(23,"i",42),e.qZA()()()()()}if(2&o){const t=l.$implicit,n=l.index,i=e.oxw(4);e.xp6(1),e.Q6J("ngIf",0==n),e.xp6(2),e.Oqu(t.Model),e.xp6(3),e.hij(" ",t.Code," "),e.xp6(2),e.Q6J("href","https://"+i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(null==t?null:t.ID),e.LSH),e.xp6(2),e.Q6J("ngxPermissionsOnly",e.VKq(11,S,i.rolePriceEdit)),e.xp6(2),e.hij(" ",e.lcZ(13,9,t.UnitPrice)," "),e.xp6(2),e.Q6J("ngClass",e.VKq(13,Fe,t.UnitPrice!=(null==t.Channel[0]?null:t.Channel[0].Price))),e.xp6(1),e.Q6J("ngIf",t.Channel.length>0),e.xp6(4),e.Q6J("href",null==t.Channel[0]?null:t.Channel[0].Url,e.LSH)}}function De(o,l){if(1&o&&(e.ynx(0),e.YNc(1,Ne,24,15,"tr",26),e.BQk()),2&o){const t=l.$implicit;e.xp6(1),e.Q6J("ngForOf",t.Variants)}}function Je(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"span",56),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(3);return e.KtG(i.getRowCount())}),e.TgZ(1,"i",57),e._uU(2,"?"),e.qZA()()}}function Me(o,l){if(1&o&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"number"),e.qZA()),2&o){const t=l.ngIf;e.xp6(1),e.Oqu(e.lcZ(2,1,t.Total))}}function Ue(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"a",61),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(4);return e.KtG(i.onNextPage())}),e._UZ(1,"i",62),e._uU(2," Next"),e.qZA()}}function Oe(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"a",63),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(4);return e.KtG(i.onLastPage())}),e._UZ(1,"i",64),e._uU(2," Last"),e.qZA()}}function ke(o,l){if(1&o&&(e.TgZ(0,"div",58),e.YNc(1,Ue,3,0,"a",59),e.YNc(2,Oe,3,0,"a",60),e.qZA()),2&o){const t=e.oxw(3);e.xp6(1),e.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),e.xp6(1),e.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}function Le(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"content")(1,"div",12)(2,"div",13)(3,"table",14)(4,"thead",15)(5,"tr")(6,"th",16),e._uU(7," Product "),e.TgZ(8,"div")(9,"mat-slide-toggle",17),e.NdJ("ngModelChange",function(i){e.CHM(t);const a=e.oxw(2);return e.KtG(a.toggleDifferentInventory=i)})("toggleChange",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.onToggleDifferentInventory())}),e.TgZ(10,"small",18),e._uU(11,"FILTER DIFFERENT PRICE"),e.qZA()()()(),e.TgZ(12,"th",19),e._uU(13,"Variant"),e.qZA(),e.TgZ(14,"th",20),e._uU(15,"SKU"),e.qZA(),e.YNc(16,be,2,0,"ng-template",21),e.TgZ(17,"th",22),e._uU(18,"POS"),e.qZA(),e.TgZ(19,"th",22)(20,"div",23),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.onChangeChannel())}),e._UZ(21,"img",24),e._uU(22),e.qZA()(),e._UZ(23,"th",25),e.qZA()(),e.TgZ(24,"tbody"),e.YNc(25,De,2,1,"ng-container",26),e.qZA()(),e.TgZ(26,"div",27)(27,"div",28)(28,"div",29),e._uU(29),e.ALo(30,"number"),e.YNc(31,Je,3,0,"span",30),e.YNc(32,Me,3,3,"span",4),e.ALo(33,"async"),e._uU(34),e.qZA()(),e.YNc(35,ke,3,2,"div",31),e.qZA()()()()}if(2&o){const t=l.ngIf,n=e.oxw(2);e.xp6(9),e.Q6J("ngModel",n.toggleDifferentInventory),e.xp6(7),e.Q6J("ngxPermissionsOnly",e.VKq(15,S,n.rolePriceEdit)),e.xp6(4),e.Q6J("matTooltip","Change "+(null==n.selectedChannel?null:n.selectedChannel.Name)),e.xp6(1),e.Q6J("src",n.selectedChannel.logo,e.LSH),e.xp6(1),e.hij(" ",null!=n.selectedChannel&&n.selectedChannel.Name?null==n.selectedChannel?null:n.selectedChannel.Name:"Choose Channel ..."," "),e.xp6(3),e.Q6J("ngForOf",t),e.xp6(4),e.hij(" Showing 1 - ",e.lcZ(30,11,null==t?null:t.length)," of "),e.xp6(2),e.Q6J("ngIf",n.paginationService.hideCount),e.xp6(1),e.Q6J("ngIf",e.lcZ(33,13,!n.paginationService.hideCount&&n.allDataCount$)),e.xp6(2),e.hij(" records ~ ",n.paginationService.footerPageNumber," Page "),e.xp6(1),e.Q6J("ngIf",t.length>0)}}function Qe(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"mainpanel",1),e.NdJ("textChange",function(i){e.CHM(t);const a=e.oxw();return e.KtG(a.searchFilter.text=i)})("onSubmit",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.search())}),e.TgZ(1,"filters")(2,"div",2)(3,"div")(4,"label"),e._uU(5,"Page Number"),e.qZA(),e.TgZ(6,"input",3),e.NdJ("ngModelChange",function(i){e.CHM(t);const a=e.oxw();return e.KtG(a.searchFilter.PageNumber=i)}),e.qZA()(),e.TgZ(7,"div")(8,"label"),e._uU(9,"Page Size"),e.qZA(),e.TgZ(10,"input",3),e.NdJ("ngModelChange",function(i){e.CHM(t);const a=e.oxw();return e.KtG(a.searchFilter.RowCount=i)}),e.qZA()()()(),e.YNc(11,Pe,5,2,"actions",4),e.ALo(12,"async"),e.YNc(13,Le,36,17,"content",4),e.ALo(14,"async"),e.qZA()}if(2&o){const t=e.oxw();e.Q6J("headerTitle",t.pageTitle)("text",t.searchFilter.text),e.xp6(6),e.Q6J("ngModel",t.searchFilter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.searchFilter.RowCount),e.xp6(1),e.Q6J("ngIf",e.lcZ(12,6,t.paginationService.data$)),e.xp6(2),e.Q6J("ngIf",e.lcZ(14,8,t.paginationService.data$))}}let qe=(()=>{var o;class l{constructor(n,i,a,c,s,p){this.http=n,this.paginationService=i,this.toastr=a,this.dialog=c,this.productService=s,this.biggerPictureService=p,this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.allDataCountEndpoint="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=M.G.price,this.hostName=this.productService.getHostName()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe((0,F.b)(n=>{this.searchFilter=n.Filter,this.searchFilter.filterModel=u.v.ALL,this.paginationService.reloadPagination(this.searchFilter),this.channelOptions=n.Options.Channel,this.initSelectedChannel()}))}onToggleDifferentInventory(){this.searchFilter.filterModel=this.toggleDifferentInventory?u.v.ALL:u.v.DIFFERENCE,this.search()}onCheckboxStateProduct(n){n.Variants=n.Variants.map(i=>(i.selected=n.selected,i))}openScanDialog(n){let i=JSON.parse(JSON.stringify(this.searchFilter));i.ChannelID=g.g.GuidEMpty,this.dialog.open(w.j,{data:{filter:i,channelOptions:n.Options.Channel},width:"600px"}).afterClosed().pipe((0,d.h)(a=>g.g.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ChannelID=a.ChannelID,this.searchFilter.ScanFull=a.ScanFull,this.searchFilter.UpdatedProduct=a.UpdatedProduct,this.searchFilter.Async=a.Async,this.scanAll(n)})}scanAll(n){const i=this.productService.findChannelById(this.searchFilter.ChannelID,n.Options.Channel);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(a=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.initPageLoader(),this.toastr.success(`Successfully scanned from ${i?.Name}`,"Success"))})}updateStock(n){let a=this.productService.selectedVariantProduct(n).map(s=>({ID:s.ID,ChannelID:s.Channel[0].ChannelID,Code:s.Code,Price:s.UnitPrice})),c={ListChannelID:[this.searchFilter.ChannelID],ListPrice:a};this.http.post("/api/Price/UpdateChannel",c).subscribe(()=>{this.search(),this.toastr.success(`Successfully updated ${c.ListPrice.length} variants in ${c.ListChannelID.length} channels`,"Success")})}refreshPrice(n){this.http.post("/api/Price/RefreshPriceChannel",{ChannelItemID:n?.Channel[0].ChannelItemID,ChannelVariationID:n?.Channel[0]?.ChannelVariationID,ChannelID:n?.Channel[0]?.ChannelID,VariantID:n.ID}).subscribe(a=>{this.toastr.success("Successfully updated","Success"),this.search()})}search(){this.paginationService.reloadPagination(this.searchFilter)}getRowCount(){this.paginationService.hideCount=!1,this.allDataCount$=this.http.post(`/API/${this.allDataCountEndpoint}`,this.searchFilter)}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}onLastPage(){this.http.post(`/API/${this.allDataCountEndpoint}`,this.searchFilter).subscribe({next:n=>{this.paginationService.getAllData(this.searchFilter,n.Total)}})}openTableDialog(n,i,a){let c=JSON.parse(JSON.stringify(n));this.dialog.open(J.k,{data:{Name:i.Name,Variant:c,ChannelID:c?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:c?.Channel[0]?.ChannelItemID}}).afterClosed().pipe((0,d.h)(p=>g.g.IsNotEmpty(p))).subscribe(p=>{this.updateItemAfterDialog(p,a,n)})}updateItemAfterDialog(n,i,a){let c={ID:n.ChannelID,ChannelItemID:n.ChannelItemID,ChannelVariantID:n.ChannelVariationID,Price:parseFloat(n.Price),VariantID:n.ID,SKU:n.Sku};this.http.post("/api/Price/UpdatePriceByID",c).subscribe(s=>{const p=this.productService.findChannelById(c.ID,i.Options.Channel);this.toastr.success(`Successfully updated ${n.ItemName} (${n.VarName}) inventory in ${p.Name} to ${c.Price}`,"Success"),a.Channel[0]&&(a.Channel[0].Price=c.Price)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(n=>n.ID==this.searchFilter.ChannelID),this.selectedChannel&&(this.selectedChannel.logo=g.g.getChannelLogoByTypeId(this.selectedChannel.TypeID))}onChangeChannel(){this.dialog.open(Ce.b,{data:{channelOptions:this.channelOptions,selectedChannel:this.selectedChannel}}).afterClosed().pipe((0,d.h)(n=>g.g.IsNotEmpty(n))).subscribe(n=>{this.selectedChannel=n,this.searchFilter.ChannelID=n.ID,this.search()})}onSelectAllSKU(n,i){i=i.map(a=>(a.Variants=a.Variants.map(c=>(c.selected=n,c)),a))}onZoomImage(n,i){this.biggerPictureService.openBiggerPicture(n,i)}ngOnDestroy(){this.paginationService.destroy()}}return(o=l).\u0275fac=function(n){return new(n||o)(e.Y36(f.O),e.Y36(N.b),e.Y36(x._W),e.Y36(P.uw),e.Y36(b.M),e.Y36(U.k))},o.\u0275cmp=e.Xpm({type:o,selectors:[["app-price-single-channel"]],decls:2,vars:3,consts:[[3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[3,"headerTitle","text","textChange","onSubmit"],["container",""],["type","number",3,"ngModel","ngModelChange"],[4,"ngIf"],[1,"d-flex"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["class","btn btn-success",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModel","ngModelChange","toggleChange"],[1,"fw-bold"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["matTooltipPosition","above",1,"d-inline-block","text-truncate","mt-3","cursor-pointer",2,"max-width","114px",3,"matTooltip","click"],[2,"width","16px",3,"src"],[2,"width","4%"],[4,"ngFor","ngForOf"],[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"],["class","btn-group",4,"ngIf"],["type","checkbox",1,"me-3",3,"change"],[1,"ms-2"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-external-link-alt"],[1,"text-end",3,"ngClass"],["style","cursor: pointer;",3,"click",4,"ngIf"],[1,"row"],[1,"col-12","ps-0","d-flex","justify-content-between"],[1,"fas","external-link-custom","fa-lg","fa-external-link-alt"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],["class","border rounded w-img cursor-pointer","style","margin-left: 20px",3,"src","click",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],["type","checkbox","class","me-3",3,"ngModel","ngModelChange",4,"ngIf"],["type","checkbox",1,"me-3",3,"ngModel","ngModelChange"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src","click"],["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,"align-middle"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],["type","checkbox",3,"ngModel","ngModelChange"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],[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"],["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(n,i){1&n&&(e.YNc(0,Qe,15,10,"mainpanel",0),e.ALo(1,"async")),2&n&&e.Q6J("ngIf",e.lcZ(1,1,i.loader$))},dependencies:[_.mk,_.sg,_.O5,h.Fj,h.wV,h.Wl,h.JJ,h.On,m.p,L.Rr,Q.gM,T.gE,_.Ov,_.JJ],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"]}),l})();var v=r(4575);const Ee=[{path:"",component:E,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",component:z,canActivate:[v.a],data:{title:"Global Price Comparison"}},{path:"OutletPrice",component:me,canActivate:[v.a],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",component:qe,canActivate:[v.a],data:{title:"Price Single Channel Comparison"}}]}];let Ve=(()=>{var o;class l{}return(o=l).\u0275fac=function(n){return new(n||o)},o.\u0275mod=e.oAB({type:o}),o.\u0275inj=e.cJS({imports:[_.ez,C.Bz.forChild(Ee)]}),l})();var Ye=r(5986);let $e=(()=>{var o;class l{}return(o=l).\u0275fac=function(n){return new(n||o)},o.\u0275mod=e.oAB({type:o}),o.\u0275inj=e.cJS({imports:[_.ez,h.u5,y.Z,m.R,C.Bz,q.A0,Ve,h.UX,L.rP,Ye.p9,Q.AV,O,D.a,T.VI.forChild()]}),l})()}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[699],{9699:(w,v,p)=>{p.r(v),p.d(v,{DownloadModule:()=>Y});var d=p(6814),t=p(5879),_=p(6027),g=p(9790);const o=function(n){return[n]};function T(n,a){if(1&n&&(t.ynx(0),t.TgZ(1,"a",9),t._uU(2),t.qZA(),t.BQk()),2&n){const r=a.$implicit;t.xp6(1),t.Q6J("routerLink",t.VKq(2,o,r.url)),t.xp6(1),t.hij(" ",r.title,"")}}let C=(()=>{var n;class a{constructor(){this.tabs=[{Title:"Download By Url",Url:"/menu/products/download/by-url",Description:"Download products information by product URL as a parameter"}],this.moreMenu=[{title:"Sold In Channel",url:"/menu/products/status/sold-in-channel"},{title:"In POS",url:"/menu/products/status/in-pos"},{title:"Not In Channel",url:"/menu/products/status/not-in-channel"},{title:"Duplicate SKU",url:"/menu/products/status/duplicate-sku"}]}}return(n=a).\u0275fac=function(e){return new(e||n)},n.\u0275cmp=t.Xpm({type:n,selectors:[["app-download"]],decls:12,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-block"],[4,"ngFor","ngForOf"],[1,"dropdown-item",3,"routerLink"]],template:function(e,i){1&e&&(t.TgZ(0,"nav",0)(1,"div",1)(2,"div"),t._UZ(3,"nav-tab",2),t.qZA()(),t.TgZ(4,"div")(5,"div",3)(6,"a",4),t._UZ(7,"i",5),t.qZA(),t.TgZ(8,"div",6)(9,"div",7),t.YNc(10,T,3,4,"ng-container",8),t.qZA()()()()(),t._UZ(11,"router-outlet")),2&e&&(t.xp6(3),t.Q6J("Tabs",i.tabs),t.xp6(7),t.Q6J("ngForOf",i.moreMenu))},dependencies:[d.sg,_.e,g.lC,g.rH]}),a})();var b=p(1657),x=p(9659);let h=(()=>{var n;class a{constructor(e){this.httpService=e}download(e){return this.httpService.post("/api/Product/downloadurl",e)}}return(n=a).\u0275fac=function(e){return new(e||n)(t.LFG(x.O))},n.\u0275prov=t.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"}),a})();var y=p(4750),f=p(6223),s=p(4387),c=p(8257);function l(n,a){if(1&n&&(t.TgZ(0,"th"),t._uU(1),t.qZA()),2&n){const r=a.$implicit;t.xp6(1),t.Oqu(r.column)}}function m(n,a){if(1&n&&(t.ynx(0),t.TgZ(1,"td"),t._UZ(2,"span",6),t.qZA(),t.BQk()),2&n){const r=a.$implicit,e=t.oxw().$implicit;t.xp6(2),t.Q6J("innerHTML",e[r.prop],t.oJD)}}const U=function(n){return{"background-color":n}};function Z(n,a){if(1&n&&(t.TgZ(0,"tr",5),t.YNc(1,m,3,1,"ng-container",3),t.qZA()),2&n){const r=a.$implicit,e=t.oxw();t.Q6J("ngStyle",t.VKq(2,U,r.Status>200?"#F4D6D5":"#DEE9C9")),t.xp6(1),t.Q6J("ngForOf",e.configs)}}let D=(()=>{var n;class a{constructor(){this.eventClose=new t.vpe}ngOnInit(){}onClose(){this.eventClose.emit()}}return(n=a).\u0275fac=function(e){return new(e||n)},n.\u0275cmp=t.Xpm({type:n,selectors:[["app-response-api-list"]],inputs:{configs:"configs",data:"data",status:"status"},outputs:{eventClose:"onClose"},decls:7,vars:2,consts:[[1,"table-responsive"],[1,"table"],[1,"thead-light"],[4,"ngFor","ngForOf"],[3,"ngStyle",4,"ngFor","ngForOf"],[3,"ngStyle"],[3,"innerHTML"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"table",1)(2,"thead",2)(3,"tr"),t.YNc(4,l,2,1,"th",3),t.qZA()(),t.TgZ(5,"tbody"),t.YNc(6,Z,2,4,"tr",4),t.qZA()()()),2&e&&(t.xp6(4),t.Q6J("ngForOf",i.configs),t.xp6(2),t.Q6J("ngForOf",i.data))},dependencies:[d.sg,d.PC]}),a})();function S(n,a){if(1&n){const r=t.EpF();t.ynx(0),t.TgZ(1,"button",23),t.NdJ("click",function(){t.CHM(r);const i=t.oxw(),u=t.MAs(11);return t.KtG(i.onNewStepperState(u))}),t._UZ(2,"i",24),t._uU(3," New "),t.qZA(),t.BQk()}}function A(n,a){if(1&n){const r=t.EpF();t.ynx(0),t.TgZ(1,"button",23),t.NdJ("click",function(){t.CHM(r),t.oxw();const i=t.MAs(11);return t.KtG(i.previous())}),t._uU(2," Back "),t.qZA(),t.BQk()}}function B(n,a){if(1&n){const r=t.EpF();t.ynx(0),t.TgZ(1,"button",25),t.NdJ("click",function(){t.CHM(r);const i=t.oxw(),u=t.MAs(11);return t.KtG(i.onStepperNext(u))}),t._uU(2," Next "),t.qZA(),t.BQk()}}function O(n,a){if(1&n){const r=t.EpF();t.ynx(0),t.TgZ(1,"button",26),t.NdJ("click",function(){t.CHM(r);const i=t.oxw(),u=t.MAs(11);return t.KtG(i.onSubmit(u))}),t._uU(2,"Download"),t.qZA(),t.BQk()}if(2&n){const r=t.oxw();t.xp6(1),t.Q6J("disabled",!r.urls)}}function I(n,a){1&n&&t._uU(0,"Instruction")}function M(n,a){1&n&&t._uU(0,"Download")}function k(n,a){1&n&&t._uU(0,"Finish")}function L(n,a){1&n&&t._UZ(0,"i",27)}function J(n,a){1&n&&t._UZ(0,"i",28)}function P(n,a){1&n&&t._UZ(0,"i",29)}let F=(()=>{var n;class a{constructor(e,i){this.downloadService=e,this.authService=i,this.configs=[{column:"Url",prop:"URL"},{column:"POS",prop:"Name"},{column:"Exception",prop:"Message"}],this.downloadResponses=[],this.stepperState="DOWNLOAD",this.urlPlaceholder="https://tokopedia.com/tokoriyanadi/kaos-polos-biru\nhttps://tokopedia.com/tokoriyanadi/Celana-Chinos-Coklat",this.currentDomain=this.authService.getDomain()}onStepperChange(e){this.stepperState=e.selectedStep.state}onSubmit(e){const i=this.urls.split(/\r?\n/);this.downloadService.download(i).subscribe(u=>{this.downloadResponses=u,this.mappingLinkToProduct(),this.onStepperNext(e)})}mappingLinkToProduct(){this.downloadResponses=this.downloadResponses.map(e=>(e.Name=e?.Name?`<a href="${this.currentDomain}/menu/Products/Catalog/Products/Info?ID=${e.ID}" target="_blank">\n ${e?.Name}\n </a>`:"-",e))}onNewStepperState(e){this.downloadResponses=[],this.urls=null,this.stepperState="DOWNLOAD",e.reset(),this.onStepperNext(e)}onStepperNext(e){e.selected.completed=!0,e.next()}}return(n=a).\u0275fac=function(e){return new(e||n)(t.Y36(h),t.Y36(y.e))},n.\u0275cmp=t.Xpm({type:n,selectors:[["app-by-url"]],features:[t._Bn([{provide:b.gx,useValue:{displayDefaultIndicatorType:!1}}])],decls:41,vars:15,consts:[["headerTitle","Tokopedia - Product Download By Url",3,"hideSearchBox","hideSearchDropdown"],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-12"],["labelPosition","bottom","linear","",1,"stepper-downloadByUrl",3,"selectedIndex","selectionChange"],["stepper",""],["state","GUIDE",3,"editable","completed"],["matStepLabel",""],[1,"mt-8"],[1,"card","border","w-50"],[1,"card-header","py-6"],[1,"text-primary"],[1,"card-body",2,"padding-left","0px"],[1,"mt-6"],["href","https://seller.tokopedia.com","target","_blank"],["state","DOWNLOAD",3,"editable","completed"],["name","url","cols","30","rows","25",1,"form-control",3,"placeholder","ngModel","ngModelChange"],["state","FINISH"],["status","error",3,"data","configs"],["matStepperIcon","GUIDE"],["matStepperIcon","DOWNLOAD"],["matStepperIcon","FINISH"],[1,"btn","btn-outline-secondary","btn-fill","btn-lg",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],["type","button",1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-3",3,"click"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","text-white","ms-3",3,"disabled","click"],[1,"fa-solid","fa-info"],[1,"fa-solid","fa-download"],[1,"fa-sharp","fa-solid","fa-flag"]],template:function(e,i){1&e&&(t.TgZ(0,"mainpanel",0)(1,"actions"),t.YNc(2,S,4,0,"ng-container",1),t.YNc(3,A,3,0,"ng-container",1),t.YNc(4,B,3,0,"ng-container",1),t.YNc(5,O,3,1,"ng-container",1),t.qZA(),t.TgZ(6,"content")(7,"div",2)(8,"div",3)(9,"div",4)(10,"mat-stepper",5,6),t.NdJ("selectionChange",function(N){return i.onStepperChange(N)}),t.TgZ(12,"mat-step",7),t.YNc(13,I,1,0,"ng-template",8),t.TgZ(14,"div",9)(15,"div",10)(16,"div",11)(17,"h4",12),t._uU(18,"Note"),t.qZA()(),t.TgZ(19,"div",13)(20,"ol",14)(21,"li"),t._uU(22," Use this form to Download Products from Tokopedia using product URL "),t.qZA(),t.TgZ(23,"li"),t._uU(24," Copy Product URL from "),t.TgZ(25,"a",15),t._uU(26,"https://seller.tokopedia.com/ "),t.qZA(),t._uU(27," and paste in this form "),t.qZA(),t.TgZ(28,"li"),t._uU(29," Use New Line when you want to input several product URLs "),t.qZA()()()()()(),t.TgZ(30,"mat-step",16),t.YNc(31,M,1,0,"ng-template",8),t.TgZ(32,"div",9)(33,"textarea",17),t.NdJ("ngModelChange",function(N){return i.urls=N}),t.qZA()()(),t.TgZ(34,"mat-step",18),t.YNc(35,k,1,0,"ng-template",8),t.TgZ(36,"div",9),t._UZ(37,"app-response-api-list",19),t.qZA()(),t.YNc(38,L,1,0,"ng-template",20),t.YNc(39,J,1,0,"ng-template",21),t.YNc(40,P,1,0,"ng-template",22),t.qZA()()()()()()),2&e&&(t.Q6J("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(2),t.Q6J("ngIf","FINISH"==i.stepperState),t.xp6(1),t.Q6J("ngIf","DOWNLOAD"==i.stepperState),t.xp6(1),t.Q6J("ngIf","GUIDE"==i.stepperState),t.xp6(1),t.Q6J("ngIf","DOWNLOAD"==i.stepperState),t.xp6(5),t.Q6J("selectedIndex",1),t.xp6(2),t.Q6J("editable","FINISH"!=i.stepperState)("completed",!0),t.xp6(18),t.Q6J("editable","FINISH"!=i.stepperState)("completed",!1),t.xp6(3),t.Q6J("placeholder",i.urlPlaceholder)("ngModel",i.urls),t.xp6(4),t.Q6J("data",i.downloadResponses)("configs",i.configs))},dependencies:[d.O5,f.Fj,f.JJ,f.On,s.p,c.C0,c.VY,c.Vq,c.z9,D],styles:[".card-header{background-color:#00000008}mat-stepper.stepper-downloadByUrl>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container{position:relative;width:60%;left:18%}mat-stepper.stepper-downloadByUrl>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container mat-step-header>div.mat-step-label{padding-top:8px}\n"],encapsulation:2}),a})();var Q=p(4575),E=p(617);const R=[{path:"",component:C,children:[{path:"by-url",component:F,data:{title:"Download Product By Url"},canActivate:[Q.a]},{pathMatch:"full",path:"",redirectTo:"by-url"}]}];let Y=(()=>{var n;class a{}return(n=a).\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({providers:[h],imports:[d.ez,f.u5,_.Z,s.R,c.T5,E.Ps,g.Bz.forChild(R)]}),a})()},6027:(w,v,p)=>{p.d(v,{Z:()=>f,e:()=>y});var d=p(6814),t=p(2596),_=p(9790),g=p(8253),o=p(5879);function T(s,c){if(1&s&&(o.ynx(0),o.TgZ(1,"a",6),o._uU(2),o.qZA(),o.BQk()),2&s){const l=o.oxw().$implicit;o.xp6(1),o.s9C("routerLink",l.Url),o.Q6J("title",l.Description?l.Description:""),o.xp6(1),o.hij(" ",l.Title," ")}}function C(s,c){if(1&s&&(o.TgZ(0,"li",4),o.YNc(1,T,3,3,"ng-container",5),o.qZA()),2&s){const l=c.$implicit;o.xp6(1),o.Q6J("ngxPermissionsOnly",l.Permissions)}}function b(s,c){if(1&s&&(o.ynx(0),o.YNc(1,C,2,1,"li",3),o.BQk()),2&s){const l=o.oxw();o.xp6(1),o.Q6J("ngForOf",l.Tabs)}}function x(s,c){if(1&s&&(o.TgZ(0,"li",4)(1,"a",6),o._uU(2),o.qZA()()),2&s){const l=c.$implicit;o.xp6(1),o.s9C("routerLink",l.Url),o.Q6J("title",l.Description?l.Description:""),o.xp6(1),o.hij(" ",l.Title," ")}}function h(s,c){if(1&s&&o.YNc(0,x,3,3,"li",3),2&s){const l=o.oxw();o.Q6J("ngForOf",l.Tabs)}}let y=(()=>{var s;class c{constructor(){this.usePermissions=!1}}return(s=c).\u0275fac=function(m){return new(m||s)},s.\u0275cmp=o.Xpm({type:s,selectors:[["nav-tab"]],inputs:{Tabs:"Tabs",usePermissions:"usePermissions"},decls:4,vars:2,consts:[[1,"nav","navbar-nav","navbar-left","nav-tab-arrow"],[4,"ngIf","ngIfElse"],["NOT_USE_PERMISSIONS",""],["routerLinkActive","active","class","nav-item me-6",4,"ngFor","ngForOf"],["routerLinkActive","active",1,"nav-item","me-6"],[4,"ngxPermissionsOnly"],[1,"nav-link","nav-link-arrow","mb-0",3,"routerLink","title"]],template:function(m,U){if(1&m&&(o.TgZ(0,"ul",0),o.YNc(1,b,2,1,"ng-container",1),o.YNc(2,h,1,1,"ng-template",null,2,o.W1O),o.qZA()),2&m){const Z=o.MAs(3);o.xp6(1),o.Q6J("ngIf",U.usePermissions)("ngIfElse",Z)}},dependencies:[d.sg,d.O5,_.rH,_.Od,g.gE]}),c})(),f=(()=>{var s;class c{}return(s=c).\u0275fac=function(m){return new(m||s)},s.\u0275mod=o.oAB({type:s}),s.\u0275inj=o.cJS({imports:[d.ez,_.Bz,t.AV,g.VI.forChild()]}),c})()}}]);
1
+ "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[699],{9699:(w,v,p)=>{p.r(v),p.d(v,{DownloadModule:()=>Y});var d=p(6814),t=p(5879),_=p(6027),g=p(9790);const o=function(n){return[n]};function T(n,a){if(1&n&&(t.ynx(0),t.TgZ(1,"a",9),t._uU(2),t.qZA(),t.BQk()),2&n){const r=a.$implicit;t.xp6(1),t.Q6J("routerLink",t.VKq(2,o,r.url)),t.xp6(1),t.hij(" ",r.title,"")}}let C=(()=>{var n;class a{constructor(){this.tabs=[{Title:"Download By Url",Url:"/menu/products/download/by-url",Description:"Download products information by product URL as a parameter"}],this.moreMenu=[{title:"Sold In Channel",url:"/menu/products/status/sold-in-channel"},{title:"In POS",url:"/menu/products/status/in-pos"},{title:"Not In Channel",url:"/menu/products/status/not-in-channel"},{title:"Duplicate SKU",url:"/menu/products/status/duplicate-sku"}]}}return(n=a).\u0275fac=function(e){return new(e||n)},n.\u0275cmp=t.Xpm({type:n,selectors:[["app-download"]],decls:12,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-block"],[4,"ngFor","ngForOf"],[1,"dropdown-item",3,"routerLink"]],template:function(e,i){1&e&&(t.TgZ(0,"nav",0)(1,"div",1)(2,"div"),t._UZ(3,"nav-tab",2),t.qZA()(),t.TgZ(4,"div")(5,"div",3)(6,"a",4),t._UZ(7,"i",5),t.qZA(),t.TgZ(8,"div",6)(9,"div",7),t.YNc(10,T,3,4,"ng-container",8),t.qZA()()()()(),t._UZ(11,"router-outlet")),2&e&&(t.xp6(3),t.Q6J("Tabs",i.tabs),t.xp6(7),t.Q6J("ngForOf",i.moreMenu))},dependencies:[d.sg,_.e,g.lC,g.rH]}),a})();var b=p(1657),x=p(9659);let h=(()=>{var n;class a{constructor(e){this.httpService=e}download(e){return this.httpService.post("/api/Product/downloadurl",e)}}return(n=a).\u0275fac=function(e){return new(e||n)(t.LFG(x.O))},n.\u0275prov=t.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"}),a})();var y=p(4750),f=p(6223),s=p(4387),c=p(8257);function l(n,a){if(1&n&&(t.TgZ(0,"th"),t._uU(1),t.qZA()),2&n){const r=a.$implicit;t.xp6(1),t.Oqu(r.column)}}function m(n,a){if(1&n&&(t.ynx(0),t.TgZ(1,"td"),t._UZ(2,"span",6),t.qZA(),t.BQk()),2&n){const r=a.$implicit,e=t.oxw().$implicit;t.xp6(2),t.Q6J("innerHTML",e[r.prop],t.oJD)}}const U=function(n){return{"background-color":n}};function Z(n,a){if(1&n&&(t.TgZ(0,"tr",5),t.YNc(1,m,3,1,"ng-container",3),t.qZA()),2&n){const r=a.$implicit,e=t.oxw();t.Q6J("ngStyle",t.VKq(2,U,r.Status>200?"#F4D6D5":"#DEE9C9")),t.xp6(1),t.Q6J("ngForOf",e.configs)}}let D=(()=>{var n;class a{constructor(){this.eventClose=new t.vpe}ngOnInit(){}onClose(){this.eventClose.emit()}}return(n=a).\u0275fac=function(e){return new(e||n)},n.\u0275cmp=t.Xpm({type:n,selectors:[["app-response-api-list"]],inputs:{configs:"configs",data:"data",status:"status"},outputs:{eventClose:"onClose"},decls:7,vars:2,consts:[[1,"table-responsive"],[1,"table"],[1,"thead-light"],[4,"ngFor","ngForOf"],[3,"ngStyle",4,"ngFor","ngForOf"],[3,"ngStyle"],[3,"innerHTML"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"table",1)(2,"thead",2)(3,"tr"),t.YNc(4,l,2,1,"th",3),t.qZA()(),t.TgZ(5,"tbody"),t.YNc(6,Z,2,4,"tr",4),t.qZA()()()),2&e&&(t.xp6(4),t.Q6J("ngForOf",i.configs),t.xp6(2),t.Q6J("ngForOf",i.data))},dependencies:[d.sg,d.PC]}),a})();function S(n,a){if(1&n){const r=t.EpF();t.ynx(0),t.TgZ(1,"button",23),t.NdJ("click",function(){t.CHM(r);const i=t.oxw(),u=t.MAs(11);return t.KtG(i.onNewStepperState(u))}),t._UZ(2,"i",24),t._uU(3," New "),t.qZA(),t.BQk()}}function A(n,a){if(1&n){const r=t.EpF();t.ynx(0),t.TgZ(1,"button",23),t.NdJ("click",function(){t.CHM(r),t.oxw();const i=t.MAs(11);return t.KtG(i.previous())}),t._uU(2," Back "),t.qZA(),t.BQk()}}function B(n,a){if(1&n){const r=t.EpF();t.ynx(0),t.TgZ(1,"button",25),t.NdJ("click",function(){t.CHM(r);const i=t.oxw(),u=t.MAs(11);return t.KtG(i.onStepperNext(u))}),t._uU(2," Next "),t.qZA(),t.BQk()}}function O(n,a){if(1&n){const r=t.EpF();t.ynx(0),t.TgZ(1,"button",26),t.NdJ("click",function(){t.CHM(r);const i=t.oxw(),u=t.MAs(11);return t.KtG(i.onSubmit(u))}),t._uU(2,"Download"),t.qZA(),t.BQk()}if(2&n){const r=t.oxw();t.xp6(1),t.Q6J("disabled",!r.urls)}}function I(n,a){1&n&&t._uU(0,"Instruction")}function M(n,a){1&n&&t._uU(0,"Download")}function k(n,a){1&n&&t._uU(0,"Finish")}function L(n,a){1&n&&t._UZ(0,"i",27)}function J(n,a){1&n&&t._UZ(0,"i",28)}function P(n,a){1&n&&t._UZ(0,"i",29)}let F=(()=>{var n;class a{constructor(e,i){this.downloadService=e,this.authService=i,this.configs=[{column:"Url",prop:"URL"},{column:"POS",prop:"Name"},{column:"Exception",prop:"Message"}],this.downloadResponses=[],this.stepperState="DOWNLOAD",this.urlPlaceholder="https://tokopedia.com/tokoriyanadi/kaos-polos-biru\nhttps://tokopedia.com/tokoriyanadi/Celana-Chinos-Coklat",this.currentDomain=this.authService.getDomain()}onStepperChange(e){this.stepperState=e.selectedStep.state}onSubmit(e){const i=this.urls.split(/\r?\n/);this.downloadService.download(i).subscribe(u=>{this.downloadResponses=u,this.mappingLinkToProduct(),this.onStepperNext(e)})}mappingLinkToProduct(){this.downloadResponses=this.downloadResponses.map(e=>(e.Name=e?.Name?`<a href="${this.currentDomain}/menu/Products/Catalog/Products/Info?ID=${e.ID}" target="_blank">\n ${e?.Name}\n </a>`:"-",e))}onNewStepperState(e){this.downloadResponses=[],this.urls=null,this.stepperState="DOWNLOAD",e.reset(),this.onStepperNext(e)}onStepperNext(e){e.selected.completed=!0,e.next()}}return(n=a).\u0275fac=function(e){return new(e||n)(t.Y36(h),t.Y36(y.e))},n.\u0275cmp=t.Xpm({type:n,selectors:[["app-by-url"]],features:[t._Bn([{provide:b.gx,useValue:{displayDefaultIndicatorType:!1}}])],decls:41,vars:15,consts:[["headerTitle","Tokopedia - Product Download By Url",3,"hideSearchBox","hideSearchDropdown"],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-12"],["labelPosition","bottom","linear","",1,"stepper-downloadByUrl",3,"selectedIndex","selectionChange"],["stepper",""],["state","GUIDE",3,"editable","completed"],["matStepLabel",""],[1,"mt-8"],[1,"card","border","w-50"],[1,"card-header","py-6"],[1,"text-primary"],[1,"card-body",2,"padding-left","0px"],[1,"mt-6"],["href","https://seller.tokopedia.com","target","_blank"],["state","DOWNLOAD",3,"editable","completed"],["name","url","cols","30","rows","25",1,"form-control",3,"placeholder","ngModel","ngModelChange"],["state","FINISH"],["status","error",3,"data","configs"],["matStepperIcon","GUIDE"],["matStepperIcon","DOWNLOAD"],["matStepperIcon","FINISH"],[1,"btn","btn-outline-secondary","btn-fill","btn-lg",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],["type","button",1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-3",3,"click"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","text-white","ms-3",3,"disabled","click"],[1,"fa-solid","fa-info"],[1,"fa-solid","fa-download"],[1,"fa-sharp","fa-solid","fa-flag"]],template:function(e,i){1&e&&(t.TgZ(0,"mainpanel",0)(1,"actions"),t.YNc(2,S,4,0,"ng-container",1),t.YNc(3,A,3,0,"ng-container",1),t.YNc(4,B,3,0,"ng-container",1),t.YNc(5,O,3,1,"ng-container",1),t.qZA(),t.TgZ(6,"content")(7,"div",2)(8,"div",3)(9,"div",4)(10,"mat-stepper",5,6),t.NdJ("selectionChange",function(N){return i.onStepperChange(N)}),t.TgZ(12,"mat-step",7),t.YNc(13,I,1,0,"ng-template",8),t.TgZ(14,"div",9)(15,"div",10)(16,"div",11)(17,"h4",12),t._uU(18,"Note"),t.qZA()(),t.TgZ(19,"div",13)(20,"ol",14)(21,"li"),t._uU(22," Use this form to Download Products from Tokopedia using product URL "),t.qZA(),t.TgZ(23,"li"),t._uU(24," Copy Product URL from "),t.TgZ(25,"a",15),t._uU(26,"https://seller.tokopedia.com/ "),t.qZA(),t._uU(27," and paste in this form "),t.qZA(),t.TgZ(28,"li"),t._uU(29," Use New Line when you want to input several product URLs "),t.qZA()()()()()(),t.TgZ(30,"mat-step",16),t.YNc(31,M,1,0,"ng-template",8),t.TgZ(32,"div",9)(33,"textarea",17),t.NdJ("ngModelChange",function(N){return i.urls=N}),t.qZA()()(),t.TgZ(34,"mat-step",18),t.YNc(35,k,1,0,"ng-template",8),t.TgZ(36,"div",9),t._UZ(37,"app-response-api-list",19),t.qZA()(),t.YNc(38,L,1,0,"ng-template",20),t.YNc(39,J,1,0,"ng-template",21),t.YNc(40,P,1,0,"ng-template",22),t.qZA()()()()()()),2&e&&(t.Q6J("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(2),t.Q6J("ngIf","FINISH"==i.stepperState),t.xp6(1),t.Q6J("ngIf","DOWNLOAD"==i.stepperState),t.xp6(1),t.Q6J("ngIf","GUIDE"==i.stepperState),t.xp6(1),t.Q6J("ngIf","DOWNLOAD"==i.stepperState),t.xp6(5),t.Q6J("selectedIndex",1),t.xp6(2),t.Q6J("editable","FINISH"!=i.stepperState)("completed",!0),t.xp6(18),t.Q6J("editable","FINISH"!=i.stepperState)("completed",!1),t.xp6(3),t.Q6J("placeholder",i.urlPlaceholder)("ngModel",i.urls),t.xp6(4),t.Q6J("data",i.downloadResponses)("configs",i.configs))},dependencies:[d.O5,f.Fj,f.JJ,f.On,s.p,c.C0,c.VY,c.Vq,c.z9,D],styles:[".card-header{background-color:#00000008}mat-stepper.stepper-downloadByUrl>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container{position:relative;width:60%;left:18%}mat-stepper.stepper-downloadByUrl>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container mat-step-header>div.mat-step-label{padding-top:8px}\n"],encapsulation:2}),a})();var Q=p(4575),E=p(617);const R=[{path:"",component:C,children:[{path:"by-url",component:F,data:{title:"Download Product By Url"},canActivate:[Q.a]},{pathMatch:"full",path:"",redirectTo:"by-url"}]}];let Y=(()=>{var n;class a{}return(n=a).\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({providers:[h],imports:[d.ez,f.u5,_.Z,s.R,c.T5,E.Ps,g.Bz.forChild(R)]}),a})()},6027:(w,v,p)=>{p.d(v,{Z:()=>f,e:()=>y});var d=p(6814),t=p(2596),_=p(9790),g=p(621),o=p(5879);function T(s,c){if(1&s&&(o.ynx(0),o.TgZ(1,"a",6),o._uU(2),o.qZA(),o.BQk()),2&s){const l=o.oxw().$implicit;o.xp6(1),o.s9C("routerLink",l.Url),o.Q6J("title",l.Description?l.Description:""),o.xp6(1),o.hij(" ",l.Title," ")}}function C(s,c){if(1&s&&(o.TgZ(0,"li",4),o.YNc(1,T,3,3,"ng-container",5),o.qZA()),2&s){const l=c.$implicit;o.xp6(1),o.Q6J("ngxPermissionsOnly",l.Permissions)}}function b(s,c){if(1&s&&(o.ynx(0),o.YNc(1,C,2,1,"li",3),o.BQk()),2&s){const l=o.oxw();o.xp6(1),o.Q6J("ngForOf",l.Tabs)}}function x(s,c){if(1&s&&(o.TgZ(0,"li",4)(1,"a",6),o._uU(2),o.qZA()()),2&s){const l=c.$implicit;o.xp6(1),o.s9C("routerLink",l.Url),o.Q6J("title",l.Description?l.Description:""),o.xp6(1),o.hij(" ",l.Title," ")}}function h(s,c){if(1&s&&o.YNc(0,x,3,3,"li",3),2&s){const l=o.oxw();o.Q6J("ngForOf",l.Tabs)}}let y=(()=>{var s;class c{constructor(){this.usePermissions=!1}}return(s=c).\u0275fac=function(m){return new(m||s)},s.\u0275cmp=o.Xpm({type:s,selectors:[["nav-tab"]],inputs:{Tabs:"Tabs",usePermissions:"usePermissions"},decls:4,vars:2,consts:[[1,"nav","navbar-nav","navbar-left","nav-tab-arrow"],[4,"ngIf","ngIfElse"],["NOT_USE_PERMISSIONS",""],["routerLinkActive","active","class","nav-item me-6",4,"ngFor","ngForOf"],["routerLinkActive","active",1,"nav-item","me-6"],[4,"ngxPermissionsOnly"],[1,"nav-link","nav-link-arrow","mb-0",3,"routerLink","title"]],template:function(m,U){if(1&m&&(o.TgZ(0,"ul",0),o.YNc(1,b,2,1,"ng-container",1),o.YNc(2,h,1,1,"ng-template",null,2,o.W1O),o.qZA()),2&m){const Z=o.MAs(3);o.xp6(1),o.Q6J("ngIf",U.usePermissions)("ngIfElse",Z)}},dependencies:[d.sg,d.O5,_.rH,_.Od,g.gE]}),c})(),f=(()=>{var s;class c{}return(s=c).\u0275fac=function(m){return new(m||s)},s.\u0275mod=o.oAB({type:s}),s.\u0275inj=o.cJS({imports:[d.ez,_.Bz,t.AV,g.VI.forChild()]}),c})()}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[726],{3726:(Pn,L,c)=>{c.r(L),c.d(L,{StatusModule:()=>xn});var p=c(6814),t=c(5879),Q=c(6027),P=c(9790);const V=function(){return["/menu/products/download/by-url"]};let G=(()=>{var i;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"}]}}return(i=r).\u0275fac=function(n){return new(n||i)},i.\u0275cmp=t.Xpm({type:i,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(n,e){1&n&&(t.TgZ(0,"nav",0)(1,"div",1)(2,"div"),t._UZ(3,"nav-tab",2),t.qZA()(),t.TgZ(4,"div")(5,"div",3)(6,"a",4),t._UZ(7,"i",5),t.qZA(),t.TgZ(8,"div",6)(9,"div",7)(10,"a",8),t._uU(11,"Download Product By Url"),t.qZA()()()()()(),t._UZ(12,"router-outlet")),2&n&&(t.xp6(3),t.Q6J("Tabs",e.productTabs),t.xp6(7),t.Q6J("routerLink",t.DdM(2,V)))},dependencies:[Q.e,P.lC,P.rH]}),r})();var F=c(5623),m=c(2383),_=c(7700),s=c(5802),h=c(754),b=function(i){return i.Tokopedia="https://seller.tokopedia.com",i.Shoope="https://seller.shopee.co.id",i.Tiktok="https://seller-id.tiktok.com",i.WooCommerce="https://woocommerce.dealpos.app",i.Lazada="https://sellercenter.lazada.co.id",i}(b||{}),U=c(2965),M=c(2596),D=c(7380);function K(i,r){if(1&i&&(t.ynx(0),t.TgZ(1,"tr")(2,"td",11),t._uU(3),t.qZA(),t.TgZ(4,"td",11),t._uU(5),t.qZA(),t.TgZ(6,"td",12)(7,"p",13),t._uU(8,"Product Not in Channel!"),t.qZA()()(),t.BQk()),2&i){const o=t.oxw().$implicit;t.xp6(3),t.hij(" ",null==o?null:o.Model,""),t.xp6(2),t.hij(" ",null==o?null:o.Code,"")}}function $(i,r){if(1&i&&(t.TgZ(0,"td",11),t._uU(1),t.qZA()),2&i){const o=t.oxw(3).$implicit;t.uIk("rowspan",o.Channel.length),t.xp6(1),t.hij(" ",null==o?null:o.Model,"")}}function H(i,r){if(1&i&&(t.TgZ(0,"td",11),t._uU(1),t.qZA()),2&i){const o=t.oxw(3).$implicit;t.uIk("rowspan",o.Channel.length),t.xp6(1),t.hij(" ",null==o?null:o.Code,"")}}const R=function(i){return{"is-disabled":i}};function j(i,r){if(1&i&&(t.TgZ(0,"tr"),t.YNc(1,$,2,2,"td",14),t.YNc(2,H,2,2,"td",14),t.TgZ(3,"td",11)(4,"div",15)(5,"a",16),t._UZ(6,"img",17),t.qZA(),t.TgZ(7,"div",18),t._uU(8),t.qZA()()(),t.TgZ(9,"td",11),t._uU(10),t.ALo(11,"number"),t.qZA(),t.TgZ(12,"td",19),t._uU(13),t.ALo(14,"number"),t.qZA(),t.TgZ(15,"td",19)(16,"a",20),t._UZ(17,"i",21),t.TgZ(18,"span",22),t._uU(19,"Edit"),t.qZA()()()()),2&i){const o=r.$implicit,n=r.index,e=t.oxw(3);t.xp6(1),t.Q6J("ngIf",0==n),t.xp6(1),t.Q6J("ngIf",0==n),t.xp6(3),t.Q6J("href",o.Url,t.LSH)("title",o.Title),t.xp6(1),t.Q6J("src",e.getChannelLogo(o.TypeID),t.LSH),t.xp6(1),t.Q6J("matTooltip",(null==o||null==o.Name?null:o.Name.length)>55?null==o?null:o.Name:""),t.xp6(1),t.hij(" ",o.Name," "),t.xp6(2),t.Oqu(t.lcZ(11,12,o.Price)),t.xp6(3),t.Oqu(t.lcZ(14,14,o.Inventory)),t.xp6(3),t.Q6J("href",e.getHyperlinkSellerCenter(o),t.LSH)("ngClass",t.VKq(16,R,o.TypeID==e.channelType.KalCare))("matTooltip",o.TypeID!=e.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function z(i,r){if(1&i&&t.YNc(0,j,20,18,"tr",8),2&i){const o=t.oxw().$implicit;t.Q6J("ngForOf",null==o?null:o.Channel)}}function W(i,r){if(1&i&&(t.ynx(0),t.YNc(1,K,9,2,"ng-container",9),t.YNc(2,z,1,1,"ng-template",null,10,t.W1O),t.BQk()),2&i){const o=r.$implicit,n=t.MAs(3);t.xp6(1),t.Q6J("ngIf",!o.Channel||o.Channel.length<1)("ngIfElse",n)}}let q=(()=>{var i;class r{constructor(n,e){this.data=n,this.dialogRef=e,this.channelType=h.x,this.variants=n.variants,this.title=n.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new U.O,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideCancel=!0,this.modalConfig.hideOk=!0}getChannelLogo(n){return s.g.getChannelLogoByTypeId(n)}getHyperlinkSellerCenter(n){let e="javascript:void(0)";switch(n.TypeID){case h.x.ShopeeV2:e=`${b.Shoope}/portal/product/${n.ChannelItemID}`;break;case h.x.Tiktok:e=`${b.Tiktok}/product/edit/${n.ChannelItemID}`;break;case h.x.Tokopedia:e=`${b.Tokopedia}/edit-product/${n.ChannelItemID}`;break;case h.x.WooCommerce:e=`${b.WooCommerce}/wp-admin/post.php?post=${n.ChannelItemID}&action=edit`;break;case h.x.Lazada:e=`${b.Lazada}/apps/product/publish?productId=${n.ChannelItemID}`}return e}}return(i=r).\u0275fac=function(n){return new(n||i)(t.Y36(_.WI),t.Y36(_.so))},i.\u0275cmp=t.Xpm({type:i,selectors:[["app-modal-variant"]],decls:22,vars:2,consts:[[3,"config","onCancel"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"text-start","sticky-top"],["matTooltip","Variant from POS",1,"fas","fa-info-circle","ms-1"],["matTooltip","Product and Variant from each Channel",1,"fas","fa-info-circle","ms-1"],[1,"text-start","sticky-top",2,"width","0%"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],["printChannelModal",""],[1,"text-start"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-start",4,"ngIf"],[1,"d-flex"],["target","_blank",1,"me-1",3,"href","title"],[2,"width","20px","height","20px",3,"src"],[1,"text-ellipsis","ps-2",2,"max-width","18vw",3,"matTooltip"],[1,"text-center"],["target","_blank",1,"btn","btn-small","btn-light","px-4","py-2",3,"href","ngClass","matTooltip"],[1,"fa-solid","fa-pencil","me-2",2,"font-size","10px"],[1,"fs-6"]],template:function(n,e){1&n&&(t.TgZ(0,"modal-material",0),t.NdJ("onCancel",function(){return e.dialogRef.close()}),t.TgZ(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4),t._uU(6," VARIANT "),t.TgZ(7,"sup"),t._UZ(8,"i",5),t.qZA()(),t.TgZ(9,"th",4),t._uU(10,"SKU"),t.qZA(),t.TgZ(11,"th",4),t._uU(12," PRODUCT "),t.TgZ(13,"sup"),t._UZ(14,"i",6),t.qZA()(),t.TgZ(15,"th",4),t._uU(16,"PRICE"),t.qZA(),t.TgZ(17,"th",7),t._uU(18,"INVENTORY"),t.qZA(),t._UZ(19,"th",4),t.qZA()(),t.TgZ(20,"tbody"),t.YNc(21,W,4,2,"ng-container",8),t.qZA()()()()),2&n&&(t.Q6J("config",e.modalConfig),t.xp6(21),t.Q6J("ngForOf",e.variants))},dependencies:[p.mk,p.sg,p.O5,M.gM,D.M,p.JJ],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#fff!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}a.is-disabled[_ngcontent-%COMP%]{color:gray;cursor:default}a.is-disabled[_ngcontent-%COMP%]:hover{text-decoration:none}"]}),r})();var g=c(2181),f=c(4664),E=c(8645),A=c(9773),X=c(2096),tt=c(1449),S=c(9659);let nt=(()=>{var i;class r{constructor(n,e){this.LocalData=n,this.httpService=e}getCategoriesByTypeId(n,e){return this.LocalData.getCategoriesByChannelType(n).pipe((0,f.w)(a=>null!=a?(0,X.of)(a):this._getCategoriesByTypeID(n,e)))}_getCategoriesByTypeID(n,e){return this.httpService.post("/api/Channel/getCategoriesByTypeID",{TypeID:n,ID:e}).pipe((0,f.w)(l=>this.LocalData.saveCategoriesByChannelType(l,n)))}}return(i=r).\u0275fac=function(n){return new(n||i)(t.LFG(tt.T),t.LFG(S.O))},i.\u0275prov=t.Yz7({token:i,factory:i.\u0275fac,providedIn:"root"}),r})();var I=c(9229),u=c(6223),et=c(6107);function ot(i,r){if(1&i){const o=t.EpF();t.ynx(0),t.TgZ(1,"ng-select-infinite",16),t.NdJ("selectedChange",function(e){t.CHM(o);const a=t.oxw().index,l=t.oxw();return t.KtG(l.onSelectCategory(e,a))}),t.qZA(),t.BQk()}if(2&i){const o=t.oxw().$implicit;t.xp6(1),t.Q6J("items",o.Categories)("clearable",!1)}}function it(i,r){if(1&i&&(t.TgZ(0,"div",17),t._UZ(1,"input",18),t.qZA()),2&i){const o=t.oxw().$implicit,n=t.oxw();t.xp6(1),t.Q6J("placeholder",n.getChannelCategory(o.TypeID))}}function at(i,r){if(1&i){const o=t.EpF();t.ynx(0),t.TgZ(1,"tr")(2,"td",9)(3,"input",10),t.NdJ("ngModelChange",function(e){const l=t.CHM(o).$implicit;return t.KtG(l.Selected=e)})("ngModelChange",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.onSelectChannel())}),t.qZA()(),t.TgZ(4,"td")(5,"div",11),t._UZ(6,"img",12),t.TgZ(7,"span",13),t._uU(8),t.qZA()()(),t.TgZ(9,"td"),t.YNc(10,ot,2,2,"ng-container",14),t.YNc(11,it,2,1,"ng-template",null,15,t.W1O),t.qZA()(),t.BQk()}if(2&i){const o=r.$implicit,n=t.MAs(12);t.xp6(3),t.Q6J("ngModel",o.Selected),t.xp6(3),t.Q6J("src",o.Img,t.LSH),t.xp6(2),t.Oqu(o.Name),t.xp6(2),t.Q6J("ngIf",o.Categories.length>0)("ngIfElse",n)}}let w=(()=>{var i;class r{constructor(n,e,a,l){this.data=n,this.channelService=e,this.dialogRef=a,this.toastrService=l,this.channelOptions=[],this.uploadResponse=[],this.channelType=h.x,this.enableBtnOk=!1,this.destroy$=new E.x,this.uploadResponse=[],this.channels=this.data.channels}ngOnInit(){this.initModalConfig(),this.initChannelOptions(),this.initCategories()}initModalConfig(){this.modalConfig=new U.O,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0}initCategories(){this.filterChannelTypeId().forEach(e=>{this.channelService.getCategoriesByTypeId(e.channelType,e.channelId).pipe((0,A.R)(this.destroy$)).subscribe(a=>{this.setCategoriesChannelOption(e.channelType,a)})})}setCategoriesChannelOption(n,e){this.channelOptions=this.channelOptions.map(a=>(a.TypeID==n&&(a.Categories=e),a))}initChannelOptions(){this.channelOptions=this.channels.map(n=>({Name:n.Name,Img:n.Img,ID:n.ID,Selected:!1,CategoryID:this.initDefaultChannelCategoryId(n.TypeID),TypeID:n.TypeID,Categories:[]}))}initDefaultChannelCategoryId(n){let e=0;return n===h.x.Lazada&&(e=6509),e}filterChannelTypeId(){return this.data.channels.map(e=>({channelType:e.TypeID,channelId:e.ID})).filter((e,a,l)=>l.findIndex(d=>e.channelType==d.channelType)==a).filter(e=>e.channelType==h.x.Tokopedia)}onSelectCategory(n,e){this.channelOptions[e].CategoryID=n,this.channelOptions[e].Selected=!0,this.onSelectChannel()}onSelectAllChannel(n){this.channelOptions=this.channelOptions.map(e=>(e.Selected=n,e)),this.enableBtnOk=n}onSelectChannel(){this.enableBtnOk=this.hasSelectedChannel()}hasSelectedChannel(){return-1!==this.channelOptions.findIndex(n=>n.Selected)}onClose(){this.dialogRef.close("CANCEL")}onSave(){if(!this.validateSelectedCategory())return void this.toastrService.warning("Category is required","Warning!");const n=this.channelOptions.filter(e=>e.Selected).map(e=>({CategoryID:e.CategoryID,ChannelID:e.ID}));this.dialogRef.close(n)}validateSelectedCategory(){return-1==this.channelOptions.filter(e=>e.Selected).filter(e=>e.TypeID==h.x.Tokopedia).findIndex(e=>0==e.CategoryID)}getChannelCategory(n){let e;switch(n){case h.x.ShopeeV2:e="Aksesoris Fashion";break;case h.x.Tiktok:e="Aksesoris Fashion - Aksesoris Pakaian";break;case h.x.WooCommerce:e="New Product";break;case h.x.Lazada:e="Fashion Accessories / Women Accessories / Others";break;default:e="Unavailable Category"}return e}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}}return(i=r).\u0275fac=function(n){return new(n||i)(t.Y36(_.WI),t.Y36(nt),t.Y36(_.so),t.Y36(I._W))},i.\u0275cmp=t.Xpm({type:i,selectors:[["app-modal-uploadMultiple-product"]],decls:15,vars:3,consts:[[3,"dynamicValidated","config","onOk","onClose","onCancel"],["content",""],[1,"table"],[1,"text-center",2,"width","6%"],["type","checkbox",3,"change"],[2,"width","30%"],[1,"fs-6"],[2,"width","60%"],[4,"ngFor","ngForOf"],[1,"text-center"],["type","checkbox",3,"ngModel","ngModelChange"],[1,"d-flex","align-items-center"],["alt","",1,"channel-logo-size",3,"src"],[1,"ms-3","fs-6"],[4,"ngIf","ngIfElse"],["EMPTY",""],["bindValue","Key","bindLabel","Value","width","100%","parent","body","position","top","placeholder","Select Category",3,"items","clearable","selectedChange"],["matTooltip","Product Category is Harcoded, Please Change Product Category in Seller Center","matTooltipPosition","above","matTooltipClass","custom-width-tooltip"],["type","text","disabled","",1,"form-control","rounded",2,"height","40px",3,"placeholder"]],template:function(n,e){1&n&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return e.onSave()})("onClose",function(){return e.onClose()})("onCancel",function(){return e.onClose()}),t.TgZ(1,"div",1)(2,"table",2)(3,"thead")(4,"tr")(5,"th",3)(6,"input",4),t.NdJ("change",function(l){return e.onSelectAllChannel(l.target.checked)}),t.qZA()(),t.TgZ(7,"th",5)(8,"span",6),t._uU(9,"CHANNEL"),t.qZA()(),t.TgZ(10,"th",7)(11,"span",6),t._uU(12,"CATEGORY"),t.qZA()()()(),t.TgZ(13,"tbody"),t.YNc(14,at,13,5,"ng-container",8),t.qZA()()()()),2&n&&(t.Q6J("dynamicValidated",e.enableBtnOk)("config",e.modalConfig),t.xp6(14),t.Q6J("ngForOf",e.channelOptions))},dependencies:[p.sg,p.O5,u.Wl,u.JJ,u.On,M.gM,D.M,et.R],styles:["input[type=checkbox]{width:15px;height:15px}img.channel-logo-size{width:24px;height:24px}table>thead>tr{border-top:none!important;border-left:none!important;border-right:none!important}\n"],encapsulation:2}),r})();var T=c(5993),x=c(4387),C=c(4807),Z=c(8558),k=c(1781),v=c(5439),O=c(8034);function lt(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"button",15),t.NdJ("click",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.onOpenScanDialog())}),t._UZ(1,"i",16),t._uU(2," Scan Channel "),t.qZA()}}function rt(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"button",17),t.NdJ("click",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.onScanMultipleProduct())}),t._UZ(1,"i",16),t._uU(2),t.qZA()}if(2&i){const o=t.oxw();let n;t.xp6(2),t.hij(" Scan (",null==(n=o.productService.selectedProduct(o.products))?null:n.length,") ")}}function ct(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"button",18),t.NdJ("click",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.onUploadMultipleProduct())}),t._UZ(1,"i",19),t._uU(2),t.qZA()}if(2&i){const o=t.oxw();let n;t.xp6(2),t.hij(" Upload (",null==(n=o.productService.selectedProduct(o.products))?null:n.length,") ")}}function st(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"div",20)(1,"app-product-card",21),t.NdJ("onUpload",function(){const a=t.CHM(o).$implicit,l=t.oxw();return t.KtG(l.onUploadToMultipleChannel(a))})("onScan",function(){const a=t.CHM(o).$implicit,l=t.oxw();return t.KtG(l.onScanSingleProduct(a))})("onDescEvent",function(){const a=t.CHM(o).index,l=t.oxw();return t.KtG(l.onOpenDialogVariant(a))})("onCheckBoxChange",function(e){const l=t.CHM(o).$implicit;return t.KtG(l.selected=e)}),t.qZA()()}if(2&i){const o=r.$implicit,n=t.oxw();t.xp6(1),t.Q6J("productId",o.ID)("title",null==o?null:o.Name)("image",null==o?null:o.ThumbnailUrl)("description",(null==o?null:o.Variants.length)>1?(null==o?null:o.Variants.length)+" Variants":null)("channels",n.productService.getChannelProduct(o))("code",n.getVariantCode(null==o?null:o.Variants))("showCheckBox",(null==o?null:o.Channel.length)<n.channelOptions.length)("scanButton",!0)("uploadButton",null==o?null:o.hasUpload)("imageForZoom",null==o?null:o.ImageUrl)}}function dt(i,r){1&i&&(t.ynx(0),t.TgZ(1,"div",22),t._UZ(2,"app-empty-state"),t.qZA(),t.BQk())}function pt(i,r){if(1&i){const o=t.EpF();t.ynx(0),t.TgZ(1,"div",23)(2,"div",24)(3,"app-custom-paginator",25),t.NdJ("next",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.onNextPage())})("previous",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.onPrevPage())}),t.qZA()()(),t.BQk()}if(2&i){const o=t.oxw();t.xp6(3),t.Q6J("filter",o.searchFilter)("totaldata",null==o.products?null:o.products.length)("paginationTotal",o.rowCount)("hasClicked",!0)}}let ht=(()=>{var i;class r{constructor(n,e,a,l){this.http=n,this.toastr=e,this.dialog=a,this.productService=l,this.searchFilter=new F.k,this.products=[],this.rowCount=0,this.getLoaderPage()}getLoaderPage(){this.productService.LoadInPOS().subscribe(n=>{this.channelOptions=n.Options.Channel,this.Categories=n.Options.Categories,this.searchFilter.PageNumber=n.Filter.PageNumber,this.searchFilter.RowCount=n.Filter.RowCount,this.searchFilter.ChannelID=null,this.searchFilter.Category=n.Filter.Category,this.searchFilter.PageSize=100,this.getProducts()})}getProducts(){this.http.post("/api/product/GetInPOS",{PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Category:this.searchFilter.Category,From:this.startDate,To:this.endDate}).subscribe(e=>{this.products=e.Data,this.rowCount=null==e.Total?this.searchFilter.RowCount:e.Total.toString(),this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions)})}onOpenScanDialog(){let n=JSON.parse(JSON.stringify(this.searchFilter));n.ChannelID=s.g.GuidEMpty,this.dialog.open(m.j,{data:{filter:n,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe((0,g.h)(a=>s.g.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ChannelID=a.ChannelID,this.searchFilter.ScanFull=a.ScanFull,this.searchFilter.UpdatedProduct=a.UpdatedProduct,this.searchFilter.Async=a.Async,this.scanAllProduct()})}scanAllProduct(){null!=this.searchFilter.ChannelID?this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(n=>{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(n,e,!this.searchFilter.UpdatedProduct)}}):this.toastr.error("Please Select Channel","Error")}onOpenDialogVariant(n){this.dialog.open(q,{data:{title:this.products[n].Name,variants:this.products[n].Variants},width:"800px"})}onUploadMultipleProduct(){let n=this.productService.selectedProduct(this.products),e=this.productService.filterUnselectedChannel(n,this.channelOptions);this.dialog.open(w,{width:"700px",data:{title:"Upload Multiple Product",channels:e}}).afterClosed().pipe((0,g.h)(a=>"CANCEL"!==a),(0,f.w)(a=>this.productService.uploadMultipleProduct(n,a))).subscribe({next:a=>{this.getProducts()}})}onUploadToMultipleChannel(n){let e=this.productService.getChannelProduct(n);n.Channel=e;let a=this.productService.filterUnselectedChannel([n],this.channelOptions);this.dialog.open(w,{width:"700px",data:{title:`Upload - ${n.Name}`,channels:a}}).afterClosed().pipe((0,g.h)(l=>"CANCEL"!==l),(0,f.w)(l=>this.productService.uploadSingleProduct([n],l))).subscribe({next:l=>{this.getProducts()}})}searchProduct(n){this.searchFilter.text=n,this.getProducts()}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPrevPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}onScanMultipleProduct(){let n=JSON.parse(JSON.stringify(this.searchFilter));n.ChannelID=s.g.GuidEMpty;let e=this.productService.filterChannelByTypeId(this.channelOptions,[h.x.Tokopedia,h.x.Tiktok]);this.dialog.open(m.j,{data:{filter:n,channelOptions:e,isSingleChannel:!0},width:"600px"}).afterClosed().pipe((0,g.h)(l=>s.g.IsNotEmpty(l))).subscribe(l=>{this.searchFilter.ChannelID=l.ChannelID,this.searchFilter.ScanFull=l.ScanFull,this.searchFilter.UpdatedProduct=l.UpdatedProduct;let d=this.productService.selectedProduct(this.products),N=this.productService.getVariantCodesProducts(d);this.scanSingleProduct(N)})}onScanSingleProduct(n){let e=JSON.parse(JSON.stringify(this.searchFilter));e.ChannelID=s.g.GuidEMpty,this.dialog.open(m.j,{data:{filter:e,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe((0,g.h)(a=>s.g.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ChannelID=a.ChannelID;const l=this.productService.getVariantCodesProduct(n);this.scanSingleProduct(l)})}scanSingleProduct(n){this.productService.scanSingle(this.searchFilter.ChannelID,n).subscribe({next:e=>{if(e)this.toastr.success("Successfully Scan ","Success");else{let a=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${a?.Name} `,"Error")}this.searchFilter.ChannelID=s.g.GuidEMpty,e&&this.getProducts()},error:e=>{this.searchFilter.ChannelID=s.g.GuidEMpty}})}getVariantCode(n){let e;return n.length>1&&(e=(n[0].model?n[0].model:"")+n[0].Code),1==n.length&&(e=n[0].Code),e}}return(i=r).\u0275fac=function(n){return new(n||i)(t.Y36(S.O),t.Y36(I._W),t.Y36(_.uw),t.Y36(T.M))},i.\u0275cmp=t.Xpm({type:i,selectors:[["app-in-pos"]],decls:26,vars:13,consts:[["description","All products which is already available in POS",3,"headerTitle","onSubmit"],["type","button","data-cy","scanSoldinChannel","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-2",3,"click",4,"ngIf"],["class","btn btn-light shadow rounded ms-2",3,"click",4,"ngIf"],[1,"d-flex"],["container",""],["bindLabel","Name","name","Name","bindValue","Name","placeholder","Select Category",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModel","ngModelChange","click"],["matEndDate","","placeholder","End date",3,"ngModel","ngModelChange","click"],["picker",""],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[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,"productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","onUpload","onScan","onDescEvent","onCheckBoxChange"],[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,"filter","totaldata","paginationTotal","hasClicked","next","previous"]],template:function(n,e){if(1&n){const a=t.EpF();t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(d){return e.searchProduct(d)}),t.TgZ(1,"actions"),t.YNc(2,lt,3,0,"button",1),t.YNc(3,rt,3,1,"button",2),t.YNc(4,ct,3,1,"button",3),t.qZA(),t.TgZ(5,"filters")(6,"div",4)(7,"div",5)(8,"div")(9,"h6"),t._uU(10,"Category "),t.qZA(),t.TgZ(11,"ng-select",6),t.NdJ("ngModelChange",function(d){return e.searchFilter.Category=d}),t.qZA()(),t.TgZ(12,"div")(13,"h6"),t._uU(14,"Release"),t.qZA(),t.TgZ(15,"mat-date-range-input",7)(16,"input",8),t.NdJ("ngModelChange",function(d){return e.startDate=d})("click",function(){t.CHM(a);const d=t.MAs(19);return t.KtG(d.open())}),t.qZA(),t.TgZ(17,"input",9),t.NdJ("ngModelChange",function(d){return e.endDate=d})("click",function(){t.CHM(a);const d=t.MAs(19);return t.KtG(d.open())}),t.qZA()(),t._UZ(18,"mat-date-range-picker",null,10),t.qZA()()()(),t.TgZ(20,"content")(21,"div",11)(22,"div",12),t.YNc(23,st,2,10,"div",13),t.YNc(24,dt,3,0,"ng-container",14),t.qZA(),t.YNc(25,pt,4,4,"ng-container",14),t.qZA()()()}if(2&n){const a=t.MAs(19);t.Q6J("headerTitle","In POS ("+e.rowCount+")"),t.xp6(2),t.Q6J("ngIf",!e.productService.hasSelection(e.products)),t.xp6(1),t.Q6J("ngIf",e.productService.hasSelection(e.products)),t.xp6(1),t.Q6J("ngIf",e.productService.hasSelection(e.products)),t.xp6(7),t.Q6J("clearable",!0)("items",e.Categories)("ngModel",e.searchFilter.Category),t.xp6(4),t.Q6J("rangePicker",a),t.xp6(1),t.Q6J("ngModel",e.startDate),t.xp6(1),t.Q6J("ngModel",e.endDate),t.xp6(6),t.Q6J("ngForOf",e.products),t.xp6(1),t.Q6J("ngIf",0==e.products.length),t.xp6(1),t.Q6J("ngIf",e.products.length>0)}},dependencies:[p.sg,p.O5,u.Fj,u.JJ,u.On,x.p,C.w9,Z.y,k.Y,v.s,O.wx,O.zY,O.By,O._g],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}"]}),r})();function ut(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"button",13),t.NdJ("click",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.onOpenScanDialog())}),t._UZ(1,"i",14),t._uU(2," Scan Channel "),t.qZA()}}function gt(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"button",15),t.NdJ("click",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.onScanMultipleProduct())}),t._UZ(1,"i",14),t._uU(2),t.qZA()}if(2&i){const o=t.oxw();t.xp6(2),t.hij(" Scan (",o.productService.selectedProduct(o.products).length,") ")}}function _t(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"button",16),t.NdJ("click",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.onUploadMultipleProduct())}),t._UZ(1,"i",17),t._uU(2),t.qZA()}if(2&i){const o=t.oxw();t.xp6(2),t.hij(" Upload (",o.productService.selectedProduct(o.products).length,") ")}}function mt(i,r){if(1&i&&(t.TgZ(0,"span",18),t._UZ(1,"img",19),t.qZA(),t._uU(2)),2&i){const o=r.item,n=t.oxw();t.xp6(1),t.Q6J("src",n.getChannelLogo(o.TypeID),t.LSH),t.xp6(1),t.hij(" ",o.Name," ")}}function Ct(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"div")(1,"h6"),t._uU(2,"Item ID"),t.qZA(),t.TgZ(3,"input",20),t.NdJ("ngModelChange",function(e){t.CHM(o);const a=t.oxw();return t.KtG(a.searchFilter.Item_id=e)}),t.qZA()()}if(2&i){const o=t.oxw();t.xp6(3),t.Q6J("ngModel",o.searchFilter.Item_id)}}function ft(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"div",21)(1,"app-product-card",22),t.NdJ("onUpload",function(){const a=t.CHM(o).$implicit,l=t.oxw();return t.KtG(l.onUploadToMultipleChannel(a))})("onDescEvent",function(){const a=t.CHM(o).index,l=t.oxw();return t.KtG(l.onOpenVariantDetail(a))})("onScan",function(){const a=t.CHM(o).$implicit,l=t.oxw();return t.KtG(l.onScanSingleProduct(a))})("onCheckBoxChange",function(e){const l=t.CHM(o).$implicit;return t.KtG(l.selected=e)}),t.qZA()()}if(2&i){const o=r.$implicit,n=t.oxw();t.xp6(1),t.Q6J("productId",null==o?null:o.ID)("title",null==o?null:o.Name)("image",null==o?null:o.ThumbnailUrl)("description",(null==o||null==o.Variants?null:o.Variants.length)>1?(null==o||null==o.Variants?null:o.Variants.length)+" Variants":null)("channels",n.productService.getChannelProduct(o))("code",n.getVariantCode(null==o?null:o.Variants))("showCheckBox",null==o?null:o.hasScan)("scanButton",!0)("uploadButton",null==o?null:o.hasUpload)("imageForZoom",null==o?null:o.ImageUrl)}}function xt(i,r){1&i&&(t.ynx(0),t.TgZ(1,"div",23),t._UZ(2,"app-empty-state"),t.qZA(),t.BQk())}function Pt(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"div",24)(1,"div",25)(2,"app-custom-paginator",26),t.NdJ("total",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.getRowCount())})("next",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.onNextPage())})("previous",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.onPreviousPage())}),t.qZA()()()}if(2&i){const o=t.oxw();t.xp6(2),t.Q6J("filter",o.searchFilter)("totaldata",null==o.products?null:o.products.length)("paginationTotal",o.rowCount)("hasClicked",o.hasClickRowCount)}}let bt=(()=>{var i;class r{constructor(n,e,a,l,d){this.http=n,this.dialog=e,this.toastr=a,this.productService=l,this.activateRouter=d,this.searchFilter=new F.k,this.products=[],this.rowCount=0,this.hasClickRowCount=!1,this.guidEmpty=s.g.GuidEMpty}ngOnInit(){this.activateRouter.queryParams.subscribe(n=>{this.initPageLoader(n.ID?n.ID:s.g.GuidEMpty)})}initPageLoader(n){this.productService.loader(n).subscribe(e=>{this.channelOptions=e.Options.Channel,this.searchFilter=e.Filter,e.Filter.ChannelID!=s.g.GuidEMpty&&(this.searchFilter.ListChannelID=[],this.searchFilter.ListChannelID.push(e.Filter.ChannelID)),this.searchFilter.PageSize=e.Filter.RowCount,this.searchFilter.Item_id="",this.getProducts()})}getProducts(){this.productService.findAllSoldInChannel({ListChannelID:this.searchFilter.ListChannelID,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Item_id:this.searchFilter.Item_id}).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(n){this.searchFilter.text=n,this.hasClickRowCount=!1,this.getProducts()}onOpenVariantDetail(n){this.dialog.open(q,{data:{variants:this.products[n].Variants,title:this.products[n].Name},width:"800px"})}onOpenScanDialog(){let n=JSON.parse(JSON.stringify(this.searchFilter));n.ChannelID=s.g.GuidEMpty,this.dialog.open(m.j,{data:{filter:n,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe((0,g.h)(a=>s.g.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ChannelID=a.ChannelID,this.searchFilter.ScanFull=a.ScanFull,this.searchFilter.UpdatedProduct=a.UpdatedProduct,this.searchFilter.Async=a.Async,this.scanAllProduct()})}scanAllProduct(){let n=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).pipe((0,g.h)(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,n,!this.searchFilter.UpdatedProduct),this.initPageLoader(s.g.GuidEMpty))})}onScanSingleProduct(n){n.Channel=this.productService.getChannelProduct(n);let e=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(m.j,{data:{filter:e,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe((0,g.h)(a=>s.g.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ChannelID=a.ChannelID;const l=this.productService.getVariantCodesProduct(n);this.scanProducts(l)})}onUploadToMultipleChannel(n){let e=this.productService.getChannelProduct(n);n.Channel=e;let a=this.productService.filterUnselectedChannel([n],this.channelOptions);this.dialog.open(w,{width:"700px",data:{title:`Upload - ${n.Name}`,channels:a}}).afterClosed().pipe((0,g.h)(l=>"CANCEL"!==l),(0,f.w)(l=>this.productService.uploadSingleProduct([n],l))).subscribe({next:l=>{this.getProducts()}})}onScanMultipleProduct(){let n=this.productService.filterChannelByTypeId(this.channelOptions,[h.x.Tokopedia,h.x.Tiktok]);this.searchFilter.ChannelID=s.g.GuidEMpty;let e=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(m.j,{data:{filter:e,channelOptions:n,isSingleChannel:!0},width:"600px"}).afterClosed().pipe((0,g.h)(l=>s.g.IsNotEmpty(l))).subscribe(l=>{this.searchFilter.ChannelID=l.ChannelID,this.searchFilter.ScanFull=l.ScanFull,this.searchFilter.UpdatedProduct=l.UpdatedProduct;let d=this.productService.selectedProduct(this.products),N=this.productService.getVariantCodesProducts(d);this.scanProducts(N)})}scanProducts(n){this.productService.scanSingle(this.searchFilter.ChannelID,n).subscribe({next:e=>{let a=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);e?this.toastr.success(`Product Successfully scan with ${a?.Name}`,"Success"):this.toastr.error(`This product is not existed in ${a?.Name} `,"Error"),this.searchFilter.ChannelID=s.g.GuidEMpty,e&&this.getProducts()},error:e=>{this.searchFilter.ChannelID=s.g.GuidEMpty}})}getVariantCode(n){let e;return n.length>1&&(e=(n[0].model?n[0].model:"")+n[0].Code),1==n.length&&(e=n[0].Code),e}onClearFilterChannel(){this.searchFilter.ChannelID=s.g.GuidEMpty,this.searchFilter.Item_id=""}onUploadMultipleProduct(){let n=this.productService.selectedProduct(this.products),e=this.productService.filterUnselectedChannel(n,this.channelOptions);this.dialog.open(w,{width:"700px",data:{title:"Upload Multiple Product",channels:e}}).afterClosed().pipe((0,g.h)(a=>"CANCEL"!==a),(0,f.w)(a=>this.productService.uploadMultipleProduct(n,a))).subscribe({next:a=>{this.getProducts()}})}getRowCount(){this.http.post("/api/product/GetSoldInChannelRowCount",{ListChannelID:this.searchFilter.ListChannelID,text:this.searchFilter.text}).subscribe(e=>{this.hasClickRowCount=!0,this.rowCount=e.Total})}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPreviousPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}getChannelLogo(n){return s.g.getChannelLogoByTypeId(n)}}return(i=r).\u0275fac=function(n){return new(n||i)(t.Y36(S.O),t.Y36(_.uw),t.Y36(I._W),t.Y36(T.M),t.Y36(P.gz))},i.\u0275cmp=t.Xpm({type:i,selectors:[["app-sold-in-channel"]],decls:20,vars:12,consts:[["description","SKU has been mapped between dealpos and marketplace",3,"headerTitle","onSubmit"],["type","button","data-cy","scanSoldinChannel","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-2",3,"click",4,"ngIf"],["class","btn btn-light shadow rounded ms-2",3,"click",4,"ngIf"],[1,"d-flex"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","multiple","items","ngModel","ngModelChange","clear"],["ng-option-tmp",""],[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","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"],["alt","",2,"width","18px",3,"src"],["type","text","name","Item_id","id","Item_id",1,"form-control",3,"ngModel","ngModelChange"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","onUpload","onDescEvent","onScan","onCheckBoxChange"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"filter","totaldata","paginationTotal","hasClicked","total","next","previous"]],template:function(n,e){1&n&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(l){return e.searchProduct(l)}),t.TgZ(1,"actions"),t.YNc(2,ut,3,0,"button",1),t.YNc(3,gt,3,1,"button",2),t.YNc(4,_t,3,1,"button",3),t.qZA(),t.TgZ(5,"filters")(6,"div",4)(7,"div",5)(8,"div")(9,"h6"),t._uU(10,"Channel"),t.qZA(),t.TgZ(11,"ng-select",6),t.NdJ("ngModelChange",function(l){return e.searchFilter.ListChannelID=l})("clear",function(){return e.onClearFilterChannel()}),t.YNc(12,mt,3,2,"ng-template",7),t.qZA()(),t.YNc(13,Ct,4,1,"div",8),t.qZA()()(),t.TgZ(14,"content")(15,"div",9)(16,"div",10),t.YNc(17,ft,2,10,"div",11),t.YNc(18,xt,3,0,"ng-container",8),t.qZA(),t.YNc(19,Pt,3,4,"div",12),t.qZA()()()),2&n&&(t.Q6J("headerTitle","Sold in Channel"),t.xp6(2),t.Q6J("ngIf",!e.productService.hasSelection(e.products)),t.xp6(1),t.Q6J("ngIf",e.productService.hasSelection(e.products)),t.xp6(1),t.Q6J("ngIf",e.productService.hasSelection(e.products)),t.xp6(7),t.Q6J("clearable",!0)("multiple",!0)("items",e.channelOptions)("ngModel",e.searchFilter.ListChannelID),t.xp6(2),t.Q6J("ngIf",null!=e.searchFilter.ListChannelID),t.xp6(4),t.Q6J("ngForOf",e.products),t.xp6(1),t.Q6J("ngIf",0==e.products.length),t.xp6(1),t.Q6J("ngIf",null==e.products?null:e.products.length))},dependencies:[p.sg,p.O5,u.Fj,u.JJ,u.On,x.p,C.w9,C.ir,Z.y,k.Y,v.s],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}"]}),r})();var y=c(4575),St=c(9397),It=c(7398),Tt=c(8695),vt=c(278);function yt(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"button",10),t.NdJ("click",function(){t.CHM(o);const e=t.oxw(2);return t.KtG(e.uploadMultipleProduct())}),t._UZ(1,"i",11),t._uU(2),t.qZA()}if(2&i){const o=t.oxw(2);t.xp6(2),t.hij(" upload (",null==o.selectedProducts?null:o.selectedProducts.length,") ")}}function Mt(i,r){if(1&i){const o=t.EpF();t.ynx(0),t.TgZ(1,"td",27)(2,"input",28),t.NdJ("ngModelChange",function(e){t.CHM(o);const a=t.oxw(2).$implicit;return t.KtG(a.selected=e)})("ngModelChange",function(){t.CHM(o);const e=t.oxw(3).ngIf,a=t.oxw(3);return t.KtG(a.onSelectProduct(e))}),t.qZA()(),t.BQk()}if(2&i){const o=t.oxw(2).$implicit;t.xp6(1),t.Q6J("rowSpan",null==o?null:o.Variants.length),t.xp6(1),t.Q6J("ngModel",o.selected)}}function wt(i,r){if(1&i){const o=t.EpF();t.ynx(0),t.TgZ(1,"img",34),t.NdJ("click",function(e){t.CHM(o);const a=t.oxw(3).$implicit,l=t.oxw(4);return t.KtG(l.onZoomImage(e,null==a?null:a.ImageUrl))}),t.qZA(),t.BQk()}if(2&i){const o=t.oxw(3).$implicit;t.xp6(1),t.Q6J("src",null==o?null:o.ImageUrl,t.LSH)}}function Zt(i,r){1&i&&t._UZ(0,"img",35)}function Ot(i,r){if(1&i&&(t.ynx(0),t.TgZ(1,"td",27)(2,"div",29),t.YNc(3,wt,2,1,"ng-container",7),t.YNc(4,Zt,1,0,"ng-template",null,30,t.W1O),t.qZA()(),t.TgZ(6,"td",31)(7,"h4",32)(8,"span",33),t._uU(9),t.qZA()()(),t.BQk()),2&i){const o=t.MAs(5),n=t.oxw(2).$implicit;t.xp6(1),t.Q6J("rowSpan",null==n?null:n.Variants.length),t.xp6(2),t.Q6J("ngIf",null==n?null:n.ImageUrl)("ngIfElse",o),t.xp6(3),t.Q6J("rowSpan",null==n?null:n.Variants.length),t.xp6(2),t.Q6J("matTooltip",(null==n||null==n.Name?null:n.Name.length)>50?null==n?null:n.Name:""),t.xp6(1),t.hij(" ",null==n?null:n.Name," ")}}function Nt(i,r){if(1&i&&(t.TgZ(0,"div")(1,"a",23),t._UZ(2,"img",36),t.qZA()()),2&i){const o=r.$implicit;t.xp6(1),t.Q6J("href",o.URL,t.LSH),t.xp6(1),t.Q6J("src",o.Img,t.LSH)("matTooltip",o.Name)}}function Ft(i,r){if(1&i&&(t.TgZ(0,"div"),t._UZ(1,"img",36),t.qZA()),2&i){const o=r.$implicit;t.xp6(1),t.Q6J("src",o.Img,t.LSH)("matTooltip",o.Name)}}function At(i,r){if(1&i&&(t.TgZ(0,"tr"),t.YNc(1,Mt,3,2,"ng-container",20),t.YNc(2,Ot,10,6,"ng-container",20),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td")(6,"span"),t._uU(7),t.qZA(),t.TgZ(8,"span",22)(9,"a",23),t._UZ(10,"i",24),t.qZA()()(),t.TgZ(11,"td",25)(12,"div",26),t.YNc(13,Nt,3,3,"div",21),t.qZA()(),t.TgZ(14,"td",25)(15,"div",26),t.YNc(16,Ft,2,2,"div",21),t.qZA()()()),2&i){const o=r.$implicit,n=r.index,e=t.oxw(5);t.xp6(1),t.Q6J("ngIf",0==n),t.xp6(1),t.Q6J("ngIf",0==n),t.xp6(2),t.hij(" ",o.Name," "),t.xp6(3),t.hij(" ",o.Code," "),t.xp6(2),t.Q6J("href","https://"+e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(null==o?null:o.ID),t.LSH),t.xp6(4),t.Q6J("ngForOf",null==o?null:o.Available),t.xp6(3),t.Q6J("ngForOf",null==o?null:o.NotAvailable)}}function kt(i,r){if(1&i&&(t.ynx(0),t.YNc(1,At,17,7,"tr",21),t.BQk()),2&i){const o=r.$implicit;t.xp6(1),t.Q6J("ngForOf",o.Variants)}}function Ut(i,r){if(1&i&&(t.TgZ(0,"tbody"),t.YNc(1,kt,2,1,"ng-container",21),t.qZA()),2&i){const o=r.ngIf;t.xp6(1),t.Q6J("ngForOf",o)}}function Dt(i,r){if(1&i&&(t.ynx(0),t.TgZ(1,"div",12)(2,"table",13)(3,"thead",14)(4,"tr"),t._UZ(5,"th",15),t.TgZ(6,"th",16),t._uU(7,"Product"),t.qZA(),t.TgZ(8,"th",17),t._uU(9,"Variant"),t.qZA(),t.TgZ(10,"th",17),t._uU(11,"SKU"),t.qZA(),t.TgZ(12,"th",18),t._uU(13,"Available In"),t.qZA(),t.TgZ(14,"th",19),t._uU(15,"Not Available In"),t.qZA()()(),t.YNc(16,Ut,2,1,"tbody",20),t.ALo(17,"async"),t.qZA()(),t.BQk()),2&i){const o=t.oxw(2);t.xp6(16),t.Q6J("ngIf",t.lcZ(17,1,o.data$))}}function Jt(i,r){1&i&&(t.TgZ(0,"div",37),t._UZ(1,"app-empty-state"),t.qZA())}function Lt(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"span",45),t.NdJ("click",function(){t.CHM(o);const e=t.oxw(3);return t.KtG(e.getRowCount())}),t.TgZ(1,"i",46),t._uU(2,"?"),t.qZA()()}}function Qt(i,r){if(1&i&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&i){const o=r.ngIf;t.xp6(1),t.Oqu(t.lcZ(2,1,null==o?null:o.Count))}}function qt(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"a",47),t.NdJ("click",function(){t.CHM(o);const e=t.oxw(3);return t.KtG(e.onNextPage())}),t._UZ(1,"i",48),t._uU(2," Next"),t.qZA()}}function Et(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"a",49),t.NdJ("click",function(){t.CHM(o);const e=t.oxw(3);return t.KtG(e.onLastPage())}),t._UZ(1,"i",50),t._uU(2," Last"),t.qZA()}}function Yt(i,r){if(1&i&&(t.TgZ(0,"div",38)(1,"div",39)(2,"div",40),t._uU(3),t.ALo(4,"number"),t.YNc(5,Lt,3,0,"span",41),t.YNc(6,Qt,3,3,"span",20),t.ALo(7,"async"),t._uU(8),t.qZA()(),t.TgZ(9,"div",42),t.YNc(10,qt,3,0,"a",43),t.YNc(11,Et,3,0,"a",44),t.qZA()()),2&i){const o=r.ngIf,n=t.oxw(2);t.xp6(3),t.hij(" Showing 1 - ",t.lcZ(4,6,null==o?null:o.length)," of "),t.xp6(2),t.Q6J("ngIf",n.paginationService.hideCount),t.xp6(1),t.Q6J("ngIf",!n.paginationService.hideCount&&t.lcZ(7,8,n.rowCount$)),t.xp6(2),t.hij(" records ~ ",n.paginationService.footerPageNumber," Page "),t.xp6(2),t.Q6J("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage),t.xp6(1),t.Q6J("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage)}}function Bt(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"mainpanel",1),t.NdJ("onSubmit",function(e){t.CHM(o);const a=t.oxw();return t.KtG(a.searchProduct(e))}),t.TgZ(1,"actions"),t.YNc(2,yt,3,1,"button",2),t.TgZ(3,"button",3),t.NdJ("click",function(){const a=t.CHM(o).ngIf,l=t.oxw();return t.KtG(l.openScanDialog(a))}),t._UZ(4,"i",4),t._uU(5," Scan Channel "),t.qZA()(),t.TgZ(6,"content")(7,"div",5)(8,"div",6),t.YNc(9,Dt,18,3,"ng-container",7),t.ALo(10,"async"),t.YNc(11,Jt,2,0,"ng-template",null,8,t.W1O),t.qZA(),t.YNc(13,Yt,12,10,"div",9),t.ALo(14,"async"),t.qZA()()()}if(2&i){const o=t.MAs(12),n=t.oxw();let e;t.Q6J("hideSearchDropdown",!0),t.xp6(2),t.Q6J("ngIf",n.hasSelectionProduct),t.xp6(7),t.Q6J("ngIf",(null==(e=t.lcZ(10,5,n.data$))?null:e.length)>0)("ngIfElse",o),t.xp6(4),t.Q6J("ngIf",t.lcZ(14,7,n.data$))}}let Vt=(()=>{var i;class r{constructor(n,e,a,l,d,N){this.http=n,this.dialog=e,this.toastr=a,this.productService=l,this.paginationService=d,this.biggerPictureService=N,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannelV2",this.hasSelectionProduct=!1,this.selectedProducts=[]}ngOnInit(){this.initPageLoader(),this.iniData(),this.initHostName()}initHostName(){const n=localStorage.getItem("Authorization");this.hostName=JSON.parse(n)?.Host}initPageLoader(){this.paginationService.fetchDataEndpoint=this.notChannelAPI,this.loader$=this.http.post(`api/${this.loaderAPI}`,{}).pipe((0,St.b)(n=>{this.filterSearch=n.Filter,this.paginationService.reloadPagination(n.Filter)}))}iniData(){this.data$=this.paginationService.data$.pipe((0,It.U)(n=>n.map(e=>(e.Variants=e.Variants.map(a=>(a.Available=this.productService.sortChannel(a.Available),a.NotAvailable=this.productService.sortChannel(a.NotAvailable),a.Available=this.assignLogoChannel(a.Available),a.NotAvailable=this.assignLogoChannel(a.NotAvailable),a)),e))))}assignLogoChannel(n){return n.map(e=>(e.Img=s.g.getChannelLogoByTypeId(e.TypeID),e))}searchProduct(n){this.filterSearch.text=n,this.paginationService.reloadPagination(this.filterSearch)}scanAllProduct(n){let e=this.productService.findChannelById(this.filterSearch.ChannelID,n.Options.Channel);this.productService.scanAll(this.filterSearch.ChannelID,this.filterSearch.ScanFull,this.filterSearch.UpdatedProduct,this.filterSearch.Async).subscribe(a=>{this.filterSearch.Async?this.toastr.success("You will be notified when the scan is completed.","Scan Asynchronous"):(this.productService.successToastrScanAllProduct(a,e,!this.filterSearch.UpdatedProduct),this.initPageLoader())})}openScanDialog(n){let e=JSON.parse(JSON.stringify(this.filterSearch));e.ChannelID=s.g.GuidEMpty,this.dialog.open(m.j,{data:{filter:e,channelOptions:n.Options.Channel},width:"600px"}).afterClosed().pipe((0,g.h)(l=>s.g.IsNotEmpty(l))).subscribe(l=>{this.filterSearch.ChannelID=l.ChannelID,this.filterSearch.ScanFull=l.ScanFull,this.filterSearch.UpdatedProduct=l.UpdatedProduct,this.filterSearch.Async=l.Async,this.scanAllProduct(n)})}getChannelLogoById(n){return s.g.getChannelLogoByTypeId(n)}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:n=>{this.filterSearch.PageNumber=1,this.paginationService.getAllData(this.filterSearch,n.Count)}})}onZoomImage(n,e){this.biggerPictureService.openBiggerPicture(n,e)}onSelectProduct(n){this.hasSelectionProduct=this.productService.hasSelection(n),this.selectedProducts=this.productService.selectedProduct(n)}uploadMultipleProduct(){let n=this.getUniqueChannels();n=n.map(e=>(e.ID=e.ChannelID,e)),this.dialog.open(w,{width:"700px",data:{title:"Upload Multiple Product",channels:n}}).afterClosed().pipe((0,g.h)(e=>"CANCEL"!==e),(0,f.w)(e=>{const a=this.getSelectedProductIds();return this.productService.uploadNotInChannel(a,e)})).subscribe({next:()=>{this.paginationService.reloadPagination(this.filterSearch),this.selectedProducts=[],this.hasSelectionProduct=!1},error:e=>{this.selectedProducts=[],this.hasSelectionProduct=!1}})}getSelectedProductIds(){return this.selectedProducts.map(e=>({ID:e.ProductID}))}getUniqueChannels(){let n=[];return this.selectedProducts.forEach(e=>{n=[...n,...e.Variants[0].NotAvailable]}),n=n.filter((e,a,l)=>l.findIndex(d=>d.ChannelID==e.ChannelID)==a),n}ngOnDestroy(){this.paginationService.destroy()}}return(i=r).\u0275fac=function(n){return new(n||i)(t.Y36(S.O),t.Y36(_.uw),t.Y36(I._W),t.Y36(T.M),t.Y36(Tt.b),t.Y36(vt.k))},i.\u0275cmp=t.Xpm({type:i,selectors:[["app-not-in-channel"]],decls:2,vars:3,consts:[["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,"hideSearchDropdown","onSubmit"],["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,"container-fluid","mt-3"],[1,"row"],[4,"ngIf","ngIfElse"],["EMPTY",""],["class","d-flex justify-content-between mt-5",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,"ngIf"],[4,"ngFor","ngForOf"],[1,"ms-1"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[2,"padding-left","0px"],[1,"d-flex","flex-wrap","mb-1"],[1,"text-center",3,"rowSpan"],["type","checkbox",3,"ngModel","ngModelChange"],[2,"padding-right","0px"],["elsePic",""],[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,"src","click"],["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(n,e){1&n&&(t.YNc(0,Bt,15,9,"mainpanel",0),t.ALo(1,"async")),2&n&&t.Q6J("ngIf",t.lcZ(1,1,e.loader$))},dependencies:[p.sg,p.O5,u.Wl,u.JJ,u.On,x.p,M.gM,v.s,p.Ov,p.JJ],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%}"]}),r})();function Gt(i,r){if(1&i&&(t.TgZ(0,"tr")(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.qZA()()),2&i){const o=r.$implicit;t.xp6(2),t.Oqu(null==o?null:o.Name),t.xp6(2),t.Oqu(null==o?null:o.ChannelVariationSKU)}}let Kt=(()=>{var i;class r{constructor(n,e){this.data=n,this.dialogRef=e}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new U.O,this.modalConfig.title=this.data?.title,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0}}return(i=r).\u0275fac=function(n){return new(n||i)(t.Y36(_.WI),t.Y36(_.so))},i.\u0275cmp=t.Xpm({type:i,selectors:[["app-modal-variants"]],decls:11,vars:2,consts:[[3,"config","onCancel"],["content",""],[1,"table"],[1,"thead-light"],[4,"ngFor","ngForOf"]],template:function(n,e){1&n&&(t.TgZ(0,"modal-material",0),t.NdJ("onCancel",function(){return e.dialogRef.close()}),t.TgZ(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th"),t._uU(6,"Variant"),t.qZA(),t.TgZ(7,"th"),t._uU(8,"SKU"),t.qZA()()(),t.TgZ(9,"tbody"),t.YNc(10,Gt,5,2,"tr",4),t.qZA()()()()),2&n&&(t.Q6J("config",e.modalConfig),t.xp6(10),t.Q6J("ngForOf",e.data.variants))},dependencies:[p.sg,D.M],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}"]}),r})();var J=c(7466);function $t(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"button",14),t.NdJ("click",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.openScanDialog())}),t._UZ(1,"i",15),t._uU(2," Scan Channel "),t.qZA()}}function Ht(i,r){if(1&i){const o=t.EpF();t.ynx(0),t.TgZ(1,"button",16),t.NdJ("click",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.onDownloadAllProduct("SELECTED"))}),t._UZ(2,"i",17),t._uU(3),t.qZA(),t.BQk()}if(2&i){const o=t.oxw();let n;t.xp6(3),t.hij(" Download (",null==(n=o.productService.selectedProduct(o.products))?null:n.length,") ")}}function Rt(i,r){if(1&i&&(t.TgZ(0,"span",18),t._UZ(1,"img",19),t.qZA(),t._uU(2)),2&i){const o=r.item,n=t.oxw();t.xp6(1),t.Q6J("src",n.getChannelLogo(o.TypeID),t.LSH),t.xp6(1),t.hij(" ",o.Name," ")}}const jt=function(i){return[i]},zt=function(){return[]};function Wt(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"div",20)(1,"app-product-card",21),t.NdJ("onCheckBoxChange",function(e){const l=t.CHM(o).index,d=t.oxw();return t.KtG(d.onSelectProduct(e,l))})("onDescEvent",function(){const a=t.CHM(o).index,l=t.oxw();return t.KtG(l.onShowVariantDetail(a))})("onDownload",function(){const a=t.CHM(o).$implicit,l=t.oxw();return t.KtG(l.onDownloadProduct(a))})("onScan",function(){const a=t.CHM(o).$implicit,l=t.oxw();return t.KtG(l.onScanChannel(a))}),t.qZA()()}if(2&i){const o=r.$implicit;t.xp6(1),t.Q6J("showRedirectIcon",!1)("title",null==o?null:o.Name)("image",null==o?null:o.Image)("imageForZoom",null==o?null:o.Image)("code",null==o?null:o.SKU)("description",(null==o||null==o.Variant?null:o.Variant.length)>0?(null==o||null==o.Variant?null:o.Variant.length)+" Variants":null)("downloadButton",!0)("channels",null!=o&&o.Channel?t.VKq(10,jt,null==o?null:o.Channel):t.DdM(12,zt))("showCheckBox",!0)("scanButton",!0)}}function Xt(i,r){1&i&&(t.ynx(0),t.TgZ(1,"div",22),t._UZ(2,"app-empty-state"),t.qZA(),t.BQk())}function tn(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"div",23)(1,"div",24)(2,"app-custom-paginator",25),t.NdJ("total",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.getRowCount())})("next",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.onNextPage())})("previous",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.onPreviousPage())}),t.qZA()()()}if(2&i){const o=t.oxw();t.xp6(2),t.Q6J("filter",o.searchFilter)("totaldata",null==o.products?null:o.products.length)("paginationTotal",o.rowCount)("hasClicked",o.hasClickRowCount)}}let nn=(()=>{var i;class r{constructor(n,e,a,l,d){this.http=n,this.dialog=e,this.productService=a,this.toastrService=l,this.activateRouter=d,this.searchFilter=new F.k,this.products=[],this.hasClickRowCount=!1}ngOnInit(){this.activateRouter.queryParams.subscribe(n=>{this.initPageLoader(n.ID?n.ID:s.g.GuidEMpty)})}initPageLoader(n){this.productService.loader(n).subscribe(e=>{this.channelOptions=e.Options.Channel,this.searchFilter=e.Filter,this.searchFilter.PageSize=e.Filter.RowCount,this.getProducts()})}getProducts(){this.http.post("/api/product/GetProductChannelNotPOS",this.searchFilter).subscribe(n=>{this.products=n.Data,this.mapChannelToProduct(),this.setSkuProduct()})}mapChannelToProduct(){this.products=this.products.map(n=>(n.Channel=JSON.parse(JSON.stringify(this.channelOptions.find(e=>e.ID==n.ChannelID))),n)).map(n=>(n.Channel.Url=n.Url,n))}setSkuProduct(){this.products=this.products.map(n=>(n.SKU=0==n?.Variant?.length?s.g.IsNotEmpty(n?.ChannelItemSKU)?n?.ChannelItemSKU:"SKU not assigned":n?.Variant[0]?.ChannelVariationSKU?n?.Variant[0]?.ChannelVariationSKU:"SKU not assigned",n))}onSearch(n){this.searchFilter.text=n,this.hasClickRowCount=!1,this.getProducts()}onClearChannelFilter(){this.searchFilter.ChannelID=s.g.GuidEMpty}onScanAll(){let n=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(s.g.GuidEMpty),this.productService.successToastrScanAllProduct(e,n,!this.searchFilter.UpdatedProduct)),this.searchFilter.ChannelID=s.g.GuidEMpty})}openScanDialog(){let n=JSON.parse(JSON.stringify(this.searchFilter));n.ChannelID=s.g.GuidEMpty,this.dialog.open(m.j,{data:{filter:n,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe((0,g.h)(a=>s.g.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ChannelID=a.ChannelID,this.searchFilter.UpdatedProduct=a.UpdatedProduct,this.searchFilter.ScanFull=a.ScanFull,this.searchFilter.Async=a.Async,this.onScanAll()})}onDownloadAllProduct(n){let e;e="ALL"==n?this.products:this.productService.selectedProduct(this.products),e.length>0&&this.productService.downloadMultipleProduct(e).subscribe({next:()=>{this.getProducts()}})}onSelectProduct(n,e){this.products[e].selected=n}onDownloadProduct(n){confirm(`Are you sure you want to Retrieve product ${n?.Name} from ${n?.Channel.Name} to POS?`)&&this.productService.downloadProduct(n).subscribe({next:()=>{this.getProducts()}})}onScanChannel(n){let e=JSON.parse(JSON.stringify(n));delete e.Channel,this.productService.scanCompareToPos([e]).subscribe(a=>{a.Status?(this.initPageLoader(s.g.GuidEMpty),this.toastrService.success(`product ${n.Name} have been successfully scanned and synchronized with POS`,"Success")):this.toastrService.error(`Product ${n.Name} is not existed in POS`,"Error")})}onShowVariantDetail(n){let e=this.products[n].Variant;e.length>0&&this.dialog.open(Kt,{data:{title:this.products[n].Name,variants:e},width:"30%"})}getRowCount(){let n={ChannelID:this.searchFilter.ChannelID,text:this.searchFilter.text,HaveSku:parseInt(this.searchFilter.HaveSku)};this.http.post("/api/product/GetProductChannelNotPOSRowCount",n).subscribe(e=>{this.hasClickRowCount=!0,this.rowCount=e.Count})}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPreviousPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}getChannelLogo(n){return s.g.getChannelLogoByTypeId(n)}}return(i=r).\u0275fac=function(n){return new(n||i)(t.Y36(S.O),t.Y36(_.uw),t.Y36(T.M),t.Y36(I._W),t.Y36(P.gz))},i.\u0275cmp=t.Xpm({type:i,selectors:[["app-not-in-pos"]],decls:32,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,"d-flex"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange","clear"],["ng-option-tmp",""],["name","haveSKU",1,"form-control","h-100","pt-3","rounded",3,"ngModel","ngModelChange"],[1,"me-5",3,"value"],["type","text","name","Item_id","id","Item_id","placeholder","item id",1,"form-control",3,"ngModel","ngModelChange"],[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"],["alt","",2,"width","18px",3,"src"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"showRedirectIcon","title","image","imageForZoom","code","description","downloadButton","channels","showCheckBox","scanButton","onCheckBoxChange","onDescEvent","onDownload","onScan"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"filter","totaldata","paginationTotal","hasClicked","total","next","previous"]],template:function(n,e){1&n&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(l){return e.onSearch(l)}),t.TgZ(1,"actions"),t.YNc(2,$t,3,0,"button",1),t.YNc(3,Ht,4,1,"ng-container",2),t.qZA(),t.TgZ(4,"filters")(5,"div",3)(6,"div",4)(7,"div")(8,"h6"),t._uU(9,"Channel"),t.qZA(),t.TgZ(10,"ng-select",5),t.NdJ("ngModelChange",function(l){return e.searchFilter.ChannelID=l})("clear",function(){return e.onClearChannelFilter()}),t.YNc(11,Rt,3,2,"ng-template",6),t.qZA()(),t.TgZ(12,"div")(13,"h6"),t._uU(14,"SKU Assigned"),t.qZA(),t.TgZ(15,"mat-radio-group",7),t.NdJ("ngModelChange",function(l){return e.searchFilter.HaveSku=l}),t.TgZ(16,"mat-radio-button",8),t._uU(17," All "),t.qZA(),t.TgZ(18,"mat-radio-button",8),t._uU(19," Yes "),t.qZA(),t.TgZ(20,"mat-radio-button",8),t._uU(21," No "),t.qZA()()(),t.TgZ(22,"div")(23,"h6"),t._uU(24,"Item ID"),t.qZA(),t.TgZ(25,"input",9),t.NdJ("ngModelChange",function(l){return e.searchFilter.Item_id=l}),t.qZA()()()()(),t.TgZ(26,"content")(27,"div",10)(28,"div",11),t.YNc(29,Wt,2,13,"div",12),t.YNc(30,Xt,3,0,"ng-container",2),t.qZA(),t.YNc(31,tn,3,4,"div",13),t.qZA()()()),2&n&&(t.xp6(2),t.Q6J("ngIf",!e.productService.hasSelection(e.products)),t.xp6(1),t.Q6J("ngIf",e.productService.hasSelection(e.products)),t.xp6(7),t.Q6J("clearable",!0)("items",e.channelOptions)("ngModel",e.searchFilter.ChannelID),t.xp6(5),t.Q6J("ngModel",e.searchFilter.HaveSku),t.xp6(1),t.Q6J("value",0),t.xp6(2),t.Q6J("value",1),t.xp6(2),t.Q6J("value",2),t.xp6(5),t.Q6J("ngModel",e.searchFilter.Item_id),t.xp6(4),t.Q6J("ngForOf",e.products),t.xp6(1),t.Q6J("ngIf",0==e.products.length),t.xp6(1),t.Q6J("ngIf",(null==e.products?null:e.products.length)>0))},dependencies:[p.sg,p.O5,u.Fj,u.JJ,u.On,x.p,C.w9,C.ir,J.VQ,J.U0,Z.y,k.Y,v.s],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}"]}),r})();var Y=c(208);function en(i,r){if(1&i&&(t.TgZ(0,"span",8),t._UZ(1,"img",9),t.qZA(),t._uU(2)),2&i){const o=r.item,n=t.oxw();t.xp6(1),t.Q6J("src",n.getChannelLogo(o.TypeID),t.LSH),t.xp6(1),t.hij(" ",o.Name," ")}}function on(i,r){if(1&i&&(t.TgZ(0,"div",10),t._UZ(1,"app-duplicate-product-card",11),t.qZA()),2&i){const o=r.$implicit,n=r.index;t.xp6(1),t.Q6J("imageForZoom",o.ImageUrl)("title",o.Name)("code",o.Code)("id",n)("image",o.ThumbnailURL)("channels",o.Channels)}}function an(i,r){1&i&&(t.ynx(0),t.TgZ(1,"div",12),t._UZ(2,"app-empty-state"),t.qZA(),t.BQk())}function ln(i,r){if(1&i){const o=t.EpF();t.ynx(0),t.TgZ(1,"div",13)(2,"div",14)(3,"app-custom-paginator",15),t.NdJ("next",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.onNextPage())})("previous",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.onPrevPage())})("total",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.getRowCount())}),t.qZA()()(),t.BQk()}if(2&i){const o=t.oxw();t.xp6(3),t.Q6J("filter",o.searchFilter)("totaldata",null==o.products?null:o.products.length)("paginationTotal",o.rowCount)("hasClicked",o.hasClickedRowCount)}}let rn=(()=>{var i;class r{constructor(n,e){this.httpService=n,this.productService=e,this.searchFilter=new F.k,this.products=[],this.hasClickedRowCount=!1,this.getPageLoader()}getPageLoader(){this.productService.loader().subscribe(n=>{this.searchFilter=n.Filter,this.searchFilter.PageSize=n.Filter.RowCount,this.channelOptions=n.Options.Channel,this.getProducts()})}getProducts(){this.httpService.post("/api/product/GetDuplicateInChannel",{ListChannelID:this.searchFilter.ListChannelID,RowCount:this.searchFilter.RowCount,PageNumber:this.searchFilter.PageNumber,text:this.searchFilter.text}).subscribe(e=>{this.products=e.Data})}onSearch(n){this.searchFilter.text=n,this.hasClickedRowCount=!1,this.getProducts()}onClearFilter(){this.searchFilter.ChannelID=s.g.GuidEMpty}getChannelLogo(n){return s.g.getChannelLogoByTypeId(n)}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPrevPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}getRowCount(){this.httpService.post("/api/product/GetDuplicateInChannelRowCount",{text:this.searchFilter.text,ChannelID:this.searchFilter.ChannelID}).subscribe(e=>{this.hasClickedRowCount=!0,this.rowCount=e.Total})}}return(i=r).\u0275fac=function(n){return new(n||i)(t.Y36(S.O),t.Y36(T.M))},i.\u0275cmp=t.Xpm({type:i,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",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"multiple","clearable","items","ngModel","ngModelChange","clear"],["ng-option-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,"filter","totaldata","paginationTotal","hasClicked","next","previous","total"]],template:function(n,e){1&n&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(l){return e.onSearch(l)}),t.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),t._uU(5,"Channel"),t.qZA(),t.TgZ(6,"ng-select",2),t.NdJ("ngModelChange",function(l){return e.searchFilter.ListChannelID=l})("clear",function(){return e.onClearFilter()}),t.YNc(7,en,3,2,"ng-template",3),t.qZA()()()(),t.TgZ(8,"content")(9,"div",4)(10,"div",5),t.YNc(11,on,2,6,"div",6),t.YNc(12,an,3,0,"ng-container",7),t.qZA(),t.YNc(13,ln,4,4,"ng-container",7),t.qZA()()()),2&n&&(t.xp6(6),t.Q6J("multiple",!0)("clearable",!0)("items",e.channelOptions)("ngModel",e.searchFilter.ListChannelID),t.xp6(5),t.Q6J("ngForOf",e.products),t.xp6(1),t.Q6J("ngIf",0==(null==e.products?null:e.products.length)),t.xp6(1),t.Q6J("ngIf",(null==e.products?null:e.products.length)>0))},dependencies:[p.sg,p.O5,u.JJ,u.On,x.p,C.w9,C.ir,Y._,Z.y,v.s]}),r})();var cn=c(1476);function sn(i,r){if(1&i&&(t.ynx(0),t._uU(1),t.BQk()),2&i){const o=t.oxw().$implicit;t.xp6(1),t.hij(" ",o.Count," ")}}function dn(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"span",26),t.NdJ("click",function(){t.CHM(o);const e=t.oxw().$implicit,a=t.oxw(2);return t.KtG(a.getLiveProductCount(e.ID,e))}),t._UZ(1,"i",27),t.qZA()}}const pn=function(){return["/menu/products/status/sold-in-channel"]},B=function(i){return{ID:i}},hn=function(){return["/menu/products/status/not-in-pos"]};function un(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"tr")(1,"td"),t._UZ(2,"img",16),t.TgZ(3,"span",17),t._uU(4),t.qZA()(),t.TgZ(5,"td",18),t.YNc(6,sn,2,1,"ng-container",4),t.YNc(7,dn,2,0,"ng-template",null,19,t.W1O),t.qZA(),t.TgZ(9,"td",18)(10,"a",20),t._uU(11),t.ALo(12,"number"),t.qZA()(),t.TgZ(13,"td",18)(14,"a",20),t._uU(15),t.ALo(16,"number"),t.qZA()(),t.TgZ(17,"td"),t._uU(18),t.ALo(19,"date"),t.qZA(),t.TgZ(20,"td")(21,"div",21)(22,"button",22),t.NdJ("click",function(){const a=t.CHM(o).$implicit,l=t.oxw(2);return t.KtG(l.onScanChannel(a))}),t._UZ(23,"i",23),t._uU(24," Scan "),t.qZA(),t.TgZ(25,"button",24),t.NdJ("click",function(){const a=t.CHM(o).$implicit,l=t.oxw(2);return t.KtG(l.onClearCache(a.ID))}),t._UZ(26,"i",25),t._uU(27," Clear "),t.qZA()()()()}if(2&i){const o=r.$implicit,n=t.MAs(8),e=t.oxw(2);t.xp6(2),t.Q6J("src",e.getChannelLogo(o.TypeID),t.LSH),t.xp6(2),t.Oqu(o.Name),t.xp6(2),t.Q6J("ngIf",void 0!==o.Count)("ngIfElse",n),t.xp6(4),t.Q6J("routerLink",t.DdM(18,pn))("queryParams",t.VKq(19,B,o.ID)),t.xp6(1),t.hij(" ",t.lcZ(12,11,o.SoldInChannel)," "),t.xp6(3),t.Q6J("routerLink",t.DdM(21,hn))("queryParams",t.VKq(22,B,o.ID)),t.xp6(1),t.hij(" ",t.lcZ(16,13,o.NotInPOS)," "),t.xp6(3),t.hij("",o.LastSync?t.xi3(19,15,o.LastSync,"dd MMM yyyy HH:mm"):"-"," ")}}function gn(i,r){if(1&i&&(t.ynx(0),t.TgZ(1,"div",6)(2,"table",7)(3,"thead",8)(4,"tr",9)(5,"th"),t._uU(6,"Channel"),t.qZA(),t.TgZ(7,"th",10),t._uU(8,"Live Product"),t.qZA(),t.TgZ(9,"th",11),t._uU(10,"Sold In Channel"),t.qZA(),t.TgZ(11,"th",12),t._uU(12,"Product Not in POS"),t.qZA(),t.TgZ(13,"th",13),t._uU(14,"Last Sync"),t.qZA(),t._UZ(15,"th",14),t.qZA()(),t.TgZ(16,"tbody"),t.YNc(17,un,28,24,"tr",15),t.ALo(18,"async"),t.qZA()()(),t.BQk()),2&i){const o=t.oxw();let n;t.xp6(17),t.Q6J("ngForOf",null==(n=t.lcZ(18,1,o.channels$))?null:n.Data)}}function _n(i,r){1&i&&(t.TgZ(0,"div",28),t._UZ(1,"app-empty-state"),t.qZA())}let mn=(()=>{var i;class r{constructor(n,e,a){this.productService=n,this.toastr=e,this.dialog=a,this.destroy$=new E.x}ngOnInit(){this.setObsProductStatistic(),this.initPageLoader()}initPageLoader(){this.productService.loader().pipe((0,A.R)(this.destroy$)).subscribe(n=>{this.channelOptions=n?.Options?.Channel})}setObsProductStatistic(){this.channels$=this.productService.getProductStatistic()}getLiveProductCount(n,e){this.productService.getTotalProductLive(n).pipe((0,A.R)(this.destroy$)).subscribe(a=>{e.Count=a.Count})}onScanChannel(n){this.dialog.open(m.j,{width:"700px",data:{channelOptions:this.channelOptions,filter:{ChannelID:n.ID},disabledChannelOption:!0}}).afterClosed().pipe((0,g.h)(e=>s.g.IsNotEmpty(e))).subscribe(e=>{this.scanAllProduct(n.ID,e)})}scanAllProduct(n,e){let a=this.productService.findChannelById(n,this.channelOptions);this.productService.scanAll(e.ChannelID,e.ScanFull,e.UpdatedProduct,e.Async).pipe((0,g.h)(l=>l)).subscribe(l=>{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(l,a,!e.UpdatedProduct),this.initPageLoader(),this.setObsProductStatistic())})}onClearCache(n){confirm("Are you sure you want to Clear Cache? This Process will remove your product integration to marketplace")&&this.productService.clearCacheChannel(n).pipe((0,A.R)(this.destroy$)).subscribe(a=>{this.toastr.success("Successfully cleared cache","Success"),this.initPageLoader(),this.setObsProductStatistic()})}getChannelLogo(n){return s.g.getChannelLogoByTypeId(n)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}}return(i=r).\u0275fac=function(n){return new(n||i)(t.Y36(T.M),t.Y36(I._W),t.Y36(_.uw))},i.\u0275cmp=t.Xpm({type:i,selectors:[["app-channel-statistic"]],decls:9,vars:6,consts:[["headerTitle","Products Statistic",3,"hideSearchBox","hideSearchDropdown"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],["EMPTY",""],[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"],["QUESTION",""],[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(n,e){if(1&n&&(t.TgZ(0,"mainpanel",0)(1,"content")(2,"div",1)(3,"div",2)(4,"div",3),t.YNc(5,gn,19,3,"ng-container",4),t.ALo(6,"async"),t.YNc(7,_n,2,0,"ng-template",null,5,t.W1O),t.qZA()()()()()),2&n){const a=t.MAs(8);let l;t.Q6J("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(5),t.Q6J("ngIf",(null==(l=t.lcZ(6,4,e.channels$))||null==l.Data?null:l.Data.length)>0)("ngIfElse",a)}},dependencies:[p.sg,p.O5,x.p,M.gM,P.rH,v.s,p.Ov,p.JJ,p.uU]}),r})();var Cn=c(3680);const fn=[{component:G,path:"",children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:ht,canActivate:[y.a],data:{title:"Products in POS"}},{path:"sold-in-channel",component:bt,canActivate:[y.a],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:Vt,canActivate:[y.a],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:nn,canActivate:[y.a],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:rn,canActivate:[y.a],data:{title:"Duplicate Sku in Channel"}},{path:"channel-statistic",component:mn,canActivate:[y.a],data:{title:"Channel Statistic"}}]}];let xn=(()=>{var i;class r{}return(i=r).\u0275fac=function(n){return new(n||i)},i.\u0275mod=t.oAB({type:i}),i.\u0275inj=t.cJS({imports:[p.ez,u.u5,x.R,M.AV,C.A0,cn.TU,J.Fk,Q.Z,Y._,Z.y,k.Y,P.Bz.forChild(fn),O.FA,Cn.XK]}),r})()}}]);