marketplacepos 3.19.3 → 3.20.1
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/3rdpartylicenses.txt +12 -12
- package/Marketplace/{chunk-O5MOPAT5.js → chunk-2E5AKA74.js} +1 -1
- package/Marketplace/chunk-2FRMUOJY.js +15 -0
- package/Marketplace/{chunk-ZWDUUAFA.js → chunk-2L6CZFW7.js} +1 -1
- package/Marketplace/{chunk-CTKEWRX4.js → chunk-2SC3HO66.js} +1 -1
- package/Marketplace/chunk-2V4K6SEC.js +1 -0
- package/Marketplace/{chunk-CHPESC5O.js → chunk-33L2SBIN.js} +1 -1
- package/Marketplace/chunk-47PEHCOU.js +1 -0
- package/Marketplace/{chunk-3XWOT6GZ.js → chunk-4CEFDQPI.js} +1 -1
- package/Marketplace/{chunk-E4XM7VHY.js → chunk-4O74KBBT.js} +1 -1
- package/Marketplace/{chunk-JKF36COK.js → chunk-5HY6FBUD.js} +1 -1
- package/Marketplace/{chunk-S36U4I4O.js → chunk-65RMQ5Q5.js} +1 -1
- package/Marketplace/{chunk-ATJPUUZQ.js → chunk-6UDYSYXW.js} +1 -1
- package/Marketplace/{chunk-AHA2WBEK.js → chunk-7V2SU4MA.js} +1 -1
- package/Marketplace/{chunk-WVKDNFEM.js → chunk-7VKIP3Z6.js} +2 -2
- package/Marketplace/chunk-7WUKCDMC.js +1 -0
- package/Marketplace/{chunk-K6H25CD6.js → chunk-7YWHTN3X.js} +1 -1
- package/Marketplace/{chunk-W3POM6UQ.js → chunk-A37OKNC2.js} +1 -1
- package/Marketplace/{chunk-HRB6G2LU.js → chunk-ALKBIH7J.js} +2 -2
- package/Marketplace/{chunk-4URWFKAM.js → chunk-BGWVHGAY.js} +1 -1
- package/Marketplace/{chunk-3LSSEMTW.js → chunk-BKFG7NIB.js} +1 -1
- package/Marketplace/{chunk-M4JG6342.js → chunk-BTY6PS53.js} +1 -1
- package/Marketplace/chunk-BZPMSXEO.js +9 -0
- package/Marketplace/{chunk-4QK7Y7R2.js → chunk-C6QIBOCB.js} +1 -1
- package/Marketplace/{chunk-3TNPJNQS.js → chunk-CJILX5R7.js} +1 -1
- package/Marketplace/{chunk-PYBQPNRY.js → chunk-D6L7HUOY.js} +1 -1
- package/Marketplace/{chunk-3ZQBMP7R.js → chunk-D76K4RZ7.js} +1 -1
- package/Marketplace/chunk-DA5WII5E.js +2 -0
- package/Marketplace/{chunk-GXHE2CDH.js → chunk-DQIP7MCZ.js} +1 -1
- package/Marketplace/{chunk-73DE2GZF.js → chunk-DYLT6RRK.js} +1 -1
- package/Marketplace/{chunk-GP6U42SV.js → chunk-E5BOLHDG.js} +1 -1
- package/Marketplace/{chunk-3UKBESDQ.js → chunk-EGYILQWG.js} +1 -1
- package/Marketplace/{chunk-6NTRXLMW.js → chunk-EIBGI6U2.js} +1 -1
- package/Marketplace/{chunk-GEOZCTY6.js → chunk-EN6KXWCY.js} +1 -1
- package/Marketplace/chunk-EXZPDDOY.js +1 -0
- package/Marketplace/{chunk-X4WLRMDP.js → chunk-FTHTFVHH.js} +1 -1
- package/Marketplace/{chunk-XNGU3O4O.js → chunk-GNY5TY3R.js} +1 -1
- package/Marketplace/{chunk-RVVTVU4B.js → chunk-GQG2K3LS.js} +1 -1
- package/Marketplace/{chunk-2ORPFPW3.js → chunk-HCJ6C5OR.js} +1 -1
- package/Marketplace/{chunk-PBJG5QAA.js → chunk-HHIG3XFB.js} +1 -1
- package/Marketplace/{chunk-G3NZDAHG.js → chunk-HOTEJTGP.js} +1 -1
- package/Marketplace/chunk-IG57OCJS.js +9 -0
- package/Marketplace/{chunk-FZDYEHNC.js → chunk-IIPI4CHY.js} +1 -1
- package/Marketplace/chunk-JEC3SZTG.js +1 -0
- package/Marketplace/{chunk-NVF24LK5.js → chunk-JHYIHRQH.js} +1 -1
- package/Marketplace/{chunk-IIANF3VA.js → chunk-JUWM7ABO.js} +1 -1
- package/Marketplace/{chunk-WH3FZ3VM.js → chunk-JY3L4RUM.js} +1 -1
- package/Marketplace/{chunk-44IWQ2WK.js → chunk-KZ6AD6KW.js} +1 -1
- package/Marketplace/{chunk-KGSUB5OH.js → chunk-L4BFVIW5.js} +1 -1
- package/Marketplace/{chunk-2C32PU5X.js → chunk-LAQL3BQZ.js} +1 -1
- package/Marketplace/chunk-MADSP2BP.js +52 -0
- package/Marketplace/{chunk-VZHIFACR.js → chunk-MKJON4UM.js} +1 -1
- package/Marketplace/{chunk-BH2R22DH.js → chunk-ML2BGDS4.js} +1 -1
- package/Marketplace/{chunk-3ORAGDUV.js → chunk-MZNSPLFO.js} +1 -1
- package/Marketplace/{chunk-XMQ2CMLS.js → chunk-NAZU3HCR.js} +1 -1
- package/Marketplace/chunk-NNXYTNL6.js +1 -0
- package/Marketplace/{chunk-OIQXRKAG.js → chunk-OTR5MBON.js} +1 -1
- package/Marketplace/{chunk-BTXJZOGD.js → chunk-PTFQX4VB.js} +1 -1
- package/Marketplace/{chunk-ACYUSHMS.js → chunk-PYD2YWAN.js} +1 -1
- package/Marketplace/chunk-QNEE46MU.js +3 -0
- package/Marketplace/{chunk-NF2ANZGK.js → chunk-QYY5XVLP.js} +1 -1
- package/Marketplace/{chunk-LVFJFYVO.js → chunk-RDSLGGC4.js} +1 -1
- package/Marketplace/{chunk-4ULJZM2I.js → chunk-SQTY2CZY.js} +1 -1
- package/Marketplace/{chunk-AUCIW6VR.js → chunk-TE62OPBT.js} +1 -1
- package/Marketplace/{chunk-IDJG7E4L.js → chunk-TVRLQACG.js} +1 -1
- package/Marketplace/{chunk-FMYZSZEX.js → chunk-ULELZXI5.js} +1 -1
- package/Marketplace/{chunk-R6PEAOIJ.js → chunk-V64ZU2C6.js} +1 -1
- package/Marketplace/{chunk-ONKOEBKR.js → chunk-VBCIYCOF.js} +1 -1
- package/Marketplace/{chunk-4YCZLOHQ.js → chunk-WKSTGJK5.js} +1 -1
- package/Marketplace/{chunk-I7OLAB5O.js → chunk-WTMUHE4V.js} +1 -1
- package/Marketplace/{chunk-WUCXNOY6.js → chunk-XG2DR4LW.js} +1 -1
- package/Marketplace/{chunk-URIDNNCK.js → chunk-XQQPMC44.js} +1 -1
- package/Marketplace/chunk-XUOIJTB4.js +1 -0
- package/Marketplace/{chunk-LV34VUJQ.js → chunk-XUSY2QT2.js} +1 -1
- package/Marketplace/{chunk-JHJNKEH6.js → chunk-XWXDJLRN.js} +1 -1
- package/Marketplace/{chunk-K62KUEI5.js → chunk-XYJNR26Y.js} +1 -1
- package/Marketplace/{chunk-YJFARXIC.js → chunk-YCTTFHDT.js} +1 -1
- package/Marketplace/{chunk-CGUWFGH3.js → chunk-YCVNABR6.js} +1 -1
- package/Marketplace/chunk-YVTEU2IF.js +14 -0
- package/Marketplace/chunk-ZA7FXMFZ.js +3 -0
- package/Marketplace/chunk-ZIZWZZ4E.js +8 -0
- package/Marketplace/chunk-ZX3SBNZT.js +3 -0
- package/Marketplace/index.html +3 -3
- package/Marketplace/{main-UMNDP57A.js → main-AEC57EMC.js} +1 -1
- package/package.json +1 -1
- package/Marketplace/chunk-6UK5EDKC.js +0 -5
- package/Marketplace/chunk-76GYL4GA.js +0 -1
- package/Marketplace/chunk-BFEEK5YU.js +0 -1
- package/Marketplace/chunk-BLH75XXY.js +0 -9
- package/Marketplace/chunk-CSYQB3ZA.js +0 -1
- package/Marketplace/chunk-HSFUKC7R.js +0 -8
- package/Marketplace/chunk-KRKQFGMS.js +0 -1
- package/Marketplace/chunk-NEQN5BMS.js +0 -15
- package/Marketplace/chunk-SNTDL3ZC.js +0 -22
- package/Marketplace/chunk-X6J6RWD3.js +0 -1
- package/Marketplace/chunk-XH22CID4.js +0 -2
- package/Marketplace/chunk-ZPFSBV72.js +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Z}from"./chunk-
|
|
1
|
+
import{a as Z}from"./chunk-TE62OPBT.js";import{a as Y}from"./chunk-65RMQ5Q5.js";import{b as ee,c as V}from"./chunk-MZNSPLFO.js";import"./chunk-BVIRHZTZ.js";import{b as X}from"./chunk-ULELZXI5.js";import"./chunk-E5BOLHDG.js";import"./chunk-A37OKNC2.js";import"./chunk-C6QIBOCB.js";import{a as Q}from"./chunk-7VKIP3Z6.js";import"./chunk-DYLT6RRK.js";import"./chunk-D76K4RZ7.js";import"./chunk-EIBGI6U2.js";import{g as q}from"./chunk-LAQL3BQZ.js";import{b as $,e as H}from"./chunk-JHYIHRQH.js";import"./chunk-KCDL7SWP.js";import{d as z,m as J,n as K}from"./chunk-4CEFDQPI.js";import"./chunk-2SC3HO66.js";import"./chunk-DQIP7MCZ.js";import{c as U,h as j,m as k,o as G,y as W}from"./chunk-2E5AKA74.js";import"./chunk-FTHTFVHH.js";import{B as F,Bc as B,Ec as I,Fc as O,Ja as u,Jb as f,Ka as h,Nb as v,Ob as y,Pb as D,Q as T,Qb as R,Rb as L,X as M,_a as w,ab as P,ac as C,bc as x,da as N,ga as E,mb as a,nb as m,oa as s,ob as b,pa as l,sb as S,vb as g,xb as o,yc as A}from"./chunk-ZIZWZZ4E.js";import"./chunk-GNOSNGXM.js";function te(r,c){if(r&1){let i=S();a(0,"button",15),g("click",function(){s(i);let e=o().ngIf,n=o(2);return l(n.onUpdateItems(e))}),b(1,"i",16),f(2," Update "),m()}}function ie(r,c){if(r&1&&(a(0,"div"),w(1,te,3,0,"button",14),m()),r&2){let i=c.ngIf,t=o(2);u(),P("ngIf",t.productService.hasSelectionVariant(i))}}function ne(r,c){if(r&1){let i=S();a(0,"mainpanel",1),g("onSubmit",function(e){s(i);let n=o();return l(n.onSearch(e))}),a(1,"actions")(2,"div",2),w(3,ie,2,1,"div",3),C(4,"async"),a(5,"button",4),g("click",function(){s(i);let e=o();return l(e.openExportDialog())}),b(6,"i",5),a(7,"span"),f(8,"Export"),m()()()(),a(9,"filters")(10,"div")(11,"label",6),f(12,"Page Number"),m(),a(13,"input",7),D("ngModelChange",function(e){s(i);let n=o();return y(n.searchFilter.PageNumber,e)||(n.searchFilter.PageNumber=e),l(e)}),m()(),a(14,"div",8)(15,"label",6),f(16,"Page Size"),m(),a(17,"input",7),D("ngModelChange",function(e){s(i);let n=o();return y(n.searchFilter.RowCount,e)||(n.searchFilter.RowCount=e),l(e)}),m()()(),a(18,"content")(19,"div",9)(20,"div",10)(21,"div",11)(22,"app-table",12),C(23,"async"),g("onToggle",function(e){s(i);let n=o();return l(n.onShowDifferencePrice(e))})("onSubmit",function(e){s(i);let n=o();return l(n.updatePriceByVariant(e))}),m(),a(24,"infinite-paginator",13),C(25,"async"),g("onNextPage",function(){s(i);let e=o();return l(e.infinitePagination.onNextPage(e.searchFilter))})("onLastPage",function(){s(i);let e=o();return l(e.infinitePagination.onLastPage(e.searchFilter))})("onGetRowCount",function(){s(i);let e=o();return l(e.infinitePagination.getRowCount(e.searchFilter))}),m()()()()()()}if(r&2){let i=o();P("textButton","Search"),u(3),P("ngIf",x(4,14,i.data$)),u(10),v("ngModel",i.searchFilter.PageNumber),u(4),v("ngModel",i.searchFilter.RowCount),u(5),P("showProductToggle",!0)("data",x(23,16,i.data$))("channel",i.channelOptions)("hiddenIPOSInventory",!1),u(2),P("totalData",i.infinitePagination.totalData())("hideCount",i.infinitePagination.hideCount())("rowCount",x(25,18,i.infinitePagination.totalRowCount$))("pageNumber",i.infinitePagination.pageNumber())("disableNextButton",i.infinitePagination.disableNextButton())("goToLastPage",i.infinitePagination.isLastPage())}}var ve=(()=>{let c=class c{constructor(t,e,n,_,d,p){this.http=t,this.toastr=e,this.dialog=n,this.productService=_,this.authService=d,this.decimalPipe=p,this.infinitePagination=N(V),this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.data$=this.infinitePagination.data$.pipe(T()),this.pageData={Title:"Price",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!0},{Title:"Price Realtime",Url:"/menu/price/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.getDataAPI,this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe(M(t=>{t.Filter={PageNumber:t.Filter.PageNumber,RowCount:t.Filter.RowCount,filterModel:1},this.searchFilter=t.Filter,this.infinitePagination.reloadPagination(this.searchFilter)}))}onShowDifferencePrice(t){this.searchFilter.filterModel=1,t&&(this.searchFilter.filterModel=3),this.infinitePagination.reloadPagination(this.searchFilter)}onSearch(t){this.searchFilter.text=t,this.infinitePagination.reloadPagination(this.searchFilter)}updatePrice(t){let e=this.productService.selectedVariantProduct(t);if(e.length>0){let _=e.map(p=>({ID:p.ID,Code:p.Code,Price:p.UnitPrice}));var n=this.channelOptions.filter(p=>p.selected).map(p=>p.ID);let d={ListChannelID:n,ListPrice:_};this.http.post("/api/Price/UpdateChannel",d).subscribe(p=>{this.infinitePagination.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+d.ListPrice.length+" items in "+d.ListChannelID.length+" channels","Success")})}}updatePriceByVariant(t){let e={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,Price:t.Price-0,VariantID:t.ID};this.http.post("/api/Price/UpdatePriceByID",e).subscribe(n=>{let _=this.productService.findChannelById(e.ID,this.channelOptions),d=e.Price?this.decimalPipe.transform(e.Price):e.Price;this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") price in "+_.Name+" to "+d,"Success"),this.infinitePagination.reloadPagination(this.searchFilter)})}onUpdateItems(t){let e=this.productService.selectedVariantProduct(t);this.dialog.open(Y,{data:{selectedItems:e,channels:this.channelOptions},width:"600px"}).afterClosed().pipe(F(n=>n!==void 0)).subscribe(n=>{this.channelOptions=n,this.updatePrice(t)})}openExportDialog(){this.dialog.open(X,{data:{title:"Export Multi Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportMultipleChannelComparison"}}).afterClosed().subscribe()}};c.\u0275fac=function(e){return new(e||c)(h(H),h($),h(z),h(Q),h(q),h(I))},c.\u0275cmp=E({type:c,selectors:[["app-price-pos-channel"]],standalone:!0,features:[R([V,I]),L],decls:2,vars:3,consts:[["headerTitle","Price Comparison",3,"textButton","onSubmit",4,"ngIf"],["headerTitle","Price Comparison",3,"onSubmit","textButton"],[1,"d-flex"],[4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"mt-5"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"onToggle","onSubmit","showProductToggle","data","channel","hiddenIPOSInventory"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"]],template:function(e,n){e&1&&(w(0,ne,26,20,"mainpanel",0),C(1,"async")),e&2&&P("ngIf",x(1,1,n.loader$))},dependencies:[O,A,B,W,U,G,j,k,ee,K,J,Z],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let r=c;return r})();export{ve as PricePosChannelComponent};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{a as ee}from"./chunk-HHIG3XFB.js";import"./chunk-6U6JR5K6.js";import{a as $t,d as Zt,e as Xt}from"./chunk-YVTEU2IF.js";import{a as ht}from"./chunk-BVIRHZTZ.js";import{a as le,b as pe,c as vt}from"./chunk-33L2SBIN.js";import{a as se}from"./chunk-BGWVHGAY.js";import{b as Rt}from"./chunk-ULELZXI5.js";import"./chunk-E5BOLHDG.js";import"./chunk-A37OKNC2.js";import{a as Bt,b as zt,c as Gt,d as jt,e as Ht,f as Ut,g as Yt}from"./chunk-L4BFVIW5.js";import"./chunk-GNY5TY3R.js";import{a as Dt,b as Et}from"./chunk-7YWHTN3X.js";import"./chunk-CJILX5R7.js";import{i as qt}from"./chunk-2FRMUOJY.js";import{a as Jt,b as Kt}from"./chunk-C6QIBOCB.js";import{a as me,b as Tt}from"./chunk-47PEHCOU.js";import{f as kt,g as Lt,h as Vt,i as Ft,j as At}from"./chunk-KZ6AD6KW.js";import{a as Ot}from"./chunk-7VKIP3Z6.js";import"./chunk-DYLT6RRK.js";import{a as Q}from"./chunk-WTMUHE4V.js";import{b as Wt}from"./chunk-MKJON4UM.js";import{b as Mt}from"./chunk-WKSTGJK5.js";import{a as Pt,b as It,c as Nt}from"./chunk-GQG2K3LS.js";import{a as ge}from"./chunk-XG2DR4LW.js";import"./chunk-BTY6PS53.js";import"./chunk-EIBGI6U2.js";import{a as re,b as oe,c as gt,d as X,e as _t}from"./chunk-PYD2YWAN.js";import{f as ce,g as Z}from"./chunk-LAQL3BQZ.js";import{b as Te,e as A}from"./chunk-JHYIHRQH.js";import"./chunk-KCDL7SWP.js";import{b as Ct,d as De,e as yt,f as wt,g as xt,m as Y,n as bt}from"./chunk-4CEFDQPI.js";import{t as ft,u as St}from"./chunk-2SC3HO66.js";import{P as ut}from"./chunk-DQIP7MCZ.js";import{b as He,c as $,h as z,m as G,o as ae,y as Ue}from"./chunk-2E5AKA74.js";import{b as N,c as M}from"./chunk-FTHTFVHH.js";import{$ as fe,$c as je,Ab as mt,B as at,Bb as st,Bc as ve,Cc as F,Ec as K,Fc as Se,Ha as V,Ib as O,Ja as p,Jb as m,Ka as v,Kb as S,Lb as T,Nb as w,Ob as x,Pb as b,Q as ye,Qb as dt,Rb as We,Sb as J,T as rt,Tb as Be,Ub as ie,Va as pt,Wc as Ge,X as be,Xc as ct,Zc as ne,_a as u,aa as Ae,ab as d,ac as P,bc as k,ca as de,cc as R,dc as U,ga as L,ha as Re,hb as Qe,mb as n,na as ot,nb as r,oa as g,ob as C,pa as _,pb as D,q as j,qa as Ze,qb as E,ra as Xe,sb as I,vb as y,vc as ze,w as nt,xb as c,xc as W,yc as B,za as lt}from"./chunk-ZIZWZZ4E.js";import{a as tt,b as it}from"./chunk-GNOSNGXM.js";var Qt=(()=>{let l=class l{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:[ht.downloadOrder]}]}ngOnInit(){}};l.\u0275fac=function(t){return new(t||l)},l.\u0275cmp=L({type:l,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,i){t&1&&(n(0,"nav",0)(1,"div",1)(2,"div"),C(3,"nav-tab",2),r()()(),C(4,"router-outlet")),t&2&&(p(3),d("Tabs",i.ObjectOrderTabs)("usePermissions",!0))},dependencies:[Dt,ct]});let a=l;return a})();var ei=(()=>{let l=class l{constructor(){}convertToCSV(e,t){let i;if(typeof e=="string")i=e;else{var h=typeof e=="object"?e:JSON.parse(e);i=this.transformToCSVStringFormat(h)}this.downloadCSV(i,t)}transformToCSVStringFormat(e){if(!e||!e.length)return;let t=",",i=Object.keys(e[0]);return e.map(f=>i.map(s=>{let q=f[s]===null||f[s]===void 0?"":f[s];return q=q instanceof Date?q.toLocaleString():q.toString().replace(/"/g,'""'),q.search(/("|,|\n)/g)>=0&&(q=`"${q}"`),q}).join(t)).join(`
|
|
2
|
+
`)}downloadCSV(e,t){var i=new Blob([e],{type:"text/csv;charset=utf8;"}),h=document.createElement("a");h.setAttribute("href",window.URL.createObjectURL(i)),h.setAttribute("download",t),document.body.appendChild(h),h.click(),document.body.removeChild(h)}};l.\u0275fac=function(t){return new(t||l)},l.\u0275prov=fe({token:l,factory:l.\u0275fac,providedIn:"root"});let a=l;return a})();var Ee=(()=>{let l=class l{constructor(e,t){this.http=e,this.exportService=t}loadInitialPage(){return this.http.post("/api/ordersLoader/GetOrder",{})}getNewOrders(e){return this.http.post("/api/orders/GetNewOrder",e).pipe(j(t=>t.Data))}getTotalNewOrders(e,t,i){let h={ListChannelID:e,From:t,To:i};return this.http.post("/api/orders/GetCountNewOrder",h).pipe(j(f=>f.Count))}exportOrders(e,t){return this.http.post("api/Orders/ExportOrder",e).pipe(be(i=>{this.exportService.convertToCSV(i,t)}))}};l.\u0275fac=function(t){return new(t||l)(de(A),de(ei))},l.\u0275prov=fe({token:l,factory:l.\u0275fac});let a=l;return a})();var Ye=(()=>{let l=class l{constructor(e,t){this.http=e,this.toastr=t}acceptTokopediaOrders(e){return this.http.post("/api/Orders/AcceptOrderTokopedia",e).pipe(be(t=>{this.tokopediaAcceptOrderHandler(t)}))}tokopediaAcceptOrderHandler(e){let t=e.filter(h=>h.Status==!1),i=e.filter(h=>h.Status==!0);if(t.length==0&&i.length>0){let h=`<ol>${this.generateSuccessMessage(i)}</ol>`;this.toastr.success(h,"Success",{enableHtml:!0})}else if(t.length>0&&i.length>0){let h=`<ol>
|
|
3
|
+
${this.generateSuccessMessage(i)}
|
|
4
|
+
${this.generateErrorMessage(t)}
|
|
5
|
+
</ol>`;this.toastr.warning(h,"Warning",{enableHtml:!0})}else{let h=`<ol>${this.generateErrorMessage(t)}</ol>`;this.toastr.error(h,"Error",{enableHtml:!0})}}generateSuccessMessage(e){let t="";return e.forEach(i=>{t+=`<li><b>${i.OrderNumber}</b> was successfully Accept</li>`}),t}generateErrorMessage(e){let t="";return e.forEach(i=>{t+=`<li><b>${i.OrderNumber}</b> ${i.Message}</li>`}),t}};l.\u0275fac=function(t){return new(t||l)(de(A),de(Te))},l.\u0275prov=fe({token:l,factory:l.\u0275fac});let a=l;return a})();function _i(a,l){if(a&1){let o=I();D(0),n(1,"button",18),y("click",function(){g(o);let t=c().ngIf,i=c();return _(i.onAcceptOrder(t))}),C(2,"i",19),m(3," Accept "),r(),E()}}function ui(a,l){if(a&1&&(D(0),u(1,_i,4,0,"ng-container",3),E()),a&2){let o=c();p(),d("ngIf",o.isTokopediaAvailable&&o.isTokopediaSelected)}}function fi(a,l){if(a&1&&(n(0,"span",20),C(1,"img",21),r(),m(2)),a&2){let o=l.item;p(),d("src",o==null?null:o.Img,V),p(),T(" ",o.Name," ")}}function Si(a,l){if(a&1){let o=I();D(0),n(1,"th",33)(2,"input",34),b("ngModelChange",function(t){g(o);let i=c(3);return x(i.isCheckAll,t)||(i.isCheckAll=t),_(t)}),y("ngModelChange",function(){g(o);let t=c(2).ngIf,i=c();return _(i.onSelectAllOrderData(t))}),r()(),E()}if(a&2){let o=c(3);p(2),w("ngModel",o.isCheckAll)}}function Ci(a,l){if(a&1){let o=I();D(0),n(1,"input",34),b("ngModelChange",function(t){g(o);let i=c(2).$implicit;return x(i.selected,t)||(i.selected=t),_(t)}),y("ngModelChange",function(){g(o);let t=c(4).ngIf,i=c();return _(i.onSelectOrderData(t))}),r(),E()}if(a&2){let o=c(2).$implicit;p(),w("ngModel",o.selected)}}function yi(a,l){if(a&1&&(D(0),n(1,"td"),u(2,Ci,2,1,"ng-container",3),r(),E()),a&2){let o=c().$implicit,e=c(3);p(2),d("ngIf",o.Type==e.tokopediaType)}}function wi(a,l){if(a&1&&(D(0),n(1,"span"),m(2),r(),E()),a&2){let o=c().$implicit;p(2),S(o.Number)}}function xi(a,l){if(a&1&&(n(0,"a",36),m(1),r()),a&2){let o=c().$implicit,e=c(3);d("href",e.domain+"/menu/Orders/Order/Sales_Order/Info?ID="+o.ID,V),p(),S(o.Number)}}function bi(a,l){if(a&1&&(n(0,"tr"),u(1,yi,3,1,"ng-container",3),n(2,"td"),m(3),r(),n(4,"td"),u(5,wi,3,1,"ng-container",22)(6,xi,2,2,"ng-template",null,1,U),r(),n(8,"td"),m(9),r(),n(10,"td"),m(11),P(12,"date"),r(),n(13,"td"),C(14,"app-channel-logo",35),r()()),a&2){let o=l.$implicit,e=O(7),t=c(3);p(),d("ngIf",t.isTokopediaAvailable),p(2),S(o.Outlet),p(2),d("ngIf",o.ID==t.guidEmpty)("ngIfElse",e),p(4),S(o.Customer),p(2),S(R(12,7,o.Created,"dd MMM yyyy HH:mm")),p(3),d("typeId",o.Type)}}function vi(a,l){if(a&1){let o=I();D(0),n(1,"div",23)(2,"table",24),y("matSortChange",function(t){g(o);let i=c(2);return _(i.onSort(t))}),n(3,"thead",25)(4,"tr",26),u(5,Si,3,1,"ng-container",3),n(6,"th",27),m(7,"Outlet"),r(),n(8,"th",28),m(9,"Order number"),r(),n(10,"th"),m(11,"Customer"),r(),n(12,"th",29),m(13,"Created On"),r(),n(14,"th",30),m(15,"Channel"),r()()(),n(16,"tbody"),u(17,bi,15,10,"tr",31),r()(),n(18,"app-mat-paginator-no-count",32),P(19,"async"),P(20,"async"),y("total",function(){g(o);let t=c(2);return _(t.getPaginatonTotal())})("next",function(){g(o);let t=c(2);return _(t.onNextPage())})("previous",function(){g(o);let t=c(2);return _(t.onPreviousPage())}),r()(),E()}if(a&2){let o,e=c().ngIf,t=c();p(5),d("ngIf",t.isTokopediaAvailable&&e),p(12),d("ngForOf",e),p(),d("filter",t.filter)("totaldata",(o=k(19,5,t.newOrdersData$))==null?null:o.length)("paginationTotal",k(20,7,t.paginationTotal$))}}function Ti(a,l){if(a&1&&(D(0),u(1,vi,21,9,"ng-container",22),E()),a&2){let o=l.ngIf;c();let e=O(32);p(),d("ngIf",(o==null?null:o.length)>0)("ngIfElse",e)}}function Di(a,l){a&1&&(n(0,"div",37),C(1,"app-empty-state"),r())}var ni=(()=>{let l=class l{constructor(e,t,i,h){this.localDataService=e,this.orderService=t,this.acceptOrderService=i,this.authService=h,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.domain=`https://${this.localDataService.getHostName()}`,this.guidEmpty=M.GuidEMpty,this.tokopediaType=N.Tokopedia,this.isTokopediaSelected=!1,this.isTokopediaAvailable=!1,this.isCheckAll=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initLoadPage()}initLoadPage(){this.orderService.loadInitialPage().subscribe(e=>{this.filter.PageNumber=e.Filter.PageNumber,this.filter.PageSize=e.Filter.RowCount,this.filter.From=e.Filter.From,this.filter.To=e.Filter.To,this.getNewOrders()})}getNewOrders(){let e={PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.sourceObs$=this.orderService.getNewOrders(e).pipe(ye()),this.newOrdersData$=this.sourceObs$.pipe(be(t=>{t.filter(h=>h.Type==N.Tokopedia).length>0&&(this.isTokopediaAvailable=!0)}))}getPaginatonTotal(){this.paginationTotal$=this.orderService.getTotalNewOrders(this.filter.ListChannelID,this.filter.From,this.filter.To).pipe(ye())}onNextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.getNewOrders()}onPreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.getNewOrders()}onSelectOrderData(e){this.isTokopediaSelected=!1,e.filter(i=>i.selected).length>0&&(this.isTokopediaSelected=!0)}onSelectAllOrderData(e){e=e.map(t=>(t.Type==N.Tokopedia&&(t.selected=this.isCheckAll),t)),this.onSelectOrderData(e)}onAcceptOrder(e){let t=this.getSelectedTokopediaOrders(e);this.acceptOrderService.acceptTokopediaOrders(t).subscribe(i=>{this.isTokopediaSelected=!1,location.reload()})}getSelectedTokopediaOrders(e){return e.filter(i=>i.selected).map(i=>i.Number)}onSort(e){if(e.direction==""){this.newOrdersData$=this.sourceObs$;return}if(e.active=="created"){let t=e.direction=="asc";this.newOrdersData$=this.newOrdersData$.pipe(j(i=>(i=i.sort((h,f)=>M.compare(h.Created,f.Created,t)),i)))}}};l.\u0275fac=function(t){return new(t||l)(v(ce),v(Ee),v(Ye),v(Z))},l.\u0275cmp=L({type:l,selectors:[["app-new-order"]],decls:33,vars:15,consts:[["EMPTY_STATE",""],["NOT_EMPTY",""],["headerTitle","1 - New Order","searchBoxPlaceHolder","Search Orders...",3,"onSubmit","hideSearchBox"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-3","d-print-none"],[1,"row"],[1,"col-md-12"],["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,"total","next","previous","filter","totaldata","paginationTotal"],[2,"width","5px"],["type","checkbox",3,"ngModelChange","ngModel"],[3,"typeId"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(t,i){if(t&1){let h=I();n(0,"mainpanel",2),y("onSubmit",function(){return g(h),_(i.getNewOrders())}),n(1,"actions"),u(2,ui,2,1,"ng-container",3),P(3,"async"),r(),n(4,"filters")(5,"div")(6,"label",4),m(7,"Channel"),r(),n(8,"ng-select",5),b("ngModelChange",function(s){return g(h),x(i.filter.ListChannelID,s)||(i.filter.ListChannelID=s),_(s)}),u(9,fi,3,2,"ng-template",6),r()(),n(10,"div",7)(11,"label",8),m(12,"Page Number"),r(),n(13,"input",9),b("ngModelChange",function(s){return g(h),x(i.filter.PageNumber,s)||(i.filter.PageNumber=s),_(s)}),r()(),n(14,"div",7)(15,"label",8),m(16,"Page Size"),r(),n(17,"input",10),b("ngModelChange",function(s){return g(h),x(i.filter.PageSize,s)||(i.filter.PageSize=s),_(s)}),r()(),n(18,"div",7)(19,"label",11),m(20,"From/To"),r(),n(21,"div",12)(22,"datepicker",13),b("dateChange",function(s){return g(h),x(i.filter.From,s)||(i.filter.From=s),_(s)}),r()(),n(23,"div")(24,"datepicker",14),b("dateChange",function(s){return g(h),x(i.filter.To,s)||(i.filter.To=s),_(s)}),r()()()(),n(25,"content")(26,"div",15)(27,"div",16)(28,"div",17),u(29,Ti,2,2,"ng-container",3),P(30,"async"),u(31,Di,2,0,"ng-template",null,0,U),r()()()()()}t&2&&(d("hideSearchBox",!0),p(2),d("ngIf",k(3,11,i.newOrdersData$)),p(6),d("clearable",!0)("multiple",!0)("items",i.channelOptions),w("ngModel",i.filter.ListChannelID),p(5),w("ngModel",i.filter.PageNumber),p(4),w("ngModel",i.filter.PageSize),p(5),w("date",i.filter.From),p(2),w("date",i.filter.To),p(5),d("ngIf",k(30,13,i.newOrdersData$)))},dependencies:[W,B,$,ae,He,z,G,Y,X,re,oe,Q,me,se,le,pe,ee,ve,F]});let a=l;return a})();var Ei=()=>["/menu/Order"];function Pi(a,l){if(a&1&&(n(0,"tr")(1,"td"),m(2),r(),n(3,"td"),m(4),P(5,"number"),r(),n(6,"td"),m(7),P(8,"number"),r()()),a&2){let o=l.$implicit;p(2),S(o.Code),p(2),S(k(5,3,o.Quantity)),p(3),S(k(8,5,o.Price))}}function Ii(a,l){if(a&1&&(n(0,"div",4)(1,"div",5)(2,"div",6)(3,"div",7)(4,"h3",8),m(5,"Outlet Info"),r()(),n(6,"div",4)(7,"div",9),m(8," Outlet : "),r(),n(9,"div",9),m(10),r()(),n(11,"div",4)(12,"div",9),m(13," Date : "),r(),n(14,"div",9),m(15),P(16,"date"),r()(),n(17,"div",4)(18,"div",9),m(19," Status : "),r(),n(20,"div",9),m(21),r()(),n(22,"div",4)(23,"div",9),m(24," Tax Type : "),r(),n(25,"div",9),m(26),r()(),n(27,"div",4)(28,"div",9),m(29," Due Date : "),r(),n(30,"div",9),m(31),P(32,"date"),r()()(),n(33,"div",6)(34,"div",7)(35,"h3",8),m(36,"Customer Info"),r()(),n(37,"div",4)(38,"div",9),m(39," Name : "),r(),n(40,"div",9),m(41),r()(),n(42,"div",4)(43,"div",9),m(44," Email : "),r(),n(45,"div",9),m(46),r()(),n(47,"div",4)(48,"div",9),m(49," Mobile : "),r(),n(50,"div",9),m(51),r()()()(),n(52,"div",10)(53,"h3",11),m(54,"Products Sold"),r(),n(55,"div",12)(56,"table",13)(57,"thead",14)(58,"tr",15)(59,"th"),m(60,"Code"),r(),n(61,"th"),m(62,"Quantity"),r(),n(63,"th"),m(64,"Price"),r()()(),n(65,"tbody"),u(66,Pi,9,7,"tr",16),r()()()()()),a&2){let o=c();p(10),T(" ",o.model.Outlet," "),p(5),T(" ",R(16,9,o.model.Date,"dd MMM yyyy")," "),p(6),T(" ",o.model.Delivery," "),p(5),T(" ",o.model.TaxType," "),p(5),T(" ",R(32,12,o.model.DueDate,"dd MMM yyyy")," "),p(10),T(" ",o.model.Customer.Name," "),p(5),T(" ",o.model.Customer.Email," "),p(5),T(" ",o.model.Customer.Mobile," "),p(15),d("ngForOf",o.model.Variants)}}var ai=(()=>{let l=class l{constructor(e,t){this.http=e,this.url=t,this.number=this.url.snapshot.queryParams.Number,this.outlet=this.url.snapshot.queryParams.Outlet}ngOnInit(){this.Load()}Load(){var e={Number:this.number,Outlet:this.outlet};this.http.post("/api/orders/GetInvoiceDetail",e).subscribe(t=>{this.model=t})}};l.\u0275fac=function(t){return new(t||l)(v(A),v(Ge))},l.\u0275cmp=L({type:l,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,i){t&1&&(n(0,"mainpanel",0)(1,"actions")(2,"a",1),m(3,"Back"),r()(),n(4,"content")(5,"div",2),u(6,Ii,67,15,"div",3),r()()()),t&2&&(d("headerTitle","Order #"+i.number)("hideSearchBox",!0)("hideSearchDropdown",!0),p(2),d("routerLink",J(5,Ei)),p(4),d("ngIf",i.model))},dependencies:[W,B,Y,ne,K,F]});let a=l;return a})();var ri=(()=>{let l=class l{constructor(e){this.dialogRef=e,this.tandaiSudahDicetak=!1}onCancel(){this.dialogRef.close()}onPrint(){this.dialogRef.close(this.tandaiSudahDicetak?1:0)}};l.\u0275fac=function(t){return new(t||l)(v(Ct))},l.\u0275cmp=L({type:l,selectors:[["app-print-tokopedia"]],decls:17,vars:1,consts:[[1,"container-fluid"],[1,"text-center","mb-4","fw-bold","mt-6"],[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,"ngModelChange","ngModel"],[1,"fs-5","pt-1"],[1,"d-flex","align-items-center","justify-content-center"],[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,i){t&1&&(n(0,"div",0)(1,"h2",1),m(2,"Cetak label pesanan"),r(),n(3,"mat-dialog-content")(4,"div",2)(5,"div",3)(6,"p",4),m(7,"Kamu akan mencetak label yang berisi detail pesanan"),r(),n(8,"div",5)(9,"mat-checkbox",6),b("ngModelChange",function(f){return x(i.tandaiSudahDicetak,f)||(i.tandaiSudahDicetak=f),f}),r(),n(10,"span",7),m(11,'Pesanan telah ditandai sebagai "Sudah Dicetak"'),r()()()()(),n(12,"mat-dialog-actions",8)(13,"button",9),y("click",function(){return i.onCancel()}),m(14,"Cancel"),r(),n(15,"button",10),y("click",function(){return i.onPrint()}),m(16,"Cetak Pesanan"),r()()()),t&2&&(p(9),w("ngModel",i.tandaiSudahDicetak))},dependencies:[z,G,Jt,wt,yt]});let a=l;return a})();var Je=(()=>{let l=class l{constructor(e,t,i){this.http=e,this.toastr=t,this.dialog=i}getTokopediaShippingLabel(e){return this.http.post("/api/v1/Shippinglabel/Tokopedia/Multiple",{Orders:e}).pipe(j(t=>(t=t.map(i=>(i.ChannelType=N.Tokopedia,i)),t)))}getTiktokShippingLabel(e){return this.http.post("/api/v1/Shippinglabel/TIktok/Multiple",{Orders:e}).pipe(j(t=>(t=t.map(i=>(i.ChannelType=N.Tiktok,i)),t)))}getShopeeShippingLabel(e){return this.http.post("/api/v1/Shippinglabel/shopee/Multiple",{Orders:e}).pipe(j(t=>(t=t.map(i=>(i.ChannelType=N.Shopee,i)),t)))}getLazadaShippingLabel(e){return this.http.post("/api/v1/Shippinglabel/lazada/Multiple",{Orders:e}).pipe(j(t=>(t=t.map(i=>(i.ChannelType=N.Lazada,i)),t)))}printShippingLabelTokopedia(e){let t={OrderNumber:e,Printed:!0};this.dialog.open(ri).afterClosed().pipe(at(i=>i!==void 0),rt(i=>(t.Printed=i,this.http.post("api/v1/Shippinglabel/Tokopedia",t)))).subscribe(i=>{let h=window.open("about:blank","_blank");h.document.write(i.File),h.document.close()})}printShippingLabelTiktok(e,t){let i={ShopID:t,OrderNumber:e};this.http.post("api/v1/Shippinglabel/Tiktok",i).subscribe(h=>{h.data!=null?window.open(h.data.doc_url,"_blank"):this.toastr.error("Cannot Print the Shipping Label,The invoice Number is not set to Pickup","Cannot Print")})}printShippingLabelShopee(e,t){let i={ShopID:t,OrderNumber:e};this.http.post("api/v1/Shippinglabel/shopee/DownloadShipping",i).subscribe(h=>{var f=Uint8Array.from(atob(h.File),q=>q.charCodeAt(0)),s=new Blob([f],{type:"octet/stream"});M.openDownloadFile(s,`${e}.pdf`)})}printShippingLabelLazada(e,t){let i={ShopID:t,OrderNumber:e};this.http.post("api/v1/Shippinglabel/Lazada/DownloadShipping",i).subscribe(h=>{h.result.data!=null?window.open(h.result.data.pdf_url,"_blank"):this.toastr.error(h.message,"Cannot Print")})}};l.\u0275fac=function(t){return new(t||l)(de(A),de(Te),de(De))},l.\u0275prov=fe({token:l,factory:l.\u0275fac,providedIn:"root"});let a=l;return a})();var he=function(a){return a.SPX="https://res.cloudinary.com/pos/image/upload/v1698216798/APP/Print%20Shipping%20Label/SPX_Logo.png",a.SICEPAT="https://res.cloudinary.com/pos/image/upload/v1698216793/APP/Print%20Shipping%20Label/SiCepat_Logo.png",a.JNT="https://res.cloudinary.com/pos/image/upload/v1698216792/APP/Print%20Shipping%20Label/J_T_Logo.png",a.ANTERAJA="https://res.cloudinary.com/pos/image/upload/v1698218271/APP/Print%20Shipping%20Label/anteraja_Logo.png",a.JNE="https://res.cloudinary.com/pos/image/upload/v1698216791/APP/Print%20Shipping%20Label/JNE_Logo.png",a.GRAB="https://res.cloudinary.com/pos/image/upload/v1698216794/APP/Print%20Shipping%20Label/GrabExpress_Logo.png",a.GOSEND="https://res.cloudinary.com/pos/image/upload/v1698218375/APP/Print%20Shipping%20Label/Gosend_Logo.png",a.LAZADA_EXPRESS="https://res.cloudinary.com/pos/image/upload/v1698914677/icons/Marketplace%20logo/lazada-Logistics.png",a}(he||{});var Ne=function(a){return a.TOKOPEDIA="https://res.cloudinary.com/pos/image/upload/v1698216793/APP/Print%20Shipping%20Label/Tokopedia_Logo.png",a.SHOPEE="https://res.cloudinary.com/pos/image/upload/v1698219243/APP/Print%20Shipping%20Label/shopee-logo.png",a.LAZADA="https://res.cloudinary.com/pos/image/upload/v1698912333/icons/Marketplace%20logo/Lazada_icon.png",a.TIKTOK="https://res.cloudinary.com/pos/image/upload/v1645761565/icons/Marketplace%20logo/tiktok-logo.png",a}(Ne||{});function Mi(a,l){if(a&1&&(D(0),n(1,"div",36)(2,"div",12)(3,"div",37),m(4),r()(),n(5,"div",12)(6,"div",37),m(7),r()()(),E()),a&2){let o=c();p(4),T(" ",o.recipient==null?null:o.recipient.City," "),p(3),T(" ",o.recipient==null?null:o.recipient.District," ")}}function Oi(a,l){if(a&1&&(D(0),n(1,"div")(2,"span",15),m(3,"Berat: "),r(),n(4,"span",18),m(5),r()(),E()),a&2){let o=c();p(5),T("",o.shippingLabel==null?null:o.shippingLabel.Weight," gr")}}function ki(a,l){if(a&1&&(D(0),n(1,"div",38)(2,"span",14),m(3,"Batas Kirim:"),r(),n(4,"span",18),m(5),P(6,"date"),r()(),E()),a&2){let o=c();p(5),S(R(6,1,o.logistic==null?null:o.logistic.Batas_kirim,"dd-MM-yyy"))}}function Li(a,l){if(a&1&&(D(0),n(1,"div",38)(2,"span",14),m(3,"No.Pesanan:"),r(),n(4,"span",18),m(5),r()(),E()),a&2){let o=c();p(5),S(o.shippingLabel==null?null:o.shippingLabel.OrderNumber)}}function Vi(a,l){if(a&1&&(n(0,"tr")(1,"td",39),m(2),r(),n(3,"td"),m(4),r(),n(5,"td"),m(6),r(),n(7,"td"),m(8),P(9,"number"),r()()),a&2){let o=l.$implicit,e=l.index;p(2),S(e+1),p(2),S(o.Product_Name),p(2),S(o.SKU),p(2),S(k(9,4,o.Quantity))}}var Ke=(()=>{let l=class l{constructor(){this.minDate=M.MinDate,this.channelType=N}ngOnChanges(e){e.shippingLabel&&e.shippingLabel.currentValue&&(this.initShippingLabel(),this.getShippingLogo(),this.getChannelLogo())}ngAfterViewInit(){this.initBarcodeConfig()}getChannelLogo(){switch(this.shippingLabel.ChannelType){case N.Tokopedia:this.marketplaceLogo=Ne.TOKOPEDIA;break;case N.Shopee:this.marketplaceLogo=Ne.SHOPEE;break;case N.Lazada:this.marketplaceLogo=Ne.LAZADA;break;case N.Tiktok:this.marketplaceLogo=Ne.TIKTOK;break}}getShippingLogo(){let e=this.shippingLabel.Logistic.Logistic_Name;e=e?.toLowerCase(),e.includes("anteraja")?this.shippingLogo=he.ANTERAJA:e.includes("grabexpress")?this.shippingLogo=he.GRAB:e.includes("jne")?this.shippingLogo=he.JNE:e.includes("gosend")?this.shippingLogo=he.GOSEND:e.includes("j&t")?this.shippingLogo=he.JNT:e.includes("sicepat")?this.shippingLogo=he.SICEPAT:e.includes("spx")?this.shippingLogo=he.SPX:e.includes("lex")&&(this.shippingLogo=he.LAZADA_EXPRESS)}initShippingLabel(){this.recipient=this.shippingLabel.Recipient,this.store=this.shippingLabel.Store,this.products=this.shippingLabel.Products,this.logistic=this.shippingLabel.Logistic}initBarcodeConfig(){if(M.IsNotEmpty(this.logistic?.Resi_Number)){let e=this.logistic?.Resi_Number;JsBarcode(`#RESI${this.id}`,this.logistic?.Resi_Number,{displayValue:!1,width:e.length>15?1:1.5,height:40})}M.IsNotEmpty(this.shippingLabel?.OrderNumber)&&JsBarcode(`#NO${this.id}`,this.shippingLabel?.OrderNumber,{displayValue:!1,width:this.shippingLabel?.OrderNumber.length>15?.5:1,height:40})}};l.\u0275fac=function(t){return new(t||l)},l.\u0275cmp=L({type:l,selectors:[["app-shipping-label"]],inputs:{shippingLabel:"shippingLabel",id:"id"},standalone:!0,features:[ot,We],decls:87,vars:20,consts:[[1,"label-container"],[2,"border","1px solid","padding","12px"],[1,"row","mb-2"],[1,"col-12"],[1,"d-flex","align-items-center","justify-content-between"],["width","105px",1,"border-0",3,"src"],[1,"mb-4"],[1,"row","mb-1"],[1,"text-center","fw-bold","border","p-2","fs-5","border-dark"],[1,"me-2"],[1,"col-12","text-center"],[3,"id"],[1,"col-6"],[1,"d-flex"],[1,"fw-bold","fs-6","me-1"],[1,"fw-bold","fs-6"],[1,"mt-2"],[1,"mb-0","fs-6",2,"max-width","200px","word-wrap","break-word"],[1,"fs-6"],[1,"fs-6",2,"word-wrap","break-word","max-width","160px"],[4,"ngIf"],[1,"row","px-6"],[1,"col-5","border","border-dark","border-end-0","text-center","p-2"],[1,"col-7","border","border-dark","p-2","text-center","fs-6"],[1,"fst-italic"],[1,"row"],[1,"col-5","pt-4",2,"padding-right","0px"],[1,"d-flex","justify-content-between"],[1,"col-7","text-center"],[1,"mt-1",3,"id"],[1,"table","table-sm","fs-6"],[1,"text-center",2,"width","5px"],[2,"width","150px"],[2,"width","50px"],[2,"width","25px"],[4,"ngFor","ngForOf"],[1,"row","mb-4"],[1,"text-center","fw-bold","border","p-2","fs-6","border-dark","text-uppercase"],[1,"mt-4"],[1,"text-center"]],template:function(t,i){t&1&&(n(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div"),C(6,"img",5),r(),n(7,"div")(8,"h4"),m(9),r()(),n(10,"div"),C(11,"img",5),r()()()(),n(12,"div",6),C(13,"hr"),r(),n(14,"div",7)(15,"div",3)(16,"div",8)(17,"span",9),m(18),r(),n(19,"span"),m(20),r()()()(),n(21,"div",7)(22,"div",10),Ze(),C(23,"svg",11),r()(),Xe(),n(24,"div",6),C(25,"hr"),r(),n(26,"div",2)(27,"div",12)(28,"div",13)(29,"div",14),m(30,"Penerima: "),r(),n(31,"div",15),m(32),r()(),n(33,"div",16)(34,"span",15),m(35,"Alamat Pengiriman:"),r(),n(36,"div",17),m(37),r()()(),n(38,"div",12)(39,"div",13)(40,"div",14),m(41,"Pengirim: "),r(),n(42,"div")(43,"div",15),m(44),r(),n(45,"div",18),m(46),r(),n(47,"div",19),m(48),r()()(),C(49,"div"),r()(),u(50,Mi,8,2,"ng-container",20),n(51,"div",21)(52,"div",22)(53,"div",15),m(54,"CASHLESS"),r()(),n(55,"div",23)(56,"small",24),m(57,"Penjual tidak perlu membayar ongkos kirim ke kurir"),r()()(),n(58,"div",25)(59,"div",26)(60,"div",27),u(61,Oi,6,1,"ng-container",20),n(62,"div")(63,"span",15),m(64,"COD: "),r(),n(65,"span",18),m(66),P(67,"number"),r()()(),u(68,ki,7,4,"ng-container",20)(69,Li,6,1,"ng-container",20),r(),n(70,"div",28),Ze(),C(71,"svg",29),r()()(),Xe(),n(72,"div",25)(73,"div",3)(74,"table",30)(75,"thead")(76,"tr")(77,"th",31),m(78,"No."),r(),n(79,"th",32),m(80,"Nama Produk"),r(),n(81,"th",33),m(82,"SKU"),r(),n(83,"th",34),m(84,"Qty"),r()()(),n(85,"tbody"),u(86,Vi,10,6,"tr",35),r()()()()()),t&2&&(p(6),d("src",i.marketplaceLogo,V),p(3),S(i.logistic==null?null:i.logistic.Service),p(2),d("src",i.shippingLogo,V),p(7),T(" ",(i.shippingLabel==null?null:i.shippingLabel.ChannelType)==(i.channelType==null?null:i.channelType.Tokopedia)?"Kode Booking: ":"No. Resi: "," "),p(2),S(i.logistic==null?null:i.logistic.Resi_Number),p(3),d("id","RESI"+i.id),p(9),S(i.recipient==null?null:i.recipient.Name),p(5),T(" ",i.recipient==null?null:i.recipient.Address," "),p(7),S(i.store==null?null:i.store.Name),p(2),S(i.store==null?null:i.store.Phone),p(2),T(" ",i.store==null?null:i.store.Address," "),p(2),d("ngIf",(i.recipient==null?null:i.recipient.City)&&(i.recipient==null?null:i.recipient.District)),p(11),d("ngIf",i.shippingLabel==null?null:i.shippingLabel.Weight),p(5),T("Rp. ",i.shippingLabel!=null&&i.shippingLabel.IsCOD?k(67,18,i.shippingLabel==null||i.shippingLabel.SummaryPrice==null?null:i.shippingLabel.SummaryPrice.Total):0,""),p(2),d("ngIf",(i.logistic==null?null:i.logistic.Batas_kirim)&&(i.logistic==null?null:i.logistic.Batas_kirim)!==i.minDate),p(),d("ngIf",i.shippingLabel==null?null:i.shippingLabel.OrderNumber),p(2),d("id","NO"+i.id),p(15),d("ngForOf",i.products))},dependencies:[Se,W,B,K,F],styles:[".table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{border:none!important}.table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{text-transform:capitalize;padding:4px!important}.table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border:none!important;padding:2px 2px 2px 5px!important;font-size:10px}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%]{border-bottom:1px solid rgba(0,0,0,.4509803922)}.label-container[_ngcontent-%COMP%]{width:465px;float:left}hr[_ngcontent-%COMP%]{opacity:.8;margin:0}"]});let a=l;return a})();var Ai=()=>["/menu/Order/detail"],Ri=(a,l)=>({Number:a,Outlet:l});function Wi(a,l){if(a&1){let o=I();D(0),n(1,"button",19),y("click",function(){g(o);let t=c();return _(t.onPrintMultipleShippingLabel())}),C(2,"i",20),n(3,"span"),m(4,"Print Shipping Label"),r()(),E()}}function Bi(a,l){if(a&1&&(n(0,"span",21),C(1,"img",22),r(),m(2)),a&2){let o=l.item;p(),d("src",o==null?null:o.Img,V)("alt",o.Name),p(),T(" ",o.Name," ")}}function zi(a,l){if(a&1){let o=I();D(0),n(1,"input",29),b("ngModelChange",function(t){g(o);let i=c().$implicit;return x(i.Selected,t)||(i.Selected=t),_(t)}),y("ngModelChange",function(){g(o);let t=c(3).ngIf,i=c();return _(i.onSelectReadyToShip(t))}),r(),E()}if(a&2){let o=c().$implicit;p(),w("ngModel",o.Selected)}}function Gi(a,l){if(a&1&&(n(0,"a",42),m(1),r()),a&2){let o=c().$implicit;d("routerLink",J(3,Ai))("queryParams",ie(4,Ri,o.Number,o.Outlet)),p(),S(o.Number)}}function ji(a,l){if(a&1&&(n(0,"a",43),m(1),r()),a&2){let o=c().$implicit,e=c(3);d("href",e.domain+o.ID,V),p(),S(o.Number)}}function Hi(a,l){if(a&1){let o=I();n(0,"a",44),y("click",function(){g(o);let t=c().$implicit,i=c(3);return _(i.onPrintShippingLabel(t.Number,t.ShopID,t.TypeID))}),C(1,"i",45),r()}}function Ui(a,l){if(a&1&&(n(0,"tr")(1,"td"),u(2,zi,2,1,"ng-container",2),r(),n(3,"td"),m(4),r(),n(5,"td"),u(6,Gi,2,7,"a",37)(7,ji,2,2,"a",38),r(),n(8,"td"),m(9),r(),n(10,"td"),m(11),P(12,"number"),r(),n(13,"td"),m(14),P(15,"date"),r(),n(16,"td"),C(17,"app-channel-logo",39),r(),n(18,"td",40),u(19,Hi,2,0,"a",41),r()()),a&2){let o=l.$implicit,e=c(3);p(2),d("ngIf",o.TypeID==e.channelType.Shopee||o.TypeID==e.channelType.Tokopedia||o.TypeID==e.channelType.Tiktok),p(2),S(o.Outlet),p(2),d("ngIf",e.guidEmpty==o.ID),p(),d("ngIf",e.guidEmpty!=o.ID),p(2),S(o.Customer),p(2),S(k(12,9,o.Amount)),p(3),S(R(15,11,o.Date,"dd MMM yyyy")),p(3),d("typeId",o.TypeID),p(2),d("ngIf",o.TypeID==e.channelType.Shopee||o.TypeID==e.channelType.Tokopedia||o.TypeID==e.channelType.Tiktok||o.TypeID==e.channelType.Lazada)}}function Yi(a,l){if(a&1){let o=I();D(0),n(1,"div",24)(2,"table",25),y("matSortChange",function(t){g(o);let i=c(2);return _(i.onSort(t))}),n(3,"thead",26)(4,"tr",27)(5,"th",28)(6,"input",29),b("ngModelChange",function(t){g(o);let i=c(2);return x(i.isCheckAll,t)||(i.isCheckAll=t),_(t)}),y("ngModelChange",function(){g(o);let t=c().ngIf,i=c();return _(i.onSelectAllReadyToShip(t))}),r()(),n(7,"th",30),m(8,"Outlet"),r(),n(9,"th",31),m(10,"Order number"),r(),n(11,"th"),m(12,"Customer"),r(),n(13,"th",32),m(14,"Amount"),r(),n(15,"th",33),m(16,"Date"),r(),n(17,"th",34),m(18,"Channel"),r(),C(19,"th",35),r()(),n(20,"tbody"),u(21,Ui,20,14,"tr",18),r()(),n(22,"app-mat-paginator-no-count",36),P(23,"async"),P(24,"async"),y("total",function(){g(o);let t=c(2);return _(t.getRowCount())})("next",function(){g(o);let t=c(2);return _(t.NextPage())})("previous",function(){g(o);let t=c(2);return _(t.PreviousPage())}),r()(),E()}if(a&2){let o,e=c().ngIf,t=c();p(6),w("ngModel",t.isCheckAll),p(15),d("ngForOf",e),p(),d("filter",t.filter)("totaldata",(o=k(23,5,t.readyToShip$))==null?null:o.length)("paginationTotal",k(24,7,t.paginationTotal$))}}function qi(a,l){if(a&1&&(D(0),u(1,Yi,25,9,"ng-container",23),E()),a&2){let o=l.ngIf;c();let e=O(31);p(),d("ngIf",o.length>0)("ngIfElse",e)}}function Ji(a,l){a&1&&(n(0,"div",46),C(1,"app-empty-state"),r())}function Ki(a,l){a&1&&(D(0),n(1,"div",48),m(2,"\xA0"),r(),E())}function $i(a,l){if(a&1&&(D(0),C(1,"app-shipping-label",47),u(2,Ki,3,0,"ng-container",2),E()),a&2){let o=l.$implicit,e=l.index,t=c();p(),d("shippingLabel",o)("id",e),p(),d("ngIf",e!==(t.shippingLabels==null?null:t.shippingLabels.length)-1)}}var oi=(()=>{let l=class l{constructor(e,t,i,h,f,s){this.http=e,this.localDataService=t,this.dialog=i,this.shippingLabelService=h,this.datePipe=f,this.authService=s,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.channelType=N,this.guidEmpty=M.GuidEMpty,this.selectedReadyToShip=[],this.isCheckAll=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(e=>{this.filter.PageNumber=e.Filter.PageNumber,this.filter.PageSize=e.Filter.RowCount,this.filter.From=e.Filter.From,this.filter.To=e.Filter.To,this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.getReadyToShip()})}getReadyToShip(e){var t={Number:e,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.sourceObs$=this.http.post("api/orders/GetReadyToShip",t).pipe(j(i=>i.Data),ye(1)),this.readyToShip$=this.sourceObs$}onPrintMultipleShippingLabel(){let e=this.filterReadyToShipByChannel(this.selectedReadyToShip,N.Tokopedia),t=this.filterReadyToShipByChannel(this.selectedReadyToShip,N.Shopee),i=this.filterReadyToShipByChannel(this.selectedReadyToShip,N.Tiktok),h=[];e.length>0&&h.push(this.shippingLabelService.getTokopediaShippingLabel(this.shippingLabelPayload(e))),t.length>0&&h.push(this.shippingLabelService.getShopeeShippingLabel(this.shippingLabelPayload(t))),i.length>0&&h.push(this.shippingLabelService.getTiktokShippingLabel(this.shippingLabelPayload(i))),nt(h).pipe(j(f=>f.reduce((s,q)=>s.concat(q),[]))).subscribe({next:f=>{this.shippingLabels=f,this.printShippingLabel()}})}filterReadyToShipByChannel(e,t){return e.filter(i=>i.TypeID==t)}shippingLabelPayload(e){return e.map(t=>({ShopID:t.ShopID,OrderNumber:t.Number}))}printShippingLabel(){setTimeout(()=>{this.setPdfname(),window.print()},500)}onPrintShippingLabel(e,t,i){switch(i){case N.Tokopedia:this.shippingLabelService.printShippingLabelTokopedia(e);break;case N.Tiktok:this.shippingLabelService.printShippingLabelTiktok(e,t);break;case N.Shopee:this.shippingLabelService.printShippingLabelShopee(e,t);break;case N.Lazada:this.shippingLabelService.printShippingLabelLazada(e,t);break}}setPdfname(){if(this.selectedReadyToShip.length>1){let e=new Date,t=this.datePipe.transform(e,"dd-MM-yyyy"),i=this.datePipe.transform(e,"HH-mm");document.title=`ShippingLabel_${t}_${i}`}else{let e=this.selectedReadyToShip[0].Number;document.title=`ShippingLabel_${e}`}}getSelectedReadyToShip(e){return e.filter(t=>t.Selected)}getRowCount(){var e={PaymentState:"Unpaid",DeliveryState:"Unsent",ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.paginationTotal$=this.http.post("api/orders/GetRowCount",e).pipe(j(t=>t?.Total))}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.getReadyToShip()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.getReadyToShip()}onSort(e){if(e.direction==""){this.readyToShip$=this.sourceObs$;return}if(e.active=="date"){let t=e.direction=="asc";this.readyToShip$=this.readyToShip$.pipe(j(i=>i.sort((h,f)=>M.compare(h.Date,f.Date,t))))}}onSelectReadyToShip(e){this.selectedReadyToShip=this.getSelectedReadyToShip(e)}onSelectAllReadyToShip(e){e=e.map(t=>((t.TypeID==N.Tokopedia||t.TypeID==N.Shopee||t.TypeID==N.Lazada)&&(t.Selected=this.isCheckAll),t)),this.selectedReadyToShip=this.getSelectedReadyToShip(e)}};l.\u0275fac=function(t){return new(t||l)(v(A),v(ce),v(De),v(Je),v(F),v(Z))},l.\u0275cmp=L({type:l,selectors:[["app-ready-to-ship"]],decls:34,vars:13,consts:[["EMPTY_STATE",""],["headerTitle","2 - Ready to Ship","searchBoxPlaceHolder","Search ...",3,"onSubmit"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-3","d-print-none"],[1,"row"],[1,"col-md-12"],[1,"print_containers"],[4,"ngFor","ngForOf"],[1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","5px"],["type","checkbox",3,"ngModelChange","ngModel"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","date",2,"width","130px"],[2,"width","114px"],[2,"width","10px"],[3,"total","next","previous","filter","totaldata","paginationTotal"],[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"],[3,"shippingLabel","id"],[1,"page-break"]],template:function(t,i){if(t&1){let h=I();n(0,"mainpanel",1),y("onSubmit",function(s){return g(h),_(i.getReadyToShip(s))}),n(1,"actions"),u(2,Wi,5,0,"ng-container",2),r(),n(3,"filters")(4,"div")(5,"label",3),m(6,"Channel"),r(),n(7,"ng-select",4),b("ngModelChange",function(s){return g(h),x(i.filter.ListChannelID,s)||(i.filter.ListChannelID=s),_(s)}),u(8,Bi,3,3,"ng-template",5),r()(),n(9,"div",6)(10,"label",7),m(11,"Page Number"),r(),n(12,"input",8),b("ngModelChange",function(s){return g(h),x(i.filter.PageNumber,s)||(i.filter.PageNumber=s),_(s)}),r()(),n(13,"div",6)(14,"label",7),m(15,"Page Size"),r(),n(16,"input",9),b("ngModelChange",function(s){return g(h),x(i.filter.PageSize,s)||(i.filter.PageSize=s),_(s)}),r()(),n(17,"div",6)(18,"label",10),m(19,"From/To"),r(),n(20,"div",11)(21,"datepicker",12),b("dateChange",function(s){return g(h),x(i.filter.From,s)||(i.filter.From=s),_(s)}),r()(),n(22,"div")(23,"datepicker",13),b("dateChange",function(s){return g(h),x(i.filter.To,s)||(i.filter.To=s),_(s)}),r()()()(),n(24,"content")(25,"div",14)(26,"div",15)(27,"div",16),u(28,qi,2,2,"ng-container",2),P(29,"async"),u(30,Ji,2,0,"ng-template",null,0,U),r()()()()(),n(32,"div",17),u(33,$i,3,3,"ng-container",18),r()}t&2&&(p(2),d("ngIf",i.selectedReadyToShip.length>0),p(5),d("clearable",!0)("multiple",!0)("items",i.channelOptions),w("ngModel",i.filter.ListChannelID),p(5),w("ngModel",i.filter.PageNumber),p(4),w("ngModel",i.filter.PageSize),p(5),w("date",i.filter.From),p(2),w("date",i.filter.To),p(5),d("ngIf",k(29,11,i.readyToShip$)),p(5),d("ngForOf",i.shippingLabels))},dependencies:[W,B,$,ae,He,z,G,Y,ne,X,re,oe,Q,me,se,le,pe,ee,Ke,ve,K,F],styles:[".print_containers[_ngcontent-%COMP%]{display:none}@media print{.print_containers[_ngcontent-%COMP%]{display:block}}@media print{.page-break[_ngcontent-%COMP%]{page-break-after:always}}"]});let a=l;return a})();var Zi=()=>["/menu/Order/detail"],Xi=(a,l)=>({Number:a,Outlet:l});function Qi(a,l){if(a&1&&(n(0,"span",17),C(1,"img",18),r(),m(2)),a&2){let o=l.item;p(),d("src",o==null?null:o.Img,V)("alt",o.Name),p(),T(" ",o.Name," ")}}function en(a,l){if(a&1&&(n(0,"a",33),m(1),r()),a&2){let o=c().$implicit;d("routerLink",J(3,Zi))("queryParams",ie(4,Xi,o.Number,o.Outlet)),p(),S(o.Number)}}function tn(a,l){if(a&1&&(n(0,"a",34),m(1),r()),a&2){let o=c().$implicit,e=c(2);d("href",e.domain+o.ID,V),p(),S(o.Number)}}function nn(a,l){if(a&1&&(n(0,"tr")(1,"td"),m(2),r(),n(3,"td"),u(4,en,2,7,"a",30)(5,tn,2,2,"a",31),r(),n(6,"td"),m(7),r(),n(8,"td"),m(9),P(10,"number"),r(),n(11,"td"),m(12),P(13,"date"),r(),n(14,"td"),C(15,"app-channel-logo",32),r()()),a&2){let o=l.$implicit,e=c(2);p(2),S(o.Outlet),p(2),d("ngIf",e.hasGuidEmpty(o.ID)),p(),d("ngIf",!e.hasGuidEmpty(o.ID)),p(2),S(o.Customer),p(2),S(k(10,7,o.Amount)),p(3),S(R(13,9,o.Created,"dd MMM yyyy HH:mm")),p(3),d("typeId",o.TypeID)}}function an(a,l){if(a&1){let o=I();D(0),n(1,"div",19)(2,"table",20),y("matSortChange",function(t){g(o);let i=c();return _(i.onSort(t))}),n(3,"thead",21)(4,"tr",22)(5,"th",23),m(6,"Outlet"),r(),n(7,"th",24),m(8,"Order number"),r(),n(9,"th"),m(10,"Customer"),r(),n(11,"th",25),m(12,"Amount"),r(),n(13,"th",26),m(14," Created On "),r(),n(15,"th",27),m(16,"Channel"),r()()(),n(17,"tbody"),u(18,nn,16,12,"tr",28),r()(),n(19,"app-mat-paginator-no-count",29),y("total",function(){g(o);let t=c();return _(t.StoreRowsCountAPIResult())})("next",function(){g(o);let t=c();return _(t.NextPage())})("previous",function(){g(o);let t=c();return _(t.PreviousPage())}),r()(),E()}if(a&2){let o=c();p(18),d("ngForOf",o.data),p(),d("filter",o.filter)("totaldata",o.totaldata)("paginationTotal",o.paginationTotal)}}function rn(a,l){a&1&&(n(0,"div",35),C(1,"app-empty-state"),r())}var li=(()=>{let l=class l{constructor(e,t,i){this.http=e,this.localDataService=t,this.authService=i,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.totaldata=0,this.paginationTotal=0,this.channelType=N,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(e=>{this.filter.PageNumber=e.Filter.PageNumber,this.filter.PageSize=e.Filter.RowCount,this.filter.From=e.Filter.From,this.filter.To=e.Filter.To,this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}hasGuidEmpty(e){return e==M.GuidEMpty}Get(e){var t={Number:e,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetShipped",t).subscribe(i=>{this.data=i.Data,this.sourceData=[...i.Data],this.totaldata=this.data.length})}changePage(e){this.filter.PageNumber=e.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){var e={PaymentState:"Unpaid",DeliveryState:"Sent",ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetRowCount",e).subscribe(t=>{this.paginationTotal=t.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}onSort(e){if(e.direction==""){this.data=this.sourceData;return}if(e.active=="created"){let t=e.direction=="asc";this.data=this.data.sort((i,h)=>M.compare(i.Created,h.Created,t))}}};l.\u0275fac=function(t){return new(t||l)(v(A),v(ce),v(Z))},l.\u0275cmp=L({type:l,selectors:[["app-shipped"]],decls:29,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","3 - Shipped","searchBoxPlaceHolder","Search ...",3,"onSubmit"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[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,"total","next","previous","filter","totaldata","paginationTotal"],[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,i){if(t&1){let h=I();n(0,"mainpanel",1),y("onSubmit",function(s){return g(h),_(i.Get(s))}),n(1,"filters")(2,"div")(3,"label",2),m(4,"Channel"),r(),n(5,"ng-select",3),b("ngModelChange",function(s){return g(h),x(i.filter.ListChannelID,s)||(i.filter.ListChannelID=s),_(s)}),u(6,Qi,3,3,"ng-template",4),r()(),n(7,"div",5)(8,"label",6),m(9,"Page Number"),r(),n(10,"input",7),b("ngModelChange",function(s){return g(h),x(i.filter.PageNumber,s)||(i.filter.PageNumber=s),_(s)}),r()(),n(11,"div",5)(12,"label",6),m(13,"Page Size"),r(),n(14,"input",8),b("ngModelChange",function(s){return g(h),x(i.filter.PageSize,s)||(i.filter.PageSize=s),_(s)}),r()(),n(15,"div",5)(16,"label",9),m(17,"From/To"),r(),n(18,"div",10)(19,"datepicker",11),b("dateChange",function(s){return g(h),x(i.filter.From,s)||(i.filter.From=s),_(s)}),r()(),n(20,"div")(21,"datepicker",12),b("dateChange",function(s){return g(h),x(i.filter.To,s)||(i.filter.To=s),_(s)}),r()()()(),n(22,"content")(23,"div",13)(24,"div",14)(25,"div",15),u(26,an,20,4,"ng-container",16)(27,rn,2,0,"ng-template",null,0,U),r()()()()()}if(t&2){let h=O(28);p(5),d("clearable",!0)("multiple",!0)("items",i.channelOptions),w("ngModel",i.filter.ListChannelID),p(5),w("ngModel",i.filter.PageNumber),p(4),w("ngModel",i.filter.PageSize),p(5),w("date",i.filter.From),p(2),w("date",i.filter.To),p(5),d("ngIf",i.data&&i.data.length>0)("ngIfElse",h)}},dependencies:[W,B,$,ae,z,G,Y,ne,X,re,oe,Q,me,se,le,pe,ee,K,F]});let a=l;return a})();var on=()=>["/menu/Order/detail"],ln=(a,l)=>({Number:a,Outlet:l});function pn(a,l){if(a&1&&(n(0,"span",17),C(1,"img",18),r(),m(2)),a&2){let o=l.item;p(),d("src",o==null?null:o.Img,V)("alt",o.Name),p(),T(" ",o.Name," ")}}function mn(a,l){if(a&1&&(n(0,"a",33),m(1),r()),a&2){let o=c().$implicit;d("routerLink",J(3,on))("queryParams",ie(4,ln,o.Number,o.Outlet)),p(),S(o.Number)}}function sn(a,l){if(a&1&&(n(0,"a",34),m(1),r()),a&2){let o=c().$implicit,e=c(2);d("href",e.customerInfoUrl+o.ID,V),p(),S(o.Number)}}function dn(a,l){if(a&1&&(n(0,"tr")(1,"td"),m(2),r(),n(3,"td"),u(4,mn,2,7,"a",30)(5,sn,2,2,"a",31),r(),n(6,"td"),m(7),r(),n(8,"td"),m(9),P(10,"number"),r(),n(11,"td"),m(12),P(13,"date"),r(),n(14,"td"),C(15,"app-channel-logo",32),r()()),a&2){let o=l.$implicit,e=c(2);p(2),S(o.Outlet),p(2),d("ngIf",e.hasGuidEmpty(o.ID)),p(),d("ngIf",!e.hasGuidEmpty(o.ID)),p(2),S(o.Customer),p(2),S(k(10,7,o.Amount)),p(3),S(R(13,9,o.Created,"dd MMM yyyy HH:mm")),p(3),d("typeId",o.TypeID)}}function cn(a,l){if(a&1){let o=I();D(0),n(1,"div",19)(2,"table",20),y("matSortChange",function(t){g(o);let i=c();return _(i.onSort(t))}),n(3,"thead",21)(4,"tr",22)(5,"th",23),m(6,"Outlet"),r(),n(7,"th",24),m(8,"Order number"),r(),n(9,"th"),m(10,"Customer"),r(),n(11,"th",25),m(12,"Amount"),r(),n(13,"th",26),m(14," Created On "),r(),n(15,"th",27),m(16,"Channel"),r()()(),n(17,"tbody"),u(18,dn,16,12,"tr",28),r()(),n(19,"app-mat-paginator-no-count",29),y("total",function(){g(o);let t=c();return _(t.StoreRowsCountAPIResult())})("next",function(){g(o);let t=c();return _(t.NextPage())})("previous",function(){g(o);let t=c();return _(t.PreviousPage())}),r()(),E()}if(a&2){let o=c();p(18),d("ngForOf",o.data),p(),d("filter",o.filter)("totaldata",o.totaldata)("paginationTotal",o.paginationTotal)}}function hn(a,l){a&1&&(n(0,"div",35),C(1,"app-empty-state"),r())}var pi=(()=>{let l=class l{constructor(e,t){this.http=e,this.authService=t,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.totaldata=0,this.paginationTotal=0,this.channelType=N,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}hasGuidEmpty(e){return e==M.GuidEMpty}getChannelLogo(e){return M.getChannelLogoByTypeId(e)}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(e=>{this.filter.PageNumber=e.Filter.PageNumber,this.filter.PageSize=e.Filter.RowCount,this.filter.From=e.Filter.From,this.filter.To=e.Filter.To,this.customerInfoUrl=`${this.authService.getDomain()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(e){var t={Number:e,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetDelivered ",t).subscribe(i=>{this.data=i.Data,this.sourceData=[...i.Data],this.totaldata=this.data.length})}changePage(e){this.filter.PageNumber=e.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){var e={PaymentState:"Paid",DeliveryState:"Sent",ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetRowCount",e).subscribe(t=>{this.paginationTotal=t.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}onSort(e){if(e.direction==""){this.data=this.sourceData;return}if(e.active=="created"){let t=e.direction=="asc";this.data=this.data.sort((i,h)=>M.compare(i.Created,h.Created,t))}}};l.\u0275fac=function(t){return new(t||l)(v(A),v(Z))},l.\u0275cmp=L({type:l,selectors:[["app-delivered"]],decls:29,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","4 - Completed","searchBoxPlaceHolder","Search ...",3,"onSubmit"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[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,"total","next","previous","filter","totaldata","paginationTotal"],[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,i){if(t&1){let h=I();n(0,"mainpanel",1),y("onSubmit",function(s){return g(h),_(i.Get(s))}),n(1,"filters")(2,"div")(3,"label",2),m(4,"Channel"),r(),n(5,"ng-select",3),b("ngModelChange",function(s){return g(h),x(i.filter.ListChannelID,s)||(i.filter.ListChannelID=s),_(s)}),u(6,pn,3,3,"ng-template",4),r()(),n(7,"div",5)(8,"label",6),m(9,"Page Number"),r(),n(10,"input",7),b("ngModelChange",function(s){return g(h),x(i.filter.PageNumber,s)||(i.filter.PageNumber=s),_(s)}),r()(),n(11,"div",5)(12,"label",6),m(13,"Page Size"),r(),n(14,"input",8),b("ngModelChange",function(s){return g(h),x(i.filter.PageSize,s)||(i.filter.PageSize=s),_(s)}),r()(),n(15,"div",5)(16,"label",9),m(17,"From/To"),r(),n(18,"div",10)(19,"datepicker",11),b("dateChange",function(s){return g(h),x(i.filter.From,s)||(i.filter.From=s),_(s)}),r()(),n(20,"div")(21,"datepicker",12),b("dateChange",function(s){return g(h),x(i.filter.To,s)||(i.filter.To=s),_(s)}),r()()()(),n(22,"content")(23,"div",13)(24,"div",14)(25,"div",15),u(26,cn,20,4,"ng-container",16)(27,hn,2,0,"ng-template",null,0,U),r()()()()()}if(t&2){let h=O(28);p(5),d("clearable",!0)("multiple",!0)("items",i.channelOptions),w("ngModel",i.filter.ListChannelID),p(5),w("ngModel",i.filter.PageNumber),p(4),w("ngModel",i.filter.PageSize),p(5),w("date",i.filter.From),p(2),w("date",i.filter.To),p(5),d("ngIf",i.data&&i.data.length>0)("ngIfElse",h)}},dependencies:[W,B,$,ae,z,G,Y,ne,X,re,oe,Q,me,se,le,pe,ee,K,F]});let a=l;return a})();var gn=()=>["/menu/Order/detail"],_n=(a,l)=>({Number:a,Outlet:l});function un(a,l){if(a&1&&(n(0,"span",19),C(1,"img",20),r(),m(2)),a&2){let o=l.item;p(),d("src",o==null?null:o.Img,V)("alt",o.Name),p(),T(" ",o.Name," ")}}function fn(a,l){if(a&1&&(n(0,"a",36),m(1),r()),a&2){let o=c().$implicit;d("routerLink",J(3,gn))("queryParams",ie(4,_n,o.Number,o.Outlet)),p(),S(o.Number)}}function Sn(a,l){if(a&1&&(n(0,"a",37),m(1),r()),a&2){let o=c().$implicit,e=c(2);d("href",e.domain+o.ID,V),p(),S(o.Number)}}function Cn(a,l){if(a&1&&(n(0,"tr")(1,"td"),m(2),r(),n(3,"td"),u(4,fn,2,7,"a",33)(5,Sn,2,2,"a",34),r(),n(6,"td"),m(7),r(),n(8,"td"),m(9),P(10,"number"),r(),n(11,"td"),m(12),P(13,"date"),r(),n(14,"td"),m(15),r(),n(16,"td"),C(17,"app-channel-logo",35),r()()),a&2){let o=l.$implicit,e=c(2);p(2),S(o.Outlet),p(2),d("ngIf",e.hasGuidEmpty(o.ID)),p(),d("ngIf",!e.hasGuidEmpty(o.ID)),p(2),S(o.Customer),p(2),S(k(10,8,o.Amount)),p(3),S(R(13,10,o.Created,"dd MMM yyyy HH:mm")),p(3),S(o.State),p(2),d("typeId",o.TypeID)}}function yn(a,l){if(a&1){let o=I();D(0),n(1,"div",21)(2,"table",22),y("matSortChange",function(t){g(o);let i=c();return _(i.onSort(t))}),n(3,"thead",23)(4,"tr",24)(5,"th",25),m(6,"Outlet"),r(),n(7,"th",26),m(8,"Order number"),r(),n(9,"th"),m(10,"Customer"),r(),n(11,"th",27),m(12,"Amount"),r(),n(13,"th",28),m(14," Created On "),r(),n(15,"th",29),m(16,"Status"),r(),n(17,"th",30),m(18,"Channel"),r()()(),n(19,"tbody"),u(20,Cn,18,13,"tr",31),r()(),n(21,"app-mat-paginator-no-count",32),y("total",function(){g(o);let t=c();return _(t.StoreRowsCountAPIResult())})("next",function(){g(o);let t=c();return _(t.NextPage())})("previous",function(){g(o);let t=c();return _(t.PreviousPage())}),r()(),E()}if(a&2){let o=c();p(20),d("ngForOf",o.data),p(),d("filter",o.filter)("totaldata",o.totaldata)("paginationTotal",o.paginationTotal)}}function wn(a,l){a&1&&(n(0,"div",38),C(1,"app-empty-state"),r())}var mi=(()=>{let l=class l{constructor(e,t,i,h){this.http=e,this.localDataService=t,this.authService=i,this.dialog=h,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.totaldata=0,this.paginationTotal=0,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}hasGuidEmpty(e){return e==M.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(e=>{this.filter.PageNumber=e.Filter.PageNumber,this.filter.PageSize=e.Filter.RowCount,this.filter.From=e.Filter.From,this.filter.To=e.Filter.To,this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(e){var t={Number:e,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetAll",t).subscribe(i=>{this.data=i.Data,this.sourceData=[...i.Data],this.totaldata=this.data.length})}openExportDialog(){this.dialog.open(Rt,{data:{title:"Export Order All",pageNumber:this.filter.PageNumber,rowCount:this.filter.PageSize,filterExport:this.filter,getRowCountApi:"orders/GetRowCount",exportApi:"orders/GetExportAll"}}).afterClosed().subscribe()}changePage(e){this.filter=e,this.Get()}StoreRowsCountAPIResult(){var e={PaymentState:"",DeliveryState:"",Bin:!1,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetRowCount",e).subscribe(t=>{this.paginationTotal=t.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}onSort(e){if(e.direction==""){this.data=this.sourceData;return}if(e.active=="created"){let t=e.direction=="asc";this.data=this.data.sort((i,h)=>M.compare(i.Created,h.Created,t))}}};l.\u0275fac=function(t){return new(t||l)(v(A),v(ce),v(Z),v(De))},l.\u0275cmp=L({type:l,selectors:[["app-all-order"]],decls:34,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","All","searchBoxPlaceHolder","Search ...",3,"onSubmit"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[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,"total","next","previous","filter","totaldata","paginationTotal"],[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,i){if(t&1){let h=I();n(0,"mainpanel",1),y("onSubmit",function(s){return g(h),_(i.Get(s))}),n(1,"actions")(2,"button",2),y("click",function(){return g(h),_(i.openExportDialog())}),C(3,"i",3),n(4,"span"),m(5,"Export"),r()()(),n(6,"filters")(7,"div")(8,"label",4),m(9,"Channel"),r(),n(10,"ng-select",5),b("ngModelChange",function(s){return g(h),x(i.filter.ListChannelID,s)||(i.filter.ListChannelID=s),_(s)}),u(11,un,3,3,"ng-template",6),r()(),n(12,"div",7)(13,"label",8),m(14,"Page Number"),r(),n(15,"input",9),b("ngModelChange",function(s){return g(h),x(i.filter.PageNumber,s)||(i.filter.PageNumber=s),_(s)}),r()(),n(16,"div",7)(17,"label",8),m(18,"Page Size"),r(),n(19,"input",10),b("ngModelChange",function(s){return g(h),x(i.filter.PageSize,s)||(i.filter.PageSize=s),_(s)}),r()(),n(20,"div",7)(21,"label",11),m(22,"From/To"),r(),n(23,"div",12)(24,"datepicker",13),b("dateChange",function(s){return g(h),x(i.filter.From,s)||(i.filter.From=s),_(s)}),r()(),n(25,"div")(26,"datepicker",14),b("dateChange",function(s){return g(h),x(i.filter.To,s)||(i.filter.To=s),_(s)}),r()()()(),n(27,"content")(28,"div",15)(29,"div",16)(30,"div",17),u(31,yn,22,4,"ng-container",18)(32,wn,2,0,"ng-template",null,0,U),r()()()()()}if(t&2){let h=O(33);p(10),d("clearable",!0)("multiple",!0)("items",i.channelOptions),w("ngModel",i.filter.ListChannelID),p(5),w("ngModel",i.filter.PageNumber),p(4),w("ngModel",i.filter.PageSize),p(5),w("date",i.filter.From),p(2),w("date",i.filter.To),p(5),d("ngIf",i.data&&i.data.length>0)("ngIfElse",h)}},dependencies:[W,B,$,ae,z,G,Y,ne,X,re,oe,Q,me,se,le,pe,ee,K,F]});let a=l;return a})();var xn=()=>["/menu/Order/detail"],bn=(a,l)=>({Number:a,Outlet:l});function vn(a,l){if(a&1&&(n(0,"span",18),C(1,"img",19),r(),m(2)),a&2){let o=l.item;p(),d("src",o==null?null:o.Img,V)("alt",o.Name),p(),T(" ",o.Name," ")}}function Tn(a,l){if(a&1&&(n(0,"a",34),m(1),r()),a&2){let o=c().$implicit;d("routerLink",J(3,xn))("queryParams",ie(4,bn,o.Number,o.Outlet)),p(),S(o.Number)}}function Dn(a,l){if(a&1&&(n(0,"a",35),m(1),r()),a&2){let o=c().$implicit,e=c(2);d("href",e.domain+o.ID,V),p(),S(o.Number)}}function En(a,l){if(a&1&&(n(0,"tr")(1,"td"),m(2),r(),n(3,"td"),u(4,Tn,2,7,"a",31)(5,Dn,2,2,"a",32),r(),n(6,"td"),m(7),r(),n(8,"td"),m(9),P(10,"number"),r(),n(11,"td"),m(12),P(13,"date"),r(),n(14,"td"),C(15,"app-channel-logo",33),r()()),a&2){let o=l.$implicit,e=c(2);p(2),S(o.Outlet),p(2),d("ngIf",e.hasGuidEmpty(o.ID)),p(),d("ngIf",!e.hasGuidEmpty(o.ID)),p(2),S(o.Customer),p(2),S(k(10,7,o.Amount)),p(3),S(R(13,9,o.Created,"dd MMM yyyy HH:mm")),p(3),d("typeId",o.TypeID)}}function Pn(a,l){if(a&1){let o=I();D(0),n(1,"div",20)(2,"table",21),y("matSortChange",function(t){g(o);let i=c();return _(i.onSort(t))}),n(3,"thead",22)(4,"tr",23)(5,"th",24),m(6,"Outlet"),r(),n(7,"th",25),m(8,"Order number"),r(),n(9,"th"),m(10,"Customer"),r(),n(11,"th",26),m(12,"Amount"),r(),n(13,"th",27),m(14," Created On "),r(),n(15,"th",28),m(16,"Channel"),r()()(),n(17,"tbody"),u(18,En,16,12,"tr",29),r()(),n(19,"app-mat-paginator-no-count",30),y("total",function(){g(o);let t=c();return _(t.StoreRowsCountAPIResult())})("next",function(){g(o);let t=c();return _(t.NextPage())})("previous",function(){g(o);let t=c();return _(t.PreviousPage())}),r()(),E()}if(a&2){let o=c();p(18),d("ngForOf",o.data),p(),d("filter",o.filter)("totaldata",o.totaldata)("paginationTotal",o.paginationTotal)}}function In(a,l){a&1&&(n(0,"div",36),C(1,"app-empty-state"),r())}var si=(()=>{let l=class l{constructor(e,t,i){this.http=e,this.localDataService=t,this.authService=i,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],Note:"",From:null,To:null},this.totaldata=0,this.paginationTotal=0,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}hasGuidEmpty(e){return e==M.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(e=>{this.filter.PageNumber=e.Filter.PageNumber,this.filter.PageSize=e.Filter.RowCount,this.filter.From=e.Filter.From,this.filter.To=e.Filter.To,this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(e){var t={Number:e,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,Note:this.filter.Note,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetCancelled ",t).subscribe(i=>{this.data=i.Data,this.sourceData=[...i.Data],this.totaldata=this.data.length})}changePage(e){this.filter.PageNumber=e.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){var e={PaymentState:"",DeliveryState:"",Bin:!0,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetRowCount",e).subscribe(t=>{this.paginationTotal=t.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}getChannelLogo(e){return M.getChannelLogoByTypeId(e)}onSort(e){if(e.direction==""){this.data=this.sourceData;return}if(e.active=="created"){let t=e.direction=="asc";this.data=this.data.sort((i,h)=>M.compare(i.Created,h.Created,t))}}};l.\u0275fac=function(t){return new(t||l)(v(A),v(ce),v(Z))},l.\u0275cmp=L({type:l,selectors:[["app-cancelled"]],decls:33,vars:11,consts:[["EMPTY_STATE",""],["headerTitle","99 - Cancelled","searchBoxPlaceHolder","Search ...",3,"onSubmit"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","text","name","Note",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[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,"total","next","previous","filter","totaldata","paginationTotal"],[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,i){if(t&1){let h=I();n(0,"mainpanel",1),y("onSubmit",function(s){return g(h),_(i.Get(s))}),n(1,"filters")(2,"div")(3,"label",2),m(4,"Channel"),r(),n(5,"ng-select",3),b("ngModelChange",function(s){return g(h),x(i.filter.ListChannelID,s)||(i.filter.ListChannelID=s),_(s)}),u(6,vn,3,3,"ng-template",4),r()(),n(7,"div",5)(8,"label",6),m(9,"Page Number"),r(),n(10,"input",7),b("ngModelChange",function(s){return g(h),x(i.filter.PageNumber,s)||(i.filter.PageNumber=s),_(s)}),r()(),n(11,"div",5)(12,"label",6),m(13,"Page Size"),r(),n(14,"input",8),b("ngModelChange",function(s){return g(h),x(i.filter.PageSize,s)||(i.filter.PageSize=s),_(s)}),r()(),n(15,"div",5)(16,"label",6),m(17,"Note"),r(),n(18,"input",9),b("ngModelChange",function(s){return g(h),x(i.filter.Note,s)||(i.filter.Note=s),_(s)}),r()(),n(19,"div",5)(20,"label",10),m(21,"From/To"),r(),n(22,"div",11)(23,"datepicker",12),b("dateChange",function(s){return g(h),x(i.filter.From,s)||(i.filter.From=s),_(s)}),r()(),n(24,"div")(25,"datepicker",13),b("dateChange",function(s){return g(h),x(i.filter.To,s)||(i.filter.To=s),_(s)}),r()()()(),n(26,"content")(27,"div",14)(28,"div",15)(29,"div",16),u(30,Pn,20,4,"ng-container",17)(31,In,2,0,"ng-template",null,0,U),r()()()()()}if(t&2){let h=O(32);p(5),d("clearable",!0)("multiple",!0)("items",i.channelOptions),w("ngModel",i.filter.ListChannelID),p(5),w("ngModel",i.filter.PageNumber),p(4),w("ngModel",i.filter.PageSize),p(4),w("ngModel",i.filter.Note),p(5),w("date",i.filter.From),p(2),w("date",i.filter.To),p(5),d("ngIf",i.data&&i.data.length>0)("ngIfElse",h)}},dependencies:[W,B,$,ae,z,G,Y,ne,X,re,oe,Q,me,se,le,pe,ee,K,F]});let a=l;return a})();var Me=function(a){return a[a.DoNothing=0]="DoNothing",a[a.New=1]="New",a[a.Update=2]="Update",a}(Me||{});var Nn=a=>({"full-width":a}),Mn=()=>({standalone:!0}),$e=(()=>{let l=class l{constructor(e){this.datePipe=e,this.fullWidth=!1,this.timeChange=new lt}ngOnInit(){}onTimeChange(e){let t=null;e&&(t=this.datePipe.transform(e,"HH:mm")),this.timeChange.emit(t),this.onTimePickerChange()}onShowCalendar(){let e=document.getElementById("dropdown-filter");if(e){var t=new bootstrap.Dropdown(e);t&&(t._config.autoClose="inside")}}onTimePickerChange(){let e=document.getElementById("dropdown-filter");if(e){var t=new bootstrap.Dropdown(e);t&&(t._config.autoClose="outside")}}};l.\u0275fac=function(t){return new(t||l)(v(F))},l.\u0275cmp=L({type:l,selectors:[["app-timepicker"]],inputs:{time:"time",fullWidth:"fullWidth"},outputs:{timeChange:"timeChange"},standalone:!0,features:[We],decls:4,vars:8,consts:[["myCalendar",""],["styleClass","custom-height","id","shippingTime","appendTo","body",3,"ngModelChange","onSelect","ngClass","baseZIndex","ngModel","timeOnly","ngModelOptions"],["pButton","","type","button","label","Close",3,"click"]],template:function(t,i){if(t&1){let h=I();n(0,"p-calendar",1,0),b("ngModelChange",function(s){return g(h),x(i.time,s)||(i.time=s),_(s)}),y("ngModelChange",function(s){return g(h),_(i.onTimeChange(s))})("onSelect",function(){return g(h),_(i.onShowCalendar())}),n(2,"p-footer")(3,"button",2),y("click",function(){return g(h),O(1).hideOverlay(),_(i.onShowCalendar())}),r()()()}t&2&&(d("ngClass",Be(5,Nn,i.fullWidth))("baseZIndex",1100),w("ngModel",i.time),d("timeOnly",!0)("ngModelOptions",J(7,Mn)))},dependencies:[Se,ze,Xt,Zt,$t,qt,Ue,z,G],styles:["p-calendar span.p-calendar.p-calendar-timeonly.custom-height{height:44px;width:55px} p-calendar.full-width span.p-calendar.p-calendar-timeonly.custom-height{height:44px;width:100%!important}"]});let a=l;return a})();var kn=(a,l)=>({"over-due-today":a,"over-due":l}),Ln=a=>({"over-due":a});function Vn(a,l){if(a&1){let o=I();D(0),n(1,"div",19)(2,"button",20),y("click",function(){g(o),c();let t=O(11);return _(t.previous())}),m(3," Back "),r(),n(4,"button",21),y("click",function(){g(o);let t=c(),i=O(11);return _(t.onNext(i))}),m(5," Next "),r()(),E()}if(a&2){let o=c();p(4),d("disabled",o.checkDisabledNextFilter())}}function Fn(a,l){if(a&1){let o=I();D(0),n(1,"button",22),y("click",function(){g(o);let t=c(),i=O(11);return _(t.onNext(i))}),m(2," Next "),r(),E()}if(a&2){let o=c();p(),d("disabled",o.checkDisabledNextFilter())}}function An(a,l){if(a&1){let o=I();D(0),n(1,"button",23),y("click",function(){g(o);let t=c(),i=O(11);return _(t.onNew(i))}),C(2,"i",24),m(3," New "),r(),E()}}function Rn(a,l){a&1&&(C(0,"i",25),n(1,"span"),m(2,"Filter"),r())}function Wn(a,l){if(a&1&&(n(0,"ng-option",35),C(1,"img",36),m(2),r()),a&2){let o=l.$implicit;d("value",o.ID),p(),d("src",o==null?null:o.Img,V),p(),T("",o.Name," ")}}function Bn(a,l){if(a&1){let o=I();n(0,"div",31)(1,"div",27)(2,"h5"),m(3,"Type"),r(),n(4,"p",28),m(5,"Select Type want to download"),r()(),n(6,"div",27)(7,"div",37)(8,"div")(9,"mat-radio-group",38),b("ngModelChange",function(t){g(o);let i=c(2);return x(i.downloadType,t)||(i.downloadType=t),_(t)}),n(10,"mat-radio-button",39),m(11," Orders "),r(),n(12,"mat-radio-button",40),m(13," Disbursement "),r()()()(),n(14,"div",41)(15,"div",42),C(16,"i",43),r(),n(17,"p",44),m(18," If there are completed transactions, to obtain payment and service fee, you need to download disbursement. "),r()()()()}if(a&2){let o=c(2);p(9),w("ngModel",o.downloadType),p(),d("value",!1),p(2),d("value",!0)}}function zn(a,l){a&1&&(n(0,"p",28),m(1," Select Disbursement date "),n(2,"span",45),m(3,"(payment date / order complete date)"),r(),m(4," of the channel you want to download (Max 1 Week). "),r())}function Gn(a,l){a&1&&(n(0,"p",28),m(1," Select transaction date of the channel you want to download (Max 2 Weeks) "),r())}function jn(a,l){if(a&1){let o=I();D(0),n(1,"div",46)(2,"app-timepicker",47),b("timeChange",function(t){g(o);let i=c(2);return x(i.timeFrom,t)||(i.timeFrom=t),_(t)}),r(),n(3,"span",48),m(4,"-"),r(),n(5,"app-timepicker",47),b("timeChange",function(t){g(o);let i=c(2);return x(i.timeTo,t)||(i.timeTo=t),_(t)}),r()(),E()}if(a&2){let o=c(2);p(2),w("time",o.timeFrom),p(3),w("time",o.timeTo)}}function Hn(a,l){if(a&1){let o=I();n(0,"div",26)(1,"div",8)(2,"div",7)(3,"div",27)(4,"h5"),m(5,"Select a Channel"),r(),n(6,"p",28),m(7," Select Channel want to download order "),r()(),n(8,"div",27)(9,"ng-select",29),b("ngModelChange",function(t){g(o);let i=c();return x(i.channelID,t)||(i.channelID=t),_(t)}),y("ngModelChange",function(){g(o);let t=c();return _(t.onSelectChannel())}),u(10,Wn,3,3,"ng-option",30),r()()(),u(11,Bn,19,3,"div",31),P(12,"async"),n(13,"div",31)(14,"div",27)(15,"h5"),m(16,"Date Range"),r(),u(17,zn,5,0,"p",28)(18,Gn,2,0,"p",28),r(),n(19,"div",27)(20,"div",8)(21,"mat-date-range-input",32)(22,"input",33),b("ngModelChange",function(t){g(o);let i=c();return x(i.startDate,t)||(i.startDate=t),_(t)}),y("click",function(){g(o);let t=O(25);return _(t.open())}),r(),n(23,"input",34),b("ngModelChange",function(t){g(o);let i=c();return x(i.endDate,t)||(i.endDate=t),_(t)}),y("click",function(){g(o);let t=O(25);return _(t.open())})("ngModelChange",function(){g(o);let t=c();return _(t.onFilterDateChange())}),r()(),C(24,"mat-date-range-picker",null,1),r(),u(26,jn,6,2,"ng-container",5),r()()()()}if(a&2){let o,e=O(25),t=c();p(9),d("clearable",!1),w("ngModel",t.channelID),p(),d("ngForOf",t.channelOptions),p(),Qe((o=k(12,9,t.channelDetail$))!=null&&o.ServiceFeeWriteOff?11:-1),p(6),Qe(t.downloadType()&&(t.currentChannel==null?null:t.currentChannel.TypeID)==t.channelType.Tokopedia?17:18),p(4),d("rangePicker",e),p(),w("ngModel",t.startDate),p(),w("ngModel",t.endDate),p(3),d("ngIf",t.showTimePicker)}}function Un(a,l){a&1&&(C(0,"i",49),n(1,"span"),m(2,"Preview"),r())}function Yn(a,l){if(a&1&&(n(0,"th",71),m(1),r()),a&2){let o=c(3);p(),T(" ",o.currentChannel?"Created Date":"Last Status Update"," ")}}function qn(a,l){if(a&1&&(n(0,"td"),m(1),P(2,"date"),r()),a&2){let o=c().$implicit;p(),T(" ",R(2,1,o.Date,"dd MMM yyyy HH:mm:ss")," ")}}function Jn(a,l){if(a&1&&(n(0,"span"),m(1),r()),a&2){let o=c().$implicit;p(),T(" ",o.ActionString," ")}}function Kn(a,l){if(a&1&&(n(0,"li"),m(1),r()),a&2){let o=l.$implicit;p(),T(" ",o," ")}}function $n(a,l){if(a&1&&(n(0,"ul",76),u(1,Kn,2,1,"li",72),r()),a&2){let o=c().$implicit;p(),d("ngForOf",o.ActionString)}}function Zn(a,l){if(a&1&&(n(0,"span",77),C(1,"i",78),r()),a&2){let o=c().$implicit;st("title","Delivery : ",o.DeliveryState,`
|
|
6
|
+
Payment : `,o.PaymentState,"")}}function Xn(a,l){if(a&1&&(n(0,"tr")(1,"td"),m(2),r(),n(3,"td"),m(4),r(),u(5,qn,3,4,"td",5),n(6,"td")(7,"span"),m(8),r(),m(9),r(),n(10,"td",73)(11,"span"),m(12),r(),m(13),r(),n(14,"td"),u(15,Jn,2,1,"span",5)(16,$n,2,1,"ul",74),r(),n(17,"td"),u(18,Zn,2,3,"span",75),r()()),a&2){let o=l.$implicit,e=l.index,t=c(4);p(2),S(e+1),p(2),S(o.Number),p(),d("ngIf",(t.currentChannel==null?null:t.currentChannel.TypeID)!=t.channelType.Shopee&&(t.currentChannel==null?null:t.currentChannel.TypeID)!==t.channelType.Tiktok),p(3),T("",o.ChannelStatus," - "),p(),T("",o.ChannelStatusDescription," "),p(),d("ngClass",ie(12,kn,(o==null?null:o.Action)==t.actionPreviewOrder.Update,(o==null?null:o.Action)==t.actionPreviewOrder.New))("matTooltip",o.POSStatus==91||o.POSStatusDescription=="Conflict"?"There is a missed status at POS, usually fulfillment has not been recorded but the payment has been recorded":""),p(2),T("",o.POSStatus," - "),p(),T("",o.POSStatusDescription," "),p(2),d("ngIf",o.ActionString.length==1),p(),d("ngIf",o.ActionString.length>1),p(2),d("ngIf",o.ChannelStatus!=99&&o.POSStatus!=99)}}function Qn(a,l){if(a&1&&(D(0),u(1,Xn,19,15,"tr",72),E()),a&2){let o=c(3);p(),d("ngForOf",o.displayedPreviewData)}}function ea(a,l){a&1&&(n(0,"tr",79)(1,"td",80)(2,"div",81),C(3,"i",82),r(),n(4,"h4",83),m(5," There is no order to processed "),r()()())}function ta(a,l){if(a&1){let o=I();n(0,"div",51)(1,"div",52)(2,"div",53)(3,"div",54)(4,"div")(5,"ul",55)(6,"li",56)(7,"button",57),y("click",function(){g(o);let t=c(2);return _(t.filterPreviewData(t.previewStatus.ALL))}),m(8),r()(),n(9,"li",58)(10,"button",59),y("click",function(){g(o);let t=c(2);return _(t.filterPreviewData(t.previewStatus.SYNC))}),m(11),r()(),n(12,"li",58)(13,"button",60),y("click",function(){g(o);let t=c(2);return _(t.filterPreviewData(t.previewStatus.WRONG))}),m(14),r()(),n(15,"li",58)(16,"button",61),y("click",function(){g(o);let t=c(2);return _(t.filterPreviewData(t.previewStatus.UNSYNC))}),m(17),r()()()(),n(18,"div")(19,"button",62),y("click",function(){g(o);let t=c(2);return _(t.exportOrders())}),C(20,"i",63),n(21,"span"),m(22,"Export"),r()()()()(),n(23,"table",64)(24,"thead",65)(25,"tr"),C(26,"th",66),n(27,"th",67),m(28,"Number"),r(),u(29,Yn,2,1,"th",68),n(30,"th",69),m(31,"Channel Status"),r(),n(32,"th",69),m(33,"POS Status"),r(),n(34,"th"),m(35,"Action"),r(),C(36,"th",66),r()(),n(37,"tbody"),u(38,Qn,2,1,"ng-container",70)(39,ea,6,0,"ng-template",null,2,U),r()()()()}if(a&2){let o=O(40),e=c(2);p(7),d("ngClass",e.pillStatus=="all"?"btn-secondary text-white":"btn-outline-dark"),p(),T(" All (",e.allData,") "),p(2),d("ngClass",e.pillStatus=="sync"?"btn-success":"btn-outline-success"),p(),T(" Existing (",e.syncData,") "),p(2),d("ngClass",e.pillStatus=="wrong"?"btn-warning text-white":"btn-outline-warning"),p(),T(" Wrong Status (",e.wrongData,") "),p(2),d("ngClass",e.pillStatus=="unsync"?"btn-danger":"btn-outline-danger"),p(),T(" Missing (",e.unsyncData,") "),p(12),d("ngIf",(e.currentChannel==null?null:e.currentChannel.TypeID)!=e.channelType.Shopee&&(e.currentChannel==null?null:e.currentChannel.TypeID)!==e.channelType.Tiktok),p(9),d("ngIf",e.displayedPreviewData.length>0)("ngIfElse",o)}}function ia(a,l){if(a&1&&u(0,ta,41,11,"div",50),a&2){let o=c();d("ngIf",o.currentState=="preview")}}function na(a,l){a&1&&(C(0,"i",84),n(1,"span"),m(2,"Finish"),r())}function aa(a,l){if(a&1&&(n(0,"tr",86)(1,"td"),m(2),r(),n(3,"td"),m(4),r(),n(5,"td"),m(6),r(),n(7,"td"),m(8),r()()),a&2){let o=l.$implicit,e=l.index;d("ngClass",Be(5,Ln,o.Exception)),p(2),S(e+1),p(2),S(o.Number),p(2),S(o.Status),p(2),S(o.Exception)}}function ra(a,l){if(a&1&&(D(0),u(1,aa,9,7,"tr",85),E()),a&2){let o=c(3);p(),d("ngForOf",o.downloadData)}}function oa(a,l){a&1&&(n(0,"tr",79)(1,"td",80)(2,"div",81),C(3,"i",82),r(),n(4,"h4",83),m(5," There is no order to processed "),r()()())}function la(a,l){if(a&1&&(n(0,"div",51)(1,"div",52)(2,"table",64)(3,"thead",65)(4,"tr"),C(5,"th",66),n(6,"th"),m(7,"Order Number"),r(),n(8,"th"),m(9,"Status"),r(),n(10,"th"),m(11,"Exception"),r()()(),n(12,"tbody"),u(13,ra,2,1,"ng-container",70)(14,oa,6,0,"ng-template",null,3,U),r()()()()),a&2){let o=O(15),e=c(2);p(13),d("ngIf",(e.downloadData==null?null:e.downloadData.length)>0)("ngIfElse",o)}}function pa(a,l){if(a&1&&u(0,la,16,2,"div",50),a&2){let o=c();d("ngIf",o.currentState=="finish")}}function ma(a,l){a&1&&(n(0,"h6"),m(1,"1"),r())}function sa(a,l){a&1&&(n(0,"h6"),m(1,"2"),r())}function da(a,l){a&1&&(n(0,"h6"),m(1,"3"),r())}var te=function(a){return a.ALL="all",a.SYNC="sync",a.WRONG="wrong",a.UNSYNC="unsync",a}(te||{}),di=(()=>{let l=class l{constructor(e,t,i,h,f,s,q){this.http=e,this.toastr=t,this.datePipe=i,this.url=h,this.productService=f,this.orderService=s,this.authService=q,this.pageTitle="Download to POS",this.pillStatus="all",this.displayedPreviewData=[],this.previewData=[],this.channelType=N,this.previewStatus=te,this.currentState="filter",this.wrongData=0,this.unsyncData=0,this.syncData=0,this.allData=0,this.actionPreviewOrder=Me,this.showTimePicker=!1,this.downloadType=pt(!1),this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initTimeFilter(),this.url.queryParams.subscribe(e=>{this.channelID=e.ChannelID,this.startDate=new Date(e.Date),this.endDate=new Date(e.Date)})}initTimeFilter(){this.timeFrom="00:00",this.timeTo="23:59"}onDownload(e){let t={ID:this.channelID,From:this.startDate,To:this.endDate,ListPreview:this.downloadedPreviewData,IsDisbursement:this.downloadType()};this.http.post("/api/Orders/Download",t).subscribe(i=>{this.downloadData=i.Body,this.onStepperNext(e)})}onPreview(e){if(!this.validateDatePreview())return;let t={ID:this.channelID,From:this.startDate,To:this.endDate,IsDisbursement:this.downloadType()};this.showTimePicker&&(t=it(tt({},t),{TimeFrom:this.timeFrom+":00",TimeTo:this.timeTo+":00"})),this.http.post("/api/Orders/Preview",t).subscribe(i=>{if(i.length==0){this.toastrEmptyPreview();return}this.previewData=i,this.groupingPreviewData(),this.filterPreviewData(te.ALL),this.initLengthStatusData(),this.onStepperNext(e)})}toastrEmptyPreview(){let e=this.datePipe.transform(this.startDate,"dd MMM yyyy"),t=this.datePipe.transform(this.endDate,"dd MMM yyyy"),i=this.showTimePicker?this.timeFrom+":00":"",h=this.showTimePicker?this.timeTo+":00":"";this.toastr.info(`There is no orders from ${e} ${i} to ${t} ${h}!`,"No Orders!")}validateDatePreview(){let e=!0;return this.downloadType()==!0?M.getDaysDiff(this.startDate,this.endDate)+1>7&&(this.toastr.warning("Dates cannot be more than 7 days apart!","Failed"),e=!1):M.getDaysDiff(this.startDate,this.endDate)+1>14&&(this.toastr.warning("Dates cannot be more than 14 days apart!","Failed"),e=!1),e}onSelectChannel(){this.currentChannel=this.channelOptions.find(e=>e.ID==this.channelID),this.initGetChannelDetail()}initGetChannelDetail(){this.currentChannel.TypeID==N.Tokopedia?this.channelDetail$=this.http.post("/api/ChannelLoader/GetChannelView",{ID:this.currentChannel.ID}).pipe(j(e=>e?.Model),ye(1)):this.channelDetail$=null}setPageTitle(e){this.pageTitle=`
|
|
7
|
+
${e} (${this.getDateTitle()})
|
|
8
|
+
`}getDateTitle(){let e=M.formatTitleFromDate(new Date(this.startDate),new Date(this.endDate)),t=this.datePipe.transform(this.startDate,e),i=this.datePipe.transform(this.endDate,"dd MMM yyyy");return`${e==null?"":t+"-"} ${i}`}onNew(e){this.channelID=null,this.startDate=null,this.endDate=null,this.pageTitle="Download to POS",this.channelDetail$=null,e.reset()}groupingPreviewData(){let e=this.filterDataByStatus(te.UNSYNC),t=this.filterDataByStatus(te.WRONG),i=[];this.currentChannel.TypeID==N.Tokopedia&&(i=this.filterDataByStatus(te.SYNC)),this.downloadedPreviewData=[...i,...e,...t]}filterDataByStatus(e){let t=[];switch(e){case te.ALL:t=this.previewData;break;case te.SYNC:t=this.previewData.filter(i=>i.Action==Me.DoNothing);break;case te.WRONG:t=this.previewData.filter(i=>i.Action==Me.Update);break;case te.UNSYNC:t=this.previewData.filter(i=>i.Action==Me.New);break}return t}filterPreviewData(e){this.pillStatus=e,this.displayedPreviewData=this.filterDataByStatus(e)}initLengthStatusData(){this.wrongData=this.filterDataByStatus(te.WRONG).length,this.allData=this.previewData.length,this.syncData=this.filterDataByStatus(te.SYNC).length,this.unsyncData=this.filterDataByStatus(te.UNSYNC).length}getTypeID(){var e=this.channelOptions.find(t=>t.ID==this.channelID)?.TypeID;return e??0}onStepperChange(e){this.currentState=e.selectedStep.state}onStepperNext(e){e.selected.completed=!0,e.next()}onNext(e){switch(this.currentState){case"filter":this.onPreview(e);break;case"preview":this.onDownload(e);break}}stepChange(e){switch(e?.selectedStep?.state){case"filter":this.pageTitle="Download To POS",this.resetPreviewData();break;case"preview":let t=this.productService.findChannelById(this.channelID,this.channelOptions);this.setPageTitle(`Preview ${t?.Name}`);break;case"finish":this.setPageTitle("Download");break}}resetPreviewData(){this.displayedPreviewData=[],this.previewData=[],this.initLengthStatusData()}checkDisabledNextFilter(){let e=!M.isValidDate(this.startDate)||!M.isValidDate(this.endDate),t=M.IsEmpty(this.channelID);return e||t}exportOrders(){let e={ID:this.channelID,From:this.startDate,To:this.endDate},t=`Orders ${this.getDateTitle()}`;this.orderService.exportOrders(e,t).subscribe()}onFilterDateChange(){let e=1;this.startDate&&this.endDate&&(e=M.getDaysDiff(this.startDate,this.endDate)),this.showTimePicker=e==0}};l.\u0275fac=function(t){return new(t||l)(v(A),v(Te),v(F),v(Ge),v(Ot),v(Ee),v(Z))},l.\u0275cmp=L({type:l,selectors:[["app-download"]],features:[dt([{provide:Bt,useValue:{displayDefaultIndicatorType:!1}}])],decls:24,vars:12,consts:[["stepper",""],["picker",""],["EMPTY",""],["EMPTY_DOWNLOAD",""],[3,"headerTitle","description","hideSearchBox","hideSearchDropdown"],[4,"ngIf"],[1,"container-fluid","pt-5","mt-5"],[1,"row"],[1,"col-12"],[1,"d-flex","justify-content-center"],["linear","",1,"w-100","stepper-download",3,"selectionChange","ngClass"],["state","filter",3,"editable","completed"],["matStepLabel",""],["matStepContent",""],["state","preview",3,"editable","completed"],["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","bg-success","text-white",3,"click","disabled"],["type","button",1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-2","bg-success","text-white",3,"click","disabled"],[1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],[1,"fa-solid","fa-filter","me-3"],[1,"row","pt-2",2,"width","63%","margin-right","40px"],[1,"col-6"],[1,"text-muted"],["appendTo","body","placeholder","Select Channel",3,"ngModelChange","clearable","ngModel"],[3,"value",4,"ngFor","ngForOf"],[1,"row","mt-6"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"form-label-group","radio","download-type",2,"margin-bottom","0px"],["name","dowloadType",3,"ngModelChange","ngModel"],["matTooltip","Download from Create sales order until create logistics status",1,"me-5",3,"value"],["matTooltip","Download only Payment and write off",1,"me-5",3,"value"],[1,"d-flex","border","mb-4","pt-6","px-6","mt-3",2,"background","#1f87ac0a","border-radius","5px"],[1,"me-3","pt-1"],[1,"fa","fa-lightbulb","fs-5"],[1,"mb-6"],[1,"fw-bold"],[1,"mt-8"],[3,"timeChange","time"],[1,"mx-4"],[1,"fa-solid","fa-file","me-3"],["class","row pt-2",4,"ngIf"],[1,"row","pt-2"],[1,"col-md-12"],[1,"row","mx-1","mb-5"],[1,"col-12","d-flex","justify-content-between","align-items-end",2,"padding-left","0px","padding-right","0px"],[1,"nav","nav-pills"],[1,"nav-item","me-3"],[1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],[1,"nav-item","mx-3"],["matTooltip","All Invoice which is already available in POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["matTooltip","Invoices that have different status between marketplace and POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["matTooltip","Invoices which is not exist in POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["type","button",1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"table"],[1,"thead-light"],["width","1%"],["width","25%"],["width","15%",4,"ngIf"],["width","10%"],[4,"ngIf","ngIfElse"],["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"],[1,"fa-sharp","fa-solid","fa-flag","me-3"],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"]],template:function(t,i){if(t&1){let h=I();n(0,"mainpanel",4)(1,"actions"),u(2,Vn,6,1,"ng-container",5)(3,Fn,3,1,"ng-container",5)(4,An,4,0,"ng-container",5),r(),n(5,"content")(6,"div",6)(7,"div",7)(8,"div",8)(9,"div",9)(10,"mat-stepper",10,0),y("selectionChange",function(s){return g(h),_(i.stepChange(s))})("selectionChange",function(s){return g(h),_(i.onStepperChange(s))}),n(12,"mat-step",11),u(13,Rn,3,0,"ng-template",12)(14,Hn,27,11,"ng-template",13),r(),n(15,"mat-step",14),u(16,Un,3,0,"ng-template",12)(17,ia,1,1,"ng-template",13),r(),n(18,"mat-step",15),u(19,na,3,0,"ng-template",12)(20,pa,1,1,"ng-template",13),r(),u(21,ma,2,0,"ng-template",16)(22,sa,2,0,"ng-template",17)(23,da,2,0,"ng-template",18),r()()()()()()()}if(t&2){let h=O(11);d("headerTitle",i.pageTitle)("description",i.pageTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),p(2),d("ngIf",i.currentState=="preview"),p(),d("ngIf",i.currentState=="filter"),p(),d("ngIf",i.currentState=="finish"),p(6),mt("ngClass","last-edited-step-"+h.selectedIndex),p(2),d("editable",i.currentState!="finish")("completed",!1),p(3),d("editable",i.currentState!="finish")("completed",!1)}},dependencies:[ze,W,B,$,z,G,Y,X,gt,Vt,kt,Lt,Ft,Ht,zt,Ut,Gt,jt,ft,$e,Pt,It,ve,F],styles:[`@import"https://fonts.googleapis.com/icon?family=Material+Icons";.vertical-radio{display:flex;flex-direction:column;margin:15px 0}.mt-1rem{margin-top:1rem}.dateRange{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-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}.form-label-group.radio.download-type{height:45.5938px!important;border-radius:.375rem!important}
|
|
9
|
+
`],encapsulation:2});let a=l;return a})();var ca=[{path:"",component:Qt,children:[{path:"",redirectTo:"new",pathMatch:"full"},{path:"new",component:ni,canActivate:[ge],data:{title:"New Order"}},{path:"detail",component:ai,canActivate:[ge],data:{title:"Orders detail"}},{path:"ready_to_ship",component:oi,canActivate:[ge],data:{title:"Ready To Ship"}},{path:"Shipped",component:li,canActivate:[ge],data:{title:"Shipped"}},{path:"Delivered",component:pi,canActivate:[ge],data:{title:"Delivered"}},{path:"All",component:mi,canActivate:[ge],data:{title:"All Order"}},{path:"Cancelled",component:si,canActivate:[ge],data:{title:"Cancelled"}},{path:"Download",component:di,canActivate:[ge],data:{title:"Download"}}]}],ci=(()=>{let l=class l{};l.\u0275fac=function(t){return new(t||l)},l.\u0275mod=Re({type:l}),l.\u0275inj=Ae({imports:[Se,je.forChild(ca)]});let a=l;return a})();var No=(()=>{let l=class l{};l.\u0275fac=function(t){return new(t||l)},l.\u0275mod=Re({type:l}),l.\u0275inj=Ae({providers:[Ee,Ye,Je],imports:[Se,Ue,ci,Et,bt,Wt,je,_t,At,ut,Q,Yt,St,Tt,Kt,xt,Mt,vt,ee,Ke,$e,Nt]});let a=l;return a})();export{No as OrdersModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as v,b}from"./chunk-
|
|
1
|
+
import{a as v,b}from"./chunk-7YWHTN3X.js";import{a as r}from"./chunk-XG2DR4LW.js";import"./chunk-LAQL3BQZ.js";import"./chunk-JHYIHRQH.js";import"./chunk-KCDL7SWP.js";import"./chunk-2SC3HO66.js";import"./chunk-DQIP7MCZ.js";import"./chunk-FTHTFVHH.js";import{$c as i,Fc as o,Ja as s,Rb as f,Xc as h,aa as l,ab as u,ga as m,ha as c,mb as d,nb as C,ob as a}from"./chunk-ZIZWZZ4E.js";import"./chunk-GNOSNGXM.js";var T=(()=>{let e=class e{constructor(){this.priceTabs=[{Title:"Single Channel Comparison",Url:"/menu/price/SingleChannel"},{Title:"Multi Channel Comparison",Url:"/menu/price/pos"},{Title:"Custom Channel Price",Url:"/menu/price/OutletPrice"}]}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=m({type:e,selectors:[["app-price"]],standalone:!0,features:[f],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,g){n&1&&(d(0,"nav",0)(1,"div",1)(2,"div"),a(3,"nav-tab",2),C()()(),a(4,"router-outlet")),n&2&&(s(3),u("Tabs",g.priceTabs))},dependencies:[o,b,v,i,h],encapsulation:2});let t=e;return t})();var P=[{path:"",component:T,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-HOTEJTGP.js").then(t=>t.PricePosChannelComponent)},canActivate:[r],data:{title:"Global Price Comparison"}},{path:"OutletPrice",loadComponent(){return import("./chunk-JUWM7ABO.js").then(t=>t.CustomChannelPriceComponent)},canActivate:[r],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",loadComponent(){return import("./chunk-XWXDJLRN.js").then(t=>t.PriceSingleChannelComponent)},canActivate:[r],data:{title:"Price Single Channel Comparison"}}]}],D=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=c({type:e}),e.\u0275inj=l({imports:[o,i.forChild(P)]});let t=e;return t})();export{D as PriceRoutingModule};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as T}from"./chunk-XUSY2QT2.js";import{a as y,b}from"./chunk-7YWHTN3X.js";import{a}from"./chunk-XG2DR4LW.js";import"./chunk-LAQL3BQZ.js";import"./chunk-JHYIHRQH.js";import"./chunk-KCDL7SWP.js";import"./chunk-2SC3HO66.js";import"./chunk-DQIP7MCZ.js";import"./chunk-FTHTFVHH.js";import{$c as r,Fc as o,Ja as c,Qb as h,Rb as v,Xc as C,aa as p,ab as u,ga as l,ha as s,mb as d,nb as f,ob as i}from"./chunk-ZIZWZZ4E.js";import"./chunk-GNOSNGXM.js";var M=(()=>{let e=class e{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"},{Title:"Different Inventory",Url:"/menu/inventory/channel_summary"}]}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=l({type:e,selectors:[["app-inventory"]],standalone:!0,features:[h([T]),v],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,S){n&1&&(d(0,"nav",0)(1,"div",1)(2,"div"),i(3,"nav-tab",2),f()()(),i(4,"router-outlet")),n&2&&(c(3),u("Tabs",S.inventoryTabs))},dependencies:[o,b,y,r,C],encapsulation:2});let t=e;return t})();var A=[{path:"",component:M,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-XUOIJTB4.js").then(t=>t.MultiChannelComparison)},canActivate:[a],data:{title:"Inventory Comparison"}},{path:"bychannel",loadComponent(){return import("./chunk-DA5WII5E.js").then(t=>t.SingleChannelComparisonComponent)},canActivate:[a],data:{title:"Inventory Comparison"}},{path:"channel_summary",loadComponent(){return import("./chunk-MADSP2BP.js").then(t=>t.ChannelSummaryComponent)},canActivate:[a],data:{title:"Different Inventory"}}]}],P=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=s({type:e}),e.\u0275inj=p({imports:[o,r.forChild(A)]});let t=e;return t})();export{P as InventoryRoutingModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as w,$a as l,E as ht,Fa as vt,Ga as Q,Ia as a,Ib as g,Ic as _t,Ja as b,Jc as Ct,Kb as y,Kc as bt,Ma as gt,Pa as U,Qb as K,Sc as yt,Ua as A,Za as H,_a as E,aa as dt,ab as M,ad as It,b as ct,ba as pt,bd as tt,c as C,ca as m,da as x,db as f,ed as B,fd as F,ga as L,gc as S,ha as mt,hd as et,j as ut,ka as ft,lb as d,mb as v,nb as R,oa as G,ob as Y,p as Z,pa as $,pb as q,rb as J,rc as W,tb as Tt,ua as N,ub as j,wb as c,wc as X}from"./chunk-HSFUKC7R.js";import{a as u,b as I}from"./chunk-GNOSNGXM.js";var wt=["toast-component",""];function At(s,n){if(s&1){let e=J();d(0,"button",5),j("click",function(){G(e);let i=c();return $(i.remove())}),d(1,"span",6),g(2,"\xD7"),v()()}}function Ht(s,n){if(s&1&&(Y(0),g(1),q()),s&2){let e=c(2);a(),y("[",e.duplicatesCount+1,"]")}}function Et(s,n){if(s&1&&(d(0,"div"),g(1),H(2,Ht,2,1,"ng-container",4),v()),s&2){let e=c();f(e.options.titleClass),E("aria-label",e.title),a(),y(" ",e.title," "),a(),l("ngIf",e.duplicatesCount)}}function Mt(s,n){if(s&1&&R(0,"div",7),s&2){let e=c();f(e.options.messageClass),l("innerHTML",e.message,Q)}}function Rt(s,n){if(s&1&&(d(0,"div",8),g(1),v()),s&2){let e=c();f(e.options.messageClass),E("aria-label",e.message),a(),y(" ",e.message," ")}}function jt(s,n){if(s&1&&(d(0,"div"),R(1,"div",9),v()),s&2){let e=c();a(),M("width",e.width()+"%")}}function Nt(s,n){if(s&1){let e=J();d(0,"button",5),j("click",function(){G(e);let i=c();return $(i.remove())}),d(1,"span",6),g(2,"\xD7"),v()()}}function St(s,n){if(s&1&&(Y(0),g(1),q()),s&2){let e=c(2);a(),y("[",e.duplicatesCount+1,"]")}}function Bt(s,n){if(s&1&&(d(0,"div"),g(1),H(2,St,2,1,"ng-container",4),v()),s&2){let e=c();f(e.options.titleClass),E("aria-label",e.title),a(),y(" ",e.title," "),a(),l("ngIf",e.duplicatesCount)}}function Ft(s,n){if(s&1&&R(0,"div",7),s&2){let e=c();f(e.options.messageClass),l("innerHTML",e.message,Q)}}function Pt(s,n){if(s&1&&(d(0,"div",8),g(1),v()),s&2){let e=c();f(e.options.messageClass),E("aria-label",e.message),a(),y(" ",e.message," ")}}function kt(s,n){if(s&1&&(d(0,"div"),R(1,"div",9),v()),s&2){let e=c();a(),M("width",e.width()+"%")}}var it=class{_attachedHost;component;viewContainerRef;injector;constructor(n,e){this.component=n,this.injector=e}attach(n,e){return this._attachedHost=n,n.attach(this,e)}detach(){let n=this._attachedHost;if(n)return this._attachedHost=void 0,n.detach()}get isAttached(){return this._attachedHost!=null}setAttachedHost(n){this._attachedHost=n}},st=class{_attachedPortal;_disposeFn;attach(n,e){return this._attachedPortal=n,this.attachComponentPortal(n,e)}detach(){this._attachedPortal&&this._attachedPortal.setAttachedHost(),this._attachedPortal=void 0,this._disposeFn&&(this._disposeFn(),this._disposeFn=void 0)}setDisposeFn(n){this._disposeFn=n}},nt=class{_overlayRef;componentInstance;duplicatesCount=0;_afterClosed=new C;_activate=new C;_manualClose=new C;_resetTimeout=new C;_countDuplicate=new C;constructor(n){this._overlayRef=n}manualClose(){this._manualClose.next(),this._manualClose.complete()}manualClosed(){return this._manualClose.asObservable()}timeoutReset(){return this._resetTimeout.asObservable()}countDuplicate(){return this._countDuplicate.asObservable()}close(){this._overlayRef.detach(),this._afterClosed.next(),this._manualClose.next(),this._afterClosed.complete(),this._manualClose.complete(),this._activate.complete(),this._resetTimeout.complete(),this._countDuplicate.complete()}afterClosed(){return this._afterClosed.asObservable()}isInactive(){return this._activate.isStopped}activate(){this._activate.next(),this._activate.complete()}afterActivate(){return this._activate.asObservable()}onDuplicate(n,e){n&&this._resetTimeout.next(),e&&this._countDuplicate.next(++this.duplicatesCount)}},D=class{toastId;config;message;title;toastType;toastRef;_onTap=new C;_onAction=new C;constructor(n,e,t,i,o,r){this.toastId=n,this.config=e,this.message=t,this.title=i,this.toastType=o,this.toastRef=r,this.toastRef.afterClosed().subscribe(()=>{this._onAction.complete(),this._onTap.complete()})}triggerTap(){this._onTap.next(),this.config.tapToDismiss&&this._onTap.complete()}onTap(){return this._onTap.asObservable()}triggerAction(n){this._onAction.next(n)}onAction(){return this._onAction.asObservable()}},xt={maxOpened:0,autoDismiss:!1,newestOnTop:!0,preventDuplicates:!1,countDuplicates:!1,resetTimeoutOnDuplicate:!1,includeTitleDuplicates:!1,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},closeButton:!1,disableTimeOut:!1,timeOut:5e3,extendedTimeOut:1e3,enableHtml:!1,progressBar:!1,toastClass:"ngx-toastr",positionClass:"toast-top-right",titleClass:"toast-title",messageClass:"toast-message",easing:"ease-in",easeTime:300,tapToDismiss:!0,onActivateTick:!1,progressAnimation:"decreasing"},Dt=new pt("ToastConfig"),ot=class extends st{_hostDomElement;_componentFactoryResolver;_appRef;constructor(n,e,t){super(),this._hostDomElement=n,this._componentFactoryResolver=e,this._appRef=t}attachComponentPortal(n,e){let t=this._componentFactoryResolver.resolveComponentFactory(n.component),i;return i=t.create(n.injector),this._appRef.attachView(i.hostView),this.setDisposeFn(()=>{this._appRef.detachView(i.hostView),i.destroy()}),e?this._hostDomElement.insertBefore(this._getComponentRootNode(i),this._hostDomElement.firstChild):this._hostDomElement.appendChild(this._getComponentRootNode(i)),i}_getComponentRootNode(n){return n.hostView.rootNodes[0]}},Vt=(()=>{class s{_document=x(W);_containerElement;ngOnDestroy(){this._containerElement&&this._containerElement.parentNode&&this._containerElement.parentNode.removeChild(this._containerElement)}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let e=this._document.createElement("div");e.classList.add("overlay-container"),e.setAttribute("aria-live","polite"),this._document.body.appendChild(e),this._containerElement=e}static \u0275fac=function(t){return new(t||s)};static \u0275prov=w({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})(),at=class{_portalHost;constructor(n){this._portalHost=n}attach(n,e=!0){return this._portalHost.attach(n,e)}detach(){return this._portalHost.detach()}},zt=(()=>{class s{_overlayContainer=x(Vt);_componentFactoryResolver=x(gt);_appRef=x(S);_document=x(W);_paneElements=new Map;create(e,t){return this._createOverlayRef(this.getPaneElement(e,t))}getPaneElement(e="",t){return this._paneElements.get(t)||this._paneElements.set(t,{}),this._paneElements.get(t)[e]||(this._paneElements.get(t)[e]=this._createPaneElement(e,t)),this._paneElements.get(t)[e]}_createPaneElement(e,t){let i=this._document.createElement("div");return i.id="toast-container",i.classList.add(e),i.classList.add("toast-container"),t?t.getContainerElement().appendChild(i):this._overlayContainer.getContainerElement().appendChild(i),i}_createPortalHost(e){return new ot(e,this._componentFactoryResolver,this._appRef)}_createOverlayRef(e){return new at(this._createPortalHost(e))}static \u0275fac=function(t){return new(t||s)};static \u0275prov=w({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})(),P=(()=>{class s{overlay;_injector;sanitizer;ngZone;toastrConfig;currentlyActive=0;toasts=[];overlayContainer;previousToastMessage;index=0;constructor(e,t,i,o,r){this.overlay=t,this._injector=i,this.sanitizer=o,this.ngZone=r,this.toastrConfig=u(u({},e.default),e.config),e.config.iconClasses&&(this.toastrConfig.iconClasses=u(u({},e.default.iconClasses),e.config.iconClasses))}show(e,t,i={},o=""){return this._preBuildNotification(o,e,t,this.applyConfig(i))}success(e,t,i={}){let o=this.toastrConfig.iconClasses.success||"";return this._preBuildNotification(o,e,t,this.applyConfig(i))}error(e,t,i={}){let o=this.toastrConfig.iconClasses.error||"";return this._preBuildNotification(o,e,t,this.applyConfig(i))}info(e,t,i={}){let o=this.toastrConfig.iconClasses.info||"";return this._preBuildNotification(o,e,t,this.applyConfig(i))}warning(e,t,i={}){let o=this.toastrConfig.iconClasses.warning||"";return this._preBuildNotification(o,e,t,this.applyConfig(i))}clear(e){for(let t of this.toasts)if(e!==void 0){if(t.toastId===e){t.toastRef.manualClose();return}}else t.toastRef.manualClose()}remove(e){let t=this._findToast(e);if(!t||(t.activeToast.toastRef.close(),this.toasts.splice(t.index,1),this.currentlyActive=this.currentlyActive-1,!this.toastrConfig.maxOpened||!this.toasts.length))return!1;if(this.currentlyActive<this.toastrConfig.maxOpened&&this.toasts[this.currentlyActive]){let i=this.toasts[this.currentlyActive].toastRef;i.isInactive()||(this.currentlyActive=this.currentlyActive+1,i.activate())}return!0}findDuplicate(e="",t="",i,o){let{includeTitleDuplicates:r}=this.toastrConfig;for(let p of this.toasts){let T=r&&p.title===e;if((!r||T)&&p.message===t)return p.toastRef.onDuplicate(i,o),p}return null}applyConfig(e={}){return u(u({},this.toastrConfig),e)}_findToast(e){for(let t=0;t<this.toasts.length;t++)if(this.toasts[t].toastId===e)return{index:t,activeToast:this.toasts[t]};return null}_preBuildNotification(e,t,i,o){return o.onActivateTick?this.ngZone.run(()=>this._buildNotification(e,t,i,o)):this._buildNotification(e,t,i,o)}_buildNotification(e,t,i,o){if(!o.toastComponent)throw new Error("toastComponent required");let r=this.findDuplicate(i,t,this.toastrConfig.resetTimeoutOnDuplicate&&o.timeOut>0,this.toastrConfig.countDuplicates);if((this.toastrConfig.includeTitleDuplicates&&i||t)&&this.toastrConfig.preventDuplicates&&r!==null)return r;this.previousToastMessage=t;let p=!1;this.toastrConfig.maxOpened&&this.currentlyActive>=this.toastrConfig.maxOpened&&(p=!0,this.toastrConfig.autoDismiss&&this.clear(this.toasts[0].toastId));let T=this.overlay.create(o.positionClass,this.overlayContainer);this.index=this.index+1;let h=t;t&&o.enableHtml&&(h=this.sanitizer.sanitize(vt.HTML,t));let _=new nt(T),O=new D(this.index,o,h,i,e,_),k=[{provide:D,useValue:O}],rt=N.create({providers:k,parent:this._injector}),V=new it(o.toastComponent,rt),lt=T.attach(V,o.newestOnTop);_.componentInstance=lt.instance;let z={toastId:this.index,title:i||"",message:t||"",toastRef:_,onShown:_.afterActivate(),onHidden:_.afterClosed(),onTap:O.onTap(),onAction:O.onAction(),portal:lt};return p||(this.currentlyActive=this.currentlyActive+1,setTimeout(()=>{z.toastRef.activate()})),this.toasts.push(z),z}static \u0275fac=function(t){return new(t||s)(m(Dt),m(zt),m(N),m(yt),m(U))};static \u0275prov=w({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})(),Zt=(()=>{class s{toastrService;toastPackage;ngZone;message;title;options;duplicatesCount;originalTimeout;width=A(-1);toastClasses="";state;get _state(){return this.state()}get displayStyle(){if(this.state().value==="inactive")return"none"}timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(e,t,i){this.toastrService=e,this.toastPackage=t,this.ngZone=i,this.message=t.message,this.title=t.title,this.options=t.config,this.originalTimeout=t.config.timeOut,this.toastClasses=`${t.toastType} ${t.config.toastClass}`,this.sub=t.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=t.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=t.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=t.toastRef.countDuplicate().subscribe(o=>{this.duplicatesCount=o}),this.state=A({value:"inactive",params:{easeTime:this.toastPackage.config.easeTime,easing:"ease-in"}})}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state.update(e=>I(u({},e),{value:"active"})),!(this.options.disableTimeOut===!0||this.options.disableTimeOut==="timeOut")&&this.options.timeOut&&(this.outsideTimeout(()=>this.remove(),this.options.timeOut),this.hideTime=new Date().getTime()+this.options.timeOut,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}updateProgress(){if(this.width()===0||this.width()===100||!this.options.timeOut)return;let e=new Date().getTime(),t=this.hideTime-e;this.width.set(t/this.options.timeOut*100),this.options.progressAnimation==="increasing"&&this.width.update(i=>100-i),this.width()<=0&&this.width.set(0),this.width()>=100&&this.width.set(100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state.update(e=>I(u({},e),{value:"active"})),this.outsideTimeout(()=>this.remove(),this.originalTimeout),this.options.timeOut=this.originalTimeout,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10)}remove(){this.state().value!=="removed"&&(clearTimeout(this.timeout),this.state.update(e=>I(u({},e),{value:"removed"})),this.outsideTimeout(()=>this.toastrService.remove(this.toastPackage.toastId),+this.toastPackage.config.easeTime))}tapToast(){this.state().value!=="removed"&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){this.state().value!=="removed"&&this.options.disableTimeOut!=="extendedTimeOut"&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width.set(0))}delayedHideToast(){this.options.disableTimeOut===!0||this.options.disableTimeOut==="extendedTimeOut"||this.options.extendedTimeOut===0||this.state().value==="removed"||(this.outsideTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}outsideTimeout(e,t){this.ngZone?this.ngZone.runOutsideAngular(()=>this.timeout=setTimeout(()=>this.runInsideAngular(e),t)):this.timeout=setTimeout(()=>e(),t)}outsideInterval(e,t){this.ngZone?this.ngZone.runOutsideAngular(()=>this.intervalId=setInterval(()=>this.runInsideAngular(e),t)):this.intervalId=setInterval(()=>e(),t)}runInsideAngular(e){this.ngZone?this.ngZone.run(()=>e()):e()}static \u0275fac=function(t){return new(t||s)(b(P),b(D),b(U))};static \u0275cmp=L({type:s,selectors:[["","toast-component",""]],hostVars:5,hostBindings:function(t,i){t&1&&j("click",function(){return i.tapToast()})("mouseenter",function(){return i.stickAround()})("mouseleave",function(){return i.delayedHideToast()}),t&2&&(Tt("@flyInOut",i._state),f(i.toastClasses),M("display",i.displayStyle))},standalone:!0,features:[K],attrs:wt,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(t,i){t&1&&H(0,At,3,0,"button",0)(1,Et,3,5,"div",1)(2,Mt,1,3,"div",2)(3,Rt,2,4,"div",3)(4,jt,2,2,"div",4),t&2&&(l("ngIf",i.options.closeButton),a(),l("ngIf",i.title),a(),l("ngIf",i.message&&i.options.enableHtml),a(),l("ngIf",i.message&&!i.options.enableHtml),a(),l("ngIf",i.options.progressBar))},dependencies:[X],encapsulation:2,data:{animation:[It("flyInOut",[F("inactive",B({opacity:0})),F("active",B({opacity:1})),F("removed",B({opacity:0})),et("inactive => active",tt("{{ easeTime }}ms {{ easing }}")),et("active => removed",tt("{{ easeTime }}ms {{ easing }}"))])]},changeDetection:0})}return s})(),Lt=I(u({},xt),{toastComponent:Zt}),Gt=(s={})=>ft([{provide:Dt,useValue:{default:Lt,config:s}}]),le=(()=>{class s{static forRoot(e={}){return{ngModule:s,providers:[Gt(e)]}}static \u0275fac=function(t){return new(t||s)};static \u0275mod=mt({type:s});static \u0275inj=dt({})}return s})();var $t=(()=>{class s{toastrService;toastPackage;appRef;message;title;options;duplicatesCount;originalTimeout;width=A(-1);toastClasses="";get displayStyle(){return this.state()==="inactive"?"none":null}state=A("inactive");timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(e,t,i){this.toastrService=e,this.toastPackage=t,this.appRef=i,this.message=t.message,this.title=t.title,this.options=t.config,this.originalTimeout=t.config.timeOut,this.toastClasses=`${t.toastType} ${t.config.toastClass}`,this.sub=t.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=t.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=t.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=t.toastRef.countDuplicate().subscribe(o=>{this.duplicatesCount=o})}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state.set("active"),!(this.options.disableTimeOut===!0||this.options.disableTimeOut==="timeOut")&&this.options.timeOut&&(this.timeout=setTimeout(()=>{this.remove()},this.options.timeOut),this.hideTime=new Date().getTime()+this.options.timeOut,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))),this.options.onActivateTick&&this.appRef.tick()}updateProgress(){if(this.width()===0||this.width()===100||!this.options.timeOut)return;let e=new Date().getTime(),t=this.hideTime-e;this.width.set(t/this.options.timeOut*100),this.options.progressAnimation==="increasing"&&this.width.update(i=>100-i),this.width()<=0&&this.width.set(0),this.width()>=100&&this.width.set(100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state.set("active"),this.options.timeOut=this.originalTimeout,this.timeout=setTimeout(()=>this.remove(),this.originalTimeout),this.hideTime=new Date().getTime()+(this.originalTimeout||0),this.width.set(-1),this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))}remove(){this.state()!=="removed"&&(clearTimeout(this.timeout),this.state.set("removed"),this.timeout=setTimeout(()=>this.toastrService.remove(this.toastPackage.toastId)))}tapToast(){this.state()!=="removed"&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){this.state()!=="removed"&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width.set(0))}delayedHideToast(){this.options.disableTimeOut===!0||this.options.disableTimeOut==="extendedTimeOut"||this.options.extendedTimeOut===0||this.state()==="removed"||(this.timeout=setTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10)))}static \u0275fac=function(t){return new(t||s)(b(P),b(D),b(S))};static \u0275cmp=L({type:s,selectors:[["","toast-component",""]],hostVars:4,hostBindings:function(t,i){t&1&&j("click",function(){return i.tapToast()})("mouseenter",function(){return i.stickAround()})("mouseleave",function(){return i.delayedHideToast()}),t&2&&(f(i.toastClasses),M("display",i.displayStyle))},standalone:!0,features:[K],attrs:wt,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(t,i){t&1&&H(0,Nt,3,0,"button",0)(1,Bt,3,5,"div",1)(2,Ft,1,3,"div",2)(3,Pt,2,4,"div",3)(4,kt,2,2,"div",4),t&2&&(l("ngIf",i.options.closeButton),a(),l("ngIf",i.title),a(),l("ngIf",i.message&&i.options.enableHtml),a(),l("ngIf",i.message&&!i.options.enableHtml),a(),l("ngIf",i.options.progressBar))},dependencies:[X],encapsulation:2,changeDetection:0})}return s})(),ce=I(u({},xt),{toastComponent:$t});var fe=(()=>{let n=class n{constructor(t,i){this.http=t,this.toastr=i}get(t,i){let o=this.generateQueryParams(i);return this.http.get(t,{params:o}).pipe(ht(r=>ut))}generateQueryParams(t=[]){let i=new Ct;return t.forEach(o=>{i=i.append(o.key,o.value)}),i}post(t,i,o={},r=1e5){return this.http.post(t,i,o).pipe(Z(r))}postFile(t,i,o=1e5){return new ct(r=>{let p=localStorage.getItem("Token"),T=new _t({"Content-Type":"application/json","Cache-Control":"no-cache"});p&&(T=T.append("Authorization","Bearer "+p)),this.http.post(t,i,{headers:T,observe:"response",responseType:"blob"}).pipe(Z(o)).subscribe({next:h=>{r.next({title:h.headers.get("Content-Disposition"),file:h.body}),r.complete()},error:h=>{if(h.headers.get("Content-Type")==="application/json; charset=utf-8"){let _=new FileReader;_.addEventListener("loadend",O=>{let k=JSON.parse(O.srcElement.result)?.Message;if(!this.unauthorizedErrorHandling(h)){let V=this.errorMessageHandling(h);this.toastr.error(k??"An unknown error has occured!",V.header,{enableHtml:!0})}}),_.readAsText(h.error)}r.error(h)}})})}unauthorizedErrorHandling(t){let i=!1;return(t.status==401||t.status==403)&&(localStorage.getItem("Token")?this.toastr.error("Your session has expired. Please login again.","Unauthorized",{enableHtml:!0}):window.location.href="/",i=!0),i}errorMessageHandling(t){let i="API Error",o="Exception Message";return t.error?(i="API Error - "+t.status,t.status==451&&(i="Error"),t.error&&(o=t.error.Message)):t.Message&&(i="API Error - "+t.name,o=t.Message),{header:i,Message:o}}delete(t,i){return this.http.delete(t,i)}};n.\u0275fac=function(i){return new(i||n)(m(bt),m(P))},n.\u0275prov=w({token:n,factory:n.\u0275fac,providedIn:"root"});let s=n;return s})();export{D as a,P as b,Zt as c,le as d,fe as e};
|
|
1
|
+
import{$ as w,$a as E,E as ht,Fa as vt,Ga as Q,Ja as a,Jb as g,Ka as b,Kc as _t,Lb as y,Lc as Ct,Mc as bt,Na as gt,Qa as U,Rb as K,Uc as yt,Va as A,_a as H,aa as dt,ab as l,b as ct,ba as pt,bb as M,c as C,ca as m,cd as It,da as x,dd as tt,eb as f,ga as L,gd as B,ha as mt,hd as F,ic as S,j as ut,jd as et,ka as ft,mb as d,nb as v,oa as G,ob as R,p as Z,pa as $,pb as Y,qb as q,sb as J,tc as W,ua as N,ub as Tt,vb as j,xb as c,yc as X}from"./chunk-ZIZWZZ4E.js";import{a as u,b as I}from"./chunk-GNOSNGXM.js";var wt=["toast-component",""];function At(s,n){if(s&1){let e=J();d(0,"button",5),j("click",function(){G(e);let i=c();return $(i.remove())}),d(1,"span",6),g(2,"\xD7"),v()()}}function Ht(s,n){if(s&1&&(Y(0),g(1),q()),s&2){let e=c(2);a(),y("[",e.duplicatesCount+1,"]")}}function Et(s,n){if(s&1&&(d(0,"div"),g(1),H(2,Ht,2,1,"ng-container",4),v()),s&2){let e=c();f(e.options.titleClass),E("aria-label",e.title),a(),y(" ",e.title," "),a(),l("ngIf",e.duplicatesCount)}}function Mt(s,n){if(s&1&&R(0,"div",7),s&2){let e=c();f(e.options.messageClass),l("innerHTML",e.message,Q)}}function Rt(s,n){if(s&1&&(d(0,"div",8),g(1),v()),s&2){let e=c();f(e.options.messageClass),E("aria-label",e.message),a(),y(" ",e.message," ")}}function jt(s,n){if(s&1&&(d(0,"div"),R(1,"div",9),v()),s&2){let e=c();a(),M("width",e.width()+"%")}}function Nt(s,n){if(s&1){let e=J();d(0,"button",5),j("click",function(){G(e);let i=c();return $(i.remove())}),d(1,"span",6),g(2,"\xD7"),v()()}}function St(s,n){if(s&1&&(Y(0),g(1),q()),s&2){let e=c(2);a(),y("[",e.duplicatesCount+1,"]")}}function Bt(s,n){if(s&1&&(d(0,"div"),g(1),H(2,St,2,1,"ng-container",4),v()),s&2){let e=c();f(e.options.titleClass),E("aria-label",e.title),a(),y(" ",e.title," "),a(),l("ngIf",e.duplicatesCount)}}function Ft(s,n){if(s&1&&R(0,"div",7),s&2){let e=c();f(e.options.messageClass),l("innerHTML",e.message,Q)}}function Pt(s,n){if(s&1&&(d(0,"div",8),g(1),v()),s&2){let e=c();f(e.options.messageClass),E("aria-label",e.message),a(),y(" ",e.message," ")}}function kt(s,n){if(s&1&&(d(0,"div"),R(1,"div",9),v()),s&2){let e=c();a(),M("width",e.width()+"%")}}var it=class{_attachedHost;component;viewContainerRef;injector;constructor(n,e){this.component=n,this.injector=e}attach(n,e){return this._attachedHost=n,n.attach(this,e)}detach(){let n=this._attachedHost;if(n)return this._attachedHost=void 0,n.detach()}get isAttached(){return this._attachedHost!=null}setAttachedHost(n){this._attachedHost=n}},st=class{_attachedPortal;_disposeFn;attach(n,e){return this._attachedPortal=n,this.attachComponentPortal(n,e)}detach(){this._attachedPortal&&this._attachedPortal.setAttachedHost(),this._attachedPortal=void 0,this._disposeFn&&(this._disposeFn(),this._disposeFn=void 0)}setDisposeFn(n){this._disposeFn=n}},nt=class{_overlayRef;componentInstance;duplicatesCount=0;_afterClosed=new C;_activate=new C;_manualClose=new C;_resetTimeout=new C;_countDuplicate=new C;constructor(n){this._overlayRef=n}manualClose(){this._manualClose.next(),this._manualClose.complete()}manualClosed(){return this._manualClose.asObservable()}timeoutReset(){return this._resetTimeout.asObservable()}countDuplicate(){return this._countDuplicate.asObservable()}close(){this._overlayRef.detach(),this._afterClosed.next(),this._manualClose.next(),this._afterClosed.complete(),this._manualClose.complete(),this._activate.complete(),this._resetTimeout.complete(),this._countDuplicate.complete()}afterClosed(){return this._afterClosed.asObservable()}isInactive(){return this._activate.isStopped}activate(){this._activate.next(),this._activate.complete()}afterActivate(){return this._activate.asObservable()}onDuplicate(n,e){n&&this._resetTimeout.next(),e&&this._countDuplicate.next(++this.duplicatesCount)}},D=class{toastId;config;message;title;toastType;toastRef;_onTap=new C;_onAction=new C;constructor(n,e,t,i,o,r){this.toastId=n,this.config=e,this.message=t,this.title=i,this.toastType=o,this.toastRef=r,this.toastRef.afterClosed().subscribe(()=>{this._onAction.complete(),this._onTap.complete()})}triggerTap(){this._onTap.next(),this.config.tapToDismiss&&this._onTap.complete()}onTap(){return this._onTap.asObservable()}triggerAction(n){this._onAction.next(n)}onAction(){return this._onAction.asObservable()}},xt={maxOpened:0,autoDismiss:!1,newestOnTop:!0,preventDuplicates:!1,countDuplicates:!1,resetTimeoutOnDuplicate:!1,includeTitleDuplicates:!1,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},closeButton:!1,disableTimeOut:!1,timeOut:5e3,extendedTimeOut:1e3,enableHtml:!1,progressBar:!1,toastClass:"ngx-toastr",positionClass:"toast-top-right",titleClass:"toast-title",messageClass:"toast-message",easing:"ease-in",easeTime:300,tapToDismiss:!0,onActivateTick:!1,progressAnimation:"decreasing"},Dt=new pt("ToastConfig"),ot=class extends st{_hostDomElement;_componentFactoryResolver;_appRef;constructor(n,e,t){super(),this._hostDomElement=n,this._componentFactoryResolver=e,this._appRef=t}attachComponentPortal(n,e){let t=this._componentFactoryResolver.resolveComponentFactory(n.component),i;return i=t.create(n.injector),this._appRef.attachView(i.hostView),this.setDisposeFn(()=>{this._appRef.detachView(i.hostView),i.destroy()}),e?this._hostDomElement.insertBefore(this._getComponentRootNode(i),this._hostDomElement.firstChild):this._hostDomElement.appendChild(this._getComponentRootNode(i)),i}_getComponentRootNode(n){return n.hostView.rootNodes[0]}},Vt=(()=>{class s{_document=x(W);_containerElement;ngOnDestroy(){this._containerElement&&this._containerElement.parentNode&&this._containerElement.parentNode.removeChild(this._containerElement)}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let e=this._document.createElement("div");e.classList.add("overlay-container"),e.setAttribute("aria-live","polite"),this._document.body.appendChild(e),this._containerElement=e}static \u0275fac=function(t){return new(t||s)};static \u0275prov=w({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})(),at=class{_portalHost;constructor(n){this._portalHost=n}attach(n,e=!0){return this._portalHost.attach(n,e)}detach(){return this._portalHost.detach()}},zt=(()=>{class s{_overlayContainer=x(Vt);_componentFactoryResolver=x(gt);_appRef=x(S);_document=x(W);_paneElements=new Map;create(e,t){return this._createOverlayRef(this.getPaneElement(e,t))}getPaneElement(e="",t){return this._paneElements.get(t)||this._paneElements.set(t,{}),this._paneElements.get(t)[e]||(this._paneElements.get(t)[e]=this._createPaneElement(e,t)),this._paneElements.get(t)[e]}_createPaneElement(e,t){let i=this._document.createElement("div");return i.id="toast-container",i.classList.add(e),i.classList.add("toast-container"),t?t.getContainerElement().appendChild(i):this._overlayContainer.getContainerElement().appendChild(i),i}_createPortalHost(e){return new ot(e,this._componentFactoryResolver,this._appRef)}_createOverlayRef(e){return new at(this._createPortalHost(e))}static \u0275fac=function(t){return new(t||s)};static \u0275prov=w({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})(),P=(()=>{class s{overlay;_injector;sanitizer;ngZone;toastrConfig;currentlyActive=0;toasts=[];overlayContainer;previousToastMessage;index=0;constructor(e,t,i,o,r){this.overlay=t,this._injector=i,this.sanitizer=o,this.ngZone=r,this.toastrConfig=u(u({},e.default),e.config),e.config.iconClasses&&(this.toastrConfig.iconClasses=u(u({},e.default.iconClasses),e.config.iconClasses))}show(e,t,i={},o=""){return this._preBuildNotification(o,e,t,this.applyConfig(i))}success(e,t,i={}){let o=this.toastrConfig.iconClasses.success||"";return this._preBuildNotification(o,e,t,this.applyConfig(i))}error(e,t,i={}){let o=this.toastrConfig.iconClasses.error||"";return this._preBuildNotification(o,e,t,this.applyConfig(i))}info(e,t,i={}){let o=this.toastrConfig.iconClasses.info||"";return this._preBuildNotification(o,e,t,this.applyConfig(i))}warning(e,t,i={}){let o=this.toastrConfig.iconClasses.warning||"";return this._preBuildNotification(o,e,t,this.applyConfig(i))}clear(e){for(let t of this.toasts)if(e!==void 0){if(t.toastId===e){t.toastRef.manualClose();return}}else t.toastRef.manualClose()}remove(e){let t=this._findToast(e);if(!t||(t.activeToast.toastRef.close(),this.toasts.splice(t.index,1),this.currentlyActive=this.currentlyActive-1,!this.toastrConfig.maxOpened||!this.toasts.length))return!1;if(this.currentlyActive<this.toastrConfig.maxOpened&&this.toasts[this.currentlyActive]){let i=this.toasts[this.currentlyActive].toastRef;i.isInactive()||(this.currentlyActive=this.currentlyActive+1,i.activate())}return!0}findDuplicate(e="",t="",i,o){let{includeTitleDuplicates:r}=this.toastrConfig;for(let p of this.toasts){let T=r&&p.title===e;if((!r||T)&&p.message===t)return p.toastRef.onDuplicate(i,o),p}return null}applyConfig(e={}){return u(u({},this.toastrConfig),e)}_findToast(e){for(let t=0;t<this.toasts.length;t++)if(this.toasts[t].toastId===e)return{index:t,activeToast:this.toasts[t]};return null}_preBuildNotification(e,t,i,o){return o.onActivateTick?this.ngZone.run(()=>this._buildNotification(e,t,i,o)):this._buildNotification(e,t,i,o)}_buildNotification(e,t,i,o){if(!o.toastComponent)throw new Error("toastComponent required");let r=this.findDuplicate(i,t,this.toastrConfig.resetTimeoutOnDuplicate&&o.timeOut>0,this.toastrConfig.countDuplicates);if((this.toastrConfig.includeTitleDuplicates&&i||t)&&this.toastrConfig.preventDuplicates&&r!==null)return r;this.previousToastMessage=t;let p=!1;this.toastrConfig.maxOpened&&this.currentlyActive>=this.toastrConfig.maxOpened&&(p=!0,this.toastrConfig.autoDismiss&&this.clear(this.toasts[0].toastId));let T=this.overlay.create(o.positionClass,this.overlayContainer);this.index=this.index+1;let h=t;t&&o.enableHtml&&(h=this.sanitizer.sanitize(vt.HTML,t));let _=new nt(T),O=new D(this.index,o,h,i,e,_),k=[{provide:D,useValue:O}],rt=N.create({providers:k,parent:this._injector}),V=new it(o.toastComponent,rt),lt=T.attach(V,o.newestOnTop);_.componentInstance=lt.instance;let z={toastId:this.index,title:i||"",message:t||"",toastRef:_,onShown:_.afterActivate(),onHidden:_.afterClosed(),onTap:O.onTap(),onAction:O.onAction(),portal:lt};return p||(this.currentlyActive=this.currentlyActive+1,setTimeout(()=>{z.toastRef.activate()})),this.toasts.push(z),z}static \u0275fac=function(t){return new(t||s)(m(Dt),m(zt),m(N),m(yt),m(U))};static \u0275prov=w({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})(),Zt=(()=>{class s{toastrService;toastPackage;ngZone;message;title;options;duplicatesCount;originalTimeout;width=A(-1);toastClasses="";state;get _state(){return this.state()}get displayStyle(){if(this.state().value==="inactive")return"none"}timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(e,t,i){this.toastrService=e,this.toastPackage=t,this.ngZone=i,this.message=t.message,this.title=t.title,this.options=t.config,this.originalTimeout=t.config.timeOut,this.toastClasses=`${t.toastType} ${t.config.toastClass}`,this.sub=t.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=t.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=t.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=t.toastRef.countDuplicate().subscribe(o=>{this.duplicatesCount=o}),this.state=A({value:"inactive",params:{easeTime:this.toastPackage.config.easeTime,easing:"ease-in"}})}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state.update(e=>I(u({},e),{value:"active"})),!(this.options.disableTimeOut===!0||this.options.disableTimeOut==="timeOut")&&this.options.timeOut&&(this.outsideTimeout(()=>this.remove(),this.options.timeOut),this.hideTime=new Date().getTime()+this.options.timeOut,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}updateProgress(){if(this.width()===0||this.width()===100||!this.options.timeOut)return;let e=new Date().getTime(),t=this.hideTime-e;this.width.set(t/this.options.timeOut*100),this.options.progressAnimation==="increasing"&&this.width.update(i=>100-i),this.width()<=0&&this.width.set(0),this.width()>=100&&this.width.set(100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state.update(e=>I(u({},e),{value:"active"})),this.outsideTimeout(()=>this.remove(),this.originalTimeout),this.options.timeOut=this.originalTimeout,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10)}remove(){this.state().value!=="removed"&&(clearTimeout(this.timeout),this.state.update(e=>I(u({},e),{value:"removed"})),this.outsideTimeout(()=>this.toastrService.remove(this.toastPackage.toastId),+this.toastPackage.config.easeTime))}tapToast(){this.state().value!=="removed"&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){this.state().value!=="removed"&&this.options.disableTimeOut!=="extendedTimeOut"&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width.set(0))}delayedHideToast(){this.options.disableTimeOut===!0||this.options.disableTimeOut==="extendedTimeOut"||this.options.extendedTimeOut===0||this.state().value==="removed"||(this.outsideTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}outsideTimeout(e,t){this.ngZone?this.ngZone.runOutsideAngular(()=>this.timeout=setTimeout(()=>this.runInsideAngular(e),t)):this.timeout=setTimeout(()=>e(),t)}outsideInterval(e,t){this.ngZone?this.ngZone.runOutsideAngular(()=>this.intervalId=setInterval(()=>this.runInsideAngular(e),t)):this.intervalId=setInterval(()=>e(),t)}runInsideAngular(e){this.ngZone?this.ngZone.run(()=>e()):e()}static \u0275fac=function(t){return new(t||s)(b(P),b(D),b(U))};static \u0275cmp=L({type:s,selectors:[["","toast-component",""]],hostVars:5,hostBindings:function(t,i){t&1&&j("click",function(){return i.tapToast()})("mouseenter",function(){return i.stickAround()})("mouseleave",function(){return i.delayedHideToast()}),t&2&&(Tt("@flyInOut",i._state),f(i.toastClasses),M("display",i.displayStyle))},standalone:!0,features:[K],attrs:wt,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(t,i){t&1&&H(0,At,3,0,"button",0)(1,Et,3,5,"div",1)(2,Mt,1,3,"div",2)(3,Rt,2,4,"div",3)(4,jt,2,2,"div",4),t&2&&(l("ngIf",i.options.closeButton),a(),l("ngIf",i.title),a(),l("ngIf",i.message&&i.options.enableHtml),a(),l("ngIf",i.message&&!i.options.enableHtml),a(),l("ngIf",i.options.progressBar))},dependencies:[X],encapsulation:2,data:{animation:[It("flyInOut",[F("inactive",B({opacity:0})),F("active",B({opacity:1})),F("removed",B({opacity:0})),et("inactive => active",tt("{{ easeTime }}ms {{ easing }}")),et("active => removed",tt("{{ easeTime }}ms {{ easing }}"))])]},changeDetection:0})}return s})(),Lt=I(u({},xt),{toastComponent:Zt}),Gt=(s={})=>ft([{provide:Dt,useValue:{default:Lt,config:s}}]),le=(()=>{class s{static forRoot(e={}){return{ngModule:s,providers:[Gt(e)]}}static \u0275fac=function(t){return new(t||s)};static \u0275mod=mt({type:s});static \u0275inj=dt({})}return s})();var $t=(()=>{class s{toastrService;toastPackage;appRef;message;title;options;duplicatesCount;originalTimeout;width=A(-1);toastClasses="";get displayStyle(){return this.state()==="inactive"?"none":null}state=A("inactive");timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(e,t,i){this.toastrService=e,this.toastPackage=t,this.appRef=i,this.message=t.message,this.title=t.title,this.options=t.config,this.originalTimeout=t.config.timeOut,this.toastClasses=`${t.toastType} ${t.config.toastClass}`,this.sub=t.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=t.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=t.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=t.toastRef.countDuplicate().subscribe(o=>{this.duplicatesCount=o})}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state.set("active"),!(this.options.disableTimeOut===!0||this.options.disableTimeOut==="timeOut")&&this.options.timeOut&&(this.timeout=setTimeout(()=>{this.remove()},this.options.timeOut),this.hideTime=new Date().getTime()+this.options.timeOut,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))),this.options.onActivateTick&&this.appRef.tick()}updateProgress(){if(this.width()===0||this.width()===100||!this.options.timeOut)return;let e=new Date().getTime(),t=this.hideTime-e;this.width.set(t/this.options.timeOut*100),this.options.progressAnimation==="increasing"&&this.width.update(i=>100-i),this.width()<=0&&this.width.set(0),this.width()>=100&&this.width.set(100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state.set("active"),this.options.timeOut=this.originalTimeout,this.timeout=setTimeout(()=>this.remove(),this.originalTimeout),this.hideTime=new Date().getTime()+(this.originalTimeout||0),this.width.set(-1),this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))}remove(){this.state()!=="removed"&&(clearTimeout(this.timeout),this.state.set("removed"),this.timeout=setTimeout(()=>this.toastrService.remove(this.toastPackage.toastId)))}tapToast(){this.state()!=="removed"&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){this.state()!=="removed"&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width.set(0))}delayedHideToast(){this.options.disableTimeOut===!0||this.options.disableTimeOut==="extendedTimeOut"||this.options.extendedTimeOut===0||this.state()==="removed"||(this.timeout=setTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10)))}static \u0275fac=function(t){return new(t||s)(b(P),b(D),b(S))};static \u0275cmp=L({type:s,selectors:[["","toast-component",""]],hostVars:4,hostBindings:function(t,i){t&1&&j("click",function(){return i.tapToast()})("mouseenter",function(){return i.stickAround()})("mouseleave",function(){return i.delayedHideToast()}),t&2&&(f(i.toastClasses),M("display",i.displayStyle))},standalone:!0,features:[K],attrs:wt,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(t,i){t&1&&H(0,Nt,3,0,"button",0)(1,Bt,3,5,"div",1)(2,Ft,1,3,"div",2)(3,Pt,2,4,"div",3)(4,kt,2,2,"div",4),t&2&&(l("ngIf",i.options.closeButton),a(),l("ngIf",i.title),a(),l("ngIf",i.message&&i.options.enableHtml),a(),l("ngIf",i.message&&!i.options.enableHtml),a(),l("ngIf",i.options.progressBar))},dependencies:[X],encapsulation:2,changeDetection:0})}return s})(),ce=I(u({},xt),{toastComponent:$t});var fe=(()=>{let n=class n{constructor(t,i){this.http=t,this.toastr=i}get(t,i){let o=this.generateQueryParams(i);return this.http.get(t,{params:o}).pipe(ht(r=>ut))}generateQueryParams(t=[]){let i=new Ct;return t.forEach(o=>{i=i.append(o.key,o.value)}),i}post(t,i,o={},r=1e5){return this.http.post(t,i,o).pipe(Z(r))}postFile(t,i,o=1e5){return new ct(r=>{let p=localStorage.getItem("Token"),T=new _t({"Content-Type":"application/json","Cache-Control":"no-cache"});p&&(T=T.append("Authorization","Bearer "+p)),this.http.post(t,i,{headers:T,observe:"response",responseType:"blob"}).pipe(Z(o)).subscribe({next:h=>{r.next({title:h.headers.get("Content-Disposition"),file:h.body}),r.complete()},error:h=>{if(h.headers.get("Content-Type")==="application/json; charset=utf-8"){let _=new FileReader;_.addEventListener("loadend",O=>{let k=JSON.parse(O.srcElement.result)?.Message;if(!this.unauthorizedErrorHandling(h)){let V=this.errorMessageHandling(h);this.toastr.error(k??"An unknown error has occured!",V.header,{enableHtml:!0})}}),_.readAsText(h.error)}r.error(h)}})})}unauthorizedErrorHandling(t){let i=!1;return(t.status==401||t.status==403)&&(localStorage.getItem("Token")?this.toastr.error("Your session has expired. Please login again.","Unauthorized",{enableHtml:!0}):window.location.href="/",i=!0),i}errorMessageHandling(t){let i="API Error",o="Exception Message";return t.error?(i="API Error - "+t.status,t.status==451&&(i="Error"),t.error&&(o=t.error.Message)):t.Message&&(i="API Error - "+t.name,o=t.Message),{header:i,Message:o}}delete(t,i){return this.http.delete(t,i)}};n.\u0275fac=function(i){return new(i||n)(m(bt),m(P))},n.\u0275prov=w({token:n,factory:n.\u0275fac,providedIn:"root"});let s=n;return s})();export{D as a,P as b,Zt as c,le as d,fe as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-AUCIW6VR.js";import{a as Oe}from"./chunk-S36U4I4O.js";import{a as K}from"./chunk-XHAXYWZ7.js";import{a as De,b as Ve,c as X}from"./chunk-3ORAGDUV.js";import{a as _e}from"./chunk-BVIRHZTZ.js";import{a as Me}from"./chunk-WH3FZ3VM.js";import{a as Ie}from"./chunk-7KG3DC5J.js";import{b as Ee}from"./chunk-FMYZSZEX.js";import{a as Te}from"./chunk-GP6U42SV.js";import"./chunk-W3POM6UQ.js";import"./chunk-4QK7Y7R2.js";import{a as we}from"./chunk-WVKDNFEM.js";import"./chunk-73DE2GZF.js";import{a as Se,b as ve,c as ye}from"./chunk-RVVTVU4B.js";import{a as Fe}from"./chunk-3ZQBMP7R.js";import"./chunk-6NTRXLMW.js";import{g as fe}from"./chunk-2C32PU5X.js";import{b as ue,e as ge}from"./chunk-NVF24LK5.js";import"./chunk-KCDL7SWP.js";import{d as xe,m as Pe,n as be}from"./chunk-3XWOT6GZ.js";import{t as j,u as W}from"./chunk-CTKEWRX4.js";import"./chunk-GXHE2CDH.js";import{b as de,h as L,m as U,y as A}from"./chunk-O5MOPAT5.js";import{c as J,e as he,f as Ce}from"./chunk-X4WLRMDP.js";import{$a as s,$b as w,B as G,Cc as pe,Dc as $,Ha as T,Hb as z,Ia as l,Ib as p,Ja as P,Jb as oe,Kb as x,Mb as V,Nb as N,Ob as k,Pb as re,Q as q,Qb as B,Sb as F,Tb as ae,X as Y,Za as g,_b as S,ac as le,bc as H,cb as te,da as Q,ga as D,gb as ne,hb as E,jb as M,kb as O,lb as a,mb as c,nb as b,oa as C,ob as v,pa as f,pb as y,q as Z,rb as I,tc as ce,ub as h,vc as R,wb as m,wc as se,za as ee,zb as ie,zc as me}from"./chunk-HSFUKC7R.js";import"./chunk-GNOSNGXM.js";var Ae=(t,r)=>({color:t,"font-weight":r});function je(t,r){if(t&1&&(a(0,"mat-radio-button",2),p(1),c()),t&2){let i=r.$implicit,o=r.index,e=m();te(ae(7,Ae,e.model==i.Key&&e.activeBold?"#0976b4":"",e.model==i.Key&&e.activeBold?"700":"")),s("disabled",e.exception==i.Value)("matTooltip",e.title.length>0?e.title[o]:"")("value",i.Key)("name",e.name),l(),x("",i.Value," ")}}var Ne=(()=>{let r=class r{constructor(){this.disabled=!1,this.modelChange=new ee,this.options=[{Key:!1,Value:"No"},{Key:!0,Value:"Yes"}],this.border=!1,this.name="",this.title=[],this.exception="",this.activeBold=""}change(o){this.modelChange.emit(o)}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=D({type:r,selectors:[["lib-radio-options"]],inputs:{model:"model",disabled:"disabled",options:"options",border:"border",name:"name",title:"title",exception:"exception",activeBold:"activeBold"},outputs:{modelChange:"modelChange"},standalone:!0,features:[B],decls:2,vars:3,consts:[["color","primary",3,"ngModelChange","disabled","ngModel"],["matTooltipPosition","above","class","me-4 mt-1",3,"style","disabled","matTooltip","value","name",4,"ngFor","ngForOf"],["matTooltipPosition","above",1,"me-4","mt-1",3,"disabled","matTooltip","value","name"]],template:function(e,n){e&1&&(a(0,"mat-radio-group",0),h("ngModelChange",function(_){return n.change(_)}),g(1,je,2,10,"mat-radio-button",1),c()),e&2&&(s("disabled",n.disabled)("ngModel",n.model),l(),s("ngForOf",n.options))},dependencies:[$,R,ye,Se,ve,A,L,U,W,j],styles:["html[_ngcontent-%COMP%]{--mdc-radio-state-layer-size: 36px;--mat-radio-touch-target-display: block}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled:checked + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__outer-circle[_ngcontent-%COMP%]{border-color:#0976b4!important}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__inner-circle[_ngcontent-%COMP%]{background-color:#0976b4!important;border-color:#0976b4!important}"]});let t=r;return t})();var ke=t=>[t],We=t=>({"text-decoration-line-through":t}),Ke=t=>({"border-bottom":t}),Ge=t=>({"bg-gradient-warning":t});function ze(t,r){if(t&1){let i=I();v(0),a(1,"div",21)(2,"h6",22),p(3,"Filter by"),c(),a(4,"lib-radio-options",23),k("modelChange",function(e){C(i);let n=m();return N(n.filterType,e)||(n.filterType=e),f(e)}),c()(),y()}if(t&2){let i=m();l(4),V("model",i.filterType),s("options",i.filterTypeOptions)}}function He(t,r){if(t&1){let i=I();a(0,"button",25),h("click",function(){C(i);let e=m().ngIf,n=m();return f(n.onUpdateItems(e))}),b(1,"i",26),p(2," Update "),c()}}function Je(t,r){if(t&1&&(v(0),a(1,"div",4),g(2,He,3,0,"button",24),c(),y()),t&2){let i=r.ngIf,o=m();l(2),s("ngIf",o.productService.hasSelectionVariant(i))}}function Xe(t,r){if(t&1&&(a(0,"th",15)(1,"div",27),b(2,"img",28),a(3,"div",29),p(4),S(5,"stringLimit"),c()()()),t&2){let i=r.$implicit;l(),s("matTooltip",(i.Name==null?null:i.Name.length)>20?i.Name:""),l(),s("src",i==null?null:i.Img,T),l(2),x(" ",le(5,3,i.Name,20)," ")}}function Ze(t,r){if(t&1){let i=I();a(0,"th")(1,"input",30),k("ngModelChange",function(e){C(i);let n=m();return N(n.checkboxState,e)||(n.checkboxState=e),f(e)}),h("ngModelChange",function(){C(i);let e=m();return f(e.onSelectAllData())}),c()()}if(t&2){let i=m();l(),V("ngModel",i.checkboxState)}}function qe(t,r){t&1&&(a(0,"th",31)(1,"span"),p(2,"Expected"),c(),a(3,"span",32),p(4,"(POS)"),c()(),a(5,"th",31),p(6,"Channel"),c())}function Ye(t,r){if(t&1){let i=I();a(0,"img",45),h("click",function(e){C(i);let n=m(3).$implicit,d=m(2);return f(d.onZoomImage(e,n==null?null:n.ImageUrl))}),c()}if(t&2){let i=m(3).$implicit;ie("src",i==null?null:i.ImageUrl,T)}}function Qe(t,r){t&1&&b(0,"img",46)}function et(t,r){if(t&1&&(a(0,"small",44),p(1),c()),t&2){let i=m(3).$implicit;l(),x("(",i==null?null:i.Category,")")}}function tt(t,r){if(t&1&&(v(0),a(1,"td",40),g(2,Ye,1,1,"img",41)(3,Qe,1,0,"ng-template",null,0,H),c(),a(5,"td",42)(6,"h5",43),p(7),c(),g(8,et,2,1,"small",44),c(),y()),t&2){let i=z(4),o=m().$index,e=m().$implicit,n=m().ngIf;l(),s("rowSpan",e==null?null:e.Variants.length)("ngClass",F(7,Ke,o+1==n.length)),l(),s("ngIf",e==null?null:e.ImageUrl)("ngIfElse",i),l(3),s("rowSpan",e==null?null:e.Variants.length),l(2),oe(e==null?null:e.Name),l(),ne(e!=null&&e.Category?8:-1)}}function nt(t,r){if(t&1){let i=I();a(0,"td",47)(1,"input",30),k("ngModelChange",function(e){C(i);let n=m().$implicit;return N(n.selected,e)||(n.selected=e),f(e)}),c()()}if(t&2){let i=m().$implicit;l(),V("ngModel",i.selected)}}function it(t,r){if(t&1){let i=I();v(0),a(1,"td",49),p(2),S(3,"number"),c(),a(4,"td",50),h("click",function(){let e=C(i).$implicit,n=m(2).$implicit,d=m().$implicit,_=m(2);return f(_.openTableDialog(n,d,e))}),a(5,"div",51)(6,"div",52),p(7),S(8,"number"),c(),a(9,"a",53),h("click",function(e){return C(i),f(e==null?null:e.stopPropagation())}),b(10,"i",38),c()()(),y()}if(t&2){let i=r.$implicit;l(2),x(" ",w(3,4,i.PriceExpected)," "),l(2),s("ngClass",F(8,Ge,i.Price!=i.PriceExpected)),l(3),x(" ",w(8,6,i.Price)," "),l(2),s("href",i.Url,T)}}function ot(t,r){t&1&&(a(0,"td",54),p(1," X "),c(),a(2,"td",54),p(3," X "),c())}function rt(t,r){if(t&1&&(v(0),g(1,it,11,10,"ng-container",48)(2,ot,4,0,"ng-template",null,1,H),y()),t&2){let i=r.$implicit,o=z(3),e=m().$implicit,n=m(3);l(),s("ngIf",n.getItemFromChannel(e,i.ID))("ngIfElse",o)}}function at(t,r){if(t&1&&(a(0,"tr"),g(1,tt,9,9,"ng-container",3),a(2,"td",33),p(3),c(),a(4,"td",34)(5,"div",35)(6,"div",36),p(7),c(),a(8,"div",29)(9,"a",37),b(10,"i",38),c()()()(),g(11,nt,2,1,"ng-template",19)(12,rt,4,2,"ng-container",39),c()),t&2){let i=r.$implicit,o=r.$index,e=m(3);l(),s("ngIf",o==0),l(2),x(" ",i==null?null:i.Model," "),l(),s("matTooltip",i.Discontinued?e.discontinuedVariantMsg:""),l(2),s("ngClass",F(8,We,i.Discontinued)),l(),x(" ",i==null?null:i.Code," "),l(2),s("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(i==null?null:i.ID),T),l(2),s("ngxPermissionsOnly",F(10,ke,e.rolePriceEdit)),l(),s("ngForOf",e.channelOptions)}}function lt(t,r){if(t&1&&(a(0,"tbody"),M(1,at,13,12,"tr",null,E),c()),t&2){let i=r.$implicit;l(),O(i.Variants)}}function ct(t,r){if(t&1&&(v(0),M(1,lt,3,0,"tbody",null,E),y()),t&2){let i=r.ngIf;l(),O(i)}}var Zt=(()=>{let r=class r{constructor(o,e,n,d,_,u,Be){this.http=o,this.toastr=e,this.dialog=n,this.productService=d,this.authService=_,this.biggerPictureService=u,this.paginationService=Be,this.infinitePagination=Q(X),this.searchFilter=new Ie,this.checkboxState=!1,this.rolePriceEdit=_e.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.filterTypeOptions=[{Key:K.ALL,Value:"All"},{Key:K.DIFFERENCE,Value:"Difference"}],this.filterType=K.ALL,this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPagination()}initPagination(){this.infinitePagination.fetchDataEndpoint="Price/GetOutletPrice",this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.infinitePagination.data$.pipe(q(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(Y(o=>{this.searchFilter=o.Filter,this.infinitePagination.reloadPagination(this.searchFilter)}))}onSelectAllData(){this.data$=this.data$.pipe(Z(o=>(o.map(e=>(e.Variants&&(e.Variants=e.Variants.map(n=>(n.selected=this.checkboxState,n))),e)),o)))}onFilter(o){this.searchFilter.text=o;let e={text:o,filterModel:this.filterType,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount};this.infinitePagination.reloadPagination(e)}updatePrice(o){let e=this.productService.selectedVariantProduct(o);if(e.length>0){let n=e.map(u=>u.ID),_={ListChannelID:this.channelOptions.filter(u=>u.selected).map(u=>u.ID),ListID:n};this.http.post("/api/Price/UpdateChannelOutletPrice",_).subscribe({next:u=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+_.ListID.length+" items in "+_.ListChannelID.length+" channels","Success")},error:u=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(o=>(o.selected=!1,o))}getItemFromChannel(o,e){return o.Channel.find(n=>n.ChannelID==e)}onUpdateItems(o){let e=this.productService.selectedVariantProduct(o);this.dialog.open(Oe,{data:{selectedItems:e,channels:this.channelOptions},width:"600px"}).afterClosed().pipe(G(n=>J.IsNotEmpty(n))).subscribe(n=>{this.channelOptions=n,this.updatePrice(o)})}openTableDialog(o,e,n){let d=JSON.parse(JSON.stringify(o));this.dialog.open(De,{data:{Name:e.Name,Variant:d,ChannelID:n?.ChannelID,Table:"price",ChannelItemID:n?.ChannelItemID}}).afterClosed().pipe(G(u=>J.IsNotEmpty(u))).subscribe(u=>{this.updateProductPrice(u,n)})}updateProductPrice(o,e){let n={ID:o.ChannelID,ChannelItemID:o.ChannelItemID,ChannelVariantID:o.ChannelVariationID,Price:parseFloat(o.Price),VariantID:o.ID,SKU:o.Sku};this.http.post("/api/Price/UpdatePriceByID",n).subscribe(d=>{e.Price=n.Price;let _=this.productService.findChannelById(n.ID,this.channelOptions);this.toastr.success(`Successfully updated ${o.ItemName} (${o.VarName}) inventory in ${_.Name} to ${n.Price}`,"Success")})}openExportDialog(){this.dialog.open(Ee,{data:{title:"Export Custom Channel Price",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportOutletPrice"}}).afterClosed().subscribe()}onZoomImage(o,e){this.biggerPictureService.openBiggerPicture(o,e)}};r.\u0275fac=function(e){return new(e||r)(P(ge),P(ue),P(xe),P(we),P(fe),P(Fe),P(Me))},r.\u0275cmp=D({type:r,selectors:[["app-custom-channel-price"]],standalone:!0,features:[re([X]),B],decls:38,vars:23,consts:[["elsePic",""],["elseCol",""],["headerTitle","Price Comparison",3,"onSubmit","hideSearchBox","hideSearchDropdown","textButton"],[4,"ngIf"],[1,"d-flex"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"channel-column"],["colspan","5"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","text-uppercase"],["scope","col","colspan","2",1,"text-center","w-25"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[3,"ngxPermissionsOnly"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[2,"height","46px"],[1,"mb-3"],["name","filterModel",3,"modelChange","model","options"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"text-end","border-top-0","border","w-10"],[1,"ms-1"],[1,"text-start","border-bottom"],["matTooltipPosition","above",1,"text-end","border-bottom",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],[3,"ngClass"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[4,"ngFor","ngForOf"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],[1,"text-start","border-bottom",2,"padding-left","0px",3,"rowSpan"],[1,"mb-0","item-name"],[1,"mt-1"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],[4,"ngIf","ngIfElse"],[1,"text-end","border"],[1,"text-center","border","pointer","cell-hover",3,"click","ngClass"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2"],["target","_blank",3,"click","href"],[1,"table-white","border","text-end",2,"color","red"]],template:function(e,n){e&1&&(a(0,"mainpanel",2),h("onSubmit",function(_){return n.onFilter(_)}),a(1,"filters"),g(2,ze,5,2,"ng-container",3),S(3,"async"),c(),a(4,"actions")(5,"div",4),g(6,Je,3,1,"ng-container",3),S(7,"async"),a(8,"button",5),h("click",function(){return n.openExportDialog()}),b(9,"i",6),a(10,"span"),p(11,"Export"),c()()()(),a(12,"content")(13,"div",7)(14,"div",8)(15,"div",9)(16,"div",10)(17,"table",11)(18,"thead",12)(19,"tr",13),b(20,"th",14),M(21,Xe,6,6,"th",15,E),c(),a(23,"tr")(24,"th",16)(25,"span"),p(26," Product "),c()(),a(27,"th",17),p(28,"Variant"),c(),a(29,"th",18),p(30,"SKU"),c(),g(31,Ze,2,1,"ng-template",19),M(32,qe,7,0,null,null,E),c()(),g(34,ct,3,0,"ng-container",3),S(35,"async"),c(),a(36,"infinite-paginator",20),S(37,"async"),h("onNextPage",function(){return n.infinitePagination.onNextPage(n.searchFilter)})("onLastPage",function(){return n.infinitePagination.onLastPage(n.searchFilter)})("onGetRowCount",function(){return n.infinitePagination.getRowCount(n.searchFilter)}),c()()()()()()()),e&2&&(s("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),l(2),s("ngIf",w(3,13,n.loader$)),l(4),s("ngIf",w(7,15,n.data$)),l(15),O(n.channelOptions),l(10),s("ngxPermissionsOnly",F(21,ke,n.rolePriceEdit)),l(),O(n.channelOptions),l(2),s("ngIf",w(35,17,n.data$)),l(2),s("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",w(37,19,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage()))},dependencies:[$,ce,R,se,me,pe,be,Pe,A,de,L,U,Ve,Ne,W,j,Te,Ce,he],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{font-weight:400;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}"]});let t=r;return t})();export{Zt as CustomChannelPriceComponent};
|
|
1
|
+
import"./chunk-TE62OPBT.js";import{a as Oe}from"./chunk-65RMQ5Q5.js";import{a as K}from"./chunk-XHAXYWZ7.js";import{a as De,b as Ve,c as X}from"./chunk-MZNSPLFO.js";import{a as _e}from"./chunk-BVIRHZTZ.js";import{a as Me}from"./chunk-JY3L4RUM.js";import{a as Ie}from"./chunk-7KG3DC5J.js";import{b as Ee}from"./chunk-ULELZXI5.js";import{a as Te}from"./chunk-E5BOLHDG.js";import"./chunk-A37OKNC2.js";import"./chunk-C6QIBOCB.js";import{a as we}from"./chunk-7VKIP3Z6.js";import"./chunk-DYLT6RRK.js";import{a as Se,b as ve,c as ye}from"./chunk-GQG2K3LS.js";import{a as Fe}from"./chunk-D76K4RZ7.js";import"./chunk-EIBGI6U2.js";import{g as fe}from"./chunk-LAQL3BQZ.js";import{b as ue,e as ge}from"./chunk-JHYIHRQH.js";import"./chunk-KCDL7SWP.js";import{d as xe,m as Pe,n as be}from"./chunk-4CEFDQPI.js";import{t as j,u as W}from"./chunk-2SC3HO66.js";import"./chunk-DQIP7MCZ.js";import{b as de,h as L,m as U,y as A}from"./chunk-2E5AKA74.js";import{c as J,e as he,f as Ce}from"./chunk-FTHTFVHH.js";import{Ab as ie,B as G,Bc as me,Ec as pe,Fc as $,Ha as T,Ib as z,Ja as l,Jb as p,Ka as P,Kb as oe,Lb as x,Nb as V,Ob as N,Pb as k,Q as q,Qb as re,Rb as B,Tb as F,Ub as ae,X as Y,_a as g,ab as s,ac as S,bc as w,cc as le,da as Q,db as te,dc as H,ga as D,hb as ne,ib as E,kb as M,lb as O,mb as a,nb as c,oa as C,ob as b,pa as f,pb as v,q as Z,qb as y,sb as I,vb as h,vc as ce,xb as m,xc as R,yc as se,za as ee}from"./chunk-ZIZWZZ4E.js";import"./chunk-GNOSNGXM.js";var Ae=(t,r)=>({color:t,"font-weight":r});function je(t,r){if(t&1&&(a(0,"mat-radio-button",2),p(1),c()),t&2){let i=r.$implicit,o=r.index,e=m();te(ae(7,Ae,e.model==i.Key&&e.activeBold?"#0976b4":"",e.model==i.Key&&e.activeBold?"700":"")),s("disabled",e.exception==i.Value)("matTooltip",e.title.length>0?e.title[o]:"")("value",i.Key)("name",e.name),l(),x("",i.Value," ")}}var Ne=(()=>{let r=class r{constructor(){this.disabled=!1,this.modelChange=new ee,this.options=[{Key:!1,Value:"No"},{Key:!0,Value:"Yes"}],this.border=!1,this.name="",this.title=[],this.exception="",this.activeBold=""}change(o){this.modelChange.emit(o)}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=D({type:r,selectors:[["lib-radio-options"]],inputs:{model:"model",disabled:"disabled",options:"options",border:"border",name:"name",title:"title",exception:"exception",activeBold:"activeBold"},outputs:{modelChange:"modelChange"},standalone:!0,features:[B],decls:2,vars:3,consts:[["color","primary",3,"ngModelChange","disabled","ngModel"],["matTooltipPosition","above","class","me-4 mt-1",3,"style","disabled","matTooltip","value","name",4,"ngFor","ngForOf"],["matTooltipPosition","above",1,"me-4","mt-1",3,"disabled","matTooltip","value","name"]],template:function(e,n){e&1&&(a(0,"mat-radio-group",0),h("ngModelChange",function(_){return n.change(_)}),g(1,je,2,10,"mat-radio-button",1),c()),e&2&&(s("disabled",n.disabled)("ngModel",n.model),l(),s("ngForOf",n.options))},dependencies:[$,R,ye,Se,ve,A,L,U,W,j],styles:["html[_ngcontent-%COMP%]{--mdc-radio-state-layer-size: 36px;--mat-radio-touch-target-display: block}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled:checked + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__outer-circle[_ngcontent-%COMP%]{border-color:#0976b4!important}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__inner-circle[_ngcontent-%COMP%]{background-color:#0976b4!important;border-color:#0976b4!important}"]});let t=r;return t})();var ke=t=>[t],We=t=>({"text-decoration-line-through":t}),Ke=t=>({"border-bottom":t}),Ge=t=>({"bg-gradient-warning":t});function ze(t,r){if(t&1){let i=I();v(0),a(1,"div",21)(2,"h6",22),p(3,"Filter by"),c(),a(4,"lib-radio-options",23),k("modelChange",function(e){C(i);let n=m();return N(n.filterType,e)||(n.filterType=e),f(e)}),c()(),y()}if(t&2){let i=m();l(4),V("model",i.filterType),s("options",i.filterTypeOptions)}}function He(t,r){if(t&1){let i=I();a(0,"button",25),h("click",function(){C(i);let e=m().ngIf,n=m();return f(n.onUpdateItems(e))}),b(1,"i",26),p(2," Update "),c()}}function Je(t,r){if(t&1&&(v(0),a(1,"div",4),g(2,He,3,0,"button",24),c(),y()),t&2){let i=r.ngIf,o=m();l(2),s("ngIf",o.productService.hasSelectionVariant(i))}}function Xe(t,r){if(t&1&&(a(0,"th",15)(1,"div",27),b(2,"img",28),a(3,"div",29),p(4),S(5,"stringLimit"),c()()()),t&2){let i=r.$implicit;l(),s("matTooltip",(i.Name==null?null:i.Name.length)>20?i.Name:""),l(),s("src",i==null?null:i.Img,T),l(2),x(" ",le(5,3,i.Name,20)," ")}}function Ze(t,r){if(t&1){let i=I();a(0,"th")(1,"input",30),k("ngModelChange",function(e){C(i);let n=m();return N(n.checkboxState,e)||(n.checkboxState=e),f(e)}),h("ngModelChange",function(){C(i);let e=m();return f(e.onSelectAllData())}),c()()}if(t&2){let i=m();l(),V("ngModel",i.checkboxState)}}function qe(t,r){t&1&&(a(0,"th",31)(1,"span"),p(2,"Expected"),c(),a(3,"span",32),p(4,"(POS)"),c()(),a(5,"th",31),p(6,"Channel"),c())}function Ye(t,r){if(t&1){let i=I();a(0,"img",45),h("click",function(e){C(i);let n=m(3).$implicit,d=m(2);return f(d.onZoomImage(e,n==null?null:n.ImageUrl))}),c()}if(t&2){let i=m(3).$implicit;ie("src",i==null?null:i.ImageUrl,T)}}function Qe(t,r){t&1&&b(0,"img",46)}function et(t,r){if(t&1&&(a(0,"small",44),p(1),c()),t&2){let i=m(3).$implicit;l(),x("(",i==null?null:i.Category,")")}}function tt(t,r){if(t&1&&(v(0),a(1,"td",40),g(2,Ye,1,1,"img",41)(3,Qe,1,0,"ng-template",null,0,H),c(),a(5,"td",42)(6,"h5",43),p(7),c(),g(8,et,2,1,"small",44),c(),y()),t&2){let i=z(4),o=m().$index,e=m().$implicit,n=m().ngIf;l(),s("rowSpan",e==null?null:e.Variants.length)("ngClass",F(7,Ke,o+1==n.length)),l(),s("ngIf",e==null?null:e.ImageUrl)("ngIfElse",i),l(3),s("rowSpan",e==null?null:e.Variants.length),l(2),oe(e==null?null:e.Name),l(),ne(e!=null&&e.Category?8:-1)}}function nt(t,r){if(t&1){let i=I();a(0,"td",47)(1,"input",30),k("ngModelChange",function(e){C(i);let n=m().$implicit;return N(n.selected,e)||(n.selected=e),f(e)}),c()()}if(t&2){let i=m().$implicit;l(),V("ngModel",i.selected)}}function it(t,r){if(t&1){let i=I();v(0),a(1,"td",49),p(2),S(3,"number"),c(),a(4,"td",50),h("click",function(){let e=C(i).$implicit,n=m(2).$implicit,d=m().$implicit,_=m(2);return f(_.openTableDialog(n,d,e))}),a(5,"div",51)(6,"div",52),p(7),S(8,"number"),c(),a(9,"a",53),h("click",function(e){return C(i),f(e==null?null:e.stopPropagation())}),b(10,"i",38),c()()(),y()}if(t&2){let i=r.$implicit;l(2),x(" ",w(3,4,i.PriceExpected)," "),l(2),s("ngClass",F(8,Ge,i.Price!=i.PriceExpected)),l(3),x(" ",w(8,6,i.Price)," "),l(2),s("href",i.Url,T)}}function ot(t,r){t&1&&(a(0,"td",54),p(1," X "),c(),a(2,"td",54),p(3," X "),c())}function rt(t,r){if(t&1&&(v(0),g(1,it,11,10,"ng-container",48)(2,ot,4,0,"ng-template",null,1,H),y()),t&2){let i=r.$implicit,o=z(3),e=m().$implicit,n=m(3);l(),s("ngIf",n.getItemFromChannel(e,i.ID))("ngIfElse",o)}}function at(t,r){if(t&1&&(a(0,"tr"),g(1,tt,9,9,"ng-container",3),a(2,"td",33),p(3),c(),a(4,"td",34)(5,"div",35)(6,"div",36),p(7),c(),a(8,"div",29)(9,"a",37),b(10,"i",38),c()()()(),g(11,nt,2,1,"ng-template",19)(12,rt,4,2,"ng-container",39),c()),t&2){let i=r.$implicit,o=r.$index,e=m(3);l(),s("ngIf",o==0),l(2),x(" ",i==null?null:i.Model," "),l(),s("matTooltip",i.Discontinued?e.discontinuedVariantMsg:""),l(2),s("ngClass",F(8,We,i.Discontinued)),l(),x(" ",i==null?null:i.Code," "),l(2),s("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(i==null?null:i.ID),T),l(2),s("ngxPermissionsOnly",F(10,ke,e.rolePriceEdit)),l(),s("ngForOf",e.channelOptions)}}function lt(t,r){if(t&1&&(a(0,"tbody"),M(1,at,13,12,"tr",null,E),c()),t&2){let i=r.$implicit;l(),O(i.Variants)}}function ct(t,r){if(t&1&&(v(0),M(1,lt,3,0,"tbody",null,E),y()),t&2){let i=r.ngIf;l(),O(i)}}var Zt=(()=>{let r=class r{constructor(o,e,n,d,_,u,Be){this.http=o,this.toastr=e,this.dialog=n,this.productService=d,this.authService=_,this.biggerPictureService=u,this.paginationService=Be,this.infinitePagination=Q(X),this.searchFilter=new Ie,this.checkboxState=!1,this.rolePriceEdit=_e.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.filterTypeOptions=[{Key:K.ALL,Value:"All"},{Key:K.DIFFERENCE,Value:"Difference"}],this.filterType=K.ALL,this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPagination()}initPagination(){this.infinitePagination.fetchDataEndpoint="Price/GetOutletPrice",this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.infinitePagination.data$.pipe(q(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(Y(o=>{this.searchFilter=o.Filter,this.infinitePagination.reloadPagination(this.searchFilter)}))}onSelectAllData(){this.data$=this.data$.pipe(Z(o=>(o.map(e=>(e.Variants&&(e.Variants=e.Variants.map(n=>(n.selected=this.checkboxState,n))),e)),o)))}onFilter(o){this.searchFilter.text=o;let e={text:o,filterModel:this.filterType,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount};this.infinitePagination.reloadPagination(e)}updatePrice(o){let e=this.productService.selectedVariantProduct(o);if(e.length>0){let n=e.map(u=>u.ID),_={ListChannelID:this.channelOptions.filter(u=>u.selected).map(u=>u.ID),ListID:n};this.http.post("/api/Price/UpdateChannelOutletPrice",_).subscribe({next:u=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+_.ListID.length+" items in "+_.ListChannelID.length+" channels","Success")},error:u=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(o=>(o.selected=!1,o))}getItemFromChannel(o,e){return o.Channel.find(n=>n.ChannelID==e)}onUpdateItems(o){let e=this.productService.selectedVariantProduct(o);this.dialog.open(Oe,{data:{selectedItems:e,channels:this.channelOptions},width:"600px"}).afterClosed().pipe(G(n=>J.IsNotEmpty(n))).subscribe(n=>{this.channelOptions=n,this.updatePrice(o)})}openTableDialog(o,e,n){let d=JSON.parse(JSON.stringify(o));this.dialog.open(De,{data:{Name:e.Name,Variant:d,ChannelID:n?.ChannelID,Table:"price",ChannelItemID:n?.ChannelItemID}}).afterClosed().pipe(G(u=>J.IsNotEmpty(u))).subscribe(u=>{this.updateProductPrice(u,n)})}updateProductPrice(o,e){let n={ID:o.ChannelID,ChannelItemID:o.ChannelItemID,ChannelVariantID:o.ChannelVariationID,Price:parseFloat(o.Price),VariantID:o.ID,SKU:o.Sku};this.http.post("/api/Price/UpdatePriceByID",n).subscribe(d=>{e.Price=n.Price;let _=this.productService.findChannelById(n.ID,this.channelOptions);this.toastr.success(`Successfully updated ${o.ItemName} (${o.VarName}) inventory in ${_.Name} to ${n.Price}`,"Success")})}openExportDialog(){this.dialog.open(Ee,{data:{title:"Export Custom Channel Price",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportOutletPrice"}}).afterClosed().subscribe()}onZoomImage(o,e){this.biggerPictureService.openBiggerPicture(o,e)}};r.\u0275fac=function(e){return new(e||r)(P(ge),P(ue),P(xe),P(we),P(fe),P(Fe),P(Me))},r.\u0275cmp=D({type:r,selectors:[["app-custom-channel-price"]],standalone:!0,features:[re([X]),B],decls:38,vars:23,consts:[["elsePic",""],["elseCol",""],["headerTitle","Price Comparison",3,"onSubmit","hideSearchBox","hideSearchDropdown","textButton"],[4,"ngIf"],[1,"d-flex"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"channel-column"],["colspan","5"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","text-uppercase"],["scope","col","colspan","2",1,"text-center","w-25"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[3,"ngxPermissionsOnly"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[2,"height","46px"],[1,"mb-3"],["name","filterModel",3,"modelChange","model","options"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"text-end","border-top-0","border","w-10"],[1,"ms-1"],[1,"text-start","border-bottom"],["matTooltipPosition","above",1,"text-end","border-bottom",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],[3,"ngClass"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[4,"ngFor","ngForOf"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],[1,"text-start","border-bottom",2,"padding-left","0px",3,"rowSpan"],[1,"mb-0","item-name"],[1,"mt-1"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],[4,"ngIf","ngIfElse"],[1,"text-end","border"],[1,"text-center","border","pointer","cell-hover",3,"click","ngClass"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2"],["target","_blank",3,"click","href"],[1,"table-white","border","text-end",2,"color","red"]],template:function(e,n){e&1&&(a(0,"mainpanel",2),h("onSubmit",function(_){return n.onFilter(_)}),a(1,"filters"),g(2,ze,5,2,"ng-container",3),S(3,"async"),c(),a(4,"actions")(5,"div",4),g(6,Je,3,1,"ng-container",3),S(7,"async"),a(8,"button",5),h("click",function(){return n.openExportDialog()}),b(9,"i",6),a(10,"span"),p(11,"Export"),c()()()(),a(12,"content")(13,"div",7)(14,"div",8)(15,"div",9)(16,"div",10)(17,"table",11)(18,"thead",12)(19,"tr",13),b(20,"th",14),M(21,Xe,6,6,"th",15,E),c(),a(23,"tr")(24,"th",16)(25,"span"),p(26," Product "),c()(),a(27,"th",17),p(28,"Variant"),c(),a(29,"th",18),p(30,"SKU"),c(),g(31,Ze,2,1,"ng-template",19),M(32,qe,7,0,null,null,E),c()(),g(34,ct,3,0,"ng-container",3),S(35,"async"),c(),a(36,"infinite-paginator",20),S(37,"async"),h("onNextPage",function(){return n.infinitePagination.onNextPage(n.searchFilter)})("onLastPage",function(){return n.infinitePagination.onLastPage(n.searchFilter)})("onGetRowCount",function(){return n.infinitePagination.getRowCount(n.searchFilter)}),c()()()()()()()),e&2&&(s("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),l(2),s("ngIf",w(3,13,n.loader$)),l(4),s("ngIf",w(7,15,n.data$)),l(15),O(n.channelOptions),l(10),s("ngxPermissionsOnly",F(21,ke,n.rolePriceEdit)),l(),O(n.channelOptions),l(2),s("ngIf",w(35,17,n.data$)),l(2),s("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",w(37,19,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage()))},dependencies:[$,ce,R,se,me,pe,be,Pe,A,de,L,U,Ve,Ne,W,j,Te,Ce,he],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{font-weight:400;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}"]});let t=r;return t})();export{Zt as CustomChannelPriceComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as N}from"./chunk-
|
|
1
|
+
import{e as N}from"./chunk-JHYIHRQH.js";import{c as f}from"./chunk-FTHTFVHH.js";import{$ as P,B as h,F as g,O as p,Q as l,V as c,X as m,Y as b,c as u,ca as d,d as s,q as n}from"./chunk-ZIZWZZ4E.js";var w=(()=>{let i=class i{get footerPageNumber(){return this._footerPageNumber}set footerPageNumber(t){this._footerPageNumber=t}get hideCount(){return this._hideCount}set hideCount(t){this._hideCount=t}get disableNextButton(){return this._disableNextButton}set disableNextButton(t){this._disableNextButton=t}get goToLastPage(){return this._goToLastPage}set goToLastPage(t){this._goToLastPage=t}constructor(t){this.http=t,this.pagination$=new s(null),this.destroy$=new u,this.data$=this.paginationFunction()}onNextPage(t){t.PageNumber+=1,this.pagination$.next(t)}setPageNumberFooter(t){this.footerPageNumber=t.PageNumber}setPaginationButtonState(t,e){e==0?this.disableNextButton=!0:this.disableNextButton=!(e<t.RowCount*t.PageNumber)}reloadPagination(t){f.IsEmpty(t.PageNumber)&&(t.PageNumber=1),this.pagination$.next(t),this.hideCount=!0,this.goToLastPage=!1}getAllData(t,e){t.RowCount=e,this.pagination$.next(t),this.goToLastPage=!0}destroy(){this.destroy$.next(!0),this.destroy$.complete(),this.pagination$=null,this.pagination$=new s(null),this.data$=this.paginationFunction()}paginationFunction(){return this.pagination$.pipe(c(this.destroy$),h(t=>t!=null),g(t=>this.http.post(`/API/${this.fetchDataEndpoint}`,JSON.stringify(t)).pipe(n(e=>e.Data))),b(this.pagination$),p((t,e)=>{let[$,a]=t,[r]=e;return a.PageNumber==1?[r,a]:[$.concat(r),a]}),m(([t,e])=>{this.setPageNumberFooter(e),this.setPaginationButtonState(e,t.length)}),n(([t])=>t),l())}};i.\u0275fac=function(e){return new(e||i)(d(N))},i.\u0275prov=P({token:i,factory:i.\u0275fac,providedIn:"root"});let o=i;return o})();export{w as a};
|