marketplacepos 2.9.2 → 2.9.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/213.73aa99e3f8dc5caa.js +1 -0
- package/Marketplace/{369.be88af4326c1a287.js → 369.881799be1b0c0cd7.js} +1 -1
- package/Marketplace/379.aad8784dbdb3dd33.js +1 -0
- package/Marketplace/395.2943aa5a44308399.js +1 -0
- package/Marketplace/397.13ff3d72465810f8.js +1 -0
- package/Marketplace/53.3655b31ecb37ade9.js +1 -0
- package/Marketplace/655.ae475c8285604367.js +1 -0
- package/Marketplace/767.eca7237ccb50aa86.js +1 -0
- package/Marketplace/835.6cfe266f3c9b5cc9.js +1 -0
- package/Marketplace/common.af67cc08f47a8d44.js +1 -0
- package/Marketplace/index.html +3 -2
- package/Marketplace/main.4874ea507cbcab3a.js +1 -0
- package/Marketplace/runtime.357a02c3b18dd5e6.js +1 -0
- package/package.json +1 -1
- package/Marketplace/213.cb4351cfb44ca3bf.js +0 -1
- package/Marketplace/379.611029ed9b632dca.js +0 -1
- package/Marketplace/397.482996341e2502bf.js +0 -1
- package/Marketplace/408.c94b4441303091c4.js +0 -1
- package/Marketplace/53.8cb269bb04087434.js +0 -1
- package/Marketplace/655.c3fe092dbd4ce86c.js +0 -1
- package/Marketplace/72.d59410fd71caf119.js +0 -1
- package/Marketplace/767.aef1dd980b626ef7.js +0 -1
- package/Marketplace/common.7ce512ca9d1674b7.js +0 -1
- package/Marketplace/main.daad5e6622008ab4.js +0 -1
- package/Marketplace/runtime.67fa2c46977dc458.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[213],{8231:(A,M,i)=>{i.d(M,{j:()=>C});var f=i(5412),g=i(1889),c=i(9694),_=i(6779),t=i(4650),I=i(284),v=i(6895),m=i(4006),D=i(1948),e=i(9549),n=i(4385),a=i(3238),o=i(266),r=i(6401);function d(h,s){if(1&h&&(t.TgZ(0,"mat-option",9)(1,"div",10),t._UZ(2,"img",11),t.TgZ(3,"span"),t._uU(4),t.qZA()()()),2&h){const l=s.$implicit;t.Q6J("value",l.ID)("disabled",l.disabled),t.xp6(1),t.Q6J("matTooltip",l.disabled?"Single Product Scan disabled for this type of Channel":null),t.xp6(1),t.Q6J("src",l.Img,t.LSH),t.xp6(2),t.Oqu(l.Name)}}function T(h,s){if(1&h){const l=t.EpF();t.TgZ(0,"div")(1,"h5",12),t._uU(2,"Scan Type"),t.qZA(),t.TgZ(3,"mat-radio-group",13),t.NdJ("ngModelChange",function(p){t.CHM(l);const S=t.oxw();return t.KtG(S.filter.ScanFull=p)}),t.TgZ(4,"mat-radio-button",14),t._uU(5," Full (Include Inactive Products) "),t.qZA(),t.TgZ(6,"mat-radio-button",15),t._uU(7," Active "),t.qZA()()()}if(2&h){const l=t.oxw();t.xp6(3),t.Q6J("ngModel",l.filter.ScanFull),t.xp6(1),t.Q6J("value",!0),t.xp6(2),t.Q6J("value",!1)}}function E(h,s){if(1&h){const l=t.EpF();t.TgZ(0,"div",16)(1,"h5",3),t._uU(2),t.ALo(3,"date"),t.qZA(),t.TgZ(4,"mat-radio-group",17),t.NdJ("ngModelChange",function(p){t.CHM(l);const S=t.oxw();return t.KtG(S.filter.UpdatedProduct=p)}),t.TgZ(5,"mat-radio-button",18),t._uU(6," Scan All Products "),t.qZA(),t.TgZ(7,"mat-radio-button",19),t._uU(8," Scan Updated Products "),t.qZA()()()}if(2&h){const l=t.oxw();t.xp6(2),t.hij(" Last Scan: ",t.xi3(3,4,l.selectedChannel.LastSync,"dd MMMM yyyy HH:mm")," "),t.xp6(2),t.Q6J("ngModel",l.filter.UpdatedProduct),t.xp6(1),t.Q6J("value",!1),t.xp6(2),t.Q6J("value",!0)}}function U(h,s){if(1&h){const l=t.EpF();t.TgZ(0,"div",16)(1,"h5",3),t._uU(2," Scan Option "),t.qZA(),t.TgZ(3,"mat-radio-group",20),t.NdJ("ngModelChange",function(p){t.CHM(l);const S=t.oxw();return t.KtG(S.filter.Async=p)}),t.TgZ(4,"mat-radio-button",21),t._uU(5," Asynchronous (Get Notified when Complete) "),t.qZA(),t.TgZ(6,"mat-radio-button",22),t._uU(7," Synchronous (Wait until Complete) "),t.qZA()()()}if(2&h){const l=t.oxw();t.xp6(3),t.Q6J("ngModel",l.filter.Async),t.xp6(1),t.Q6J("value",!0),t.xp6(2),t.Q6J("value",!1)}}class C{constructor(s,l,u){this.dialogRef=s,this.data=l,this.router=u,this.channelType=c.x,this.disabledChannelOption=!1,this.filter={ChannelID:g.g.GuidEMpty,ScanFull:!0,UpdatedProduct:!1,Async:!1},this.isSingleChannel=!!g.g.IsNotEmpty(l.isSingleChannel)&&this.data.isSingleChannel,this.disabledChannelOption=!g.g.IsEmpty(l.disabledChannelOption)&&this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new _.O,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(s=>(s.disabled=!0,(s.TypeID==c.x.Tiktok||s.TypeID==c.x.Tokopedia||s.TypeID==c.x.Lazada)&&(s.disabled=!1),s)).sort(s=>s.disabled?1:-1))}onSelectChannel(s){let l=this.filterChannelById(s);this.selectedChannel=l,this.filter.Async=!0,l&&l.TypeID==c.x.Tokopedia?(this.filter.ScanFull=!0,this.isTokopedia=!0):(this.filter.ScanFull=!1,this.isTokopedia=!1),this.iniHasScanUpdate(),this.setDefaultConfigUpdate()}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&g.g.IsNotEmpty(this.selectedChannel.LastSync)&&(this.selectedChannel.TypeID==c.x.ShopeeV2||this.selectedChannel.TypeID==c.x.Tiktok||this.selectedChannel.TypeID==c.x.Lazada)&&(this.filter.UpdatedProduct=!0)}iniHasScanUpdate(){this.hasScanUpdate=!(this.selectedChannel?.TypeID==c.x.WooCommerce||this.selectedChannel?.TypeID==c.x.KalCare||this.selectedChannel?.TypeID==c.x.None||!g.g.IsNotEmpty(this.selectedChannel?.LastSync)||this.isSingleChannel)}filterChannelById(s){let l;return this.channelOptions&&(l=this.channelOptions.find(u=>u.ID==s)),l}submit(){this.selectedChannel.TypeID==c.x.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(s){return g.g.IsNotEmpty(s)}onClose(){this.dialogRef.close()}}C.\u0275fac=function(s){return new(s||C)(t.Y36(f.so),t.Y36(f.WI),t.Y36(I.F0))},C.\u0275cmp=t.Xpm({type:C,selectors:[["app-scan-dialog"]],decls:11,vars:8,consts:[[3,"dynamicValidated","config","onOk","onClose","onCancel"],["content",""],[1,"mx-4"],[1,"mb-3","fw-normal"],["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"],[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,"mb-3","fw-normal","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","matTooltip","Scan only products that have been updated since the last channel scan",1,"me-5",3,"value"],["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(s,l){1&s&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return l.submit()})("onClose",function(){return l.onClose()})("onCancel",function(){return l.onClose()}),t.TgZ(1,"div",1)(2,"div",2)(3,"h5",3),t._uU(4,"Select a Channel"),t.qZA(),t.TgZ(5,"mat-form-field",4)(6,"mat-select",5),t.NdJ("ngModelChange",function(p){return l.filter.ChannelID=p})("ngModelChange",function(p){return l.onSelectChannel(p)}),t.YNc(7,d,5,5,"mat-option",6),t.qZA()(),t.YNc(8,T,8,3,"div",7),t.YNc(9,E,9,7,"div",8),t.YNc(10,U,8,3,"div",8),t.qZA()()()),2&s&&(t.Q6J("dynamicValidated",l.isNotEmpty(l.filter.ChannelID))("config",l.modalConfig),t.xp6(6),t.Q6J("disabled",l.disabledChannelOption)("ngModel",l.filter.ChannelID),t.xp6(1),t.Q6J("ngForOf",l.channelOptions),t.xp6(1),t.Q6J("ngIf",!l.isSingleChannel&&!l.isTokopedia&&l.isNotEmpty(l.filter.ChannelID)),t.xp6(1),t.Q6J("ngIf",l.hasScanUpdate),t.xp6(1),t.Q6J("ngIf",!(null!=l.filter&&l.filter.UpdatedProduct)&&!l.isSingleChannel&&l.isNotEmpty(l.filter.ChannelID)))},dependencies:[v.sg,v.O5,m.JJ,m.On,D.VQ,D.U0,e.KE,n.gD,a.ey,o.gM,r.M,v.uU],encapsulation:2})},9425:(A,M,i)=>{i.d(M,{b:()=>C});var f=i(1135),g=i(7579),c=i(2722),_=i(9300),t=i(4351),I=i(4004),v=i(4482),m=i(5403),D=i(8421),e=i(4671),n=i(5032),a=i(3269),r=i(5026),d=i(8505),T=i(4782),E=i(4650),U=i(1318);class C{constructor(s){this.http=s,this.pagination$=new f.X(null),this.destroy$=new g.x,this.data$=this.paginationFunction()}onNextPage(s){s.PageNumber+=1,this.pagination$.next(s)}setPageNumberFooter(s){this.footerPageNumber=s.PageNumber}setPaginationButtonState(s,l){this.disableNextButton=0==l||!(l<s.RowCount*s.PageNumber)}resetToFirstPage(s){s.PageNumber=1,this.pagination$.next(s),this.hideCount=!0,this.goToLastPage=!1}getAllData(s,l){s.RowCount=l,this.pagination$.next(s),this.goToLastPage=!0}destroy(){this.destroy$.next(!0),this.destroy$.complete(),this.pagination$=null,this.pagination$=new f.X(null),this.data$=this.paginationFunction()}paginationFunction(){return this.pagination$.pipe((0,c.R)(this.destroy$),(0,_.h)(s=>null!=s),(0,t.b)(s=>this.http.post(`/API/${this.fetchDataEndpoint}`,JSON.stringify(s)).pipe((0,I.U)(l=>l.Data))),function o(...h){const s=(0,a.jO)(h);return(0,v.e)((l,u)=>{const p=h.length,S=new Array(p);let y=h.map(()=>!1),N=!1;for(let P=0;P<p;P++)(0,D.Xf)(h[P]).subscribe((0,m.x)(u,O=>{S[P]=O,!N&&!y[P]&&(y[P]=!0,(N=y.every(e.y))&&(y=null))},n.Z));l.subscribe((0,m.x)(u,P=>{if(N){const O=[P,...S];u.next(s?s(...O):O)}}))})}(this.pagination$),(0,r.R)((s,l)=>{const[u,p]=s,[S]=l;return 1==p.PageNumber?[S,p]:[u.concat(S),p]}),(0,d.b)(([s,l])=>{this.setPageNumberFooter(l),this.setPaginationButtonState(l,s.length)}),(0,I.U)(([s])=>s),(0,T.d)())}}C.\u0275fac=function(s){return new(s||C)(E.LFG(U.O))},C.\u0275prov=E.Yz7({token:C,factory:C.\u0275fac,providedIn:"root"})},6082:(A,M,i)=>{i.d(M,{M:()=>m});var f=i(8505),g=i(262),c=i(2843),_=i(1889),t=i(4650),I=i(1318),v=i(7185);class m{constructor(e,n){this.httpService=e,this.toastrService=n}loader(e=_.g.GuidEMpty){return this.httpService.post("/api/product/Load",{ID:e})}LoadInPOS(e=_.g.GuidEMpty){return this.httpService.post("/api/product/LoadInPOS",{ID:e})}filterChannelByTypeId(e,n){return e.filter(a=>-1!==n.findIndex(o=>a.TypeID==o))}getProductStatistic(){return this.httpService.post("/api/product/ProductStatistic",{})}getTotalProductLive(e){return this.httpService.post("/api/product/TotalProductLive",{ID:e})}clearCacheChannel(e){return this.httpService.post("/api/Channel/ClearCacheChannel",{ID:e})}uploadSingleProduct(e,n){return this.httpService.post("api/product/UploadMultipleChannel",{Channel:n,Products:e}).pipe((0,f.b)(o=>{this.showToastrSuccessUploadSingle(o,e[0])}),(0,g.K)(o=>(this.showToastErrorUploadSingle(o,e[0]),(0,c._)(()=>new Error(o)))))}uploadMultipleProduct(e,n){return this.httpService.post("api/product/UploadMultipleProductAndMultipleChannel",{Channel:n,Products:e}).pipe((0,f.b)(o=>{this.showToastrUploadMultiple(o.Message)}),(0,g.K)(o=>(this.showToastrUploadMultiple(o.error?.Message),(0,c._)(()=>new Error(o)))))}uploadNotInChannel(e,n){return this.httpService.post("/api/product/UploadProductNotInChannelToChannel",{Products:e,Channel:n}).pipe((0,f.b)(o=>{this.showToastrUploadMultiple(o)}),(0,g.K)(o=>(this.showToastrUploadMultiple(o.error?.Message),(0,c._)(()=>new Error(o)))))}scanSingle(e,n){return this.httpService.post("/api/product/ScanSingle",{ID:e,SKU:n})}scanNotInChannel(e){return this.httpService.post("/api/product/ScanNotinChannel",{ID:e})}findAllSoldInChannel(e){return this.httpService.post("/api/product/GetSoldInChannel",e)}scanAll(e,n,a,o=!1){return this.httpService.post("/api/product/ScanOptimized",{ID:e,ScanFull:n,UpdatedProduct:a,Async:o})}scanCompareToPos(e){return this.httpService.post("/api/product/CompareMarketplaceToPOS",e)}getVariantCodesProduct(e){return e.Variants.map(a=>a.Code)}downloadMultipleProduct(e){let n=e.map(a=>({ChannelItemID:a.ChannelItemID,ChannelID:a.ChannelID}));return this.httpService.post("/api/product/DownloadMultipleProductFromChannel",n).pipe((0,f.b)(a=>{this.toastrService.success(`${a.Count} products downloaded to POS`,"Download Complete")}))}downloadProduct(e){return this.httpService.post("/api/product/DownloadProductFromChannel",{ChannelItemID:e.ChannelItemID,ChannelID:e.ChannelID}).pipe((0,f.b)(()=>{this.toastrService.success("Product successfully downloaded to POS","Download Complete")}))}getVariantCodesProducts(e=[]){let n=[];return e.forEach(a=>{a.Variants.forEach(o=>{n=[...n,o.Code]})}),n}filterUnselectedChannel(e,n){let o,a=[];if(e.forEach(r=>{a=[...a,...r.Channel]}),a&&0!=a.length){let r=[];o=n.filter(d=>(r=a.filter(T=>T.ChannelID==d.ID),r.length!==e.length))}else o=n;return o}findChannelById(e,n){return n.find(a=>a.ID==e)}sortChannel(e=[]){return e.sort((n,a)=>n.TypeID<a.TypeID?1:n.TypeID===a.TypeID?0:-1)}hasSelection(e=[]){return this.selectedProduct(e).length>0}selectedProduct(e=[]){return e.filter(n=>n.selected)}hasSelectionVariant(e){return this.selectedVariantProduct(e).length>0}selectedVariantProduct(e){let n=[];return e.forEach(a=>{n=[...n,...null!=a.Variants?a.Variants.filter(o=>o.selected):""]}),n}getChannelProduct(e){const n=e.Variants;let a=[];for(let o of n)if(null!=o.Channel)for(let r of o.Channel)0==a.filter(d=>d.ChannelID==r.ChannelID).length&&a.push(r);return this.sortChannel(a)}successToastrScanAllProduct(e,n,a){if(a){const o=e?.NotInPOS?.Product?e?.NotInPOS?.Product:0,r=e?.InChannel?.Product?e?.InChannel?.Product:0;this.toastrService.success(`\n ${o+r} found in ${n.Name} </br>\n (${r} In POS + ${o} Not In Pos)\n `,"Scan Complete!",{enableHtml:!0})}else this.toastrService.success(`${e.InChannel?e.InChannel.Product:0} product updates in ${n.Name} </br> \n since ${e.LastUpdate}`,"Scan Complete!",{enableHtml:!0})}checkProductHasScanButton(e,n){let a;return e.map(o=>(o.Channel=this.getChannelProduct(o),a=this.filterUnselectedChannel([o],n),o.hasScan=a.length>0,o))}checkProductHasUploadBtn(e,n){let a;return e.map(o=>(o.Channel=this.getChannelProduct(o),a=this.filterUnselectedChannel([o],n),o.hasUpload=a.length>0,o))}showToastrUploadMultiple(e=[]){let n=[],a=[];if(e.forEach(o=>{"string"==typeof o?.Response?a=[...a,`<li>${o.Response}</li>`]:(o?.Response?.Success.forEach(r=>{n=[...n,`<li>Product ${r} was <b>successfully</b> uploaded to ${o.Name}</li>`]}),o?.Response.Fail.forEach(r=>{a=[...a,`<li>${r} in <b>${o.Name}</b></li>`]}))}),a.length>0&&n.length>0){const o=[...n,...a];this.toastrService.warning(this.concatMessage(o),"Warning!",{enableHtml:!0})}else n.length>0&&0==a.length?this.toastrService.success(this.concatMessage(n),"Success",{enableHtml:!0}):this.toastrService.error(this.concatMessage(a),"Error",{enableHtml:!0})}concatMessage(e=[]){let n="";return e.forEach(a=>{n+=a}),`<ol>${n}</ol>`}showToastrSuccessUploadSingle(e,n){let a=e.filter(d=>0==d.Status),o=e.filter(d=>1==d.Status),r=this.generateToastrMessage(a,o,n);this.toastrService.success(r.message,"Success",{enableHtml:!0})}showToastErrorUploadSingle(e,n){let a=e?.error?.Message.filter(d=>0==d.Status),o=e?.error?.Message.filter(d=>1==d.Status),r=this.generateToastrMessage(a,o,n);"WARNING"==r.status?this.toastrService.warning(r.message,"Warning!",{enableHtml:!0}):this.toastrService.error(r.message,`Error - ${e.status}`,{enableHtml:!0})}generateToastrMessage(e,n,a){let r,o="";return 0==e.length&&n.length>0?(r="SUCCESS",o=this.createSuccessResponse(n,a)):e.length>0&&0==n.length?(r="ERROR",o=this.createErrResponse(e,a)):(r="WARNING",o=`${this.createSuccessResponse(n,a)} ${this.createErrResponse(e,a)}`),o=`<ol>${o}</ol>`,{status:r,message:o}}createErrResponse(e,n){let a="";return e.forEach((o,r)=>{a+=`<li><b>${o.Response}</b> for ${n.Name} in ${o.Name}</li>`}),a}createSuccessResponse(e,n){let a="";return e.forEach((o,r)=>{a+=`<li>Product ${n.Name} was <b>successfully</b> uploaded to ${o.Name}</li>`}),a}getHostName(){if(_.g.IsEmpty(this.hostName)){const e=localStorage.getItem("Authorization");this.hostName=JSON.parse(e)?.Host}return this.hostName}}m.\u0275fac=function(e){return new(e||m)(t.LFG(I.O),t.LFG(v._W))},m.\u0275prov=t.Yz7({token:m,factory:m.\u0275fac,providedIn:"root"})}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[369],{9369:(Y,x,a)=>{a.r(x),a.d(x,{LoginModule:()=>p});var _=a(6895),s=a(4006),t=a(4650),c=a(284),b=a(1318);class m{constructor(e,o,i){this.route=e,this.http=o,this.service=i}ngOnInit(){this.route.queryParams.subscribe(e=>{this.code=e.code})}addChannelLazada(){this.http.post("/api/ChannelAdd/AddLazada",{Code:this.code}).subscribe(o=>{this.service.navigate(["/menu/channel"])})}}m.\u0275fac=function(e){return new(e||m)(t.Y36(c.gz),t.Y36(b.O),t.Y36(c.F0))},m.\u0275cmp=t.Xpm({type:m,selectors:[["app-lazada"]],decls:20,vars:1,consts:[[1,"container","h-100"],[1,"row","d-flex","justify-content-center","align-items-center","h-100"],[1,"col-md-4"],[1,"card"],[1,"card-header","text-center"],[1,"far","fa-check-circle","text-success",2,"font-size","115px"],[1,"h3","fw-bold"],[1,"card-body","text-center","py-6"],[1,"text-shopee","fw-bold"],["type","button",1,"btn","btn-success","mt-6",3,"click"],[1,"fas","fa-undo"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),t._UZ(5,"i",5),t.TgZ(6,"div",6),t._uU(7,"Success !"),t.qZA()(),t.TgZ(8,"div",7)(9,"div"),t._uU(10,"You have successfully authorized "),t.qZA(),t.TgZ(11,"div"),t._uU(12,"DEALPOS to manage your Lazada"),t.qZA(),t.TgZ(13,"div"),t._uU(14," Your Code is "),t.TgZ(15,"span",8),t._uU(16),t.qZA()(),t.TgZ(17,"button",9),t.NdJ("click",function(){return o.addChannelLazada()}),t._UZ(18,"i",10),t._uU(19," Add to my Channel"),t.qZA()()()()()()),2&e&&(t.xp6(16),t.Oqu(o.code))}});var v=a(1889),w=a(8703),Z=a(7185);class l{constructor(){}getBrowserName(){const e=window.navigator.userAgent.toLowerCase();switch(!0){case e.indexOf("edge")>-1||e.indexOf("edg")>-1:return"edge";case e.indexOf("opr")>-1:return"opera";case e.indexOf("chrome")>-1:return"chrome";case e.indexOf("trident")>-1:return"ie";case e.indexOf("firefox")>-1:return"firefox";case e.indexOf("safari")>-1:return"safari";default:return"other"}}}l.\u0275fac=function(e){return new(e||l)},l.\u0275prov=t.Yz7({token:l,factory:l.\u0275fac,providedIn:"root"});var M=a(501),C=a(4954);const O=["subdomainEl"];function y(n,e){if(1&n){const o=t.EpF();t.ynx(0),t.TgZ(1,"div",18)(2,"div",19)(3,"form")(4,"div",20)(5,"h2",21),t._uU(6,"Sign in"),t.qZA(),t.TgZ(7,"div",22)(8,"div",23)(9,"div",24)(10,"span",25),t._UZ(11,"i",26),t.qZA(),t.TgZ(12,"input",27,28),t.NdJ("ngModelChange",function(r){t.CHM(o);const d=t.oxw();return t.KtG(d.subdomain=r)}),t.qZA()()(),t.TgZ(14,"select",29),t.NdJ("ngModelChange",function(r){t.CHM(o);const d=t.oxw();return t.KtG(d.domain=r)}),t.TgZ(15,"option",30),t._uU(16,".dealpos.co.id"),t.qZA(),t.TgZ(17,"option",31),t._uU(18,".dealpos.net"),t.qZA(),t.TgZ(19,"option",32),t._uU(20,".dealpos.com"),t.qZA()()()(),t.TgZ(21,"div",33)(22,"button",34),t.NdJ("click",function(){t.CHM(o);const r=t.oxw();return t.KtG(r.onNextState())}),t._uU(23," Next "),t.qZA()()()()(),t.BQk()}if(2&n){const o=t.oxw();t.xp6(12),t.Q6J("ngModel",o.subdomain),t.xp6(2),t.Q6J("ngModel",o.domain)}}function A(n,e){1&n&&(t.TgZ(0,"p"),t._uU(1," Username is required "),t.qZA())}function T(n,e){if(1&n&&(t.TgZ(0,"div",58),t.YNc(1,A,2,0,"p",59),t.qZA()),2&n){t.oxw();const o=t.MAs(13);t.xp6(1),t.Q6J("ngIf",o.errors.required)}}const P=function(n,e){return{"fa-eye":n,"fa-eye-slash":e}};function k(n,e){if(1&n){const o=t.EpF();t.TgZ(0,"i",60),t.NdJ("click",function(){t.CHM(o);const r=t.oxw(2);return t.KtG(r.hideShowPassword())}),t.qZA()}if(2&n){const o=t.oxw(2);t.Q6J("ngClass",t.WLB(1,P,"eye-off"==o.passwordIcon,"eye"==o.passwordIcon))}}function U(n,e){1&n&&(t.TgZ(0,"p"),t._uU(1," Password is required "),t.qZA())}function S(n,e){if(1&n&&(t.TgZ(0,"div",58),t.YNc(1,U,2,0,"p",59),t.qZA()),2&n){t.oxw();const o=t.MAs(19);t.xp6(1),t.Q6J("ngIf",o.errors.required)}}function q(n,e){if(1&n){const o=t.EpF();t.TgZ(0,"div",18)(1,"div",19)(2,"div",35)(3,"h2",21),t._uU(4,"Sign in"),t.qZA(),t.TgZ(5,"div",36),t._uU(6," to "),t.TgZ(7,"h6",37),t._uU(8),t.qZA(),t.TgZ(9,"i",38),t.NdJ("click",function(){t.CHM(o);const r=t.oxw();return t.KtG(r.onEditDomain())}),t.qZA()()(),t.TgZ(10,"form",39)(11,"div",40)(12,"input",41,42),t.NdJ("ngModelChange",function(r){t.CHM(o);const d=t.oxw();return t.KtG(d.username=r)}),t.qZA(),t.TgZ(14,"label",43),t._uU(15,"Username"),t.qZA(),t.YNc(16,T,2,1,"div",44),t.qZA(),t.TgZ(17,"div",45)(18,"input",46,47),t.NdJ("ngModelChange",function(r){t.CHM(o);const d=t.oxw();return t.KtG(d.password=r)}),t.qZA(),t.TgZ(20,"label",48),t._uU(21,"Password"),t.qZA(),t.YNc(22,k,1,4,"i",49),t.YNc(23,S,2,1,"div",44),t.qZA(),t.TgZ(24,"div",50)(25,"a",51),t._uU(26,"Forgot Password?"),t.qZA()(),t.TgZ(27,"div",52)(28,"button",53),t.NdJ("click",function(){t.CHM(o);const r=t.oxw();return t.KtG(r.onLogin())}),t._uU(29," Log in "),t.qZA()(),t.TgZ(30,"div",54),t._UZ(31,"hr"),t.TgZ(32,"span",55),t._uU(33,"or"),t.qZA(),t._UZ(34,"hr"),t.qZA(),t.TgZ(35,"div")(36,"button",56),t.NdJ("click",function(r){t.CHM(o);const d=t.oxw();return t.KtG(d.onLoginByGoogle(r))}),t._UZ(37,"i",57),t._uU(38," Sign In with Google "),t.qZA()()()()()}if(2&n){const o=t.MAs(13),i=t.MAs(19),r=t.oxw();t.xp6(8),t.AsE(" (",r.subdomain,"",r.domain,") "),t.xp6(4),t.Q6J("ngModel",r.username),t.xp6(4),t.Q6J("ngIf",o.invalid&&(o.dirty||o.touched)),t.xp6(2),t.Q6J("type",r.passwordType)("ngModel",r.password),t.xp6(4),t.Q6J("ngIf",""!=r.password&&"edge"!=r.browser),t.xp6(1),t.Q6J("ngIf",i.invalid&&(i.dirty||i.touched)),t.xp6(2),t.Q6J("href","https://"+r.subdomain+r.domain+"/ForgotPassword",t.LSH)}}class u{constructor(e,o,i,r,d,I){this._router=e,this.elementRef=o,this.toastr=i,this.checkBrowser=r,this.authService=d,this.ngxPermission=I,this.domain=".dealpos.co.id",this.loginState="FORM_DOMAIN",this.passwordType="password",this.passwordIcon="eye-off"}ngOnInit(){this.initLogin(),this.elementRef.nativeElement.ownerDocument.body.style.backgroundColor="#dfeffc",this.browser=this.checkBrowser.getBrowserName()}ngAfterViewInit(){this.setAutoFocusDomain()}initLogin(){const e=JSON.parse(localStorage.getItem("Authorization"));this.username=e?.username,this.subdomain=e?.Host?.split(".dealpos")[0];const o=e?.Host?.split(".dealpos")[1];this.domain=".co.id"==o?".dealpos.co.id":".net"==o?".dealpos.net":".dealpos.com",this.authService.isActiveToken()&&this._router.navigate(["menu"])}onNextState(){v.g.IsEmpty(this.subdomain)?this.toastr.warning("Account Domain is required","Warning"):(this.parseSubdomain(),this.loginState="FORM_AUTH")}parseSubdomain(){let e=this.subdomain.indexOf(".dealpos");-1!=e&&(this.subdomain=this.subdomain.substring(0,e))}onEditDomain(){this.loginState="FORM_DOMAIN"}onLogin(){this.authService.login({Host:`${this.subdomain}${this.domain}`,Username:this.username,Password:this.password}).subscribe(o=>{this.onSuccessLogin(o)})}onLoginByGoogle(e){this.authService.loginWithGoogle(e,`${this.subdomain}${this.domain}`).subscribe(i=>{this.onSuccessLogin(i)})}onSuccessLogin(e){this.ngxPermission.hasPermission([w.G.dashboardView]).then(o=>{this._router.navigate(o?["menu/dashboard"]:e.Channel.length<1?["menu/channel"]:["menu/products"])})}setAutoFocusDomain(){this.subdomainEl.nativeElement.focus()}hideShowPassword(){this.passwordType="text"===this.passwordType?"password":"text",this.passwordIcon="eye-off"===this.passwordIcon?"eye":"eye-off"}ngOnDestroy(){this.elementRef.nativeElement.ownerDocument.body.style.backgroundColor="white"}}u.\u0275fac=function(e){return new(e||u)(t.Y36(c.F0),t.Y36(t.SBq),t.Y36(Z._W),t.Y36(l),t.Y36(M.e),t.Y36(C.YI))},u.\u0275cmp=t.Xpm({type:u,selectors:[["app-login"]],viewQuery:function(e,o){if(1&e&&t.Gf(O,5),2&e){let i;t.iGM(i=t.CRH())&&(o.subdomainEl=i.first)}},decls:30,vars:8,consts:[[1,"container"],[1,"row","mt-md-0","align-self-center"],[1,"col-12","col-md-7","text-center"],[1,"big-display","robotoslab","d-none","d-sm-block"],["ngSrc","https://res.cloudinary.com/pos/image/upload/v1687829600/APP/New_Omnichannel.png","alt","integration-image",1,"img-fluid",3,"width","height"],[1,"col-12","col-md-5","order-first","order-md-last","mt-12"],[1,"big-display","text-center","my-5","py-5","robotoslab","d-block","d-sm-none"],[4,"ngIf","ngIfElse"],["USR_PASS",""],[1,"col-12","d-block","d-md-none","text-center"],[1,"pt-8","me-3"],["target","_blank","href","https://www.dealpos.com"],["ngSrc","https://res.cloudinary.com/pos/image/upload/POS/Images/Login/dealpos.png","alt","dealpos-logo",1,"img-fluid",3,"width","height"],["target","_blank","href","https://changelog.dealpos.com/?categories=cat_nILYcoEQzgGWX&view=complete",1,"pt-8","font-italic"],[1,"mx-5","pb-5","mb-5","d-none","d-md-block"],[1,"row","justify-content-between","align-items-center"],[1,"col-auto","d-inline-flex"],[1,"col-auto"],[1,"card"],[1,"card-body","p-8"],[1,"card-title"],[1,"fw-normal","font-xl","robotoslab"],[1,"d-flex","align-items-center","mt-6"],[1,"mt-7","w-75","rounded-end-0"],[1,"input-group","mb-3"],["id","basic-addon1",1,"input-group-text","border-end-0","rounded-start"],[1,"fa-solid","fa-cloud"],["type","text","required","","name","subdomain","id","inputHost","placeholder","Store Address",1,"form-control","text-start","subdomain-input","border-start-0",2,"padding-left","0px",3,"ngModel","ngModelChange"],["subdomainEl",""],["name","domainOption",1,"form-select","form-control","border-start-0","mt-4","rounded-end","rounded-start-0","domain-option",3,"ngModel","ngModelChange"],["selected","","value",".dealpos.co.id"],["value",".dealpos.net"],["value",".dealpos.com"],[1,"w-100","mt-10"],["name","next","data-cy","next","type","submit",1,"btn","btn-lg","btn-primary","btn-block","font125rem","robotoslab","w-100",3,"click"],[1,"card-title","d-flex","align-items-center"],[1,"pt-2","ms-2"],[1,"fw-bold","me-2","robotoslab","d-inline-block","text-primary"],[1,"fa-solid","fa-edit","link-primary","fs-5","pointer",3,"click"],[1,"mt-10"],[1,"form-label-group"],["autofocus","","type","text","name","Username","id","inputUsername","placeholder","Username","required","",1,"form-control","text-start",3,"ngModel","ngModelChange"],["usernameCtrl","ngModel"],["for","inputUsername",1,"text-start"],["class","text-danger",4,"ngIf"],[1,"form-label-group","mb-5","mb-sm-1"],["name","Password","id","inputPassword","placeholder","Password","required","",1,"form-control","text-start",3,"type","ngModel","ngModelChange"],["passwordCtrl","ngModel"],["for","inputPassword",1,"text-start"],["class","passwordIcon fas fa-lg",3,"ngClass","click",4,"ngIf"],[1,"text-end","mt-3"],[3,"href"],[1,"w-100","mt-8"],["data-cy","login","type","submit",1,"btn","btn-lg","btn-primary","btn-block","font125rem","robotoslab","w-100",3,"click"],[1,"divider","d-flex","align-items-center","justify-content-center"],[1,"mx-4","text-muted"],[1,"btn","btn-social-login","text-primary","w-100","fw-bold",3,"click"],[1,"fa-brands","fa-google"],[1,"text-danger"],[4,"ngIf"],[1,"passwordIcon","fas","fa-lg",3,"ngClass","click"]],template:function(e,o){if(1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"h1",3),t._uU(4," DealPOS Omnichannel "),t.qZA(),t._UZ(5,"img",4),t.qZA(),t.TgZ(6,"div",5)(7,"h1",6),t._uU(8," DealPOS Omnichannel "),t.qZA(),t.YNc(9,y,24,2,"ng-container",7),t.YNc(10,q,39,9,"ng-template",null,8,t.W1O),t.qZA(),t.TgZ(12,"div",9)(13,"p",10),t._uU(14,"Powered by :"),t.qZA(),t.TgZ(15,"a",11),t._UZ(16,"img",12),t.qZA(),t._UZ(17,"br"),t.TgZ(18,"a",13),t._uU(19,"Version 2.9.2"),t.qZA()()()(),t.TgZ(20,"footer",14)(21,"div",15)(22,"div",16)(23,"p",10),t._uU(24,"Powered by :"),t.qZA(),t.TgZ(25,"a",11),t._UZ(26,"img",12),t.qZA()(),t.TgZ(27,"div",17)(28,"a",13),t._uU(29,"Version 2.9.2"),t.qZA()()()()),2&e){const i=t.MAs(11);t.xp6(5),t.Q6J("width",350)("height",273),t.xp6(4),t.Q6J("ngIf","FORM_DOMAIN"==o.loginState)("ngIfElse",i),t.xp6(7),t.Q6J("width",130)("height",73),t.xp6(10),t.Q6J("width",130)("height",73)}},dependencies:[_.mk,_.O5,s._Y,s.YN,s.Kr,s.Fj,s.EJ,s.JJ,s.JL,s.Q7,s.On,s.F,_.Zd],styles:[".container[_ngcontent-%COMP%]{position:absolute;max-width:100%}.card[_ngcontent-%COMP%]{margin-bottom:30px;padding-bottom:5px;padding-top:5px}.passwordIcon[_ngcontent-%COMP%]{top:1.8rem;right:.8rem;position:absolute;margin:0 auto!important;cursor:pointer}.big-display[_ngcontent-%COMP%]{font-size:2rem;font-weight:300;line-height:1.2}@media (min-width: 768px){.container[_ngcontent-%COMP%]{max-width:70%;top:50%;left:50%;transform:translate(-50%) translateY(-50%)}.big-display[_ngcontent-%COMP%]{font-size:3rem}}footer[_ngcontent-%COMP%]{position:absolute;bottom:0;width:90%;left:3rem}.form-label-group[_ngcontent-%COMP%] > label[_ngcontent-%COMP%]{color:#666}.font-xl[_ngcontent-%COMP%]{font-size:x-large}.font125rem[_ngcontent-%COMP%]{font-size:1.25rem}.robotoslab[_ngcontent-%COMP%]{font-family:Roboto Slab}div.divider[_ngcontent-%COMP%] > hr[_ngcontent-%COMP%]{margin-top:1.2rem;margin-bottom:1.2rem;border-top:1px solid rgba(0,0,0,.855);width:20%}button.btn-social-login[_ngcontent-%COMP%]{border:1px solid var(--bs-primary)}.fa-google[_ngcontent-%COMP%]{background:conic-gradient(from -45deg,#ea4335 110deg,#4285f4 90deg 180deg,#34a853 180deg 270deg,#fbbc05 270deg) 73% 55%/150% 150% no-repeat;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent}.domain-option[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem;color:#343434;font-size:.875rem;border-color:#c8d3df;width:10rem}.subdomain-input[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem;color:#343434;font-size:.875rem;border-color:#c8d3df}.form-select[_ngcontent-%COMP%]:focus{border:solid 1.5px #1A73E8!important;box-shadow:none!important}"]});class h{constructor(e,o,i){this.route=e,this.http=o,this.service=i}ngOnInit(){this.route.queryParams.subscribe(e=>{this.shopID=e.shop_id,this.code=e.code})}addShopee(){let e={ShopID:Number(this.shopID),Code:this.code};this.http.post("/api/ChannelAdd/ShopeeV2",e).subscribe(i=>{this.service.navigate(["/menu/channel"])})}}h.\u0275fac=function(e){return new(e||h)(t.Y36(c.gz),t.Y36(b.O),t.Y36(c.F0))},h.\u0275cmp=t.Xpm({type:h,selectors:[["shopee-authorized"]],decls:20,vars:1,consts:[[1,"container","h-100"],[1,"row","d-flex","justify-content-center","align-items-center","h-100"],[1,"col-md-4"],[1,"card"],[1,"card-header","text-center"],[1,"far","fa-check-circle","text-success",2,"font-size","115px"],[1,"h3","fw-bold"],[1,"card-body","text-center","py-6"],[1,"text-shopee","fw-bold"],["type","button",1,"btn","btn-success","mt-t",3,"click"],[1,"fas","fa-undo"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),t._UZ(5,"i",5),t.TgZ(6,"div",6),t._uU(7,"Success !"),t.qZA()(),t.TgZ(8,"div",7)(9,"div"),t._uU(10,"You have successfully authorized "),t.qZA(),t.TgZ(11,"div"),t._uU(12,"DEALPOS to manage your Shopee"),t.qZA(),t.TgZ(13,"div"),t._uU(14," Your shopID is "),t.TgZ(15,"span",8),t._uU(16),t.qZA()(),t.TgZ(17,"button",9),t.NdJ("click",function(){return o.addShopee()}),t._UZ(18,"i",10),t._uU(19," Add to my Channel"),t.qZA()()()()()()),2&e&&(t.xp6(16),t.Oqu(o.shopID))},styles:[".container[_ngcontent-%COMP%]{position:absolute;max-width:100%}.card[_ngcontent-%COMP%]{margin-bottom:30px;padding-bottom:5px;padding-top:5px}.passwordIcon[_ngcontent-%COMP%]{top:1.8rem;right:.8rem;position:absolute;margin:0 auto!important;cursor:pointer}.big-display[_ngcontent-%COMP%]{font-size:2rem;font-weight:300;line-height:1.2}@media (min-width: 768px){.container[_ngcontent-%COMP%]{max-width:70%;top:50%;left:50%;transform:translate(-50%) translateY(-50%)}.big-display[_ngcontent-%COMP%]{font-size:3rem}}footer[_ngcontent-%COMP%]{position:absolute;bottom:0;width:90%;left:3rem}.form-label-group[_ngcontent-%COMP%] > label[_ngcontent-%COMP%]{color:#666}.font-xl[_ngcontent-%COMP%]{font-size:x-large}.font125rem[_ngcontent-%COMP%]{font-size:1.25rem}.robotoslab[_ngcontent-%COMP%]{font-family:Roboto Slab}div.divider[_ngcontent-%COMP%] > hr[_ngcontent-%COMP%]{margin-top:1.2rem;margin-bottom:1.2rem;border-top:1px solid rgba(0,0,0,.855);width:20%}button.btn-social-login[_ngcontent-%COMP%]{border:1px solid var(--bs-primary)}.fa-google[_ngcontent-%COMP%]{background:conic-gradient(from -45deg,#ea4335 110deg,#4285f4 90deg 180deg,#34a853 180deg 270deg,#fbbc05 270deg) 73% 55%/150% 150% no-repeat;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent}.domain-option[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem;color:#343434;font-size:.875rem;border-color:#c8d3df;width:10rem}.subdomain-input[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem;color:#343434;font-size:.875rem;border-color:#c8d3df}.form-select[_ngcontent-%COMP%]:focus{border:solid 1.5px #1A73E8!important;box-shadow:none!important}.form-signin[_ngcontent-%COMP%]{max-width:600px}.card[_ngcontent-%COMP%]{font:100 14px/25px Roboto,Helvetica Neue,sans-serif;border-radius:13px;box-sizing:border-box}.text-shopee[_ngcontent-%COMP%]{color:#f53d2d}"]});class f{constructor(e,o,i){this.route=e,this.http=o,this.service=i}ngOnInit(){this.route.queryParams.subscribe(e=>{this.code=e.code,this.state=e.state})}addChannelTiktok(){this.http.post("/api/ChannelAdd/AddTiktok",{Code:this.code}).subscribe(o=>{this.service.navigate(["/menu/channel"])})}}f.\u0275fac=function(e){return new(e||f)(t.Y36(c.gz),t.Y36(b.O),t.Y36(c.F0))},f.\u0275cmp=t.Xpm({type:f,selectors:[["app-tiktok"]],decls:24,vars:2,consts:[[1,"container","h-100"],[1,"row","d-flex","justify-content-center","align-items-center","h-100"],[1,"col-md-4"],[1,"card"],[1,"card-header","text-center"],[1,"far","fa-check-circle","text-success",2,"font-size","115px"],[1,"h3","fw-bold"],[1,"card-body","text-center","py-6"],[1,"text-shopee","fw-bold"],["type","button",1,"btn","btn-success","mt-6",3,"click"],[1,"fas","fa-undo"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),t._UZ(5,"i",5),t.TgZ(6,"div",6),t._uU(7,"Success !"),t.qZA()(),t.TgZ(8,"div",7)(9,"div"),t._uU(10,"You have successfully authorized "),t.qZA(),t.TgZ(11,"div"),t._uU(12,"DEALPOS to manage your Tiktok"),t.qZA(),t.TgZ(13,"div"),t._uU(14," Your Code is "),t.TgZ(15,"span",8),t._uU(16),t.qZA()(),t.TgZ(17,"div"),t._uU(18," Your State is "),t.TgZ(19,"span",8),t._uU(20),t.qZA()(),t.TgZ(21,"button",9),t.NdJ("click",function(){return o.addChannelTiktok()}),t._UZ(22,"i",10),t._uU(23," Add to my Channel"),t.qZA()()()()()()),2&e&&(t.xp6(16),t.Oqu(o.code),t.xp6(4),t.Oqu(o.state))},styles:[".container[_ngcontent-%COMP%]{position:absolute;max-width:100%}.card[_ngcontent-%COMP%]{margin-bottom:30px;padding-bottom:5px;padding-top:5px}.passwordIcon[_ngcontent-%COMP%]{top:1.8rem;right:.8rem;position:absolute;margin:0 auto!important;cursor:pointer}.big-display[_ngcontent-%COMP%]{font-size:2rem;font-weight:300;line-height:1.2}@media (min-width: 768px){.container[_ngcontent-%COMP%]{max-width:70%;top:50%;left:50%;transform:translate(-50%) translateY(-50%)}.big-display[_ngcontent-%COMP%]{font-size:3rem}}footer[_ngcontent-%COMP%]{position:absolute;bottom:0;width:90%;left:3rem}.form-label-group[_ngcontent-%COMP%] > label[_ngcontent-%COMP%]{color:#666}.font-xl[_ngcontent-%COMP%]{font-size:x-large}.font125rem[_ngcontent-%COMP%]{font-size:1.25rem}.robotoslab[_ngcontent-%COMP%]{font-family:Roboto Slab}div.divider[_ngcontent-%COMP%] > hr[_ngcontent-%COMP%]{margin-top:1.2rem;margin-bottom:1.2rem;border-top:1px solid rgba(0,0,0,.855);width:20%}button.btn-social-login[_ngcontent-%COMP%]{border:1px solid var(--bs-primary)}.fa-google[_ngcontent-%COMP%]{background:conic-gradient(from -45deg,#ea4335 110deg,#4285f4 90deg 180deg,#34a853 180deg 270deg,#fbbc05 270deg) 73% 55%/150% 150% no-repeat;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent}.domain-option[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem;color:#343434;font-size:.875rem;border-color:#c8d3df;width:10rem}.subdomain-input[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem;color:#343434;font-size:.875rem;border-color:#c8d3df}.form-select[_ngcontent-%COMP%]:focus{border:solid 1.5px #1A73E8!important;box-shadow:none!important}.form-signin[_ngcontent-%COMP%]{max-width:600px}.card[_ngcontent-%COMP%]{font:100 14px/25px Roboto,Helvetica Neue,sans-serif;border-radius:13px;box-sizing:border-box}.text-shopee[_ngcontent-%COMP%]{color:#f53d2d}"]});const L=[{path:"",component:u,data:{title:"Dealpos x Marketplace"}},{path:"shopee",component:h,data:{title:"Success"}},{path:"tiktok",component:f,data:{title:"Success"}},{path:"lazada",component:m,data:{title:"Success"}}];class g{}g.\u0275fac=function(e){return new(e||g)},g.\u0275mod=t.oAB({type:g}),g.\u0275inj=t.cJS({imports:[c.Bz.forChild(L),c.Bz]});var z=a(8796);class p{}p.\u0275fac=function(e){return new(e||p)},p.\u0275mod=t.oAB({type:p}),p.\u0275inj=t.cJS({imports:[_.ez,s.u5,g,z.A0,C.VI]})}}]);
|
|
1
|
+
"use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[369],{9369:(Y,x,a)=>{a.r(x),a.d(x,{LoginModule:()=>p});var _=a(6895),s=a(4006),t=a(4650),c=a(284),b=a(1318);class m{constructor(e,o,i){this.route=e,this.http=o,this.service=i}ngOnInit(){this.route.queryParams.subscribe(e=>{this.code=e.code})}addChannelLazada(){this.http.post("/api/ChannelAdd/AddLazada",{Code:this.code}).subscribe(o=>{this.service.navigate(["/menu/channel"])})}}m.\u0275fac=function(e){return new(e||m)(t.Y36(c.gz),t.Y36(b.O),t.Y36(c.F0))},m.\u0275cmp=t.Xpm({type:m,selectors:[["app-lazada"]],decls:20,vars:1,consts:[[1,"container","h-100"],[1,"row","d-flex","justify-content-center","align-items-center","h-100"],[1,"col-md-4"],[1,"card"],[1,"card-header","text-center"],[1,"far","fa-check-circle","text-success",2,"font-size","115px"],[1,"h3","fw-bold"],[1,"card-body","text-center","py-6"],[1,"text-shopee","fw-bold"],["type","button",1,"btn","btn-success","mt-6",3,"click"],[1,"fas","fa-undo"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),t._UZ(5,"i",5),t.TgZ(6,"div",6),t._uU(7,"Success !"),t.qZA()(),t.TgZ(8,"div",7)(9,"div"),t._uU(10,"You have successfully authorized "),t.qZA(),t.TgZ(11,"div"),t._uU(12,"DEALPOS to manage your Lazada"),t.qZA(),t.TgZ(13,"div"),t._uU(14," Your Code is "),t.TgZ(15,"span",8),t._uU(16),t.qZA()(),t.TgZ(17,"button",9),t.NdJ("click",function(){return o.addChannelLazada()}),t._UZ(18,"i",10),t._uU(19," Add to my Channel"),t.qZA()()()()()()),2&e&&(t.xp6(16),t.Oqu(o.code))}});var v=a(1889),w=a(8703),Z=a(7185);class l{constructor(){}getBrowserName(){const e=window.navigator.userAgent.toLowerCase();switch(!0){case e.indexOf("edge")>-1||e.indexOf("edg")>-1:return"edge";case e.indexOf("opr")>-1:return"opera";case e.indexOf("chrome")>-1:return"chrome";case e.indexOf("trident")>-1:return"ie";case e.indexOf("firefox")>-1:return"firefox";case e.indexOf("safari")>-1:return"safari";default:return"other"}}}l.\u0275fac=function(e){return new(e||l)},l.\u0275prov=t.Yz7({token:l,factory:l.\u0275fac,providedIn:"root"});var M=a(501),C=a(4954);const O=["subdomainEl"];function y(n,e){if(1&n){const o=t.EpF();t.ynx(0),t.TgZ(1,"div",18)(2,"div",19)(3,"form")(4,"div",20)(5,"h2",21),t._uU(6,"Sign in"),t.qZA(),t.TgZ(7,"div",22)(8,"div",23)(9,"div",24)(10,"span",25),t._UZ(11,"i",26),t.qZA(),t.TgZ(12,"input",27,28),t.NdJ("ngModelChange",function(r){t.CHM(o);const d=t.oxw();return t.KtG(d.subdomain=r)}),t.qZA()()(),t.TgZ(14,"select",29),t.NdJ("ngModelChange",function(r){t.CHM(o);const d=t.oxw();return t.KtG(d.domain=r)}),t.TgZ(15,"option",30),t._uU(16,".dealpos.co.id"),t.qZA(),t.TgZ(17,"option",31),t._uU(18,".dealpos.net"),t.qZA(),t.TgZ(19,"option",32),t._uU(20,".dealpos.com"),t.qZA()()()(),t.TgZ(21,"div",33)(22,"button",34),t.NdJ("click",function(){t.CHM(o);const r=t.oxw();return t.KtG(r.onNextState())}),t._uU(23," Next "),t.qZA()()()()(),t.BQk()}if(2&n){const o=t.oxw();t.xp6(12),t.Q6J("ngModel",o.subdomain),t.xp6(2),t.Q6J("ngModel",o.domain)}}function A(n,e){1&n&&(t.TgZ(0,"p"),t._uU(1," Username is required "),t.qZA())}function T(n,e){if(1&n&&(t.TgZ(0,"div",58),t.YNc(1,A,2,0,"p",59),t.qZA()),2&n){t.oxw();const o=t.MAs(13);t.xp6(1),t.Q6J("ngIf",o.errors.required)}}const P=function(n,e){return{"fa-eye":n,"fa-eye-slash":e}};function k(n,e){if(1&n){const o=t.EpF();t.TgZ(0,"i",60),t.NdJ("click",function(){t.CHM(o);const r=t.oxw(2);return t.KtG(r.hideShowPassword())}),t.qZA()}if(2&n){const o=t.oxw(2);t.Q6J("ngClass",t.WLB(1,P,"eye-off"==o.passwordIcon,"eye"==o.passwordIcon))}}function U(n,e){1&n&&(t.TgZ(0,"p"),t._uU(1," Password is required "),t.qZA())}function S(n,e){if(1&n&&(t.TgZ(0,"div",58),t.YNc(1,U,2,0,"p",59),t.qZA()),2&n){t.oxw();const o=t.MAs(19);t.xp6(1),t.Q6J("ngIf",o.errors.required)}}function q(n,e){if(1&n){const o=t.EpF();t.TgZ(0,"div",18)(1,"div",19)(2,"div",35)(3,"h2",21),t._uU(4,"Sign in"),t.qZA(),t.TgZ(5,"div",36),t._uU(6," to "),t.TgZ(7,"h6",37),t._uU(8),t.qZA(),t.TgZ(9,"i",38),t.NdJ("click",function(){t.CHM(o);const r=t.oxw();return t.KtG(r.onEditDomain())}),t.qZA()()(),t.TgZ(10,"form",39)(11,"div",40)(12,"input",41,42),t.NdJ("ngModelChange",function(r){t.CHM(o);const d=t.oxw();return t.KtG(d.username=r)}),t.qZA(),t.TgZ(14,"label",43),t._uU(15,"Username"),t.qZA(),t.YNc(16,T,2,1,"div",44),t.qZA(),t.TgZ(17,"div",45)(18,"input",46,47),t.NdJ("ngModelChange",function(r){t.CHM(o);const d=t.oxw();return t.KtG(d.password=r)}),t.qZA(),t.TgZ(20,"label",48),t._uU(21,"Password"),t.qZA(),t.YNc(22,k,1,4,"i",49),t.YNc(23,S,2,1,"div",44),t.qZA(),t.TgZ(24,"div",50)(25,"a",51),t._uU(26,"Forgot Password?"),t.qZA()(),t.TgZ(27,"div",52)(28,"button",53),t.NdJ("click",function(){t.CHM(o);const r=t.oxw();return t.KtG(r.onLogin())}),t._uU(29," Log in "),t.qZA()(),t.TgZ(30,"div",54),t._UZ(31,"hr"),t.TgZ(32,"span",55),t._uU(33,"or"),t.qZA(),t._UZ(34,"hr"),t.qZA(),t.TgZ(35,"div")(36,"button",56),t.NdJ("click",function(r){t.CHM(o);const d=t.oxw();return t.KtG(d.onLoginByGoogle(r))}),t._UZ(37,"i",57),t._uU(38," Sign In with Google "),t.qZA()()()()()}if(2&n){const o=t.MAs(13),i=t.MAs(19),r=t.oxw();t.xp6(8),t.AsE(" (",r.subdomain,"",r.domain,") "),t.xp6(4),t.Q6J("ngModel",r.username),t.xp6(4),t.Q6J("ngIf",o.invalid&&(o.dirty||o.touched)),t.xp6(2),t.Q6J("type",r.passwordType)("ngModel",r.password),t.xp6(4),t.Q6J("ngIf",""!=r.password&&"edge"!=r.browser),t.xp6(1),t.Q6J("ngIf",i.invalid&&(i.dirty||i.touched)),t.xp6(2),t.Q6J("href","https://"+r.subdomain+r.domain+"/ForgotPassword",t.LSH)}}class u{constructor(e,o,i,r,d,I){this._router=e,this.elementRef=o,this.toastr=i,this.checkBrowser=r,this.authService=d,this.ngxPermission=I,this.domain=".dealpos.co.id",this.loginState="FORM_DOMAIN",this.passwordType="password",this.passwordIcon="eye-off"}ngOnInit(){this.initLogin(),this.elementRef.nativeElement.ownerDocument.body.style.backgroundColor="#dfeffc",this.browser=this.checkBrowser.getBrowserName()}ngAfterViewInit(){this.setAutoFocusDomain()}initLogin(){const e=JSON.parse(localStorage.getItem("Authorization"));this.username=e?.username,this.subdomain=e?.Host?.split(".dealpos")[0];const o=e?.Host?.split(".dealpos")[1];this.domain=".co.id"==o?".dealpos.co.id":".net"==o?".dealpos.net":".dealpos.com",this.authService.isActiveToken()&&this._router.navigate(["menu"])}onNextState(){v.g.IsEmpty(this.subdomain)?this.toastr.warning("Account Domain is required","Warning"):(this.parseSubdomain(),this.loginState="FORM_AUTH")}parseSubdomain(){let e=this.subdomain.indexOf(".dealpos");-1!=e&&(this.subdomain=this.subdomain.substring(0,e))}onEditDomain(){this.loginState="FORM_DOMAIN"}onLogin(){this.authService.login({Host:`${this.subdomain}${this.domain}`,Username:this.username,Password:this.password}).subscribe(o=>{this.onSuccessLogin(o)})}onLoginByGoogle(e){this.authService.loginWithGoogle(e,`${this.subdomain}${this.domain}`).subscribe(i=>{this.onSuccessLogin(i)})}onSuccessLogin(e){this.ngxPermission.hasPermission([w.G.dashboardView]).then(o=>{this._router.navigate(o?["menu/dashboard"]:e.Channel.length<1?["menu/channel"]:["menu/products"])})}setAutoFocusDomain(){this.subdomainEl.nativeElement.focus()}hideShowPassword(){this.passwordType="text"===this.passwordType?"password":"text",this.passwordIcon="eye-off"===this.passwordIcon?"eye":"eye-off"}ngOnDestroy(){this.elementRef.nativeElement.ownerDocument.body.style.backgroundColor="white"}}u.\u0275fac=function(e){return new(e||u)(t.Y36(c.F0),t.Y36(t.SBq),t.Y36(Z._W),t.Y36(l),t.Y36(M.e),t.Y36(C.YI))},u.\u0275cmp=t.Xpm({type:u,selectors:[["app-login"]],viewQuery:function(e,o){if(1&e&&t.Gf(O,5),2&e){let i;t.iGM(i=t.CRH())&&(o.subdomainEl=i.first)}},decls:30,vars:8,consts:[[1,"container"],[1,"row","mt-md-0","align-self-center"],[1,"col-12","col-md-7","text-center"],[1,"big-display","robotoslab","d-none","d-sm-block"],["ngSrc","https://res.cloudinary.com/pos/image/upload/v1687829600/APP/New_Omnichannel.png","alt","integration-image",1,"img-fluid",3,"width","height"],[1,"col-12","col-md-5","order-first","order-md-last","mt-12"],[1,"big-display","text-center","my-5","py-5","robotoslab","d-block","d-sm-none"],[4,"ngIf","ngIfElse"],["USR_PASS",""],[1,"col-12","d-block","d-md-none","text-center"],[1,"pt-8","me-3"],["target","_blank","href","https://www.dealpos.com"],["ngSrc","https://res.cloudinary.com/pos/image/upload/POS/Images/Login/dealpos.png","alt","dealpos-logo",1,"img-fluid",3,"width","height"],["target","_blank","href","https://changelog.dealpos.com/?categories=cat_nILYcoEQzgGWX&view=complete",1,"pt-8","font-italic"],[1,"mx-5","pb-5","mb-5","d-none","d-md-block"],[1,"row","justify-content-between","align-items-center"],[1,"col-auto","d-inline-flex"],[1,"col-auto"],[1,"card"],[1,"card-body","p-8"],[1,"card-title"],[1,"fw-normal","font-xl","robotoslab"],[1,"d-flex","align-items-center","mt-6"],[1,"mt-7","w-75","rounded-end-0"],[1,"input-group","mb-3"],["id","basic-addon1",1,"input-group-text","border-end-0","rounded-start"],[1,"fa-solid","fa-cloud"],["type","text","required","","name","subdomain","id","inputHost","placeholder","Store Address",1,"form-control","text-start","subdomain-input","border-start-0",2,"padding-left","0px",3,"ngModel","ngModelChange"],["subdomainEl",""],["name","domainOption",1,"form-select","form-control","border-start-0","mt-4","rounded-end","rounded-start-0","domain-option",3,"ngModel","ngModelChange"],["selected","","value",".dealpos.co.id"],["value",".dealpos.net"],["value",".dealpos.com"],[1,"w-100","mt-10"],["name","next","data-cy","next","type","submit",1,"btn","btn-lg","btn-primary","btn-block","font125rem","robotoslab","w-100",3,"click"],[1,"card-title","d-flex","align-items-center"],[1,"pt-2","ms-2"],[1,"fw-bold","me-2","robotoslab","d-inline-block","text-primary"],[1,"fa-solid","fa-edit","link-primary","fs-5","pointer",3,"click"],[1,"mt-10"],[1,"form-label-group"],["autofocus","","type","text","name","Username","id","inputUsername","placeholder","Username","required","",1,"form-control","text-start",3,"ngModel","ngModelChange"],["usernameCtrl","ngModel"],["for","inputUsername",1,"text-start"],["class","text-danger",4,"ngIf"],[1,"form-label-group","mb-5","mb-sm-1"],["name","Password","id","inputPassword","placeholder","Password","required","",1,"form-control","text-start",3,"type","ngModel","ngModelChange"],["passwordCtrl","ngModel"],["for","inputPassword",1,"text-start"],["class","passwordIcon fas fa-lg",3,"ngClass","click",4,"ngIf"],[1,"text-end","mt-3"],[3,"href"],[1,"w-100","mt-8"],["data-cy","login","type","submit",1,"btn","btn-lg","btn-primary","btn-block","font125rem","robotoslab","w-100",3,"click"],[1,"divider","d-flex","align-items-center","justify-content-center"],[1,"mx-4","text-muted"],[1,"btn","btn-social-login","text-primary","w-100","fw-bold",3,"click"],[1,"fa-brands","fa-google"],[1,"text-danger"],[4,"ngIf"],[1,"passwordIcon","fas","fa-lg",3,"ngClass","click"]],template:function(e,o){if(1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"h1",3),t._uU(4," DealPOS Omnichannel "),t.qZA(),t._UZ(5,"img",4),t.qZA(),t.TgZ(6,"div",5)(7,"h1",6),t._uU(8," DealPOS Omnichannel "),t.qZA(),t.YNc(9,y,24,2,"ng-container",7),t.YNc(10,q,39,9,"ng-template",null,8,t.W1O),t.qZA(),t.TgZ(12,"div",9)(13,"p",10),t._uU(14,"Powered by :"),t.qZA(),t.TgZ(15,"a",11),t._UZ(16,"img",12),t.qZA(),t._UZ(17,"br"),t.TgZ(18,"a",13),t._uU(19,"Version 2.9.4"),t.qZA()()()(),t.TgZ(20,"footer",14)(21,"div",15)(22,"div",16)(23,"p",10),t._uU(24,"Powered by :"),t.qZA(),t.TgZ(25,"a",11),t._UZ(26,"img",12),t.qZA()(),t.TgZ(27,"div",17)(28,"a",13),t._uU(29,"Version 2.9.4"),t.qZA()()()()),2&e){const i=t.MAs(11);t.xp6(5),t.Q6J("width",350)("height",273),t.xp6(4),t.Q6J("ngIf","FORM_DOMAIN"==o.loginState)("ngIfElse",i),t.xp6(7),t.Q6J("width",130)("height",73),t.xp6(10),t.Q6J("width",130)("height",73)}},dependencies:[_.mk,_.O5,s._Y,s.YN,s.Kr,s.Fj,s.EJ,s.JJ,s.JL,s.Q7,s.On,s.F,_.Zd],styles:[".container[_ngcontent-%COMP%]{position:absolute;max-width:100%}.card[_ngcontent-%COMP%]{margin-bottom:30px;padding-bottom:5px;padding-top:5px}.passwordIcon[_ngcontent-%COMP%]{top:1.8rem;right:.8rem;position:absolute;margin:0 auto!important;cursor:pointer}.big-display[_ngcontent-%COMP%]{font-size:2rem;font-weight:300;line-height:1.2}@media (min-width: 768px){.container[_ngcontent-%COMP%]{max-width:70%;top:50%;left:50%;transform:translate(-50%) translateY(-50%)}.big-display[_ngcontent-%COMP%]{font-size:3rem}}footer[_ngcontent-%COMP%]{position:absolute;bottom:0;width:90%;left:3rem}.form-label-group[_ngcontent-%COMP%] > label[_ngcontent-%COMP%]{color:#666}.font-xl[_ngcontent-%COMP%]{font-size:x-large}.font125rem[_ngcontent-%COMP%]{font-size:1.25rem}.robotoslab[_ngcontent-%COMP%]{font-family:Roboto Slab}div.divider[_ngcontent-%COMP%] > hr[_ngcontent-%COMP%]{margin-top:1.2rem;margin-bottom:1.2rem;border-top:1px solid rgba(0,0,0,.855);width:20%}button.btn-social-login[_ngcontent-%COMP%]{border:1px solid var(--bs-primary)}.fa-google[_ngcontent-%COMP%]{background:conic-gradient(from -45deg,#ea4335 110deg,#4285f4 90deg 180deg,#34a853 180deg 270deg,#fbbc05 270deg) 73% 55%/150% 150% no-repeat;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent}.domain-option[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem;color:#343434;font-size:.875rem;border-color:#c8d3df;width:10rem}.subdomain-input[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem;color:#343434;font-size:.875rem;border-color:#c8d3df}.form-select[_ngcontent-%COMP%]:focus{border:solid 1.5px #1A73E8!important;box-shadow:none!important}"]});class h{constructor(e,o,i){this.route=e,this.http=o,this.service=i}ngOnInit(){this.route.queryParams.subscribe(e=>{this.shopID=e.shop_id,this.code=e.code})}addShopee(){let e={ShopID:Number(this.shopID),Code:this.code};this.http.post("/api/ChannelAdd/ShopeeV2",e).subscribe(i=>{this.service.navigate(["/menu/channel"])})}}h.\u0275fac=function(e){return new(e||h)(t.Y36(c.gz),t.Y36(b.O),t.Y36(c.F0))},h.\u0275cmp=t.Xpm({type:h,selectors:[["shopee-authorized"]],decls:20,vars:1,consts:[[1,"container","h-100"],[1,"row","d-flex","justify-content-center","align-items-center","h-100"],[1,"col-md-4"],[1,"card"],[1,"card-header","text-center"],[1,"far","fa-check-circle","text-success",2,"font-size","115px"],[1,"h3","fw-bold"],[1,"card-body","text-center","py-6"],[1,"text-shopee","fw-bold"],["type","button",1,"btn","btn-success","mt-t",3,"click"],[1,"fas","fa-undo"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),t._UZ(5,"i",5),t.TgZ(6,"div",6),t._uU(7,"Success !"),t.qZA()(),t.TgZ(8,"div",7)(9,"div"),t._uU(10,"You have successfully authorized "),t.qZA(),t.TgZ(11,"div"),t._uU(12,"DEALPOS to manage your Shopee"),t.qZA(),t.TgZ(13,"div"),t._uU(14," Your shopID is "),t.TgZ(15,"span",8),t._uU(16),t.qZA()(),t.TgZ(17,"button",9),t.NdJ("click",function(){return o.addShopee()}),t._UZ(18,"i",10),t._uU(19," Add to my Channel"),t.qZA()()()()()()),2&e&&(t.xp6(16),t.Oqu(o.shopID))},styles:[".container[_ngcontent-%COMP%]{position:absolute;max-width:100%}.card[_ngcontent-%COMP%]{margin-bottom:30px;padding-bottom:5px;padding-top:5px}.passwordIcon[_ngcontent-%COMP%]{top:1.8rem;right:.8rem;position:absolute;margin:0 auto!important;cursor:pointer}.big-display[_ngcontent-%COMP%]{font-size:2rem;font-weight:300;line-height:1.2}@media (min-width: 768px){.container[_ngcontent-%COMP%]{max-width:70%;top:50%;left:50%;transform:translate(-50%) translateY(-50%)}.big-display[_ngcontent-%COMP%]{font-size:3rem}}footer[_ngcontent-%COMP%]{position:absolute;bottom:0;width:90%;left:3rem}.form-label-group[_ngcontent-%COMP%] > label[_ngcontent-%COMP%]{color:#666}.font-xl[_ngcontent-%COMP%]{font-size:x-large}.font125rem[_ngcontent-%COMP%]{font-size:1.25rem}.robotoslab[_ngcontent-%COMP%]{font-family:Roboto Slab}div.divider[_ngcontent-%COMP%] > hr[_ngcontent-%COMP%]{margin-top:1.2rem;margin-bottom:1.2rem;border-top:1px solid rgba(0,0,0,.855);width:20%}button.btn-social-login[_ngcontent-%COMP%]{border:1px solid var(--bs-primary)}.fa-google[_ngcontent-%COMP%]{background:conic-gradient(from -45deg,#ea4335 110deg,#4285f4 90deg 180deg,#34a853 180deg 270deg,#fbbc05 270deg) 73% 55%/150% 150% no-repeat;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent}.domain-option[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem;color:#343434;font-size:.875rem;border-color:#c8d3df;width:10rem}.subdomain-input[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem;color:#343434;font-size:.875rem;border-color:#c8d3df}.form-select[_ngcontent-%COMP%]:focus{border:solid 1.5px #1A73E8!important;box-shadow:none!important}.form-signin[_ngcontent-%COMP%]{max-width:600px}.card[_ngcontent-%COMP%]{font:100 14px/25px Roboto,Helvetica Neue,sans-serif;border-radius:13px;box-sizing:border-box}.text-shopee[_ngcontent-%COMP%]{color:#f53d2d}"]});class f{constructor(e,o,i){this.route=e,this.http=o,this.service=i}ngOnInit(){this.route.queryParams.subscribe(e=>{this.code=e.code,this.state=e.state})}addChannelTiktok(){this.http.post("/api/ChannelAdd/AddTiktok",{Code:this.code}).subscribe(o=>{this.service.navigate(["/menu/channel"])})}}f.\u0275fac=function(e){return new(e||f)(t.Y36(c.gz),t.Y36(b.O),t.Y36(c.F0))},f.\u0275cmp=t.Xpm({type:f,selectors:[["app-tiktok"]],decls:24,vars:2,consts:[[1,"container","h-100"],[1,"row","d-flex","justify-content-center","align-items-center","h-100"],[1,"col-md-4"],[1,"card"],[1,"card-header","text-center"],[1,"far","fa-check-circle","text-success",2,"font-size","115px"],[1,"h3","fw-bold"],[1,"card-body","text-center","py-6"],[1,"text-shopee","fw-bold"],["type","button",1,"btn","btn-success","mt-6",3,"click"],[1,"fas","fa-undo"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),t._UZ(5,"i",5),t.TgZ(6,"div",6),t._uU(7,"Success !"),t.qZA()(),t.TgZ(8,"div",7)(9,"div"),t._uU(10,"You have successfully authorized "),t.qZA(),t.TgZ(11,"div"),t._uU(12,"DEALPOS to manage your Tiktok"),t.qZA(),t.TgZ(13,"div"),t._uU(14," Your Code is "),t.TgZ(15,"span",8),t._uU(16),t.qZA()(),t.TgZ(17,"div"),t._uU(18," Your State is "),t.TgZ(19,"span",8),t._uU(20),t.qZA()(),t.TgZ(21,"button",9),t.NdJ("click",function(){return o.addChannelTiktok()}),t._UZ(22,"i",10),t._uU(23," Add to my Channel"),t.qZA()()()()()()),2&e&&(t.xp6(16),t.Oqu(o.code),t.xp6(4),t.Oqu(o.state))},styles:[".container[_ngcontent-%COMP%]{position:absolute;max-width:100%}.card[_ngcontent-%COMP%]{margin-bottom:30px;padding-bottom:5px;padding-top:5px}.passwordIcon[_ngcontent-%COMP%]{top:1.8rem;right:.8rem;position:absolute;margin:0 auto!important;cursor:pointer}.big-display[_ngcontent-%COMP%]{font-size:2rem;font-weight:300;line-height:1.2}@media (min-width: 768px){.container[_ngcontent-%COMP%]{max-width:70%;top:50%;left:50%;transform:translate(-50%) translateY(-50%)}.big-display[_ngcontent-%COMP%]{font-size:3rem}}footer[_ngcontent-%COMP%]{position:absolute;bottom:0;width:90%;left:3rem}.form-label-group[_ngcontent-%COMP%] > label[_ngcontent-%COMP%]{color:#666}.font-xl[_ngcontent-%COMP%]{font-size:x-large}.font125rem[_ngcontent-%COMP%]{font-size:1.25rem}.robotoslab[_ngcontent-%COMP%]{font-family:Roboto Slab}div.divider[_ngcontent-%COMP%] > hr[_ngcontent-%COMP%]{margin-top:1.2rem;margin-bottom:1.2rem;border-top:1px solid rgba(0,0,0,.855);width:20%}button.btn-social-login[_ngcontent-%COMP%]{border:1px solid var(--bs-primary)}.fa-google[_ngcontent-%COMP%]{background:conic-gradient(from -45deg,#ea4335 110deg,#4285f4 90deg 180deg,#34a853 180deg 270deg,#fbbc05 270deg) 73% 55%/150% 150% no-repeat;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent}.domain-option[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem;color:#343434;font-size:.875rem;border-color:#c8d3df;width:10rem}.subdomain-input[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem;color:#343434;font-size:.875rem;border-color:#c8d3df}.form-select[_ngcontent-%COMP%]:focus{border:solid 1.5px #1A73E8!important;box-shadow:none!important}.form-signin[_ngcontent-%COMP%]{max-width:600px}.card[_ngcontent-%COMP%]{font:100 14px/25px Roboto,Helvetica Neue,sans-serif;border-radius:13px;box-sizing:border-box}.text-shopee[_ngcontent-%COMP%]{color:#f53d2d}"]});const L=[{path:"",component:u,data:{title:"Dealpos x Marketplace"}},{path:"shopee",component:h,data:{title:"Success"}},{path:"tiktok",component:f,data:{title:"Success"}},{path:"lazada",component:m,data:{title:"Success"}}];class g{}g.\u0275fac=function(e){return new(e||g)},g.\u0275mod=t.oAB({type:g}),g.\u0275inj=t.cJS({imports:[c.Bz.forChild(L),c.Bz]});var z=a(8796);class p{}p.\u0275fac=function(e){return new(e||p)},p.\u0275mod=t.oAB({type:p}),p.\u0275inj=t.cJS({imports:[_.ez,s.u5,g,z.A0,C.VI]})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[379],{2379:(X,K,u)=>{u.r(K),u.d(K,{OrdersModule:()=>k});var g=u(6895),m=u(284),L=u(8703),e=u(4650),M=u(2937);class y{constructor(){this.ObjectOrderTabs=[{Title:"1 - New Order",Url:"/menu/Order/new",Permissions:[]},{Title:"2 - Ready to Ship",Url:"/menu/Order/ready_to_ship",Permissions:[]},{Title:"3 - Shipped",Url:"/menu/Order/Shipped",Permissions:[]},{Title:"4 - Completed",Url:"/menu/Order/Delivered",Permissions:[]},{Title:"All",Url:"/menu/Order/All",Permissions:[]},{Title:"99 - Cancelled",Url:"/menu/Order/Cancelled",Permissions:[]},{Title:"Download",Url:"/menu/Order/Download",Permissions:[L.G.downloadOrder]}]}ngOnInit(){}}y.\u0275fac=function(n){return new(n||y)},y.\u0275cmp=e.Xpm({type:y,selectors:[["app-orders"]],decls:5,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs","usePermissions"]],template:function(n,t){1&n&&(e.TgZ(0,"nav",0)(1,"div",1)(2,"div"),e._UZ(3,"nav-tab",2),e.qZA()()(),e._UZ(4,"router-outlet")),2&n&&(e.xp6(3),e.Q6J("Tabs",t.ObjectOrderTabs)("usePermissions",!0))},dependencies:[M.e,m.lC]});var h=u(1889),b=u(4782),J=u(8505),r=u(9694),l=u(9568),s=u(2428),p=u(5412),c=u(4006),_=u(6709);class v{constructor(n){this.dialogRef=n,this.tandaiSudahDicetak=!1}onCancel(){this.dialogRef.close()}onPrint(){this.dialogRef.close(this.tandaiSudahDicetak?1:0)}}v.\u0275fac=function(n){return new(n||v)(e.Y36(p.so))},v.\u0275cmp=e.Xpm({type:v,selectors:[["app-print-tokopedia"]],decls:17,vars:1,consts:[[1,"container-fluid"],["mat-dialog-title","",1,"text-center","mb-8","fw-bold"],[1,"row"],[1,"col-12"],[1,"fs-5"],[1,"d-flex","align-items-center","text-center","justify-content-center","mb-8"],[1,"me-2",3,"ngModel","ngModelChange"],[1,"fs-5","pt-1"],[1,"d-flex","align-items-center","justify-content-center","mt-6"],[1,"btn","btn-light-blue","text-primary","btn-lg","fw-bold","mx-3",3,"click"],[1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3",3,"click"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0)(1,"h2",1),e._uU(2,"Cetak label pesanan"),e.qZA(),e.TgZ(3,"mat-dialog-content")(4,"div",2)(5,"div",3)(6,"p",4),e._uU(7,"Kamu akan mencetak label yang berisi detail pesanan"),e.qZA(),e.TgZ(8,"div",5)(9,"mat-checkbox",6),e.NdJ("ngModelChange",function(o){return t.tandaiSudahDicetak=o}),e.qZA(),e.TgZ(10,"span",7),e._uU(11,'Pesanan telah ditandai sebagai "Sudah Dicetak"'),e.qZA()()()()(),e.TgZ(12,"mat-dialog-actions",8)(13,"button",9),e.NdJ("click",function(){return t.onCancel()}),e._uU(14,"Cancel"),e.qZA(),e.TgZ(15,"button",10),e.NdJ("click",function(){return t.onPrint()}),e._uU(16,"Cetak Pesanan"),e.qZA()()()),2&n&&(e.xp6(9),e.Q6J("ngModel",t.tandaiSudahDicetak))},dependencies:[c.JJ,c.On,_.oG,p.uh,p.xY,p.H8]});var V=u(4004),ee=u(9300),te=u(3900),S=u(1318),j=u(7185);class q{constructor(){}convertToCSV(n,t){let i;if("string"==typeof n)i=n;else{var o="object"==typeof n?n:JSON.parse(n);i=this.transformToCSVStringFormat(o)}this.downloadCSV(i,t)}transformToCSVStringFormat(n){if(!n||!n.length)return;const i=Object.keys(n[0]);return n.map(d=>i.map(I=>{let x=null==d[I]?"":d[I];return x=x instanceof Date?x.toLocaleString():x.toString().replace(/"/g,'""'),x.search(/("|,|\n)/g)>=0&&(x=`"${x}"`),x}).join(",")).join("\n")}downloadCSV(n,t){var i=new Blob([n],{type:"text/csv;charset=utf8;"}),o=document.createElement("a");o.setAttribute("href",window.URL.createObjectURL(i)),o.setAttribute("download",t),document.body.appendChild(o),o.click(),document.body.removeChild(o)}}q.\u0275fac=function(n){return new(n||q)},q.\u0275prov=e.Yz7({token:q,factory:q.\u0275fac,providedIn:"root"});class C{constructor(n,t,i,o){this.http=n,this.dialog=t,this.toastr=i,this.exportService=o}loadInitialPage(){return this.http.post("/api/ordersLoader/GetOrder",{})}getNewOrders(n){return this.http.post("/api/orders/GetNewOrder",n).pipe((0,V.U)(t=>t.Data))}getTotalNewOrders(n){return this.http.post("/api/orders/GetCountNewOrder",{ListChannelID:n}).pipe((0,V.U)(i=>i.Count))}printShippingLabelTokopedia(n){const t={OrderNumber:n,Printed:!0};this.dialog.open(v).afterClosed().pipe((0,ee.h)(i=>void 0!==i),(0,te.w)(i=>(t.Printed=i,this.http.post("api/v1/Shippinglabel/Tokopedia",t)))).subscribe(i=>{const o=window.open("about:blank","_blank");o.document.write(i),o.document.close()})}printShippingLabelTiktok(n,t){this.http.post("api/v1/Shippinglabel/Tiktok",{ShopID:t,OrderNumber:n}).subscribe(o=>{null!=o.data?window.open(o.data.doc_url,"_blank"):this.toastr.error("Cannot Print the Shipping Label,The invoice Number is not set to Pickup","Cannot Print")})}printShippingLabelShopee(n,t){this.http.post("api/v1/Shippinglabel/shopee/DownloadShipping",{ShopID:t,OrderNumber:n}).subscribe(o=>{var d=Uint8Array.from(atob(o),x=>x.charCodeAt(0)),I=new Blob([d],{type:"octet/stream"});h.g.openDownloadFile(I,`${n}.pdf`)})}printShippingLabelLazada(n,t){this.http.post("api/v1/Shippinglabel/Lazada/DownloadShipping",{ShopID:t,OrderNumber:n}).subscribe(o=>{null!=o.result.data?window.open(o.result.data.pdf_url,"_blank"):this.toastr.error(o.message,"Cannot Print")})}exportOrders(n,t){return this.http.post("api/Orders/ExportOrder",n).pipe((0,J.b)(i=>{this.exportService.convertToCSV(i,t)}))}}C.\u0275fac=function(n){return new(n||C)(e.LFG(S.O),e.LFG(p.uw),e.LFG(j._W),e.LFG(q))},C.\u0275prov=e.Yz7({token:C,factory:C.\u0275fac});class A{constructor(n,t){this.http=n,this.toastr=t}acceptTokopediaOrders(n){return this.http.post("/api/Orders/AcceptOrderTokopedia",n).pipe((0,J.b)(t=>{this.tokopediaAcceptOrderHandler(t)}))}tokopediaAcceptOrderHandler(n){const t=n.filter(o=>0==o.Status),i=n.filter(o=>1==o.Status);if(0==t.length&&i.length>0){let o=`<ol>${this.generateSuccessMessage(i)}</ol>`;this.toastr.success(o,"Success",{enableHtml:!0})}else if(t.length>0&&i.length>0){let o=`<ol>\n ${this.generateSuccessMessage(i)}\n ${this.generateErrorMessage(t)}\n </ol>`;this.toastr.warning(o,"Warning",{enableHtml:!0})}else{let o=`<ol>${this.generateErrorMessage(t)}</ol>`;this.toastr.error(o,"Error",{enableHtml:!0})}}generateSuccessMessage(n){let t="";return n.forEach(i=>{t+=`<li><b>${i.OrderNumber}</b> was successfully Accept</li>`}),t}generateErrorMessage(n){let t="";return n.forEach(i=>{t+=`<li><b>${i.OrderNumber}</b> ${i.Message}</li>`}),t}}A.\u0275fac=function(n){return new(n||A)(e.LFG(S.O),e.LFG(j._W))},A.\u0275prov=e.Yz7({token:A,factory:A.\u0275fac});var w=u(7481),f=u(8796),N=u(2594);class Z{constructor(){}set typeId(n){this.channelLogo=h.g.getChannelLogoByTypeId(n),this.initChannelName(n)}initChannelName(n){switch(n){case r.x.Tokopedia:this.channelName="Tokopedia";break;case r.x.Tiktok:this.channelName="Tiktok";break;case r.x.WooCommerce:this.channelName="WooCommerce";break;case r.x.ShopeeV2:this.channelName="Shopee";break;case r.x.Lazada:this.channelName="Lazada";break;case r.x.KalCare:this.channelName="Kalcare"}}}Z.\u0275fac=function(n){return new(n||Z)},Z.\u0275cmp=e.Xpm({type:Z,selectors:[["app-channel-logo"]],inputs:{typeId:"typeId"},decls:4,vars:2,consts:[[1,"d-flex","align-items-center"],[2,"width","20px",3,"src"],[1,"ms-3","fw-normal"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e._UZ(1,"img",1),e.TgZ(2,"span",2),e._uU(3),e.qZA()()),2&n&&(e.xp6(1),e.Q6J("src",t.channelLogo,e.LSH),e.xp6(2),e.Oqu(t.channelName))}});var P=u(9640);function ne(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"button",11),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().ngIf,d=e.oxw();return e.KtG(d.onAcceptOrder(o))}),e._UZ(2,"i",12),e._uU(3," Accept "),e.qZA(),e.BQk()}}function ae(a,n){if(1&a&&(e.ynx(0),e.YNc(1,ne,4,0,"ng-container",1),e.BQk()),2&a){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.isTokopediaAvailable&&t.isTokopediaSelected)}}function ie(a,n){if(1&a&&(e.TgZ(0,"span",13),e._UZ(1,"img",14),e.qZA(),e._uU(2)),2&a){const t=n.item;e.xp6(1),e.Q6J("src",t.img,e.LSH),e.xp6(1),e.hij(" ",t.Name," ")}}function oe(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"th",25)(2,"input",26),e.NdJ("ngModelChange",function(o){e.CHM(t);const d=e.oxw(3);return e.KtG(d.isCheckAll=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw(2).ngIf,d=e.oxw();return e.KtG(d.onSelectAllOrderData(o))}),e.qZA()(),e.BQk()}if(2&a){const t=e.oxw(3);e.xp6(2),e.Q6J("ngModel",t.isCheckAll)}}function re(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"input",26),e.NdJ("ngModelChange",function(o){e.CHM(t);const d=e.oxw(2).$implicit;return e.KtG(d.selected=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw(4).ngIf,d=e.oxw();return e.KtG(d.onSelectOrderData(o))}),e.qZA(),e.BQk()}if(2&a){const t=e.oxw(2).$implicit;e.xp6(1),e.Q6J("ngModel",t.selected)}}function le(a,n){if(1&a&&(e.ynx(0),e.TgZ(1,"td"),e.YNc(2,re,2,1,"ng-container",1),e.qZA(),e.BQk()),2&a){const t=e.oxw().$implicit,i=e.oxw(3);e.xp6(2),e.Q6J("ngIf",t.Type==i.tokopediaType)}}function se(a,n){if(1&a&&(e.ynx(0),e.TgZ(1,"span"),e._uU(2),e.qZA(),e.BQk()),2&a){const t=e.oxw().$implicit;e.xp6(2),e.Oqu(t.Number)}}function pe(a,n){if(1&a&&(e.TgZ(0,"a",29),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit,i=e.oxw(3);e.Q6J("href",i.domain+"/menu/Orders/Order/Sales_Order/Info?ID="+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function ce(a,n){if(1&a&&(e.TgZ(0,"tr"),e.YNc(1,le,3,1,"ng-container",1),e.TgZ(2,"td"),e._uU(3),e.qZA(),e.TgZ(4,"td"),e.YNc(5,se,3,1,"ng-container",15),e.YNc(6,pe,2,2,"ng-template",null,27,e.W1O),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.qZA(),e.TgZ(10,"td"),e._uU(11),e.ALo(12,"date"),e.qZA(),e.TgZ(13,"td"),e._UZ(14,"app-channel-logo",28),e.qZA()()),2&a){const t=n.$implicit,i=e.MAs(7),o=e.oxw(3);e.xp6(1),e.Q6J("ngIf",o.isTokopediaAvailable),e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",t.ID==o.guidEmpty)("ngIfElse",i),e.xp6(4),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.xi3(12,7,t.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",t.Type)}}function de(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",16)(2,"table",17)(3,"thead",18)(4,"tr",19),e.YNc(5,oe,3,1,"ng-container",1),e.TgZ(6,"th",20),e._uU(7,"Outlet"),e.qZA(),e.TgZ(8,"th",21),e._uU(9,"Order number"),e.qZA(),e.TgZ(10,"th"),e._uU(11,"Customer"),e.qZA(),e.TgZ(12,"th",22),e._uU(13,"Created On"),e.qZA(),e.TgZ(14,"th",22),e._uU(15,"Channel"),e.qZA()()(),e.TgZ(16,"tbody"),e.YNc(17,ce,15,10,"tr",23),e.qZA()(),e.TgZ(18,"app-mat-paginator-no-count",24),e.NdJ("total",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.getPaginatonTotal())})("next",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.onNextPage())})("previous",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.onPreviousPage())}),e.ALo(19,"async"),e.ALo(20,"async"),e.qZA()(),e.BQk()}if(2&a){const t=e.oxw().ngIf,i=e.oxw();let o;e.xp6(5),e.Q6J("ngIf",i.isTokopediaAvailable&&t),e.xp6(12),e.Q6J("ngForOf",t),e.xp6(1),e.Q6J("filter",i.filter)("totaldata",null==(o=e.lcZ(19,5,i.newOrdersData$))?null:o.length)("paginationTotal",e.lcZ(20,7,i.paginationTotal$))}}function ue(a,n){if(1&a&&(e.ynx(0),e.YNc(1,de,21,9,"ng-container",15),e.BQk()),2&a){const t=n.ngIf;e.oxw();const i=e.MAs(26);e.xp6(1),e.Q6J("ngIf",(null==t?null:t.length)>0)("ngIfElse",i)}}function ge(a,n){1&a&&(e.TgZ(0,"div",30),e._UZ(1,"app-empty-state"),e.qZA())}class E{constructor(n,t,i,o,d){this.localDataService=n,this.channelService=t,this.orderService=i,this.toastr=o,this.acceptOrderService=d,this.filter={PageNumber:null,PageSize:null,ListChannelID:[]},this.domain=`https://${this.localDataService.getHostName()}`,this.guidEmpty=h.g.GuidEMpty,this.tokopediaType=r.x.Tokopedia,this.isTokopediaSelected=!1,this.isTokopediaAvailable=!1,this.isCheckAll=!1}ngOnInit(){this.initLoadPage()}initLoadPage(){this.orderService.loadInitialPage().subscribe(n=>{this.filter.PageNumber=n.Filter.PageNumber,this.filter.PageSize=n.Filter.RowCount,this.channels=n.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),this.getNewOrders()})}getNewOrders(){this.newOrdersData$=this.orderService.getNewOrders({PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID}).pipe((0,b.d)(),(0,J.b)(t=>{t.filter(o=>o.Type==r.x.Tokopedia).length>0&&(this.isTokopediaAvailable=!0)}))}getPaginatonTotal(){this.paginationTotal$=this.orderService.getTotalNewOrders(this.filter.ListChannelID).pipe((0,b.d)())}onNextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.getNewOrders()}onPreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.getNewOrders()}onSelectOrderData(n){this.isTokopediaSelected=!1,n.filter(i=>i.selected).length>0&&(this.isTokopediaSelected=!0)}onSelectAllOrderData(n){n=n.map(t=>(t.Type==r.x.Tokopedia&&(t.selected=this.isCheckAll),t)),this.onSelectOrderData(n)}onAcceptOrder(n){let t=this.getSelectedTokopediaOrders(n);this.acceptOrderService.acceptTokopediaOrders(t).subscribe(i=>{this.isTokopediaSelected=!1,location.reload()})}getSelectedTokopediaOrders(n){return n.filter(i=>i.selected).map(i=>i.Number)}}function he(a,n){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.ALo(5,"number"),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.ALo(8,"number"),e.qZA()()),2&a){const t=n.$implicit;e.xp6(2),e.Oqu(t.Code),e.xp6(2),e.Oqu(e.lcZ(5,3,t.Quantity)),e.xp6(3),e.Oqu(e.lcZ(8,5,t.Price))}}function _e(a,n){if(1&a&&(e.TgZ(0,"div",4)(1,"div",5)(2,"div",6)(3,"div",7)(4,"h3",8),e._uU(5,"Outlet Info"),e.qZA()(),e.TgZ(6,"div",4)(7,"div",9),e._uU(8," Outlet : "),e.qZA(),e.TgZ(9,"div",9),e._uU(10),e.qZA()(),e.TgZ(11,"div",4)(12,"div",9),e._uU(13," Date : "),e.qZA(),e.TgZ(14,"div",9),e._uU(15),e.ALo(16,"date"),e.qZA()(),e.TgZ(17,"div",4)(18,"div",9),e._uU(19," Status : "),e.qZA(),e.TgZ(20,"div",9),e._uU(21),e.qZA()(),e.TgZ(22,"div",4)(23,"div",9),e._uU(24," Tax Type : "),e.qZA(),e.TgZ(25,"div",9),e._uU(26),e.qZA()(),e.TgZ(27,"div",4)(28,"div",9),e._uU(29," Due Date : "),e.qZA(),e.TgZ(30,"div",9),e._uU(31),e.ALo(32,"date"),e.qZA()()(),e.TgZ(33,"div",6)(34,"div",7)(35,"h3",8),e._uU(36,"Customer Info"),e.qZA()(),e.TgZ(37,"div",4)(38,"div",9),e._uU(39," Name : "),e.qZA(),e.TgZ(40,"div",9),e._uU(41),e.qZA()(),e.TgZ(42,"div",4)(43,"div",9),e._uU(44," Email : "),e.qZA(),e.TgZ(45,"div",9),e._uU(46),e.qZA()(),e.TgZ(47,"div",4)(48,"div",9),e._uU(49," Mobile : "),e.qZA(),e.TgZ(50,"div",9),e._uU(51),e.qZA()()()(),e.TgZ(52,"div",10)(53,"h3",11),e._uU(54,"Products Sold"),e.qZA(),e.TgZ(55,"div",12)(56,"table",13)(57,"thead",14)(58,"tr",15)(59,"th"),e._uU(60,"Code"),e.qZA(),e.TgZ(61,"th"),e._uU(62,"Quantity"),e.qZA(),e.TgZ(63,"th"),e._uU(64,"Price"),e.qZA()()(),e.TgZ(65,"tbody"),e.YNc(66,he,9,7,"tr",16),e.qZA()()()()()),2&a){const t=e.oxw();e.xp6(10),e.hij(" ",t.model.Outlet," "),e.xp6(5),e.hij(" ",e.xi3(16,9,t.model.Date,"dd MMM yyyy")," "),e.xp6(6),e.hij(" ",t.model.Delivery," "),e.xp6(5),e.hij(" ",t.model.TaxType," "),e.xp6(5),e.hij(" ",e.xi3(32,12,t.model.DueDate,"dd MMM yyyy")," "),e.xp6(10),e.hij(" ",t.model.Customer.Name," "),e.xp6(5),e.hij(" ",t.model.Customer.Email," "),e.xp6(5),e.hij(" ",t.model.Customer.Mobile," "),e.xp6(15),e.Q6J("ngForOf",t.model.Variants)}}E.\u0275fac=function(n){return new(n||E)(e.Y36(l.T),e.Y36(s.T),e.Y36(C),e.Y36(j._W),e.Y36(A))},E.\u0275cmp=e.Xpm({type:E,selectors:[["app-new-order"]],decls:27,vars:13,consts:[["headerTitle","1 - New Order","searchBoxPlaceHolder","Search Orders...",3,"hideSearchBox","onSubmit"],[4,"ngIf"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","multiple","items","ngModel","ngModelChange"],["ng-option-tmp",""],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["EMPTY_STATE",""],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fa-solid","fa-check"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[2,"width","5px"],["type","checkbox",3,"ngModel","ngModelChange"],["NOT_EMPTY",""],[3,"typeId"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(n,t){1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(){return t.getNewOrders()}),e.TgZ(1,"actions"),e.YNc(2,ae,2,1,"ng-container",1),e.ALo(3,"async"),e.qZA(),e.TgZ(4,"filters")(5,"div",2)(6,"div")(7,"h6"),e._uU(8,"Channel"),e.qZA(),e.TgZ(9,"ng-select",3),e.NdJ("ngModelChange",function(o){return t.filter.ListChannelID=o}),e.YNc(10,ie,3,2,"ng-template",4),e.qZA()(),e.TgZ(11,"div")(12,"h6"),e._uU(13,"Page Number"),e.qZA(),e.TgZ(14,"input",5),e.NdJ("ngModelChange",function(o){return t.filter.PageNumber=o}),e.qZA()(),e.TgZ(15,"div")(16,"h6"),e._uU(17,"Page Size"),e.qZA(),e.TgZ(18,"input",6),e.NdJ("ngModelChange",function(o){return t.filter.PageSize=o}),e.qZA()()()(),e.TgZ(19,"content")(20,"div",7)(21,"div",8)(22,"div",9),e.YNc(23,ue,2,2,"ng-container",1),e.ALo(24,"async"),e.YNc(25,ge,2,0,"ng-template",null,10,e.W1O),e.qZA()()()()()),2&n&&(e.Q6J("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",e.lcZ(3,9,t.newOrdersData$)),e.xp6(7),e.Q6J("clearable",!0)("multiple",!0)("items",t.channels)("ngModel",t.filter.ListChannelID),e.xp6(5),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.PageSize),e.xp6(5),e.Q6J("ngIf",e.lcZ(24,11,t.newOrdersData$)))},dependencies:[g.sg,g.O5,c.Fj,c.wV,c.Wl,c.JJ,c.On,w.p,f.w9,f.ir,N.n,Z,P.s,g.Ov,g.uU]});const me=function(){return["/menu/Order"]};class Q{constructor(n,t){this.http=n,this.url=t,this.number=this.url.snapshot.queryParams.Number,this.outlet=this.url.snapshot.queryParams.Outlet}ngOnInit(){this.Load()}Load(){this.http.post("/api/orders/GetInvoiceDetail",{Number:this.number,Outlet:this.outlet}).subscribe(t=>{this.model=t})}}function fe(a,n){if(1&a&&(e.TgZ(0,"span",11),e._UZ(1,"img",12),e.qZA(),e._uU(2)),2&a){const t=n.item;e.xp6(1),e.Q6J("src",t.img,e.LSH),e.xp6(1),e.hij(" ",t.Name," ")}}Q.\u0275fac=function(n){return new(n||Q)(e.Y36(S.O),e.Y36(m.gz))},Q.\u0275cmp=e.Xpm({type:Q,selectors:[["app-detail-order"]],decls:7,vars:6,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button",1,"btn","btn-secondary","btn-fill","btn-lg","me-3",3,"routerLink"],[1,"container"],["class","row",4,"ngIf"],[1,"row"],[1,"col-4"],[1,"border","my-3","py-3","col-12"],[1,"row","m-2"],[1,"text-center"],[1,"col"],[1,"col-8"],[1,"text-center","my-3","py-3"],[1,"table-responsive"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"]],template:function(n,t){1&n&&(e.TgZ(0,"mainpanel",0)(1,"actions")(2,"a",1),e._uU(3,"Back"),e.qZA()(),e.TgZ(4,"content")(5,"div",2),e.YNc(6,_e,67,15,"div",3),e.qZA()()()),2&n&&(e.Q6J("headerTitle","Order #"+t.number)("hideSearchBox",!0)("hideSearchDropdown",!0),e.xp6(2),e.Q6J("routerLink",e.DdM(5,me)),e.xp6(4),e.Q6J("ngIf",t.model))},dependencies:[g.sg,g.O5,w.p,m.rH,g.JJ,g.uU]});const Te=function(){return["/menu/Order/detail"]},Ce=function(a,n){return{Number:a,Outlet:n}};function Ze(a,n){if(1&a&&(e.TgZ(0,"a",29),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,Te))("queryParams",e.WLB(4,Ce,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function xe(a,n){if(1&a&&(e.TgZ(0,"a",30),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit,i=e.oxw(2);e.Q6J("href",i.domain+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function be(a,n){if(1&a){const t=e.EpF();e.TgZ(0,"a",31),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().$implicit,d=e.oxw(2);return e.KtG(d.onPrintShippingLabel(o.Number,o.ShopID,o.TypeID))}),e._UZ(1,"i",32),e.qZA()}}function ve(a,n){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,Ze,2,7,"a",24),e.YNc(5,xe,2,2,"a",25),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA(),e.TgZ(14,"td"),e._UZ(15,"app-channel-logo",26),e.qZA(),e.TgZ(16,"td",27),e.YNc(17,be,2,0,"a",28),e.qZA()()),2&a){const t=n.$implicit,i=e.oxw(2);e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",i.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!i.hasGuidEmpty(t.ID)),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.lcZ(10,8,t.Amount)),e.xp6(3),e.Oqu(e.xi3(13,10,t.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",t.TypeID),e.xp6(2),e.Q6J("ngIf",t.TypeID==i.channelType.ShopeeV2||t.TypeID==i.channelType.Tokopedia||t.TypeID==i.channelType.Tiktok||t.TypeID==i.channelType.Lazada)}}function Se(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",13)(2,"table",14)(3,"thead",15)(4,"tr",16)(5,"th",17),e._uU(6,"Outlet"),e.qZA(),e.TgZ(7,"th",18),e._uU(8,"Order number"),e.qZA(),e.TgZ(9,"th"),e._uU(10,"Customer"),e.qZA(),e.TgZ(11,"th",19),e._uU(12,"Amount"),e.qZA(),e.TgZ(13,"th",20),e._uU(14,"Created On"),e.qZA(),e.TgZ(15,"th",20),e._uU(16,"Channel"),e.qZA(),e._UZ(17,"th",21),e.qZA()(),e.TgZ(18,"tbody"),e.YNc(19,ve,18,13,"tr",22),e.qZA()(),e.TgZ(20,"app-mat-paginator-no-count",23),e.NdJ("total",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.StoreRowsCountAPIResult())})("next",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.NextPage())})("previous",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.PreviousPage())}),e.qZA()(),e.BQk()}if(2&a){const t=e.oxw();e.xp6(19),e.Q6J("ngForOf",t.data),e.xp6(1),e.Q6J("filter",t.filter)("totaldata",t.totaldata)("paginationTotal",t.paginationTotal)}}function we(a,n){1&a&&(e.TgZ(0,"div",33),e._UZ(1,"app-empty-state"),e.qZA())}class Y{constructor(n,t,i,o,d){this.http=n,this.localDataService=t,this.dialog=i,this.orderService=o,this.channelService=d,this.filter={PageNumber:null,PageSize:null,ListChannelID:[]},this.totaldata=0,this.paginationTotal=0,this.checkboxState=!1,this.channelType=r.x}ngOnInit(){this.Load()}getChannelLogo(n){return h.g.getChannelLogoByTypeId(n)}hasGuidEmpty(n){return n==h.g.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(n=>{this.filter.PageNumber=n.Filter.PageNumber,this.filter.PageSize=n.Filter.RowCount,this.channels=n.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(n){this.http.post("api/orders/GetReadyToShip",{Number:n,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID}).subscribe(i=>{this.data=i.Data,this.totaldata=this.data.length})}onPrintShippingLabel(n,t,i){switch(i){case r.x.Tokopedia:this.orderService.printShippingLabelTokopedia(n);break;case r.x.Tiktok:this.orderService.printShippingLabelTiktok(n,t);break;case r.x.ShopeeV2:this.orderService.printShippingLabelShopee(n,t);break;case r.x.Lazada:this.orderService.printShippingLabelLazada(n,t)}}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"Unpaid",DeliveryState:"Unsent",ListChannelID:this.filter.ListChannelID}).subscribe(t=>{this.paginationTotal=t.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}function De(a,n){if(1&a&&(e.TgZ(0,"span",11),e._UZ(1,"img",12),e.qZA(),e._uU(2)),2&a){const t=n.item;e.xp6(1),e.Q6J("src",t.img,e.LSH),e.xp6(1),e.hij(" ",t.Name," ")}}Y.\u0275fac=function(n){return new(n||Y)(e.Y36(S.O),e.Y36(l.T),e.Y36(p.uw),e.Y36(C),e.Y36(s.T))},Y.\u0275cmp=e.Xpm({type:Y,selectors:[["app-ready-to-ship"]],decls:23,vars:8,consts:[["headerTitle","2 - Ready to Ship","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["container","",1,""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","multiple","items","ngModel","ngModelChange"],["ng-option-tmp",""],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],["EMPTY_STATE",""],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],[2,"width","130px"],[2,"width","60px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[1,"text-center","text-primary"],["title","Print shipping label",3,"click",4,"ngIf"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],["title","Print shipping label",3,"click"],[1,"fa-solid","fa-print","fs-3","cursor"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(n,t){if(1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(o){return t.Get(o)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Channel"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(o){return t.filter.ListChannelID=o}),e.YNc(7,fe,3,2,"ng-template",3),e.qZA()(),e.TgZ(8,"div")(9,"h6"),e._uU(10,"Page Number"),e.qZA(),e.TgZ(11,"input",4),e.NdJ("ngModelChange",function(o){return t.filter.PageNumber=o}),e.qZA()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Page Size"),e.qZA(),e.TgZ(15,"input",5),e.NdJ("ngModelChange",function(o){return t.filter.PageSize=o}),e.qZA()()()(),e.TgZ(16,"content")(17,"div",6)(18,"div",7)(19,"div",8),e.YNc(20,Se,21,4,"ng-container",9),e.YNc(21,we,2,0,"ng-template",null,10,e.W1O),e.qZA()()()()()),2&n){const i=e.MAs(22);e.xp6(6),e.Q6J("clearable",!0)("multiple",!0)("items",t.channels)("ngModel",t.filter.ListChannelID),e.xp6(5),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.PageSize),e.xp6(5),e.Q6J("ngIf",t.data&&t.data.length>0)("ngIfElse",i)}},dependencies:[g.sg,g.O5,c.Fj,c.wV,c.JJ,c.On,w.p,m.rH,f.w9,f.ir,N.n,Z,P.s,g.JJ,g.uU]});const ye=function(){return["/menu/Order/detail"]},Ae=function(a,n){return{Number:a,Outlet:n}};function Ne(a,n){if(1&a&&(e.TgZ(0,"a",29),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,ye))("queryParams",e.WLB(4,Ae,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function Pe(a,n){if(1&a&&(e.TgZ(0,"a",30),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit,i=e.oxw(2);e.Q6J("href",i.domain+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function Oe(a,n){if(1&a){const t=e.EpF();e.TgZ(0,"a",31),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().$implicit,d=e.oxw(2);return e.KtG(d.onPrintShippingLabel(o.Number,o.ShopID,o.TypeID))}),e._UZ(1,"i",32),e.qZA()}}function Ie(a,n){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,Ne,2,7,"a",24),e.YNc(5,Pe,2,2,"a",25),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA(),e.TgZ(14,"td"),e._UZ(15,"app-channel-logo",26),e.qZA(),e.TgZ(16,"td",27),e.YNc(17,Oe,2,0,"a",28),e.qZA()()),2&a){const t=n.$implicit,i=e.oxw(2);e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",i.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!i.hasGuidEmpty(t.ID)),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.lcZ(10,8,t.Amount)),e.xp6(3),e.Oqu(e.xi3(13,10,t.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",t.TypeID),e.xp6(2),e.Q6J("ngIf",t.TypeID==i.channelType.ShopeeV2||t.TypeID==i.channelType.Tokopedia||t.TypeID==i.channelType.Tiktok||t.TypeID==i.channelType.Lazada)}}function Me(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",13)(2,"table",14)(3,"thead",15)(4,"tr",16)(5,"th",17),e._uU(6,"Outlet"),e.qZA(),e.TgZ(7,"th",18),e._uU(8,"Order number"),e.qZA(),e.TgZ(9,"th"),e._uU(10,"Customer"),e.qZA(),e.TgZ(11,"th",19),e._uU(12,"Amount"),e.qZA(),e.TgZ(13,"th",20),e._uU(14,"Created On"),e.qZA(),e.TgZ(15,"th",20),e._uU(16,"Channel"),e.qZA(),e._UZ(17,"th",21),e.qZA()(),e.TgZ(18,"tbody"),e.YNc(19,Ie,18,13,"tr",22),e.qZA()(),e.TgZ(20,"app-mat-paginator-no-count",23),e.NdJ("total",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.StoreRowsCountAPIResult())})("next",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.NextPage())})("previous",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.PreviousPage())}),e.qZA()(),e.BQk()}if(2&a){const t=e.oxw();e.xp6(19),e.Q6J("ngForOf",t.data),e.xp6(1),e.Q6J("filter",t.filter)("totaldata",t.totaldata)("paginationTotal",t.paginationTotal)}}function qe(a,n){1&a&&(e.TgZ(0,"div",33),e._UZ(1,"app-empty-state"),e.qZA())}class G{constructor(n,t,i,o){this.http=n,this.localDataService=t,this.orderService=i,this.channelService=o,this.filter={PageNumber:null,PageSize:null,ListChannelID:[]},this.totaldata=0,this.paginationTotal=0,this.channelType=r.x}ngOnInit(){this.Load()}getChannelLogo(n){return h.g.getChannelLogoByTypeId(n)}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(n=>{this.filter.PageNumber=n.Filter.PageNumber,this.filter.PageSize=n.Filter.RowCount,this.channels=n.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}hasGuidEmpty(n){return n==h.g.GuidEMpty}Get(n){this.http.post("api/orders/GetShipped",{Number:n,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID}).subscribe(i=>{this.data=i.Data,this.totaldata=this.data.length})}changePage(n){this.filter.PageNumber=n.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"Unpaid",DeliveryState:"Sent",ListChannelID:this.filter.ListChannelID}).subscribe(t=>{this.paginationTotal=t.Total})}onPrintShippingLabel(n,t,i){switch(i){case r.x.Tokopedia:this.orderService.printShippingLabelTokopedia(n);break;case r.x.Tiktok:this.orderService.printShippingLabelTiktok(n,t);break;case r.x.ShopeeV2:this.orderService.printShippingLabelShopee(n,t);break;case r.x.Lazada:this.orderService.printShippingLabelLazada(n,t)}}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}G.\u0275fac=function(n){return new(n||G)(e.Y36(S.O),e.Y36(l.T),e.Y36(C),e.Y36(s.T))},G.\u0275cmp=e.Xpm({type:G,selectors:[["app-shipped"]],decls:23,vars:8,consts:[["headerTitle","3 - Shipped","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","multiple","items","ngModel","ngModelChange"],["ng-option-tmp",""],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],["EMPTY_STATE",""],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],[2,"width","130px"],[2,"width","60px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[1,"text-center","text-primary"],["title","Print shipping label",3,"click",4,"ngIf"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],["title","Print shipping label",3,"click"],[1,"fa-solid","fa-print","fs-3","cursor"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(n,t){if(1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(o){return t.Get(o)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Channel"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(o){return t.filter.ListChannelID=o}),e.YNc(7,De,3,2,"ng-template",3),e.qZA()(),e.TgZ(8,"div")(9,"h6"),e._uU(10,"Page Number"),e.qZA(),e.TgZ(11,"input",4),e.NdJ("ngModelChange",function(o){return t.filter.PageNumber=o}),e.qZA()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Page Size"),e.qZA(),e.TgZ(15,"input",5),e.NdJ("ngModelChange",function(o){return t.filter.PageSize=o}),e.qZA()()()(),e.TgZ(16,"content")(17,"div",6)(18,"div",7)(19,"div",8),e.YNc(20,Me,21,4,"ng-container",9),e.YNc(21,qe,2,0,"ng-template",null,10,e.W1O),e.qZA()()()()()),2&n){const i=e.MAs(22);e.xp6(6),e.Q6J("clearable",!0)("multiple",!0)("items",t.channels)("ngModel",t.filter.ListChannelID),e.xp6(5),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.PageSize),e.xp6(5),e.Q6J("ngIf",t.data&&t.data.length>0)("ngIfElse",i)}},dependencies:[g.sg,g.O5,c.Fj,c.wV,c.JJ,c.On,w.p,m.rH,f.w9,f.ir,N.n,Z,P.s,g.JJ,g.uU]});var Ue=u(501);function ke(a,n){if(1&a&&(e.TgZ(0,"span",11),e._UZ(1,"img",12),e.qZA(),e._uU(2)),2&a){const t=n.item;e.xp6(1),e.Q6J("src",t.img,e.LSH),e.xp6(1),e.hij(" ",t.Name," ")}}const Le=function(){return["/menu/Order/detail"]},Je=function(a,n){return{Number:a,Outlet:n}};function Ee(a,n){if(1&a&&(e.TgZ(0,"a",29),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,Le))("queryParams",e.WLB(4,Je,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function Qe(a,n){if(1&a&&(e.TgZ(0,"a",30),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit,i=e.oxw(2);e.Q6J("href",i.customerInfoUrl+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function Ye(a,n){if(1&a){const t=e.EpF();e.TgZ(0,"a",31),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().$implicit,d=e.oxw(2);return e.KtG(d.onPrintShippingLabel(o.Number,o.ShopID,o.TypeID))}),e._UZ(1,"i",32),e.qZA()}}function Ge(a,n){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,Ee,2,7,"a",24),e.YNc(5,Qe,2,2,"a",25),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA(),e.TgZ(14,"td"),e._UZ(15,"app-channel-logo",26),e.qZA(),e.TgZ(16,"td",27),e.YNc(17,Ye,2,0,"a",28),e.qZA()()),2&a){const t=n.$implicit,i=e.oxw(2);e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",i.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!i.hasGuidEmpty(t.ID)),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.lcZ(10,8,t.Amount)),e.xp6(3),e.Oqu(e.xi3(13,10,t.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",t.TypeID),e.xp6(2),e.Q6J("ngIf",t.TypeID==i.channelType.ShopeeV2||t.TypeID==i.channelType.Tokopedia||t.TypeID==i.channelType.Tiktok)}}function Fe(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",13)(2,"table",14)(3,"thead",15)(4,"tr",16)(5,"th",17),e._uU(6,"Outlet"),e.qZA(),e.TgZ(7,"th",18),e._uU(8,"Order number"),e.qZA(),e.TgZ(9,"th"),e._uU(10,"Customer"),e.qZA(),e.TgZ(11,"th",19),e._uU(12,"Amount"),e.qZA(),e.TgZ(13,"th",20),e._uU(14,"Created On"),e.qZA(),e.TgZ(15,"th",20),e._uU(16,"Channel"),e.qZA(),e._UZ(17,"th",21),e.qZA()(),e.TgZ(18,"tbody"),e.YNc(19,Ge,18,13,"tr",22),e.qZA()(),e.TgZ(20,"app-mat-paginator-no-count",23),e.NdJ("total",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.StoreRowsCountAPIResult())})("next",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.NextPage())})("previous",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.PreviousPage())}),e.qZA()(),e.BQk()}if(2&a){const t=e.oxw();e.xp6(19),e.Q6J("ngForOf",t.data),e.xp6(1),e.Q6J("filter",t.filter)("totaldata",t.totaldata)("paginationTotal",t.paginationTotal)}}function He(a,n){1&a&&(e.TgZ(0,"div",33),e._UZ(1,"app-empty-state"),e.qZA())}class F{constructor(n,t,i,o){this.http=n,this.orderService=t,this.authService=i,this.channelService=o,this.filter={PageNumber:null,PageSize:null,ListChannelID:[]},this.totaldata=0,this.paginationTotal=0,this.channelType=r.x}ngOnInit(){this.Load()}hasGuidEmpty(n){return n==h.g.GuidEMpty}getChannelLogo(n){return h.g.getChannelLogoByTypeId(n)}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(n=>{this.filter.PageNumber=n.Filter.PageNumber,this.filter.PageSize=n.Filter.RowCount,this.channels=n.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),this.customerInfoUrl=`${this.authService.getDomain()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(n){this.http.post("api/orders/GetDelivered ",{Number:n,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID}).subscribe(i=>{this.data=i.Data,this.totaldata=this.data.length})}changePage(n){this.filter.PageNumber=n.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"Paid",DeliveryState:"Sent",ListChannelID:this.filter.ListChannelID}).subscribe(t=>{this.paginationTotal=t.Total})}onPrintShippingLabel(n,t,i){switch(i){case r.x.Tokopedia:this.orderService.printShippingLabelTokopedia(n);break;case r.x.Tiktok:this.orderService.printShippingLabelTiktok(n,t);break;case r.x.ShopeeV2:this.orderService.printShippingLabelShopee(n,t)}}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}function Re(a,n){if(1&a&&(e.TgZ(0,"span",11),e._UZ(1,"img",12),e.qZA(),e._uU(2)),2&a){const t=n.item;e.xp6(1),e.Q6J("src",t.img,e.LSH),e.xp6(1),e.hij(" ",t.Name," ")}}F.\u0275fac=function(n){return new(n||F)(e.Y36(S.O),e.Y36(C),e.Y36(Ue.e),e.Y36(s.T))},F.\u0275cmp=e.Xpm({type:F,selectors:[["app-delivered"]],decls:23,vars:9,consts:[["headerTitle","4 - Completed","searchBoxPlaceHolder","Search ...",3,"hideSearchBox","onSubmit"],["container","",1,""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","multiple","items","ngModel","ngModelChange"],["ng-option-tmp",""],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],["EMPTY_STATE",""],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],[2,"width","130px"],[2,"width","60px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[1,"text-center","text-primary"],["title","Print shipping label",3,"click",4,"ngIf"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],["title","Print shipping label",3,"click"],[1,"fa-solid","fa-print","fs-3","cursor"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(n,t){if(1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(o){return t.Get(o)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Channel"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(o){return t.filter.ListChannelID=o}),e.YNc(7,ke,3,2,"ng-template",3),e.qZA()(),e.TgZ(8,"div")(9,"h6"),e._uU(10,"Page Number"),e.qZA(),e.TgZ(11,"input",4),e.NdJ("ngModelChange",function(o){return t.filter.PageNumber=o}),e.qZA()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Page Size"),e.qZA(),e.TgZ(15,"input",5),e.NdJ("ngModelChange",function(o){return t.filter.PageSize=o}),e.qZA()()()(),e.TgZ(16,"content")(17,"div",6)(18,"div",7)(19,"div",8),e.YNc(20,Fe,21,4,"ng-container",9),e.YNc(21,He,2,0,"ng-template",null,10,e.W1O),e.qZA()()()()()),2&n){const i=e.MAs(22);e.Q6J("hideSearchBox",!0),e.xp6(6),e.Q6J("clearable",!0)("multiple",!0)("items",t.channels)("ngModel",t.filter.ListChannelID),e.xp6(5),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.PageSize),e.xp6(5),e.Q6J("ngIf",t.data&&t.data.length>0)("ngIfElse",i)}},dependencies:[g.sg,g.O5,c.Fj,c.wV,c.JJ,c.On,w.p,m.rH,f.w9,f.ir,N.n,Z,P.s,g.JJ,g.uU]});const ze=function(){return["/menu/Order/detail"]},$e=function(a,n){return{Number:a,Outlet:n}};function Be(a,n){if(1&a&&(e.TgZ(0,"a",27),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,ze))("queryParams",e.WLB(4,$e,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function Ke(a,n){if(1&a&&(e.TgZ(0,"a",28),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit,i=e.oxw(2);e.Q6J("href",i.domain+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function je(a,n){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,Be,2,7,"a",24),e.YNc(5,Ke,2,2,"a",25),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA(),e.TgZ(14,"td"),e._uU(15),e.qZA(),e.TgZ(16,"td"),e._UZ(17,"app-channel-logo",26),e.qZA()()),2&a){const t=n.$implicit,i=e.oxw(2);e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",i.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!i.hasGuidEmpty(t.ID)),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.lcZ(10,8,t.Amount)),e.xp6(3),e.Oqu(e.xi3(13,10,t.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Oqu(t.State),e.xp6(2),e.Q6J("typeId",t.TypeID)}}function Ve(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",13)(2,"table",14)(3,"thead",15)(4,"tr",16)(5,"th",17),e._uU(6,"Outlet"),e.qZA(),e.TgZ(7,"th",18),e._uU(8,"Order number"),e.qZA(),e.TgZ(9,"th"),e._uU(10,"Customer"),e.qZA(),e.TgZ(11,"th",19),e._uU(12,"Amount"),e.qZA(),e.TgZ(13,"th",20),e._uU(14,"Created On"),e.qZA(),e.TgZ(15,"th",21),e._uU(16,"Status"),e.qZA(),e.TgZ(17,"th",20),e._uU(18,"Channel"),e.qZA()()(),e.TgZ(19,"tbody"),e.YNc(20,je,18,13,"tr",22),e.qZA()(),e.TgZ(21,"app-mat-paginator-no-count",23),e.NdJ("total",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.StoreRowsCountAPIResult())})("next",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.NextPage())})("previous",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.PreviousPage())}),e.qZA()(),e.BQk()}if(2&a){const t=e.oxw();e.xp6(20),e.Q6J("ngForOf",t.data),e.xp6(1),e.Q6J("filter",t.filter)("totaldata",t.totaldata)("paginationTotal",t.paginationTotal)}}function We(a,n){1&a&&(e.TgZ(0,"div",29),e._UZ(1,"app-empty-state"),e.qZA())}class H{constructor(n,t,i){this.http=n,this.localDataService=t,this.channelService=i,this.filter={PageNumber:null,PageSize:null,ListChannelID:[]},this.totaldata=0,this.paginationTotal=0}ngOnInit(){this.Load()}hasGuidEmpty(n){return n==h.g.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(n=>{this.filter.PageNumber=n.Filter.PageNumber,this.filter.PageSize=n.Filter.RowCount,this.channels=n.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(n){this.http.post("api/orders/GetAll ",{Number:n,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID}).subscribe(i=>{this.data=i.Data,this.totaldata=this.data.length})}changePage(n){this.filter=n,this.Get()}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"",DeliveryState:"",Bin:!1,ListChannelID:this.filter.ListChannelID}).subscribe(t=>{this.paginationTotal=t.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}function Xe(a,n){if(1&a&&(e.TgZ(0,"span",11),e._UZ(1,"img",12),e.qZA(),e._uU(2)),2&a){const t=n.item;e.xp6(1),e.Q6J("src",t.img,e.LSH),e.xp6(1),e.hij(" ",t.Name," ")}}H.\u0275fac=function(n){return new(n||H)(e.Y36(S.O),e.Y36(l.T),e.Y36(s.T))},H.\u0275cmp=e.Xpm({type:H,selectors:[["app-all-order"]],decls:23,vars:8,consts:[["headerTitle","All","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","multiple","items","ngModel","ngModelChange"],["ng-option-tmp",""],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],["EMPTY_STATE",""],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],[2,"width","130px"],[2,"width","135px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(n,t){if(1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(o){return t.Get(o)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Channel"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(o){return t.filter.ListChannelID=o}),e.YNc(7,Re,3,2,"ng-template",3),e.qZA()(),e.TgZ(8,"div")(9,"h6"),e._uU(10,"Page Number"),e.qZA(),e.TgZ(11,"input",4),e.NdJ("ngModelChange",function(o){return t.filter.PageNumber=o}),e.qZA()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Page Size"),e.qZA(),e.TgZ(15,"input",5),e.NdJ("ngModelChange",function(o){return t.filter.PageSize=o}),e.qZA()()()(),e.TgZ(16,"content")(17,"div",6)(18,"div",7)(19,"div",8),e.YNc(20,Ve,22,4,"ng-container",9),e.YNc(21,We,2,0,"ng-template",null,10,e.W1O),e.qZA()()()()()),2&n){const i=e.MAs(22);e.xp6(6),e.Q6J("clearable",!0)("multiple",!0)("items",t.channels)("ngModel",t.filter.ListChannelID),e.xp6(5),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.PageSize),e.xp6(5),e.Q6J("ngIf",t.data&&t.data.length>0)("ngIfElse",i)}},dependencies:[g.sg,g.O5,c.Fj,c.wV,c.JJ,c.On,w.p,m.rH,f.w9,f.ir,N.n,Z,P.s,g.JJ,g.uU]});const et=function(){return["/menu/Order/detail"]},tt=function(a,n){return{Number:a,Outlet:n}};function nt(a,n){if(1&a&&(e.TgZ(0,"a",26),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,et))("queryParams",e.WLB(4,tt,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function at(a,n){if(1&a&&(e.TgZ(0,"a",27),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit,i=e.oxw(2);e.Q6J("href",i.domain+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function it(a,n){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,nt,2,7,"a",23),e.YNc(5,at,2,2,"a",24),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA(),e.TgZ(14,"td"),e._UZ(15,"app-channel-logo",25),e.qZA()()),2&a){const t=n.$implicit,i=e.oxw(2);e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",i.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!i.hasGuidEmpty(t.ID)),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.lcZ(10,7,t.Amount)),e.xp6(3),e.Oqu(e.xi3(13,9,t.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",t.TypeID)}}function ot(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",13)(2,"table",14)(3,"thead",15)(4,"tr",16)(5,"th",17),e._uU(6,"Outlet"),e.qZA(),e.TgZ(7,"th",18),e._uU(8,"Order number"),e.qZA(),e.TgZ(9,"th"),e._uU(10,"Customer"),e.qZA(),e.TgZ(11,"th",19),e._uU(12,"Amount"),e.qZA(),e.TgZ(13,"th",20),e._uU(14,"Created On"),e.qZA(),e.TgZ(15,"th",20),e._uU(16,"Channel"),e.qZA()()(),e.TgZ(17,"tbody"),e.YNc(18,it,16,12,"tr",21),e.qZA()(),e.TgZ(19,"app-mat-paginator-no-count",22),e.NdJ("total",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.StoreRowsCountAPIResult())})("next",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.NextPage())})("previous",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.PreviousPage())}),e.qZA()(),e.BQk()}if(2&a){const t=e.oxw();e.xp6(18),e.Q6J("ngForOf",t.data),e.xp6(1),e.Q6J("filter",t.filter)("totaldata",t.totaldata)("paginationTotal",t.paginationTotal)}}function rt(a,n){1&a&&(e.TgZ(0,"div",28),e._UZ(1,"app-empty-state"),e.qZA())}class R{constructor(n,t,i){this.http=n,this.localDataService=t,this.channelService=i,this.filter={PageNumber:null,PageSize:null,ListChannelID:[]},this.totaldata=0,this.paginationTotal=0}ngOnInit(){this.Load()}hasGuidEmpty(n){return n==h.g.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(n=>{this.filter.PageNumber=n.Filter.PageNumber,this.filter.PageSize=n.Filter.RowCount,this.channels=n.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(n){this.http.post("api/orders/GetCancelled ",{Number:n,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID}).subscribe(i=>{this.data=i.Data,this.totaldata=this.data.length})}changePage(n){this.filter.PageNumber=n.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"",DeliveryState:"",Bin:!0,ListChannelID:this.filter.ListChannelID}).subscribe(t=>{this.paginationTotal=t.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}getChannelLogo(n){return h.g.getChannelLogoByTypeId(n)}}R.\u0275fac=function(n){return new(n||R)(e.Y36(S.O),e.Y36(l.T),e.Y36(s.T))},R.\u0275cmp=e.Xpm({type:R,selectors:[["app-cancelled"]],decls:23,vars:8,consts:[["headerTitle","99 - Cancelled","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["container","",1,""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","multiple","items","ngModel","ngModelChange"],["ng-option-tmp",""],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],["EMPTY_STATE",""],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(n,t){if(1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(o){return t.Get(o)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Channel"),e.qZA(),e.TgZ(6,"ng-select",2),e.NdJ("ngModelChange",function(o){return t.filter.ListChannelID=o}),e.YNc(7,Xe,3,2,"ng-template",3),e.qZA()(),e.TgZ(8,"div")(9,"h6"),e._uU(10,"Page Number"),e.qZA(),e.TgZ(11,"input",4),e.NdJ("ngModelChange",function(o){return t.filter.PageNumber=o}),e.qZA()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Page Size"),e.qZA(),e.TgZ(15,"input",5),e.NdJ("ngModelChange",function(o){return t.filter.PageSize=o}),e.qZA()()()(),e.TgZ(16,"content")(17,"div",6)(18,"div",7)(19,"div",8),e.YNc(20,ot,20,4,"ng-container",9),e.YNc(21,rt,2,0,"ng-template",null,10,e.W1O),e.qZA()()()()()),2&n){const i=e.MAs(22);e.xp6(6),e.Q6J("clearable",!0)("multiple",!0)("items",t.channels)("ngModel",t.filter.ListChannelID),e.xp6(5),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.PageSize),e.xp6(5),e.Q6J("ngIf",t.data&&t.data.length>0)("ngIfElse",i)}},dependencies:[g.sg,g.O5,c.Fj,c.wV,c.JJ,c.On,w.p,m.rH,f.w9,f.ir,N.n,Z,P.s,g.JJ,g.uU]});var lt=u(2138),O=(()=>{return(a=O||(O={}))[a.DoNothing=0]="DoNothing",a[a.New=1]="New",a[a.Update=2]="Update",O;var a})(),st=u(6082),z=u(9602),$=u(8425),W=u(266);function pt(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",28)(2,"button",29),e.NdJ("click",function(){e.CHM(t),e.oxw();const o=e.MAs(11);return e.KtG(o.previous())}),e._uU(3," Back "),e.qZA(),e.TgZ(4,"button",30),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(),d=e.MAs(11);return e.KtG(o.onNext(d))}),e._uU(5," Next "),e.qZA(),e.TgZ(6,"button",31),e._UZ(7,"b",32),e.qZA(),e.TgZ(8,"ul",33)(9,"li",34)(10,"a",35),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.exportOrders())}),e._uU(11," Export "),e.qZA()()()(),e.BQk()}if(2&a){const t=e.oxw();e.xp6(4),e.Q6J("disabled",t.checkDisabledNextFilter())}}function ct(a,n){if(1&a){const t=e.EpF();e.TgZ(0,"button",36),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(),d=e.MAs(11);return e.KtG(o.onNext(d))}),e._uU(1," Next "),e.qZA()}if(2&a){const t=e.oxw();e.Q6J("disabled",t.checkDisabledNextFilter())}}function dt(a,n){if(1&a){const t=e.EpF();e.TgZ(0,"button",37),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(),d=e.MAs(11);return e.KtG(o.onNew(d))}),e._UZ(1,"i",38),e._uU(2," New "),e.qZA()}}function ut(a,n){1&a&&e._uU(0,"Filter")}function gt(a,n){if(1&a&&(e.TgZ(0,"ng-option",39),e._UZ(1,"img",40),e._uU(2),e.qZA()),2&a){const t=n.$implicit;e.Q6J("value",t.ID),e.xp6(1),e.s9C("src",t.Img,e.LSH),e.xp6(1),e.hij("",t.Name," ")}}function ht(a,n){1&a&&e._uU(0,"Preview")}function _t(a,n){if(1&a&&(e.TgZ(0,"th",58),e._uU(1),e.qZA()),2&a){const t=e.oxw(2);e.xp6(1),e.Oqu(0==t.getTypeID()?"Last Status Update":"Created Date")}}function mt(a,n){if(1&a&&(e.TgZ(0,"td"),e._uU(1),e.ALo(2,"date"),e.qZA()),2&a){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.xi3(2,1,t.Date,"dd MMM yyyy HH:mm:ss"),"")}}function ft(a,n){if(1&a&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",t.ActionString," ")}}function Tt(a,n){if(1&a&&(e.TgZ(0,"li"),e._uU(1),e.qZA()),2&a){const t=n.$implicit;e.xp6(1),e.hij("",t," ")}}function Ct(a,n){if(1&a&&(e.TgZ(0,"ul",63),e.YNc(1,Tt,2,1,"li",59),e.qZA()),2&a){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngForOf",t.ActionString)}}function Zt(a,n){if(1&a&&(e.TgZ(0,"span",64),e._UZ(1,"i",65),e.qZA()),2&a){const t=e.oxw().$implicit;e.hYB("title","Delivery : ",t.DeliveryState," \nPayment : ",t.PaymentState,"")}}const xt=function(a,n){return{"over-due-today":a,"over-due":n}};function bt(a,n){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.YNc(5,mt,3,4,"td",1),e.TgZ(6,"td")(7,"span"),e._uU(8),e.qZA(),e._uU(9),e.qZA(),e.TgZ(10,"td",60)(11,"span"),e._uU(12),e.qZA(),e._uU(13),e.qZA(),e.TgZ(14,"td"),e.YNc(15,ft,2,1,"span",1),e.YNc(16,Ct,2,1,"ul",61),e.qZA(),e.TgZ(17,"td"),e.YNc(18,Zt,2,2,"span",62),e.qZA()()),2&a){const t=n.$implicit,i=n.index,o=e.oxw(3);e.xp6(2),e.Oqu(i+1),e.xp6(2),e.Oqu(t.Number),e.xp6(1),e.Q6J("ngIf",o.getTypeID()!=o.channelType.ShopeeV2),e.xp6(3),e.hij("",t.ChannelStatus," - "),e.xp6(1),e.Oqu(t.ChannelStatusDescription),e.xp6(1),e.Q6J("ngClass",e.WLB(12,xt,(null==t?null:t.Action)==o.actionPreviewOrder.Update,(null==t?null:t.Action)==o.actionPreviewOrder.New))("matTooltip",91==t.POSStatus||"Conflict"==t.POSStatusDescription?"There is a missed status at POS, usually fulfillment has not been recorded but the payment has been recorded":""),e.xp6(2),e.hij("",t.POSStatus," - "),e.xp6(1),e.hij("",t.POSStatusDescription," "),e.xp6(2),e.Q6J("ngIf",1==t.ActionString.length),e.xp6(1),e.Q6J("ngIf",t.ActionString.length>1),e.xp6(2),e.Q6J("ngIf",99!=t.ChannelStatus&&99!=t.POSStatus)}}function vt(a,n){if(1&a&&(e.ynx(0),e.YNc(1,bt,19,15,"tr",59),e.BQk()),2&a){const t=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",t.displayedPreviewData)}}function St(a,n){1&a&&(e.TgZ(0,"tr",66)(1,"td",67)(2,"div",68),e._UZ(3,"i",69),e.qZA(),e.TgZ(4,"h4",70),e._uU(5,"There is no order to processed"),e.qZA()()())}function wt(a,n){if(1&a){const t=e.EpF();e.TgZ(0,"div",41)(1,"div",42)(2,"div",43)(3,"ul",44)(4,"li",45)(5,"button",46),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.filterPreviewData(o.previewStatus.ALL))}),e._uU(6),e.qZA()(),e.TgZ(7,"li",45)(8,"button",47),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.filterPreviewData(o.previewStatus.SYNC))}),e._uU(9),e.qZA()(),e.TgZ(10,"li",45)(11,"button",48),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.filterPreviewData(o.previewStatus.WRONG))}),e._uU(12),e.qZA()(),e.TgZ(13,"li",45)(14,"button",49),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.filterPreviewData(o.previewStatus.UNSYNC))}),e._uU(15),e.qZA()()()(),e.TgZ(16,"table",50)(17,"thead",51)(18,"tr"),e._UZ(19,"th",52),e.TgZ(20,"th",53),e._uU(21,"Number"),e.qZA(),e.YNc(22,_t,2,1,"th",54),e.TgZ(23,"th",55),e._uU(24,"Channel Status"),e.qZA(),e.TgZ(25,"th",55),e._uU(26,"POS Status"),e.qZA(),e.TgZ(27,"th"),e._uU(28,"Action"),e.qZA(),e._UZ(29,"th",52),e.qZA()(),e.TgZ(30,"tbody"),e.YNc(31,vt,2,1,"ng-container",56),e.YNc(32,St,6,0,"ng-template",null,57,e.W1O),e.qZA()()()()}if(2&a){const t=e.MAs(33),i=e.oxw();e.xp6(5),e.Q6J("ngClass","all"==i.pillStatus?"btn-secondary text-white":"btn-outline-dark"),e.xp6(1),e.hij("All (",i.allData,")"),e.xp6(2),e.Q6J("ngClass","sync"==i.pillStatus?"btn-success":"btn-outline-success"),e.xp6(1),e.hij("Existing (",i.syncData,")"),e.xp6(2),e.Q6J("ngClass","wrong"==i.pillStatus?"btn-warning text-white":"btn-outline-warning"),e.xp6(1),e.hij("Wrong Status (",i.wrongData,")"),e.xp6(2),e.Q6J("ngClass","unsync"==i.pillStatus?"btn-danger":"btn-outline-danger"),e.xp6(1),e.hij("Missing (",i.unsyncData,")"),e.xp6(7),e.Q6J("ngIf",i.getTypeID()!=i.channelType.ShopeeV2),e.xp6(9),e.Q6J("ngIf",i.displayedPreviewData.length>0)("ngIfElse",t)}}function Dt(a,n){1&a&&e._uU(0,"Finish")}const yt=function(a){return{"over-due":a}};function At(a,n){if(1&a&&(e.TgZ(0,"tr",73)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.TgZ(5,"td"),e._uU(6),e.qZA(),e.TgZ(7,"td"),e._uU(8),e.qZA()()),2&a){const t=n.$implicit,i=n.index;e.Q6J("ngClass",e.VKq(5,yt,t.Exception)),e.xp6(2),e.Oqu(i+1),e.xp6(2),e.Oqu(t.Number),e.xp6(2),e.Oqu(t.Status),e.xp6(2),e.Oqu(t.Exception)}}function Nt(a,n){if(1&a&&(e.ynx(0),e.YNc(1,At,9,7,"tr",72),e.BQk()),2&a){const t=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",t.downloadData)}}function Pt(a,n){1&a&&(e.TgZ(0,"tr",66)(1,"td",67)(2,"div",68),e._UZ(3,"i",69),e.qZA(),e.TgZ(4,"h4",70),e._uU(5,"There is no order to processed"),e.qZA()()())}function Ot(a,n){if(1&a&&(e.TgZ(0,"div",41)(1,"div",42)(2,"table",50)(3,"thead",51)(4,"tr"),e._UZ(5,"th",52),e.TgZ(6,"th"),e._uU(7,"Order Number"),e.qZA(),e.TgZ(8,"th"),e._uU(9,"Status"),e.qZA(),e.TgZ(10,"th"),e._uU(11,"Exception"),e.qZA()()(),e.TgZ(12,"tbody"),e.YNc(13,Nt,2,1,"ng-container",56),e.YNc(14,Pt,6,0,"ng-template",null,71,e.W1O),e.qZA()()()()),2&a){const t=e.MAs(15),i=e.oxw();e.xp6(13),e.Q6J("ngIf",(null==i.downloadData?null:i.downloadData.length)>0)("ngIfElse",t)}}function It(a,n){1&a&&e._UZ(0,"i",74)}function Mt(a,n){1&a&&e._UZ(0,"i",75)}function qt(a,n){1&a&&e._UZ(0,"i",76)}var T=(()=>{return(a=T||(T={})).ALL="all",a.SYNC="sync",a.WRONG="wrong",a.UNSYNC="unsync",T;var a})();class B{constructor(n,t,i,o,d,I){this.http=n,this.toastr=t,this.datePipe=i,this.url=o,this.productService=d,this.orderService=I,this.pageTitle="Download to POS",this.pillStatus="all",this.displayedPreviewData=[],this.previewData=[],this.channelType=r.x,this.previewStatus=T,this.currentState="filter",this.wrongData=0,this.unsyncData=0,this.syncData=0,this.allData=0,this.actionPreviewOrder=O}ngOnInit(){this.initPageLoader(),this.url.queryParams.subscribe(n=>{this.channelID=n.ChannelID,this.startDate=new Date(n.Date),this.endDate=new Date(n.Date)})}initPageLoader(){this.productService.loader().subscribe(n=>{this.channelOptions=n.Options.Channel})}onDownload(n){this.http.post("/api/Orders/Download",{ID:this.channelID,From:this.startDate,To:this.endDate,ListPreview:this.downloadedPreviewData}).subscribe(i=>{this.downloadData=i.Body,this.onStepperNext(n)})}onPreview(n){this.validateDatePreview()&&this.http.post("/api/Orders/Preview",{ID:this.channelID,From:this.startDate,To:this.endDate}).subscribe(i=>{0!=i.length?(this.previewData=i,this.groupingPreviewData(),this.filterPreviewData(T.ALL),this.initLengthStatusData(),this.onStepperNext(n)):this.toastrEmptyPreview()})}toastrEmptyPreview(){this.toastr.info("There is no orders from "+this.datePipe.transform(this.startDate,"dd MMM yyyy")+" to "+this.datePipe.transform(this.endDate,"dd MMM yyyy")+" !","No Orders!")}validateDatePreview(){let n=!0;return h.g.getDaysDiff(this.startDate,this.endDate)>14&&(this.toastr.warning("Dates cannot be more than 14 days apart!","Failed"),n=!1),n}setPageTitle(n){this.pageTitle=`\n ${n} (${this.getDateTitle()})\n `}getDateTitle(){const n=h.g.formatTitleFromDate(new Date(this.startDate),new Date(this.endDate)),t=this.datePipe.transform(this.startDate,n);return`${null==n?"":t+"-"} ${this.datePipe.transform(this.endDate,"dd MMM yyyy")}`}onNew(n){this.channelID=null,this.startDate=null,this.endDate=null,this.pageTitle="Download to POS",n.reset()}groupingPreviewData(){let n=this.filterDataByStatus(T.UNSYNC),t=this.filterDataByStatus(T.WRONG);this.downloadedPreviewData=[...n,...t]}filterDataByStatus(n){let t=[];switch(n){case T.ALL:t=this.previewData;break;case T.SYNC:t=this.previewData.filter(i=>i.Action==O.DoNothing);break;case T.WRONG:t=this.previewData.filter(i=>i.Action==O.Update);break;case T.UNSYNC:t=this.previewData.filter(i=>i.Action==O.New)}return t}filterPreviewData(n){this.pillStatus=n,this.displayedPreviewData=this.filterDataByStatus(n)}initLengthStatusData(){this.wrongData=this.filterDataByStatus(T.WRONG).length,this.allData=this.previewData.length,this.syncData=this.filterDataByStatus(T.SYNC).length,this.unsyncData=this.filterDataByStatus(T.UNSYNC).length}getTypeID(){var n=this.channelOptions.find(t=>t.ID==this.channelID)?.TypeID;return n??0}onStepperChange(n){this.currentState=n.selectedStep.state}onStepperNext(n){n.selected.completed=!0,n.next()}onNext(n){switch(this.currentState){case"filter":this.onPreview(n);break;case"preview":this.onDownload(n)}}stepChange(n){switch(n?.selectedStep?.state){case"filter":this.pageTitle="Download To POS",this.resetPreviewData();break;case"preview":let t=this.productService.findChannelById(this.channelID,this.channelOptions);this.setPageTitle(`Preview ${t?.Name}`);break;case"finish":this.setPageTitle("Download")}}resetPreviewData(){this.displayedPreviewData=[],this.previewData=[],this.initLengthStatusData()}checkDisabledNextFilter(){let n=!h.g.isValidDate(this.startDate)||!h.g.isValidDate(this.endDate),t=h.g.IsEmpty(this.channelID);return n||t}exportOrders(){let n={ID:this.channelID,From:this.startDate,To:this.endDate};const t=`Orders ${this.getDateTitle()}`;this.orderService.exportOrders(n,t).subscribe()}}B.\u0275fac=function(n){return new(n||B)(e.Y36(S.O),e.Y36(j._W),e.Y36(g.uU),e.Y36(m.gz),e.Y36(st.M),e.Y36(C))},B.\u0275cmp=e.Xpm({type:B,selectors:[["app-download"]],features:[e._Bn([{provide:lt.gx,useValue:{displayDefaultIndicatorType:!1}}])],decls:47,vars:20,consts:[[3,"headerTitle","description","hideSearchBox","hideSearchDropdown"],[4,"ngIf"],["class","btn btn-outline-secondary btn-fill btn-lg ms-2","type","button",3,"disabled","click",4,"ngIf"],["class","btn btn-outline-secondary btn-fill btn-lg ms-2",3,"click",4,"ngIf"],[1,"container-fluid","pt-5","mt-5"],[1,"row"],[1,"col-12"],[1,"d-flex","justify-content-center"],["labelPosition","bottom","linear","",1,"w-100","stepper-download",3,"ngClass","selectionChange"],["stepper",""],["state","filter",3,"editable","completed"],["matStepLabel",""],[1,"row","pt-2",2,"width","63%","margin-right","40px"],[1,"col-6"],[1,"text-muted"],["appendTo","body",3,"clearable","ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[1,"row","mt-1rem"],["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",""],["state","preview",3,"editable","completed"],["class","row pt-2",4,"ngIf"],["state","finish"],["matStepperIcon","filter"],["matStepperIcon","preview"],["matStepperIcon","finish"],[1,"btn-group"],[1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-outline-secondary","border-end-0",3,"disabled","click"],["data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"caret"],[1,"dropdown-menu","dropdown-menu-end",2,"min-width","85px !important"],[1,"dropdown-item"],[3,"click"],["type","button",1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-2",3,"disabled","click"],[1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"row","pt-2"],[1,"col-md-12"],[1,"row","mx-1","mb-5"],[1,"nav","nav-pills"],[1,"nav-item","mx-3"],[1,"btn","btn-sm","rounded-pill",3,"ngClass","click"],["matTooltip","All Invoice which is already available in POS",1,"btn","btn-sm","rounded-pill",3,"ngClass","click"],["matTooltip","Invoices that have different status between marketplace and POS",1,"btn","btn-sm","rounded-pill",3,"ngClass","click"],["matTooltip","Invoices which is not exist in POS",1,"btn","btn-sm","rounded-pill",3,"ngClass","click"],[1,"table"],[1,"thead-light"],["width","1%"],["width","25%"],["width","15%",4,"ngIf"],["width","10%"],[4,"ngIf","ngIfElse"],["EMPTY",""],["width","15%"],[4,"ngFor","ngForOf"],["matTooltipClass","custom-width-tooltip",3,"ngClass","matTooltip"],["class","ps-5",4,"ngIf"],[3,"title",4,"ngIf"],[1,"ps-5"],[3,"title"],[1,"fas","fa-info-circle","ms-2"],[1,"text-center"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"],["EMPTY_DOWNLOAD",""],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"],[1,"fa-solid","fa-filter"],[1,"fa-solid","fa-file"],[1,"fa-sharp","fa-solid","fa-flag"]],template:function(n,t){if(1&n){const i=e.EpF();e.TgZ(0,"mainpanel",0)(1,"actions"),e.YNc(2,pt,12,1,"ng-container",1),e.YNc(3,ct,2,1,"button",2),e.YNc(4,dt,3,0,"button",3),e.qZA(),e.TgZ(5,"content")(6,"div",4)(7,"div",5)(8,"div",6)(9,"div",7)(10,"mat-stepper",8,9),e.NdJ("selectionChange",function(d){return t.stepChange(d)})("selectionChange",function(d){return t.onStepperChange(d)}),e.TgZ(12,"mat-step",10),e.YNc(13,ut,1,0,"ng-template",11),e.TgZ(14,"div",12)(15,"div",6)(16,"div",5)(17,"div",13)(18,"h5"),e._uU(19,"Select a Channel"),e.qZA(),e.TgZ(20,"p",14),e._uU(21,"Select Channel want to download order"),e.qZA()(),e.TgZ(22,"div",13)(23,"ng-select",15),e.NdJ("ngModelChange",function(d){return t.channelID=d}),e.YNc(24,gt,3,3,"ng-option",16),e.qZA()()(),e.TgZ(25,"div",17)(26,"div",13)(27,"h5"),e._uU(28,"Date Range"),e.qZA(),e.TgZ(29,"p",14),e._uU(30,"Select transaction date of the channel you want to download (Max 2 Weeks)"),e.qZA()(),e.TgZ(31,"div",13)(32,"div",6)(33,"mat-date-range-input",18)(34,"input",19),e.NdJ("ngModelChange",function(d){return t.startDate=d})("click",function(){e.CHM(i);const d=e.MAs(37);return e.KtG(d.open())}),e.qZA(),e.TgZ(35,"input",20),e.NdJ("ngModelChange",function(d){return t.endDate=d})("click",function(){e.CHM(i);const d=e.MAs(37);return e.KtG(d.open())}),e.qZA()(),e._UZ(36,"mat-date-range-picker",null,21),e.qZA()()()()()(),e.TgZ(38,"mat-step",22),e.YNc(39,ht,1,0,"ng-template",11),e.YNc(40,wt,34,11,"div",23),e.qZA(),e.TgZ(41,"mat-step",24),e.YNc(42,Dt,1,0,"ng-template",11),e.YNc(43,Ot,16,2,"div",23),e.qZA(),e.YNc(44,It,1,0,"ng-template",25),e.YNc(45,Mt,1,0,"ng-template",26),e.YNc(46,qt,1,0,"ng-template",27),e.qZA()()()()()()()}if(2&n){const i=e.MAs(11),o=e.MAs(37);e.Q6J("headerTitle",t.pageTitle)("description",t.pageTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),e.xp6(2),e.Q6J("ngIf","preview"==t.currentState),e.xp6(1),e.Q6J("ngIf","filter"==t.currentState),e.xp6(1),e.Q6J("ngIf","finish"==t.currentState),e.xp6(6),e.s9C("ngClass","last-edited-step-"+i.selectedIndex),e.xp6(2),e.Q6J("editable","finish"!=t.currentState)("completed",!1),e.xp6(11),e.Q6J("clearable",!1)("ngModel",t.channelID),e.xp6(1),e.Q6J("ngForOf",t.channelOptions),e.xp6(9),e.Q6J("rangePicker",o),e.xp6(1),e.Q6J("ngModel",t.startDate),e.xp6(1),e.Q6J("ngModel",t.endDate),e.xp6(3),e.Q6J("editable","finish"!=t.currentState)("completed",!1),e.xp6(2),e.Q6J("ngIf","preview"==t.currentState),e.xp6(3),e.Q6J("ngIf","finish"==t.currentState)}},dependencies:[g.mk,g.sg,g.O5,c.Fj,c.JJ,c.On,w.p,f.w9,f.jq,z.wx,z.zY,z.By,z._g,$.C0,$.VY,$.Vq,$.z9,W.gM,g.uU],styles:[".vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}.mt-1rem[_ngcontent-%COMP%]{margin-top:1rem}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem} mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container{position:relative;width:60%;left:18%} mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container mat-step-header>div.mat-step-label{padding-top:8px} mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container>div.mat-horizontal-stepper-content:nth-child(1){display:flex;justify-content:left} mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container{margin-top:30px} mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container>mat-step-header.mat-horizontal-stepper-header{pointer-events:none!important}"]});var D=u(8063);const Ut=[{path:"",component:y,children:[{path:"",redirectTo:"new",pathMatch:"full"},{path:"new",component:E,canActivate:[D.a],data:{title:"New Order"}},{path:"detail",component:Q,canActivate:[D.a],data:{title:"Orders detail"}},{path:"ready_to_ship",component:Y,canActivate:[D.a],data:{title:"Ready To Ship"}},{path:"Shipped",component:G,canActivate:[D.a],data:{title:"Shipped"}},{path:"Delivered",component:F,canActivate:[D.a],data:{title:"Delivered"}},{path:"All",component:H,canActivate:[D.a],data:{title:"All Order"}},{path:"Cancelled",component:R,canActivate:[D.a],data:{title:"Cancelled"}},{path:"Download",component:B,canActivate:[D.a],data:{title:"Download"}}]}];class U{}U.\u0275fac=function(n){return new(n||U)},U.\u0275mod=e.oAB({type:U}),U.\u0275inj=e.cJS({imports:[g.ez,m.Bz.forChild(Ut)]});var kt=u(8739),Lt=u(3238),Jt=u(1108),Et=u(4385);class k{}k.\u0275fac=function(n){return new(n||k)},k.\u0275mod=e.oAB({type:k}),k.\u0275inj=e.cJS({providers:[C,A],imports:[g.ez,c.u5,U,M.Z,w.R,kt.TU,m.Bz,f.A0,z.FA,Lt.XK,N.n,$.T5,W.AV,Jt.f,_.p9,p.Is,Et.LD,P.s]})},6082:(X,K,u)=>{u.d(K,{M:()=>b});var g=u(8505),m=u(262),L=u(2843),e=u(1889),M=u(4650),y=u(1318),h=u(7185);class b{constructor(r,l){this.httpService=r,this.toastrService=l}loader(r=e.g.GuidEMpty){return this.httpService.post("/api/product/Load",{ID:r})}LoadInPOS(r=e.g.GuidEMpty){return this.httpService.post("/api/product/LoadInPOS",{ID:r})}filterChannelByTypeId(r,l){return r.filter(s=>-1!==l.findIndex(p=>s.TypeID==p))}getProductStatistic(){return this.httpService.post("/api/product/ProductStatistic",{})}getTotalProductLive(r){return this.httpService.post("/api/product/TotalProductLive",{ID:r})}clearCacheChannel(r){return this.httpService.post("/api/Channel/ClearCacheChannel",{ID:r})}uploadSingleProduct(r,l){return this.httpService.post("api/product/UploadMultipleChannel",{Channel:l,Products:r}).pipe((0,g.b)(p=>{this.showToastrSuccessUploadSingle(p,r[0])}),(0,m.K)(p=>(this.showToastErrorUploadSingle(p,r[0]),(0,L._)(()=>new Error(p)))))}uploadMultipleProduct(r,l){return this.httpService.post("api/product/UploadMultipleProductAndMultipleChannel",{Channel:l,Products:r}).pipe((0,g.b)(p=>{this.showToastrUploadMultiple(p.Message)}),(0,m.K)(p=>(this.showToastrUploadMultiple(p.error?.Message),(0,L._)(()=>new Error(p)))))}uploadNotInChannel(r,l){return this.httpService.post("/api/product/UploadProductNotInChannelToChannel",{Products:r,Channel:l}).pipe((0,g.b)(p=>{this.showToastrUploadMultiple(p)}),(0,m.K)(p=>(this.showToastrUploadMultiple(p.error?.Message),(0,L._)(()=>new Error(p)))))}scanSingle(r,l){return this.httpService.post("/api/product/ScanSingle",{ID:r,SKU:l})}scanNotInChannel(r){return this.httpService.post("/api/product/ScanNotinChannel",{ID:r})}findAllSoldInChannel(r){return this.httpService.post("/api/product/GetSoldInChannel",r)}scanAll(r,l,s,p=!1){return this.httpService.post("/api/product/ScanOptimized",{ID:r,ScanFull:l,UpdatedProduct:s,Async:p})}scanCompareToPos(r){return this.httpService.post("/api/product/CompareMarketplaceToPOS",r)}getVariantCodesProduct(r){return r.Variants.map(s=>s.Code)}downloadMultipleProduct(r){let l=r.map(s=>({ChannelItemID:s.ChannelItemID,ChannelID:s.ChannelID}));return this.httpService.post("/api/product/DownloadMultipleProductFromChannel",l).pipe((0,g.b)(s=>{this.toastrService.success(`${s.Count} products downloaded to POS`,"Download Complete")}))}downloadProduct(r){return this.httpService.post("/api/product/DownloadProductFromChannel",{ChannelItemID:r.ChannelItemID,ChannelID:r.ChannelID}).pipe((0,g.b)(()=>{this.toastrService.success("Product successfully downloaded to POS","Download Complete")}))}getVariantCodesProducts(r=[]){let l=[];return r.forEach(s=>{s.Variants.forEach(p=>{l=[...l,p.Code]})}),l}filterUnselectedChannel(r,l){let p,s=[];if(r.forEach(c=>{s=[...s,...c.Channel]}),s&&0!=s.length){let c=[];p=l.filter(_=>(c=s.filter(v=>v.ChannelID==_.ID),c.length!==r.length))}else p=l;return p}findChannelById(r,l){return l.find(s=>s.ID==r)}sortChannel(r=[]){return r.sort((l,s)=>l.TypeID<s.TypeID?1:l.TypeID===s.TypeID?0:-1)}hasSelection(r=[]){return this.selectedProduct(r).length>0}selectedProduct(r=[]){return r.filter(l=>l.selected)}hasSelectionVariant(r){return this.selectedVariantProduct(r).length>0}selectedVariantProduct(r){let l=[];return r.forEach(s=>{l=[...l,...null!=s.Variants?s.Variants.filter(p=>p.selected):""]}),l}getChannelProduct(r){const l=r.Variants;let s=[];for(let p of l)if(null!=p.Channel)for(let c of p.Channel)0==s.filter(_=>_.ChannelID==c.ChannelID).length&&s.push(c);return this.sortChannel(s)}successToastrScanAllProduct(r,l,s){if(s){const p=r?.NotInPOS?.Product?r?.NotInPOS?.Product:0,c=r?.InChannel?.Product?r?.InChannel?.Product:0;this.toastrService.success(`\n ${p+c} found in ${l.Name} </br>\n (${c} In POS + ${p} Not In Pos)\n `,"Scan Complete!",{enableHtml:!0})}else this.toastrService.success(`${r.InChannel?r.InChannel.Product:0} product updates in ${l.Name} </br> \n since ${r.LastUpdate}`,"Scan Complete!",{enableHtml:!0})}checkProductHasScanButton(r,l){let s;return r.map(p=>(p.Channel=this.getChannelProduct(p),s=this.filterUnselectedChannel([p],l),p.hasScan=s.length>0,p))}checkProductHasUploadBtn(r,l){let s;return r.map(p=>(p.Channel=this.getChannelProduct(p),s=this.filterUnselectedChannel([p],l),p.hasUpload=s.length>0,p))}showToastrUploadMultiple(r=[]){let l=[],s=[];if(r.forEach(p=>{"string"==typeof p?.Response?s=[...s,`<li>${p.Response}</li>`]:(p?.Response?.Success.forEach(c=>{l=[...l,`<li>Product ${c} was <b>successfully</b> uploaded to ${p.Name}</li>`]}),p?.Response.Fail.forEach(c=>{s=[...s,`<li>${c} in <b>${p.Name}</b></li>`]}))}),s.length>0&&l.length>0){const p=[...l,...s];this.toastrService.warning(this.concatMessage(p),"Warning!",{enableHtml:!0})}else l.length>0&&0==s.length?this.toastrService.success(this.concatMessage(l),"Success",{enableHtml:!0}):this.toastrService.error(this.concatMessage(s),"Error",{enableHtml:!0})}concatMessage(r=[]){let l="";return r.forEach(s=>{l+=s}),`<ol>${l}</ol>`}showToastrSuccessUploadSingle(r,l){let s=r.filter(_=>0==_.Status),p=r.filter(_=>1==_.Status),c=this.generateToastrMessage(s,p,l);this.toastrService.success(c.message,"Success",{enableHtml:!0})}showToastErrorUploadSingle(r,l){let s=r?.error?.Message.filter(_=>0==_.Status),p=r?.error?.Message.filter(_=>1==_.Status),c=this.generateToastrMessage(s,p,l);"WARNING"==c.status?this.toastrService.warning(c.message,"Warning!",{enableHtml:!0}):this.toastrService.error(c.message,`Error - ${r.status}`,{enableHtml:!0})}generateToastrMessage(r,l,s){let c,p="";return 0==r.length&&l.length>0?(c="SUCCESS",p=this.createSuccessResponse(l,s)):r.length>0&&0==l.length?(c="ERROR",p=this.createErrResponse(r,s)):(c="WARNING",p=`${this.createSuccessResponse(l,s)} ${this.createErrResponse(r,s)}`),p=`<ol>${p}</ol>`,{status:c,message:p}}createErrResponse(r,l){let s="";return r.forEach((p,c)=>{s+=`<li><b>${p.Response}</b> for ${l.Name} in ${p.Name}</li>`}),s}createSuccessResponse(r,l){let s="";return r.forEach((p,c)=>{s+=`<li>Product ${l.Name} was <b>successfully</b> uploaded to ${p.Name}</li>`}),s}getHostName(){if(e.g.IsEmpty(this.hostName)){const r=localStorage.getItem("Authorization");this.hostName=JSON.parse(r)?.Host}return this.hostName}}b.\u0275fac=function(r){return new(r||b)(M.LFG(y.O),M.LFG(h._W))},b.\u0275prov=M.Yz7({token:b,factory:b.\u0275fac,providedIn:"root"})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[395],{9395:(Pn,w,s)=>{s.r(w),s.d(w,{InventoryModule:()=>m});var p=s(6895),n=s(4650),I=s(284),F=s(2937);class d{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"}]}}d.\u0275fac=function(t){return new(t||d)},d.\u0275cmp=n.Xpm({type:d,selectors:[["app-inventory"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,e){1&t&&(n.TgZ(0,"nav",0)(1,"div",1)(2,"div"),n._UZ(3,"nav-tab",2),n.qZA()()(),n._UZ(4,"router-outlet")),2&t&&(n.xp6(3),n.Q6J("Tabs",e.inventoryTabs))},dependencies:[I.lC,F.e]});var A=s(8231),L=s(6304),b=s(8505),C=s(9300),h=s(1889),f=s(8705),N=s(1318),T=s(7185),S=s(5412),D=s(9425),J=s(6082),Z=s(7481),P=s(6114);function O(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"button",17),n.NdJ("click",function(){n.CHM(e);const i=n.oxw(3);return n.KtG(i.openScanDialog())}),n._UZ(1,"i",18),n._uU(2," Scan Channel "),n.qZA()}}function E(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"button",19),n.NdJ("click",function(){n.CHM(e);const i=n.oxw().ngIf,l=n.oxw(2);return n.KtG(l.onUpdateItems(i))}),n._UZ(1,"i",20),n._uU(2," Update "),n.qZA()}}function Y(a,t){if(1&a&&(n.TgZ(0,"actions")(1,"div",14)(2,"div"),n.YNc(3,O,3,0,"button",15),n.YNc(4,E,3,0,"button",16),n.qZA()()()),2&a){const e=t.ngIf,o=n.oxw(2);n.xp6(3),n.Q6J("ngIf",!o.productService.hasSelectionVariant(e)),n.xp6(1),n.Q6J("ngIf",o.productService.hasSelectionVariant(e))}}function $(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"app-table",21),n.NdJ("onToggle",function(i){n.CHM(e);const l=n.oxw(2);return n.KtG(l.onShowDifferenceStock(i))})("onSubmit",function(i){const r=n.CHM(e).ngIf,c=n.oxw(2);return n.KtG(c.updateStockByVariant(i,r))}),n.qZA()}if(2&a){const e=t.ngIf,o=n.oxw(2);n.Q6J("data",e)("channel",o.channelOptions)("showProductToggle",!0)("filter",o.searchFilter)}}function R(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"span",22),n.NdJ("click",function(){n.CHM(e);const i=n.oxw(2);return n.KtG(i.getRowCount())}),n.TgZ(1,"i",23),n._uU(2,"?"),n.qZA()()}}function q(a,t){if(1&a&&(n.TgZ(0,"span"),n._uU(1),n.ALo(2,"number"),n.qZA()),2&a){const e=t.ngIf;n.xp6(1),n.Oqu(n.lcZ(2,1,e))}}function H(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"a",24),n.NdJ("click",function(){n.CHM(e);const i=n.oxw(2);return n.KtG(i.nextPage())}),n._UZ(1,"i",25),n._uU(2," Next"),n.qZA()}}function V(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"a",26),n.NdJ("click",function(){n.CHM(e);const i=n.oxw(2);return n.KtG(i.getAllData())}),n._UZ(1,"i",27),n._uU(2," Last"),n.qZA()}}function B(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"mainpanel",1),n.NdJ("onSubmit",function(i){n.CHM(e);const l=n.oxw();return n.KtG(l.onSearch(i))}),n.YNc(1,Y,5,2,"actions",2),n.ALo(2,"async"),n.TgZ(3,"content")(4,"div",3)(5,"div",4)(6,"div",5),n.YNc(7,$,1,4,"app-table",6),n.ALo(8,"async"),n.ynx(9),n.TgZ(10,"div",7)(11,"div",8)(12,"div",9),n._uU(13),n.ALo(14,"number"),n.ALo(15,"async"),n.YNc(16,R,3,0,"span",10),n.YNc(17,q,3,3,"span",2),n.ALo(18,"async"),n._uU(19),n.qZA()(),n.TgZ(20,"div",11),n.YNc(21,H,3,0,"a",12),n.YNc(22,V,3,0,"a",13),n.qZA()(),n.BQk(),n.qZA()()()()()}if(2&a){const e=n.oxw();let o;n.Q6J("pageData",e.pageData)("hideSearchBox",!1)("hideSearchDropdown",!0)("textButton","Search"),n.xp6(1),n.Q6J("ngIf",n.lcZ(2,12,e.paginationService.data$)),n.xp6(6),n.Q6J("ngIf",n.lcZ(8,14,e.paginationService.data$)),n.xp6(6),n.hij(" Showing 1 - ",n.lcZ(14,16,null==(o=n.lcZ(15,18,e.paginationService.data$))?null:o.length)," of "),n.xp6(3),n.Q6J("ngIf",e.paginationService.hideCount),n.xp6(1),n.Q6J("ngIf",n.lcZ(18,20,!e.paginationService.hideCount&&e.allDataCount$)),n.xp6(2),n.hij(" records ~ ",e.paginationService.footerPageNumber," Page "),n.xp6(2),n.Q6J("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage),n.xp6(1),n.Q6J("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage)}}class x{constructor(t,e,o,i,l){this.http=t,this.toastr=e,this.dialog=o,this.paginationService=i,this.productService=l,this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.filterTypeOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory/pos",Active:!0},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!1}]}}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe((0,b.b)(t=>{this.channelOptions=t.Options.Channel,t.Filter={PageNumber:t.Filter.PageNumber,filterModel:f.v.ALL,RowCount:t.Filter.PageSize,HiddenIPOSInventory:t.Filter.HiddenIPOSInventory},this.searchFilter=t.Filter,this.paginationService.resetToFirstPage(this.searchFilter)}))}onSearch(t){this.searchFilter.text=t,this.paginationService.resetToFirstPage(this.searchFilter)}updateStock(t,e){let o=this.productService.selectedVariantProduct(t);if(o.length>0){let l=o.map(c=>({ID:c.ID,Code:c.Code,Inventory:c.Inventory})),r={ListChannelID:e.filter(c=>c.selected).map(c=>c.ID),List:l};this.http.post("/api/Inventory/UpdateChannel",r).subscribe(c=>{this.paginationService.resetToFirstPage(this.searchFilter),this.toastr.success("Successfully updated "+r.List.length+" variants in "+r.ListChannelID.length+" channels","Success")})}}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(A.j,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe((0,C.h)(o=>h.g.IsNotEmpty(o))).subscribe(o=>{this.searchFilter.ScanFull=o.ScanFull,this.searchFilter.ChannelID=o.ChannelID,this.searchFilter.UpdatedProduct=o.UpdatedProduct,this.searchFilter.Async=o.Async,this.scanAll()})}scanAll(){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{let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,e,!this.searchFilter.UpdatedProduct),this.initPageLoader()}this.searchFilter.ChannelID=h.g.GuidEMpty})}updateStockByVariant(t,e){let o={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku};this.http.post("/api/Inventory/UpdateQuantityByItem",o).subscribe(i=>{let l=this.productService.findChannelById(o.ID,this.channelOptions);this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+l.Name+" to "+o.NewQuantity,"Success")})}onShowDifferenceStock(t){this.searchFilter.filterModel=t?f.v.DIFFERENCE:f.v.ALL,this.paginationService.resetToFirstPage(this.searchFilter)}onUpdateItems(t){const e=this.productService.selectedVariantProduct(t);this.dialog.open(L.j,{data:{selectedItems:e,channels:JSON.parse(JSON.stringify(this.channelOptions))},width:"600px"}).afterClosed().pipe((0,C.h)(o=>h.g.IsNotEmpty(o))).subscribe(o=>{this.updateStock(t,o)})}getRowCount(){this.paginationService.hideCount=!1,this.allDataCount$=this.http.post(`/API/${this.allDataCountEndpoint}`,{text:this.searchFilter.text})}nextPage(){this.paginationService.onNextPage(this.searchFilter)}getAllData(){this.http.post(`/API/${this.allDataCountEndpoint}`,{}).subscribe({next:t=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,t)}})}ngOnDestroy(){this.paginationService.destroy()}}x.\u0275fac=function(t){return new(t||x)(n.Y36(N.O),n.Y36(T._W),n.Y36(S.uw),n.Y36(D.b),n.Y36(J.M))},x.\u0275cmp=n.Xpm({type:x,selectors:[["app-multi-channel-comparison"]],decls:2,vars:3,consts:[["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit",4,"ngIf"],["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit"],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],[1,"d-flex"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(t,e){1&t&&(n.YNc(0,B,23,22,"mainpanel",0),n.ALo(1,"async")),2&t&&n.Q6J("ngIf",n.lcZ(1,1,e.loader$))},dependencies:[p.O5,Z.p,P.a,p.Ov,p.JJ],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});var G=s(7945),K=s(9608),j=s(6779),_=s(4006),W=s(6401),M=s(8796);function z(a,t){if(1&a&&(n.TgZ(0,"ng-option",4),n._UZ(1,"img",5),n._uU(2),n.qZA()),2&a){const e=t.$implicit;n.Q6J("value",e.ID),n.xp6(1),n.Q6J("src",e.Img,n.LSH),n.xp6(1),n.hij("",e.Name," ")}}class v{constructor(t,e){this.data=t,this.dialogRef=e,this.channelOptions=t.channelOptions,this.channel=t.selectedChannel?t.selectedChannel:new K.$}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new j.O,this.modalConfig.title="Choose Channel",this.modalConfig.customWidth="350px",this.modalConfig.okText="SAVE"}onSelectChannel(t){let e=this.channelOptions.find(o=>o.ID==t);this.channel=e,this.channel&&(this.channel.logo=h.g.getChannelLogoByTypeId(e.TypeID))}onClose(){this.dialogRef.close()}onOk(){this.dialogRef.close(this.channel)}}v.\u0275fac=function(t){return new(t||v)(n.Y36(S.WI),n.Y36(S.so))},v.\u0275cmp=n.Xpm({type:v,selectors:[["app-modal-choose-channel"]],decls:4,vars:4,consts:[[3,"config","onClose","onCancel","onOk"],["content",""],["appendTo","body",3,"clearable","ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"]],template:function(t,e){1&t&&(n.TgZ(0,"modal-material",0),n.NdJ("onClose",function(){return e.onClose()})("onCancel",function(){return e.onClose()})("onOk",function(){return e.onOk()}),n.TgZ(1,"div",1)(2,"ng-select",2),n.NdJ("ngModelChange",function(i){return e.onSelectChannel(i)}),n.YNc(3,z,3,3,"ng-option",3),n.qZA()()()),2&t&&(n.Q6J("config",e.modalConfig),n.xp6(2),n.Q6J("clearable",!1)("ngModel",e.channel.ID),n.xp6(1),n.Q6J("ngForOf",e.channelOptions))},dependencies:[p.sg,_.JJ,_.On,W.M,M.w9,M.jq]});var X=s(1739);class u{constructor(t){this.toastrService=t}showToastrUpdateInventory(t,e){const o=t.length>0,i=e.length>0;if(!i&&o&&this.toastrService.success(`${this.generateSuccessMessage(t.length)}`,"Success",{enableHtml:!0}),i&&o){const l=`<li>${this.generateSuccessMessage(t.length)}</li>`,r=this.generateErrorMessage(e);this.toastrService.warning(`<ol>${l} ${r}</ol>`,"Warning",{enableHtml:!0})}if(i&&!o){const l=`<ol>${this.generateErrorMessage(e)}</ol>`;this.toastrService.error(l,"Error",{enableHtml:!0})}}generateSuccessMessage(t){return`<span class="fw-bold">Successfully</span> updated ${t} variants in 1 channels`}generateErrorMessage(t=[]){let e="";return t.forEach((o,i)=>{e+=`<li><span class="fw-bold">Error</span> Updating stock for [${o.Name}] - <b>${o.Message}</b></li>`}),e}}u.\u0275fac=function(t){return new(t||u)(n.LFG(T._W))},u.\u0275prov=n.Yz7({token:u,factory:u.\u0275fac});var k=s(455),U=s(266);function nn(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"button",36),n.NdJ("click",function(){n.CHM(e);const i=n.oxw(2).ngIf,l=n.oxw();return n.KtG(l.openScanDialog(i))}),n._UZ(1,"i",37),n._uU(2," Scan Channel "),n.qZA()}}function en(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"button",38),n.NdJ("click",function(){n.CHM(e);const i=n.oxw().ngIf,l=n.oxw(2);return n.KtG(l.updateStock(i))}),n._UZ(1,"i",39),n._uU(2," Update"),n.qZA()}}function tn(a,t){if(1&a&&(n.TgZ(0,"div"),n.YNc(1,nn,3,0,"button",34),n.YNc(2,en,3,0,"button",35),n.qZA()),2&a){const e=t.ngIf,o=n.oxw(2);n.xp6(1),n.Q6J("ngIf",!o.productService.hasSelectionVariant(e)),n.xp6(1),n.Q6J("ngIf",o.productService.hasSelectionVariant(e))}}function an(a,t){1&a&&(n.TgZ(0,"div",40)(1,"span"),n._uU(2," showing only different stock, please press next to populate more data "),n.qZA()())}function on(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"th")(1,"input",41),n.NdJ("ngModelChange",function(i){n.CHM(e);const l=n.oxw(2);return n.KtG(l.checkboxState=i)})("ngModelChange",function(){const l=n.CHM(e).ngIf,r=n.oxw(2);return n.KtG(r.onCheckboxStateChange(l))}),n.qZA()()}if(2&a){const e=n.oxw(2);n.xp6(1),n.Q6J("ngModel",e.checkboxState)}}function ln(a,t){1&a&&(n.ynx(0),n.TgZ(1,"th",42),n._uU(2," Reserved "),n.qZA(),n.BQk())}function sn(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"input",66),n.NdJ("ngModelChange",function(i){n.CHM(e);const l=n.oxw(3).$implicit;return n.KtG(l.selected=i)})("ngModelChange",function(){n.CHM(e);const i=n.oxw(3).$implicit,l=n.oxw(2);return n.KtG(l.onCheckboxStateProduct(i))}),n.qZA()}if(2&a){const e=n.oxw(3).$implicit;n.Q6J("ngModel",e.selected)}}function rn(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"img",67),n.NdJ("click",function(i){n.CHM(e);const l=n.oxw(3).$implicit,r=n.oxw(2);return n.KtG(r.onZoomImage(i,null==l?null:l.ImageUrl))}),n.qZA()}if(2&a){const e=n.oxw(3).$implicit;n.s9C("src",null==e?null:e.ThumbnailUrl,n.LSH)}}function cn(a,t){1&a&&n._UZ(0,"img",68)}function pn(a,t){if(1&a&&(n.ynx(0),n.TgZ(1,"td",57)(2,"div",58),n.YNc(3,sn,1,1,"input",59),n.YNc(4,rn,1,1,"img",60),n.YNc(5,cn,1,0,"ng-template",null,61,n.W1O),n.qZA()(),n.TgZ(7,"td",62)(8,"span",63),n._uU(9),n.qZA(),n._UZ(10,"br"),n.TgZ(11,"div",64),n._UZ(12,"i",65),n.TgZ(13,"small"),n._uU(14),n.qZA()()(),n.BQk()),2&a){const e=n.MAs(6),o=n.oxw().$implicit,i=n.oxw().$implicit;n.xp6(1),n.Q6J("rowSpan",null==i?null:i.Variants.length),n.xp6(2),n.Q6J("ngIf",(null==o?null:o.Inventory)>=0||i.Variants.length>1),n.xp6(1),n.Q6J("ngIf",null==i?null:i.ThumbnailUrl)("ngIfElse",e),n.xp6(3),n.Q6J("rowSpan",null==i?null:i.Variants.length),n.xp6(2),n.Oqu(null==i?null:i.Name),n.xp6(5),n.hij("(",null==i?null:i.Category,")")}}function hn(a,t){if(1&a){const e=n.EpF();n.ynx(0),n.TgZ(1,"input",41),n.NdJ("ngModelChange",function(i){n.CHM(e);const l=n.oxw(2).$implicit;return n.KtG(l.selected=i)}),n.qZA(),n.BQk()}if(2&a){const e=n.oxw(2).$implicit;n.xp6(1),n.Q6J("ngModel",e.selected)}}function _n(a,t){if(1&a&&(n.ynx(0),n.YNc(1,hn,2,1,"ng-container",3),n.BQk()),2&a){const e=n.oxw().$implicit;n.xp6(1),n.Q6J("ngIf",(null==e?null:e.Inventory)<=1e5)}}function un(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"input",41),n.NdJ("ngModelChange",function(i){n.CHM(e);const l=n.oxw(2).$implicit;return n.KtG(l.selected=i)}),n.qZA()}if(2&a){const e=n.oxw(2).$implicit;n.Q6J("ngModel",e.selected)}}function gn(a,t){if(1&a&&n.YNc(0,un,1,1,"input",69),2&a){const e=n.oxw().$implicit;n.Q6J("ngIf",(null==e?null:e.Inventory)>=0)}}function mn(a,t){if(1&a&&(n.TgZ(0,"span")(1,"span",70),n._uU(2),n.ALo(3,"number"),n.qZA(),n._uU(4," => "),n.TgZ(5,"span",71),n._uU(6),n.ALo(7,"number"),n.qZA()()),2&a){const e=n.oxw().$implicit;n.xp6(2),n.hij(" ",n.lcZ(3,2,null==e||null==e.I?null:e.I.Available),""),n.xp6(4),n.Oqu(n.lcZ(7,4,null==e?null:e.Inventory))}}function dn(a,t){if(1&a&&(n.TgZ(0,"span"),n._uU(1),n.ALo(2,"number"),n.qZA()),2&a){const e=n.oxw().$implicit;n.xp6(1),n.hij(" ",n.lcZ(2,1,null==e?null:e.Inventory)," ")}}const Cn=function(a){return{"bg-gradient-warning":a}};function fn(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"td",72)(1,"span",73),n.NdJ("click",function(){n.CHM(e);const i=n.oxw().$implicit,l=n.oxw(),r=l.$implicit,c=l.ngForOf,Jn=n.oxw(2);return n.KtG(Jn.openTableDialog(r,i,c))}),n._uU(2),n.ALo(3,"number"),n.qZA()()}if(2&a){const e=n.oxw().$implicit;n.Q6J("ngClass",n.VKq(4,Cn,(null==e?null:e.Inventory)!=(null==e||null==e.Channel[0]?null:e.Channel[0].Inventory))),n.xp6(2),n.hij(" ",n.lcZ(3,2,null==e||null==e.Channel[0]?null:e.Channel[0].Inventory)," ")}}function xn(a,t){if(1&a&&(n.ynx(0),n.TgZ(1,"span",75),n._uU(2),n.ALo(3,"number"),n.qZA(),n.BQk()),2&a){const e=n.oxw(2).$implicit;n.xp6(2),n.hij(" (",n.lcZ(3,1,null==e||null==e.Channel[0]?null:e.Channel[0].InventoryReserved),") ")}}function vn(a,t){1&a&&n._uU(0," - ")}function yn(a,t){if(1&a&&(n.ynx(0),n.TgZ(1,"td",44),n.YNc(2,xn,4,3,"ng-container",50),n.YNc(3,vn,1,0,"ng-template",null,74,n.W1O),n.qZA(),n.BQk()),2&a){const e=n.MAs(4),o=n.oxw().$implicit;n.xp6(2),n.Q6J("ngIf",null==o||null==o.Channel[0]?null:o.Channel[0].InventoryReserved)("ngIfElse",e)}}function Sn(a,t){1&a&&(n.ynx(0),n._uU(1," - "),n.BQk())}function In(a,t){if(1&a&&(n.TgZ(0,"span",76),n.ALo(1,"date"),n._uU(2),n.ALo(3,"date"),n.qZA()),2&a){const e=n.oxw().$implicit;n.Q6J("matTooltip",n.xi3(1,2,null==e||null==e.Channel[0]?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),n.xp6(2),n.hij(" ",n.xi3(3,5,null==e||null==e.Channel[0]?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function bn(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"tr"),n.YNc(1,pn,15,7,"ng-container",3),n.TgZ(2,"td",43),n._uU(3),n.qZA(),n.TgZ(4,"td",44)(5,"div",45)(6,"span"),n._uU(7),n.qZA(),n.TgZ(8,"span",46)(9,"a",47),n._UZ(10,"i",48),n.qZA()()()(),n.TgZ(11,"td",49),n.YNc(12,_n,2,1,"ng-container",50),n.YNc(13,gn,1,1,"ng-template",null,51,n.W1O),n.qZA(),n.TgZ(15,"td",44),n.YNc(16,mn,8,6,"span",3),n.YNc(17,dn,3,3,"span",3),n.qZA(),n.YNc(18,fn,4,6,"td",52),n.YNc(19,yn,5,2,"ng-container",3),n.TgZ(20,"td",26),n.YNc(21,Sn,2,0,"ng-container",50),n.YNc(22,In,4,8,"ng-template",null,53,n.W1O),n.qZA(),n.TgZ(24,"td")(25,"div",12)(26,"div",54)(27,"a",47),n._UZ(28,"i",48),n.qZA(),n._uU(29," \xa0\xa0 "),n.TgZ(30,"span",55),n.NdJ("click",function(){const l=n.CHM(e).$implicit,r=n.oxw(3);return n.KtG(r.refreshInventory(null==l||null==l.Channel[0]?null:l.Channel[0].ChannelItemID,null==l||null==l.Channel[0]?null:l.Channel[0].ChannelVariationID,null==l||null==l.Channel[0]?null:l.Channel[0].ChannelID,null==l?null:l.ID))}),n._UZ(31,"i",56),n.qZA()()()()()}if(2&a){const e=t.$implicit,o=t.index,i=n.MAs(14),l=n.MAs(23),r=n.oxw(3);n.xp6(1),n.Q6J("ngIf",0==o),n.xp6(2),n.Oqu(null==e?null:e.Model),n.xp6(4),n.Oqu(null==e?null:e.Code),n.xp6(2),n.Q6J("href","https://"+r.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(null==e?null:e.ID),n.LSH),n.xp6(3),n.Q6J("ngIf",1==(null==e?null:e.Channel[0].TypeID))("ngIfElse",i),n.xp6(4),n.Q6J("ngIf",(null==e?null:e.Inventory)!=(null==e||null==e.I?null:e.I.Available)),n.xp6(1),n.Q6J("ngIf",(null==e?null:e.Inventory)==(null==e||null==e.I?null:e.I.Available)),n.xp6(1),n.Q6J("ngIf",null==e?null:e.Channel),n.xp6(1),n.Q6J("ngIf",r.isShowReservedColumn),n.xp6(2),n.Q6J("ngIf",(null==e||null==e.Channel[0]?null:e.Channel[0].LastInventorySync)==r.minDate)("ngIfElse",l),n.xp6(6),n.Q6J("href",null==e||null==e.Channel[0]?null:e.Channel[0].Url,n.LSH)}}function Tn(a,t){if(1&a&&(n.TgZ(0,"tbody"),n.YNc(1,bn,32,13,"tr",28),n.qZA()),2&a){const e=t.$implicit;n.xp6(1),n.Q6J("ngForOf",e.Variants)}}function Zn(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"span",77),n.NdJ("click",function(){n.CHM(e);const i=n.oxw(2);return n.KtG(i.getRowCount())}),n.TgZ(1,"i",78),n._uU(2,"?"),n.qZA()()}}function Mn(a,t){if(1&a&&(n.TgZ(0,"span"),n._uU(1),n.ALo(2,"number"),n.qZA()),2&a){const e=t.ngIf;n.xp6(1),n.Oqu(n.lcZ(2,1,null==e?null:e.Total))}}function wn(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"a",82),n.NdJ("click",function(){n.CHM(e);const i=n.oxw(3);return n.KtG(i.onNextPage())}),n._UZ(1,"i",83),n._uU(2," Next"),n.qZA()}}function Fn(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"a",84),n.NdJ("click",function(){n.CHM(e);const i=n.oxw(3);return n.KtG(i.onLastPage())}),n._UZ(1,"i",85),n._uU(2," Last"),n.qZA()}}function An(a,t){if(1&a&&(n.TgZ(0,"div",79),n.YNc(1,wn,3,0,"a",80),n.YNc(2,Fn,3,0,"a",81),n.qZA()),2&a){const e=n.oxw(2);n.xp6(1),n.Q6J("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage),n.xp6(1),n.Q6J("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage)}}function Nn(a,t){if(1&a){const e=n.EpF();n.TgZ(0,"mainpanel",1),n.NdJ("onSubmit",function(i){n.CHM(e);const l=n.oxw();return n.KtG(l.onSearch(i))}),n.TgZ(1,"actions")(2,"div",2),n.YNc(3,tn,3,2,"div",3),n.ALo(4,"async"),n.qZA()(),n.TgZ(5,"filters")(6,"div",2)(7,"div",4)(8,"div")(9,"label",5),n._uU(10,"PageNumber"),n.qZA(),n.TgZ(11,"input",6),n.NdJ("ngModelChange",function(i){n.CHM(e);const l=n.oxw();return n.KtG(l.searchFilter.PageNumber=i)}),n.qZA()(),n.TgZ(12,"div")(13,"label",7),n._uU(14,"Page Size"),n.qZA(),n.TgZ(15,"input",8),n.NdJ("ngModelChange",function(i){n.CHM(e);const l=n.oxw();return n.KtG(l.searchFilter.RowCount=i)}),n.qZA()(),n.TgZ(16,"div")(17,"h6"),n._uU(18,"Quantity From - To"),n.qZA(),n.TgZ(19,"input",9),n.NdJ("ngModelChange",function(i){n.CHM(e);const l=n.oxw();return n.KtG(l.searchFilter.QuantityFrom=i)}),n.qZA(),n._uU(20," - "),n.TgZ(21,"input",10),n.NdJ("ngModelChange",function(i){n.CHM(e);const l=n.oxw();return n.KtG(l.searchFilter.QuantityTo=i)}),n.qZA()()()()(),n.TgZ(22,"content")(23,"div",11)(24,"div",12)(25,"div",13),n.YNc(26,an,3,0,"div",14),n.TgZ(27,"table",15)(28,"thead",16)(29,"tr")(30,"th",17),n._uU(31,"Product "),n._UZ(32,"br"),n.TgZ(33,"mat-slide-toggle",18),n.NdJ("toggleChange",function(){n.CHM(e);const i=n.oxw();return i.showDifferenceStock=!i.showDifferenceStock,n.KtG(i.onShowDifferenceStock())}),n.TgZ(34,"small",19),n._uU(35,"FILTER DIFFERENT INVENTORY"),n.qZA()()(),n.TgZ(36,"th",20),n._uU(37,"Variant"),n.qZA(),n.TgZ(38,"th",21),n._uU(39,"SKU"),n.qZA(),n.YNc(40,on,2,1,"th",3),n.ALo(41,"async"),n.TgZ(42,"th",22),n._uU(43,"POS"),n.qZA(),n.TgZ(44,"th",23)(45,"div",24),n.NdJ("click",function(){n.CHM(e);const i=n.oxw();return n.KtG(i.onChangeChannel())}),n._UZ(46,"img",25),n._uU(47),n.qZA()(),n.YNc(48,ln,3,0,"ng-container",3),n.TgZ(49,"th",26),n._uU(50,"Last Sync"),n.qZA(),n._UZ(51,"th",27),n.qZA()(),n.YNc(52,Tn,2,1,"tbody",28),n.ALo(53,"async"),n.qZA(),n.TgZ(54,"div",29)(55,"div",30)(56,"div",31),n._uU(57),n.ALo(58,"number"),n.ALo(59,"async"),n.YNc(60,Zn,3,0,"span",32),n.YNc(61,Mn,3,3,"span",3),n.ALo(62,"async"),n._uU(63),n.qZA()(),n.YNc(64,An,3,2,"div",33),n.ALo(65,"async"),n.qZA()()()()()()}if(2&a){const e=n.oxw();let o,i;n.Q6J("headerTitle","Inventory Comparison")("pageData",e.pageData)("hideSearchBox",!1),n.xp6(3),n.Q6J("ngIf",n.lcZ(4,20,e.paginationService.data$)),n.xp6(8),n.Q6J("ngModel",e.searchFilter.PageNumber),n.xp6(4),n.Q6J("ngModel",e.searchFilter.RowCount),n.xp6(4),n.Q6J("ngModel",e.searchFilter.QuantityFrom),n.xp6(2),n.Q6J("ngModel",e.searchFilter.QuantityTo),n.xp6(5),n.Q6J("ngIf",3==(null==e.searchFilter?null:e.searchFilter.filterModel)),n.xp6(14),n.Q6J("ngIf",n.lcZ(41,22,e.paginationService.data$)),n.xp6(5),n.Q6J("matTooltip","Change "+(null==e.selectedChannel?null:e.selectedChannel.Name)),n.xp6(1),n.Q6J("src",e.selectedChannel.logo,n.LSH),n.xp6(1),n.hij(" ",null!=e.selectedChannel&&e.selectedChannel.Name?null==e.selectedChannel?null:e.selectedChannel.Name:"Choose Channel ..."," "),n.xp6(1),n.Q6J("ngIf",e.isShowReservedColumn),n.xp6(4),n.Q6J("ngForOf",n.lcZ(53,24,e.products$)),n.xp6(5),n.hij(" Showing 1 - ",n.lcZ(58,26,null==(o=n.lcZ(59,28,e.paginationService.data$))?null:o.length)," of "),n.xp6(3),n.Q6J("ngIf",e.paginationService.hideCount),n.xp6(1),n.Q6J("ngIf",n.lcZ(62,30,!e.paginationService.hideCount&&e.rowCount$)),n.xp6(2),n.hij(" records ~ ",e.paginationService.footerPageNumber," Page "),n.xp6(1),n.Q6J("ngIf",(null==(i=n.lcZ(65,32,e.paginationService.data$))?null:i.length)>0)}}class y{constructor(t,e,o,i,l,r,c){this.http=t,this.toastr=e,this.dialog=o,this.paginationService=i,this.productService=l,this.biggerPictureService=r,this.inventoryService=c,this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="/api/InventoryLoader/Load",this.rowCountApi="/api/Inventory/GetInventoryByChannelRowCount",this.minDate=h.g.MinDate,this.isShowReservedColumn=!0,this.Options=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]},this.hostName=l.getHostName()}ngOnInit(){this.initPageLoader(),this.products$=this.paginationService.data$.pipe((0,b.b)(t=>{this.checkShowReservedColumn(t)}))}checkShowReservedColumn(t){let o,e=0;t.forEach(i=>{o=i.Variants.find(l=>h.g.IsNotEmpty(l?.Channel[0]?.InventoryReserved)),o&&(e+=1)}),this.isShowReservedColumn=e>0}initPageLoader(){this.paginationService.fetchDataEndpoint="Inventory/GetSingleChannelComparison",this.loader$=this.http.post(this.loaderApi,{}).pipe((0,b.b)(t=>{this.channelOptions=t.Options.Channel,this.searchFilter={RowCount:t.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:t.Filter.ChannelID},this.initSelectedChannel(),this.paginationService.resetToFirstPage(this.searchFilter),t.Filter.IsMarketplaceAppActive||this.toastr.warning("Automatic inventory sync disabled.\n Please enable Dealpos X Marketplace Apps integration in POS Configuration","Warning")}))}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(t=>t.ID==this.searchFilter.ChannelID),this.selectedChannel&&(this.selectedChannel.logo=h.g.getChannelLogoByTypeId(this.selectedChannel.TypeID))}onChangeChannel(){this.dialog.open(v,{data:{channelOptions:this.channelOptions,selectedChannel:this.selectedChannel}}).afterClosed().pipe((0,C.h)(t=>h.g.IsNotEmpty(t))).subscribe(t=>{this.selectedChannel=t,this.onFilterChannel(t.ID)})}onSearch(t){this.searchFilter.text=t,this.paginationService.resetToFirstPage(this.searchFilter)}onFilterChannel(t){this.searchFilter.ChannelID=t,this.searchFilter.PageNumber=1,this.paginationService.resetToFirstPage(this.searchFilter)}updateStock(t){const e=this.productService.selectedVariantProduct(t);if(e.length>0){let o=e.map(l=>({ID:l.ID,Code:l.Code,Inventory:l.Inventory}));this.http.post("/api/Inventory/UpdateChannel",{ListChannelID:[this.searchFilter.ChannelID],List:o}).subscribe(l=>{this.searchFilter.PageNumber=1,this.paginationService.resetToFirstPage(this.searchFilter),this.checkboxState=!1,this.handlingUpdateStock(l)})}}handlingUpdateStock(t){t[0]?.StatusProduct?this.inventoryService.showToastrUpdateInventory(t[0].StatusProduct.Success_list,t[0].StatusProduct.Fail_list):this.toastr.error(t[0]?.Exception,"Error")}openScanDialog(t){const e=JSON.parse(JSON.stringify(this.searchFilter));e.ChannelID=h.g.GuidEMpty,this.dialog.open(A.j,{data:{filter:e,channelOptions:t.Options.Channel},width:"600px"}).afterClosed().pipe((0,C.h)(i=>h.g.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.scannALl(t)})}scannALl(t){const e=this.productService.findChannelById(this.searchFilter.ChannelID,t.Options.Channel);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(o=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.searchFilter.ScanFull=!1,this.initPageLoader(),this.toastr.success("Successfully scanned from "+e?.Name,"Success"))})}refreshInventory(t,e,o,i){this.http.post("/api/Inventory/RefreshInventoryChannel",{ChannelItemID:t,ChannelVariationID:e,ChannelID:o,VariantID:i}).subscribe(r=>{this.toastr.success("Successfully updated","Success"),this.paginationService.resetToFirstPage(this.searchFilter)})}onCheckboxStateProduct(t){t.Variants=t.Variants.map(e=>(e.Inventory>=0&&(e.selected=t.selected),e))}onCheckboxStateChange(t){t=t.map(e=>(e.Variants=e.Variants.map(o=>(o.selected=this.checkboxState,o)),e))}openTableDialog(t,e,o){this.dialog.open(G.k,{data:{Name:t.Name,Variant:e,ChannelID:e?.Channel[0].ChannelID,Table:"inventory",ChannelItemID:t.ChannelItemID}}).afterClosed().pipe((0,C.h)(l=>h.g.IsNotEmpty(l))).subscribe(l=>{this.updateItemAfterDialog(l,o)})}updateItemAfterDialog(t,e){let o={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku};const i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.http.post("/api/Inventory/UpdateQuantityByItem",o).subscribe(l=>{this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+i?.Name+" to "+o.NewQuantity,"Success")})}onShowDifferenceStock(){this.searchFilter.filterModel=this.showDifferenceStock?f.v.DIFFERENCE:f.v.ALL,this.paginationService.resetToFirstPage(this.searchFilter)}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}getRowCount(){const t={ChannelID:this.searchFilter.ChannelID,PageNumber:1,text:this.searchFilter.text};this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`${this.rowCountApi}`,t)}onLastPage(){this.http.post(`${this.rowCountApi}`,{ChannelID:this.searchFilter.ChannelID,PageNumber:1}).subscribe({next:e=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,e.Total)}})}onZoomImage(t,e){this.biggerPictureService.openBiggerPicture(t,e)}ngOnDestroy(){this.paginationService.destroy()}}y.\u0275fac=function(t){return new(t||y)(n.Y36(N.O),n.Y36(T._W),n.Y36(S.uw),n.Y36(D.b),n.Y36(J.M),n.Y36(X.k),n.Y36(u))},y.\u0275cmp=n.Xpm({type:y,selectors:[["app-single-channel-comparison"]],decls:2,vars:3,consts:[["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit",4,"ngIf"],["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit"],[1,"d-flex"],[4,"ngIf"],["container",""],["for","PageNumber"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control",3,"ngModel","ngModelChange"],["for","RowCount"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control",3,"ngModel","ngModelChange"],["type","number","name","QuantityFrom",1,"w-25","me-2",3,"ngModel","ngModelChange"],["type","number","name","QuantityTo",1,"w-25","ms-2",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["class","alert alert-warning d-flex justify-content-between text-dark","role","alert",4,"ngIf"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","ps-12",2,"width","25%"],[3,"toggleChange"],[1,"fw-bold"],["scope","col",1,"text-start"],["scope","col",1,"text-end",2,"width","10%"],["scope","col",1,"text-end","w-10",2,"width","8%"],[1,"text-end",2,"width","100px"],["matTooltipPosition","above",1,"d-inline-block","text-truncate","mt-3","cursor-pointer",2,"max-width","114px",3,"matTooltip","click"],[2,"width","16px",3,"src"],[1,"text-center"],[2,"width","4%"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],["class","btn-group",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["class","btn btn-success",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],["role","alert",1,"alert","alert-warning","d-flex","justify-content-between","text-dark"],["type","checkbox",3,"ngModel","ngModelChange"],["matTooltip","Reserved Stock","matTooltipPosition","above",1,"text-end",2,"width","80px"],[1,"text-start"],[1,"text-end"],[1,"d-flex","align-items-center","justify-content-end"],[1,"ms-2"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"align-middle"],[4,"ngIf","ngIfElse"],["OTHER_CHANNEL",""],["class","text-end",3,"ngClass",4,"ngIf"],["SYNCDATE",""],[1,"col-12","ps-0","d-flex","justify-content-between"],["matTooltip","Refresh stock according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","fa-sync","fa-lg","external-link-custom"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],["type","checkbox","class","me-3",3,"ngModel","ngModelChange",4,"ngIf"],["class","border rounded w-img cursor-pointer","style","margin-left: 20px",3,"src","click",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-flex","align-items-center"],["title","Category",1,"fa-solid","fa-tags","me-2",2,"opacity","60%"],["type","checkbox",1,"me-3",3,"ngModel","ngModelChange"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],["title","Allocated"],["title","Inventory below minimum inventory"],[1,"text-end",3,"ngClass"],[1,"cursor",3,"click"],["EMPTY_RESERVED",""],[1,"text-danger"],["matTooltipShowDelay","500",3,"matTooltip"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(t,e){1&t&&(n.YNc(0,Nn,66,34,"mainpanel",0),n.ALo(1,"async")),2&t&&n.Q6J("ngIf",n.lcZ(1,1,e.loader$))},dependencies:[p.mk,p.sg,p.O5,_.Fj,_.wV,_.Wl,_.JJ,_.On,k.Rr,Z.p,U.gM,p.Ov,p.JJ,p.uU],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}"]});var Q=s(8063);const Dn=[{path:"",component:d,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",component:x,canActivate:[Q.a],data:{title:"Inventory Comparison"}},{path:"bychannel",component:y,canActivate:[Q.a],data:{title:"Inventory Comparison"}}]}];class g{}g.\u0275fac=function(t){return new(t||g)},g.\u0275mod=n.oAB({type:g}),g.\u0275inj=n.cJS({imports:[p.ez,I.Bz.forChild(Dn)]});class m{}m.\u0275fac=function(t){return new(t||m)},m.\u0275mod=n.oAB({type:m}),m.\u0275inj=n.cJS({providers:[u],imports:[p.ez,g,I.Bz,F.Z,_.u5,M.A0,k.rP,Z.R,P.a,U.AV]})}}]);
|