marketplacepos 2.9.5 → 2.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Marketplace/103.bd9a1f982b50e346.js +1 -0
- package/Marketplace/168.372c8292de413867.js +1 -0
- package/Marketplace/231.0c7ab993977632a2.js +1 -0
- package/Marketplace/257.d1592e885695ba4b.js +1 -0
- package/Marketplace/278.e89610409641d910.js +1 -0
- package/Marketplace/296.93310f70e5f9d3a9.js +1 -0
- package/Marketplace/299.86cba892502ce6e4.js +1 -0
- package/Marketplace/307.494dace4c75f3987.js +1 -0
- package/Marketplace/311.17b5fcab2ef01d3f.js +1 -0
- package/Marketplace/389.f73b3c5db7bdf654.js +1 -0
- package/Marketplace/3rdpartylicenses.txt +1 -1
- package/Marketplace/445.8f1497373c95bb64.js +1 -0
- package/Marketplace/452.12b65c3c6f144b7e.js +1 -0
- package/Marketplace/476.d08ef7b92327904d.js +1 -0
- package/Marketplace/478.bdd1c6271d13e6fc.js +1 -0
- package/Marketplace/500.c2e6963e4771761e.js +1 -0
- package/Marketplace/527.e23646167d384e97.js +1 -0
- package/Marketplace/556.5d624cfb73f161b2.js +1 -0
- package/Marketplace/56.0432dfcbb3e04e39.js +1 -0
- package/Marketplace/599.8de0c2b4c7af0f9d.js +1 -0
- package/Marketplace/617.4db1b737553fe58b.js +1 -0
- package/Marketplace/62.4f9a8ca2692bdd97.js +1 -0
- package/Marketplace/671.8d5ec5d95df1c8e5.js +1 -0
- package/Marketplace/699.e1f8489991913e8e.js +1 -0
- package/Marketplace/726.318498721a0c771c.js +1 -0
- package/Marketplace/810.af61302495e16f98.js +1 -0
- package/Marketplace/877.bbdea3b04cc75780.js +1 -0
- package/Marketplace/900.f4171c8753af159f.js +1 -0
- package/Marketplace/967.2b39f548c7f4eb30.js +1 -0
- package/Marketplace/common.91711b840b02b984.js +1 -0
- package/Marketplace/index.html +6 -5
- package/Marketplace/main.9ef14d5cfe5be8d5.js +1 -0
- package/Marketplace/polyfills.503b3f4bf922d237.js +1 -0
- package/Marketplace/runtime.d8765e35f501b572.js +1 -0
- package/Marketplace/scripts.3e75d50128144df1.js +1 -0
- package/Marketplace/styles.7f496be7a7c4b295.css +19 -0
- package/package.json +1 -1
- package/Marketplace/174.491c4991a4f8e404.js +0 -1
- package/Marketplace/19.124a066645320965.js +0 -1
- package/Marketplace/213.0e33a2cc7393deb2.js +0 -1
- package/Marketplace/277.e644e3531765ce65.js +0 -1
- package/Marketplace/360.5c7b51c35e7142e7.js +0 -1
- package/Marketplace/369.a1e3b731aeb5243f.js +0 -1
- package/Marketplace/379.25d1b1c637903c75.js +0 -1
- package/Marketplace/392.f4537160149f627a.js +0 -1
- package/Marketplace/397.c1a8fad6c2ca3235.js +0 -1
- package/Marketplace/425.03f8f97da7452806.js +0 -1
- package/Marketplace/455.c9dd08adf08a1b65.js +0 -1
- package/Marketplace/46.40ebac81bd0fb91b.js +0 -1
- package/Marketplace/481.64ffd74d20798f93.js +0 -1
- package/Marketplace/501.7645c32a140dd7f8.js +0 -1
- package/Marketplace/512.52dc49022c04fa43.js +0 -1
- package/Marketplace/53.3655b31ecb37ade9.js +0 -1
- package/Marketplace/545.4809f373cc63f3b4.js +0 -1
- package/Marketplace/717.5d253da5bb63552f.js +0 -1
- package/Marketplace/72.23b7f31fc45323cb.js +0 -1
- package/Marketplace/739.0de1f18deac0ed90.js +0 -1
- package/Marketplace/754.086e7f7a5377c7d9.js +0 -1
- package/Marketplace/767.64dd12e70c78eb25.js +0 -1
- package/Marketplace/835.ea5f86512592f641.js +0 -1
- package/Marketplace/859.3a4d26983bbb5254.js +0 -1
- package/Marketplace/874.1fbcd1001b41f18e.js +0 -1
- package/Marketplace/913.ec8155bc121fb0a6.js +0 -1
- package/Marketplace/993.5c22ca4b00b8c459.js +0 -1
- package/Marketplace/997.1e5281aa64540dee.js +0 -1
- package/Marketplace/common.1b119d9b7a972f87.js +0 -1
- package/Marketplace/main.cbb985d0c847641f.js +0 -1
- package/Marketplace/polyfills.bee3c4d96e890990.js +0 -1
- package/Marketplace/runtime.8ddf6965934d46b2.js +0 -1
- package/Marketplace/scripts.b7cebc1258dbcca8.js +0 -1
- package/Marketplace/styles.97105d62c44869cb.css +0 -20
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[671],{7671:(B,E,h)=>{h.r(E),h.d(E,{OrdersModule:()=>Ht});var u=h(6814),C=h(9790),k=h(7826),e=h(5879),P=h(6027);let H=(()=>{var a;class r{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:[k.G.downloadOrder]}]}ngOnInit(){}}return(a=r).\u0275fac=function(t){return new(t||a)},a.\u0275cmp=e.Xpm({type:a,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(t,n){1&t&&(e.TgZ(0,"nav",0)(1,"div",1)(2,"div"),e._UZ(3,"nav-tab",2),e.qZA()()(),e._UZ(4,"router-outlet")),2&t&&(e.xp6(3),e.Q6J("Tabs",n.ObjectOrderTabs)("usePermissions",!0))},dependencies:[P.e,C.lC]}),r})();var f=h(5802),Y=h(7081),S=h(9397),I=h(7398),m=h(754),s=h(1449),c=h(5149),d=h(7700),p=h(6223),g=h(5986);let T=(()=>{var a;class r{constructor(t){this.dialogRef=t,this.tandaiSudahDicetak=!1}onCancel(){this.dialogRef.close()}onPrint(){this.dialogRef.close(this.tandaiSudahDicetak?1:0)}}return(a=r).\u0275fac=function(t){return new(t||a)(e.Y36(d.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(t,n){1&t&&(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(l){return n.tandaiSudahDicetak=l}),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 n.onCancel()}),e._uU(14,"Cancel"),e.qZA(),e.TgZ(15,"button",10),e.NdJ("click",function(){return n.onPrint()}),e._uU(16,"Cetak Pesanan"),e.qZA()()()),2&t&&(e.xp6(9),e.Q6J("ngModel",n.tandaiSudahDicetak))},dependencies:[p.JJ,p.On,g.oG,d.uh,d.xY,d.H8]}),r})();var J=h(2181),R=h(4664),w=h(9659),G=h(9229);let K=(()=>{var a;class r{constructor(){}convertToCSV(t,n){let o;if("string"==typeof t)o=t;else{var l="object"==typeof t?t:JSON.parse(t);o=this.transformToCSVStringFormat(l)}this.downloadCSV(o,n)}transformToCSVStringFormat(t){if(!t||!t.length)return;const o=Object.keys(t[0]);return t.map(_=>o.map(O=>{let b=null==_[O]?"":_[O];return b=b instanceof Date?b.toLocaleString():b.toString().replace(/"/g,'""'),b.search(/("|,|\n)/g)>=0&&(b=`"${b}"`),b}).join(",")).join("\n")}downloadCSV(t,n){var o=new Blob([t],{type:"text/csv;charset=utf8;"}),l=document.createElement("a");l.setAttribute("href",window.URL.createObjectURL(o)),l.setAttribute("download",n),document.body.appendChild(l),l.click(),document.body.removeChild(l)}}return(a=r).\u0275fac=function(t){return new(t||a)},a.\u0275prov=e.Yz7({token:a,factory:a.\u0275fac,providedIn:"root"}),r})(),M=(()=>{var a;class r{constructor(t,n,o,l){this.http=t,this.dialog=n,this.toastr=o,this.exportService=l}loadInitialPage(){return this.http.post("/api/ordersLoader/GetOrder",{})}getNewOrders(t){return this.http.post("/api/orders/GetNewOrder",t).pipe((0,I.U)(n=>n.Data))}getTotalNewOrders(t,n,o){return this.http.post("/api/orders/GetCountNewOrder",{ListChannelID:t,From:n,To:o}).pipe((0,I.U)(_=>_.Count))}printShippingLabelTokopedia(t){const n={OrderNumber:t,Printed:!0};this.dialog.open(T).afterClosed().pipe((0,J.h)(o=>void 0!==o),(0,R.w)(o=>(n.Printed=o,this.http.post("api/v1/Shippinglabel/Tokopedia",n)))).subscribe(o=>{const l=window.open("about:blank","_blank");l.document.write(o),l.document.close()})}printShippingLabelTiktok(t,n){this.http.post("api/v1/Shippinglabel/Tiktok",{ShopID:n,OrderNumber:t}).subscribe(l=>{null!=l.data?window.open(l.data.doc_url,"_blank"):this.toastr.error("Cannot Print the Shipping Label,The invoice Number is not set to Pickup","Cannot Print")})}printShippingLabelShopee(t,n){this.http.post("api/v1/Shippinglabel/shopee/DownloadShipping",{ShopID:n,OrderNumber:t}).subscribe(l=>{var _=Uint8Array.from(atob(l),b=>b.charCodeAt(0)),O=new Blob([_],{type:"octet/stream"});f.g.openDownloadFile(O,`${t}.pdf`)})}printShippingLabelLazada(t,n){this.http.post("api/v1/Shippinglabel/Lazada/DownloadShipping",{ShopID:n,OrderNumber:t}).subscribe(l=>{null!=l.result.data?window.open(l.result.data.pdf_url,"_blank"):this.toastr.error(l.message,"Cannot Print")})}exportOrders(t,n){return this.http.post("api/Orders/ExportOrder",t).pipe((0,S.b)(o=>{this.exportService.convertToCSV(o,n)}))}}return(a=r).\u0275fac=function(t){return new(t||a)(e.LFG(w.O),e.LFG(d.uw),e.LFG(G._W),e.LFG(K))},a.\u0275prov=e.Yz7({token:a,factory:a.\u0275fac}),r})(),$=(()=>{var a;class r{constructor(t,n){this.http=t,this.toastr=n}acceptTokopediaOrders(t){return this.http.post("/api/Orders/AcceptOrderTokopedia",t).pipe((0,S.b)(n=>{this.tokopediaAcceptOrderHandler(n)}))}tokopediaAcceptOrderHandler(t){const n=t.filter(l=>0==l.Status),o=t.filter(l=>1==l.Status);if(0==n.length&&o.length>0){let l=`<ol>${this.generateSuccessMessage(o)}</ol>`;this.toastr.success(l,"Success",{enableHtml:!0})}else if(n.length>0&&o.length>0){let l=`<ol>\n ${this.generateSuccessMessage(o)}\n ${this.generateErrorMessage(n)}\n </ol>`;this.toastr.warning(l,"Warning",{enableHtml:!0})}else{let l=`<ol>${this.generateErrorMessage(n)}</ol>`;this.toastr.error(l,"Error",{enableHtml:!0})}}generateSuccessMessage(t){let n="";return t.forEach(o=>{n+=`<li><b>${o.OrderNumber}</b> was successfully Accept</li>`}),n}generateErrorMessage(t){let n="";return t.forEach(o=>{n+=`<li><b>${o.OrderNumber}</b> ${o.Message}</li>`}),n}}return(a=r).\u0275fac=function(t){return new(t||a)(e.LFG(w.O),e.LFG(G._W))},a.\u0275prov=e.Yz7({token:a,factory:a.\u0275fac}),r})();var D=h(4387),Z=h(4807),A=h(6930);let q=(()=>{var a;class r{set typeId(t){this.channelLogo=f.g.getChannelLogoByTypeId(t),this.initChannelName(t)}constructor(){}initChannelName(t){switch(t){case m.x.Tokopedia:this.channelName="Tokopedia";break;case m.x.Tiktok:this.channelName="Tiktok";break;case m.x.WooCommerce:this.channelName="WooCommerce";break;case m.x.ShopeeV2:this.channelName="Shopee";break;case m.x.Lazada:this.channelName="Lazada";break;case m.x.KalCare:this.channelName="Kalcare"}}}return(a=r).\u0275fac=function(t){return new(t||a)},a.\u0275cmp=e.Xpm({type:a,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(t,n){1&t&&(e.TgZ(0,"div",0),e._UZ(1,"img",1),e.TgZ(2,"span",2),e._uU(3),e.qZA()()),2&t&&(e.xp6(1),e.Q6J("src",n.channelLogo,e.LSH),e.xp6(2),e.Oqu(n.channelName))}}),r})();var U=h(5439),x=h(3566),y=h(4126);function j(a,r){if(1&a){const i=e.EpF();e.ynx(0),e.TgZ(1,"button",13),e.NdJ("click",function(){e.CHM(i);const n=e.oxw().ngIf,o=e.oxw();return e.KtG(o.onAcceptOrder(n))}),e._UZ(2,"i",14),e._uU(3," Accept "),e.qZA(),e.BQk()}}function V(a,r){if(1&a&&(e.ynx(0),e.YNc(1,j,4,0,"ng-container",1),e.BQk()),2&a){const i=e.oxw();e.xp6(1),e.Q6J("ngIf",i.isTokopediaAvailable&&i.isTokopediaSelected)}}function W(a,r){if(1&a&&(e.TgZ(0,"span",15),e._UZ(1,"img",16),e.qZA(),e._uU(2)),2&a){const i=r.item;e.xp6(1),e.Q6J("src",i.img,e.LSH),e.xp6(1),e.hij(" ",i.Name," ")}}function X(a,r){if(1&a){const i=e.EpF();e.ynx(0),e.TgZ(1,"th",28)(2,"input",29),e.NdJ("ngModelChange",function(n){e.CHM(i);const o=e.oxw(3);return e.KtG(o.isCheckAll=n)})("ngModelChange",function(){e.CHM(i);const n=e.oxw(2).ngIf,o=e.oxw();return e.KtG(o.onSelectAllOrderData(n))}),e.qZA()(),e.BQk()}if(2&a){const i=e.oxw(3);e.xp6(2),e.Q6J("ngModel",i.isCheckAll)}}function ee(a,r){if(1&a){const i=e.EpF();e.ynx(0),e.TgZ(1,"input",29),e.NdJ("ngModelChange",function(n){e.CHM(i);const o=e.oxw(2).$implicit;return e.KtG(o.selected=n)})("ngModelChange",function(){e.CHM(i);const n=e.oxw(4).ngIf,o=e.oxw();return e.KtG(o.onSelectOrderData(n))}),e.qZA(),e.BQk()}if(2&a){const i=e.oxw(2).$implicit;e.xp6(1),e.Q6J("ngModel",i.selected)}}function te(a,r){if(1&a&&(e.ynx(0),e.TgZ(1,"td"),e.YNc(2,ee,2,1,"ng-container",1),e.qZA(),e.BQk()),2&a){const i=e.oxw().$implicit,t=e.oxw(3);e.xp6(2),e.Q6J("ngIf",i.Type==t.tokopediaType)}}function ne(a,r){if(1&a&&(e.ynx(0),e.TgZ(1,"span"),e._uU(2),e.qZA(),e.BQk()),2&a){const i=e.oxw().$implicit;e.xp6(2),e.Oqu(i.Number)}}function ae(a,r){if(1&a&&(e.TgZ(0,"a",32),e._uU(1),e.qZA()),2&a){const i=e.oxw().$implicit,t=e.oxw(3);e.Q6J("href",t.domain+"/menu/Orders/Order/Sales_Order/Info?ID="+i.ID,e.LSH),e.xp6(1),e.Oqu(i.Number)}}function ie(a,r){if(1&a&&(e.TgZ(0,"tr"),e.YNc(1,te,3,1,"ng-container",1),e.TgZ(2,"td"),e._uU(3),e.qZA(),e.TgZ(4,"td"),e.YNc(5,ne,3,1,"ng-container",17),e.YNc(6,ae,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&a){const i=r.$implicit,t=e.MAs(7),n=e.oxw(3);e.xp6(1),e.Q6J("ngIf",n.isTokopediaAvailable),e.xp6(2),e.Oqu(i.Outlet),e.xp6(2),e.Q6J("ngIf",i.ID==n.guidEmpty)("ngIfElse",t),e.xp6(4),e.Oqu(i.Customer),e.xp6(2),e.Oqu(e.xi3(12,7,i.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",i.Type)}}function oe(a,r){if(1&a){const i=e.EpF();e.ynx(0),e.TgZ(1,"div",18)(2,"table",19),e.NdJ("matSortChange",function(n){e.CHM(i);const o=e.oxw(2);return e.KtG(o.onSort(n))}),e.TgZ(3,"thead",20)(4,"tr",21),e.YNc(5,X,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,ie,15,10,"tr",26),e.qZA()(),e.TgZ(18,"app-mat-paginator-no-count",27),e.NdJ("total",function(){e.CHM(i);const n=e.oxw(2);return e.KtG(n.getPaginatonTotal())})("next",function(){e.CHM(i);const n=e.oxw(2);return e.KtG(n.onNextPage())})("previous",function(){e.CHM(i);const n=e.oxw(2);return e.KtG(n.onPreviousPage())}),e.ALo(19,"async"),e.ALo(20,"async"),e.qZA()(),e.BQk()}if(2&a){const i=e.oxw().ngIf,t=e.oxw();let n;e.xp6(5),e.Q6J("ngIf",t.isTokopediaAvailable&&i),e.xp6(12),e.Q6J("ngForOf",i),e.xp6(1),e.Q6J("filter",t.filter)("totaldata",null==(n=e.lcZ(19,5,t.newOrdersData$))?null:n.length)("paginationTotal",e.lcZ(20,7,t.paginationTotal$))}}function re(a,r){if(1&a&&(e.ynx(0),e.YNc(1,oe,21,9,"ng-container",17),e.BQk()),2&a){const i=r.ngIf;e.oxw();const t=e.MAs(31);e.xp6(1),e.Q6J("ngIf",(null==i?null:i.length)>0)("ngIfElse",t)}}function le(a,r){1&a&&(e.TgZ(0,"div",33),e._UZ(1,"app-empty-state"),e.qZA())}let se=(()=>{var a;class r{constructor(t,n,o,l,_){this.localDataService=t,this.channelService=n,this.orderService=o,this.toastr=l,this.acceptOrderService=_,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.domain=`https://${this.localDataService.getHostName()}`,this.guidEmpty=f.g.GuidEMpty,this.tokopediaType=m.x.Tokopedia,this.isTokopediaSelected=!1,this.isTokopediaAvailable=!1,this.isCheckAll=!1}ngOnInit(){this.initLoadPage()}initLoadPage(){this.orderService.loadInitialPage().subscribe(t=>{this.filter.PageNumber=t.Filter.PageNumber,this.filter.PageSize=t.Filter.RowCount,this.filter.From=t.Filter.From,this.filter.To=t.Filter.To,this.channels=t.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,Y.d)()),this.newOrdersData$=this.sourceObs$.pipe((0,S.b)(n=>{n.filter(l=>l.Type==m.x.Tokopedia).length>0&&(this.isTokopediaAvailable=!0)}))}getPaginatonTotal(){this.paginationTotal$=this.orderService.getTotalNewOrders(this.filter.ListChannelID,this.filter.From,this.filter.To).pipe((0,Y.d)())}onNextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.getNewOrders()}onPreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.getNewOrders()}onSelectOrderData(t){this.isTokopediaSelected=!1,t.filter(o=>o.selected).length>0&&(this.isTokopediaSelected=!0)}onSelectAllOrderData(t){t=t.map(n=>(n.Type==m.x.Tokopedia&&(n.selected=this.isCheckAll),n)),this.onSelectOrderData(t)}onAcceptOrder(t){let n=this.getSelectedTokopediaOrders(t);this.acceptOrderService.acceptTokopediaOrders(n).subscribe(o=>{this.isTokopediaSelected=!1,location.reload()})}getSelectedTokopediaOrders(t){return t.filter(o=>o.selected).map(o=>o.Number)}onSort(t){if(""!=t.direction){if("created"==t.active){const n="asc"==t.direction;this.newOrdersData$=this.newOrdersData$.pipe((0,I.U)(o=>o.sort((l,_)=>f.g.compare(l.Created,_.Created,n))))}}else this.newOrdersData$=this.sourceObs$}}return(a=r).\u0275fac=function(t){return new(t||a)(e.Y36(s.T),e.Y36(c.T),e.Y36(M),e.Y36(G._W),e.Y36($))},a.\u0275cmp=e.Xpm({type:a,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(t,n){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(){return n.getNewOrders()}),e.TgZ(1,"actions"),e.YNc(2,V,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(l){return n.filter.ListChannelID=l}),e.YNc(10,W,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(l){return n.filter.PageNumber=l}),e.qZA()(),e.TgZ(15,"div")(16,"h6"),e._uU(17,"Page Size"),e.qZA(),e.TgZ(18,"input",6),e.NdJ("ngModelChange",function(l){return n.filter.PageSize=l}),e.qZA()(),e.TgZ(19,"div")(20,"h6"),e._uU(21,"From/To"),e.qZA(),e.TgZ(22,"datepicker",7),e.NdJ("dateChange",function(l){return n.filter.From=l}),e.qZA(),e.TgZ(23,"datepicker",8),e.NdJ("dateChange",function(l){return n.filter.To=l}),e.qZA()()()(),e.TgZ(24,"content")(25,"div",9)(26,"div",10)(27,"div",11),e.YNc(28,re,2,2,"ng-container",1),e.ALo(29,"async"),e.YNc(30,le,2,0,"ng-template",null,12,e.W1O),e.qZA()()()()()),2&t&&(e.Q6J("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",e.lcZ(3,11,n.newOrdersData$)),e.xp6(7),e.Q6J("clearable",!0)("multiple",!0)("items",n.channels)("ngModel",n.filter.ListChannelID),e.xp6(5),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.PageSize),e.xp6(4),e.Q6J("date",n.filter.From),e.xp6(1),e.Q6J("date",n.filter.To),e.xp6(5),e.Q6J("ngIf",e.lcZ(29,13,n.newOrdersData$)))},dependencies:[u.sg,u.O5,p.Fj,p.wV,p.Wl,p.JJ,p.On,D.p,Z.w9,Z.ir,A.n,q,U.s,x.YE,x.nU,y.Q,u.Ov,u.uU]}),r})();function pe(a,r){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.ALo(5,"number"),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.ALo(8,"number"),e.qZA()()),2&a){const i=r.$implicit;e.xp6(2),e.Oqu(i.Code),e.xp6(2),e.Oqu(e.lcZ(5,3,i.Quantity)),e.xp6(3),e.Oqu(e.lcZ(8,5,i.Price))}}function ce(a,r){if(1&a&&(e.TgZ(0,"div",4)(1,"div",5)(2,"div",6)(3,"div",7)(4,"h3",8),e._uU(5,"Outlet Info"),e.qZA()(),e.TgZ(6,"div",4)(7,"div",9),e._uU(8," Outlet : "),e.qZA(),e.TgZ(9,"div",9),e._uU(10),e.qZA()(),e.TgZ(11,"div",4)(12,"div",9),e._uU(13," Date : "),e.qZA(),e.TgZ(14,"div",9),e._uU(15),e.ALo(16,"date"),e.qZA()(),e.TgZ(17,"div",4)(18,"div",9),e._uU(19," Status : "),e.qZA(),e.TgZ(20,"div",9),e._uU(21),e.qZA()(),e.TgZ(22,"div",4)(23,"div",9),e._uU(24," Tax Type : "),e.qZA(),e.TgZ(25,"div",9),e._uU(26),e.qZA()(),e.TgZ(27,"div",4)(28,"div",9),e._uU(29," Due Date : "),e.qZA(),e.TgZ(30,"div",9),e._uU(31),e.ALo(32,"date"),e.qZA()()(),e.TgZ(33,"div",6)(34,"div",7)(35,"h3",8),e._uU(36,"Customer Info"),e.qZA()(),e.TgZ(37,"div",4)(38,"div",9),e._uU(39," Name : "),e.qZA(),e.TgZ(40,"div",9),e._uU(41),e.qZA()(),e.TgZ(42,"div",4)(43,"div",9),e._uU(44," Email : "),e.qZA(),e.TgZ(45,"div",9),e._uU(46),e.qZA()(),e.TgZ(47,"div",4)(48,"div",9),e._uU(49," Mobile : "),e.qZA(),e.TgZ(50,"div",9),e._uU(51),e.qZA()()()(),e.TgZ(52,"div",10)(53,"h3",11),e._uU(54,"Products Sold"),e.qZA(),e.TgZ(55,"div",12)(56,"table",13)(57,"thead",14)(58,"tr",15)(59,"th"),e._uU(60,"Code"),e.qZA(),e.TgZ(61,"th"),e._uU(62,"Quantity"),e.qZA(),e.TgZ(63,"th"),e._uU(64,"Price"),e.qZA()()(),e.TgZ(65,"tbody"),e.YNc(66,pe,9,7,"tr",16),e.qZA()()()()()),2&a){const i=e.oxw();e.xp6(10),e.hij(" ",i.model.Outlet," "),e.xp6(5),e.hij(" ",e.xi3(16,9,i.model.Date,"dd MMM yyyy")," "),e.xp6(6),e.hij(" ",i.model.Delivery," "),e.xp6(5),e.hij(" ",i.model.TaxType," "),e.xp6(5),e.hij(" ",e.xi3(32,12,i.model.DueDate,"dd MMM yyyy")," "),e.xp6(10),e.hij(" ",i.model.Customer.Name," "),e.xp6(5),e.hij(" ",i.model.Customer.Email," "),e.xp6(5),e.hij(" ",i.model.Customer.Mobile," "),e.xp6(15),e.Q6J("ngForOf",i.model.Variants)}}const de=function(){return["/menu/Order"]};let he=(()=>{var a;class r{constructor(t,n){this.http=t,this.url=n,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(n=>{this.model=n})}}return(a=r).\u0275fac=function(t){return new(t||a)(e.Y36(w.O),e.Y36(C.gz))},a.\u0275cmp=e.Xpm({type:a,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(t,n){1&t&&(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,ce,67,15,"div",3),e.qZA()()()),2&t&&(e.Q6J("headerTitle","Order #"+n.number)("hideSearchBox",!0)("hideSearchDropdown",!0),e.xp6(2),e.Q6J("routerLink",e.DdM(5,de)),e.xp6(4),e.Q6J("ngIf",n.model))},dependencies:[u.sg,u.O5,D.p,C.rH,u.JJ,u.uU]}),r})();function ue(a,r){if(1&a&&(e.TgZ(0,"span",13),e._UZ(1,"img",14),e.qZA(),e._uU(2)),2&a){const i=r.item;e.xp6(1),e.Q6J("src",i.img,e.LSH),e.xp6(1),e.hij(" ",i.Name," ")}}const ge=function(){return["/menu/Order/detail"]},_e=function(a,r){return{Number:a,Outlet:r}};function me(a,r){if(1&a&&(e.TgZ(0,"a",32),e._uU(1),e.qZA()),2&a){const i=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,ge))("queryParams",e.WLB(4,_e,i.Number,i.Outlet)),e.xp6(1),e.Oqu(i.Number)}}function fe(a,r){if(1&a&&(e.TgZ(0,"a",33),e._uU(1),e.qZA()),2&a){const i=e.oxw().$implicit,t=e.oxw(2);e.Q6J("href",t.domain+i.ID,e.LSH),e.xp6(1),e.Oqu(i.Number)}}function Te(a,r){if(1&a){const i=e.EpF();e.TgZ(0,"a",34),e.NdJ("click",function(){e.CHM(i);const n=e.oxw().$implicit,o=e.oxw(2);return e.KtG(o.onPrintShippingLabel(n.Number,n.ShopID,n.TypeID))}),e._UZ(1,"i",35),e.qZA()}}function Ce(a,r){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,me,2,7,"a",27),e.YNc(5,fe,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,Te,2,0,"a",31),e.qZA()()),2&a){const i=r.$implicit,t=e.oxw(2);e.xp6(2),e.Oqu(i.Outlet),e.xp6(2),e.Q6J("ngIf",t.hasGuidEmpty(i.ID)),e.xp6(1),e.Q6J("ngIf",!t.hasGuidEmpty(i.ID)),e.xp6(2),e.Oqu(i.Customer),e.xp6(2),e.Oqu(e.lcZ(10,8,i.Amount)),e.xp6(3),e.Oqu(e.xi3(13,10,i.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",i.TypeID),e.xp6(2),e.Q6J("ngIf",i.TypeID==t.channelType.ShopeeV2||i.TypeID==t.channelType.Tokopedia||i.TypeID==t.channelType.Tiktok||i.TypeID==t.channelType.Lazada)}}function Ze(a,r){if(1&a){const i=e.EpF();e.ynx(0),e.TgZ(1,"div",15)(2,"table",16),e.NdJ("matSortChange",function(n){e.CHM(i);const o=e.oxw();return e.KtG(o.onSort(n))}),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,Ce,18,13,"tr",25),e.qZA()(),e.TgZ(20,"app-mat-paginator-no-count",26),e.NdJ("total",function(){e.CHM(i);const n=e.oxw();return e.KtG(n.StoreRowsCountAPIResult())})("next",function(){e.CHM(i);const n=e.oxw();return e.KtG(n.NextPage())})("previous",function(){e.CHM(i);const n=e.oxw();return e.KtG(n.PreviousPage())}),e.qZA()(),e.BQk()}if(2&a){const i=e.oxw();e.xp6(19),e.Q6J("ngForOf",i.data),e.xp6(1),e.Q6J("filter",i.filter)("totaldata",i.totaldata)("paginationTotal",i.paginationTotal)}}function xe(a,r){1&a&&(e.TgZ(0,"div",36),e._UZ(1,"app-empty-state"),e.qZA())}let ve=(()=>{var a;class r{constructor(t,n,o,l,_){this.http=t,this.localDataService=n,this.dialog=o,this.orderService=l,this.channelService=_,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.totaldata=0,this.paginationTotal=0,this.checkboxState=!1,this.channelType=m.x}ngOnInit(){this.Load()}hasGuidEmpty(t){return t==f.g.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(t=>{this.filter.PageNumber=t.Filter.PageNumber,this.filter.PageSize=t.Filter.RowCount,this.filter.From=t.Filter.From,this.filter.To=t.Filter.To,this.channels=t.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(t){this.http.post("api/orders/GetReadyToShip",{Number:t,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To}).subscribe(o=>{this.data=o.Data,this.sourceData=[...o.Data],this.totaldata=this.data.length})}onPrintShippingLabel(t,n,o){switch(o){case m.x.Tokopedia:this.orderService.printShippingLabelTokopedia(t);break;case m.x.Tiktok:this.orderService.printShippingLabelTiktok(t,n);break;case m.x.ShopeeV2:this.orderService.printShippingLabelShopee(t,n);break;case m.x.Lazada:this.orderService.printShippingLabelLazada(t,n)}}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"Unpaid",DeliveryState:"Unsent",ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To}).subscribe(n=>{this.paginationTotal=n.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}onSort(t){if(""!=t.direction){if("created"==t.active){const n="asc"==t.direction;this.data=this.data.sort((o,l)=>f.g.compare(o.Created,l.Created,n))}}else this.data=this.sourceData}}return(a=r).\u0275fac=function(t){return new(t||a)(e.Y36(w.O),e.Y36(s.T),e.Y36(d.uw),e.Y36(M),e.Y36(c.T))},a.\u0275cmp=e.Xpm({type:a,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(t,n){if(1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(l){return n.Get(l)}),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(l){return n.filter.ListChannelID=l}),e.YNc(7,ue,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(l){return n.filter.PageNumber=l}),e.qZA()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Page Size"),e.qZA(),e.TgZ(15,"input",5),e.NdJ("ngModelChange",function(l){return n.filter.PageSize=l}),e.qZA()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"From/To"),e.qZA(),e.TgZ(19,"datepicker",6),e.NdJ("dateChange",function(l){return n.filter.From=l}),e.qZA(),e.TgZ(20,"datepicker",7),e.NdJ("dateChange",function(l){return n.filter.To=l}),e.qZA()()()(),e.TgZ(21,"content")(22,"div",8)(23,"div",9)(24,"div",10),e.YNc(25,Ze,21,4,"ng-container",11),e.YNc(26,xe,2,0,"ng-template",null,12,e.W1O),e.qZA()()()()()),2&t){const o=e.MAs(27);e.xp6(6),e.Q6J("clearable",!0)("multiple",!0)("items",n.channels)("ngModel",n.filter.ListChannelID),e.xp6(5),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.PageSize),e.xp6(4),e.Q6J("date",n.filter.From),e.xp6(1),e.Q6J("date",n.filter.To),e.xp6(5),e.Q6J("ngIf",n.data&&n.data.length>0)("ngIfElse",o)}},dependencies:[u.sg,u.O5,p.Fj,p.wV,p.JJ,p.On,D.p,C.rH,Z.w9,Z.ir,A.n,q,U.s,x.YE,x.nU,y.Q,u.JJ,u.uU]}),r})();function Se(a,r){if(1&a&&(e.TgZ(0,"span",13),e._UZ(1,"img",14),e.qZA(),e._uU(2)),2&a){const i=r.item;e.xp6(1),e.Q6J("src",i.img,e.LSH),e.xp6(1),e.hij(" ",i.Name," ")}}const be=function(){return["/menu/Order/detail"]},we=function(a,r){return{Number:a,Outlet:r}};function De(a,r){if(1&a&&(e.TgZ(0,"a",32),e._uU(1),e.qZA()),2&a){const i=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,be))("queryParams",e.WLB(4,we,i.Number,i.Outlet)),e.xp6(1),e.Oqu(i.Number)}}function Ne(a,r){if(1&a&&(e.TgZ(0,"a",33),e._uU(1),e.qZA()),2&a){const i=e.oxw().$implicit,t=e.oxw(2);e.Q6J("href",t.domain+i.ID,e.LSH),e.xp6(1),e.Oqu(i.Number)}}function Ae(a,r){if(1&a){const i=e.EpF();e.TgZ(0,"a",34),e.NdJ("click",function(){e.CHM(i);const n=e.oxw().$implicit,o=e.oxw(2);return e.KtG(o.onPrintShippingLabel(n.Number,n.ShopID,n.TypeID))}),e._UZ(1,"i",35),e.qZA()}}function ye(a,r){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,De,2,7,"a",27),e.YNc(5,Ne,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,Ae,2,0,"a",31),e.qZA()()),2&a){const i=r.$implicit,t=e.oxw(2);e.xp6(2),e.Oqu(i.Outlet),e.xp6(2),e.Q6J("ngIf",t.hasGuidEmpty(i.ID)),e.xp6(1),e.Q6J("ngIf",!t.hasGuidEmpty(i.ID)),e.xp6(2),e.Oqu(i.Customer),e.xp6(2),e.Oqu(e.lcZ(10,8,i.Amount)),e.xp6(3),e.Oqu(e.xi3(13,10,i.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",i.TypeID),e.xp6(2),e.Q6J("ngIf",i.TypeID==t.channelType.ShopeeV2||i.TypeID==t.channelType.Tokopedia||i.TypeID==t.channelType.Tiktok||i.TypeID==t.channelType.Lazada)}}function Oe(a,r){if(1&a){const i=e.EpF();e.ynx(0),e.TgZ(1,"div",15)(2,"table",16),e.NdJ("matSortChange",function(n){e.CHM(i);const o=e.oxw();return e.KtG(o.onSort(n))}),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,ye,18,13,"tr",25),e.qZA()(),e.TgZ(20,"app-mat-paginator-no-count",26),e.NdJ("total",function(){e.CHM(i);const n=e.oxw();return e.KtG(n.StoreRowsCountAPIResult())})("next",function(){e.CHM(i);const n=e.oxw();return e.KtG(n.NextPage())})("previous",function(){e.CHM(i);const n=e.oxw();return e.KtG(n.PreviousPage())}),e.qZA()(),e.BQk()}if(2&a){const i=e.oxw();e.xp6(19),e.Q6J("ngForOf",i.data),e.xp6(1),e.Q6J("filter",i.filter)("totaldata",i.totaldata)("paginationTotal",i.paginationTotal)}}function Pe(a,r){1&a&&(e.TgZ(0,"div",36),e._UZ(1,"app-empty-state"),e.qZA())}let Ie=(()=>{var a;class r{constructor(t,n,o,l){this.http=t,this.localDataService=n,this.orderService=o,this.channelService=l,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.totaldata=0,this.paginationTotal=0,this.channelType=m.x}ngOnInit(){this.Load()}getChannelLogo(t){return f.g.getChannelLogoByTypeId(t)}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(t=>{this.filter.PageNumber=t.Filter.PageNumber,this.filter.PageSize=t.Filter.RowCount,this.filter.From=t.Filter.From,this.filter.To=t.Filter.To,this.channels=t.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(t){return t==f.g.GuidEMpty}Get(t){this.http.post("api/orders/GetShipped",{Number:t,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To}).subscribe(o=>{this.data=o.Data,this.sourceData=[...o.Data],this.totaldata=this.data.length})}changePage(t){this.filter.PageNumber=t.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(n=>{this.paginationTotal=n.Total})}onPrintShippingLabel(t,n,o){switch(o){case m.x.Tokopedia:this.orderService.printShippingLabelTokopedia(t);break;case m.x.Tiktok:this.orderService.printShippingLabelTiktok(t,n);break;case m.x.ShopeeV2:this.orderService.printShippingLabelShopee(t,n);break;case m.x.Lazada:this.orderService.printShippingLabelLazada(t,n)}}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}onSort(t){if(""!=t.direction){if("created"==t.active){const n="asc"==t.direction;this.data=this.data.sort((o,l)=>f.g.compare(o.Created,l.Created,n))}}else this.data=this.sourceData}}return(a=r).\u0275fac=function(t){return new(t||a)(e.Y36(w.O),e.Y36(s.T),e.Y36(M),e.Y36(c.T))},a.\u0275cmp=e.Xpm({type:a,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(t,n){if(1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(l){return n.Get(l)}),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(l){return n.filter.ListChannelID=l}),e.YNc(7,Se,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(l){return n.filter.PageNumber=l}),e.qZA()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Page Size"),e.qZA(),e.TgZ(15,"input",5),e.NdJ("ngModelChange",function(l){return n.filter.PageSize=l}),e.qZA()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"From/To"),e.qZA(),e.TgZ(19,"datepicker",6),e.NdJ("dateChange",function(l){return n.filter.From=l}),e.qZA(),e.TgZ(20,"datepicker",7),e.NdJ("dateChange",function(l){return n.filter.To=l}),e.qZA()()()(),e.TgZ(21,"content")(22,"div",8)(23,"div",9)(24,"div",10),e.YNc(25,Oe,21,4,"ng-container",11),e.YNc(26,Pe,2,0,"ng-template",null,12,e.W1O),e.qZA()()()()()),2&t){const o=e.MAs(27);e.xp6(6),e.Q6J("clearable",!0)("multiple",!0)("items",n.channels)("ngModel",n.filter.ListChannelID),e.xp6(5),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.PageSize),e.xp6(4),e.Q6J("date",n.filter.From),e.xp6(1),e.Q6J("date",n.filter.To),e.xp6(5),e.Q6J("ngIf",n.data&&n.data.length>0)("ngIfElse",o)}},dependencies:[u.sg,u.O5,p.Fj,p.wV,p.JJ,p.On,D.p,C.rH,Z.w9,Z.ir,A.n,q,U.s,x.YE,x.nU,y.Q,u.JJ,u.uU]}),r})();var Me=h(4750);function qe(a,r){if(1&a&&(e.TgZ(0,"span",13),e._UZ(1,"img",14),e.qZA(),e._uU(2)),2&a){const i=r.item;e.xp6(1),e.Q6J("src",i.img,e.LSH),e.xp6(1),e.hij(" ",i.Name," ")}}const Ue=function(){return["/menu/Order/detail"]},ke=function(a,r){return{Number:a,Outlet:r}};function Je(a,r){if(1&a&&(e.TgZ(0,"a",32),e._uU(1),e.qZA()),2&a){const i=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,Ue))("queryParams",e.WLB(4,ke,i.Number,i.Outlet)),e.xp6(1),e.Oqu(i.Number)}}function Le(a,r){if(1&a&&(e.TgZ(0,"a",33),e._uU(1),e.qZA()),2&a){const i=e.oxw().$implicit,t=e.oxw(2);e.Q6J("href",t.customerInfoUrl+i.ID,e.LSH),e.xp6(1),e.Oqu(i.Number)}}function Fe(a,r){if(1&a){const i=e.EpF();e.TgZ(0,"a",34),e.NdJ("click",function(){e.CHM(i);const n=e.oxw().$implicit,o=e.oxw(2);return e.KtG(o.onPrintShippingLabel(n.Number,n.ShopID,n.TypeID))}),e._UZ(1,"i",35),e.qZA()}}function Qe(a,r){if(1&a&&(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,Le,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,Fe,2,0,"a",31),e.qZA()()),2&a){const i=r.$implicit,t=e.oxw(2);e.xp6(2),e.Oqu(i.Outlet),e.xp6(2),e.Q6J("ngIf",t.hasGuidEmpty(i.ID)),e.xp6(1),e.Q6J("ngIf",!t.hasGuidEmpty(i.ID)),e.xp6(2),e.Oqu(i.Customer),e.xp6(2),e.Oqu(e.lcZ(10,8,i.Amount)),e.xp6(3),e.Oqu(e.xi3(13,10,i.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",i.TypeID),e.xp6(2),e.Q6J("ngIf",i.TypeID==t.channelType.ShopeeV2||i.TypeID==t.channelType.Tokopedia||i.TypeID==t.channelType.Tiktok)}}function Ee(a,r){if(1&a){const i=e.EpF();e.ynx(0),e.TgZ(1,"div",15)(2,"table",16),e.NdJ("matSortChange",function(n){e.CHM(i);const o=e.oxw();return e.KtG(o.onSort(n))}),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(i);const n=e.oxw();return e.KtG(n.StoreRowsCountAPIResult())})("next",function(){e.CHM(i);const n=e.oxw();return e.KtG(n.NextPage())})("previous",function(){e.CHM(i);const n=e.oxw();return e.KtG(n.PreviousPage())}),e.qZA()(),e.BQk()}if(2&a){const i=e.oxw();e.xp6(19),e.Q6J("ngForOf",i.data),e.xp6(1),e.Q6J("filter",i.filter)("totaldata",i.totaldata)("paginationTotal",i.paginationTotal)}}function Ye(a,r){1&a&&(e.TgZ(0,"div",36),e._UZ(1,"app-empty-state"),e.qZA())}let Ge=(()=>{var a;class r{constructor(t,n,o,l){this.http=t,this.orderService=n,this.authService=o,this.channelService=l,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.totaldata=0,this.paginationTotal=0,this.channelType=m.x}ngOnInit(){this.Load()}hasGuidEmpty(t){return t==f.g.GuidEMpty}getChannelLogo(t){return f.g.getChannelLogoByTypeId(t)}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(t=>{this.filter.PageNumber=t.Filter.PageNumber,this.filter.PageSize=t.Filter.RowCount,this.filter.From=t.Filter.From,this.filter.To=t.Filter.To,this.channels=t.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),this.customerInfoUrl=`${this.authService.getDomain()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(t){this.http.post("api/orders/GetDelivered ",{Number:t,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To}).subscribe(o=>{this.data=o.Data,this.sourceData=[...o.Data],this.totaldata=this.data.length})}changePage(t){this.filter.PageNumber=t.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(n=>{this.paginationTotal=n.Total})}onPrintShippingLabel(t,n,o){switch(o){case m.x.Tokopedia:this.orderService.printShippingLabelTokopedia(t);break;case m.x.Tiktok:this.orderService.printShippingLabelTiktok(t,n);break;case m.x.ShopeeV2:this.orderService.printShippingLabelShopee(t,n)}}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}onSort(t){if(""!=t.direction){if("created"==t.active){const n="asc"==t.direction;this.data=this.data.sort((o,l)=>f.g.compare(o.Created,l.Created,n))}}else this.data=this.sourceData}}return(a=r).\u0275fac=function(t){return new(t||a)(e.Y36(w.O),e.Y36(M),e.Y36(Me.e),e.Y36(c.T))},a.\u0275cmp=e.Xpm({type:a,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(t,n){if(1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(l){return n.Get(l)}),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(l){return n.filter.ListChannelID=l}),e.YNc(7,qe,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(l){return n.filter.PageNumber=l}),e.qZA()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Page Size"),e.qZA(),e.TgZ(15,"input",5),e.NdJ("ngModelChange",function(l){return n.filter.PageSize=l}),e.qZA()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"From/To"),e.qZA(),e.TgZ(19,"datepicker",6),e.NdJ("dateChange",function(l){return n.filter.From=l}),e.qZA(),e.TgZ(20,"datepicker",7),e.NdJ("dateChange",function(l){return n.filter.To=l}),e.qZA()()()(),e.TgZ(21,"content")(22,"div",8)(23,"div",9)(24,"div",10),e.YNc(25,Ee,21,4,"ng-container",11),e.YNc(26,Ye,2,0,"ng-template",null,12,e.W1O),e.qZA()()()()()),2&t){const o=e.MAs(27);e.Q6J("hideSearchBox",!0),e.xp6(6),e.Q6J("clearable",!0)("multiple",!0)("items",n.channels)("ngModel",n.filter.ListChannelID),e.xp6(5),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.PageSize),e.xp6(4),e.Q6J("date",n.filter.From),e.xp6(1),e.Q6J("date",n.filter.To),e.xp6(5),e.Q6J("ngIf",n.data&&n.data.length>0)("ngIfElse",o)}},dependencies:[u.sg,u.O5,p.Fj,p.wV,p.JJ,p.On,D.p,C.rH,Z.w9,Z.ir,A.n,q,U.s,x.YE,x.nU,y.Q,u.JJ,u.uU]}),r})();function He(a,r){if(1&a&&(e.TgZ(0,"span",13),e._UZ(1,"img",14),e.qZA(),e._uU(2)),2&a){const i=r.item;e.xp6(1),e.Q6J("src",i.img,e.LSH),e.xp6(1),e.hij(" ",i.Name," ")}}const Re=function(){return["/menu/Order/detail"]},$e=function(a,r){return{Number:a,Outlet:r}};function ze(a,r){if(1&a&&(e.TgZ(0,"a",30),e._uU(1),e.qZA()),2&a){const i=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,Re))("queryParams",e.WLB(4,$e,i.Number,i.Outlet)),e.xp6(1),e.Oqu(i.Number)}}function Be(a,r){if(1&a&&(e.TgZ(0,"a",31),e._uU(1),e.qZA()),2&a){const i=e.oxw().$implicit,t=e.oxw(2);e.Q6J("href",t.domain+i.ID,e.LSH),e.xp6(1),e.Oqu(i.Number)}}function Ke(a,r){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,ze,2,7,"a",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._uU(15),e.qZA(),e.TgZ(16,"td"),e._UZ(17,"app-channel-logo",29),e.qZA()()),2&a){const i=r.$implicit,t=e.oxw(2);e.xp6(2),e.Oqu(i.Outlet),e.xp6(2),e.Q6J("ngIf",t.hasGuidEmpty(i.ID)),e.xp6(1),e.Q6J("ngIf",!t.hasGuidEmpty(i.ID)),e.xp6(2),e.Oqu(i.Customer),e.xp6(2),e.Oqu(e.lcZ(10,8,i.Amount)),e.xp6(3),e.Oqu(e.xi3(13,10,i.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Oqu(i.State),e.xp6(2),e.Q6J("typeId",i.TypeID)}}function je(a,r){if(1&a){const i=e.EpF();e.ynx(0),e.TgZ(1,"div",15)(2,"table",16),e.NdJ("matSortChange",function(n){e.CHM(i);const o=e.oxw();return e.KtG(o.onSort(n))}),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,Ke,18,13,"tr",25),e.qZA()(),e.TgZ(21,"app-mat-paginator-no-count",26),e.NdJ("total",function(){e.CHM(i);const n=e.oxw();return e.KtG(n.StoreRowsCountAPIResult())})("next",function(){e.CHM(i);const n=e.oxw();return e.KtG(n.NextPage())})("previous",function(){e.CHM(i);const n=e.oxw();return e.KtG(n.PreviousPage())}),e.qZA()(),e.BQk()}if(2&a){const i=e.oxw();e.xp6(20),e.Q6J("ngForOf",i.data),e.xp6(1),e.Q6J("filter",i.filter)("totaldata",i.totaldata)("paginationTotal",i.paginationTotal)}}function Ve(a,r){1&a&&(e.TgZ(0,"div",32),e._UZ(1,"app-empty-state"),e.qZA())}let We=(()=>{var a;class r{constructor(t,n,o){this.http=t,this.localDataService=n,this.channelService=o,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.totaldata=0,this.paginationTotal=0}ngOnInit(){this.Load()}hasGuidEmpty(t){return t==f.g.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(t=>{this.filter.PageNumber=t.Filter.PageNumber,this.filter.PageSize=t.Filter.RowCount,this.filter.From=t.Filter.From,this.filter.To=t.Filter.To,this.channels=t.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(t){this.http.post("api/orders/GetAll ",{Number:t,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To}).subscribe(o=>{this.data=o.Data,this.sourceData=[...o.Data],this.totaldata=this.data.length})}changePage(t){this.filter=t,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(n=>{this.paginationTotal=n.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}onSort(t){if(""!=t.direction){if("created"==t.active){const n="asc"==t.direction;this.data=this.data.sort((o,l)=>f.g.compare(o.Created,l.Created,n))}}else this.data=this.sourceData}}return(a=r).\u0275fac=function(t){return new(t||a)(e.Y36(w.O),e.Y36(s.T),e.Y36(c.T))},a.\u0275cmp=e.Xpm({type:a,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(t,n){if(1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(l){return n.Get(l)}),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(l){return n.filter.ListChannelID=l}),e.YNc(7,He,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(l){return n.filter.PageNumber=l}),e.qZA()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Page Size"),e.qZA(),e.TgZ(15,"input",5),e.NdJ("ngModelChange",function(l){return n.filter.PageSize=l}),e.qZA()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"From/To"),e.qZA(),e.TgZ(19,"datepicker",6),e.NdJ("dateChange",function(l){return n.filter.From=l}),e.qZA(),e.TgZ(20,"datepicker",7),e.NdJ("dateChange",function(l){return n.filter.To=l}),e.qZA()()()(),e.TgZ(21,"content")(22,"div",8)(23,"div",9)(24,"div",10),e.YNc(25,je,22,4,"ng-container",11),e.YNc(26,Ve,2,0,"ng-template",null,12,e.W1O),e.qZA()()()()()),2&t){const o=e.MAs(27);e.xp6(6),e.Q6J("clearable",!0)("multiple",!0)("items",n.channels)("ngModel",n.filter.ListChannelID),e.xp6(5),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.PageSize),e.xp6(4),e.Q6J("date",n.filter.From),e.xp6(1),e.Q6J("date",n.filter.To),e.xp6(5),e.Q6J("ngIf",n.data&&n.data.length>0)("ngIfElse",o)}},dependencies:[u.sg,u.O5,p.Fj,p.wV,p.JJ,p.On,D.p,C.rH,Z.w9,Z.ir,A.n,q,U.s,x.YE,x.nU,y.Q,u.JJ,u.uU]}),r})();function Xe(a,r){if(1&a&&(e.TgZ(0,"span",14),e._UZ(1,"img",15),e.qZA(),e._uU(2)),2&a){const i=r.item;e.xp6(1),e.Q6J("src",i.img,e.LSH),e.xp6(1),e.hij(" ",i.Name," ")}}const et=function(){return["/menu/Order/detail"]},tt=function(a,r){return{Number:a,Outlet:r}};function nt(a,r){if(1&a&&(e.TgZ(0,"a",30),e._uU(1),e.qZA()),2&a){const i=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,et))("queryParams",e.WLB(4,tt,i.Number,i.Outlet)),e.xp6(1),e.Oqu(i.Number)}}function at(a,r){if(1&a&&(e.TgZ(0,"a",31),e._uU(1),e.qZA()),2&a){const i=e.oxw().$implicit,t=e.oxw(2);e.Q6J("href",t.domain+i.ID,e.LSH),e.xp6(1),e.Oqu(i.Number)}}function it(a,r){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,nt,2,7,"a",27),e.YNc(5,at,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&a){const i=r.$implicit,t=e.oxw(2);e.xp6(2),e.Oqu(i.Outlet),e.xp6(2),e.Q6J("ngIf",t.hasGuidEmpty(i.ID)),e.xp6(1),e.Q6J("ngIf",!t.hasGuidEmpty(i.ID)),e.xp6(2),e.Oqu(i.Customer),e.xp6(2),e.Oqu(e.lcZ(10,7,i.Amount)),e.xp6(3),e.Oqu(e.xi3(13,9,i.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",i.TypeID)}}function ot(a,r){if(1&a){const i=e.EpF();e.ynx(0),e.TgZ(1,"div",16)(2,"table",17),e.NdJ("matSortChange",function(n){e.CHM(i);const o=e.oxw();return e.KtG(o.onSort(n))}),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,it,16,12,"tr",25),e.qZA()(),e.TgZ(19,"app-mat-paginator-no-count",26),e.NdJ("total",function(){e.CHM(i);const n=e.oxw();return e.KtG(n.StoreRowsCountAPIResult())})("next",function(){e.CHM(i);const n=e.oxw();return e.KtG(n.NextPage())})("previous",function(){e.CHM(i);const n=e.oxw();return e.KtG(n.PreviousPage())}),e.qZA()(),e.BQk()}if(2&a){const i=e.oxw();e.xp6(18),e.Q6J("ngForOf",i.data),e.xp6(1),e.Q6J("filter",i.filter)("totaldata",i.totaldata)("paginationTotal",i.paginationTotal)}}function rt(a,r){1&a&&(e.TgZ(0,"div",32),e._UZ(1,"app-empty-state"),e.qZA())}let lt=(()=>{var a;class r{constructor(t,n,o){this.http=t,this.localDataService=n,this.channelService=o,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],Note:"",From:null,To:null},this.totaldata=0,this.paginationTotal=0}ngOnInit(){this.Load()}hasGuidEmpty(t){return t==f.g.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(t=>{this.filter.PageNumber=t.Filter.PageNumber,this.filter.PageSize=t.Filter.RowCount,this.filter.From=t.Filter.From,this.filter.To=t.Filter.To,this.channels=t.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(t){this.http.post("api/orders/GetCancelled ",{Number:t,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(o=>{this.data=o.Data,this.sourceData=[...o.Data],this.totaldata=this.data.length})}changePage(t){this.filter.PageNumber=t.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(n=>{this.paginationTotal=n.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}getChannelLogo(t){return f.g.getChannelLogoByTypeId(t)}onSort(t){if(""!=t.direction){if("created"==t.active){const n="asc"==t.direction;this.data=this.data.sort((o,l)=>f.g.compare(o.Created,l.Created,n))}}else this.data=this.sourceData}}return(a=r).\u0275fac=function(t){return new(t||a)(e.Y36(w.O),e.Y36(s.T),e.Y36(c.T))},a.\u0275cmp=e.Xpm({type:a,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(t,n){if(1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(l){return n.Get(l)}),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(l){return n.filter.ListChannelID=l}),e.YNc(7,Xe,3,2,"ng-template",3),e.qZA()(),e.TgZ(8,"div")(9,"h6"),e._uU(10,"Page Number"),e.qZA(),e.TgZ(11,"input",4),e.NdJ("ngModelChange",function(l){return n.filter.PageNumber=l}),e.qZA()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Page Size"),e.qZA(),e.TgZ(15,"input",5),e.NdJ("ngModelChange",function(l){return n.filter.PageSize=l}),e.qZA()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"Note"),e.qZA(),e.TgZ(19,"input",6),e.NdJ("ngModelChange",function(l){return n.filter.Note=l}),e.qZA()(),e.TgZ(20,"div")(21,"h6"),e._uU(22,"From/To"),e.qZA(),e.TgZ(23,"datepicker",7),e.NdJ("dateChange",function(l){return n.filter.From=l}),e.qZA(),e.TgZ(24,"datepicker",8),e.NdJ("dateChange",function(l){return n.filter.To=l}),e.qZA()()()(),e.TgZ(25,"content")(26,"div",9)(27,"div",10)(28,"div",11),e.YNc(29,ot,20,4,"ng-container",12),e.YNc(30,rt,2,0,"ng-template",null,13,e.W1O),e.qZA()()()()()),2&t){const o=e.MAs(31);e.xp6(6),e.Q6J("clearable",!0)("multiple",!0)("items",n.channels)("ngModel",n.filter.ListChannelID),e.xp6(5),e.Q6J("ngModel",n.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",n.filter.PageSize),e.xp6(4),e.Q6J("ngModel",n.filter.Note),e.xp6(4),e.Q6J("date",n.filter.From),e.xp6(1),e.Q6J("date",n.filter.To),e.xp6(5),e.Q6J("ngIf",n.data&&n.data.length>0)("ngIfElse",o)}},dependencies:[u.sg,u.O5,p.Fj,p.wV,p.JJ,p.On,D.p,C.rH,Z.w9,Z.ir,A.n,q,U.s,x.YE,x.nU,y.Q,u.JJ,u.uU]}),r})();var st=h(1657),L=function(a){return a[a.DoNothing=0]="DoNothing",a[a.New=1]="New",a[a.Update=2]="Update",a}(L||{}),pt=h(5993),F=h(8034),Q=h(8257),z=h(2596);function ct(a,r){if(1&a){const i=e.EpF();e.ynx(0),e.TgZ(1,"div",28)(2,"button",29),e.NdJ("click",function(){e.CHM(i),e.oxw();const n=e.MAs(11);return e.KtG(n.previous())}),e._uU(3," Back "),e.qZA(),e.TgZ(4,"button",30),e.NdJ("click",function(){e.CHM(i);const n=e.oxw(),o=e.MAs(11);return e.KtG(n.onNext(o))}),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(i);const n=e.oxw();return e.KtG(n.exportOrders())}),e._uU(11," Export "),e.qZA()()()(),e.BQk()}if(2&a){const i=e.oxw();e.xp6(4),e.Q6J("disabled",i.checkDisabledNextFilter())}}function dt(a,r){if(1&a){const i=e.EpF();e.TgZ(0,"button",36),e.NdJ("click",function(){e.CHM(i);const n=e.oxw(),o=e.MAs(11);return e.KtG(n.onNext(o))}),e._uU(1," Next "),e.qZA()}if(2&a){const i=e.oxw();e.Q6J("disabled",i.checkDisabledNextFilter())}}function ht(a,r){if(1&a){const i=e.EpF();e.TgZ(0,"button",37),e.NdJ("click",function(){e.CHM(i);const n=e.oxw(),o=e.MAs(11);return e.KtG(n.onNew(o))}),e._UZ(1,"i",38),e._uU(2," New "),e.qZA()}}function ut(a,r){1&a&&e._uU(0,"Filter")}function gt(a,r){if(1&a&&(e.TgZ(0,"ng-option",39),e._UZ(1,"img",40),e._uU(2),e.qZA()),2&a){const i=r.$implicit;e.Q6J("value",i.ID),e.xp6(1),e.s9C("src",i.Img,e.LSH),e.xp6(1),e.hij("",i.Name," ")}}function _t(a,r){1&a&&e._uU(0,"Preview")}function mt(a,r){if(1&a&&(e.TgZ(0,"th",58),e._uU(1),e.qZA()),2&a){const i=e.oxw(2);e.xp6(1),e.Oqu(0==i.getTypeID()?"Last Status Update":"Created Date")}}function ft(a,r){if(1&a&&(e.TgZ(0,"td"),e._uU(1),e.ALo(2,"date"),e.qZA()),2&a){const i=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.xi3(2,1,i.Date,"dd MMM yyyy HH:mm:ss"),"")}}function Tt(a,r){if(1&a&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&a){const i=e.oxw().$implicit;e.xp6(1),e.hij(" ",i.ActionString," ")}}function Ct(a,r){if(1&a&&(e.TgZ(0,"li"),e._uU(1),e.qZA()),2&a){const i=r.$implicit;e.xp6(1),e.hij("",i," ")}}function Zt(a,r){if(1&a&&(e.TgZ(0,"ul",63),e.YNc(1,Ct,2,1,"li",59),e.qZA()),2&a){const i=e.oxw().$implicit;e.xp6(1),e.Q6J("ngForOf",i.ActionString)}}function xt(a,r){if(1&a&&(e.TgZ(0,"span",64),e._UZ(1,"i",65),e.qZA()),2&a){const i=e.oxw().$implicit;e.hYB("title","Delivery : ",i.DeliveryState," \nPayment : ",i.PaymentState,"")}}const vt=function(a,r){return{"over-due-today":a,"over-due":r}};function St(a,r){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.YNc(5,ft,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,Tt,2,1,"span",1),e.YNc(16,Zt,2,1,"ul",61),e.qZA(),e.TgZ(17,"td"),e.YNc(18,xt,2,2,"span",62),e.qZA()()),2&a){const i=r.$implicit,t=r.index,n=e.oxw(3);e.xp6(2),e.Oqu(t+1),e.xp6(2),e.Oqu(i.Number),e.xp6(1),e.Q6J("ngIf",n.getTypeID()!=n.channelType.ShopeeV2),e.xp6(3),e.hij("",i.ChannelStatus," - "),e.xp6(1),e.Oqu(i.ChannelStatusDescription),e.xp6(1),e.Q6J("ngClass",e.WLB(12,vt,(null==i?null:i.Action)==n.actionPreviewOrder.Update,(null==i?null:i.Action)==n.actionPreviewOrder.New))("matTooltip",91==i.POSStatus||"Conflict"==i.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("",i.POSStatus," - "),e.xp6(1),e.hij("",i.POSStatusDescription," "),e.xp6(2),e.Q6J("ngIf",1==i.ActionString.length),e.xp6(1),e.Q6J("ngIf",i.ActionString.length>1),e.xp6(2),e.Q6J("ngIf",99!=i.ChannelStatus&&99!=i.POSStatus)}}function bt(a,r){if(1&a&&(e.ynx(0),e.YNc(1,St,19,15,"tr",59),e.BQk()),2&a){const i=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",i.displayedPreviewData)}}function wt(a,r){1&a&&(e.TgZ(0,"tr",66)(1,"td",67)(2,"div",68),e._UZ(3,"i",69),e.qZA(),e.TgZ(4,"h4",70),e._uU(5,"There is no order to processed"),e.qZA()()())}function Dt(a,r){if(1&a){const i=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(i);const n=e.oxw();return e.KtG(n.filterPreviewData(n.previewStatus.ALL))}),e._uU(6),e.qZA()(),e.TgZ(7,"li",45)(8,"button",47),e.NdJ("click",function(){e.CHM(i);const n=e.oxw();return e.KtG(n.filterPreviewData(n.previewStatus.SYNC))}),e._uU(9),e.qZA()(),e.TgZ(10,"li",45)(11,"button",48),e.NdJ("click",function(){e.CHM(i);const n=e.oxw();return e.KtG(n.filterPreviewData(n.previewStatus.WRONG))}),e._uU(12),e.qZA()(),e.TgZ(13,"li",45)(14,"button",49),e.NdJ("click",function(){e.CHM(i);const n=e.oxw();return e.KtG(n.filterPreviewData(n.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,mt,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,bt,2,1,"ng-container",56),e.YNc(32,wt,6,0,"ng-template",null,57,e.W1O),e.qZA()()()()}if(2&a){const i=e.MAs(33),t=e.oxw();e.xp6(5),e.Q6J("ngClass","all"==t.pillStatus?"btn-secondary text-white":"btn-outline-dark"),e.xp6(1),e.hij("All (",t.allData,")"),e.xp6(2),e.Q6J("ngClass","sync"==t.pillStatus?"btn-success":"btn-outline-success"),e.xp6(1),e.hij("Existing (",t.syncData,")"),e.xp6(2),e.Q6J("ngClass","wrong"==t.pillStatus?"btn-warning text-white":"btn-outline-warning"),e.xp6(1),e.hij("Wrong Status (",t.wrongData,")"),e.xp6(2),e.Q6J("ngClass","unsync"==t.pillStatus?"btn-danger":"btn-outline-danger"),e.xp6(1),e.hij("Missing (",t.unsyncData,")"),e.xp6(7),e.Q6J("ngIf",t.getTypeID()!=t.channelType.ShopeeV2),e.xp6(9),e.Q6J("ngIf",t.displayedPreviewData.length>0)("ngIfElse",i)}}function Nt(a,r){1&a&&e._uU(0,"Finish")}const At=function(a){return{"over-due":a}};function yt(a,r){if(1&a&&(e.TgZ(0,"tr",73)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.TgZ(5,"td"),e._uU(6),e.qZA(),e.TgZ(7,"td"),e._uU(8),e.qZA()()),2&a){const i=r.$implicit,t=r.index;e.Q6J("ngClass",e.VKq(5,At,i.Exception)),e.xp6(2),e.Oqu(t+1),e.xp6(2),e.Oqu(i.Number),e.xp6(2),e.Oqu(i.Status),e.xp6(2),e.Oqu(i.Exception)}}function Ot(a,r){if(1&a&&(e.ynx(0),e.YNc(1,yt,9,7,"tr",72),e.BQk()),2&a){const i=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",i.downloadData)}}function Pt(a,r){1&a&&(e.TgZ(0,"tr",66)(1,"td",67)(2,"div",68),e._UZ(3,"i",69),e.qZA(),e.TgZ(4,"h4",70),e._uU(5,"There is no order to processed"),e.qZA()()())}function It(a,r){if(1&a&&(e.TgZ(0,"div",41)(1,"div",42)(2,"table",50)(3,"thead",51)(4,"tr"),e._UZ(5,"th",52),e.TgZ(6,"th"),e._uU(7,"Order Number"),e.qZA(),e.TgZ(8,"th"),e._uU(9,"Status"),e.qZA(),e.TgZ(10,"th"),e._uU(11,"Exception"),e.qZA()()(),e.TgZ(12,"tbody"),e.YNc(13,Ot,2,1,"ng-container",56),e.YNc(14,Pt,6,0,"ng-template",null,71,e.W1O),e.qZA()()()()),2&a){const i=e.MAs(15),t=e.oxw();e.xp6(13),e.Q6J("ngIf",(null==t.downloadData?null:t.downloadData.length)>0)("ngIfElse",i)}}function Mt(a,r){1&a&&e._UZ(0,"i",74)}function qt(a,r){1&a&&e._UZ(0,"i",75)}function Ut(a,r){1&a&&e._UZ(0,"i",76)}var v=function(a){return a.ALL="all",a.SYNC="sync",a.WRONG="wrong",a.UNSYNC="unsync",a}(v||{});let kt=(()=>{var a;class r{constructor(t,n,o,l,_,O){this.http=t,this.toastr=n,this.datePipe=o,this.url=l,this.productService=_,this.orderService=O,this.pageTitle="Download to POS",this.pillStatus="all",this.displayedPreviewData=[],this.previewData=[],this.channelType=m.x,this.previewStatus=v,this.currentState="filter",this.wrongData=0,this.unsyncData=0,this.syncData=0,this.allData=0,this.actionPreviewOrder=L}ngOnInit(){this.initPageLoader(),this.url.queryParams.subscribe(t=>{this.channelID=t.ChannelID,this.startDate=new Date(t.Date),this.endDate=new Date(t.Date)})}initPageLoader(){this.productService.loader().subscribe(t=>{this.channelOptions=t.Options.Channel})}onDownload(t){this.http.post("/api/Orders/Download",{ID:this.channelID,From:this.startDate,To:this.endDate,ListPreview:this.downloadedPreviewData}).subscribe(o=>{this.downloadData=o.Body,this.onStepperNext(t)})}onPreview(t){this.validateDatePreview()&&this.http.post("/api/Orders/Preview",{ID:this.channelID,From:this.startDate,To:this.endDate}).subscribe(o=>{0!=o.length?(this.previewData=o,this.groupingPreviewData(),this.filterPreviewData(v.ALL),this.initLengthStatusData(),this.onStepperNext(t)):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 t=!0;return f.g.getDaysDiff(this.startDate,this.endDate)>14&&(this.toastr.warning("Dates cannot be more than 14 days apart!","Failed"),t=!1),t}setPageTitle(t){this.pageTitle=`\n ${t} (${this.getDateTitle()})\n `}getDateTitle(){const t=f.g.formatTitleFromDate(new Date(this.startDate),new Date(this.endDate)),n=this.datePipe.transform(this.startDate,t);return`${null==t?"":n+"-"} ${this.datePipe.transform(this.endDate,"dd MMM yyyy")}`}onNew(t){this.channelID=null,this.startDate=null,this.endDate=null,this.pageTitle="Download to POS",t.reset()}groupingPreviewData(){let t=this.filterDataByStatus(v.UNSYNC),n=this.filterDataByStatus(v.WRONG);this.downloadedPreviewData=[...t,...n]}filterDataByStatus(t){let n=[];switch(t){case v.ALL:n=this.previewData;break;case v.SYNC:n=this.previewData.filter(o=>o.Action==L.DoNothing);break;case v.WRONG:n=this.previewData.filter(o=>o.Action==L.Update);break;case v.UNSYNC:n=this.previewData.filter(o=>o.Action==L.New)}return n}filterPreviewData(t){this.pillStatus=t,this.displayedPreviewData=this.filterDataByStatus(t)}initLengthStatusData(){this.wrongData=this.filterDataByStatus(v.WRONG).length,this.allData=this.previewData.length,this.syncData=this.filterDataByStatus(v.SYNC).length,this.unsyncData=this.filterDataByStatus(v.UNSYNC).length}getTypeID(){var t=this.channelOptions.find(n=>n.ID==this.channelID)?.TypeID;return t??0}onStepperChange(t){this.currentState=t.selectedStep.state}onStepperNext(t){t.selected.completed=!0,t.next()}onNext(t){switch(this.currentState){case"filter":this.onPreview(t);break;case"preview":this.onDownload(t)}}stepChange(t){switch(t?.selectedStep?.state){case"filter":this.pageTitle="Download To POS",this.resetPreviewData();break;case"preview":let n=this.productService.findChannelById(this.channelID,this.channelOptions);this.setPageTitle(`Preview ${n?.Name}`);break;case"finish":this.setPageTitle("Download")}}resetPreviewData(){this.displayedPreviewData=[],this.previewData=[],this.initLengthStatusData()}checkDisabledNextFilter(){let t=!f.g.isValidDate(this.startDate)||!f.g.isValidDate(this.endDate),n=f.g.IsEmpty(this.channelID);return t||n}exportOrders(){let t={ID:this.channelID,From:this.startDate,To:this.endDate};const n=`Orders ${this.getDateTitle()}`;this.orderService.exportOrders(t,n).subscribe()}}return(a=r).\u0275fac=function(t){return new(t||a)(e.Y36(w.O),e.Y36(G._W),e.Y36(u.uU),e.Y36(C.gz),e.Y36(pt.M),e.Y36(M))},a.\u0275cmp=e.Xpm({type:a,selectors:[["app-download"]],features:[e._Bn([{provide:st.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(t,n){if(1&t){const o=e.EpF();e.TgZ(0,"mainpanel",0)(1,"actions"),e.YNc(2,ct,12,1,"ng-container",1),e.YNc(3,dt,2,1,"button",2),e.YNc(4,ht,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(_){return n.stepChange(_)})("selectionChange",function(_){return n.onStepperChange(_)}),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(_){return n.channelID=_}),e.YNc(24,gt,3,3,"ng-option",16),e.qZA()()(),e.TgZ(25,"div",17)(26,"div",13)(27,"h5"),e._uU(28,"Date Range"),e.qZA(),e.TgZ(29,"p",14),e._uU(30,"Select transaction date of the channel you want to download (Max 2 Weeks)"),e.qZA()(),e.TgZ(31,"div",13)(32,"div",6)(33,"mat-date-range-input",18)(34,"input",19),e.NdJ("ngModelChange",function(_){return n.startDate=_})("click",function(){e.CHM(o);const _=e.MAs(37);return e.KtG(_.open())}),e.qZA(),e.TgZ(35,"input",20),e.NdJ("ngModelChange",function(_){return n.endDate=_})("click",function(){e.CHM(o);const _=e.MAs(37);return e.KtG(_.open())}),e.qZA()(),e._UZ(36,"mat-date-range-picker",null,21),e.qZA()()()()()(),e.TgZ(38,"mat-step",22),e.YNc(39,_t,1,0,"ng-template",11),e.YNc(40,Dt,34,11,"div",23),e.qZA(),e.TgZ(41,"mat-step",24),e.YNc(42,Nt,1,0,"ng-template",11),e.YNc(43,It,16,2,"div",23),e.qZA(),e.YNc(44,Mt,1,0,"ng-template",25),e.YNc(45,qt,1,0,"ng-template",26),e.YNc(46,Ut,1,0,"ng-template",27),e.qZA()()()()()()()}if(2&t){const o=e.MAs(11),l=e.MAs(37);e.Q6J("headerTitle",n.pageTitle)("description",n.pageTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),e.xp6(2),e.Q6J("ngIf","preview"==n.currentState),e.xp6(1),e.Q6J("ngIf","filter"==n.currentState),e.xp6(1),e.Q6J("ngIf","finish"==n.currentState),e.xp6(6),e.s9C("ngClass","last-edited-step-"+o.selectedIndex),e.xp6(2),e.Q6J("editable","finish"!=n.currentState)("completed",!1),e.xp6(11),e.Q6J("clearable",!1)("ngModel",n.channelID),e.xp6(1),e.Q6J("ngForOf",n.channelOptions),e.xp6(9),e.Q6J("rangePicker",l),e.xp6(1),e.Q6J("ngModel",n.startDate),e.xp6(1),e.Q6J("ngModel",n.endDate),e.xp6(3),e.Q6J("editable","finish"!=n.currentState)("completed",!1),e.xp6(2),e.Q6J("ngIf","preview"==n.currentState),e.xp6(3),e.Q6J("ngIf","finish"==n.currentState)}},dependencies:[u.mk,u.sg,u.O5,p.Fj,p.JJ,p.On,D.p,Z.w9,Z.jq,F.wx,F.zY,F.By,F._g,Q.C0,Q.VY,Q.Vq,Q.z9,z.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}"]}),r})();var N=h(4575);const Jt=[{path:"",component:H,children:[{path:"",redirectTo:"new",pathMatch:"full"},{path:"new",component:se,canActivate:[N.a],data:{title:"New Order"}},{path:"detail",component:he,canActivate:[N.a],data:{title:"Orders detail"}},{path:"ready_to_ship",component:ve,canActivate:[N.a],data:{title:"Ready To Ship"}},{path:"Shipped",component:Ie,canActivate:[N.a],data:{title:"Shipped"}},{path:"Delivered",component:Ge,canActivate:[N.a],data:{title:"Delivered"}},{path:"All",component:We,canActivate:[N.a],data:{title:"All Order"}},{path:"Cancelled",component:lt,canActivate:[N.a],data:{title:"Cancelled"}},{path:"Download",component:kt,canActivate:[N.a],data:{title:"Download"}}]}];let Lt=(()=>{var a;class r{}return(a=r).\u0275fac=function(t){return new(t||a)},a.\u0275mod=e.oAB({type:a}),a.\u0275inj=e.cJS({imports:[u.ez,C.Bz.forChild(Jt)]}),r})();var Ft=h(1476),Qt=h(3680),Et=h(7738),Yt=h(8525),Gt=h(7801);let Ht=(()=>{var a;class r{}return(a=r).\u0275fac=function(t){return new(t||a)},a.\u0275mod=e.oAB({type:a}),a.\u0275inj=e.cJS({providers:[M,$],imports:[u.ez,p.u5,Lt,P.Z,D.R,Ft.TU,C.Bz,Z.A0,F.FA,Qt.XK,A.n,Q.T5,z.AV,Et.f,g.p9,d.Is,Yt.LD,x.JX,Gt.P,y.Q]}),r})()},5993:(B,E,h)=>{h.d(E,{M:()=>Y});var u=h(9397),C=h(6306),k=h(8504),e=h(5802),P=h(5879),H=h(9659),f=h(9229);let Y=(()=>{var S;class I{constructor(s,c){this.httpService=s,this.toastrService=c}loader(s=e.g.GuidEMpty){return this.httpService.post("/api/product/Load",{ID:s})}LoadInPOS(s=e.g.GuidEMpty){return this.httpService.post("/api/product/LoadInPOS",{ID:s})}filterChannelByTypeId(s,c){return s.filter(d=>-1!==c.findIndex(p=>d.TypeID==p))}getProductStatistic(){return this.httpService.post("/api/product/ProductStatistic",{})}getTotalProductLive(s){return this.httpService.post("/api/product/TotalProductLive",{ID:s})}clearCacheChannel(s){return this.httpService.post("/api/Channel/ClearCacheChannel",{ID:s})}uploadSingleProduct(s,c){return this.httpService.post("api/product/UploadMultipleChannel",{Channel:c,Products:s}).pipe((0,u.b)(p=>{this.showToastrSuccessUploadSingle(p,s[0])}),(0,C.K)(p=>(this.showToastErrorUploadSingle(p,s[0]),(0,k._)(()=>new Error(p)))))}uploadMultipleProduct(s,c){return this.httpService.post("api/product/UploadMultipleProductAndMultipleChannel",{Channel:c,Products:s}).pipe((0,u.b)(p=>{this.showToastrUploadMultiple(p.Message)}),(0,C.K)(p=>(this.showToastrUploadMultiple(p.error?.Message),(0,k._)(()=>new Error(p)))))}uploadNotInChannel(s,c){return this.httpService.post("/api/product/UploadProductNotInChannelToChannel",{Products:s,Channel:c}).pipe((0,u.b)(p=>{this.showToastrUploadMultiple(p)}),(0,C.K)(p=>(this.showToastrUploadMultiple(p.error?.Message),(0,k._)(()=>new Error(p)))))}scanSingle(s,c){return this.httpService.post("/api/product/ScanSingle",{ID:s,SKU:c})}scanNotInChannel(s){return this.httpService.post("/api/product/ScanNotinChannel",{ID:s})}findAllSoldInChannel(s){return this.httpService.post("/api/product/GetSoldInChannel",s)}scanAll(s,c,d,p=!1){return this.httpService.post("/api/product/ScanOptimized",{ID:s,ScanFull:c,UpdatedProduct:d,Async:p})}scanCompareToPos(s){return this.httpService.post("/api/product/CompareMarketplaceToPOS",s)}getVariantCodesProduct(s){return s.Variants.map(d=>d.Code)}downloadMultipleProduct(s){let c=s.map(d=>({ChannelItemID:d.ChannelItemID,ChannelID:d.ChannelID}));return this.httpService.post("/api/product/DownloadMultipleProductFromChannel",c).pipe((0,u.b)(d=>{this.toastrService.success(`${d.Count} products downloaded to POS`,"Download Complete")}))}downloadProduct(s){return this.httpService.post("/api/product/DownloadProductFromChannel",{ChannelItemID:s.ChannelItemID,ChannelID:s.ChannelID}).pipe((0,u.b)(()=>{this.toastrService.success("Product successfully downloaded to POS","Download Complete")}))}getVariantCodesProducts(s=[]){let c=[];return s.forEach(d=>{d.Variants.forEach(p=>{c=[...c,p.Code]})}),c}filterUnselectedChannel(s,c){let p,d=[];if(s.forEach(g=>{d=[...d,...g.Channel]}),d&&0!=d.length){let g=[];p=c.filter(T=>(g=d.filter(J=>J.ChannelID==T.ID),g.length!==s.length))}else p=c;return p}findChannelById(s,c){return c.find(d=>d.ID==s)}sortChannel(s=[]){return s.sort((c,d)=>c.TypeID<d.TypeID?1:c.TypeID===d.TypeID?0:-1)}hasSelection(s=[]){return this.selectedProduct(s).length>0}selectedProduct(s=[]){return s.filter(c=>c.selected)}hasSelectionVariant(s){return this.selectedVariantProduct(s).length>0}selectedVariantProduct(s){let c=[];return s.forEach(d=>{c=[...c,...null!=d.Variants?d.Variants.filter(p=>p.selected):""]}),c}getChannelProduct(s){const c=s.Variants;let d=[];for(let p of c)if(null!=p.Channel)for(let g of p.Channel)0==d.filter(T=>T.ChannelID==g.ChannelID).length&&d.push(g);return this.sortChannel(d)}successToastrScanAllProduct(s,c,d){if(d){const p=s?.NotInPOS?.Product?s?.NotInPOS?.Product:0,g=s?.InChannel?.Product?s?.InChannel?.Product:0;this.toastrService.success(`\n ${p+g} found in ${c.Name} </br>\n (${g} In POS + ${p} Not In Pos)\n `,"Scan Complete!",{enableHtml:!0})}else this.toastrService.success(`${s.InChannel?s.InChannel.Product:0} product updates in ${c.Name} </br> \n since ${s.LastUpdate}`,"Scan Complete!",{enableHtml:!0})}checkProductHasScanButton(s,c){let d;return s.map(p=>(p.Channel=this.getChannelProduct(p),d=this.filterUnselectedChannel([p],c),p.hasScan=d.length>0,p))}checkProductHasUploadBtn(s,c){let d;return s.map(p=>(p.Channel=this.getChannelProduct(p),d=this.filterUnselectedChannel([p],c),p.hasUpload=d.length>0,p))}showToastrUploadMultiple(s=[]){let c=[],d=[];const p=this.getResponseList(s);if(s.forEach(g=>{"string"==typeof g?.Response?d=[...d,p.length>1?this.setHtmlli(g.Response):this.setHtmlli(g.Response,!1)]:(g?.Response?.Success.forEach(T=>{c=[...c,p.length>1?this.setHtmlli(`Product ${T} was <b>successfully</b> uploaded to ${g.Name}`):this.setHtmlli(`Product ${T} was <b>successfully</b> uploaded to ${g.Name}`,!1)]}),g?.Response.Fail.forEach(T=>{d=[...d,p.length>1?this.setHtmlli(T):this.setHtmlli(T,!1)]}))}),d.length>0&&c.length>0){const g=[...c,...d];this.toastrService.warning(this.concatMessage(g),"Warning!",{enableHtml:!0})}else c.length>0&&0==d.length?this.toastrService.success(this.concatMessage(c),"Success",{enableHtml:!0}):this.toastrService.error(this.concatMessage(d),"Error",{enableHtml:!0})}setHtmlli(s,c=!0){return c?`<li>${s}</li>`:s}getResponseList(s){let c=[];return s.forEach(d=>{"string"==typeof d?.Response?c=[...c,d.Response]:(d?.Response?.Success.forEach(p=>{c=[...c,d.Name]}),d?.Response.Fail.forEach(p=>{c=[...c,p]}))}),c}concatMessage(s=[]){let c="";return s.forEach(d=>{c+=d}),s.length>1?`<ol>${c}</ol>`:c}showToastrSuccessUploadSingle(s,c){let d=s.filter(T=>0==T.Status),p=s.filter(T=>1==T.Status),g=this.generateToastrMessage(d,p,c);this.toastrService.success(g.message,"Success",{enableHtml:!0})}showToastErrorUploadSingle(s,c){let d=s?.error?.Message.filter(T=>0==T.Status),p=s?.error?.Message.filter(T=>1==T.Status),g=this.generateToastrMessage(d,p,c);"WARNING"==g.status?this.toastrService.warning(g.message,"Warning!",{enableHtml:!0}):this.toastrService.error(g.message,`Error - ${s.status}`,{enableHtml:!0})}generateToastrMessage(s,c,d){let g,p="",T=[...s,...c];return 0==s.length&&c.length>0?(g="SUCCESS",p=this.createSuccessResponse(c,d)):s.length>0&&0==c.length?(g="ERROR",p=this.createErrResponse(s,d)):(g="WARNING",p=`${this.createSuccessResponse(c,d)} ${this.createErrResponse(s,d)}`),T.length>1&&(p=`<ol>${p}</ol>`),{status:g,message:p}}createErrResponse(s,c){let d="";return s.length>1?s.forEach((p,g)=>{d+=`<li>${p.Response}</li>`}):1==s.length&&(d+=`${s[0].Response}`),d}createSuccessResponse(s,c){let d="";return s.length>1?s.forEach((p,g)=>{d+=`<li>Product ${c.Name} was <b>successfully</b> uploaded to ${p.Name}</li>`}):1==s.length&&(d+=`Product ${c.Name} was <b>successfully</b> uploaded to ${s[0].Name}`),d}getHostName(){if(e.g.IsEmpty(this.hostName)){const s=localStorage.getItem("Authorization");this.hostName=JSON.parse(s)?.Host}return this.hostName}}return(S=I).\u0275fac=function(s){return new(s||S)(P.LFG(H.O),P.LFG(f._W))},S.\u0275prov=P.Yz7({token:S,factory:S.\u0275fac,providedIn:"root"}),I})()}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[699],{9699:(w,v,p)=>{p.r(v),p.d(v,{DownloadModule:()=>Y});var d=p(6814),t=p(5879),_=p(6027),g=p(9790);const o=function(n){return[n]};function T(n,a){if(1&n&&(t.ynx(0),t.TgZ(1,"a",9),t._uU(2),t.qZA(),t.BQk()),2&n){const r=a.$implicit;t.xp6(1),t.Q6J("routerLink",t.VKq(2,o,r.url)),t.xp6(1),t.hij(" ",r.title,"")}}let C=(()=>{var n;class a{constructor(){this.tabs=[{Title:"Download By Url",Url:"/menu/products/download/by-url",Description:"Download products information by product URL as a parameter"}],this.moreMenu=[{title:"Sold In Channel",url:"/menu/products/status/sold-in-channel"},{title:"In POS",url:"/menu/products/status/in-pos"},{title:"Not In Channel",url:"/menu/products/status/not-in-channel"},{title:"Duplicate SKU",url:"/menu/products/status/duplicate-sku"}]}}return(n=a).\u0275fac=function(e){return new(e||n)},n.\u0275cmp=t.Xpm({type:n,selectors:[["app-download"]],decls:12,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-block"],[4,"ngFor","ngForOf"],[1,"dropdown-item",3,"routerLink"]],template:function(e,i){1&e&&(t.TgZ(0,"nav",0)(1,"div",1)(2,"div"),t._UZ(3,"nav-tab",2),t.qZA()(),t.TgZ(4,"div")(5,"div",3)(6,"a",4),t._UZ(7,"i",5),t.qZA(),t.TgZ(8,"div",6)(9,"div",7),t.YNc(10,T,3,4,"ng-container",8),t.qZA()()()()(),t._UZ(11,"router-outlet")),2&e&&(t.xp6(3),t.Q6J("Tabs",i.tabs),t.xp6(7),t.Q6J("ngForOf",i.moreMenu))},dependencies:[d.sg,_.e,g.lC,g.rH]}),a})();var b=p(1657),x=p(9659);let h=(()=>{var n;class a{constructor(e){this.httpService=e}download(e){return this.httpService.post("/api/Product/downloadurl",e)}}return(n=a).\u0275fac=function(e){return new(e||n)(t.LFG(x.O))},n.\u0275prov=t.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"}),a})();var y=p(4750),f=p(6223),s=p(4387),c=p(8257);function l(n,a){if(1&n&&(t.TgZ(0,"th"),t._uU(1),t.qZA()),2&n){const r=a.$implicit;t.xp6(1),t.Oqu(r.column)}}function m(n,a){if(1&n&&(t.ynx(0),t.TgZ(1,"td"),t._UZ(2,"span",6),t.qZA(),t.BQk()),2&n){const r=a.$implicit,e=t.oxw().$implicit;t.xp6(2),t.Q6J("innerHTML",e[r.prop],t.oJD)}}const U=function(n){return{"background-color":n}};function Z(n,a){if(1&n&&(t.TgZ(0,"tr",5),t.YNc(1,m,3,1,"ng-container",3),t.qZA()),2&n){const r=a.$implicit,e=t.oxw();t.Q6J("ngStyle",t.VKq(2,U,r.Status>200?"#F4D6D5":"#DEE9C9")),t.xp6(1),t.Q6J("ngForOf",e.configs)}}let D=(()=>{var n;class a{constructor(){this.eventClose=new t.vpe}ngOnInit(){}onClose(){this.eventClose.emit()}}return(n=a).\u0275fac=function(e){return new(e||n)},n.\u0275cmp=t.Xpm({type:n,selectors:[["app-response-api-list"]],inputs:{configs:"configs",data:"data",status:"status"},outputs:{eventClose:"onClose"},decls:7,vars:2,consts:[[1,"table-responsive"],[1,"table"],[1,"thead-light"],[4,"ngFor","ngForOf"],[3,"ngStyle",4,"ngFor","ngForOf"],[3,"ngStyle"],[3,"innerHTML"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"table",1)(2,"thead",2)(3,"tr"),t.YNc(4,l,2,1,"th",3),t.qZA()(),t.TgZ(5,"tbody"),t.YNc(6,Z,2,4,"tr",4),t.qZA()()()),2&e&&(t.xp6(4),t.Q6J("ngForOf",i.configs),t.xp6(2),t.Q6J("ngForOf",i.data))},dependencies:[d.sg,d.PC]}),a})();function S(n,a){if(1&n){const r=t.EpF();t.ynx(0),t.TgZ(1,"button",23),t.NdJ("click",function(){t.CHM(r);const i=t.oxw(),u=t.MAs(11);return t.KtG(i.onNewStepperState(u))}),t._UZ(2,"i",24),t._uU(3," New "),t.qZA(),t.BQk()}}function A(n,a){if(1&n){const r=t.EpF();t.ynx(0),t.TgZ(1,"button",23),t.NdJ("click",function(){t.CHM(r),t.oxw();const i=t.MAs(11);return t.KtG(i.previous())}),t._uU(2," Back "),t.qZA(),t.BQk()}}function B(n,a){if(1&n){const r=t.EpF();t.ynx(0),t.TgZ(1,"button",25),t.NdJ("click",function(){t.CHM(r);const i=t.oxw(),u=t.MAs(11);return t.KtG(i.onStepperNext(u))}),t._uU(2," Next "),t.qZA(),t.BQk()}}function O(n,a){if(1&n){const r=t.EpF();t.ynx(0),t.TgZ(1,"button",26),t.NdJ("click",function(){t.CHM(r);const i=t.oxw(),u=t.MAs(11);return t.KtG(i.onSubmit(u))}),t._uU(2,"Download"),t.qZA(),t.BQk()}if(2&n){const r=t.oxw();t.xp6(1),t.Q6J("disabled",!r.urls)}}function I(n,a){1&n&&t._uU(0,"Instruction")}function M(n,a){1&n&&t._uU(0,"Download")}function k(n,a){1&n&&t._uU(0,"Finish")}function L(n,a){1&n&&t._UZ(0,"i",27)}function J(n,a){1&n&&t._UZ(0,"i",28)}function P(n,a){1&n&&t._UZ(0,"i",29)}let F=(()=>{var n;class a{constructor(e,i){this.downloadService=e,this.authService=i,this.configs=[{column:"Url",prop:"URL"},{column:"POS",prop:"Name"},{column:"Exception",prop:"Message"}],this.downloadResponses=[],this.stepperState="DOWNLOAD",this.urlPlaceholder="https://tokopedia.com/tokoriyanadi/kaos-polos-biru\nhttps://tokopedia.com/tokoriyanadi/Celana-Chinos-Coklat",this.currentDomain=this.authService.getDomain()}onStepperChange(e){this.stepperState=e.selectedStep.state}onSubmit(e){const i=this.urls.split(/\r?\n/);this.downloadService.download(i).subscribe(u=>{this.downloadResponses=u,this.mappingLinkToProduct(),this.onStepperNext(e)})}mappingLinkToProduct(){this.downloadResponses=this.downloadResponses.map(e=>(e.Name=e?.Name?`<a href="${this.currentDomain}/menu/Products/Catalog/Products/Info?ID=${e.ID}" target="_blank">\n ${e?.Name}\n </a>`:"-",e))}onNewStepperState(e){this.downloadResponses=[],this.urls=null,this.stepperState="DOWNLOAD",e.reset(),this.onStepperNext(e)}onStepperNext(e){e.selected.completed=!0,e.next()}}return(n=a).\u0275fac=function(e){return new(e||n)(t.Y36(h),t.Y36(y.e))},n.\u0275cmp=t.Xpm({type:n,selectors:[["app-by-url"]],features:[t._Bn([{provide:b.gx,useValue:{displayDefaultIndicatorType:!1}}])],decls:41,vars:15,consts:[["headerTitle","Tokopedia - Product Download By Url",3,"hideSearchBox","hideSearchDropdown"],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-12"],["labelPosition","bottom","linear","",1,"stepper-downloadByUrl",3,"selectedIndex","selectionChange"],["stepper",""],["state","GUIDE",3,"editable","completed"],["matStepLabel",""],[1,"mt-8"],[1,"card","border","w-50"],[1,"card-header","py-6"],[1,"text-primary"],[1,"card-body",2,"padding-left","0px"],[1,"mt-6"],["href","https://seller.tokopedia.com","target","_blank"],["state","DOWNLOAD",3,"editable","completed"],["name","url","cols","30","rows","25",1,"form-control",3,"placeholder","ngModel","ngModelChange"],["state","FINISH"],["status","error",3,"data","configs"],["matStepperIcon","GUIDE"],["matStepperIcon","DOWNLOAD"],["matStepperIcon","FINISH"],[1,"btn","btn-outline-secondary","btn-fill","btn-lg",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],["type","button",1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-3",3,"click"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","text-white","ms-3",3,"disabled","click"],[1,"fa-solid","fa-info"],[1,"fa-solid","fa-download"],[1,"fa-sharp","fa-solid","fa-flag"]],template:function(e,i){1&e&&(t.TgZ(0,"mainpanel",0)(1,"actions"),t.YNc(2,S,4,0,"ng-container",1),t.YNc(3,A,3,0,"ng-container",1),t.YNc(4,B,3,0,"ng-container",1),t.YNc(5,O,3,1,"ng-container",1),t.qZA(),t.TgZ(6,"content")(7,"div",2)(8,"div",3)(9,"div",4)(10,"mat-stepper",5,6),t.NdJ("selectionChange",function(N){return i.onStepperChange(N)}),t.TgZ(12,"mat-step",7),t.YNc(13,I,1,0,"ng-template",8),t.TgZ(14,"div",9)(15,"div",10)(16,"div",11)(17,"h4",12),t._uU(18,"Note"),t.qZA()(),t.TgZ(19,"div",13)(20,"ol",14)(21,"li"),t._uU(22," Use this form to Download Products from Tokopedia using product URL "),t.qZA(),t.TgZ(23,"li"),t._uU(24," Copy Product URL from "),t.TgZ(25,"a",15),t._uU(26,"https://seller.tokopedia.com/ "),t.qZA(),t._uU(27," and paste in this form "),t.qZA(),t.TgZ(28,"li"),t._uU(29," Use New Line when you want to input several product URLs "),t.qZA()()()()()(),t.TgZ(30,"mat-step",16),t.YNc(31,M,1,0,"ng-template",8),t.TgZ(32,"div",9)(33,"textarea",17),t.NdJ("ngModelChange",function(N){return i.urls=N}),t.qZA()()(),t.TgZ(34,"mat-step",18),t.YNc(35,k,1,0,"ng-template",8),t.TgZ(36,"div",9),t._UZ(37,"app-response-api-list",19),t.qZA()(),t.YNc(38,L,1,0,"ng-template",20),t.YNc(39,J,1,0,"ng-template",21),t.YNc(40,P,1,0,"ng-template",22),t.qZA()()()()()()),2&e&&(t.Q6J("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(2),t.Q6J("ngIf","FINISH"==i.stepperState),t.xp6(1),t.Q6J("ngIf","DOWNLOAD"==i.stepperState),t.xp6(1),t.Q6J("ngIf","GUIDE"==i.stepperState),t.xp6(1),t.Q6J("ngIf","DOWNLOAD"==i.stepperState),t.xp6(5),t.Q6J("selectedIndex",1),t.xp6(2),t.Q6J("editable","FINISH"!=i.stepperState)("completed",!0),t.xp6(18),t.Q6J("editable","FINISH"!=i.stepperState)("completed",!1),t.xp6(3),t.Q6J("placeholder",i.urlPlaceholder)("ngModel",i.urls),t.xp6(4),t.Q6J("data",i.downloadResponses)("configs",i.configs))},dependencies:[d.O5,f.Fj,f.JJ,f.On,s.p,c.C0,c.VY,c.Vq,c.z9,D],styles:[".card-header{background-color:#00000008}mat-stepper.stepper-downloadByUrl>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container{position:relative;width:60%;left:18%}mat-stepper.stepper-downloadByUrl>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container mat-step-header>div.mat-step-label{padding-top:8px}\n"],encapsulation:2}),a})();var Q=p(4575),E=p(617);const R=[{path:"",component:C,children:[{path:"by-url",component:F,data:{title:"Download Product By Url"},canActivate:[Q.a]},{pathMatch:"full",path:"",redirectTo:"by-url"}]}];let Y=(()=>{var n;class a{}return(n=a).\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({providers:[h],imports:[d.ez,f.u5,_.Z,s.R,c.T5,E.Ps,g.Bz.forChild(R)]}),a})()},6027:(w,v,p)=>{p.d(v,{Z:()=>f,e:()=>y});var d=p(6814),t=p(2596),_=p(9790),g=p(8253),o=p(5879);function T(s,c){if(1&s&&(o.ynx(0),o.TgZ(1,"a",6),o._uU(2),o.qZA(),o.BQk()),2&s){const l=o.oxw().$implicit;o.xp6(1),o.s9C("routerLink",l.Url),o.Q6J("title",l.Description?l.Description:""),o.xp6(1),o.hij(" ",l.Title," ")}}function C(s,c){if(1&s&&(o.TgZ(0,"li",4),o.YNc(1,T,3,3,"ng-container",5),o.qZA()),2&s){const l=c.$implicit;o.xp6(1),o.Q6J("ngxPermissionsOnly",l.Permissions)}}function b(s,c){if(1&s&&(o.ynx(0),o.YNc(1,C,2,1,"li",3),o.BQk()),2&s){const l=o.oxw();o.xp6(1),o.Q6J("ngForOf",l.Tabs)}}function x(s,c){if(1&s&&(o.TgZ(0,"li",4)(1,"a",6),o._uU(2),o.qZA()()),2&s){const l=c.$implicit;o.xp6(1),o.s9C("routerLink",l.Url),o.Q6J("title",l.Description?l.Description:""),o.xp6(1),o.hij(" ",l.Title," ")}}function h(s,c){if(1&s&&o.YNc(0,x,3,3,"li",3),2&s){const l=o.oxw();o.Q6J("ngForOf",l.Tabs)}}let y=(()=>{var s;class c{constructor(){this.usePermissions=!1}}return(s=c).\u0275fac=function(m){return new(m||s)},s.\u0275cmp=o.Xpm({type:s,selectors:[["nav-tab"]],inputs:{Tabs:"Tabs",usePermissions:"usePermissions"},decls:4,vars:2,consts:[[1,"nav","navbar-nav","navbar-left","nav-tab-arrow"],[4,"ngIf","ngIfElse"],["NOT_USE_PERMISSIONS",""],["routerLinkActive","active","class","nav-item me-6",4,"ngFor","ngForOf"],["routerLinkActive","active",1,"nav-item","me-6"],[4,"ngxPermissionsOnly"],[1,"nav-link","nav-link-arrow","mb-0",3,"routerLink","title"]],template:function(m,U){if(1&m&&(o.TgZ(0,"ul",0),o.YNc(1,b,2,1,"ng-container",1),o.YNc(2,h,1,1,"ng-template",null,2,o.W1O),o.qZA()),2&m){const Z=o.MAs(3);o.xp6(1),o.Q6J("ngIf",U.usePermissions)("ngIfElse",Z)}},dependencies:[d.sg,d.O5,_.rH,_.Od,g.gE]}),c})(),f=(()=>{var s;class c{}return(s=c).\u0275fac=function(m){return new(m||s)},s.\u0275mod=o.oAB({type:s}),s.\u0275inj=o.cJS({imports:[d.ez,_.Bz,t.AV,g.VI.forChild()]}),c})()}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[726],{3726:(Pn,L,c)=>{c.r(L),c.d(L,{StatusModule:()=>xn});var p=c(6814),t=c(5879),Q=c(6027),P=c(9790);const V=function(){return["/menu/products/download/by-url"]};let K=(()=>{var i;class r{constructor(){this.productTabs=[{Title:"Sold in Channel",Url:"/menu/products/status/sold-in-channel",Description:"SKU has been mapped between dealpos and marketplace"},{Title:"Not in POS",Url:"/menu/products/status/not-in-pos",Description:"SKU sold in Marketplace but not exist in DEALPOS"},{Title:"Not in Channel",Url:"/menu/products/status/not-in-channel",Description:"SKU has not been sold on one of channels"},{Title:"In POS",Url:"/menu/products/status/in-pos",Description:"All products which is already available in POS"},{Title:"Multiple Listed SKU",Url:"/menu/products/status/duplicate-sku",Description:"SKU(s) which is listed more than one time (one to many)"},{Title:"Channel Statistic",Url:"/menu/products/status/channel-statistic",Description:"Product statistic from each channel obtained from the last product scan"}]}}return(i=r).\u0275fac=function(n){return new(n||i)},i.\u0275cmp=t.Xpm({type:i,selectors:[["app-status"]],decls:13,vars:3,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-flex"],[1,"dropdown-item",3,"routerLink"]],template:function(n,e){1&n&&(t.TgZ(0,"nav",0)(1,"div",1)(2,"div"),t._UZ(3,"nav-tab",2),t.qZA()(),t.TgZ(4,"div")(5,"div",3)(6,"a",4),t._UZ(7,"i",5),t.qZA(),t.TgZ(8,"div",6)(9,"div",7)(10,"a",8),t._uU(11,"Download Product By Url"),t.qZA()()()()()(),t._UZ(12,"router-outlet")),2&n&&(t.xp6(3),t.Q6J("Tabs",e.productTabs),t.xp6(7),t.Q6J("routerLink",t.DdM(2,V)))},dependencies:[Q.e,P.lC,P.rH]}),r})();var F=c(5623),m=c(2383),_=c(7700),s=c(5802),h=c(754),b=function(i){return i.Tokopedia="https://seller.tokopedia.com",i.Shoope="https://seller.shopee.co.id",i.Tiktok="https://seller-id.tiktok.com",i.WooCommerce="https://woocommerce.dealpos.app",i.Lazada="https://sellercenter.lazada.co.id",i}(b||{}),U=c(2965),M=c(2596),D=c(7380);function G(i,r){if(1&i&&(t.ynx(0),t.TgZ(1,"tr")(2,"td",11),t._uU(3),t.qZA(),t.TgZ(4,"td",11),t._uU(5),t.qZA(),t.TgZ(6,"td",12)(7,"p",13),t._uU(8,"Product Not in Channel!"),t.qZA()()(),t.BQk()),2&i){const o=t.oxw().$implicit;t.xp6(3),t.hij(" ",null==o?null:o.Model,""),t.xp6(2),t.hij(" ",null==o?null:o.Code,"")}}function $(i,r){if(1&i&&(t.TgZ(0,"td",11),t._uU(1),t.qZA()),2&i){const o=t.oxw(3).$implicit;t.uIk("rowspan",o.Channel.length),t.xp6(1),t.hij(" ",null==o?null:o.Model,"")}}function H(i,r){if(1&i&&(t.TgZ(0,"td",11),t._uU(1),t.qZA()),2&i){const o=t.oxw(3).$implicit;t.uIk("rowspan",o.Channel.length),t.xp6(1),t.hij(" ",null==o?null:o.Code,"")}}const R=function(i){return{"is-disabled":i}};function j(i,r){if(1&i&&(t.TgZ(0,"tr"),t.YNc(1,$,2,2,"td",14),t.YNc(2,H,2,2,"td",14),t.TgZ(3,"td",11)(4,"div",15)(5,"a",16),t._UZ(6,"img",17),t.qZA(),t.TgZ(7,"div",18),t._uU(8),t.qZA()()(),t.TgZ(9,"td",11),t._uU(10),t.ALo(11,"number"),t.qZA(),t.TgZ(12,"td",19),t._uU(13),t.ALo(14,"number"),t.qZA(),t.TgZ(15,"td",19)(16,"a",20),t._UZ(17,"i",21),t.TgZ(18,"span",22),t._uU(19,"Edit"),t.qZA()()()()),2&i){const o=r.$implicit,n=r.index,e=t.oxw(3);t.xp6(1),t.Q6J("ngIf",0==n),t.xp6(1),t.Q6J("ngIf",0==n),t.xp6(3),t.Q6J("href",o.Url,t.LSH)("title",o.Title),t.xp6(1),t.Q6J("src",e.getChannelLogo(o.TypeID),t.LSH),t.xp6(1),t.Q6J("matTooltip",(null==o||null==o.Name?null:o.Name.length)>55?null==o?null:o.Name:""),t.xp6(1),t.hij(" ",o.Name," "),t.xp6(2),t.Oqu(t.lcZ(11,12,o.Price)),t.xp6(3),t.Oqu(t.lcZ(14,14,o.Inventory)),t.xp6(3),t.Q6J("href",e.getHyperlinkSellerCenter(o),t.LSH)("ngClass",t.VKq(16,R,o.TypeID==e.channelType.KalCare))("matTooltip",o.TypeID!=e.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function z(i,r){if(1&i&&t.YNc(0,j,20,18,"tr",8),2&i){const o=t.oxw().$implicit;t.Q6J("ngForOf",null==o?null:o.Channel)}}function W(i,r){if(1&i&&(t.ynx(0),t.YNc(1,G,9,2,"ng-container",9),t.YNc(2,z,1,1,"ng-template",null,10,t.W1O),t.BQk()),2&i){const o=r.$implicit,n=t.MAs(3);t.xp6(1),t.Q6J("ngIf",!o.Channel||o.Channel.length<1)("ngIfElse",n)}}let q=(()=>{var i;class r{constructor(n,e){this.data=n,this.dialogRef=e,this.channelType=h.x,this.variants=n.variants,this.title=n.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new U.O,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideCancel=!0,this.modalConfig.hideOk=!0}getChannelLogo(n){return s.g.getChannelLogoByTypeId(n)}getHyperlinkSellerCenter(n){let e="javascript:void(0)";switch(n.TypeID){case h.x.ShopeeV2:e=`${b.Shoope}/portal/product/${n.ChannelItemID}`;break;case h.x.Tiktok:e=`${b.Tiktok}/product/edit/${n.ChannelItemID}`;break;case h.x.Tokopedia:e=`${b.Tokopedia}/edit-product/${n.ChannelItemID}`;break;case h.x.WooCommerce:e=`${b.WooCommerce}/wp-admin/post.php?post=${n.ChannelItemID}&action=edit`;break;case h.x.Lazada:e=`${b.Lazada}/apps/product/publish?productId=${n.ChannelItemID}`}return e}}return(i=r).\u0275fac=function(n){return new(n||i)(t.Y36(_.WI),t.Y36(_.so))},i.\u0275cmp=t.Xpm({type:i,selectors:[["app-modal-variant"]],decls:22,vars:2,consts:[[3,"config","onCancel"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"text-start","sticky-top"],["matTooltip","Variant from POS",1,"fas","fa-info-circle","ms-1"],["matTooltip","Product and Variant from each Channel",1,"fas","fa-info-circle","ms-1"],[1,"text-start","sticky-top",2,"width","0%"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],["printChannelModal",""],[1,"text-start"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-start",4,"ngIf"],[1,"d-flex"],["target","_blank",1,"me-1",3,"href","title"],[2,"width","20px","height","20px",3,"src"],[1,"text-ellipsis","ps-2",2,"max-width","18vw",3,"matTooltip"],[1,"text-center"],["target","_blank",1,"btn","btn-small","btn-light","px-4","py-2",3,"href","ngClass","matTooltip"],[1,"fa-solid","fa-pencil","me-2",2,"font-size","10px"],[1,"fs-6"]],template:function(n,e){1&n&&(t.TgZ(0,"modal-material",0),t.NdJ("onCancel",function(){return e.dialogRef.close()}),t.TgZ(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4),t._uU(6," VARIANT "),t.TgZ(7,"sup"),t._UZ(8,"i",5),t.qZA()(),t.TgZ(9,"th",4),t._uU(10,"SKU"),t.qZA(),t.TgZ(11,"th",4),t._uU(12," PRODUCT "),t.TgZ(13,"sup"),t._UZ(14,"i",6),t.qZA()(),t.TgZ(15,"th",4),t._uU(16,"PRICE"),t.qZA(),t.TgZ(17,"th",7),t._uU(18,"INVENTORY"),t.qZA(),t._UZ(19,"th",4),t.qZA()(),t.TgZ(20,"tbody"),t.YNc(21,W,4,2,"ng-container",8),t.qZA()()()()),2&n&&(t.Q6J("config",e.modalConfig),t.xp6(21),t.Q6J("ngForOf",e.variants))},dependencies:[p.mk,p.sg,p.O5,M.gM,D.M,p.JJ],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#fff!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}a.is-disabled[_ngcontent-%COMP%]{color:gray;cursor:default}a.is-disabled[_ngcontent-%COMP%]:hover{text-decoration:none}"]}),r})();var g=c(2181),f=c(4664),E=c(8645),A=c(9773),X=c(2096),tt=c(1449),S=c(9659);let nt=(()=>{var i;class r{constructor(n,e){this.LocalData=n,this.httpService=e}getCategoriesByTypeId(n,e){return this.LocalData.getCategoriesByChannelType(n).pipe((0,f.w)(a=>null!=a?(0,X.of)(a):this._getCategoriesByTypeID(n,e)))}_getCategoriesByTypeID(n,e){return this.httpService.post("/api/Channel/getCategoriesByTypeID",{TypeID:n,ID:e}).pipe((0,f.w)(l=>this.LocalData.saveCategoriesByChannelType(l,n)))}}return(i=r).\u0275fac=function(n){return new(n||i)(t.LFG(tt.T),t.LFG(S.O))},i.\u0275prov=t.Yz7({token:i,factory:i.\u0275fac,providedIn:"root"}),r})();var I=c(9229),u=c(6223),et=c(6107);function ot(i,r){if(1&i){const o=t.EpF();t.ynx(0),t.TgZ(1,"ng-select-infinite",16),t.NdJ("selectedChange",function(e){t.CHM(o);const a=t.oxw().index,l=t.oxw();return t.KtG(l.onSelectCategory(e,a))}),t.qZA(),t.BQk()}if(2&i){const o=t.oxw().$implicit;t.xp6(1),t.Q6J("items",o.Categories)("clearable",!1)}}function it(i,r){if(1&i&&(t.TgZ(0,"div",17),t._UZ(1,"input",18),t.qZA()),2&i){const o=t.oxw().$implicit,n=t.oxw();t.xp6(1),t.Q6J("placeholder",n.getChannelCategory(o.TypeID))}}function at(i,r){if(1&i){const o=t.EpF();t.ynx(0),t.TgZ(1,"tr")(2,"td",9)(3,"input",10),t.NdJ("ngModelChange",function(e){const l=t.CHM(o).$implicit;return t.KtG(l.Selected=e)})("ngModelChange",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.onSelectChannel())}),t.qZA()(),t.TgZ(4,"td")(5,"div",11),t._UZ(6,"img",12),t.TgZ(7,"span",13),t._uU(8),t.qZA()()(),t.TgZ(9,"td"),t.YNc(10,ot,2,2,"ng-container",14),t.YNc(11,it,2,1,"ng-template",null,15,t.W1O),t.qZA()(),t.BQk()}if(2&i){const o=r.$implicit,n=t.MAs(12);t.xp6(3),t.Q6J("ngModel",o.Selected),t.xp6(3),t.Q6J("src",o.Img,t.LSH),t.xp6(2),t.Oqu(o.Name),t.xp6(2),t.Q6J("ngIf",o.Categories.length>0)("ngIfElse",n)}}let w=(()=>{var i;class r{constructor(n,e,a,l){this.data=n,this.channelService=e,this.dialogRef=a,this.toastrService=l,this.channelOptions=[],this.uploadResponse=[],this.channelType=h.x,this.enableBtnOk=!1,this.destroy$=new E.x,this.uploadResponse=[],this.channels=this.data.channels}ngOnInit(){this.initModalConfig(),this.initChannelOptions(),this.initCategories()}initModalConfig(){this.modalConfig=new U.O,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0}initCategories(){this.filterChannelTypeId().forEach(e=>{this.channelService.getCategoriesByTypeId(e.channelType,e.channelId).pipe((0,A.R)(this.destroy$)).subscribe(a=>{this.setCategoriesChannelOption(e.channelType,a)})})}setCategoriesChannelOption(n,e){this.channelOptions=this.channelOptions.map(a=>(a.TypeID==n&&(a.Categories=e),a))}initChannelOptions(){this.channelOptions=this.channels.map(n=>({Name:n.Name,Img:n.Img,ID:n.ID,Selected:!1,CategoryID:this.initDefaultChannelCategoryId(n.TypeID),TypeID:n.TypeID,Categories:[]}))}initDefaultChannelCategoryId(n){let e=0;return n===h.x.Lazada&&(e=6509),e}filterChannelTypeId(){return this.data.channels.map(e=>({channelType:e.TypeID,channelId:e.ID})).filter((e,a,l)=>l.findIndex(d=>e.channelType==d.channelType)==a).filter(e=>e.channelType==h.x.Tokopedia)}onSelectCategory(n,e){this.channelOptions[e].CategoryID=n,this.channelOptions[e].Selected=!0,this.onSelectChannel()}onSelectAllChannel(n){this.channelOptions=this.channelOptions.map(e=>(e.Selected=n,e)),this.enableBtnOk=n}onSelectChannel(){this.enableBtnOk=this.hasSelectedChannel()}hasSelectedChannel(){return-1!==this.channelOptions.findIndex(n=>n.Selected)}onClose(){this.dialogRef.close("CANCEL")}onSave(){if(!this.validateSelectedCategory())return void this.toastrService.warning("Category is required","Warning!");const n=this.channelOptions.filter(e=>e.Selected).map(e=>({CategoryID:e.CategoryID,ChannelID:e.ID}));this.dialogRef.close(n)}validateSelectedCategory(){return-1==this.channelOptions.filter(e=>e.Selected).filter(e=>e.TypeID==h.x.Tokopedia).findIndex(e=>0==e.CategoryID)}getChannelCategory(n){let e;switch(n){case h.x.ShopeeV2:e="Aksesoris Fashion";break;case h.x.Tiktok:e="Aksesoris Fashion - Aksesoris Pakaian";break;case h.x.WooCommerce:e="New Product";break;case h.x.Lazada:e="Fashion Accessories / Women Accessories / Others";break;default:e="Unavailable Category"}return e}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}}return(i=r).\u0275fac=function(n){return new(n||i)(t.Y36(_.WI),t.Y36(nt),t.Y36(_.so),t.Y36(I._W))},i.\u0275cmp=t.Xpm({type:i,selectors:[["app-modal-uploadMultiple-product"]],decls:15,vars:3,consts:[[3,"dynamicValidated","config","onOk","onClose","onCancel"],["content",""],[1,"table"],[1,"text-center",2,"width","6%"],["type","checkbox",3,"change"],[2,"width","30%"],[1,"fs-6"],[2,"width","60%"],[4,"ngFor","ngForOf"],[1,"text-center"],["type","checkbox",3,"ngModel","ngModelChange"],[1,"d-flex","align-items-center"],["alt","",1,"channel-logo-size",3,"src"],[1,"ms-3","fs-6"],[4,"ngIf","ngIfElse"],["EMPTY",""],["bindValue","Key","bindLabel","Value","width","100%","parent","body","position","top","placeholder","Select Category",3,"items","clearable","selectedChange"],["matTooltip","Product Category is Harcoded, Please Change Product Category in Seller Center","matTooltipPosition","above","matTooltipClass","custom-width-tooltip"],["type","text","disabled","",1,"form-control","rounded",2,"height","40px",3,"placeholder"]],template:function(n,e){1&n&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return e.onSave()})("onClose",function(){return e.onClose()})("onCancel",function(){return e.onClose()}),t.TgZ(1,"div",1)(2,"table",2)(3,"thead")(4,"tr")(5,"th",3)(6,"input",4),t.NdJ("change",function(l){return e.onSelectAllChannel(l.target.checked)}),t.qZA()(),t.TgZ(7,"th",5)(8,"span",6),t._uU(9,"CHANNEL"),t.qZA()(),t.TgZ(10,"th",7)(11,"span",6),t._uU(12,"CATEGORY"),t.qZA()()()(),t.TgZ(13,"tbody"),t.YNc(14,at,13,5,"ng-container",8),t.qZA()()()()),2&n&&(t.Q6J("dynamicValidated",e.enableBtnOk)("config",e.modalConfig),t.xp6(14),t.Q6J("ngForOf",e.channelOptions))},dependencies:[p.sg,p.O5,u.Wl,u.JJ,u.On,M.gM,D.M,et.R],styles:["input[type=checkbox]{width:15px;height:15px}img.channel-logo-size{width:24px;height:24px}table>thead>tr{border-top:none!important;border-left:none!important;border-right:none!important}\n"],encapsulation:2}),r})();var T=c(5993),x=c(4387),C=c(4807),Z=c(8558),k=c(1781),v=c(5439),O=c(8034);function lt(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"button",15),t.NdJ("click",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.onOpenScanDialog())}),t._UZ(1,"i",16),t._uU(2," Scan Channel "),t.qZA()}}function rt(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"button",17),t.NdJ("click",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.onScanMultipleProduct())}),t._UZ(1,"i",16),t._uU(2),t.qZA()}if(2&i){const o=t.oxw();let n;t.xp6(2),t.hij(" Scan (",null==(n=o.productService.selectedProduct(o.products))?null:n.length,") ")}}function ct(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"button",18),t.NdJ("click",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.onUploadMultipleProduct())}),t._UZ(1,"i",19),t._uU(2),t.qZA()}if(2&i){const o=t.oxw();let n;t.xp6(2),t.hij(" Upload (",null==(n=o.productService.selectedProduct(o.products))?null:n.length,") ")}}function st(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"div",20)(1,"app-product-card",21),t.NdJ("onUpload",function(){const a=t.CHM(o).$implicit,l=t.oxw();return t.KtG(l.onUploadToMultipleChannel(a))})("onScan",function(){const a=t.CHM(o).$implicit,l=t.oxw();return t.KtG(l.onScanSingleProduct(a))})("onDescEvent",function(){const a=t.CHM(o).index,l=t.oxw();return t.KtG(l.onOpenDialogVariant(a))})("onCheckBoxChange",function(e){const l=t.CHM(o).$implicit;return t.KtG(l.selected=e)}),t.qZA()()}if(2&i){const o=r.$implicit,n=t.oxw();t.xp6(1),t.Q6J("productId",o.ID)("title",null==o?null:o.Name)("image",null==o?null:o.ThumbnailUrl)("description",(null==o?null:o.Variants.length)>1?(null==o?null:o.Variants.length)+" Variants":null)("channels",n.productService.getChannelProduct(o))("code",n.getVariantCode(null==o?null:o.Variants))("showCheckBox",(null==o?null:o.Channel.length)<n.channelOptions.length)("scanButton",!0)("uploadButton",null==o?null:o.hasUpload)("imageForZoom",null==o?null:o.ImageUrl)}}function dt(i,r){1&i&&(t.ynx(0),t.TgZ(1,"div",22),t._UZ(2,"app-empty-state"),t.qZA(),t.BQk())}function pt(i,r){if(1&i){const o=t.EpF();t.ynx(0),t.TgZ(1,"div",23)(2,"div",24)(3,"app-custom-paginator",25),t.NdJ("next",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.onNextPage())})("previous",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.onPrevPage())}),t.qZA()()(),t.BQk()}if(2&i){const o=t.oxw();t.xp6(3),t.Q6J("filter",o.searchFilter)("totaldata",null==o.products?null:o.products.length)("paginationTotal",o.rowCount)("hasClicked",!0)}}let ht=(()=>{var i;class r{constructor(n,e,a,l){this.http=n,this.toastr=e,this.dialog=a,this.productService=l,this.searchFilter=new F.k,this.products=[],this.rowCount=0,this.getLoaderPage()}getLoaderPage(){this.productService.LoadInPOS().subscribe(n=>{this.channelOptions=n.Options.Channel,this.Categories=n.Options.Categories,this.searchFilter.PageNumber=n.Filter.PageNumber,this.searchFilter.RowCount=n.Filter.RowCount,this.searchFilter.ChannelID=null,this.searchFilter.Category=n.Filter.Category,this.searchFilter.PageSize=100,this.getProducts()})}getProducts(){this.http.post("/api/product/GetInPOS",{PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Category:this.searchFilter.Category,From:this.startDate,To:this.endDate}).subscribe(e=>{this.products=e.Data,this.rowCount=null==e.Total?this.searchFilter.RowCount:e.Total.toString(),this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions)})}onOpenScanDialog(){let n=JSON.parse(JSON.stringify(this.searchFilter));n.ChannelID=s.g.GuidEMpty,this.dialog.open(m.j,{data:{filter:n,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe((0,g.h)(a=>s.g.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ChannelID=a.ChannelID,this.searchFilter.ScanFull=a.ScanFull,this.searchFilter.UpdatedProduct=a.UpdatedProduct,this.searchFilter.Async=a.Async,this.scanAllProduct()})}scanAllProduct(){null!=this.searchFilter.ChannelID?this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(n=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{this.getLoaderPage();let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(n,e,!this.searchFilter.UpdatedProduct)}}):this.toastr.error("Please Select Channel","Error")}onOpenDialogVariant(n){this.dialog.open(q,{data:{title:this.products[n].Name,variants:this.products[n].Variants},width:"800px"})}onUploadMultipleProduct(){let n=this.productService.selectedProduct(this.products),e=this.productService.filterUnselectedChannel(n,this.channelOptions);this.dialog.open(w,{width:"700px",data:{title:"Upload Multiple Product",channels:e}}).afterClosed().pipe((0,g.h)(a=>"CANCEL"!==a),(0,f.w)(a=>this.productService.uploadMultipleProduct(n,a))).subscribe({next:a=>{this.getProducts()}})}onUploadToMultipleChannel(n){let e=this.productService.getChannelProduct(n);n.Channel=e;let a=this.productService.filterUnselectedChannel([n],this.channelOptions);this.dialog.open(w,{width:"700px",data:{title:`Upload - ${n.Name}`,channels:a}}).afterClosed().pipe((0,g.h)(l=>"CANCEL"!==l),(0,f.w)(l=>this.productService.uploadSingleProduct([n],l))).subscribe({next:l=>{this.getProducts()}})}searchProduct(n){this.searchFilter.text=n,this.getProducts()}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPrevPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}onScanMultipleProduct(){let n=JSON.parse(JSON.stringify(this.searchFilter));n.ChannelID=s.g.GuidEMpty;let e=this.productService.filterChannelByTypeId(this.channelOptions,[h.x.Tokopedia,h.x.Tiktok]);this.dialog.open(m.j,{data:{filter:n,channelOptions:e,isSingleChannel:!0},width:"600px"}).afterClosed().pipe((0,g.h)(l=>s.g.IsNotEmpty(l))).subscribe(l=>{this.searchFilter.ChannelID=l.ChannelID,this.searchFilter.ScanFull=l.ScanFull,this.searchFilter.UpdatedProduct=l.UpdatedProduct;let d=this.productService.selectedProduct(this.products),N=this.productService.getVariantCodesProducts(d);this.scanSingleProduct(N)})}onScanSingleProduct(n){let e=JSON.parse(JSON.stringify(this.searchFilter));e.ChannelID=s.g.GuidEMpty,this.dialog.open(m.j,{data:{filter:e,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe((0,g.h)(a=>s.g.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ChannelID=a.ChannelID;const l=this.productService.getVariantCodesProduct(n);this.scanSingleProduct(l)})}scanSingleProduct(n){this.productService.scanSingle(this.searchFilter.ChannelID,n).subscribe({next:e=>{if(e)this.toastr.success("Successfully Scan ","Success");else{let a=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${a?.Name} `,"Error")}this.searchFilter.ChannelID=s.g.GuidEMpty,e&&this.getProducts()},error:e=>{this.searchFilter.ChannelID=s.g.GuidEMpty}})}getVariantCode(n){let e;return n.length>1&&(e=(n[0].model?n[0].model:"")+n[0].Code),1==n.length&&(e=n[0].Code),e}}return(i=r).\u0275fac=function(n){return new(n||i)(t.Y36(S.O),t.Y36(I._W),t.Y36(_.uw),t.Y36(T.M))},i.\u0275cmp=t.Xpm({type:i,selectors:[["app-in-pos"]],decls:26,vars:13,consts:[["description","All products which is already available in POS",3,"headerTitle","onSubmit"],["type","button","data-cy","scanSoldinChannel","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-2",3,"click",4,"ngIf"],["class","btn btn-light shadow rounded ms-2",3,"click",4,"ngIf"],[1,"d-flex"],["container",""],["bindLabel","Name","name","Name","bindValue","Name","placeholder","Select Category",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModel","ngModelChange","click"],["matEndDate","","placeholder","End date",3,"ngModel","ngModelChange","click"],["picker",""],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[4,"ngIf"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","onUpload","onScan","onDescEvent","onCheckBoxChange"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"filter","totaldata","paginationTotal","hasClicked","next","previous"]],template:function(n,e){if(1&n){const a=t.EpF();t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(d){return e.searchProduct(d)}),t.TgZ(1,"actions"),t.YNc(2,lt,3,0,"button",1),t.YNc(3,rt,3,1,"button",2),t.YNc(4,ct,3,1,"button",3),t.qZA(),t.TgZ(5,"filters")(6,"div",4)(7,"div",5)(8,"div")(9,"h6"),t._uU(10,"Category "),t.qZA(),t.TgZ(11,"ng-select",6),t.NdJ("ngModelChange",function(d){return e.searchFilter.Category=d}),t.qZA()(),t.TgZ(12,"div")(13,"h6"),t._uU(14,"Release"),t.qZA(),t.TgZ(15,"mat-date-range-input",7)(16,"input",8),t.NdJ("ngModelChange",function(d){return e.startDate=d})("click",function(){t.CHM(a);const d=t.MAs(19);return t.KtG(d.open())}),t.qZA(),t.TgZ(17,"input",9),t.NdJ("ngModelChange",function(d){return e.endDate=d})("click",function(){t.CHM(a);const d=t.MAs(19);return t.KtG(d.open())}),t.qZA()(),t._UZ(18,"mat-date-range-picker",null,10),t.qZA()()()(),t.TgZ(20,"content")(21,"div",11)(22,"div",12),t.YNc(23,st,2,10,"div",13),t.YNc(24,dt,3,0,"ng-container",14),t.qZA(),t.YNc(25,pt,4,4,"ng-container",14),t.qZA()()()}if(2&n){const a=t.MAs(19);t.Q6J("headerTitle","In POS ("+e.rowCount+")"),t.xp6(2),t.Q6J("ngIf",!e.productService.hasSelection(e.products)),t.xp6(1),t.Q6J("ngIf",e.productService.hasSelection(e.products)),t.xp6(1),t.Q6J("ngIf",e.productService.hasSelection(e.products)),t.xp6(7),t.Q6J("clearable",!0)("items",e.Categories)("ngModel",e.searchFilter.Category),t.xp6(4),t.Q6J("rangePicker",a),t.xp6(1),t.Q6J("ngModel",e.startDate),t.xp6(1),t.Q6J("ngModel",e.endDate),t.xp6(6),t.Q6J("ngForOf",e.products),t.xp6(1),t.Q6J("ngIf",0==e.products.length),t.xp6(1),t.Q6J("ngIf",e.products.length>0)}},dependencies:[p.sg,p.O5,u.Fj,u.JJ,u.On,x.p,C.w9,Z.y,k.Y,v.s,O.wx,O.zY,O.By,O._g],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.img-logo[_ngcontent-%COMP%]{height:24px;width:24px}"]}),r})();function ut(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"button",13),t.NdJ("click",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.onOpenScanDialog())}),t._UZ(1,"i",14),t._uU(2," Scan Channel "),t.qZA()}}function gt(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"button",15),t.NdJ("click",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.onScanMultipleProduct())}),t._UZ(1,"i",14),t._uU(2),t.qZA()}if(2&i){const o=t.oxw();t.xp6(2),t.hij(" Scan (",o.productService.selectedProduct(o.products).length,") ")}}function _t(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"button",16),t.NdJ("click",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.onUploadMultipleProduct())}),t._UZ(1,"i",17),t._uU(2),t.qZA()}if(2&i){const o=t.oxw();t.xp6(2),t.hij(" Upload (",o.productService.selectedProduct(o.products).length,") ")}}function mt(i,r){if(1&i&&(t.TgZ(0,"span",18),t._UZ(1,"img",19),t.qZA(),t._uU(2)),2&i){const o=r.item,n=t.oxw();t.xp6(1),t.Q6J("src",n.getChannelLogo(o.TypeID),t.LSH),t.xp6(1),t.hij(" ",o.Name," ")}}function Ct(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"div")(1,"h6"),t._uU(2,"Item ID"),t.qZA(),t.TgZ(3,"input",20),t.NdJ("ngModelChange",function(e){t.CHM(o);const a=t.oxw();return t.KtG(a.searchFilter.Item_id=e)}),t.qZA()()}if(2&i){const o=t.oxw();t.xp6(3),t.Q6J("ngModel",o.searchFilter.Item_id)}}function ft(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"div",21)(1,"app-product-card",22),t.NdJ("onUpload",function(){const a=t.CHM(o).$implicit,l=t.oxw();return t.KtG(l.onUploadToMultipleChannel(a))})("onDescEvent",function(){const a=t.CHM(o).index,l=t.oxw();return t.KtG(l.onOpenVariantDetail(a))})("onScan",function(){const a=t.CHM(o).$implicit,l=t.oxw();return t.KtG(l.onScanSingleProduct(a))})("onCheckBoxChange",function(e){const l=t.CHM(o).$implicit;return t.KtG(l.selected=e)}),t.qZA()()}if(2&i){const o=r.$implicit,n=t.oxw();t.xp6(1),t.Q6J("productId",null==o?null:o.ID)("title",null==o?null:o.Name)("image",null==o?null:o.ThumbnailUrl)("description",(null==o||null==o.Variants?null:o.Variants.length)>1?(null==o||null==o.Variants?null:o.Variants.length)+" Variants":null)("channels",n.productService.getChannelProduct(o))("code",n.getVariantCode(null==o?null:o.Variants))("showCheckBox",null==o?null:o.hasScan)("scanButton",!0)("uploadButton",null==o?null:o.hasUpload)("imageForZoom",null==o?null:o.ImageUrl)}}function xt(i,r){1&i&&(t.ynx(0),t.TgZ(1,"div",23),t._UZ(2,"app-empty-state"),t.qZA(),t.BQk())}function Pt(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"div",24)(1,"div",25)(2,"app-custom-paginator",26),t.NdJ("total",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.getRowCount())})("next",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.onNextPage())})("previous",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.onPreviousPage())}),t.qZA()()()}if(2&i){const o=t.oxw();t.xp6(2),t.Q6J("filter",o.searchFilter)("totaldata",null==o.products?null:o.products.length)("paginationTotal",o.rowCount)("hasClicked",o.hasClickRowCount)}}let bt=(()=>{var i;class r{constructor(n,e,a,l,d){this.http=n,this.dialog=e,this.toastr=a,this.productService=l,this.activateRouter=d,this.searchFilter=new F.k,this.products=[],this.rowCount=0,this.hasClickRowCount=!1,this.guidEmpty=s.g.GuidEMpty}ngOnInit(){this.activateRouter.queryParams.subscribe(n=>{this.initPageLoader(n.ID?n.ID:s.g.GuidEMpty)})}initPageLoader(n){this.productService.loader(n).subscribe(e=>{this.channelOptions=e.Options.Channel,this.searchFilter=e.Filter,e.Filter.ChannelID!=s.g.GuidEMpty&&(this.searchFilter.ListChannelID=[],this.searchFilter.ListChannelID.push(e.Filter.ChannelID)),this.searchFilter.PageSize=e.Filter.RowCount,this.searchFilter.Item_id="",this.getProducts()})}getProducts(){this.productService.findAllSoldInChannel({ListChannelID:this.searchFilter.ListChannelID,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Item_id:this.searchFilter.Item_id}).subscribe(e=>{this.products=e.Data,this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions),this.products=this.productService.checkProductHasScanButton(this.products,this.channelOptions)})}searchProduct(n){this.searchFilter.text=n,this.hasClickRowCount=!1,this.getProducts()}onOpenVariantDetail(n){this.dialog.open(q,{data:{variants:this.products[n].Variants,title:this.products[n].Name},width:"800px"})}onOpenScanDialog(){let n=JSON.parse(JSON.stringify(this.searchFilter));n.ChannelID=s.g.GuidEMpty,this.dialog.open(m.j,{data:{filter:n,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe((0,g.h)(a=>s.g.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ChannelID=a.ChannelID,this.searchFilter.ScanFull=a.ScanFull,this.searchFilter.UpdatedProduct=a.UpdatedProduct,this.searchFilter.Async=a.Async,this.scanAllProduct()})}scanAllProduct(){let n=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).pipe((0,g.h)(e=>e)).subscribe(e=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(e,n,!this.searchFilter.UpdatedProduct),this.initPageLoader(s.g.GuidEMpty))})}onScanSingleProduct(n){n.Channel=this.productService.getChannelProduct(n);let e=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(m.j,{data:{filter:e,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe((0,g.h)(a=>s.g.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ChannelID=a.ChannelID;const l=this.productService.getVariantCodesProduct(n);this.scanProducts(l)})}onUploadToMultipleChannel(n){let e=this.productService.getChannelProduct(n);n.Channel=e;let a=this.productService.filterUnselectedChannel([n],this.channelOptions);this.dialog.open(w,{width:"700px",data:{title:`Upload - ${n.Name}`,channels:a}}).afterClosed().pipe((0,g.h)(l=>"CANCEL"!==l),(0,f.w)(l=>this.productService.uploadSingleProduct([n],l))).subscribe({next:l=>{this.getProducts()}})}onScanMultipleProduct(){let n=this.productService.filterChannelByTypeId(this.channelOptions,[h.x.Tokopedia,h.x.Tiktok]);this.searchFilter.ChannelID=s.g.GuidEMpty;let e=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(m.j,{data:{filter:e,channelOptions:n,isSingleChannel:!0},width:"600px"}).afterClosed().pipe((0,g.h)(l=>s.g.IsNotEmpty(l))).subscribe(l=>{this.searchFilter.ChannelID=l.ChannelID,this.searchFilter.ScanFull=l.ScanFull,this.searchFilter.UpdatedProduct=l.UpdatedProduct;let d=this.productService.selectedProduct(this.products),N=this.productService.getVariantCodesProducts(d);this.scanProducts(N)})}scanProducts(n){this.productService.scanSingle(this.searchFilter.ChannelID,n).subscribe({next:e=>{let a=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);e?this.toastr.success(`Product Successfully scan with ${a?.Name}`,"Success"):this.toastr.error(`This product is not existed in ${a?.Name} `,"Error"),this.searchFilter.ChannelID=s.g.GuidEMpty,e&&this.getProducts()},error:e=>{this.searchFilter.ChannelID=s.g.GuidEMpty}})}getVariantCode(n){let e;return n.length>1&&(e=(n[0].model?n[0].model:"")+n[0].Code),1==n.length&&(e=n[0].Code),e}onClearFilterChannel(){this.searchFilter.ChannelID=s.g.GuidEMpty,this.searchFilter.Item_id=""}onUploadMultipleProduct(){let n=this.productService.selectedProduct(this.products),e=this.productService.filterUnselectedChannel(n,this.channelOptions);this.dialog.open(w,{width:"700px",data:{title:"Upload Multiple Product",channels:e}}).afterClosed().pipe((0,g.h)(a=>"CANCEL"!==a),(0,f.w)(a=>this.productService.uploadMultipleProduct(n,a))).subscribe({next:a=>{this.getProducts()}})}getRowCount(){this.http.post("/api/product/GetSoldInChannelRowCount",{ListChannelID:this.searchFilter.ListChannelID,text:this.searchFilter.text}).subscribe(e=>{this.hasClickRowCount=!0,this.rowCount=e.Total})}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPreviousPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}getChannelLogo(n){return s.g.getChannelLogoByTypeId(n)}}return(i=r).\u0275fac=function(n){return new(n||i)(t.Y36(S.O),t.Y36(_.uw),t.Y36(I._W),t.Y36(T.M),t.Y36(P.gz))},i.\u0275cmp=t.Xpm({type:i,selectors:[["app-sold-in-channel"]],decls:20,vars:12,consts:[["description","SKU has been mapped between dealpos and marketplace",3,"headerTitle","onSubmit"],["type","button","data-cy","scanSoldinChannel","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-2",3,"click",4,"ngIf"],["class","btn btn-light shadow rounded ms-2",3,"click",4,"ngIf"],[1,"d-flex"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","multiple","items","ngModel","ngModelChange","clear"],["ng-option-tmp",""],[4,"ngIf"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],["type","text","name","Item_id","id","Item_id",1,"form-control",3,"ngModel","ngModelChange"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","onUpload","onDescEvent","onScan","onCheckBoxChange"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"filter","totaldata","paginationTotal","hasClicked","total","next","previous"]],template:function(n,e){1&n&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(l){return e.searchProduct(l)}),t.TgZ(1,"actions"),t.YNc(2,ut,3,0,"button",1),t.YNc(3,gt,3,1,"button",2),t.YNc(4,_t,3,1,"button",3),t.qZA(),t.TgZ(5,"filters")(6,"div",4)(7,"div",5)(8,"div")(9,"h6"),t._uU(10,"Channel"),t.qZA(),t.TgZ(11,"ng-select",6),t.NdJ("ngModelChange",function(l){return e.searchFilter.ListChannelID=l})("clear",function(){return e.onClearFilterChannel()}),t.YNc(12,mt,3,2,"ng-template",7),t.qZA()(),t.YNc(13,Ct,4,1,"div",8),t.qZA()()(),t.TgZ(14,"content")(15,"div",9)(16,"div",10),t.YNc(17,ft,2,10,"div",11),t.YNc(18,xt,3,0,"ng-container",8),t.qZA(),t.YNc(19,Pt,3,4,"div",12),t.qZA()()()),2&n&&(t.Q6J("headerTitle","Sold in Channel"),t.xp6(2),t.Q6J("ngIf",!e.productService.hasSelection(e.products)),t.xp6(1),t.Q6J("ngIf",e.productService.hasSelection(e.products)),t.xp6(1),t.Q6J("ngIf",e.productService.hasSelection(e.products)),t.xp6(7),t.Q6J("clearable",!0)("multiple",!0)("items",e.channelOptions)("ngModel",e.searchFilter.ListChannelID),t.xp6(2),t.Q6J("ngIf",null!=e.searchFilter.ListChannelID),t.xp6(4),t.Q6J("ngForOf",e.products),t.xp6(1),t.Q6J("ngIf",0==e.products.length),t.xp6(1),t.Q6J("ngIf",null==e.products?null:e.products.length))},dependencies:[p.sg,p.O5,u.Fj,u.JJ,u.On,x.p,C.w9,C.ir,Z.y,k.Y,v.s],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]}),r})();var y=c(4575),St=c(9397),It=c(7398),Tt=c(8695),vt=c(278);function yt(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"button",10),t.NdJ("click",function(){t.CHM(o);const e=t.oxw(2);return t.KtG(e.uploadMultipleProduct())}),t._UZ(1,"i",11),t._uU(2),t.qZA()}if(2&i){const o=t.oxw(2);t.xp6(2),t.hij(" upload (",null==o.selectedProducts?null:o.selectedProducts.length,") ")}}function Mt(i,r){if(1&i){const o=t.EpF();t.ynx(0),t.TgZ(1,"td",27)(2,"input",28),t.NdJ("ngModelChange",function(e){t.CHM(o);const a=t.oxw(2).$implicit;return t.KtG(a.selected=e)})("ngModelChange",function(){t.CHM(o);const e=t.oxw(3).ngIf,a=t.oxw(3);return t.KtG(a.onSelectProduct(e))}),t.qZA()(),t.BQk()}if(2&i){const o=t.oxw(2).$implicit;t.xp6(1),t.Q6J("rowSpan",null==o?null:o.Variants.length),t.xp6(1),t.Q6J("ngModel",o.selected)}}function wt(i,r){if(1&i){const o=t.EpF();t.ynx(0),t.TgZ(1,"img",34),t.NdJ("click",function(e){t.CHM(o);const a=t.oxw(3).$implicit,l=t.oxw(4);return t.KtG(l.onZoomImage(e,null==a?null:a.ImageUrl))}),t.qZA(),t.BQk()}if(2&i){const o=t.oxw(3).$implicit;t.xp6(1),t.Q6J("src",null==o?null:o.ImageUrl,t.LSH)}}function Zt(i,r){1&i&&t._UZ(0,"img",35)}function Ot(i,r){if(1&i&&(t.ynx(0),t.TgZ(1,"td",27)(2,"div",29),t.YNc(3,wt,2,1,"ng-container",7),t.YNc(4,Zt,1,0,"ng-template",null,30,t.W1O),t.qZA()(),t.TgZ(6,"td",31)(7,"h4",32)(8,"span",33),t._uU(9),t.qZA()()(),t.BQk()),2&i){const o=t.MAs(5),n=t.oxw(2).$implicit;t.xp6(1),t.Q6J("rowSpan",null==n?null:n.Variants.length),t.xp6(2),t.Q6J("ngIf",null==n?null:n.ImageUrl)("ngIfElse",o),t.xp6(3),t.Q6J("rowSpan",null==n?null:n.Variants.length),t.xp6(2),t.Q6J("matTooltip",(null==n||null==n.Name?null:n.Name.length)>50?null==n?null:n.Name:""),t.xp6(1),t.hij(" ",null==n?null:n.Name," ")}}function Nt(i,r){if(1&i&&(t.TgZ(0,"div")(1,"a",23),t._UZ(2,"img",36),t.qZA()()),2&i){const o=r.$implicit;t.xp6(1),t.Q6J("href",o.URL,t.LSH),t.xp6(1),t.Q6J("src",o.Img,t.LSH)("matTooltip",o.Name)}}function Ft(i,r){if(1&i&&(t.TgZ(0,"div"),t._UZ(1,"img",36),t.qZA()),2&i){const o=r.$implicit;t.xp6(1),t.Q6J("src",o.Img,t.LSH)("matTooltip",o.Name)}}function At(i,r){if(1&i&&(t.TgZ(0,"tr"),t.YNc(1,Mt,3,2,"ng-container",20),t.YNc(2,Ot,10,6,"ng-container",20),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td")(6,"span"),t._uU(7),t.qZA(),t.TgZ(8,"span",22)(9,"a",23),t._UZ(10,"i",24),t.qZA()()(),t.TgZ(11,"td",25)(12,"div",26),t.YNc(13,Nt,3,3,"div",21),t.qZA()(),t.TgZ(14,"td",25)(15,"div",26),t.YNc(16,Ft,2,2,"div",21),t.qZA()()()),2&i){const o=r.$implicit,n=r.index,e=t.oxw(5);t.xp6(1),t.Q6J("ngIf",0==n),t.xp6(1),t.Q6J("ngIf",0==n),t.xp6(2),t.hij(" ",o.Name," "),t.xp6(3),t.hij(" ",o.Code," "),t.xp6(2),t.Q6J("href","https://"+e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(null==o?null:o.ID),t.LSH),t.xp6(4),t.Q6J("ngForOf",null==o?null:o.Available),t.xp6(3),t.Q6J("ngForOf",null==o?null:o.NotAvailable)}}function kt(i,r){if(1&i&&(t.ynx(0),t.YNc(1,At,17,7,"tr",21),t.BQk()),2&i){const o=r.$implicit;t.xp6(1),t.Q6J("ngForOf",o.Variants)}}function Ut(i,r){if(1&i&&(t.TgZ(0,"tbody"),t.YNc(1,kt,2,1,"ng-container",21),t.qZA()),2&i){const o=r.ngIf;t.xp6(1),t.Q6J("ngForOf",o)}}function Dt(i,r){if(1&i&&(t.ynx(0),t.TgZ(1,"div",12)(2,"table",13)(3,"thead",14)(4,"tr"),t._UZ(5,"th",15),t.TgZ(6,"th",16),t._uU(7,"Product"),t.qZA(),t.TgZ(8,"th",17),t._uU(9,"Variant"),t.qZA(),t.TgZ(10,"th",17),t._uU(11,"SKU"),t.qZA(),t.TgZ(12,"th",18),t._uU(13,"Available In"),t.qZA(),t.TgZ(14,"th",19),t._uU(15,"Not Available In"),t.qZA()()(),t.YNc(16,Ut,2,1,"tbody",20),t.ALo(17,"async"),t.qZA()(),t.BQk()),2&i){const o=t.oxw(2);t.xp6(16),t.Q6J("ngIf",t.lcZ(17,1,o.data$))}}function Jt(i,r){1&i&&(t.TgZ(0,"div",37),t._UZ(1,"app-empty-state"),t.qZA())}function Lt(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"span",45),t.NdJ("click",function(){t.CHM(o);const e=t.oxw(3);return t.KtG(e.getRowCount())}),t.TgZ(1,"i",46),t._uU(2,"?"),t.qZA()()}}function Qt(i,r){if(1&i&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&i){const o=r.ngIf;t.xp6(1),t.Oqu(t.lcZ(2,1,null==o?null:o.Count))}}function qt(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"a",47),t.NdJ("click",function(){t.CHM(o);const e=t.oxw(3);return t.KtG(e.onNextPage())}),t._UZ(1,"i",48),t._uU(2," Next"),t.qZA()}}function Et(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"a",49),t.NdJ("click",function(){t.CHM(o);const e=t.oxw(3);return t.KtG(e.onLastPage())}),t._UZ(1,"i",50),t._uU(2," Last"),t.qZA()}}function Yt(i,r){if(1&i&&(t.TgZ(0,"div",38)(1,"div",39)(2,"div",40),t._uU(3),t.ALo(4,"number"),t.YNc(5,Lt,3,0,"span",41),t.YNc(6,Qt,3,3,"span",20),t.ALo(7,"async"),t._uU(8),t.qZA()(),t.TgZ(9,"div",42),t.YNc(10,qt,3,0,"a",43),t.YNc(11,Et,3,0,"a",44),t.qZA()()),2&i){const o=r.ngIf,n=t.oxw(2);t.xp6(3),t.hij(" Showing 1 - ",t.lcZ(4,6,null==o?null:o.length)," of "),t.xp6(2),t.Q6J("ngIf",n.paginationService.hideCount),t.xp6(1),t.Q6J("ngIf",!n.paginationService.hideCount&&t.lcZ(7,8,n.rowCount$)),t.xp6(2),t.hij(" records ~ ",n.paginationService.footerPageNumber," Page "),t.xp6(2),t.Q6J("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage),t.xp6(1),t.Q6J("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage)}}function Bt(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"mainpanel",1),t.NdJ("onSubmit",function(e){t.CHM(o);const a=t.oxw();return t.KtG(a.searchProduct(e))}),t.TgZ(1,"actions"),t.YNc(2,yt,3,1,"button",2),t.TgZ(3,"button",3),t.NdJ("click",function(){const a=t.CHM(o).ngIf,l=t.oxw();return t.KtG(l.openScanDialog(a))}),t._UZ(4,"i",4),t._uU(5," Scan Channel "),t.qZA()(),t.TgZ(6,"content")(7,"div",5)(8,"div",6),t.YNc(9,Dt,18,3,"ng-container",7),t.ALo(10,"async"),t.YNc(11,Jt,2,0,"ng-template",null,8,t.W1O),t.qZA(),t.YNc(13,Yt,12,10,"div",9),t.ALo(14,"async"),t.qZA()()()}if(2&i){const o=t.MAs(12),n=t.oxw();let e;t.Q6J("hideSearchDropdown",!0),t.xp6(2),t.Q6J("ngIf",n.hasSelectionProduct),t.xp6(7),t.Q6J("ngIf",(null==(e=t.lcZ(10,5,n.data$))?null:e.length)>0)("ngIfElse",o),t.xp6(4),t.Q6J("ngIf",t.lcZ(14,7,n.data$))}}let Vt=(()=>{var i;class r{constructor(n,e,a,l,d,N){this.http=n,this.dialog=e,this.toastr=a,this.productService=l,this.paginationService=d,this.biggerPictureService=N,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannelV2",this.hasSelectionProduct=!1,this.selectedProducts=[]}ngOnInit(){this.initPageLoader(),this.iniData(),this.initHostName()}initHostName(){const n=localStorage.getItem("Authorization");this.hostName=JSON.parse(n)?.Host}initPageLoader(){this.paginationService.fetchDataEndpoint=this.notChannelAPI,this.loader$=this.http.post(`api/${this.loaderAPI}`,{}).pipe((0,St.b)(n=>{this.filterSearch=n.Filter,this.paginationService.reloadPagination(n.Filter)}))}iniData(){this.data$=this.paginationService.data$.pipe((0,It.U)(n=>n.map(e=>(e.Variants=e.Variants.map(a=>(a.Available=this.productService.sortChannel(a.Available),a.NotAvailable=this.productService.sortChannel(a.NotAvailable),a.Available=this.assignLogoChannel(a.Available),a.NotAvailable=this.assignLogoChannel(a.NotAvailable),a)),e))))}assignLogoChannel(n){return n.map(e=>(e.Img=s.g.getChannelLogoByTypeId(e.TypeID),e))}searchProduct(n){this.filterSearch.text=n,this.paginationService.reloadPagination(this.filterSearch)}scanAllProduct(n){let e=this.productService.findChannelById(this.filterSearch.ChannelID,n.Options.Channel);this.productService.scanAll(this.filterSearch.ChannelID,this.filterSearch.ScanFull,this.filterSearch.UpdatedProduct,this.filterSearch.Async).subscribe(a=>{this.filterSearch.Async?this.toastr.success("You will be notified when the scan is completed.","Scan Asynchronous"):(this.productService.successToastrScanAllProduct(a,e,!this.filterSearch.UpdatedProduct),this.initPageLoader())})}openScanDialog(n){let e=JSON.parse(JSON.stringify(this.filterSearch));e.ChannelID=s.g.GuidEMpty,this.dialog.open(m.j,{data:{filter:e,channelOptions:n.Options.Channel},width:"600px"}).afterClosed().pipe((0,g.h)(l=>s.g.IsNotEmpty(l))).subscribe(l=>{this.filterSearch.ChannelID=l.ChannelID,this.filterSearch.ScanFull=l.ScanFull,this.filterSearch.UpdatedProduct=l.UpdatedProduct,this.filterSearch.Async=l.Async,this.scanAllProduct(n)})}getChannelLogoById(n){return s.g.getChannelLogoByTypeId(n)}getRowCount(){this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`/api/${this.rowCountAPI}`,this.filterSearch)}onNextPage(){this.paginationService.onNextPage(this.filterSearch)}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:n=>{this.filterSearch.PageNumber=1,this.paginationService.getAllData(this.filterSearch,n.Count)}})}onZoomImage(n,e){this.biggerPictureService.openBiggerPicture(n,e)}onSelectProduct(n){this.hasSelectionProduct=this.productService.hasSelection(n),this.selectedProducts=this.productService.selectedProduct(n)}uploadMultipleProduct(){let n=this.getUniqueChannels();n=n.map(e=>(e.ID=e.ChannelID,e)),this.dialog.open(w,{width:"700px",data:{title:"Upload Multiple Product",channels:n}}).afterClosed().pipe((0,g.h)(e=>"CANCEL"!==e),(0,f.w)(e=>{const a=this.getSelectedProductIds();return this.productService.uploadNotInChannel(a,e)})).subscribe({next:()=>{this.paginationService.reloadPagination(this.filterSearch),this.selectedProducts=[],this.hasSelectionProduct=!1},error:e=>{this.selectedProducts=[],this.hasSelectionProduct=!1}})}getSelectedProductIds(){return this.selectedProducts.map(e=>({ID:e.ProductID}))}getUniqueChannels(){let n=[];return this.selectedProducts.forEach(e=>{n=[...n,...e.Variants[0].NotAvailable]}),n=n.filter((e,a,l)=>l.findIndex(d=>d.ChannelID==e.ChannelID)==a),n}ngOnDestroy(){this.paginationService.destroy()}}return(i=r).\u0275fac=function(n){return new(n||i)(t.Y36(S.O),t.Y36(_.uw),t.Y36(I._W),t.Y36(T.M),t.Y36(Tt.b),t.Y36(vt.k))},i.\u0275cmp=t.Xpm({type:i,selectors:[["app-not-in-channel"]],decls:2,vars:3,consts:[["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"hideSearchDropdown","onSubmit",4,"ngIf"],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"hideSearchDropdown","onSubmit"],["class","btn btn-light shadow rounded ms-2",3,"click",4,"ngIf"],["data-cy","scanNotinChannel","type","button",1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"container-fluid","mt-3"],[1,"row"],[4,"ngIf","ngIfElse"],["EMPTY",""],["class","d-flex justify-content-between mt-5",4,"ngIf"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-md-12"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[2,"width","10px"],["colspan","2",1,"ms-5","text-center",2,"width","450px"],[2,"width","150px"],[2,"width","20%"],[2,"width","16%"],[4,"ngIf"],[4,"ngFor","ngForOf"],[1,"ms-1"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[2,"padding-left","0px"],[1,"d-flex","flex-wrap","mb-1"],[1,"text-center",3,"rowSpan"],["type","checkbox",3,"ngModel","ngModelChange"],[2,"padding-right","0px"],["elsePic",""],[1,"text-start",3,"rowSpan"],[1,"ms-5","fw-normal","text-ellipsis",2,"max-width","26vw !important"],[3,"matTooltip"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],["alt","",1,"channel-logo","cursor-pointer","ms-4","mt-3",3,"src","matTooltip"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(n,e){1&n&&(t.YNc(0,Bt,15,9,"mainpanel",0),t.ALo(1,"async")),2&n&&t.Q6J("ngIf",t.lcZ(1,1,e.loader$))},dependencies:[p.sg,p.O5,u.Wl,u.JJ,u.On,x.p,M.gM,v.s,p.Ov,p.JJ],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}thead[_ngcontent-%COMP%]{position:sticky;top:0}.channel-logo[_ngcontent-%COMP%]{width:20px}.w-img[_ngcontent-%COMP%]{width:100%}"]}),r})();function Kt(i,r){if(1&i&&(t.TgZ(0,"tr")(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.qZA()()),2&i){const o=r.$implicit;t.xp6(2),t.Oqu(null==o?null:o.Name),t.xp6(2),t.Oqu(null==o?null:o.ChannelVariationSKU)}}let Gt=(()=>{var i;class r{constructor(n,e){this.data=n,this.dialogRef=e}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new U.O,this.modalConfig.title=this.data?.title,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0}}return(i=r).\u0275fac=function(n){return new(n||i)(t.Y36(_.WI),t.Y36(_.so))},i.\u0275cmp=t.Xpm({type:i,selectors:[["app-modal-variants"]],decls:11,vars:2,consts:[[3,"config","onCancel"],["content",""],[1,"table"],[1,"thead-light"],[4,"ngFor","ngForOf"]],template:function(n,e){1&n&&(t.TgZ(0,"modal-material",0),t.NdJ("onCancel",function(){return e.dialogRef.close()}),t.TgZ(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th"),t._uU(6,"Variant"),t.qZA(),t.TgZ(7,"th"),t._uU(8,"SKU"),t.qZA()()(),t.TgZ(9,"tbody"),t.YNc(10,Kt,5,2,"tr",4),t.qZA()()()()),2&n&&(t.Q6J("config",e.modalConfig),t.xp6(10),t.Q6J("ngForOf",e.data.variants))},dependencies:[p.sg,D.M],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}"]}),r})();var J=c(7466);function $t(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"button",14),t.NdJ("click",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.openScanDialog())}),t._UZ(1,"i",15),t._uU(2," Scan Channel "),t.qZA()}}function Ht(i,r){if(1&i){const o=t.EpF();t.ynx(0),t.TgZ(1,"button",16),t.NdJ("click",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.onDownloadAllProduct("SELECTED"))}),t._UZ(2,"i",17),t._uU(3),t.qZA(),t.BQk()}if(2&i){const o=t.oxw();let n;t.xp6(3),t.hij(" Download (",null==(n=o.productService.selectedProduct(o.products))?null:n.length,") ")}}function Rt(i,r){if(1&i&&(t.TgZ(0,"span",18),t._UZ(1,"img",19),t.qZA(),t._uU(2)),2&i){const o=r.item,n=t.oxw();t.xp6(1),t.Q6J("src",n.getChannelLogo(o.TypeID),t.LSH),t.xp6(1),t.hij(" ",o.Name," ")}}const jt=function(i){return[i]},zt=function(){return[]};function Wt(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"div",20)(1,"app-product-card",21),t.NdJ("onCheckBoxChange",function(e){const l=t.CHM(o).index,d=t.oxw();return t.KtG(d.onSelectProduct(e,l))})("onDescEvent",function(){const a=t.CHM(o).index,l=t.oxw();return t.KtG(l.onShowVariantDetail(a))})("onDownload",function(){const a=t.CHM(o).$implicit,l=t.oxw();return t.KtG(l.onDownloadProduct(a))})("onScan",function(){const a=t.CHM(o).$implicit,l=t.oxw();return t.KtG(l.onScanChannel(a))}),t.qZA()()}if(2&i){const o=r.$implicit;t.xp6(1),t.Q6J("showRedirectIcon",!1)("title",null==o?null:o.Name)("image",null==o?null:o.Image)("imageForZoom",null==o?null:o.Image)("code",null==o?null:o.SKU)("description",(null==o||null==o.Variant?null:o.Variant.length)>0?(null==o||null==o.Variant?null:o.Variant.length)+" Variants":null)("downloadButton",!0)("channels",null!=o&&o.Channel?t.VKq(10,jt,null==o?null:o.Channel):t.DdM(12,zt))("showCheckBox",!0)("scanButton",!0)}}function Xt(i,r){1&i&&(t.ynx(0),t.TgZ(1,"div",22),t._UZ(2,"app-empty-state"),t.qZA(),t.BQk())}function tn(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"div",23)(1,"div",24)(2,"app-custom-paginator",25),t.NdJ("total",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.getRowCount())})("next",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.onNextPage())})("previous",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.onPreviousPage())}),t.qZA()()()}if(2&i){const o=t.oxw();t.xp6(2),t.Q6J("filter",o.searchFilter)("totaldata",null==o.products?null:o.products.length)("paginationTotal",o.rowCount)("hasClicked",o.hasClickRowCount)}}let nn=(()=>{var i;class r{constructor(n,e,a,l,d){this.http=n,this.dialog=e,this.productService=a,this.toastrService=l,this.activateRouter=d,this.searchFilter=new F.k,this.products=[],this.hasClickRowCount=!1}ngOnInit(){this.activateRouter.queryParams.subscribe(n=>{this.initPageLoader(n.ID?n.ID:s.g.GuidEMpty)})}initPageLoader(n){this.productService.loader(n).subscribe(e=>{this.channelOptions=e.Options.Channel,this.searchFilter=e.Filter,this.searchFilter.PageSize=e.Filter.RowCount,this.getProducts()})}getProducts(){this.http.post("/api/product/GetProductChannelNotPOS",this.searchFilter).subscribe(n=>{this.products=n.Data,this.mapChannelToProduct(),this.setSkuProduct()})}mapChannelToProduct(){this.products=this.products.map(n=>(n.Channel=JSON.parse(JSON.stringify(this.channelOptions.find(e=>e.ID==n.ChannelID))),n)).map(n=>(n.Channel.Url=n.Url,n))}setSkuProduct(){this.products=this.products.map(n=>(n.SKU=0==n?.Variant?.length?s.g.IsNotEmpty(n?.ChannelItemSKU)?n?.ChannelItemSKU:"SKU not assigned":n?.Variant[0]?.ChannelVariationSKU?n?.Variant[0]?.ChannelVariationSKU:"SKU not assigned",n))}onSearch(n){this.searchFilter.text=n,this.hasClickRowCount=!1,this.getProducts()}onClearChannelFilter(){this.searchFilter.ChannelID=s.g.GuidEMpty}onScanAll(){let n=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(e=>{this.searchFilter.Async?this.toastrService.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.initPageLoader(s.g.GuidEMpty),this.productService.successToastrScanAllProduct(e,n,!this.searchFilter.UpdatedProduct)),this.searchFilter.ChannelID=s.g.GuidEMpty})}openScanDialog(){let n=JSON.parse(JSON.stringify(this.searchFilter));n.ChannelID=s.g.GuidEMpty,this.dialog.open(m.j,{data:{filter:n,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe((0,g.h)(a=>s.g.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ChannelID=a.ChannelID,this.searchFilter.UpdatedProduct=a.UpdatedProduct,this.searchFilter.ScanFull=a.ScanFull,this.searchFilter.Async=a.Async,this.onScanAll()})}onDownloadAllProduct(n){let e;e="ALL"==n?this.products:this.productService.selectedProduct(this.products),e.length>0&&this.productService.downloadMultipleProduct(e).subscribe({next:()=>{this.getProducts()}})}onSelectProduct(n,e){this.products[e].selected=n}onDownloadProduct(n){confirm(`Are you sure you want to Retrieve product ${n?.Name} from ${n?.Channel.Name} to POS?`)&&this.productService.downloadProduct(n).subscribe({next:()=>{this.getProducts()}})}onScanChannel(n){let e=JSON.parse(JSON.stringify(n));delete e.Channel,this.productService.scanCompareToPos([e]).subscribe(a=>{a.Status?(this.initPageLoader(s.g.GuidEMpty),this.toastrService.success(`product ${n.Name} have been successfully scanned and synchronized with POS`,"Success")):this.toastrService.error(`Product ${n.Name} is not existed in POS`,"Error")})}onShowVariantDetail(n){let e=this.products[n].Variant;e.length>0&&this.dialog.open(Gt,{data:{title:this.products[n].Name,variants:e},width:"30%"})}getRowCount(){let n={ChannelID:this.searchFilter.ChannelID,text:this.searchFilter.text,HaveSku:parseInt(this.searchFilter.HaveSku)};this.http.post("/api/product/GetProductChannelNotPOSRowCount",n).subscribe(e=>{this.hasClickRowCount=!0,this.rowCount=e.Count})}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPreviousPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}getChannelLogo(n){return s.g.getChannelLogoByTypeId(n)}}return(i=r).\u0275fac=function(n){return new(n||i)(t.Y36(S.O),t.Y36(_.uw),t.Y36(T.M),t.Y36(I._W),t.Y36(P.gz))},i.\u0275cmp=t.Xpm({type:i,selectors:[["app-not-in-pos"]],decls:32,vars:13,consts:[["headerTitle","Not in POS","textButton","Search","description","SKU sold in Marketplace but not exist in DEALPOS",3,"onSubmit"],["type","button","data-cy","scanNotInPos","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],[4,"ngIf"],[1,"d-flex"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange","clear"],["ng-option-tmp",""],["name","haveSKU",1,"form-control","h-100","pt-3","rounded",3,"ngModel","ngModelChange"],[1,"me-5",3,"value"],["type","text","name","Item_id","id","Item_id","placeholder","item id",1,"form-control",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button","data-cy","scanNotInPos",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","ms-3",3,"click"],[1,"fa","fa-download"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"showRedirectIcon","title","image","imageForZoom","code","description","downloadButton","channels","showCheckBox","scanButton","onCheckBoxChange","onDescEvent","onDownload","onScan"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"filter","totaldata","paginationTotal","hasClicked","total","next","previous"]],template:function(n,e){1&n&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(l){return e.onSearch(l)}),t.TgZ(1,"actions"),t.YNc(2,$t,3,0,"button",1),t.YNc(3,Ht,4,1,"ng-container",2),t.qZA(),t.TgZ(4,"filters")(5,"div",3)(6,"div",4)(7,"div")(8,"h6"),t._uU(9,"Channel"),t.qZA(),t.TgZ(10,"ng-select",5),t.NdJ("ngModelChange",function(l){return e.searchFilter.ChannelID=l})("clear",function(){return e.onClearChannelFilter()}),t.YNc(11,Rt,3,2,"ng-template",6),t.qZA()(),t.TgZ(12,"div")(13,"h6"),t._uU(14,"SKU Assigned"),t.qZA(),t.TgZ(15,"mat-radio-group",7),t.NdJ("ngModelChange",function(l){return e.searchFilter.HaveSku=l}),t.TgZ(16,"mat-radio-button",8),t._uU(17," All "),t.qZA(),t.TgZ(18,"mat-radio-button",8),t._uU(19," Yes "),t.qZA(),t.TgZ(20,"mat-radio-button",8),t._uU(21," No "),t.qZA()()(),t.TgZ(22,"div")(23,"h6"),t._uU(24,"Item ID"),t.qZA(),t.TgZ(25,"input",9),t.NdJ("ngModelChange",function(l){return e.searchFilter.Item_id=l}),t.qZA()()()()(),t.TgZ(26,"content")(27,"div",10)(28,"div",11),t.YNc(29,Wt,2,13,"div",12),t.YNc(30,Xt,3,0,"ng-container",2),t.qZA(),t.YNc(31,tn,3,4,"div",13),t.qZA()()()),2&n&&(t.xp6(2),t.Q6J("ngIf",!e.productService.hasSelection(e.products)),t.xp6(1),t.Q6J("ngIf",e.productService.hasSelection(e.products)),t.xp6(7),t.Q6J("clearable",!0)("items",e.channelOptions)("ngModel",e.searchFilter.ChannelID),t.xp6(5),t.Q6J("ngModel",e.searchFilter.HaveSku),t.xp6(1),t.Q6J("value",0),t.xp6(2),t.Q6J("value",1),t.xp6(2),t.Q6J("value",2),t.xp6(5),t.Q6J("ngModel",e.searchFilter.Item_id),t.xp6(4),t.Q6J("ngForOf",e.products),t.xp6(1),t.Q6J("ngIf",0==e.products.length),t.xp6(1),t.Q6J("ngIf",(null==e.products?null:e.products.length)>0))},dependencies:[p.sg,p.O5,u.Fj,u.JJ,u.On,x.p,C.w9,C.ir,J.VQ,J.U0,Z.y,k.Y,v.s],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.itemTitle[_ngcontent-%COMP%]{cursor:pointer}"]}),r})();var Y=c(208);function en(i,r){if(1&i&&(t.TgZ(0,"span",8),t._UZ(1,"img",9),t.qZA(),t._uU(2)),2&i){const o=r.item,n=t.oxw();t.xp6(1),t.Q6J("src",n.getChannelLogo(o.TypeID),t.LSH),t.xp6(1),t.hij(" ",o.Name," ")}}function on(i,r){if(1&i&&(t.TgZ(0,"div",10),t._UZ(1,"app-duplicate-product-card",11),t.qZA()),2&i){const o=r.$implicit,n=r.index;t.xp6(1),t.Q6J("imageForZoom",o.ImageUrl)("title",o.Name)("code",o.Code)("id",n)("image",o.ThumbnailURL)("channels",o.Channel)}}function an(i,r){1&i&&(t.ynx(0),t.TgZ(1,"div",12),t._UZ(2,"app-empty-state"),t.qZA(),t.BQk())}function ln(i,r){if(1&i){const o=t.EpF();t.ynx(0),t.TgZ(1,"div",13)(2,"div",14)(3,"app-custom-paginator",15),t.NdJ("next",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.onNextPage())})("previous",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.onPrevPage())})("total",function(){t.CHM(o);const e=t.oxw();return t.KtG(e.getRowCount())}),t.qZA()()(),t.BQk()}if(2&i){const o=t.oxw();t.xp6(3),t.Q6J("filter",o.searchFilter)("totaldata",null==o.products?null:o.products.length)("paginationTotal",o.rowCount)("hasClicked",o.hasClickedRowCount)}}let rn=(()=>{var i;class r{constructor(n,e){this.httpService=n,this.productService=e,this.searchFilter=new F.k,this.products=[],this.hasClickedRowCount=!1,this.getPageLoader()}getPageLoader(){this.productService.loader().subscribe(n=>{this.searchFilter=n.Filter,this.searchFilter.PageSize=n.Filter.RowCount,this.channelOptions=n.Options.Channel,this.getProducts()})}getProducts(){this.httpService.post("/api/product/GetDuplicateInChannel",{ChannelID:this.searchFilter.ChannelID,RowCount:this.searchFilter.RowCount,PageNumber:this.searchFilter.PageNumber,text:this.searchFilter.text}).subscribe(e=>{this.products=e.Data})}onSearch(n){this.searchFilter.text=n,this.hasClickedRowCount=!1,this.getProducts()}onClearFilter(){this.searchFilter.ChannelID=s.g.GuidEMpty}getChannelLogo(n){return s.g.getChannelLogoByTypeId(n)}onNextPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber+1,this.getProducts()}onPrevPage(){this.searchFilter.PageNumber=this.searchFilter.PageNumber-1,this.getProducts()}getRowCount(){this.httpService.post("/api/product/GetDuplicateInChannelRowCount",{text:this.searchFilter.text,ChannelID:this.searchFilter.ChannelID}).subscribe(e=>{this.hasClickedRowCount=!0,this.rowCount=e.Total})}}return(i=r).\u0275fac=function(n){return new(n||i)(t.Y36(S.O),t.Y36(T.M))},i.\u0275cmp=t.Xpm({type:i,selectors:[["app-duplicate-sku"]],decls:14,vars:6,consts:[["headerTitle","Multiple Listed SKU","textButton"," Search","description","SKU(s) which is listed more than one time (one to many)",3,"onSubmit"],["container",""],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange","clear"],["ng-option-tmp",""],[1,"container-fluid"],[1,"row","mt-8","mx-1"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"imageForZoom","title","code","id","image","channels"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"filter","totaldata","paginationTotal","hasClicked","next","previous","total"]],template:function(n,e){1&n&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(l){return e.onSearch(l)}),t.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),t._uU(5,"Channel"),t.qZA(),t.TgZ(6,"ng-select",2),t.NdJ("ngModelChange",function(l){return e.searchFilter.ChannelID=l})("clear",function(){return e.onClearFilter()}),t.YNc(7,en,3,2,"ng-template",3),t.qZA()()()(),t.TgZ(8,"content")(9,"div",4)(10,"div",5),t.YNc(11,on,2,6,"div",6),t.YNc(12,an,3,0,"ng-container",7),t.qZA(),t.YNc(13,ln,4,4,"ng-container",7),t.qZA()()()),2&n&&(t.xp6(6),t.Q6J("clearable",!0)("items",e.channelOptions)("ngModel",e.searchFilter.ChannelID),t.xp6(5),t.Q6J("ngForOf",e.products),t.xp6(1),t.Q6J("ngIf",0==(null==e.products?null:e.products.length)),t.xp6(1),t.Q6J("ngIf",(null==e.products?null:e.products.length)>0))},dependencies:[p.sg,p.O5,u.JJ,u.On,x.p,C.w9,C.ir,Y._,Z.y,v.s]}),r})();var cn=c(1476);function sn(i,r){if(1&i&&(t.ynx(0),t._uU(1),t.BQk()),2&i){const o=t.oxw().$implicit;t.xp6(1),t.hij(" ",o.Count," ")}}function dn(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"span",26),t.NdJ("click",function(){t.CHM(o);const e=t.oxw().$implicit,a=t.oxw(2);return t.KtG(a.getLiveProductCount(e.ID,e))}),t._UZ(1,"i",27),t.qZA()}}const pn=function(){return["/menu/products/status/sold-in-channel"]},B=function(i){return{ID:i}},hn=function(){return["/menu/products/status/not-in-pos"]};function un(i,r){if(1&i){const o=t.EpF();t.TgZ(0,"tr")(1,"td"),t._UZ(2,"img",16),t.TgZ(3,"span",17),t._uU(4),t.qZA()(),t.TgZ(5,"td",18),t.YNc(6,sn,2,1,"ng-container",4),t.YNc(7,dn,2,0,"ng-template",null,19,t.W1O),t.qZA(),t.TgZ(9,"td",18)(10,"a",20),t._uU(11),t.ALo(12,"number"),t.qZA()(),t.TgZ(13,"td",18)(14,"a",20),t._uU(15),t.ALo(16,"number"),t.qZA()(),t.TgZ(17,"td"),t._uU(18),t.ALo(19,"date"),t.qZA(),t.TgZ(20,"td")(21,"div",21)(22,"button",22),t.NdJ("click",function(){const a=t.CHM(o).$implicit,l=t.oxw(2);return t.KtG(l.onScanChannel(a))}),t._UZ(23,"i",23),t._uU(24," Scan "),t.qZA(),t.TgZ(25,"button",24),t.NdJ("click",function(){const a=t.CHM(o).$implicit,l=t.oxw(2);return t.KtG(l.onClearCache(a.ID))}),t._UZ(26,"i",25),t._uU(27," Clear "),t.qZA()()()()}if(2&i){const o=r.$implicit,n=t.MAs(8),e=t.oxw(2);t.xp6(2),t.Q6J("src",e.getChannelLogo(o.TypeID),t.LSH),t.xp6(2),t.Oqu(o.Name),t.xp6(2),t.Q6J("ngIf",void 0!==o.Count)("ngIfElse",n),t.xp6(4),t.Q6J("routerLink",t.DdM(18,pn))("queryParams",t.VKq(19,B,o.ID)),t.xp6(1),t.hij(" ",t.lcZ(12,11,o.SoldInChannel)," "),t.xp6(3),t.Q6J("routerLink",t.DdM(21,hn))("queryParams",t.VKq(22,B,o.ID)),t.xp6(1),t.hij(" ",t.lcZ(16,13,o.NotInPOS)," "),t.xp6(3),t.hij("",o.LastSync?t.xi3(19,15,o.LastSync,"dd MMM yyyy HH:mm"):"-"," ")}}function gn(i,r){if(1&i&&(t.ynx(0),t.TgZ(1,"div",6)(2,"table",7)(3,"thead",8)(4,"tr",9)(5,"th"),t._uU(6,"Channel"),t.qZA(),t.TgZ(7,"th",10),t._uU(8,"Live Product"),t.qZA(),t.TgZ(9,"th",11),t._uU(10,"Sold In Channel"),t.qZA(),t.TgZ(11,"th",12),t._uU(12,"Product Not in POS"),t.qZA(),t.TgZ(13,"th",13),t._uU(14,"Last Sync"),t.qZA(),t._UZ(15,"th",14),t.qZA()(),t.TgZ(16,"tbody"),t.YNc(17,un,28,24,"tr",15),t.ALo(18,"async"),t.qZA()()(),t.BQk()),2&i){const o=t.oxw();let n;t.xp6(17),t.Q6J("ngForOf",null==(n=t.lcZ(18,1,o.channels$))?null:n.Data)}}function _n(i,r){1&i&&(t.TgZ(0,"div",28),t._UZ(1,"app-empty-state"),t.qZA())}let mn=(()=>{var i;class r{constructor(n,e,a){this.productService=n,this.toastr=e,this.dialog=a,this.destroy$=new E.x}ngOnInit(){this.setObsProductStatistic(),this.initPageLoader()}initPageLoader(){this.productService.loader().pipe((0,A.R)(this.destroy$)).subscribe(n=>{this.channelOptions=n?.Options?.Channel})}setObsProductStatistic(){this.channels$=this.productService.getProductStatistic()}getLiveProductCount(n,e){this.productService.getTotalProductLive(n).pipe((0,A.R)(this.destroy$)).subscribe(a=>{e.Count=a.Count})}onScanChannel(n){this.dialog.open(m.j,{width:"700px",data:{channelOptions:this.channelOptions,filter:{ChannelID:n.ID},disabledChannelOption:!0}}).afterClosed().pipe((0,g.h)(e=>s.g.IsNotEmpty(e))).subscribe(e=>{this.scanAllProduct(n.ID,e)})}scanAllProduct(n,e){let a=this.productService.findChannelById(n,this.channelOptions);this.productService.scanAll(e.ChannelID,e.ScanFull,e.UpdatedProduct,e.Async).pipe((0,g.h)(l=>l)).subscribe(l=>{e.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(l,a,!e.UpdatedProduct),this.initPageLoader(),this.setObsProductStatistic())})}onClearCache(n){confirm("Are you sure you want to Clear Cache? This Process will remove your product integration to marketplace")&&this.productService.clearCacheChannel(n).pipe((0,A.R)(this.destroy$)).subscribe(a=>{this.toastr.success("Successfully cleared cache","Success"),this.initPageLoader(),this.setObsProductStatistic()})}getChannelLogo(n){return s.g.getChannelLogoByTypeId(n)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}}return(i=r).\u0275fac=function(n){return new(n||i)(t.Y36(T.M),t.Y36(I._W),t.Y36(_.uw))},i.\u0275cmp=t.Xpm({type:i,selectors:[["app-channel-statistic"]],decls:9,vars:6,consts:[["headerTitle","Products Statistic",3,"hideSearchBox","hideSearchDropdown"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],["EMPTY",""],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[1,"text-center",2,"width","13rem"],[1,"text-center",2,"width","9rem"],[1,"text-center",2,"width","14rem"],[2,"width","10rem"],[2,"width","12rem"],[4,"ngFor","ngForOf"],[2,"width","24px","height","24px",3,"src"],[1,"ms-3"],[1,"text-center"],["QUESTION",""],[3,"routerLink","queryParams"],[1,"d-flex","align-items-center","justify-content-center"],[1,"btn","btn-sm","btn-secondary","fs-6",3,"click"],[1,"fa","fa-spinner"],[1,"btn","btn-sm","btn-secondary","fs-6","ms-3",3,"click"],[1,"fa","fa-trash"],["matTooltip","Click to see total live product",1,"cursor-pointer","fs-5","text-primary",3,"click"],[1,"fa-solid","fa-circle-question","cursor"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(n,e){if(1&n&&(t.TgZ(0,"mainpanel",0)(1,"content")(2,"div",1)(3,"div",2)(4,"div",3),t.YNc(5,gn,19,3,"ng-container",4),t.ALo(6,"async"),t.YNc(7,_n,2,0,"ng-template",null,5,t.W1O),t.qZA()()()()()),2&n){const a=t.MAs(8);let l;t.Q6J("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(5),t.Q6J("ngIf",(null==(l=t.lcZ(6,4,e.channels$))||null==l.Data?null:l.Data.length)>0)("ngIfElse",a)}},dependencies:[p.sg,p.O5,x.p,M.gM,P.rH,v.s,p.Ov,p.JJ,p.uU]}),r})();var Cn=c(3680);const fn=[{component:K,path:"",children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:ht,canActivate:[y.a],data:{title:"Products in POS"}},{path:"sold-in-channel",component:bt,canActivate:[y.a],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:Vt,canActivate:[y.a],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:nn,canActivate:[y.a],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:rn,canActivate:[y.a],data:{title:"Duplicate Sku in Channel"}},{path:"channel-statistic",component:mn,canActivate:[y.a],data:{title:"Channel Statistic"}}]}];let xn=(()=>{var i;class r{}return(i=r).\u0275fac=function(n){return new(n||i)},i.\u0275mod=t.oAB({type:i}),i.\u0275inj=t.cJS({imports:[p.ez,u.u5,x.R,M.AV,C.A0,cn.TU,J.Fk,Q.Z,Y._,Z.y,k.Y,P.Bz.forChild(fn),O.FA,Cn.XK]}),r})()}}]);
|