marketplacepos 3.22.8 → 3.22.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Marketplace/{chunk-6QLRN5DC.js → chunk-27TRHLWP.js} +1 -1
- package/Marketplace/{chunk-VTIM32W5.js → chunk-2KRLACOJ.js} +1 -1
- package/Marketplace/{chunk-QYA5FUMB.js → chunk-66JFFESQ.js} +1 -1
- package/Marketplace/{chunk-XVF5C6K3.js → chunk-6ZHHZ2HR.js} +1 -1
- package/Marketplace/{chunk-6V44GMIW.js → chunk-7UNHNQKK.js} +1 -1
- package/Marketplace/{chunk-HUQ2TRU6.js → chunk-AK3J366L.js} +1 -1
- package/Marketplace/{chunk-KBJEDIFC.js → chunk-BBICRGTY.js} +1 -1
- package/Marketplace/{chunk-FGAQYUJP.js → chunk-BOZNO5L6.js} +1 -1
- package/Marketplace/{chunk-2AZIRD3H.js → chunk-BRKTKAGH.js} +1 -1
- package/Marketplace/{chunk-YSYCCLYG.js → chunk-BT3XJQA5.js} +1 -1
- package/Marketplace/{chunk-2V4HZYVR.js → chunk-DGAMJULA.js} +1 -1
- package/Marketplace/{chunk-J5K5H4FR.js → chunk-DJ3NLV6P.js} +1 -1
- package/Marketplace/{chunk-AKYLFMD3.js → chunk-F3MM4SRD.js} +1 -1
- package/Marketplace/{chunk-NK2CBWWU.js → chunk-FMHP3NCQ.js} +1 -1
- package/Marketplace/{chunk-DXB2OHQZ.js → chunk-FOJY6SPD.js} +1 -1
- package/Marketplace/{chunk-4FFNXVLL.js → chunk-GD3RGKTZ.js} +1 -1
- package/Marketplace/{chunk-L4SJ72H4.js → chunk-GWLH7XX3.js} +1 -1
- package/Marketplace/{chunk-H6FMLR2D.js → chunk-H2HFQTLO.js} +1 -1
- package/Marketplace/{chunk-S46Y6TZ3.js → chunk-IP2GY7DV.js} +1 -1
- package/Marketplace/{chunk-J5QT7AEB.js → chunk-KCXBTZRK.js} +1 -1
- package/Marketplace/{chunk-F2HSZ5BX.js → chunk-LILTMSQC.js} +1 -1
- package/Marketplace/{chunk-CBLSX34S.js → chunk-NS5LZV7F.js} +1 -1
- package/Marketplace/{chunk-WU2PACVU.js → chunk-OFVG22A5.js} +1 -1
- package/Marketplace/{chunk-YH3ET4YX.js → chunk-PM5EOUHK.js} +1 -1
- package/Marketplace/{chunk-7NOBCBXC.js → chunk-PRJISEUT.js} +1 -1
- package/Marketplace/{chunk-Z3KMYVFY.js → chunk-Q4T2TR5D.js} +2 -2
- package/Marketplace/{chunk-TXZVD3Y2.js → chunk-RMXNUALM.js} +2 -2
- package/Marketplace/{chunk-5PPWE4IJ.js → chunk-SXDSKDMD.js} +1 -1
- package/Marketplace/{chunk-CDMZ7IPB.js → chunk-VAH7LJXK.js} +1 -1
- package/Marketplace/{chunk-4YGXXQGV.js → chunk-X77RRMSG.js} +1 -1
- package/Marketplace/{chunk-UP2QCF6N.js → chunk-YEFRSD3L.js} +1 -1
- package/Marketplace/{chunk-25B2ZKEV.js → chunk-ZUHLET6D.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-T34LUNYS.js → main-6N6S2IVE.js} +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as he}from"./chunk-5OHPBQ35.js";import"./chunk-LRU7GIXZ.js";import{a as ce}from"./chunk-
|
|
1
|
+
import{a as he}from"./chunk-5OHPBQ35.js";import"./chunk-LRU7GIXZ.js";import{a as ce}from"./chunk-PM5EOUHK.js";import{a as se}from"./chunk-7LZ5ZSXM.js";import{a as F}from"./chunk-XHAXYWZ7.js";import{b as pe,c as V}from"./chunk-B5PFUQJP.js";import"./chunk-BVIRHZTZ.js";import"./chunk-N6IHFFFZ.js";import"./chunk-PD4CUVAW.js";import"./chunk-IJYSJN63.js";import"./chunk-X5Q6FPWS.js";import"./chunk-46AOM3SM.js";import"./chunk-JXTGH22T.js";import"./chunk-OULUJ2IO.js";import"./chunk-GCKSYCMI.js";import{a as le}from"./chunk-ZFQW5CVZ.js";import"./chunk-ADRVUMMW.js";import"./chunk-XFTUE2ST.js";import"./chunk-HCDKYABV.js";import{i as M}from"./chunk-F3MM4SRD.js";import{b as te,e as ne}from"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import{d as ie,l as ae,m as oe,n as re}from"./chunk-BO4PPSB5.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{c as q,h as X,m as Y,o as Z,y as ee}from"./chunk-BSN7ZAXG.js";import{c as D}from"./chunk-64G3XLI6.js";import"./chunk-OVEJFFL6.js";import{$b as C,Cd as K,Da as b,Ea as P,Eb as I,G as B,Gb as d,Gc as v,Hc as y,Sb as c,Tb as p,Ub as U,Vb as G,Wb as W,Xb as H,Yb as N,bc as g,ea as k,ja as j,jb as h,kb as m,nc as _,pa as S,rc as L,sc as T,ta as A,tc as E,uc as z,vc as $,vd as Q,xb as w,yd as J}from"./chunk-PQDPS2ID.js";import{a as R,b as x}from"./chunk-GNOSNGXM.js";var O=(()=>{let r=class r{constructor(){this.authService=S(M),this.channelOptions=this.authService.getChannels()}filterSelectedChannels(t,i){let e=Object.assign([],this.channelOptions),n=[],a;return t.forEach(o=>{a=e.find(s=>s.ID==o?.parent?.id),a&&(a=x(R({},a),{Name:`${o?.parent?.label} - ${o?.label}`,LocationID:o?.id}),n.push(a))}),i.forEach(o=>{a=e.find(s=>s.ID==o.id),a&&n.push(a)}),n}generateFilterLocation(t,i){let e=[],n=[],a=[];return t.length>0?(e=t.map(o=>o.id),n=t.map(o=>o.parent.id).filter((o,s,f)=>f.indexOf(o)===s)):(e=[],n=[]),a=i.map(o=>o.id),a=a.concat(n).filter((o,s,f)=>f.indexOf(o)===s),{locationIds:e,channelIds:a}}};r.\u0275fac=function(i){return new(i||r)},r.\u0275prov=j({token:r,factory:r.\u0275fac});let l=r;return l})();function ue(l,r){if(l&1){let u=N();c(0,"button",15),C("click",function(){b(u);let i=g().ngIf,e=g();return P(e.onUpdateItems(i))}),U(1,"i",16),_(2," Update "),p()}}function me(l,r){if(l&1&&(c(0,"actions")(1,"div",13),I(2,ue,3,0,"button",14),p()()),l&2){let u=r.ngIf,t=g();h(2),d("ngIf",t.productService.hasSelectionVariant(u))}}function ge(l,r){l&1&&H(0)}function Ce(l,r){if(l&1){let u=N();G(0),c(1,"app-table",17),C("onToggle",function(i){b(u);let e=g();return P(e.onShowDifferenceStock(i))})("onSubmit",function(i){b(u);let e=g();return P(e.updateStockByVariant(i))}),p(),W()}if(l&2){let u=r.ngIf,t=g();h(),d("data",u)("channel",t.channels())("showProductToggle",!0)("hiddenIPOSInventory",t.searchFilter.HiddenIPOSInventory)}}var $e=(()=>{let r=class r{constructor(t,i,e,n,a,o){this.http=t,this.toastr=i,this.dialog=e,this.productService=n,this.authService=a,this.mainPanelService=o,this.paginationService=S(V),this.multiChannelService=S(O),this.searchFilter={PageNumber:1,RowCount:100},this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.selectedLocations=w([]),this.selectedChannels=w([]),this.channels=w([]),this.pageData={Title:"Inventory",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory/pos",Active:!0},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.paginationService.fethRowCountEndpoint=this.allDataCountEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(k(t=>{t.Filter={PageNumber:t.Filter.PageNumber,filterModel:F.ALL,RowCount:t.Filter.PageSize,HiddenIPOSInventory:t.Filter.HiddenIPOSInventory},this.searchFilter=t.Filter,this.mainPanelService.openModalFilter()}))}onChannelChange(t=[]){let i=t.filter(n=>D.isValidGUID(n.id)==!1),e=t.filter(n=>D.isValidGUID(n.id));this.selectedLocations.set(i),this.selectedChannels.set(e)}onSearch(t){let i=this.multiChannelService.filterSelectedChannels(this.selectedLocations(),this.selectedChannels());this.channels.set(i);let e=this.multiChannelService.generateFilterLocation(this.selectedLocations(),this.selectedChannels());this.searchFilter.ListChannelID=e.channelIds,this.searchFilter.ListLocationID=e.locationIds,this.searchFilter.text=t,this.paginationService.reloadPagination(this.searchFilter)}updateStock(t,i){let e=this.productService.selectedVariantProduct(t);if(e.length>0){let n=[];e.forEach(s=>{s.Channel?.forEach(f=>{n.push({ID:s.ID,Code:s.Code,Inventory:s.Inventory,LocationID:f.LocationID})})});let o={ListChannelID:i.filter(s=>s.selected).map(s=>s.ID),List:n};this.http.post("/api/Inventory/UpdateChannel",o).subscribe(s=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+o.List.length+" variants in "+o.ListChannelID.length+" channels","Success")})}}updateStockByVariant(t){let i={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku,LocationID:t.LocationID};this.http.post("/api/Inventory/UpdateQuantityByItem",i).subscribe(e=>{this.paginationService.reloadPagination(this.searchFilter);let n=this.productService.findChannelById(i.ID,this.channelOptions);this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+n.Name+" to "+i.NewQuantity,"Success")})}onShowDifferenceStock(t){t?this.searchFilter.filterModel=F.DIFFERENCE:this.searchFilter.filterModel=F.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(t){let i=this.productService.selectedVariantProduct(t),e=this.channelOptions.filter(n=>this.channels()?.find(a=>a.ID===n.ID));this.dialog.open(se,{data:{selectedItems:i,channels:JSON.parse(JSON.stringify(e))},width:"400px"}).afterClosed().pipe(B(n=>D.IsNotEmpty(n))).subscribe(n=>{this.updateStock(t,n)})}};r.\u0275fac=function(i){return new(i||r)(m(ne),m(te),m(ie),m(le),m(M),m(ae))},r.\u0275cmp=A({type:r,selectors:[["app-multi-channel-comparison"]],standalone:!0,features:[z([V,O]),$],decls:26,vars:22,consts:[["headerTitle","Inventory Comparison","textButton","Search",3,"onSubmit","pageData","hideSearchBox"],[4,"ngIf"],["for","selectChannel",1,"fw-bold","mb-3"],["id","selectChannel",3,"onChannelChange","multiple"],[1,"mt-5"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"d-flex"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"onToggle","onSubmit","data","channel","showProductToggle","hiddenIPOSInventory"]],template:function(i,e){i&1&&(c(0,"mainpanel",0),C("onSubmit",function(a){return e.onSearch(a)}),I(1,me,3,1,"actions",1),v(2,"async"),c(3,"filters"),I(4,ge,1,0,"ng-container",1),v(5,"async"),c(6,"div")(7,"label",2),_(8,"Channel"),p(),c(9,"multiwarehouse-tree-select",3),C("onChannelChange",function(a){return e.onChannelChange(a)}),p()(),c(10,"div",4)(11,"label",5),_(12,"PageNumber"),p(),c(13,"input",6),E("ngModelChange",function(a){return T(e.searchFilter.PageNumber,a)||(e.searchFilter.PageNumber=a),a}),p()(),c(14,"div",4)(15,"label",7),_(16,"Page Size"),p(),c(17,"input",8),E("ngModelChange",function(a){return T(e.searchFilter.RowCount,a)||(e.searchFilter.RowCount=a),a}),p()()(),c(18,"content")(19,"div",9)(20,"div",10)(21,"div",11),I(22,Ce,2,4,"ng-container",1),v(23,"async"),c(24,"infinite-paginator",12),v(25,"async"),C("onNextPage",function(){return e.paginationService.onNextPage(e.searchFilter)})("onLastPage",function(){return e.paginationService.onLastPage(e.searchFilter)})("onGetRowCount",function(){return e.paginationService.getRowCount(e.searchFilter)}),p()()()()()()),i&2&&(d("pageData",e.pageData)("hideSearchBox",!1),h(),d("ngIf",y(2,14,e.paginationService.data$)),h(3),d("ngIf",y(5,16,e.loader$)),h(5),d("multiple",!0),h(4),L("ngModel",e.searchFilter.PageNumber),h(4),L("ngModel",e.searchFilter.RowCount),h(5),d("ngIf",y(23,18,e.paginationService.data$)),h(2),d("totalData",e.paginationService.totalData())("hideCount",e.paginationService.hideCount())("rowCount",y(25,20,e.paginationService.totalRowCount$))("pageNumber",e.paginationService.pageNumber())("disableNextButton",e.paginationService.disableNextButton())("goToLastPage",e.paginationService.isLastPage()))},dependencies:[K,Q,J,re,oe,ce,ee,q,Z,X,Y,pe,he],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let l=r;return l})();export{$e as MultiChannelComparison};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as c}from"./chunk-
|
|
1
|
+
import{i as c}from"./chunk-F3MM4SRD.js";import{b as a}from"./chunk-4SAJUEHO.js";import{ja as s,oa as o}from"./chunk-PQDPS2ID.js";var d=(()=>{let e=class e{constructor(i,t){this.toastr=i,this.authService=t}canActivate(i,t){let n=JSON.parse(window.localStorage.getItem("user")),l=new Date;if(n!=null){let p=new Date(n.Token.expiredAt);return l<p?!0:(this.onTokenExpired(),!1)}else return this.onTokenExpired(),!1}onTokenExpired(){this.toastr.error("Your session has expired. Please login again.","Session Expired").onShown.subscribe(()=>this.authService.logout())}};e.\u0275fac=function(t){return new(t||e)(o(a),o(c))},e.\u0275prov=s({token:e,factory:e.\u0275fac,providedIn:"root"});let r=e;return r})();export{d as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as rt}from"./chunk-PD4CUVAW.js";import{c as ot}from"./chunk-UMNGKENU.js";import{a as Q,b as X,d as Y,e as Z}from"./chunk-CCXKODFV.js";import{i as J}from"./chunk-
|
|
1
|
+
import{b as rt}from"./chunk-PD4CUVAW.js";import{c as ot}from"./chunk-UMNGKENU.js";import{a as Q,b as X,d as Y,e as Z}from"./chunk-CCXKODFV.js";import{i as J}from"./chunk-F3MM4SRD.js";import{b as $,e as q}from"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import{m as it,n as nt}from"./chunk-BO4PPSB5.js";import{t as tt,u as et}from"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{h as H,m as A,y as z}from"./chunk-BSN7ZAXG.js";import{b as p,c as G}from"./chunk-64G3XLI6.js";import{r as v}from"./chunk-OVEJFFL6.js";import{$b as _,Cd as C,Da as O,Ea as w,Eb as u,Gb as m,Gc as V,Hc as W,Sb as r,Tb as a,Ub as D,Vb as U,Wb as F,Yb as K,Z as T,bc as f,ea as x,gb as P,jb as c,ka as d,kb as g,nc as l,oc as S,pc as j,rc as y,sc as L,ta as E,tc as M,ua as h,ud as k,v as I,vd as R,yd as B}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";function ct(n,e){if(n&1&&(r(0,"span",13),D(1,"img",14),a(),r(2,"span"),l(3),a()),n&2){let s=e.item;c(),m("src",s.Img,P)("alt",s.Name),c(2),j(" ",s.Name," ")}}function mt(n,e){if(n&1){let s=K();U(0),r(1,"ng-select",16),M("ngModelChange",function(i){O(s);let o=f().$implicit;return L(o.ProductSKU,i)||(o.ProductSKU=i),w(i)}),a(),F()}if(n&2){let s=e.ngIf,t=f().$implicit;c(),y("ngModel",t.ProductSKU),m("items",s)}}function pt(n,e){if(n&1&&(r(0,"tr")(1,"td"),l(2),a(),r(3,"td"),l(4),a(),r(5,"td"),l(6),a(),r(7,"td"),u(8,mt,2,2,"ng-container",15),V(9,"async"),a()()),n&2){let s=e.$implicit,t=f();c(2),S(s.Name),c(2),S(s.Service),c(2),S(s.TypeString),c(2),m("ngIf",W(9,4,t.logisticOptions$))}}var st=(()=>{let e=class e{constructor(t,i,o){this.http=t,this.toastr=i,this.authService=o,this.filter={ChannelID:""},this.logisticServiceOptions=[],this.channelOptions=this.authService.getChannels(),this.initUnsupportedChannel(),this.initLoader()}initUnsupportedChannel(){let t=[p.WooCommerce,p.Lazada,p.Shopify,p.Plugo];this.channelOptions=this.channelOptions.map(i=>(t.forEach(o=>{i.TypeID===o&&(i.disabled=!0)}),i))}initLoader(){this.http.post("/api/Logistic/Load",{}).subscribe(t=>{this.filter=t.Filter,this.channelName=this.channelOptions[0].Name,this.initLogisticServiceOptions(),this.getLogisticService()})}initLogisticServiceOptions(){this.logisticOptions$=this.http.get("/api/Logistic/OptionLogisticsService").pipe(T(1),x(t=>{this.logisticServiceOptions=t}))}Validate(){for(let t of this.logisticServices)this.datasource.find(o=>o.ProductSKU==t.ProductSKU&&o.Name==t.Name)===void 0&&(t.IsChange=!0);return Promise.resolve(this.logisticServices)}submitLogistics(){this.Validate().then(t=>{this.http.post("/api/Logistic/Submit",this.logisticServices).subscribe(i=>{this.toastr.success("Success","Update Complete!",{timeOut:5e3,enableHtml:!0}),this.getLogisticService()})})}getLogisticService(){this.datasource=[],this.http.post("/api/Logistic/Get",this.filter).pipe(I(t=>t.map(i=>(i.ProductSKU=G.IsEmpty(i.ProductSKU)?null:i.ProductSKU,i)))).subscribe(t=>{this.iniTitle(),this.logisticServices=t,this.datasource=structuredClone(t)})}iniTitle(){let t=this.channelOptions.find(i=>i.ID==this.filter.ChannelID);this.channelName=t?t.Name:null}};e.\u0275fac=function(i){return new(i||e)(g(q),g($),g(J))},e.\u0275cmp=E({type:e,selectors:[["app-logistic"]],decls:28,vars:6,consts:[["hideSearchBox","true","searchBoxPlaceHolder","Enter Number...",3,"onSubmit","headerTitle","hideSearchDropdown"],[1,"mb-2","fw-bold"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],["role","button","data-toggle","tooltip","data-placement","top","matTooltip","enter Logistic for recorded",1,"btn","btn-success","btn-fill","btn-lg","text-white",3,"click"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[4,"ngIf"],["placeholder","Logistic Service Code","bindLabel","Name","bindValue","Code",1,"w-75",3,"ngModelChange","ngModel","items"]],template:function(i,o){i&1&&(r(0,"mainpanel",0),_("onSubmit",function(){return o.getLogisticService()}),r(1,"filters")(2,"div")(3,"label",1),l(4,"Select a Channel"),a(),r(5,"ng-select",2),M("ngModelChange",function(b){return L(o.filter.ChannelID,b)||(o.filter.ChannelID=b),b}),u(6,ct,4,3,"ng-template",3),a()()(),r(7,"actions")(8,"a",4),_("click",function(){return o.submitLogistics()}),l(9,"Submit"),a()(),r(10,"content")(11,"div",5)(12,"div",6)(13,"div",7)(14,"div",8)(15,"table",9)(16,"thead",10)(17,"tr",11)(18,"th"),l(19,"Logistic"),a(),r(20,"th"),l(21,"Service"),a(),r(22,"th"),l(23,"Type"),a(),r(24,"th"),l(25,"Logistic Service"),a()()(),r(26,"tbody"),u(27,pt,10,6,"tr",12),a()()()()()()()()),i&2&&(m("headerTitle","Logistic Courier - "+o.channelName)("hideSearchDropdown",!1),c(5),m("clearable",!1)("items",o.channelOptions),y("ngModel",o.filter.ChannelID),c(22),m("ngForOf",o.logisticServices))},dependencies:[k,R,H,A,it,Y,Q,X,tt,B]});let n=e;return n})();var dt=[{path:"",component:st}],lt=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=h({type:e}),e.\u0275inj=d({imports:[C,v.forChild(dt)]});let n=e;return n})();var kt=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=h({type:e}),e.\u0275inj=d({imports:[C,v,lt,z,nt,Z,rt,ot,et]});let n=e;return n})();export{kt as LogisticModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-GWLH7XX3.js";import"./chunk-RENQ3YZH.js";import"./chunk-LB6JFX4H.js";import"./chunk-WT6W7RAQ.js";import"./chunk-BQ7NR3ET.js";import"./chunk-FMV4LYKN.js";import"./chunk-HCDKYABV.js";import"./chunk-CCXKODFV.js";import"./chunk-F3MM4SRD.js";import"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import"./chunk-BO4PPSB5.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import"./chunk-BSN7ZAXG.js";import"./chunk-64G3XLI6.js";import"./chunk-OVEJFFL6.js";import"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";export{a as ChannelLogComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as B}from"./chunk-
|
|
1
|
+
import{a as B}from"./chunk-KCXBTZRK.js";import{a as vt}from"./chunk-7KG3DC5J.js";import{a as $}from"./chunk-6YZFSP2B.js";import{a as st,b as ft,d as ut,e as gt}from"./chunk-CCXKODFV.js";import{i as dt}from"./chunk-F3MM4SRD.js";import{e as pt}from"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import{m as k,n as ht}from"./chunk-BO4PPSB5.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{h as rt,m as lt,y as mt}from"./chunk-BSN7ZAXG.js";import{c as ct}from"./chunk-64G3XLI6.js";import{m as at,p as F,r as R}from"./chunk-OVEJFFL6.js";import{$b as V,Bd as P,Cd as L,Da as N,Ea as E,Eb as u,Gb as p,Gc as s,Hc as _,Ic as S,Jc as it,Sb as r,Tb as o,Ub as D,Vb as g,Wb as h,Yb as G,Z as j,aa as q,bc as f,ca as U,ec as J,f as z,fb as W,gb as H,jb as m,ka as I,kb as v,mc as K,nc as l,oc as d,pc as x,rc as Q,sc as X,sd as nt,ta as y,tc as Y,ua as b,ud as ot,v as C,vd as T,wc as Z,xc as tt,yc as et,yd as w,zd as M}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var Et=(t,e)=>({"bg-gradient-danger":t,"bg-gradient-warning":e}),Dt=()=>["/menu/notification/detail"],Tt=t=>({ID:t});function wt(t,e){if(t&1&&(r(0,"span",14),D(1,"img",15),o(),l(2)),t&2){let n=e.item;m(),p("src",n.Img,H)("alt",n.Name),m(),x(" ",n.Name," ")}}function Mt(t,e){if(t&1&&(g(0),l(1),s(2,"number"),r(3,"span"),l(4,"s"),o(),h()),t&2){let n=f().$implicit;m(),x(" ",S(2,1,n.DurationInSecond,"1.1-1")," ")}}function Pt(t,e){t&1&&l(0," - ")}function Lt(t,e){if(t&1&&(g(0),r(1,"tr",16)(2,"td")(3,"a",17),D(4,"img",18),r(5,"span"),l(6),o()()(),r(7,"td")(8,"b"),l(9),o(),D(10,"div",19),o(),r(11,"td"),u(12,Mt,5,4,"ng-container",20)(13,Pt,1,0,"ng-template",null,0,it),o(),r(15,"td"),l(16),o(),r(17,"td"),l(18),s(19,"date"),o()(),h()),t&2){let n=e.$implicit,a=K(14);m(),p("ngClass",et(14,Et,n.Status==1,n.Status==0)),m(2),p("routerLink",Z(17,Dt))("queryParams",tt(18,Tt,n.ID)),m(),J("src",n.Img,H),m(2),d(n.Name),m(3),d(n.Label),m(),p("innerHTML",n.Message,W),m(2),p("ngIf",n.DurationInSecond)("ngIfElse",a),m(4),d(n.StatusLabel),m(2),d(S(19,11,n.Created,"dd MMM yyyy HH:mm"))}}function Ft(t,e){if(t&1){let n=G();g(0),r(1,"div",6)(2,"div",21)(3,"app-custom-paginator",22),s(4,"async"),s(5,"async"),V("total",function(){N(n);let i=f(2);return E(i.getRowCount())})("next",function(){N(n);let i=f(2);return E(i.getNotifications())})("previous",function(){N(n);let i=f(2);return E(i.getNotifications())}),o()()(),h()}if(t&2){let n=f().ngIf,a=f();m(3),p("filter",a.filter)("totaldata",n==null?null:n.length)("paginationTotal",_(4,4,a.rowCount$))("hasClicked",_(5,6,a.rowCount$))}}function Rt(t,e){if(t&1&&(g(0),u(1,Ft,6,8,"ng-container",13),h()),t&2){let n=e.ngIf;m(),p("ngIf",n.length>0)}}var _t=(()=>{let e=class e{constructor(a,i,c){this.http=a,this.notificationService=i,this.authService=c,this.filter=new vt,this.destroy$=new z,this.channelOptions=c.getChannels()}ngOnInit(){this.notificationService.clearNotification(),this.initPageLoader(),this.subscribeNotification()}subscribeNotification(){this.notificationService.getNotification().pipe(U(this.destroy$)).subscribe(a=>{a.length>0&&(this.getNotifications(),this.notificationService.clearNotification())})}initPageLoader(){this.http.post("/api/notification/Load",{}).subscribe(a=>{this.filter=a.Filter,this.filter.PageSize=this.filter.RowCount,this.getNotifications()})}onFilter(){this.rowCount$=null,this.getNotifications()}getNotifications(){let a={ChannelID:this.filter.ChannelID,RowCount:this.filter.PageSize,PageNumber:this.filter.PageNumber};this.notifications$=this.http.post("/api/notification/Get",a).pipe(C(i=>i.Data),C(i=>(i=this.setChannelLogoToNotifications(i),i=this.setTimeToSecond(i),i)),j(1))}setTimeToSecond(a){return a=a.map(i=>(i.DurationInSecond=parseInt(i.Duration)/1e3,i)),a}setChannelLogoToNotifications(a){return a=a.map(i=>(i.Img=ct.getChannelLogoByTypeId(i.TypeID),i)),a}getRowCount(){let a={ChannelID:this.filter.ChannelID};this.rowCount$=this.http.post("/api/notification/RowCount",a).pipe(C(i=>i.Count),j(1))}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};e.\u0275fac=function(i){return new(i||e)(v(pt),v(B),v(dt))},e.\u0275cmp=y({type:e,selectors:[["app-notification"]],decls:30,vars:9,consts:[["timeNotAvailable",""],["headerTitle","Notification","hideSearchBox","true",3,"onSubmit"],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[3,"ngClass"],[3,"routerLink","queryParams"],["alt","",1,"channelLogo-md","me-4",3,"src"],[3,"innerHTML"],[4,"ngIf","ngIfElse"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(i,c){i&1&&(r(0,"mainpanel",1),V("onSubmit",function(){return c.onFilter()}),r(1,"filters")(2,"div")(3,"h6",2),l(4,"Channel"),o(),r(5,"ng-select",3),Y("ngModelChange",function(O){return X(c.filter.ChannelID,O)||(c.filter.ChannelID=O),O}),u(6,wt,3,3,"ng-template",4),o()()(),r(7,"content")(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"table",9)(13,"thead",10)(14,"tr",11)(15,"th"),l(16,"Channel"),o(),r(17,"th"),l(18,"Process"),o(),r(19,"th"),l(20,"Duration"),o(),r(21,"th"),l(22,"Status"),o(),r(23,"th"),l(24,"Created"),o()()(),r(25,"tbody"),u(26,Lt,20,20,"ng-container",12),s(27,"async"),o()()()()(),u(28,Rt,2,1,"ng-container",13),s(29,"async"),o()()()),i&2&&(m(5),p("clearable",!0)("items",c.channelOptions),Q("ngModel",c.filter.ChannelID),m(21),p("ngForOf",_(27,5,c.notifications$)),m(2),p("ngIf",_(29,7,c.notifications$)))},dependencies:[nt,ot,T,ut,st,ft,rt,lt,k,F,$,w,P,M]});let t=e;return t})();function Bt(t,e){if(t&1&&(r(0,"div",10)(1,"div",13)(2,"div",7)(3,"h5"),l(4,"Perflog"),o()(),r(5,"div",8)(6,"div",14)(7,"div",15)(8,"pre"),l(9),o()()()()()()),t&2){let n=f().ngIf;m(9),d(n.Perflog)}}function kt(t,e){if(t&1&&(g(0),r(1,"div",17)(2,"div",13)(3,"div",7)(4,"h5"),l(5,"StackTrace"),o()(),r(6,"div",8)(7,"div",14)(8,"div",15)(9,"pre"),l(10),o()()()()()(),h()),t&2){let n=f().ngIf;m(10),d(n==null?null:n.StackTrace)}}function $t(t,e){if(t&1&&(g(0),r(1,"mainpanel",1)(2,"actions")(3,"a",2),l(4,"Back"),o()(),r(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h5"),l(12,"General"),o()(),r(13,"div",8)(14,"div",9)(15,"div",10)(16,"div",11)(17,"label"),l(18,"Created Date"),o(),r(19,"div")(20,"span"),l(21),s(22,"date"),o()()()(),r(23,"div",10)(24,"div",11)(25,"label"),l(26,"Status"),o(),r(27,"div")(28,"span"),l(29),o()()()()(),r(30,"div",12)(31,"div",10)(32,"div",11)(33,"label"),l(34,"Duration"),o(),r(35,"div")(36,"span"),l(37),s(38,"number"),o()()()(),r(39,"div",10)(40,"div",11)(41,"label"),l(42,"Label"),o(),r(43,"div")(44,"span"),l(45),o()()()()()()()()(),r(46,"div",4)(47,"div",10)(48,"div",13)(49,"div",7)(50,"h5"),l(51,"Message"),o()(),r(52,"div",8)(53,"div",14)(54,"div",15)(55,"pre"),l(56),o()()()()()(),u(57,Bt,10,1,"div",16)(58,kt,11,1,"ng-container",0),o()()()(),h()),t&2){let n=e.ngIf;m(),p("headerTitle","Notification "+n.Name)("hideSearchBox",!0)("hideSearchDropdown",!0),m(20),d(S(22,10,n.Created,"dd MMM yyyy HH:mm:ss")),m(8),d(n.StatusLabel),m(8),x("",S(38,13,n.DurationInSecond,"1.1-1")," s"),m(8),d(n.Label),m(11),d(n.Message),m(),p("ngIf",n==null?null:n.Perflog),m(),p("ngIf",n==null?null:n.StackTrace)}}var Ct=(()=>{let e=class e{constructor(a,i){this.activatedRoute=a,this.notificationService=i}ngOnInit(){this.notification$=this.activatedRoute.queryParams.pipe(q(a=>{let i=a.ID;return this.notificationService.getNotificationDetail(i).pipe(C(c=>(c.DurationInSecond=parseInt(c.Duration)/1e3,c)))}))}};e.\u0275fac=function(i){return new(i||e)(v(at),v(B))},e.\u0275cmp=y({type:e,selectors:[["app-detail"]],decls:2,vars:3,consts:[[4,"ngIf"],[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/notification",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-8"],[1,"row"],[1,"col-12"],[1,"card","mb-8"],[1,"card-header"],[1,"card-body"],[1,"row","mt-6"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-4"],[1,"card"],[1,"col-sm-12","mt-2"],[1,"form-group"],["class","col-sm-6",4,"ngIf"],[1,"col-sm-12"]],template:function(i,c){i&1&&(u(0,$t,59,16,"ng-container",0),s(1,"async")),i&2&&p("ngIf",_(1,1,c.notification$))},dependencies:[T,k,F,w,P,M]});let t=e;return t})();var Ot=[{path:"",component:_t},{path:"detail",component:Ct}],St=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=b({type:e}),e.\u0275inj=I({imports:[L,R.forChild(Ot)]});let t=e;return t})();var se=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=b({type:e}),e.\u0275inj=I({imports:[L,St,gt,mt,ht,R,$]});let t=e;return t})();export{se as NotificationModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as T}from"./chunk-LRU7GIXZ.js";import{a as y,b}from"./chunk-N3TTJVBG.js";import{a}from"./chunk-
|
|
1
|
+
import{a as T}from"./chunk-LRU7GIXZ.js";import{a as y,b}from"./chunk-N3TTJVBG.js";import{a}from"./chunk-2KRLACOJ.js";import"./chunk-F3MM4SRD.js";import"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import"./chunk-64G3XLI6.js";import{n as C,r}from"./chunk-OVEJFFL6.js";import{Cd as o,Gb as u,Sb as d,Tb as f,Ub as i,jb as c,ka as p,ta as l,ua as s,uc as h,vc as v}from"./chunk-PQDPS2ID.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-27TRHLWP.js").then(t=>t.MultiChannelComparison)},canActivate:[a],data:{title:"Inventory Comparison"}},{path:"bychannel",loadComponent(){return import("./chunk-PRJISEUT.js").then(t=>t.SingleChannelComparisonComponent)},canActivate:[a],data:{title:"Inventory Comparison"}},{path:"channel_summary",loadComponent(){return import("./chunk-LILTMSQC.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{a as Ge}from"./chunk-L4SJ72H4.js";import{a as Z}from"./chunk-J5D7PMX5.js";import"./chunk-6U6JR5K6.js";import{a as Y}from"./chunk-RENQ3YZH.js";import{a as qe,b as He}from"./chunk-N3TTJVBG.js";import"./chunk-MY4B7K3R.js";import"./chunk-LB6JFX4H.js";import"./chunk-FGPSBTFS.js";import"./chunk-ADRVUMMW.js";import{a as K,b as ze}from"./chunk-WT6W7RAQ.js";import"./chunk-BQ7NR3ET.js";import{a as W}from"./chunk-VTIM32W5.js";import"./chunk-FMV4LYKN.js";import"./chunk-HCDKYABV.js";import{a as pe,b as ce,d as ue,e as Be}from"./chunk-CCXKODFV.js";import{i as de}from"./chunk-AKYLFMD3.js";import{e as M}from"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import{m as R,n as je}from"./chunk-BO4PPSB5.js";import{t as Ae,u as Fe}from"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{c as ae,h as le,m as se,o as me,t as Oe,u as ke,y as We,z as Ve}from"./chunk-BSN7ZAXG.js";import{c as X}from"./chunk-64G3XLI6.js";import{m as B,n as Le,p as k,r as ve}from"./chunk-OVEJFFL6.js";import{$b as N,Ad as re,Cd as fe,Da as g,Ea as h,Eb as y,Gb as p,Gc as x,Hc as G,Ic as E,Jc as U,Kb as De,Pa as Ee,Sb as t,Tb as i,Ub as w,Vb as F,Wb as j,Yb as L,Z as be,bc as b,ea as xe,ec as Me,gb as V,ja as ie,jb as m,ka as ne,kb as f,ld as Re,ma as we,mc as H,nc as l,oa as he,oc as u,pc as P,rc as _,sb as Te,sc as C,sd as Ne,ta as I,tc as S,ua as oe,ud as J,v as Se,va as Ie,vd as T,wc as z,xc as q,yd as Pe,zd as D}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var Ue=(()=>{let n=class n{constructor(){this.ObjectlogTabs=[{Title:"Sync Order",Url:"/menu/log/order"},{Title:"Inventory Sync ",Url:"/menu/log/inventory"},{Title:"Channel Webhook",Url:"/menu/log/rawlog"},{Title:"Channel Webhook Exception ",Url:"/menu/log/exception"},{Title:"Authorization Log ",Url:"/menu/log/authorization-log"}]}};n.\u0275fac=function(r){return new(r||n)},n.\u0275cmp=I({type:n,selectors:[["app-logs"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(r,e){r&1&&(t(0,"nav",0)(1,"div",1)(2,"div"),w(3,"nav-tab",2),i()()(),w(4,"router-outlet")),r&2&&(m(3),p("Tabs",e.ObjectlogTabs))},dependencies:[Le,qe]});let o=n;return o})();var A=(()=>{let n=class n{constructor(){}get Data(){return this._Data}set Data(s){this._Data=s}Fill(s){return this._Data.find(r=>r._id==s)}};n.\u0275fac=function(r){return new(r||n)},n.\u0275prov=ie({token:n,factory:n.\u0275fac,providedIn:"root"});let o=n;return o})();var dt=()=>["/menu/log/order/detail"],pt=o=>({ID:o}),ct=o=>({"bg-warning":o});function ut(o,n){if(o&1&&(t(0,"span",22),w(1,"img",23),i(),l(2)),o&2){let a=n.item;m(),p("src",a.Img,V)("alt",a.Name),m(),P(" ",a.Name," ")}}function gt(o,n){o&1&&(t(0,"th",27)(1,"span",33),l(2," Response Body Warning "),i()())}function ht(o,n){o&1&&(t(0,"th")(1,"span",33),l(2," Number Override "),i()())}function ft(o,n){if(o&1&&(t(0,"td",27)(1,"span",36),l(2),i()()),o&2){let a=b().$implicit;m(),p("ngClass",q(2,ct,a.responseBodyWarning!=null)),m(),u(a.responseBodyWarning)}}function vt(o,n){if(o&1&&(t(0,"td"),l(1),i()),o&2){let a=b().$implicit;m(),P(" ",a.ResponseBodyWarningReference," ")}}function yt(o,n){if(o&1&&(t(0,"tr")(1,"td")(2,"a",34),l(3),x(4,"date"),i()(),t(5,"td"),l(6),i(),t(7,"td"),l(8),i(),t(9,"td"),l(10),i(),t(11,"td",27)(12,"span",35),l(13),i()(),y(14,ft,3,4,"td",29)(15,vt,2,1,"td",30),i()),o&2){let a=n.$implicit,s=b(2);m(2),p("routerLink",z(14,dt))("queryParams",q(15,pt,a.ID)),m(),P(" ",E(4,11,a.Created,"dd MMM yyyy HH:mm:ss")," "),m(3),u(a.MarketTypeString),m(2),u(a.POSActionTypeString),m(2),u(a.Number),m(2),De(a.ResponseCode===200||a.ResponseCode===202?"bg-success":"bg-warning"),m(),P(" ",a.ResponseCode," "),m(),p("ngIf",s.responseBodyWarningVisible),m(),p("ngIf",s.responseBodyWarningVisible)}}function _t(o,n){if(o&1){let a=L();F(0),t(1,"div",24)(2,"table",25)(3,"thead")(4,"tr",26)(5,"th"),l(6,"Date"),i(),t(7,"th"),l(8,"Channel"),i(),t(9,"th"),l(10,"Actions"),i(),t(11,"th"),l(12,"Number"),i(),t(13,"th",27)(14,"span",28),l(15," Response Code "),i()(),y(16,gt,3,0,"th",29)(17,ht,3,0,"th",30),i()(),t(18,"tbody"),y(19,yt,16,17,"tr",31),i()(),t(20,"mat-paginator",32),N("page",function(r){g(a);let e=b();return h(e.changePage(r))}),i()(),j()}if(o&2){let a=b();m(16),p("ngIf",a.responseBodyWarningVisible),m(),p("ngIf",a.responseBodyWarningVisible),m(2),p("ngForOf",a.Result),m(),p("length",a.paginationTotal)("pageSize",a.paginationPageSize)("pageIndex",(a.filter==null?null:a.filter.PageNumber)==0?0:(a.filter==null?null:a.filter.PageNumber)-1)}}function Ct(o,n){o&1&&(t(0,"div",37),w(1,"app-empty-state"),i())}var Qe=(()=>{let n=class n{constructor(s,r,e,c){this.http=s,this._RawLogService=r,this.route=e,this.authService=c,this.Result=Array(),this.filter={RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCode:"",From:"",To:"",responseBodyWarning:""},this.responseBodyWarningVisible=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.route.queryParams.subscribe(s=>{this.responseCode=s.responseCode,this.responseCode!=null?this.Load(s):this.Load()})}Load(s={}){this.http.post("/api/OrdersLoader/Get",s).subscribe(r=>{this.filter=r.Filter,this.ActionTypeList=r.Options.ActionTypeList,this.Get()})}Get(s){this.filter.Number=s,this.http.post("/api/Orders/Get",this.filter).subscribe(r=>{this._RawLogService.Data=r.hits,this.Result=Array();for(let e of r.hits){e._source.log.responseBodyWarning!=null&&(this.responseBodyWarningVisible=!0);let c={ID:e._id,Created:e._source["@timestamp_received"],shopId:e._source.shopId,MarketTypeString:e._source.log.type,POSActionTypeString:e._source.message,Number:e._source.log.number,ResponseCode:e._source.log.responseCode,responseBodyWarning:e._source.log.responseBodyWarning,ResponseBodyWarningReference:e._source.log.ResponseBodyWarningReference};this.Result.push(c)}this.paginationTotal=r.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(s){this.filter.PageNumber=s.pageIndex+1,this.Get()}};n.\u0275fac=function(r){return new(r||n)(f(M),f(A),f(B),f(de))},n.\u0275cmp=I({type:n,selectors:[["app-order"]],decls:43,vars:15,consts:[["EMPTY_STATE",""],["headerTitle","Order Log","searchBoxPlaceHolder","Invoice Number..",3,"textChange","onSubmit","text"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],["bindLabel","Value","name","ActionType","bindValue","Key","placeholder","Action Type",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","text","name","StatusCode",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","text","name","responseBodyWarning","list","listresponseBodyWarning",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["id","listresponseBodyWarning"],["value","number-override"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[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"],[1,"table","table-hover"],[1,"table-light"],[1,"text-center"],["matTooltip","Http Status Code from developer.dealpos.com."],["class","text-center",4,"ngIf"],[4,"ngIf"],[4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],["matTooltip","ex: when payload.Number != response.Number value will be number-override"],[3,"routerLink","queryParams"],[1,"text-white","p-2","rounded","response-desc"],[1,"text-white","p-2","rounded","response-desc",3,"ngClass"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(r,e){if(r&1){let c=L();t(0,"mainpanel",1),S("textChange",function(d){return g(c),C(e.Number,d)||(e.Number=d),h(d)}),N("onSubmit",function(d){return g(c),h(e.Get(d))}),t(1,"filters")(2,"div")(3,"label",2),l(4,"Channel"),i(),t(5,"ng-select",3),S("ngModelChange",function(d){return g(c),C(e.filter.ChannelID,d)||(e.filter.ChannelID=d),h(d)}),y(6,ut,3,3,"ng-template",4),i()(),t(7,"div",5)(8,"label",2),l(9,"Action"),i(),t(10,"ng-select",6),S("ngModelChange",function(d){return g(c),C(e.filter.ActionType,d)||(e.filter.ActionType=d),h(d)}),i()(),t(11,"div",5)(12,"label",7),l(13,"From/To"),i(),t(14,"div",8)(15,"datepicker",9),S("dateChange",function(d){return g(c),C(e.filter.From,d)||(e.filter.From=d),h(d)}),i()(),t(16,"div")(17,"datepicker",10),S("dateChange",function(d){return g(c),C(e.filter.To,d)||(e.filter.To=d),h(d)}),i()()(),t(18,"div",5)(19,"label",11),l(20,"Response Code"),i(),t(21,"input",12),S("ngModelChange",function(d){return g(c),C(e.filter.StatusCode,d)||(e.filter.StatusCode=d),h(d)}),i()(),t(22,"div",5)(23,"label",11),l(24,"Response Body Warning"),i(),t(25,"input",13),S("ngModelChange",function(d){return g(c),C(e.filter.responseBodyWarning,d)||(e.filter.responseBodyWarning=d),h(d)}),i(),t(26,"datalist",14),w(27,"option",15),i()(),t(28,"div",5)(29,"label",11),l(30,"Page Number"),i(),t(31,"input",16),S("ngModelChange",function(d){return g(c),C(e.filter.PageNumber,d)||(e.filter.PageNumber=d),h(d)}),i()(),t(32,"div",5)(33,"label",11),l(34,"Page Size"),i(),t(35,"input",17),S("ngModelChange",function(d){return g(c),C(e.filter.RowCount,d)||(e.filter.RowCount=d),h(d)}),i()()(),t(36,"content")(37,"div",18)(38,"div",19)(39,"div",20),y(40,_t,21,6,"ng-container",21)(41,Ct,2,0,"ng-template",null,0,U),i()()()()()}if(r&2){let c=H(42);_("text",e.Number),m(5),p("clearable",!0)("items",e.channelOptions),_("ngModel",e.filter.ChannelID),m(5),p("clearable",!0)("items",e.ActionTypeList),_("ngModel",e.filter.ActionType),m(5),_("date",e.filter.From),m(2),_("date",e.filter.To),m(4),_("ngModel",e.filter.StatusCode),m(4),_("ngModel",e.filter.responseBodyWarning),m(6),_("ngModel",e.filter.PageNumber),m(4),_("ngModel",e.filter.RowCount),m(5),p("ngIf",(e.Result==null?null:e.Result.length)>0)("ngIfElse",c)}},dependencies:[Ne,J,T,Oe,ke,ae,me,le,se,k,R,K,ue,pe,ce,Z,Y,Ae,D]});let o=n;return o})();var St=()=>["/menu/log/inventory/sync-inventory/detail"],bt=o=>({ID:o});function xt(o,n){if(o&1&&(t(0,"span",19),w(1,"img",20),i(),l(2)),o&2){let a=n.item;m(),p("src",a.Img,V)("alt",a.Name),m(),P(" ",a.Name," ")}}function wt(o,n){if(o&1&&(t(0,"tr")(1,"td")(2,"a",26),l(3),x(4,"date"),i()(),t(5,"td"),l(6),i(),t(7,"td"),l(8),i(),t(9,"td"),l(10),i(),t(11,"td"),l(12),i()()),o&2){let a=n.$implicit;m(2),p("routerLink",z(10,St))("queryParams",q(11,bt,a.ID)),m(),P(" ",E(4,7,a.Created,"dd MMM yyyy HH:mm")," "),m(3),u(a.channelName),m(2),u(a.Sku),m(2),u(a.Stock),m(2),u(a.ResponseCode)}}function It(o,n){if(o&1){let a=L();F(0),t(1,"div",21)(2,"table",22)(3,"thead")(4,"tr",23)(5,"th"),l(6,"Created"),i(),t(7,"th"),l(8,"Channel"),i(),t(9,"th"),l(10,"SKU"),i(),t(11,"th"),l(12,"Stock"),i(),t(13,"th"),l(14,"Response code"),i()()(),t(15,"tbody"),y(16,wt,13,13,"tr",24),i()(),t(17,"mat-paginator",25),N("page",function(r){g(a);let e=b();return h(e.changePage(r))}),i()(),j()}if(o&2){let a=b();m(16),p("ngForOf",a.Result),m(),p("length",a.paginationTotal)("pageSize",a.paginationPageSize)("pageIndex",(a.filter==null?null:a.filter.PageNumber)==0?0:(a.filter==null?null:a.filter.PageNumber)-1)}}function Et(o,n){o&1&&(t(0,"div",27),w(1,"app-empty-state"),i())}var Xe=(()=>{let n=class n{constructor(s,r,e){this.http=s,this._RawLogService=r,this.authService=e,this.Result=Array(),this.filter={PageNumber:0,RowCount:20,Sku:null,ChannelID:"",StatusCode:"",From:"",To:""},this.Load(),this.channelOptions=this.authService.getChannels()}Load(){this.http.post("/api/OrdersLoader/Get",{}).subscribe(s=>{this.filter=s.Filter,this.ActionTypeList=s.Options.ActionTypeList,this.Get()})}Get(s){s!=null&&(this.filter.Sku=s),this.http.post("api/Inventory/GetLog",this.filter).subscribe(r=>{this._RawLogService.Data=r.hits,this.Result=Array();for(let e of r.hits){let c={ID:e._source.log.id,Created:e._source["@timestamp_received"],channelName:e._source.log.channelName,Sku:e._source.log.sku,Stock:e._source.log.stock,ResponseCode:e._source.log.responseCode};this.Result.push(c)}this.paginationTotal=r.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(s){this.filter.PageNumber=s.pageIndex+1,this.Get()}};n.\u0275fac=function(r){return new(r||n)(f(M),f(A),f(de))},n.\u0275cmp=I({type:n,selectors:[["app-inventory-log"]],decls:33,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","Product Inventory Sync","searchBoxPlaceHolder","Enter SKU...",3,"textChange","onSubmit","text"],["role","button","routerLink","/menu/log/inventory",1,"btn","btn-success"],["container",""],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[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"],[1,"table","table-hover"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],[3,"routerLink","queryParams"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(r,e){if(r&1){let c=L();t(0,"mainpanel",1),S("textChange",function(d){return g(c),C(e.filter.Sku,d)||(e.filter.Sku=d),h(d)}),N("onSubmit",function(d){return g(c),h(e.Get(d))}),t(1,"actions")(2,"a",2),l(3," Async Inventory "),i()(),t(4,"filters")(5,"div",3)(6,"div")(7,"label",4),l(8,"Channel"),i(),t(9,"ng-select",5),S("ngModelChange",function(d){return g(c),C(e.filter.ChannelID,d)||(e.filter.ChannelID=d),h(d)}),y(10,xt,3,3,"ng-template",6),i()(),t(11,"div",7)(12,"label",8),l(13,"From/To"),i(),t(14,"div",9)(15,"datepicker",10),S("dateChange",function(d){return g(c),C(e.filter.From,d)||(e.filter.From=d),h(d)}),i()(),t(16,"div")(17,"datepicker",11),S("dateChange",function(d){return g(c),C(e.filter.To,d)||(e.filter.To=d),h(d)}),i()()(),t(18,"div",7)(19,"label",12),l(20,"Page Number"),i(),t(21,"input",13),S("ngModelChange",function(d){return g(c),C(e.filter.PageNumber,d)||(e.filter.PageNumber=d),h(d)}),i()(),t(22,"div",7)(23,"label",12),l(24,"Page Size"),i(),t(25,"input",14),S("ngModelChange",function(d){return g(c),C(e.filter.RowCount,d)||(e.filter.RowCount=d),h(d)}),i()()()(),t(26,"content")(27,"div",15)(28,"div",16)(29,"div",17),y(30,It,18,4,"ng-container",18)(31,Et,2,0,"ng-template",null,0,U),i()()()()()}if(r&2){let c=H(32);_("text",e.filter.Sku),m(9),p("clearable",!0)("items",e.channelOptions),_("ngModel",e.filter.ChannelID),m(6),_("date",e.filter.From),m(2),_("date",e.filter.To),m(4),_("ngModel",e.filter.PageNumber),m(4),_("ngModel",e.filter.RowCount),m(5),p("ngIf",(e.Result==null?null:e.Result.length)>0)("ngIfElse",c)}},dependencies:[J,T,ae,me,le,se,k,R,K,ue,pe,ce,Z,Y,D]});let o=n;return o})();var Tt=()=>["/menu/log/order/detail"],Dt=o=>({ID:o});function Mt(o,n){if(o&1&&(t(0,"span",17),w(1,"img",18),i(),l(2)),o&2){let a=n.item;m(),p("src",a.Img,V)("alt",a.Name),m(),P(" ",a.Name," ")}}function Rt(o,n){if(o&1&&(t(0,"tr")(1,"td")(2,"a",25),l(3),x(4,"date"),i()(),t(5,"td"),l(6),i(),t(7,"td"),l(8),i(),t(9,"td"),l(10),i()()),o&2){let a=n.$implicit;m(2),p("routerLink",z(9,Tt))("queryParams",q(10,Dt,a.id)),m(),P(" ",E(4,6,a.Created,"dd MMM yyyy HH:mm:ss")," "),m(3),u(a.type),m(2),u(a.number),m(2),u(a.message)}}function Nt(o,n){if(o&1){let a=L();F(0),t(1,"div",19)(2,"table",20)(3,"thead",21)(4,"tr")(5,"th",22),l(6,"Date"),i(),t(7,"th"),l(8,"Type"),i(),t(9,"th"),l(10,"Number"),i(),t(11,"th"),l(12,"Message"),i()()(),t(13,"tbody"),y(14,Rt,11,12,"tr",23),i()(),t(15,"mat-paginator",24),N("page",function(r){g(a);let e=b();return h(e.changePage(r))}),i()(),j()}if(o&2){let a=b();m(14),p("ngForOf",a.Result),m(),p("length",a.paginationTotal)("pageSize",a.paginationPageSize)("pageIndex",(a.filter==null?null:a.filter.PageNumber)==0?0:(a.filter==null?null:a.filter.PageNumber)-1)}}function Pt(o,n){o&1&&(t(0,"div",26),w(1,"app-empty-state"),i())}var $e=(()=>{let n=class n{constructor(s,r,e){this.http=s,this._RawLogService=r,this.authService=e,this.Result=Array(),this.filter={RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCode:"",From:"",To:""},this.list=[],this.Types=[{Key:0,Value:"Shopee"},{Key:1,Value:"Tokopedia"}],this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}Load(s={}){this.http.post("/api/OrdersLoader/Get",s).subscribe(r=>{this.filter=r.Filter,this.ActionTypeList=r.Options.ActionTypeList,this.Get()})}Get(s){this.filter.Number=s,this.http.post("api/Orders/GetRawLog",this.filter).subscribe(r=>{this._RawLogService.Data=r.hits,this.Result=Array();for(let e of r.hits){let c={id:e._id,message:e._source.message,responseCode:e._source.log.responseCode,processTypeString:e._source.log.processType,type:e._source.log.type,number:e._source.log.number,Created:e._source["@timestamp_received"]};this.Result.push(c)}this.paginationTotal=r.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(s){this.filter.PageNumber=s.pageIndex+1,this.Get()}};n.\u0275fac=function(r){return new(r||n)(f(M),f(A),f(de))},n.\u0275cmp=I({type:n,selectors:[["app-raw-log"]],decls:29,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","Channel Webhook Log","searchBoxPlaceHolder","Invoice Number..",3,"textChange","onSubmit","text"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[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"],[1,"table"],[1,"thead-light"],[2,"width","200px"],[4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],[3,"routerLink","queryParams"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(r,e){if(r&1){let c=L();t(0,"mainpanel",1),S("textChange",function(d){return g(c),C(e.filter.Number,d)||(e.filter.Number=d),h(d)}),N("onSubmit",function(d){return g(c),h(e.Get(d))}),t(1,"filters")(2,"div")(3,"label",2),l(4,"Channel"),i(),t(5,"ng-select",3),S("ngModelChange",function(d){return g(c),C(e.filter.ChannelID,d)||(e.filter.ChannelID=d),h(d)}),y(6,Mt,3,3,"ng-template",4),i()(),t(7,"div",5)(8,"label",6),l(9,"From/To"),i(),t(10,"div",7)(11,"datepicker",8),S("dateChange",function(d){return g(c),C(e.filter.From,d)||(e.filter.From=d),h(d)}),i()(),t(12,"div")(13,"datepicker",9),S("dateChange",function(d){return g(c),C(e.filter.To,d)||(e.filter.To=d),h(d)}),i()()(),t(14,"div",5)(15,"label",10),l(16,"Page Number"),i(),t(17,"input",11),S("ngModelChange",function(d){return g(c),C(e.filter.PageNumber,d)||(e.filter.PageNumber=d),h(d)}),i()(),t(18,"div",5)(19,"label",10),l(20,"Page Size"),i(),t(21,"input",12),S("ngModelChange",function(d){return g(c),C(e.filter.RowCount,d)||(e.filter.RowCount=d),h(d)}),i()()(),t(22,"content")(23,"div",13)(24,"div",14)(25,"div",15),y(26,Nt,16,4,"ng-container",16)(27,Pt,2,0,"ng-template",null,0,U),i()()()()()}if(r&2){let c=H(28);_("text",e.filter.Number),m(5),p("clearable",!0)("items",e.channelOptions),_("ngModel",e.filter.ChannelID),m(6),_("date",e.filter.From),m(2),_("date",e.filter.To),m(4),_("ngModel",e.filter.PageNumber),m(4),_("ngModel",e.filter.RowCount),m(5),p("ngIf",(e.Result==null?null:e.Result.length)>0)("ngIfElse",c)}},dependencies:[J,T,ae,me,le,se,k,R,K,ue,pe,ce,Z,Y,D]});let o=n;return o})();var Ce=class{constructor(n,a){this._document=a;let s=this._textarea=this._document.createElement("textarea"),r=s.style;r.position="fixed",r.top=r.opacity="0",r.left="-999em",s.setAttribute("aria-hidden","true"),s.value=n,s.readOnly=!0,(this._document.fullscreenElement||this._document.body).appendChild(s)}copy(){let n=this._textarea,a=!1;try{if(n){let s=this._document.activeElement;n.select(),n.setSelectionRange(0,n.value.length),a=this._document.execCommand("copy"),s&&s.focus()}}catch{}return a}destroy(){let n=this._textarea;n&&(n.remove(),this._textarea=void 0)}},Lt=(()=>{let n=class n{constructor(s){this._document=s}copy(s){let r=this.beginCopy(s),e=r.copy();return r.destroy(),e}beginCopy(s){return new Ce(s,this._document)}};n.\u0275fac=function(r){return new(r||n)(he(Re))},n.\u0275prov=ie({token:n,factory:n.\u0275fac,providedIn:"root"});let o=n;return o})(),Ot=new we("CDK_COPY_TO_CLIPBOARD_CONFIG"),et=(()=>{let n=class n{constructor(s,r,e){this._clipboard=s,this._ngZone=r,this.text="",this.attempts=1,this.copied=new Ee,this._pending=new Set,e&&e.attempts!=null&&(this.attempts=e.attempts)}copy(s=this.attempts){if(s>1){let r=s,e=this._clipboard.beginCopy(this.text);this._pending.add(e);let c=()=>{let v=e.copy();!v&&--r&&!this._destroyed?this._currentTimeout=this._ngZone.runOutsideAngular(()=>setTimeout(c,1)):(this._currentTimeout=null,this._pending.delete(e),e.destroy(),this.copied.emit(v))};c()}else this.copied.emit(this._clipboard.copy(this.text))}ngOnDestroy(){this._currentTimeout&&clearTimeout(this._currentTimeout),this._pending.forEach(s=>s.destroy()),this._pending.clear(),this._destroyed=!0}};n.\u0275fac=function(r){return new(r||n)(f(Lt),f(Te),f(Ot,8))},n.\u0275dir=Ie({type:n,selectors:[["","cdkCopyToClipboard",""]],hostBindings:function(r,e){r&1&&N("click",function(){return e.copy()})},inputs:{text:[0,"cdkCopyToClipboard","text"],attempts:[0,"cdkCopyToClipboardAttempts","attempts"]},outputs:{copied:"cdkCopyToClipboardCopied"},standalone:!0});let o=n;return o})(),tt=(()=>{let n=class n{};n.\u0275fac=function(r){return new(r||n)},n.\u0275mod=oe({type:n}),n.\u0275inj=ne({});let o=n;return o})();function Wt(o,n){o&1&&w(0,"img",21)}function Vt(o,n){o&1&&w(0,"img",22)}function Bt(o,n){if(o&1&&(t(0,"div",4)(1,"div",5)(2,"div",6)(3,"h5"),l(4,"General"),i()(),t(5,"div",7)(6,"div",2)(7,"div",8)(8,"div",9)(9,"label"),l(10,"Date"),i(),t(11,"div")(12,"span"),l(13),x(14,"date"),i()()()(),t(15,"div",10)(16,"div",9)(17,"label"),l(18,"Market Place Type"),i(),y(19,Wt,1,0,"img",11)(20,Vt,1,0,"img",12),t(21,"a",13)(22,"span",14),l(23),i(),w(24,"br"),t(25,"small",15),l(26),i()()()(),t(27,"div",10)(28,"div",9)(29,"label"),l(30,"Number"),i(),t(31,"div")(32,"span"),l(33),i()()()(),t(34,"div",8)(35,"div",9)(36,"label"),l(37,"Process Type"),i(),t(38,"div")(39,"span"),l(40),i()()()(),t(41,"div",4)(42,"div",9)(43,"label"),l(44,"Authorization Header"),i(),t(45,"div")(46,"span"),l(47),i()()()(),t(48,"div",16)(49,"div",5)(50,"div",17)(51,"div",18)(52,"h3"),l(53,"Request"),i()(),t(54,"div",19)(55,"button",20),l(56,"Copy to clipboard"),i()()(),t(57,"div",7),l(58),i()()()()()()()),o&2){let a=b();m(13),u(E(14,11,a.data.Created,"dd MMM yyyy HH:mm:ss")),m(6),p("ngIf",a.data.TypeID==1),m(),p("ngIf",a.data.TypeID==0),m(),Me("href",a.data.ShopLink,V),m(2),u(a.data.ShopName),m(3),u(a.data.ShopLink),m(7),u(a.data._source.log.number),m(7),u(a.data._source.log.processType),m(7),u(a.data._source.log.authorizationHeader),m(8),p("cdkCopyToClipboard",a.data._source.log.request),m(3),P(" ",a.data._source.log.request," ")}}var it=(()=>{let n=class n{constructor(s,r,e){this.route=s,this.http=r,this._RawLogService=e,this.route.queryParams.subscribe(c=>{let v=JSON.parse(localStorage.getItem("channel"));if(this.ID=c.ID,this.data=this._RawLogService.Fill(this.ID),this.data.Created=this.data._source["@timestamp_received"],v.length>0){let d=v.find(mt=>mt.ShopID==this.data._source.shopId);d?(this.data.TypeID=d.TypeID,this.data.ShopName=d.Name,this.data.ShopLink=d.URL):(this.data.TypeID=null,this.data.ShopName=null,this.data.ShopLink=null)}})}ngOnInit(){}};n.\u0275fac=function(r){return new(r||n)(f(B),f(M),f(A))},n.\u0275cmp=I({type:n,selectors:[["app-raw-detail"]],decls:5,vars:4,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],[1,"container-fluid","mt-2"],[1,"row"],["class","col-sm-12",4,"ngIf"],[1,"col-sm-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"col-sm-2"],[1,"info-label-group"],[1,"col-sm-4"],["class","me-2","src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",4,"ngIf"],["class","me-2","src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",4,"ngIf"],["target","_blank",3,"href"],[1,"fw-bold"],[1,"text-dark"],[1,"col-sm-12","mt-2"],[1,"card-header","d-lg-flex"],[1,"me-auto"],[1,"d-sm-block","mt-2"],[3,"cdkCopyToClipboard"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",1,"me-2"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",1,"me-2"]],template:function(r,e){r&1&&(t(0,"mainpanel",0)(1,"content")(2,"div",1)(3,"div",2),y(4,Bt,59,14,"div",3),i()()()()),r&2&&(p("headerTitle","Request Raw Log Detail")("hideSearchBox",!0)("hideSearchDropdown",!0),m(4),p("ngIf",e.data))},dependencies:[T,R,et,D]});let o=n;return o})();function At(o,n){if(o&1&&(t(0,"div",10)(1,"div",7)(2,"div",8)(3,"h5"),l(4,"General"),i()(),t(5,"div",9)(6,"div",3)(7,"div",6)(8,"div",12)(9,"label"),l(10,"Date"),i(),t(11,"div")(12,"span"),l(13),x(14,"date"),i()()()(),t(15,"div",6)(16,"div",12)(17,"label"),l(18,"SKU"),i(),t(19,"div")(20,"span"),l(21),i()()()(),t(22,"div",6)(23,"div",12)(24,"label"),l(25,"Channel"),i(),t(26,"div")(27,"span"),l(28),i()()()(),t(29,"div",6)(30,"div",12)(31,"label"),l(32,"Response Code"),i(),t(33,"div")(34,"span"),l(35),i()()()()()()()()),o&2){let a=b();m(13),u(E(14,4,a.data.Created,"dd MMM yyyy")),m(8),u(a.data.Sku),m(7),u(a.data.ChannelName),m(7),u(a.data.ResponseCode)}}var nt=(()=>{let n=class n{constructor(s,r,e){this.route=s,this.http=r,this._RawLogService=e,this.data={Created:"",Sku:"",ChannelName:"",ResponseCode:""},this.route.queryParams.subscribe(c=>{this.ID=c.ID,this.Load()})}ngOnInit(){}Load(){var s={ID:this.ID};this.http.post("/api/Inventory/GetInventoryLogDeatil",s).subscribe(r=>{this.data.Created=r.hits[0]._source["@timestamp_received"],this.data.Sku=r.hits[0]._source.log.sku,this.data.ChannelName=r.hits[0]._source.log.channelName,this.data.ResponseCode=r.hits[0]._source.log.responseCode,this.request=X.IsNotEmpty(r.hits[0]?._source.log?.request)?JSON.parse(r.hits[0]?._source?.log?.request):"",this.response=r.hits[0]._source.log.response})}};n.\u0275fac=function(r){return new(r||n)(f(B),f(M),f(A))},n.\u0275cmp=I({type:n,selectors:[["app-inventory-detail"]],decls:30,vars:7,consts:[["headerTitle","Product Inventory Sync Detail",3,"hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/inventory/sync-inventory",1,"btn","btn-secondary","btn-fill","btn-lg","me-2"],[1,"container-fluid","mt-3"],[1,"row"],["class","col-sm-12",4,"ngIf"],[1,"row","mt-2"],[1,"col-sm-6"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group"],[1,"info-label-group"]],template:function(r,e){r&1&&(t(0,"mainpanel",0)(1,"actions")(2,"a",1),l(3,"Back"),i()(),t(4,"content")(5,"div",2)(6,"div",3),y(7,At,36,7,"div",4),i(),t(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"h5"),l(13,"Request"),i()(),t(14,"div",9)(15,"div",10)(16,"div",11)(17,"pre"),l(18),x(19,"json"),i()()()()()(),t(20,"div",6)(21,"div",7)(22,"div",8)(23,"h5"),l(24,"Response"),i()(),t(25,"div",9)(26,"div",10)(27,"div",11)(28,"pre"),l(29),i()()()()()()()()()()),r&2&&(p("hideSearchBox",!0)("hideSearchDropdown",!0),m(7),p("ngIf",e.data),m(11),u(G(19,5,e.request)),m(11),u(e.response))},dependencies:[T,k,R,re,D]});let o=n;return o})();function Ft(o,n){if(o&1&&(t(0,"div",9)(1,"div",10)(2,"label"),l(3,"Process Code"),i(),t(4,"div")(5,"span"),l(6),i()()()()),o&2){let a=b();m(6),u(a.ProcessedCode)}}function jt(o,n){if(o&1){let a=L();t(0,"a",16),N("click",function(){g(a);let r=b();return h(r.Retry())}),l(1,"Retry"),i()}}var ot=(()=>{let n=class n{constructor(s,r){this.route=s,this.http=r,this.ProcessDuration=0,this.request="",this.response="",this.route.queryParams.subscribe(e=>{this.ID=e.ID,this.Load()})}Retry(){var s={Number:this.Number,ShopID:this.shopId};this.http.post("/api/Orders/Retry",s).subscribe(r=>{alert(JSON.stringify(r))})}Load(){var s={ID:this.ID};this.http.post("/api/Orders/GetDetail",s).subscribe(r=>{for(let e of r.hits)this.Number=e._source.log.number,this.MarketTypeString=e._source.log.type,this.ResponseCode=e._source.log.responseCode,this.POSActionTypeString=e._source.message,this.ProcessDuration=0,this.Created=e._source["@timestamp_received"],this.request=X.IsNotEmpty(e._source?.log?.request)?JSON.parse(e._source.log?.request):"",this.response=X.IsNotEmpty(e._source?.log?.response)?JSON.parse(e._source.log?.response):"",this.shopId=e._source.shopId,this.ProcessedCode=e._source.log.processedCode})}};n.\u0275fac=function(r){return new(r||n)(f(B),f(M))},n.\u0275cmp=I({type:n,selectors:[["app-orderdetail"]],decls:83,vars:21,consts:[[3,"headerTitle","pageData","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/order",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-sm-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"row","mt-7"],[1,"col-sm-6"],[1,"info-label-group"],["class","col-sm-6",4,"ngIf"],[1,"row","mt-2"],[1,"form-group"],[1,"float-right"],["role","button","class","btn btn-success btn-fill btn-lg me-3",3,"click",4,"ngIf"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","me-3",3,"click"]],template:function(r,e){r&1&&(t(0,"mainpanel",0)(1,"actions")(2,"a",1),l(3,"Back"),i()(),t(4,"content")(5,"div",2)(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"h5"),l(11,"General"),i()(),t(12,"div",7)(13,"div",8)(14,"div",9)(15,"div",10)(16,"label"),l(17,"Date"),i(),t(18,"div")(19,"span"),l(20),x(21,"date"),i()()()(),t(22,"div",9)(23,"div",10)(24,"label"),l(25,"Number"),i(),t(26,"div")(27,"span"),l(28),i()()()(),t(29,"div",9)(30,"div",10)(31,"label"),l(32,"Type"),i(),t(33,"div")(34,"span"),l(35),i()()()(),t(36,"div",9)(37,"div",10)(38,"label"),l(39,"Response Code"),i(),t(40,"div")(41,"span"),l(42),i()()()(),t(43,"div",9)(44,"div",10)(45,"label"),l(46,"ShopID"),i(),t(47,"div")(48,"span"),l(49),i()()()(),y(50,Ft,7,1,"div",11),t(51,"div",9)(52,"div",10)(53,"label"),l(54,"Action"),i(),t(55,"div")(56,"span"),l(57),i()()()()()()()()(),t(58,"div",12)(59,"div",9)(60,"div",5)(61,"div",6)(62,"h5"),l(63,"Request"),i()(),t(64,"div",7)(65,"div",4)(66,"div",13)(67,"pre"),l(68),x(69,"json"),i()()(),t(70,"actions",14),y(71,jt,2,0,"a",15),i()()()(),t(72,"div",9)(73,"div",5)(74,"div",6)(75,"h5"),l(76,"Response"),i()(),t(77,"div",7)(78,"div",4)(79,"div",13)(80,"pre"),l(81),x(82,"json"),i()()()()()()()()()()),r&2&&(p("headerTitle","Order #"+e.Number)("pageData","Orders Detail ")("hideSearchBox",!0)("hideSearchDropdown",!0),m(20),u(E(21,14,e.Created,"dd MMM yyyy HH:mm:ss")),m(8),u(e.Number),m(7),u(e.MarketTypeString),m(7),u(e.ResponseCode),m(7),u(e.shopId),m(),p("ngIf",e.ProcessedCode!=null),m(7),u(e.POSActionTypeString),m(11),u(G(69,17,e.request)),m(3),p("ngIf",e.ResponseCode!="200"&&e.ResponseCode!="201"),m(10),u(G(82,19,e.response)))},dependencies:[T,k,R,re,D]});let o=n;return o})();var qt=()=>["/menu/log/exception/detail"],Ht=o=>({ID:o});function zt(o,n){if(o&1&&(t(0,"tr")(1,"td",12),w(2,"img",13),i(),t(3,"td"),l(4),x(5,"date"),i(),t(6,"td")(7,"a",14),l(8),i()(),t(9,"td")(10,"div",15),l(11),i(),t(12,"div"),l(13),i()()()),o&2){let a=n.$implicit;m(2),p("src",a.logo,V),m(2),u(E(5,7,a.date,"dd-MM-yyyy hh:mm:ss")),m(3),p("routerLink",z(10,qt))("queryParams",q(11,Ht,a.id)),m(),P(" ",a.number," "),m(3),u(a.message),m(2),u(a.stackTrace)}}function Gt(o,n){if(o&1){let a=L();F(0),t(1,"mat-paginator",16),N("page",function(r){g(a);let e=b(2);return h(e.onPaginationChange(r))}),i(),j()}if(o&2){let a=b(2);m(),p("length",a.pageTotal)("pageSize",a.pageSize)("pageIndex",(a.filter==null?null:a.filter.PageNumber)==0?0:(a.filter==null?null:a.filter.PageNumber)-1)}}function Ut(o,n){if(o&1&&(F(0),t(1,"div",6)(2,"table",7)(3,"thead")(4,"tr",8)(5,"th"),l(6,"Channel"),i(),t(7,"th",9),l(8,"Date"),i(),t(9,"th"),l(10,"Number"),i(),t(11,"th"),l(12,"Exception"),i()()(),t(13,"tbody"),y(14,zt,14,13,"tr",10),i()(),y(15,Gt,2,3,"ng-container",11),i(),j()),o&2){let a=b();m(14),p("ngForOf",a.exceptions),m(),p("ngIf",(a.exceptions==null?null:a.exceptions.length)>0)}}function Jt(o,n){o&1&&(t(0,"div",17),w(1,"app-empty-state"),i())}var rt=(()=>{let n=class n{constructor(s){this.http=s,this.exceptions=[],this.filter={RowCount:50,PageNumber:1},this.getData()}getData(){this.http.post("/api/Orders/GetExceptionList",this.filter).subscribe(s=>{this.exceptions=s.hits.map(r=>({id:r._id,logo:X.getChannelLogoByName(r._source.error?.Type),number:r._source.error.number,date:r._source["@timestamp_received"],stackTrace:r._source.error.stackTrace,message:r._source.message,requestJSON:r._source?.error?.requestJSON})),this.pageTotal=s.total.value,this.pageSize=this.filter.RowCount>this.pageTotal?this.pageTotal:this.filter.RowCount})}onPaginationChange(s){this.filter.PageNumber=s.pageIndex+1,this.getData()}};n.\u0275fac=function(r){return new(r||n)(f(M))},n.\u0275cmp=I({type:n,selectors:[["app-exception-log"]],decls:8,vars:2,consts:[["EMPTY_STATE",""],["headerTitle","Exception Log","searchBoxPlaceHolder","Enter Number...","hideSearchBox","true","hideSearchDropdown","true"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[2,"width","140px"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"text-center"],[2,"width","25px",3,"src"],[3,"routerLink","queryParams"],[1,"fw-bold"],[3,"page","length","pageSize","pageIndex"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(r,e){if(r&1&&(t(0,"mainpanel",1)(1,"content")(2,"div",2)(3,"div",3)(4,"div",4),y(5,Ut,16,2,"ng-container",5)(6,Jt,2,0,"ng-template",null,0,U),i()()()()()),r&2){let c=H(7);m(5),p("ngIf",e.exceptions.length>0)("ngIfElse",c)}},dependencies:[J,T,k,R,K,Y,D]});let o=n;return o})();var at=(()=>{let n=class n{constructor(s){this.httpService=s}getExceptionDetail(s){return this.httpService.post("/api/Orders/GetDetailException",{ID:s}).pipe(Se(e=>e?.hits[0]?._source))}};n.\u0275fac=function(r){return new(r||n)(he(M))},n.\u0275prov=ie({token:n,factory:n.\u0275fac,providedIn:"root"});let o=n;return o})();function Kt(o,n){if(o&1&&(t(0,"div",2)(1,"div",3)(2,"div",4)(3,"div",5)(4,"div",6)(5,"h5"),l(6,"General"),i()(),t(7,"div",7)(8,"div",8)(9,"div",9)(10,"div",10)(11,"label"),l(12,"Date"),i(),t(13,"div")(14,"span"),l(15),x(16,"date"),i()()()(),t(17,"div",9)(18,"div",10)(19,"label"),l(20,"Number"),i(),t(21,"div")(22,"span"),l(23),i()()()(),t(24,"div",9)(25,"div",10)(26,"label"),l(27,"Type"),i(),t(28,"div")(29,"span"),l(30),i()()()(),t(31,"div",9)(32,"div",10)(33,"label"),l(34,"ShopID"),i(),t(35,"div")(36,"span"),l(37),i()()()()()()()()(),t(38,"div",11)(39,"div",9)(40,"div",5)(41,"div",6)(42,"h5"),l(43,"Request"),i()(),t(44,"div",7)(45,"div",12)(46,"div",13)(47,"pre"),l(48),x(49,"json"),i()()()()()(),t(50,"div",9)(51,"div",5)(52,"div",6)(53,"h5"),l(54,"Exception"),i()(),t(55,"div",7)(56,"div",14)(57,"div",13)(58,"div",15),l(59),i(),t(60,"pre"),l(61),i()()()()()()()()),o&2){let a=n.ngIf;m(15),u(E(16,7,a["@timestamp"],"dd MMM yyyy HH:mm:ss")),m(8),u(a==null||a.error==null?null:a.error.number),m(7),u(a==null||a.error==null?null:a.error.Type),m(7),u(a==null?null:a.shopId),m(11),u(G(49,10,a==null||a.error==null?null:a.error.requestJSON)),m(11),u(a==null?null:a.message),m(2),u(a==null||a.error==null?null:a.error.stackTrace)}}var lt=(()=>{let n=class n{constructor(s,r){this.activatedRoute=s,this.exceptionService=r,this.invoiceNumber=""}ngOnInit(){let s=this.activatedRoute.snapshot.queryParams;this.getExceptionDetail(s?.ID)}getExceptionDetail(s){this.exceptionDetail$=this.exceptionService.getExceptionDetail(s).pipe(xe(r=>{this.invoiceNumber=r?.error?.number}),be(1))}};n.\u0275fac=function(r){return new(r||n)(f(B),f(at))},n.\u0275cmp=I({type:n,selectors:[["app-exception-detail"]],decls:4,vars:6,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["class","container-fluid mt-3",4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"row","mt-7"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-2"],[1,"col-sm-12"],[1,"form-group"],[1,"col-sm-12","mt-2"],[1,"fw-bold"]],template:function(r,e){r&1&&(t(0,"mainpanel",0)(1,"content"),y(2,Kt,62,12,"div",1),x(3,"async"),i()()),r&2&&(p("headerTitle","Order #"+e.invoiceNumber)("hideSearchBox",!0)("hideSearchDropdown",!0),m(2),p("ngIf",G(3,4,e.exceptionDetail$)))},dependencies:[T,R,Pe,re,D]});let o=n;return o})();var Zt=[{path:"",component:Ue,children:[{path:"",redirectTo:"order",pathMatch:"full"},{path:"order",component:Qe,canActivate:[W],data:{title:"Order Log"}},{path:"inventory/sync-inventory",component:Xe,canActivate:[W],data:{title:"Product Inventory Sync"}},{path:"rawlog",component:$e,canActivate:[W],data:{title:"Raw Log"}},{path:"rawlog/detail",component:it,canActivate:[W],data:{title:"Raw Log Detail"}},{path:"inventory/sync-inventory/detail",component:nt,canActivate:[W],data:{title:"Product Inventory Sync Detail"}},{path:"order/detail",component:ot,canActivate:[W],data:{title:"Order Details"}},{path:"exception",component:rt,canActivate:[W],data:{title:"Exception Log"}},{path:"exception/detail",component:lt,canActivate:[W],data:{title:"Exception Log Detail"}},{path:"inventory",loadComponent:()=>import("./chunk-T32TE7CZ.js").then(o=>o.InventoryAsyncLogComponent),canActivate:[W],data:{title:"Product Inventory Sync"}},{path:"inventory/detail",loadComponent:()=>import("./chunk-Z6PE5TYH.js").then(o=>o.InventoryAsyncDetailComponent),canActivate:[W],data:{title:"Product Inventory Sync Detail"}},{path:"authorization-log",loadComponent(){return import("./chunk-XVF5C6K3.js").then(o=>o.ChannelLogComponent)},canActivate:[W],data:{title:"Authorization Log"}}]}],st=(()=>{let n=class n{};n.\u0275fac=function(r){return new(r||n)},n.\u0275mod=oe({type:n}),n.\u0275inj=ne({imports:[fe,ve.forChild(Zt)]});let o=n;return o})();var gn=(()=>{let n=class n{};n.\u0275fac=function(r){return new(r||n)},n.\u0275mod=oe({type:n}),n.\u0275inj=ne({imports:[fe,We,Ve,st,ve,je,tt,ze,Be,He,Z,Fe,Ge]});let o=n;return o})();export{gn as LogsModule};
|
|
1
|
+
import{a as Ge}from"./chunk-GWLH7XX3.js";import{a as Z}from"./chunk-J5D7PMX5.js";import"./chunk-6U6JR5K6.js";import{a as Y}from"./chunk-RENQ3YZH.js";import{a as qe,b as He}from"./chunk-N3TTJVBG.js";import"./chunk-MY4B7K3R.js";import"./chunk-LB6JFX4H.js";import"./chunk-FGPSBTFS.js";import"./chunk-ADRVUMMW.js";import{a as K,b as ze}from"./chunk-WT6W7RAQ.js";import"./chunk-BQ7NR3ET.js";import{a as W}from"./chunk-2KRLACOJ.js";import"./chunk-FMV4LYKN.js";import"./chunk-HCDKYABV.js";import{a as pe,b as ce,d as ue,e as Be}from"./chunk-CCXKODFV.js";import{i as de}from"./chunk-F3MM4SRD.js";import{e as M}from"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import{m as R,n as je}from"./chunk-BO4PPSB5.js";import{t as Ae,u as Fe}from"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{c as ae,h as le,m as se,o as me,t as Oe,u as ke,y as We,z as Ve}from"./chunk-BSN7ZAXG.js";import{c as X}from"./chunk-64G3XLI6.js";import{m as B,n as Le,p as k,r as ve}from"./chunk-OVEJFFL6.js";import{$b as N,Ad as re,Cd as fe,Da as g,Ea as h,Eb as y,Gb as p,Gc as x,Hc as G,Ic as E,Jc as U,Kb as De,Pa as Ee,Sb as t,Tb as i,Ub as w,Vb as F,Wb as j,Yb as L,Z as be,bc as b,ea as xe,ec as Me,gb as V,ja as ie,jb as m,ka as ne,kb as f,ld as Re,ma as we,mc as H,nc as l,oa as he,oc as u,pc as P,rc as _,sb as Te,sc as C,sd as Ne,ta as I,tc as S,ua as oe,ud as J,v as Se,va as Ie,vd as T,wc as z,xc as q,yd as Pe,zd as D}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var Ue=(()=>{let n=class n{constructor(){this.ObjectlogTabs=[{Title:"Sync Order",Url:"/menu/log/order"},{Title:"Inventory Sync ",Url:"/menu/log/inventory"},{Title:"Channel Webhook",Url:"/menu/log/rawlog"},{Title:"Channel Webhook Exception ",Url:"/menu/log/exception"},{Title:"Authorization Log ",Url:"/menu/log/authorization-log"}]}};n.\u0275fac=function(r){return new(r||n)},n.\u0275cmp=I({type:n,selectors:[["app-logs"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(r,e){r&1&&(t(0,"nav",0)(1,"div",1)(2,"div"),w(3,"nav-tab",2),i()()(),w(4,"router-outlet")),r&2&&(m(3),p("Tabs",e.ObjectlogTabs))},dependencies:[Le,qe]});let o=n;return o})();var A=(()=>{let n=class n{constructor(){}get Data(){return this._Data}set Data(s){this._Data=s}Fill(s){return this._Data.find(r=>r._id==s)}};n.\u0275fac=function(r){return new(r||n)},n.\u0275prov=ie({token:n,factory:n.\u0275fac,providedIn:"root"});let o=n;return o})();var dt=()=>["/menu/log/order/detail"],pt=o=>({ID:o}),ct=o=>({"bg-warning":o});function ut(o,n){if(o&1&&(t(0,"span",22),w(1,"img",23),i(),l(2)),o&2){let a=n.item;m(),p("src",a.Img,V)("alt",a.Name),m(),P(" ",a.Name," ")}}function gt(o,n){o&1&&(t(0,"th",27)(1,"span",33),l(2," Response Body Warning "),i()())}function ht(o,n){o&1&&(t(0,"th")(1,"span",33),l(2," Number Override "),i()())}function ft(o,n){if(o&1&&(t(0,"td",27)(1,"span",36),l(2),i()()),o&2){let a=b().$implicit;m(),p("ngClass",q(2,ct,a.responseBodyWarning!=null)),m(),u(a.responseBodyWarning)}}function vt(o,n){if(o&1&&(t(0,"td"),l(1),i()),o&2){let a=b().$implicit;m(),P(" ",a.ResponseBodyWarningReference," ")}}function yt(o,n){if(o&1&&(t(0,"tr")(1,"td")(2,"a",34),l(3),x(4,"date"),i()(),t(5,"td"),l(6),i(),t(7,"td"),l(8),i(),t(9,"td"),l(10),i(),t(11,"td",27)(12,"span",35),l(13),i()(),y(14,ft,3,4,"td",29)(15,vt,2,1,"td",30),i()),o&2){let a=n.$implicit,s=b(2);m(2),p("routerLink",z(14,dt))("queryParams",q(15,pt,a.ID)),m(),P(" ",E(4,11,a.Created,"dd MMM yyyy HH:mm:ss")," "),m(3),u(a.MarketTypeString),m(2),u(a.POSActionTypeString),m(2),u(a.Number),m(2),De(a.ResponseCode===200||a.ResponseCode===202?"bg-success":"bg-warning"),m(),P(" ",a.ResponseCode," "),m(),p("ngIf",s.responseBodyWarningVisible),m(),p("ngIf",s.responseBodyWarningVisible)}}function _t(o,n){if(o&1){let a=L();F(0),t(1,"div",24)(2,"table",25)(3,"thead")(4,"tr",26)(5,"th"),l(6,"Date"),i(),t(7,"th"),l(8,"Channel"),i(),t(9,"th"),l(10,"Actions"),i(),t(11,"th"),l(12,"Number"),i(),t(13,"th",27)(14,"span",28),l(15," Response Code "),i()(),y(16,gt,3,0,"th",29)(17,ht,3,0,"th",30),i()(),t(18,"tbody"),y(19,yt,16,17,"tr",31),i()(),t(20,"mat-paginator",32),N("page",function(r){g(a);let e=b();return h(e.changePage(r))}),i()(),j()}if(o&2){let a=b();m(16),p("ngIf",a.responseBodyWarningVisible),m(),p("ngIf",a.responseBodyWarningVisible),m(2),p("ngForOf",a.Result),m(),p("length",a.paginationTotal)("pageSize",a.paginationPageSize)("pageIndex",(a.filter==null?null:a.filter.PageNumber)==0?0:(a.filter==null?null:a.filter.PageNumber)-1)}}function Ct(o,n){o&1&&(t(0,"div",37),w(1,"app-empty-state"),i())}var Qe=(()=>{let n=class n{constructor(s,r,e,c){this.http=s,this._RawLogService=r,this.route=e,this.authService=c,this.Result=Array(),this.filter={RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCode:"",From:"",To:"",responseBodyWarning:""},this.responseBodyWarningVisible=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.route.queryParams.subscribe(s=>{this.responseCode=s.responseCode,this.responseCode!=null?this.Load(s):this.Load()})}Load(s={}){this.http.post("/api/OrdersLoader/Get",s).subscribe(r=>{this.filter=r.Filter,this.ActionTypeList=r.Options.ActionTypeList,this.Get()})}Get(s){this.filter.Number=s,this.http.post("/api/Orders/Get",this.filter).subscribe(r=>{this._RawLogService.Data=r.hits,this.Result=Array();for(let e of r.hits){e._source.log.responseBodyWarning!=null&&(this.responseBodyWarningVisible=!0);let c={ID:e._id,Created:e._source["@timestamp_received"],shopId:e._source.shopId,MarketTypeString:e._source.log.type,POSActionTypeString:e._source.message,Number:e._source.log.number,ResponseCode:e._source.log.responseCode,responseBodyWarning:e._source.log.responseBodyWarning,ResponseBodyWarningReference:e._source.log.ResponseBodyWarningReference};this.Result.push(c)}this.paginationTotal=r.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(s){this.filter.PageNumber=s.pageIndex+1,this.Get()}};n.\u0275fac=function(r){return new(r||n)(f(M),f(A),f(B),f(de))},n.\u0275cmp=I({type:n,selectors:[["app-order"]],decls:43,vars:15,consts:[["EMPTY_STATE",""],["headerTitle","Order Log","searchBoxPlaceHolder","Invoice Number..",3,"textChange","onSubmit","text"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],["bindLabel","Value","name","ActionType","bindValue","Key","placeholder","Action Type",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","text","name","StatusCode",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","text","name","responseBodyWarning","list","listresponseBodyWarning",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["id","listresponseBodyWarning"],["value","number-override"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[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"],[1,"table","table-hover"],[1,"table-light"],[1,"text-center"],["matTooltip","Http Status Code from developer.dealpos.com."],["class","text-center",4,"ngIf"],[4,"ngIf"],[4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],["matTooltip","ex: when payload.Number != response.Number value will be number-override"],[3,"routerLink","queryParams"],[1,"text-white","p-2","rounded","response-desc"],[1,"text-white","p-2","rounded","response-desc",3,"ngClass"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(r,e){if(r&1){let c=L();t(0,"mainpanel",1),S("textChange",function(d){return g(c),C(e.Number,d)||(e.Number=d),h(d)}),N("onSubmit",function(d){return g(c),h(e.Get(d))}),t(1,"filters")(2,"div")(3,"label",2),l(4,"Channel"),i(),t(5,"ng-select",3),S("ngModelChange",function(d){return g(c),C(e.filter.ChannelID,d)||(e.filter.ChannelID=d),h(d)}),y(6,ut,3,3,"ng-template",4),i()(),t(7,"div",5)(8,"label",2),l(9,"Action"),i(),t(10,"ng-select",6),S("ngModelChange",function(d){return g(c),C(e.filter.ActionType,d)||(e.filter.ActionType=d),h(d)}),i()(),t(11,"div",5)(12,"label",7),l(13,"From/To"),i(),t(14,"div",8)(15,"datepicker",9),S("dateChange",function(d){return g(c),C(e.filter.From,d)||(e.filter.From=d),h(d)}),i()(),t(16,"div")(17,"datepicker",10),S("dateChange",function(d){return g(c),C(e.filter.To,d)||(e.filter.To=d),h(d)}),i()()(),t(18,"div",5)(19,"label",11),l(20,"Response Code"),i(),t(21,"input",12),S("ngModelChange",function(d){return g(c),C(e.filter.StatusCode,d)||(e.filter.StatusCode=d),h(d)}),i()(),t(22,"div",5)(23,"label",11),l(24,"Response Body Warning"),i(),t(25,"input",13),S("ngModelChange",function(d){return g(c),C(e.filter.responseBodyWarning,d)||(e.filter.responseBodyWarning=d),h(d)}),i(),t(26,"datalist",14),w(27,"option",15),i()(),t(28,"div",5)(29,"label",11),l(30,"Page Number"),i(),t(31,"input",16),S("ngModelChange",function(d){return g(c),C(e.filter.PageNumber,d)||(e.filter.PageNumber=d),h(d)}),i()(),t(32,"div",5)(33,"label",11),l(34,"Page Size"),i(),t(35,"input",17),S("ngModelChange",function(d){return g(c),C(e.filter.RowCount,d)||(e.filter.RowCount=d),h(d)}),i()()(),t(36,"content")(37,"div",18)(38,"div",19)(39,"div",20),y(40,_t,21,6,"ng-container",21)(41,Ct,2,0,"ng-template",null,0,U),i()()()()()}if(r&2){let c=H(42);_("text",e.Number),m(5),p("clearable",!0)("items",e.channelOptions),_("ngModel",e.filter.ChannelID),m(5),p("clearable",!0)("items",e.ActionTypeList),_("ngModel",e.filter.ActionType),m(5),_("date",e.filter.From),m(2),_("date",e.filter.To),m(4),_("ngModel",e.filter.StatusCode),m(4),_("ngModel",e.filter.responseBodyWarning),m(6),_("ngModel",e.filter.PageNumber),m(4),_("ngModel",e.filter.RowCount),m(5),p("ngIf",(e.Result==null?null:e.Result.length)>0)("ngIfElse",c)}},dependencies:[Ne,J,T,Oe,ke,ae,me,le,se,k,R,K,ue,pe,ce,Z,Y,Ae,D]});let o=n;return o})();var St=()=>["/menu/log/inventory/sync-inventory/detail"],bt=o=>({ID:o});function xt(o,n){if(o&1&&(t(0,"span",19),w(1,"img",20),i(),l(2)),o&2){let a=n.item;m(),p("src",a.Img,V)("alt",a.Name),m(),P(" ",a.Name," ")}}function wt(o,n){if(o&1&&(t(0,"tr")(1,"td")(2,"a",26),l(3),x(4,"date"),i()(),t(5,"td"),l(6),i(),t(7,"td"),l(8),i(),t(9,"td"),l(10),i(),t(11,"td"),l(12),i()()),o&2){let a=n.$implicit;m(2),p("routerLink",z(10,St))("queryParams",q(11,bt,a.ID)),m(),P(" ",E(4,7,a.Created,"dd MMM yyyy HH:mm")," "),m(3),u(a.channelName),m(2),u(a.Sku),m(2),u(a.Stock),m(2),u(a.ResponseCode)}}function It(o,n){if(o&1){let a=L();F(0),t(1,"div",21)(2,"table",22)(3,"thead")(4,"tr",23)(5,"th"),l(6,"Created"),i(),t(7,"th"),l(8,"Channel"),i(),t(9,"th"),l(10,"SKU"),i(),t(11,"th"),l(12,"Stock"),i(),t(13,"th"),l(14,"Response code"),i()()(),t(15,"tbody"),y(16,wt,13,13,"tr",24),i()(),t(17,"mat-paginator",25),N("page",function(r){g(a);let e=b();return h(e.changePage(r))}),i()(),j()}if(o&2){let a=b();m(16),p("ngForOf",a.Result),m(),p("length",a.paginationTotal)("pageSize",a.paginationPageSize)("pageIndex",(a.filter==null?null:a.filter.PageNumber)==0?0:(a.filter==null?null:a.filter.PageNumber)-1)}}function Et(o,n){o&1&&(t(0,"div",27),w(1,"app-empty-state"),i())}var Xe=(()=>{let n=class n{constructor(s,r,e){this.http=s,this._RawLogService=r,this.authService=e,this.Result=Array(),this.filter={PageNumber:0,RowCount:20,Sku:null,ChannelID:"",StatusCode:"",From:"",To:""},this.Load(),this.channelOptions=this.authService.getChannels()}Load(){this.http.post("/api/OrdersLoader/Get",{}).subscribe(s=>{this.filter=s.Filter,this.ActionTypeList=s.Options.ActionTypeList,this.Get()})}Get(s){s!=null&&(this.filter.Sku=s),this.http.post("api/Inventory/GetLog",this.filter).subscribe(r=>{this._RawLogService.Data=r.hits,this.Result=Array();for(let e of r.hits){let c={ID:e._source.log.id,Created:e._source["@timestamp_received"],channelName:e._source.log.channelName,Sku:e._source.log.sku,Stock:e._source.log.stock,ResponseCode:e._source.log.responseCode};this.Result.push(c)}this.paginationTotal=r.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(s){this.filter.PageNumber=s.pageIndex+1,this.Get()}};n.\u0275fac=function(r){return new(r||n)(f(M),f(A),f(de))},n.\u0275cmp=I({type:n,selectors:[["app-inventory-log"]],decls:33,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","Product Inventory Sync","searchBoxPlaceHolder","Enter SKU...",3,"textChange","onSubmit","text"],["role","button","routerLink","/menu/log/inventory",1,"btn","btn-success"],["container",""],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[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"],[1,"table","table-hover"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],[3,"routerLink","queryParams"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(r,e){if(r&1){let c=L();t(0,"mainpanel",1),S("textChange",function(d){return g(c),C(e.filter.Sku,d)||(e.filter.Sku=d),h(d)}),N("onSubmit",function(d){return g(c),h(e.Get(d))}),t(1,"actions")(2,"a",2),l(3," Async Inventory "),i()(),t(4,"filters")(5,"div",3)(6,"div")(7,"label",4),l(8,"Channel"),i(),t(9,"ng-select",5),S("ngModelChange",function(d){return g(c),C(e.filter.ChannelID,d)||(e.filter.ChannelID=d),h(d)}),y(10,xt,3,3,"ng-template",6),i()(),t(11,"div",7)(12,"label",8),l(13,"From/To"),i(),t(14,"div",9)(15,"datepicker",10),S("dateChange",function(d){return g(c),C(e.filter.From,d)||(e.filter.From=d),h(d)}),i()(),t(16,"div")(17,"datepicker",11),S("dateChange",function(d){return g(c),C(e.filter.To,d)||(e.filter.To=d),h(d)}),i()()(),t(18,"div",7)(19,"label",12),l(20,"Page Number"),i(),t(21,"input",13),S("ngModelChange",function(d){return g(c),C(e.filter.PageNumber,d)||(e.filter.PageNumber=d),h(d)}),i()(),t(22,"div",7)(23,"label",12),l(24,"Page Size"),i(),t(25,"input",14),S("ngModelChange",function(d){return g(c),C(e.filter.RowCount,d)||(e.filter.RowCount=d),h(d)}),i()()()(),t(26,"content")(27,"div",15)(28,"div",16)(29,"div",17),y(30,It,18,4,"ng-container",18)(31,Et,2,0,"ng-template",null,0,U),i()()()()()}if(r&2){let c=H(32);_("text",e.filter.Sku),m(9),p("clearable",!0)("items",e.channelOptions),_("ngModel",e.filter.ChannelID),m(6),_("date",e.filter.From),m(2),_("date",e.filter.To),m(4),_("ngModel",e.filter.PageNumber),m(4),_("ngModel",e.filter.RowCount),m(5),p("ngIf",(e.Result==null?null:e.Result.length)>0)("ngIfElse",c)}},dependencies:[J,T,ae,me,le,se,k,R,K,ue,pe,ce,Z,Y,D]});let o=n;return o})();var Tt=()=>["/menu/log/order/detail"],Dt=o=>({ID:o});function Mt(o,n){if(o&1&&(t(0,"span",17),w(1,"img",18),i(),l(2)),o&2){let a=n.item;m(),p("src",a.Img,V)("alt",a.Name),m(),P(" ",a.Name," ")}}function Rt(o,n){if(o&1&&(t(0,"tr")(1,"td")(2,"a",25),l(3),x(4,"date"),i()(),t(5,"td"),l(6),i(),t(7,"td"),l(8),i(),t(9,"td"),l(10),i()()),o&2){let a=n.$implicit;m(2),p("routerLink",z(9,Tt))("queryParams",q(10,Dt,a.id)),m(),P(" ",E(4,6,a.Created,"dd MMM yyyy HH:mm:ss")," "),m(3),u(a.type),m(2),u(a.number),m(2),u(a.message)}}function Nt(o,n){if(o&1){let a=L();F(0),t(1,"div",19)(2,"table",20)(3,"thead",21)(4,"tr")(5,"th",22),l(6,"Date"),i(),t(7,"th"),l(8,"Type"),i(),t(9,"th"),l(10,"Number"),i(),t(11,"th"),l(12,"Message"),i()()(),t(13,"tbody"),y(14,Rt,11,12,"tr",23),i()(),t(15,"mat-paginator",24),N("page",function(r){g(a);let e=b();return h(e.changePage(r))}),i()(),j()}if(o&2){let a=b();m(14),p("ngForOf",a.Result),m(),p("length",a.paginationTotal)("pageSize",a.paginationPageSize)("pageIndex",(a.filter==null?null:a.filter.PageNumber)==0?0:(a.filter==null?null:a.filter.PageNumber)-1)}}function Pt(o,n){o&1&&(t(0,"div",26),w(1,"app-empty-state"),i())}var $e=(()=>{let n=class n{constructor(s,r,e){this.http=s,this._RawLogService=r,this.authService=e,this.Result=Array(),this.filter={RowCount:20,Number:"",PageNumber:1,ActionType:"",ChannelID:"",StatusCode:"",From:"",To:""},this.list=[],this.Types=[{Key:0,Value:"Shopee"},{Key:1,Value:"Tokopedia"}],this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}Load(s={}){this.http.post("/api/OrdersLoader/Get",s).subscribe(r=>{this.filter=r.Filter,this.ActionTypeList=r.Options.ActionTypeList,this.Get()})}Get(s){this.filter.Number=s,this.http.post("api/Orders/GetRawLog",this.filter).subscribe(r=>{this._RawLogService.Data=r.hits,this.Result=Array();for(let e of r.hits){let c={id:e._id,message:e._source.message,responseCode:e._source.log.responseCode,processTypeString:e._source.log.processType,type:e._source.log.type,number:e._source.log.number,Created:e._source["@timestamp_received"]};this.Result.push(c)}this.paginationTotal=r.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}changePage(s){this.filter.PageNumber=s.pageIndex+1,this.Get()}};n.\u0275fac=function(r){return new(r||n)(f(M),f(A),f(de))},n.\u0275cmp=I({type:n,selectors:[["app-raw-log"]],decls:29,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","Channel Webhook Log","searchBoxPlaceHolder","Invoice Number..",3,"textChange","onSubmit","text"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[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"],[1,"table"],[1,"thead-light"],[2,"width","200px"],[4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],[3,"routerLink","queryParams"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(r,e){if(r&1){let c=L();t(0,"mainpanel",1),S("textChange",function(d){return g(c),C(e.filter.Number,d)||(e.filter.Number=d),h(d)}),N("onSubmit",function(d){return g(c),h(e.Get(d))}),t(1,"filters")(2,"div")(3,"label",2),l(4,"Channel"),i(),t(5,"ng-select",3),S("ngModelChange",function(d){return g(c),C(e.filter.ChannelID,d)||(e.filter.ChannelID=d),h(d)}),y(6,Mt,3,3,"ng-template",4),i()(),t(7,"div",5)(8,"label",6),l(9,"From/To"),i(),t(10,"div",7)(11,"datepicker",8),S("dateChange",function(d){return g(c),C(e.filter.From,d)||(e.filter.From=d),h(d)}),i()(),t(12,"div")(13,"datepicker",9),S("dateChange",function(d){return g(c),C(e.filter.To,d)||(e.filter.To=d),h(d)}),i()()(),t(14,"div",5)(15,"label",10),l(16,"Page Number"),i(),t(17,"input",11),S("ngModelChange",function(d){return g(c),C(e.filter.PageNumber,d)||(e.filter.PageNumber=d),h(d)}),i()(),t(18,"div",5)(19,"label",10),l(20,"Page Size"),i(),t(21,"input",12),S("ngModelChange",function(d){return g(c),C(e.filter.RowCount,d)||(e.filter.RowCount=d),h(d)}),i()()(),t(22,"content")(23,"div",13)(24,"div",14)(25,"div",15),y(26,Nt,16,4,"ng-container",16)(27,Pt,2,0,"ng-template",null,0,U),i()()()()()}if(r&2){let c=H(28);_("text",e.filter.Number),m(5),p("clearable",!0)("items",e.channelOptions),_("ngModel",e.filter.ChannelID),m(6),_("date",e.filter.From),m(2),_("date",e.filter.To),m(4),_("ngModel",e.filter.PageNumber),m(4),_("ngModel",e.filter.RowCount),m(5),p("ngIf",(e.Result==null?null:e.Result.length)>0)("ngIfElse",c)}},dependencies:[J,T,ae,me,le,se,k,R,K,ue,pe,ce,Z,Y,D]});let o=n;return o})();var Ce=class{constructor(n,a){this._document=a;let s=this._textarea=this._document.createElement("textarea"),r=s.style;r.position="fixed",r.top=r.opacity="0",r.left="-999em",s.setAttribute("aria-hidden","true"),s.value=n,s.readOnly=!0,(this._document.fullscreenElement||this._document.body).appendChild(s)}copy(){let n=this._textarea,a=!1;try{if(n){let s=this._document.activeElement;n.select(),n.setSelectionRange(0,n.value.length),a=this._document.execCommand("copy"),s&&s.focus()}}catch{}return a}destroy(){let n=this._textarea;n&&(n.remove(),this._textarea=void 0)}},Lt=(()=>{let n=class n{constructor(s){this._document=s}copy(s){let r=this.beginCopy(s),e=r.copy();return r.destroy(),e}beginCopy(s){return new Ce(s,this._document)}};n.\u0275fac=function(r){return new(r||n)(he(Re))},n.\u0275prov=ie({token:n,factory:n.\u0275fac,providedIn:"root"});let o=n;return o})(),Ot=new we("CDK_COPY_TO_CLIPBOARD_CONFIG"),et=(()=>{let n=class n{constructor(s,r,e){this._clipboard=s,this._ngZone=r,this.text="",this.attempts=1,this.copied=new Ee,this._pending=new Set,e&&e.attempts!=null&&(this.attempts=e.attempts)}copy(s=this.attempts){if(s>1){let r=s,e=this._clipboard.beginCopy(this.text);this._pending.add(e);let c=()=>{let v=e.copy();!v&&--r&&!this._destroyed?this._currentTimeout=this._ngZone.runOutsideAngular(()=>setTimeout(c,1)):(this._currentTimeout=null,this._pending.delete(e),e.destroy(),this.copied.emit(v))};c()}else this.copied.emit(this._clipboard.copy(this.text))}ngOnDestroy(){this._currentTimeout&&clearTimeout(this._currentTimeout),this._pending.forEach(s=>s.destroy()),this._pending.clear(),this._destroyed=!0}};n.\u0275fac=function(r){return new(r||n)(f(Lt),f(Te),f(Ot,8))},n.\u0275dir=Ie({type:n,selectors:[["","cdkCopyToClipboard",""]],hostBindings:function(r,e){r&1&&N("click",function(){return e.copy()})},inputs:{text:[0,"cdkCopyToClipboard","text"],attempts:[0,"cdkCopyToClipboardAttempts","attempts"]},outputs:{copied:"cdkCopyToClipboardCopied"},standalone:!0});let o=n;return o})(),tt=(()=>{let n=class n{};n.\u0275fac=function(r){return new(r||n)},n.\u0275mod=oe({type:n}),n.\u0275inj=ne({});let o=n;return o})();function Wt(o,n){o&1&&w(0,"img",21)}function Vt(o,n){o&1&&w(0,"img",22)}function Bt(o,n){if(o&1&&(t(0,"div",4)(1,"div",5)(2,"div",6)(3,"h5"),l(4,"General"),i()(),t(5,"div",7)(6,"div",2)(7,"div",8)(8,"div",9)(9,"label"),l(10,"Date"),i(),t(11,"div")(12,"span"),l(13),x(14,"date"),i()()()(),t(15,"div",10)(16,"div",9)(17,"label"),l(18,"Market Place Type"),i(),y(19,Wt,1,0,"img",11)(20,Vt,1,0,"img",12),t(21,"a",13)(22,"span",14),l(23),i(),w(24,"br"),t(25,"small",15),l(26),i()()()(),t(27,"div",10)(28,"div",9)(29,"label"),l(30,"Number"),i(),t(31,"div")(32,"span"),l(33),i()()()(),t(34,"div",8)(35,"div",9)(36,"label"),l(37,"Process Type"),i(),t(38,"div")(39,"span"),l(40),i()()()(),t(41,"div",4)(42,"div",9)(43,"label"),l(44,"Authorization Header"),i(),t(45,"div")(46,"span"),l(47),i()()()(),t(48,"div",16)(49,"div",5)(50,"div",17)(51,"div",18)(52,"h3"),l(53,"Request"),i()(),t(54,"div",19)(55,"button",20),l(56,"Copy to clipboard"),i()()(),t(57,"div",7),l(58),i()()()()()()()),o&2){let a=b();m(13),u(E(14,11,a.data.Created,"dd MMM yyyy HH:mm:ss")),m(6),p("ngIf",a.data.TypeID==1),m(),p("ngIf",a.data.TypeID==0),m(),Me("href",a.data.ShopLink,V),m(2),u(a.data.ShopName),m(3),u(a.data.ShopLink),m(7),u(a.data._source.log.number),m(7),u(a.data._source.log.processType),m(7),u(a.data._source.log.authorizationHeader),m(8),p("cdkCopyToClipboard",a.data._source.log.request),m(3),P(" ",a.data._source.log.request," ")}}var it=(()=>{let n=class n{constructor(s,r,e){this.route=s,this.http=r,this._RawLogService=e,this.route.queryParams.subscribe(c=>{let v=JSON.parse(localStorage.getItem("channel"));if(this.ID=c.ID,this.data=this._RawLogService.Fill(this.ID),this.data.Created=this.data._source["@timestamp_received"],v.length>0){let d=v.find(mt=>mt.ShopID==this.data._source.shopId);d?(this.data.TypeID=d.TypeID,this.data.ShopName=d.Name,this.data.ShopLink=d.URL):(this.data.TypeID=null,this.data.ShopName=null,this.data.ShopLink=null)}})}ngOnInit(){}};n.\u0275fac=function(r){return new(r||n)(f(B),f(M),f(A))},n.\u0275cmp=I({type:n,selectors:[["app-raw-detail"]],decls:5,vars:4,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],[1,"container-fluid","mt-2"],[1,"row"],["class","col-sm-12",4,"ngIf"],[1,"col-sm-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"col-sm-2"],[1,"info-label-group"],[1,"col-sm-4"],["class","me-2","src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",4,"ngIf"],["class","me-2","src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",4,"ngIf"],["target","_blank",3,"href"],[1,"fw-bold"],[1,"text-dark"],[1,"col-sm-12","mt-2"],[1,"card-header","d-lg-flex"],[1,"me-auto"],[1,"d-sm-block","mt-2"],[3,"cdkCopyToClipboard"],["src","https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",1,"me-2"],["src","https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",1,"me-2"]],template:function(r,e){r&1&&(t(0,"mainpanel",0)(1,"content")(2,"div",1)(3,"div",2),y(4,Bt,59,14,"div",3),i()()()()),r&2&&(p("headerTitle","Request Raw Log Detail")("hideSearchBox",!0)("hideSearchDropdown",!0),m(4),p("ngIf",e.data))},dependencies:[T,R,et,D]});let o=n;return o})();function At(o,n){if(o&1&&(t(0,"div",10)(1,"div",7)(2,"div",8)(3,"h5"),l(4,"General"),i()(),t(5,"div",9)(6,"div",3)(7,"div",6)(8,"div",12)(9,"label"),l(10,"Date"),i(),t(11,"div")(12,"span"),l(13),x(14,"date"),i()()()(),t(15,"div",6)(16,"div",12)(17,"label"),l(18,"SKU"),i(),t(19,"div")(20,"span"),l(21),i()()()(),t(22,"div",6)(23,"div",12)(24,"label"),l(25,"Channel"),i(),t(26,"div")(27,"span"),l(28),i()()()(),t(29,"div",6)(30,"div",12)(31,"label"),l(32,"Response Code"),i(),t(33,"div")(34,"span"),l(35),i()()()()()()()()),o&2){let a=b();m(13),u(E(14,4,a.data.Created,"dd MMM yyyy")),m(8),u(a.data.Sku),m(7),u(a.data.ChannelName),m(7),u(a.data.ResponseCode)}}var nt=(()=>{let n=class n{constructor(s,r,e){this.route=s,this.http=r,this._RawLogService=e,this.data={Created:"",Sku:"",ChannelName:"",ResponseCode:""},this.route.queryParams.subscribe(c=>{this.ID=c.ID,this.Load()})}ngOnInit(){}Load(){var s={ID:this.ID};this.http.post("/api/Inventory/GetInventoryLogDeatil",s).subscribe(r=>{this.data.Created=r.hits[0]._source["@timestamp_received"],this.data.Sku=r.hits[0]._source.log.sku,this.data.ChannelName=r.hits[0]._source.log.channelName,this.data.ResponseCode=r.hits[0]._source.log.responseCode,this.request=X.IsNotEmpty(r.hits[0]?._source.log?.request)?JSON.parse(r.hits[0]?._source?.log?.request):"",this.response=r.hits[0]._source.log.response})}};n.\u0275fac=function(r){return new(r||n)(f(B),f(M),f(A))},n.\u0275cmp=I({type:n,selectors:[["app-inventory-detail"]],decls:30,vars:7,consts:[["headerTitle","Product Inventory Sync Detail",3,"hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/inventory/sync-inventory",1,"btn","btn-secondary","btn-fill","btn-lg","me-2"],[1,"container-fluid","mt-3"],[1,"row"],["class","col-sm-12",4,"ngIf"],[1,"row","mt-2"],[1,"col-sm-6"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group"],[1,"info-label-group"]],template:function(r,e){r&1&&(t(0,"mainpanel",0)(1,"actions")(2,"a",1),l(3,"Back"),i()(),t(4,"content")(5,"div",2)(6,"div",3),y(7,At,36,7,"div",4),i(),t(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"h5"),l(13,"Request"),i()(),t(14,"div",9)(15,"div",10)(16,"div",11)(17,"pre"),l(18),x(19,"json"),i()()()()()(),t(20,"div",6)(21,"div",7)(22,"div",8)(23,"h5"),l(24,"Response"),i()(),t(25,"div",9)(26,"div",10)(27,"div",11)(28,"pre"),l(29),i()()()()()()()()()()),r&2&&(p("hideSearchBox",!0)("hideSearchDropdown",!0),m(7),p("ngIf",e.data),m(11),u(G(19,5,e.request)),m(11),u(e.response))},dependencies:[T,k,R,re,D]});let o=n;return o})();function Ft(o,n){if(o&1&&(t(0,"div",9)(1,"div",10)(2,"label"),l(3,"Process Code"),i(),t(4,"div")(5,"span"),l(6),i()()()()),o&2){let a=b();m(6),u(a.ProcessedCode)}}function jt(o,n){if(o&1){let a=L();t(0,"a",16),N("click",function(){g(a);let r=b();return h(r.Retry())}),l(1,"Retry"),i()}}var ot=(()=>{let n=class n{constructor(s,r){this.route=s,this.http=r,this.ProcessDuration=0,this.request="",this.response="",this.route.queryParams.subscribe(e=>{this.ID=e.ID,this.Load()})}Retry(){var s={Number:this.Number,ShopID:this.shopId};this.http.post("/api/Orders/Retry",s).subscribe(r=>{alert(JSON.stringify(r))})}Load(){var s={ID:this.ID};this.http.post("/api/Orders/GetDetail",s).subscribe(r=>{for(let e of r.hits)this.Number=e._source.log.number,this.MarketTypeString=e._source.log.type,this.ResponseCode=e._source.log.responseCode,this.POSActionTypeString=e._source.message,this.ProcessDuration=0,this.Created=e._source["@timestamp_received"],this.request=X.IsNotEmpty(e._source?.log?.request)?JSON.parse(e._source.log?.request):"",this.response=X.IsNotEmpty(e._source?.log?.response)?JSON.parse(e._source.log?.response):"",this.shopId=e._source.shopId,this.ProcessedCode=e._source.log.processedCode})}};n.\u0275fac=function(r){return new(r||n)(f(B),f(M))},n.\u0275cmp=I({type:n,selectors:[["app-orderdetail"]],decls:83,vars:21,consts:[[3,"headerTitle","pageData","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/log/order",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-sm-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"row","mt-7"],[1,"col-sm-6"],[1,"info-label-group"],["class","col-sm-6",4,"ngIf"],[1,"row","mt-2"],[1,"form-group"],[1,"float-right"],["role","button","class","btn btn-success btn-fill btn-lg me-3",3,"click",4,"ngIf"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","me-3",3,"click"]],template:function(r,e){r&1&&(t(0,"mainpanel",0)(1,"actions")(2,"a",1),l(3,"Back"),i()(),t(4,"content")(5,"div",2)(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"h5"),l(11,"General"),i()(),t(12,"div",7)(13,"div",8)(14,"div",9)(15,"div",10)(16,"label"),l(17,"Date"),i(),t(18,"div")(19,"span"),l(20),x(21,"date"),i()()()(),t(22,"div",9)(23,"div",10)(24,"label"),l(25,"Number"),i(),t(26,"div")(27,"span"),l(28),i()()()(),t(29,"div",9)(30,"div",10)(31,"label"),l(32,"Type"),i(),t(33,"div")(34,"span"),l(35),i()()()(),t(36,"div",9)(37,"div",10)(38,"label"),l(39,"Response Code"),i(),t(40,"div")(41,"span"),l(42),i()()()(),t(43,"div",9)(44,"div",10)(45,"label"),l(46,"ShopID"),i(),t(47,"div")(48,"span"),l(49),i()()()(),y(50,Ft,7,1,"div",11),t(51,"div",9)(52,"div",10)(53,"label"),l(54,"Action"),i(),t(55,"div")(56,"span"),l(57),i()()()()()()()()(),t(58,"div",12)(59,"div",9)(60,"div",5)(61,"div",6)(62,"h5"),l(63,"Request"),i()(),t(64,"div",7)(65,"div",4)(66,"div",13)(67,"pre"),l(68),x(69,"json"),i()()(),t(70,"actions",14),y(71,jt,2,0,"a",15),i()()()(),t(72,"div",9)(73,"div",5)(74,"div",6)(75,"h5"),l(76,"Response"),i()(),t(77,"div",7)(78,"div",4)(79,"div",13)(80,"pre"),l(81),x(82,"json"),i()()()()()()()()()()),r&2&&(p("headerTitle","Order #"+e.Number)("pageData","Orders Detail ")("hideSearchBox",!0)("hideSearchDropdown",!0),m(20),u(E(21,14,e.Created,"dd MMM yyyy HH:mm:ss")),m(8),u(e.Number),m(7),u(e.MarketTypeString),m(7),u(e.ResponseCode),m(7),u(e.shopId),m(),p("ngIf",e.ProcessedCode!=null),m(7),u(e.POSActionTypeString),m(11),u(G(69,17,e.request)),m(3),p("ngIf",e.ResponseCode!="200"&&e.ResponseCode!="201"),m(10),u(G(82,19,e.response)))},dependencies:[T,k,R,re,D]});let o=n;return o})();var qt=()=>["/menu/log/exception/detail"],Ht=o=>({ID:o});function zt(o,n){if(o&1&&(t(0,"tr")(1,"td",12),w(2,"img",13),i(),t(3,"td"),l(4),x(5,"date"),i(),t(6,"td")(7,"a",14),l(8),i()(),t(9,"td")(10,"div",15),l(11),i(),t(12,"div"),l(13),i()()()),o&2){let a=n.$implicit;m(2),p("src",a.logo,V),m(2),u(E(5,7,a.date,"dd-MM-yyyy hh:mm:ss")),m(3),p("routerLink",z(10,qt))("queryParams",q(11,Ht,a.id)),m(),P(" ",a.number," "),m(3),u(a.message),m(2),u(a.stackTrace)}}function Gt(o,n){if(o&1){let a=L();F(0),t(1,"mat-paginator",16),N("page",function(r){g(a);let e=b(2);return h(e.onPaginationChange(r))}),i(),j()}if(o&2){let a=b(2);m(),p("length",a.pageTotal)("pageSize",a.pageSize)("pageIndex",(a.filter==null?null:a.filter.PageNumber)==0?0:(a.filter==null?null:a.filter.PageNumber)-1)}}function Ut(o,n){if(o&1&&(F(0),t(1,"div",6)(2,"table",7)(3,"thead")(4,"tr",8)(5,"th"),l(6,"Channel"),i(),t(7,"th",9),l(8,"Date"),i(),t(9,"th"),l(10,"Number"),i(),t(11,"th"),l(12,"Exception"),i()()(),t(13,"tbody"),y(14,zt,14,13,"tr",10),i()(),y(15,Gt,2,3,"ng-container",11),i(),j()),o&2){let a=b();m(14),p("ngForOf",a.exceptions),m(),p("ngIf",(a.exceptions==null?null:a.exceptions.length)>0)}}function Jt(o,n){o&1&&(t(0,"div",17),w(1,"app-empty-state"),i())}var rt=(()=>{let n=class n{constructor(s){this.http=s,this.exceptions=[],this.filter={RowCount:50,PageNumber:1},this.getData()}getData(){this.http.post("/api/Orders/GetExceptionList",this.filter).subscribe(s=>{this.exceptions=s.hits.map(r=>({id:r._id,logo:X.getChannelLogoByName(r._source.error?.Type),number:r._source.error.number,date:r._source["@timestamp_received"],stackTrace:r._source.error.stackTrace,message:r._source.message,requestJSON:r._source?.error?.requestJSON})),this.pageTotal=s.total.value,this.pageSize=this.filter.RowCount>this.pageTotal?this.pageTotal:this.filter.RowCount})}onPaginationChange(s){this.filter.PageNumber=s.pageIndex+1,this.getData()}};n.\u0275fac=function(r){return new(r||n)(f(M))},n.\u0275cmp=I({type:n,selectors:[["app-exception-log"]],decls:8,vars:2,consts:[["EMPTY_STATE",""],["headerTitle","Exception Log","searchBoxPlaceHolder","Enter Number...","hideSearchBox","true","hideSearchDropdown","true"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[2,"width","140px"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"text-center"],[2,"width","25px",3,"src"],[3,"routerLink","queryParams"],[1,"fw-bold"],[3,"page","length","pageSize","pageIndex"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(r,e){if(r&1&&(t(0,"mainpanel",1)(1,"content")(2,"div",2)(3,"div",3)(4,"div",4),y(5,Ut,16,2,"ng-container",5)(6,Jt,2,0,"ng-template",null,0,U),i()()()()()),r&2){let c=H(7);m(5),p("ngIf",e.exceptions.length>0)("ngIfElse",c)}},dependencies:[J,T,k,R,K,Y,D]});let o=n;return o})();var at=(()=>{let n=class n{constructor(s){this.httpService=s}getExceptionDetail(s){return this.httpService.post("/api/Orders/GetDetailException",{ID:s}).pipe(Se(e=>e?.hits[0]?._source))}};n.\u0275fac=function(r){return new(r||n)(he(M))},n.\u0275prov=ie({token:n,factory:n.\u0275fac,providedIn:"root"});let o=n;return o})();function Kt(o,n){if(o&1&&(t(0,"div",2)(1,"div",3)(2,"div",4)(3,"div",5)(4,"div",6)(5,"h5"),l(6,"General"),i()(),t(7,"div",7)(8,"div",8)(9,"div",9)(10,"div",10)(11,"label"),l(12,"Date"),i(),t(13,"div")(14,"span"),l(15),x(16,"date"),i()()()(),t(17,"div",9)(18,"div",10)(19,"label"),l(20,"Number"),i(),t(21,"div")(22,"span"),l(23),i()()()(),t(24,"div",9)(25,"div",10)(26,"label"),l(27,"Type"),i(),t(28,"div")(29,"span"),l(30),i()()()(),t(31,"div",9)(32,"div",10)(33,"label"),l(34,"ShopID"),i(),t(35,"div")(36,"span"),l(37),i()()()()()()()()(),t(38,"div",11)(39,"div",9)(40,"div",5)(41,"div",6)(42,"h5"),l(43,"Request"),i()(),t(44,"div",7)(45,"div",12)(46,"div",13)(47,"pre"),l(48),x(49,"json"),i()()()()()(),t(50,"div",9)(51,"div",5)(52,"div",6)(53,"h5"),l(54,"Exception"),i()(),t(55,"div",7)(56,"div",14)(57,"div",13)(58,"div",15),l(59),i(),t(60,"pre"),l(61),i()()()()()()()()),o&2){let a=n.ngIf;m(15),u(E(16,7,a["@timestamp"],"dd MMM yyyy HH:mm:ss")),m(8),u(a==null||a.error==null?null:a.error.number),m(7),u(a==null||a.error==null?null:a.error.Type),m(7),u(a==null?null:a.shopId),m(11),u(G(49,10,a==null||a.error==null?null:a.error.requestJSON)),m(11),u(a==null?null:a.message),m(2),u(a==null||a.error==null?null:a.error.stackTrace)}}var lt=(()=>{let n=class n{constructor(s,r){this.activatedRoute=s,this.exceptionService=r,this.invoiceNumber=""}ngOnInit(){let s=this.activatedRoute.snapshot.queryParams;this.getExceptionDetail(s?.ID)}getExceptionDetail(s){this.exceptionDetail$=this.exceptionService.getExceptionDetail(s).pipe(xe(r=>{this.invoiceNumber=r?.error?.number}),be(1))}};n.\u0275fac=function(r){return new(r||n)(f(B),f(at))},n.\u0275cmp=I({type:n,selectors:[["app-exception-detail"]],decls:4,vars:6,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["class","container-fluid mt-3",4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"row","mt-7"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-2"],[1,"col-sm-12"],[1,"form-group"],[1,"col-sm-12","mt-2"],[1,"fw-bold"]],template:function(r,e){r&1&&(t(0,"mainpanel",0)(1,"content"),y(2,Kt,62,12,"div",1),x(3,"async"),i()()),r&2&&(p("headerTitle","Order #"+e.invoiceNumber)("hideSearchBox",!0)("hideSearchDropdown",!0),m(2),p("ngIf",G(3,4,e.exceptionDetail$)))},dependencies:[T,R,Pe,re,D]});let o=n;return o})();var Zt=[{path:"",component:Ue,children:[{path:"",redirectTo:"order",pathMatch:"full"},{path:"order",component:Qe,canActivate:[W],data:{title:"Order Log"}},{path:"inventory/sync-inventory",component:Xe,canActivate:[W],data:{title:"Product Inventory Sync"}},{path:"rawlog",component:$e,canActivate:[W],data:{title:"Raw Log"}},{path:"rawlog/detail",component:it,canActivate:[W],data:{title:"Raw Log Detail"}},{path:"inventory/sync-inventory/detail",component:nt,canActivate:[W],data:{title:"Product Inventory Sync Detail"}},{path:"order/detail",component:ot,canActivate:[W],data:{title:"Order Details"}},{path:"exception",component:rt,canActivate:[W],data:{title:"Exception Log"}},{path:"exception/detail",component:lt,canActivate:[W],data:{title:"Exception Log Detail"}},{path:"inventory",loadComponent:()=>import("./chunk-T32TE7CZ.js").then(o=>o.InventoryAsyncLogComponent),canActivate:[W],data:{title:"Product Inventory Sync"}},{path:"inventory/detail",loadComponent:()=>import("./chunk-Z6PE5TYH.js").then(o=>o.InventoryAsyncDetailComponent),canActivate:[W],data:{title:"Product Inventory Sync Detail"}},{path:"authorization-log",loadComponent(){return import("./chunk-6ZHHZ2HR.js").then(o=>o.ChannelLogComponent)},canActivate:[W],data:{title:"Authorization Log"}}]}],st=(()=>{let n=class n{};n.\u0275fac=function(r){return new(r||n)},n.\u0275mod=oe({type:n}),n.\u0275inj=ne({imports:[fe,ve.forChild(Zt)]});let o=n;return o})();var gn=(()=>{let n=class n{};n.\u0275fac=function(r){return new(r||n)},n.\u0275mod=oe({type:n}),n.\u0275inj=ne({imports:[fe,We,Ve,st,ve,je,tt,ze,Be,He,Z,Fe,Ge]});let o=n;return o})();export{gn as LogsModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as r}from"./chunk-
|
|
1
|
+
import{g as r}from"./chunk-F3MM4SRD.js";import{b as l,e as C}from"./chunk-4SAJUEHO.js";import{b as o,c}from"./chunk-64G3XLI6.js";import{ea as s,ja as u,oa as h,v as p}from"./chunk-PQDPS2ID.js";var y=(()=>{let n=class n{constructor(t,e){this.httpService=t,this.toastr=e}saveChannel(t){return this.httpService.post("/api/Channel/SubmitChannel",t)}getLastSync(t){return this.httpService.get(`${r.ChannelGetLastSyncByID}/?ID=${t}`)}getChannel(t){return this.httpService.post(r.GetChannel,t)}getChannelLoader(){return this.httpService.get(r.GetChannelLoader)}testShopID(t){return this.httpService.post(r.TestShopID,t).pipe(s(e=>{this.showTostrSuccessTestShopID(e)}))}updateChannelIndex(t){return this.httpService.post(r.UpdateChannelIndex,t)}deleteChannel(t){return this.httpService.post(r.DeleteChannel,t)}mapChannelImage(t){return t.map(e=>(e.img=c.getChannelLogoByTypeId(e.TypeID),e))}showTostrSuccessTestShopID(t){let e="";for(var i in t)e+=i+" : "+t[i]+"<br/>";this.toastr.success(e,"Success",{enableHtml:!0,closeButton:!0,positionClass:"toast-bottom-right"})}getRegisterByOutletName(t){return this.httpService.post(r.GetRegisterByOutletName,{Outlet:t})}getChannelRowCount(t){return this.httpService.post(r.GetChannelRowCount,t).pipe(p(e=>e.Count))}getChannelWarehouse(t){return this.httpService.get(`${r.GetChannelWarehouse}/?ChannelID=${t}`)}unSynchronizedWarehouse(t){return this.httpService.delete(`${r.UnSynchronizedWarehouse}?ID=${t}`)}authorizedChannel(t){let e=this.getApiAuthorize(t);return this.httpService.post(`/api/${e}`,null).pipe(s(i=>{window.open(i.Url,"_blank")}))}getApiAuthorize(t){let e;switch(t){case o.Shopee:e="ChannelAuthorization/ShopeeV2_URL";break;case o.Tiktok:e="ChannelAuthorization/Tiktok_URL";break;case o.Lazada:e="ChannelAuthorization/Lazada_URL";break}return e}};n.\u0275fac=function(e){return new(e||n)(h(C),h(l))},n.\u0275prov=u({token:n,factory:n.\u0275fac,providedIn:"root"});let a=n;return a})();export{y as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as N}from"./chunk-WTR5UFZI.js";import{a as M}from"./chunk-XHAXYWZ7.js";import{a as Ne,b as ke,c as U}from"./chunk-B5PFUQJP.js";import{a as _e}from"./chunk-BVIRHZTZ.js";import{a as Ee,b as Me}from"./chunk-AMSVLO4N.js";import{a as De}from"./chunk-N6IHFFFZ.js";import{a as Ve,b as Te}from"./chunk-PD4CUVAW.js";import"./chunk-GCKSYCMI.js";import{a as be}from"./chunk-ZFQW5CVZ.js";import"./chunk-ADRVUMMW.js";import{a as Fe}from"./chunk-XFTUE2ST.js";import"./chunk-HCDKYABV.js";import{a as fe,b as xe,d as Se,e as Pe}from"./chunk-CCXKODFV.js";import{i as ue}from"./chunk-AKYLFMD3.js";import{b as de,e as ge}from"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import{d as Ie,l as we,m as ye,n as ve}from"./chunk-BO4PPSB5.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{b as oe,c as re,h as le,m as ce,o as se,y as pe}from"./chunk-BSN7ZAXG.js";import{c as me,e as he,f as Ce}from"./chunk-64G3XLI6.js";import"./chunk-OVEJFFL6.js";import{$b as u,Bd as E,Cd as ie,Da as _,Ea as m,Eb as h,G as A,Gb as p,Gc as v,Hc as T,Ic as X,Id as ae,Jc as Y,Nb as S,Ob as k,Qb as L,Rb as R,Sb as o,Tb as c,Ub as P,Vb as q,Wb as K,Yb as x,Z as $,bc as r,ea as j,ec as H,gb as D,jb as l,kb as f,mc as J,nc as d,oc as B,pa as z,pc as F,rc as I,sc as w,sd as ee,ta as G,tc as y,uc as Z,vc as Q,vd as te,xc as V,yd as ne}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var O=i=>[i],Ue=i=>({"text-decoration-line-through":i}),Oe=i=>({"bg-gradient-warning":i}),We=i=>({"ms-10":i});function Ae(i,s){if(i&1&&(o(0,"span",10),P(1,"img",11),c(),d(2)),i&2){let t=s.item;l(),p("src",t==null?null:t.Img,D),l(),F(" ",t.Name," ")}}function $e(i,s){if(i&1){let t=x();o(0,"button",16),u("click",function(){_(t);let n=r().ngIf,a=r(2);return m(a.updateStock(n))}),P(1,"i",17),d(2," Update "),c()}}function je(i,s){if(i&1){let t=x();o(0,"actions")(1,"div",12),h(2,$e,3,0,"button",13),o(3,"button",14),u("click",function(){_(t);let n=r(2);return m(n.openExportDialog())}),P(4,"i",15),o(5,"span"),d(6,"Export"),c()()()()}if(i&2){let t=s.ngIf,e=r(2);l(2),p("ngIf",e.productService.hasSelectionVariant(t))}}function ze(i,s){if(i&1){let t=x();o(0,"th")(1,"input",32),u("change",function(n){_(t);let a=r().ngIf,g=r(2);return m(g.onSelectAllSKU(n.target.checked,a))}),c()()}}function Ge(i,s){if(i&1){let t=x();o(0,"input",51),y("ngModelChange",function(n){_(t);let a=r(4).$implicit;return w(a.selected,n)||(a.selected=n),m(n)}),u("ngModelChange",function(){_(t);let n=r(4).$implicit,a=r(3);return m(a.onCheckboxStateProduct(n))}),c()}if(i&2){let t=r(4).$implicit;I("ngModel",t.selected)}}function qe(i,s){if(i&1&&h(0,Ge,1,1,"ng-template",26),i&2){let t=r(6);p("ngxPermissionsOnly",V(1,O,t.rolePriceEdit))}}function Ke(i,s){if(i&1){let t=x();q(0),o(1,"img",52),u("click",function(n){_(t);let a=r(3).$implicit,g=r(3);return m(g.onZoomImage(n,a==null?null:a.ImageUrl))}),c(),K()}if(i&2){let t=r(3).$implicit;l(),H("src",t.ThumbnailUrl,D)}}function He(i,s){i&1&&P(0,"img",53)}function Je(i,s){if(i&1&&(o(0,"small",50),d(1),c()),i&2){let t=r(3).$implicit;l(),F("(",t.Category,")")}}function Ze(i,s){if(i&1&&(o(0,"td",44)(1,"div",45),h(2,qe,1,3,null,26),o(3,"div",46),h(4,Ke,2,1,"ng-container",47)(5,He,1,0,"ng-template",null,0,Y),c()()(),o(7,"td",48)(8,"span",49),d(9),c(),h(10,Je,2,1,"small",50),c()),i&2){let t=J(6),e=r(2).$implicit;p("rowSpan",e.Variants.length),l(2),S((e.Variants==null?null:e.Variants.length)>1?2:-1),l(),p("ngClass",V(8,We,(e.Variants==null?null:e.Variants.length)<=1)),l(),p("ngIf",e.ThumbnailUrl)("ngIfElse",t),l(3),p("rowSpan",e.Variants.length),l(2),B(e.Name),l(),S(e.Category?10:-1)}}function Qe(i,s){if(i&1){let t=x();o(0,"input",56),y("ngModelChange",function(n){_(t);let a=r(2).$implicit;return w(a.selected,n)||(a.selected=n),m(n)}),c()}if(i&2){let t=r(2).$implicit;I("ngModel",t.selected)}}function Xe(i,s){if(i&1&&(o(0,"td",54),h(1,Qe,1,1,"input",55),c()),i&2){let t=r().$implicit;l(),S(t.UnitPrice>=0?1:-1)}}function Ye(i,s){i&1&&(o(0,"div",36),d(1," Not Found "),c())}function et(i,s){if(i&1&&(o(0,"div"),d(1),v(2,"number"),c()),i&2){let t=r().$implicit;l(),F(" ",T(2,1,t.UnitPrice)," ")}}function tt(i,s){if(i&1&&(o(0,"div",37)(1,"a",40),P(2,"i",57),c()()),i&2){let t=r().$implicit,e=r(4);l(),p("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),D)}}function nt(i,s){if(i&1){let t=x();o(0,"div",58),u("click",function(){_(t);let n=r().$implicit,a=r().$implicit,g=r(2).ngIf,C=r();return m(C.openTableDialog(n,a,g))}),d(1),v(2,"number"),c()}if(i&2){let t=r().$implicit;l(),F(" ",T(2,1,t.Channel[0]==null?null:t.Channel[0].Price)," ")}}function it(i,s){if(i&1){let t=x();o(0,"tr",33),h(1,Ze,11,10),o(2,"td",24),d(3),c(),o(4,"td",27)(5,"span",34),d(6),c()(),h(7,Xe,2,1,"ng-template",26),o(8,"td",27)(9,"div",35),h(10,Ye,2,0,"div",36)(11,et,3,3,"div")(12,tt,3,1,"div",37),c()(),o(13,"td",38)(14,"div",35),h(15,nt,3,3,"div",39),o(16,"div",37)(17,"a",40),P(18,"i",41),c()(),o(19,"div",37)(20,"div",42),u("click",function(){let n=_(t).$implicit,a=r(4);return m(a.refreshPrice(n))}),P(21,"i",43),c()()()()()}if(i&2){let t=s.$implicit,e=s.$index,n=r(4);l(),S(e==0?1:-1),l(2),B(t.Model),l(2),p("matTooltip",t.Discontinued?n.discontinuedVariantMsg:"")("ngClass",V(12,Ue,t.Discontinued)),l(),F(" ",t.Code," "),l(),p("ngxPermissionsOnly",V(14,O,n.rolePriceEdit)),l(3),S((t.Channel[0]==null?null:t.Channel[0].Description)!=null?10:-1),l(),S((t.Channel[0]==null?null:t.Channel[0].Description)==null?11:-1),l(),S((t.Channel[0]==null?null:t.Channel[0].Description)==null?12:-1),l(),p("ngClass",V(16,Oe,t.UnitPrice!=(t.Channel[0]==null?null:t.Channel[0].Price))),l(2),S(t.Channel.length>0?15:-1),l(2),p("href",t.Channel[0]==null?null:t.Channel[0].Url,D)}}function at(i,s){if(i&1&&L(0,it,22,18,"tr",33,k),i&2){let t=s.$implicit;R(t.Variants)}}function ot(i,s){if(i&1){let t=x();o(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),o(8,"div")(9,"mat-slide-toggle",23),y("ngModelChange",function(n){_(t);let a=r(2);return w(a.toggleDifferentInventory,n)||(a.toggleDifferentInventory=n),m(n)}),u("toggleChange",function(){_(t);let n=r(2);return m(n.onToggleDifferentInventory())}),o(10,"small",7),d(11,"FILTER DIFFERENT PRICE"),c()()()(),o(12,"th",24),d(13,"Variant"),c(),o(14,"th",25),d(15,"SKU"),c(),h(16,ze,2,0,"ng-template",26),o(17,"th",27),d(18,"POS"),c(),o(19,"th",27)(20,"div",28),u("click",function(){_(t);let n=r(2);return m(n.openModalFilter())}),P(21,"img",29),o(22,"span",30),d(23),v(24,"stringLimit"),c()()()()(),o(25,"tbody"),L(26,at,2,0,null,null,k),c()(),o(28,"infinite-paginator",31),v(29,"async"),u("onNextPage",function(){_(t);let n=r(2);return m(n.infinitePagination.onNextPage(n.searchFilter))})("onLastPage",function(){_(t);let n=r(2);return m(n.infinitePagination.onLastPage(n.searchFilter))})("onGetRowCount",function(){_(t);let n=r(2);return m(n.infinitePagination.getRowCount(n.searchFilter))}),c()()()()}if(i&2){let t=s.ngIf,e=r(2);l(9),I("ngModel",e.toggleDifferentInventory),l(7),p("ngxPermissionsOnly",V(16,O,e.rolePriceEdit)),l(4),p("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?e.selectedChannel==null?null:e.selectedChannel.Name:""),l(),p("src",e.selectedChannel==null?null:e.selectedChannel.Img,D),l(2),F(" ",X(24,11,e.selectedChannel==null?null:e.selectedChannel.Name,20)," "),l(3),R(t),l(2),p("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",T(29,14,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}function rt(i,s){if(i&1){let t=x();o(0,"mainpanel",2),y("textChange",function(n){_(t);let a=r();return w(a.searchFilter.text,n)||(a.searchFilter.text=n),m(n)}),u("onSubmit",function(){_(t);let n=r();return m(n.onSearch())}),o(1,"filters")(2,"div")(3,"label",3),d(4,"Channel"),c(),o(5,"ng-select",4),y("ngModelChange",function(n){_(t);let a=r();return w(a.searchFilter.ChannelID,n)||(a.searchFilter.ChannelID=n),m(n)}),h(6,Ae,3,2,"ng-template",5),c()(),o(7,"div",6)(8,"label",7),d(9,"Page Number"),c(),o(10,"input",8),y("ngModelChange",function(n){_(t);let a=r();return w(a.searchFilter.PageNumber,n)||(a.searchFilter.PageNumber=n),m(n)}),c()(),o(11,"div",6)(12,"label",7),d(13,"Page Size"),c(),o(14,"input",8),y("ngModelChange",function(n){_(t);let a=r();return w(a.searchFilter.RowCount,n)||(a.searchFilter.RowCount=n),m(n)}),c()()(),h(15,je,7,1,"actions",9),v(16,"async"),h(17,ot,30,18,"content",9),v(18,"async"),c()}if(i&2){let t=r();p("headerTitle",t.pageTitle),I("text",t.searchFilter.text),l(5),p("clearable",!1)("items",t.channelOptions),I("ngModel",t.searchFilter.ChannelID),l(5),I("ngModel",t.searchFilter.PageNumber),l(4),I("ngModel",t.searchFilter.RowCount),l(),p("ngIf",T(16,9,t.data$)),l(2),p("ngIf",T(18,11,t.data$))}}var zt=(()=>{let s=class s{constructor(e,n,a,g,C,b,W,Le,Re,Be){this.http=e,this.toastr=n,this.dialog=a,this.productService=g,this.biggerPictureService=C,this.inventoryService=b,this.authService=W,this.mainPanelService=Le,this.exportService=Re,this.decimalPipe=Be,this.infinitePagination=z(U),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",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.hostName=this.authService.getDomain(),this.data$=this.infinitePagination.data$.pipe($(1)),this.channelOptions=W.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe(j(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=M.ALL,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=M.ALL:this.searchFilter.filterModel=M.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let a=this.productService.selectedVariantProduct(e).map(C=>({ID:C.ID,ChannelID:C.Channel[0].ChannelID,Code:C.Code,Price:C.UnitPrice})),g={ListChannelID:[this.searchFilter.ChannelID],ListPrice:a};this.http.post("/api/Price/UpdateChannel",g).subscribe(C=>{this.onSearch(),this.handlingUpdateStock(C.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let n=e.failure_list,a=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",a,n)}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let n={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",n).subscribe(a=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openTableDialog(e,n,a){let g=JSON.parse(JSON.stringify(e));this.dialog.open(Ne,{data:{Name:n.Name,Variant:g,ChannelID:g?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:g?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(A(b=>me.IsNotEmpty(b))).subscribe(b=>{this.updateItemAfterDialog(b,e)})}updateItemAfterDialog(e,n){let a={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",a).subscribe(g=>{let C=this.productService.findChannelById(a.ID,this.channelOptions),b=a.Price?this.decimalPipe.transform(a.Price):a.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${C.Name} to ${b}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=a.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(a=>(a.Variants=a.Variants.map(g=>(g.selected=e,g)),a))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}openExportDialog(){this.dialog.open(Me,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}};s.\u0275fac=function(n){return new(n||s)(f(ge),f(de),f(Ie),f(be),f(Fe),f(N),f(ue),f(we),f(Ee),f(E))},s.\u0275cmp=G({type:s,selectors:[["app-price-single-channel"]],standalone:!0,features:[Z([U,N,ae("https://res.cloudinary.com/"),E]),Q],decls:2,vars:3,consts:[["elsePic",""],["class","single-price",3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[1,"single-price",3,"textChange","onSubmit","headerTitle","text"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src"],[1,"d-flex"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModelChange","toggleChange","ngModel"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-solid","fa-arrow-up-right-from-square"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],[3,"ngClass"],[4,"ngIf","ngIfElse"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"cursor","pointer",3,"click"]],template:function(n,a){n&1&&(h(0,rt,19,13,"mainpanel",1),v(1,"async")),n&2&&p("ngIf",T(1,1,a.loader$))},dependencies:[ie,ee,te,ne,E,ve,ye,Pe,Se,fe,xe,pe,re,se,oe,le,ce,De,ke,Ce,he,Te,Ve],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"],changeDetection:0});let i=s;return i})();export{zt as PriceSingleChannelComponent};
|
|
1
|
+
import{a as N}from"./chunk-WTR5UFZI.js";import{a as M}from"./chunk-XHAXYWZ7.js";import{a as Ne,b as ke,c as U}from"./chunk-B5PFUQJP.js";import{a as _e}from"./chunk-BVIRHZTZ.js";import{a as Ee,b as Me}from"./chunk-AMSVLO4N.js";import{a as De}from"./chunk-N6IHFFFZ.js";import{a as Ve,b as Te}from"./chunk-PD4CUVAW.js";import"./chunk-GCKSYCMI.js";import{a as be}from"./chunk-ZFQW5CVZ.js";import"./chunk-ADRVUMMW.js";import{a as Fe}from"./chunk-XFTUE2ST.js";import"./chunk-HCDKYABV.js";import{a as fe,b as xe,d as Se,e as Pe}from"./chunk-CCXKODFV.js";import{i as ue}from"./chunk-F3MM4SRD.js";import{b as de,e as ge}from"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import{d as Ie,l as we,m as ye,n as ve}from"./chunk-BO4PPSB5.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{b as oe,c as re,h as le,m as ce,o as se,y as pe}from"./chunk-BSN7ZAXG.js";import{c as me,e as he,f as Ce}from"./chunk-64G3XLI6.js";import"./chunk-OVEJFFL6.js";import{$b as u,Bd as E,Cd as ie,Da as _,Ea as m,Eb as h,G as A,Gb as p,Gc as v,Hc as T,Ic as X,Id as ae,Jc as Y,Nb as S,Ob as k,Qb as L,Rb as R,Sb as o,Tb as c,Ub as P,Vb as q,Wb as K,Yb as x,Z as $,bc as r,ea as j,ec as H,gb as D,jb as l,kb as f,mc as J,nc as d,oc as B,pa as z,pc as F,rc as I,sc as w,sd as ee,ta as G,tc as y,uc as Z,vc as Q,vd as te,xc as V,yd as ne}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var O=i=>[i],Ue=i=>({"text-decoration-line-through":i}),Oe=i=>({"bg-gradient-warning":i}),We=i=>({"ms-10":i});function Ae(i,s){if(i&1&&(o(0,"span",10),P(1,"img",11),c(),d(2)),i&2){let t=s.item;l(),p("src",t==null?null:t.Img,D),l(),F(" ",t.Name," ")}}function $e(i,s){if(i&1){let t=x();o(0,"button",16),u("click",function(){_(t);let n=r().ngIf,a=r(2);return m(a.updateStock(n))}),P(1,"i",17),d(2," Update "),c()}}function je(i,s){if(i&1){let t=x();o(0,"actions")(1,"div",12),h(2,$e,3,0,"button",13),o(3,"button",14),u("click",function(){_(t);let n=r(2);return m(n.openExportDialog())}),P(4,"i",15),o(5,"span"),d(6,"Export"),c()()()()}if(i&2){let t=s.ngIf,e=r(2);l(2),p("ngIf",e.productService.hasSelectionVariant(t))}}function ze(i,s){if(i&1){let t=x();o(0,"th")(1,"input",32),u("change",function(n){_(t);let a=r().ngIf,g=r(2);return m(g.onSelectAllSKU(n.target.checked,a))}),c()()}}function Ge(i,s){if(i&1){let t=x();o(0,"input",51),y("ngModelChange",function(n){_(t);let a=r(4).$implicit;return w(a.selected,n)||(a.selected=n),m(n)}),u("ngModelChange",function(){_(t);let n=r(4).$implicit,a=r(3);return m(a.onCheckboxStateProduct(n))}),c()}if(i&2){let t=r(4).$implicit;I("ngModel",t.selected)}}function qe(i,s){if(i&1&&h(0,Ge,1,1,"ng-template",26),i&2){let t=r(6);p("ngxPermissionsOnly",V(1,O,t.rolePriceEdit))}}function Ke(i,s){if(i&1){let t=x();q(0),o(1,"img",52),u("click",function(n){_(t);let a=r(3).$implicit,g=r(3);return m(g.onZoomImage(n,a==null?null:a.ImageUrl))}),c(),K()}if(i&2){let t=r(3).$implicit;l(),H("src",t.ThumbnailUrl,D)}}function He(i,s){i&1&&P(0,"img",53)}function Je(i,s){if(i&1&&(o(0,"small",50),d(1),c()),i&2){let t=r(3).$implicit;l(),F("(",t.Category,")")}}function Ze(i,s){if(i&1&&(o(0,"td",44)(1,"div",45),h(2,qe,1,3,null,26),o(3,"div",46),h(4,Ke,2,1,"ng-container",47)(5,He,1,0,"ng-template",null,0,Y),c()()(),o(7,"td",48)(8,"span",49),d(9),c(),h(10,Je,2,1,"small",50),c()),i&2){let t=J(6),e=r(2).$implicit;p("rowSpan",e.Variants.length),l(2),S((e.Variants==null?null:e.Variants.length)>1?2:-1),l(),p("ngClass",V(8,We,(e.Variants==null?null:e.Variants.length)<=1)),l(),p("ngIf",e.ThumbnailUrl)("ngIfElse",t),l(3),p("rowSpan",e.Variants.length),l(2),B(e.Name),l(),S(e.Category?10:-1)}}function Qe(i,s){if(i&1){let t=x();o(0,"input",56),y("ngModelChange",function(n){_(t);let a=r(2).$implicit;return w(a.selected,n)||(a.selected=n),m(n)}),c()}if(i&2){let t=r(2).$implicit;I("ngModel",t.selected)}}function Xe(i,s){if(i&1&&(o(0,"td",54),h(1,Qe,1,1,"input",55),c()),i&2){let t=r().$implicit;l(),S(t.UnitPrice>=0?1:-1)}}function Ye(i,s){i&1&&(o(0,"div",36),d(1," Not Found "),c())}function et(i,s){if(i&1&&(o(0,"div"),d(1),v(2,"number"),c()),i&2){let t=r().$implicit;l(),F(" ",T(2,1,t.UnitPrice)," ")}}function tt(i,s){if(i&1&&(o(0,"div",37)(1,"a",40),P(2,"i",57),c()()),i&2){let t=r().$implicit,e=r(4);l(),p("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),D)}}function nt(i,s){if(i&1){let t=x();o(0,"div",58),u("click",function(){_(t);let n=r().$implicit,a=r().$implicit,g=r(2).ngIf,C=r();return m(C.openTableDialog(n,a,g))}),d(1),v(2,"number"),c()}if(i&2){let t=r().$implicit;l(),F(" ",T(2,1,t.Channel[0]==null?null:t.Channel[0].Price)," ")}}function it(i,s){if(i&1){let t=x();o(0,"tr",33),h(1,Ze,11,10),o(2,"td",24),d(3),c(),o(4,"td",27)(5,"span",34),d(6),c()(),h(7,Xe,2,1,"ng-template",26),o(8,"td",27)(9,"div",35),h(10,Ye,2,0,"div",36)(11,et,3,3,"div")(12,tt,3,1,"div",37),c()(),o(13,"td",38)(14,"div",35),h(15,nt,3,3,"div",39),o(16,"div",37)(17,"a",40),P(18,"i",41),c()(),o(19,"div",37)(20,"div",42),u("click",function(){let n=_(t).$implicit,a=r(4);return m(a.refreshPrice(n))}),P(21,"i",43),c()()()()()}if(i&2){let t=s.$implicit,e=s.$index,n=r(4);l(),S(e==0?1:-1),l(2),B(t.Model),l(2),p("matTooltip",t.Discontinued?n.discontinuedVariantMsg:"")("ngClass",V(12,Ue,t.Discontinued)),l(),F(" ",t.Code," "),l(),p("ngxPermissionsOnly",V(14,O,n.rolePriceEdit)),l(3),S((t.Channel[0]==null?null:t.Channel[0].Description)!=null?10:-1),l(),S((t.Channel[0]==null?null:t.Channel[0].Description)==null?11:-1),l(),S((t.Channel[0]==null?null:t.Channel[0].Description)==null?12:-1),l(),p("ngClass",V(16,Oe,t.UnitPrice!=(t.Channel[0]==null?null:t.Channel[0].Price))),l(2),S(t.Channel.length>0?15:-1),l(2),p("href",t.Channel[0]==null?null:t.Channel[0].Url,D)}}function at(i,s){if(i&1&&L(0,it,22,18,"tr",33,k),i&2){let t=s.$implicit;R(t.Variants)}}function ot(i,s){if(i&1){let t=x();o(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),o(8,"div")(9,"mat-slide-toggle",23),y("ngModelChange",function(n){_(t);let a=r(2);return w(a.toggleDifferentInventory,n)||(a.toggleDifferentInventory=n),m(n)}),u("toggleChange",function(){_(t);let n=r(2);return m(n.onToggleDifferentInventory())}),o(10,"small",7),d(11,"FILTER DIFFERENT PRICE"),c()()()(),o(12,"th",24),d(13,"Variant"),c(),o(14,"th",25),d(15,"SKU"),c(),h(16,ze,2,0,"ng-template",26),o(17,"th",27),d(18,"POS"),c(),o(19,"th",27)(20,"div",28),u("click",function(){_(t);let n=r(2);return m(n.openModalFilter())}),P(21,"img",29),o(22,"span",30),d(23),v(24,"stringLimit"),c()()()()(),o(25,"tbody"),L(26,at,2,0,null,null,k),c()(),o(28,"infinite-paginator",31),v(29,"async"),u("onNextPage",function(){_(t);let n=r(2);return m(n.infinitePagination.onNextPage(n.searchFilter))})("onLastPage",function(){_(t);let n=r(2);return m(n.infinitePagination.onLastPage(n.searchFilter))})("onGetRowCount",function(){_(t);let n=r(2);return m(n.infinitePagination.getRowCount(n.searchFilter))}),c()()()()}if(i&2){let t=s.ngIf,e=r(2);l(9),I("ngModel",e.toggleDifferentInventory),l(7),p("ngxPermissionsOnly",V(16,O,e.rolePriceEdit)),l(4),p("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?e.selectedChannel==null?null:e.selectedChannel.Name:""),l(),p("src",e.selectedChannel==null?null:e.selectedChannel.Img,D),l(2),F(" ",X(24,11,e.selectedChannel==null?null:e.selectedChannel.Name,20)," "),l(3),R(t),l(2),p("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",T(29,14,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}function rt(i,s){if(i&1){let t=x();o(0,"mainpanel",2),y("textChange",function(n){_(t);let a=r();return w(a.searchFilter.text,n)||(a.searchFilter.text=n),m(n)}),u("onSubmit",function(){_(t);let n=r();return m(n.onSearch())}),o(1,"filters")(2,"div")(3,"label",3),d(4,"Channel"),c(),o(5,"ng-select",4),y("ngModelChange",function(n){_(t);let a=r();return w(a.searchFilter.ChannelID,n)||(a.searchFilter.ChannelID=n),m(n)}),h(6,Ae,3,2,"ng-template",5),c()(),o(7,"div",6)(8,"label",7),d(9,"Page Number"),c(),o(10,"input",8),y("ngModelChange",function(n){_(t);let a=r();return w(a.searchFilter.PageNumber,n)||(a.searchFilter.PageNumber=n),m(n)}),c()(),o(11,"div",6)(12,"label",7),d(13,"Page Size"),c(),o(14,"input",8),y("ngModelChange",function(n){_(t);let a=r();return w(a.searchFilter.RowCount,n)||(a.searchFilter.RowCount=n),m(n)}),c()()(),h(15,je,7,1,"actions",9),v(16,"async"),h(17,ot,30,18,"content",9),v(18,"async"),c()}if(i&2){let t=r();p("headerTitle",t.pageTitle),I("text",t.searchFilter.text),l(5),p("clearable",!1)("items",t.channelOptions),I("ngModel",t.searchFilter.ChannelID),l(5),I("ngModel",t.searchFilter.PageNumber),l(4),I("ngModel",t.searchFilter.RowCount),l(),p("ngIf",T(16,9,t.data$)),l(2),p("ngIf",T(18,11,t.data$))}}var zt=(()=>{let s=class s{constructor(e,n,a,g,C,b,W,Le,Re,Be){this.http=e,this.toastr=n,this.dialog=a,this.productService=g,this.biggerPictureService=C,this.inventoryService=b,this.authService=W,this.mainPanelService=Le,this.exportService=Re,this.decimalPipe=Be,this.infinitePagination=z(U),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",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.hostName=this.authService.getDomain(),this.data$=this.infinitePagination.data$.pipe($(1)),this.channelOptions=W.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe(j(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=M.ALL,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=M.ALL:this.searchFilter.filterModel=M.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let a=this.productService.selectedVariantProduct(e).map(C=>({ID:C.ID,ChannelID:C.Channel[0].ChannelID,Code:C.Code,Price:C.UnitPrice})),g={ListChannelID:[this.searchFilter.ChannelID],ListPrice:a};this.http.post("/api/Price/UpdateChannel",g).subscribe(C=>{this.onSearch(),this.handlingUpdateStock(C.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let n=e.failure_list,a=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",a,n)}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let n={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",n).subscribe(a=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openTableDialog(e,n,a){let g=JSON.parse(JSON.stringify(e));this.dialog.open(Ne,{data:{Name:n.Name,Variant:g,ChannelID:g?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:g?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(A(b=>me.IsNotEmpty(b))).subscribe(b=>{this.updateItemAfterDialog(b,e)})}updateItemAfterDialog(e,n){let a={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",a).subscribe(g=>{let C=this.productService.findChannelById(a.ID,this.channelOptions),b=a.Price?this.decimalPipe.transform(a.Price):a.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${C.Name} to ${b}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=a.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(a=>(a.Variants=a.Variants.map(g=>(g.selected=e,g)),a))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}openExportDialog(){this.dialog.open(Me,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}};s.\u0275fac=function(n){return new(n||s)(f(ge),f(de),f(Ie),f(be),f(Fe),f(N),f(ue),f(we),f(Ee),f(E))},s.\u0275cmp=G({type:s,selectors:[["app-price-single-channel"]],standalone:!0,features:[Z([U,N,ae("https://res.cloudinary.com/"),E]),Q],decls:2,vars:3,consts:[["elsePic",""],["class","single-price",3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[1,"single-price",3,"textChange","onSubmit","headerTitle","text"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src"],[1,"d-flex"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModelChange","toggleChange","ngModel"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-solid","fa-arrow-up-right-from-square"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],[3,"ngClass"],[4,"ngIf","ngIfElse"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"cursor","pointer",3,"click"]],template:function(n,a){n&1&&(h(0,rt,19,13,"mainpanel",1),v(1,"async")),n&2&&p("ngIf",T(1,1,a.loader$))},dependencies:[ie,ee,te,ne,E,ve,ye,Pe,Se,fe,xe,pe,re,se,oe,le,ce,De,ke,Ce,he,Te,Ve],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"],changeDetection:0});let i=s;return i})();export{zt as PriceSingleChannelComponent};
|