marketplacepos 3.11.7 → 3.11.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.
@@ -1 +1 @@
1
- import{a as D,b as St,d as Q,e as oe}from"./chunk-5OSUE6B3.js";import{a as q}from"./chunk-IWVYX6KY.js";import{a as B}from"./chunk-NRVXDIHY.js";import{d as Qt,e as Xt,f as te,g as ee,k as ne}from"./chunk-XDNW2F3I.js";import{a as X,b as xt}from"./chunk-5LCXVQBT.js";import{a as z}from"./chunk-PZOGC5DT.js";import{a as Ht,b as Yt,c as Zt}from"./chunk-G5LCLRIW.js";import{b as re}from"./chunk-DEH6NGKQ.js";import"./chunk-5ZUWMFL5.js";import"./chunk-TDHJ34QP.js";import{a as ie}from"./chunk-KBYAFLE5.js";import{a as R}from"./chunk-U5YOE633.js";import"./chunk-INNTQ5YN.js";import{a as Jt,b as zt}from"./chunk-SRYGE2HW.js";import{a as qt}from"./chunk-MYMGWQRE.js";import"./chunk-DT3B54LD.js";import{a as rt,b as Ct,d as Z,e as $t}from"./chunk-AL67KXJV.js";import{a as et}from"./chunk-T4Y427M7.js";import{g as A}from"./chunk-7QECCYLR.js";import{b as $,e as G}from"./chunk-K3G6FMDF.js";import"./chunk-JM3LERUP.js";import{C as L,D as Kt,q as ft,r as Wt,u as J}from"./chunk-ZKBLXGXT.js";import{N as Gt}from"./chunk-6B64VOO7.js";import{b as Bt,c as ot,h as W,k as K,u as jt}from"./chunk-SP6QPE3M.js";import{b as Y,c as _}from"./chunk-6F6NSBIF.js";import{Ab as m,B as y,Bb as mt,Cb as I,Eb as T,Fb as N,Gb as E,Ha as O,Ia as c,Ja as x,Jb as tt,Kb as at,Rb as F,Sb as k,T as H,Tb as Vt,Ub as it,V as wt,Vc as _t,Wa as S,Wc as Lt,X as Nt,Ya as s,Yc as gt,_c as Rt,aa as Et,c as Dt,fb as a,gb as l,ha as M,hb as C,ia as kt,ib as v,jb as b,kc as V,lb as P,lc as U,ob as f,oc as ut,pa as u,pc as Ut,q as Tt,qa as h,qb as p,rc as ht,sc as At,zb as j}from"./chunk-6DRNAUKE.js";import"./chunk-GRMIXZTT.js";var _e=()=>["/menu/products/download/by-url"],ae=(()=>{let r=class r{constructor(){this.productTabs=[{Title:"Sold in Channel",Url:"/menu/products/status/sold-in-channel",Description:"SKU has been mapped between dealpos and marketplace"},{Title:"Not in POS",Url:"/menu/products/status/not-in-pos",Description:"SKU sold in Marketplace but not exist in DEALPOS"},{Title:"Not in Channel",Url:"/menu/products/status/not-in-channel",Description:"SKU has not been sold on one of channels"},{Title:"In POS",Url:"/menu/products/status/in-pos",Description:"All products which is already available in POS"},{Title:"Multiple Listing",Url:"/menu/products/status/duplicate-sku",Description:"SKU(s) which is listed more than one time (one to many)"},{Title:"Channel Statistic",Url:"/menu/products/status/channel-statistic",Description:"Product statistic from each channel obtained from the last product scan"}]}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=M({type:r,selectors:[["app-status"]],decls:13,vars:3,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-flex"],[1,"dropdown-item",3,"routerLink"]],template:function(e,i){e&1&&(a(0,"nav",0)(1,"div",1)(2,"div"),C(3,"nav-tab",2),l()(),a(4,"div")(5,"div",3)(6,"a",4),C(7,"i",5),l(),a(8,"div",6)(9,"div",7)(10,"a",8),m(11,"Download Product By Url"),l()()()()()(),C(12,"router-outlet")),e&2&&(c(3),s("Tabs",i.productTabs),c(7),s("routerLink",tt(2,_e)))},dependencies:[Jt,Lt,gt]});let o=r;return o})();function ge(o,r){if(o&1){let n=P();a(0,"button",13),f("click",function(){u(n);let e=p(2);return h(e.onOpenScanDialog())}),C(1,"i",14),m(2," Scan Channel "),l()}}function Ce(o,r){if(o&1&&(v(0),S(1,ge,3,0,"button",12),b()),o&2){let n=p();c(),s("ngIf",!n.productService.hasSelection(n.products))}}function fe(o,r){if(o&1){let n=P();v(0),a(1,"button",15),f("click",function(){u(n);let e=p();return h(e.onScanMultipleProduct())}),C(2,"i",14),m(3),l(),b()}if(o&2){let n,t=p();c(3),I(" Scan (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function Se(o,r){if(o&1){let n=P();v(0),a(1,"button",16),f("click",function(){u(n);let e=p();return h(e.onUploadMultipleProduct())}),C(2,"i",17),m(3),l(),b()}if(o&2){let n,t=p();c(3),I(" Upload (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function xe(o,r){if(o&1){let n=P();a(0,"div",18)(1,"app-product-card",19),f("onUpload",function(){let e=u(n).$implicit,i=p();return h(i.onUploadToMultipleChannel(e))})("onScan",function(){let e=u(n).$implicit,i=p();return h(i.onScanSingleProduct(e))})("onDescEvent",function(){let e=u(n).index,i=p();return h(i.onOpenDialogVariant(e))})("onCheckBoxChange",function(e){let i=u(n).$implicit;return h(i.selected=e)}),l()()}if(o&2){let n=r.$implicit,t=p();c(),s("productId",n.ID)("title",n==null?null:n.Name)("image",n==null?null:n.ThumbnailUrl)("description",(n==null?null:n.Variants.length)>1?(n==null?null:n.Variants.length)+" Variants":null)("channels",t.productService.getChannelProduct(n))("code",t.getVariantCode(n==null?null:n.Variants))("showCheckBox",(n==null?null:n.Channel.length)<t.channelOptions.length)("scanButton",!0)("uploadButton",n==null?null:n.hasUpload)("imageForZoom",n==null?null:n.ImageUrl)}}function Pe(o,r){o&1&&(v(0),a(1,"div",20),C(2,"app-empty-state"),l(),b())}function ve(o,r){if(o&1){let n=P();v(0),a(1,"div",21)(2,"div",22)(3,"app-custom-paginator",23),f("next",function(){u(n);let e=p();return h(e.onNextPage())})("previous",function(){u(n);let e=p();return h(e.onPrevPage())}),l()()(),b()}if(o&2){let n=p();c(3),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",!0)}}var ce=(()=>{let r=class r{constructor(t,e,i,d,g){this.http=t,this.toastr=e,this.dialog=i,this.productService=d,this.authService=g,this.searchFilter=new q,this.products=[],this.rowCount=0,this.multipeScanChannels=[],this.getLoaderPage(),this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}getLoaderPage(){this.productService.LoadInPOS().subscribe(t=>{this.Categories=t.Options.Categories,this.searchFilter.PageNumber=t.Filter.PageNumber,this.searchFilter.RowCount=t.Filter.RowCount,this.searchFilter.ChannelID=null,this.searchFilter.Category=t.Filter.Category,this.searchFilter.PageSize=100,this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[Y.Tokopedia,Y.Tiktok])}getProducts(){let t={PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Category:this.searchFilter.Category,From:this.startDate,To:this.endDate};this.http.post("/api/product/GetInPOS",t).subscribe(e=>{this.products=e.Data,this.rowCount=e.Total==null?this.searchFilter.RowCount:e.Total.toString(),this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions)})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=_.GuidEMpty,this.dialog.open(D,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.Async,this.scanAllProduct()})}scanAllProduct(){if(this.searchFilter.ChannelID==null){this.toastr.error("Please Select Channel","Error");return}this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(t=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{this.getLoaderPage();let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,e,!this.searchFilter.UpdatedProduct)}})}onOpenDialogVariant(t){this.dialog.open(St,{data:{title:this.products[t].Name,variants:this.products[t].Variants},width:"800px"})}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products),e=this.productService.filterUnselectedChannel(t,this.channelOptions);this.dialog.open(Q,{width:"700px",data:{title:"Upload Multiple Product",channels:e}}).afterClosed().pipe(y(i=>_.IsNotEmpty(i)),H(i=>this.productService.uploadMultipleProduct(t,i))).subscribe({next:i=>{this.getProducts()}})}onUploadToMultipleChannel(t){let e=this.productService.getChannelProduct(t);t.Channel=e;let i=this.productService.filterUnselectedChannel([t],this.channelOptions);this.dialog.open(Q,{width:"700px",data:{title:`Upload - ${t.Name}`,channels:i,product:t}}).afterClosed().pipe(y(d=>_.IsNotEmpty(d)),H(d=>this.productService.uploadSingleProduct([t],d))).subscribe({next:d=>{this.getProducts()}})}searchProduct(t){this.searchFilter.text=t,this.getProducts()}onNextPage(){this.getProducts()}onPrevPage(){this.getProducts()}onScanMultipleProduct(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=_.GuidEMpty;let e=this.productService.filterChannelByTypeId(this.channelOptions,[Y.Tokopedia,Y.Tiktok]);this.dialog.open(D,{data:{filter:t,channelOptions:e,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(d=>_.IsNotEmpty(d))).subscribe(d=>{this.searchFilter.ChannelID=d.ChannelID,this.searchFilter.ScanFull=d.ScanFull,this.searchFilter.UpdatedProduct=d.UpdatedProduct;let g=this.productService.selectedProduct(this.products),w=this.productService.getVariantCodesProducts(g);this.scanSingleProduct(w)})}onScanSingleProduct(t){let e=JSON.parse(JSON.stringify(this.searchFilter));e.ChannelID=_.GuidEMpty,this.dialog.open(D,{data:{filter:e,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID;let d=this.productService.getVariantCodesProduct(t);this.scanSingleProduct(d)})}scanSingleProduct(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:e=>{if(e)this.toastr.success("Successfully Scan ","Success");else{let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${i?.Name} `,"Error")}this.searchFilter.ChannelID=_.GuidEMpty,e&&this.getProducts()},error:e=>{this.searchFilter.ChannelID=_.GuidEMpty}})}getVariantCode(t){let e;return t.length>1&&(e=(t[0].model?t[0].model:"")+t[0].Code),t.length==1&&(e=t[0].Code),e}};r.\u0275fac=function(e){return new(e||r)(x(G),x($),x(J),x(R),x(A))},r.\u0275cmp=M({type:r,selectors:[["app-in-pos"]],decls:22,vars:13,consts:[["picker",""],["description","All products which is already available in POS",3,"onSubmit","headerTitle"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","Name","bindValue","Name","placeholder","Select Category",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[1,"mt-5"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["type","button","data-cy","scanSoldinChannel","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onUpload","onScan","onDescEvent","onCheckBoxChange","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(e,i){if(e&1){let d=P();a(0,"mainpanel",1),f("onSubmit",function(w){return u(d),h(i.searchProduct(w))}),a(1,"actions"),S(2,Ce,2,1,"ng-container",2)(3,fe,4,1,"ng-container",2)(4,Se,4,1,"ng-container",2),l(),a(5,"filters")(6,"div")(7,"label",3),m(8,"Category"),l(),a(9,"ng-select",4),f("ngModelChange",function(w){return u(d),h(i.searchFilter.Category=w)}),l()(),a(10,"div",5)(11,"mat-date-range-input",6)(12,"input",7),E("ngModelChange",function(w){return u(d),N(i.startDate,w)||(i.startDate=w),h(w)}),f("click",function(){u(d);let w=j(15);return h(w.open())}),l(),a(13,"input",8),E("ngModelChange",function(w){return u(d),N(i.endDate,w)||(i.endDate=w),h(w)}),f("click",function(){u(d);let w=j(15);return h(w.open())}),l()(),C(14,"mat-date-range-picker",null,0),l()(),a(16,"content")(17,"div",9)(18,"div",10),S(19,xe,2,10,"div",11)(20,Pe,3,0,"ng-container",2),l(),S(21,ve,4,4,"ng-container",2),l()()()}if(e&2){let d=j(15);s("headerTitle","In POS ("+i.rowCount+")"),c(2),s("ngIf",!i.productService.hasSelection(i.products)),c(),s("ngIf",i.productService.hasSelection(i.products)&&i.multipeScanChannels.length>0),c(),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("items",i.Categories)("ngModel",i.searchFilter.Category),c(2),s("rangePicker",d),c(),T("ngModel",i.startDate),c(),T("ngModel",i.endDate),c(6),s("ngForOf",i.products),c(),s("ngIf",i.products.length==0),c(),s("ngIf",i.products.length>0)}},dependencies:[V,U,ot,W,K,L,Z,z,X,B,te,Qt,Xt,ee],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.img-logo[_ngcontent-%COMP%]{height:24px;width:24px}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}"]});let o=r;return o})();function be(o,r){if(o&1){let n=P();v(0),a(1,"button",10),f("click",function(){u(n);let e=p();return h(e.onOpenScanDialog())}),C(2,"i",11),m(3," Scan Channel "),l(),b()}}function Ie(o,r){if(o&1){let n=P();v(0),a(1,"button",12),f("click",function(){u(n);let e=p();return h(e.onScanMultipleProduct())}),C(2,"i",11),m(3),l(),b()}if(o&2){let n=p();c(3),I(" Scan (",n.productService.selectedProduct(n.products).length,") ")}}function we(o,r){if(o&1){let n=P();v(0),a(1,"button",13),f("click",function(){u(n);let e=p();return h(e.onUploadMultipleProduct())}),C(2,"i",14),m(3),l(),b()}if(o&2){let n=p();c(3),I(" Upload (",n.productService.selectedProduct(n.products).length,") ")}}function ye(o,r){if(o&1&&(a(0,"span",15),C(1,"img",16),l(),m(2)),o&2){let n=r.item;c(),s("src",n.Img,O)("alt",n.Name),c(),I(" ",n.Name," ")}}function Me(o,r){if(o&1){let n=P();a(0,"div",17)(1,"label",18),m(2,"Item ID"),l(),a(3,"input",19),E("ngModelChange",function(e){u(n);let i=p();return N(i.searchFilter.Item_id,e)||(i.searchFilter.Item_id=e),h(e)}),l()()}if(o&2){let n=p();c(3),T("ngModel",n.searchFilter.Item_id)}}function Oe(o,r){if(o&1){let n=P();a(0,"div",20)(1,"app-product-card",21),f("onUpload",function(){let e=u(n).$implicit,i=p();return h(i.onUploadToMultipleChannel(e))})("onDescEvent",function(){let e=u(n).index,i=p();return h(i.onOpenVariantDetail(e))})("onScan",function(){let e=u(n).$implicit,i=p();return h(i.onScanSingleProduct(e))})("onCheckBoxChange",function(e){let i=u(n).$implicit;return h(i.selected=e)}),l()()}if(o&2){let n=r.$implicit,t=p();c(),s("productId",n==null?null:n.ID)("title",n==null?null:n.Name)("image",n==null?null:n.ThumbnailUrl)("description",(n==null||n.Variants==null?null:n.Variants.length)>1?(n==null||n.Variants==null?null:n.Variants.length)+" Variants":null)("channels",t.productService.getChannelProduct(n))("code",t.getVariantCode(n==null?null:n.Variants))("showCheckBox",n==null?null:n.hasScan)("scanButton",!0)("uploadButton",n==null?null:n.hasUpload)("imageForZoom",n==null?null:n.ImageUrl)}}function Fe(o,r){o&1&&(v(0),a(1,"div",22),C(2,"app-empty-state"),l(),b())}function De(o,r){if(o&1){let n=P();a(0,"div",23)(1,"div",24)(2,"app-custom-paginator",25),f("total",function(){u(n);let e=p();return h(e.getRowCount())})("next",function(){u(n);let e=p();return h(e.onNextPage())})("previous",function(){u(n);let e=p();return h(e.onPreviousPage())}),l()()()}if(o&2){let n=p();c(2),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}var se=(()=>{let r=class r{constructor(t,e,i,d,g,w){this.http=t,this.dialog=e,this.toastr=i,this.productService=d,this.activateRouter=g,this.authService=w,this.searchFilter=new q,this.products=[],this.rowCount=0,this.hasClickRowCount=!1,this.guidEmpty=_.GuidEMpty,this.multipeScanChannels=[],this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(_.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(e=>{this.searchFilter=e.Filter,e.Filter.ChannelID!=_.GuidEMpty&&(this.searchFilter.ListChannelID=[],this.searchFilter.ListChannelID.push(e.Filter.ChannelID)),this.searchFilter.PageSize=e.Filter.RowCount,this.searchFilter.Item_id="",this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[Y.Tokopedia,Y.Tiktok])}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Item_id:this.searchFilter.Item_id};this.productService.findAllSoldInChannel(t).subscribe(e=>{this.products=e.Data,this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions),this.products=this.productService.checkProductHasScanButton(this.products,this.channelOptions)})}searchProduct(t){this.searchFilter.text=t,this.hasClickRowCount=!1,this.getProducts()}onOpenVariantDetail(t){let e=this.products[t].Variants;this.dialog.open(St,{data:{variants:e,title:this.products[t].Name},width:"800px"})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=_.GuidEMpty,this.dialog.open(D,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.Async,this.scanAllProduct()})}scanAllProduct(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).pipe(y(e=>e)).subscribe(e=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(e,t,!this.searchFilter.UpdatedProduct),this.initPageLoader(_.GuidEMpty))})}onScanSingleProduct(t){t.Channel=this.productService.getChannelProduct(t);let e=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(D,{data:{filter:e,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID;let d=this.productService.getVariantCodesProduct(t);this.scanProducts(d)})}onUploadToMultipleChannel(t){let e=this.productService.getChannelProduct(t);t.Channel=e;let i=this.productService.filterUnselectedChannel([t],this.channelOptions);this.dialog.open(Q,{width:"700px",data:{title:`Upload - ${t.Name}`,channels:i,product:t}}).afterClosed().pipe(y(d=>_.IsNotEmpty(d)),H(d=>this.productService.uploadSingleProduct([t],d))).subscribe({next:d=>{this.getProducts()}})}onScanMultipleProduct(){this.searchFilter.ChannelID=_.GuidEMpty;let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(D,{data:{filter:t,channelOptions:this.multipeScanChannels,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct;let d=this.productService.selectedProduct(this.products),g=this.productService.getVariantCodesProducts(d);this.scanProducts(g)})}scanProducts(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:e=>{let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);e?this.toastr.success(`Product Successfully scan with ${i?.Name}`,"Success"):this.toastr.error(`This product is not existed in ${i?.Name} `,"Error"),this.searchFilter.ChannelID=_.GuidEMpty,e&&this.getProducts()},error:e=>{this.searchFilter.ChannelID=_.GuidEMpty}})}getVariantCode(t){let e;return t.length>1&&(e=(t[0].model?t[0].model:"")+t[0].Code),t.length==1&&(e=t[0].Code),e}onClearFilterChannel(){this.searchFilter.ChannelID=_.GuidEMpty,this.searchFilter.Item_id=""}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products),e=this.productService.filterUnselectedChannel(t,this.channelOptions);this.dialog.open(Q,{width:"700px",data:{title:"Upload Multiple Product",channels:e}}).afterClosed().pipe(y(i=>_.IsNotEmpty(i)),H(i=>this.productService.uploadMultipleProduct(t,i))).subscribe({next:i=>{this.getProducts()}})}getRowCount(){let t={ListChannelID:this.searchFilter.ListChannelID,text:this.searchFilter.text};this.http.post("/api/product/GetSoldInChannelRowCount",t).subscribe(e=>{this.hasClickRowCount=!0,this.rowCount=e.Total})}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPreviousPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}};r.\u0275fac=function(e){return new(e||r)(x(G),x(J),x($),x(R),x(_t),x(A))},r.\u0275cmp=M({type:r,selectors:[["app-sold-in-channel"]],decls:18,vars:12,consts:[["description","SKU has been mapped between dealpos and marketplace",3,"onSubmit","headerTitle"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clear","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],["class","mt-5",4,"ngIf"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"mt-5"],[1,"fw-bold"],["type","text","name","Item_id","id","Item_id",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onUpload","onDescEvent","onScan","onCheckBoxChange","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(e,i){e&1&&(a(0,"mainpanel",0),f("onSubmit",function(g){return i.searchProduct(g)}),a(1,"actions"),S(2,be,4,0,"ng-container",1)(3,Ie,4,1,"ng-container",1)(4,we,4,1,"ng-container",1),l(),a(5,"filters")(6,"div")(7,"label",2),m(8,"Channel"),l(),a(9,"ng-select",3),f("ngModelChange",function(g){return i.searchFilter.ListChannelID=g})("clear",function(){return i.onClearFilterChannel()}),S(10,ye,3,3,"ng-template",4),l()(),S(11,Me,4,1,"div",5),l(),a(12,"content")(13,"div",6)(14,"div",7),S(15,Oe,2,10,"div",8)(16,Fe,3,0,"ng-container",1),l(),S(17,De,3,4,"div",9),l()()()),e&2&&(s("headerTitle","Sold in Channel"),c(2),s("ngIf",!i.productService.hasSelection(i.products)),c(),s("ngIf",i.multipeScanChannels.length>0&&i.productService.hasSelection(i.products)),c(),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("multiple",!0)("items",i.channelOptions)("ngModel",i.searchFilter.ListChannelID),c(2),s("ngIf",i.searchFilter.ListChannelID!=null),c(4),s("ngForOf",i.products),c(),s("ngIf",i.products.length==0),c(),s("ngIf",i.products==null?null:i.products.length))},dependencies:[V,U,ot,W,K,L,Z,rt,Ct,z,X,B],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]});let o=r;return o})();function Ne(o,r){if(o&1){let n=P();a(0,"button",13),f("click",function(){u(n);let e=p(2);return h(e.uploadMultipleProduct())}),C(1,"i",14),m(2),l()}if(o&2){let n=p(2);c(2),I(" upload (",n.selectedProducts==null?null:n.selectedProducts.length,") ")}}function Ee(o,r){if(o&1){let n=P();v(0),a(1,"td",29)(2,"input",30),E("ngModelChange",function(e){u(n);let i=p(2).$implicit;return N(i.selected,e)||(i.selected=e),h(e)}),f("ngModelChange",function(){u(n);let e=p(3).ngIf,i=p(3);return h(i.onSelectProduct(e))}),l()(),b()}if(o&2){let n=p(2).$implicit;c(),s("rowSpan",n==null?null:n.Variants.length),c(),T("ngModel",n.selected)}}function ke(o,r){if(o&1){let n=P();v(0),a(1,"img",35),f("click",function(e){u(n);let i=p(3).$implicit,d=p(4);return h(d.onZoomImage(e,i==null?null:i.ImageUrl))}),l(),b()}if(o&2){let n=p(3).$implicit;c(),s("src",n==null?null:n.ImageUrl,O)}}function Ve(o,r){o&1&&C(0,"img",36)}function Ue(o,r){if(o&1&&(v(0),a(1,"td",29)(2,"div",31),S(3,ke,2,1,"ng-container",11)(4,Ve,1,0,"ng-template",null,1,it),l()(),a(6,"td",32)(7,"h4",33)(8,"span",34),m(9),l()()(),b()),o&2){let n=j(5),t=p(2).$implicit;c(),s("rowSpan",t==null?null:t.Variants.length),c(2),s("ngIf",t==null?null:t.ImageUrl)("ngIfElse",n),c(3),s("rowSpan",t==null?null:t.Variants.length),c(2),s("matTooltip",(t==null||t.Name==null?null:t.Name.length)>50?t==null?null:t.Name:""),c(),I(" ",t==null?null:t.Name," ")}}function Ae(o,r){if(o&1&&(a(0,"div")(1,"a",25),C(2,"img",37),l()()),o&2){let n=r.$implicit;c(),s("href",n.URL,O),c(),s("src",n.Img,O)("matTooltip",n.Name)}}function Le(o,r){if(o&1&&(a(0,"div"),C(1,"img",37),l()),o&2){let n=r.$implicit;c(),s("src",n.Img,O)("matTooltip",n.Name)}}function Re(o,r){if(o&1&&(a(0,"tr"),S(1,Ee,3,2,"ng-container",12)(2,Ue,10,6,"ng-container",12),a(3,"td"),m(4),l(),a(5,"td")(6,"span"),m(7),l(),a(8,"span",24)(9,"a",25),C(10,"i",26),l()()(),a(11,"td",27)(12,"div",28),S(13,Ae,3,3,"div",23),l()(),a(14,"td",27)(15,"div",28),S(16,Le,2,2,"div",23),l()()()),o&2){let n=r.$implicit,t=r.index,e=p(5);c(),s("ngIf",t==0),c(),s("ngIf",t==0),c(2),I(" ",n.Name," "),c(3),I(" ",n.Code," "),c(2),s("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),O),c(4),s("ngForOf",n==null?null:n.Available),c(3),s("ngForOf",n==null?null:n.NotAvailable)}}function Be(o,r){if(o&1&&(v(0),S(1,Re,17,7,"tr",23),b()),o&2){let n=r.$implicit;c(),s("ngForOf",n.Variants)}}function je(o,r){if(o&1&&(a(0,"tbody"),S(1,Be,2,1,"ng-container",23),l()),o&2){let n=r.ngIf;c(),s("ngForOf",n)}}function $e(o,r){if(o&1&&(v(0),a(1,"div",15)(2,"table",16)(3,"thead",17)(4,"tr"),C(5,"th",18),a(6,"th",19),m(7,"Product"),l(),a(8,"th",20),m(9,"Variant"),l(),a(10,"th",20),m(11,"SKU"),l(),a(12,"th",21),m(13,"Available In"),l(),a(14,"th",22),m(15,"Not Available In"),l()()(),S(16,je,2,1,"tbody",12),F(17,"async"),l()(),b()),o&2){let n=p(2);c(16),s("ngIf",k(17,1,n.data$))}}function Ge(o,r){o&1&&(a(0,"div",38),C(1,"app-empty-state"),l())}function We(o,r){if(o&1){let n=P();a(0,"span",46),f("click",function(){u(n);let e=p(4);return h(e.getRowCount())}),a(1,"i",47),m(2,"?"),l()()}}function Ke(o,r){if(o&1&&(a(0,"span"),m(1),F(2,"number"),l()),o&2){let n=r.ngIf;c(),mt(k(2,1,n==null?null:n.Count))}}function Je(o,r){if(o&1){let n=P();a(0,"a",48),f("click",function(){u(n);let e=p(4);return h(e.onNextPage())}),C(1,"i",49),m(2," Next"),l()}}function ze(o,r){if(o&1){let n=P();a(0,"a",50),f("click",function(){u(n);let e=p(4);return h(e.onLastPage())}),C(1,"i",51),m(2," Last"),l()}}function He(o,r){if(o&1&&(v(0),a(1,"div",39)(2,"div",40)(3,"div",41),m(4),F(5,"number"),S(6,We,3,0,"span",42)(7,Ke,3,3,"span",12),F(8,"async"),m(9),l()(),a(10,"div",43),S(11,Je,3,0,"a",44)(12,ze,3,0,"a",45),l()(),b()),o&2){let n=p().ngIf,t=p(2);c(4),I(" Showing 1 - ",k(5,6,n==null?null:n.length)," of "),c(2),s("ngIf",t.paginationService.hideCount),c(),s("ngIf",!t.paginationService.hideCount&&k(8,8,t.rowCount$)),c(2),I(" records ~ ",t.paginationService.footerPageNumber," Page "),c(2),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),c(),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}function Ye(o,r){if(o&1&&(v(0),S(1,He,13,10,"ng-container",12),b()),o&2){let n=r.ngIf;c(),s("ngIf",(n==null?null:n.length)>0)}}function Ze(o,r){if(o&1){let n=P();a(0,"mainpanel",3),f("onSubmit",function(e){u(n);let i=p();return h(i.searchProduct(e))}),a(1,"actions"),S(2,Ne,3,1,"button",4),a(3,"button",5),f("click",function(){u(n);let e=p();return h(e.openScanDialog())}),C(4,"i",6),m(5," Scan Channel "),l(),a(6,"button",7),f("click",function(){u(n);let e=p();return h(e.Export())}),C(7,"i",8),a(8,"span"),m(9,"Export"),l()()(),a(10,"content")(11,"div",9)(12,"div",10),S(13,$e,18,3,"ng-container",11),F(14,"async"),S(15,Ge,2,0,"ng-template",null,0,it),l(),S(17,Ye,2,1,"ng-container",12),F(18,"async"),l()()()}if(o&2){let n,t=j(16),e=p();s("hideSearchDropdown",!0),c(2),s("ngIf",e.hasSelectionProduct),c(11),s("ngIf",((n=k(14,5,e.data$))==null?null:n.length)>0)("ngIfElse",t),c(4),s("ngIf",k(18,7,e.data$))}}var pe=(()=>{let r=class r{constructor(t,e,i,d,g,w,Ft){this.http=t,this.dialog=e,this.toastr=i,this.productService=d,this.paginationService=g,this.biggerPictureService=w,this.authService=Ft,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannelV2",this.hasSelectionProduct=!1,this.selectedProducts=[],this.channelOptions=Ft.getChannels(),this.hostName=this.authService.getDomain()}ngOnInit(){this.initPageLoader(),this.iniData()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.notChannelAPI,this.loader$=this.http.post(`api/${this.loaderAPI}`,{}).pipe(Nt(t=>{this.filterSearch=t.Filter,this.paginationService.reloadPagination(t.Filter)}))}iniData(){this.data$=this.paginationService.data$.pipe(Tt(t=>(t=t.map(e=>(e.Variants=e.Variants.map(i=>(i.Available=this.productService.sortChannel(i.Available),i.NotAvailable=this.productService.sortChannel(i.NotAvailable),i.Available=this.assignLogoChannel(i.Available),i.NotAvailable=this.assignLogoChannel(i.NotAvailable),i)),e)),t)))}assignLogoChannel(t){return t=t.map(e=>(e.Img=_.getChannelLogoByTypeId(e.TypeID),e)),t}searchProduct(t){this.filterSearch.text=t,this.paginationService.reloadPagination(this.filterSearch)}scanAllProduct(){let t=this.productService.findChannelById(this.filterSearch.ChannelID,this.channelOptions);this.productService.scanAll(this.filterSearch.ChannelID,this.filterSearch.ScanFull,this.filterSearch.UpdatedProduct,this.filterSearch.Async).subscribe(e=>{this.filterSearch.Async?this.toastr.success("You will be notified when the scan is completed.","Scan Asynchronous"):(this.productService.successToastrScanAllProduct(e,t,!this.filterSearch.UpdatedProduct),this.initPageLoader())})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.filterSearch));t.ChannelID=_.GuidEMpty,this.dialog.open(D,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.filterSearch.ChannelID=i.ChannelID,this.filterSearch.ScanFull=i.ScanFull,this.filterSearch.UpdatedProduct=i.UpdatedProduct,this.filterSearch.Async=i.Async,this.scanAllProduct()})}getRowCount(){this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`/api/${this.rowCountAPI}`,this.filterSearch)}onNextPage(){this.paginationService.onNextPage(this.filterSearch)}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:t=>{this.filterSearch.PageNumber=1,this.paginationService.getAllData(this.filterSearch,t.Count)}})}onZoomImage(t,e){this.biggerPictureService.openBiggerPicture(t,e)}onSelectProduct(t){this.hasSelectionProduct=this.productService.hasSelection(t),this.selectedProducts=this.productService.selectedProduct(t)}uploadMultipleProduct(){let t=this.getUniqueChannels();t=t.map(e=>(e.ID=e.ChannelID,e)),this.dialog.open(Q,{width:"700px",data:{title:"Upload Multiple Product",channels:t}}).afterClosed().pipe(y(e=>_.IsNotEmpty(e)),H(e=>{let i=this.getSelectedProductIds();return this.productService.uploadNotInChannel(i,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 t=[];return this.selectedProducts.forEach(e=>{t=[...t,...e.Variants[0].NotAvailable]}),t=t.filter((e,i,d)=>d.findIndex(g=>g.ChannelID==e.ChannelID)==i),t}ngOnDestroy(){this.paginationService.destroy()}Export(){let t={ChannelID:this.filterSearch.ChannelID,PageNumber:this.filterSearch.PageNumber,RowCount:this.filterSearch.RowCount,text:this.filterSearch.text};this.http.postFile("/api/product/GetNotInChannelExport",t).subscribe(e=>{let i=window.URL.createObjectURL(e.file),d=document.createElement("a");d.download=this.getFilenameFromContentDisposition(e.title),d.href=i,d.click(),URL.revokeObjectURL(i),d.remove()})}getFilenameFromContentDisposition(t){let i=/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(t);return i!=null&&i[1]?i[1].replace(/['"]/g,""):""}};r.\u0275fac=function(e){return new(e||r)(x(G),x(J),x($),x(R),x(ie),x(qt),x(A))},r.\u0275cmp=M({type:r,selectors:[["app-not-in-channel"]],decls:2,vars:3,consts:[["EMPTY",""],["elsePic",""],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"hideSearchDropdown","onSubmit",4,"ngIf"],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"onSubmit","hideSearchDropdown"],["class","btn btn-light shadow rounded ms-2",3,"click",4,"ngIf"],["data-cy","scanNotinChannel","type","button",1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[4,"ngIf","ngIfElse"],[4,"ngIf"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-md-12"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[2,"width","10px"],["colspan","2",1,"ms-5","text-center",2,"width","450px"],[2,"width","150px"],[2,"width","20%"],[2,"width","16%"],[4,"ngFor","ngForOf"],[1,"ms-1"],["target","_blank",3,"href"],[1,"fas","fa-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,"ngModelChange","ngModel"],[2,"padding-right","0px"],[1,"text-start",3,"rowSpan"],[1,"ms-5","fw-normal","text-ellipsis",2,"max-width","26vw !important"],[3,"matTooltip"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],["alt","",1,"channel-logo","cursor-pointer","ms-4","mt-3",3,"src","matTooltip"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(e,i){e&1&&(S(0,Ze,19,9,"mainpanel",2),F(1,"async")),e&2&&s("ngIf",k(1,1,i.loader$))},dependencies:[V,U,Bt,W,K,L,ft,B,ut,ht],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}thead[_ngcontent-%COMP%]{position:sticky;top:0}.channel-logo[_ngcontent-%COMP%]{width:20px}.w-img[_ngcontent-%COMP%]{width:100%}"]});let o=r;return o})();var qe=o=>[o],Qe=()=>[];function Xe(o,r){if(o&1){let n=P();a(0,"button",15),f("click",function(){u(n);let e=p();return h(e.openScanDialog())}),C(1,"i",16),m(2," Scan Channel "),l()}}function tn(o,r){if(o&1){let n=P();v(0),a(1,"button",17),f("click",function(){u(n);let e=p();return h(e.onDownloadAllProduct("SELECTED"))}),C(2,"i",18),m(3),l(),b()}if(o&2){let n,t=p();c(3),I(" Download (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function en(o,r){if(o&1&&(a(0,"span",19),C(1,"img",20),l(),m(2)),o&2){let n=r.item;c(),s("src",n.Img,O)("alt",n.Name),c(),I(" ",n.Name," ")}}function nn(o,r){if(o&1){let n=P();a(0,"div",21)(1,"app-product-card",22),f("onCheckBoxChange",function(e){let i=u(n).index,d=p();return h(d.onSelectProduct(e,i))})("onDescEvent",function(){let e=u(n).index,i=p();return h(i.onShowVariantDetail(e))})("onDownload",function(){let e=u(n).$implicit,i=p();return h(i.onDownloadProduct(e))})("onScan",function(){let e=u(n).$implicit,i=p();return h(i.onScanChannel(e))}),l()()}if(o&2){let n=r.$implicit;c(),s("showRedirectIcon",!1)("title",n==null?null:n.Name)("image",n==null?null:n.Image)("imageForZoom",n==null?null:n.Image)("code",n==null?null:n.SKU)("description",(n==null||n.Variant==null?null:n.Variant.length)>0?(n==null||n.Variant==null?null:n.Variant.length)+" Variants":null)("downloadButton",!0)("channels",n!=null&&n.Channel?at(10,qe,n==null?null:n.Channel):tt(12,Qe))("showCheckBox",!0)("scanButton",!0)}}function on(o,r){o&1&&(v(0),a(1,"div",23),C(2,"app-empty-state"),l(),b())}function rn(o,r){if(o&1){let n=P();a(0,"div",24)(1,"div",25)(2,"app-custom-paginator",26),f("total",function(){u(n);let e=p();return h(e.getRowCount())})("next",function(){u(n);let e=p();return h(e.onNextPage())})("previous",function(){u(n);let e=p();return h(e.onPreviousPage())}),l()()()}if(o&2){let n=p();c(2),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}var de=(()=>{let r=class r{constructor(t,e,i,d,g,w){this.http=t,this.dialog=e,this.productService=i,this.toastrService=d,this.activateRouter=g,this.authService=w,this.searchFilter=new q,this.products=[],this.hasClickRowCount=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(_.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(e=>{this.searchFilter=e.Filter,this.searchFilter.PageSize=e.Filter.RowCount,this.getProducts()})}getProducts(){this.http.post("/api/product/GetProductChannelNotPOS",this.searchFilter).subscribe(t=>{this.products=t.Data,this.mapChannelToProduct(),this.setSkuProduct()})}mapChannelToProduct(){let t;this.products=this.products.map(e=>(t=this.channelOptions.find(i=>i.ID==e.ChannelID),t?e.Channel=JSON.parse(JSON.stringify(t)):e.Channel=null,e)).map(e=>(e.Channel&&(e.Channel.Url=e.Url),e))}setSkuProduct(){this.products=this.products.map(t=>(t?.Variant?.length==0?_.IsNotEmpty(t?.ChannelItemSKU)?t.SKU=t?.ChannelItemSKU:t.SKU="SKU not assigned":t.SKU=t?.Variant[0]?.ChannelVariationSKU?t?.Variant[0]?.ChannelVariationSKU:"SKU not assigned",t))}onSearch(t){this.searchFilter.text=t,this.hasClickRowCount=!1,this.getProducts()}onClearChannelFilter(){this.searchFilter.ChannelID=_.GuidEMpty}onScanAll(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(e=>{this.searchFilter.Async?this.toastrService.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.initPageLoader(_.GuidEMpty),this.productService.successToastrScanAllProduct(e,t,!this.searchFilter.UpdatedProduct)),this.searchFilter.ChannelID=_.GuidEMpty})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=_.GuidEMpty,this.dialog.open(D,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.Async=i.Async,this.onScanAll()})}onDownloadAllProduct(t){let e;t=="ALL"?e=this.products:e=this.productService.selectedProduct(this.products),e.length>0&&this.productService.downloadMultipleProduct(e).subscribe({next:()=>{this.getProducts()}})}onSelectProduct(t,e){this.products[e].selected=t}onDownloadProduct(t){confirm(`Are you sure you want to Retrieve product ${t?.Name} from ${t?.Channel.Name} to POS?`)&&this.productService.downloadProduct(t).subscribe({next:()=>{this.getProducts()}})}onScanChannel(t){let e=JSON.parse(JSON.stringify(t));delete e.Channel,this.productService.scanCompareToPos([e]).subscribe(i=>{i.Status?(this.initPageLoader(_.GuidEMpty),this.toastrService.success(`product ${t.Name} have been successfully scanned and synchronized with POS`,"Success")):this.toastrService.error(`Product ${t.Name} is not existed in POS`,"Error")})}onShowVariantDetail(t){let e=this.products[t].Variant;e.length>0&&this.dialog.open(oe,{data:{title:this.products[t].Name,variants:e},width:"30%"})}getRowCount(){let t={ChannelID:this.searchFilter.ChannelID,text:this.searchFilter.text,HaveSku:parseInt(this.searchFilter.HaveSku)};this.http.post("/api/product/GetProductChannelNotPOSRowCount",t).subscribe(e=>{this.hasClickRowCount=!0,this.rowCount=e.Count})}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPreviousPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}};r.\u0275fac=function(e){return new(e||r)(x(G),x(J),x(R),x($),x(_t),x(A))},r.\u0275cmp=M({type:r,selectors:[["app-not-in-pos"]],decls:30,vars:13,consts:[["headerTitle","Not in POS","textButton","Search","description","SKU sold in Marketplace but not exist in DEALPOS",3,"onSubmit"],["type","button","data-cy","scanNotInPos","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],[4,"ngIf"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp",""],[1,"mt-5"],[1,"fw-bold"],["name","haveSKU",1,"form-control","h-100","pt-3","rounded","mt-2",3,"ngModelChange","ngModel"],[1,"me-5",3,"value"],["type","text","name","Item_id","id","Item_id","placeholder","item id",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button","data-cy","scanNotInPos",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","ms-3",3,"click"],[1,"fa","fa-download"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onCheckBoxChange","onDescEvent","onDownload","onScan","showRedirectIcon","title","image","imageForZoom","code","description","downloadButton","channels","showCheckBox","scanButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(e,i){e&1&&(a(0,"mainpanel",0),f("onSubmit",function(g){return i.onSearch(g)}),a(1,"actions"),S(2,Xe,3,0,"button",1)(3,tn,4,1,"ng-container",2),l(),a(4,"filters")(5,"div")(6,"label",3),m(7,"Channel"),l(),a(8,"ng-select",4),E("ngModelChange",function(g){return N(i.searchFilter.ChannelID,g)||(i.searchFilter.ChannelID=g),g}),S(9,en,3,3,"ng-template",5),l()(),a(10,"div",6)(11,"label",7),m(12,"SKU Assigned"),l(),a(13,"mat-radio-group",8),E("ngModelChange",function(g){return N(i.searchFilter.HaveSku,g)||(i.searchFilter.HaveSku=g),g}),a(14,"mat-radio-button",9),m(15," All "),l(),a(16,"mat-radio-button",9),m(17," Yes "),l(),a(18,"mat-radio-button",9),m(19," No "),l()()(),a(20,"div",6)(21,"label",7),m(22,"Item ID"),l(),a(23,"input",10),E("ngModelChange",function(g){return N(i.searchFilter.Item_id,g)||(i.searchFilter.Item_id=g),g}),l()()(),a(24,"content")(25,"div",11)(26,"div",12),S(27,nn,2,13,"div",13)(28,on,3,0,"ng-container",2),l(),S(29,rn,3,4,"div",14),l()()()),e&2&&(c(2),s("ngIf",!i.productService.hasSelection(i.products)),c(),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("items",i.channelOptions),T("ngModel",i.searchFilter.ChannelID),c(5),T("ngModel",i.searchFilter.HaveSku),c(),s("value",0),c(2),s("value",1),c(2),s("value",2),c(5),T("ngModel",i.searchFilter.Item_id),c(4),s("ngForOf",i.products),c(),s("ngIf",i.products.length==0),c(),s("ngIf",(i.products==null?null:i.products.length)>0))},dependencies:[V,U,ot,W,K,L,Z,rt,Ht,Yt,z,X,B],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.itemTitle[_ngcontent-%COMP%]{cursor:pointer}"]});let o=r;return o})();function an(o,r){if(o&1&&(a(0,"span",9),C(1,"img",10),l(),m(2)),o&2){let n=r.item,t=p();c(),s("src",t.getChannelLogo(n.TypeID),O),c(),I(" ",n.Name," ")}}function ln(o,r){if(o&1&&(a(0,"div",11),C(1,"app-duplicate-product-card",12),l()),o&2){let n=r.$implicit,t=r.index;c(),s("imageForZoom",n.ImageUrl)("title",n.Name)("code",n.Code)("id",t)("image",n.ThumbnailURL)("channels",n.Channels)}}function cn(o,r){o&1&&(v(0),a(1,"div",13),C(2,"app-empty-state"),l(),b())}function sn(o,r){if(o&1){let n=P();v(0),a(1,"div",14)(2,"div",15)(3,"app-custom-paginator",16),f("next",function(){u(n);let e=p();return h(e.onNextPage())})("previous",function(){u(n);let e=p();return h(e.onPrevPage())})("total",function(){u(n);let e=p();return h(e.getRowCount())}),l()()(),b()}if(o&2){let n=p();c(3),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickedRowCount)}}var me=(()=>{let r=class r{constructor(t,e,i){this.httpService=t,this.productService=e,this.authService=i,this.searchFilter=new q,this.products=[],this.hasClickedRowCount=!1,this.getPageLoader(),this.channelOptions=i.getChannels()}getPageLoader(){this.productService.loader().subscribe(t=>{this.searchFilter=t.Filter,this.searchFilter.PageSize=t.Filter.RowCount,this.getProducts()})}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,RowCount:this.searchFilter.RowCount,PageNumber:this.searchFilter.PageNumber,text:this.searchFilter.text};this.httpService.post("/api/product/GetDuplicateInChannel",t).subscribe(e=>{this.products=e.Data})}onSearch(t){this.searchFilter.text=t,this.hasClickedRowCount=!1,this.getProducts()}onClearFilter(){this.searchFilter.ChannelID=_.GuidEMpty}getChannelLogo(t){return _.getChannelLogoByTypeId(t)}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPrevPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}getRowCount(){let t={text:this.searchFilter.text,ChannelID:this.searchFilter.ChannelID};this.httpService.post("/api/product/GetDuplicateInChannelRowCount",t).subscribe(e=>{this.hasClickedRowCount=!0,this.rowCount=e.Total})}};r.\u0275fac=function(e){return new(e||r)(x(G),x(R),x(A))},r.\u0275cmp=M({type:r,selectors:[["app-duplicate-sku"]],decls:14,vars:7,consts:[["headerTitle","Multiple Listing","textButton"," Search","description","SKU(s) which is listed more than one time (one to many)",3,"onSubmit"],["container",""],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clear","multiple","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid"],[1,"row","mt-8","mx-1"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"imageForZoom","title","code","id","image","channels"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"next","previous","total","filter","totaldata","paginationTotal","hasClicked"]],template:function(e,i){e&1&&(a(0,"mainpanel",0),f("onSubmit",function(g){return i.onSearch(g)}),a(1,"filters")(2,"div",1)(3,"div")(4,"h6",2),m(5,"Channel"),l(),a(6,"ng-select",3),E("ngModelChange",function(g){return N(i.searchFilter.ListChannelID,g)||(i.searchFilter.ListChannelID=g),g}),f("clear",function(){return i.onClearFilter()}),S(7,an,3,2,"ng-template",4),l()()()(),a(8,"content")(9,"div",5)(10,"div",6),S(11,ln,2,6,"div",7)(12,cn,3,0,"ng-container",8),l(),S(13,sn,4,4,"ng-container",8),l()()()),e&2&&(c(6),s("multiple",!0)("clearable",!0)("items",i.channelOptions),T("ngModel",i.searchFilter.ListChannelID),c(5),s("ngForOf",i.products),c(),s("ngIf",(i.products==null?null:i.products.length)==0),c(),s("ngIf",(i.products==null?null:i.products.length)>0))},dependencies:[V,U,W,K,L,Z,rt,Ct,xt,z,B]});let o=r;return o})();var pn=()=>["/menu/products/status/sold-in-channel"],ue=o=>({ID:o}),dn=()=>["/menu/products/status/not-in-pos"];function mn(o,r){if(o&1&&(v(0),m(1),b()),o&2){let n=p().$implicit;c(),I(" ",n.Count," ")}}function un(o,r){if(o&1){let n=P();a(0,"span",26),f("click",function(){u(n);let e=p().$implicit,i=p(2);return h(i.getLiveProductCount(e.ID,e))}),C(1,"i",27),l()}}function hn(o,r){if(o&1){let n=P();a(0,"tr")(1,"td"),C(2,"img",17),a(3,"span",18),m(4),l()(),a(5,"td",19),S(6,mn,2,1,"ng-container",6)(7,un,2,0,"ng-template",null,1,it),l(),a(9,"td",19)(10,"a",20),m(11),F(12,"number"),l()(),a(13,"td",19)(14,"a",20),m(15),F(16,"number"),l()(),a(17,"td"),m(18),F(19,"date"),l(),a(20,"td")(21,"div",21)(22,"button",22),f("click",function(){let e=u(n).$implicit,i=p(2);return h(i.onScanChannel(e))}),C(23,"i",23),m(24," Scan "),l(),a(25,"button",24),f("click",function(){let e=u(n).$implicit,i=p(2);return h(i.onClearCache(e.ID))}),C(26,"i",25),m(27," Clear "),l()()()()}if(o&2){let n=r.$implicit,t=j(8),e=p(2);c(2),s("src",e.getChannelLogo(n.TypeID),O),c(2),mt(n.Name),c(2),s("ngIf",n.Count!==void 0)("ngIfElse",t),c(4),s("routerLink",tt(18,pn))("queryParams",at(19,ue,n.ID)),c(),I(" ",k(12,11,n.SoldInChannel)," "),c(3),s("routerLink",tt(21,dn))("queryParams",at(22,ue,n.ID)),c(),I(" ",k(16,13,n.NotInPOS)," "),c(3),I("",n.LastSync?Vt(19,15,n.LastSync,"dd MMM yyyy HH:mm"):"-"," ")}}function _n(o,r){if(o&1&&(v(0),a(1,"div",7)(2,"table",8)(3,"thead",9)(4,"tr",10)(5,"th"),m(6,"Channel"),l(),a(7,"th",11),m(8,"Live Product"),l(),a(9,"th",12),m(10,"Sold In Channel"),l(),a(11,"th",13),m(12,"Product Not in POS"),l(),a(13,"th",14),m(14,"Last Sync"),l(),C(15,"th",15),l()(),a(16,"tbody"),S(17,hn,28,24,"tr",16),F(18,"async"),l()()(),b()),o&2){let n,t=p();c(17),s("ngForOf",(n=k(18,1,t.channels$))==null?null:n.Data)}}function gn(o,r){o&1&&(a(0,"div",28),C(1,"app-empty-state"),l())}var he=(()=>{let r=class r{constructor(t,e,i,d){this.productService=t,this.toastr=e,this.dialog=i,this.authService=d,this.destroy$=new Dt,this.channelOptions=d.getChannels()}ngOnInit(){this.setObsProductStatistic()}setObsProductStatistic(){this.channels$=this.productService.getProductStatistic()}getLiveProductCount(t,e){this.productService.getTotalProductLive(t).pipe(wt(this.destroy$)).subscribe(i=>{e.Count=i.Count})}onScanChannel(t){this.dialog.open(D,{width:"700px",data:{channelOptions:this.channelOptions,filter:{ChannelID:t.ID},disabledChannelOption:!0}}).afterClosed().pipe(y(e=>_.IsNotEmpty(e))).subscribe(e=>{this.scanAllProduct(t.ID,e)})}scanAllProduct(t,e){let i=this.productService.findChannelById(t,this.channelOptions);this.productService.scanAll(e.ChannelID,e.ScanFull,e.UpdatedProduct,e.Async).pipe(y(d=>d)).subscribe(d=>{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(d,i,!e.UpdatedProduct),this.setObsProductStatistic())})}onClearCache(t){confirm("Are you sure you want to Clear Cache? This Process will remove your product integration to marketplace")&&this.productService.clearCacheChannel(t).pipe(wt(this.destroy$)).subscribe(i=>{this.toastr.success("Successfully cleared cache","Success"),this.setObsProductStatistic()})}getChannelLogo(t){return _.getChannelLogoByTypeId(t)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};r.\u0275fac=function(e){return new(e||r)(x(R),x($),x(J),x(A))},r.\u0275cmp=M({type:r,selectors:[["app-channel-statistic"]],decls:9,vars:6,consts:[["EMPTY",""],["QUESTION",""],["headerTitle","Products Statistic",3,"hideSearchBox","hideSearchDropdown"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[1,"text-center",2,"width","13rem"],[1,"text-center",2,"width","9rem"],[1,"text-center",2,"width","14rem"],[2,"width","10rem"],[2,"width","12rem"],[4,"ngFor","ngForOf"],[2,"width","24px","height","24px",3,"src"],[1,"ms-3"],[1,"text-center"],[3,"routerLink","queryParams"],[1,"d-flex","align-items-center","justify-content-center"],[1,"btn","btn-sm","btn-secondary","fs-6",3,"click"],[1,"fa","fa-spinner"],[1,"btn","btn-sm","btn-secondary","fs-6","ms-3",3,"click"],[1,"fa","fa-trash"],["matTooltip","Click to see total live product",1,"cursor-pointer","fs-5","text-primary",3,"click"],[1,"fa-solid","fa-circle-question","cursor"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(e,i){if(e&1&&(a(0,"mainpanel",2)(1,"content")(2,"div",3)(3,"div",4)(4,"div",5),S(5,_n,19,3,"ng-container",6),F(6,"async"),S(7,gn,2,0,"ng-template",null,0,it),l()()()()()),e&2){let d,g=j(8);s("hideSearchBox",!0)("hideSearchDropdown",!0),c(5),s("ngIf",((d=k(6,4,i.channels$))==null||d.Data==null?null:d.Data.length)>0)("ngIfElse",g)}},dependencies:[V,U,L,ft,gt,B,ut,ht,Ut]});let o=r;return o})();var Cn=[{component:ae,path:"",children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:ce,canActivate:[et],data:{title:"Products in POS"}},{path:"sold-in-channel",component:se,canActivate:[et],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:pe,canActivate:[et],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:de,canActivate:[et],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:me,canActivate:[et],data:{title:"Duplicate Sku in Channel"}},{path:"channel-statistic",component:he,canActivate:[et],data:{title:"Channel Statistic"}}]}],Fi=(()=>{let r=class r{};r.\u0275fac=function(e){return new(e||r)},r.\u0275mod=kt({type:r}),r.\u0275inj=Et({imports:[At,jt,Kt,Wt,$t,re,Zt,zt,xt,z,X,Rt.forChild(Cn),ne,Gt]});let o=r;return o})();export{Fi as StatusModule};
1
+ import{a as D,b as St,d as Q,e as oe}from"./chunk-INC2ZO2P.js";import{a as q}from"./chunk-IWVYX6KY.js";import{a as B}from"./chunk-NRVXDIHY.js";import{d as Qt,e as Xt,f as te,g as ee,k as ne}from"./chunk-XDNW2F3I.js";import{a as X,b as xt}from"./chunk-5LCXVQBT.js";import{a as z}from"./chunk-PZOGC5DT.js";import{a as Ht,b as Yt,c as Zt}from"./chunk-G5LCLRIW.js";import{b as re}from"./chunk-DEH6NGKQ.js";import"./chunk-5ZUWMFL5.js";import"./chunk-TDHJ34QP.js";import{a as ie}from"./chunk-KBYAFLE5.js";import{a as R}from"./chunk-U5YOE633.js";import"./chunk-INNTQ5YN.js";import{a as Jt,b as zt}from"./chunk-SRYGE2HW.js";import{a as qt}from"./chunk-MYMGWQRE.js";import"./chunk-DT3B54LD.js";import{a as rt,b as Ct,d as Z,e as $t}from"./chunk-AL67KXJV.js";import{a as et}from"./chunk-GIB66QXC.js";import{g as A}from"./chunk-2OH65RRD.js";import{b as $,e as G}from"./chunk-K3G6FMDF.js";import"./chunk-JM3LERUP.js";import{C as L,D as Kt,q as ft,r as Wt,u as J}from"./chunk-ZKBLXGXT.js";import{N as Gt}from"./chunk-6B64VOO7.js";import{b as Bt,c as ot,h as W,k as K,u as jt}from"./chunk-SP6QPE3M.js";import{b as Y,c as _}from"./chunk-6F6NSBIF.js";import{Ab as m,B as y,Bb as mt,Cb as I,Eb as T,Fb as N,Gb as E,Ha as O,Ia as c,Ja as x,Jb as tt,Kb as at,Rb as F,Sb as k,T as H,Tb as Vt,Ub as it,V as wt,Vc as _t,Wa as S,Wc as Lt,X as Nt,Ya as s,Yc as gt,_c as Rt,aa as Et,c as Dt,fb as a,gb as l,ha as M,hb as C,ia as kt,ib as v,jb as b,kc as V,lb as P,lc as U,ob as f,oc as ut,pa as u,pc as Ut,q as Tt,qa as h,qb as p,rc as ht,sc as At,zb as j}from"./chunk-6DRNAUKE.js";import"./chunk-GRMIXZTT.js";var _e=()=>["/menu/products/download/by-url"],ae=(()=>{let r=class r{constructor(){this.productTabs=[{Title:"Sold in Channel",Url:"/menu/products/status/sold-in-channel",Description:"SKU has been mapped between dealpos and marketplace"},{Title:"Not in POS",Url:"/menu/products/status/not-in-pos",Description:"SKU sold in Marketplace but not exist in DEALPOS"},{Title:"Not in Channel",Url:"/menu/products/status/not-in-channel",Description:"SKU has not been sold on one of channels"},{Title:"In POS",Url:"/menu/products/status/in-pos",Description:"All products which is already available in POS"},{Title:"Multiple Listing",Url:"/menu/products/status/duplicate-sku",Description:"SKU(s) which is listed more than one time (one to many)"},{Title:"Channel Statistic",Url:"/menu/products/status/channel-statistic",Description:"Product statistic from each channel obtained from the last product scan"}]}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=M({type:r,selectors:[["app-status"]],decls:13,vars:3,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-flex"],[1,"dropdown-item",3,"routerLink"]],template:function(e,i){e&1&&(a(0,"nav",0)(1,"div",1)(2,"div"),C(3,"nav-tab",2),l()(),a(4,"div")(5,"div",3)(6,"a",4),C(7,"i",5),l(),a(8,"div",6)(9,"div",7)(10,"a",8),m(11,"Download Product By Url"),l()()()()()(),C(12,"router-outlet")),e&2&&(c(3),s("Tabs",i.productTabs),c(7),s("routerLink",tt(2,_e)))},dependencies:[Jt,Lt,gt]});let o=r;return o})();function ge(o,r){if(o&1){let n=P();a(0,"button",13),f("click",function(){u(n);let e=p(2);return h(e.onOpenScanDialog())}),C(1,"i",14),m(2," Scan Channel "),l()}}function Ce(o,r){if(o&1&&(v(0),S(1,ge,3,0,"button",12),b()),o&2){let n=p();c(),s("ngIf",!n.productService.hasSelection(n.products))}}function fe(o,r){if(o&1){let n=P();v(0),a(1,"button",15),f("click",function(){u(n);let e=p();return h(e.onScanMultipleProduct())}),C(2,"i",14),m(3),l(),b()}if(o&2){let n,t=p();c(3),I(" Scan (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function Se(o,r){if(o&1){let n=P();v(0),a(1,"button",16),f("click",function(){u(n);let e=p();return h(e.onUploadMultipleProduct())}),C(2,"i",17),m(3),l(),b()}if(o&2){let n,t=p();c(3),I(" Upload (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function xe(o,r){if(o&1){let n=P();a(0,"div",18)(1,"app-product-card",19),f("onUpload",function(){let e=u(n).$implicit,i=p();return h(i.onUploadToMultipleChannel(e))})("onScan",function(){let e=u(n).$implicit,i=p();return h(i.onScanSingleProduct(e))})("onDescEvent",function(){let e=u(n).index,i=p();return h(i.onOpenDialogVariant(e))})("onCheckBoxChange",function(e){let i=u(n).$implicit;return h(i.selected=e)}),l()()}if(o&2){let n=r.$implicit,t=p();c(),s("productId",n.ID)("title",n==null?null:n.Name)("image",n==null?null:n.ThumbnailUrl)("description",(n==null?null:n.Variants.length)>1?(n==null?null:n.Variants.length)+" Variants":null)("channels",t.productService.getChannelProduct(n))("code",t.getVariantCode(n==null?null:n.Variants))("showCheckBox",(n==null?null:n.Channel.length)<t.channelOptions.length)("scanButton",!0)("uploadButton",n==null?null:n.hasUpload)("imageForZoom",n==null?null:n.ImageUrl)}}function Pe(o,r){o&1&&(v(0),a(1,"div",20),C(2,"app-empty-state"),l(),b())}function ve(o,r){if(o&1){let n=P();v(0),a(1,"div",21)(2,"div",22)(3,"app-custom-paginator",23),f("next",function(){u(n);let e=p();return h(e.onNextPage())})("previous",function(){u(n);let e=p();return h(e.onPrevPage())}),l()()(),b()}if(o&2){let n=p();c(3),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",!0)}}var ce=(()=>{let r=class r{constructor(t,e,i,d,g){this.http=t,this.toastr=e,this.dialog=i,this.productService=d,this.authService=g,this.searchFilter=new q,this.products=[],this.rowCount=0,this.multipeScanChannels=[],this.getLoaderPage(),this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}getLoaderPage(){this.productService.LoadInPOS().subscribe(t=>{this.Categories=t.Options.Categories,this.searchFilter.PageNumber=t.Filter.PageNumber,this.searchFilter.RowCount=t.Filter.RowCount,this.searchFilter.ChannelID=null,this.searchFilter.Category=t.Filter.Category,this.searchFilter.PageSize=100,this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[Y.Tokopedia,Y.Tiktok])}getProducts(){let t={PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Category:this.searchFilter.Category,From:this.startDate,To:this.endDate};this.http.post("/api/product/GetInPOS",t).subscribe(e=>{this.products=e.Data,this.rowCount=e.Total==null?this.searchFilter.RowCount:e.Total.toString(),this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions)})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=_.GuidEMpty,this.dialog.open(D,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.Async,this.scanAllProduct()})}scanAllProduct(){if(this.searchFilter.ChannelID==null){this.toastr.error("Please Select Channel","Error");return}this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(t=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{this.getLoaderPage();let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,e,!this.searchFilter.UpdatedProduct)}})}onOpenDialogVariant(t){this.dialog.open(St,{data:{title:this.products[t].Name,variants:this.products[t].Variants},width:"800px"})}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products),e=this.productService.filterUnselectedChannel(t,this.channelOptions);this.dialog.open(Q,{width:"700px",data:{title:"Upload Multiple Product",channels:e}}).afterClosed().pipe(y(i=>_.IsNotEmpty(i)),H(i=>this.productService.uploadMultipleProduct(t,i))).subscribe({next:i=>{this.getProducts()}})}onUploadToMultipleChannel(t){let e=this.productService.getChannelProduct(t);t.Channel=e;let i=this.productService.filterUnselectedChannel([t],this.channelOptions);this.dialog.open(Q,{width:"700px",data:{title:`Upload - ${t.Name}`,channels:i,product:t}}).afterClosed().pipe(y(d=>_.IsNotEmpty(d)),H(d=>this.productService.uploadSingleProduct([t],d))).subscribe({next:d=>{this.getProducts()}})}searchProduct(t){this.searchFilter.text=t,this.getProducts()}onNextPage(){this.getProducts()}onPrevPage(){this.getProducts()}onScanMultipleProduct(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=_.GuidEMpty;let e=this.productService.filterChannelByTypeId(this.channelOptions,[Y.Tokopedia,Y.Tiktok]);this.dialog.open(D,{data:{filter:t,channelOptions:e,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(d=>_.IsNotEmpty(d))).subscribe(d=>{this.searchFilter.ChannelID=d.ChannelID,this.searchFilter.ScanFull=d.ScanFull,this.searchFilter.UpdatedProduct=d.UpdatedProduct;let g=this.productService.selectedProduct(this.products),w=this.productService.getVariantCodesProducts(g);this.scanSingleProduct(w)})}onScanSingleProduct(t){let e=JSON.parse(JSON.stringify(this.searchFilter));e.ChannelID=_.GuidEMpty,this.dialog.open(D,{data:{filter:e,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID;let d=this.productService.getVariantCodesProduct(t);this.scanSingleProduct(d)})}scanSingleProduct(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:e=>{if(e)this.toastr.success("Successfully Scan ","Success");else{let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${i?.Name} `,"Error")}this.searchFilter.ChannelID=_.GuidEMpty,e&&this.getProducts()},error:e=>{this.searchFilter.ChannelID=_.GuidEMpty}})}getVariantCode(t){let e;return t.length>1&&(e=(t[0].model?t[0].model:"")+t[0].Code),t.length==1&&(e=t[0].Code),e}};r.\u0275fac=function(e){return new(e||r)(x(G),x($),x(J),x(R),x(A))},r.\u0275cmp=M({type:r,selectors:[["app-in-pos"]],decls:22,vars:13,consts:[["picker",""],["description","All products which is already available in POS",3,"onSubmit","headerTitle"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","Name","bindValue","Name","placeholder","Select Category",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[1,"mt-5"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["type","button","data-cy","scanSoldinChannel","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onUpload","onScan","onDescEvent","onCheckBoxChange","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(e,i){if(e&1){let d=P();a(0,"mainpanel",1),f("onSubmit",function(w){return u(d),h(i.searchProduct(w))}),a(1,"actions"),S(2,Ce,2,1,"ng-container",2)(3,fe,4,1,"ng-container",2)(4,Se,4,1,"ng-container",2),l(),a(5,"filters")(6,"div")(7,"label",3),m(8,"Category"),l(),a(9,"ng-select",4),f("ngModelChange",function(w){return u(d),h(i.searchFilter.Category=w)}),l()(),a(10,"div",5)(11,"mat-date-range-input",6)(12,"input",7),E("ngModelChange",function(w){return u(d),N(i.startDate,w)||(i.startDate=w),h(w)}),f("click",function(){u(d);let w=j(15);return h(w.open())}),l(),a(13,"input",8),E("ngModelChange",function(w){return u(d),N(i.endDate,w)||(i.endDate=w),h(w)}),f("click",function(){u(d);let w=j(15);return h(w.open())}),l()(),C(14,"mat-date-range-picker",null,0),l()(),a(16,"content")(17,"div",9)(18,"div",10),S(19,xe,2,10,"div",11)(20,Pe,3,0,"ng-container",2),l(),S(21,ve,4,4,"ng-container",2),l()()()}if(e&2){let d=j(15);s("headerTitle","In POS ("+i.rowCount+")"),c(2),s("ngIf",!i.productService.hasSelection(i.products)),c(),s("ngIf",i.productService.hasSelection(i.products)&&i.multipeScanChannels.length>0),c(),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("items",i.Categories)("ngModel",i.searchFilter.Category),c(2),s("rangePicker",d),c(),T("ngModel",i.startDate),c(),T("ngModel",i.endDate),c(6),s("ngForOf",i.products),c(),s("ngIf",i.products.length==0),c(),s("ngIf",i.products.length>0)}},dependencies:[V,U,ot,W,K,L,Z,z,X,B,te,Qt,Xt,ee],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.img-logo[_ngcontent-%COMP%]{height:24px;width:24px}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}"]});let o=r;return o})();function be(o,r){if(o&1){let n=P();v(0),a(1,"button",10),f("click",function(){u(n);let e=p();return h(e.onOpenScanDialog())}),C(2,"i",11),m(3," Scan Channel "),l(),b()}}function Ie(o,r){if(o&1){let n=P();v(0),a(1,"button",12),f("click",function(){u(n);let e=p();return h(e.onScanMultipleProduct())}),C(2,"i",11),m(3),l(),b()}if(o&2){let n=p();c(3),I(" Scan (",n.productService.selectedProduct(n.products).length,") ")}}function we(o,r){if(o&1){let n=P();v(0),a(1,"button",13),f("click",function(){u(n);let e=p();return h(e.onUploadMultipleProduct())}),C(2,"i",14),m(3),l(),b()}if(o&2){let n=p();c(3),I(" Upload (",n.productService.selectedProduct(n.products).length,") ")}}function ye(o,r){if(o&1&&(a(0,"span",15),C(1,"img",16),l(),m(2)),o&2){let n=r.item;c(),s("src",n.Img,O)("alt",n.Name),c(),I(" ",n.Name," ")}}function Me(o,r){if(o&1){let n=P();a(0,"div",17)(1,"label",18),m(2,"Item ID"),l(),a(3,"input",19),E("ngModelChange",function(e){u(n);let i=p();return N(i.searchFilter.Item_id,e)||(i.searchFilter.Item_id=e),h(e)}),l()()}if(o&2){let n=p();c(3),T("ngModel",n.searchFilter.Item_id)}}function Oe(o,r){if(o&1){let n=P();a(0,"div",20)(1,"app-product-card",21),f("onUpload",function(){let e=u(n).$implicit,i=p();return h(i.onUploadToMultipleChannel(e))})("onDescEvent",function(){let e=u(n).index,i=p();return h(i.onOpenVariantDetail(e))})("onScan",function(){let e=u(n).$implicit,i=p();return h(i.onScanSingleProduct(e))})("onCheckBoxChange",function(e){let i=u(n).$implicit;return h(i.selected=e)}),l()()}if(o&2){let n=r.$implicit,t=p();c(),s("productId",n==null?null:n.ID)("title",n==null?null:n.Name)("image",n==null?null:n.ThumbnailUrl)("description",(n==null||n.Variants==null?null:n.Variants.length)>1?(n==null||n.Variants==null?null:n.Variants.length)+" Variants":null)("channels",t.productService.getChannelProduct(n))("code",t.getVariantCode(n==null?null:n.Variants))("showCheckBox",n==null?null:n.hasScan)("scanButton",!0)("uploadButton",n==null?null:n.hasUpload)("imageForZoom",n==null?null:n.ImageUrl)}}function Fe(o,r){o&1&&(v(0),a(1,"div",22),C(2,"app-empty-state"),l(),b())}function De(o,r){if(o&1){let n=P();a(0,"div",23)(1,"div",24)(2,"app-custom-paginator",25),f("total",function(){u(n);let e=p();return h(e.getRowCount())})("next",function(){u(n);let e=p();return h(e.onNextPage())})("previous",function(){u(n);let e=p();return h(e.onPreviousPage())}),l()()()}if(o&2){let n=p();c(2),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}var se=(()=>{let r=class r{constructor(t,e,i,d,g,w){this.http=t,this.dialog=e,this.toastr=i,this.productService=d,this.activateRouter=g,this.authService=w,this.searchFilter=new q,this.products=[],this.rowCount=0,this.hasClickRowCount=!1,this.guidEmpty=_.GuidEMpty,this.multipeScanChannels=[],this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(_.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(e=>{this.searchFilter=e.Filter,e.Filter.ChannelID!=_.GuidEMpty&&(this.searchFilter.ListChannelID=[],this.searchFilter.ListChannelID.push(e.Filter.ChannelID)),this.searchFilter.PageSize=e.Filter.RowCount,this.searchFilter.Item_id="",this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[Y.Tokopedia,Y.Tiktok])}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Item_id:this.searchFilter.Item_id};this.productService.findAllSoldInChannel(t).subscribe(e=>{this.products=e.Data,this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions),this.products=this.productService.checkProductHasScanButton(this.products,this.channelOptions)})}searchProduct(t){this.searchFilter.text=t,this.hasClickRowCount=!1,this.getProducts()}onOpenVariantDetail(t){let e=this.products[t].Variants;this.dialog.open(St,{data:{variants:e,title:this.products[t].Name},width:"800px"})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=_.GuidEMpty,this.dialog.open(D,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.Async,this.scanAllProduct()})}scanAllProduct(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).pipe(y(e=>e)).subscribe(e=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(e,t,!this.searchFilter.UpdatedProduct),this.initPageLoader(_.GuidEMpty))})}onScanSingleProduct(t){t.Channel=this.productService.getChannelProduct(t);let e=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(D,{data:{filter:e,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID;let d=this.productService.getVariantCodesProduct(t);this.scanProducts(d)})}onUploadToMultipleChannel(t){let e=this.productService.getChannelProduct(t);t.Channel=e;let i=this.productService.filterUnselectedChannel([t],this.channelOptions);this.dialog.open(Q,{width:"700px",data:{title:`Upload - ${t.Name}`,channels:i,product:t}}).afterClosed().pipe(y(d=>_.IsNotEmpty(d)),H(d=>this.productService.uploadSingleProduct([t],d))).subscribe({next:d=>{this.getProducts()}})}onScanMultipleProduct(){this.searchFilter.ChannelID=_.GuidEMpty;let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(D,{data:{filter:t,channelOptions:this.multipeScanChannels,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct;let d=this.productService.selectedProduct(this.products),g=this.productService.getVariantCodesProducts(d);this.scanProducts(g)})}scanProducts(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:e=>{let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);e?this.toastr.success(`Product Successfully scan with ${i?.Name}`,"Success"):this.toastr.error(`This product is not existed in ${i?.Name} `,"Error"),this.searchFilter.ChannelID=_.GuidEMpty,e&&this.getProducts()},error:e=>{this.searchFilter.ChannelID=_.GuidEMpty}})}getVariantCode(t){let e;return t.length>1&&(e=(t[0].model?t[0].model:"")+t[0].Code),t.length==1&&(e=t[0].Code),e}onClearFilterChannel(){this.searchFilter.ChannelID=_.GuidEMpty,this.searchFilter.Item_id=""}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products),e=this.productService.filterUnselectedChannel(t,this.channelOptions);this.dialog.open(Q,{width:"700px",data:{title:"Upload Multiple Product",channels:e}}).afterClosed().pipe(y(i=>_.IsNotEmpty(i)),H(i=>this.productService.uploadMultipleProduct(t,i))).subscribe({next:i=>{this.getProducts()}})}getRowCount(){let t={ListChannelID:this.searchFilter.ListChannelID,text:this.searchFilter.text};this.http.post("/api/product/GetSoldInChannelRowCount",t).subscribe(e=>{this.hasClickRowCount=!0,this.rowCount=e.Total})}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPreviousPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}};r.\u0275fac=function(e){return new(e||r)(x(G),x(J),x($),x(R),x(_t),x(A))},r.\u0275cmp=M({type:r,selectors:[["app-sold-in-channel"]],decls:18,vars:12,consts:[["description","SKU has been mapped between dealpos and marketplace",3,"onSubmit","headerTitle"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clear","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],["class","mt-5",4,"ngIf"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"mt-5"],[1,"fw-bold"],["type","text","name","Item_id","id","Item_id",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onUpload","onDescEvent","onScan","onCheckBoxChange","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(e,i){e&1&&(a(0,"mainpanel",0),f("onSubmit",function(g){return i.searchProduct(g)}),a(1,"actions"),S(2,be,4,0,"ng-container",1)(3,Ie,4,1,"ng-container",1)(4,we,4,1,"ng-container",1),l(),a(5,"filters")(6,"div")(7,"label",2),m(8,"Channel"),l(),a(9,"ng-select",3),f("ngModelChange",function(g){return i.searchFilter.ListChannelID=g})("clear",function(){return i.onClearFilterChannel()}),S(10,ye,3,3,"ng-template",4),l()(),S(11,Me,4,1,"div",5),l(),a(12,"content")(13,"div",6)(14,"div",7),S(15,Oe,2,10,"div",8)(16,Fe,3,0,"ng-container",1),l(),S(17,De,3,4,"div",9),l()()()),e&2&&(s("headerTitle","Sold in Channel"),c(2),s("ngIf",!i.productService.hasSelection(i.products)),c(),s("ngIf",i.multipeScanChannels.length>0&&i.productService.hasSelection(i.products)),c(),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("multiple",!0)("items",i.channelOptions)("ngModel",i.searchFilter.ListChannelID),c(2),s("ngIf",i.searchFilter.ListChannelID!=null),c(4),s("ngForOf",i.products),c(),s("ngIf",i.products.length==0),c(),s("ngIf",i.products==null?null:i.products.length))},dependencies:[V,U,ot,W,K,L,Z,rt,Ct,z,X,B],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]});let o=r;return o})();function Ne(o,r){if(o&1){let n=P();a(0,"button",13),f("click",function(){u(n);let e=p(2);return h(e.uploadMultipleProduct())}),C(1,"i",14),m(2),l()}if(o&2){let n=p(2);c(2),I(" upload (",n.selectedProducts==null?null:n.selectedProducts.length,") ")}}function Ee(o,r){if(o&1){let n=P();v(0),a(1,"td",29)(2,"input",30),E("ngModelChange",function(e){u(n);let i=p(2).$implicit;return N(i.selected,e)||(i.selected=e),h(e)}),f("ngModelChange",function(){u(n);let e=p(3).ngIf,i=p(3);return h(i.onSelectProduct(e))}),l()(),b()}if(o&2){let n=p(2).$implicit;c(),s("rowSpan",n==null?null:n.Variants.length),c(),T("ngModel",n.selected)}}function ke(o,r){if(o&1){let n=P();v(0),a(1,"img",35),f("click",function(e){u(n);let i=p(3).$implicit,d=p(4);return h(d.onZoomImage(e,i==null?null:i.ImageUrl))}),l(),b()}if(o&2){let n=p(3).$implicit;c(),s("src",n==null?null:n.ImageUrl,O)}}function Ve(o,r){o&1&&C(0,"img",36)}function Ue(o,r){if(o&1&&(v(0),a(1,"td",29)(2,"div",31),S(3,ke,2,1,"ng-container",11)(4,Ve,1,0,"ng-template",null,1,it),l()(),a(6,"td",32)(7,"h4",33)(8,"span",34),m(9),l()()(),b()),o&2){let n=j(5),t=p(2).$implicit;c(),s("rowSpan",t==null?null:t.Variants.length),c(2),s("ngIf",t==null?null:t.ImageUrl)("ngIfElse",n),c(3),s("rowSpan",t==null?null:t.Variants.length),c(2),s("matTooltip",(t==null||t.Name==null?null:t.Name.length)>50?t==null?null:t.Name:""),c(),I(" ",t==null?null:t.Name," ")}}function Ae(o,r){if(o&1&&(a(0,"div")(1,"a",25),C(2,"img",37),l()()),o&2){let n=r.$implicit;c(),s("href",n.URL,O),c(),s("src",n.Img,O)("matTooltip",n.Name)}}function Le(o,r){if(o&1&&(a(0,"div"),C(1,"img",37),l()),o&2){let n=r.$implicit;c(),s("src",n.Img,O)("matTooltip",n.Name)}}function Re(o,r){if(o&1&&(a(0,"tr"),S(1,Ee,3,2,"ng-container",12)(2,Ue,10,6,"ng-container",12),a(3,"td"),m(4),l(),a(5,"td")(6,"span"),m(7),l(),a(8,"span",24)(9,"a",25),C(10,"i",26),l()()(),a(11,"td",27)(12,"div",28),S(13,Ae,3,3,"div",23),l()(),a(14,"td",27)(15,"div",28),S(16,Le,2,2,"div",23),l()()()),o&2){let n=r.$implicit,t=r.index,e=p(5);c(),s("ngIf",t==0),c(),s("ngIf",t==0),c(2),I(" ",n.Name," "),c(3),I(" ",n.Code," "),c(2),s("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),O),c(4),s("ngForOf",n==null?null:n.Available),c(3),s("ngForOf",n==null?null:n.NotAvailable)}}function Be(o,r){if(o&1&&(v(0),S(1,Re,17,7,"tr",23),b()),o&2){let n=r.$implicit;c(),s("ngForOf",n.Variants)}}function je(o,r){if(o&1&&(a(0,"tbody"),S(1,Be,2,1,"ng-container",23),l()),o&2){let n=r.ngIf;c(),s("ngForOf",n)}}function $e(o,r){if(o&1&&(v(0),a(1,"div",15)(2,"table",16)(3,"thead",17)(4,"tr"),C(5,"th",18),a(6,"th",19),m(7,"Product"),l(),a(8,"th",20),m(9,"Variant"),l(),a(10,"th",20),m(11,"SKU"),l(),a(12,"th",21),m(13,"Available In"),l(),a(14,"th",22),m(15,"Not Available In"),l()()(),S(16,je,2,1,"tbody",12),F(17,"async"),l()(),b()),o&2){let n=p(2);c(16),s("ngIf",k(17,1,n.data$))}}function Ge(o,r){o&1&&(a(0,"div",38),C(1,"app-empty-state"),l())}function We(o,r){if(o&1){let n=P();a(0,"span",46),f("click",function(){u(n);let e=p(4);return h(e.getRowCount())}),a(1,"i",47),m(2,"?"),l()()}}function Ke(o,r){if(o&1&&(a(0,"span"),m(1),F(2,"number"),l()),o&2){let n=r.ngIf;c(),mt(k(2,1,n==null?null:n.Count))}}function Je(o,r){if(o&1){let n=P();a(0,"a",48),f("click",function(){u(n);let e=p(4);return h(e.onNextPage())}),C(1,"i",49),m(2," Next"),l()}}function ze(o,r){if(o&1){let n=P();a(0,"a",50),f("click",function(){u(n);let e=p(4);return h(e.onLastPage())}),C(1,"i",51),m(2," Last"),l()}}function He(o,r){if(o&1&&(v(0),a(1,"div",39)(2,"div",40)(3,"div",41),m(4),F(5,"number"),S(6,We,3,0,"span",42)(7,Ke,3,3,"span",12),F(8,"async"),m(9),l()(),a(10,"div",43),S(11,Je,3,0,"a",44)(12,ze,3,0,"a",45),l()(),b()),o&2){let n=p().ngIf,t=p(2);c(4),I(" Showing 1 - ",k(5,6,n==null?null:n.length)," of "),c(2),s("ngIf",t.paginationService.hideCount),c(),s("ngIf",!t.paginationService.hideCount&&k(8,8,t.rowCount$)),c(2),I(" records ~ ",t.paginationService.footerPageNumber," Page "),c(2),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),c(),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}function Ye(o,r){if(o&1&&(v(0),S(1,He,13,10,"ng-container",12),b()),o&2){let n=r.ngIf;c(),s("ngIf",(n==null?null:n.length)>0)}}function Ze(o,r){if(o&1){let n=P();a(0,"mainpanel",3),f("onSubmit",function(e){u(n);let i=p();return h(i.searchProduct(e))}),a(1,"actions"),S(2,Ne,3,1,"button",4),a(3,"button",5),f("click",function(){u(n);let e=p();return h(e.openScanDialog())}),C(4,"i",6),m(5," Scan Channel "),l(),a(6,"button",7),f("click",function(){u(n);let e=p();return h(e.Export())}),C(7,"i",8),a(8,"span"),m(9,"Export"),l()()(),a(10,"content")(11,"div",9)(12,"div",10),S(13,$e,18,3,"ng-container",11),F(14,"async"),S(15,Ge,2,0,"ng-template",null,0,it),l(),S(17,Ye,2,1,"ng-container",12),F(18,"async"),l()()()}if(o&2){let n,t=j(16),e=p();s("hideSearchDropdown",!0),c(2),s("ngIf",e.hasSelectionProduct),c(11),s("ngIf",((n=k(14,5,e.data$))==null?null:n.length)>0)("ngIfElse",t),c(4),s("ngIf",k(18,7,e.data$))}}var pe=(()=>{let r=class r{constructor(t,e,i,d,g,w,Ft){this.http=t,this.dialog=e,this.toastr=i,this.productService=d,this.paginationService=g,this.biggerPictureService=w,this.authService=Ft,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannelV2",this.hasSelectionProduct=!1,this.selectedProducts=[],this.channelOptions=Ft.getChannels(),this.hostName=this.authService.getDomain()}ngOnInit(){this.initPageLoader(),this.iniData()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.notChannelAPI,this.loader$=this.http.post(`api/${this.loaderAPI}`,{}).pipe(Nt(t=>{this.filterSearch=t.Filter,this.paginationService.reloadPagination(t.Filter)}))}iniData(){this.data$=this.paginationService.data$.pipe(Tt(t=>(t=t.map(e=>(e.Variants=e.Variants.map(i=>(i.Available=this.productService.sortChannel(i.Available),i.NotAvailable=this.productService.sortChannel(i.NotAvailable),i.Available=this.assignLogoChannel(i.Available),i.NotAvailable=this.assignLogoChannel(i.NotAvailable),i)),e)),t)))}assignLogoChannel(t){return t=t.map(e=>(e.Img=_.getChannelLogoByTypeId(e.TypeID),e)),t}searchProduct(t){this.filterSearch.text=t,this.paginationService.reloadPagination(this.filterSearch)}scanAllProduct(){let t=this.productService.findChannelById(this.filterSearch.ChannelID,this.channelOptions);this.productService.scanAll(this.filterSearch.ChannelID,this.filterSearch.ScanFull,this.filterSearch.UpdatedProduct,this.filterSearch.Async).subscribe(e=>{this.filterSearch.Async?this.toastr.success("You will be notified when the scan is completed.","Scan Asynchronous"):(this.productService.successToastrScanAllProduct(e,t,!this.filterSearch.UpdatedProduct),this.initPageLoader())})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.filterSearch));t.ChannelID=_.GuidEMpty,this.dialog.open(D,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.filterSearch.ChannelID=i.ChannelID,this.filterSearch.ScanFull=i.ScanFull,this.filterSearch.UpdatedProduct=i.UpdatedProduct,this.filterSearch.Async=i.Async,this.scanAllProduct()})}getRowCount(){this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`/api/${this.rowCountAPI}`,this.filterSearch)}onNextPage(){this.paginationService.onNextPage(this.filterSearch)}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:t=>{this.filterSearch.PageNumber=1,this.paginationService.getAllData(this.filterSearch,t.Count)}})}onZoomImage(t,e){this.biggerPictureService.openBiggerPicture(t,e)}onSelectProduct(t){this.hasSelectionProduct=this.productService.hasSelection(t),this.selectedProducts=this.productService.selectedProduct(t)}uploadMultipleProduct(){let t=this.getUniqueChannels();t=t.map(e=>(e.ID=e.ChannelID,e)),this.dialog.open(Q,{width:"700px",data:{title:"Upload Multiple Product",channels:t}}).afterClosed().pipe(y(e=>_.IsNotEmpty(e)),H(e=>{let i=this.getSelectedProductIds();return this.productService.uploadNotInChannel(i,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 t=[];return this.selectedProducts.forEach(e=>{t=[...t,...e.Variants[0].NotAvailable]}),t=t.filter((e,i,d)=>d.findIndex(g=>g.ChannelID==e.ChannelID)==i),t}ngOnDestroy(){this.paginationService.destroy()}Export(){let t={ChannelID:this.filterSearch.ChannelID,PageNumber:this.filterSearch.PageNumber,RowCount:this.filterSearch.RowCount,text:this.filterSearch.text};this.http.postFile("/api/product/GetNotInChannelExport",t).subscribe(e=>{let i=window.URL.createObjectURL(e.file),d=document.createElement("a");d.download=this.getFilenameFromContentDisposition(e.title),d.href=i,d.click(),URL.revokeObjectURL(i),d.remove()})}getFilenameFromContentDisposition(t){let i=/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(t);return i!=null&&i[1]?i[1].replace(/['"]/g,""):""}};r.\u0275fac=function(e){return new(e||r)(x(G),x(J),x($),x(R),x(ie),x(qt),x(A))},r.\u0275cmp=M({type:r,selectors:[["app-not-in-channel"]],decls:2,vars:3,consts:[["EMPTY",""],["elsePic",""],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"hideSearchDropdown","onSubmit",4,"ngIf"],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"onSubmit","hideSearchDropdown"],["class","btn btn-light shadow rounded ms-2",3,"click",4,"ngIf"],["data-cy","scanNotinChannel","type","button",1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[4,"ngIf","ngIfElse"],[4,"ngIf"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-md-12"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[2,"width","10px"],["colspan","2",1,"ms-5","text-center",2,"width","450px"],[2,"width","150px"],[2,"width","20%"],[2,"width","16%"],[4,"ngFor","ngForOf"],[1,"ms-1"],["target","_blank",3,"href"],[1,"fas","fa-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,"ngModelChange","ngModel"],[2,"padding-right","0px"],[1,"text-start",3,"rowSpan"],[1,"ms-5","fw-normal","text-ellipsis",2,"max-width","26vw !important"],[3,"matTooltip"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],["alt","",1,"channel-logo","cursor-pointer","ms-4","mt-3",3,"src","matTooltip"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(e,i){e&1&&(S(0,Ze,19,9,"mainpanel",2),F(1,"async")),e&2&&s("ngIf",k(1,1,i.loader$))},dependencies:[V,U,Bt,W,K,L,ft,B,ut,ht],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}thead[_ngcontent-%COMP%]{position:sticky;top:0}.channel-logo[_ngcontent-%COMP%]{width:20px}.w-img[_ngcontent-%COMP%]{width:100%}"]});let o=r;return o})();var qe=o=>[o],Qe=()=>[];function Xe(o,r){if(o&1){let n=P();a(0,"button",15),f("click",function(){u(n);let e=p();return h(e.openScanDialog())}),C(1,"i",16),m(2," Scan Channel "),l()}}function tn(o,r){if(o&1){let n=P();v(0),a(1,"button",17),f("click",function(){u(n);let e=p();return h(e.onDownloadAllProduct("SELECTED"))}),C(2,"i",18),m(3),l(),b()}if(o&2){let n,t=p();c(3),I(" Download (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function en(o,r){if(o&1&&(a(0,"span",19),C(1,"img",20),l(),m(2)),o&2){let n=r.item;c(),s("src",n.Img,O)("alt",n.Name),c(),I(" ",n.Name," ")}}function nn(o,r){if(o&1){let n=P();a(0,"div",21)(1,"app-product-card",22),f("onCheckBoxChange",function(e){let i=u(n).index,d=p();return h(d.onSelectProduct(e,i))})("onDescEvent",function(){let e=u(n).index,i=p();return h(i.onShowVariantDetail(e))})("onDownload",function(){let e=u(n).$implicit,i=p();return h(i.onDownloadProduct(e))})("onScan",function(){let e=u(n).$implicit,i=p();return h(i.onScanChannel(e))}),l()()}if(o&2){let n=r.$implicit;c(),s("showRedirectIcon",!1)("title",n==null?null:n.Name)("image",n==null?null:n.Image)("imageForZoom",n==null?null:n.Image)("code",n==null?null:n.SKU)("description",(n==null||n.Variant==null?null:n.Variant.length)>0?(n==null||n.Variant==null?null:n.Variant.length)+" Variants":null)("downloadButton",!0)("channels",n!=null&&n.Channel?at(10,qe,n==null?null:n.Channel):tt(12,Qe))("showCheckBox",!0)("scanButton",!0)}}function on(o,r){o&1&&(v(0),a(1,"div",23),C(2,"app-empty-state"),l(),b())}function rn(o,r){if(o&1){let n=P();a(0,"div",24)(1,"div",25)(2,"app-custom-paginator",26),f("total",function(){u(n);let e=p();return h(e.getRowCount())})("next",function(){u(n);let e=p();return h(e.onNextPage())})("previous",function(){u(n);let e=p();return h(e.onPreviousPage())}),l()()()}if(o&2){let n=p();c(2),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}var de=(()=>{let r=class r{constructor(t,e,i,d,g,w){this.http=t,this.dialog=e,this.productService=i,this.toastrService=d,this.activateRouter=g,this.authService=w,this.searchFilter=new q,this.products=[],this.hasClickRowCount=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(_.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(e=>{this.searchFilter=e.Filter,this.searchFilter.PageSize=e.Filter.RowCount,this.getProducts()})}getProducts(){this.http.post("/api/product/GetProductChannelNotPOS",this.searchFilter).subscribe(t=>{this.products=t.Data,this.mapChannelToProduct(),this.setSkuProduct()})}mapChannelToProduct(){let t;this.products=this.products.map(e=>(t=this.channelOptions.find(i=>i.ID==e.ChannelID),t?e.Channel=JSON.parse(JSON.stringify(t)):e.Channel=null,e)).map(e=>(e.Channel&&(e.Channel.Url=e.Url),e))}setSkuProduct(){this.products=this.products.map(t=>(t?.Variant?.length==0?_.IsNotEmpty(t?.ChannelItemSKU)?t.SKU=t?.ChannelItemSKU:t.SKU="SKU not assigned":t.SKU=t?.Variant[0]?.ChannelVariationSKU?t?.Variant[0]?.ChannelVariationSKU:"SKU not assigned",t))}onSearch(t){this.searchFilter.text=t,this.hasClickRowCount=!1,this.getProducts()}onClearChannelFilter(){this.searchFilter.ChannelID=_.GuidEMpty}onScanAll(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(e=>{this.searchFilter.Async?this.toastrService.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.initPageLoader(_.GuidEMpty),this.productService.successToastrScanAllProduct(e,t,!this.searchFilter.UpdatedProduct)),this.searchFilter.ChannelID=_.GuidEMpty})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=_.GuidEMpty,this.dialog.open(D,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.Async=i.Async,this.onScanAll()})}onDownloadAllProduct(t){let e;t=="ALL"?e=this.products:e=this.productService.selectedProduct(this.products),e.length>0&&this.productService.downloadMultipleProduct(e).subscribe({next:()=>{this.getProducts()}})}onSelectProduct(t,e){this.products[e].selected=t}onDownloadProduct(t){confirm(`Are you sure you want to Retrieve product ${t?.Name} from ${t?.Channel.Name} to POS?`)&&this.productService.downloadProduct(t).subscribe({next:()=>{this.getProducts()}})}onScanChannel(t){let e=JSON.parse(JSON.stringify(t));delete e.Channel,this.productService.scanCompareToPos([e]).subscribe(i=>{i.Status?(this.initPageLoader(_.GuidEMpty),this.toastrService.success(`product ${t.Name} have been successfully scanned and synchronized with POS`,"Success")):this.toastrService.error(`Product ${t.Name} is not existed in POS`,"Error")})}onShowVariantDetail(t){let e=this.products[t].Variant;e.length>0&&this.dialog.open(oe,{data:{title:this.products[t].Name,variants:e},width:"30%"})}getRowCount(){let t={ChannelID:this.searchFilter.ChannelID,text:this.searchFilter.text,HaveSku:parseInt(this.searchFilter.HaveSku)};this.http.post("/api/product/GetProductChannelNotPOSRowCount",t).subscribe(e=>{this.hasClickRowCount=!0,this.rowCount=e.Count})}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPreviousPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}};r.\u0275fac=function(e){return new(e||r)(x(G),x(J),x(R),x($),x(_t),x(A))},r.\u0275cmp=M({type:r,selectors:[["app-not-in-pos"]],decls:30,vars:13,consts:[["headerTitle","Not in POS","textButton","Search","description","SKU sold in Marketplace but not exist in DEALPOS",3,"onSubmit"],["type","button","data-cy","scanNotInPos","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],[4,"ngIf"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp",""],[1,"mt-5"],[1,"fw-bold"],["name","haveSKU",1,"form-control","h-100","pt-3","rounded","mt-2",3,"ngModelChange","ngModel"],[1,"me-5",3,"value"],["type","text","name","Item_id","id","Item_id","placeholder","item id",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button","data-cy","scanNotInPos",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","ms-3",3,"click"],[1,"fa","fa-download"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onCheckBoxChange","onDescEvent","onDownload","onScan","showRedirectIcon","title","image","imageForZoom","code","description","downloadButton","channels","showCheckBox","scanButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(e,i){e&1&&(a(0,"mainpanel",0),f("onSubmit",function(g){return i.onSearch(g)}),a(1,"actions"),S(2,Xe,3,0,"button",1)(3,tn,4,1,"ng-container",2),l(),a(4,"filters")(5,"div")(6,"label",3),m(7,"Channel"),l(),a(8,"ng-select",4),E("ngModelChange",function(g){return N(i.searchFilter.ChannelID,g)||(i.searchFilter.ChannelID=g),g}),S(9,en,3,3,"ng-template",5),l()(),a(10,"div",6)(11,"label",7),m(12,"SKU Assigned"),l(),a(13,"mat-radio-group",8),E("ngModelChange",function(g){return N(i.searchFilter.HaveSku,g)||(i.searchFilter.HaveSku=g),g}),a(14,"mat-radio-button",9),m(15," All "),l(),a(16,"mat-radio-button",9),m(17," Yes "),l(),a(18,"mat-radio-button",9),m(19," No "),l()()(),a(20,"div",6)(21,"label",7),m(22,"Item ID"),l(),a(23,"input",10),E("ngModelChange",function(g){return N(i.searchFilter.Item_id,g)||(i.searchFilter.Item_id=g),g}),l()()(),a(24,"content")(25,"div",11)(26,"div",12),S(27,nn,2,13,"div",13)(28,on,3,0,"ng-container",2),l(),S(29,rn,3,4,"div",14),l()()()),e&2&&(c(2),s("ngIf",!i.productService.hasSelection(i.products)),c(),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("items",i.channelOptions),T("ngModel",i.searchFilter.ChannelID),c(5),T("ngModel",i.searchFilter.HaveSku),c(),s("value",0),c(2),s("value",1),c(2),s("value",2),c(5),T("ngModel",i.searchFilter.Item_id),c(4),s("ngForOf",i.products),c(),s("ngIf",i.products.length==0),c(),s("ngIf",(i.products==null?null:i.products.length)>0))},dependencies:[V,U,ot,W,K,L,Z,rt,Ht,Yt,z,X,B],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.itemTitle[_ngcontent-%COMP%]{cursor:pointer}"]});let o=r;return o})();function an(o,r){if(o&1&&(a(0,"span",9),C(1,"img",10),l(),m(2)),o&2){let n=r.item,t=p();c(),s("src",t.getChannelLogo(n.TypeID),O),c(),I(" ",n.Name," ")}}function ln(o,r){if(o&1&&(a(0,"div",11),C(1,"app-duplicate-product-card",12),l()),o&2){let n=r.$implicit,t=r.index;c(),s("imageForZoom",n.ImageUrl)("title",n.Name)("code",n.Code)("id",t)("image",n.ThumbnailURL)("channels",n.Channels)}}function cn(o,r){o&1&&(v(0),a(1,"div",13),C(2,"app-empty-state"),l(),b())}function sn(o,r){if(o&1){let n=P();v(0),a(1,"div",14)(2,"div",15)(3,"app-custom-paginator",16),f("next",function(){u(n);let e=p();return h(e.onNextPage())})("previous",function(){u(n);let e=p();return h(e.onPrevPage())})("total",function(){u(n);let e=p();return h(e.getRowCount())}),l()()(),b()}if(o&2){let n=p();c(3),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickedRowCount)}}var me=(()=>{let r=class r{constructor(t,e,i){this.httpService=t,this.productService=e,this.authService=i,this.searchFilter=new q,this.products=[],this.hasClickedRowCount=!1,this.getPageLoader(),this.channelOptions=i.getChannels()}getPageLoader(){this.productService.loader().subscribe(t=>{this.searchFilter=t.Filter,this.searchFilter.PageSize=t.Filter.RowCount,this.getProducts()})}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,RowCount:this.searchFilter.RowCount,PageNumber:this.searchFilter.PageNumber,text:this.searchFilter.text};this.httpService.post("/api/product/GetDuplicateInChannel",t).subscribe(e=>{this.products=e.Data})}onSearch(t){this.searchFilter.text=t,this.hasClickedRowCount=!1,this.getProducts()}onClearFilter(){this.searchFilter.ChannelID=_.GuidEMpty}getChannelLogo(t){return _.getChannelLogoByTypeId(t)}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPrevPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}getRowCount(){let t={text:this.searchFilter.text,ChannelID:this.searchFilter.ChannelID};this.httpService.post("/api/product/GetDuplicateInChannelRowCount",t).subscribe(e=>{this.hasClickedRowCount=!0,this.rowCount=e.Total})}};r.\u0275fac=function(e){return new(e||r)(x(G),x(R),x(A))},r.\u0275cmp=M({type:r,selectors:[["app-duplicate-sku"]],decls:14,vars:7,consts:[["headerTitle","Multiple Listing","textButton"," Search","description","SKU(s) which is listed more than one time (one to many)",3,"onSubmit"],["container",""],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clear","multiple","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid"],[1,"row","mt-8","mx-1"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"imageForZoom","title","code","id","image","channels"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"next","previous","total","filter","totaldata","paginationTotal","hasClicked"]],template:function(e,i){e&1&&(a(0,"mainpanel",0),f("onSubmit",function(g){return i.onSearch(g)}),a(1,"filters")(2,"div",1)(3,"div")(4,"h6",2),m(5,"Channel"),l(),a(6,"ng-select",3),E("ngModelChange",function(g){return N(i.searchFilter.ListChannelID,g)||(i.searchFilter.ListChannelID=g),g}),f("clear",function(){return i.onClearFilter()}),S(7,an,3,2,"ng-template",4),l()()()(),a(8,"content")(9,"div",5)(10,"div",6),S(11,ln,2,6,"div",7)(12,cn,3,0,"ng-container",8),l(),S(13,sn,4,4,"ng-container",8),l()()()),e&2&&(c(6),s("multiple",!0)("clearable",!0)("items",i.channelOptions),T("ngModel",i.searchFilter.ListChannelID),c(5),s("ngForOf",i.products),c(),s("ngIf",(i.products==null?null:i.products.length)==0),c(),s("ngIf",(i.products==null?null:i.products.length)>0))},dependencies:[V,U,W,K,L,Z,rt,Ct,xt,z,B]});let o=r;return o})();var pn=()=>["/menu/products/status/sold-in-channel"],ue=o=>({ID:o}),dn=()=>["/menu/products/status/not-in-pos"];function mn(o,r){if(o&1&&(v(0),m(1),b()),o&2){let n=p().$implicit;c(),I(" ",n.Count," ")}}function un(o,r){if(o&1){let n=P();a(0,"span",26),f("click",function(){u(n);let e=p().$implicit,i=p(2);return h(i.getLiveProductCount(e.ID,e))}),C(1,"i",27),l()}}function hn(o,r){if(o&1){let n=P();a(0,"tr")(1,"td"),C(2,"img",17),a(3,"span",18),m(4),l()(),a(5,"td",19),S(6,mn,2,1,"ng-container",6)(7,un,2,0,"ng-template",null,1,it),l(),a(9,"td",19)(10,"a",20),m(11),F(12,"number"),l()(),a(13,"td",19)(14,"a",20),m(15),F(16,"number"),l()(),a(17,"td"),m(18),F(19,"date"),l(),a(20,"td")(21,"div",21)(22,"button",22),f("click",function(){let e=u(n).$implicit,i=p(2);return h(i.onScanChannel(e))}),C(23,"i",23),m(24," Scan "),l(),a(25,"button",24),f("click",function(){let e=u(n).$implicit,i=p(2);return h(i.onClearCache(e.ID))}),C(26,"i",25),m(27," Clear "),l()()()()}if(o&2){let n=r.$implicit,t=j(8),e=p(2);c(2),s("src",e.getChannelLogo(n.TypeID),O),c(2),mt(n.Name),c(2),s("ngIf",n.Count!==void 0)("ngIfElse",t),c(4),s("routerLink",tt(18,pn))("queryParams",at(19,ue,n.ID)),c(),I(" ",k(12,11,n.SoldInChannel)," "),c(3),s("routerLink",tt(21,dn))("queryParams",at(22,ue,n.ID)),c(),I(" ",k(16,13,n.NotInPOS)," "),c(3),I("",n.LastSync?Vt(19,15,n.LastSync,"dd MMM yyyy HH:mm"):"-"," ")}}function _n(o,r){if(o&1&&(v(0),a(1,"div",7)(2,"table",8)(3,"thead",9)(4,"tr",10)(5,"th"),m(6,"Channel"),l(),a(7,"th",11),m(8,"Live Product"),l(),a(9,"th",12),m(10,"Sold In Channel"),l(),a(11,"th",13),m(12,"Product Not in POS"),l(),a(13,"th",14),m(14,"Last Sync"),l(),C(15,"th",15),l()(),a(16,"tbody"),S(17,hn,28,24,"tr",16),F(18,"async"),l()()(),b()),o&2){let n,t=p();c(17),s("ngForOf",(n=k(18,1,t.channels$))==null?null:n.Data)}}function gn(o,r){o&1&&(a(0,"div",28),C(1,"app-empty-state"),l())}var he=(()=>{let r=class r{constructor(t,e,i,d){this.productService=t,this.toastr=e,this.dialog=i,this.authService=d,this.destroy$=new Dt,this.channelOptions=d.getChannels()}ngOnInit(){this.setObsProductStatistic()}setObsProductStatistic(){this.channels$=this.productService.getProductStatistic()}getLiveProductCount(t,e){this.productService.getTotalProductLive(t).pipe(wt(this.destroy$)).subscribe(i=>{e.Count=i.Count})}onScanChannel(t){this.dialog.open(D,{width:"700px",data:{channelOptions:this.channelOptions,filter:{ChannelID:t.ID},disabledChannelOption:!0}}).afterClosed().pipe(y(e=>_.IsNotEmpty(e))).subscribe(e=>{this.scanAllProduct(t.ID,e)})}scanAllProduct(t,e){let i=this.productService.findChannelById(t,this.channelOptions);this.productService.scanAll(e.ChannelID,e.ScanFull,e.UpdatedProduct,e.Async).pipe(y(d=>d)).subscribe(d=>{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(d,i,!e.UpdatedProduct),this.setObsProductStatistic())})}onClearCache(t){confirm("Are you sure you want to Clear Cache? This Process will remove your product integration to marketplace")&&this.productService.clearCacheChannel(t).pipe(wt(this.destroy$)).subscribe(i=>{this.toastr.success("Successfully cleared cache","Success"),this.setObsProductStatistic()})}getChannelLogo(t){return _.getChannelLogoByTypeId(t)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};r.\u0275fac=function(e){return new(e||r)(x(R),x($),x(J),x(A))},r.\u0275cmp=M({type:r,selectors:[["app-channel-statistic"]],decls:9,vars:6,consts:[["EMPTY",""],["QUESTION",""],["headerTitle","Products Statistic",3,"hideSearchBox","hideSearchDropdown"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[1,"text-center",2,"width","13rem"],[1,"text-center",2,"width","9rem"],[1,"text-center",2,"width","14rem"],[2,"width","10rem"],[2,"width","12rem"],[4,"ngFor","ngForOf"],[2,"width","24px","height","24px",3,"src"],[1,"ms-3"],[1,"text-center"],[3,"routerLink","queryParams"],[1,"d-flex","align-items-center","justify-content-center"],[1,"btn","btn-sm","btn-secondary","fs-6",3,"click"],[1,"fa","fa-spinner"],[1,"btn","btn-sm","btn-secondary","fs-6","ms-3",3,"click"],[1,"fa","fa-trash"],["matTooltip","Click to see total live product",1,"cursor-pointer","fs-5","text-primary",3,"click"],[1,"fa-solid","fa-circle-question","cursor"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(e,i){if(e&1&&(a(0,"mainpanel",2)(1,"content")(2,"div",3)(3,"div",4)(4,"div",5),S(5,_n,19,3,"ng-container",6),F(6,"async"),S(7,gn,2,0,"ng-template",null,0,it),l()()()()()),e&2){let d,g=j(8);s("hideSearchBox",!0)("hideSearchDropdown",!0),c(5),s("ngIf",((d=k(6,4,i.channels$))==null||d.Data==null?null:d.Data.length)>0)("ngIfElse",g)}},dependencies:[V,U,L,ft,gt,B,ut,ht,Ut]});let o=r;return o})();var Cn=[{component:ae,path:"",children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:ce,canActivate:[et],data:{title:"Products in POS"}},{path:"sold-in-channel",component:se,canActivate:[et],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:pe,canActivate:[et],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:de,canActivate:[et],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:me,canActivate:[et],data:{title:"Duplicate Sku in Channel"}},{path:"channel-statistic",component:he,canActivate:[et],data:{title:"Channel Statistic"}}]}],Fi=(()=>{let r=class r{};r.\u0275fac=function(e){return new(e||r)},r.\u0275mod=kt({type:r}),r.\u0275inj=Et({imports:[At,jt,Kt,Wt,$t,re,Zt,zt,xt,z,X,Rt.forChild(Cn),ne,Gt]});let o=r;return o})();export{Fi as StatusModule};
@@ -1 +1 @@
1
- import{a as fe}from"./chunk-YZ67XPSX.js";import{b as _}from"./chunk-GSSZWMCP.js";import"./chunk-XDNW2F3I.js";import"./chunk-TDHJ34QP.js";import"./chunk-INNTQ5YN.js";import{a as de,b as ce}from"./chunk-SRYGE2HW.js";import"./chunk-DT3B54LD.js";import{a as L}from"./chunk-T4Y427M7.js";import"./chunk-7QECCYLR.js";import{e as oe}from"./chunk-K3G6FMDF.js";import"./chunk-JM3LERUP.js";import{C as D,D as pe}from"./chunk-ZKBLXGXT.js";import"./chunk-6B64VOO7.js";import{u as me}from"./chunk-SP6QPE3M.js";import{c as f}from"./chunk-6F6NSBIF.js";import{$ as J,$a as X,Ab as c,Bb as N,Cb as Z,Eb as u,Fb as y,Gb as g,Ha as G,Ia as s,Ja as h,Jb as $,Ob as ee,Q as V,Rb as A,Sb as j,Wa as C,Wc as ae,X as H,Ya as p,Yc as le,_c as se,aa as Q,ca as K,fb as o,gb as a,ha as S,hb as T,ia as z,kb as Y,kc as te,lc as w,oa as q,ob as P,oc as ie,pc as b,qb as v,rc as re,sc as ne,tb as U}from"./chunk-6DRNAUKE.js";import"./chunk-GRMIXZTT.js";var he=(()=>{let r=class r{constructor(){this.reportTabs=[{Title:"1.Create Order",Url:"/menu/sync-log/order/sync-order"},{Title:"2.Convert Order To Invoice",Url:"/menu/sync-log/order/convert-to-invoice"},{Title:"3.Create Invoice",Url:"/menu/sync-log/order/invoice"},{Title:"4.Create Outbound Logistic",Url:"/menu/sync-log/order/delivery"},{Title:"5.Add Payment",Url:"/menu/sync-log/order/payment"},{Title:"6.Void Invoice",Url:"/menu/sync-log/order/void-invoice"},{Title:"All",Url:"/menu/sync-log/order/all"}]}};r.\u0275fac=function(i){return new(i||r)},r.\u0275cmp=S({type:r,selectors:[["app-order"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(i,t){i&1&&(o(0,"nav",0)(1,"div",1)(2,"div"),T(3,"nav-tab",2),a()()(),T(4,"router-outlet")),i&2&&(s(3),p("Tabs",t.reportTabs))},dependencies:[de,ae],styles:[".dropdown[_ngcontent-%COMP%] .dropdown-menu.report.show[_ngcontent-%COMP%]{top:100%!important;transform:none!important;z-index:10000;cursor:pointer;right:-50%}"]});let n=r;return n})();var F=class{};var I=(()=>{let r=class r{constructor(e){this.http=e}GetLoader(){return this.http.post("/api/Report/GetLoader",{})}GetSyncOrder(e){return new Promise((i,t)=>{this.http.post("/api/Report/Salesorder",JSON.stringify(e)).subscribe(d=>{i(d)})})}GetSyncInvoice(e){return new Promise((i,t)=>{this.http.post("/api/Report/CreateInvoice",JSON.stringify(e)).subscribe(d=>{i(d)})})}GetSyncVoidInvoice(e){return new Promise((i,t)=>{this.http.post("/api/Report/Void",JSON.stringify(e)).subscribe(d=>{i(d)})})}GetSyncConvertInvoice(e){return new Promise((i,t)=>{this.http.post("/api/Report/ConvertToInvoice",JSON.stringify(e)).subscribe(d=>{i(d)})})}GetSyncDelivery(e){return new Promise((i,t)=>{this.http.post("/api/Report/Delivery",JSON.stringify(e)).subscribe(d=>{i(d)})})}GetSyncPayment(e){return new Promise((i,t)=>{this.http.post("/api/Report/Payment",JSON.stringify(e)).subscribe(d=>{i(d)})})}getAllReport(e){return this.http.post("/api/Report/all",JSON.stringify(e))}};r.\u0275fac=function(i){return new(i||r)(K(oe))},r.\u0275prov=J({token:r,factory:r.\u0275fac,providedIn:"root"});let n=r;return n})();var R=function(n){return n[n.OK=200]="OK",n[n.BAD_REQUEST=400]="BAD_REQUEST",n[n.CONFLICT=409]="CONFLICT",n[n.NOT_FOUND=404]="NOT_FOUND",n[n.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",n}(R||{});var Fe=()=>["/menu/log/order"],Pe=(n,r,m,e,i)=>({responseCode:n,From:r,to:m,actionType:e,ChannelID:i});function we(n,r){if(n&1&&(o(0,"th",9)(1,"div",10)(2,"h4"),c(3),a(),o(4,"small",11),c(5),a()()()),n&2){let m=r.$implicit,e=v();s(3),N(m),s(),X(e.getTextBgColor(m)),s(),N(e.getHeaderStatusDesc(m))}}function be(n,r){if(n&1&&(o(0,"td",14)(1,"a",15),c(2),a()()),n&2){let m=r.$implicit,e=v().$implicit,i=v();s(),p("routerLink",$(3,Fe))("queryParams",ee(4,Pe,m.Key,i.fromQueryParam,i.toQueryParam,i.type,e.ChannelID)),s(),Z(" ",m.Value," ")}}function De(n,r){if(n&1&&(o(0,"tr")(1,"td")(2,"a",12),T(3,"img",13),a()(),o(4,"td")(5,"div")(6,"a",12),c(7),a()(),o(8,"div"),c(9),a()(),C(10,be,3,10,"td",8),a()),n&2){let m=r.$implicit,e=v();s(2),U("href",m.Url,G),s(),p("src",e.getChannelLogo(m.Type),G),s(3),U("href",m.Url,G),s(),N(m.Name),s(2),N(m.Url),s(),p("ngForOf",m.list)}}function Ie(n,r){if(n&1&&(o(0,"td",14)(1,"div",16),c(2),A(3,"number"),a()()),n&2){let m=r.$implicit;s(2),N(j(3,1,m.total))}}var E=(()=>{let r=class r{constructor(){this.type=null,this.headerStatus=R,this.listCalculationStatusCode=[]}set from(e){e&&(this.fromQueryParam=new Date(e).toJSON().toString())}set to(e){e&&(this.toQueryParam=new Date(e).toJSON().toString())}ngOnChanges(e){e.result&&this.calculateStatusCode()}getHeaderStatusDesc(e){let i=null;switch(e){case R.BAD_REQUEST:i="BAD REQUEST";break;case R.CONFLICT:i="CONFLICT";break;case R.INTERNAL_SERVER_ERROR:i="INTERNAL SERVER ERROR";break;case R.NOT_FOUND:i="NOT FOUND";break;default:i="OK";break}return i}getTextBgColor(e){let i=null;switch(e){case R.OK:i="bg-success";break;case R.INTERNAL_SERVER_ERROR:i="bg-danger";break;default:i="bg-warning";break}return i}getChannelLogo(e){return f.getChannelLogoByTypeId(e)}calculateStatusCode(){if(this.listCalculationStatusCode=[],this.result){let e,i;this.concatStatusCode().forEach(t=>{e=this.listCalculationStatusCode.findIndex(d=>d.status==t.Key),i=e!==-1,i?this.listCalculationStatusCode[e].total+=t.Value:this.listCalculationStatusCode=[...this.listCalculationStatusCode,{status:t.Key,total:t.Value}]})}}concatStatusCode(){return this.result.map(e=>e.list).reduce((e,i)=>[...e,...i])}};r.\u0275fac=function(i){return new(i||r)},r.\u0275cmp=S({type:r,selectors:[["app-table-report"]],inputs:{header:"header",result:"result",from:"from",to:"to",type:"type"},features:[q],decls:15,vars:3,consts:[[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","0%"],[2,"width","5%"],["class","text-start","style","width: 10%;",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],["colspan","2"],[1,"text-center","h3","fw-bold"],["class","text-start",4,"ngFor","ngForOf"],[1,"text-start",2,"width","10%"],[1,"d-block"],[1,"text-white","p-1","rounded","response-desc"],["target","_blank",3,"href"],[2,"width","24px","height","24px",3,"src"],[1,"text-start"],[1,"h3","text-primary","fw-bold","ms-1",3,"routerLink","queryParams"],[1,"d-inline-block","h3","text-primary","fw-bold","ms-1"]],template:function(i,t){i&1&&(o(0,"table",0)(1,"thead",1)(2,"tr"),T(3,"th",2),o(4,"th",3),c(5,"Channel"),a(),C(6,we,6,4,"th",4),a()(),o(7,"tbody"),C(8,De,11,6,"tr",5),a(),o(9,"tfoot")(10,"tr")(11,"td",6)(12,"div",7),c(13,"Total"),a()(),C(14,Ie,4,3,"td",8),a()()()),i&2&&(s(6),p("ngForOf",t.header),s(2),p("ngForOf",t.result),s(6),p("ngForOf",t.listCalculationStatusCode))},dependencies:[te,le,re],styles:[".response-desc[_ngcontent-%COMP%]{font-size:12px}"]});let n=r;return n})();function Ee(n,r){if(n&1&&(o(0,"div",6)(1,"div",7),T(2,"app-table-report",8),a()()),n&2){let m=v();s(2),p("result",m.result)("header",m.header)("from",m.filter.From)("to",m.filter.To)("type",0)}}var ue=(()=>{let r=class r{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new F,this.pageTitle="New Order";let t=new Date;this.maxDate=t,this.minDate=f.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.pageTitle=`New Order (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncOrder(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(b))},r.\u0275cmp=S({type:r,selectors:[["app-sales-order"]],decls:10,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),P("onSubmit",function(){return t.getChannelLogs()}),o(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),a(),o(5,"datepicker",2),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a(),o(6,"datepicker",3),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()(),o(7,"content")(8,"div",4),C(9,Ee,3,5,"div",5),a()()()),i&2&&(p("headerTitle",t.pageTitle)("hideSearchBox",!0),s(5),u("date",t.filter.From),s(),u("date",t.filter.To),s(3),p("ngIf",t.result))},dependencies:[w,D,_,E]});let n=r;return n})();function Oe(n,r){if(n&1&&(o(0,"div",6)(1,"div",7),T(2,"app-table-report",8),a()()),n&2){let m=v();s(2),p("result",m.result)("header",m.header)("from",m.filter.From)("to",m.filter.To)("type",1)}}var ye=(()=>{let r=class r{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new F,this.PageTitle="Ready to Ship";let t=new Date;this.maxDate=t,this.minDate=f.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Ready to Ship (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(b))},r.\u0275cmp=S({type:r,selectors:[["app-invoice"]],decls:10,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),P("onSubmit",function(){return t.onFilter()}),o(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),a(),o(5,"datepicker",2),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a(),o(6,"datepicker",3),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()(),o(7,"content")(8,"div",4),C(9,Oe,3,5,"div",5),a()()()),i&2&&(p("headerTitle",t.PageTitle)("hideSearchBox",!0),s(5),u("date",t.filter.From),s(),u("date",t.filter.To),s(3),p("ngIf",t.result))},dependencies:[w,D,_,E]});let n=r;return n})();function Re(n,r){if(n&1&&(o(0,"div",7)(1,"div",8),T(2,"app-table-report",9),a()()),n&2){let m=v();s(2),p("result",m.result)("header",m.header)("from",m.filter.From)("to",m.filter.To)("type",3)}}var ge=(()=>{let r=class r{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new F;let t=new Date;this.maxDate=t,this.minDate=f.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Shipped (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncDelivery(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(b))},r.\u0275cmp=S({type:r,selectors:[["app-delivery"]],decls:10,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"filterDate"],[1,"fw-bold"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),P("onSubmit",function(){return t.onFilter()}),o(1,"filters")(2,"div",1)(3,"h6",2),c(4,"From/To"),a(),o(5,"datepicker",3),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a(),o(6,"datepicker",4),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()(),o(7,"content")(8,"div",5),C(9,Re,3,5,"div",6),a()()()),i&2&&(p("headerTitle",t.PageTitle)("hideSearchBox",!0),s(5),u("date",t.filter.From),s(),u("date",t.filter.To),s(3),p("ngIf",t.result))},dependencies:[w,D,_,E]});let n=r;return n})();function Le(n,r){if(n&1&&(o(0,"div",6)(1,"div",7),T(2,"app-table-report",8),a()()),n&2){let m=v();s(2),p("result",m.result)("header",m.header)("from",m.filter.From)("to",m.filter.To)("type",4)}}var Ce=(()=>{let r=class r{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new F,this.PageTitle="Completed";let t=new Date;this.minDate=f.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Completed (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncPayment(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(b))},r.\u0275cmp=S({type:r,selectors:[["app-payment"]],decls:10,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),P("onSubmit",function(){return t.onFilter()}),o(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),a(),o(5,"datepicker",2),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a(),o(6,"datepicker",3),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()(),o(7,"content")(8,"div",4),C(9,Le,3,5,"div",5),a()()()),i&2&&(p("headerTitle",t.PageTitle)("hideSearchBox",!0),s(5),u("date",t.filter.From),s(),u("date",t.filter.To),s(3),p("ngIf",t.result))},dependencies:[w,D,_,E]});let n=r;return n})();function Me(n,r){n&1&&Y(0)}function ke(n,r){if(n&1&&(o(0,"div",7)(1,"div",8),T(2,"app-table-report",9),a()()),n&2){let m=r.ngIf,e=v();s(2),p("result",m.Body)("header",m.Header)("from",e.filter==null?null:e.filter.From)("to",e.filter==null?null:e.filter.To)}}var Te=(()=>{let r=class r{constructor(e,i){this.reportOrderService=e,this.datePipe=i,this.filter=new F}ngOnInit(){this.initFilter(),this.initLoader()}initFilter(){let e=new Date;this.minDate=f.addDays(e,6),this.filter.From=e,this.filter.To=e,this.updatePageTitle()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.pageTitle=`All (${e==null?"":i+"-"} ${t})`}initLoader(){this.pageLoader$=this.reportOrderService.GetLoader().pipe(H(e=>{this.filter=e,this.updatePageTitle(),this.initData()}))}initData(){this.reportData$=this.reportOrderService.getAllReport(this.filter).pipe(V())}onFilter(){this.updatePageTitle(),this.initData()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(b))},r.\u0275cmp=S({type:r,selectors:[["app-all"]],decls:13,vars:10,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],[4,"ngIf"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),P("onSubmit",function(){return t.onFilter()}),o(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),a(),o(5,"datepicker",2),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a(),o(6,"datepicker",3),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()(),o(7,"content")(8,"div",4),C(9,Me,1,0,"ng-container",5),A(10,"async"),C(11,ke,3,4,"div",6),A(12,"async"),a()()()),i&2&&(p("headerTitle",t.pageTitle)("hideSearchBox",!0),s(5),u("date",t.filter.From),s(),u("date",t.filter.To),s(3),p("ngIf",j(10,6,t.pageLoader$)),s(2),p("ngIf",j(12,8,t.reportData$)))},dependencies:[w,D,_,E,ie]});let n=r;return n})();function xe(n,r){if(n&1&&(o(0,"div",6)(1,"div",7),T(2,"app-table-report",8),a()()),n&2){let m=v();s(2),p("result",m.result)("header",m.header)("from",m.filter.From)("to",m.filter.To)("type",1)}}var ve=(()=>{let r=class r{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new F,this.PageTitle="Convert Sales Order To Invoice";let t=new Date;this.maxDate=t,this.minDate=f.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Convert Sales Order To Invoice (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(b))},r.\u0275cmp=S({type:r,selectors:[["app-convert-invoice"]],decls:10,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),P("onSubmit",function(){return t.onFilter()}),o(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),a(),o(5,"datepicker",2),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a(),o(6,"datepicker",3),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()(),o(7,"content")(8,"div",4),C(9,xe,3,5,"div",5),a()()()),i&2&&(p("headerTitle",t.PageTitle)("hideSearchBox",!0),s(5),u("date",t.filter.From),s(),u("date",t.filter.To),s(3),p("ngIf",t.result))},dependencies:[w,D,_,E]});let n=r;return n})();function Ne(n,r){if(n&1&&(o(0,"div",6)(1,"div",7),T(2,"app-table-report",8),a()()),n&2){let m=v();s(2),p("result",m.result)("header",m.header)("from",m.filter.From)("to",m.filter.To)("type",1)}}var Se=(()=>{let r=class r{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new F,this.PageTitle="Ready to Ship";let t=new Date;this.maxDate=t,this.minDate=f.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Ready to Ship (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(b))},r.\u0275cmp=S({type:r,selectors:[["app-void-invoice"]],decls:10,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),P("onSubmit",function(){return t.onFilter()}),o(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),a(),o(5,"datepicker",2),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a(),o(6,"datepicker",3),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()(),o(7,"content")(8,"div",4),C(9,Ne,3,5,"div",5),a()()()),i&2&&(p("headerTitle",t.PageTitle)("hideSearchBox",!0),s(5),u("date",t.filter.From),s(),u("date",t.filter.To),s(3),p("ngIf",t.result))},dependencies:[w,D,_,E]});let n=r;return n})();var Be=[{path:"",component:he,children:[{path:"",redirectTo:"sync-order",pathMatch:"full"},{path:"sync-order",component:ue,canActivate:[L],data:{title:"Sync Order"}},{path:"convert-to-invoice",component:ve,canActivate:[L],data:{title:"Sync Convert to Invoice"}},{path:"invoice",component:ye,canActivate:[L],data:{title:"Sync Invoice"}},{path:"delivery",component:ge,canActivate:[L],data:{title:"Sync Delivery"}},{path:"payment",component:Ce,canActivate:[L],data:{title:"Sync Payment"}},{path:"void-invoice",component:Se,canActivate:[L],data:{title:"Sync void invoice"}},{path:"all",component:Te,canActivate:[L],data:{title:"All Report"}}]}],Rt=(()=>{let r=class r{};r.\u0275fac=function(i){return new(i||r)},r.\u0275mod=z({type:r}),r.\u0275inj=Q({imports:[ne,ce,me,pe,fe,_,se.forChild(Be)]});let n=r;return n})();export{Rt as OrderModule};
1
+ import{a as fe}from"./chunk-YZ67XPSX.js";import{b as _}from"./chunk-GSSZWMCP.js";import"./chunk-XDNW2F3I.js";import"./chunk-TDHJ34QP.js";import"./chunk-INNTQ5YN.js";import{a as de,b as ce}from"./chunk-SRYGE2HW.js";import"./chunk-DT3B54LD.js";import{a as L}from"./chunk-GIB66QXC.js";import"./chunk-2OH65RRD.js";import{e as oe}from"./chunk-K3G6FMDF.js";import"./chunk-JM3LERUP.js";import{C as D,D as pe}from"./chunk-ZKBLXGXT.js";import"./chunk-6B64VOO7.js";import{u as me}from"./chunk-SP6QPE3M.js";import{c as f}from"./chunk-6F6NSBIF.js";import{$ as J,$a as X,Ab as c,Bb as N,Cb as Z,Eb as u,Fb as y,Gb as g,Ha as G,Ia as s,Ja as h,Jb as $,Ob as ee,Q as V,Rb as A,Sb as j,Wa as C,Wc as ae,X as H,Ya as p,Yc as le,_c as se,aa as Q,ca as K,fb as o,gb as a,ha as S,hb as T,ia as z,kb as Y,kc as te,lc as w,oa as q,ob as P,oc as ie,pc as b,qb as v,rc as re,sc as ne,tb as U}from"./chunk-6DRNAUKE.js";import"./chunk-GRMIXZTT.js";var he=(()=>{let r=class r{constructor(){this.reportTabs=[{Title:"1.Create Order",Url:"/menu/sync-log/order/sync-order"},{Title:"2.Convert Order To Invoice",Url:"/menu/sync-log/order/convert-to-invoice"},{Title:"3.Create Invoice",Url:"/menu/sync-log/order/invoice"},{Title:"4.Create Outbound Logistic",Url:"/menu/sync-log/order/delivery"},{Title:"5.Add Payment",Url:"/menu/sync-log/order/payment"},{Title:"6.Void Invoice",Url:"/menu/sync-log/order/void-invoice"},{Title:"All",Url:"/menu/sync-log/order/all"}]}};r.\u0275fac=function(i){return new(i||r)},r.\u0275cmp=S({type:r,selectors:[["app-order"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(i,t){i&1&&(o(0,"nav",0)(1,"div",1)(2,"div"),T(3,"nav-tab",2),a()()(),T(4,"router-outlet")),i&2&&(s(3),p("Tabs",t.reportTabs))},dependencies:[de,ae],styles:[".dropdown[_ngcontent-%COMP%] .dropdown-menu.report.show[_ngcontent-%COMP%]{top:100%!important;transform:none!important;z-index:10000;cursor:pointer;right:-50%}"]});let n=r;return n})();var F=class{};var I=(()=>{let r=class r{constructor(e){this.http=e}GetLoader(){return this.http.post("/api/Report/GetLoader",{})}GetSyncOrder(e){return new Promise((i,t)=>{this.http.post("/api/Report/Salesorder",JSON.stringify(e)).subscribe(d=>{i(d)})})}GetSyncInvoice(e){return new Promise((i,t)=>{this.http.post("/api/Report/CreateInvoice",JSON.stringify(e)).subscribe(d=>{i(d)})})}GetSyncVoidInvoice(e){return new Promise((i,t)=>{this.http.post("/api/Report/Void",JSON.stringify(e)).subscribe(d=>{i(d)})})}GetSyncConvertInvoice(e){return new Promise((i,t)=>{this.http.post("/api/Report/ConvertToInvoice",JSON.stringify(e)).subscribe(d=>{i(d)})})}GetSyncDelivery(e){return new Promise((i,t)=>{this.http.post("/api/Report/Delivery",JSON.stringify(e)).subscribe(d=>{i(d)})})}GetSyncPayment(e){return new Promise((i,t)=>{this.http.post("/api/Report/Payment",JSON.stringify(e)).subscribe(d=>{i(d)})})}getAllReport(e){return this.http.post("/api/Report/all",JSON.stringify(e))}};r.\u0275fac=function(i){return new(i||r)(K(oe))},r.\u0275prov=J({token:r,factory:r.\u0275fac,providedIn:"root"});let n=r;return n})();var R=function(n){return n[n.OK=200]="OK",n[n.BAD_REQUEST=400]="BAD_REQUEST",n[n.CONFLICT=409]="CONFLICT",n[n.NOT_FOUND=404]="NOT_FOUND",n[n.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",n}(R||{});var Fe=()=>["/menu/log/order"],Pe=(n,r,m,e,i)=>({responseCode:n,From:r,to:m,actionType:e,ChannelID:i});function we(n,r){if(n&1&&(o(0,"th",9)(1,"div",10)(2,"h4"),c(3),a(),o(4,"small",11),c(5),a()()()),n&2){let m=r.$implicit,e=v();s(3),N(m),s(),X(e.getTextBgColor(m)),s(),N(e.getHeaderStatusDesc(m))}}function be(n,r){if(n&1&&(o(0,"td",14)(1,"a",15),c(2),a()()),n&2){let m=r.$implicit,e=v().$implicit,i=v();s(),p("routerLink",$(3,Fe))("queryParams",ee(4,Pe,m.Key,i.fromQueryParam,i.toQueryParam,i.type,e.ChannelID)),s(),Z(" ",m.Value," ")}}function De(n,r){if(n&1&&(o(0,"tr")(1,"td")(2,"a",12),T(3,"img",13),a()(),o(4,"td")(5,"div")(6,"a",12),c(7),a()(),o(8,"div"),c(9),a()(),C(10,be,3,10,"td",8),a()),n&2){let m=r.$implicit,e=v();s(2),U("href",m.Url,G),s(),p("src",e.getChannelLogo(m.Type),G),s(3),U("href",m.Url,G),s(),N(m.Name),s(2),N(m.Url),s(),p("ngForOf",m.list)}}function Ie(n,r){if(n&1&&(o(0,"td",14)(1,"div",16),c(2),A(3,"number"),a()()),n&2){let m=r.$implicit;s(2),N(j(3,1,m.total))}}var E=(()=>{let r=class r{constructor(){this.type=null,this.headerStatus=R,this.listCalculationStatusCode=[]}set from(e){e&&(this.fromQueryParam=new Date(e).toJSON().toString())}set to(e){e&&(this.toQueryParam=new Date(e).toJSON().toString())}ngOnChanges(e){e.result&&this.calculateStatusCode()}getHeaderStatusDesc(e){let i=null;switch(e){case R.BAD_REQUEST:i="BAD REQUEST";break;case R.CONFLICT:i="CONFLICT";break;case R.INTERNAL_SERVER_ERROR:i="INTERNAL SERVER ERROR";break;case R.NOT_FOUND:i="NOT FOUND";break;default:i="OK";break}return i}getTextBgColor(e){let i=null;switch(e){case R.OK:i="bg-success";break;case R.INTERNAL_SERVER_ERROR:i="bg-danger";break;default:i="bg-warning";break}return i}getChannelLogo(e){return f.getChannelLogoByTypeId(e)}calculateStatusCode(){if(this.listCalculationStatusCode=[],this.result){let e,i;this.concatStatusCode().forEach(t=>{e=this.listCalculationStatusCode.findIndex(d=>d.status==t.Key),i=e!==-1,i?this.listCalculationStatusCode[e].total+=t.Value:this.listCalculationStatusCode=[...this.listCalculationStatusCode,{status:t.Key,total:t.Value}]})}}concatStatusCode(){return this.result.map(e=>e.list).reduce((e,i)=>[...e,...i])}};r.\u0275fac=function(i){return new(i||r)},r.\u0275cmp=S({type:r,selectors:[["app-table-report"]],inputs:{header:"header",result:"result",from:"from",to:"to",type:"type"},features:[q],decls:15,vars:3,consts:[[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","0%"],[2,"width","5%"],["class","text-start","style","width: 10%;",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],["colspan","2"],[1,"text-center","h3","fw-bold"],["class","text-start",4,"ngFor","ngForOf"],[1,"text-start",2,"width","10%"],[1,"d-block"],[1,"text-white","p-1","rounded","response-desc"],["target","_blank",3,"href"],[2,"width","24px","height","24px",3,"src"],[1,"text-start"],[1,"h3","text-primary","fw-bold","ms-1",3,"routerLink","queryParams"],[1,"d-inline-block","h3","text-primary","fw-bold","ms-1"]],template:function(i,t){i&1&&(o(0,"table",0)(1,"thead",1)(2,"tr"),T(3,"th",2),o(4,"th",3),c(5,"Channel"),a(),C(6,we,6,4,"th",4),a()(),o(7,"tbody"),C(8,De,11,6,"tr",5),a(),o(9,"tfoot")(10,"tr")(11,"td",6)(12,"div",7),c(13,"Total"),a()(),C(14,Ie,4,3,"td",8),a()()()),i&2&&(s(6),p("ngForOf",t.header),s(2),p("ngForOf",t.result),s(6),p("ngForOf",t.listCalculationStatusCode))},dependencies:[te,le,re],styles:[".response-desc[_ngcontent-%COMP%]{font-size:12px}"]});let n=r;return n})();function Ee(n,r){if(n&1&&(o(0,"div",6)(1,"div",7),T(2,"app-table-report",8),a()()),n&2){let m=v();s(2),p("result",m.result)("header",m.header)("from",m.filter.From)("to",m.filter.To)("type",0)}}var ue=(()=>{let r=class r{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new F,this.pageTitle="New Order";let t=new Date;this.maxDate=t,this.minDate=f.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.pageTitle=`New Order (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncOrder(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(b))},r.\u0275cmp=S({type:r,selectors:[["app-sales-order"]],decls:10,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),P("onSubmit",function(){return t.getChannelLogs()}),o(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),a(),o(5,"datepicker",2),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a(),o(6,"datepicker",3),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()(),o(7,"content")(8,"div",4),C(9,Ee,3,5,"div",5),a()()()),i&2&&(p("headerTitle",t.pageTitle)("hideSearchBox",!0),s(5),u("date",t.filter.From),s(),u("date",t.filter.To),s(3),p("ngIf",t.result))},dependencies:[w,D,_,E]});let n=r;return n})();function Oe(n,r){if(n&1&&(o(0,"div",6)(1,"div",7),T(2,"app-table-report",8),a()()),n&2){let m=v();s(2),p("result",m.result)("header",m.header)("from",m.filter.From)("to",m.filter.To)("type",1)}}var ye=(()=>{let r=class r{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new F,this.PageTitle="Ready to Ship";let t=new Date;this.maxDate=t,this.minDate=f.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Ready to Ship (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(b))},r.\u0275cmp=S({type:r,selectors:[["app-invoice"]],decls:10,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),P("onSubmit",function(){return t.onFilter()}),o(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),a(),o(5,"datepicker",2),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a(),o(6,"datepicker",3),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()(),o(7,"content")(8,"div",4),C(9,Oe,3,5,"div",5),a()()()),i&2&&(p("headerTitle",t.PageTitle)("hideSearchBox",!0),s(5),u("date",t.filter.From),s(),u("date",t.filter.To),s(3),p("ngIf",t.result))},dependencies:[w,D,_,E]});let n=r;return n})();function Re(n,r){if(n&1&&(o(0,"div",7)(1,"div",8),T(2,"app-table-report",9),a()()),n&2){let m=v();s(2),p("result",m.result)("header",m.header)("from",m.filter.From)("to",m.filter.To)("type",3)}}var ge=(()=>{let r=class r{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new F;let t=new Date;this.maxDate=t,this.minDate=f.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Shipped (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncDelivery(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(b))},r.\u0275cmp=S({type:r,selectors:[["app-delivery"]],decls:10,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"filterDate"],[1,"fw-bold"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),P("onSubmit",function(){return t.onFilter()}),o(1,"filters")(2,"div",1)(3,"h6",2),c(4,"From/To"),a(),o(5,"datepicker",3),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a(),o(6,"datepicker",4),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()(),o(7,"content")(8,"div",5),C(9,Re,3,5,"div",6),a()()()),i&2&&(p("headerTitle",t.PageTitle)("hideSearchBox",!0),s(5),u("date",t.filter.From),s(),u("date",t.filter.To),s(3),p("ngIf",t.result))},dependencies:[w,D,_,E]});let n=r;return n})();function Le(n,r){if(n&1&&(o(0,"div",6)(1,"div",7),T(2,"app-table-report",8),a()()),n&2){let m=v();s(2),p("result",m.result)("header",m.header)("from",m.filter.From)("to",m.filter.To)("type",4)}}var Ce=(()=>{let r=class r{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new F,this.PageTitle="Completed";let t=new Date;this.minDate=f.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Completed (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncPayment(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(b))},r.\u0275cmp=S({type:r,selectors:[["app-payment"]],decls:10,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),P("onSubmit",function(){return t.onFilter()}),o(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),a(),o(5,"datepicker",2),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a(),o(6,"datepicker",3),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()(),o(7,"content")(8,"div",4),C(9,Le,3,5,"div",5),a()()()),i&2&&(p("headerTitle",t.PageTitle)("hideSearchBox",!0),s(5),u("date",t.filter.From),s(),u("date",t.filter.To),s(3),p("ngIf",t.result))},dependencies:[w,D,_,E]});let n=r;return n})();function Me(n,r){n&1&&Y(0)}function ke(n,r){if(n&1&&(o(0,"div",7)(1,"div",8),T(2,"app-table-report",9),a()()),n&2){let m=r.ngIf,e=v();s(2),p("result",m.Body)("header",m.Header)("from",e.filter==null?null:e.filter.From)("to",e.filter==null?null:e.filter.To)}}var Te=(()=>{let r=class r{constructor(e,i){this.reportOrderService=e,this.datePipe=i,this.filter=new F}ngOnInit(){this.initFilter(),this.initLoader()}initFilter(){let e=new Date;this.minDate=f.addDays(e,6),this.filter.From=e,this.filter.To=e,this.updatePageTitle()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.pageTitle=`All (${e==null?"":i+"-"} ${t})`}initLoader(){this.pageLoader$=this.reportOrderService.GetLoader().pipe(H(e=>{this.filter=e,this.updatePageTitle(),this.initData()}))}initData(){this.reportData$=this.reportOrderService.getAllReport(this.filter).pipe(V())}onFilter(){this.updatePageTitle(),this.initData()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(b))},r.\u0275cmp=S({type:r,selectors:[["app-all"]],decls:13,vars:10,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],[4,"ngIf"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),P("onSubmit",function(){return t.onFilter()}),o(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),a(),o(5,"datepicker",2),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a(),o(6,"datepicker",3),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()(),o(7,"content")(8,"div",4),C(9,Me,1,0,"ng-container",5),A(10,"async"),C(11,ke,3,4,"div",6),A(12,"async"),a()()()),i&2&&(p("headerTitle",t.pageTitle)("hideSearchBox",!0),s(5),u("date",t.filter.From),s(),u("date",t.filter.To),s(3),p("ngIf",j(10,6,t.pageLoader$)),s(2),p("ngIf",j(12,8,t.reportData$)))},dependencies:[w,D,_,E,ie]});let n=r;return n})();function xe(n,r){if(n&1&&(o(0,"div",6)(1,"div",7),T(2,"app-table-report",8),a()()),n&2){let m=v();s(2),p("result",m.result)("header",m.header)("from",m.filter.From)("to",m.filter.To)("type",1)}}var ve=(()=>{let r=class r{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new F,this.PageTitle="Convert Sales Order To Invoice";let t=new Date;this.maxDate=t,this.minDate=f.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Convert Sales Order To Invoice (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(b))},r.\u0275cmp=S({type:r,selectors:[["app-convert-invoice"]],decls:10,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),P("onSubmit",function(){return t.onFilter()}),o(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),a(),o(5,"datepicker",2),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a(),o(6,"datepicker",3),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()(),o(7,"content")(8,"div",4),C(9,xe,3,5,"div",5),a()()()),i&2&&(p("headerTitle",t.PageTitle)("hideSearchBox",!0),s(5),u("date",t.filter.From),s(),u("date",t.filter.To),s(3),p("ngIf",t.result))},dependencies:[w,D,_,E]});let n=r;return n})();function Ne(n,r){if(n&1&&(o(0,"div",6)(1,"div",7),T(2,"app-table-report",8),a()()),n&2){let m=v();s(2),p("result",m.result)("header",m.header)("from",m.filter.From)("to",m.filter.To)("type",1)}}var Se=(()=>{let r=class r{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new F,this.PageTitle="Ready to Ship";let t=new Date;this.maxDate=t,this.minDate=f.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Ready to Ship (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(b))},r.\u0275cmp=S({type:r,selectors:[["app-void-invoice"]],decls:10,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),P("onSubmit",function(){return t.onFilter()}),o(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),a(),o(5,"datepicker",2),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a(),o(6,"datepicker",3),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()(),o(7,"content")(8,"div",4),C(9,Ne,3,5,"div",5),a()()()),i&2&&(p("headerTitle",t.PageTitle)("hideSearchBox",!0),s(5),u("date",t.filter.From),s(),u("date",t.filter.To),s(3),p("ngIf",t.result))},dependencies:[w,D,_,E]});let n=r;return n})();var Be=[{path:"",component:he,children:[{path:"",redirectTo:"sync-order",pathMatch:"full"},{path:"sync-order",component:ue,canActivate:[L],data:{title:"Sync Order"}},{path:"convert-to-invoice",component:ve,canActivate:[L],data:{title:"Sync Convert to Invoice"}},{path:"invoice",component:ye,canActivate:[L],data:{title:"Sync Invoice"}},{path:"delivery",component:ge,canActivate:[L],data:{title:"Sync Delivery"}},{path:"payment",component:Ce,canActivate:[L],data:{title:"Sync Payment"}},{path:"void-invoice",component:Se,canActivate:[L],data:{title:"Sync void invoice"}},{path:"all",component:Te,canActivate:[L],data:{title:"All Report"}}]}],Rt=(()=>{let r=class r{};r.\u0275fac=function(i){return new(i||r)},r.\u0275mod=z({type:r}),r.\u0275inj=Q({imports:[ne,ce,me,pe,fe,_,se.forChild(Be)]});let n=r;return n})();export{Rt as OrderModule};
@@ -1,4 +1,4 @@
1
- import{a as ne,b as oe,c as re,d as ae,e as le,f as pe,g as se}from"./chunk-MSGMWJHN.js";import{b as ie}from"./chunk-PRYDCJG5.js";import{a as ee,b as te}from"./chunk-SRYGE2HW.js";import{a as X}from"./chunk-T4Y427M7.js";import{g as Q}from"./chunk-7QECCYLR.js";import{e as W}from"./chunk-K3G6FMDF.js";import"./chunk-JM3LERUP.js";import{C as Y,D as Z}from"./chunk-ZKBLXGXT.js";import"./chunk-6B64VOO7.js";import{c as z,h as K,k as q,u as J}from"./chunk-SP6QPE3M.js";import"./chunk-6F6NSBIF.js";import{$ as D,Ab as m,Bb as O,Cb as B,Eb as L,Fb as F,Ga as M,Gb as R,Hb as P,Ia as p,Ja as I,Kb as x,Wa as c,Wc as j,Ya as s,Yc as $,_c as G,aa as T,ca as U,fb as o,gb as r,ha as C,hb as d,ia as N,ib as f,jb as _,kc as w,lb as S,lc as V,mc as A,ob as y,pa as g,qa as h,qb as u,sc as H,za as k,zb as v}from"./chunk-6DRNAUKE.js";import"./chunk-GRMIXZTT.js";var ge=e=>[e];function he(e,t){if(e&1&&(f(0),o(1,"a",9),m(2),r(),_()),e&2){let a=t.$implicit;p(),s("routerLink",x(2,ge,a.url)),p(),B(" ",a.title,"")}}var ce=(()=>{let t=class t{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"}]}};t.\u0275fac=function(i){return new(i||t)},t.\u0275cmp=C({type:t,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(i,l){i&1&&(o(0,"nav",0)(1,"div",1)(2,"div"),d(3,"nav-tab",2),r()(),o(4,"div")(5,"div",3)(6,"a",4),d(7,"i",5),r(),o(8,"div",6)(9,"div",7),c(10,he,3,4,"ng-container",8),r()()()()(),d(11,"router-outlet")),i&2&&(p(3),s("Tabs",l.tabs),p(7),s("ngForOf",l.moreMenu))},dependencies:[w,ee,j,$]});let e=t;return e})();var E=(()=>{let t=class t{constructor(n){this.httpService=n}download(n){return this.httpService.post("/api/Product/downloadurl",n)}};t.\u0275fac=function(i){return new(i||t)(U(W))},t.\u0275prov=D({token:t,factory:t.\u0275fac,providedIn:"root"});let e=t;return e})();var Ce=e=>({"background-color":e});function ye(e,t){if(e&1&&(o(0,"th"),m(1),r()),e&2){let a=t.$implicit;p(),O(a.column)}}function ve(e,t){if(e&1&&(f(0),o(1,"td"),d(2,"span",6),r(),_()),e&2){let a=t.$implicit,n=u().$implicit;p(2),s("innerHTML",n[a.prop],M)}}function xe(e,t){if(e&1&&(o(0,"tr",5),c(1,ve,3,1,"ng-container",3),r()),e&2){let a=t.$implicit,n=u();s("ngStyle",x(2,Ce,a.Status>200?"#F4D6D5":"#DEE9C9")),p(),s("ngForOf",n.configs)}}var de=(()=>{let t=class t{constructor(){this.eventClose=new k}ngOnInit(){}onClose(){this.eventClose.emit()}};t.\u0275fac=function(i){return new(i||t)},t.\u0275cmp=C({type:t,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(i,l){i&1&&(o(0,"div",0)(1,"table",1)(2,"thead",2)(3,"tr"),c(4,ye,2,1,"th",3),r()(),o(5,"tbody"),c(6,xe,2,4,"tr",4),r()()()),i&2&&(p(4),s("ngForOf",l.configs),p(2),s("ngForOf",l.data))},dependencies:[w,A]});let e=t;return e})();function be(e,t){if(e&1){let a=S();f(0),o(1,"button",15),y("click",function(){g(a);let i=u(),l=v(11);return h(i.onNewStepperState(l))}),d(2,"i",16),m(3," New "),r(),_()}}function Ee(e,t){if(e&1){let a=S();f(0),o(1,"button",15),y("click",function(){g(a),u();let i=v(11);return h(i.previous())}),m(2," Back "),r(),_()}}function Ie(e,t){if(e&1){let a=S();f(0),o(1,"button",17),y("click",function(){g(a);let i=u(),l=v(11);return h(i.onStepperNext(l))}),m(2," Next "),r(),_()}}function De(e,t){if(e&1){let a=S();f(0),o(1,"button",18),y("click",function(){g(a);let i=u(),l=v(11);return h(i.onSubmit(l))}),m(2,"Download"),r(),_()}if(e&2){let a=u();p(),s("disabled",!a.urls)}}function Te(e,t){e&1&&(d(0,"i",19),o(1,"span"),m(2,"Instruction"),r())}function Ue(e,t){e&1&&(o(0,"div",20)(1,"div",21)(2,"div",22)(3,"h4",23),m(4,"Note"),r()(),o(5,"div",24)(6,"ol",25)(7,"li"),m(8," Use this form to Download Products from Tokopedia using product URL "),r(),o(9,"li"),m(10," Copy Product URL from "),o(11,"a",26),m(12,"https://seller.tokopedia.com/ "),r(),m(13," and paste in this form "),r(),o(14,"li"),m(15," Use New Line when you want to input several product URLs "),r()()()()())}function Ne(e,t){e&1&&(d(0,"i",27),o(1,"span"),m(2,"Download"),r())}function ke(e,t){if(e&1){let a=S();o(0,"div",20)(1,"textarea",28),R("ngModelChange",function(i){g(a);let l=u();return F(l.urls,i)||(l.urls=i),h(i)}),r()()}if(e&2){let a=u();p(),s("placeholder",a.urlPlaceholder),L("ngModel",a.urls)}}function Me(e,t){e&1&&(d(0,"i",29),o(1,"span"),m(2,"Finish"),r())}function Oe(e,t){if(e&1&&(o(0,"div",20),d(1,"app-response-api-list",30),r()),e&2){let a=u();p(),s("data",a.downloadResponses)("configs",a.configs)}}function Be(e,t){e&1&&(o(0,"h6"),m(1,"1"),r())}function Le(e,t){e&1&&(o(0,"h6"),m(1,"2"),r())}function Fe(e,t){e&1&&(o(0,"h6"),m(1,"3"),r())}var ue=(()=>{let t=class t{constructor(n,i){this.downloadService=n,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
1
+ import{a as ne,b as oe,c as re,d as ae,e as le,f as pe,g as se}from"./chunk-MSGMWJHN.js";import{b as ie}from"./chunk-PRYDCJG5.js";import{a as ee,b as te}from"./chunk-SRYGE2HW.js";import{a as X}from"./chunk-GIB66QXC.js";import{g as Q}from"./chunk-2OH65RRD.js";import{e as W}from"./chunk-K3G6FMDF.js";import"./chunk-JM3LERUP.js";import{C as Y,D as Z}from"./chunk-ZKBLXGXT.js";import"./chunk-6B64VOO7.js";import{c as z,h as K,k as q,u as J}from"./chunk-SP6QPE3M.js";import"./chunk-6F6NSBIF.js";import{$ as D,Ab as m,Bb as O,Cb as B,Eb as L,Fb as F,Ga as M,Gb as R,Hb as P,Ia as p,Ja as I,Kb as x,Wa as c,Wc as j,Ya as s,Yc as $,_c as G,aa as T,ca as U,fb as o,gb as r,ha as C,hb as d,ia as N,ib as f,jb as _,kc as w,lb as S,lc as V,mc as A,ob as y,pa as g,qa as h,qb as u,sc as H,za as k,zb as v}from"./chunk-6DRNAUKE.js";import"./chunk-GRMIXZTT.js";var ge=e=>[e];function he(e,t){if(e&1&&(f(0),o(1,"a",9),m(2),r(),_()),e&2){let a=t.$implicit;p(),s("routerLink",x(2,ge,a.url)),p(),B(" ",a.title,"")}}var ce=(()=>{let t=class t{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"}]}};t.\u0275fac=function(i){return new(i||t)},t.\u0275cmp=C({type:t,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(i,l){i&1&&(o(0,"nav",0)(1,"div",1)(2,"div"),d(3,"nav-tab",2),r()(),o(4,"div")(5,"div",3)(6,"a",4),d(7,"i",5),r(),o(8,"div",6)(9,"div",7),c(10,he,3,4,"ng-container",8),r()()()()(),d(11,"router-outlet")),i&2&&(p(3),s("Tabs",l.tabs),p(7),s("ngForOf",l.moreMenu))},dependencies:[w,ee,j,$]});let e=t;return e})();var E=(()=>{let t=class t{constructor(n){this.httpService=n}download(n){return this.httpService.post("/api/Product/downloadurl",n)}};t.\u0275fac=function(i){return new(i||t)(U(W))},t.\u0275prov=D({token:t,factory:t.\u0275fac,providedIn:"root"});let e=t;return e})();var Ce=e=>({"background-color":e});function ye(e,t){if(e&1&&(o(0,"th"),m(1),r()),e&2){let a=t.$implicit;p(),O(a.column)}}function ve(e,t){if(e&1&&(f(0),o(1,"td"),d(2,"span",6),r(),_()),e&2){let a=t.$implicit,n=u().$implicit;p(2),s("innerHTML",n[a.prop],M)}}function xe(e,t){if(e&1&&(o(0,"tr",5),c(1,ve,3,1,"ng-container",3),r()),e&2){let a=t.$implicit,n=u();s("ngStyle",x(2,Ce,a.Status>200?"#F4D6D5":"#DEE9C9")),p(),s("ngForOf",n.configs)}}var de=(()=>{let t=class t{constructor(){this.eventClose=new k}ngOnInit(){}onClose(){this.eventClose.emit()}};t.\u0275fac=function(i){return new(i||t)},t.\u0275cmp=C({type:t,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(i,l){i&1&&(o(0,"div",0)(1,"table",1)(2,"thead",2)(3,"tr"),c(4,ye,2,1,"th",3),r()(),o(5,"tbody"),c(6,xe,2,4,"tr",4),r()()()),i&2&&(p(4),s("ngForOf",l.configs),p(2),s("ngForOf",l.data))},dependencies:[w,A]});let e=t;return e})();function be(e,t){if(e&1){let a=S();f(0),o(1,"button",15),y("click",function(){g(a);let i=u(),l=v(11);return h(i.onNewStepperState(l))}),d(2,"i",16),m(3," New "),r(),_()}}function Ee(e,t){if(e&1){let a=S();f(0),o(1,"button",15),y("click",function(){g(a),u();let i=v(11);return h(i.previous())}),m(2," Back "),r(),_()}}function Ie(e,t){if(e&1){let a=S();f(0),o(1,"button",17),y("click",function(){g(a);let i=u(),l=v(11);return h(i.onStepperNext(l))}),m(2," Next "),r(),_()}}function De(e,t){if(e&1){let a=S();f(0),o(1,"button",18),y("click",function(){g(a);let i=u(),l=v(11);return h(i.onSubmit(l))}),m(2,"Download"),r(),_()}if(e&2){let a=u();p(),s("disabled",!a.urls)}}function Te(e,t){e&1&&(d(0,"i",19),o(1,"span"),m(2,"Instruction"),r())}function Ue(e,t){e&1&&(o(0,"div",20)(1,"div",21)(2,"div",22)(3,"h4",23),m(4,"Note"),r()(),o(5,"div",24)(6,"ol",25)(7,"li"),m(8," Use this form to Download Products from Tokopedia using product URL "),r(),o(9,"li"),m(10," Copy Product URL from "),o(11,"a",26),m(12,"https://seller.tokopedia.com/ "),r(),m(13," and paste in this form "),r(),o(14,"li"),m(15," Use New Line when you want to input several product URLs "),r()()()()())}function Ne(e,t){e&1&&(d(0,"i",27),o(1,"span"),m(2,"Download"),r())}function ke(e,t){if(e&1){let a=S();o(0,"div",20)(1,"textarea",28),R("ngModelChange",function(i){g(a);let l=u();return F(l.urls,i)||(l.urls=i),h(i)}),r()()}if(e&2){let a=u();p(),s("placeholder",a.urlPlaceholder),L("ngModel",a.urls)}}function Me(e,t){e&1&&(d(0,"i",29),o(1,"span"),m(2,"Finish"),r())}function Oe(e,t){if(e&1&&(o(0,"div",20),d(1,"app-response-api-list",30),r()),e&2){let a=u();p(),s("data",a.downloadResponses)("configs",a.configs)}}function Be(e,t){e&1&&(o(0,"h6"),m(1,"1"),r())}function Le(e,t){e&1&&(o(0,"h6"),m(1,"2"),r())}function Fe(e,t){e&1&&(o(0,"h6"),m(1,"3"),r())}var ue=(()=>{let t=class t{constructor(n,i){this.downloadService=n,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
2
2
  https://tokopedia.com/tokoriyanadi/Celana-Chinos-Coklat`,this.currentDomain=this.authService.getDomain()}onStepperChange(n){this.stepperState=n.selectedStep.state}onSubmit(n){let i=this.urls.split(/\r?\n/);this.downloadService.download(i).subscribe(l=>{this.downloadResponses=l,this.mappingLinkToProduct(),this.onStepperNext(n)})}mappingLinkToProduct(){this.downloadResponses=this.downloadResponses.map(n=>(n.Name=n?.Name?`<a href="${this.currentDomain}/menu/Products/Catalog/Products/Info?ID=${n.ID}" target="_blank">
3
3
  ${n?.Name}
4
4
  </a>`:"-",n))}onNewStepperState(n){this.downloadResponses=[],this.urls=null,this.stepperState="DOWNLOAD",n.reset(),this.onStepperNext(n)}onStepperNext(n){n.selected.completed=!0,n.next()}};t.\u0275fac=function(i){return new(i||t)(I(E),I(Q))},t.\u0275cmp=C({type:t,selectors:[["app-by-url"]],features:[P([{provide:ne,useValue:{displayDefaultIndicatorType:!1}}])],decls:24,vars:11,consts:[["stepper",""],["headerTitle","Tokopedia - Product Download By Url",3,"hideSearchBox","hideSearchDropdown"],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-12"],["linear","",1,"stepper-downloadByUrl",3,"selectionChange","selectedIndex"],["state","GUIDE",3,"editable","completed"],["matStepLabel",""],["matStepContent",""],["state","DOWNLOAD",3,"editable","completed"],["state","FINISH"],["matStepperIcon","GUIDE"],["matStepperIcon","DOWNLOAD"],["matStepperIcon","FINISH"],[1,"btn","btn-outline-secondary","btn-fill","btn-lg",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],["type","button",1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-3",3,"click"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","text-white","ms-3",3,"click","disabled"],[1,"fa-solid","fa-info","me-3"],[1,"mt-8"],[1,"card","border","w-50"],[1,"card-header","py-6"],[1,"text-primary"],[1,"card-body",2,"padding-left","0px"],[1,"mt-6"],["href","https://seller.tokopedia.com","target","_blank"],[1,"fa-solid","fa-download","me-3"],["name","url","cols","30","rows","25",1,"form-control",3,"ngModelChange","placeholder","ngModel"],[1,"fa-sharp","fa-solid","fa-flag","me-3"],["status","error",3,"data","configs"]],template:function(i,l){if(i&1){let fe=S();o(0,"mainpanel",1)(1,"actions"),c(2,be,4,0,"ng-container",2)(3,Ee,3,0,"ng-container",2)(4,Ie,3,0,"ng-container",2)(5,De,3,1,"ng-container",2),r(),o(6,"content")(7,"div",3)(8,"div",4)(9,"div",5)(10,"mat-stepper",6,0),y("selectionChange",function(_e){return g(fe),h(l.onStepperChange(_e))}),o(12,"mat-step",7),c(13,Te,3,0,"ng-template",8)(14,Ue,16,0,"ng-template",9),r(),o(15,"mat-step",10),c(16,Ne,3,0,"ng-template",8)(17,ke,2,2,"ng-template",9),r(),o(18,"mat-step",11),c(19,Me,3,0,"ng-template",8)(20,Oe,2,2,"ng-template",9),r(),c(21,Be,2,0,"ng-template",12)(22,Le,2,0,"ng-template",13)(23,Fe,2,0,"ng-template",14),r()()()()()()}i&2&&(s("hideSearchBox",!0)("hideSearchDropdown",!0),p(2),s("ngIf",l.stepperState=="FINISH"),p(),s("ngIf",l.stepperState=="DOWNLOAD"),p(),s("ngIf",l.stepperState=="GUIDE"),p(),s("ngIf",l.stepperState=="DOWNLOAD"),p(5),s("selectedIndex",1),p(2),s("editable",l.stepperState!="FINISH")("completed",!0),p(3),s("editable",l.stepperState!="FINISH")("completed",!1))},dependencies:[V,z,K,q,Y,le,oe,pe,re,ae,de],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%}