marketplacepos 3.13.0 → 3.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/Marketplace/{chunk-CW5KDBLU.js → chunk-4VJSS2RP.js} +1 -1
  2. package/Marketplace/{chunk-7OJNNBCN.js → chunk-5TLAX43C.js} +1 -1
  3. package/Marketplace/{chunk-RSTDY3BK.js → chunk-AATQG55J.js} +1 -1
  4. package/Marketplace/{chunk-ZIWIIY7R.js → chunk-ABGYQNLC.js} +1 -1
  5. package/Marketplace/{chunk-5US3733H.js → chunk-ARA3PK2O.js} +1 -1
  6. package/Marketplace/{chunk-AZMGWQHI.js → chunk-CS5AGUUI.js} +1 -1
  7. package/Marketplace/{chunk-II3E425T.js → chunk-ENMVK7WN.js} +1 -1
  8. package/Marketplace/{chunk-27IRFADU.js → chunk-FG5CLZ6F.js} +1 -1
  9. package/Marketplace/{chunk-PVQ2T5XH.js → chunk-FON6ZRGN.js} +1 -1
  10. package/Marketplace/{chunk-2KLUGZKI.js → chunk-FQUPOWRE.js} +1 -1
  11. package/Marketplace/{chunk-B6W4BWFY.js → chunk-GEEAZIV4.js} +1 -1
  12. package/Marketplace/{chunk-RUBFBYVI.js → chunk-KK2VCYNM.js} +1 -1
  13. package/Marketplace/{chunk-H6JEFAAC.js → chunk-KRNA3GN5.js} +1 -1
  14. package/Marketplace/{chunk-M3P5OJ7T.js → chunk-LCOFOENF.js} +1 -1
  15. package/Marketplace/{chunk-ENYT723T.js → chunk-M67NQISG.js} +1 -1
  16. package/Marketplace/chunk-MFCHLZW7.js +3 -0
  17. package/Marketplace/{chunk-VW2YGC3V.js → chunk-MUFSHB3B.js} +1 -1
  18. package/Marketplace/{chunk-52ZJ2S2T.js → chunk-NUHOGS4I.js} +1 -1
  19. package/Marketplace/{chunk-WLSW7EOC.js → chunk-OOBUECHW.js} +1 -1
  20. package/Marketplace/{chunk-XT632VDA.js → chunk-PMOYSZXY.js} +1 -1
  21. package/Marketplace/{chunk-AKIUNZCW.js → chunk-TOGKMWQK.js} +1 -1
  22. package/Marketplace/{chunk-HMAXDG3A.js → chunk-VOVI2B6O.js} +1 -1
  23. package/Marketplace/{chunk-GY7H2DNW.js → chunk-VXKEHQ73.js} +1 -1
  24. package/Marketplace/{chunk-ZIAISN44.js → chunk-WMVEBC4Z.js} +1 -1
  25. package/Marketplace/index.html +2 -2
  26. package/Marketplace/{main-NPVQUDS5.js → main-6U2BHS4K.js} +1 -1
  27. package/package.json +1 -1
  28. package/Marketplace/chunk-HW7H3ISH.js +0 -3
@@ -1 +1 @@
1
- import{a as O,b as It,d as Q,e as de}from"./chunk-WLSW7EOC.js";import{a as q}from"./chunk-IWVYX6KY.js";import{a as $}from"./chunk-FCVAME75.js";import"./chunk-CP7VAKTQ.js";import{a as pe}from"./chunk-LIS3LB3F.js";import{f as re,g as ae,h as le,i as ce,j as se}from"./chunk-7GNI4BOW.js";import"./chunk-OFRBPREK.js";import{a as Xt,b as te}from"./chunk-7CEWM7GE.js";import{a as X,b as wt}from"./chunk-TX43EE6N.js";import{a as z}from"./chunk-N23ZYP7G.js";import{a as ee,b as ne,c as ie}from"./chunk-DXJFMERC.js";import{b as me}from"./chunk-7NWB2VB2.js";import"./chunk-IP2WADIR.js";import"./chunk-MEGPKKGI.js";import{a as rt,b as bt,d as Z,e as Yt}from"./chunk-2Y4N4NSS.js";import{a as nt}from"./chunk-M3P5OJ7T.js";import{a as B}from"./chunk-NNPT3RN6.js";import"./chunk-G6CZHXQI.js";import"./chunk-M4VGME5L.js";import{a as oe}from"./chunk-5WVUQE43.js";import"./chunk-AAIK6JQ3.js";import{g as L}from"./chunk-PVQ2T5XH.js";import{b as G,e as A}from"./chunk-IPX66YIX.js";import"./chunk-HBHGO2RV.js";import{d as J,l as R,m as Qt}from"./chunk-PIDUM6XT.js";import{t as vt,u as qt}from"./chunk-43TMSPFC.js";import{P as Zt}from"./chunk-4TYJR476.js";import{b as zt,c as ot,h as W,k as K,u as Ht}from"./chunk-F5YRASNU.js";import{b as Y,c as _}from"./chunk-2UXFUEON.js";import{$ as Lt,B as y,Eb as j,F as kt,Fb as m,Gb as Ct,Ha as N,Hb as I,Ia as c,Ja as x,Jb as D,Kb as T,Lb as E,O as Vt,Ob as et,Pb as ct,Q as Ut,T as H,V as lt,Wb as F,X as _t,Xb as k,Y as At,Ya as S,Yb as jt,Zb as it,_a as s,aa as Rt,bd as xt,c as gt,ca as Bt,cd as Kt,d as Ft,ed as Pt,ga as M,gd as Jt,ha as $t,kb as a,lb as l,mb as C,nb as b,oa as u,ob as v,pa as h,q as at,qb as P,rc as V,sc as U,tb as f,vb as p,vc as ft,wc as Gt,yc as St,zc as Wt}from"./chunk-77JORVC2.js";import"./chunk-CRRJCY55.js";var ve=()=>["/menu/products/download/by-url"],ue=(()=>{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",et(2,ve)))},dependencies:[Xt,Kt,Pt]});let o=r;return o})();function Ie(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 we(o,r){if(o&1&&(b(0),S(1,Ie,3,0,"button",12),v()),o&2){let n=p();c(),s("ngIf",!n.productService.hasSelection(n.products))}}function ye(o,r){if(o&1){let n=P();b(0),a(1,"button",15),f("click",function(){u(n);let e=p();return h(e.onScanMultipleProduct())}),C(2,"i",14),m(3),l(),v()}if(o&2){let n,t=p();c(3),I(" Scan (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function Me(o,r){if(o&1){let n=P();b(0),a(1,"button",16),f("click",function(){u(n);let e=p();return h(e.onUploadMultipleProduct())}),C(2,"i",17),m(3),l(),v()}if(o&2){let n,t=p();c(3),I(" Upload (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function Ne(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 Fe(o,r){o&1&&(b(0),a(1,"div",20),C(2,"app-empty-state"),l(),v())}function Oe(o,r){if(o&1){let n=P();b(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()()(),v()}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 ge=(()=>{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(O,{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(It,{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(O,{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(O,{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(A),x(G),x(J),x(B),x(L))},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,we,2,1,"ng-container",2)(3,ye,4,1,"ng-container",2)(4,Me,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),T(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),T(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,Ne,2,10,"div",11)(20,Fe,3,0,"ng-container",2),l(),S(21,Oe,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(),D("ngModel",i.startDate),c(),D("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,R,Z,z,X,$,le,re,ae,ce],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 De(o,r){if(o&1){let n=P();b(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(),v()}}function Te(o,r){if(o&1){let n=P();b(0),a(1,"button",12),f("click",function(){u(n);let e=p();return h(e.onScanMultipleProduct())}),C(2,"i",11),m(3),l(),v()}if(o&2){let n=p();c(3),I(" Scan (",n.productService.selectedProduct(n.products).length,") ")}}function Ee(o,r){if(o&1){let n=P();b(0),a(1,"button",13),f("click",function(){u(n);let e=p();return h(e.onUploadMultipleProduct())}),C(2,"i",14),m(3),l(),v()}if(o&2){let n=p();c(3),I(" Upload (",n.productService.selectedProduct(n.products).length,") ")}}function ke(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,N)("alt",n.Name),c(),I(" ",n.Name," ")}}function Ve(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 T(i.searchFilter.Item_id,e)||(i.searchFilter.Item_id=e),h(e)}),l()()}if(o&2){let n=p();c(3),D("ngModel",n.searchFilter.Item_id)}}function Ue(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 Ae(o,r){o&1&&(b(0),a(1,"div",22),C(2,"app-empty-state"),l(),v())}function Le(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 _e=(()=>{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(It,{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(O,{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(O,{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(O,{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(A),x(J),x(G),x(B),x(xt),x(L))},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,De,4,0,"ng-container",1)(3,Te,4,1,"ng-container",1)(4,Ee,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,ke,3,3,"ng-template",4),l()(),S(11,Ve,4,1,"div",5),l(),a(12,"content")(13,"div",6)(14,"div",7),S(15,Ue,2,10,"div",8)(16,Ae,3,0,"ng-container",1),l(),S(17,Le,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,R,Z,rt,bt,z,X,$],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})();var Ce=(()=>{let r=class r{get footerPageNumber(){return this._footerPageNumber}set footerPageNumber(t){this._footerPageNumber=t}get hideCount(){return this._hideCount}set hideCount(t){this._hideCount=t}get disableNextButton(){return this._disableNextButton}set disableNextButton(t){this._disableNextButton=t}get goToLastPage(){return this._goToLastPage}set goToLastPage(t){this._goToLastPage=t}constructor(t){this.http=t,this.pagination$=new Ft(null),this.destroy$=new gt,this.data$=this.paginationFunction()}onNextPage(t){t.PageNumber+=1,this.pagination$.next(t)}setPageNumberFooter(t){this.footerPageNumber=t.PageNumber}setPaginationButtonState(t,e){e==0?this.disableNextButton=!0:this.disableNextButton=!(e<t.RowCount*t.PageNumber)}reloadPagination(t){_.IsEmpty(t.PageNumber)&&(t.PageNumber=1),this.pagination$.next(t),this.hideCount=!0,this.goToLastPage=!1}getAllData(t,e){t.RowCount=e,this.pagination$.next(t),this.goToLastPage=!0}destroy(){this.destroy$.next(!0),this.destroy$.complete(),this.pagination$=null,this.pagination$=new Ft(null),this.data$=this.paginationFunction()}paginationFunction(){return this.pagination$.pipe(lt(this.destroy$),y(t=>t!=null),kt(t=>this.http.post(`/API/${this.fetchDataEndpoint}`,JSON.stringify(t)).pipe(at(e=>e.Data))),At(this.pagination$),Vt((t,e)=>{let[i,d]=t,[g]=e;return d.PageNumber==1?[g,d]:[i.concat(g),d]}),_t(([t,e])=>{this.setPageNumberFooter(e),this.setPaginationButtonState(e,t.length)}),at(([t])=>t),Ut())}};r.\u0275fac=function(e){return new(e||r)(Bt(A))},r.\u0275prov=Lt({token:r,factory:r.\u0275fac,providedIn:"root"});let o=r;return o})();function $e(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 je(o,r){if(o&1){let n=P();b(0),a(1,"td",29)(2,"input",30),E("ngModelChange",function(e){u(n);let i=p(2).$implicit;return T(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()(),v()}if(o&2){let n=p(2).$implicit;c(),s("rowSpan",n==null?null:n.Variants.length),c(),D("ngModel",n.selected)}}function Ge(o,r){if(o&1){let n=P();b(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(),v()}if(o&2){let n=p(3).$implicit;c(),s("src",n==null?null:n.ImageUrl,N)}}function We(o,r){o&1&&C(0,"img",36)}function Ke(o,r){if(o&1&&(b(0),a(1,"td",29)(2,"div",31),S(3,Ge,2,1,"ng-container",11)(4,We,1,0,"ng-template",null,1,it),l()(),a(6,"td",32)(7,"h4",33)(8,"span",34),m(9),l()()(),v()),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 Je(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,N),c(),s("src",n.Img,N)("matTooltip",n.Name)}}function ze(o,r){if(o&1&&(a(0,"div"),C(1,"img",37),l()),o&2){let n=r.$implicit;c(),s("src",n.Img,N)("matTooltip",n.Name)}}function He(o,r){if(o&1&&(a(0,"tr"),S(1,je,3,2,"ng-container",12)(2,Ke,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,Je,3,3,"div",23),l()(),a(14,"td",27)(15,"div",28),S(16,ze,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),N),c(4),s("ngForOf",n==null?null:n.Available),c(3),s("ngForOf",n==null?null:n.NotAvailable)}}function Ye(o,r){if(o&1&&(b(0),S(1,He,17,7,"tr",23),v()),o&2){let n=r.$implicit;c(),s("ngForOf",n.Variants)}}function Ze(o,r){if(o&1&&(a(0,"tbody"),S(1,Ye,2,1,"ng-container",23),l()),o&2){let n=r.ngIf;c(),s("ngForOf",n)}}function qe(o,r){if(o&1&&(b(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,Ze,2,1,"tbody",12),F(17,"async"),l()(),v()),o&2){let n=p(2);c(16),s("ngIf",k(17,1,n.data$))}}function Qe(o,r){o&1&&(a(0,"div",38),C(1,"app-empty-state"),l())}function Xe(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 tn(o,r){if(o&1&&(a(0,"span"),m(1),F(2,"number"),l()),o&2){let n=r.ngIf;c(),Ct(k(2,1,n==null?null:n.Count))}}function en(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 nn(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 on(o,r){if(o&1&&(b(0),a(1,"div",39)(2,"div",40)(3,"div",41),m(4),F(5,"number"),S(6,Xe,3,0,"span",42)(7,tn,3,3,"span",12),F(8,"async"),m(9),l()(),a(10,"div",43),S(11,en,3,0,"a",44)(12,nn,3,0,"a",45),l()(),v()),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 rn(o,r){if(o&1&&(b(0),S(1,on,13,10,"ng-container",12),v()),o&2){let n=r.ngIf;c(),s("ngIf",(n==null?null:n.length)>0)}}function an(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,$e,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.openExportDialog())}),C(7,"i",8),a(8,"span"),m(9,"Export"),l()()(),a(10,"content")(11,"div",9)(12,"div",10),S(13,qe,18,3,"ng-container",11),F(14,"async"),S(15,Qe,2,0,"ng-template",null,0,it),l(),S(17,rn,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 fe=(()=>{let r=class r{constructor(t,e,i,d,g,w,Et){this.http=t,this.dialog=e,this.toastr=i,this.productService=d,this.paginationService=g,this.biggerPictureService=w,this.authService=Et,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannelV2",this.hasSelectionProduct=!1,this.selectedProducts=[],this.channelOptions=Et.getChannels(),this.hostName=this.authService.getDomain()}ngOnInit(){this.initPageLoader(),this.iniData()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.notChannelAPI,this.loader$=this.http.post(`api/${this.loaderAPI}`,{}).pipe(_t(t=>{this.filterSearch=t.Filter,this.paginationService.reloadPagination(t.Filter)}))}iniData(){this.data$=this.paginationService.data$.pipe(at(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(O,{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()}openExportDialog(){this.dialog.open(pe,{data:{title:"Export Not In Channel",pageNumber:this.filterSearch.PageNumber,rowCount:this.filterSearch.RowCount,filterExport:this.filterSearch,getRowCountApi:"product/GetNotInChannelRowCount",exportApi:"product/GetNotInChannelExport"}}).afterClosed().subscribe()}};r.\u0275fac=function(e){return new(e||r)(x(A),x(J),x(G),x(B),x(Ce),x(oe),x(L))},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,an,19,9,"mainpanel",2),F(1,"async")),e&2&&s("ngIf",k(1,1,i.loader$))},dependencies:[V,U,zt,W,K,R,vt,$,ft,St],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 ln=o=>[o],cn=()=>[];function sn(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 pn(o,r){if(o&1){let n=P();b(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(),v()}if(o&2){let n,t=p();c(3),I(" Download (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function dn(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,N)("alt",n.Name),c(),I(" ",n.Name," ")}}function mn(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?ct(10,ln,n==null?null:n.Channel):et(12,cn))("showCheckBox",!0)("scanButton",!0)}}function un(o,r){o&1&&(b(0),a(1,"div",23),C(2,"app-empty-state"),l(),v())}function hn(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 Se=(()=>{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(O,{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(de,{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(A),x(J),x(B),x(G),x(xt),x(L))},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,sn,3,0,"button",1)(3,pn,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 T(i.searchFilter.ChannelID,g)||(i.searchFilter.ChannelID=g),g}),S(9,dn,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 T(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 T(i.searchFilter.Item_id,g)||(i.searchFilter.Item_id=g),g}),l()()(),a(24,"content")(25,"div",11)(26,"div",12),S(27,mn,2,13,"div",13)(28,un,3,0,"ng-container",2),l(),S(29,hn,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),D("ngModel",i.searchFilter.ChannelID),c(5),D("ngModel",i.searchFilter.HaveSku),c(),s("value",0),c(2),s("value",1),c(2),s("value",2),c(5),D("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,R,Z,rt,ee,ne,z,X,$],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 gn(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),N),c(),I(" ",n.Name," ")}}function _n(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&&(b(0),a(1,"div",13),C(2,"app-empty-state"),l(),v())}function fn(o,r){if(o&1){let n=P();b(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()()(),v()}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 xe=(()=>{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(A),x(B),x(L))},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 T(i.searchFilter.ListChannelID,g)||(i.searchFilter.ListChannelID=g),g}),f("clear",function(){return i.onClearFilter()}),S(7,gn,3,2,"ng-template",4),l()()()(),a(8,"content")(9,"div",5)(10,"div",6),S(11,_n,2,6,"div",7)(12,Cn,3,0,"ng-container",8),l(),S(13,fn,4,4,"ng-container",8),l()()()),e&2&&(c(6),s("multiple",!0)("clearable",!0)("items",i.channelOptions),D("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,R,Z,rt,bt,wt,z,$]});let o=r;return o})();var Sn=()=>["/menu/products/status/sold-in-channel"],Pe=o=>({ID:o}),xn=()=>["/menu/products/status/not-in-pos"];function Pn(o,r){if(o&1&&(b(0),m(1),v()),o&2){let n=p().$implicit;c(),I(" ",n.Count," ")}}function bn(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 vn(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,Pn,2,1,"ng-container",6)(7,bn,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),N),c(2),Ct(n.Name),c(2),s("ngIf",n.Count!==void 0)("ngIfElse",t),c(4),s("routerLink",et(18,Sn))("queryParams",ct(19,Pe,n.ID)),c(),I(" ",k(12,11,n.SoldInChannel)," "),c(3),s("routerLink",et(21,xn))("queryParams",ct(22,Pe,n.ID)),c(),I(" ",k(16,13,n.NotInPOS)," "),c(3),I("",n.LastSync?jt(19,15,n.LastSync,"dd MMM yyyy HH:mm"):"Never"," ")}}function In(o,r){if(o&1&&(b(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,vn,28,24,"tr",16),F(18,"async"),l()()(),v()),o&2){let n,t=p();c(17),s("ngForOf",(n=k(18,1,t.channels$))==null?null:n.Data)}}function wn(o,r){o&1&&(a(0,"div",28),C(1,"app-empty-state"),l())}var be=(()=>{let r=class r{constructor(t,e,i,d){this.productService=t,this.toastr=e,this.dialog=i,this.authService=d,this.destroy$=new gt,this.channelOptions=d.getChannels()}ngOnInit(){this.setObsProductStatistic()}setObsProductStatistic(){this.channels$=this.productService.getProductStatistic()}getLiveProductCount(t,e){this.productService.getTotalProductLive(t).pipe(lt(this.destroy$)).subscribe(i=>{e.Count=i.Count})}onScanChannel(t){this.dialog.open(O,{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(lt(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(B),x(G),x(J),x(L))},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,In,19,3,"ng-container",6),F(6,"async"),S(7,wn,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,R,vt,Pt,$,ft,St,Gt]});let o=r;return o})();var yn=[{component:ue,path:"",children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:ge,canActivate:[nt],data:{title:"Products in POS"}},{path:"sold-in-channel",component:_e,canActivate:[nt],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:fe,canActivate:[nt],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:Se,canActivate:[nt],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:xe,canActivate:[nt],data:{title:"Duplicate Sku in Channel"}},{path:"channel-statistic",component:be,canActivate:[nt],data:{title:"Channel Statistic"}}]}],Bi=(()=>{let r=class r{};r.\u0275fac=function(e){return new(e||r)},r.\u0275mod=$t({type:r}),r.\u0275inj=Rt({imports:[Wt,Ht,Qt,qt,Yt,me,ie,te,wt,z,X,Jt.forChild(yn),se,Zt]});let o=r;return o})();export{Bi as StatusModule};
1
+ import{a as O,b as It,d as Q,e as de}from"./chunk-OOBUECHW.js";import{a as q}from"./chunk-IWVYX6KY.js";import{a as $}from"./chunk-FCVAME75.js";import"./chunk-CP7VAKTQ.js";import{a as pe}from"./chunk-LIS3LB3F.js";import{f as re,g as ae,h as le,i as ce,j as se}from"./chunk-7GNI4BOW.js";import"./chunk-OFRBPREK.js";import{a as Xt,b as te}from"./chunk-7CEWM7GE.js";import{a as X,b as wt}from"./chunk-TX43EE6N.js";import{a as z}from"./chunk-N23ZYP7G.js";import{a as ee,b as ne,c as ie}from"./chunk-DXJFMERC.js";import{b as me}from"./chunk-7NWB2VB2.js";import"./chunk-IP2WADIR.js";import"./chunk-MEGPKKGI.js";import{a as rt,b as bt,d as Z,e as Yt}from"./chunk-2Y4N4NSS.js";import{a as nt}from"./chunk-LCOFOENF.js";import{a as B}from"./chunk-NNPT3RN6.js";import"./chunk-G6CZHXQI.js";import"./chunk-M4VGME5L.js";import{a as oe}from"./chunk-5WVUQE43.js";import"./chunk-AAIK6JQ3.js";import{g as L}from"./chunk-FON6ZRGN.js";import{b as G,e as A}from"./chunk-IPX66YIX.js";import"./chunk-HBHGO2RV.js";import{d as J,l as R,m as Qt}from"./chunk-PIDUM6XT.js";import{t as vt,u as qt}from"./chunk-43TMSPFC.js";import{P as Zt}from"./chunk-4TYJR476.js";import{b as zt,c as ot,h as W,k as K,u as Ht}from"./chunk-F5YRASNU.js";import{b as Y,c as _}from"./chunk-2UXFUEON.js";import{$ as Lt,B as y,Eb as j,F as kt,Fb as m,Gb as Ct,Ha as N,Hb as I,Ia as c,Ja as x,Jb as D,Kb as T,Lb as E,O as Vt,Ob as et,Pb as ct,Q as Ut,T as H,V as lt,Wb as F,X as _t,Xb as k,Y as At,Ya as S,Yb as jt,Zb as it,_a as s,aa as Rt,bd as xt,c as gt,ca as Bt,cd as Kt,d as Ft,ed as Pt,ga as M,gd as Jt,ha as $t,kb as a,lb as l,mb as C,nb as b,oa as u,ob as v,pa as h,q as at,qb as P,rc as V,sc as U,tb as f,vb as p,vc as ft,wc as Gt,yc as St,zc as Wt}from"./chunk-77JORVC2.js";import"./chunk-CRRJCY55.js";var ve=()=>["/menu/products/download/by-url"],ue=(()=>{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",et(2,ve)))},dependencies:[Xt,Kt,Pt]});let o=r;return o})();function Ie(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 we(o,r){if(o&1&&(b(0),S(1,Ie,3,0,"button",12),v()),o&2){let n=p();c(),s("ngIf",!n.productService.hasSelection(n.products))}}function ye(o,r){if(o&1){let n=P();b(0),a(1,"button",15),f("click",function(){u(n);let e=p();return h(e.onScanMultipleProduct())}),C(2,"i",14),m(3),l(),v()}if(o&2){let n,t=p();c(3),I(" Scan (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function Me(o,r){if(o&1){let n=P();b(0),a(1,"button",16),f("click",function(){u(n);let e=p();return h(e.onUploadMultipleProduct())}),C(2,"i",17),m(3),l(),v()}if(o&2){let n,t=p();c(3),I(" Upload (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function Ne(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 Fe(o,r){o&1&&(b(0),a(1,"div",20),C(2,"app-empty-state"),l(),v())}function Oe(o,r){if(o&1){let n=P();b(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()()(),v()}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 ge=(()=>{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(O,{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(It,{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(O,{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(O,{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(A),x(G),x(J),x(B),x(L))},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,we,2,1,"ng-container",2)(3,ye,4,1,"ng-container",2)(4,Me,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),T(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),T(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,Ne,2,10,"div",11)(20,Fe,3,0,"ng-container",2),l(),S(21,Oe,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(),D("ngModel",i.startDate),c(),D("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,R,Z,z,X,$,le,re,ae,ce],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 De(o,r){if(o&1){let n=P();b(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(),v()}}function Te(o,r){if(o&1){let n=P();b(0),a(1,"button",12),f("click",function(){u(n);let e=p();return h(e.onScanMultipleProduct())}),C(2,"i",11),m(3),l(),v()}if(o&2){let n=p();c(3),I(" Scan (",n.productService.selectedProduct(n.products).length,") ")}}function Ee(o,r){if(o&1){let n=P();b(0),a(1,"button",13),f("click",function(){u(n);let e=p();return h(e.onUploadMultipleProduct())}),C(2,"i",14),m(3),l(),v()}if(o&2){let n=p();c(3),I(" Upload (",n.productService.selectedProduct(n.products).length,") ")}}function ke(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,N)("alt",n.Name),c(),I(" ",n.Name," ")}}function Ve(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 T(i.searchFilter.Item_id,e)||(i.searchFilter.Item_id=e),h(e)}),l()()}if(o&2){let n=p();c(3),D("ngModel",n.searchFilter.Item_id)}}function Ue(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 Ae(o,r){o&1&&(b(0),a(1,"div",22),C(2,"app-empty-state"),l(),v())}function Le(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 _e=(()=>{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(It,{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(O,{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(O,{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(O,{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(A),x(J),x(G),x(B),x(xt),x(L))},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,De,4,0,"ng-container",1)(3,Te,4,1,"ng-container",1)(4,Ee,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,ke,3,3,"ng-template",4),l()(),S(11,Ve,4,1,"div",5),l(),a(12,"content")(13,"div",6)(14,"div",7),S(15,Ue,2,10,"div",8)(16,Ae,3,0,"ng-container",1),l(),S(17,Le,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,R,Z,rt,bt,z,X,$],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})();var Ce=(()=>{let r=class r{get footerPageNumber(){return this._footerPageNumber}set footerPageNumber(t){this._footerPageNumber=t}get hideCount(){return this._hideCount}set hideCount(t){this._hideCount=t}get disableNextButton(){return this._disableNextButton}set disableNextButton(t){this._disableNextButton=t}get goToLastPage(){return this._goToLastPage}set goToLastPage(t){this._goToLastPage=t}constructor(t){this.http=t,this.pagination$=new Ft(null),this.destroy$=new gt,this.data$=this.paginationFunction()}onNextPage(t){t.PageNumber+=1,this.pagination$.next(t)}setPageNumberFooter(t){this.footerPageNumber=t.PageNumber}setPaginationButtonState(t,e){e==0?this.disableNextButton=!0:this.disableNextButton=!(e<t.RowCount*t.PageNumber)}reloadPagination(t){_.IsEmpty(t.PageNumber)&&(t.PageNumber=1),this.pagination$.next(t),this.hideCount=!0,this.goToLastPage=!1}getAllData(t,e){t.RowCount=e,this.pagination$.next(t),this.goToLastPage=!0}destroy(){this.destroy$.next(!0),this.destroy$.complete(),this.pagination$=null,this.pagination$=new Ft(null),this.data$=this.paginationFunction()}paginationFunction(){return this.pagination$.pipe(lt(this.destroy$),y(t=>t!=null),kt(t=>this.http.post(`/API/${this.fetchDataEndpoint}`,JSON.stringify(t)).pipe(at(e=>e.Data))),At(this.pagination$),Vt((t,e)=>{let[i,d]=t,[g]=e;return d.PageNumber==1?[g,d]:[i.concat(g),d]}),_t(([t,e])=>{this.setPageNumberFooter(e),this.setPaginationButtonState(e,t.length)}),at(([t])=>t),Ut())}};r.\u0275fac=function(e){return new(e||r)(Bt(A))},r.\u0275prov=Lt({token:r,factory:r.\u0275fac,providedIn:"root"});let o=r;return o})();function $e(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 je(o,r){if(o&1){let n=P();b(0),a(1,"td",29)(2,"input",30),E("ngModelChange",function(e){u(n);let i=p(2).$implicit;return T(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()(),v()}if(o&2){let n=p(2).$implicit;c(),s("rowSpan",n==null?null:n.Variants.length),c(),D("ngModel",n.selected)}}function Ge(o,r){if(o&1){let n=P();b(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(),v()}if(o&2){let n=p(3).$implicit;c(),s("src",n==null?null:n.ImageUrl,N)}}function We(o,r){o&1&&C(0,"img",36)}function Ke(o,r){if(o&1&&(b(0),a(1,"td",29)(2,"div",31),S(3,Ge,2,1,"ng-container",11)(4,We,1,0,"ng-template",null,1,it),l()(),a(6,"td",32)(7,"h4",33)(8,"span",34),m(9),l()()(),v()),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 Je(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,N),c(),s("src",n.Img,N)("matTooltip",n.Name)}}function ze(o,r){if(o&1&&(a(0,"div"),C(1,"img",37),l()),o&2){let n=r.$implicit;c(),s("src",n.Img,N)("matTooltip",n.Name)}}function He(o,r){if(o&1&&(a(0,"tr"),S(1,je,3,2,"ng-container",12)(2,Ke,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,Je,3,3,"div",23),l()(),a(14,"td",27)(15,"div",28),S(16,ze,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),N),c(4),s("ngForOf",n==null?null:n.Available),c(3),s("ngForOf",n==null?null:n.NotAvailable)}}function Ye(o,r){if(o&1&&(b(0),S(1,He,17,7,"tr",23),v()),o&2){let n=r.$implicit;c(),s("ngForOf",n.Variants)}}function Ze(o,r){if(o&1&&(a(0,"tbody"),S(1,Ye,2,1,"ng-container",23),l()),o&2){let n=r.ngIf;c(),s("ngForOf",n)}}function qe(o,r){if(o&1&&(b(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,Ze,2,1,"tbody",12),F(17,"async"),l()(),v()),o&2){let n=p(2);c(16),s("ngIf",k(17,1,n.data$))}}function Qe(o,r){o&1&&(a(0,"div",38),C(1,"app-empty-state"),l())}function Xe(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 tn(o,r){if(o&1&&(a(0,"span"),m(1),F(2,"number"),l()),o&2){let n=r.ngIf;c(),Ct(k(2,1,n==null?null:n.Count))}}function en(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 nn(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 on(o,r){if(o&1&&(b(0),a(1,"div",39)(2,"div",40)(3,"div",41),m(4),F(5,"number"),S(6,Xe,3,0,"span",42)(7,tn,3,3,"span",12),F(8,"async"),m(9),l()(),a(10,"div",43),S(11,en,3,0,"a",44)(12,nn,3,0,"a",45),l()(),v()),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 rn(o,r){if(o&1&&(b(0),S(1,on,13,10,"ng-container",12),v()),o&2){let n=r.ngIf;c(),s("ngIf",(n==null?null:n.length)>0)}}function an(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,$e,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.openExportDialog())}),C(7,"i",8),a(8,"span"),m(9,"Export"),l()()(),a(10,"content")(11,"div",9)(12,"div",10),S(13,qe,18,3,"ng-container",11),F(14,"async"),S(15,Qe,2,0,"ng-template",null,0,it),l(),S(17,rn,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 fe=(()=>{let r=class r{constructor(t,e,i,d,g,w,Et){this.http=t,this.dialog=e,this.toastr=i,this.productService=d,this.paginationService=g,this.biggerPictureService=w,this.authService=Et,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannelV2",this.hasSelectionProduct=!1,this.selectedProducts=[],this.channelOptions=Et.getChannels(),this.hostName=this.authService.getDomain()}ngOnInit(){this.initPageLoader(),this.iniData()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.notChannelAPI,this.loader$=this.http.post(`api/${this.loaderAPI}`,{}).pipe(_t(t=>{this.filterSearch=t.Filter,this.paginationService.reloadPagination(t.Filter)}))}iniData(){this.data$=this.paginationService.data$.pipe(at(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(O,{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()}openExportDialog(){this.dialog.open(pe,{data:{title:"Export Not In Channel",pageNumber:this.filterSearch.PageNumber,rowCount:this.filterSearch.RowCount,filterExport:this.filterSearch,getRowCountApi:"product/GetNotInChannelRowCount",exportApi:"product/GetNotInChannelExport"}}).afterClosed().subscribe()}};r.\u0275fac=function(e){return new(e||r)(x(A),x(J),x(G),x(B),x(Ce),x(oe),x(L))},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,an,19,9,"mainpanel",2),F(1,"async")),e&2&&s("ngIf",k(1,1,i.loader$))},dependencies:[V,U,zt,W,K,R,vt,$,ft,St],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 ln=o=>[o],cn=()=>[];function sn(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 pn(o,r){if(o&1){let n=P();b(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(),v()}if(o&2){let n,t=p();c(3),I(" Download (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function dn(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,N)("alt",n.Name),c(),I(" ",n.Name," ")}}function mn(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?ct(10,ln,n==null?null:n.Channel):et(12,cn))("showCheckBox",!0)("scanButton",!0)}}function un(o,r){o&1&&(b(0),a(1,"div",23),C(2,"app-empty-state"),l(),v())}function hn(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 Se=(()=>{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(O,{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(de,{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(A),x(J),x(B),x(G),x(xt),x(L))},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,sn,3,0,"button",1)(3,pn,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 T(i.searchFilter.ChannelID,g)||(i.searchFilter.ChannelID=g),g}),S(9,dn,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 T(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 T(i.searchFilter.Item_id,g)||(i.searchFilter.Item_id=g),g}),l()()(),a(24,"content")(25,"div",11)(26,"div",12),S(27,mn,2,13,"div",13)(28,un,3,0,"ng-container",2),l(),S(29,hn,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),D("ngModel",i.searchFilter.ChannelID),c(5),D("ngModel",i.searchFilter.HaveSku),c(),s("value",0),c(2),s("value",1),c(2),s("value",2),c(5),D("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,R,Z,rt,ee,ne,z,X,$],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 gn(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),N),c(),I(" ",n.Name," ")}}function _n(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&&(b(0),a(1,"div",13),C(2,"app-empty-state"),l(),v())}function fn(o,r){if(o&1){let n=P();b(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()()(),v()}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 xe=(()=>{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(A),x(B),x(L))},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 T(i.searchFilter.ListChannelID,g)||(i.searchFilter.ListChannelID=g),g}),f("clear",function(){return i.onClearFilter()}),S(7,gn,3,2,"ng-template",4),l()()()(),a(8,"content")(9,"div",5)(10,"div",6),S(11,_n,2,6,"div",7)(12,Cn,3,0,"ng-container",8),l(),S(13,fn,4,4,"ng-container",8),l()()()),e&2&&(c(6),s("multiple",!0)("clearable",!0)("items",i.channelOptions),D("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,R,Z,rt,bt,wt,z,$]});let o=r;return o})();var Sn=()=>["/menu/products/status/sold-in-channel"],Pe=o=>({ID:o}),xn=()=>["/menu/products/status/not-in-pos"];function Pn(o,r){if(o&1&&(b(0),m(1),v()),o&2){let n=p().$implicit;c(),I(" ",n.Count," ")}}function bn(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 vn(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,Pn,2,1,"ng-container",6)(7,bn,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),N),c(2),Ct(n.Name),c(2),s("ngIf",n.Count!==void 0)("ngIfElse",t),c(4),s("routerLink",et(18,Sn))("queryParams",ct(19,Pe,n.ID)),c(),I(" ",k(12,11,n.SoldInChannel)," "),c(3),s("routerLink",et(21,xn))("queryParams",ct(22,Pe,n.ID)),c(),I(" ",k(16,13,n.NotInPOS)," "),c(3),I("",n.LastSync?jt(19,15,n.LastSync,"dd MMM yyyy HH:mm"):"Never"," ")}}function In(o,r){if(o&1&&(b(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,vn,28,24,"tr",16),F(18,"async"),l()()(),v()),o&2){let n,t=p();c(17),s("ngForOf",(n=k(18,1,t.channels$))==null?null:n.Data)}}function wn(o,r){o&1&&(a(0,"div",28),C(1,"app-empty-state"),l())}var be=(()=>{let r=class r{constructor(t,e,i,d){this.productService=t,this.toastr=e,this.dialog=i,this.authService=d,this.destroy$=new gt,this.channelOptions=d.getChannels()}ngOnInit(){this.setObsProductStatistic()}setObsProductStatistic(){this.channels$=this.productService.getProductStatistic()}getLiveProductCount(t,e){this.productService.getTotalProductLive(t).pipe(lt(this.destroy$)).subscribe(i=>{e.Count=i.Count})}onScanChannel(t){this.dialog.open(O,{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(lt(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(B),x(G),x(J),x(L))},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,In,19,3,"ng-container",6),F(6,"async"),S(7,wn,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,R,vt,Pt,$,ft,St,Gt]});let o=r;return o})();var yn=[{component:ue,path:"",children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:ge,canActivate:[nt],data:{title:"Products in POS"}},{path:"sold-in-channel",component:_e,canActivate:[nt],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:fe,canActivate:[nt],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:Se,canActivate:[nt],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:xe,canActivate:[nt],data:{title:"Duplicate Sku in Channel"}},{path:"channel-statistic",component:be,canActivate:[nt],data:{title:"Channel Statistic"}}]}],Bi=(()=>{let r=class r{};r.\u0275fac=function(e){return new(e||r)},r.\u0275mod=$t({type:r}),r.\u0275inj=Rt({imports:[Wt,Ht,Qt,qt,Yt,me,ie,te,wt,z,X,Jt.forChild(yn),se,Zt]});let o=r;return o})();export{Bi as StatusModule};
@@ -1,2 +1,2 @@
1
- import{a as R}from"./chunk-FX43R2N5.js";import{a as he,b as Ce,d as fe,e as xe}from"./chunk-2Y4N4NSS.js";import{a as $}from"./chunk-BSBYMQ7J.js";import{a as Ve,b as j,c as De}from"./chunk-BRTVFFDI.js";import"./chunk-662E5VTA.js";import{a as Te,c as Ee}from"./chunk-NNPT3RN6.js";import{a as Fe,b as Me}from"./chunk-G6CZHXQI.js";import"./chunk-M4VGME5L.js";import{a as Pe}from"./chunk-5WVUQE43.js";import"./chunk-AAIK6JQ3.js";import{g as ge}from"./chunk-PVQ2T5XH.js";import{b as le,e as re}from"./chunk-IPX66YIX.js";import"./chunk-HBHGO2RV.js";import{d as ye,k as Ie,l as we,m as be}from"./chunk-PIDUM6XT.js";import{t as Se,u as ve}from"./chunk-43TMSPFC.js";import"./chunk-4TYJR476.js";import{b as se,c as pe,h as ce,k as me,m as _e,u as de}from"./chunk-F5YRASNU.js";import{c as D,f as ue}from"./chunk-2UXFUEON.js";import{B as z,Eb as O,Fb as c,Gb as V,Ha as F,Hb as P,Ia as s,Ib as Z,Ja as T,Jb as I,Kb as w,Lb as b,Mb as X,Nb as q,Pb as k,Q as G,Wb as h,X as B,Xb as f,Ya as u,Yb as N,Zb as U,_a as m,da as H,fb as v,ga as Y,gb as L,ib as A,jb as W,kb as o,lb as l,mb as x,nb as M,oa as _,ob as E,pa as d,pc as J,qb as y,rc as ee,sc as te,tb as S,vb as r,vc as ne,wc as ie,yb as K,yc as ae,zc as oe}from"./chunk-77JORVC2.js";import"./chunk-CRRJCY55.js";var Re=n=>({"text-decoration-line-through":n}),Be=n=>({"ms-10":n}),Le=n=>({"bg-gradient-warning":n});function Ae(n,p){if(n&1){let e=y();o(0,"button",37),S("click",function(){_(e);let t=r().ngIf,a=r(2);return d(a.updateStock(t))}),x(1,"i",38),c(2," Update "),l()}}function We(n,p){if(n&1&&(o(0,"div"),u(1,Ae,3,0,"button",36),l()),n&2){let e=p.ngIf,i=r(2);s(),m("ngIf",i.productService.hasSelectionVariant(e))}}function Oe(n,p){if(n&1&&(o(0,"span",39),x(1,"img",40),l(),c(2)),n&2){let e=p.item;s(),m("src",e==null?null:e.Img,F),s(),P(" ",e.Name," ")}}function Ue(n,p){n&1&&(o(0,"div",41)(1,"span"),c(2," showing only different stock, please press next to populate more data "),l()())}function $e(n,p){if(n&1){let e=y();o(0,"th")(1,"input",42),b("ngModelChange",function(t){_(e);let a=r(2);return w(a.checkboxState,t)||(a.checkboxState=t),d(t)}),S("ngModelChange",function(){let t=_(e).ngIf,a=r(2);return d(a.onCheckboxStateChange(t))}),l()()}if(n&2){let e=r(2);s(),I("ngModel",e.checkboxState)}}function je(n,p){n&1&&(o(0,"th",33),c(1," Reserved "),l())}function Qe(n,p){}function ze(n,p){if(n&1){let e=y();o(0,"input",61),b("ngModelChange",function(t){_(e);let a=r(3).$implicit;return w(a.selected,t)||(a.selected=t),d(t)}),S("ngModelChange",function(){_(e);let t=r(3).$implicit,a=r(2);return d(a.onCheckboxStateProduct(t))}),l()}if(n&2){let e=r(3).$implicit;I("ngModel",e.selected)}}function Ge(n,p){if(n&1){let e=y();o(0,"img",62),S("click",function(t){_(e);let a=r(3).$implicit,C=r(2);return d(C.onZoomImage(t,a==null?null:a.ImageUrl))}),l()}if(n&2){let e=r(3).$implicit;K("src",e==null?null:e.ThumbnailUrl,F)}}function He(n,p){n&1&&x(0,"img",58)}function Ye(n,p){if(n&1&&(x(0,"br"),o(1,"div",63),x(2,"i",64),o(3,"small"),c(4),l()()),n&2){let e=r(3).$implicit;s(4),P("(",e==null?null:e.Category,")")}}function Ke(n,p){if(n&1&&(o(0,"td",54)(1,"div",15),u(2,ze,1,1,"input",55),o(3,"div",56),u(4,Ge,1,1,"img",57)(5,He,1,0,"img",58),l()()(),o(6,"td",59)(7,"span",60),c(8),l(),u(9,Ye,5,1),l()),n&2){let e=r(2).$implicit,i=r(2);m("rowSpan",e==null?null:e.Variants.length),s(2),v(e.Variants.length>1?2:-1),s(),m("ngClass",k(7,Be,e.Variants.length<=1)),s(),v(e!=null&&e.ThumbnailUrl?4:5),s(2),m("rowSpan",e==null?null:e.Variants.length),s(2),V(e==null?null:e.Name),s(),v(e.CategoryID!==null&&e.CategoryID!=i.guidEmpty?9:-1)}}function Ze(n,p){if(n&1){let e=y();o(0,"input",42),b("ngModelChange",function(t){_(e);let a=r(2).$implicit;return w(a.selected,t)||(a.selected=t),d(t)}),l()}if(n&2){let e=r(2).$implicit;I("ngModel",e.selected)}}function Xe(n,p){if(n&1&&u(0,Ze,1,1,"input",48),n&2){let e=r().$implicit;v((e==null?null:e.Inventory)<=1e5?0:-1)}}function qe(n,p){if(n&1){let e=y();o(0,"input",42),b("ngModelChange",function(t){_(e);let a=r().$implicit;return w(a.selected,t)||(a.selected=t),d(t)}),l()}if(n&2){let e=r().$implicit;I("ngModel",e.selected)}}function Je(n,p){n&1&&(o(0,"div",65),c(1," Not Found "),l())}function et(n,p){if(n&1&&(o(0,"div")(1,"span",66),c(2),h(3,"number"),l(),c(4," => "),o(5,"span",67),c(6),h(7,"number"),l()()),n&2){let e=r().$implicit;s(2),P(" ",f(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),V(f(7,4,e==null?null:e.Inventory))}}function tt(n,p){if(n&1&&(c(0),h(1,"number")),n&2){let e=r().$implicit;P(" ",f(1,1,e==null?null:e.Inventory)," ")}}function nt(n,p){if(n&1&&(M(0),o(1,"div",68)(2,"a",69),x(3,"i",70),l()(),E()),n&2){let e=r().$implicit,i=r(3);s(2),m("href",i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),F)}}function it(n,p){if(n&1){let e=y();o(0,"span",75),S("click",function(){let t=_(e).ngIf,a=r(2).$implicit,C=r().$implicit,g=r(2);return d(g.openTableDialog(C,a,t))}),c(1),h(2,"number"),l()}if(n&2){let e=r(2).$implicit;s(),P(" ",f(2,1,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function at(n,p){if(n&1){let e=y();o(0,"td",71)(1,"div",49)(2,"div"),u(3,it,3,3,"span",72),h(4,"async"),l(),o(5,"div",68)(6,"a",69),x(7,"i",70),l()(),o(8,"div",68)(9,"span",73),S("click",function(){_(e);let t=r().$implicit,a=r(3);return d(a.refreshInventory(t==null||t.Channel[0]==null?null:t.Channel[0].ChannelItemID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelVariationID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelID,t==null?null:t.ID))}),x(10,"i",74),l()()()()}if(n&2){let e=r().$implicit,i=r(3);m("ngClass",k(5,Le,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(3),m("ngIf",f(4,3,i.products$)),s(3),m("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,F)}}function ot(n,p){if(n&1&&(M(0),o(1,"span",76),c(2),h(3,"number"),l(),E()),n&2){let e=r(2).$implicit;s(2),P(" (",f(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function lt(n,p){n&1&&c(0," - ")}function rt(n,p){if(n&1&&(M(0),o(1,"td",45),u(2,ot,4,3,"ng-container",53)(3,lt,1,0,"ng-template",null,1,U),l(),E()),n&2){let e=O(4),i=r().$implicit;s(2),m("ngIf",i==null||i.Channel[0]==null?null:i.Channel[0].InventoryReserved)("ngIfElse",e)}}function st(n,p){n&1&&(M(0),c(1," - "),E())}function pt(n,p){if(n&1&&(o(0,"span",77),h(1,"date"),c(2),h(3,"date"),l()),n&2){let e=r().$implicit;m("matTooltip",N(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),P(" ",N(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function ct(n,p){if(n&1&&(o(0,"tr"),u(1,Ke,10,9),o(2,"td",44),c(3),l(),o(4,"td",45)(5,"span",46),c(6),l()(),o(7,"td",47),u(8,Xe,1,1)(9,qe,1,1,"input",48),l(),o(10,"td")(11,"div",49),u(12,Je,2,0,"div",50)(13,et,8,6,"div")(14,tt,2,3)(15,nt,4,1,"ng-container",5),l()(),u(16,at,11,7,"td",51)(17,rt,5,2,"ng-container",5),o(18,"td",52),u(19,st,2,0,"ng-container",53)(20,pt,4,8,"ng-template",null,0,U),l()()),n&2){let e=p.$implicit,i=p.index,t=O(21),a=r(3);s(),v(i==0?1:-1),s(2),V(e==null?null:e.Model),s(2),m("matTooltip",e.Discontinued?a.discontinuedVariantMsg:"")("ngClass",k(14,Re,e.Discontinued)),s(),V(e==null?null:e.Code),s(2),v((e==null?null:e.Channel[0].TypeID)==1?8:(e==null?null:e.Inventory)>=0?9:-1),s(4),m("ngIf",(e==null?null:e.I)==null),s(),v((e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)?13:-1),s(),v((e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)?14:-1),s(),m("ngIf",(e==null?null:e.I)!=null),s(),m("ngIf",e==null?null:e.Channel),s(),m("ngIf",a.isShowReservedColumn),s(2),m("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==a.minDate)("ngIfElse",t)}}function mt(n,p){if(n&1&&(o(0,"tbody"),A(1,Qe,0,0,null,null,L),u(3,ct,22,16,"tr",43),l()),n&2){let e=p.$implicit;s(),W(e.Variants),s(2),m("ngForOf",e.Variants)}}function _t(n,p){if(n&1){let e=y();o(0,"mainpanel",3),S("onSubmit",function(t){_(e);let a=r();return d(a.onSearch(t))}),o(1,"actions")(2,"div",4),u(3,We,2,1,"div",5),h(4,"async"),l()(),o(5,"filters")(6,"div")(7,"label",6),c(8,"Channel"),l(),o(9,"ng-select",7),b("ngModelChange",function(t){_(e);let a=r();return w(a.searchFilter.ChannelID,t)||(a.searchFilter.ChannelID=t),d(t)}),u(10,Oe,3,2,"ng-template",8),l()(),o(11,"div",9)(12,"label",10),c(13,"PageNumber"),l(),o(14,"input",11),b("ngModelChange",function(t){_(e);let a=r();return w(a.searchFilter.PageNumber,t)||(a.searchFilter.PageNumber=t),d(t)}),l()(),o(15,"div",9)(16,"label",12),c(17,"Page Size"),l(),o(18,"input",13),b("ngModelChange",function(t){_(e);let a=r();return w(a.searchFilter.RowCount,t)||(a.searchFilter.RowCount=t),d(t)}),l()(),o(19,"div",9)(20,"label",14),c(21,"Quantity From - To"),l(),o(22,"div",15)(23,"input",16),b("ngModelChange",function(t){_(e);let a=r();return w(a.searchFilter.QuantityFrom,t)||(a.searchFilter.QuantityFrom=t),d(t)}),l(),c(24," - "),o(25,"input",17),b("ngModelChange",function(t){_(e);let a=r();return w(a.searchFilter.QuantityTo,t)||(a.searchFilter.QuantityTo=t),d(t)}),l()()()(),o(26,"content")(27,"div",18)(28,"div",19)(29,"div",20),u(30,Ue,3,0,"div",21),o(31,"table",22)(32,"thead",23)(33,"tr")(34,"th",24),c(35," Product "),x(36,"br"),o(37,"mat-slide-toggle",25),S("toggleChange",function(){_(e);let t=r();return t.showDifferenceStock=!t.showDifferenceStock,d(t.onShowDifferenceStock())}),o(38,"small",14),c(39,"FILTER DIFFERENT INVENTORY"),l()()(),o(40,"th",26),c(41,"Variant"),l(),o(42,"th",27),c(43,"SKU"),l(),u(44,$e,2,1,"th",5),h(45,"async"),o(46,"th",28),c(47,"POS"),l(),o(48,"th",29)(49,"div",30),S("click",function(){_(e);let t=r();return d(t.openModalFilter())}),x(50,"img",31),o(51,"span",32),c(52),h(53,"stringLimit"),l()()(),u(54,je,2,0,"th",33),o(55,"th",34),c(56,"Last Sync"),l()()(),A(57,mt,4,1,"tbody",null,L),h(59,"async"),l(),o(60,"infinite-paginator",35),h(61,"async"),S("onNextPage",function(){_(e);let t=r();return d(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){_(e);let t=r();return d(t.onLastPage())})("onGetRowCount",function(){_(e);let t=r();return d(t.infinitePagination.getRowCount(t.searchFilter))}),l()()()()()()}if(n&2){let e=r();m("headerTitle","Inventory Comparison")("pageData",e.pageData)("hideSearchBox",!1),s(3),m("ngIf",f(4,24,e.products$)),s(6),m("clearable",!1)("items",e.channelOptions),I("ngModel",e.searchFilter.ChannelID),s(5),I("ngModel",e.searchFilter.PageNumber),s(4),I("ngModel",e.searchFilter.RowCount),s(5),I("ngModel",e.searchFilter.QuantityFrom),s(2),I("ngModel",e.searchFilter.QuantityTo),s(5),m("ngIf",(e.searchFilter==null?null:e.searchFilter.filterModel)==3),s(14),m("ngIf",f(45,26,e.products$)),s(5),m("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>13?e.selectedChannel==null?null:e.selectedChannel.Name:""),s(),m("src",e.selectedChannel==null?null:e.selectedChannel.Img,F),s(2),Z(" ",N(53,28,e.selectedChannel==null?null:e.selectedChannel.Name,13),"",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>13?"...":""," "),s(2),v(e.isShowReservedColumn?54:-1),s(3),W(f(59,31,e.products$)),s(3),m("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",f(61,33,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.goToLastPage())}}var Gt=(()=>{let p=class p{constructor(i,t,a,C,g,Q,ke,Ne){this.http=i,this.toastr=t,this.dialog=a,this.productService=C,this.authService=g,this.biggerPictureService=Q,this.inventoryService=ke,this.mainPanelService=Ne,this.infinitePagination=H(j),this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="InventoryLoader/Load",this.fetchApi="Inventory/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.minDate=D.MinDate,this.isShowReservedColumn=!0,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.guidEmpty=D.GuidEMpty,this.Options=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]}}ngOnInit(){this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPageLoader(),this.products$=this.infinitePagination.data$.pipe(B(i=>{this.checkShowReservedColumn(i)}),G())}checkShowReservedColumn(i){let t=0,a;i.forEach(C=>{a=C.Variants.find(g=>D.IsNotEmpty(g?.Channel[0]?.InventoryReserved)),a&&(t+=1)}),this.isShowReservedColumn=t>0}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.fetchApi,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/api/${this.loaderApi}`,{}).pipe(B(i=>{this.searchFilter={RowCount:i.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:i.Filter.ChannelID},this.initSelectedChannel(),this.infinitePagination.reloadPagination(this.searchFilter),this.showToastrMarketplaceInactive(!i.Filter.IsMarketplaceAppActive)}))}showToastrMarketplaceInactive(i){i&&this.toastr.warning(`Automatic inventory sync disabled.
1
+ import{a as R}from"./chunk-FX43R2N5.js";import{a as he,b as Ce,d as fe,e as xe}from"./chunk-2Y4N4NSS.js";import{a as $}from"./chunk-BSBYMQ7J.js";import{a as Ve,b as j,c as De}from"./chunk-BRTVFFDI.js";import"./chunk-662E5VTA.js";import{a as Te,c as Ee}from"./chunk-NNPT3RN6.js";import{a as Fe,b as Me}from"./chunk-G6CZHXQI.js";import"./chunk-M4VGME5L.js";import{a as Pe}from"./chunk-5WVUQE43.js";import"./chunk-AAIK6JQ3.js";import{g as ge}from"./chunk-FON6ZRGN.js";import{b as le,e as re}from"./chunk-IPX66YIX.js";import"./chunk-HBHGO2RV.js";import{d as ye,k as Ie,l as we,m as be}from"./chunk-PIDUM6XT.js";import{t as Se,u as ve}from"./chunk-43TMSPFC.js";import"./chunk-4TYJR476.js";import{b as se,c as pe,h as ce,k as me,m as _e,u as de}from"./chunk-F5YRASNU.js";import{c as D,f as ue}from"./chunk-2UXFUEON.js";import{B as z,Eb as O,Fb as c,Gb as V,Ha as F,Hb as P,Ia as s,Ib as Z,Ja as T,Jb as I,Kb as w,Lb as b,Mb as X,Nb as q,Pb as k,Q as G,Wb as h,X as B,Xb as f,Ya as u,Yb as N,Zb as U,_a as m,da as H,fb as v,ga as Y,gb as L,ib as A,jb as W,kb as o,lb as l,mb as x,nb as M,oa as _,ob as E,pa as d,pc as J,qb as y,rc as ee,sc as te,tb as S,vb as r,vc as ne,wc as ie,yb as K,yc as ae,zc as oe}from"./chunk-77JORVC2.js";import"./chunk-CRRJCY55.js";var Re=n=>({"text-decoration-line-through":n}),Be=n=>({"ms-10":n}),Le=n=>({"bg-gradient-warning":n});function Ae(n,p){if(n&1){let e=y();o(0,"button",37),S("click",function(){_(e);let t=r().ngIf,a=r(2);return d(a.updateStock(t))}),x(1,"i",38),c(2," Update "),l()}}function We(n,p){if(n&1&&(o(0,"div"),u(1,Ae,3,0,"button",36),l()),n&2){let e=p.ngIf,i=r(2);s(),m("ngIf",i.productService.hasSelectionVariant(e))}}function Oe(n,p){if(n&1&&(o(0,"span",39),x(1,"img",40),l(),c(2)),n&2){let e=p.item;s(),m("src",e==null?null:e.Img,F),s(),P(" ",e.Name," ")}}function Ue(n,p){n&1&&(o(0,"div",41)(1,"span"),c(2," showing only different stock, please press next to populate more data "),l()())}function $e(n,p){if(n&1){let e=y();o(0,"th")(1,"input",42),b("ngModelChange",function(t){_(e);let a=r(2);return w(a.checkboxState,t)||(a.checkboxState=t),d(t)}),S("ngModelChange",function(){let t=_(e).ngIf,a=r(2);return d(a.onCheckboxStateChange(t))}),l()()}if(n&2){let e=r(2);s(),I("ngModel",e.checkboxState)}}function je(n,p){n&1&&(o(0,"th",33),c(1," Reserved "),l())}function Qe(n,p){}function ze(n,p){if(n&1){let e=y();o(0,"input",61),b("ngModelChange",function(t){_(e);let a=r(3).$implicit;return w(a.selected,t)||(a.selected=t),d(t)}),S("ngModelChange",function(){_(e);let t=r(3).$implicit,a=r(2);return d(a.onCheckboxStateProduct(t))}),l()}if(n&2){let e=r(3).$implicit;I("ngModel",e.selected)}}function Ge(n,p){if(n&1){let e=y();o(0,"img",62),S("click",function(t){_(e);let a=r(3).$implicit,C=r(2);return d(C.onZoomImage(t,a==null?null:a.ImageUrl))}),l()}if(n&2){let e=r(3).$implicit;K("src",e==null?null:e.ThumbnailUrl,F)}}function He(n,p){n&1&&x(0,"img",58)}function Ye(n,p){if(n&1&&(x(0,"br"),o(1,"div",63),x(2,"i",64),o(3,"small"),c(4),l()()),n&2){let e=r(3).$implicit;s(4),P("(",e==null?null:e.Category,")")}}function Ke(n,p){if(n&1&&(o(0,"td",54)(1,"div",15),u(2,ze,1,1,"input",55),o(3,"div",56),u(4,Ge,1,1,"img",57)(5,He,1,0,"img",58),l()()(),o(6,"td",59)(7,"span",60),c(8),l(),u(9,Ye,5,1),l()),n&2){let e=r(2).$implicit,i=r(2);m("rowSpan",e==null?null:e.Variants.length),s(2),v(e.Variants.length>1?2:-1),s(),m("ngClass",k(7,Be,e.Variants.length<=1)),s(),v(e!=null&&e.ThumbnailUrl?4:5),s(2),m("rowSpan",e==null?null:e.Variants.length),s(2),V(e==null?null:e.Name),s(),v(e.CategoryID!==null&&e.CategoryID!=i.guidEmpty?9:-1)}}function Ze(n,p){if(n&1){let e=y();o(0,"input",42),b("ngModelChange",function(t){_(e);let a=r(2).$implicit;return w(a.selected,t)||(a.selected=t),d(t)}),l()}if(n&2){let e=r(2).$implicit;I("ngModel",e.selected)}}function Xe(n,p){if(n&1&&u(0,Ze,1,1,"input",48),n&2){let e=r().$implicit;v((e==null?null:e.Inventory)<=1e5?0:-1)}}function qe(n,p){if(n&1){let e=y();o(0,"input",42),b("ngModelChange",function(t){_(e);let a=r().$implicit;return w(a.selected,t)||(a.selected=t),d(t)}),l()}if(n&2){let e=r().$implicit;I("ngModel",e.selected)}}function Je(n,p){n&1&&(o(0,"div",65),c(1," Not Found "),l())}function et(n,p){if(n&1&&(o(0,"div")(1,"span",66),c(2),h(3,"number"),l(),c(4," => "),o(5,"span",67),c(6),h(7,"number"),l()()),n&2){let e=r().$implicit;s(2),P(" ",f(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),V(f(7,4,e==null?null:e.Inventory))}}function tt(n,p){if(n&1&&(c(0),h(1,"number")),n&2){let e=r().$implicit;P(" ",f(1,1,e==null?null:e.Inventory)," ")}}function nt(n,p){if(n&1&&(M(0),o(1,"div",68)(2,"a",69),x(3,"i",70),l()(),E()),n&2){let e=r().$implicit,i=r(3);s(2),m("href",i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),F)}}function it(n,p){if(n&1){let e=y();o(0,"span",75),S("click",function(){let t=_(e).ngIf,a=r(2).$implicit,C=r().$implicit,g=r(2);return d(g.openTableDialog(C,a,t))}),c(1),h(2,"number"),l()}if(n&2){let e=r(2).$implicit;s(),P(" ",f(2,1,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function at(n,p){if(n&1){let e=y();o(0,"td",71)(1,"div",49)(2,"div"),u(3,it,3,3,"span",72),h(4,"async"),l(),o(5,"div",68)(6,"a",69),x(7,"i",70),l()(),o(8,"div",68)(9,"span",73),S("click",function(){_(e);let t=r().$implicit,a=r(3);return d(a.refreshInventory(t==null||t.Channel[0]==null?null:t.Channel[0].ChannelItemID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelVariationID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelID,t==null?null:t.ID))}),x(10,"i",74),l()()()()}if(n&2){let e=r().$implicit,i=r(3);m("ngClass",k(5,Le,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(3),m("ngIf",f(4,3,i.products$)),s(3),m("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,F)}}function ot(n,p){if(n&1&&(M(0),o(1,"span",76),c(2),h(3,"number"),l(),E()),n&2){let e=r(2).$implicit;s(2),P(" (",f(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function lt(n,p){n&1&&c(0," - ")}function rt(n,p){if(n&1&&(M(0),o(1,"td",45),u(2,ot,4,3,"ng-container",53)(3,lt,1,0,"ng-template",null,1,U),l(),E()),n&2){let e=O(4),i=r().$implicit;s(2),m("ngIf",i==null||i.Channel[0]==null?null:i.Channel[0].InventoryReserved)("ngIfElse",e)}}function st(n,p){n&1&&(M(0),c(1," - "),E())}function pt(n,p){if(n&1&&(o(0,"span",77),h(1,"date"),c(2),h(3,"date"),l()),n&2){let e=r().$implicit;m("matTooltip",N(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),P(" ",N(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function ct(n,p){if(n&1&&(o(0,"tr"),u(1,Ke,10,9),o(2,"td",44),c(3),l(),o(4,"td",45)(5,"span",46),c(6),l()(),o(7,"td",47),u(8,Xe,1,1)(9,qe,1,1,"input",48),l(),o(10,"td")(11,"div",49),u(12,Je,2,0,"div",50)(13,et,8,6,"div")(14,tt,2,3)(15,nt,4,1,"ng-container",5),l()(),u(16,at,11,7,"td",51)(17,rt,5,2,"ng-container",5),o(18,"td",52),u(19,st,2,0,"ng-container",53)(20,pt,4,8,"ng-template",null,0,U),l()()),n&2){let e=p.$implicit,i=p.index,t=O(21),a=r(3);s(),v(i==0?1:-1),s(2),V(e==null?null:e.Model),s(2),m("matTooltip",e.Discontinued?a.discontinuedVariantMsg:"")("ngClass",k(14,Re,e.Discontinued)),s(),V(e==null?null:e.Code),s(2),v((e==null?null:e.Channel[0].TypeID)==1?8:(e==null?null:e.Inventory)>=0?9:-1),s(4),m("ngIf",(e==null?null:e.I)==null),s(),v((e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)?13:-1),s(),v((e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)?14:-1),s(),m("ngIf",(e==null?null:e.I)!=null),s(),m("ngIf",e==null?null:e.Channel),s(),m("ngIf",a.isShowReservedColumn),s(2),m("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==a.minDate)("ngIfElse",t)}}function mt(n,p){if(n&1&&(o(0,"tbody"),A(1,Qe,0,0,null,null,L),u(3,ct,22,16,"tr",43),l()),n&2){let e=p.$implicit;s(),W(e.Variants),s(2),m("ngForOf",e.Variants)}}function _t(n,p){if(n&1){let e=y();o(0,"mainpanel",3),S("onSubmit",function(t){_(e);let a=r();return d(a.onSearch(t))}),o(1,"actions")(2,"div",4),u(3,We,2,1,"div",5),h(4,"async"),l()(),o(5,"filters")(6,"div")(7,"label",6),c(8,"Channel"),l(),o(9,"ng-select",7),b("ngModelChange",function(t){_(e);let a=r();return w(a.searchFilter.ChannelID,t)||(a.searchFilter.ChannelID=t),d(t)}),u(10,Oe,3,2,"ng-template",8),l()(),o(11,"div",9)(12,"label",10),c(13,"PageNumber"),l(),o(14,"input",11),b("ngModelChange",function(t){_(e);let a=r();return w(a.searchFilter.PageNumber,t)||(a.searchFilter.PageNumber=t),d(t)}),l()(),o(15,"div",9)(16,"label",12),c(17,"Page Size"),l(),o(18,"input",13),b("ngModelChange",function(t){_(e);let a=r();return w(a.searchFilter.RowCount,t)||(a.searchFilter.RowCount=t),d(t)}),l()(),o(19,"div",9)(20,"label",14),c(21,"Quantity From - To"),l(),o(22,"div",15)(23,"input",16),b("ngModelChange",function(t){_(e);let a=r();return w(a.searchFilter.QuantityFrom,t)||(a.searchFilter.QuantityFrom=t),d(t)}),l(),c(24," - "),o(25,"input",17),b("ngModelChange",function(t){_(e);let a=r();return w(a.searchFilter.QuantityTo,t)||(a.searchFilter.QuantityTo=t),d(t)}),l()()()(),o(26,"content")(27,"div",18)(28,"div",19)(29,"div",20),u(30,Ue,3,0,"div",21),o(31,"table",22)(32,"thead",23)(33,"tr")(34,"th",24),c(35," Product "),x(36,"br"),o(37,"mat-slide-toggle",25),S("toggleChange",function(){_(e);let t=r();return t.showDifferenceStock=!t.showDifferenceStock,d(t.onShowDifferenceStock())}),o(38,"small",14),c(39,"FILTER DIFFERENT INVENTORY"),l()()(),o(40,"th",26),c(41,"Variant"),l(),o(42,"th",27),c(43,"SKU"),l(),u(44,$e,2,1,"th",5),h(45,"async"),o(46,"th",28),c(47,"POS"),l(),o(48,"th",29)(49,"div",30),S("click",function(){_(e);let t=r();return d(t.openModalFilter())}),x(50,"img",31),o(51,"span",32),c(52),h(53,"stringLimit"),l()()(),u(54,je,2,0,"th",33),o(55,"th",34),c(56,"Last Sync"),l()()(),A(57,mt,4,1,"tbody",null,L),h(59,"async"),l(),o(60,"infinite-paginator",35),h(61,"async"),S("onNextPage",function(){_(e);let t=r();return d(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){_(e);let t=r();return d(t.onLastPage())})("onGetRowCount",function(){_(e);let t=r();return d(t.infinitePagination.getRowCount(t.searchFilter))}),l()()()()()()}if(n&2){let e=r();m("headerTitle","Inventory Comparison")("pageData",e.pageData)("hideSearchBox",!1),s(3),m("ngIf",f(4,24,e.products$)),s(6),m("clearable",!1)("items",e.channelOptions),I("ngModel",e.searchFilter.ChannelID),s(5),I("ngModel",e.searchFilter.PageNumber),s(4),I("ngModel",e.searchFilter.RowCount),s(5),I("ngModel",e.searchFilter.QuantityFrom),s(2),I("ngModel",e.searchFilter.QuantityTo),s(5),m("ngIf",(e.searchFilter==null?null:e.searchFilter.filterModel)==3),s(14),m("ngIf",f(45,26,e.products$)),s(5),m("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>13?e.selectedChannel==null?null:e.selectedChannel.Name:""),s(),m("src",e.selectedChannel==null?null:e.selectedChannel.Img,F),s(2),Z(" ",N(53,28,e.selectedChannel==null?null:e.selectedChannel.Name,13),"",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>13?"...":""," "),s(2),v(e.isShowReservedColumn?54:-1),s(3),W(f(59,31,e.products$)),s(3),m("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",f(61,33,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.goToLastPage())}}var Gt=(()=>{let p=class p{constructor(i,t,a,C,g,Q,ke,Ne){this.http=i,this.toastr=t,this.dialog=a,this.productService=C,this.authService=g,this.biggerPictureService=Q,this.inventoryService=ke,this.mainPanelService=Ne,this.infinitePagination=H(j),this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="InventoryLoader/Load",this.fetchApi="Inventory/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.minDate=D.MinDate,this.isShowReservedColumn=!0,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.guidEmpty=D.GuidEMpty,this.Options=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]}}ngOnInit(){this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPageLoader(),this.products$=this.infinitePagination.data$.pipe(B(i=>{this.checkShowReservedColumn(i)}),G())}checkShowReservedColumn(i){let t=0,a;i.forEach(C=>{a=C.Variants.find(g=>D.IsNotEmpty(g?.Channel[0]?.InventoryReserved)),a&&(t+=1)}),this.isShowReservedColumn=t>0}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.fetchApi,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/api/${this.loaderApi}`,{}).pipe(B(i=>{this.searchFilter={RowCount:i.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:i.Filter.ChannelID},this.initSelectedChannel(),this.infinitePagination.reloadPagination(this.searchFilter),this.showToastrMarketplaceInactive(!i.Filter.IsMarketplaceAppActive)}))}showToastrMarketplaceInactive(i){i&&this.toastr.warning(`Automatic inventory sync disabled.
2
2
  Please enable Dealpos X Marketplace Apps integration in POS Configuration`,"Warning")}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(i=>i.ID==this.searchFilter.ChannelID)}onSearch(i){this.searchFilter.text=i,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(i){let t=this.productService.selectedVariantProduct(i);if(t.length>0){let a=t.map(g=>({ID:g.ID,Code:g.Code,Inventory:g.Inventory})),C={ListChannelID:[this.searchFilter.ChannelID],List:a};this.http.post("/api/Inventory/UpdateChannel",C).subscribe(g=>{this.searchFilter.PageNumber=1,this.infinitePagination.reloadPagination(this.searchFilter),this.checkboxState=!1,this.handlingUpdateStock(g)})}}handlingUpdateStock(i){if(i[0]?.StatusProduct){let t=i[0].StatusProduct.Fail_list,a=i[0].StatusProduct.Success_list;this.inventoryService.showToastrUpdateInventory("Stock",a,t)}else this.toastr.error(i[0]?.Exception,"Error")}refreshInventory(i,t,a,C){let g={ChannelItemID:i,ChannelVariationID:t,ChannelID:a,VariantID:C};this.http.post("/api/Inventory/RefreshInventoryChannel",g).subscribe(Q=>{this.toastr.success("Successfully updated","Success"),this.infinitePagination.reloadPagination(this.searchFilter)})}onCheckboxStateProduct(i){i.Variants=i.Variants.map(t=>(t.Inventory>=0&&(t.selected=i.selected),t))}onCheckboxStateChange(i){i=i.map(t=>(t.Variants=t.Variants.map(a=>(a.selected=this.checkboxState,a)),t))}openTableDialog(i,t,a){this.dialog.open(Ve,{data:{Name:i.Name,Variant:t,ChannelID:t?.Channel[0].ChannelID,Table:"inventory",ChannelItemID:i.ChannelItemID}}).afterClosed().pipe(z(g=>D.IsNotEmpty(g))).subscribe(g=>{this.updateItemAfterDialog(g,a)})}updateItemAfterDialog(i,t){let a={ID:i.ChannelID,ChannelItemID:i.ChannelItemID,ChannelVariantID:i.ChannelVariationID,NewQuantity:parseFloat(i.Inventory),VariantID:i.ID,SKU:i.Sku};this.http.post("/api/Inventory/UpdateQuantityByItem",a).subscribe(C=>{this.searchFilter.PageNumber=1,this.infinitePagination.reloadPagination(this.searchFilter),this.handlingUpdateStock([C])})}onShowDifferenceStock(){this.showDifferenceStock?this.searchFilter.filterModel=$.DIFFERENCE:this.searchFilter.filterModel=$.ALL,this.infinitePagination.reloadPagination(this.searchFilter)}onLastPage(){let i={ChannelID:this.searchFilter.ChannelID,PageNumber:1};this.http.post(`${this.rowCountApi}`,i).subscribe({next:t=>{this.searchFilter.PageNumber=1,this.infinitePagination.onLastPage(this.searchFilter,t.Total)}})}onZoomImage(i,t){this.biggerPictureService.openBiggerPicture(i,t)}};p.\u0275fac=function(t){return new(t||p)(T(re),T(le),T(ye),T(Te),T(ge),T(Pe),T(R),T(Ie))},p.\u0275cmp=Y({type:p,selectors:[["app-single-channel-comparison"]],standalone:!0,features:[X([j,R]),q],decls:2,vars:3,consts:[["SYNCDATE",""],["EMPTY_RESERVED",""],["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit",4,"ngIf"],["textButton","Search",3,"onSubmit","headerTitle","pageData","hideSearchBox"],[1,"d-flex"],[4,"ngIf"],["for","ng-select",1,"fw-bold"],["id","ng-select","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text","mt-3",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"mat-mdc-tooltip-trigger","form-control","ng-pristine","ng-valid","ng-touched","mt-3",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"mat-mdc-tooltip-trigger","form-control","ng-pristine","ng-valid","ng-touched","mt-3",3,"ngModelChange","ngModel"],[1,"fw-bold"],[1,"d-flex","align-items-center","justify-content-start"],["type","number","name","QuantityFrom",1,"w-25","me-2","mt-3","form-control",3,"ngModelChange","ngModel"],["type","number","name","QuantityTo",1,"w-25","ms-2","form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["class","alert alert-warning d-flex justify-content-between text-dark","role","alert",4,"ngIf"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","ps-12",2,"width","25%"],[3,"toggleChange"],["scope","col",1,"text-start"],["scope","col",1,"text-end",2,"width","10%"],["scope","col",1,"text-end","w-10",2,"width","8%"],[1,"text-end",2,"width","150px"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],["matTooltip","Reserved Stock","matTooltipPosition","above",1,"text-end",2,"width","80px"],[1,"text-center",2,"width","145px"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"me-2"],[2,"width","18px",3,"src"],["role","alert",1,"alert","alert-warning","d-flex","justify-content-between","text-dark"],["type","checkbox",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"align-middle"],["type","checkbox",3,"ngModel"],[1,"d-flex","align-items-center","justify-content-end"],["class","text-danger","matTooltip","This product is no longer available in POS","matTooltipPosition","above",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],[1,"text-center"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"width","0%",3,"rowSpan"],["type","checkbox",1,"me-3",3,"ngModel"],[3,"ngClass"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],[1,"d-flex","align-items-center"],["title","Category",1,"fa-solid","fa-tags","me-2",2,"opacity","60%"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],["title","Stock Available"],["title","Inventory below minimum inventory"],[1,"ms-3"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"text-end",3,"ngClass"],["class","cursor",3,"click",4,"ngIf"],["matTooltip","Refresh stock according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","fa-sync","fa-lg","external-link-custom"],[1,"cursor",3,"click"],[1,"text-danger"],["matTooltipShowDelay","500",3,"matTooltip"]],template:function(t,a){t&1&&(u(0,_t,62,35,"mainpanel",2),h(1,"async")),t&2&&m("ngIf",f(1,1,a.loader$))},dependencies:[oe,J,ee,te,ne,ae,ie,be,we,xe,fe,he,Ce,de,pe,_e,se,ce,me,Ee,De,ue,Me,Fe,ve,Se],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}"]});let n=p;return n})();export{Gt as SingleChannelComparisonComponent};
@@ -1 +1 @@
1
- import{g as c}from"./chunk-PVQ2T5XH.js";import{b as a}from"./chunk-IPX66YIX.js";import{$ as s,ca as o}from"./chunk-77JORVC2.js";var d=(()=>{let e=class e{constructor(i,t){this.toastr=i,this.authService=t}canActivate(i,t){let n=JSON.parse(window.localStorage.getItem("user")),l=new Date;if(n!=null){let p=new Date(n.Token.expiredAt);return l<p?!0:(this.onTokenExpired(),!1)}else return this.onTokenExpired(),!1}onTokenExpired(){this.toastr.error("Your session has expired. Please login again.","Session Expired").onShown.subscribe(()=>this.authService.logout())}};e.\u0275fac=function(t){return new(t||e)(o(a),o(c))},e.\u0275prov=s({token:e,factory:e.\u0275fac,providedIn:"root"});let r=e;return r})();export{d as a};
1
+ import{g as c}from"./chunk-FON6ZRGN.js";import{b as a}from"./chunk-IPX66YIX.js";import{$ as s,ca as o}from"./chunk-77JORVC2.js";var d=(()=>{let e=class e{constructor(i,t){this.toastr=i,this.authService=t}canActivate(i,t){let n=JSON.parse(window.localStorage.getItem("user")),l=new Date;if(n!=null){let p=new Date(n.Token.expiredAt);return l<p?!0:(this.onTokenExpired(),!1)}else return this.onTokenExpired(),!1}onTokenExpired(){this.toastr.error("Your session has expired. Please login again.","Session Expired").onShown.subscribe(()=>this.authService.logout())}};e.\u0275fac=function(t){return new(t||e)(o(a),o(c))},e.\u0275prov=s({token:e,factory:e.\u0275fac,providedIn:"root"});let r=e;return r})();export{d as a};
@@ -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-DZHNXVSW.js";import{b as ie}from"./chunk-3LRKHZJF.js";import{a as ee,b as te}from"./chunk-7CEWM7GE.js";import{a as X}from"./chunk-M3P5OJ7T.js";import{g as Q}from"./chunk-PVQ2T5XH.js";import{e as W}from"./chunk-IPX66YIX.js";import"./chunk-HBHGO2RV.js";import{l as Y,m as Z}from"./chunk-PIDUM6XT.js";import"./chunk-43TMSPFC.js";import"./chunk-4TYJR476.js";import{c as z,h as K,k as q,u as J}from"./chunk-F5YRASNU.js";import"./chunk-2UXFUEON.js";import{$ as D,Eb as v,Fb as m,Ga as M,Gb as O,Hb as B,Ia as p,Ja as I,Jb as L,Kb as F,Lb as R,Mb as P,Pb as x,Ya as c,_a as s,aa as T,ca as U,cd as j,ed as $,ga as C,gd as G,ha as N,kb as o,lb as r,mb as d,nb as f,oa as g,ob as _,pa as h,qb as S,rc as w,sc as V,tb as y,tc as A,vb as u,za as k,zc as H}from"./chunk-77JORVC2.js";import"./chunk-CRRJCY55.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-DZHNXVSW.js";import{b as ie}from"./chunk-3LRKHZJF.js";import{a as ee,b as te}from"./chunk-7CEWM7GE.js";import{a as X}from"./chunk-LCOFOENF.js";import{g as Q}from"./chunk-FON6ZRGN.js";import{e as W}from"./chunk-IPX66YIX.js";import"./chunk-HBHGO2RV.js";import{l as Y,m as Z}from"./chunk-PIDUM6XT.js";import"./chunk-43TMSPFC.js";import"./chunk-4TYJR476.js";import{c as z,h as K,k as q,u as J}from"./chunk-F5YRASNU.js";import"./chunk-2UXFUEON.js";import{$ as D,Eb as v,Fb as m,Ga as M,Gb as O,Hb as B,Ia as p,Ja as I,Jb as L,Kb as F,Lb as R,Mb as P,Pb as x,Ya as c,_a as s,aa as T,ca as U,cd as j,ed as $,ga as C,gd as G,ha as N,kb as o,lb as r,mb as d,nb as f,oa as g,ob as _,pa as h,qb as S,rc as w,sc as V,tb as y,tc as A,vb as u,za as k,zc as H}from"./chunk-77JORVC2.js";import"./chunk-CRRJCY55.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%}