marketplacepos 3.7.2 → 3.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Marketplace/{chunk-QOBUHJEC.js → chunk-2SA7SVYH.js} +1 -1
- package/Marketplace/{chunk-H65R6LYY.js → chunk-2UI4YTN6.js} +1 -1
- package/Marketplace/chunk-2V7GCWY7.js +1 -0
- package/Marketplace/{chunk-EJ4H3OFV.js → chunk-2YI2WW5U.js} +1 -1
- package/Marketplace/{chunk-ULZ3J3BD.js → chunk-4AQ3EZML.js} +1 -1
- package/Marketplace/{chunk-GSZSRSYG.js → chunk-5XRAHMC6.js} +1 -1
- package/Marketplace/{chunk-MQUFUG4I.js → chunk-644NU43G.js} +1 -1
- package/Marketplace/{chunk-4SAZAICQ.js → chunk-7I7KV673.js} +1 -1
- package/Marketplace/{chunk-IANWTXDM.js → chunk-7QIOC7BK.js} +1 -1
- package/Marketplace/{chunk-MG7FPXZX.js → chunk-7XITKPS5.js} +1 -1
- package/Marketplace/{chunk-H65V337R.js → chunk-BGCBCSHC.js} +1 -1
- package/Marketplace/{chunk-AE6IHJSI.js → chunk-BTKXSJ5K.js} +1 -1
- package/Marketplace/{chunk-LQUPRVED.js → chunk-CHDEJCV7.js} +1 -1
- package/Marketplace/{chunk-KOEWWMXB.js → chunk-COKR3NPC.js} +1 -1
- package/Marketplace/{chunk-6GVQC3OR.js → chunk-COLVGV5B.js} +1 -1
- package/Marketplace/{chunk-NY3NDLUY.js → chunk-CS62TIAP.js} +1 -1
- package/Marketplace/{chunk-QWKP6LGP.js → chunk-CSUJ7V36.js} +1 -1
- package/Marketplace/{chunk-3KV2JLZD.js → chunk-CUYZKVZ3.js} +1 -1
- package/Marketplace/{chunk-CQJJCQOZ.js → chunk-DJCANNYC.js} +1 -1
- package/Marketplace/{chunk-JHT6TPR2.js → chunk-ELFNCSQS.js} +1 -1
- package/Marketplace/{chunk-ZA6GABVQ.js → chunk-ENOOLWKX.js} +1 -1
- package/Marketplace/{chunk-LU4CQUNV.js → chunk-FGEVVKEH.js} +1 -1
- package/Marketplace/{chunk-T4IQWUBV.js → chunk-FZ3LLUFV.js} +1 -1
- package/Marketplace/{chunk-VM5LF2AQ.js → chunk-GQU66EJO.js} +1 -1
- package/Marketplace/{chunk-7QK5UPRO.js → chunk-H4UMXVLS.js} +1 -1
- package/Marketplace/{chunk-2SYJDDTX.js → chunk-HAU6K6GW.js} +1 -1
- package/Marketplace/{chunk-ONRH4TTU.js → chunk-HX36ACUF.js} +1 -1
- package/Marketplace/{chunk-4Z75AP5X.js → chunk-IL2DK2XK.js} +1 -1
- package/Marketplace/{chunk-WIPT5BVZ.js → chunk-IMUZFXPJ.js} +2 -2
- package/Marketplace/{chunk-NE4U3Z2F.js → chunk-IPVDR333.js} +1 -1
- package/Marketplace/{chunk-LV7NKX2V.js → chunk-IZ3HV6DV.js} +1 -1
- package/Marketplace/{chunk-GSZGHECR.js → chunk-JB6W2UTC.js} +1 -1
- package/Marketplace/{chunk-F2WJC5YO.js → chunk-K5HNYUX4.js} +2 -2
- package/Marketplace/{chunk-HD4CTBL2.js → chunk-KQRK4CTQ.js} +1 -1
- package/Marketplace/{chunk-RNMZG2RU.js → chunk-KSDM566S.js} +1 -1
- package/Marketplace/{chunk-QHJPUEQJ.js → chunk-LSBFWGC6.js} +1 -1
- package/Marketplace/{chunk-MCTEEYBG.js → chunk-MPHWSDOT.js} +1 -1
- package/Marketplace/{chunk-PSAPUCAJ.js → chunk-N5YIZS6Z.js} +1 -1
- package/Marketplace/{chunk-JOI2R7DA.js → chunk-O7MAOFLA.js} +1 -1
- package/Marketplace/chunk-OGL675J6.js +1 -0
- package/Marketplace/{chunk-37MHCWTD.js → chunk-OKATPNAY.js} +1 -1
- package/Marketplace/{chunk-B2H2LMDP.js → chunk-Q4LQRXK4.js} +1 -1
- package/Marketplace/{chunk-W5LP6HWA.js → chunk-R4XC3TIR.js} +1 -1
- package/Marketplace/{chunk-JEIL7GTU.js → chunk-S5TAVCV2.js} +1 -1
- package/Marketplace/{chunk-P7MI7GDE.js → chunk-SCSHD4KU.js} +1 -1
- package/Marketplace/{chunk-JGSLR6Q7.js → chunk-SKMUHTVE.js} +1 -1
- package/Marketplace/{chunk-LPD77TVJ.js → chunk-SMV45LT2.js} +1 -1
- package/Marketplace/{chunk-UUY6BTJU.js → chunk-TNBAGDLT.js} +1 -1
- package/Marketplace/{chunk-VZO27DX6.js → chunk-TO2VHTUR.js} +3 -3
- package/Marketplace/{chunk-HIX2BUDB.js → chunk-U7MYN4C4.js} +1 -1
- package/Marketplace/{chunk-CBW7JGFJ.js → chunk-UGTOBS2B.js} +1 -1
- package/Marketplace/{chunk-RQWHADXY.js → chunk-VAE6Y2B3.js} +1 -1
- package/Marketplace/{chunk-T5BNV4KL.js → chunk-WGXKB6XB.js} +1 -1
- package/Marketplace/{chunk-N6VKSGEM.js → chunk-WOOLZ22H.js} +1 -1
- package/Marketplace/{chunk-ZSK75YJW.js → chunk-WP6G47JB.js} +1 -1
- package/Marketplace/{chunk-F7PVCSNW.js → chunk-X5NF5S2H.js} +1 -1
- package/Marketplace/{chunk-27IVVEQ5.js → chunk-X6UUIC3F.js} +1 -1
- package/Marketplace/{chunk-ZMMTX4YX.js → chunk-Y3GV3L67.js} +1 -1
- package/Marketplace/{chunk-I66FBNYV.js → chunk-YBPTSF4K.js} +1 -1
- package/Marketplace/{chunk-PL4TRYLK.js → chunk-ZAKCXPP7.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-AUAZAZGD.js → main-FSM7S3E4.js} +1 -1
- package/Marketplace/{styles-DC4DACOA.css → styles-VY4XPEM3.css} +1 -1
- package/package.json +1 -1
- package/Marketplace/chunk-5CBOZ77Z.js +0 -1
- package/Marketplace/chunk-FX4KZMXX.js +0 -1
- /package/Marketplace/{chunk-5DL35YCG.js → chunk-322JBPYB.js} +0 -0
- /package/Marketplace/{chunk-VS4FYYKI.js → chunk-EF3W3UUA.js} +0 -0
- /package/Marketplace/{chunk-QYP6WXYL.js → chunk-MKDJJ5L7.js} +0 -0
- /package/Marketplace/{chunk-FG5W5K4B.js → chunk-R7J6AS67.js} +0 -0
- /package/Marketplace/{polyfills-FXABYPWM.js → polyfills-5ZPLRT7K.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as _t,c as q,d as te}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.2/Marketplace/chunk-H65R6LYY.js";import{a as Z}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.2/Marketplace/chunk-VS4FYYKI.js";import{a as A}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.2/Marketplace/chunk-37MHCWTD.js";import{d as Zt,e as qt,f as Yt,g as Qt,k as Wt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.2/Marketplace/chunk-JHT6TPR2.js";import{a as Y,b as gt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.2/Marketplace/chunk-B2H2LMDP.js";import{a as K}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.2/Marketplace/chunk-4SAZAICQ.js";import{b as ee}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.2/Marketplace/chunk-MCTEEYBG.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.2/Marketplace/chunk-HIX2BUDB.js";import{a as Xt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.2/Marketplace/chunk-HD4CTBL2.js";import{a as D}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.2/Marketplace/chunk-3KV2JLZD.js";import{a as U}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.2/Marketplace/chunk-QOBUHJEC.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.2/Marketplace/chunk-QHJPUEQJ.js";import{a as jt,b as Gt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.2/Marketplace/chunk-MQUFUG4I.js";import{e as k}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.2/Marketplace/chunk-WIPT5BVZ.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.2/Marketplace/chunk-JGSLR6Q7.js";import{b as R,e as B}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.2/Marketplace/chunk-MG7FPXZX.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.2/Marketplace/chunk-VM5LF2AQ.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.2/Marketplace/chunk-ZSK75YJW.js";import{a as Ht}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.2/Marketplace/chunk-ONRH4TTU.js";import{a as Kt,b as Jt,c as zt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.2/Marketplace/chunk-27IVVEQ5.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.2/Marketplace/chunk-JEIL7GTU.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.2/Marketplace/chunk-T4IQWUBV.js";import{a as nt,c as H,d as Lt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.2/Marketplace/chunk-NE4U3Z2F.js";import{a as W}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.2/Marketplace/chunk-PL4TRYLK.js";import{B as V,C as $t,q as ht,r as Bt,u as G}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.2/Marketplace/chunk-W5LP6HWA.js";import{T as Rt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.2/Marketplace/chunk-7QK5UPRO.js";import{b as Ut,c as et,h as $,k as j,u as At}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.2/Marketplace/chunk-IANWTXDM.js";import{b as z,c as _}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.2/Marketplace/chunk-QYP6WXYL.js";import{$a as C,B as y,Cb as F,Db as T,Eb as Tt,Fa as c,Ga as x,Gc as mt,Hc as kt,Jc as ut,Lb as tt,Lc as Vt,Oa as s,T as J,Ua as S,V as Pt,X as Ot,Za as a,Zb as N,_a as l,_b as E,aa as Ft,ab as v,bb as b,bc as pt,c as wt,cc as Nt,db as P,ea as M,ec as dt,fa as Dt,fc as Et,hb as g,ja as u,jb as d,ka as h,ob as L,pb as m,q as Mt,qb as st,rb as I,vb as Q,wb as it,za as O}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.2/Marketplace/chunk-CQJJCQOZ.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.2/Marketplace/chunk-FG5W5K4B.js";var de=()=>["/menu/products/download/by-url"],ne=(()=>{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",Q(2,de)))},dependencies:[jt,kt,ut]});let o=r;return o})();function me(o,r){if(o&1){let n=P();a(0,"button",13),g("click",function(){u(n);let e=d(2);return h(e.onOpenScanDialog())}),C(1,"i",14),m(2," Scan Channel "),l()}}function ue(o,r){if(o&1&&(v(0),S(1,me,3,0,"button",12),b()),o&2){let n=d();c(1),s("ngIf",!n.productService.hasSelection(n.products))}}function he(o,r){if(o&1){let n=P();v(0),a(1,"button",15),g("click",function(){u(n);let e=d();return h(e.onScanMultipleProduct())}),C(2,"i",14),m(3),l(),b()}if(o&2){let n=d(),t;c(3),I(" Scan (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function _e(o,r){if(o&1){let n=P();v(0),a(1,"button",16),g("click",function(){u(n);let e=d();return h(e.onUploadMultipleProduct())}),C(2,"i",17),m(3),l(),b()}if(o&2){let n=d(),t;c(3),I(" Upload (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function ge(o,r){if(o&1){let n=P();a(0,"div",18)(1,"app-product-card",19),g("onUpload",function(){let i=u(n).$implicit,p=d();return h(p.onUploadToMultipleChannel(i))})("onScan",function(){let i=u(n).$implicit,p=d();return h(p.onScanSingleProduct(i))})("onDescEvent",function(){let i=u(n).index,p=d();return h(p.onOpenDialogVariant(i))})("onCheckBoxChange",function(e){let p=u(n).$implicit;return h(p.selected=e)}),l()()}if(o&2){let n=r.$implicit,t=d();c(1),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 Ce(o,r){o&1&&(v(0),a(1,"div",20),C(2,"app-empty-state"),l(),b())}function fe(o,r){if(o&1){let n=P();v(0),a(1,"div",21)(2,"div",22)(3,"app-custom-paginator",23),g("next",function(){u(n);let e=d();return h(e.onNextPage())})("previous",function(){u(n);let e=d();return h(e.onPrevPage())}),l()()(),b()}if(o&2){let n=d();c(3),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",!0)}}var oe=(()=>{let r=class r{constructor(t,e,i,p,f){this.http=t,this.toastr=e,this.dialog=i,this.productService=p,this.authService=f,this.searchFilter=new Z,this.products=[],this.rowCount=0,this.multipeScanChannels=[],this.getLoaderPage(),this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}getLoaderPage(){this.productService.LoadInPOS().subscribe(t=>{this.Categories=t.Options.Categories,this.searchFilter.PageNumber=t.Filter.PageNumber,this.searchFilter.RowCount=t.Filter.RowCount,this.searchFilter.ChannelID=null,this.searchFilter.Category=t.Filter.Category,this.searchFilter.PageSize=100,this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[z.Tokopedia,z.Tiktok])}getProducts(){let t={PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Category:this.searchFilter.Category,From:this.startDate,To:this.endDate};this.http.post("/api/product/GetInPOS",t).subscribe(e=>{this.products=e.Data,this.rowCount=e.Total==null?this.searchFilter.RowCount:e.Total.toString(),this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions)})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=_.GuidEMpty,this.dialog.open(D,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.Async,this.scanAllProduct()})}scanAllProduct(){if(this.searchFilter.ChannelID==null){this.toastr.error("Please Select Channel","Error");return}this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(t=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{this.getLoaderPage();let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,e,!this.searchFilter.UpdatedProduct)}})}onOpenDialogVariant(t){this.dialog.open(_t,{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)),J(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(p=>_.IsNotEmpty(p)),J(p=>this.productService.uploadSingleProduct([t],p))).subscribe({next:p=>{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,[z.Tokopedia,z.Tiktok]);this.dialog.open(D,{data:{filter:t,channelOptions:e,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(p=>_.IsNotEmpty(p))).subscribe(p=>{this.searchFilter.ChannelID=p.ChannelID,this.searchFilter.ScanFull=p.ScanFull,this.searchFilter.UpdatedProduct=p.UpdatedProduct;let f=this.productService.selectedProduct(this.products),w=this.productService.getVariantCodesProducts(f);this.scanSingleProduct(w)})}onScanSingleProduct(t){let e=JSON.parse(JSON.stringify(this.searchFilter));e.ChannelID=_.GuidEMpty,this.dialog.open(D,{data:{filter:e,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID;let p=this.productService.getVariantCodesProduct(t);this.scanSingleProduct(p)})}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(B),x(R),x(G),x(U),x(k))},r.\u0275cmp=M({type:r,selectors:[["app-in-pos"]],decls:22,vars:13,consts:[["description","All products which is already available in POS",3,"headerTitle","onSubmit"],[4,"ngIf"],[1,"fw-bold"],["appendTo","body","bindLabel","Name","name","Name","bindValue","Name","placeholder","Select Category",1,"center-text","mt-2",3,"clearable","items","ngModel","ngModelChange"],[1,"mt-5"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModel","ngModelChange","click"],["matEndDate","","placeholder","End date",3,"ngModel","ngModelChange","click"],["picker",""],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["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,"productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","onUpload","onScan","onDescEvent","onCheckBoxChange"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"filter","totaldata","paginationTotal","hasClicked","next","previous"]],template:function(e,i){if(e&1){let p=P();a(0,"mainpanel",0),g("onSubmit",function(w){return i.searchProduct(w)}),a(1,"actions"),S(2,ue,2,1,"ng-container",1)(3,he,4,1,"ng-container",1)(4,_e,4,1,"ng-container",1),l(),a(5,"filters")(6,"div")(7,"label",2),m(8,"Category"),l(),a(9,"ng-select",3),g("ngModelChange",function(w){return i.searchFilter.Category=w}),l()(),a(10,"div",4)(11,"mat-date-range-input",5)(12,"input",6),g("ngModelChange",function(w){return i.startDate=w})("click",function(){u(p);let w=L(15);return h(w.open())}),l(),a(13,"input",7),g("ngModelChange",function(w){return i.endDate=w})("click",function(){u(p);let w=L(15);return h(w.open())}),l()(),C(14,"mat-date-range-picker",null,8),l()(),a(16,"content")(17,"div",9)(18,"div",10),S(19,ge,2,10,"div",11)(20,Ce,3,0,"ng-container",1),l(),S(21,fe,4,4,"ng-container",1),l()()()}if(e&2){let p=L(15);s("headerTitle","In POS ("+i.rowCount+")"),c(2),s("ngIf",!i.productService.hasSelection(i.products)),c(1),s("ngIf",i.productService.hasSelection(i.products)&&i.multipeScanChannels.length>0),c(1),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("items",i.Categories)("ngModel",i.searchFilter.Category),c(2),s("rangePicker",p),c(1),s("ngModel",i.startDate),c(1),s("ngModel",i.endDate),c(6),s("ngForOf",i.products),c(1),s("ngIf",i.products.length==0),c(1),s("ngIf",i.products.length>0)}},dependencies:[N,E,et,$,j,V,H,K,Y,A,Yt,Zt,qt,Qt],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 Se(o,r){if(o&1){let n=P();v(0),a(1,"button",10),g("click",function(){u(n);let e=d();return h(e.onOpenScanDialog())}),C(2,"i",11),m(3," Scan Channel "),l(),b()}}function xe(o,r){if(o&1){let n=P();v(0),a(1,"button",12),g("click",function(){u(n);let e=d();return h(e.onScanMultipleProduct())}),C(2,"i",11),m(3),l(),b()}if(o&2){let n=d();c(3),I(" Scan (",n.productService.selectedProduct(n.products).length,") ")}}function Pe(o,r){if(o&1){let n=P();v(0),a(1,"button",13),g("click",function(){u(n);let e=d();return h(e.onUploadMultipleProduct())}),C(2,"i",14),m(3),l(),b()}if(o&2){let n=d();c(3),I(" Upload (",n.productService.selectedProduct(n.products).length,") ")}}function ve(o,r){if(o&1&&(a(0,"span",15),C(1,"img",16),l(),m(2)),o&2){let n=r.item,t=d();c(1),s("src",t.getChannelLogo(n.TypeID),O),c(1),I(" ",n.Name," ")}}function be(o,r){if(o&1){let n=P();a(0,"div",17)(1,"label",2),m(2,"Item ID"),l(),a(3,"input",18),g("ngModelChange",function(e){u(n);let i=d();return h(i.searchFilter.Item_id=e)}),l()()}if(o&2){let n=d();c(3),s("ngModel",n.searchFilter.Item_id)}}function Ie(o,r){if(o&1){let n=P();a(0,"div",19)(1,"app-product-card",20),g("onUpload",function(){let i=u(n).$implicit,p=d();return h(p.onUploadToMultipleChannel(i))})("onDescEvent",function(){let i=u(n).index,p=d();return h(p.onOpenVariantDetail(i))})("onScan",function(){let i=u(n).$implicit,p=d();return h(p.onScanSingleProduct(i))})("onCheckBoxChange",function(e){let p=u(n).$implicit;return h(p.selected=e)}),l()()}if(o&2){let n=r.$implicit,t=d();c(1),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 ye(o,r){o&1&&(v(0),a(1,"div",21),C(2,"app-empty-state"),l(),b())}function we(o,r){if(o&1){let n=P();a(0,"div",22)(1,"div",23)(2,"app-custom-paginator",24),g("total",function(){u(n);let e=d();return h(e.getRowCount())})("next",function(){u(n);let e=d();return h(e.onNextPage())})("previous",function(){u(n);let e=d();return h(e.onPreviousPage())}),l()()()}if(o&2){let n=d();c(2),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}var re=(()=>{let r=class r{constructor(t,e,i,p,f,w){this.http=t,this.dialog=e,this.toastr=i,this.productService=p,this.activateRouter=f,this.authService=w,this.searchFilter=new Z,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,[z.Tokopedia,z.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(_t,{data:{variants:e,title:this.products[t].Name},width:"800px"})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=_.GuidEMpty,this.dialog.open(D,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.Async,this.scanAllProduct()})}scanAllProduct(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).pipe(y(e=>e)).subscribe(e=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(e,t,!this.searchFilter.UpdatedProduct),this.initPageLoader(_.GuidEMpty))})}onScanSingleProduct(t){t.Channel=this.productService.getChannelProduct(t);let e=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(D,{data:{filter:e,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID;let p=this.productService.getVariantCodesProduct(t);this.scanProducts(p)})}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(p=>_.IsNotEmpty(p)),J(p=>this.productService.uploadSingleProduct([t],p))).subscribe({next:p=>{this.getProducts()}})}onScanMultipleProduct(){this.searchFilter.ChannelID=_.GuidEMpty;let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(D,{data:{filter:t,channelOptions:this.multipeScanChannels,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct;let p=this.productService.selectedProduct(this.products),f=this.productService.getVariantCodesProducts(p);this.scanProducts(f)})}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)),J(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()}getChannelLogo(t){return _.getChannelLogoByTypeId(t)}};r.\u0275fac=function(e){return new(e||r)(x(B),x(G),x(R),x(U),x(mt),x(k))},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,"headerTitle","onSubmit"],[4,"ngIf"],[1,"fw-bold"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text","mt-2",3,"clearable","multiple","items","ngModel","ngModelChange","clear"],["ng-option-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"],["alt","",2,"width","18px",3,"src"],[1,"mt-5"],["type","text","name","Item_id","id","Item_id",1,"form-control","mt-2",3,"ngModel","ngModelChange"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","onUpload","onDescEvent","onScan","onCheckBoxChange"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"filter","totaldata","paginationTotal","hasClicked","total","next","previous"]],template:function(e,i){e&1&&(a(0,"mainpanel",0),g("onSubmit",function(f){return i.searchProduct(f)}),a(1,"actions"),S(2,Se,4,0,"ng-container",1)(3,xe,4,1,"ng-container",1)(4,Pe,4,1,"ng-container",1),l(),a(5,"filters")(6,"div")(7,"label",2),m(8,"Channel"),l(),a(9,"ng-select",3),g("ngModelChange",function(f){return i.searchFilter.ListChannelID=f})("clear",function(){return i.onClearFilterChannel()}),S(10,ve,3,2,"ng-template",4),l()(),S(11,be,4,1,"div",5),l(),a(12,"content")(13,"div",6)(14,"div",7),S(15,Ie,2,10,"div",8)(16,ye,3,0,"ng-container",1),l(),S(17,we,3,4,"div",9),l()()()),e&2&&(s("headerTitle","Sold in Channel"),c(2),s("ngIf",!i.productService.hasSelection(i.products)),c(1),s("ngIf",i.multipeScanChannels.length>0&&i.productService.hasSelection(i.products)),c(1),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(1),s("ngIf",i.products.length==0),c(1),s("ngIf",i.products==null?null:i.products.length))},dependencies:[N,E,et,$,j,V,H,nt,K,Y,A],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]});let o=r;return o})();function Oe(o,r){if(o&1){let n=P();a(0,"button",10),g("click",function(){u(n);let e=d(2);return h(e.uploadMultipleProduct())}),C(1,"i",11),m(2),l()}if(o&2){let n=d(2);c(2),I(" upload (",n.selectedProducts==null?null:n.selectedProducts.length,") ")}}function Fe(o,r){if(o&1){let n=P();v(0),a(1,"td",26)(2,"input",27),g("ngModelChange",function(e){u(n);let i=d(2).$implicit;return h(i.selected=e)})("ngModelChange",function(){u(n);let e=d(3).ngIf,i=d(3);return h(i.onSelectProduct(e))}),l()(),b()}if(o&2){let n=d(2).$implicit;c(1),s("rowSpan",n==null?null:n.Variants.length),c(1),s("ngModel",n.selected)}}function De(o,r){if(o&1){let n=P();v(0),a(1,"img",33),g("click",function(e){u(n);let i=d(3).$implicit,p=d(4);return h(p.onZoomImage(e,i==null?null:i.ImageUrl))}),l(),b()}if(o&2){let n=d(3).$implicit;c(1),s("src",n==null?null:n.ImageUrl,O)}}function Te(o,r){o&1&&C(0,"img",34)}function Ne(o,r){if(o&1&&(v(0),a(1,"td",26)(2,"div",28),S(3,De,2,1,"ng-container",7)(4,Te,1,0,"ng-template",null,29,tt),l()(),a(6,"td",30)(7,"h4",31)(8,"span",32),m(9),l()()(),b()),o&2){let n=L(5),t=d(2).$implicit;c(1),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(1),I(" ",t==null?null:t.Name," ")}}function Ee(o,r){if(o&1&&(a(0,"div")(1,"a",22),C(2,"img",35),l()()),o&2){let n=r.$implicit;c(1),s("href",n.URL,O),c(1),s("src",n.Img,O)("matTooltip",n.Name)}}function ke(o,r){if(o&1&&(a(0,"div"),C(1,"img",35),l()),o&2){let n=r.$implicit;c(1),s("src",n.Img,O)("matTooltip",n.Name)}}function Ve(o,r){if(o&1&&(a(0,"tr"),S(1,Fe,3,2,"ng-container",9)(2,Ne,10,6,"ng-container",9),a(3,"td"),m(4),l(),a(5,"td")(6,"span"),m(7),l(),a(8,"span",21)(9,"a",22),C(10,"i",23),l()()(),a(11,"td",24)(12,"div",25),S(13,Ee,3,3,"div",20),l()(),a(14,"td",24)(15,"div",25),S(16,ke,2,2,"div",20),l()()()),o&2){let n=r.$implicit,t=r.index,e=d(5);c(1),s("ngIf",t==0),c(1),s("ngIf",t==0),c(2),I(" ",n.Name," "),c(3),I(" ",n.Code," "),c(2),s("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),O),c(4),s("ngForOf",n==null?null:n.Available),c(3),s("ngForOf",n==null?null:n.NotAvailable)}}function Ue(o,r){if(o&1&&(v(0),S(1,Ve,17,7,"tr",20),b()),o&2){let n=r.$implicit;c(1),s("ngForOf",n.Variants)}}function Ae(o,r){if(o&1&&(a(0,"tbody"),S(1,Ue,2,1,"ng-container",20),l()),o&2){let n=r.ngIf;c(1),s("ngForOf",n)}}function Le(o,r){if(o&1&&(v(0),a(1,"div",12)(2,"table",13)(3,"thead",14)(4,"tr"),C(5,"th",15),a(6,"th",16),m(7,"Product"),l(),a(8,"th",17),m(9,"Variant"),l(),a(10,"th",17),m(11,"SKU"),l(),a(12,"th",18),m(13,"Available In"),l(),a(14,"th",19),m(15,"Not Available In"),l()()(),S(16,Ae,2,1,"tbody",9),F(17,"async"),l()(),b()),o&2){let n=d(2);c(16),s("ngIf",T(17,1,n.data$))}}function Re(o,r){o&1&&(a(0,"div",36),C(1,"app-empty-state"),l())}function Be(o,r){if(o&1){let n=P();a(0,"span",44),g("click",function(){u(n);let e=d(4);return h(e.getRowCount())}),a(1,"i",45),m(2,"?"),l()()}}function $e(o,r){if(o&1&&(a(0,"span"),m(1),F(2,"number"),l()),o&2){let n=r.ngIf;c(1),st(T(2,1,n==null?null:n.Count))}}function je(o,r){if(o&1){let n=P();a(0,"a",46),g("click",function(){u(n);let e=d(4);return h(e.onNextPage())}),C(1,"i",47),m(2," Next"),l()}}function Ge(o,r){if(o&1){let n=P();a(0,"a",48),g("click",function(){u(n);let e=d(4);return h(e.onLastPage())}),C(1,"i",49),m(2," Last"),l()}}function Ke(o,r){if(o&1&&(v(0),a(1,"div",37)(2,"div",38)(3,"div",39),m(4),F(5,"number"),S(6,Be,3,0,"span",40)(7,$e,3,3,"span",9),F(8,"async"),m(9),l()(),a(10,"div",41),S(11,je,3,0,"a",42)(12,Ge,3,0,"a",43),l()(),b()),o&2){let n=d().ngIf,t=d(2);c(4),I(" Showing 1 - ",T(5,6,n==null?null:n.length)," of "),c(2),s("ngIf",t.paginationService.hideCount),c(1),s("ngIf",!t.paginationService.hideCount&&T(8,8,t.rowCount$)),c(2),I(" records ~ ",t.paginationService.footerPageNumber," Page "),c(2),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),c(1),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}function Je(o,r){if(o&1&&(v(0),S(1,Ke,13,10,"ng-container",9),b()),o&2){let n=r.ngIf;c(1),s("ngIf",(n==null?null:n.length)>0)}}function ze(o,r){if(o&1){let n=P();a(0,"mainpanel",1),g("onSubmit",function(e){u(n);let i=d();return h(i.searchProduct(e))}),a(1,"actions"),S(2,Oe,3,1,"button",2),a(3,"button",3),g("click",function(){u(n);let e=d();return h(e.openScanDialog())}),C(4,"i",4),m(5," Scan Channel "),l()(),a(6,"content")(7,"div",5)(8,"div",6),S(9,Le,18,3,"ng-container",7),F(10,"async"),S(11,Re,2,0,"ng-template",null,8,tt),l(),S(13,Je,2,1,"ng-container",9),F(14,"async"),l()()()}if(o&2){let n=L(12),t=d(),e;s("hideSearchDropdown",!0),c(2),s("ngIf",t.hasSelectionProduct),c(7),s("ngIf",((e=T(10,5,t.data$))==null?null:e.length)>0)("ngIfElse",n),c(4),s("ngIf",T(14,7,t.data$))}}var ae=(()=>{let r=class r{constructor(t,e,i,p,f,w,yt){this.http=t,this.dialog=e,this.toastr=i,this.productService=p,this.paginationService=f,this.biggerPictureService=w,this.authService=yt,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannelV2",this.hasSelectionProduct=!1,this.selectedProducts=[],this.channelOptions=yt.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(Ot(t=>{this.filterSearch=t.Filter,this.paginationService.reloadPagination(t.Filter)}))}iniData(){this.data$=this.paginationService.data$.pipe(Mt(t=>(t=t.map(e=>(e.Variants=e.Variants.map(i=>(i.Available=this.productService.sortChannel(i.Available),i.NotAvailable=this.productService.sortChannel(i.NotAvailable),i.Available=this.assignLogoChannel(i.Available),i.NotAvailable=this.assignLogoChannel(i.NotAvailable),i)),e)),t)))}assignLogoChannel(t){return t=t.map(e=>(e.Img=_.getChannelLogoByTypeId(e.TypeID),e)),t}searchProduct(t){this.filterSearch.text=t,this.paginationService.reloadPagination(this.filterSearch)}scanAllProduct(){let t=this.productService.findChannelById(this.filterSearch.ChannelID,this.channelOptions);this.productService.scanAll(this.filterSearch.ChannelID,this.filterSearch.ScanFull,this.filterSearch.UpdatedProduct,this.filterSearch.Async).subscribe(e=>{this.filterSearch.Async?this.toastr.success("You will be notified when the scan is completed.","Scan Asynchronous"):(this.productService.successToastrScanAllProduct(e,t,!this.filterSearch.UpdatedProduct),this.initPageLoader())})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.filterSearch));t.ChannelID=_.GuidEMpty,this.dialog.open(D,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.filterSearch.ChannelID=i.ChannelID,this.filterSearch.ScanFull=i.ScanFull,this.filterSearch.UpdatedProduct=i.UpdatedProduct,this.filterSearch.Async=i.Async,this.scanAllProduct()})}getRowCount(){this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`/api/${this.rowCountAPI}`,this.filterSearch)}onNextPage(){this.paginationService.onNextPage(this.filterSearch)}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:t=>{this.filterSearch.PageNumber=1,this.paginationService.getAllData(this.filterSearch,t.Count)}})}onZoomImage(t,e){this.biggerPictureService.openBiggerPicture(t,e)}onSelectProduct(t){this.hasSelectionProduct=this.productService.hasSelection(t),this.selectedProducts=this.productService.selectedProduct(t)}uploadMultipleProduct(){let t=this.getUniqueChannels();t=t.map(e=>(e.ID=e.ChannelID,e)),this.dialog.open(q,{width:"700px",data:{title:"Upload Multiple Product",channels:t}}).afterClosed().pipe(y(e=>_.IsNotEmpty(e)),J(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,p)=>p.findIndex(f=>f.ChannelID==e.ChannelID)==i),t}ngOnDestroy(){this.paginationService.destroy()}};r.\u0275fac=function(e){return new(e||r)(x(B),x(G),x(R),x(U),x(Xt),x(Ht),x(k))},r.\u0275cmp=M({type:r,selectors:[["app-not-in-channel"]],decls:2,vars:3,consts:[["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"hideSearchDropdown","onSubmit",4,"ngIf"],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"hideSearchDropdown","onSubmit"],["class","btn btn-light shadow rounded ms-2",3,"click",4,"ngIf"],["data-cy","scanNotinChannel","type","button",1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"container-fluid","mt-3"],[1,"row"],[4,"ngIf","ngIfElse"],["EMPTY",""],[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,"ngModel","ngModelChange"],[2,"padding-right","0px"],["elsePic",""],[1,"text-start",3,"rowSpan"],[1,"ms-5","fw-normal","text-ellipsis",2,"max-width","26vw !important"],[3,"matTooltip"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],["alt","",1,"channel-logo","cursor-pointer","ms-4","mt-3",3,"src","matTooltip"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(e,i){e&1&&(S(0,ze,15,9,"mainpanel",0),F(1,"async")),e&2&&s("ngIf",T(1,1,i.loader$))},dependencies:[N,E,Ut,$,j,V,ht,A,pt,dt],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})();function He(o,r){if(o&1){let n=P();a(0,"button",14),g("click",function(){u(n);let e=d();return h(e.openScanDialog())}),C(1,"i",15),m(2," Scan Channel "),l()}}function Ze(o,r){if(o&1){let n=P();v(0),a(1,"button",16),g("click",function(){u(n);let e=d();return h(e.onDownloadAllProduct("SELECTED"))}),C(2,"i",17),m(3),l(),b()}if(o&2){let n=d(),t;c(3),I(" Download (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function qe(o,r){if(o&1&&(a(0,"span",18),C(1,"img",19),l(),m(2)),o&2){let n=r.item,t=d();c(1),s("src",t.getChannelLogo(n.TypeID),O),c(1),I(" ",n.Name," ")}}var Ye=o=>[o],Qe=()=>[];function We(o,r){if(o&1){let n=P();a(0,"div",20)(1,"app-product-card",21),g("onCheckBoxChange",function(e){let p=u(n).index,f=d();return h(f.onSelectProduct(e,p))})("onDescEvent",function(){let i=u(n).index,p=d();return h(p.onShowVariantDetail(i))})("onDownload",function(){let i=u(n).$implicit,p=d();return h(p.onDownloadProduct(i))})("onScan",function(){let i=u(n).$implicit,p=d();return h(p.onScanChannel(i))}),l()()}if(o&2){let n=r.$implicit;c(1),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?it(10,Ye,n==null?null:n.Channel):Q(12,Qe))("showCheckBox",!0)("scanButton",!0)}}function Xe(o,r){o&1&&(v(0),a(1,"div",22),C(2,"app-empty-state"),l(),b())}function tn(o,r){if(o&1){let n=P();a(0,"div",23)(1,"div",24)(2,"app-custom-paginator",25),g("total",function(){u(n);let e=d();return h(e.getRowCount())})("next",function(){u(n);let e=d();return h(e.onNextPage())})("previous",function(){u(n);let e=d();return h(e.onPreviousPage())}),l()()()}if(o&2){let n=d();c(2),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}var le=(()=>{let r=class r{constructor(t,e,i,p,f,w){this.http=t,this.dialog=e,this.productService=i,this.toastrService=p,this.activateRouter=f,this.authService=w,this.searchFilter=new Z,this.products=[],this.hasClickRowCount=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(_.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(e=>{this.searchFilter=e.Filter,this.searchFilter.PageSize=e.Filter.RowCount,this.getProducts()})}getProducts(){this.http.post("/api/product/GetProductChannelNotPOS",this.searchFilter).subscribe(t=>{this.products=t.Data,this.mapChannelToProduct(),this.setSkuProduct()})}mapChannelToProduct(){let t;this.products=this.products.map(e=>(t=this.channelOptions.find(i=>i.ID==e.ChannelID),t?e.Channel=JSON.parse(JSON.stringify(t)):e.Channel=null,e)).map(e=>(e.Channel&&(e.Channel.Url=e.Url),e))}setSkuProduct(){this.products=this.products.map(t=>(t?.Variant?.length==0?_.IsNotEmpty(t?.ChannelItemSKU)?t.SKU=t?.ChannelItemSKU:t.SKU="SKU not assigned":t.SKU=t?.Variant[0]?.ChannelVariationSKU?t?.Variant[0]?.ChannelVariationSKU:"SKU not assigned",t))}onSearch(t){this.searchFilter.text=t,this.hasClickRowCount=!1,this.getProducts()}onClearChannelFilter(){this.searchFilter.ChannelID=_.GuidEMpty}onScanAll(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(e=>{this.searchFilter.Async?this.toastrService.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.initPageLoader(_.GuidEMpty),this.productService.successToastrScanAllProduct(e,t,!this.searchFilter.UpdatedProduct)),this.searchFilter.ChannelID=_.GuidEMpty})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=_.GuidEMpty,this.dialog.open(D,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.Async=i.Async,this.onScanAll()})}onDownloadAllProduct(t){let e;t=="ALL"?e=this.products:e=this.productService.selectedProduct(this.products),e.length>0&&this.productService.downloadMultipleProduct(e).subscribe({next:()=>{this.getProducts()}})}onSelectProduct(t,e){this.products[e].selected=t}onDownloadProduct(t){confirm(`Are you sure you want to Retrieve product ${t?.Name} from ${t?.Channel.Name} to POS?`)&&this.productService.downloadProduct(t).subscribe({next:()=>{this.getProducts()}})}onScanChannel(t){let e=JSON.parse(JSON.stringify(t));delete e.Channel,this.productService.scanCompareToPos([e]).subscribe(i=>{i.Status?(this.initPageLoader(_.GuidEMpty),this.toastrService.success(`product ${t.Name} have been successfully scanned and synchronized with POS`,"Success")):this.toastrService.error(`Product ${t.Name} is not existed in POS`,"Error")})}onShowVariantDetail(t){let e=this.products[t].Variant;e.length>0&&this.dialog.open(te,{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()}getChannelLogo(t){return _.getChannelLogoByTypeId(t)}};r.\u0275fac=function(e){return new(e||r)(x(B),x(G),x(U),x(R),x(mt),x(k))},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"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text","mt-2",3,"clearable","items","ngModel","ngModelChange","clear"],["ng-option-tmp",""],[1,"mt-5"],["name","haveSKU",1,"form-control","h-100","pt-3","rounded","mt-2",3,"ngModel","ngModelChange"],[1,"me-5",3,"value"],["type","text","name","Item_id","id","Item_id","placeholder","item id",1,"form-control","mt-2",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button","data-cy","scanNotInPos",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","ms-3",3,"click"],[1,"fa","fa-download"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"showRedirectIcon","title","image","imageForZoom","code","description","downloadButton","channels","showCheckBox","scanButton","onCheckBoxChange","onDescEvent","onDownload","onScan"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"filter","totaldata","paginationTotal","hasClicked","total","next","previous"]],template:function(e,i){e&1&&(a(0,"mainpanel",0),g("onSubmit",function(f){return i.onSearch(f)}),a(1,"actions"),S(2,He,3,0,"button",1)(3,Ze,4,1,"ng-container",2),l(),a(4,"filters")(5,"div")(6,"label",3),m(7,"Channel"),l(),a(8,"ng-select",4),g("ngModelChange",function(f){return i.searchFilter.ChannelID=f})("clear",function(){return i.onClearChannelFilter()}),S(9,qe,3,2,"ng-template",5),l()(),a(10,"div",6)(11,"label",3),m(12,"SKU Assigned"),l(),a(13,"mat-radio-group",7),g("ngModelChange",function(f){return i.searchFilter.HaveSku=f}),a(14,"mat-radio-button",8),m(15," All "),l(),a(16,"mat-radio-button",8),m(17," Yes "),l(),a(18,"mat-radio-button",8),m(19," No "),l()()(),a(20,"div",6)(21,"label",3),m(22,"Item ID"),l(),a(23,"input",9),g("ngModelChange",function(f){return i.searchFilter.Item_id=f}),l()()(),a(24,"content")(25,"div",10)(26,"div",11),S(27,We,2,13,"div",12)(28,Xe,3,0,"ng-container",2),l(),S(29,tn,3,4,"div",13),l()()()),e&2&&(c(2),s("ngIf",!i.productService.hasSelection(i.products)),c(1),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("items",i.channelOptions)("ngModel",i.searchFilter.ChannelID),c(5),s("ngModel",i.searchFilter.HaveSku),c(1),s("value",0),c(2),s("value",1),c(2),s("value",2),c(5),s("ngModel",i.searchFilter.Item_id),c(4),s("ngForOf",i.products),c(1),s("ngIf",i.products.length==0),c(1),s("ngIf",(i.products==null?null:i.products.length)>0))},dependencies:[N,E,et,$,j,V,H,nt,Kt,Jt,K,Y,A],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 en(o,r){if(o&1&&(a(0,"span",8),C(1,"img",9),l(),m(2)),o&2){let n=r.item,t=d();c(1),s("src",t.getChannelLogo(n.TypeID),O),c(1),I(" ",n.Name," ")}}function nn(o,r){if(o&1&&(a(0,"div",10),C(1,"app-duplicate-product-card",11),l()),o&2){let n=r.$implicit,t=r.index;c(1),s("imageForZoom",n.ImageUrl)("title",n.Name)("code",n.Code)("id",t)("image",n.ThumbnailURL)("channels",n.Channels)}}function on(o,r){o&1&&(v(0),a(1,"div",12),C(2,"app-empty-state"),l(),b())}function rn(o,r){if(o&1){let n=P();v(0),a(1,"div",13)(2,"div",14)(3,"app-custom-paginator",15),g("next",function(){u(n);let e=d();return h(e.onNextPage())})("previous",function(){u(n);let e=d();return h(e.onPrevPage())})("total",function(){u(n);let e=d();return h(e.getRowCount())}),l()()(),b()}if(o&2){let n=d();c(3),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickedRowCount)}}var ce=(()=>{let r=class r{constructor(t,e,i){this.httpService=t,this.productService=e,this.authService=i,this.searchFilter=new Z,this.products=[],this.hasClickedRowCount=!1,this.getPageLoader(),this.channelOptions=i.getChannels()}getPageLoader(){this.productService.loader().subscribe(t=>{this.searchFilter=t.Filter,this.searchFilter.PageSize=t.Filter.RowCount,this.getProducts()})}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,RowCount:this.searchFilter.RowCount,PageNumber:this.searchFilter.PageNumber,text:this.searchFilter.text};this.httpService.post("/api/product/GetDuplicateInChannel",t).subscribe(e=>{this.products=e.Data})}onSearch(t){this.searchFilter.text=t,this.hasClickedRowCount=!1,this.getProducts()}onClearFilter(){this.searchFilter.ChannelID=_.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(B),x(U),x(k))},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",""],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text","mt-2",3,"multiple","clearable","items","ngModel","ngModelChange","clear"],["ng-option-tmp",""],[1,"container-fluid"],[1,"row","mt-8","mx-1"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"imageForZoom","title","code","id","image","channels"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"filter","totaldata","paginationTotal","hasClicked","next","previous","total"]],template:function(e,i){e&1&&(a(0,"mainpanel",0),g("onSubmit",function(f){return i.onSearch(f)}),a(1,"filters")(2,"div",1)(3,"div")(4,"h6"),m(5,"Channel"),l(),a(6,"ng-select",2),g("ngModelChange",function(f){return i.searchFilter.ListChannelID=f})("clear",function(){return i.onClearFilter()}),S(7,en,3,2,"ng-template",3),l()()()(),a(8,"content")(9,"div",4)(10,"div",5),S(11,nn,2,6,"div",6)(12,on,3,0,"ng-container",7),l(),S(13,rn,4,4,"ng-container",7),l()()()),e&2&&(c(6),s("multiple",!0)("clearable",!0)("items",i.channelOptions)("ngModel",i.searchFilter.ListChannelID),c(5),s("ngForOf",i.products),c(1),s("ngIf",(i.products==null?null:i.products.length)==0),c(1),s("ngIf",(i.products==null?null:i.products.length)>0))},dependencies:[N,E,$,j,V,H,nt,gt,K,A]});let o=r;return o})();function an(o,r){if(o&1&&(v(0),m(1),b()),o&2){let n=d().$implicit;c(1),I(" ",n.Count," ")}}function ln(o,r){if(o&1){let n=P();a(0,"span",26),g("click",function(){u(n);let e=d().$implicit,i=d(2);return h(i.getLiveProductCount(e.ID,e))}),C(1,"i",27),l()}}var cn=()=>["/menu/products/status/sold-in-channel"],se=o=>({ID:o}),sn=()=>["/menu/products/status/not-in-pos"];function pn(o,r){if(o&1){let n=P();a(0,"tr")(1,"td"),C(2,"img",16),a(3,"span",17),m(4),l()(),a(5,"td",18),S(6,an,2,1,"ng-container",4)(7,ln,2,0,"ng-template",null,19,tt),l(),a(9,"td",18)(10,"a",20),m(11),F(12,"number"),l()(),a(13,"td",18)(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),g("click",function(){let i=u(n).$implicit,p=d(2);return h(p.onScanChannel(i))}),C(23,"i",23),m(24," Scan "),l(),a(25,"button",24),g("click",function(){let i=u(n).$implicit,p=d(2);return h(p.onClearCache(i.ID))}),C(26,"i",25),m(27," Clear "),l()()()()}if(o&2){let n=r.$implicit,t=L(8),e=d(2);c(2),s("src",e.getChannelLogo(n.TypeID),O),c(2),st(n.Name),c(2),s("ngIf",n.Count!==void 0)("ngIfElse",t),c(4),s("routerLink",Q(18,cn))("queryParams",it(19,se,n.ID)),c(1),I(" ",T(12,11,n.SoldInChannel)," "),c(3),s("routerLink",Q(21,sn))("queryParams",it(22,se,n.ID)),c(1),I(" ",T(16,13,n.NotInPOS)," "),c(3),I("",n.LastSync?Tt(19,15,n.LastSync,"dd MMM yyyy HH:mm"):"-"," ")}}function dn(o,r){if(o&1&&(v(0),a(1,"div",6)(2,"table",7)(3,"thead",8)(4,"tr",9)(5,"th"),m(6,"Channel"),l(),a(7,"th",10),m(8,"Live Product"),l(),a(9,"th",11),m(10,"Sold In Channel"),l(),a(11,"th",12),m(12,"Product Not in POS"),l(),a(13,"th",13),m(14,"Last Sync"),l(),C(15,"th",14),l()(),a(16,"tbody"),S(17,pn,28,24,"tr",15),F(18,"async"),l()()(),b()),o&2){let n=d(),t;c(17),s("ngForOf",(t=T(18,1,n.channels$))==null?null:t.Data)}}function mn(o,r){o&1&&(a(0,"div",28),C(1,"app-empty-state"),l())}var pe=(()=>{let r=class r{constructor(t,e,i,p){this.productService=t,this.toastr=e,this.dialog=i,this.authService=p,this.destroy$=new wt,this.channelOptions=p.getChannels()}ngOnInit(){this.setObsProductStatistic()}setObsProductStatistic(){this.channels$=this.productService.getProductStatistic()}getLiveProductCount(t,e){this.productService.getTotalProductLive(t).pipe(Pt(this.destroy$)).subscribe(i=>{e.Count=i.Count})}onScanChannel(t){this.dialog.open(D,{width:"700px",data:{channelOptions:this.channelOptions,filter:{ChannelID:t.ID},disabledChannelOption:!0}}).afterClosed().pipe(y(e=>_.IsNotEmpty(e))).subscribe(e=>{this.scanAllProduct(t.ID,e)})}scanAllProduct(t,e){let i=this.productService.findChannelById(t,this.channelOptions);this.productService.scanAll(e.ChannelID,e.ScanFull,e.UpdatedProduct,e.Async).pipe(y(p=>p)).subscribe(p=>{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(p,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(Pt(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(U),x(R),x(G),x(k))},r.\u0275cmp=M({type:r,selectors:[["app-channel-statistic"]],decls:9,vars:6,consts:[["headerTitle","Products Statistic",3,"hideSearchBox","hideSearchDropdown"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],["EMPTY",""],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[1,"text-center",2,"width","13rem"],[1,"text-center",2,"width","9rem"],[1,"text-center",2,"width","14rem"],[2,"width","10rem"],[2,"width","12rem"],[4,"ngFor","ngForOf"],[2,"width","24px","height","24px",3,"src"],[1,"ms-3"],[1,"text-center"],["QUESTION",""],[3,"routerLink","queryParams"],[1,"d-flex","align-items-center","justify-content-center"],[1,"btn","btn-sm","btn-secondary","fs-6",3,"click"],[1,"fa","fa-spinner"],[1,"btn","btn-sm","btn-secondary","fs-6","ms-3",3,"click"],[1,"fa","fa-trash"],["matTooltip","Click to see total live product",1,"cursor-pointer","fs-5","text-primary",3,"click"],[1,"fa-solid","fa-circle-question","cursor"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(e,i){if(e&1&&(a(0,"mainpanel",0)(1,"content")(2,"div",1)(3,"div",2)(4,"div",3),S(5,dn,19,3,"ng-container",4),F(6,"async"),S(7,mn,2,0,"ng-template",null,5,tt),l()()()()()),e&2){let p=L(8),f;s("hideSearchBox",!0)("hideSearchDropdown",!0),c(5),s("ngIf",((f=T(6,4,i.channels$))==null||f.Data==null?null:f.Data.length)>0)("ngIfElse",p)}},dependencies:[N,E,V,ht,ut,A,pt,dt,Nt]});let o=r;return o})();var un=[{component:ne,path:"",children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:oe,canActivate:[W],data:{title:"Products in POS"}},{path:"sold-in-channel",component:re,canActivate:[W],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:ae,canActivate:[W],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:le,canActivate:[W],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:ce,canActivate:[W],data:{title:"Duplicate Sku in Channel"}},{path:"channel-statistic",component:pe,canActivate:[W],data:{title:"Channel Statistic"}}]}],yi=(()=>{let r=class r{};r.\u0275fac=function(e){return new(e||r)},r.\u0275mod=Dt({type:r}),r.\u0275inj=Ft({imports:[Et,At,$t,Bt,Lt,ee,zt,Gt,gt,K,Y,Vt.forChild(un),Wt,Rt]});let o=r;return o})();export{yi as StatusModule};
|
|
1
|
+
import{a as _t,c as q,d as te}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-2UI4YTN6.js";import{a as Z}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-EF3W3UUA.js";import{a as A}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-OKATPNAY.js";import{d as Zt,e as qt,f as Yt,g as Qt,k as Wt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-ELFNCSQS.js";import{a as Y,b as gt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-Q4LQRXK4.js";import{a as K}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-7I7KV673.js";import{b as ee}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-MPHWSDOT.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-U7MYN4C4.js";import{a as Xt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-KQRK4CTQ.js";import{a as D}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-CUYZKVZ3.js";import{a as U}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-2SA7SVYH.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-LSBFWGC6.js";import{a as jt,b as Gt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-644NU43G.js";import{e as k}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-IMUZFXPJ.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-SKMUHTVE.js";import{b as R,e as B}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-7XITKPS5.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-GQU66EJO.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-WP6G47JB.js";import{a as Ht}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-HX36ACUF.js";import{a as Kt,b as Jt,c as zt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-X6UUIC3F.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-S5TAVCV2.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-FZ3LLUFV.js";import{a as nt,c as H,d as Lt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-IPVDR333.js";import{a as W}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-ZAKCXPP7.js";import{B as V,C as $t,q as ht,r as Bt,u as G}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-R4XC3TIR.js";import{T as Rt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-H4UMXVLS.js";import{b as Ut,c as et,h as $,k as j,u as At}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-7QIOC7BK.js";import{b as z,c as _}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-MKDJJ5L7.js";import{$a as C,B as y,Cb as F,Db as T,Eb as Tt,Fa as c,Ga as x,Gc as mt,Hc as kt,Jc as ut,Lb as tt,Lc as Vt,Oa as s,T as J,Ua as S,V as Pt,X as Ot,Za as a,Zb as N,_a as l,_b as E,aa as Ft,ab as v,bb as b,bc as pt,c as wt,cc as Nt,db as P,ea as M,ec as dt,fa as Dt,fc as Et,hb as g,ja as u,jb as d,ka as h,ob as L,pb as m,q as Mt,qb as st,rb as I,vb as Q,wb as it,za as O}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-DJCANNYC.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-R7J6AS67.js";var de=()=>["/menu/products/download/by-url"],ne=(()=>{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",Q(2,de)))},dependencies:[jt,kt,ut]});let o=r;return o})();function me(o,r){if(o&1){let n=P();a(0,"button",13),g("click",function(){u(n);let e=d(2);return h(e.onOpenScanDialog())}),C(1,"i",14),m(2," Scan Channel "),l()}}function ue(o,r){if(o&1&&(v(0),S(1,me,3,0,"button",12),b()),o&2){let n=d();c(1),s("ngIf",!n.productService.hasSelection(n.products))}}function he(o,r){if(o&1){let n=P();v(0),a(1,"button",15),g("click",function(){u(n);let e=d();return h(e.onScanMultipleProduct())}),C(2,"i",14),m(3),l(),b()}if(o&2){let n=d(),t;c(3),I(" Scan (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function _e(o,r){if(o&1){let n=P();v(0),a(1,"button",16),g("click",function(){u(n);let e=d();return h(e.onUploadMultipleProduct())}),C(2,"i",17),m(3),l(),b()}if(o&2){let n=d(),t;c(3),I(" Upload (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function ge(o,r){if(o&1){let n=P();a(0,"div",18)(1,"app-product-card",19),g("onUpload",function(){let i=u(n).$implicit,p=d();return h(p.onUploadToMultipleChannel(i))})("onScan",function(){let i=u(n).$implicit,p=d();return h(p.onScanSingleProduct(i))})("onDescEvent",function(){let i=u(n).index,p=d();return h(p.onOpenDialogVariant(i))})("onCheckBoxChange",function(e){let p=u(n).$implicit;return h(p.selected=e)}),l()()}if(o&2){let n=r.$implicit,t=d();c(1),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 Ce(o,r){o&1&&(v(0),a(1,"div",20),C(2,"app-empty-state"),l(),b())}function fe(o,r){if(o&1){let n=P();v(0),a(1,"div",21)(2,"div",22)(3,"app-custom-paginator",23),g("next",function(){u(n);let e=d();return h(e.onNextPage())})("previous",function(){u(n);let e=d();return h(e.onPrevPage())}),l()()(),b()}if(o&2){let n=d();c(3),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",!0)}}var oe=(()=>{let r=class r{constructor(t,e,i,p,f){this.http=t,this.toastr=e,this.dialog=i,this.productService=p,this.authService=f,this.searchFilter=new Z,this.products=[],this.rowCount=0,this.multipeScanChannels=[],this.getLoaderPage(),this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}getLoaderPage(){this.productService.LoadInPOS().subscribe(t=>{this.Categories=t.Options.Categories,this.searchFilter.PageNumber=t.Filter.PageNumber,this.searchFilter.RowCount=t.Filter.RowCount,this.searchFilter.ChannelID=null,this.searchFilter.Category=t.Filter.Category,this.searchFilter.PageSize=100,this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[z.Tokopedia,z.Tiktok])}getProducts(){let t={PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Category:this.searchFilter.Category,From:this.startDate,To:this.endDate};this.http.post("/api/product/GetInPOS",t).subscribe(e=>{this.products=e.Data,this.rowCount=e.Total==null?this.searchFilter.RowCount:e.Total.toString(),this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions)})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=_.GuidEMpty,this.dialog.open(D,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.Async,this.scanAllProduct()})}scanAllProduct(){if(this.searchFilter.ChannelID==null){this.toastr.error("Please Select Channel","Error");return}this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(t=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{this.getLoaderPage();let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,e,!this.searchFilter.UpdatedProduct)}})}onOpenDialogVariant(t){this.dialog.open(_t,{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)),J(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(p=>_.IsNotEmpty(p)),J(p=>this.productService.uploadSingleProduct([t],p))).subscribe({next:p=>{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,[z.Tokopedia,z.Tiktok]);this.dialog.open(D,{data:{filter:t,channelOptions:e,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(p=>_.IsNotEmpty(p))).subscribe(p=>{this.searchFilter.ChannelID=p.ChannelID,this.searchFilter.ScanFull=p.ScanFull,this.searchFilter.UpdatedProduct=p.UpdatedProduct;let f=this.productService.selectedProduct(this.products),w=this.productService.getVariantCodesProducts(f);this.scanSingleProduct(w)})}onScanSingleProduct(t){let e=JSON.parse(JSON.stringify(this.searchFilter));e.ChannelID=_.GuidEMpty,this.dialog.open(D,{data:{filter:e,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID;let p=this.productService.getVariantCodesProduct(t);this.scanSingleProduct(p)})}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(B),x(R),x(G),x(U),x(k))},r.\u0275cmp=M({type:r,selectors:[["app-in-pos"]],decls:22,vars:13,consts:[["description","All products which is already available in POS",3,"headerTitle","onSubmit"],[4,"ngIf"],[1,"fw-bold"],["appendTo","body","bindLabel","Name","name","Name","bindValue","Name","placeholder","Select Category",1,"center-text","mt-2",3,"clearable","items","ngModel","ngModelChange"],[1,"mt-5"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModel","ngModelChange","click"],["matEndDate","","placeholder","End date",3,"ngModel","ngModelChange","click"],["picker",""],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["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,"productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","onUpload","onScan","onDescEvent","onCheckBoxChange"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"filter","totaldata","paginationTotal","hasClicked","next","previous"]],template:function(e,i){if(e&1){let p=P();a(0,"mainpanel",0),g("onSubmit",function(w){return i.searchProduct(w)}),a(1,"actions"),S(2,ue,2,1,"ng-container",1)(3,he,4,1,"ng-container",1)(4,_e,4,1,"ng-container",1),l(),a(5,"filters")(6,"div")(7,"label",2),m(8,"Category"),l(),a(9,"ng-select",3),g("ngModelChange",function(w){return i.searchFilter.Category=w}),l()(),a(10,"div",4)(11,"mat-date-range-input",5)(12,"input",6),g("ngModelChange",function(w){return i.startDate=w})("click",function(){u(p);let w=L(15);return h(w.open())}),l(),a(13,"input",7),g("ngModelChange",function(w){return i.endDate=w})("click",function(){u(p);let w=L(15);return h(w.open())}),l()(),C(14,"mat-date-range-picker",null,8),l()(),a(16,"content")(17,"div",9)(18,"div",10),S(19,ge,2,10,"div",11)(20,Ce,3,0,"ng-container",1),l(),S(21,fe,4,4,"ng-container",1),l()()()}if(e&2){let p=L(15);s("headerTitle","In POS ("+i.rowCount+")"),c(2),s("ngIf",!i.productService.hasSelection(i.products)),c(1),s("ngIf",i.productService.hasSelection(i.products)&&i.multipeScanChannels.length>0),c(1),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("items",i.Categories)("ngModel",i.searchFilter.Category),c(2),s("rangePicker",p),c(1),s("ngModel",i.startDate),c(1),s("ngModel",i.endDate),c(6),s("ngForOf",i.products),c(1),s("ngIf",i.products.length==0),c(1),s("ngIf",i.products.length>0)}},dependencies:[N,E,et,$,j,V,H,K,Y,A,Yt,Zt,qt,Qt],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 Se(o,r){if(o&1){let n=P();v(0),a(1,"button",10),g("click",function(){u(n);let e=d();return h(e.onOpenScanDialog())}),C(2,"i",11),m(3," Scan Channel "),l(),b()}}function xe(o,r){if(o&1){let n=P();v(0),a(1,"button",12),g("click",function(){u(n);let e=d();return h(e.onScanMultipleProduct())}),C(2,"i",11),m(3),l(),b()}if(o&2){let n=d();c(3),I(" Scan (",n.productService.selectedProduct(n.products).length,") ")}}function Pe(o,r){if(o&1){let n=P();v(0),a(1,"button",13),g("click",function(){u(n);let e=d();return h(e.onUploadMultipleProduct())}),C(2,"i",14),m(3),l(),b()}if(o&2){let n=d();c(3),I(" Upload (",n.productService.selectedProduct(n.products).length,") ")}}function ve(o,r){if(o&1&&(a(0,"span",15),C(1,"img",16),l(),m(2)),o&2){let n=r.item,t=d();c(1),s("src",t.getChannelLogo(n.TypeID),O),c(1),I(" ",n.Name," ")}}function be(o,r){if(o&1){let n=P();a(0,"div",17)(1,"label",2),m(2,"Item ID"),l(),a(3,"input",18),g("ngModelChange",function(e){u(n);let i=d();return h(i.searchFilter.Item_id=e)}),l()()}if(o&2){let n=d();c(3),s("ngModel",n.searchFilter.Item_id)}}function Ie(o,r){if(o&1){let n=P();a(0,"div",19)(1,"app-product-card",20),g("onUpload",function(){let i=u(n).$implicit,p=d();return h(p.onUploadToMultipleChannel(i))})("onDescEvent",function(){let i=u(n).index,p=d();return h(p.onOpenVariantDetail(i))})("onScan",function(){let i=u(n).$implicit,p=d();return h(p.onScanSingleProduct(i))})("onCheckBoxChange",function(e){let p=u(n).$implicit;return h(p.selected=e)}),l()()}if(o&2){let n=r.$implicit,t=d();c(1),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 ye(o,r){o&1&&(v(0),a(1,"div",21),C(2,"app-empty-state"),l(),b())}function we(o,r){if(o&1){let n=P();a(0,"div",22)(1,"div",23)(2,"app-custom-paginator",24),g("total",function(){u(n);let e=d();return h(e.getRowCount())})("next",function(){u(n);let e=d();return h(e.onNextPage())})("previous",function(){u(n);let e=d();return h(e.onPreviousPage())}),l()()()}if(o&2){let n=d();c(2),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}var re=(()=>{let r=class r{constructor(t,e,i,p,f,w){this.http=t,this.dialog=e,this.toastr=i,this.productService=p,this.activateRouter=f,this.authService=w,this.searchFilter=new Z,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,[z.Tokopedia,z.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(_t,{data:{variants:e,title:this.products[t].Name},width:"800px"})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=_.GuidEMpty,this.dialog.open(D,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.Async,this.scanAllProduct()})}scanAllProduct(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).pipe(y(e=>e)).subscribe(e=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(e,t,!this.searchFilter.UpdatedProduct),this.initPageLoader(_.GuidEMpty))})}onScanSingleProduct(t){t.Channel=this.productService.getChannelProduct(t);let e=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(D,{data:{filter:e,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID;let p=this.productService.getVariantCodesProduct(t);this.scanProducts(p)})}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(p=>_.IsNotEmpty(p)),J(p=>this.productService.uploadSingleProduct([t],p))).subscribe({next:p=>{this.getProducts()}})}onScanMultipleProduct(){this.searchFilter.ChannelID=_.GuidEMpty;let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(D,{data:{filter:t,channelOptions:this.multipeScanChannels,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct;let p=this.productService.selectedProduct(this.products),f=this.productService.getVariantCodesProducts(p);this.scanProducts(f)})}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)),J(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()}getChannelLogo(t){return _.getChannelLogoByTypeId(t)}};r.\u0275fac=function(e){return new(e||r)(x(B),x(G),x(R),x(U),x(mt),x(k))},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,"headerTitle","onSubmit"],[4,"ngIf"],[1,"fw-bold"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text","mt-2",3,"clearable","multiple","items","ngModel","ngModelChange","clear"],["ng-option-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"],["alt","",2,"width","18px",3,"src"],[1,"mt-5"],["type","text","name","Item_id","id","Item_id",1,"form-control","mt-2",3,"ngModel","ngModelChange"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","onUpload","onDescEvent","onScan","onCheckBoxChange"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"filter","totaldata","paginationTotal","hasClicked","total","next","previous"]],template:function(e,i){e&1&&(a(0,"mainpanel",0),g("onSubmit",function(f){return i.searchProduct(f)}),a(1,"actions"),S(2,Se,4,0,"ng-container",1)(3,xe,4,1,"ng-container",1)(4,Pe,4,1,"ng-container",1),l(),a(5,"filters")(6,"div")(7,"label",2),m(8,"Channel"),l(),a(9,"ng-select",3),g("ngModelChange",function(f){return i.searchFilter.ListChannelID=f})("clear",function(){return i.onClearFilterChannel()}),S(10,ve,3,2,"ng-template",4),l()(),S(11,be,4,1,"div",5),l(),a(12,"content")(13,"div",6)(14,"div",7),S(15,Ie,2,10,"div",8)(16,ye,3,0,"ng-container",1),l(),S(17,we,3,4,"div",9),l()()()),e&2&&(s("headerTitle","Sold in Channel"),c(2),s("ngIf",!i.productService.hasSelection(i.products)),c(1),s("ngIf",i.multipeScanChannels.length>0&&i.productService.hasSelection(i.products)),c(1),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(1),s("ngIf",i.products.length==0),c(1),s("ngIf",i.products==null?null:i.products.length))},dependencies:[N,E,et,$,j,V,H,nt,K,Y,A],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]});let o=r;return o})();function Oe(o,r){if(o&1){let n=P();a(0,"button",10),g("click",function(){u(n);let e=d(2);return h(e.uploadMultipleProduct())}),C(1,"i",11),m(2),l()}if(o&2){let n=d(2);c(2),I(" upload (",n.selectedProducts==null?null:n.selectedProducts.length,") ")}}function Fe(o,r){if(o&1){let n=P();v(0),a(1,"td",26)(2,"input",27),g("ngModelChange",function(e){u(n);let i=d(2).$implicit;return h(i.selected=e)})("ngModelChange",function(){u(n);let e=d(3).ngIf,i=d(3);return h(i.onSelectProduct(e))}),l()(),b()}if(o&2){let n=d(2).$implicit;c(1),s("rowSpan",n==null?null:n.Variants.length),c(1),s("ngModel",n.selected)}}function De(o,r){if(o&1){let n=P();v(0),a(1,"img",33),g("click",function(e){u(n);let i=d(3).$implicit,p=d(4);return h(p.onZoomImage(e,i==null?null:i.ImageUrl))}),l(),b()}if(o&2){let n=d(3).$implicit;c(1),s("src",n==null?null:n.ImageUrl,O)}}function Te(o,r){o&1&&C(0,"img",34)}function Ne(o,r){if(o&1&&(v(0),a(1,"td",26)(2,"div",28),S(3,De,2,1,"ng-container",7)(4,Te,1,0,"ng-template",null,29,tt),l()(),a(6,"td",30)(7,"h4",31)(8,"span",32),m(9),l()()(),b()),o&2){let n=L(5),t=d(2).$implicit;c(1),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(1),I(" ",t==null?null:t.Name," ")}}function Ee(o,r){if(o&1&&(a(0,"div")(1,"a",22),C(2,"img",35),l()()),o&2){let n=r.$implicit;c(1),s("href",n.URL,O),c(1),s("src",n.Img,O)("matTooltip",n.Name)}}function ke(o,r){if(o&1&&(a(0,"div"),C(1,"img",35),l()),o&2){let n=r.$implicit;c(1),s("src",n.Img,O)("matTooltip",n.Name)}}function Ve(o,r){if(o&1&&(a(0,"tr"),S(1,Fe,3,2,"ng-container",9)(2,Ne,10,6,"ng-container",9),a(3,"td"),m(4),l(),a(5,"td")(6,"span"),m(7),l(),a(8,"span",21)(9,"a",22),C(10,"i",23),l()()(),a(11,"td",24)(12,"div",25),S(13,Ee,3,3,"div",20),l()(),a(14,"td",24)(15,"div",25),S(16,ke,2,2,"div",20),l()()()),o&2){let n=r.$implicit,t=r.index,e=d(5);c(1),s("ngIf",t==0),c(1),s("ngIf",t==0),c(2),I(" ",n.Name," "),c(3),I(" ",n.Code," "),c(2),s("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),O),c(4),s("ngForOf",n==null?null:n.Available),c(3),s("ngForOf",n==null?null:n.NotAvailable)}}function Ue(o,r){if(o&1&&(v(0),S(1,Ve,17,7,"tr",20),b()),o&2){let n=r.$implicit;c(1),s("ngForOf",n.Variants)}}function Ae(o,r){if(o&1&&(a(0,"tbody"),S(1,Ue,2,1,"ng-container",20),l()),o&2){let n=r.ngIf;c(1),s("ngForOf",n)}}function Le(o,r){if(o&1&&(v(0),a(1,"div",12)(2,"table",13)(3,"thead",14)(4,"tr"),C(5,"th",15),a(6,"th",16),m(7,"Product"),l(),a(8,"th",17),m(9,"Variant"),l(),a(10,"th",17),m(11,"SKU"),l(),a(12,"th",18),m(13,"Available In"),l(),a(14,"th",19),m(15,"Not Available In"),l()()(),S(16,Ae,2,1,"tbody",9),F(17,"async"),l()(),b()),o&2){let n=d(2);c(16),s("ngIf",T(17,1,n.data$))}}function Re(o,r){o&1&&(a(0,"div",36),C(1,"app-empty-state"),l())}function Be(o,r){if(o&1){let n=P();a(0,"span",44),g("click",function(){u(n);let e=d(4);return h(e.getRowCount())}),a(1,"i",45),m(2,"?"),l()()}}function $e(o,r){if(o&1&&(a(0,"span"),m(1),F(2,"number"),l()),o&2){let n=r.ngIf;c(1),st(T(2,1,n==null?null:n.Count))}}function je(o,r){if(o&1){let n=P();a(0,"a",46),g("click",function(){u(n);let e=d(4);return h(e.onNextPage())}),C(1,"i",47),m(2," Next"),l()}}function Ge(o,r){if(o&1){let n=P();a(0,"a",48),g("click",function(){u(n);let e=d(4);return h(e.onLastPage())}),C(1,"i",49),m(2," Last"),l()}}function Ke(o,r){if(o&1&&(v(0),a(1,"div",37)(2,"div",38)(3,"div",39),m(4),F(5,"number"),S(6,Be,3,0,"span",40)(7,$e,3,3,"span",9),F(8,"async"),m(9),l()(),a(10,"div",41),S(11,je,3,0,"a",42)(12,Ge,3,0,"a",43),l()(),b()),o&2){let n=d().ngIf,t=d(2);c(4),I(" Showing 1 - ",T(5,6,n==null?null:n.length)," of "),c(2),s("ngIf",t.paginationService.hideCount),c(1),s("ngIf",!t.paginationService.hideCount&&T(8,8,t.rowCount$)),c(2),I(" records ~ ",t.paginationService.footerPageNumber," Page "),c(2),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),c(1),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}function Je(o,r){if(o&1&&(v(0),S(1,Ke,13,10,"ng-container",9),b()),o&2){let n=r.ngIf;c(1),s("ngIf",(n==null?null:n.length)>0)}}function ze(o,r){if(o&1){let n=P();a(0,"mainpanel",1),g("onSubmit",function(e){u(n);let i=d();return h(i.searchProduct(e))}),a(1,"actions"),S(2,Oe,3,1,"button",2),a(3,"button",3),g("click",function(){u(n);let e=d();return h(e.openScanDialog())}),C(4,"i",4),m(5," Scan Channel "),l()(),a(6,"content")(7,"div",5)(8,"div",6),S(9,Le,18,3,"ng-container",7),F(10,"async"),S(11,Re,2,0,"ng-template",null,8,tt),l(),S(13,Je,2,1,"ng-container",9),F(14,"async"),l()()()}if(o&2){let n=L(12),t=d(),e;s("hideSearchDropdown",!0),c(2),s("ngIf",t.hasSelectionProduct),c(7),s("ngIf",((e=T(10,5,t.data$))==null?null:e.length)>0)("ngIfElse",n),c(4),s("ngIf",T(14,7,t.data$))}}var ae=(()=>{let r=class r{constructor(t,e,i,p,f,w,yt){this.http=t,this.dialog=e,this.toastr=i,this.productService=p,this.paginationService=f,this.biggerPictureService=w,this.authService=yt,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannelV2",this.hasSelectionProduct=!1,this.selectedProducts=[],this.channelOptions=yt.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(Ot(t=>{this.filterSearch=t.Filter,this.paginationService.reloadPagination(t.Filter)}))}iniData(){this.data$=this.paginationService.data$.pipe(Mt(t=>(t=t.map(e=>(e.Variants=e.Variants.map(i=>(i.Available=this.productService.sortChannel(i.Available),i.NotAvailable=this.productService.sortChannel(i.NotAvailable),i.Available=this.assignLogoChannel(i.Available),i.NotAvailable=this.assignLogoChannel(i.NotAvailable),i)),e)),t)))}assignLogoChannel(t){return t=t.map(e=>(e.Img=_.getChannelLogoByTypeId(e.TypeID),e)),t}searchProduct(t){this.filterSearch.text=t,this.paginationService.reloadPagination(this.filterSearch)}scanAllProduct(){let t=this.productService.findChannelById(this.filterSearch.ChannelID,this.channelOptions);this.productService.scanAll(this.filterSearch.ChannelID,this.filterSearch.ScanFull,this.filterSearch.UpdatedProduct,this.filterSearch.Async).subscribe(e=>{this.filterSearch.Async?this.toastr.success("You will be notified when the scan is completed.","Scan Asynchronous"):(this.productService.successToastrScanAllProduct(e,t,!this.filterSearch.UpdatedProduct),this.initPageLoader())})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.filterSearch));t.ChannelID=_.GuidEMpty,this.dialog.open(D,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.filterSearch.ChannelID=i.ChannelID,this.filterSearch.ScanFull=i.ScanFull,this.filterSearch.UpdatedProduct=i.UpdatedProduct,this.filterSearch.Async=i.Async,this.scanAllProduct()})}getRowCount(){this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`/api/${this.rowCountAPI}`,this.filterSearch)}onNextPage(){this.paginationService.onNextPage(this.filterSearch)}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:t=>{this.filterSearch.PageNumber=1,this.paginationService.getAllData(this.filterSearch,t.Count)}})}onZoomImage(t,e){this.biggerPictureService.openBiggerPicture(t,e)}onSelectProduct(t){this.hasSelectionProduct=this.productService.hasSelection(t),this.selectedProducts=this.productService.selectedProduct(t)}uploadMultipleProduct(){let t=this.getUniqueChannels();t=t.map(e=>(e.ID=e.ChannelID,e)),this.dialog.open(q,{width:"700px",data:{title:"Upload Multiple Product",channels:t}}).afterClosed().pipe(y(e=>_.IsNotEmpty(e)),J(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,p)=>p.findIndex(f=>f.ChannelID==e.ChannelID)==i),t}ngOnDestroy(){this.paginationService.destroy()}};r.\u0275fac=function(e){return new(e||r)(x(B),x(G),x(R),x(U),x(Xt),x(Ht),x(k))},r.\u0275cmp=M({type:r,selectors:[["app-not-in-channel"]],decls:2,vars:3,consts:[["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"hideSearchDropdown","onSubmit",4,"ngIf"],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"hideSearchDropdown","onSubmit"],["class","btn btn-light shadow rounded ms-2",3,"click",4,"ngIf"],["data-cy","scanNotinChannel","type","button",1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"container-fluid","mt-3"],[1,"row"],[4,"ngIf","ngIfElse"],["EMPTY",""],[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,"ngModel","ngModelChange"],[2,"padding-right","0px"],["elsePic",""],[1,"text-start",3,"rowSpan"],[1,"ms-5","fw-normal","text-ellipsis",2,"max-width","26vw !important"],[3,"matTooltip"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],["alt","",1,"channel-logo","cursor-pointer","ms-4","mt-3",3,"src","matTooltip"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(e,i){e&1&&(S(0,ze,15,9,"mainpanel",0),F(1,"async")),e&2&&s("ngIf",T(1,1,i.loader$))},dependencies:[N,E,Ut,$,j,V,ht,A,pt,dt],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})();function He(o,r){if(o&1){let n=P();a(0,"button",14),g("click",function(){u(n);let e=d();return h(e.openScanDialog())}),C(1,"i",15),m(2," Scan Channel "),l()}}function Ze(o,r){if(o&1){let n=P();v(0),a(1,"button",16),g("click",function(){u(n);let e=d();return h(e.onDownloadAllProduct("SELECTED"))}),C(2,"i",17),m(3),l(),b()}if(o&2){let n=d(),t;c(3),I(" Download (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function qe(o,r){if(o&1&&(a(0,"span",18),C(1,"img",19),l(),m(2)),o&2){let n=r.item,t=d();c(1),s("src",t.getChannelLogo(n.TypeID),O),c(1),I(" ",n.Name," ")}}var Ye=o=>[o],Qe=()=>[];function We(o,r){if(o&1){let n=P();a(0,"div",20)(1,"app-product-card",21),g("onCheckBoxChange",function(e){let p=u(n).index,f=d();return h(f.onSelectProduct(e,p))})("onDescEvent",function(){let i=u(n).index,p=d();return h(p.onShowVariantDetail(i))})("onDownload",function(){let i=u(n).$implicit,p=d();return h(p.onDownloadProduct(i))})("onScan",function(){let i=u(n).$implicit,p=d();return h(p.onScanChannel(i))}),l()()}if(o&2){let n=r.$implicit;c(1),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?it(10,Ye,n==null?null:n.Channel):Q(12,Qe))("showCheckBox",!0)("scanButton",!0)}}function Xe(o,r){o&1&&(v(0),a(1,"div",22),C(2,"app-empty-state"),l(),b())}function tn(o,r){if(o&1){let n=P();a(0,"div",23)(1,"div",24)(2,"app-custom-paginator",25),g("total",function(){u(n);let e=d();return h(e.getRowCount())})("next",function(){u(n);let e=d();return h(e.onNextPage())})("previous",function(){u(n);let e=d();return h(e.onPreviousPage())}),l()()()}if(o&2){let n=d();c(2),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}var le=(()=>{let r=class r{constructor(t,e,i,p,f,w){this.http=t,this.dialog=e,this.productService=i,this.toastrService=p,this.activateRouter=f,this.authService=w,this.searchFilter=new Z,this.products=[],this.hasClickRowCount=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(_.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(e=>{this.searchFilter=e.Filter,this.searchFilter.PageSize=e.Filter.RowCount,this.getProducts()})}getProducts(){this.http.post("/api/product/GetProductChannelNotPOS",this.searchFilter).subscribe(t=>{this.products=t.Data,this.mapChannelToProduct(),this.setSkuProduct()})}mapChannelToProduct(){let t;this.products=this.products.map(e=>(t=this.channelOptions.find(i=>i.ID==e.ChannelID),t?e.Channel=JSON.parse(JSON.stringify(t)):e.Channel=null,e)).map(e=>(e.Channel&&(e.Channel.Url=e.Url),e))}setSkuProduct(){this.products=this.products.map(t=>(t?.Variant?.length==0?_.IsNotEmpty(t?.ChannelItemSKU)?t.SKU=t?.ChannelItemSKU:t.SKU="SKU not assigned":t.SKU=t?.Variant[0]?.ChannelVariationSKU?t?.Variant[0]?.ChannelVariationSKU:"SKU not assigned",t))}onSearch(t){this.searchFilter.text=t,this.hasClickRowCount=!1,this.getProducts()}onClearChannelFilter(){this.searchFilter.ChannelID=_.GuidEMpty}onScanAll(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(e=>{this.searchFilter.Async?this.toastrService.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.initPageLoader(_.GuidEMpty),this.productService.successToastrScanAllProduct(e,t,!this.searchFilter.UpdatedProduct)),this.searchFilter.ChannelID=_.GuidEMpty})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=_.GuidEMpty,this.dialog.open(D,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>_.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.Async=i.Async,this.onScanAll()})}onDownloadAllProduct(t){let e;t=="ALL"?e=this.products:e=this.productService.selectedProduct(this.products),e.length>0&&this.productService.downloadMultipleProduct(e).subscribe({next:()=>{this.getProducts()}})}onSelectProduct(t,e){this.products[e].selected=t}onDownloadProduct(t){confirm(`Are you sure you want to Retrieve product ${t?.Name} from ${t?.Channel.Name} to POS?`)&&this.productService.downloadProduct(t).subscribe({next:()=>{this.getProducts()}})}onScanChannel(t){let e=JSON.parse(JSON.stringify(t));delete e.Channel,this.productService.scanCompareToPos([e]).subscribe(i=>{i.Status?(this.initPageLoader(_.GuidEMpty),this.toastrService.success(`product ${t.Name} have been successfully scanned and synchronized with POS`,"Success")):this.toastrService.error(`Product ${t.Name} is not existed in POS`,"Error")})}onShowVariantDetail(t){let e=this.products[t].Variant;e.length>0&&this.dialog.open(te,{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()}getChannelLogo(t){return _.getChannelLogoByTypeId(t)}};r.\u0275fac=function(e){return new(e||r)(x(B),x(G),x(U),x(R),x(mt),x(k))},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"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text","mt-2",3,"clearable","items","ngModel","ngModelChange","clear"],["ng-option-tmp",""],[1,"mt-5"],["name","haveSKU",1,"form-control","h-100","pt-3","rounded","mt-2",3,"ngModel","ngModelChange"],[1,"me-5",3,"value"],["type","text","name","Item_id","id","Item_id","placeholder","item id",1,"form-control","mt-2",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button","data-cy","scanNotInPos",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","ms-3",3,"click"],[1,"fa","fa-download"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"showRedirectIcon","title","image","imageForZoom","code","description","downloadButton","channels","showCheckBox","scanButton","onCheckBoxChange","onDescEvent","onDownload","onScan"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"filter","totaldata","paginationTotal","hasClicked","total","next","previous"]],template:function(e,i){e&1&&(a(0,"mainpanel",0),g("onSubmit",function(f){return i.onSearch(f)}),a(1,"actions"),S(2,He,3,0,"button",1)(3,Ze,4,1,"ng-container",2),l(),a(4,"filters")(5,"div")(6,"label",3),m(7,"Channel"),l(),a(8,"ng-select",4),g("ngModelChange",function(f){return i.searchFilter.ChannelID=f})("clear",function(){return i.onClearChannelFilter()}),S(9,qe,3,2,"ng-template",5),l()(),a(10,"div",6)(11,"label",3),m(12,"SKU Assigned"),l(),a(13,"mat-radio-group",7),g("ngModelChange",function(f){return i.searchFilter.HaveSku=f}),a(14,"mat-radio-button",8),m(15," All "),l(),a(16,"mat-radio-button",8),m(17," Yes "),l(),a(18,"mat-radio-button",8),m(19," No "),l()()(),a(20,"div",6)(21,"label",3),m(22,"Item ID"),l(),a(23,"input",9),g("ngModelChange",function(f){return i.searchFilter.Item_id=f}),l()()(),a(24,"content")(25,"div",10)(26,"div",11),S(27,We,2,13,"div",12)(28,Xe,3,0,"ng-container",2),l(),S(29,tn,3,4,"div",13),l()()()),e&2&&(c(2),s("ngIf",!i.productService.hasSelection(i.products)),c(1),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("items",i.channelOptions)("ngModel",i.searchFilter.ChannelID),c(5),s("ngModel",i.searchFilter.HaveSku),c(1),s("value",0),c(2),s("value",1),c(2),s("value",2),c(5),s("ngModel",i.searchFilter.Item_id),c(4),s("ngForOf",i.products),c(1),s("ngIf",i.products.length==0),c(1),s("ngIf",(i.products==null?null:i.products.length)>0))},dependencies:[N,E,et,$,j,V,H,nt,Kt,Jt,K,Y,A],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 en(o,r){if(o&1&&(a(0,"span",8),C(1,"img",9),l(),m(2)),o&2){let n=r.item,t=d();c(1),s("src",t.getChannelLogo(n.TypeID),O),c(1),I(" ",n.Name," ")}}function nn(o,r){if(o&1&&(a(0,"div",10),C(1,"app-duplicate-product-card",11),l()),o&2){let n=r.$implicit,t=r.index;c(1),s("imageForZoom",n.ImageUrl)("title",n.Name)("code",n.Code)("id",t)("image",n.ThumbnailURL)("channels",n.Channels)}}function on(o,r){o&1&&(v(0),a(1,"div",12),C(2,"app-empty-state"),l(),b())}function rn(o,r){if(o&1){let n=P();v(0),a(1,"div",13)(2,"div",14)(3,"app-custom-paginator",15),g("next",function(){u(n);let e=d();return h(e.onNextPage())})("previous",function(){u(n);let e=d();return h(e.onPrevPage())})("total",function(){u(n);let e=d();return h(e.getRowCount())}),l()()(),b()}if(o&2){let n=d();c(3),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickedRowCount)}}var ce=(()=>{let r=class r{constructor(t,e,i){this.httpService=t,this.productService=e,this.authService=i,this.searchFilter=new Z,this.products=[],this.hasClickedRowCount=!1,this.getPageLoader(),this.channelOptions=i.getChannels()}getPageLoader(){this.productService.loader().subscribe(t=>{this.searchFilter=t.Filter,this.searchFilter.PageSize=t.Filter.RowCount,this.getProducts()})}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,RowCount:this.searchFilter.RowCount,PageNumber:this.searchFilter.PageNumber,text:this.searchFilter.text};this.httpService.post("/api/product/GetDuplicateInChannel",t).subscribe(e=>{this.products=e.Data})}onSearch(t){this.searchFilter.text=t,this.hasClickedRowCount=!1,this.getProducts()}onClearFilter(){this.searchFilter.ChannelID=_.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(B),x(U),x(k))},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",""],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text","mt-2",3,"multiple","clearable","items","ngModel","ngModelChange","clear"],["ng-option-tmp",""],[1,"container-fluid"],[1,"row","mt-8","mx-1"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"imageForZoom","title","code","id","image","channels"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"filter","totaldata","paginationTotal","hasClicked","next","previous","total"]],template:function(e,i){e&1&&(a(0,"mainpanel",0),g("onSubmit",function(f){return i.onSearch(f)}),a(1,"filters")(2,"div",1)(3,"div")(4,"h6"),m(5,"Channel"),l(),a(6,"ng-select",2),g("ngModelChange",function(f){return i.searchFilter.ListChannelID=f})("clear",function(){return i.onClearFilter()}),S(7,en,3,2,"ng-template",3),l()()()(),a(8,"content")(9,"div",4)(10,"div",5),S(11,nn,2,6,"div",6)(12,on,3,0,"ng-container",7),l(),S(13,rn,4,4,"ng-container",7),l()()()),e&2&&(c(6),s("multiple",!0)("clearable",!0)("items",i.channelOptions)("ngModel",i.searchFilter.ListChannelID),c(5),s("ngForOf",i.products),c(1),s("ngIf",(i.products==null?null:i.products.length)==0),c(1),s("ngIf",(i.products==null?null:i.products.length)>0))},dependencies:[N,E,$,j,V,H,nt,gt,K,A]});let o=r;return o})();function an(o,r){if(o&1&&(v(0),m(1),b()),o&2){let n=d().$implicit;c(1),I(" ",n.Count," ")}}function ln(o,r){if(o&1){let n=P();a(0,"span",26),g("click",function(){u(n);let e=d().$implicit,i=d(2);return h(i.getLiveProductCount(e.ID,e))}),C(1,"i",27),l()}}var cn=()=>["/menu/products/status/sold-in-channel"],se=o=>({ID:o}),sn=()=>["/menu/products/status/not-in-pos"];function pn(o,r){if(o&1){let n=P();a(0,"tr")(1,"td"),C(2,"img",16),a(3,"span",17),m(4),l()(),a(5,"td",18),S(6,an,2,1,"ng-container",4)(7,ln,2,0,"ng-template",null,19,tt),l(),a(9,"td",18)(10,"a",20),m(11),F(12,"number"),l()(),a(13,"td",18)(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),g("click",function(){let i=u(n).$implicit,p=d(2);return h(p.onScanChannel(i))}),C(23,"i",23),m(24," Scan "),l(),a(25,"button",24),g("click",function(){let i=u(n).$implicit,p=d(2);return h(p.onClearCache(i.ID))}),C(26,"i",25),m(27," Clear "),l()()()()}if(o&2){let n=r.$implicit,t=L(8),e=d(2);c(2),s("src",e.getChannelLogo(n.TypeID),O),c(2),st(n.Name),c(2),s("ngIf",n.Count!==void 0)("ngIfElse",t),c(4),s("routerLink",Q(18,cn))("queryParams",it(19,se,n.ID)),c(1),I(" ",T(12,11,n.SoldInChannel)," "),c(3),s("routerLink",Q(21,sn))("queryParams",it(22,se,n.ID)),c(1),I(" ",T(16,13,n.NotInPOS)," "),c(3),I("",n.LastSync?Tt(19,15,n.LastSync,"dd MMM yyyy HH:mm"):"-"," ")}}function dn(o,r){if(o&1&&(v(0),a(1,"div",6)(2,"table",7)(3,"thead",8)(4,"tr",9)(5,"th"),m(6,"Channel"),l(),a(7,"th",10),m(8,"Live Product"),l(),a(9,"th",11),m(10,"Sold In Channel"),l(),a(11,"th",12),m(12,"Product Not in POS"),l(),a(13,"th",13),m(14,"Last Sync"),l(),C(15,"th",14),l()(),a(16,"tbody"),S(17,pn,28,24,"tr",15),F(18,"async"),l()()(),b()),o&2){let n=d(),t;c(17),s("ngForOf",(t=T(18,1,n.channels$))==null?null:t.Data)}}function mn(o,r){o&1&&(a(0,"div",28),C(1,"app-empty-state"),l())}var pe=(()=>{let r=class r{constructor(t,e,i,p){this.productService=t,this.toastr=e,this.dialog=i,this.authService=p,this.destroy$=new wt,this.channelOptions=p.getChannels()}ngOnInit(){this.setObsProductStatistic()}setObsProductStatistic(){this.channels$=this.productService.getProductStatistic()}getLiveProductCount(t,e){this.productService.getTotalProductLive(t).pipe(Pt(this.destroy$)).subscribe(i=>{e.Count=i.Count})}onScanChannel(t){this.dialog.open(D,{width:"700px",data:{channelOptions:this.channelOptions,filter:{ChannelID:t.ID},disabledChannelOption:!0}}).afterClosed().pipe(y(e=>_.IsNotEmpty(e))).subscribe(e=>{this.scanAllProduct(t.ID,e)})}scanAllProduct(t,e){let i=this.productService.findChannelById(t,this.channelOptions);this.productService.scanAll(e.ChannelID,e.ScanFull,e.UpdatedProduct,e.Async).pipe(y(p=>p)).subscribe(p=>{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(p,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(Pt(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(U),x(R),x(G),x(k))},r.\u0275cmp=M({type:r,selectors:[["app-channel-statistic"]],decls:9,vars:6,consts:[["headerTitle","Products Statistic",3,"hideSearchBox","hideSearchDropdown"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],["EMPTY",""],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[1,"text-center",2,"width","13rem"],[1,"text-center",2,"width","9rem"],[1,"text-center",2,"width","14rem"],[2,"width","10rem"],[2,"width","12rem"],[4,"ngFor","ngForOf"],[2,"width","24px","height","24px",3,"src"],[1,"ms-3"],[1,"text-center"],["QUESTION",""],[3,"routerLink","queryParams"],[1,"d-flex","align-items-center","justify-content-center"],[1,"btn","btn-sm","btn-secondary","fs-6",3,"click"],[1,"fa","fa-spinner"],[1,"btn","btn-sm","btn-secondary","fs-6","ms-3",3,"click"],[1,"fa","fa-trash"],["matTooltip","Click to see total live product",1,"cursor-pointer","fs-5","text-primary",3,"click"],[1,"fa-solid","fa-circle-question","cursor"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(e,i){if(e&1&&(a(0,"mainpanel",0)(1,"content")(2,"div",1)(3,"div",2)(4,"div",3),S(5,dn,19,3,"ng-container",4),F(6,"async"),S(7,mn,2,0,"ng-template",null,5,tt),l()()()()()),e&2){let p=L(8),f;s("hideSearchBox",!0)("hideSearchDropdown",!0),c(5),s("ngIf",((f=T(6,4,i.channels$))==null||f.Data==null?null:f.Data.length)>0)("ngIfElse",p)}},dependencies:[N,E,V,ht,ut,A,pt,dt,Nt]});let o=r;return o})();var un=[{component:ne,path:"",children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:oe,canActivate:[W],data:{title:"Products in POS"}},{path:"sold-in-channel",component:re,canActivate:[W],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:ae,canActivate:[W],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:le,canActivate:[W],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:ce,canActivate:[W],data:{title:"Duplicate Sku in Channel"}},{path:"channel-statistic",component:pe,canActivate:[W],data:{title:"Channel Statistic"}}]}],yi=(()=>{let r=class r{};r.\u0275fac=function(e){return new(e||r)},r.\u0275mod=Dt({type:r}),r.\u0275inj=Ft({imports:[Et,At,$t,Bt,Lt,ee,zt,Gt,gt,K,Y,Vt.forChild(un),Wt,Rt]});let o=r;return o})();export{yi as StatusModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as j,b as G}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.
|
|
1
|
+
import{a as j,b as G}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-X6UUIC3F.js";import{a as z}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-S5TAVCV2.js";import{g as H}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-FZ3LLUFV.js";import{A as B,q as A,s as V,t as R,z as L}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-R4XC3TIR.js";import{_ as k}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-H4UMXVLS.js";import{h as N,k as F}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-7QIOC7BK.js";import{b as d,c as h}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-MKDJJ5L7.js";import{$a as D,Cb as O,Eb as w,Fa as n,Ga as _,Ic as x,Oa as o,Ua as v,Za as l,Zb as E,_a as s,_b as P,cc as U,db as y,ea as b,hb as u,ja as C,jb as c,ka as g,pb as p,qb as M,rb as T,za as I}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-DJCANNYC.js";function W(r,m){if(r&1&&(l(0,"mat-option",9)(1,"div",10),D(2,"img",11),l(3,"span"),p(4),s()()()),r&2){let t=m.$implicit;o("value",t.ID)("disabled",t.disabled),n(1),o("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),n(1),o("src",t.Img,I),n(2),M(t.Name)}}function J(r,m){if(r&1){let t=y();l(0,"div",12)(1,"label",13),p(2,"Scan Type"),s(),l(3,"mat-radio-group",14),u("ngModelChange",function(a){C(t);let e=c();return g(e.filter.ScanFull=a)}),l(4,"mat-radio-button",15),p(5," Full (Include Inactive Products) "),s(),l(6,"mat-radio-button",16),p(7," Active "),s()()()}if(r&2){let t=c();n(3),o("ngModel",t.filter.ScanFull),n(1),o("value",!0),n(2),o("value",!1)}}function K(r,m){if(r&1){let t=y();l(0,"div",17)(1,"label",3),p(2),O(3,"date"),s(),l(4,"mat-radio-group",18),u("ngModelChange",function(a){C(t);let e=c();return g(e.filter.UpdatedProduct=a)}),l(5,"mat-radio-button",19),p(6," Scan All Products "),s(),l(7,"mat-radio-button",20),p(8),s()()()}if(r&2){let t=c();n(2),T(" Last Scan: ",w(3,6,t.selectedChannel.LastSync,"dd MMMM yyyy HH:mm")," "),n(2),o("ngModel",t.filter.UpdatedProduct),n(1),o("value",!1),n(2),o("value",!0)("matTooltip",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Use Tokopedia URL for mapping SKU between POS and Tokopedia":"Scan only products that have been updated since the last channel scan"),n(1),T(" ",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Product Download By URL":"Scan Updated Products"," ")}}function $(r,m){if(r&1){let t=y();l(0,"div",17)(1,"label",3),p(2," Scan Option "),s(),l(3,"mat-radio-group",21),u("ngModelChange",function(a){C(t);let e=c();return g(e.filter.Async=a)}),l(4,"mat-radio-button",22),p(5," Asynchronous (Get Notified when Complete) "),s(),l(6,"mat-radio-button",23),p(7," Synchronous (Wait until Complete) "),s()()()}if(r&2){let t=c();n(3),o("ngModel",t.filter.Async),n(1),o("value",!0),n(2),o("value",!1)}}var pe=(()=>{let m=class m{constructor(i,a,e){this.dialogRef=i,this.data=a,this.router=e,this.channelType=d,this.disabledChannelOption=!1,this.filter={ChannelID:h.GuidEMpty,ScanFull:!0,UpdatedProduct:!1,Async:!1},this.isSingleChannel=h.IsNotEmpty(a.isSingleChannel)?this.data.isSingleChannel:!1,this.disabledChannelOption=h.IsEmpty(a.disabledChannelOption)?!1:this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new L,this.modalConfig.title="Scan Marketplace",this.modalConfig.bodyScrollable=!0}initFilter(){this.filter.ChannelID=this.data?.filter?.ChannelID,this.filter.ScanFull=!1}initChannelOptions(){this.channelOptions=JSON.parse(JSON.stringify(this.data.channelOptions)),this.isSingleChannel&&(this.channelOptions=this.channelOptions.map(i=>(i.disabled=!0,(i.TypeID==d.Tiktok||i.TypeID==d.Tokopedia||i.TypeID==d.Lazada||i.TypeID==d.WooCommerce)&&(i.disabled=!1),i)).sort(i=>i.disabled?1:-1))}onSelectChannel(i){let a=this.filterChannelById(i);this.selectedChannel=a,this.filter.Async=!0,this.iniHasScanUpdate(),this.setDefaultConfigUpdate()}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&h.IsNotEmpty(this.selectedChannel.LastSync)&&(this.selectedChannel.TypeID==d.ShopeeV2||this.selectedChannel.TypeID==d.Tiktok||this.selectedChannel.TypeID==d.Lazada)&&(this.filter.UpdatedProduct=!0)}iniHasScanUpdate(){this.selectedChannel?.TypeID!=d.WooCommerce&&this.selectedChannel?.TypeID!=d.KalCare&&this.selectedChannel?.TypeID!=d.None&&h.IsNotEmpty(this.selectedChannel?.LastSync)&&!this.isSingleChannel?this.hasScanUpdate=!0:this.hasScanUpdate=!1}filterChannelById(i){let a;return this.channelOptions&&(a=this.channelOptions.find(e=>e.ID==i)),a}submit(){this.selectedChannel.TypeID==d.Tokopedia&&this.filter.UpdatedProduct?this.router.navigate(["/menu/products/download/by-url"]).then(()=>{this.dialogRef.close()}):(this.beforeSubmit(),this.dialogRef.close(this.filter))}beforeSubmit(){this.filter.UpdatedProduct&&(this.filter.Async=!1)}isNotEmpty(i){return h.IsNotEmpty(i)}onClose(){this.dialogRef.close()}};m.\u0275fac=function(a){return new(a||m)(_(V),_(R),_(x))},m.\u0275cmp=b({type:m,selectors:[["app-scan-dialog"]],decls:11,vars:8,consts:[[3,"dynamicValidated","config","onOk","onClose","onCancel"],["content",""],[1,"mx-4"],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"disabled","ngModel","ngModelChange"],["class","channel-option",3,"value","disabled",4,"ngFor","ngForOf"],["class","mt-4",4,"ngIf"],["class","mt-8",4,"ngIf"],[1,"channel-option",3,"value","disabled"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],[2,"width","18px","margin-right","10px",3,"src"],[1,"mt-4"],[1,"mb-2","fw-bold","mt-3"],["name","scanType",1,"form-control","h-100","round",3,"ngModel","ngModelChange"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Full Scan Product",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Only Active Product",1,"me-5",3,"value"],[1,"mt-8"],["name","ScanFull",1,"form-control","h-100","round",2,"line-height","2",3,"ngModel","ngModelChange"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Scan product from beginning ( use this if you haven't scanned at all)",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above",1,"me-5",3,"value","matTooltip"],["name","Async",1,"form-control","h-100","round",2,"line-height","2",3,"ngModel","ngModelChange"],["matTooltipClass","custom-width-tooltip","matTooltip","Scan is running in the background, status will be visible in the notification menu","matTooltipPosition","above",1,"me-5",3,"value"],[1,"me-5",3,"value"]],template:function(a,e){a&1&&(l(0,"modal-material",0),u("onOk",function(){return e.submit()})("onClose",function(){return e.onClose()})("onCancel",function(){return e.onClose()}),l(1,"div",1)(2,"div",2)(3,"label",3),p(4,"Select a Channel"),s(),l(5,"mat-form-field",4)(6,"mat-select",5),u("ngModelChange",function(S){return e.filter.ChannelID=S})("ngModelChange",function(S){return e.onSelectChannel(S)}),v(7,W,5,5,"mat-option",6),s()(),v(8,J,8,3,"div",7)(9,K,9,9,"div",8)(10,$,8,3,"div",8),s()()()),a&2&&(o("dynamicValidated",e.isNotEmpty(e.filter.ChannelID))("config",e.modalConfig),n(6),o("disabled",e.disabledChannelOption)("ngModel",e.filter.ChannelID),n(1),o("ngForOf",e.channelOptions),n(1),o("ngIf",!e.isSingleChannel&&e.isNotEmpty(e.filter.ChannelID)),n(1),o("ngIf",e.hasScanUpdate),n(1),o("ngIf",!(e.filter!=null&&e.filter.UpdatedProduct)&&!e.isSingleChannel&&e.isNotEmpty(e.filter.ChannelID)))},dependencies:[E,P,N,F,j,G,H,z,k,A,B,U],encapsulation:2});let r=m;return r})();export{pe as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as D,b as ee,j as Cd,k as Ro,l as Ed,m as Id}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.
|
|
1
|
+
import{a as D,b as ee,j as Cd,k as Ro,l as Ed,m as Id}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.4/Marketplace/chunk-R7J6AS67.js";function M(t){return typeof t=="function"}function ca(t){return M(t?.lift)}function b(t){return e=>{if(ca(e))return e.lift(function(r){try{return t(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function jt(t){let r=t(n=>{Error.call(n),n.stack=new Error().stack});return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var Oo=jt(t=>function(r){t(this),this.message=r?`${r.length} errors occurred during unsubscription:
|
|
2
2
|
${r.map((n,o)=>`${o+1}) ${n.toString()}`).join(`
|
|
3
3
|
`)}`:"",this.name="UnsubscriptionError",this.errors=r});function en(t,e){if(t){let r=t.indexOf(e);0<=r&&t.splice(r,1)}}var Q=class t{constructor(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let e;if(!this.closed){this.closed=!0;let{_parentage:r}=this;if(r)if(this._parentage=null,Array.isArray(r))for(let i of r)i.remove(this);else r.remove(this);let{initialTeardown:n}=this;if(M(n))try{n()}catch(i){e=i instanceof Oo?i.errors:[i]}let{_finalizers:o}=this;if(o){this._finalizers=null;for(let i of o)try{bd(i)}catch(s){e=e??[],s instanceof Oo?e=[...e,...s.errors]:e.push(s)}}if(e)throw new Oo(e)}}add(e){var r;if(e&&e!==this)if(this.closed)bd(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(e)}}_hasParent(e){let{_parentage:r}=this;return r===e||Array.isArray(r)&&r.includes(e)}_addParent(e){let{_parentage:r}=this;this._parentage=Array.isArray(r)?(r.push(e),r):r?[r,e]:e}_removeParent(e){let{_parentage:r}=this;r===e?this._parentage=null:Array.isArray(r)&&en(r,e)}remove(e){let{_finalizers:r}=this;r&&en(r,e),e instanceof t&&e._removeParent(this)}};Q.EMPTY=(()=>{let t=new Q;return t.closed=!0,t})();var la=Q.EMPTY;function Po(t){return t instanceof Q||t&&"closed"in t&&M(t.remove)&&M(t.add)&&M(t.unsubscribe)}function bd(t){M(t)?t():t.unsubscribe()}var Be={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var Tn={setTimeout(t,e,...r){let{delegate:n}=Tn;return n?.setTimeout?n.setTimeout(t,e,...r):setTimeout(t,e,...r)},clearTimeout(t){let{delegate:e}=Tn;return(e?.clearTimeout||clearTimeout)(t)},delegate:void 0};function Fo(t){Tn.setTimeout(()=>{let{onUnhandledError:e}=Be;if(e)e(t);else throw t})}function He(){}var Md=(()=>da("C",void 0,void 0))();function Sd(t){return da("E",void 0,t)}function Td(t){return da("N",t,void 0)}function da(t,e,r){return{kind:t,value:e,error:r}}var tn=null;function xn(t){if(Be.useDeprecatedSynchronousErrorHandling){let e=!tn;if(e&&(tn={errorThrown:!1,error:null}),t(),e){let{errorThrown:r,error:n}=tn;if(tn=null,r)throw n}}else t()}function xd(t){Be.useDeprecatedSynchronousErrorHandling&&tn&&(tn.errorThrown=!0,tn.error=t)}var nn=class extends Q{constructor(e){super(),this.isStopped=!1,e?(this.destination=e,Po(e)&&e.add(this)):this.destination=Dv}static create(e,r,n){return new vt(e,r,n)}next(e){this.isStopped?ha(Td(e),this):this._next(e)}error(e){this.isStopped?ha(Sd(e),this):(this.isStopped=!0,this._error(e))}complete(){this.isStopped?ha(Md,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(e){this.destination.next(e)}_error(e){try{this.destination.error(e)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}},vv=Function.prototype.bind;function fa(t,e){return vv.call(t,e)}var pa=class{constructor(e){this.partialObserver=e}next(e){let{partialObserver:r}=this;if(r.next)try{r.next(e)}catch(n){ko(n)}}error(e){let{partialObserver:r}=this;if(r.error)try{r.error(e)}catch(n){ko(n)}else ko(e)}complete(){let{partialObserver:e}=this;if(e.complete)try{e.complete()}catch(r){ko(r)}}},vt=class extends nn{constructor(e,r,n){super();let o;if(M(e)||!e)o={next:e??void 0,error:r??void 0,complete:n??void 0};else{let i;this&&Be.useDeprecatedNextContext?(i=Object.create(e),i.unsubscribe=()=>this.unsubscribe(),o={next:e.next&&fa(e.next,i),error:e.error&&fa(e.error,i),complete:e.complete&&fa(e.complete,i)}):o=e}this.destination=new pa(o)}};function ko(t){Be.useDeprecatedSynchronousErrorHandling?xd(t):Fo(t)}function yv(t){throw t}function ha(t,e){let{onStoppedNotification:r}=Be;r&&Tn.setTimeout(()=>r(t,e))}var Dv={closed:!0,next:He,error:yv,complete:He};function I(t,e,r,n,o){return new ga(t,e,r,n,o)}var ga=class extends nn{constructor(e,r,n,o,i,s){super(e),this.onFinalize=i,this.shouldUnsubscribe=s,this._next=r?function(a){try{r(a)}catch(u){e.error(u)}}:super._next,this._error=o?function(a){try{o(a)}catch(u){e.error(u)}finally{this.unsubscribe()}}:super._error,this._complete=n?function(){try{n()}catch(a){e.error(a)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){let{closed:r}=this;super.unsubscribe(),!r&&((e=this.onFinalize)===null||e===void 0||e.call(this))}}};function O(t,e){return b((r,n)=>{let o=0;r.subscribe(I(n,i=>{n.next(t.call(e,i,o++))}))})}var _n=(()=>typeof Symbol=="function"&&Symbol.observable||"@@observable")();function le(t){return t}function ma(...t){return va(t)}function va(t){return t.length===0?le:t.length===1?t[0]:function(r){return t.reduce((n,o)=>o(n),r)}}var k=(()=>{class t{constructor(r){r&&(this._subscribe=r)}lift(r){let n=new t;return n.source=this,n.operator=r,n}subscribe(r,n,o){let i=Cv(r)?r:new vt(r,n,o);return xn(()=>{let{operator:s,source:a}=this;i.add(s?s.call(i,a):a?this._subscribe(i):this._trySubscribe(i))}),i}_trySubscribe(r){try{return this._subscribe(r)}catch(n){r.error(n)}}forEach(r,n){return n=_d(n),new n((o,i)=>{let s=new vt({next:a=>{try{r(a)}catch(u){i(u),s.unsubscribe()}},error:i,complete:o});this.subscribe(s)})}_subscribe(r){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(r)}[_n](){return this}pipe(...r){return va(r)(this)}toPromise(r){return r=_d(r),new r((n,o)=>{let i;this.subscribe(s=>i=s,s=>o(s),()=>n(i))})}}return t.create=e=>new t(e),t})();function _d(t){var e;return(e=t??Be.Promise)!==null&&e!==void 0?e:Promise}function wv(t){return t&&M(t.next)&&M(t.error)&&M(t.complete)}function Cv(t){return t&&t instanceof nn||wv(t)&&Po(t)}var Ad=jt(t=>function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});var ae=(()=>{class t extends k{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(r){let n=new Lo(this,this);return n.operator=r,n}_throwIfClosed(){if(this.closed)throw new Ad}next(r){xn(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(let n of this.currentObservers)n.next(r)}})}error(r){xn(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=r;let{observers:n}=this;for(;n.length;)n.shift().error(r)}})}complete(){xn(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;let{observers:r}=this;for(;r.length;)r.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0}_trySubscribe(r){return this._throwIfClosed(),super._trySubscribe(r)}_subscribe(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)}_innerSubscribe(r){let{hasError:n,isStopped:o,observers:i}=this;return n||o?la:(this.currentObservers=null,i.push(r),new Q(()=>{this.currentObservers=null,en(i,r)}))}_checkFinalizedStatuses(r){let{hasError:n,thrownError:o,isStopped:i}=this;n?r.error(o):i&&r.complete()}asObservable(){let r=new k;return r.source=this,r}}return t.create=(e,r)=>new Lo(e,r),t})(),Lo=class extends ae{constructor(e,r){super(),this.destination=e,this.source=r}next(e){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.next)===null||n===void 0||n.call(r,e)}error(e){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.error)===null||n===void 0||n.call(r,e)}complete(){var e,r;(r=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||r===void 0||r.call(e)}_subscribe(e){var r,n;return(n=(r=this.source)===null||r===void 0?void 0:r.subscribe(e))!==null&&n!==void 0?n:la}};var Ir={now(){return(Ir.delegate||Date).now()},delegate:void 0};var br=class extends ae{constructor(e=1/0,r=1/0,n=Ir){super(),this._bufferSize=e,this._windowTime=r,this._timestampProvider=n,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=r===1/0,this._bufferSize=Math.max(1,e),this._windowTime=Math.max(1,r)}next(e){let{isStopped:r,_buffer:n,_infiniteTimeWindow:o,_timestampProvider:i,_windowTime:s}=this;r||(n.push(e),!o&&n.push(i.now()+s)),this._trimBuffer(),super.next(e)}_subscribe(e){this._throwIfClosed(),this._trimBuffer();let r=this._innerSubscribe(e),{_infiniteTimeWindow:n,_buffer:o}=this,i=o.slice();for(let s=0;s<i.length&&!e.closed;s+=n?1:2)e.next(i[s]);return this._checkFinalizedStatuses(e),r}_trimBuffer(){let{_bufferSize:e,_timestampProvider:r,_buffer:n,_infiniteTimeWindow:o}=this,i=(o?1:2)*e;if(e<1/0&&i<n.length&&n.splice(0,n.length-i),!o){let s=r.now(),a=0;for(let u=1;u<n.length&&n[u]<=s;u+=2)a=u;a&&n.splice(0,a+1)}}};var An=t=>t&&typeof t.length=="number"&&typeof t!="function";function jo(t){return M(t?.then)}function Vo(t){return M(t[_n])}function $o(t){return Symbol.asyncIterator&&M(t?.[Symbol.asyncIterator])}function Uo(t){return new TypeError(`You provided ${t!==null&&typeof t=="object"?"an invalid object":`'${t}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function Ev(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Bo=Ev();function Ho(t){return M(t?.[Bo])}function zo(t){return Ed(this,arguments,function*(){let r=t.getReader();try{for(;;){let{value:n,done:o}=yield Ro(r.read());if(o)return yield Ro(void 0);yield yield Ro(n)}}finally{r.releaseLock()}})}function Wo(t){return M(t?.getReader)}function P(t){if(t instanceof k)return t;if(t!=null){if(Vo(t))return Iv(t);if(An(t))return bv(t);if(jo(t))return Mv(t);if($o(t))return Nd(t);if(Ho(t))return Sv(t);if(Wo(t))return Tv(t)}throw Uo(t)}function Iv(t){return new k(e=>{let r=t[_n]();if(M(r.subscribe))return r.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function bv(t){return new k(e=>{for(let r=0;r<t.length&&!e.closed;r++)e.next(t[r]);e.complete()})}function Mv(t){return new k(e=>{t.then(r=>{e.closed||(e.next(r),e.complete())},r=>e.error(r)).then(null,Fo)})}function Sv(t){return new k(e=>{for(let r of t)if(e.next(r),e.closed)return;e.complete()})}function Nd(t){return new k(e=>{xv(t,e).catch(r=>e.error(r))})}function Tv(t){return Nd(zo(t))}function xv(t,e){var r,n,o,i;return Cd(this,void 0,void 0,function*(){try{for(r=Id(t);n=yield r.next(),!n.done;){let s=n.value;if(e.next(s),e.closed)return}}catch(s){o={error:s}}finally{try{n&&!n.done&&(i=r.return)&&(yield i.call(r))}finally{if(o)throw o.error}}e.complete()})}function Da(t={}){let{connector:e=()=>new ae,resetOnError:r=!0,resetOnComplete:n=!0,resetOnRefCountZero:o=!0}=t;return i=>{let s,a,u,c=0,l=!1,d=!1,f=()=>{a?.unsubscribe(),a=void 0},h=()=>{f(),s=u=void 0,l=d=!1},p=()=>{let S=s;h(),S?.unsubscribe()};return b((S,C)=>{c++,!d&&!l&&f();let m=u=u??e();C.add(()=>{c--,c===0&&!d&&!l&&(a=ya(p,o))}),m.subscribe(C),!s&&c>0&&(s=new vt({next:j=>m.next(j),error:j=>{d=!0,f(),a=ya(h,r,j),m.error(j)},complete:()=>{l=!0,f(),a=ya(h,n),m.complete()}}),P(S).subscribe(s))})(i)}}function ya(t,e,...r){if(e===!0){t();return}if(e===!1)return;let n=new vt({next:()=>{n.unsubscribe(),t()}});return P(e(...r)).subscribe(n)}function Rd(t,e,r){let n,o=!1;return t&&typeof t=="object"?{bufferSize:n=1/0,windowTime:e=1/0,refCount:o=!1,scheduler:r}=t:n=t??1/0,Da({connector:()=>new br(n,e,r),resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:o})}function Nn(){return b((t,e)=>{let r=null;t._refCount++;let n=I(e,void 0,void 0,void 0,()=>{if(!t||t._refCount<=0||0<--t._refCount){r=null;return}let o=t._connection,i=r;r=null,o&&(!i||o===i)&&o.unsubscribe(),e.unsubscribe()});t.subscribe(n),n.closed||(r=t.connect())})}var Rn=class extends k{constructor(e,r){super(),this.source=e,this.subjectFactory=r,this._subject=null,this._refCount=0,this._connection=null,ca(e)&&(this.lift=e.lift)}_subscribe(e){return this.getSubject().subscribe(e)}getSubject(){let e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject}_teardown(){this._refCount=0;let{_connection:e}=this;this._subject=this._connection=null,e?.unsubscribe()}connect(){let e=this._connection;if(!e){e=this._connection=new Q;let r=this.getSubject();e.add(this.source.subscribe(I(r,void 0,()=>{this._teardown(),r.complete()},n=>{this._teardown(),r.error(n)},()=>this._teardown()))),e.closed&&(this._connection=null,e=Q.EMPTY)}return e}refCount(){return Nn()(this)}};var On={schedule(t){let e=requestAnimationFrame,r=cancelAnimationFrame,{delegate:n}=On;n&&(e=n.requestAnimationFrame,r=n.cancelAnimationFrame);let o=e(i=>{r=void 0,t(i)});return new Q(()=>r?.(o))},requestAnimationFrame(...t){let{delegate:e}=On;return(e?.requestAnimationFrame||requestAnimationFrame)(...t)},cancelAnimationFrame(...t){let{delegate:e}=On;return(e?.cancelAnimationFrame||cancelAnimationFrame)(...t)},delegate:void 0};var de=class extends ae{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){let r=super._subscribe(e);return!r.closed&&e.next(this._value),r}getValue(){let{hasError:e,thrownError:r,_value:n}=this;if(e)throw r;return this._throwIfClosed(),n}next(e){super.next(this._value=e)}};var Go=class extends Q{constructor(e,r){super()}schedule(e,r=0){return this}};var Mr={setInterval(t,e,...r){let{delegate:n}=Mr;return n?.setInterval?n.setInterval(t,e,...r):setInterval(t,e,...r)},clearInterval(t){let{delegate:e}=Mr;return(e?.clearInterval||clearInterval)(t)},delegate:void 0};var Ke=class extends Go{constructor(e,r){super(e,r),this.scheduler=e,this.work=r,this.pending=!1}schedule(e,r=0){var n;if(this.closed)return this;this.state=e;let o=this.id,i=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(i,o,r)),this.pending=!0,this.delay=r,this.id=(n=this.id)!==null&&n!==void 0?n:this.requestAsyncId(i,this.id,r),this}requestAsyncId(e,r,n=0){return Mr.setInterval(e.flush.bind(e,this),n)}recycleAsyncId(e,r,n=0){if(n!=null&&this.delay===n&&this.pending===!1)return r;r!=null&&Mr.clearInterval(r)}execute(e,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;let n=this._execute(e,r);if(n)return n;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,r){let n=!1,o;try{this.work(e)}catch(i){n=!0,o=i||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),o}unsubscribe(){if(!this.closed){let{id:e,scheduler:r}=this,{actions:n}=r;this.work=this.state=this.scheduler=null,this.pending=!1,en(n,this),e!=null&&(this.id=this.recycleAsyncId(r,e,null)),this.delay=null,super.unsubscribe()}}};var _v=1,wa,Ca={};function Od(t){return t in Ca?(delete Ca[t],!0):!1}var Pd={setImmediate(t){let e=_v++;return Ca[e]=!0,wa||(wa=Promise.resolve()),wa.then(()=>Od(e)&&t()),e},clearImmediate(t){Od(t)}};var{setImmediate:Av,clearImmediate:Nv}=Pd,Sr={setImmediate(...t){let{delegate:e}=Sr;return(e?.setImmediate||Av)(...t)},clearImmediate(t){let{delegate:e}=Sr;return(e?.clearImmediate||Nv)(t)},delegate:void 0};var qo=class extends Ke{constructor(e,r){super(e,r),this.scheduler=e,this.work=r}requestAsyncId(e,r,n=0){return n!==null&&n>0?super.requestAsyncId(e,r,n):(e.actions.push(this),e._scheduled||(e._scheduled=Sr.setImmediate(e.flush.bind(e,void 0))))}recycleAsyncId(e,r,n=0){var o;if(n!=null?n>0:this.delay>0)return super.recycleAsyncId(e,r,n);let{actions:i}=e;r!=null&&((o=i[i.length-1])===null||o===void 0?void 0:o.id)!==r&&(Sr.clearImmediate(r),e._scheduled===r&&(e._scheduled=void 0))}};var Pn=class t{constructor(e,r=t.now){this.schedulerActionCtor=e,this.now=r}schedule(e,r=0,n){return new this.schedulerActionCtor(this,e).schedule(n,r)}};Pn.now=Ir.now;var Je=class extends Pn{constructor(e,r=Pn.now){super(e,r),this.actions=[],this._active=!1}flush(e){let{actions:r}=this;if(this._active){r.push(e);return}let n;this._active=!0;do if(n=e.execute(e.state,e.delay))break;while(e=r.shift());if(this._active=!1,n){for(;e=r.shift();)e.unsubscribe();throw n}}};var Zo=class extends Je{flush(e){this._active=!0;let r=this._scheduled;this._scheduled=void 0;let{actions:n}=this,o;e=e||n.shift();do if(o=e.execute(e.state,e.delay))break;while((e=n[0])&&e.id===r&&n.shift());if(this._active=!1,o){for(;(e=n[0])&&e.id===r&&n.shift();)e.unsubscribe();throw o}}};var Rv=new Zo(qo);var Xe=new Je(Ke),Ea=Xe;var Yo=class extends Ke{constructor(e,r){super(e,r),this.scheduler=e,this.work=r}schedule(e,r=0){return r>0?super.schedule(e,r):(this.delay=r,this.state=e,this.scheduler.flush(this),this)}execute(e,r){return r>0||this.closed?super.execute(e,r):this._execute(e,r)}requestAsyncId(e,r,n=0){return n!=null&&n>0||n==null&&this.delay>0?super.requestAsyncId(e,r,n):(e.flush(this),0)}};var Qo=class extends Je{};var Ov=new Qo(Yo);var Ko=class extends Ke{constructor(e,r){super(e,r),this.scheduler=e,this.work=r}requestAsyncId(e,r,n=0){return n!==null&&n>0?super.requestAsyncId(e,r,n):(e.actions.push(this),e._scheduled||(e._scheduled=On.requestAnimationFrame(()=>e.flush(void 0))))}recycleAsyncId(e,r,n=0){var o;if(n!=null?n>0:this.delay>0)return super.recycleAsyncId(e,r,n);let{actions:i}=e;r!=null&&((o=i[i.length-1])===null||o===void 0?void 0:o.id)!==r&&(On.cancelAnimationFrame(r),e._scheduled=void 0)}};var Jo=class extends Je{flush(e){this._active=!0;let r=this._scheduled;this._scheduled=void 0;let{actions:n}=this,o;e=e||n.shift();do if(o=e.execute(e.state,e.delay))break;while((e=n[0])&&e.id===r&&n.shift());if(this._active=!1,o){for(;(e=n[0])&&e.id===r&&n.shift();)e.unsubscribe();throw o}}};var Pv=new Jo(Ko);var Ie=new k(t=>t.complete());function Xo(t){return t&&M(t.schedule)}function Ia(t){return t[t.length-1]}function Fn(t){return M(Ia(t))?t.pop():void 0}function et(t){return Xo(Ia(t))?t.pop():void 0}function Fd(t,e){return typeof Ia(t)=="number"?t.pop():e}function pe(t,e,r,n=0,o=!1){let i=e.schedule(function(){r(),o?t.add(this.schedule(null,n)):this.unsubscribe()},n);if(t.add(i),!o)return i}function Tr(t,e=0){return b((r,n)=>{r.subscribe(I(n,o=>pe(n,t,()=>n.next(o),e),()=>pe(n,t,()=>n.complete(),e),o=>pe(n,t,()=>n.error(o),e)))})}function xr(t,e=0){return b((r,n)=>{n.add(t.schedule(()=>r.subscribe(n),e))})}function kd(t,e){return P(t).pipe(xr(e),Tr(e))}function Ld(t,e){return P(t).pipe(xr(e),Tr(e))}function jd(t,e){return new k(r=>{let n=0;return e.schedule(function(){n===t.length?r.complete():(r.next(t[n++]),r.closed||this.schedule())})})}function Vd(t,e){return new k(r=>{let n;return pe(r,e,()=>{n=t[Bo](),pe(r,e,()=>{let o,i;try{({value:o,done:i}=n.next())}catch(s){r.error(s);return}i?r.complete():r.next(o)},0,!0)}),()=>M(n?.return)&&n.return()})}function ei(t,e){if(!t)throw new Error("Iterable cannot be null");return new k(r=>{pe(r,e,()=>{let n=t[Symbol.asyncIterator]();pe(r,e,()=>{n.next().then(o=>{o.done?r.complete():r.next(o.value)})},0,!0)})})}function $d(t,e){return ei(zo(t),e)}function Ud(t,e){if(t!=null){if(Vo(t))return kd(t,e);if(An(t))return jd(t,e);if(jo(t))return Ld(t,e);if($o(t))return ei(t,e);if(Ho(t))return Vd(t,e);if(Wo(t))return $d(t,e)}throw Uo(t)}function G(t,e){return e?Ud(t,e):P(t)}function T(...t){let e=et(t);return G(t,e)}function kn(t,e){let r=M(t)?t:()=>t,n=o=>o.error(r());return new k(e?o=>e.schedule(n,0,o):n)}function ba(t){return!!t&&(t instanceof k||M(t.lift)&&M(t.subscribe))}var yt=jt(t=>function(){t(this),this.name="EmptyError",this.message="no elements in sequence"});function ti(t){return t instanceof Date&&!isNaN(t)}var Fv=jt(t=>function(r=null){t(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=r});function kv(t,e){let{first:r,each:n,with:o=Lv,scheduler:i=e??Xe,meta:s=null}=ti(t)?{first:t}:typeof t=="number"?{each:t}:t;if(r==null&&n==null)throw new TypeError("No timeout provided.");return b((a,u)=>{let c,l,d=null,f=0,h=p=>{l=pe(u,i,()=>{try{c.unsubscribe(),P(o({meta:s,lastValue:d,seen:f})).subscribe(u)}catch(S){u.error(S)}},p)};c=a.subscribe(I(u,p=>{l?.unsubscribe(),f++,u.next(d=p),n>0&&h(n)},void 0,void 0,()=>{l?.closed||l?.unsubscribe(),d=null})),!f&&h(r!=null?typeof r=="number"?r:+r-i.now():n)})}function Lv(t){throw new Fv(t)}var{isArray:jv}=Array;function Vv(t,e){return jv(e)?t(...e):t(e)}function Ln(t){return O(e=>Vv(t,e))}var{isArray:$v}=Array,{getPrototypeOf:Uv,prototype:Bv,keys:Hv}=Object;function ni(t){if(t.length===1){let e=t[0];if($v(e))return{args:e,keys:null};if(zv(e)){let r=Hv(e);return{args:r.map(n=>e[n]),keys:r}}}return{args:t,keys:null}}function zv(t){return t&&typeof t=="object"&&Uv(t)===Bv}function ri(t,e){return t.reduce((r,n,o)=>(r[n]=e[o],r),{})}function _r(...t){let e=et(t),r=Fn(t),{args:n,keys:o}=ni(t);if(n.length===0)return G([],e);let i=new k(Wv(n,e,o?s=>ri(o,s):le));return r?i.pipe(Ln(r)):i}function Wv(t,e,r=le){return n=>{Bd(e,()=>{let{length:o}=t,i=new Array(o),s=o,a=o;for(let u=0;u<o;u++)Bd(e,()=>{let c=G(t[u],e),l=!1;c.subscribe(I(n,d=>{i[u]=d,l||(l=!0,a--),a||n.next(r(i.slice()))},()=>{--s||n.complete()}))},n)},n)}}function Bd(t,e,r){t?pe(r,t,e):e()}function Hd(t,e,r,n,o,i,s,a){let u=[],c=0,l=0,d=!1,f=()=>{d&&!u.length&&!c&&e.complete()},h=S=>c<n?p(S):u.push(S),p=S=>{i&&e.next(S),c++;let C=!1;P(r(S,l++)).subscribe(I(e,m=>{o?.(m),i?h(m):e.next(m)},()=>{C=!0},void 0,()=>{if(C)try{for(c--;u.length&&c<n;){let m=u.shift();s?pe(e,s,()=>p(m)):p(m)}f()}catch(m){e.error(m)}}))};return t.subscribe(I(e,h,()=>{d=!0,f()})),()=>{a?.()}}function K(t,e,r=1/0){return M(e)?K((n,o)=>O((i,s)=>e(n,i,o,s))(P(t(n,o))),r):(typeof e=="number"&&(r=e),b((n,o)=>Hd(n,o,t,r)))}function tt(t=1/0){return K(le,t)}function zd(){return tt(1)}function jn(...t){return zd()(G(t,et(t)))}function oi(t){return new k(e=>{P(t()).subscribe(e)})}function Gv(...t){let e=Fn(t),{args:r,keys:n}=ni(t),o=new k(i=>{let{length:s}=r;if(!s){i.complete();return}let a=new Array(s),u=s,c=s;for(let l=0;l<s;l++){let d=!1;P(r[l]).subscribe(I(i,f=>{d||(d=!0,c--),a[l]=f},()=>u--,void 0,()=>{(!u||!d)&&(c||i.next(n?ri(n,a):a),i.complete())}))}});return e?o.pipe(Ln(e)):o}var qv=["addListener","removeListener"],Zv=["addEventListener","removeEventListener"],Yv=["on","off"];function Ma(t,e,r,n){if(M(r)&&(n=r,r=void 0),n)return Ma(t,e,r).pipe(Ln(n));let[o,i]=Jv(t)?Zv.map(s=>a=>t[s](e,a,r)):Qv(t)?qv.map(Wd(t,e)):Kv(t)?Yv.map(Wd(t,e)):[];if(!o&&An(t))return K(s=>Ma(s,e,r))(P(t));if(!o)throw new TypeError("Invalid event target");return new k(s=>{let a=(...u)=>s.next(1<u.length?u:u[0]);return o(a),()=>i(a)})}function Wd(t,e){return r=>n=>t[r](e,n)}function Qv(t){return M(t.addListener)&&M(t.removeListener)}function Kv(t){return M(t.on)&&M(t.off)}function Jv(t){return M(t.addEventListener)&&M(t.removeEventListener)}function Ar(t=0,e,r=Ea){let n=-1;return e!=null&&(Xo(e)?r=e:n=e),new k(o=>{let i=ti(t)?+t-r.now():t;i<0&&(i=0);let s=0;return r.schedule(function(){o.closed||(o.next(s++),0<=n?this.schedule(void 0,n):o.complete())},i)})}function Xv(t=0,e=Xe){return t<0&&(t=0),Ar(t,t,e)}function ey(...t){let e=et(t),r=Fd(t,1/0),n=t;return n.length?n.length===1?P(n[0]):tt(r)(G(n,e)):Ie}function Gd(t,e){return(r,n)=>!t.call(e,r,n)}function te(t,e){return b((r,n)=>{let o=0;r.subscribe(I(n,i=>t.call(e,i,o++)&&n.next(i)))})}function ty(t,e,r){return[te(e,r)(P(t)),te(Gd(e,r))(P(t))]}function qd(t){return b((e,r)=>{let n=!1,o=null,i=null,s=!1,a=()=>{if(i?.unsubscribe(),i=null,n){n=!1;let c=o;o=null,r.next(c)}s&&r.complete()},u=()=>{i=null,s&&r.complete()};e.subscribe(I(r,c=>{n=!0,o=c,i||P(t(c)).subscribe(i=I(r,a,u))},()=>{s=!0,(!n||!i||i.closed)&&r.complete()}))})}function ny(t,e=Xe){return qd(()=>Ar(t,e))}function Dt(t){return b((e,r)=>{let n=null,o=!1,i;n=e.subscribe(I(r,void 0,void 0,s=>{i=P(t(s,Dt(t)(e))),n?(n.unsubscribe(),n=null,i.subscribe(r)):o=!0})),o&&(n.unsubscribe(),n=null,i.subscribe(r))})}function Zd(t,e,r,n,o){return(i,s)=>{let a=r,u=e,c=0;i.subscribe(I(s,l=>{let d=c++;u=a?t(u,l,d):(a=!0,l),n&&s.next(u)},o&&(()=>{a&&s.next(u),s.complete()})))}}function nt(t,e){return M(e)?K(t,e,1):K(t,1)}function ry(t){return b((e,r)=>{let n=!1,o=null,i=null,s=()=>{if(i?.unsubscribe(),i=null,n){n=!1;let a=o;o=null,r.next(a)}};e.subscribe(I(r,a=>{i?.unsubscribe(),n=!0,o=a,i=I(r,s,He),P(t(a)).subscribe(i)},()=>{s(),r.complete()},void 0,()=>{o=i=null}))})}function oy(t,e=Xe){return b((r,n)=>{let o=null,i=null,s=null,a=()=>{if(o){o.unsubscribe(),o=null;let c=i;i=null,n.next(c)}};function u(){let c=s+t,l=e.now();if(l<c){o=this.schedule(void 0,c-l),n.add(o);return}a()}r.subscribe(I(n,c=>{i=c,s=e.now(),o||(o=e.schedule(u,t),n.add(o))},()=>{a(),n.complete()},void 0,()=>{i=o=null}))})}function Vt(t){return b((e,r)=>{let n=!1;e.subscribe(I(r,o=>{n=!0,r.next(o)},()=>{n||r.next(t),r.complete()}))})}function wt(t){return t<=0?()=>Ie:b((e,r)=>{let n=0;e.subscribe(I(r,o=>{++n<=t&&(r.next(o),t<=n&&r.complete())}))})}function iy(){return b((t,e)=>{t.subscribe(I(e,He))})}function Sa(t){return O(()=>t)}function sy(t,e=le){return t=t??ay,b((r,n)=>{let o,i=!0;r.subscribe(I(n,s=>{let a=e(s);(i||!t(o,a))&&(i=!1,o=a,n.next(s))}))})}function ay(t,e){return t===e}function ii(t=uy){return b((e,r)=>{let n=!1;e.subscribe(I(r,o=>{n=!0,r.next(o)},()=>n?r.complete():r.error(t())))})}function uy(){return new yt}function cy(t,e){return b((r,n)=>{let o=0;r.subscribe(I(n,i=>{t.call(e,i,o++,r)||(n.next(!1),n.complete())},()=>{n.next(!0),n.complete()}))})}function $t(t){return b((e,r)=>{try{e.subscribe(r)}finally{r.add(t)}})}function rt(t,e){let r=arguments.length>=2;return n=>n.pipe(t?te((o,i)=>t(o,i,n)):le,wt(1),r?Vt(e):ii(()=>new yt))}function Vn(t){return t<=0?()=>Ie:b((e,r)=>{let n=[];e.subscribe(I(r,o=>{n.push(o),t<n.length&&n.shift()},()=>{for(let o of n)r.next(o);r.complete()},void 0,()=>{n=null}))})}function Ta(t,e){let r=arguments.length>=2;return n=>n.pipe(t?te((o,i)=>t(o,i,n)):le,Vn(1),r?Vt(e):ii(()=>new yt))}function si(t,e){return b(Zd(t,e,arguments.length>=2,!0))}function ly(t){return te((e,r)=>t<=r)}function xa(...t){let e=et(t);return b((r,n)=>{(e?jn(t,r,e):jn(t,r)).subscribe(n)})}function ue(t,e){return b((r,n)=>{let o=null,i=0,s=!1,a=()=>s&&!o&&n.complete();r.subscribe(I(n,u=>{o?.unsubscribe();let c=0,l=i++;P(t(u,l)).subscribe(o=I(n,d=>n.next(e?e(u,d,l,c++):d),()=>{o=null,a()}))},()=>{s=!0,a()}))})}function dy(t,e){return M(e)?ue(()=>t,e):ue(()=>t)}function ai(t){return b((e,r)=>{P(t).subscribe(I(r,()=>r.complete(),He)),!r.closed&&e.subscribe(r)})}function fy(t,e=!1){return b((r,n)=>{let o=0;r.subscribe(I(n,i=>{let s=t(i,o++);(s||e)&&n.next(i),!s&&n.complete()}))})}function ne(t,e,r){let n=M(t)||e||r?{next:t,error:e,complete:r}:t;return n?b((o,i)=>{var s;(s=n.subscribe)===null||s===void 0||s.call(n);let a=!0;o.subscribe(I(i,u=>{var c;(c=n.next)===null||c===void 0||c.call(n,u),i.next(u)},()=>{var u;a=!1,(u=n.complete)===null||u===void 0||u.call(n),i.complete()},u=>{var c;a=!1,(c=n.error)===null||c===void 0||c.call(n,u),i.error(u)},()=>{var u,c;a&&((u=n.unsubscribe)===null||u===void 0||u.call(n)),(c=n.finalize)===null||c===void 0||c.call(n)}))}):le}function hy(...t){let e=Fn(t);return b((r,n)=>{let o=t.length,i=new Array(o),s=t.map(()=>!1),a=!1;for(let u=0;u<o;u++)P(t[u]).subscribe(I(n,c=>{i[u]=c,!a&&!s[u]&&(s[u]=!0,(a=s.every(le))&&(s=null))},He));r.subscribe(I(n,u=>{if(a){let c=[u,...i];n.next(e?e(...c):c)}}))})}var Yd=null;var _a=1;function se(t){let e=Yd;return Yd=t,e}var Qd={version:0,lastCleanEpoch:0,dirty:!1,producerNode:void 0,producerLastReadVersion:void 0,producerIndexOfThis:void 0,nextProducerIndex:0,liveConsumerNode:void 0,liveConsumerIndexOfThis:void 0,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function py(t){if(!(Ra(t)&&!t.dirty)&&!(!t.dirty&&t.lastCleanEpoch===_a)){if(!t.producerMustRecompute(t)&&!Aa(t)){t.dirty=!1,t.lastCleanEpoch=_a;return}t.producerRecomputeValue(t),t.dirty=!1,t.lastCleanEpoch=_a}}function Kd(t){return t&&(t.nextProducerIndex=0),se(t)}function Jd(t,e){if(se(e),!(!t||t.producerNode===void 0||t.producerIndexOfThis===void 0||t.producerLastReadVersion===void 0)){if(Ra(t))for(let r=t.nextProducerIndex;r<t.producerNode.length;r++)Na(t.producerNode[r],t.producerIndexOfThis[r]);for(;t.producerNode.length>t.nextProducerIndex;)t.producerNode.pop(),t.producerLastReadVersion.pop(),t.producerIndexOfThis.pop()}}function Aa(t){ui(t);for(let e=0;e<t.producerNode.length;e++){let r=t.producerNode[e],n=t.producerLastReadVersion[e];if(n!==r.version||(py(r),n!==r.version))return!0}return!1}function Xd(t){if(ui(t),Ra(t))for(let e=0;e<t.producerNode.length;e++)Na(t.producerNode[e],t.producerIndexOfThis[e]);t.producerNode.length=t.producerLastReadVersion.length=t.producerIndexOfThis.length=0,t.liveConsumerNode&&(t.liveConsumerNode.length=t.liveConsumerIndexOfThis.length=0)}function Na(t,e){if(gy(t),ui(t),t.liveConsumerNode.length===1)for(let n=0;n<t.producerNode.length;n++)Na(t.producerNode[n],t.producerIndexOfThis[n]);let r=t.liveConsumerNode.length-1;if(t.liveConsumerNode[e]=t.liveConsumerNode[r],t.liveConsumerIndexOfThis[e]=t.liveConsumerIndexOfThis[r],t.liveConsumerNode.length--,t.liveConsumerIndexOfThis.length--,e<t.liveConsumerNode.length){let n=t.liveConsumerIndexOfThis[e],o=t.liveConsumerNode[e];ui(o),o.producerIndexOfThis[n]=e}}function Ra(t){return t.consumerIsAlwaysLive||(t?.liveConsumerNode?.length??0)>0}function ui(t){t.producerNode??=[],t.producerIndexOfThis??=[],t.producerLastReadVersion??=[]}function gy(t){t.liveConsumerNode??=[],t.liveConsumerIndexOfThis??=[]}function my(){throw new Error}var vy=my;function ef(t){vy=t}function z(t){for(let e in t)if(t[e]===z)return e;throw Error("Could not find renamed property on target object.")}function ci(t,e){for(let r in e)e.hasOwnProperty(r)&&!t.hasOwnProperty(r)&&(t[r]=e[r])}function ge(t){if(typeof t=="string")return t;if(Array.isArray(t))return"["+t.map(ge).join(", ")+"]";if(t==null)return""+t;if(t.overriddenName)return`${t.overriddenName}`;if(t.name)return`${t.name}`;let e=t.toString();if(e==null)return""+e;let r=e.indexOf(`
|
|
4
4
|
`);return r===-1?e:e.substring(0,r)}function Ya(t,e){return t==null||t===""?e===null?"":e:e==null||e===""?t:t+" "+e}var yy=z({__forward_ref__:z});function zf(t){return t.__forward_ref__=zf,t.toString=function(){return ge(this())},t}function we(t){return Wf(t)?t():t}function Wf(t){return typeof t=="function"&&t.hasOwnProperty(yy)&&t.__forward_ref__===zf}function Gf(t){return t&&!!t.\u0275providers}var qf="https://g.co/ng/security#xss",v=class extends Error{constructor(e,r){super(zi(e,r)),this.code=e}};function zi(t,e){return`${`NG0${Math.abs(t)}`}${e?": "+e:""}`}var Dy=z({\u0275cmp:z}),wy=z({\u0275dir:z}),Cy=z({\u0275pipe:z}),Ey=z({\u0275mod:z}),Ii=z({\u0275fac:z}),Nr=z({__NG_ELEMENT_ID__:z}),tf=z({__NG_ENV_ID__:z});function sn(t){return typeof t=="string"?t:t==null?"":String(t)}function Iy(t){return typeof t=="function"?t.name||t.toString():typeof t=="object"&&t!=null&&typeof t.type=="function"?t.type.name||t.type.toString():sn(t)}function by(t,e){let r=e?`. Dependency path: ${e.join(" > ")} > ${t}`:"";throw new v(-200,`Circular dependency in DI detected for ${t}${r}`)}function ac(t,e){let r=e?` in ${e}`:"";throw new v(-201,!1)}function My(t,e){t==null&&Sy(e,t,null,"!=")}function Sy(t,e,r,n){throw new Error(`ASSERTION ERROR: ${t}`+(n==null?"":` [Expected=> ${r} ${n} ${e} <=Actual]`))}function w(t){return{token:t.token,providedIn:t.providedIn||null,factory:t.factory,value:void 0}}function Mt(t){return{providers:t.providers||[],imports:t.imports||[]}}function Wi(t){return nf(t,Yf)||nf(t,Qf)}function Zf(t){return Wi(t)!==null}function nf(t,e){return t.hasOwnProperty(e)?t[e]:null}function Ty(t){let e=t&&(t[Yf]||t[Qf]);return e||null}function rf(t){return t&&(t.hasOwnProperty(of)||t.hasOwnProperty(xy))?t[of]:null}var Yf=z({\u0275prov:z}),of=z({\u0275inj:z}),Qf=z({ngInjectableDef:z}),xy=z({ngInjectorDef:z}),F=function(t){return t[t.Default=0]="Default",t[t.Host=1]="Host",t[t.Self=2]="Self",t[t.SkipSelf=4]="SkipSelf",t[t.Optional=8]="Optional",t}(F||{}),Qa;function Kf(){return Qa}function be(t){let e=Qa;return Qa=t,e}function Jf(t,e,r){let n=Wi(t);if(n&&n.providedIn=="root")return n.value===void 0?n.value=n.factory():n.value;if(r&F.Optional)return null;if(e!==void 0)return e;ac(ge(t),"Injector")}var X=globalThis;var E=class{constructor(e,r){this._desc=e,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,typeof r=="number"?this.__NG_ELEMENT_ID__=r:r!==void 0&&(this.\u0275prov=w({token:this,providedIn:r.providedIn||"root",factory:r.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}};var _y={},Or=_y,Ka="__NG_DI_FLAG__",bi="ngTempTokenPath",Ay="ngTokenPath",Ny=/\n/gm,Ry="\u0275",sf="__source",zn;function Oy(){return zn}function Ut(t){let e=zn;return zn=t,e}function Py(t,e=F.Default){if(zn===void 0)throw new v(-203,!1);return zn===null?Jf(t,void 0,e):zn.get(t,e&F.Optional?null:void 0,e)}function y(t,e=F.Default){return(Kf()||Py)(we(t),e)}function g(t,e=F.Default){return y(t,Gi(e))}function Gi(t){return typeof t>"u"||typeof t=="number"?t:0|(t.optional&&8)|(t.host&&1)|(t.self&&2)|(t.skipSelf&&4)}function Ja(t){let e=[];for(let r=0;r<t.length;r++){let n=we(t[r]);if(Array.isArray(n)){if(n.length===0)throw new v(900,!1);let o,i=F.Default;for(let s=0;s<n.length;s++){let a=n[s],u=Fy(a);typeof u=="number"?u===-1?o=a.token:i|=u:o=a}e.push(y(o,i))}else e.push(y(n))}return e}function Xf(t,e){return t[Ka]=e,t.prototype[Ka]=e,t}function Fy(t){return t[Ka]}function ky(t,e,r,n){let o=t[bi];throw e[sf]&&o.unshift(e[sf]),t.message=Ly(`
|