marketplacepos 2.9.3 → 2.9.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/Marketplace/174.491c4991a4f8e404.js +1 -0
  2. package/Marketplace/19.124a066645320965.js +1 -0
  3. package/Marketplace/213.0e33a2cc7393deb2.js +1 -0
  4. package/Marketplace/360.5c7b51c35e7142e7.js +1 -0
  5. package/Marketplace/{369.a12060880985ee8f.js → 369.a1e3b731aeb5243f.js} +1 -1
  6. package/Marketplace/379.25d1b1c637903c75.js +1 -0
  7. package/Marketplace/397.c1a8fad6c2ca3235.js +1 -0
  8. package/Marketplace/72.23b7f31fc45323cb.js +1 -0
  9. package/Marketplace/754.086e7f7a5377c7d9.js +1 -0
  10. package/Marketplace/767.64dd12e70c78eb25.js +1 -0
  11. package/Marketplace/835.ea5f86512592f641.js +1 -0
  12. package/Marketplace/874.1fbcd1001b41f18e.js +1 -0
  13. package/Marketplace/common.1b119d9b7a972f87.js +1 -0
  14. package/Marketplace/index.html +3 -2
  15. package/Marketplace/{main.6966bb7fcafbe0e4.js → main.cbb985d0c847641f.js} +1 -1
  16. package/Marketplace/runtime.8ddf6965934d46b2.js +1 -0
  17. package/package.json +1 -1
  18. package/Marketplace/213.d00d0a3f05c831f7.js +0 -1
  19. package/Marketplace/360.8279e3b4ceab63e1.js +0 -1
  20. package/Marketplace/378.7f743ac9660ec6e6.js +0 -1
  21. package/Marketplace/379.aad8784dbdb3dd33.js +0 -1
  22. package/Marketplace/395.2943aa5a44308399.js +0 -1
  23. package/Marketplace/397.8ba047b91801962d.js +0 -1
  24. package/Marketplace/533.cc5ab7f3ce13770c.js +0 -1
  25. package/Marketplace/655.ae475c8285604367.js +0 -1
  26. package/Marketplace/767.d939ac65d1cb16fb.js +0 -1
  27. package/Marketplace/874.5b06431d2b5a1e8f.js +0 -1
  28. package/Marketplace/common.af67cc08f47a8d44.js +0 -1
  29. package/Marketplace/runtime.5db60124bb5bf7cb.js +0 -1
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[213],{8231:(A,E,s)=>{s.d(E,{j:()=>f});var C=s(5412),g=s(1889),d=s(9694),_=s(6779),t=s(4650),I=s(284),v=s(6895),m=s(4006),D=s(1948),e=s(9549),n=s(4385),a=s(3238),o=s(266),r=s(6401);function h(c,i){if(1&c&&(t.TgZ(0,"mat-option",9)(1,"div",10),t._UZ(2,"img",11),t.TgZ(3,"span"),t._uU(4),t.qZA()()()),2&c){const l=i.$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(c,i){if(1&c){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&c){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 M(c,i){if(1&c){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&c){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(c,i){if(1&c){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&c){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 f{constructor(i,l,u){this.dialogRef=i,this.data=l,this.router=u,this.channelType=d.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(i=>(i.disabled=!0,(i.TypeID==d.x.Tiktok||i.TypeID==d.x.Tokopedia||i.TypeID==d.x.Lazada)&&(i.disabled=!1),i)).sort(i=>i.disabled?1:-1))}onSelectChannel(i){let l=this.filterChannelById(i);this.selectedChannel=l,this.filter.Async=!0,l&&l.TypeID==d.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==d.x.ShopeeV2||this.selectedChannel.TypeID==d.x.Tiktok||this.selectedChannel.TypeID==d.x.Lazada)&&(this.filter.UpdatedProduct=!0)}iniHasScanUpdate(){this.hasScanUpdate=!(this.selectedChannel?.TypeID==d.x.WooCommerce||this.selectedChannel?.TypeID==d.x.KalCare||this.selectedChannel?.TypeID==d.x.None||!g.g.IsNotEmpty(this.selectedChannel?.LastSync)||this.isSingleChannel)}filterChannelById(i){let l;return this.channelOptions&&(l=this.channelOptions.find(u=>u.ID==i)),l}submit(){this.selectedChannel.TypeID==d.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(i){return g.g.IsNotEmpty(i)}onClose(){this.dialogRef.close()}}f.\u0275fac=function(i){return new(i||f)(t.Y36(C.so),t.Y36(C.WI),t.Y36(I.F0))},f.\u0275cmp=t.Xpm({type:f,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(i,l){1&i&&(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,h,5,5,"mat-option",6),t.qZA()(),t.YNc(8,T,8,3,"div",7),t.YNc(9,M,9,7,"div",8),t.YNc(10,U,8,3,"div",8),t.qZA()()()),2&i&&(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,E,s)=>{s.d(E,{b:()=>f});var C=s(1135),g=s(7579),d=s(2722),_=s(9300),t=s(4351),I=s(4004),v=s(4482),m=s(5403),D=s(8421),e=s(4671),n=s(5032),a=s(3269),r=s(5026),h=s(8505),T=s(4782),M=s(4650),U=s(1318);class f{constructor(i){this.http=i,this.pagination$=new C.X(null),this.destroy$=new g.x,this.data$=this.paginationFunction()}onNextPage(i){i.PageNumber+=1,this.pagination$.next(i)}setPageNumberFooter(i){this.footerPageNumber=i.PageNumber}setPaginationButtonState(i,l){this.disableNextButton=0==l||!(l<i.RowCount*i.PageNumber)}resetToFirstPage(i){i.PageNumber=1,this.pagination$.next(i),this.hideCount=!0,this.goToLastPage=!1}getAllData(i,l){i.RowCount=l,this.pagination$.next(i),this.goToLastPage=!0}destroy(){this.destroy$.next(!0),this.destroy$.complete(),this.pagination$=null,this.pagination$=new C.X(null),this.data$=this.paginationFunction()}paginationFunction(){return this.pagination$.pipe((0,d.R)(this.destroy$),(0,_.h)(i=>null!=i),(0,t.b)(i=>this.http.post(`/API/${this.fetchDataEndpoint}`,JSON.stringify(i)).pipe((0,I.U)(l=>l.Data))),function o(...c){const i=(0,a.jO)(c);return(0,v.e)((l,u)=>{const p=c.length,S=new Array(p);let y=c.map(()=>!1),N=!1;for(let P=0;P<p;P++)(0,D.Xf)(c[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(i?i(...O):O)}}))})}(this.pagination$),(0,r.R)((i,l)=>{const[u,p]=i,[S]=l;return 1==p.PageNumber?[S,p]:[u.concat(S),p]}),(0,h.b)(([i,l])=>{this.setPageNumberFooter(l),this.setPaginationButtonState(l,i.length)}),(0,I.U)(([i])=>i),(0,T.d)())}}f.\u0275fac=function(i){return new(i||f)(M.LFG(U.O))},f.\u0275prov=M.Yz7({token:f,factory:f.\u0275fac,providedIn:"root"})},6082:(A,E,s)=>{s.d(E,{M:()=>m});var C=s(8505),g=s(262),d=s(2843),_=s(1889),t=s(4650),I=s(1318),v=s(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,C.b)(o=>{this.showToastrSuccessUploadSingle(o,e[0])}),(0,g.K)(o=>(this.showToastErrorUploadSingle(o,e[0]),(0,d._)(()=>new Error(o)))))}uploadMultipleProduct(e,n){return this.httpService.post("api/product/UploadMultipleProductAndMultipleChannel",{Channel:n,Products:e}).pipe((0,C.b)(o=>{this.showToastrUploadMultiple(o.Message)}),(0,g.K)(o=>(this.showToastrUploadMultiple(o.error?.Message),(0,d._)(()=>new Error(o)))))}uploadNotInChannel(e,n){return this.httpService.post("/api/product/UploadProductNotInChannelToChannel",{Products:e,Channel:n}).pipe((0,C.b)(o=>{this.showToastrUploadMultiple(o)}),(0,g.K)(o=>(this.showToastrUploadMultiple(o.error?.Message),(0,d._)(()=>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,C.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,C.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(h=>(r=a.filter(T=>T.ChannelID==h.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(h=>h.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=[];const o=this.getResponseList(e);if(e.forEach(r=>{"string"==typeof r?.Response?a=[...a,o.length>1?this.setHtmlli(r.Response):this.setHtmlli(r.Response,!1)]:(r?.Response?.Success.forEach(h=>{n=[...n,o.length>1?this.setHtmlli(`Product ${h} was <b>successfully</b> uploaded to ${r.Name}`):this.setHtmlli(`Product ${h} was <b>successfully</b> uploaded to ${r.Name}`,!1)]}),r?.Response.Fail.forEach(h=>{a=[...a,o.length>1?this.setHtmlli(h):this.setHtmlli(h,!1)]}))}),a.length>0&&n.length>0){const r=[...n,...a];this.toastrService.warning(this.concatMessage(r),"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})}setHtmlli(e,n=!0){return n?`<li>${e}</li>`:e}getResponseList(e){let n=[];return e.forEach(a=>{"string"==typeof a?.Response?n=[...n,a.Response]:(a?.Response?.Success.forEach(o=>{n=[...n,a.Name]}),a?.Response.Fail.forEach(o=>{n=[...n,o]}))}),n}concatMessage(e=[]){let n="";return e.forEach(a=>{n+=a}),e.length>1?`<ol>${n}</ol>`:n}showToastrSuccessUploadSingle(e,n){let a=e.filter(h=>0==h.Status),o=e.filter(h=>1==h.Status),r=this.generateToastrMessage(a,o,n);this.toastrService.success(r.message,"Success",{enableHtml:!0})}showToastErrorUploadSingle(e,n){let a=e?.error?.Message.filter(h=>0==h.Status),o=e?.error?.Message.filter(h=>1==h.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="",h=[...e,...n];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)}`),h.length>1&&(o=`<ol>${o}</ol>`),{status:r,message:o}}createErrResponse(e,n){let a="";return e.length>1?e.forEach((o,r)=>{a+=`<li>${o.Response}</li>`}):1==e.length&&(a+=`${e[0].Response}`),a}createSuccessResponse(e,n){let a="";return e.length>1?e.forEach((o,r)=>{a+=`<li>Product ${n.Name} was <b>successfully</b> uploaded to ${o.Name}</li>`}):1==e.length&&(a+=`Product ${n.Name} was <b>successfully</b> uploaded to ${e[0].Name}`),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"})}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[360],{4360:(v,c,t)=>{t.r(c),t.d(c,{ReportModule:()=>a});var p=t(6895),s=t(2937),e=t(4650),d=t(284);class l{constructor(){}}l.\u0275fac=function(n){return new(n||l)},l.\u0275cmp=e.Xpm({type:l,selectors:[["app-report"]],decls:1,vars:0,template:function(n,R){1&n&&e._UZ(0,"router-outlet")},dependencies:[d.lC],styles:["ul[_ngcontent-%COMP%] > li.dropdown-item[_ngcontent-%COMP%]{font-size:.6875rem!important}"]});var m=t(8063);const u=[{path:"",component:l,children:[{path:"",redirectTo:"order",pathMatch:"full"},{path:"order",loadChildren:()=>Promise.all([t.e(592),t.e(993)]).then(t.bind(t,7993)).then(o=>o.OrderModule),canActivate:[m.a]}]}];class r{}r.\u0275fac=function(n){return new(n||r)},r.\u0275mod=e.oAB({type:r}),r.\u0275inj=e.cJS({imports:[p.ez,d.Bz.forChild(u)]});var f=t(4006),h=t(7481),i=t(5171);class a{}a.\u0275fac=function(n){return new(n||a)},a.\u0275mod=e.oAB({type:a}),a.\u0275inj=e.cJS({imports:[p.ez,s.Z,r,f.u5,h.R,d.Bz,i.P]})}}]);
@@ -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.3"),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.3"),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.5"),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.5"),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:(te,W,h)=>{h.r(W),h.d(W,{OrdersModule:()=>F});var u=h(6895),m=h(284),Q=h(8703),e=h(4650),U=h(2937);class N{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:[Q.G.downloadOrder]}]}ngOnInit(){}}N.\u0275fac=function(n){return new(n||N)},N.\u0275cmp=e.Xpm({type:N,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:[U.e,m.lC]});var _=h(1889),b=h(4782),E=h(8505),l=h(4004),r=h(9694),s=h(9568),p=h(2428),g=h(5412),d=h(4006),J=h(6709);class A{constructor(n){this.dialogRef=n,this.tandaiSudahDicetak=!1}onCancel(){this.dialogRef.close()}onPrint(){this.dialogRef.close(this.tandaiSudahDicetak?1:0)}}A.\u0275fac=function(n){return new(n||A)(e.Y36(g.so))},A.\u0275cmp=e.Xpm({type:A,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:[d.JJ,d.On,J.oG,g.uh,g.xY,g.H8]});var ne=h(9300),ae=h(3900),v=h(1318),X=h(7185);class k{constructor(){}convertToCSV(n,t){let a;if("string"==typeof n)a=n;else{var o="object"==typeof n?n:JSON.parse(n);a=this.transformToCSVStringFormat(o)}this.downloadCSV(a,t)}transformToCSVStringFormat(n){if(!n||!n.length)return;const a=Object.keys(n[0]);return n.map(c=>a.map(q=>{let S=null==c[q]?"":c[q];return S=S instanceof Date?S.toLocaleString():S.toString().replace(/"/g,'""'),S.search(/("|,|\n)/g)>=0&&(S=`"${S}"`),S}).join(",")).join("\n")}downloadCSV(n,t){var a=new Blob([n],{type:"text/csv;charset=utf8;"}),o=document.createElement("a");o.setAttribute("href",window.URL.createObjectURL(a)),o.setAttribute("download",t),document.body.appendChild(o),o.click(),document.body.removeChild(o)}}k.\u0275fac=function(n){return new(n||k)},k.\u0275prov=e.Yz7({token:k,factory:k.\u0275fac,providedIn:"root"});class Z{constructor(n,t,a,o){this.http=n,this.dialog=t,this.toastr=a,this.exportService=o}loadInitialPage(){return this.http.post("/api/ordersLoader/GetOrder",{})}getNewOrders(n){return this.http.post("/api/orders/GetNewOrder",n).pipe((0,l.U)(t=>t.Data))}getTotalNewOrders(n,t,a){return this.http.post("/api/orders/GetCountNewOrder",{ListChannelID:n,From:t,To:a}).pipe((0,l.U)(c=>c.Count))}printShippingLabelTokopedia(n){const t={OrderNumber:n,Printed:!0};this.dialog.open(A).afterClosed().pipe((0,ne.h)(a=>void 0!==a),(0,ae.w)(a=>(t.Printed=a,this.http.post("api/v1/Shippinglabel/Tokopedia",t)))).subscribe(a=>{const o=window.open("about:blank","_blank");o.document.write(a),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 c=Uint8Array.from(atob(o),S=>S.charCodeAt(0)),q=new Blob([c],{type:"octet/stream"});_.g.openDownloadFile(q,`${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,E.b)(a=>{this.exportService.convertToCSV(a,t)}))}}Z.\u0275fac=function(n){return new(n||Z)(e.LFG(v.O),e.LFG(g.uw),e.LFG(X._W),e.LFG(k))},Z.\u0275prov=e.Yz7({token:Z,factory:Z.\u0275fac});class y{constructor(n,t){this.http=n,this.toastr=t}acceptTokopediaOrders(n){return this.http.post("/api/Orders/AcceptOrderTokopedia",n).pipe((0,E.b)(t=>{this.tokopediaAcceptOrderHandler(t)}))}tokopediaAcceptOrderHandler(n){const t=n.filter(o=>0==o.Status),a=n.filter(o=>1==o.Status);if(0==t.length&&a.length>0){let o=`<ol>${this.generateSuccessMessage(a)}</ol>`;this.toastr.success(o,"Success",{enableHtml:!0})}else if(t.length>0&&a.length>0){let o=`<ol>\n ${this.generateSuccessMessage(a)}\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(a=>{t+=`<li><b>${a.OrderNumber}</b> was successfully Accept</li>`}),t}generateErrorMessage(n){let t="";return n.forEach(a=>{t+=`<li><b>${a.OrderNumber}</b> ${a.Message}</li>`}),t}}y.\u0275fac=function(n){return new(n||y)(e.LFG(v.O),e.LFG(X._W))},y.\u0275prov=e.Yz7({token:y,factory:y.\u0275fac});var w=h(7481),f=h(8796),P=h(2594);class x{constructor(){}set typeId(n){this.channelLogo=_.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"}}}x.\u0275fac=function(n){return new(n||x)},x.\u0275cmp=e.Xpm({type:x,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 O=h(9640),C=h(6308),I=h(5585);function ie(i,n){if(1&i){const t=e.EpF();e.ynx(0),e.TgZ(1,"button",13),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().ngIf,c=e.oxw();return e.KtG(c.onAcceptOrder(o))}),e._UZ(2,"i",14),e._uU(3," Accept "),e.qZA(),e.BQk()}}function oe(i,n){if(1&i&&(e.ynx(0),e.YNc(1,ie,4,0,"ng-container",1),e.BQk()),2&i){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.isTokopediaAvailable&&t.isTokopediaSelected)}}function re(i,n){if(1&i&&(e.TgZ(0,"span",15),e._UZ(1,"img",16),e.qZA(),e._uU(2)),2&i){const t=n.item;e.xp6(1),e.Q6J("src",t.img,e.LSH),e.xp6(1),e.hij(" ",t.Name," ")}}function le(i,n){if(1&i){const t=e.EpF();e.ynx(0),e.TgZ(1,"th",28)(2,"input",29),e.NdJ("ngModelChange",function(o){e.CHM(t);const c=e.oxw(3);return e.KtG(c.isCheckAll=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw(2).ngIf,c=e.oxw();return e.KtG(c.onSelectAllOrderData(o))}),e.qZA()(),e.BQk()}if(2&i){const t=e.oxw(3);e.xp6(2),e.Q6J("ngModel",t.isCheckAll)}}function se(i,n){if(1&i){const t=e.EpF();e.ynx(0),e.TgZ(1,"input",29),e.NdJ("ngModelChange",function(o){e.CHM(t);const c=e.oxw(2).$implicit;return e.KtG(c.selected=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw(4).ngIf,c=e.oxw();return e.KtG(c.onSelectOrderData(o))}),e.qZA(),e.BQk()}if(2&i){const t=e.oxw(2).$implicit;e.xp6(1),e.Q6J("ngModel",t.selected)}}function pe(i,n){if(1&i&&(e.ynx(0),e.TgZ(1,"td"),e.YNc(2,se,2,1,"ng-container",1),e.qZA(),e.BQk()),2&i){const t=e.oxw().$implicit,a=e.oxw(3);e.xp6(2),e.Q6J("ngIf",t.Type==a.tokopediaType)}}function ce(i,n){if(1&i&&(e.ynx(0),e.TgZ(1,"span"),e._uU(2),e.qZA(),e.BQk()),2&i){const t=e.oxw().$implicit;e.xp6(2),e.Oqu(t.Number)}}function de(i,n){if(1&i&&(e.TgZ(0,"a",32),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit,a=e.oxw(3);e.Q6J("href",a.domain+"/menu/Orders/Order/Sales_Order/Info?ID="+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function he(i,n){if(1&i&&(e.TgZ(0,"tr"),e.YNc(1,pe,3,1,"ng-container",1),e.TgZ(2,"td"),e._uU(3),e.qZA(),e.TgZ(4,"td"),e.YNc(5,ce,3,1,"ng-container",17),e.YNc(6,de,2,2,"ng-template",null,30,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",31),e.qZA()()),2&i){const t=n.$implicit,a=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",a),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 ge(i,n){if(1&i){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",18)(2,"table",19),e.NdJ("matSortChange",function(o){e.CHM(t);const c=e.oxw(2);return e.KtG(c.onSort(o))}),e.TgZ(3,"thead",20)(4,"tr",21),e.YNc(5,le,3,1,"ng-container",1),e.TgZ(6,"th",22),e._uU(7,"Outlet"),e.qZA(),e.TgZ(8,"th",23),e._uU(9,"Order number"),e.qZA(),e.TgZ(10,"th"),e._uU(11,"Customer"),e.qZA(),e.TgZ(12,"th",24),e._uU(13,"Created On"),e.qZA(),e.TgZ(14,"th",25),e._uU(15,"Channel"),e.qZA()()(),e.TgZ(16,"tbody"),e.YNc(17,he,15,10,"tr",26),e.qZA()(),e.TgZ(18,"app-mat-paginator-no-count",27),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&i){const t=e.oxw().ngIf,a=e.oxw();let o;e.xp6(5),e.Q6J("ngIf",a.isTokopediaAvailable&&t),e.xp6(12),e.Q6J("ngForOf",t),e.xp6(1),e.Q6J("filter",a.filter)("totaldata",null==(o=e.lcZ(19,5,a.newOrdersData$))?null:o.length)("paginationTotal",e.lcZ(20,7,a.paginationTotal$))}}function ue(i,n){if(1&i&&(e.ynx(0),e.YNc(1,ge,21,9,"ng-container",17),e.BQk()),2&i){const t=n.ngIf;e.oxw();const a=e.MAs(31);e.xp6(1),e.Q6J("ngIf",(null==t?null:t.length)>0)("ngIfElse",a)}}function _e(i,n){1&i&&(e.TgZ(0,"div",33),e._UZ(1,"app-empty-state"),e.qZA())}class Y{constructor(n,t,a,o,c){this.localDataService=n,this.channelService=t,this.orderService=a,this.toastr=o,this.acceptOrderService=c,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.domain=`https://${this.localDataService.getHostName()}`,this.guidEmpty=_.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.filter.From=n.Filter.From,this.filter.To=n.Filter.To,this.channels=n.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),this.getNewOrders()})}getNewOrders(){this.sourceObs$=this.orderService.getNewOrders({PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To}).pipe((0,b.d)()),this.newOrdersData$=this.sourceObs$.pipe((0,E.b)(t=>{t.filter(o=>o.Type==r.x.Tokopedia).length>0&&(this.isTokopediaAvailable=!0)}))}getPaginatonTotal(){this.paginationTotal$=this.orderService.getTotalNewOrders(this.filter.ListChannelID,this.filter.From,this.filter.To).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(a=>a.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(a=>{this.isTokopediaSelected=!1,location.reload()})}getSelectedTokopediaOrders(n){return n.filter(a=>a.selected).map(a=>a.Number)}onSort(n){if(""!=n.direction){if("created"==n.active){const t="asc"==n.direction;this.newOrdersData$=this.newOrdersData$.pipe((0,l.U)(a=>a.sort((o,c)=>_.g.compare(o.Created,c.Created,t))))}}else this.newOrdersData$=this.sourceObs$}}function me(i,n){if(1&i&&(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&i){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 fe(i,n){if(1&i&&(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,me,9,7,"tr",16),e.qZA()()()()()),2&i){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)}}Y.\u0275fac=function(n){return new(n||Y)(e.Y36(s.T),e.Y36(p.T),e.Y36(Z),e.Y36(X._W),e.Y36(y))},Y.\u0275cmp=e.Xpm({type:Y,selectors:[["app-new-order"]],decls:32,vars:15,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"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[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"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],["mat-sort-header","created",2,"width","130px"],[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,oe,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,re,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,"div")(20,"h6"),e._uU(21,"From/To"),e.qZA(),e.TgZ(22,"datepicker",7),e.NdJ("dateChange",function(o){return t.filter.From=o}),e.qZA(),e.TgZ(23,"datepicker",8),e.NdJ("dateChange",function(o){return t.filter.To=o}),e.qZA()()()(),e.TgZ(24,"content")(25,"div",9)(26,"div",10)(27,"div",11),e.YNc(28,ue,2,2,"ng-container",1),e.ALo(29,"async"),e.YNc(30,_e,2,0,"ng-template",null,12,e.W1O),e.qZA()()()()()),2&n&&(e.Q6J("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",e.lcZ(3,11,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(4),e.Q6J("date",t.filter.From),e.xp6(1),e.Q6J("date",t.filter.To),e.xp6(5),e.Q6J("ngIf",e.lcZ(29,13,t.newOrdersData$)))},dependencies:[u.sg,u.O5,d.Fj,d.wV,d.Wl,d.JJ,d.On,w.p,f.w9,f.ir,P.n,x,O.s,C.YE,C.nU,I.Q,u.Ov,u.uU]});const Te=function(){return["/menu/Order"]};class G{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 Ce(i,n){if(1&i&&(e.TgZ(0,"span",13),e._UZ(1,"img",14),e.qZA(),e._uU(2)),2&i){const t=n.item;e.xp6(1),e.Q6J("src",t.img,e.LSH),e.xp6(1),e.hij(" ",t.Name," ")}}G.\u0275fac=function(n){return new(n||G)(e.Y36(v.O),e.Y36(m.gz))},G.\u0275cmp=e.Xpm({type:G,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,fe,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,Te)),e.xp6(4),e.Q6J("ngIf",t.model))},dependencies:[u.sg,u.O5,w.p,m.rH,u.JJ,u.uU]});const Ze=function(){return["/menu/Order/detail"]},xe=function(i,n){return{Number:i,Outlet:n}};function Se(i,n){if(1&i&&(e.TgZ(0,"a",32),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,Ze))("queryParams",e.WLB(4,xe,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function be(i,n){if(1&i&&(e.TgZ(0,"a",33),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit,a=e.oxw(2);e.Q6J("href",a.domain+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function ve(i,n){if(1&i){const t=e.EpF();e.TgZ(0,"a",34),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().$implicit,c=e.oxw(2);return e.KtG(c.onPrintShippingLabel(o.Number,o.ShopID,o.TypeID))}),e._UZ(1,"i",35),e.qZA()}}function we(i,n){if(1&i&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,Se,2,7,"a",27),e.YNc(5,be,2,2,"a",28),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",29),e.qZA(),e.TgZ(16,"td",30),e.YNc(17,ve,2,0,"a",31),e.qZA()()),2&i){const t=n.$implicit,a=e.oxw(2);e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",a.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!a.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==a.channelType.ShopeeV2||t.TypeID==a.channelType.Tokopedia||t.TypeID==a.channelType.Tiktok||t.TypeID==a.channelType.Lazada)}}function De(i,n){if(1&i){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",15)(2,"table",16),e.NdJ("matSortChange",function(o){e.CHM(t);const c=e.oxw();return e.KtG(c.onSort(o))}),e.TgZ(3,"thead",17)(4,"tr",18)(5,"th",19),e._uU(6,"Outlet"),e.qZA(),e.TgZ(7,"th",20),e._uU(8,"Order number"),e.qZA(),e.TgZ(9,"th"),e._uU(10,"Customer"),e.qZA(),e.TgZ(11,"th",21),e._uU(12,"Amount"),e.qZA(),e.TgZ(13,"th",22),e._uU(14,"Created On"),e.qZA(),e.TgZ(15,"th",23),e._uU(16,"Channel"),e.qZA(),e._UZ(17,"th",24),e.qZA()(),e.TgZ(18,"tbody"),e.YNc(19,we,18,13,"tr",25),e.qZA()(),e.TgZ(20,"app-mat-paginator-no-count",26),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&i){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 Ne(i,n){1&i&&(e.TgZ(0,"div",36),e._UZ(1,"app-empty-state"),e.qZA())}class H{constructor(n,t,a,o,c){this.http=n,this.localDataService=t,this.dialog=a,this.orderService=o,this.channelService=c,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.totaldata=0,this.paginationTotal=0,this.checkboxState=!1,this.channelType=r.x}ngOnInit(){this.Load()}hasGuidEmpty(n){return n==_.g.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(n=>{this.filter.PageNumber=n.Filter.PageNumber,this.filter.PageSize=n.Filter.RowCount,this.filter.From=n.Filter.From,this.filter.To=n.Filter.To,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,From:this.filter.From,To:this.filter.To}).subscribe(a=>{this.data=a.Data,this.sourceData=[...a.Data],this.totaldata=this.data.length})}onPrintShippingLabel(n,t,a){switch(a){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,From:this.filter.From,To:this.filter.To}).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()}onSort(n){if(""!=n.direction){if("created"==n.active){const t="asc"==n.direction;this.data=this.data.sort((a,o)=>_.g.compare(a.Created,o.Created,t))}}else this.data=this.sourceData}}function Ae(i,n){if(1&i&&(e.TgZ(0,"span",13),e._UZ(1,"img",14),e.qZA(),e._uU(2)),2&i){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(v.O),e.Y36(s.T),e.Y36(g.uw),e.Y36(Z),e.Y36(p.T))},H.\u0275cmp=e.Xpm({type:H,selectors:[["app-ready-to-ship"]],decls:28,vars:10,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"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[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"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","created",2,"width","130px"],[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,Ce,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,"div")(17,"h6"),e._uU(18,"From/To"),e.qZA(),e.TgZ(19,"datepicker",6),e.NdJ("dateChange",function(o){return t.filter.From=o}),e.qZA(),e.TgZ(20,"datepicker",7),e.NdJ("dateChange",function(o){return t.filter.To=o}),e.qZA()()()(),e.TgZ(21,"content")(22,"div",8)(23,"div",9)(24,"div",10),e.YNc(25,De,21,4,"ng-container",11),e.YNc(26,Ne,2,0,"ng-template",null,12,e.W1O),e.qZA()()()()()),2&n){const a=e.MAs(27);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(4),e.Q6J("date",t.filter.From),e.xp6(1),e.Q6J("date",t.filter.To),e.xp6(5),e.Q6J("ngIf",t.data&&t.data.length>0)("ngIfElse",a)}},dependencies:[u.sg,u.O5,d.Fj,d.wV,d.JJ,d.On,w.p,m.rH,f.w9,f.ir,P.n,x,O.s,C.YE,C.nU,I.Q,u.JJ,u.uU]});const ye=function(){return["/menu/Order/detail"]},Pe=function(i,n){return{Number:i,Outlet:n}};function Oe(i,n){if(1&i&&(e.TgZ(0,"a",32),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,ye))("queryParams",e.WLB(4,Pe,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function Ie(i,n){if(1&i&&(e.TgZ(0,"a",33),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit,a=e.oxw(2);e.Q6J("href",a.domain+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function Me(i,n){if(1&i){const t=e.EpF();e.TgZ(0,"a",34),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().$implicit,c=e.oxw(2);return e.KtG(c.onPrintShippingLabel(o.Number,o.ShopID,o.TypeID))}),e._UZ(1,"i",35),e.qZA()}}function qe(i,n){if(1&i&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,Oe,2,7,"a",27),e.YNc(5,Ie,2,2,"a",28),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",29),e.qZA(),e.TgZ(16,"td",30),e.YNc(17,Me,2,0,"a",31),e.qZA()()),2&i){const t=n.$implicit,a=e.oxw(2);e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",a.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!a.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==a.channelType.ShopeeV2||t.TypeID==a.channelType.Tokopedia||t.TypeID==a.channelType.Tiktok||t.TypeID==a.channelType.Lazada)}}function Ue(i,n){if(1&i){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",15)(2,"table",16),e.NdJ("matSortChange",function(o){e.CHM(t);const c=e.oxw();return e.KtG(c.onSort(o))}),e.TgZ(3,"thead",17)(4,"tr",18)(5,"th",19),e._uU(6,"Outlet"),e.qZA(),e.TgZ(7,"th",20),e._uU(8,"Order number"),e.qZA(),e.TgZ(9,"th"),e._uU(10,"Customer"),e.qZA(),e.TgZ(11,"th",21),e._uU(12,"Amount"),e.qZA(),e.TgZ(13,"th",22),e._uU(14,"Created On"),e.qZA(),e.TgZ(15,"th",23),e._uU(16,"Channel"),e.qZA(),e._UZ(17,"th",24),e.qZA()(),e.TgZ(18,"tbody"),e.YNc(19,qe,18,13,"tr",25),e.qZA()(),e.TgZ(20,"app-mat-paginator-no-count",26),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&i){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 Je(i,n){1&i&&(e.TgZ(0,"div",36),e._UZ(1,"app-empty-state"),e.qZA())}class R{constructor(n,t,a,o){this.http=n,this.localDataService=t,this.orderService=a,this.channelService=o,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.totaldata=0,this.paginationTotal=0,this.channelType=r.x}ngOnInit(){this.Load()}getChannelLogo(n){return _.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.filter.From=n.Filter.From,this.filter.To=n.Filter.To,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==_.g.GuidEMpty}Get(n){this.http.post("api/orders/GetShipped",{Number:n,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To}).subscribe(a=>{this.data=a.Data,this.sourceData=[...a.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,From:this.filter.From,To:this.filter.To}).subscribe(t=>{this.paginationTotal=t.Total})}onPrintShippingLabel(n,t,a){switch(a){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()}onSort(n){if(""!=n.direction){if("created"==n.active){const t="asc"==n.direction;this.data=this.data.sort((a,o)=>_.g.compare(a.Created,o.Created,t))}}else this.data=this.sourceData}}R.\u0275fac=function(n){return new(n||R)(e.Y36(v.O),e.Y36(s.T),e.Y36(Z),e.Y36(p.T))},R.\u0275cmp=e.Xpm({type:R,selectors:[["app-shipped"]],decls:28,vars:10,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"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[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"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","created",2,"width","130px"],[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,Ae,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,"div")(17,"h6"),e._uU(18,"From/To"),e.qZA(),e.TgZ(19,"datepicker",6),e.NdJ("dateChange",function(o){return t.filter.From=o}),e.qZA(),e.TgZ(20,"datepicker",7),e.NdJ("dateChange",function(o){return t.filter.To=o}),e.qZA()()()(),e.TgZ(21,"content")(22,"div",8)(23,"div",9)(24,"div",10),e.YNc(25,Ue,21,4,"ng-container",11),e.YNc(26,Je,2,0,"ng-template",null,12,e.W1O),e.qZA()()()()()),2&n){const a=e.MAs(27);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(4),e.Q6J("date",t.filter.From),e.xp6(1),e.Q6J("date",t.filter.To),e.xp6(5),e.Q6J("ngIf",t.data&&t.data.length>0)("ngIfElse",a)}},dependencies:[u.sg,u.O5,d.Fj,d.wV,d.JJ,d.On,w.p,m.rH,f.w9,f.ir,P.n,x,O.s,C.YE,C.nU,I.Q,u.JJ,u.uU]});var ke=h(501);function Le(i,n){if(1&i&&(e.TgZ(0,"span",13),e._UZ(1,"img",14),e.qZA(),e._uU(2)),2&i){const t=n.item;e.xp6(1),e.Q6J("src",t.img,e.LSH),e.xp6(1),e.hij(" ",t.Name," ")}}const Fe=function(){return["/menu/Order/detail"]},Qe=function(i,n){return{Number:i,Outlet:n}};function Ee(i,n){if(1&i&&(e.TgZ(0,"a",32),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,Fe))("queryParams",e.WLB(4,Qe,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function Ye(i,n){if(1&i&&(e.TgZ(0,"a",33),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit,a=e.oxw(2);e.Q6J("href",a.customerInfoUrl+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function Ge(i,n){if(1&i){const t=e.EpF();e.TgZ(0,"a",34),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().$implicit,c=e.oxw(2);return e.KtG(c.onPrintShippingLabel(o.Number,o.ShopID,o.TypeID))}),e._UZ(1,"i",35),e.qZA()}}function He(i,n){if(1&i&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,Ee,2,7,"a",27),e.YNc(5,Ye,2,2,"a",28),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",29),e.qZA(),e.TgZ(16,"td",30),e.YNc(17,Ge,2,0,"a",31),e.qZA()()),2&i){const t=n.$implicit,a=e.oxw(2);e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",a.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!a.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==a.channelType.ShopeeV2||t.TypeID==a.channelType.Tokopedia||t.TypeID==a.channelType.Tiktok)}}function Re(i,n){if(1&i){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",15)(2,"table",16),e.NdJ("matSortChange",function(o){e.CHM(t);const c=e.oxw();return e.KtG(c.onSort(o))}),e.TgZ(3,"thead",17)(4,"tr",18)(5,"th",19),e._uU(6,"Outlet"),e.qZA(),e.TgZ(7,"th",20),e._uU(8,"Order number"),e.qZA(),e.TgZ(9,"th"),e._uU(10,"Customer"),e.qZA(),e.TgZ(11,"th",21),e._uU(12,"Amount"),e.qZA(),e.TgZ(13,"th",22),e._uU(14,"Created On"),e.qZA(),e.TgZ(15,"th",23),e._uU(16,"Channel"),e.qZA(),e._UZ(17,"th",24),e.qZA()(),e.TgZ(18,"tbody"),e.YNc(19,He,18,13,"tr",25),e.qZA()(),e.TgZ(20,"app-mat-paginator-no-count",26),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&i){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 $e(i,n){1&i&&(e.TgZ(0,"div",36),e._UZ(1,"app-empty-state"),e.qZA())}class ${constructor(n,t,a,o){this.http=n,this.orderService=t,this.authService=a,this.channelService=o,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.totaldata=0,this.paginationTotal=0,this.channelType=r.x}ngOnInit(){this.Load()}hasGuidEmpty(n){return n==_.g.GuidEMpty}getChannelLogo(n){return _.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.filter.From=n.Filter.From,this.filter.To=n.Filter.To,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,From:this.filter.From,To:this.filter.To}).subscribe(a=>{this.data=a.Data,this.sourceData=[...a.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,From:this.filter.From,To:this.filter.To}).subscribe(t=>{this.paginationTotal=t.Total})}onPrintShippingLabel(n,t,a){switch(a){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()}onSort(n){if(""!=n.direction){if("created"==n.active){const t="asc"==n.direction;this.data=this.data.sort((a,o)=>_.g.compare(a.Created,o.Created,t))}}else this.data=this.sourceData}}function ze(i,n){if(1&i&&(e.TgZ(0,"span",13),e._UZ(1,"img",14),e.qZA(),e._uU(2)),2&i){const t=n.item;e.xp6(1),e.Q6J("src",t.img,e.LSH),e.xp6(1),e.hij(" ",t.Name," ")}}$.\u0275fac=function(n){return new(n||$)(e.Y36(v.O),e.Y36(Z),e.Y36(ke.e),e.Y36(p.T))},$.\u0275cmp=e.Xpm({type:$,selectors:[["app-delivered"]],decls:28,vars:11,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"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[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"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","created",2,"width","130px"],[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,Le,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,"div")(17,"h6"),e._uU(18,"From/To"),e.qZA(),e.TgZ(19,"datepicker",6),e.NdJ("dateChange",function(o){return t.filter.From=o}),e.qZA(),e.TgZ(20,"datepicker",7),e.NdJ("dateChange",function(o){return t.filter.To=o}),e.qZA()()()(),e.TgZ(21,"content")(22,"div",8)(23,"div",9)(24,"div",10),e.YNc(25,Re,21,4,"ng-container",11),e.YNc(26,$e,2,0,"ng-template",null,12,e.W1O),e.qZA()()()()()),2&n){const a=e.MAs(27);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(4),e.Q6J("date",t.filter.From),e.xp6(1),e.Q6J("date",t.filter.To),e.xp6(5),e.Q6J("ngIf",t.data&&t.data.length>0)("ngIfElse",a)}},dependencies:[u.sg,u.O5,d.Fj,d.wV,d.JJ,d.On,w.p,m.rH,f.w9,f.ir,P.n,x,O.s,C.YE,C.nU,I.Q,u.JJ,u.uU]});const Be=function(){return["/menu/Order/detail"]},Ke=function(i,n){return{Number:i,Outlet:n}};function je(i,n){if(1&i&&(e.TgZ(0,"a",30),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,Be))("queryParams",e.WLB(4,Ke,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function Ve(i,n){if(1&i&&(e.TgZ(0,"a",31),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit,a=e.oxw(2);e.Q6J("href",a.domain+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function We(i,n){if(1&i&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,je,2,7,"a",27),e.YNc(5,Ve,2,2,"a",28),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",29),e.qZA()()),2&i){const t=n.$implicit,a=e.oxw(2);e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",a.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!a.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 Xe(i,n){if(1&i){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",15)(2,"table",16),e.NdJ("matSortChange",function(o){e.CHM(t);const c=e.oxw();return e.KtG(c.onSort(o))}),e.TgZ(3,"thead",17)(4,"tr",18)(5,"th",19),e._uU(6,"Outlet"),e.qZA(),e.TgZ(7,"th",20),e._uU(8,"Order number"),e.qZA(),e.TgZ(9,"th"),e._uU(10,"Customer"),e.qZA(),e.TgZ(11,"th",21),e._uU(12,"Amount"),e.qZA(),e.TgZ(13,"th",22),e._uU(14,"Created On"),e.qZA(),e.TgZ(15,"th",23),e._uU(16,"Status"),e.qZA(),e.TgZ(17,"th",24),e._uU(18,"Channel"),e.qZA()()(),e.TgZ(19,"tbody"),e.YNc(20,We,18,13,"tr",25),e.qZA()(),e.TgZ(21,"app-mat-paginator-no-count",26),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&i){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 et(i,n){1&i&&(e.TgZ(0,"div",32),e._UZ(1,"app-empty-state"),e.qZA())}class z{constructor(n,t,a){this.http=n,this.localDataService=t,this.channelService=a,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.totaldata=0,this.paginationTotal=0}ngOnInit(){this.Load()}hasGuidEmpty(n){return n==_.g.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(n=>{this.filter.PageNumber=n.Filter.PageNumber,this.filter.PageSize=n.Filter.RowCount,this.filter.From=n.Filter.From,this.filter.To=n.Filter.To,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,From:this.filter.From,To:this.filter.To}).subscribe(a=>{this.data=a.Data,this.sourceData=[...a.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,From:this.filter.From,To:this.filter.To}).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()}onSort(n){if(""!=n.direction){if("created"==n.active){const t="asc"==n.direction;this.data=this.data.sort((a,o)=>_.g.compare(a.Created,o.Created,t))}}else this.data=this.sourceData}}function tt(i,n){if(1&i&&(e.TgZ(0,"span",14),e._UZ(1,"img",15),e.qZA(),e._uU(2)),2&i){const t=n.item;e.xp6(1),e.Q6J("src",t.img,e.LSH),e.xp6(1),e.hij(" ",t.Name," ")}}z.\u0275fac=function(n){return new(n||z)(e.Y36(v.O),e.Y36(s.T),e.Y36(p.T))},z.\u0275cmp=e.Xpm({type:z,selectors:[["app-all-order"]],decls:28,vars:10,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"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[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"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","created",2,"width","130px"],[2,"width","135px"],[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,ze,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,"div")(17,"h6"),e._uU(18,"From/To"),e.qZA(),e.TgZ(19,"datepicker",6),e.NdJ("dateChange",function(o){return t.filter.From=o}),e.qZA(),e.TgZ(20,"datepicker",7),e.NdJ("dateChange",function(o){return t.filter.To=o}),e.qZA()()()(),e.TgZ(21,"content")(22,"div",8)(23,"div",9)(24,"div",10),e.YNc(25,Xe,22,4,"ng-container",11),e.YNc(26,et,2,0,"ng-template",null,12,e.W1O),e.qZA()()()()()),2&n){const a=e.MAs(27);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(4),e.Q6J("date",t.filter.From),e.xp6(1),e.Q6J("date",t.filter.To),e.xp6(5),e.Q6J("ngIf",t.data&&t.data.length>0)("ngIfElse",a)}},dependencies:[u.sg,u.O5,d.Fj,d.wV,d.JJ,d.On,w.p,m.rH,f.w9,f.ir,P.n,x,O.s,C.YE,C.nU,I.Q,u.JJ,u.uU]});const nt=function(){return["/menu/Order/detail"]},at=function(i,n){return{Number:i,Outlet:n}};function it(i,n){if(1&i&&(e.TgZ(0,"a",30),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,nt))("queryParams",e.WLB(4,at,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function ot(i,n){if(1&i&&(e.TgZ(0,"a",31),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit,a=e.oxw(2);e.Q6J("href",a.domain+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function rt(i,n){if(1&i&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,it,2,7,"a",27),e.YNc(5,ot,2,2,"a",28),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",29),e.qZA()()),2&i){const t=n.$implicit,a=e.oxw(2);e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",a.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!a.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 lt(i,n){if(1&i){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",16)(2,"table",17),e.NdJ("matSortChange",function(o){e.CHM(t);const c=e.oxw();return e.KtG(c.onSort(o))}),e.TgZ(3,"thead",18)(4,"tr",19)(5,"th",20),e._uU(6,"Outlet"),e.qZA(),e.TgZ(7,"th",21),e._uU(8,"Order number"),e.qZA(),e.TgZ(9,"th"),e._uU(10,"Customer"),e.qZA(),e.TgZ(11,"th",22),e._uU(12,"Amount"),e.qZA(),e.TgZ(13,"th",23),e._uU(14,"Created On"),e.qZA(),e.TgZ(15,"th",24),e._uU(16,"Channel"),e.qZA()()(),e.TgZ(17,"tbody"),e.YNc(18,rt,16,12,"tr",25),e.qZA()(),e.TgZ(19,"app-mat-paginator-no-count",26),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&i){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 st(i,n){1&i&&(e.TgZ(0,"div",32),e._UZ(1,"app-empty-state"),e.qZA())}class B{constructor(n,t,a){this.http=n,this.localDataService=t,this.channelService=a,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],Note:"",From:null,To:null},this.totaldata=0,this.paginationTotal=0}ngOnInit(){this.Load()}hasGuidEmpty(n){return n==_.g.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(n=>{this.filter.PageNumber=n.Filter.PageNumber,this.filter.PageSize=n.Filter.RowCount,this.filter.From=n.Filter.From,this.filter.To=n.Filter.To,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,Note:this.filter.Note,From:this.filter.From,To:this.filter.To}).subscribe(a=>{this.data=a.Data,this.sourceData=[...a.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,From:this.filter.From,To:this.filter.To}).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 _.g.getChannelLogoByTypeId(n)}onSort(n){if(""!=n.direction){if("created"==n.active){const t="asc"==n.direction;this.data=this.data.sort((a,o)=>_.g.compare(a.Created,o.Created,t))}}else this.data=this.sourceData}}B.\u0275fac=function(n){return new(n||B)(e.Y36(v.O),e.Y36(s.T),e.Y36(p.T))},B.\u0275cmp=e.Xpm({type:B,selectors:[["app-cancelled"]],decls:32,vars:11,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"],["type","text","name","Note",1,"w-100",3,"ngModel","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[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"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","created",2,"width","130px"],[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,tt,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,"div")(17,"h6"),e._uU(18,"Note"),e.qZA(),e.TgZ(19,"input",6),e.NdJ("ngModelChange",function(o){return t.filter.Note=o}),e.qZA()(),e.TgZ(20,"div")(21,"h6"),e._uU(22,"From/To"),e.qZA(),e.TgZ(23,"datepicker",7),e.NdJ("dateChange",function(o){return t.filter.From=o}),e.qZA(),e.TgZ(24,"datepicker",8),e.NdJ("dateChange",function(o){return t.filter.To=o}),e.qZA()()()(),e.TgZ(25,"content")(26,"div",9)(27,"div",10)(28,"div",11),e.YNc(29,lt,20,4,"ng-container",12),e.YNc(30,st,2,0,"ng-template",null,13,e.W1O),e.qZA()()()()()),2&n){const a=e.MAs(31);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(4),e.Q6J("ngModel",t.filter.Note),e.xp6(4),e.Q6J("date",t.filter.From),e.xp6(1),e.Q6J("date",t.filter.To),e.xp6(5),e.Q6J("ngIf",t.data&&t.data.length>0)("ngIfElse",a)}},dependencies:[u.sg,u.O5,d.Fj,d.wV,d.JJ,d.On,w.p,m.rH,f.w9,f.ir,P.n,x,O.s,C.YE,C.nU,I.Q,u.JJ,u.uU]});var pt=h(2138),M=(()=>{return(i=M||(M={}))[i.DoNothing=0]="DoNothing",i[i.New=1]="New",i[i.Update=2]="Update",M;var i})(),ct=h(6082),K=h(9602),j=h(8425),ee=h(266);function dt(i,n){if(1&i){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(),c=e.MAs(11);return e.KtG(o.onNext(c))}),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&i){const t=e.oxw();e.xp6(4),e.Q6J("disabled",t.checkDisabledNextFilter())}}function ht(i,n){if(1&i){const t=e.EpF();e.TgZ(0,"button",36),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(),c=e.MAs(11);return e.KtG(o.onNext(c))}),e._uU(1," Next "),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("disabled",t.checkDisabledNextFilter())}}function gt(i,n){if(1&i){const t=e.EpF();e.TgZ(0,"button",37),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(),c=e.MAs(11);return e.KtG(o.onNew(c))}),e._UZ(1,"i",38),e._uU(2," New "),e.qZA()}}function ut(i,n){1&i&&e._uU(0,"Filter")}function _t(i,n){if(1&i&&(e.TgZ(0,"ng-option",39),e._UZ(1,"img",40),e._uU(2),e.qZA()),2&i){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 mt(i,n){1&i&&e._uU(0,"Preview")}function ft(i,n){if(1&i&&(e.TgZ(0,"th",58),e._uU(1),e.qZA()),2&i){const t=e.oxw(2);e.xp6(1),e.Oqu(0==t.getTypeID()?"Last Status Update":"Created Date")}}function Tt(i,n){if(1&i&&(e.TgZ(0,"td"),e._uU(1),e.ALo(2,"date"),e.qZA()),2&i){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.xi3(2,1,t.Date,"dd MMM yyyy HH:mm:ss"),"")}}function Ct(i,n){if(1&i&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&i){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",t.ActionString," ")}}function Zt(i,n){if(1&i&&(e.TgZ(0,"li"),e._uU(1),e.qZA()),2&i){const t=n.$implicit;e.xp6(1),e.hij("",t," ")}}function xt(i,n){if(1&i&&(e.TgZ(0,"ul",63),e.YNc(1,Zt,2,1,"li",59),e.qZA()),2&i){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngForOf",t.ActionString)}}function St(i,n){if(1&i&&(e.TgZ(0,"span",64),e._UZ(1,"i",65),e.qZA()),2&i){const t=e.oxw().$implicit;e.hYB("title","Delivery : ",t.DeliveryState," \nPayment : ",t.PaymentState,"")}}const bt=function(i,n){return{"over-due-today":i,"over-due":n}};function vt(i,n){if(1&i&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.YNc(5,Tt,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,Ct,2,1,"span",1),e.YNc(16,xt,2,1,"ul",61),e.qZA(),e.TgZ(17,"td"),e.YNc(18,St,2,2,"span",62),e.qZA()()),2&i){const t=n.$implicit,a=n.index,o=e.oxw(3);e.xp6(2),e.Oqu(a+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,bt,(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 wt(i,n){if(1&i&&(e.ynx(0),e.YNc(1,vt,19,15,"tr",59),e.BQk()),2&i){const t=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",t.displayedPreviewData)}}function Dt(i,n){1&i&&(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 Nt(i,n){if(1&i){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,ft,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,wt,2,1,"ng-container",56),e.YNc(32,Dt,6,0,"ng-template",null,57,e.W1O),e.qZA()()()()}if(2&i){const t=e.MAs(33),a=e.oxw();e.xp6(5),e.Q6J("ngClass","all"==a.pillStatus?"btn-secondary text-white":"btn-outline-dark"),e.xp6(1),e.hij("All (",a.allData,")"),e.xp6(2),e.Q6J("ngClass","sync"==a.pillStatus?"btn-success":"btn-outline-success"),e.xp6(1),e.hij("Existing (",a.syncData,")"),e.xp6(2),e.Q6J("ngClass","wrong"==a.pillStatus?"btn-warning text-white":"btn-outline-warning"),e.xp6(1),e.hij("Wrong Status (",a.wrongData,")"),e.xp6(2),e.Q6J("ngClass","unsync"==a.pillStatus?"btn-danger":"btn-outline-danger"),e.xp6(1),e.hij("Missing (",a.unsyncData,")"),e.xp6(7),e.Q6J("ngIf",a.getTypeID()!=a.channelType.ShopeeV2),e.xp6(9),e.Q6J("ngIf",a.displayedPreviewData.length>0)("ngIfElse",t)}}function At(i,n){1&i&&e._uU(0,"Finish")}const yt=function(i){return{"over-due":i}};function Pt(i,n){if(1&i&&(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&i){const t=n.$implicit,a=n.index;e.Q6J("ngClass",e.VKq(5,yt,t.Exception)),e.xp6(2),e.Oqu(a+1),e.xp6(2),e.Oqu(t.Number),e.xp6(2),e.Oqu(t.Status),e.xp6(2),e.Oqu(t.Exception)}}function Ot(i,n){if(1&i&&(e.ynx(0),e.YNc(1,Pt,9,7,"tr",72),e.BQk()),2&i){const t=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",t.downloadData)}}function It(i,n){1&i&&(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 Mt(i,n){if(1&i&&(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,Ot,2,1,"ng-container",56),e.YNc(14,It,6,0,"ng-template",null,71,e.W1O),e.qZA()()()()),2&i){const t=e.MAs(15),a=e.oxw();e.xp6(13),e.Q6J("ngIf",(null==a.downloadData?null:a.downloadData.length)>0)("ngIfElse",t)}}function qt(i,n){1&i&&e._UZ(0,"i",74)}function Ut(i,n){1&i&&e._UZ(0,"i",75)}function Jt(i,n){1&i&&e._UZ(0,"i",76)}var T=(()=>{return(i=T||(T={})).ALL="all",i.SYNC="sync",i.WRONG="wrong",i.UNSYNC="unsync",T;var i})();class V{constructor(n,t,a,o,c,q){this.http=n,this.toastr=t,this.datePipe=a,this.url=o,this.productService=c,this.orderService=q,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=M}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(a=>{this.downloadData=a.Body,this.onStepperNext(n)})}onPreview(n){this.validateDatePreview()&&this.http.post("/api/Orders/Preview",{ID:this.channelID,From:this.startDate,To:this.endDate}).subscribe(a=>{0!=a.length?(this.previewData=a,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 _.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=_.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(a=>a.Action==M.DoNothing);break;case T.WRONG:t=this.previewData.filter(a=>a.Action==M.Update);break;case T.UNSYNC:t=this.previewData.filter(a=>a.Action==M.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=!_.g.isValidDate(this.startDate)||!_.g.isValidDate(this.endDate),t=_.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()}}V.\u0275fac=function(n){return new(n||V)(e.Y36(v.O),e.Y36(X._W),e.Y36(u.uU),e.Y36(m.gz),e.Y36(ct.M),e.Y36(Z))},V.\u0275cmp=e.Xpm({type:V,selectors:[["app-download"]],features:[e._Bn([{provide:pt.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 a=e.EpF();e.TgZ(0,"mainpanel",0)(1,"actions"),e.YNc(2,dt,12,1,"ng-container",1),e.YNc(3,ht,2,1,"button",2),e.YNc(4,gt,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(c){return t.stepChange(c)})("selectionChange",function(c){return t.onStepperChange(c)}),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(c){return t.channelID=c}),e.YNc(24,_t,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(c){return t.startDate=c})("click",function(){e.CHM(a);const c=e.MAs(37);return e.KtG(c.open())}),e.qZA(),e.TgZ(35,"input",20),e.NdJ("ngModelChange",function(c){return t.endDate=c})("click",function(){e.CHM(a);const c=e.MAs(37);return e.KtG(c.open())}),e.qZA()(),e._UZ(36,"mat-date-range-picker",null,21),e.qZA()()()()()(),e.TgZ(38,"mat-step",22),e.YNc(39,mt,1,0,"ng-template",11),e.YNc(40,Nt,34,11,"div",23),e.qZA(),e.TgZ(41,"mat-step",24),e.YNc(42,At,1,0,"ng-template",11),e.YNc(43,Mt,16,2,"div",23),e.qZA(),e.YNc(44,qt,1,0,"ng-template",25),e.YNc(45,Ut,1,0,"ng-template",26),e.YNc(46,Jt,1,0,"ng-template",27),e.qZA()()()()()()()}if(2&n){const a=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-"+a.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:[u.mk,u.sg,u.O5,d.Fj,d.JJ,d.On,w.p,f.w9,f.jq,K.wx,K.zY,K.By,K._g,j.C0,j.VY,j.Vq,j.z9,ee.gM,u.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=h(8063);const kt=[{path:"",component:N,children:[{path:"",redirectTo:"new",pathMatch:"full"},{path:"new",component:Y,canActivate:[D.a],data:{title:"New Order"}},{path:"detail",component:G,canActivate:[D.a],data:{title:"Orders detail"}},{path:"ready_to_ship",component:H,canActivate:[D.a],data:{title:"Ready To Ship"}},{path:"Shipped",component:R,canActivate:[D.a],data:{title:"Shipped"}},{path:"Delivered",component:$,canActivate:[D.a],data:{title:"Delivered"}},{path:"All",component:z,canActivate:[D.a],data:{title:"All Order"}},{path:"Cancelled",component:B,canActivate:[D.a],data:{title:"Cancelled"}},{path:"Download",component:V,canActivate:[D.a],data:{title:"Download"}}]}];class L{}L.\u0275fac=function(n){return new(n||L)},L.\u0275mod=e.oAB({type:L}),L.\u0275inj=e.cJS({imports:[u.ez,m.Bz.forChild(kt)]});var Lt=h(8739),Ft=h(3238),Qt=h(1108),Et=h(4385),Yt=h(5171);class F{}F.\u0275fac=function(n){return new(n||F)},F.\u0275mod=e.oAB({type:F}),F.\u0275inj=e.cJS({providers:[Z,y],imports:[u.ez,d.u5,L,U.Z,w.R,Lt.TU,m.Bz,f.A0,K.FA,Ft.XK,P.n,j.T5,ee.AV,Qt.f,J.p9,g.Is,Et.LD,O.s,C.JX,Yt.P,I.Q]})},6082:(te,W,h)=>{h.d(W,{M:()=>b});var u=h(8505),m=h(262),Q=h(2843),e=h(1889),U=h(4650),N=h(1318),_=h(7185);class b{constructor(l,r){this.httpService=l,this.toastrService=r}loader(l=e.g.GuidEMpty){return this.httpService.post("/api/product/Load",{ID:l})}LoadInPOS(l=e.g.GuidEMpty){return this.httpService.post("/api/product/LoadInPOS",{ID:l})}filterChannelByTypeId(l,r){return l.filter(s=>-1!==r.findIndex(p=>s.TypeID==p))}getProductStatistic(){return this.httpService.post("/api/product/ProductStatistic",{})}getTotalProductLive(l){return this.httpService.post("/api/product/TotalProductLive",{ID:l})}clearCacheChannel(l){return this.httpService.post("/api/Channel/ClearCacheChannel",{ID:l})}uploadSingleProduct(l,r){return this.httpService.post("api/product/UploadMultipleChannel",{Channel:r,Products:l}).pipe((0,u.b)(p=>{this.showToastrSuccessUploadSingle(p,l[0])}),(0,m.K)(p=>(this.showToastErrorUploadSingle(p,l[0]),(0,Q._)(()=>new Error(p)))))}uploadMultipleProduct(l,r){return this.httpService.post("api/product/UploadMultipleProductAndMultipleChannel",{Channel:r,Products:l}).pipe((0,u.b)(p=>{this.showToastrUploadMultiple(p.Message)}),(0,m.K)(p=>(this.showToastrUploadMultiple(p.error?.Message),(0,Q._)(()=>new Error(p)))))}uploadNotInChannel(l,r){return this.httpService.post("/api/product/UploadProductNotInChannelToChannel",{Products:l,Channel:r}).pipe((0,u.b)(p=>{this.showToastrUploadMultiple(p)}),(0,m.K)(p=>(this.showToastrUploadMultiple(p.error?.Message),(0,Q._)(()=>new Error(p)))))}scanSingle(l,r){return this.httpService.post("/api/product/ScanSingle",{ID:l,SKU:r})}scanNotInChannel(l){return this.httpService.post("/api/product/ScanNotinChannel",{ID:l})}findAllSoldInChannel(l){return this.httpService.post("/api/product/GetSoldInChannel",l)}scanAll(l,r,s,p=!1){return this.httpService.post("/api/product/ScanOptimized",{ID:l,ScanFull:r,UpdatedProduct:s,Async:p})}scanCompareToPos(l){return this.httpService.post("/api/product/CompareMarketplaceToPOS",l)}getVariantCodesProduct(l){return l.Variants.map(s=>s.Code)}downloadMultipleProduct(l){let r=l.map(s=>({ChannelItemID:s.ChannelItemID,ChannelID:s.ChannelID}));return this.httpService.post("/api/product/DownloadMultipleProductFromChannel",r).pipe((0,u.b)(s=>{this.toastrService.success(`${s.Count} products downloaded to POS`,"Download Complete")}))}downloadProduct(l){return this.httpService.post("/api/product/DownloadProductFromChannel",{ChannelItemID:l.ChannelItemID,ChannelID:l.ChannelID}).pipe((0,u.b)(()=>{this.toastrService.success("Product successfully downloaded to POS","Download Complete")}))}getVariantCodesProducts(l=[]){let r=[];return l.forEach(s=>{s.Variants.forEach(p=>{r=[...r,p.Code]})}),r}filterUnselectedChannel(l,r){let p,s=[];if(l.forEach(g=>{s=[...s,...g.Channel]}),s&&0!=s.length){let g=[];p=r.filter(d=>(g=s.filter(J=>J.ChannelID==d.ID),g.length!==l.length))}else p=r;return p}findChannelById(l,r){return r.find(s=>s.ID==l)}sortChannel(l=[]){return l.sort((r,s)=>r.TypeID<s.TypeID?1:r.TypeID===s.TypeID?0:-1)}hasSelection(l=[]){return this.selectedProduct(l).length>0}selectedProduct(l=[]){return l.filter(r=>r.selected)}hasSelectionVariant(l){return this.selectedVariantProduct(l).length>0}selectedVariantProduct(l){let r=[];return l.forEach(s=>{r=[...r,...null!=s.Variants?s.Variants.filter(p=>p.selected):""]}),r}getChannelProduct(l){const r=l.Variants;let s=[];for(let p of r)if(null!=p.Channel)for(let g of p.Channel)0==s.filter(d=>d.ChannelID==g.ChannelID).length&&s.push(g);return this.sortChannel(s)}successToastrScanAllProduct(l,r,s){if(s){const p=l?.NotInPOS?.Product?l?.NotInPOS?.Product:0,g=l?.InChannel?.Product?l?.InChannel?.Product:0;this.toastrService.success(`\n ${p+g} found in ${r.Name} </br>\n (${g} In POS + ${p} Not In Pos)\n `,"Scan Complete!",{enableHtml:!0})}else this.toastrService.success(`${l.InChannel?l.InChannel.Product:0} product updates in ${r.Name} </br> \n since ${l.LastUpdate}`,"Scan Complete!",{enableHtml:!0})}checkProductHasScanButton(l,r){let s;return l.map(p=>(p.Channel=this.getChannelProduct(p),s=this.filterUnselectedChannel([p],r),p.hasScan=s.length>0,p))}checkProductHasUploadBtn(l,r){let s;return l.map(p=>(p.Channel=this.getChannelProduct(p),s=this.filterUnselectedChannel([p],r),p.hasUpload=s.length>0,p))}showToastrUploadMultiple(l=[]){let r=[],s=[];const p=this.getResponseList(l);if(l.forEach(g=>{"string"==typeof g?.Response?s=[...s,p.length>1?this.setHtmlli(g.Response):this.setHtmlli(g.Response,!1)]:(g?.Response?.Success.forEach(d=>{r=[...r,p.length>1?this.setHtmlli(`Product ${d} was <b>successfully</b> uploaded to ${g.Name}`):this.setHtmlli(`Product ${d} was <b>successfully</b> uploaded to ${g.Name}`,!1)]}),g?.Response.Fail.forEach(d=>{s=[...s,p.length>1?this.setHtmlli(d):this.setHtmlli(d,!1)]}))}),s.length>0&&r.length>0){const g=[...r,...s];this.toastrService.warning(this.concatMessage(g),"Warning!",{enableHtml:!0})}else r.length>0&&0==s.length?this.toastrService.success(this.concatMessage(r),"Success",{enableHtml:!0}):this.toastrService.error(this.concatMessage(s),"Error",{enableHtml:!0})}setHtmlli(l,r=!0){return r?`<li>${l}</li>`:l}getResponseList(l){let r=[];return l.forEach(s=>{"string"==typeof s?.Response?r=[...r,s.Response]:(s?.Response?.Success.forEach(p=>{r=[...r,s.Name]}),s?.Response.Fail.forEach(p=>{r=[...r,p]}))}),r}concatMessage(l=[]){let r="";return l.forEach(s=>{r+=s}),l.length>1?`<ol>${r}</ol>`:r}showToastrSuccessUploadSingle(l,r){let s=l.filter(d=>0==d.Status),p=l.filter(d=>1==d.Status),g=this.generateToastrMessage(s,p,r);this.toastrService.success(g.message,"Success",{enableHtml:!0})}showToastErrorUploadSingle(l,r){let s=l?.error?.Message.filter(d=>0==d.Status),p=l?.error?.Message.filter(d=>1==d.Status),g=this.generateToastrMessage(s,p,r);"WARNING"==g.status?this.toastrService.warning(g.message,"Warning!",{enableHtml:!0}):this.toastrService.error(g.message,`Error - ${l.status}`,{enableHtml:!0})}generateToastrMessage(l,r,s){let g,p="",d=[...l,...r];return 0==l.length&&r.length>0?(g="SUCCESS",p=this.createSuccessResponse(r,s)):l.length>0&&0==r.length?(g="ERROR",p=this.createErrResponse(l,s)):(g="WARNING",p=`${this.createSuccessResponse(r,s)} ${this.createErrResponse(l,s)}`),d.length>1&&(p=`<ol>${p}</ol>`),{status:g,message:p}}createErrResponse(l,r){let s="";return l.length>1?l.forEach((p,g)=>{s+=`<li>${p.Response}</li>`}):1==l.length&&(s+=`${l[0].Response}`),s}createSuccessResponse(l,r){let s="";return l.length>1?l.forEach((p,g)=>{s+=`<li>Product ${r.Name} was <b>successfully</b> uploaded to ${p.Name}</li>`}):1==l.length&&(s+=`Product ${r.Name} was <b>successfully</b> uploaded to ${l[0].Name}`),s}getHostName(){if(e.g.IsEmpty(this.hostName)){const l=localStorage.getItem("Authorization");this.hostName=JSON.parse(l)?.Host}return this.hostName}}b.\u0275fac=function(l){return new(l||b)(U.LFG(N.O),U.LFG(_._W))},b.\u0275prov=U.Yz7({token:b,factory:b.\u0275fac,providedIn:"root"})}}]);