marketplacepos 2.9.2 → 2.9.3

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([[53],{9053:(xn,$,c)=>{c.r($),c.d($,{StatusModule:()=>Z});var d=c(6895),t=c(4650),H=c(2937),S=c(284);const W=function(){return["/menu/products/download/by-url"]};class O{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 Listed SKU",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"}]}}O.\u0275fac=function(e){return new(e||O)},O.\u0275cmp=t.Xpm({type:O,selectors:[["app-status"]],decls:13,vars:3,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-flex"],[1,"dropdown-item",3,"routerLink"]],template:function(e,n){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)(10,"a",8),t._uU(11,"Download Product By Url"),t.qZA()()()()()(),t._UZ(12,"router-outlet")),2&e&&(t.xp6(3),t.Q6J("Tabs",n.productTabs),t.xp6(7),t.Q6J("routerLink",t.DdM(2,W)))},dependencies:[H.e,S.lC,S.rH]});var E=c(1290),_=c(8231),g=c(5412),s=c(1889),p=c(9694),C=(()=>{return(i=C||(C={})).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",C;var i})(),K=c(6779),N=c(266),V=c(6401);function X(i,e){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 n=t.oxw().$implicit;t.xp6(3),t.hij(" ",null==n?null:n.Model,""),t.xp6(2),t.hij(" ",null==n?null:n.Code,"")}}function tt(i,e){if(1&i&&(t.TgZ(0,"td",11),t._uU(1),t.qZA()),2&i){const n=t.oxw(3).$implicit;t.uIk("rowspan",n.Channel.length),t.xp6(1),t.hij(" ",null==n?null:n.Model,"")}}function nt(i,e){if(1&i&&(t.TgZ(0,"td",11),t._uU(1),t.qZA()),2&i){const n=t.oxw(3).$implicit;t.uIk("rowspan",n.Channel.length),t.xp6(1),t.hij(" ",null==n?null:n.Code,"")}}const et=function(i){return{"is-disabled":i}};function ot(i,e){if(1&i&&(t.TgZ(0,"tr"),t.YNc(1,tt,2,2,"td",14),t.YNc(2,nt,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 n=e.$implicit,o=e.index,a=t.oxw(3);t.xp6(1),t.Q6J("ngIf",0==o),t.xp6(1),t.Q6J("ngIf",0==o),t.xp6(3),t.Q6J("href",n.Url,t.LSH)("title",n.Title),t.xp6(1),t.Q6J("src",a.getChannelLogo(n.TypeID),t.LSH),t.xp6(1),t.Q6J("matTooltip",(null==n||null==n.Name?null:n.Name.length)>55?null==n?null:n.Name:""),t.xp6(1),t.hij(" ",n.Name," "),t.xp6(2),t.Oqu(t.lcZ(11,12,n.Price)),t.xp6(3),t.Oqu(t.lcZ(14,14,n.Inventory)),t.xp6(3),t.Q6J("href",a.getHyperlinkSellerCenter(n),t.LSH)("ngClass",t.VKq(16,et,n.TypeID==a.channelType.KalCare))("matTooltip",n.TypeID!=a.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function it(i,e){if(1&i&&t.YNc(0,ot,20,18,"tr",8),2&i){const n=t.oxw().$implicit;t.Q6J("ngForOf",null==n?null:n.Channel)}}function at(i,e){if(1&i&&(t.ynx(0),t.YNc(1,X,9,2,"ng-container",9),t.YNc(2,it,1,1,"ng-template",null,10,t.W1O),t.BQk()),2&i){const n=e.$implicit,o=t.MAs(3);t.xp6(1),t.Q6J("ngIf",!n.Channel||n.Channel.length<1)("ngIfElse",o)}}class I{constructor(e,n){this.data=e,this.dialogRef=n,this.channelType=p.x,this.variants=e.variants,this.title=e.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new K.O,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideCancel=!0,this.modalConfig.hideOk=!0}getChannelLogo(e){return s.g.getChannelLogoByTypeId(e)}getHyperlinkSellerCenter(e){let n="javascript:void(0)";switch(e.TypeID){case p.x.ShopeeV2:n=`${C.Shoope}/portal/product/${e.ChannelItemID}`;break;case p.x.Tiktok:n=`${C.Tiktok}/product/edit/${e.ChannelItemID}`;break;case p.x.Tokopedia:n=`${C.Tokopedia}/edit-product/${e.ChannelItemID}`;break;case p.x.WooCommerce:n=`${C.WooCommerce}/wp-admin/post.php?post=${e.ChannelItemID}&action=edit`;break;case p.x.Lazada:n=`${C.Lazada}/apps/product/publish?productId=${e.ChannelItemID}`}return n}}I.\u0275fac=function(e){return new(e||I)(t.Y36(g.WI),t.Y36(g.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(e,n){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onCancel",function(){return n.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,at,4,2,"ng-container",8),t.qZA()()()()),2&e&&(t.Q6J("config",n.modalConfig),t.xp6(21),t.Q6J("ngForOf",n.variants))},dependencies:[d.mk,d.sg,d.O5,N.gM,V.M,d.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}"]});var u=c(9300),x=c(3900),R=c(7579),Y=c(2722),lt=c(9646),rt=c(9568),T=c(1318);class y{constructor(e,n){this.LocalData=e,this.httpService=n}getCategoriesByTypeId(e,n){return this.LocalData.getCategoriesByChannelType(e).pipe((0,x.w)(o=>null!=o?(0,lt.of)(o):this._getCategoriesByTypeID(e,n)))}_getCategoriesByTypeID(e,n){return this.httpService.post("/api/Channel/getCategoriesByTypeID",{TypeID:e,ID:n}).pipe((0,x.w)(a=>this.LocalData.saveCategoriesByChannelType(a,e)))}}y.\u0275fac=function(e){return new(e||y)(t.LFG(rt.T),t.LFG(T.O))},y.\u0275prov=t.Yz7({token:y,factory:y.\u0275fac,providedIn:"root"});var v=c(7185),h=c(4006),ct=c(8158);function st(i,e){if(1&i){const n=t.EpF();t.ynx(0),t.TgZ(1,"ng-select-infinite",16),t.NdJ("selectedChange",function(a){t.CHM(n);const l=t.oxw().index,r=t.oxw();return t.KtG(r.onSelectCategory(a,l))}),t.qZA(),t.BQk()}if(2&i){const n=t.oxw().$implicit;t.xp6(1),t.Q6J("items",n.Categories)("clearable",!1)}}function dt(i,e){if(1&i&&(t.TgZ(0,"div",17),t._UZ(1,"input",18),t.qZA()),2&i){const n=t.oxw().$implicit,o=t.oxw();t.xp6(1),t.Q6J("placeholder",o.getChannelCategory(n.TypeID))}}function pt(i,e){if(1&i){const n=t.EpF();t.ynx(0),t.TgZ(1,"tr")(2,"td",9)(3,"input",10),t.NdJ("ngModelChange",function(a){const r=t.CHM(n).$implicit;return t.KtG(r.Selected=a)})("ngModelChange",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.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,st,2,2,"ng-container",14),t.YNc(11,dt,2,1,"ng-template",null,15,t.W1O),t.qZA()(),t.BQk()}if(2&i){const n=e.$implicit,o=t.MAs(12);t.xp6(3),t.Q6J("ngModel",n.Selected),t.xp6(3),t.Q6J("src",n.Img,t.LSH),t.xp6(2),t.Oqu(n.Name),t.xp6(2),t.Q6J("ngIf",n.Categories.length>0)("ngIfElse",o)}}class m{constructor(e,n,o,a){this.data=e,this.channelService=n,this.dialogRef=o,this.toastrService=a,this.channelOptions=[],this.uploadResponse=[],this.channelType=p.x,this.enableBtnOk=!1,this.destroy$=new R.x,this.uploadResponse=[],this.channels=this.data.channels}ngOnInit(){this.initModalConfig(),this.initChannelOptions(),this.initCategories()}initModalConfig(){this.modalConfig=new K.O,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0}initCategories(){this.filterChannelTypeId().forEach(n=>{this.channelService.getCategoriesByTypeId(n.channelType,n.channelId).pipe((0,Y.R)(this.destroy$)).subscribe(o=>{this.setCategoriesChannelOption(n.channelType,o)})})}setCategoriesChannelOption(e,n){this.channelOptions=this.channelOptions.map(o=>(o.TypeID==e&&(o.Categories=n),o))}initChannelOptions(){this.channelOptions=this.channels.map(e=>({Name:e.Name,Img:e.Img,ID:e.ID,Selected:!1,CategoryID:this.initDefaultChannelCategoryId(e.TypeID),TypeID:e.TypeID,Categories:[]}))}initDefaultChannelCategoryId(e){let n=0;return e===p.x.Lazada&&(n=6509),n}filterChannelTypeId(){return this.data.channels.map(n=>({channelType:n.TypeID,channelId:n.ID})).filter((n,o,a)=>a.findIndex(l=>n.channelType==l.channelType)==o).filter(n=>n.channelType==p.x.Tokopedia)}onSelectCategory(e,n){this.channelOptions[n].CategoryID=e,this.channelOptions[n].Selected=!0,this.onSelectChannel()}onSelectAllChannel(e){this.channelOptions=this.channelOptions.map(n=>(n.Selected=e,n)),this.enableBtnOk=e}onSelectChannel(){this.enableBtnOk=this.hasSelectedChannel()}hasSelectedChannel(){return-1!==this.channelOptions.findIndex(e=>e.Selected)}onClose(){this.dialogRef.close("CANCEL")}onSave(){if(!this.validateSelectedCategory())return void this.toastrService.warning("Category is required","Warning!");const e=this.channelOptions.filter(n=>n.Selected).map(n=>({CategoryID:n.CategoryID,ChannelID:n.ID}));this.dialogRef.close(e)}validateSelectedCategory(){return-1==this.channelOptions.filter(n=>n.Selected).filter(n=>n.TypeID==p.x.Tokopedia).findIndex(n=>0==n.CategoryID)}getChannelCategory(e){let n;switch(e){case p.x.ShopeeV2:n="Aksesoris Fashion";break;case p.x.Tiktok:n="Aksesoris Fashion - Aksesoris Pakaian";break;case p.x.WooCommerce:n="New Product";break;case p.x.Lazada:n="Fashion Accessories / Women Accessories / Others";break;default:n="Unavailable Category"}return n}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}}m.\u0275fac=function(e){return new(e||m)(t.Y36(g.WI),t.Y36(y),t.Y36(g.so),t.Y36(v._W))},m.\u0275cmp=t.Xpm({type:m,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(e,n){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return n.onSave()})("onClose",function(){return n.onClose()})("onCancel",function(){return n.onClose()}),t.TgZ(1,"div",1)(2,"table",2)(3,"thead")(4,"tr")(5,"th",3)(6,"input",4),t.NdJ("change",function(a){return n.onSelectAllChannel(a.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,pt,13,5,"ng-container",8),t.qZA()()()()),2&e&&(t.Q6J("dynamicValidated",n.enableBtnOk)("config",n.modalConfig),t.xp6(14),t.Q6J("ngForOf",n.channelOptions))},dependencies:[d.sg,d.O5,h.Wl,h.JJ,h.On,N.gM,V.M,ct.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});var M=c(6082),P=c(7481),f=c(8796),F=c(6732),B=c(6956),b=c(9640),A=c(9602);function ht(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"button",15),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onOpenScanDialog())}),t._UZ(1,"i",16),t._uU(2," Scan Channel "),t.qZA()}}function ut(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"button",17),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onScanMultipleProduct())}),t._UZ(1,"i",16),t._uU(2),t.qZA()}if(2&i){const n=t.oxw();let o;t.xp6(2),t.hij(" Scan (",null==(o=n.productService.selectedProduct(n.products))?null:o.length,") ")}}function gt(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"button",18),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onUploadMultipleProduct())}),t._UZ(1,"i",19),t._uU(2),t.qZA()}if(2&i){const n=t.oxw();let o;t.xp6(2),t.hij(" Upload (",null==(o=n.productService.selectedProduct(n.products))?null:o.length,") ")}}function _t(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"div",20)(1,"app-product-card",21),t.NdJ("onUpload",function(){const l=t.CHM(n).$implicit,r=t.oxw();return t.KtG(r.onUploadToMultipleChannel(l))})("onScan",function(){const l=t.CHM(n).$implicit,r=t.oxw();return t.KtG(r.onScanSingleProduct(l))})("onDescEvent",function(){const l=t.CHM(n).index,r=t.oxw();return t.KtG(r.onOpenDialogVariant(l))})("onCheckBoxChange",function(a){const r=t.CHM(n).$implicit;return t.KtG(r.selected=a)}),t.qZA()()}if(2&i){const n=e.$implicit,o=t.oxw();t.xp6(1),t.Q6J("productId",n.ID)("title",null==n?null:n.Name)("image",null==n?null:n.ThumbnailUrl)("description",(null==n?null:n.Variants.length)>1?(null==n?null:n.Variants.length)+" Variants":null)("channels",o.productService.getChannelProduct(n))("code",o.getVariantCode(null==n?null:n.Variants))("showCheckBox",(null==n?null:n.Channel.length)<o.channelOptions.length)("scanButton",!0)("uploadButton",null==n?null:n.hasUpload)("imageForZoom",null==n?null:n.ImageUrl)}}function mt(i,e){1&i&&(t.ynx(0),t.TgZ(1,"div",22),t._UZ(2,"app-empty-state"),t.qZA(),t.BQk())}function Ct(i,e){if(1&i){const n=t.EpF();t.ynx(0),t.TgZ(1,"div",23)(2,"div",24)(3,"app-custom-paginator",25),t.NdJ("next",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onNextPage())})("previous",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onPrevPage())}),t.qZA()()(),t.BQk()}if(2&i){const n=t.oxw();t.xp6(3),t.Q6J("filter",n.searchFilter)("totaldata",null==n.products?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",!0)}}class k{constructor(e,n,o,a){this.http=e,this.toastr=n,this.dialog=o,this.productService=a,this.searchFilter=new E.k,this.products=[],this.rowCount=0,this.getLoaderPage()}getLoaderPage(){this.productService.LoadInPOS().subscribe(e=>{this.channelOptions=e.Options.Channel,this.Categories=e.Options.Categories,this.searchFilter.PageNumber=e.Filter.PageNumber,this.searchFilter.RowCount=e.Filter.RowCount,this.searchFilter.ChannelID=null,this.searchFilter.Category=e.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(n=>{this.products=n.Data,this.rowCount=null==n.Total?this.searchFilter.RowCount:n.Total.toString(),this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions)})}onOpenScanDialog(){let e=JSON.parse(JSON.stringify(this.searchFilter));e.ChannelID=s.g.GuidEMpty,this.dialog.open(_.j,{data:{filter:e,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe((0,u.h)(o=>s.g.IsNotEmpty(o))).subscribe(o=>{this.searchFilter.ChannelID=o.ChannelID,this.searchFilter.ScanFull=o.ScanFull,this.searchFilter.UpdatedProduct=o.UpdatedProduct,this.searchFilter.Async=o.Async,this.scanAllProduct()})}scanAllProduct(){null!=this.searchFilter.ChannelID?this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(e=>{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 n=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(e,n,!this.searchFilter.UpdatedProduct)}}):this.toastr.error("Please Select Channel","Error")}onOpenDialogVariant(e){this.dialog.open(I,{data:{title:this.products[e].Name,variants:this.products[e].Variants},width:"800px"})}onUploadMultipleProduct(){let e=this.productService.selectedProduct(this.products),n=this.productService.filterUnselectedChannel(e,this.channelOptions);this.dialog.open(m,{width:"700px",data:{title:"Upload Multiple Product",channels:n}}).afterClosed().pipe((0,u.h)(o=>"CANCEL"!==o),(0,x.w)(o=>this.productService.uploadMultipleProduct(e,o))).subscribe({next:o=>{this.getProducts()}})}onUploadToMultipleChannel(e){let n=this.productService.getChannelProduct(e);e.Channel=n;let o=this.productService.filterUnselectedChannel([e],this.channelOptions);this.dialog.open(m,{width:"700px",data:{title:`Upload - ${e.Name}`,channels:o}}).afterClosed().pipe((0,u.h)(a=>"CANCEL"!==a),(0,x.w)(a=>this.productService.uploadSingleProduct([e],a))).subscribe({next:a=>{this.getProducts()}})}searchProduct(e){this.searchFilter.text=e,this.getProducts()}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPrevPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}onScanMultipleProduct(){let e=JSON.parse(JSON.stringify(this.searchFilter));e.ChannelID=s.g.GuidEMpty;let n=this.productService.filterChannelByTypeId(this.channelOptions,[p.x.Tokopedia,p.x.Tiktok]);this.dialog.open(_.j,{data:{filter:e,channelOptions:n,isSingleChannel:!0},width:"600px"}).afterClosed().pipe((0,u.h)(a=>s.g.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ChannelID=a.ChannelID,this.searchFilter.ScanFull=a.ScanFull,this.searchFilter.UpdatedProduct=a.UpdatedProduct;let l=this.productService.selectedProduct(this.products),r=this.productService.getVariantCodesProducts(l);this.scanSingleProduct(r)})}onScanSingleProduct(e){let n=JSON.parse(JSON.stringify(this.searchFilter));n.ChannelID=s.g.GuidEMpty,this.dialog.open(_.j,{data:{filter:n,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe((0,u.h)(o=>s.g.IsNotEmpty(o))).subscribe(o=>{this.searchFilter.ChannelID=o.ChannelID;const a=this.productService.getVariantCodesProduct(e);this.scanSingleProduct(a)})}scanSingleProduct(e){this.productService.scanSingle(this.searchFilter.ChannelID,e).subscribe({next:n=>{if(n)this.toastr.success("Successfully Scan ","Success");else{let o=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${o?.Name} `,"Error")}this.searchFilter.ChannelID=s.g.GuidEMpty,n&&this.getProducts()},error:n=>{this.searchFilter.ChannelID=s.g.GuidEMpty}})}getVariantCode(e){let n;return e.length>1&&(n=(e[0].model?e[0].model:"")+e[0].Code),1==e.length&&(n=e[0].Code),n}}function ft(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"button",13),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onOpenScanDialog())}),t._UZ(1,"i",14),t._uU(2," Scan Channel "),t.qZA()}}function xt(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"button",15),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onScanMultipleProduct())}),t._UZ(1,"i",14),t._uU(2),t.qZA()}if(2&i){const n=t.oxw();t.xp6(2),t.hij(" Scan (",n.productService.selectedProduct(n.products).length,") ")}}function Pt(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"button",16),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onUploadMultipleProduct())}),t._UZ(1,"i",17),t._uU(2),t.qZA()}if(2&i){const n=t.oxw();t.xp6(2),t.hij(" Upload (",n.productService.selectedProduct(n.products).length,") ")}}function bt(i,e){if(1&i&&(t.TgZ(0,"span",18),t._UZ(1,"img",19),t.qZA(),t._uU(2)),2&i){const n=e.item,o=t.oxw();t.xp6(1),t.Q6J("src",o.getChannelLogo(n.TypeID),t.LSH),t.xp6(1),t.hij(" ",n.Name," ")}}function St(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"div")(1,"h6"),t._uU(2,"Item ID"),t.qZA(),t.TgZ(3,"input",20),t.NdJ("ngModelChange",function(a){t.CHM(n);const l=t.oxw();return t.KtG(l.searchFilter.Item_id=a)}),t.qZA()()}if(2&i){const n=t.oxw();t.xp6(3),t.Q6J("ngModel",n.searchFilter.Item_id)}}function It(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"div",21)(1,"app-product-card",22),t.NdJ("onUpload",function(){const l=t.CHM(n).$implicit,r=t.oxw();return t.KtG(r.onUploadToMultipleChannel(l))})("onDescEvent",function(){const l=t.CHM(n).index,r=t.oxw();return t.KtG(r.onOpenVariantDetail(l))})("onScan",function(){const l=t.CHM(n).$implicit,r=t.oxw();return t.KtG(r.onScanSingleProduct(l))})("onCheckBoxChange",function(a){const r=t.CHM(n).$implicit;return t.KtG(r.selected=a)}),t.qZA()()}if(2&i){const n=e.$implicit,o=t.oxw();t.xp6(1),t.Q6J("productId",null==n?null:n.ID)("title",null==n?null:n.Name)("image",null==n?null:n.ThumbnailUrl)("description",(null==n||null==n.Variants?null:n.Variants.length)>1?(null==n||null==n.Variants?null:n.Variants.length)+" Variants":null)("channels",o.productService.getChannelProduct(n))("code",o.getVariantCode(null==n?null:n.Variants))("showCheckBox",null==n?null:n.hasScan)("scanButton",!0)("uploadButton",null==n?null:n.hasUpload)("imageForZoom",null==n?null:n.ImageUrl)}}function Tt(i,e){1&i&&(t.ynx(0),t.TgZ(1,"div",23),t._UZ(2,"app-empty-state"),t.qZA(),t.BQk())}function yt(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"div",24)(1,"div",25)(2,"app-custom-paginator",26),t.NdJ("total",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.getRowCount())})("next",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onNextPage())})("previous",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onPreviousPage())}),t.qZA()()()}if(2&i){const n=t.oxw();t.xp6(2),t.Q6J("filter",n.searchFilter)("totaldata",null==n.products?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}k.\u0275fac=function(e){return new(e||k)(t.Y36(T.O),t.Y36(v._W),t.Y36(g.uw),t.Y36(M.M))},k.\u0275cmp=t.Xpm({type:k,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(e,n){if(1&e){const o=t.EpF();t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(l){return n.searchProduct(l)}),t.TgZ(1,"actions"),t.YNc(2,ht,3,0,"button",1),t.YNc(3,ut,3,1,"button",2),t.YNc(4,gt,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(l){return n.searchFilter.Category=l}),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(l){return n.startDate=l})("click",function(){t.CHM(o);const l=t.MAs(19);return t.KtG(l.open())}),t.qZA(),t.TgZ(17,"input",9),t.NdJ("ngModelChange",function(l){return n.endDate=l})("click",function(){t.CHM(o);const l=t.MAs(19);return t.KtG(l.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,_t,2,10,"div",13),t.YNc(24,mt,3,0,"ng-container",14),t.qZA(),t.YNc(25,Ct,4,4,"ng-container",14),t.qZA()()()}if(2&e){const o=t.MAs(19);t.Q6J("headerTitle","In POS ("+n.rowCount+")"),t.xp6(2),t.Q6J("ngIf",!n.productService.hasSelection(n.products)),t.xp6(1),t.Q6J("ngIf",n.productService.hasSelection(n.products)),t.xp6(1),t.Q6J("ngIf",n.productService.hasSelection(n.products)),t.xp6(7),t.Q6J("clearable",!0)("items",n.Categories)("ngModel",n.searchFilter.Category),t.xp6(4),t.Q6J("rangePicker",o),t.xp6(1),t.Q6J("ngModel",n.startDate),t.xp6(1),t.Q6J("ngModel",n.endDate),t.xp6(6),t.Q6J("ngForOf",n.products),t.xp6(1),t.Q6J("ngIf",0==n.products.length),t.xp6(1),t.Q6J("ngIf",n.products.length>0)}},dependencies:[d.sg,d.O5,h.Fj,h.JJ,h.On,P.p,f.w9,F.y,B.Y,b.s,A.wx,A.zY,A.By,A._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}"]});class U{constructor(e,n,o,a,l){this.http=e,this.dialog=n,this.toastr=o,this.productService=a,this.activateRouter=l,this.searchFilter=new E.k,this.products=[],this.rowCount=0,this.hasClickRowCount=!1,this.guidEmpty=s.g.GuidEMpty}ngOnInit(){this.activateRouter.queryParams.subscribe(e=>{this.initPageLoader(e.ID?e.ID:s.g.GuidEMpty)})}initPageLoader(e){this.productService.loader(e).subscribe(n=>{this.channelOptions=n.Options.Channel,this.searchFilter=n.Filter,n.Filter.ChannelID!=s.g.GuidEMpty&&(this.searchFilter.ListChannelID=[],this.searchFilter.ListChannelID.push(n.Filter.ChannelID)),this.searchFilter.PageSize=n.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(n=>{this.products=n.Data,this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions),this.products=this.productService.checkProductHasScanButton(this.products,this.channelOptions)})}searchProduct(e){this.searchFilter.text=e,this.hasClickRowCount=!1,this.getProducts()}onOpenVariantDetail(e){this.dialog.open(I,{data:{variants:this.products[e].Variants,title:this.products[e].Name},width:"800px"})}onOpenScanDialog(){let e=JSON.parse(JSON.stringify(this.searchFilter));e.ChannelID=s.g.GuidEMpty,this.dialog.open(_.j,{data:{filter:e,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe((0,u.h)(o=>s.g.IsNotEmpty(o))).subscribe(o=>{this.searchFilter.ChannelID=o.ChannelID,this.searchFilter.ScanFull=o.ScanFull,this.searchFilter.UpdatedProduct=o.UpdatedProduct,this.searchFilter.Async=o.Async,this.scanAllProduct()})}scanAllProduct(){let e=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,u.h)(n=>n)).subscribe(n=>{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(n,e,!this.searchFilter.UpdatedProduct),this.initPageLoader(s.g.GuidEMpty))})}onScanSingleProduct(e){e.Channel=this.productService.getChannelProduct(e);let n=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(_.j,{data:{filter:n,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe((0,u.h)(o=>s.g.IsNotEmpty(o))).subscribe(o=>{this.searchFilter.ChannelID=o.ChannelID;const a=this.productService.getVariantCodesProduct(e);this.scanProducts(a)})}onUploadToMultipleChannel(e){let n=this.productService.getChannelProduct(e);e.Channel=n;let o=this.productService.filterUnselectedChannel([e],this.channelOptions);this.dialog.open(m,{width:"700px",data:{title:`Upload - ${e.Name}`,channels:o}}).afterClosed().pipe((0,u.h)(a=>"CANCEL"!==a),(0,x.w)(a=>this.productService.uploadSingleProduct([e],a))).subscribe({next:a=>{this.getProducts()}})}onScanMultipleProduct(){let e=this.productService.filterChannelByTypeId(this.channelOptions,[p.x.Tokopedia,p.x.Tiktok]);this.searchFilter.ChannelID=s.g.GuidEMpty;let n=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(_.j,{data:{filter:n,channelOptions:e,isSingleChannel:!0},width:"600px"}).afterClosed().pipe((0,u.h)(a=>s.g.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ChannelID=a.ChannelID,this.searchFilter.ScanFull=a.ScanFull,this.searchFilter.UpdatedProduct=a.UpdatedProduct;let l=this.productService.selectedProduct(this.products),r=this.productService.getVariantCodesProducts(l);this.scanProducts(r)})}scanProducts(e){this.productService.scanSingle(this.searchFilter.ChannelID,e).subscribe({next:n=>{let o=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);n?this.toastr.success(`Product Successfully scan with ${o?.Name}`,"Success"):this.toastr.error(`This product is not existed in ${o?.Name} `,"Error"),this.searchFilter.ChannelID=s.g.GuidEMpty,n&&this.getProducts()},error:n=>{this.searchFilter.ChannelID=s.g.GuidEMpty}})}getVariantCode(e){let n;return e.length>1&&(n=(e[0].model?e[0].model:"")+e[0].Code),1==e.length&&(n=e[0].Code),n}onClearFilterChannel(){this.searchFilter.ChannelID=s.g.GuidEMpty,this.searchFilter.Item_id=""}onUploadMultipleProduct(){let e=this.productService.selectedProduct(this.products),n=this.productService.filterUnselectedChannel(e,this.channelOptions);this.dialog.open(m,{width:"700px",data:{title:"Upload Multiple Product",channels:n}}).afterClosed().pipe((0,u.h)(o=>"CANCEL"!==o),(0,x.w)(o=>this.productService.uploadMultipleProduct(e,o))).subscribe({next:o=>{this.getProducts()}})}getRowCount(){this.http.post("/api/product/GetSoldInChannelRowCount",{ListChannelID:this.searchFilter.ListChannelID,text:this.searchFilter.text}).subscribe(n=>{this.hasClickRowCount=!0,this.rowCount=n.Total})}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPreviousPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}getChannelLogo(e){return s.g.getChannelLogoByTypeId(e)}}U.\u0275fac=function(e){return new(e||U)(t.Y36(T.O),t.Y36(g.uw),t.Y36(v._W),t.Y36(M.M),t.Y36(S.gz))},U.\u0275cmp=t.Xpm({type:U,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(e,n){1&e&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(a){return n.searchProduct(a)}),t.TgZ(1,"actions"),t.YNc(2,ft,3,0,"button",1),t.YNc(3,xt,3,1,"button",2),t.YNc(4,Pt,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(a){return n.searchFilter.ListChannelID=a})("clear",function(){return n.onClearFilterChannel()}),t.YNc(12,bt,3,2,"ng-template",7),t.qZA()(),t.YNc(13,St,4,1,"div",8),t.qZA()()(),t.TgZ(14,"content")(15,"div",9)(16,"div",10),t.YNc(17,It,2,10,"div",11),t.YNc(18,Tt,3,0,"ng-container",8),t.qZA(),t.YNc(19,yt,3,4,"div",12),t.qZA()()()),2&e&&(t.Q6J("headerTitle","Sold in Channel"),t.xp6(2),t.Q6J("ngIf",!n.productService.hasSelection(n.products)),t.xp6(1),t.Q6J("ngIf",n.productService.hasSelection(n.products)),t.xp6(1),t.Q6J("ngIf",n.productService.hasSelection(n.products)),t.xp6(7),t.Q6J("clearable",!0)("multiple",!0)("items",n.channelOptions)("ngModel",n.searchFilter.ListChannelID),t.xp6(2),t.Q6J("ngIf",null!=n.searchFilter.ListChannelID),t.xp6(4),t.Q6J("ngForOf",n.products),t.xp6(1),t.Q6J("ngIf",0==n.products.length),t.xp6(1),t.Q6J("ngIf",null==n.products?null:n.products.length))},dependencies:[d.sg,d.O5,h.Fj,h.JJ,h.On,P.p,f.w9,f.ir,F.y,B.Y,b.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}"]});var w=c(8063),vt=c(8505),Mt=c(4004),wt=c(9425),Zt=c(1739);function Ot(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"button",10),t.NdJ("click",function(){t.CHM(n);const a=t.oxw(2);return t.KtG(a.uploadMultipleProduct())}),t._UZ(1,"i",11),t._uU(2),t.qZA()}if(2&i){const n=t.oxw(2);t.xp6(2),t.hij(" upload (",null==n.selectedProducts?null:n.selectedProducts.length,") ")}}function Nt(i,e){if(1&i){const n=t.EpF();t.ynx(0),t.TgZ(1,"td",27)(2,"input",28),t.NdJ("ngModelChange",function(a){t.CHM(n);const l=t.oxw(2).$implicit;return t.KtG(l.selected=a)})("ngModelChange",function(){t.CHM(n);const a=t.oxw(3).ngIf,l=t.oxw(3);return t.KtG(l.onSelectProduct(a))}),t.qZA()(),t.BQk()}if(2&i){const n=t.oxw(2).$implicit;t.xp6(1),t.Q6J("rowSpan",null==n?null:n.Variants.length),t.xp6(1),t.Q6J("ngModel",n.selected)}}function Ft(i,e){if(1&i){const n=t.EpF();t.ynx(0),t.TgZ(1,"img",34),t.NdJ("click",function(a){t.CHM(n);const l=t.oxw(3).$implicit,r=t.oxw(4);return t.KtG(r.onZoomImage(a,null==l?null:l.ImageUrl))}),t.qZA(),t.BQk()}if(2&i){const n=t.oxw(3).$implicit;t.xp6(1),t.Q6J("src",null==n?null:n.ImageUrl,t.LSH)}}function At(i,e){1&i&&t._UZ(0,"img",35)}function kt(i,e){if(1&i&&(t.ynx(0),t.TgZ(1,"td",27)(2,"div",29),t.YNc(3,Ft,2,1,"ng-container",7),t.YNc(4,At,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 n=t.MAs(5),o=t.oxw(2).$implicit;t.xp6(1),t.Q6J("rowSpan",null==o?null:o.Variants.length),t.xp6(2),t.Q6J("ngIf",null==o?null:o.ImageUrl)("ngIfElse",n),t.xp6(3),t.Q6J("rowSpan",null==o?null:o.Variants.length),t.xp6(2),t.Q6J("matTooltip",(null==o||null==o.Name?null:o.Name.length)>50?null==o?null:o.Name:""),t.xp6(1),t.hij(" ",null==o?null:o.Name," ")}}function Ut(i,e){if(1&i&&(t.TgZ(0,"div")(1,"a",23),t._UZ(2,"img",36),t.qZA()()),2&i){const n=e.$implicit;t.xp6(1),t.Q6J("href",n.URL,t.LSH),t.xp6(1),t.Q6J("src",n.Img,t.LSH)("matTooltip",n.Name)}}function Dt(i,e){if(1&i&&(t.TgZ(0,"div"),t._UZ(1,"img",36),t.qZA()),2&i){const n=e.$implicit;t.xp6(1),t.Q6J("src",n.Img,t.LSH)("matTooltip",n.Name)}}function Jt(i,e){if(1&i&&(t.TgZ(0,"tr"),t.YNc(1,Nt,3,2,"ng-container",20),t.YNc(2,kt,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,Ut,3,3,"div",21),t.qZA()(),t.TgZ(14,"td",25)(15,"div",26),t.YNc(16,Dt,2,2,"div",21),t.qZA()()()),2&i){const n=e.$implicit,o=e.index,a=t.oxw(5);t.xp6(1),t.Q6J("ngIf",0==o),t.xp6(1),t.Q6J("ngIf",0==o),t.xp6(2),t.hij(" ",n.Name," "),t.xp6(3),t.hij(" ",n.Code," "),t.xp6(2),t.Q6J("href","https://"+a.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(null==n?null:n.ID),t.LSH),t.xp6(4),t.Q6J("ngForOf",null==n?null:n.Available),t.xp6(3),t.Q6J("ngForOf",null==n?null:n.NotAvailable)}}function Lt(i,e){if(1&i&&(t.ynx(0),t.YNc(1,Jt,17,7,"tr",21),t.BQk()),2&i){const n=e.$implicit;t.xp6(1),t.Q6J("ngForOf",n.Variants)}}function Qt(i,e){if(1&i&&(t.TgZ(0,"tbody"),t.YNc(1,Lt,2,1,"ng-container",21),t.qZA()),2&i){const n=e.ngIf;t.xp6(1),t.Q6J("ngForOf",n)}}function qt(i,e){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,Qt,2,1,"tbody",20),t.ALo(17,"async"),t.qZA()(),t.BQk()),2&i){const n=t.oxw(2);t.xp6(16),t.Q6J("ngIf",t.lcZ(17,1,n.data$))}}function Et(i,e){1&i&&(t.TgZ(0,"div",37),t._UZ(1,"app-empty-state"),t.qZA())}function Yt(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"span",45),t.NdJ("click",function(){t.CHM(n);const a=t.oxw(3);return t.KtG(a.getRowCount())}),t.TgZ(1,"i",46),t._uU(2,"?"),t.qZA()()}}function Bt(i,e){if(1&i&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&i){const n=e.ngIf;t.xp6(1),t.Oqu(t.lcZ(2,1,null==n?null:n.Count))}}function Kt(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"a",47),t.NdJ("click",function(){t.CHM(n);const a=t.oxw(3);return t.KtG(a.onNextPage())}),t._UZ(1,"i",48),t._uU(2," Next"),t.qZA()}}function Vt(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"a",49),t.NdJ("click",function(){t.CHM(n);const a=t.oxw(3);return t.KtG(a.onLastPage())}),t._UZ(1,"i",50),t._uU(2," Last"),t.qZA()}}function Gt(i,e){if(1&i&&(t.TgZ(0,"div",38)(1,"div",39)(2,"div",40),t._uU(3),t.ALo(4,"number"),t.YNc(5,Yt,3,0,"span",41),t.YNc(6,Bt,3,3,"span",20),t.ALo(7,"async"),t._uU(8),t.qZA()(),t.TgZ(9,"div",42),t.YNc(10,Kt,3,0,"a",43),t.YNc(11,Vt,3,0,"a",44),t.qZA()()),2&i){const n=e.ngIf,o=t.oxw(2);t.xp6(3),t.hij(" Showing 1 - ",t.lcZ(4,6,null==n?null:n.length)," of "),t.xp6(2),t.Q6J("ngIf",o.paginationService.hideCount),t.xp6(1),t.Q6J("ngIf",!o.paginationService.hideCount&&t.lcZ(7,8,o.rowCount$)),t.xp6(2),t.hij(" records ~ ",o.paginationService.footerPageNumber," Page "),t.xp6(2),t.Q6J("ngIf",o.paginationService.disableNextButton&&!o.paginationService.goToLastPage),t.xp6(1),t.Q6J("ngIf",o.paginationService.disableNextButton&&!o.paginationService.goToLastPage)}}function $t(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"mainpanel",1),t.NdJ("onSubmit",function(a){t.CHM(n);const l=t.oxw();return t.KtG(l.searchProduct(a))}),t.TgZ(1,"actions"),t.YNc(2,Ot,3,1,"button",2),t.TgZ(3,"button",3),t.NdJ("click",function(){const l=t.CHM(n).ngIf,r=t.oxw();return t.KtG(r.openScanDialog(l))}),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,qt,18,3,"ng-container",7),t.ALo(10,"async"),t.YNc(11,Et,2,0,"ng-template",null,8,t.W1O),t.qZA(),t.YNc(13,Gt,12,10,"div",9),t.ALo(14,"async"),t.qZA()()()}if(2&i){const n=t.MAs(12),o=t.oxw();let a;t.Q6J("hideSearchDropdown",!0),t.xp6(2),t.Q6J("ngIf",o.hasSelectionProduct),t.xp6(7),t.Q6J("ngIf",(null==(a=t.lcZ(10,5,o.data$))?null:a.length)>0)("ngIfElse",n),t.xp6(4),t.Q6J("ngIf",t.lcZ(14,7,o.data$))}}class D{constructor(e,n,o,a,l,r){this.http=e,this.dialog=n,this.toastr=o,this.productService=a,this.paginationService=l,this.biggerPictureService=r,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 e=localStorage.getItem("Authorization");this.hostName=JSON.parse(e)?.Host}initPageLoader(){this.paginationService.fetchDataEndpoint=this.notChannelAPI,this.loader$=this.http.post(`api/${this.loaderAPI}`,{}).pipe((0,vt.b)(e=>{this.filterSearch=e.Filter,this.paginationService.resetToFirstPage(e.Filter)}))}iniData(){this.data$=this.paginationService.data$.pipe((0,Mt.U)(e=>e.map(n=>(n.Variants=n.Variants.map(o=>(o.Available=this.productService.sortChannel(o.Available),o.NotAvailable=this.productService.sortChannel(o.NotAvailable),o.Available=this.assignLogoChannel(o.Available),o.NotAvailable=this.assignLogoChannel(o.NotAvailable),o)),n))))}assignLogoChannel(e){return e.map(n=>(n.Img=s.g.getChannelLogoByTypeId(n.TypeID),n))}searchProduct(e){this.filterSearch.text=e,this.paginationService.resetToFirstPage(this.filterSearch)}scanAllProduct(e){let n=this.productService.findChannelById(this.filterSearch.ChannelID,e.Options.Channel);this.productService.scanAll(this.filterSearch.ChannelID,this.filterSearch.ScanFull,this.filterSearch.UpdatedProduct,this.filterSearch.Async).subscribe(o=>{this.filterSearch.Async?this.toastr.success("You will be notified when the scan is completed.","Scan Asynchronous"):(this.productService.successToastrScanAllProduct(o,n,!this.filterSearch.UpdatedProduct),this.initPageLoader())})}openScanDialog(e){let n=JSON.parse(JSON.stringify(this.filterSearch));n.ChannelID=s.g.GuidEMpty,this.dialog.open(_.j,{data:{filter:n,channelOptions:e.Options.Channel},width:"600px"}).afterClosed().pipe((0,u.h)(a=>s.g.IsNotEmpty(a))).subscribe(a=>{this.filterSearch.ChannelID=a.ChannelID,this.filterSearch.ScanFull=a.ScanFull,this.filterSearch.UpdatedProduct=a.UpdatedProduct,this.filterSearch.Async=a.Async,this.scanAllProduct(e)})}getChannelLogoById(e){return s.g.getChannelLogoByTypeId(e)}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:e=>{this.filterSearch.PageNumber=1,this.paginationService.getAllData(this.filterSearch,e.Count)}})}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}onSelectProduct(e){this.hasSelectionProduct=this.productService.hasSelection(e),this.selectedProducts=this.productService.selectedProduct(e)}uploadMultipleProduct(){let e=this.getUniqueChannels();e=e.map(n=>(n.ID=n.ChannelID,n)),this.dialog.open(m,{width:"700px",data:{title:"Upload Multiple Product",channels:e}}).afterClosed().pipe((0,u.h)(n=>"CANCEL"!==n),(0,x.w)(n=>{const o=this.getSelectedProductIds();return this.productService.uploadNotInChannel(o,n)})).subscribe({next:()=>{this.paginationService.resetToFirstPage(this.filterSearch),this.selectedProducts=[],this.hasSelectionProduct=!1},error:n=>{this.selectedProducts=[],this.hasSelectionProduct=!1}})}getSelectedProductIds(){return this.selectedProducts.map(n=>({ID:n.ProductID}))}getUniqueChannels(){let e=[];return this.selectedProducts.forEach(n=>{e=[...e,...n.Variants[0].NotAvailable]}),e=e.filter((n,o,a)=>a.findIndex(l=>l.ChannelID==n.ChannelID)==o),e}ngOnDestroy(){this.paginationService.destroy()}}function Ht(i,e){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 n=e.$implicit;t.xp6(2),t.Oqu(null==n?null:n.Name),t.xp6(2),t.Oqu(null==n?null:n.ChannelVariationSKU)}}D.\u0275fac=function(e){return new(e||D)(t.Y36(T.O),t.Y36(g.uw),t.Y36(v._W),t.Y36(M.M),t.Y36(wt.b),t.Y36(Zt.k))},D.\u0275cmp=t.Xpm({type:D,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(e,n){1&e&&(t.YNc(0,$t,15,9,"mainpanel",0),t.ALo(1,"async")),2&e&&t.Q6J("ngIf",t.lcZ(1,1,n.loader$))},dependencies:[d.sg,d.O5,h.Wl,h.JJ,h.On,P.p,N.gM,b.s,d.Ov,d.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%}"]});class J{constructor(e,n){this.data=e,this.dialogRef=n}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new K.O,this.modalConfig.title=this.data?.title,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0}}J.\u0275fac=function(e){return new(e||J)(t.Y36(g.WI),t.Y36(g.so))},J.\u0275cmp=t.Xpm({type:J,selectors:[["app-modal-variants"]],decls:11,vars:2,consts:[[3,"config","onCancel"],["content",""],[1,"table"],[1,"thead-light"],[4,"ngFor","ngForOf"]],template:function(e,n){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onCancel",function(){return n.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,Ht,5,2,"tr",4),t.qZA()()()()),2&e&&(t.Q6J("config",n.modalConfig),t.xp6(10),t.Q6J("ngForOf",n.data.variants))},dependencies:[d.sg,V.M],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}"]});var G=c(1948);function Rt(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"button",14),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.openScanDialog())}),t._UZ(1,"i",15),t._uU(2," Scan Channel "),t.qZA()}}function jt(i,e){if(1&i){const n=t.EpF();t.ynx(0),t.TgZ(1,"button",16),t.NdJ("click",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onDownloadAllProduct("SELECTED"))}),t._UZ(2,"i",17),t._uU(3),t.qZA(),t.BQk()}if(2&i){const n=t.oxw();let o;t.xp6(3),t.hij(" Download (",null==(o=n.productService.selectedProduct(n.products))?null:o.length,") ")}}function zt(i,e){if(1&i&&(t.TgZ(0,"span",18),t._UZ(1,"img",19),t.qZA(),t._uU(2)),2&i){const n=e.item,o=t.oxw();t.xp6(1),t.Q6J("src",o.getChannelLogo(n.TypeID),t.LSH),t.xp6(1),t.hij(" ",n.Name," ")}}const Wt=function(i){return[i]},Xt=function(){return[]};function tn(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"div",20)(1,"app-product-card",21),t.NdJ("onCheckBoxChange",function(a){const r=t.CHM(n).index,fn=t.oxw();return t.KtG(fn.onSelectProduct(a,r))})("onDescEvent",function(){const l=t.CHM(n).index,r=t.oxw();return t.KtG(r.onShowVariantDetail(l))})("onDownload",function(){const l=t.CHM(n).$implicit,r=t.oxw();return t.KtG(r.onDownloadProduct(l))})("onScan",function(){const l=t.CHM(n).$implicit,r=t.oxw();return t.KtG(r.onScanChannel(l))}),t.qZA()()}if(2&i){const n=e.$implicit;t.xp6(1),t.Q6J("showRedirectIcon",!1)("title",null==n?null:n.Name)("image",null==n?null:n.Image)("imageForZoom",null==n?null:n.Image)("code",null==n?null:n.SKU)("description",(null==n||null==n.Variant?null:n.Variant.length)>0?(null==n||null==n.Variant?null:n.Variant.length)+" Variants":null)("downloadButton",!0)("channels",null!=n&&n.Channel?t.VKq(10,Wt,null==n?null:n.Channel):t.DdM(12,Xt))("showCheckBox",!0)("scanButton",!0)}}function nn(i,e){1&i&&(t.ynx(0),t.TgZ(1,"div",22),t._UZ(2,"app-empty-state"),t.qZA(),t.BQk())}function en(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"div",23)(1,"div",24)(2,"app-custom-paginator",25),t.NdJ("total",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.getRowCount())})("next",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onNextPage())})("previous",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onPreviousPage())}),t.qZA()()()}if(2&i){const n=t.oxw();t.xp6(2),t.Q6J("filter",n.searchFilter)("totaldata",null==n.products?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}class L{constructor(e,n,o,a,l){this.http=e,this.dialog=n,this.productService=o,this.toastrService=a,this.activateRouter=l,this.searchFilter=new E.k,this.products=[],this.hasClickRowCount=!1}ngOnInit(){this.activateRouter.queryParams.subscribe(e=>{this.initPageLoader(e.ID?e.ID:s.g.GuidEMpty)})}initPageLoader(e){this.productService.loader(e).subscribe(n=>{this.channelOptions=n.Options.Channel,this.searchFilter=n.Filter,this.searchFilter.PageSize=n.Filter.RowCount,this.getProducts()})}getProducts(){this.http.post("/api/product/GetProductChannelNotPOS",this.searchFilter).subscribe(e=>{this.products=e.Data,this.mapChannelToProduct(),this.setSkuProduct()})}mapChannelToProduct(){this.products=this.products.map(e=>(e.Channel=JSON.parse(JSON.stringify(this.channelOptions.find(n=>n.ID==e.ChannelID))),e)).map(e=>(e.Channel.Url=e.Url,e))}setSkuProduct(){this.products=this.products.map(e=>(e.SKU=0==e?.Variant?.length?s.g.IsNotEmpty(e?.ChannelItemSKU)?e?.ChannelItemSKU:"SKU not assigned":e?.Variant[0]?.ChannelVariationSKU?e?.Variant[0]?.ChannelVariationSKU:"SKU not assigned",e))}onSearch(e){this.searchFilter.text=e,this.hasClickRowCount=!1,this.getProducts()}onClearChannelFilter(){this.searchFilter.ChannelID=s.g.GuidEMpty}onScanAll(){let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(n=>{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(n,e,!this.searchFilter.UpdatedProduct)),this.searchFilter.ChannelID=s.g.GuidEMpty})}openScanDialog(){let e=JSON.parse(JSON.stringify(this.searchFilter));e.ChannelID=s.g.GuidEMpty,this.dialog.open(_.j,{data:{filter:e,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe((0,u.h)(o=>s.g.IsNotEmpty(o))).subscribe(o=>{this.searchFilter.ChannelID=o.ChannelID,this.searchFilter.UpdatedProduct=o.UpdatedProduct,this.searchFilter.ScanFull=o.ScanFull,this.searchFilter.Async=o.Async,this.onScanAll()})}onDownloadAllProduct(e){let n;n="ALL"==e?this.products:this.productService.selectedProduct(this.products),n.length>0&&this.productService.downloadMultipleProduct(n).subscribe({next:()=>{this.getProducts()}})}onSelectProduct(e,n){this.products[n].selected=e}onDownloadProduct(e){confirm(`Are you sure you want to Retrieve product ${e?.Name} from ${e?.Channel.Name} to POS?`)&&this.productService.downloadProduct(e).subscribe({next:()=>{this.getProducts()}})}onScanChannel(e){let n=JSON.parse(JSON.stringify(e));delete n.Channel,this.productService.scanCompareToPos([n]).subscribe(o=>{o.Status?(this.initPageLoader(s.g.GuidEMpty),this.toastrService.success(`product ${e.Name} have been successfully scanned and synchronized with POS`,"Success")):this.toastrService.error(`Product ${e.Name} is not existed in POS`,"Error")})}onShowVariantDetail(e){let n=this.products[e].Variant;n.length>0&&this.dialog.open(J,{data:{title:this.products[e].Name,variants:n},width:"30%"})}getRowCount(){let e={ChannelID:this.searchFilter.ChannelID,text:this.searchFilter.text,HaveSku:parseInt(this.searchFilter.HaveSku)};this.http.post("/api/product/GetProductChannelNotPOSRowCount",e).subscribe(n=>{this.hasClickRowCount=!0,this.rowCount=n.Count})}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPreviousPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}getChannelLogo(e){return s.g.getChannelLogoByTypeId(e)}}L.\u0275fac=function(e){return new(e||L)(t.Y36(T.O),t.Y36(g.uw),t.Y36(M.M),t.Y36(v._W),t.Y36(S.gz))},L.\u0275cmp=t.Xpm({type:L,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(e,n){1&e&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(a){return n.onSearch(a)}),t.TgZ(1,"actions"),t.YNc(2,Rt,3,0,"button",1),t.YNc(3,jt,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(a){return n.searchFilter.ChannelID=a})("clear",function(){return n.onClearChannelFilter()}),t.YNc(11,zt,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(a){return n.searchFilter.HaveSku=a}),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(a){return n.searchFilter.Item_id=a}),t.qZA()()()()(),t.TgZ(26,"content")(27,"div",10)(28,"div",11),t.YNc(29,tn,2,13,"div",12),t.YNc(30,nn,3,0,"ng-container",2),t.qZA(),t.YNc(31,en,3,4,"div",13),t.qZA()()()),2&e&&(t.xp6(2),t.Q6J("ngIf",!n.productService.hasSelection(n.products)),t.xp6(1),t.Q6J("ngIf",n.productService.hasSelection(n.products)),t.xp6(7),t.Q6J("clearable",!0)("items",n.channelOptions)("ngModel",n.searchFilter.ChannelID),t.xp6(5),t.Q6J("ngModel",n.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",n.searchFilter.Item_id),t.xp6(4),t.Q6J("ngForOf",n.products),t.xp6(1),t.Q6J("ngIf",0==n.products.length),t.xp6(1),t.Q6J("ngIf",(null==n.products?null:n.products.length)>0))},dependencies:[d.sg,d.O5,h.Fj,h.JJ,h.On,P.p,f.w9,f.ir,G.VQ,G.U0,F.y,B.Y,b.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}"]});var j=c(5631);function on(i,e){if(1&i&&(t.TgZ(0,"span",8),t._UZ(1,"img",9),t.qZA(),t._uU(2)),2&i){const n=e.item,o=t.oxw();t.xp6(1),t.Q6J("src",o.getChannelLogo(n.TypeID),t.LSH),t.xp6(1),t.hij(" ",n.Name," ")}}function an(i,e){if(1&i&&(t.TgZ(0,"div",10),t._UZ(1,"app-duplicate-product-card",11),t.qZA()),2&i){const n=e.$implicit;t.xp6(1),t.Q6J("imageForZoom",n.ImageUrl)("title",n.Name)("code",n.Code)("image",n.ThumbnailURL)("channels",n.Channel)}}function ln(i,e){1&i&&(t.ynx(0),t.TgZ(1,"div",12),t._UZ(2,"app-empty-state"),t.qZA(),t.BQk())}function rn(i,e){if(1&i){const n=t.EpF();t.ynx(0),t.TgZ(1,"div",13)(2,"div",14)(3,"app-custom-paginator",15),t.NdJ("next",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onNextPage())})("previous",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.onPrevPage())})("total",function(){t.CHM(n);const a=t.oxw();return t.KtG(a.getRowCount())}),t.qZA()()(),t.BQk()}if(2&i){const n=t.oxw();t.xp6(3),t.Q6J("filter",n.searchFilter)("totaldata",null==n.products?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickedRowCount)}}class Q{constructor(e,n){this.httpService=e,this.productService=n,this.searchFilter=new E.k,this.products=[],this.hasClickedRowCount=!1,this.getPageLoader()}getPageLoader(){this.productService.loader().subscribe(e=>{this.searchFilter=e.Filter,this.searchFilter.PageSize=e.Filter.RowCount,this.channelOptions=e.Options.Channel,this.getProducts()})}getProducts(){this.httpService.post("/api/product/GetDuplicateInChannel",{ChannelID:this.searchFilter.ChannelID,RowCount:this.searchFilter.RowCount,PageNumber:this.searchFilter.PageNumber,text:this.searchFilter.text}).subscribe(n=>{this.products=n.Data})}onSearch(e){this.searchFilter.text=e,this.hasClickedRowCount=!1,this.getProducts()}onClearFilter(){this.searchFilter.ChannelID=s.g.GuidEMpty}getChannelLogo(e){return s.g.getChannelLogoByTypeId(e)}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(n=>{this.hasClickedRowCount=!0,this.rowCount=n.Total})}}Q.\u0275fac=function(e){return new(e||Q)(t.Y36(T.O),t.Y36(M.M))},Q.\u0275cmp=t.Xpm({type:Q,selectors:[["app-duplicate-sku"]],decls:14,vars:6,consts:[["headerTitle","Multiple Listed SKU","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,"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","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(e,n){1&e&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(a){return n.onSearch(a)}),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(a){return n.searchFilter.ChannelID=a})("clear",function(){return n.onClearFilter()}),t.YNc(7,on,3,2,"ng-template",3),t.qZA()()()(),t.TgZ(8,"content")(9,"div",4)(10,"div",5),t.YNc(11,an,2,5,"div",6),t.YNc(12,ln,3,0,"ng-container",7),t.qZA(),t.YNc(13,rn,4,4,"ng-container",7),t.qZA()()()),2&e&&(t.xp6(6),t.Q6J("clearable",!0)("items",n.channelOptions)("ngModel",n.searchFilter.ChannelID),t.xp6(5),t.Q6J("ngForOf",n.products),t.xp6(1),t.Q6J("ngIf",0==(null==n.products?null:n.products.length)),t.xp6(1),t.Q6J("ngIf",(null==n.products?null:n.products.length)>0))},dependencies:[d.sg,d.O5,h.JJ,h.On,P.p,f.w9,f.ir,j._,F.y,b.s]});var cn=c(8739);function sn(i,e){if(1&i&&(t.ynx(0),t._uU(1),t.BQk()),2&i){const n=t.oxw().$implicit;t.xp6(1),t.hij(" ",n.Count," ")}}function dn(i,e){if(1&i){const n=t.EpF();t.TgZ(0,"span",26),t.NdJ("click",function(){t.CHM(n);const a=t.oxw().$implicit,l=t.oxw(2);return t.KtG(l.getLiveProductCount(a.ID,a))}),t._UZ(1,"i",27),t.qZA()}}const pn=function(){return["/menu/products/status/sold-in-channel"]},z=function(i){return{ID:i}},hn=function(){return["/menu/products/status/not-in-pos"]};function un(i,e){if(1&i){const n=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 l=t.CHM(n).$implicit,r=t.oxw(2);return t.KtG(r.onScanChannel(l))}),t._UZ(23,"i",23),t._uU(24," Scan "),t.qZA(),t.TgZ(25,"button",24),t.NdJ("click",function(){const l=t.CHM(n).$implicit,r=t.oxw(2);return t.KtG(r.onClearCache(l.ID))}),t._UZ(26,"i",25),t._uU(27," Clear "),t.qZA()()()()}if(2&i){const n=e.$implicit,o=t.MAs(8),a=t.oxw(2);t.xp6(2),t.Q6J("src",a.getChannelLogo(n.TypeID),t.LSH),t.xp6(2),t.Oqu(n.Name),t.xp6(2),t.Q6J("ngIf",void 0!==n.Count)("ngIfElse",o),t.xp6(4),t.Q6J("routerLink",t.DdM(18,pn))("queryParams",t.VKq(19,z,n.ID)),t.xp6(1),t.hij(" ",t.lcZ(12,11,n.SoldInChannel)," "),t.xp6(3),t.Q6J("routerLink",t.DdM(21,hn))("queryParams",t.VKq(22,z,n.ID)),t.xp6(1),t.hij(" ",t.lcZ(16,13,n.NotInPOS)," "),t.xp6(3),t.hij("",n.LastSync?t.xi3(19,15,n.LastSync,"dd MMM yyyy HH:mm"):"-"," ")}}function gn(i,e){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 n=t.oxw();let o;t.xp6(17),t.Q6J("ngForOf",null==(o=t.lcZ(18,1,n.channels$))?null:o.Data)}}function _n(i,e){1&i&&(t.TgZ(0,"div",28),t._UZ(1,"app-empty-state"),t.qZA())}class q{constructor(e,n,o){this.productService=e,this.toastr=n,this.dialog=o,this.destroy$=new R.x}ngOnInit(){this.setObsProductStatistic(),this.initPageLoader()}initPageLoader(){this.productService.loader().pipe((0,Y.R)(this.destroy$)).subscribe(e=>{this.channelOptions=e?.Options?.Channel})}setObsProductStatistic(){this.channels$=this.productService.getProductStatistic()}getLiveProductCount(e,n){this.productService.getTotalProductLive(e).pipe((0,Y.R)(this.destroy$)).subscribe(o=>{n.Count=o.Count})}onScanChannel(e){this.dialog.open(_.j,{width:"700px",data:{channelOptions:this.channelOptions,filter:{ChannelID:e.ID},disabledChannelOption:!0}}).afterClosed().pipe((0,u.h)(n=>s.g.IsNotEmpty(n))).subscribe(n=>{this.scanAllProduct(e.ID,n)})}scanAllProduct(e,n){let o=this.productService.findChannelById(e,this.channelOptions);this.productService.scanAll(n.ChannelID,n.ScanFull,n.UpdatedProduct,n.Async).pipe((0,u.h)(a=>a)).subscribe(a=>{n.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(a,o,!n.UpdatedProduct),this.initPageLoader(),this.setObsProductStatistic())})}onClearCache(e){confirm("Are you sure you want to Clear Cache? This Process will remove your product integration to marketplace")&&this.productService.clearCacheChannel(e).pipe((0,Y.R)(this.destroy$)).subscribe(o=>{this.toastr.success("Successfully cleared cache","Success"),this.initPageLoader(),this.setObsProductStatistic()})}getChannelLogo(e){return s.g.getChannelLogoByTypeId(e)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}}q.\u0275fac=function(e){return new(e||q)(t.Y36(M.M),t.Y36(v._W),t.Y36(g.uw))},q.\u0275cmp=t.Xpm({type:q,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(e,n){if(1&e&&(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&e){const o=t.MAs(8);let a;t.Q6J("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(5),t.Q6J("ngIf",(null==(a=t.lcZ(6,4,n.channels$))||null==a.Data?null:a.Data.length)>0)("ngIfElse",o)}},dependencies:[d.sg,d.O5,P.p,N.gM,S.rH,b.s,d.Ov,d.JJ,d.uU]});var mn=c(3238);const Cn=[{component:O,path:"",children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:k,canActivate:[w.a],data:{title:"Products in POS"}},{path:"sold-in-channel",component:U,canActivate:[w.a],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:D,canActivate:[w.a],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:L,canActivate:[w.a],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:Q,canActivate:[w.a],data:{title:"Duplicate Sku in Channel"}},{path:"channel-statistic",component:q,canActivate:[w.a],data:{title:"Channel Statistic"}}]}];class Z{}Z.\u0275fac=function(e){return new(e||Z)},Z.\u0275mod=t.oAB({type:Z}),Z.\u0275inj=t.cJS({imports:[d.ez,h.u5,P.R,N.AV,f.A0,cn.TU,G.Fk,H.Z,j._,F.y,B.Y,S.Bz.forChild(Cn),b.s,A.FA,mn.XK]})}}]);