marketplacepos 6.31.2 → 6.32.0
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-BDL6VX7O.js → chunk-23QF42EC.js} +1 -1
- package/Marketplace/{chunk-OFLYY6SE.js → chunk-25B2S2RU.js} +1 -1
- package/Marketplace/{chunk-ZNUU6KNL.js → chunk-2FIPIRGE.js} +1 -1
- package/Marketplace/{chunk-3YEPZOWW.js → chunk-2FQFDKZG.js} +1 -1
- package/Marketplace/{chunk-KCPD4Z3X.js → chunk-2IGRFJZH.js} +1 -1
- package/Marketplace/{chunk-UCBUYDAK.js → chunk-437TOLUD.js} +1 -1
- package/Marketplace/chunk-4EWXCLF5.js +1 -0
- package/Marketplace/{chunk-VB4EKTTU.js → chunk-5FO4RY4B.js} +1 -1
- package/Marketplace/{chunk-Y5TU2325.js → chunk-6MQGXJKX.js} +1 -1
- package/Marketplace/{chunk-YHFFMWT4.js → chunk-6XQJQFDD.js} +1 -1
- package/Marketplace/{chunk-UZG65BH3.js → chunk-AATHZXRD.js} +1 -1
- package/Marketplace/{chunk-HDPVYUNM.js → chunk-AQFSKIOT.js} +1 -1
- package/Marketplace/{chunk-BY4A7KFT.js → chunk-BDJDA3UR.js} +1 -1
- package/Marketplace/{chunk-H3AJTV7H.js → chunk-CATPFRZT.js} +1 -1
- package/Marketplace/{chunk-XTQO7LQT.js → chunk-CFH746DO.js} +2 -2
- package/Marketplace/{chunk-4NLZR5G6.js → chunk-CQRUJPRW.js} +1 -1
- package/Marketplace/chunk-CTMKVKBI.js +1 -0
- package/Marketplace/{chunk-LTFRIYVD.js → chunk-DBL74BPX.js} +1 -1
- package/Marketplace/{chunk-B7PRYIER.js → chunk-EAU4IG7O.js} +1 -1
- package/Marketplace/{chunk-KS63PJZE.js → chunk-EHDO475L.js} +1 -1
- package/Marketplace/{chunk-T7PNPUCK.js → chunk-ELKXBB2L.js} +1 -1
- package/Marketplace/{chunk-NZ77VVLC.js → chunk-ESU355JU.js} +1 -1
- package/Marketplace/{chunk-X77IQNIG.js → chunk-F5Z5BMMB.js} +1 -1
- package/Marketplace/{chunk-SS5GOXIZ.js → chunk-F7ZVBDGA.js} +1 -1
- package/Marketplace/{chunk-CMN6WQRQ.js → chunk-FEIOPBRJ.js} +1 -1
- package/Marketplace/{chunk-46MLNUK6.js → chunk-FOIFO4IT.js} +1 -1
- package/Marketplace/{chunk-ZNL4R4ZY.js → chunk-H5HR53KH.js} +1 -1
- package/Marketplace/{chunk-6VEA6GG4.js → chunk-H5JTGSWS.js} +1 -1
- package/Marketplace/{chunk-OQ3SGN6B.js → chunk-H5W3EMYB.js} +1 -1
- package/Marketplace/{chunk-CUFGJCZX.js → chunk-HSKAYNRW.js} +1 -1
- package/Marketplace/{chunk-JVVN7I3K.js → chunk-HYJGVYR3.js} +1 -1
- package/Marketplace/{chunk-VU5XZQJM.js → chunk-I2LNUWKZ.js} +1 -1
- package/Marketplace/{chunk-45SZYPN7.js → chunk-IF5TGEWC.js} +1 -1
- package/Marketplace/{chunk-JURDZGFU.js → chunk-IHWIDZBF.js} +1 -1
- package/Marketplace/{chunk-54E2GKVP.js → chunk-IZRRQZQN.js} +1 -1
- package/Marketplace/{chunk-DEC7P5YC.js → chunk-J3BUF2XZ.js} +1 -1
- package/Marketplace/{chunk-YKBRWOO3.js → chunk-J6QZDOVJ.js} +1 -1
- package/Marketplace/{chunk-VL3JT6OI.js → chunk-JDWZ6OPA.js} +1 -1
- package/Marketplace/{chunk-W7G4WIRL.js → chunk-KIA53ZRS.js} +1 -1
- package/Marketplace/{chunk-RQUENCBZ.js → chunk-LEVO5XO7.js} +1 -1
- package/Marketplace/{chunk-FUPT6QVP.js → chunk-MFOJDYRW.js} +1 -1
- package/Marketplace/{chunk-VSOZTJLX.js → chunk-MOVP6G2O.js} +2 -2
- package/Marketplace/{chunk-ASKT24WA.js → chunk-NMLU7LIO.js} +1 -1
- package/Marketplace/{chunk-DVTJ5IUH.js → chunk-PAWBVKZQ.js} +1 -1
- package/Marketplace/{chunk-56UQOJHL.js → chunk-PBJGE2HY.js} +1 -1
- package/Marketplace/{chunk-LALJHEQ4.js → chunk-RFA7CS6B.js} +1 -1
- package/Marketplace/{chunk-NFKQXOQD.js → chunk-SPE6G6R5.js} +1 -1
- package/Marketplace/{chunk-YN6BGZZ6.js → chunk-SUGYXB64.js} +1 -1
- package/Marketplace/{chunk-5GMAPKUT.js → chunk-SWON3WKA.js} +1 -1
- package/Marketplace/{chunk-6MA3X2DS.js → chunk-TEDENAMD.js} +1 -1
- package/Marketplace/{chunk-DENZQL5X.js → chunk-TQI5VPVU.js} +1 -1
- package/Marketplace/chunk-UBS6I527.js +1 -0
- package/Marketplace/{chunk-743ML6A7.js → chunk-V457FNNR.js} +1 -1
- package/Marketplace/{chunk-PKEJBTNO.js → chunk-WANHMLNX.js} +1 -1
- package/Marketplace/{chunk-DGZJ7ASC.js → chunk-XTDWTHOT.js} +1 -1
- package/Marketplace/{chunk-7J6UH2BT.js → chunk-Y3SRH4WV.js} +1 -1
- package/Marketplace/{chunk-LHRO7M7M.js → chunk-Y7W7NN2Q.js} +1 -1
- package/Marketplace/{chunk-KYZGVVJM.js → chunk-YLPMCVI6.js} +1 -1
- package/Marketplace/{chunk-BGTQQCDH.js → chunk-YUHHLKCN.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-STZJXPG6.js → main-NGG6BP6I.js} +2 -2
- package/package.json +1 -1
- package/Marketplace/chunk-SHPCIBEX.js +0 -1
- package/Marketplace/chunk-VDFAJSCS.js +0 -1
- package/Marketplace/chunk-ZPKMQUVX.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t}from"./chunk-
|
|
1
|
+
import{a as t}from"./chunk-FOIFO4IT.js";import{a as v}from"./chunk-BBLSFVNH.js";import{a as u}from"./chunk-J3PHESB2.js";import"./chunk-RDXDKWLL.js";import"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import"./chunk-5FO4RY4B.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import"./chunk-P5OAPFNC.js";import"./chunk-7R55YTL6.js";import"./chunk-NNVT5X6O.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import"./chunk-45DFJJAO.js";import{c as s,g as c}from"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{$c as l,Eb as a,ic as i,jc as m,kc as p,lc as o,mb as r}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var d=(()=>{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"}]}static{this.\u0275fac=function(n){return new(n||e)}}static{this.\u0275cmp=a({type:e,selectors:[["app-inventory"]],features:[l([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,y){n&1&&(m(0,"nav",0)(1,"div",1)(2,"div"),o(3,"nav-tab",2),p()()(),o(4,"router-outlet")),n&2&&(r(3),i("Tabs",y.inventoryTabs))},dependencies:[u,c,s],encapsulation:2})}}return e})();var A=[{path:"",component:d,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-SUGYXB64.js").then(e=>e.MultiChannelComparison)},canActivate:[t],data:{title:"Inventory Comparison"}},{path:"bychannel",loadComponent(){return import("./chunk-TQI5VPVU.js").then(e=>e.SingleChannelComparisonComponent)},canActivate:[t],data:{title:"Inventory Comparison"}},{path:"channel_summary",loadComponent(){return import("./chunk-H5W3EMYB.js").then(e=>e.ChannelSummaryComponent)},canActivate:[t],data:{title:"Different Inventory"}}]}];export{A as routes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Fe,b as Ie}from"./chunk-RWB2N7TQ.js";import{a as Pe,b as De,c as Ee}from"./chunk-CUFGJCZX.js";import{a as Ne}from"./chunk-W7G4WIRL.js";import{a as j}from"./chunk-HHZM6PB4.js";import{a as Ve}from"./chunk-J5PTSESV.js";import{a as Le,b as Ae}from"./chunk-SEB36UUD.js";import"./chunk-FJYX7L63.js";import"./chunk-D2THPOQ7.js";import{a as Me}from"./chunk-T7PNPUCK.js";import"./chunk-6GSJBXEE.js";import"./chunk-2C6XBRGE.js";import"./chunk-RUHYZ275.js";import"./chunk-3BV4FPZE.js";import{a as Te}from"./chunk-TWRFL73R.js";import"./chunk-7ES2Z445.js";import{a as ke}from"./chunk-KMCVYMXQ.js";import"./chunk-QDKVYF6D.js";import"./chunk-VAYLCOBC.js";import"./chunk-6PI5PUIQ.js";import"./chunk-6VOSRCWX.js";import"./chunk-XSXHGAXP.js";import"./chunk-W2CSYQ6H.js";import"./chunk-ODW7HQHU.js";import"./chunk-TWIWWZUD.js";import"./chunk-ACIMXBIC.js";import"./chunk-67AXBZYF.js";import"./chunk-5QG5PZ7U.js";import"./chunk-KYK2ZFUZ.js";import"./chunk-KXLYQDZR.js";import{a as xe,b as ye}from"./chunk-L7K2JAJV.js";import"./chunk-DEQSZUMF.js";import{a as _e,c as be,e as Se,f as we,g as ve}from"./chunk-NIRJAWTX.js";import{a as Ce}from"./chunk-RDXDKWLL.js";import"./chunk-2GINYFUG.js";import"./chunk-625TQFQL.js";import"./chunk-EDNKI3WA.js";import"./chunk-CM45JN3C.js";import"./chunk-7BEOEYAC.js";import"./chunk-WU3SNCIC.js";import"./chunk-A32JPG5P.js";import"./chunk-JY726AM5.js";import"./chunk-2BS4VK45.js";import"./chunk-TTMPMWUQ.js";import"./chunk-5RV2CJGS.js";import"./chunk-QGNTUEVO.js";import"./chunk-GJXDRPAS.js";import"./chunk-GBUDZCXK.js";import"./chunk-S3MYFAWN.js";import"./chunk-SPNVH2ST.js";import"./chunk-BXA5YUTN.js";import{b as fe}from"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import"./chunk-VB4EKTTU.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import{a as S}from"./chunk-P5OAPFNC.js";import"./chunk-7R55YTL6.js";import{b as c,c as E}from"./chunk-NNVT5X6O.js";import{b as ue,c as he,h as W,m as R,o as ge,z}from"./chunk-BUBQQEYA.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import{b as I,e as O}from"./chunk-45DFJJAO.js";import"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import{B as de,D as me,z as ce}from"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{$c as le,Dc as te,E as G,Eb as N,Ec as ie,Fc as ne,Ga as M,Nc as oe,Oc as s,Pc as L,Qc as A,Sc as x,Tc as y,Uc as k,V as J,Vc as re,Wc as ae,Xc as P,Y as X,bc as w,bd as pe,dc as v,ec as Z,gc as $,hc as ee,ia as V,ic as _,jc as n,kb as Y,kc as r,kd as D,lc as f,ld as F,mb as l,md as se,na as g,sc as T,sd as B,t as K,ua as d,va as m,xc as C,zc as u}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import{a as Q,b as q}from"./chunk-66YHNWRR.js";var Oe=(()=>{class o{constructor(){this.http=g(O),this.toastr=g(I)}printTokopediaShippingLabel(e,t=!1){let i={OrderNumber:e,Printed:t};return this.http.post(S.TokopediaPrintShippingLabel,i)}printTiktokShippingLabel(e,t){let i={ShopID:t,OrderNumber:e};return this.http.post(S.TiktokPrintShippingLabel,i)}printShopeeShippingLabel(e,t){let i={ShopID:t,OrderNumber:e};return this.http.post(S.ShopeePrintShippingLabel,i).pipe(K(a=>(a&&(a.Number=e),a)))}printLazadaShippingLabel(e,t){let i={ShopID:t,OrderNumber:e};return this.http.post(S.LazadaPrintShippingLabel,i)}handleShippingLabelResponse(e,t){switch(t){case c.Tokopedia:let h=window.open("about:blank","_blank");h.document.write(e.File),h.document.close();break;case c.Tiktok:e.data!=null?window.open(e.data.doc_url,"_blank"):this.toastr.error("Cannot Print the Shipping Label,The invoice Number is not set to Pickup","Cannot Print");break;case c.Shopee:var i=Uint8Array.from(atob(e.File),p=>p.charCodeAt(0)),a=new Blob([i],{type:"octet/stream"});E.openDownloadFile(a,`${e?.Number}.pdf`);break;case c.Lazada:e?.result?.data!=null?window.open(e?.result?.data?.pdf_url,"_blank"):this.toastr.error(e.message,"Cannot Print");break}}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();var We=(()=>{class o{constructor(){this.dialogRef=g(_e),this.tandaiSudahDicetak=M(!1)}onCancel(){this.dialogRef.close()}onPrint(){this.dialogRef.close(this.tandaiSudahDicetak()?1:0)}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275cmp=N({type:o,selectors:[["app-print-tokopedia"]],decls:17,vars:1,consts:[[1,"container-fluid"],[1,"text-center","mb-4","fw-bold","mt-6"],[1,"row"],[1,"col-12"],[1,"fs-5"],[1,"d-flex","align-items-center","text-center","justify-content-center","mb-8"],[1,"me-2",3,"ngModelChange","ngModel"],[1,"fs-5","pt-1"],[1,"d-flex","align-items-center","justify-content-center"],[1,"btn","btn-light-blue","text-primary","btn-lg","fw-bold","mx-3",3,"click"],[1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3",3,"click"]],template:function(t,i){t&1&&(n(0,"div",0)(1,"h2",1),s(2,"Cetak label pesanan"),r(),n(3,"mat-dialog-content")(4,"div",2)(5,"div",3)(6,"p",4),s(7,"Kamu akan mencetak label yang berisi detail pesanan"),r(),n(8,"div",5)(9,"mat-checkbox",6),C("ngModelChange",function(h){return i.tandaiSudahDicetak.set(h)}),r(),n(10,"span",7),s(11,'Pesanan telah ditandai sebagai "Sudah Dicetak"'),r()()()()(),n(12,"mat-dialog-actions",8)(13,"button",9),C("click",function(){return i.onCancel()}),s(14,"Cancel"),r(),n(15,"button",10),C("click",function(){return i.onPrint()}),s(16,"Cetak Pesanan"),r()()()),t&2&&(l(9),_("ngModel",i.tandaiSudahDicetak()))},dependencies:[z,W,R,ve,we,Se,Ae,Le],encapsulation:2,changeDetection:0})}}return o})();var U=(()=>{class o{constructor(){this.httpService=g(O),this.shippingLabelService=g(Oe),this.toastrService=g(I),this.dialog=g(be)}printShippingLabel(e){switch(e?.MarketType){case c.Shopee:this.shippingLabelService.printShopeeShippingLabel(e.Number,e.ShopID).subscribe(t=>this.shippingLabelService.handleShippingLabelResponse(t,c.Shopee));break;case c.Tiktok:this.shippingLabelService.printTiktokShippingLabel(e.Number,e.ShopID).subscribe(t=>this.shippingLabelService.handleShippingLabelResponse(t,c.Tiktok));break;case c.Tokopedia:this.dialog.open(We).afterClosed().pipe(G(t=>E.IsNotEmpty(t)),X(t=>this.shippingLabelService.printTokopediaShippingLabel(e.Number,t))).subscribe(t=>this.shippingLabelService.handleShippingLabelResponse(t,c.Tokopedia));break;case c.Lazada:this.shippingLabelService.printLazadaShippingLabel(e.Number,e.ShopID).subscribe(t=>this.shippingLabelService.handleShippingLabelResponse(t,c.Lazada));break;case c.Shopify:this.toastrService.error("Shopify not supported","Error Not supported");break}}printMultipleShippingLabel(e){let t=e.map(a=>({OrderNumber:a.Number,ShopID:a.ShopID})),i="";switch(e[0]?.MarketType){case c.Shopee:i=S.ShopeePrintMultipleShippingLabel;break;case c.Tiktok:i=S.TiktokPrintMultipleShippingLabel;break;case c.Lazada:i=S.LazadaPrintMultipleShippingLabel;break}this.httpService.post(i,t).subscribe(a=>{var h=Uint8Array.from(atob(a.File),Re=>Re.charCodeAt(0)),p=new Blob([h],{type:"octet/stream"});E.openDownloadFile(p,`${a?.Name}.pdf`)})}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275prov=V({token:o,factory:o.\u0275fac})}}return o})();var Be=["contextMenu"],je=o=>({"td-cell-hover":o});function He(o,b){if(o&1){let e=T();n(0,"button",21),C("click",function(){d(e);let i=u(),a=P(0);return m(i.onDowloadShippingLabel(a))}),f(1,"i",22),n(2,"span"),s(3,"Download Shipping Label"),r()()}}function Ue(o,b){o&1&&(n(0,"div",5),f(1,"i",23),n(2,"div")(3,"div",24),s(4,'Please select a channel filter first before using "Select All".'),r()()())}function Qe(o,b){if(o&1){let e=T();n(0,"input",51),k("ngModelChange",function(i){d(e);let a=u().$implicit;return y(a.selected,i)||(a.selected=i),m(i)}),C("ngModelChange",function(){d(e);let i=u(3),a=P(0);return m(i.onSelectOrders(a))}),r()}if(o&2){let e=u().$implicit,t=u(2);x("ngModel",e.selected),_("disabled",t.selectedChannelType()!=null&&t.selectedChannelType()!=e.MarketType)}}function qe(o,b){if(o&1&&f(0,"variants-dropdown",43),o&2){let e=u().$implicit;_("variants",e==null?null:e.Variants)}}function Ke(o,b){if(o&1&&f(0,"variant-with-image",44),o&2){let e=u().$implicit;_("variant",e==null?null:e.Variants[0])}}function Ge(o,b){if(o&1&&(n(0,"span"),s(1),r()),o&2){let e=u().$implicit;l(),A("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function Je(o,b){if(o&1){let e=T();n(0,"button",52),C("click",function(){d(e);let i=u().$implicit,a=u(2);return m(a.onPrintShippingLabel(i))}),f(1,"i",53),r()}}function Xe(o,b){if(o&1){let e=T();n(0,"tr")(1,"td"),w(2,Qe,1,2,"input",35),r(),n(3,"td")(4,"div",36),f(5,"img",37),D(6,"channelImage"),n(7,"div",38)(8,"div"),s(9),r(),n(10,"small",39)(11,"span"),s(12),r()()()()(),n(13,"td")(14,"div",40)(15,"div"),f(16,"order-link",41),r(),n(17,"small"),s(18),D(19,"date"),r(),f(20,"br"),n(21,"small"),f(22,"i",42),s(23),r()()(),n(24,"td"),w(25,qe,1,1,"variants-dropdown",43)(26,Ke,1,1,"variant-with-image",44),r(),n(27,"td",45),s(28),D(29,"number"),r(),n(30,"td",46),C("mouseenter",function(i){let a=d(e).$implicit,h=u(2);return m(h.onMouseEnter(i,a))}),n(31,"div",47)(32,"div",40)(33,"div",48)(34,"span"),s(35),r(),w(36,Ge,2,1,"span"),r(),n(37,"small"),s(38),r()()()(),n(39,"td",49),w(40,Je,2,0,"button",50),r()()}if(o&2){let e=b.$implicit,t=u(2);l(2),v((e==null?null:e.MarketType)!=t.channelType.WooCommerce?2:-1),l(3),_("src",F(6,16,e==null?null:e.MarketType),Y)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),l(4),L(e.Outlet),l(3),L(e.ChannelName),l(4),_("order",e),l(2),A(" ",se(19,18,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),l(5),A(" ",e.Customer," "),l(),oe(pe(23,je,(e.Variants==null?null:e.Variants.length)>1)),l(),v((e.Variants==null?null:e.Variants.length)>1?25:26),l(3),L(F(29,21,e.Amount)),l(7),L(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),l(),v(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?36:-1),l(2),A(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," "),l(2),v((e==null?null:e.MarketType)!=t.channelType.WooCommerce?40:-1)}}function Ye(o,b){if(o&1){let e=T();n(0,"div",18)(1,"table",25)(2,"thead",26)(3,"tr",27)(4,"th",28)(5,"input",29),C("change",function(){d(e);let i=u(),a=P(0);return m(i.onSelectAll(a))}),r()(),n(6,"th",30),s(7,"Outlet"),r(),n(8,"th",30),s(9,"Number"),r(),n(10,"th"),s(11,"Items"),r(),n(12,"th",31),s(13,"Amount"),r(),n(14,"th",32),s(15,"Shipping"),r(),f(16,"th",33),r()(),n(17,"tbody"),$(18,Xe,41,25,"tr",null,Z),r()(),n(20,"app-custom-paginator",34),C("next",function(){d(e);let i=u();return m(i.initAwaitingCollection())})("previous",function(){d(e);let i=u();return m(i.initAwaitingCollection())}),r()()}if(o&2){let e=u(),t=P(0);l(5),_("checked",e.isAllSelected(t)),l(13),ee(t),l(2),_("filter",e.filter())("totaldata",t==null?null:t.length)}}function Ze(o,b){o&1&&(n(0,"div",19),f(1,"app-empty-state"),r())}var ei=(()=>{class o{constructor(){this.printShippingService=g(U),this.orderService=g(j),this.fulfillmentService=g(Fe),this.mainPanelService=g(xe),this.channelType=c,this.selectedOrders=M([]),this.selectedChannelType=B(()=>{let e=null;return this.selectedOrders().length>0&&(e=this.selectedOrders()[0].MarketType),e}),this.showFilterWarning=M(!1),this.isFiltered=B(()=>this.filter().ListChannelID?.length>0),this.filter=M({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null}),this.contextMenuItems=[{id:"refresh",label:"Refresh Shipping",icon:"fa-solid fa-arrows-rotate"},{id:"fulfillment",label:"Set Fulfillment",icon:"fa-solid fa-truck"}]}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:e=>{this.initFromDate(e)},error:e=>{console.error("Error fetching default date:",e),this.initFromDate(null)}})}initFromDate(e){this.filter.update(t=>q(Q({},t),{From:e})),this.initAwaitingCollection()}initAwaitingCollection(){this.awaitingCollections$=this.orderService.getAwaitingCollectionOrders(this.filter()).pipe(J(1))}onPrintShippingLabel(e){this.printShippingService.printShippingLabel(e)}onSelectOrders(e){let t=e.filter(i=>i.selected);this.selectedOrders.set(t)}onDowloadShippingLabel(e){e=e.map(t=>(t.selected=!1,t)),this.printShippingService.printMultipleShippingLabel(this.selectedOrders()),this.selectedOrders.set([])}onSetFulfillment(e){this.fulfillmentService.setFulfillmentOrder(e).subscribe(()=>{this.initAwaitingCollection()})}refreshShippingAndRefNumber(e){this.orderService.refreshShippingCourier(e.ShopID,e.Number).subscribe(()=>{this.initAwaitingCollection()})}onMouseEnter(e,t){(!t.LogisticService?.Name||!t.ReferenceNumber)&&this.contextMenuEl.show(e,t)}onSelectContextItem(e){e.item?.id==="refresh"?this.refreshShippingAndRefNumber(e.data):this.onSetFulfillment(e.data)}isAllSelected(e){let t=this.getSelectableOrders(e);return t.length>0&&t.every(i=>i.selected)}getSelectableOrders(e){return e.filter(t=>t.MarketType!=this.channelType.WooCommerce)}onSelectAll(e){if(!this.filter().ListChannelID?.length){this.showFilterWarning.set(!0),this.mainPanelService.openModalFilter();return}this.showFilterWarning.set(!1);let t=this.getSelectableOrders(e),i=t.every(a=>a.selected);t.forEach(a=>{a.selected=!i}),this.selectedOrders.set(i?[]:[...t])}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275cmp=N({type:o,selectors:[["app-awaiting-collection"]],viewQuery:function(t,i){if(t&1&&te(Be,5),t&2){let a;ie(a=ne())&&(i.contextMenuEl=a.first)}},features:[le([j,U])],decls:38,vars:14,consts:[["contextMenu",""],["headerTitle","Awaiting Collection","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],[1,"btn","btn-outline-secondary","shadow","rounded"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-3"],[1,"fa-regular","fa-tv","me-3"],["role","alert",1,"alert","alert-warning","border-0","rounded-3","py-5","px-4","mb-4","d-flex","align-items-center","gap-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[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","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[3,"onSelectItem","items"],[1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],["aria-hidden","true",1,"fa-solid","fa-arrow-down-to-line","me-3"],[1,"fa-solid","fa-circle-info","fs-4","text-warning"],[1,"text-muted","mt-1",2,"font-size","0.875rem"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","5px"],["type","checkbox",3,"change","checked"],[2,"width","200px"],[1,"text-end",2,"width","100px"],[2,"width","150px"],[2,"width","50px"],["rowCountApi","/api/orders/awaitingcollectioncount",3,"next","previous","filter","totaldata"],["type","checkbox",3,"ngModel","disabled"],[1,"d-flex","align-items-center","gap-3"],[2,"width","20px","height","20px",3,"src","alt"],[1,"lh-base"],[1,"d-flex","align-items-center","gap-2"],[1,"lh-sm"],[2,"font-size","14px",3,"order"],[1,"fa-solid","fa-user"],[3,"variants"],[3,"variant"],[1,"text-end"],[3,"mouseenter"],[1,"d-flex","align-items-center","gap-6"],[1,"d-flex","align-items-end","gap-2"],[1,"text-end","td-cell-hover"],["type","button","aria-label","Print order","title","Print","matTooltip","Download shipping label",1,"btn","p-0","border-0","bg-transparent"],["type","checkbox",3,"ngModelChange","ngModel","disabled"],["type","button","aria-label","Print order","title","Print","matTooltip","Download shipping label",1,"btn","p-0","border-0","bg-transparent",3,"click"],["aria-hidden","true",1,"fa-solid","fa-arrow-down-to-line"]],template:function(t,i){if(t&1){let a=T();re(0),D(1,"async"),n(2,"mainpanel",1),C("onSubmit",function(){return d(a),m(i.initAwaitingCollection())}),k("textChange",function(p){return d(a),y(i.filter().Number,p)||(i.filter().Number=p),m(p)}),n(3,"actions"),w(4,He,4,0,"button",2),n(5,"a",3),f(6,"i",4),n(7,"span"),s(8,"Order Fulfillment Display"),r()()(),n(9,"filters"),w(10,Ue,5,0,"div",5),n(11,"div")(12,"label",6),s(13,"Channel"),r(),n(14,"app-channel-options-v2",7),k("ngModelChange",function(p){return d(a),y(i.filter().ListChannelID,p)||(i.filter().ListChannelID=p),m(p)}),r()(),n(15,"div",8)(16,"label",6),s(17,"From/To"),r(),n(18,"div",9)(19,"datepicker",10),k("dateChange",function(p){return d(a),y(i.filter().From,p)||(i.filter().From=p),m(p)}),r()(),n(20,"div")(21,"datepicker",11),k("dateChange",function(p){return d(a),y(i.filter().To,p)||(i.filter().To=p),m(p)}),r()()(),n(22,"div",8)(23,"label",12),s(24,"Page Number"),r(),n(25,"input",13),k("ngModelChange",function(p){return d(a),y(i.filter().PageNumber,p)||(i.filter().PageNumber=p),m(p)}),r()(),n(26,"div",8)(27,"label",12),s(28,"Page Size"),r(),n(29,"input",14),k("ngModelChange",function(p){return d(a),y(i.filter().PageSize,p)||(i.filter().PageSize=p),m(p)}),r()()(),n(30,"content")(31,"div",15)(32,"div",16)(33,"div",17),w(34,Ye,21,3,"div",18)(35,Ze,2,0,"div",19),r()()()()(),n(36,"app-context-menu",20,0),C("onSelectItem",function(p){return d(a),m(i.onSelectContextItem(p))}),r()}if(t&2){let a=ae(F(1,11,i.awaitingCollections$));l(2),x("text",i.filter().Number),l(2),v(i.selectedOrders().length>0?4:-1),l(6),v(i.showFilterWarning()?10:-1),l(4),_("multiple",!0),x("ngModel",i.filter().ListChannelID),l(5),x("date",i.filter().From),l(2),x("date",i.filter().To),l(4),x("ngModel",i.filter().PageNumber),l(4),x("ngModel",i.filter().PageSize),l(5),v((a==null?null:a.length)>0?34:35),l(2),_("items",i.contextMenuItems)}},dependencies:[ye,ke,Te,z,he,ge,ue,W,R,De,Ee,Ve,Ce,fe,Ne,Ie,Me,Pe,ce,de,me],encapsulation:2,changeDetection:0})}}return o})();export{ei as AwaitingCollectionComponent};
|
|
1
|
+
import{a as Fe,b as Ie}from"./chunk-RWB2N7TQ.js";import{a as Pe,b as De,c as Ee}from"./chunk-HSKAYNRW.js";import{a as Ne}from"./chunk-KIA53ZRS.js";import{a as j}from"./chunk-HHZM6PB4.js";import{a as Ve}from"./chunk-J5PTSESV.js";import{a as Le,b as Ae}from"./chunk-SEB36UUD.js";import"./chunk-FJYX7L63.js";import"./chunk-D2THPOQ7.js";import{a as Me}from"./chunk-ELKXBB2L.js";import"./chunk-6GSJBXEE.js";import"./chunk-2C6XBRGE.js";import"./chunk-RUHYZ275.js";import"./chunk-3BV4FPZE.js";import{a as Te}from"./chunk-TWRFL73R.js";import"./chunk-7ES2Z445.js";import{a as ke}from"./chunk-KMCVYMXQ.js";import"./chunk-QDKVYF6D.js";import"./chunk-VAYLCOBC.js";import"./chunk-6PI5PUIQ.js";import"./chunk-6VOSRCWX.js";import"./chunk-XSXHGAXP.js";import"./chunk-W2CSYQ6H.js";import"./chunk-ODW7HQHU.js";import"./chunk-TWIWWZUD.js";import"./chunk-ACIMXBIC.js";import"./chunk-67AXBZYF.js";import"./chunk-5QG5PZ7U.js";import"./chunk-KYK2ZFUZ.js";import"./chunk-KXLYQDZR.js";import{a as xe,b as ye}from"./chunk-L7K2JAJV.js";import"./chunk-DEQSZUMF.js";import{a as _e,c as be,e as Se,f as we,g as ve}from"./chunk-NIRJAWTX.js";import{a as Ce}from"./chunk-RDXDKWLL.js";import"./chunk-2GINYFUG.js";import"./chunk-625TQFQL.js";import"./chunk-EDNKI3WA.js";import"./chunk-CM45JN3C.js";import"./chunk-7BEOEYAC.js";import"./chunk-WU3SNCIC.js";import"./chunk-A32JPG5P.js";import"./chunk-JY726AM5.js";import"./chunk-2BS4VK45.js";import"./chunk-TTMPMWUQ.js";import"./chunk-5RV2CJGS.js";import"./chunk-QGNTUEVO.js";import"./chunk-GJXDRPAS.js";import"./chunk-GBUDZCXK.js";import"./chunk-S3MYFAWN.js";import"./chunk-SPNVH2ST.js";import"./chunk-BXA5YUTN.js";import{b as fe}from"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import"./chunk-5FO4RY4B.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import{a as S}from"./chunk-P5OAPFNC.js";import"./chunk-7R55YTL6.js";import{b as c,c as E}from"./chunk-NNVT5X6O.js";import{b as ue,c as he,h as W,m as R,o as ge,z}from"./chunk-BUBQQEYA.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import{b as I,e as O}from"./chunk-45DFJJAO.js";import"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import{B as de,D as me,z as ce}from"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{$c as le,Dc as te,E as G,Eb as N,Ec as ie,Fc as ne,Ga as M,Nc as oe,Oc as s,Pc as L,Qc as A,Sc as x,Tc as y,Uc as k,V as J,Vc as re,Wc as ae,Xc as P,Y as X,bc as w,bd as pe,dc as v,ec as Z,gc as $,hc as ee,ia as V,ic as _,jc as n,kb as Y,kc as r,kd as D,lc as f,ld as F,mb as l,md as se,na as g,sc as T,sd as B,t as K,ua as d,va as m,xc as C,zc as u}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import{a as Q,b as q}from"./chunk-66YHNWRR.js";var Oe=(()=>{class o{constructor(){this.http=g(O),this.toastr=g(I)}printTokopediaShippingLabel(e,t=!1){let i={OrderNumber:e,Printed:t};return this.http.post(S.TokopediaPrintShippingLabel,i)}printTiktokShippingLabel(e,t){let i={ShopID:t,OrderNumber:e};return this.http.post(S.TiktokPrintShippingLabel,i)}printShopeeShippingLabel(e,t){let i={ShopID:t,OrderNumber:e};return this.http.post(S.ShopeePrintShippingLabel,i).pipe(K(a=>(a&&(a.Number=e),a)))}printLazadaShippingLabel(e,t){let i={ShopID:t,OrderNumber:e};return this.http.post(S.LazadaPrintShippingLabel,i)}handleShippingLabelResponse(e,t){switch(t){case c.Tokopedia:let h=window.open("about:blank","_blank");h.document.write(e.File),h.document.close();break;case c.Tiktok:e.data!=null?window.open(e.data.doc_url,"_blank"):this.toastr.error("Cannot Print the Shipping Label,The invoice Number is not set to Pickup","Cannot Print");break;case c.Shopee:var i=Uint8Array.from(atob(e.File),p=>p.charCodeAt(0)),a=new Blob([i],{type:"octet/stream"});E.openDownloadFile(a,`${e?.Number}.pdf`);break;case c.Lazada:e?.result?.data!=null?window.open(e?.result?.data?.pdf_url,"_blank"):this.toastr.error(e.message,"Cannot Print");break}}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275prov=V({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();var We=(()=>{class o{constructor(){this.dialogRef=g(_e),this.tandaiSudahDicetak=M(!1)}onCancel(){this.dialogRef.close()}onPrint(){this.dialogRef.close(this.tandaiSudahDicetak()?1:0)}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275cmp=N({type:o,selectors:[["app-print-tokopedia"]],decls:17,vars:1,consts:[[1,"container-fluid"],[1,"text-center","mb-4","fw-bold","mt-6"],[1,"row"],[1,"col-12"],[1,"fs-5"],[1,"d-flex","align-items-center","text-center","justify-content-center","mb-8"],[1,"me-2",3,"ngModelChange","ngModel"],[1,"fs-5","pt-1"],[1,"d-flex","align-items-center","justify-content-center"],[1,"btn","btn-light-blue","text-primary","btn-lg","fw-bold","mx-3",3,"click"],[1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3",3,"click"]],template:function(t,i){t&1&&(n(0,"div",0)(1,"h2",1),s(2,"Cetak label pesanan"),r(),n(3,"mat-dialog-content")(4,"div",2)(5,"div",3)(6,"p",4),s(7,"Kamu akan mencetak label yang berisi detail pesanan"),r(),n(8,"div",5)(9,"mat-checkbox",6),C("ngModelChange",function(h){return i.tandaiSudahDicetak.set(h)}),r(),n(10,"span",7),s(11,'Pesanan telah ditandai sebagai "Sudah Dicetak"'),r()()()()(),n(12,"mat-dialog-actions",8)(13,"button",9),C("click",function(){return i.onCancel()}),s(14,"Cancel"),r(),n(15,"button",10),C("click",function(){return i.onPrint()}),s(16,"Cetak Pesanan"),r()()()),t&2&&(l(9),_("ngModel",i.tandaiSudahDicetak()))},dependencies:[z,W,R,ve,we,Se,Ae,Le],encapsulation:2,changeDetection:0})}}return o})();var U=(()=>{class o{constructor(){this.httpService=g(O),this.shippingLabelService=g(Oe),this.toastrService=g(I),this.dialog=g(be)}printShippingLabel(e){switch(e?.MarketType){case c.Shopee:this.shippingLabelService.printShopeeShippingLabel(e.Number,e.ShopID).subscribe(t=>this.shippingLabelService.handleShippingLabelResponse(t,c.Shopee));break;case c.Tiktok:this.shippingLabelService.printTiktokShippingLabel(e.Number,e.ShopID).subscribe(t=>this.shippingLabelService.handleShippingLabelResponse(t,c.Tiktok));break;case c.Tokopedia:this.dialog.open(We).afterClosed().pipe(G(t=>E.IsNotEmpty(t)),X(t=>this.shippingLabelService.printTokopediaShippingLabel(e.Number,t))).subscribe(t=>this.shippingLabelService.handleShippingLabelResponse(t,c.Tokopedia));break;case c.Lazada:this.shippingLabelService.printLazadaShippingLabel(e.Number,e.ShopID).subscribe(t=>this.shippingLabelService.handleShippingLabelResponse(t,c.Lazada));break;case c.Shopify:this.toastrService.error("Shopify not supported","Error Not supported");break}}printMultipleShippingLabel(e){let t=e.map(a=>({OrderNumber:a.Number,ShopID:a.ShopID})),i="";switch(e[0]?.MarketType){case c.Shopee:i=S.ShopeePrintMultipleShippingLabel;break;case c.Tiktok:i=S.TiktokPrintMultipleShippingLabel;break;case c.Lazada:i=S.LazadaPrintMultipleShippingLabel;break}this.httpService.post(i,t).subscribe(a=>{var h=Uint8Array.from(atob(a.File),Re=>Re.charCodeAt(0)),p=new Blob([h],{type:"octet/stream"});E.openDownloadFile(p,`${a?.Name}.pdf`)})}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275prov=V({token:o,factory:o.\u0275fac})}}return o})();var Be=["contextMenu"],je=o=>({"td-cell-hover":o});function He(o,b){if(o&1){let e=T();n(0,"button",21),C("click",function(){d(e);let i=u(),a=P(0);return m(i.onDowloadShippingLabel(a))}),f(1,"i",22),n(2,"span"),s(3,"Download Shipping Label"),r()()}}function Ue(o,b){o&1&&(n(0,"div",5),f(1,"i",23),n(2,"div")(3,"div",24),s(4,'Please select a channel filter first before using "Select All".'),r()()())}function Qe(o,b){if(o&1){let e=T();n(0,"input",51),k("ngModelChange",function(i){d(e);let a=u().$implicit;return y(a.selected,i)||(a.selected=i),m(i)}),C("ngModelChange",function(){d(e);let i=u(3),a=P(0);return m(i.onSelectOrders(a))}),r()}if(o&2){let e=u().$implicit,t=u(2);x("ngModel",e.selected),_("disabled",t.selectedChannelType()!=null&&t.selectedChannelType()!=e.MarketType)}}function qe(o,b){if(o&1&&f(0,"variants-dropdown",43),o&2){let e=u().$implicit;_("variants",e==null?null:e.Variants)}}function Ke(o,b){if(o&1&&f(0,"variant-with-image",44),o&2){let e=u().$implicit;_("variant",e==null?null:e.Variants[0])}}function Ge(o,b){if(o&1&&(n(0,"span"),s(1),r()),o&2){let e=u().$implicit;l(),A("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function Je(o,b){if(o&1){let e=T();n(0,"button",52),C("click",function(){d(e);let i=u().$implicit,a=u(2);return m(a.onPrintShippingLabel(i))}),f(1,"i",53),r()}}function Xe(o,b){if(o&1){let e=T();n(0,"tr")(1,"td"),w(2,Qe,1,2,"input",35),r(),n(3,"td")(4,"div",36),f(5,"img",37),D(6,"channelImage"),n(7,"div",38)(8,"div"),s(9),r(),n(10,"small",39)(11,"span"),s(12),r()()()()(),n(13,"td")(14,"div",40)(15,"div"),f(16,"order-link",41),r(),n(17,"small"),s(18),D(19,"date"),r(),f(20,"br"),n(21,"small"),f(22,"i",42),s(23),r()()(),n(24,"td"),w(25,qe,1,1,"variants-dropdown",43)(26,Ke,1,1,"variant-with-image",44),r(),n(27,"td",45),s(28),D(29,"number"),r(),n(30,"td",46),C("mouseenter",function(i){let a=d(e).$implicit,h=u(2);return m(h.onMouseEnter(i,a))}),n(31,"div",47)(32,"div",40)(33,"div",48)(34,"span"),s(35),r(),w(36,Ge,2,1,"span"),r(),n(37,"small"),s(38),r()()()(),n(39,"td",49),w(40,Je,2,0,"button",50),r()()}if(o&2){let e=b.$implicit,t=u(2);l(2),v((e==null?null:e.MarketType)!=t.channelType.WooCommerce?2:-1),l(3),_("src",F(6,16,e==null?null:e.MarketType),Y)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),l(4),L(e.Outlet),l(3),L(e.ChannelName),l(4),_("order",e),l(2),A(" ",se(19,18,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),l(5),A(" ",e.Customer," "),l(),oe(pe(23,je,(e.Variants==null?null:e.Variants.length)>1)),l(),v((e.Variants==null?null:e.Variants.length)>1?25:26),l(3),L(F(29,21,e.Amount)),l(7),L(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),l(),v(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?36:-1),l(2),A(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," "),l(2),v((e==null?null:e.MarketType)!=t.channelType.WooCommerce?40:-1)}}function Ye(o,b){if(o&1){let e=T();n(0,"div",18)(1,"table",25)(2,"thead",26)(3,"tr",27)(4,"th",28)(5,"input",29),C("change",function(){d(e);let i=u(),a=P(0);return m(i.onSelectAll(a))}),r()(),n(6,"th",30),s(7,"Outlet"),r(),n(8,"th",30),s(9,"Number"),r(),n(10,"th"),s(11,"Items"),r(),n(12,"th",31),s(13,"Amount"),r(),n(14,"th",32),s(15,"Shipping"),r(),f(16,"th",33),r()(),n(17,"tbody"),$(18,Xe,41,25,"tr",null,Z),r()(),n(20,"app-custom-paginator",34),C("next",function(){d(e);let i=u();return m(i.initAwaitingCollection())})("previous",function(){d(e);let i=u();return m(i.initAwaitingCollection())}),r()()}if(o&2){let e=u(),t=P(0);l(5),_("checked",e.isAllSelected(t)),l(13),ee(t),l(2),_("filter",e.filter())("totaldata",t==null?null:t.length)}}function Ze(o,b){o&1&&(n(0,"div",19),f(1,"app-empty-state"),r())}var ei=(()=>{class o{constructor(){this.printShippingService=g(U),this.orderService=g(j),this.fulfillmentService=g(Fe),this.mainPanelService=g(xe),this.channelType=c,this.selectedOrders=M([]),this.selectedChannelType=B(()=>{let e=null;return this.selectedOrders().length>0&&(e=this.selectedOrders()[0].MarketType),e}),this.showFilterWarning=M(!1),this.isFiltered=B(()=>this.filter().ListChannelID?.length>0),this.filter=M({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null}),this.contextMenuItems=[{id:"refresh",label:"Refresh Shipping",icon:"fa-solid fa-arrows-rotate"},{id:"fulfillment",label:"Set Fulfillment",icon:"fa-solid fa-truck"}]}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:e=>{this.initFromDate(e)},error:e=>{console.error("Error fetching default date:",e),this.initFromDate(null)}})}initFromDate(e){this.filter.update(t=>q(Q({},t),{From:e})),this.initAwaitingCollection()}initAwaitingCollection(){this.awaitingCollections$=this.orderService.getAwaitingCollectionOrders(this.filter()).pipe(J(1))}onPrintShippingLabel(e){this.printShippingService.printShippingLabel(e)}onSelectOrders(e){let t=e.filter(i=>i.selected);this.selectedOrders.set(t)}onDowloadShippingLabel(e){e=e.map(t=>(t.selected=!1,t)),this.printShippingService.printMultipleShippingLabel(this.selectedOrders()),this.selectedOrders.set([])}onSetFulfillment(e){this.fulfillmentService.setFulfillmentOrder(e).subscribe(()=>{this.initAwaitingCollection()})}refreshShippingAndRefNumber(e){this.orderService.refreshShippingCourier(e.ShopID,e.Number).subscribe(()=>{this.initAwaitingCollection()})}onMouseEnter(e,t){(!t.LogisticService?.Name||!t.ReferenceNumber)&&this.contextMenuEl.show(e,t)}onSelectContextItem(e){e.item?.id==="refresh"?this.refreshShippingAndRefNumber(e.data):this.onSetFulfillment(e.data)}isAllSelected(e){let t=this.getSelectableOrders(e);return t.length>0&&t.every(i=>i.selected)}getSelectableOrders(e){return e.filter(t=>t.MarketType!=this.channelType.WooCommerce)}onSelectAll(e){if(!this.filter().ListChannelID?.length){this.showFilterWarning.set(!0),this.mainPanelService.openModalFilter();return}this.showFilterWarning.set(!1);let t=this.getSelectableOrders(e),i=t.every(a=>a.selected);t.forEach(a=>{a.selected=!i}),this.selectedOrders.set(i?[]:[...t])}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275cmp=N({type:o,selectors:[["app-awaiting-collection"]],viewQuery:function(t,i){if(t&1&&te(Be,5),t&2){let a;ie(a=ne())&&(i.contextMenuEl=a.first)}},features:[le([j,U])],decls:38,vars:14,consts:[["contextMenu",""],["headerTitle","Awaiting Collection","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],[1,"btn","btn-outline-secondary","shadow","rounded"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-3"],[1,"fa-regular","fa-tv","me-3"],["role","alert",1,"alert","alert-warning","border-0","rounded-3","py-5","px-4","mb-4","d-flex","align-items-center","gap-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[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","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[3,"onSelectItem","items"],[1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],["aria-hidden","true",1,"fa-solid","fa-arrow-down-to-line","me-3"],[1,"fa-solid","fa-circle-info","fs-4","text-warning"],[1,"text-muted","mt-1",2,"font-size","0.875rem"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","5px"],["type","checkbox",3,"change","checked"],[2,"width","200px"],[1,"text-end",2,"width","100px"],[2,"width","150px"],[2,"width","50px"],["rowCountApi","/api/orders/awaitingcollectioncount",3,"next","previous","filter","totaldata"],["type","checkbox",3,"ngModel","disabled"],[1,"d-flex","align-items-center","gap-3"],[2,"width","20px","height","20px",3,"src","alt"],[1,"lh-base"],[1,"d-flex","align-items-center","gap-2"],[1,"lh-sm"],[2,"font-size","14px",3,"order"],[1,"fa-solid","fa-user"],[3,"variants"],[3,"variant"],[1,"text-end"],[3,"mouseenter"],[1,"d-flex","align-items-center","gap-6"],[1,"d-flex","align-items-end","gap-2"],[1,"text-end","td-cell-hover"],["type","button","aria-label","Print order","title","Print","matTooltip","Download shipping label",1,"btn","p-0","border-0","bg-transparent"],["type","checkbox",3,"ngModelChange","ngModel","disabled"],["type","button","aria-label","Print order","title","Print","matTooltip","Download shipping label",1,"btn","p-0","border-0","bg-transparent",3,"click"],["aria-hidden","true",1,"fa-solid","fa-arrow-down-to-line"]],template:function(t,i){if(t&1){let a=T();re(0),D(1,"async"),n(2,"mainpanel",1),C("onSubmit",function(){return d(a),m(i.initAwaitingCollection())}),k("textChange",function(p){return d(a),y(i.filter().Number,p)||(i.filter().Number=p),m(p)}),n(3,"actions"),w(4,He,4,0,"button",2),n(5,"a",3),f(6,"i",4),n(7,"span"),s(8,"Order Fulfillment Display"),r()()(),n(9,"filters"),w(10,Ue,5,0,"div",5),n(11,"div")(12,"label",6),s(13,"Channel"),r(),n(14,"app-channel-options-v2",7),k("ngModelChange",function(p){return d(a),y(i.filter().ListChannelID,p)||(i.filter().ListChannelID=p),m(p)}),r()(),n(15,"div",8)(16,"label",6),s(17,"From/To"),r(),n(18,"div",9)(19,"datepicker",10),k("dateChange",function(p){return d(a),y(i.filter().From,p)||(i.filter().From=p),m(p)}),r()(),n(20,"div")(21,"datepicker",11),k("dateChange",function(p){return d(a),y(i.filter().To,p)||(i.filter().To=p),m(p)}),r()()(),n(22,"div",8)(23,"label",12),s(24,"Page Number"),r(),n(25,"input",13),k("ngModelChange",function(p){return d(a),y(i.filter().PageNumber,p)||(i.filter().PageNumber=p),m(p)}),r()(),n(26,"div",8)(27,"label",12),s(28,"Page Size"),r(),n(29,"input",14),k("ngModelChange",function(p){return d(a),y(i.filter().PageSize,p)||(i.filter().PageSize=p),m(p)}),r()()(),n(30,"content")(31,"div",15)(32,"div",16)(33,"div",17),w(34,Ye,21,3,"div",18)(35,Ze,2,0,"div",19),r()()()()(),n(36,"app-context-menu",20,0),C("onSelectItem",function(p){return d(a),m(i.onSelectContextItem(p))}),r()}if(t&2){let a=ae(F(1,11,i.awaitingCollections$));l(2),x("text",i.filter().Number),l(2),v(i.selectedOrders().length>0?4:-1),l(6),v(i.showFilterWarning()?10:-1),l(4),_("multiple",!0),x("ngModel",i.filter().ListChannelID),l(5),x("date",i.filter().From),l(2),x("date",i.filter().To),l(4),x("ngModel",i.filter().PageNumber),l(4),x("ngModel",i.filter().PageSize),l(5),v((a==null?null:a.length)>0?34:35),l(2),_("items",i.contextMenuItems)}},dependencies:[ye,ke,Te,z,he,ge,ue,W,R,De,Ee,Ve,Ce,fe,Ne,Ie,Me,Pe,ce,de,me],encapsulation:2,changeDetection:0})}}return o})();export{ei as AwaitingCollectionComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ne}from"./chunk-MIMZDUDP.js";import{a as te}from"./chunk-ZEALEXSH.js";import{a as ee}from"./chunk-J5PTSESV.js";import"./chunk-26I3WOHT.js";import"./chunk-72AE6737.js";import{a as $}from"./chunk-KMCVYMXQ.js";import"./chunk-ACIMXBIC.js";import{a as X,b as Y,d as Z}from"./chunk-KXLYQDZR.js";import{b as Q}from"./chunk-L7K2JAJV.js";import"./chunk-DEQSZUMF.js";import"./chunk-NIRJAWTX.js";import"./chunk-RDXDKWLL.js";import"./chunk-2GINYFUG.js";import"./chunk-625TQFQL.js";import"./chunk-EDNKI3WA.js";import"./chunk-CM45JN3C.js";import"./chunk-7BEOEYAC.js";import"./chunk-WU3SNCIC.js";import"./chunk-A32JPG5P.js";import"./chunk-JY726AM5.js";import"./chunk-2BS4VK45.js";import"./chunk-TTMPMWUQ.js";import"./chunk-5RV2CJGS.js";import"./chunk-QGNTUEVO.js";import"./chunk-GJXDRPAS.js";import"./chunk-GBUDZCXK.js";import"./chunk-S3MYFAWN.js";import"./chunk-BXA5YUTN.js";import"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import{h as U}from"./chunk-
|
|
1
|
+
import{a as ne}from"./chunk-MIMZDUDP.js";import{a as te}from"./chunk-ZEALEXSH.js";import{a as ee}from"./chunk-J5PTSESV.js";import"./chunk-26I3WOHT.js";import"./chunk-72AE6737.js";import{a as $}from"./chunk-KMCVYMXQ.js";import"./chunk-ACIMXBIC.js";import{a as X,b as Y,d as Z}from"./chunk-KXLYQDZR.js";import{b as Q}from"./chunk-L7K2JAJV.js";import"./chunk-DEQSZUMF.js";import"./chunk-NIRJAWTX.js";import"./chunk-RDXDKWLL.js";import"./chunk-2GINYFUG.js";import"./chunk-625TQFQL.js";import"./chunk-EDNKI3WA.js";import"./chunk-CM45JN3C.js";import"./chunk-7BEOEYAC.js";import"./chunk-WU3SNCIC.js";import"./chunk-A32JPG5P.js";import"./chunk-JY726AM5.js";import"./chunk-2BS4VK45.js";import"./chunk-TTMPMWUQ.js";import"./chunk-5RV2CJGS.js";import"./chunk-QGNTUEVO.js";import"./chunk-GJXDRPAS.js";import"./chunk-GBUDZCXK.js";import"./chunk-S3MYFAWN.js";import"./chunk-BXA5YUTN.js";import"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import{h as U}from"./chunk-5FO4RY4B.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import"./chunk-P5OAPFNC.js";import"./chunk-7R55YTL6.js";import"./chunk-NNVT5X6O.js";import{c as W,h as j,m as q,o as K,z as J}from"./chunk-BUBQQEYA.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import{e as H}from"./chunk-45DFJJAO.js";import{e as B}from"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import{B as V}from"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{Eb as T,Ga as s,Kb as L,Lc as P,Oc as p,Pc as h,Qc as S,Sc as R,Tc as k,Uc as F,ad as O,bc as M,bd as z,dc as N,fc as x,gc as E,hc as w,ic as d,jc as t,kb as I,kc as n,kd as A,lc as C,mb as m,md as G,na as v,sc as D,ua as y,va as b,xc as g,zc as f}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import{a as u,b as _}from"./chunk-66YHNWRR.js";var ie=()=>["/menu/log/inventory/sync-inventory/detail"],oe=a=>({ID:a});function ae(a,c){if(a&1&&(t(0,"span",19),C(1,"img",20),n(),p(2)),a&2){let e=c.item;m(),d("src",e.Img,I)("alt",e.Name),m(),S(" ",e.Name," ")}}function re(a,c){if(a&1&&(t(0,"tr")(1,"td")(2,"a",25),p(3),A(4,"date"),n()(),t(5,"td"),p(6),n(),t(7,"td"),p(8),n(),t(9,"td"),p(10),n(),t(11,"td"),p(12),n()()),a&2){let e=c.$implicit;P("bg-gradient-warning",e.ResponseCode==400),m(2),d("routerLink",O(12,ie))("queryParams",z(13,oe,e.ID)),m(),S(" ",G(4,9,e.Created,"dd MMM yyyy HH:mm")," "),m(3),h(e.channelName),m(2),h(e.Sku),m(2),h(e.Stock),m(2),h(e.ResponseCode)}}function le(a,c){if(a&1){let e=D();t(0,"div",17)(1,"table",21)(2,"thead")(3,"tr",22)(4,"th"),p(5,"Created"),n(),t(6,"th"),p(7,"Channel"),n(),t(8,"th"),p(9,"SKU"),n(),t(10,"th"),p(11,"Stock"),n(),t(12,"th"),p(13,"Response code"),n()()(),t(14,"tbody"),E(15,re,13,15,"tr",23,x),n()(),t(17,"mat-paginator",24),g("page",function(i){y(e);let o=f();return b(o.changePage(i))}),n()()}if(a&2){let e=f();m(15),w(e.Result()),m(2),d("length",e.paginationTotal())("pageSize",e.paginationPageSize())("pageIndex",e.filter().PageNumber==0?0:e.filter().PageNumber-1)}}function me(a,c){a&1&&(t(0,"div",18),C(1,"app-empty-state"),n())}var Me=(()=>{class a{constructor(){this.http=v(H),this._RawLogService=v(ne),this.authService=v(U),this.Result=s([]),this.filter=s({PageNumber:0,RowCount:20,Sku:null,ChannelID:"",StatusCode:"",From:"",To:""}),this.ActionTypeList=s(null),this.paginationTotal=s(0),this.paginationPageSize=s(0),this.channelOptions=s(this.authService.getChannels()),this.Number=s(null),this.Load()}Load(){this.http.post("/api/OrdersLoader/Get",{}).subscribe(e=>{this.filter.update(r=>u(u({},r),e.Filter)),this.ActionTypeList.set(e.Options.ActionTypeList),this.Get()})}Get(e){e!=null&&this.filter.update(r=>_(u({},r),{Sku:e})),this.http.post("api/Inventory/GetLog",this.filter()).subscribe(r=>{this._RawLogService.Data=r.hits;let i=[];for(let o of r.hits){let l={ID:o._source.log.id,Created:o._source["@timestamp_received"],channelName:o._source.log.channelName,Sku:o._source.log.sku,Stock:o._source.log.stock,ResponseCode:o._source.log.responseCode};i.push(l)}this.Result.set(i),this.paginationTotal.set(r.total.value),this.paginationPageSize.set(this.filter().RowCount>this.paginationTotal()?this.paginationTotal():this.filter().RowCount)})}changePage(e){this.filter.update(r=>_(u({},r),{PageNumber:e.pageIndex+1})),this.Get()}updateFilter(e,r){this.filter.update(i=>_(u({},i),{[e]:r}))}static{this.\u0275fac=function(r){return new(r||a)}}static{this.\u0275cmp=T({type:a,selectors:[["app-inventory-log"]],decls:32,vars:9,consts:[["headerTitle","Channel 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"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table","table-hover"],[1,"table-light"],[3,"bg-gradient-warning"],[3,"page","length","pageSize","pageIndex"],[3,"routerLink","queryParams"]],template:function(r,i){if(r&1&&(t(0,"mainpanel",0),F("textChange",function(l){return k(i.filter().Sku,l)||(i.filter().Sku=l),l}),g("onSubmit",function(l){return i.Get(l)}),t(1,"actions")(2,"a",1),p(3," Order Inventory Sync Job "),n()(),t(4,"filters")(5,"div",2)(6,"div")(7,"label",3),p(8,"Channel"),n(),t(9,"ng-select",4),g("ngModelChange",function(l){return i.updateFilter("ChannelID",l)}),L(10,ae,3,3,"ng-template",5),n()(),t(11,"div",6)(12,"label",7),p(13,"From/To"),n(),t(14,"div",8)(15,"datepicker",9),g("dateChange",function(l){return i.updateFilter("From",l)}),n()(),t(16,"div")(17,"datepicker",10),g("dateChange",function(l){return i.updateFilter("To",l)}),n()()(),t(18,"div",6)(19,"label",11),p(20,"Page Number"),n(),t(21,"input",12),g("ngModelChange",function(l){return i.updateFilter("PageNumber",l)}),n()(),t(22,"div",6)(23,"label",11),p(24,"Page Size"),n(),t(25,"input",13),g("ngModelChange",function(l){return i.updateFilter("RowCount",l)}),n()()()(),t(26,"content")(27,"div",14)(28,"div",15)(29,"div",16),M(30,le,18,3,"div",17)(31,me,2,0,"div",18),n()()()()()),r&2){let o;R("text",i.filter().Sku),m(9),d("clearable",!0)("items",i.channelOptions())("ngModel",i.filter().ChannelID),m(6),d("date",i.filter().From),m(2),d("date",i.filter().To),m(4),d("ngModel",i.filter().PageNumber),m(4),d("ngModel",i.filter().RowCount),m(5),N(((o=i.Result())==null?null:o.length)>0?30:31)}},dependencies:[Q,B,Z,J,W,K,j,q,X,Y,ee,te,$,V],encapsulation:2})}}return a})();export{Me as InventoryLogComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as we}from"./chunk-SEB36UUD.js";import{a as Ie,b as Me}from"./chunk-IBZCREPJ.js";import{a as ye,b as Se}from"./chunk-Y5RUW5VE.js";import{a as ve}from"./chunk-7ES2Z445.js";import{a as he,b as ue,c as Ce,g as xe,i as fe,j as be}from"./chunk-NIRJAWTX.js";import{a as ge}from"./chunk-RDXDKWLL.js";import{b as Te}from"./chunk-A32JPG5P.js";import{a as ae}from"./chunk-JY726AM5.js";import{b as pe}from"./chunk-47Z3CNAW.js";import{a as E}from"./chunk-ZSUWHVKX.js";import{h as de}from"./chunk-VB4EKTTU.js";import{a as le,b as re,c as ce}from"./chunk-7R55YTL6.js";import{c as Z}from"./chunk-NNVT5X6O.js";import{b as se,h as me,m as _e,z as V}from"./chunk-BUBQQEYA.js";import{D as oe,y as ie}from"./chunk-4NAKX6WQ.js";import{Ca as B,E as G,Eb as D,Ga as b,Jc as A,Kb as T,Lc as L,Nc as Y,Oc as m,Pc as M,Qc as F,Sc as j,Tc as z,Uc as W,Yc as J,_ as K,bc as p,bd as k,cd as Q,d as q,dc as g,ec as I,fc as X,gc as y,hc as S,ic as s,jc as l,kb as v,kc as d,kd as O,lc as w,ld as H,mb as r,md as ee,na as f,od as te,rc as R,sc as x,sd as ne,ua as h,va as u,wd as P,xc as C,zc as a}from"./chunk-ZPV56E2J.js";import{a as U,b as $}from"./chunk-66YHNWRR.js";function ke(t,c){if(t&1){let e=x();l(0,"span")(1,"mat-checkbox",4),C("change",function(n){h(e);let o=a();return u(o.onSelectAll(n==null?null:n.checked))}),l(2,"h5",5),m(3,"Select All"),d()()()}}function Ee(t,c){if(t&1){let e=x();l(0,"li")(1,"mat-checkbox",6),C("change",function(n){let o=h(e).$implicit,_=a();return u(_.onChannelChange(o,n.checked))}),l(2,"div",7),w(3,"img",8),l(4,"h5",9),m(5),d()()()()}if(t&2){let e=c.$implicit;r(),s("checked",e.selected),r(2),s("src",e.Img,v),r(2),M(e.Name)}}var mt=(()=>{class t{constructor(){this.data=f(ue),this.dialogRef=f(he),this.channels=b([]),this.getSelectedChannel=ne(()=>this.channels().filter(e=>e.selected)),this.selectedItems=this.data.selectedItems,this.channels.set(this.data.channels)}ngOnInit(){this.initModalConfig()}initModalConfig(){let e=this.data.title?this.data.title:"Updating Inventory";this.modalConfig=new fe,this.modalConfig.title=e}onSelectAll(e){this.channels.update(i=>i.map(n=>$(U({},n),{selected:e})))}onOk(){this.dialogRef.close(this.channels())}onClose(){this.dialogRef.close()}onChannelChange(e,i){this.channels.update(n=>n.map(o=>o.ID===e.ID?$(U({},o),{selected:i}):o))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=D({type:t,selectors:[["app-modal-update-channels"]],decls:7,vars:3,consts:[[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[2,"overflow-y","auto","max-height","28rem"],[1,"no-bullet",2,"margin-bottom","0px !important","overflow","hidden"],["color","primary",1,"me-6",3,"change"],[1,"fw-light"],["color","primary",3,"change","checked"],[1,"d-flex","align-items-center"],[1,"channelLogo-md",3,"src"],[1,"fw-light","ms-2","my-auto"]],template:function(i,n){i&1&&(l(0,"modal-material",0),C("onOk",function(){return n.onOk()})("onClose",function(){return n.onClose()})("onCancel",function(){return n.onClose()}),l(1,"div",1)(2,"div",2),p(3,ke,4,0,"span"),l(4,"ul",3),y(5,Ee,6,3,"li",null,I),d()()()()),i&2&&(s("dynamicValidated",n.getSelectedChannel().length>0)("config",n.modalConfig),r(3),g(n.channels().length>1?3:-1),r(2),S(n.channels()))},dependencies:[be,we,V],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}"],changeDetection:0})}}return t})();var N=t=>[t],De=(t,c)=>({"bg-gradient-warning":t,"cell-hover pointer":c});function Oe(t,c){if(t&1){let e=x();l(0,"mat-slide-toggle",10),C("toggleChange",function(){h(e);let n=a();return u(n.onToggle())}),l(1,"small",11),m(2),d()()}if(t&2){let e=a();s("checked",e.toggleStatus()),r(2),F(" ",e.productToggleTitle()?e.productToggleTitle():"FILTER DIFFERENT INVENTORY"," ")}}function Ve(t,c){if(t&1){let e=x();l(0,"th")(1,"input",13),C("change",function(n){h(e);let o=a(2);return o.checkboxState.set(n.target.checked),u(o.onCheckboxStateChange())}),d()()}if(t&2){let e=a(2);r(),s("checked",e.checkboxState())}}function Ne(t,c){if(t&1&&(T(0,Ve,2,1,"ng-template",12),l(1,"th",8),m(2,"POS"),d()),t&2){let e=a();s("ngxPermissionsOnly",k(1,N,e.rolePriceEdit))}}function Ue(t,c){if(t&1&&(l(0,"th",9)(1,"div",14)(2,"div",15),w(3,"img",16),l(4,"div",17),m(5),O(6,"stringLimit"),d()()()()),t&2){let e=c.$implicit;r(2),s("matTooltip",(e.Name==null?null:e.Name.length)>20?e.Name:""),r(),s("src",e==null?null:e.Img,v),r(2),F(" ",ee(6,3,e.Name,20)," ")}}function $e(t,c){t&1&&R(0)}function Be(t,c){if(t&1&&T(0,$e,1,0,"ng-container",28),t&2){a(2);let e=A(5);s("ngTemplateOutlet",e)}}function Re(t,c){if(t&1&&T(0,Be,1,1,"ng-template",12),t&2){let e=a(4);s("ngxPermissionsOnly",k(1,N,e.roleInventoryUpdate))}}function Ae(t,c){t&1&&R(0)}function Le(t,c){if(t&1&&T(0,Ae,1,0,"ng-container",28),t&2){a(2);let e=A(5);s("ngTemplateOutlet",e)}}function je(t,c){if(t&1&&T(0,Le,1,1,"ng-template",12),t&2){let e=a(4);s("ngxPermissionsOnly",k(1,N,e.rolePriceEdit))}}function ze(t,c){if(t&1){let e=x();l(0,"div")(1,"input",29),W("ngModelChange",function(n){h(e);let o=a(4).$implicit;return z(o.selected,n)||(o.selected=n),u(n)}),C("ngModelChange",function(){h(e);let n=a(4).$implicit,o=a();return u(o.onCheckboxStateProduct(n.ID))}),d()()}if(t&2){let e=a(4).$implicit;r(),j("ngModel",e.selected),s("disabled",!(e!=null&&e.Category))}}function We(t,c){if(t&1&&p(0,ze,2,2,"div"),t&2){let e=a(3).$implicit;g((e==null||e.Variants==null?null:e.Variants.length)>1?0:-1)}}function He(t,c){if(t&1){let e=x();l(0,"img",30),C("click",function(n){h(e);let o=a(3).$implicit,_=a();return u(_.onZoomImage(n,o==null?null:o.ImageUrl))}),d()}if(t&2){let e=a(3).$implicit;s("src",J(e==null?null:e.ThumbnailUrl),v)}}function Ze(t,c){t&1&&w(0,"img",25)}function qe(t,c){if(t&1&&(l(0,"td",22)(1,"div",23),p(2,Re,1,3,null,12)(3,je,1,3,null,12),T(4,We,1,1,"ng-template",null,0,te),l(6,"div"),p(7,He,1,2,"img",24)(8,Ze,1,0,"img",25),d()()(),l(9,"td",26)(10,"div"),m(11),d(),l(12,"small",27),m(13),d()()),t&2){let e=a(2).$implicit,i=a();s("rowSpan",e==null?null:e.Variants.length),r(2),g(i.table()=="inventory"?2:3),r(5),g(e!=null&&e.ThumbnailUrl?7:8),r(2),s("rowSpan",e==null?null:e.Variants.length),r(2),M(e==null?null:e.Name),r(),L("text-danger",!(e!=null&&e.Category)),r(),F("(",e!=null&&e.Category?e==null?null:e.Category:"Not Found In POS",")")}}function Ge(t,c){if(t&1&&(l(0,"a",21),w(1,"i",31),d()),t&2){let e=a().$implicit,i=a(2);s("href",i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),v)}}function Ke(t,c){if(t&1){let e=x();l(0,"input",34),W("ngModelChange",function(n){h(e);let o=a(3).$implicit;return z(o.selected,n)||(o.selected=n),u(n)}),d()}if(t&2){let e=a(3).$implicit,i=a().$implicit;j("ngModel",e.selected),s("disabled",!(i!=null&&i.Category))}}function Xe(t,c){if(t&1&&(l(0,"td",32),p(1,Ke,1,2,"input",33),d()),t&2){let e=a(2).$implicit,i=a(2);r(),g(i.printPOS(e)>=0||i.table()=="price"?1:-1)}}function Ye(t,c){if(t&1&&(T(0,Xe,2,1,"ng-template",12),l(1,"td",19),m(2),O(3,"number"),d()),t&2){let e=a().$implicit,i=a(2);s("ngxPermissionsOnly",k(4,N,i.rolePriceEdit)),r(2),M(H(3,2,i.printPOS(e)))}}function Je(t,c){if(t&1){let e=x();l(0,"td",37),C("click",function(){h(e);let n=a().$implicit,o=a().$implicit,_=a().$implicit,Fe=a();return u(Fe.onUpdateData(_.Name,o,n.ID,_.ChannelItemID))}),l(1,"div",38)(2,"div",39),m(3),O(4,"number"),d(),l(5,"a",40),C("click",function(n){return h(e),u(n==null?null:n.stopPropagation())}),w(6,"i",31),d()()()}if(t&2){let e=c,i=a(2).$implicit,n=a(2);Y(Q(6,De,n.printPOS(i)!=n.printItem(e)&&n.hiddenIPOSInventory()==!1,n.hasPriceEdit()&&n.table()=="price"||n.hasInventoryEdit()&&n.table()=="inventory")),r(3),F(" ",H(4,4,n.printItem(e))," "),r(2),s("href",e.Url,v)}}function Qe(t,c){t&1&&(l(0,"td",36)(1,"div",38)(2,"span"),m(3,"X"),d()()())}function et(t,c){if(t&1&&p(0,Je,7,9,"td",35)(1,Qe,4,0,"td",36),t&2){let e,i=c.$implicit,n=a().$implicit,o=a(2);g((e=o.getItemFromChannel(n,i))?0:1,e)}}function tt(t,c){if(t&1&&(l(0,"tr"),p(1,qe,14,8),l(2,"td",18),m(3),d(),l(4,"td",19)(5,"div",20)(6,"div"),m(7),d(),l(8,"div",17),p(9,Ge,2,1,"a",21),d()()(),p(10,Ye,4,6),y(11,et,2,1,null,null,I),d()),t&2){let e=c.$implicit,i=c.$index,n=a().$implicit,o=a();r(),g(i==0?1:-1),r(2),M(e==null?null:e.Model),r(2),s("matTooltip",e.Discontinued?o.discontinuedVariantMsg:""),r(),L("text-decoration-line-through",e.Discontinued),r(),F(" ",e.Code," "),r(2),g(n.Category?9:-1),r(),g(o.hiddenIPOSInventory()==!1?10:-1),r(),S(o.channel())}}function nt(t,c){if(t&1&&(l(0,"tbody"),y(1,tt,13,8,"tr",null,I),d()),t&2){let e=c.$implicit;r(),S(e.Variants)}}var Bt=(()=>{class t{constructor(){this.dialog=f(Ce),this.biggerPictureService=f(ve),this.authService=f(de),this.permissionsService=f(le),this.table=P(void 0),this.channel=P(void 0),this.showProductToggle=P(!1),this.productToggleTitle=P(void 0),this.hiddenIPOSInventory=P(!1),this.toggleStatus=b(!1),this.stockHeader=b(void 0),this.checkboxState=b(!1),this.rolePriceEdit=E.PriceUpdate,this.roleInventoryUpdate=E.InventoryUpdate,this.hasPriceEdit=b(!1),this.hasInventoryEdit=b(!1),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.onSubmit=new B,this.destroy$=new q,this.toggle=new B,this.hostName=this.authService.getDomain()}ngOnInit(){this.initRoles();let e=this.table();e=="inventory"?this.stockHeader.set("Stock"):e=="price"&&this.stockHeader.set("Price")}initRoles(){this.permissionsService.hasPermission(E.InventoryUpdate).then(e=>this.hasInventoryEdit.set(e)),this.permissionsService.hasPermission(E.PriceUpdate).then(e=>this.hasPriceEdit.set(e))}onCheckboxStateProduct(e){let i=this.data.filter(n=>n.ID==e);i.length>0&&(i=i.map(n=>(n.Variants=n.Variants.map(o=>(o.selected=n.selected,o)),n)))}onCheckboxStateChange(){this.data=this.data.map(e=>(e.Variants=e.Variants.map(i=>(i.selected=this.checkboxState(),i)),e))}getItemFromChannel(e,i){return e.Channel.find(o=>Z.IsNotEmpty(i.LocationID)?o.LocationID==i.LocationID:o.ChannelID==i.ID)}printItem(e){let i=this.table();if(i=="inventory")return e.Inventory;if(i=="price")return e.Price}onUpdateData(e,i,n,o){let _=this.table();this.hasPriceEdit()&&_=="price"&&this.onOpenDialogUpdate(e,i,n,o),this.hasInventoryEdit()&&_=="inventory"&&this.onOpenDialogUpdate(e,i,n,o)}onOpenDialogUpdate(e,i,n,o){this.dialog.open(Ie,{data:{Name:e,Variant:i,ChannelID:n,Table:this.table(),ChannelItemID:o}}).afterClosed().pipe(G(_=>Z.IsNotEmpty(_)),K(this.destroy$)).subscribe(_=>{this.onSubmit.emit(_)})}printPOS(e){let i=this.table();return i=="inventory"?e.Inventory?e.Inventory:0:i=="price"?e.UnitPrice:null}onToggle(){this.toggleStatus.update(e=>!e),this.toggle.emit(this.toggleStatus())}onZoomImage(e,i){this.biggerPictureService.openBiggerPicture(e,i)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=D({type:t,selectors:[["app-table"]],inputs:{data:"data",table:[1,"table"],channel:[1,"channel"],showProductToggle:[1,"showProductToggle"],productToggleTitle:[1,"productToggleTitle"],hiddenIPOSInventory:[1,"hiddenIPOSInventory"]},outputs:{onSubmit:"onSubmit",toggle:"onToggle"},decls:18,vars:2,consts:[["checkbox_update",""],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","w-25"],[1,"w-100"],[2,"width","200px",3,"checked"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],["scope","col"],[2,"width","200px",3,"toggleChange","checked"],[1,"fw-bold"],[3,"ngxPermissionsOnly"],["type","checkbox",3,"change","checked"],[1,"w-100","d-flex","align-items-center","justify-content-center"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-end",3,"matTooltip"],["target","_blank",3,"href"],[1,"text-center",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-end"],[1,"border","rounded","w-img","cursor-pointer",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"text-start",2,"padding-left","0px",3,"rowSpan"],[1,"mt-1"],[4,"ngTemplateOutlet"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel","disabled"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"align-middle"],["type","checkbox",3,"ngModel","disabled"],["type","checkbox",3,"ngModelChange","ngModel","disabled"],[1,"p-0",3,"class"],[1,"table-white","text-center",2,"color","red"],[1,"p-0",3,"click"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2","mt-1"],["target","_blank",3,"click","href"]],template:function(i,n){i&1&&(l(0,"div",1)(1,"table",2)(2,"thead",3)(3,"tr")(4,"th",4)(5,"div",5)(6,"div"),m(7,"Product"),d(),p(8,Oe,3,2,"mat-slide-toggle",6),d()(),l(9,"th",7),m(10,"Variant"),d(),l(11,"th",8),m(12,"SKU"),d(),p(13,Ne,3,3),y(14,Ue,7,6,"th",9,X),d()(),y(16,nt,3,0,"tbody",null,I),d()()),i&2&&(r(8),g(n.showProductToggle()?8:-1),r(5),g(n.hiddenIPOSInventory()==!1?13:-1),r(),S(n.channel()),r(2),S(n.data))},dependencies:[V,se,me,_e,Se,ye,xe,ae,Te,ce,re,ge,pe,ie,Me,oe],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}.text-wrapping[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:88px}.cell-hover[_ngcontent-%COMP%]{width:400px!important}"],changeDetection:0})}}return t})();export{mt as a,Bt as b};
|
|
1
|
+
import{a as we}from"./chunk-SEB36UUD.js";import{a as Ie,b as Me}from"./chunk-IBZCREPJ.js";import{a as ye,b as Se}from"./chunk-Y5RUW5VE.js";import{a as ve}from"./chunk-7ES2Z445.js";import{a as he,b as ue,c as Ce,g as xe,i as fe,j as be}from"./chunk-NIRJAWTX.js";import{a as ge}from"./chunk-RDXDKWLL.js";import{b as Te}from"./chunk-A32JPG5P.js";import{a as ae}from"./chunk-JY726AM5.js";import{b as pe}from"./chunk-47Z3CNAW.js";import{a as E}from"./chunk-ZSUWHVKX.js";import{h as de}from"./chunk-5FO4RY4B.js";import{a as le,b as re,c as ce}from"./chunk-7R55YTL6.js";import{c as Z}from"./chunk-NNVT5X6O.js";import{b as se,h as me,m as _e,z as V}from"./chunk-BUBQQEYA.js";import{D as oe,y as ie}from"./chunk-4NAKX6WQ.js";import{Ca as B,E as G,Eb as D,Ga as b,Jc as A,Kb as T,Lc as L,Nc as Y,Oc as m,Pc as M,Qc as F,Sc as j,Tc as z,Uc as W,Yc as J,_ as K,bc as p,bd as k,cd as Q,d as q,dc as g,ec as I,fc as X,gc as y,hc as S,ic as s,jc as l,kb as v,kc as d,kd as O,lc as w,ld as H,mb as r,md as ee,na as f,od as te,rc as R,sc as x,sd as ne,ua as h,va as u,wd as P,xc as C,zc as a}from"./chunk-ZPV56E2J.js";import{a as U,b as $}from"./chunk-66YHNWRR.js";function ke(t,c){if(t&1){let e=x();l(0,"span")(1,"mat-checkbox",4),C("change",function(n){h(e);let o=a();return u(o.onSelectAll(n==null?null:n.checked))}),l(2,"h5",5),m(3,"Select All"),d()()()}}function Ee(t,c){if(t&1){let e=x();l(0,"li")(1,"mat-checkbox",6),C("change",function(n){let o=h(e).$implicit,_=a();return u(_.onChannelChange(o,n.checked))}),l(2,"div",7),w(3,"img",8),l(4,"h5",9),m(5),d()()()()}if(t&2){let e=c.$implicit;r(),s("checked",e.selected),r(2),s("src",e.Img,v),r(2),M(e.Name)}}var mt=(()=>{class t{constructor(){this.data=f(ue),this.dialogRef=f(he),this.channels=b([]),this.getSelectedChannel=ne(()=>this.channels().filter(e=>e.selected)),this.selectedItems=this.data.selectedItems,this.channels.set(this.data.channels)}ngOnInit(){this.initModalConfig()}initModalConfig(){let e=this.data.title?this.data.title:"Updating Inventory";this.modalConfig=new fe,this.modalConfig.title=e}onSelectAll(e){this.channels.update(i=>i.map(n=>$(U({},n),{selected:e})))}onOk(){this.dialogRef.close(this.channels())}onClose(){this.dialogRef.close()}onChannelChange(e,i){this.channels.update(n=>n.map(o=>o.ID===e.ID?$(U({},o),{selected:i}):o))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=D({type:t,selectors:[["app-modal-update-channels"]],decls:7,vars:3,consts:[[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[2,"overflow-y","auto","max-height","28rem"],[1,"no-bullet",2,"margin-bottom","0px !important","overflow","hidden"],["color","primary",1,"me-6",3,"change"],[1,"fw-light"],["color","primary",3,"change","checked"],[1,"d-flex","align-items-center"],[1,"channelLogo-md",3,"src"],[1,"fw-light","ms-2","my-auto"]],template:function(i,n){i&1&&(l(0,"modal-material",0),C("onOk",function(){return n.onOk()})("onClose",function(){return n.onClose()})("onCancel",function(){return n.onClose()}),l(1,"div",1)(2,"div",2),p(3,ke,4,0,"span"),l(4,"ul",3),y(5,Ee,6,3,"li",null,I),d()()()()),i&2&&(s("dynamicValidated",n.getSelectedChannel().length>0)("config",n.modalConfig),r(3),g(n.channels().length>1?3:-1),r(2),S(n.channels()))},dependencies:[be,we,V],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}"],changeDetection:0})}}return t})();var N=t=>[t],De=(t,c)=>({"bg-gradient-warning":t,"cell-hover pointer":c});function Oe(t,c){if(t&1){let e=x();l(0,"mat-slide-toggle",10),C("toggleChange",function(){h(e);let n=a();return u(n.onToggle())}),l(1,"small",11),m(2),d()()}if(t&2){let e=a();s("checked",e.toggleStatus()),r(2),F(" ",e.productToggleTitle()?e.productToggleTitle():"FILTER DIFFERENT INVENTORY"," ")}}function Ve(t,c){if(t&1){let e=x();l(0,"th")(1,"input",13),C("change",function(n){h(e);let o=a(2);return o.checkboxState.set(n.target.checked),u(o.onCheckboxStateChange())}),d()()}if(t&2){let e=a(2);r(),s("checked",e.checkboxState())}}function Ne(t,c){if(t&1&&(T(0,Ve,2,1,"ng-template",12),l(1,"th",8),m(2,"POS"),d()),t&2){let e=a();s("ngxPermissionsOnly",k(1,N,e.rolePriceEdit))}}function Ue(t,c){if(t&1&&(l(0,"th",9)(1,"div",14)(2,"div",15),w(3,"img",16),l(4,"div",17),m(5),O(6,"stringLimit"),d()()()()),t&2){let e=c.$implicit;r(2),s("matTooltip",(e.Name==null?null:e.Name.length)>20?e.Name:""),r(),s("src",e==null?null:e.Img,v),r(2),F(" ",ee(6,3,e.Name,20)," ")}}function $e(t,c){t&1&&R(0)}function Be(t,c){if(t&1&&T(0,$e,1,0,"ng-container",28),t&2){a(2);let e=A(5);s("ngTemplateOutlet",e)}}function Re(t,c){if(t&1&&T(0,Be,1,1,"ng-template",12),t&2){let e=a(4);s("ngxPermissionsOnly",k(1,N,e.roleInventoryUpdate))}}function Ae(t,c){t&1&&R(0)}function Le(t,c){if(t&1&&T(0,Ae,1,0,"ng-container",28),t&2){a(2);let e=A(5);s("ngTemplateOutlet",e)}}function je(t,c){if(t&1&&T(0,Le,1,1,"ng-template",12),t&2){let e=a(4);s("ngxPermissionsOnly",k(1,N,e.rolePriceEdit))}}function ze(t,c){if(t&1){let e=x();l(0,"div")(1,"input",29),W("ngModelChange",function(n){h(e);let o=a(4).$implicit;return z(o.selected,n)||(o.selected=n),u(n)}),C("ngModelChange",function(){h(e);let n=a(4).$implicit,o=a();return u(o.onCheckboxStateProduct(n.ID))}),d()()}if(t&2){let e=a(4).$implicit;r(),j("ngModel",e.selected),s("disabled",!(e!=null&&e.Category))}}function We(t,c){if(t&1&&p(0,ze,2,2,"div"),t&2){let e=a(3).$implicit;g((e==null||e.Variants==null?null:e.Variants.length)>1?0:-1)}}function He(t,c){if(t&1){let e=x();l(0,"img",30),C("click",function(n){h(e);let o=a(3).$implicit,_=a();return u(_.onZoomImage(n,o==null?null:o.ImageUrl))}),d()}if(t&2){let e=a(3).$implicit;s("src",J(e==null?null:e.ThumbnailUrl),v)}}function Ze(t,c){t&1&&w(0,"img",25)}function qe(t,c){if(t&1&&(l(0,"td",22)(1,"div",23),p(2,Re,1,3,null,12)(3,je,1,3,null,12),T(4,We,1,1,"ng-template",null,0,te),l(6,"div"),p(7,He,1,2,"img",24)(8,Ze,1,0,"img",25),d()()(),l(9,"td",26)(10,"div"),m(11),d(),l(12,"small",27),m(13),d()()),t&2){let e=a(2).$implicit,i=a();s("rowSpan",e==null?null:e.Variants.length),r(2),g(i.table()=="inventory"?2:3),r(5),g(e!=null&&e.ThumbnailUrl?7:8),r(2),s("rowSpan",e==null?null:e.Variants.length),r(2),M(e==null?null:e.Name),r(),L("text-danger",!(e!=null&&e.Category)),r(),F("(",e!=null&&e.Category?e==null?null:e.Category:"Not Found In POS",")")}}function Ge(t,c){if(t&1&&(l(0,"a",21),w(1,"i",31),d()),t&2){let e=a().$implicit,i=a(2);s("href",i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),v)}}function Ke(t,c){if(t&1){let e=x();l(0,"input",34),W("ngModelChange",function(n){h(e);let o=a(3).$implicit;return z(o.selected,n)||(o.selected=n),u(n)}),d()}if(t&2){let e=a(3).$implicit,i=a().$implicit;j("ngModel",e.selected),s("disabled",!(i!=null&&i.Category))}}function Xe(t,c){if(t&1&&(l(0,"td",32),p(1,Ke,1,2,"input",33),d()),t&2){let e=a(2).$implicit,i=a(2);r(),g(i.printPOS(e)>=0||i.table()=="price"?1:-1)}}function Ye(t,c){if(t&1&&(T(0,Xe,2,1,"ng-template",12),l(1,"td",19),m(2),O(3,"number"),d()),t&2){let e=a().$implicit,i=a(2);s("ngxPermissionsOnly",k(4,N,i.rolePriceEdit)),r(2),M(H(3,2,i.printPOS(e)))}}function Je(t,c){if(t&1){let e=x();l(0,"td",37),C("click",function(){h(e);let n=a().$implicit,o=a().$implicit,_=a().$implicit,Fe=a();return u(Fe.onUpdateData(_.Name,o,n.ID,_.ChannelItemID))}),l(1,"div",38)(2,"div",39),m(3),O(4,"number"),d(),l(5,"a",40),C("click",function(n){return h(e),u(n==null?null:n.stopPropagation())}),w(6,"i",31),d()()()}if(t&2){let e=c,i=a(2).$implicit,n=a(2);Y(Q(6,De,n.printPOS(i)!=n.printItem(e)&&n.hiddenIPOSInventory()==!1,n.hasPriceEdit()&&n.table()=="price"||n.hasInventoryEdit()&&n.table()=="inventory")),r(3),F(" ",H(4,4,n.printItem(e))," "),r(2),s("href",e.Url,v)}}function Qe(t,c){t&1&&(l(0,"td",36)(1,"div",38)(2,"span"),m(3,"X"),d()()())}function et(t,c){if(t&1&&p(0,Je,7,9,"td",35)(1,Qe,4,0,"td",36),t&2){let e,i=c.$implicit,n=a().$implicit,o=a(2);g((e=o.getItemFromChannel(n,i))?0:1,e)}}function tt(t,c){if(t&1&&(l(0,"tr"),p(1,qe,14,8),l(2,"td",18),m(3),d(),l(4,"td",19)(5,"div",20)(6,"div"),m(7),d(),l(8,"div",17),p(9,Ge,2,1,"a",21),d()()(),p(10,Ye,4,6),y(11,et,2,1,null,null,I),d()),t&2){let e=c.$implicit,i=c.$index,n=a().$implicit,o=a();r(),g(i==0?1:-1),r(2),M(e==null?null:e.Model),r(2),s("matTooltip",e.Discontinued?o.discontinuedVariantMsg:""),r(),L("text-decoration-line-through",e.Discontinued),r(),F(" ",e.Code," "),r(2),g(n.Category?9:-1),r(),g(o.hiddenIPOSInventory()==!1?10:-1),r(),S(o.channel())}}function nt(t,c){if(t&1&&(l(0,"tbody"),y(1,tt,13,8,"tr",null,I),d()),t&2){let e=c.$implicit;r(),S(e.Variants)}}var Bt=(()=>{class t{constructor(){this.dialog=f(Ce),this.biggerPictureService=f(ve),this.authService=f(de),this.permissionsService=f(le),this.table=P(void 0),this.channel=P(void 0),this.showProductToggle=P(!1),this.productToggleTitle=P(void 0),this.hiddenIPOSInventory=P(!1),this.toggleStatus=b(!1),this.stockHeader=b(void 0),this.checkboxState=b(!1),this.rolePriceEdit=E.PriceUpdate,this.roleInventoryUpdate=E.InventoryUpdate,this.hasPriceEdit=b(!1),this.hasInventoryEdit=b(!1),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.onSubmit=new B,this.destroy$=new q,this.toggle=new B,this.hostName=this.authService.getDomain()}ngOnInit(){this.initRoles();let e=this.table();e=="inventory"?this.stockHeader.set("Stock"):e=="price"&&this.stockHeader.set("Price")}initRoles(){this.permissionsService.hasPermission(E.InventoryUpdate).then(e=>this.hasInventoryEdit.set(e)),this.permissionsService.hasPermission(E.PriceUpdate).then(e=>this.hasPriceEdit.set(e))}onCheckboxStateProduct(e){let i=this.data.filter(n=>n.ID==e);i.length>0&&(i=i.map(n=>(n.Variants=n.Variants.map(o=>(o.selected=n.selected,o)),n)))}onCheckboxStateChange(){this.data=this.data.map(e=>(e.Variants=e.Variants.map(i=>(i.selected=this.checkboxState(),i)),e))}getItemFromChannel(e,i){return e.Channel.find(o=>Z.IsNotEmpty(i.LocationID)?o.LocationID==i.LocationID:o.ChannelID==i.ID)}printItem(e){let i=this.table();if(i=="inventory")return e.Inventory;if(i=="price")return e.Price}onUpdateData(e,i,n,o){let _=this.table();this.hasPriceEdit()&&_=="price"&&this.onOpenDialogUpdate(e,i,n,o),this.hasInventoryEdit()&&_=="inventory"&&this.onOpenDialogUpdate(e,i,n,o)}onOpenDialogUpdate(e,i,n,o){this.dialog.open(Ie,{data:{Name:e,Variant:i,ChannelID:n,Table:this.table(),ChannelItemID:o}}).afterClosed().pipe(G(_=>Z.IsNotEmpty(_)),K(this.destroy$)).subscribe(_=>{this.onSubmit.emit(_)})}printPOS(e){let i=this.table();return i=="inventory"?e.Inventory?e.Inventory:0:i=="price"?e.UnitPrice:null}onToggle(){this.toggleStatus.update(e=>!e),this.toggle.emit(this.toggleStatus())}onZoomImage(e,i){this.biggerPictureService.openBiggerPicture(e,i)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=D({type:t,selectors:[["app-table"]],inputs:{data:"data",table:[1,"table"],channel:[1,"channel"],showProductToggle:[1,"showProductToggle"],productToggleTitle:[1,"productToggleTitle"],hiddenIPOSInventory:[1,"hiddenIPOSInventory"]},outputs:{onSubmit:"onSubmit",toggle:"onToggle"},decls:18,vars:2,consts:[["checkbox_update",""],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","w-25"],[1,"w-100"],[2,"width","200px",3,"checked"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],["scope","col"],[2,"width","200px",3,"toggleChange","checked"],[1,"fw-bold"],[3,"ngxPermissionsOnly"],["type","checkbox",3,"change","checked"],[1,"w-100","d-flex","align-items-center","justify-content-center"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-end",3,"matTooltip"],["target","_blank",3,"href"],[1,"text-center",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-end"],[1,"border","rounded","w-img","cursor-pointer",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"text-start",2,"padding-left","0px",3,"rowSpan"],[1,"mt-1"],[4,"ngTemplateOutlet"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel","disabled"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"align-middle"],["type","checkbox",3,"ngModel","disabled"],["type","checkbox",3,"ngModelChange","ngModel","disabled"],[1,"p-0",3,"class"],[1,"table-white","text-center",2,"color","red"],[1,"p-0",3,"click"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2","mt-1"],["target","_blank",3,"click","href"]],template:function(i,n){i&1&&(l(0,"div",1)(1,"table",2)(2,"thead",3)(3,"tr")(4,"th",4)(5,"div",5)(6,"div"),m(7,"Product"),d(),p(8,Oe,3,2,"mat-slide-toggle",6),d()(),l(9,"th",7),m(10,"Variant"),d(),l(11,"th",8),m(12,"SKU"),d(),p(13,Ne,3,3),y(14,Ue,7,6,"th",9,X),d()(),y(16,nt,3,0,"tbody",null,I),d()()),i&2&&(r(8),g(n.showProductToggle()?8:-1),r(5),g(n.hiddenIPOSInventory()==!1?13:-1),r(),S(n.channel()),r(2),S(n.data))},dependencies:[V,se,me,_e,Se,ye,xe,ae,Te,ce,re,ge,pe,ie,Me,oe],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}.text-wrapping[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:88px}.cell-hover[_ngcontent-%COMP%]{width:400px!important}"],changeDetection:0})}}return t})();export{mt as a,Bt as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-66YHNWRR.js";var o=[{path:"",loadComponent(){return import("./chunk-OL7LL2JK.js").then(t=>t.OrdersV2Component)},children:[{path:"to-ship",loadComponent(){return import("./chunk-
|
|
1
|
+
import"./chunk-66YHNWRR.js";var o=[{path:"",loadComponent(){return import("./chunk-OL7LL2JK.js").then(t=>t.OrdersV2Component)},children:[{path:"to-ship",loadComponent(){return import("./chunk-CTMKVKBI.js").then(t=>t.ReadyToShipComponent)},title:"To Ship"},{path:"awaiting-collection",loadComponent(){return import("./chunk-25B2S2RU.js").then(t=>t.AwaitingCollectionComponent)},title:"Awaiting Collection"},{path:"shipped",loadComponent(){return import("./chunk-AATHZXRD.js").then(t=>t.ShippedComponent)},title:"Shipped"},{path:"completed",loadComponent(){return import("./chunk-WANHMLNX.js").then(t=>t.CompletedComponent)},title:"Completed"},{path:"all",loadComponent(){return import("./chunk-CFH746DO.js").then(t=>t.AllComponent)},title:"All Orders"},{path:"cancelled",loadComponent(){return import("./chunk-AQFSKIOT.js").then(t=>t.CancelledComponent)},title:"Cancelled"},{path:"download",loadComponent(){return import("./chunk-FEIOPBRJ.js").then(t=>t.DownloadV2Component)},title:"Download"},{path:"log",loadComponent(){return import("./chunk-6MQGXJKX.js").then(t=>t.DownloadOrderLogComponent)},title:"Download Log"},{path:"log/detail",loadComponent(){return import("./chunk-G2XGQFY4.js").then(t=>t.DownloadOrderDetailComponent)},title:"Download Log Detail"},{path:"",pathMatch:"full",redirectTo:"to-ship"}]}];export{o as routes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
1
|
+
import{a as e}from"./chunk-FOIFO4IT.js";import{a as d}from"./chunk-J3PHESB2.js";import"./chunk-RDXDKWLL.js";import"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import"./chunk-5FO4RY4B.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import"./chunk-P5OAPFNC.js";import"./chunk-7R55YTL6.js";import"./chunk-NNVT5X6O.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import"./chunk-45DFJJAO.js";import{c as m}from"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{Eb as i,Ga as a,ic as l,jc as p,kc as c,lc as o,mb as r}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var h=(()=>{class t{constructor(){this.ObjectlogTabs=a([{Title:"Channel Push Log Exception",Url:"/menu/log/exception"},{Title:"Channel Push Log",Url:"/menu/log/rawlog"},{Title:"POS Sync Order Log",Url:"/menu/log/order"},{Title:"Inventory Sync ",Url:"/menu/log/inventory"},{Title:"Authorization Log ",Url:"/menu/log/authorization-log"},{Title:"Flush Cache ",Url:"/menu/log/flush-cache"}])}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=i({type:t,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(n,s){n&1&&(p(0,"nav",0)(1,"div",1)(2,"div"),o(3,"nav-tab",2),c()()(),o(4,"router-outlet")),n&2&&(r(3),l("Tabs",s.ObjectlogTabs()))},dependencies:[d,m],encapsulation:2,changeDetection:0})}}return t})();var T=[{path:"",component:h,children:[{path:"",redirectTo:"exception",pathMatch:"full"},{path:"order",loadComponent(){return import("./chunk-ESU355JU.js").then(t=>t.OrderComponent)},canActivate:[e],data:{title:"Order Log"}},{path:"inventory/sync-inventory",loadComponent(){return import("./chunk-2FIPIRGE.js").then(t=>t.InventoryLogComponent)},canActivate:[e],data:{title:"Product Inventory Sync"}},{path:"rawlog",loadComponent(){return import("./chunk-EHDO475L.js").then(t=>t.RawLogComponent)},canActivate:[e],data:{title:"Raw Log"}},{path:"rawlog/detail",loadComponent(){return import("./chunk-DBH7LDYB.js").then(t=>t.RawDetailComponent)},canActivate:[e],data:{title:"Raw Log Detail"}},{path:"inventory/sync-inventory/detail",loadComponent(){return import("./chunk-266EEWSE.js").then(t=>t.InventoryDetailComponent)},canActivate:[e],data:{title:"Product Inventory Sync Detail"}},{path:"order/detail",loadComponent(){return import("./chunk-UGJ5XNLS.js").then(t=>t.OrderdetailComponent)},canActivate:[e],data:{title:"Order Details"}},{path:"order/detail-user",loadComponent(){return import("./chunk-5J6UA4BV.js").then(t=>t.OrderdetailUserComponent)},canActivate:[e],data:{title:"Order User Details"}},{path:"exception",loadComponent(){return import("./chunk-XTDWTHOT.js").then(t=>t.ExceptionLogComponent)},canActivate:[e],data:{title:"Exception Log"}},{path:"exception/detail",loadComponent(){return import("./chunk-V457FNNR.js").then(t=>t.ExceptionDetailComponent)},canActivate:[e],data:{title:"Exception Log Detail"}},{path:"inventory",loadComponent:()=>import("./chunk-2HR6ZBIJ.js").then(t=>t.InventoryAsyncLogComponent),canActivate:[e],data:{title:"Product Inventory Sync"}},{path:"inventory/detail",loadComponent:()=>import("./chunk-MM2TEPZZ.js").then(t=>t.InventoryAsyncDetailComponent),canActivate:[e],data:{title:"Product Inventory Sync Detail"}},{path:"authorization-log",loadComponent(){return import("./chunk-HYJGVYR3.js").then(t=>t.ChannelLogComponent)},canActivate:[e],data:{title:"Authorization Log"}},{path:"flush-cache",loadComponent(){return import("./chunk-4TF3XWRL.js").then(t=>t.FlushCacheComponent)},canActivate:[e],data:{title:"Flush Cache"}}]}];export{T as routes};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as E}from"./chunk-GIPWMAZL.js";import{a as F}from"./chunk-YLPMCVI6.js";import{h as T}from"./chunk-5FO4RY4B.js";import{a as w}from"./chunk-P5OAPFNC.js";import{b as i,c as m}from"./chunk-NNVT5X6O.js";import{b as j,e as s}from"./chunk-45DFJJAO.js";import{d as D}from"./chunk-OF426VSL.js";import{E as I,Ga as C,H as u,e as b,ia as c,na as a,o as d,t as A,z as U}from"./chunk-ZPV56E2J.js";var x=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/shopee/GetAttributesTree",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/shopee/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/shopee/AddProduct",t).pipe(u(o=>d(null)))}generateAttribute(t){return t.map(e=>({attribute_id:e.attribute_id,attribute_value_list:e.attribute_value_list.map(o=>({value_id:o.value_id,name:o.name}))})),t}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var H=(()=>{class r{constructor(){this.httpService=a(s)}getCategories(t){return this.httpService.get("api/product/tiktok/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tiktok/AddProduct",t).pipe(u(o=>d(null)))}generateAttribute(t){let e;return t.map(o=>(o.type=="PRODUCT_PROPERTY"?e={id:o.id,name:o.name,type:o.type,values:o.values}:e={id:o.id,name:o.values[0].id,type:o.type},e))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var z=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/lazada/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/lazada/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/lazada/AddProduct",t).pipe(u(o=>d(null)))}generateAttribute(t){return t.map(e=>({name:e.name,options:e.options}))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var R=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/woo/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/woo/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/woo/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var g=class{};var S=class{};var V=(()=>{class r{constructor(){this.httpService=a(s)}getCategories(t){return this.httpService.get("api/product/tokopedia/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tokopedia/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var G=(()=>{class r{constructor(){this.httpService=a(s)}uploadProduct(t){return this.httpService.post("api/product/ShopifyV2/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var N=(()=>{class r{constructor(){this.httpService=a(s)}uploadProduct(t){return this.httpService.post(w.UploadPlugoProduct,t).pipe(u(e=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var Mt=(()=>{class r{constructor(){this.authService=a(T),this.productService=a(F),this.shoppeUploadService=a(x),this.tiktokUploadService=a(H),this.lazadaUploadService=a(z),this.tokopediaUploadService=a(V),this.wooUploadService=a(R),this.shopifyUploadService=a(G),this.plugoUploadService=a(N),this.toastrHandlingService=a(E),this.toastr=a(j),this.router=a(D),this.httpService=a(s),this._selectedProduct=new b(this.getStoredProducts()),this.selectedProduct$=this._selectedProduct.asObservable().pipe(I(t=>t&&t.length>0))}getStoredProducts(){let t=localStorage.getItem("productsUpload");if(t){let e=JSON.parse(t);return e&&e.length>0?e:[]}else return[]}setSelectedProduct(t){localStorage.setItem("productsUpload",JSON.stringify(t)),this._selectedProduct.next(t)}clearSelectedProduct(){localStorage.removeItem("productsUpload"),this._selectedProduct.next([])}getUnselectedChannels(){let t=this.authService.getChannels(),e=this._selectedProduct.getValue();return this.productService.filterUnselectedChannel(e,t)}getDefaultCategory(){return this.httpService.get("api/v1/Channel/ProductCategory/Default")}get channelProductUpload(){let t=this.getUnselectedChannels();return C(t.map(o=>{let p=new g;return p.id=o.ID,p.name=o.Name,p.type=o.TypeID,p.categoryId=null,p.attributes=[],p.selected=!1,p}))}onUploadProduct(t){let e=t.filter(o=>o.selected&&m.IsNotEmpty(o.categoryId)||o.selected&&(o.type==i.Shopify||o.type==i.ShopifyV2||o.type==i.Plugo));if(e.length>0){let o=this.generateDataForUpload(e);this.uploadProduct(o)}else this.toastr.warning("Please select a channel and category to upload the product.","Warning!")}uploadProduct(t){let e=this.generateObservableForUpload(t);U(e).pipe(A(o=>{let p=[];return o.filter(h=>m.IsNotEmpty(h)).forEach(h=>{p=[...p,...h]}),p})).subscribe({next:(o=[])=>{m.IsNotEmpty(o)&&this.toastrHandlingService.showToastrUploadMultiple(o),this.hasSuccessRes(o)&&this.onSuccessUpload()}})}hasSuccessRes(t){let e=!1;return t.forEach(o=>{o?.Response.Success_list?.length>0&&m.IsNotEmpty(o)&&(e=!0)}),e}onSuccessUpload(){this.router.navigate(["/menu/products/status/sold-in-channel"]),this.clearSelectedProduct()}generateObservableForUpload(t){let e=[],o=[],p=[],h=[],v=[],y=[],P=[],k=[];t.forEach(l=>{switch(l.ChannelType){case i.Shopee:o.push(l);break;case i.Tiktok:e.push(l);break;case i.Lazada:p.push(l);break;case i.Tokopedia:h.push(l);break;case i.WooCommerce:v.push(l);break;case i.Shopify:y.push(l);break;case i.ShopifyV2:P.push(l);break;case i.Plugo:k.push(l);break}});let n=[];return[{type:i.Shopee,data:o},{type:i.Tiktok,data:e},{type:i.Lazada,data:p},{type:i.Tokopedia,data:h},{type:i.WooCommerce,data:v},{type:i.Shopify,data:y},{type:i.ShopifyV2,data:P},{type:i.Plugo,data:k}].filter(l=>l.data.length>0).forEach(l=>{switch(l.type){case i.Shopee:n.push(this.shoppeUploadService.uploadProduct(o));break;case i.Tiktok:n.push(this.tiktokUploadService.uploadProduct(e));break;case i.Lazada:n.push(this.lazadaUploadService.uploadProduct(p));break;case i.Tokopedia:n.push(this.tokopediaUploadService.uploadProduct(h));break;case i.WooCommerce:n.push(this.wooUploadService.uploadProduct(v));break;case i.Shopify:n.push(this.shopifyUploadService.uploadProduct(y));break;case i.ShopifyV2:n.push(this.shopifyUploadService.uploadProduct(P));break;case i.Plugo:n.push(this.plugoUploadService.uploadProduct(k));break}}),n}generateDataForUpload(t){let e=[];return t.forEach(o=>{let p=new S;p.ChannelID=o.id,p.ChannelType=o.type,p.Products=this._selectedProduct.getValue(),o.type==i.Shopify||o.type==i.ShopifyV2?delete p.CategoryID:p.CategoryID=o.categoryId,p=this.generateAttributeHttpRequest(o,p),e.push(p)}),e}generateAttributeHttpRequest(t,e){return t.type==i.WooCommerce||t.type==i.Shopify||t.type==i.ShopifyV2?e.Attribute=t.attributes[0]:t.type==i.Tiktok?(e.Attributes=this.formatAttributes(t.type,t.attributes),e.listing_platforms=t.listing_platforms):e.Attributes=this.formatAttributes(t.type,t.attributes),e}formatAttributes(t,e){let o;switch(t){case i.Shopee:o=this.shoppeUploadService.generateAttribute(e);break;case i.Tiktok:o=this.tiktokUploadService.generateAttribute(e);break;case i.WooCommerce:o=this.tiktokUploadService.generateAttribute(e);break;case i.Lazada:o=this.lazadaUploadService.generateAttribute(e);break;case i.Tokopedia:o=e;break;case i.Shopify:o=e;break;case i.ShopifyV2:o=e;break;default:o=[];break}return o}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();export{x as a,H as b,z as c,R as d,Mt as e};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as nt}from"./chunk-4JTBEEYK.js";import{a as Q}from"./chunk-QXRG5XYP.js";import{a as rt}from"./chunk-7R55YTL6.js";import{b as we,c as ee}from"./chunk-NNVT5X6O.js";import{d as Qe}from"./chunk-BMVBJQDF.js";import{a as Ge,b as fe,c as Ze,d as Je,e as ge,f as Xe,g as me,h as Ye,i as G,j as ye,k as x}from"./chunk-34FX4M3J.js";import{e as et}from"./chunk-45DFJJAO.js";import{d as tt}from"./chunk-OF426VSL.js";import{H as qe,I as Ve}from"./chunk-4NAKX6WQ.js";import{Bd as L,D as Ne,Da as H,E as Fe,Fb as U,L as le,La as ze,P as Le,Q as $e,Ua as K,V as ue,Y as O,Z as de,aa as he,c as g,ca as We,d as je,da as He,h as Oe,i as Be,ia as T,ja as W,l as q,la as C,m as Y,ma as f,n as B,na as M,o as V,ra as pe,t as R,ta as Ke,u as Me,za as Ue}from"./chunk-ZPV56E2J.js";import{b as y}from"./chunk-WFMAM73Y.js";import{a as ce,i as A}from"./chunk-66YHNWRR.js";var ot={production:!0,version:"6.31.2",firebaseConfig:{apiKey:"AIzaSyDnnitFXpM8TglWKNpzu4ChgF98n25Rgvw",authDomain:"auth.dealpos.com",projectId:"devops-signin",storageBucket:"devops-signin.appspot.com",messagingSenderId:"412465165194",appId:"1:412465165194:web:03d806f6b6ab6f8b460e73",measurementId:"G-MNDBRJ5XZD"},news:"https://changelog.dealpos.app/umbraco/delivery/api/v2/content?fetch=children:omni&sort=sortOrder:asc"};var it=(()=>{class r{constructor(){}getParseToken(){let e=JSON.parse(window.localStorage.getItem("user"));return this.ParseToken(e.Token.access_token)}GetRoles(){let t=this.getParseToken()["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"];return typeof t=="string"&&(t=[t]),t||[]}ParseToken(e){try{let n=e.split(".")[0].replace("-","+").replace("_","/"),o=JSON.parse(window.atob(n)),c=e.split(".")[1].replace("-","+").replace("_","/"),s=JSON.parse(window.atob(c));return s.header=o,s}catch{return!1}}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=T({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var Tt="firebase",Ct="11.10.0";G(Tt,Ct,"app");var z=new We("ANGULARFIRE2_VERSION");var st=(r,a)=>{let e=a?[a]:Ye(),t=[];return e.forEach(n=>{n.container.getProvider(r).instances.forEach(i=>{t.includes(i)||t.push(i)})}),t},ve=(function(r){return r[r.SILENT=0]="SILENT",r[r.WARN=1]="WARN",r[r.VERBOSE=2]="VERBOSE",r})(ve||{}),Mr=L()&&typeof Zone<"u"?ve.WARN:ve.SILENT;var te=class{zone;delegate;constructor(a,e=Be){this.zone=a,this.delegate=e}now(){return this.delegate.now()}schedule(a,e,t){let n=this.zone,o=function(i){n?n.runGuarded(()=>{a.apply(this,[i])}):a.apply(this,[i])};return this.delegate.schedule(o,e,t)}},Ae=(()=>{class r{outsideAngular;insideAngular;constructor(){let e=M(H);this.outsideAngular=e.runOutsideAngular(()=>new te(typeof Zone>"u"?void 0:Zone.current)),this.insideAngular=e.run(()=>new te(typeof Zone>"u"?void 0:Zone.current,Oe))}static \u0275fac=function(t){return new(t||r)};static \u0275prov=T({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var Pt="firebase",xt="11.10.0";x.registerVersion(Pt,xt,"app-compat");var _t=["ngOnDestroy"],ct=(r,a,e,t={})=>new Proxy(r,{get:(n,o)=>e.runOutsideAngular(()=>{if(r[o])return t?.spy?.get&&t.spy.get(o,r[o]),r[o];if(_t.indexOf(o)>-1)return()=>{};let i=a.toPromise().then(c=>{let s=c?.[o];return typeof s=="function"?s.bind(c):s?.then?s.then(l=>e.run(()=>l)):e.run(()=>s)});return new Proxy(()=>{},{get:(c,s)=>i[s],apply:(c,s,l)=>i.then(h=>{let u=h?.(...l);return t?.spy?.apply&&t.spy.apply(o,l,u),u})})})});var re=class{constructor(a){return a}},ne=new C("angularfire2.app.options"),oe=new C("angularfire2.app.name");function ke(r,a,e){let t=typeof e=="string"&&e||"[DEFAULT]",n=typeof e=="object"&&e||{};n.name=n.name||t;let i=x.apps.filter(c=>c&&c.name===n.name)[0]||a.runOutsideAngular(()=>x.initializeApp(r,n));try{if(JSON.stringify(r)!==JSON.stringify(i.options)){let c=!!module.hot;Rt("error",`${i.name} Firebase App already initialized with different options${c?", you may need to reload as Firebase is not HMR aware.":"."}`)}}catch{}return new re(i)}var Rt=(r,...a)=>{L()&&typeof console<"u"&&console[r](...a)},jt={provide:re,useFactory:ke,deps:[ne,H,[new ze,oe]]},zr=(()=>{class r{static initializeApp(e,t){return{ngModule:r,providers:[{provide:ne,useValue:e},{provide:oe,useValue:t}]}}constructor(e){x.registerVersion("angularfire",z.full,"core"),x.registerVersion("angularfire",z.full,"app-compat"),x.registerVersion("angular",He.full,e.toString())}static \u0275fac=function(t){return new(t||r)(f(K))};static \u0275mod=U({type:r});static \u0275inj=W({providers:[jt]})}return r})();function lt(r,a,e,t,n){let[,o,i]=globalThis.\u0275AngularfireInstanceCache.find(c=>c[0]===r)||[];if(o)return Ot(n,i)||(at("error",`${a} was already initialized on the ${e} Firebase App with different settings.${Bt?" You may need to reload as Firebase is not HMR aware.":""}`),at("warn",{is:n,was:i})),o;{let c=t();return globalThis.\u0275AngularfireInstanceCache.push([r,c,n]),c}}function Ot(r,a){try{return r.toString()===a.toString()}catch{return r===a}}var Bt=typeof module<"u"&&!!module.hot,at=(r,...a)=>{L()&&typeof console<"u"&&console[r](...a)};globalThis.\u0275AngularfireInstanceCache||=[];var Mt=new Map,Nt={activated:!1,tokenObservers:[]},Ft={initialized:!1,enabled:!1};function _(r){return Mt.get(r)||Object.assign({},Nt)}function pt(){return Ft}var Lt="https://content-firebaseappcheck.googleapis.com/v1";var $t="exchangeDebugToken",ut={OFFSET_DURATION:300*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:960*1e3},nn=1440*60*1e3;var Ee=class{constructor(a,e,t,n,o){if(this.operation=a,this.retryPolicy=e,this.getWaitDuration=t,this.lowerBound=n,this.upperBound=o,this.pending=null,this.nextErrorWaitInterval=n,n>o)throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}process(a){return A(this,null,function*(){this.stop();try{this.pending=new fe,this.pending.promise.catch(e=>{}),yield Wt(this.getNextRun(a)),this.pending.resolve(),yield this.pending.promise,this.pending=new fe,this.pending.promise.catch(e=>{}),yield this.operation(),this.pending.resolve(),yield this.pending.promise,this.process(!0).catch(()=>{})}catch(e){this.retryPolicy(e)?this.process(!1).catch(()=>{}):this.stop()}})}getNextRun(a){if(a)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{let e=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),e}}};function Wt(r){return new Promise(a=>{setTimeout(a,r)})}var Ht={"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.","initial-throttle":"{$httpStatus} error. Attempts allowed again after {$time}",throttled:"Requests throttled due to previous {$httpStatus} error. Attempts allowed again after {$time}"},N=new Je("appCheck","AppCheck",Ht);function ft(r){if(!_(r).activated)throw N.create("use-before-activation",{appName:r.name})}function gt(t,n){return A(this,arguments,function*({url:r,body:a},e){let o={"Content-Type":"application/json"},i=e.getImmediate({optional:!0});if(i){let d=yield i.getHeartbeatsHeader();d&&(o["X-Firebase-Client"]=d)}let c={method:"POST",body:JSON.stringify(a),headers:o},s;try{s=yield fetch(r,c)}catch(d){throw N.create("fetch-network-error",{originalErrorMessage:d?.message})}if(s.status!==200)throw N.create("fetch-status-error",{httpStatus:s.status});let l;try{l=yield s.json()}catch(d){throw N.create("fetch-parse-error",{originalErrorMessage:d?.message})}let h=l.ttl.match(/^([\d.]+)(s)$/);if(!h||!h[2]||isNaN(Number(h[1])))throw N.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${l.ttl}`});let u=Number(h[1])*1e3,p=Date.now();return{token:l.token,expireTimeMillis:p+u,issuedAtTimeMillis:p}})}function mt(r,a){let{projectId:e,appId:t,apiKey:n}=r.options;return{url:`${Lt}/projects/${e}/apps/${t}:${$t}?key=${n}`,body:{debug_token:a}}}var Kt="firebase-app-check-database",Ut=1,Ie="firebase-app-check-store";var ie=null;function zt(){return ie||(ie=new Promise((r,a)=>{try{let e=indexedDB.open(Kt,Ut);e.onsuccess=t=>{r(t.target.result)},e.onerror=t=>{var n;a(N.create("storage-open",{originalErrorMessage:(n=t.target.error)===null||n===void 0?void 0:n.message}))},e.onupgradeneeded=t=>{let n=t.target.result;switch(t.oldVersion){case 0:n.createObjectStore(Ie,{keyPath:"compositeKey"})}}}catch(e){a(N.create("storage-open",{originalErrorMessage:e?.message}))}}),ie)}function qt(r,a){return Vt(Gt(r),a)}function Vt(r,a){return A(this,null,function*(){let t=(yield zt()).transaction(Ie,"readwrite"),o=t.objectStore(Ie).put({compositeKey:r,value:a});return new Promise((i,c)=>{o.onsuccess=s=>{i()},t.onerror=s=>{var l;c(N.create("storage-set",{originalErrorMessage:(l=s.target.error)===null||l===void 0?void 0:l.message}))}})})}function Gt(r){return`${r.options.appId}-${r.name}`}var Z=new Xe("@firebase/app-check");function be(r,a){return Ze()?qt(r,a).catch(e=>{Z.warn(`Failed to write token to IndexedDB. Error: ${e}`)}):Promise.resolve()}function yt(){return pt().enabled}function wt(){return A(this,null,function*(){let r=pt();if(r.enabled&&r.token)return r.token.promise;throw Error(`
|
|
1
|
+
import{a as nt}from"./chunk-4JTBEEYK.js";import{a as Q}from"./chunk-QXRG5XYP.js";import{a as rt}from"./chunk-7R55YTL6.js";import{b as we,c as ee}from"./chunk-NNVT5X6O.js";import{d as Qe}from"./chunk-BMVBJQDF.js";import{a as Ge,b as fe,c as Ze,d as Je,e as ge,f as Xe,g as me,h as Ye,i as G,j as ye,k as x}from"./chunk-34FX4M3J.js";import{e as et}from"./chunk-45DFJJAO.js";import{d as tt}from"./chunk-OF426VSL.js";import{H as qe,I as Ve}from"./chunk-4NAKX6WQ.js";import{Bd as L,D as Ne,Da as H,E as Fe,Fb as U,L as le,La as ze,P as Le,Q as $e,Ua as K,V as ue,Y as O,Z as de,aa as he,c as g,ca as We,d as je,da as He,h as Oe,i as Be,ia as T,ja as W,l as q,la as C,m as Y,ma as f,n as B,na as M,o as V,ra as pe,t as R,ta as Ke,u as Me,za as Ue}from"./chunk-ZPV56E2J.js";import{b as y}from"./chunk-WFMAM73Y.js";import{a as ce,i as A}from"./chunk-66YHNWRR.js";var ot={production:!0,version:"6.32.0",firebaseConfig:{apiKey:"AIzaSyDnnitFXpM8TglWKNpzu4ChgF98n25Rgvw",authDomain:"auth.dealpos.com",projectId:"devops-signin",storageBucket:"devops-signin.appspot.com",messagingSenderId:"412465165194",appId:"1:412465165194:web:03d806f6b6ab6f8b460e73",measurementId:"G-MNDBRJ5XZD"},news:"https://changelog.dealpos.app/umbraco/delivery/api/v2/content?fetch=children:omni&sort=sortOrder:asc"};var it=(()=>{class r{constructor(){}getParseToken(){let e=JSON.parse(window.localStorage.getItem("user"));return this.ParseToken(e.Token.access_token)}GetRoles(){let t=this.getParseToken()["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"];return typeof t=="string"&&(t=[t]),t||[]}ParseToken(e){try{let n=e.split(".")[0].replace("-","+").replace("_","/"),o=JSON.parse(window.atob(n)),c=e.split(".")[1].replace("-","+").replace("_","/"),s=JSON.parse(window.atob(c));return s.header=o,s}catch{return!1}}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=T({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var Tt="firebase",Ct="11.10.0";G(Tt,Ct,"app");var z=new We("ANGULARFIRE2_VERSION");var st=(r,a)=>{let e=a?[a]:Ye(),t=[];return e.forEach(n=>{n.container.getProvider(r).instances.forEach(i=>{t.includes(i)||t.push(i)})}),t},ve=(function(r){return r[r.SILENT=0]="SILENT",r[r.WARN=1]="WARN",r[r.VERBOSE=2]="VERBOSE",r})(ve||{}),Mr=L()&&typeof Zone<"u"?ve.WARN:ve.SILENT;var te=class{zone;delegate;constructor(a,e=Be){this.zone=a,this.delegate=e}now(){return this.delegate.now()}schedule(a,e,t){let n=this.zone,o=function(i){n?n.runGuarded(()=>{a.apply(this,[i])}):a.apply(this,[i])};return this.delegate.schedule(o,e,t)}},Ae=(()=>{class r{outsideAngular;insideAngular;constructor(){let e=M(H);this.outsideAngular=e.runOutsideAngular(()=>new te(typeof Zone>"u"?void 0:Zone.current)),this.insideAngular=e.run(()=>new te(typeof Zone>"u"?void 0:Zone.current,Oe))}static \u0275fac=function(t){return new(t||r)};static \u0275prov=T({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var Pt="firebase",xt="11.10.0";x.registerVersion(Pt,xt,"app-compat");var _t=["ngOnDestroy"],ct=(r,a,e,t={})=>new Proxy(r,{get:(n,o)=>e.runOutsideAngular(()=>{if(r[o])return t?.spy?.get&&t.spy.get(o,r[o]),r[o];if(_t.indexOf(o)>-1)return()=>{};let i=a.toPromise().then(c=>{let s=c?.[o];return typeof s=="function"?s.bind(c):s?.then?s.then(l=>e.run(()=>l)):e.run(()=>s)});return new Proxy(()=>{},{get:(c,s)=>i[s],apply:(c,s,l)=>i.then(h=>{let u=h?.(...l);return t?.spy?.apply&&t.spy.apply(o,l,u),u})})})});var re=class{constructor(a){return a}},ne=new C("angularfire2.app.options"),oe=new C("angularfire2.app.name");function ke(r,a,e){let t=typeof e=="string"&&e||"[DEFAULT]",n=typeof e=="object"&&e||{};n.name=n.name||t;let i=x.apps.filter(c=>c&&c.name===n.name)[0]||a.runOutsideAngular(()=>x.initializeApp(r,n));try{if(JSON.stringify(r)!==JSON.stringify(i.options)){let c=!!module.hot;Rt("error",`${i.name} Firebase App already initialized with different options${c?", you may need to reload as Firebase is not HMR aware.":"."}`)}}catch{}return new re(i)}var Rt=(r,...a)=>{L()&&typeof console<"u"&&console[r](...a)},jt={provide:re,useFactory:ke,deps:[ne,H,[new ze,oe]]},zr=(()=>{class r{static initializeApp(e,t){return{ngModule:r,providers:[{provide:ne,useValue:e},{provide:oe,useValue:t}]}}constructor(e){x.registerVersion("angularfire",z.full,"core"),x.registerVersion("angularfire",z.full,"app-compat"),x.registerVersion("angular",He.full,e.toString())}static \u0275fac=function(t){return new(t||r)(f(K))};static \u0275mod=U({type:r});static \u0275inj=W({providers:[jt]})}return r})();function lt(r,a,e,t,n){let[,o,i]=globalThis.\u0275AngularfireInstanceCache.find(c=>c[0]===r)||[];if(o)return Ot(n,i)||(at("error",`${a} was already initialized on the ${e} Firebase App with different settings.${Bt?" You may need to reload as Firebase is not HMR aware.":""}`),at("warn",{is:n,was:i})),o;{let c=t();return globalThis.\u0275AngularfireInstanceCache.push([r,c,n]),c}}function Ot(r,a){try{return r.toString()===a.toString()}catch{return r===a}}var Bt=typeof module<"u"&&!!module.hot,at=(r,...a)=>{L()&&typeof console<"u"&&console[r](...a)};globalThis.\u0275AngularfireInstanceCache||=[];var Mt=new Map,Nt={activated:!1,tokenObservers:[]},Ft={initialized:!1,enabled:!1};function _(r){return Mt.get(r)||Object.assign({},Nt)}function pt(){return Ft}var Lt="https://content-firebaseappcheck.googleapis.com/v1";var $t="exchangeDebugToken",ut={OFFSET_DURATION:300*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:960*1e3},nn=1440*60*1e3;var Ee=class{constructor(a,e,t,n,o){if(this.operation=a,this.retryPolicy=e,this.getWaitDuration=t,this.lowerBound=n,this.upperBound=o,this.pending=null,this.nextErrorWaitInterval=n,n>o)throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}process(a){return A(this,null,function*(){this.stop();try{this.pending=new fe,this.pending.promise.catch(e=>{}),yield Wt(this.getNextRun(a)),this.pending.resolve(),yield this.pending.promise,this.pending=new fe,this.pending.promise.catch(e=>{}),yield this.operation(),this.pending.resolve(),yield this.pending.promise,this.process(!0).catch(()=>{})}catch(e){this.retryPolicy(e)?this.process(!1).catch(()=>{}):this.stop()}})}getNextRun(a){if(a)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{let e=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),e}}};function Wt(r){return new Promise(a=>{setTimeout(a,r)})}var Ht={"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.","initial-throttle":"{$httpStatus} error. Attempts allowed again after {$time}",throttled:"Requests throttled due to previous {$httpStatus} error. Attempts allowed again after {$time}"},N=new Je("appCheck","AppCheck",Ht);function ft(r){if(!_(r).activated)throw N.create("use-before-activation",{appName:r.name})}function gt(t,n){return A(this,arguments,function*({url:r,body:a},e){let o={"Content-Type":"application/json"},i=e.getImmediate({optional:!0});if(i){let d=yield i.getHeartbeatsHeader();d&&(o["X-Firebase-Client"]=d)}let c={method:"POST",body:JSON.stringify(a),headers:o},s;try{s=yield fetch(r,c)}catch(d){throw N.create("fetch-network-error",{originalErrorMessage:d?.message})}if(s.status!==200)throw N.create("fetch-status-error",{httpStatus:s.status});let l;try{l=yield s.json()}catch(d){throw N.create("fetch-parse-error",{originalErrorMessage:d?.message})}let h=l.ttl.match(/^([\d.]+)(s)$/);if(!h||!h[2]||isNaN(Number(h[1])))throw N.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${l.ttl}`});let u=Number(h[1])*1e3,p=Date.now();return{token:l.token,expireTimeMillis:p+u,issuedAtTimeMillis:p}})}function mt(r,a){let{projectId:e,appId:t,apiKey:n}=r.options;return{url:`${Lt}/projects/${e}/apps/${t}:${$t}?key=${n}`,body:{debug_token:a}}}var Kt="firebase-app-check-database",Ut=1,Ie="firebase-app-check-store";var ie=null;function zt(){return ie||(ie=new Promise((r,a)=>{try{let e=indexedDB.open(Kt,Ut);e.onsuccess=t=>{r(t.target.result)},e.onerror=t=>{var n;a(N.create("storage-open",{originalErrorMessage:(n=t.target.error)===null||n===void 0?void 0:n.message}))},e.onupgradeneeded=t=>{let n=t.target.result;switch(t.oldVersion){case 0:n.createObjectStore(Ie,{keyPath:"compositeKey"})}}}catch(e){a(N.create("storage-open",{originalErrorMessage:e?.message}))}}),ie)}function qt(r,a){return Vt(Gt(r),a)}function Vt(r,a){return A(this,null,function*(){let t=(yield zt()).transaction(Ie,"readwrite"),o=t.objectStore(Ie).put({compositeKey:r,value:a});return new Promise((i,c)=>{o.onsuccess=s=>{i()},t.onerror=s=>{var l;c(N.create("storage-set",{originalErrorMessage:(l=s.target.error)===null||l===void 0?void 0:l.message}))}})})}function Gt(r){return`${r.options.appId}-${r.name}`}var Z=new Xe("@firebase/app-check");function be(r,a){return Ze()?qt(r,a).catch(e=>{Z.warn(`Failed to write token to IndexedDB. Error: ${e}`)}):Promise.resolve()}function yt(){return pt().enabled}function wt(){return A(this,null,function*(){let r=pt();if(r.enabled&&r.token)return r.token.promise;throw Error(`
|
|
2
2
|
Can't get debug token in production mode.
|
|
3
3
|
`)})}var Zt={error:"UNKNOWN_ERROR"};function Jt(r){return Ge.encodeString(JSON.stringify(r),!1)}function Te(r,a=!1,e=!1){return A(this,null,function*(){let t=r.app;ft(t);let n=_(t),o=n.token,i;if(o&&!J(o)&&(n.token=void 0,o=void 0),!o){let l=yield n.cachedTokenPromise;l&&(J(l)?o=l:yield be(t,void 0))}if(!a&&o&&J(o))return{token:o.token};let c=!1;if(yt())try{n.exchangeTokenPromise||(n.exchangeTokenPromise=gt(mt(t,yield wt()),r.heartbeatServiceProvider).finally(()=>{n.exchangeTokenPromise=void 0}),c=!0);let l=yield n.exchangeTokenPromise;return yield be(t,l),n.token=l,{token:l.token}}catch(l){return l.code==="appCheck/throttled"||l.code==="appCheck/initial-throttle"?Z.warn(l.message):e&&Z.error(l),Se(l)}try{n.exchangeTokenPromise||(n.exchangeTokenPromise=n.provider.getToken().finally(()=>{n.exchangeTokenPromise=void 0}),c=!0),o=yield _(t).exchangeTokenPromise}catch(l){l.code==="appCheck/throttled"||l.code==="appCheck/initial-throttle"?Z.warn(l.message):e&&Z.error(l),i=l}let s;return o?i?J(o)?s={token:o.token,internalError:i}:s=Se(i):(s={token:o.token},n.token=o,yield be(t,o)):s=Se(i),c&&er(t,s),s})}function Xt(r){return A(this,null,function*(){let a=r.app;ft(a);let{provider:e}=_(a);if(yt()){let t=yield wt(),{token:n}=yield gt(mt(a,t),r.heartbeatServiceProvider);return{token:n}}else{let{token:t}=yield e.getToken();return{token:t}}})}function Yt(r,a,e,t){let{app:n}=r,o=_(n),i={next:e,error:t,type:a};if(o.tokenObservers=[...o.tokenObservers,i],o.token&&J(o.token)){let c=o.token;Promise.resolve().then(()=>{e({token:c.token}),dt(r)}).catch(()=>{})}o.cachedTokenPromise.then(()=>dt(r))}function vt(r,a){let e=_(r),t=e.tokenObservers.filter(n=>n.next!==a);t.length===0&&e.tokenRefresher&&e.tokenRefresher.isRunning()&&e.tokenRefresher.stop(),e.tokenObservers=t}function dt(r){let{app:a}=r,e=_(a),t=e.tokenRefresher;t||(t=Qt(r),e.tokenRefresher=t),!t.isRunning()&&e.isTokenAutoRefreshEnabled&&t.start()}function Qt(r){let{app:a}=r;return new Ee(()=>A(null,null,function*(){let e=_(a),t;if(e.token?t=yield Te(r,!0):t=yield Te(r),t.error)throw t.error;if(t.internalError)throw t.internalError}),()=>!0,()=>{let e=_(a);if(e.token){let t=e.token.issuedAtTimeMillis+(e.token.expireTimeMillis-e.token.issuedAtTimeMillis)*.5+3e5,n=e.token.expireTimeMillis-300*1e3;return t=Math.min(t,n),Math.max(0,t-Date.now())}else return 0},ut.RETRIAL_MIN_WAIT,ut.RETRIAL_MAX_WAIT)}function er(r,a){let e=_(r).tokenObservers;for(let t of e)try{t.type==="EXTERNAL"&&a.error!=null?t.error(a.error):t.next(a)}catch{}}function J(r){return r.expireTimeMillis-Date.now()>0}function Se(r){return{token:Jt(Zt),error:r}}var Ce=class{constructor(a,e){this.app=a,this.heartbeatServiceProvider=e}_delete(){let{tokenObservers:a}=_(this.app);for(let e of a)vt(this.app,e.next);return Promise.resolve()}};function tr(r,a){return new Ce(r,a)}function rr(r){return{getToken:a=>Te(r,a),getLimitedUseToken:()=>Xt(r),addTokenListener:a=>Yt(r,"INTERNAL",a),removeTokenListener:a=>vt(r.app,a)}}var nr="@firebase/app-check",or="0.10.1";var ir="app-check",ht="app-check-internal";function sr(){me(new ge(ir,r=>{let a=r.getProvider("app").getImmediate(),e=r.getProvider("heartbeat");return tr(a,e)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((r,a,e)=>{r.getProvider(ht).initialize()})),me(new ge(ht,r=>{let a=r.getProvider("app-check").getImmediate();return rr(a)},"PUBLIC").setInstantiationMode("EXPLICIT")),G(nr,or)}sr();var ar="app-check";var se=class{constructor(){return st(ar)}};var cr=["localhost","0.0.0.0","127.0.0.1"],vn=typeof window<"u"&&cr.includes(window.location.hostname);var ur=new C("angularfire2.auth.use-emulator"),dr=new C("angularfire2.auth.settings"),hr=new C("angularfire2.auth.tenant-id"),pr=new C("angularfire2.auth.langugage-code"),fr=new C("angularfire2.auth.use-device-language"),gr=new C("angularfire.auth.persistence"),mr=(r,a,e,t,n,o,i,c)=>lt(`${r.name}.auth`,"AngularFireAuth",r.name,()=>{let s=a.runOutsideAngular(()=>r.auth());if(e&&s.useEmulator(...e),t&&(s.tenantId=t),s.languageCode=n,o&&s.useDeviceLanguage(),i)for(let[l,h]of Object.entries(i))s.settings[l]=h;return c&&s.setPersistence(c),s},[e,t,n,o,i,c]),De=(()=>{class r{injector=M(pe);authState;idToken;user;idTokenResult;credential;constructor(e,t,n,o,i,c,s,l,h,u,p,d){let m=new je,D=V(void 0).pipe(q(i.outsideAngular),O(()=>o.runOutsideAngular(()=>import("./chunk-JHNZSQGY.js"))),R(()=>ke(e,o,t)),R(P=>mr(P,o,c,l,h,u,s,p)),ue({bufferSize:1,refCount:!1}));if(Ve(n))this.authState=this.user=this.idToken=this.idTokenResult=this.credential=V(null);else{D.pipe($e()).subscribe();let P=D.pipe(O(E=>E.getRedirectResult().then(j=>j,()=>null)),Qe(this.injector),ue({bufferSize:1,refCount:!1})),X=D.pipe(O(E=>new g(j=>({unsubscribe:o.runOutsideAngular(()=>E.onAuthStateChanged(F=>j.next(F),F=>j.error(F),()=>j.complete()))})))),ae=D.pipe(O(E=>new g(j=>({unsubscribe:o.runOutsideAngular(()=>E.onIdTokenChanged(F=>j.next(F),F=>j.error(F),()=>j.complete()))}))));this.authState=P.pipe(de(X),Y(i.outsideAngular),q(i.insideAngular)),this.user=P.pipe(de(ae),Y(i.outsideAngular),q(i.insideAngular)),this.idToken=this.user.pipe(O(E=>E?B(E.getIdToken()):V(null))),this.idTokenResult=this.user.pipe(O(E=>E?B(E.getIdTokenResult()):V(null))),this.credential=Ne(P,m,this.authState.pipe(Fe(E=>!E))).pipe(R(E=>E?.user?E:null),Y(i.outsideAngular),q(i.insideAngular))}return ct(this,D,o,{spy:{apply:(P,X,ae)=>{(P.startsWith("signIn")||P.startsWith("createUser"))&&ae.then(E=>m.next(E))}}})}static \u0275fac=function(t){return new(t||r)(f(ne),f(oe,8),f(K),f(H),f(Ae),f(ur,8),f(dr,8),f(hr,8),f(pr,8),f(fr,8),f(gr,8),f(se,8))};static \u0275prov=T({token:r,factory:r.\u0275fac,providedIn:"any"})}return r})(),Bn=(()=>{class r{constructor(){x.registerVersion("angularfire",z.full,"auth-compat")}static \u0275fac=function(t){return new(t||r)};static \u0275mod=U({type:r});static \u0275inj=W({providers:[De]})}return r})();var k=(function(r){return r.readonly="readonly",r.readwrite="readwrite",r})(k||{}),At=new C(null),kt=new C("Indexed DB"),wr=new C("Server Indexed DB");function vr(r,a){return r.objectStoreNames.contains(a)}function I(r,a,e){if(!r){e("You need to use the openDatabase function to create a database before you query it!");return}vr(r,a)||e(`objectStore does not exists: ${a}`)}function b(r,a){let e=r.transaction(a.storeName,a.dbMode);return e.onerror=a.error,e.onabort=a.abort,e}function S(r,a,e,t){return{storeName:a,dbMode:r,error:n=>{e(n)},abort:n=>{e(n)}}}var xe=[];function w(r,a,e,t){return new Promise((n,o)=>{r||o("IndexedDB not available");let i=r.open(a,e),c;i.onsuccess=()=>{c=i.result,xe.push(c),n(c)},i.onerror=()=>{o(`IndexedDB error: ${i.error}`)},typeof t=="function"&&(i.onupgradeneeded=s=>{t(s,c)})})}function Pe(r,a,e,t,n){return A(this,null,function*(){return new Promise((o,i)=>{if(!r)return;let c=r.open(a,e);c.onupgradeneeded=s=>A(null,null,function*(){let l=s.target.result,h=t.map(p=>A(null,null,function*(){if(!l.objectStoreNames.contains(p.store)){let d=l.createObjectStore(p.store,p.storeConfig);for(let m of p.storeSchema)d.createIndex(m.name,m.keypath,m.options)}}));yield Promise.all(h);let u=n&&n();if(u){let p=Object.keys(u).map(d=>parseInt(d,10)).filter(d=>d>s.oldVersion).sort((d,m)=>d-m);for(let d of p)u[d](l,c.transaction)}l.close(),o()}),c.onsuccess=s=>{s.target.result.close(),o()},c.onerror=s=>{i(s)}})})}function Ar(r,a,e){if(!r||!a||!e)throw Error('Params: "dbName", "version", "storeName" are mandatory.');return new g(t=>{try{let n=a+1,o=indexedDB.open(r,n);o.onupgradeneeded=i=>{let c=i.target.result;c.deleteObjectStore(e),c.close(),console.log("onupgradeneeded"),t.next(),t.complete()},o.onerror=i=>t.error(i)}catch(n){t.error(n)}})}function kr(r){return new Promise((a,e)=>{if(!r){e(new Error("No database to close"));return}try{r.close(),a()}catch(t){e(`Error closing database: ${t}`)}})}function v(){return function(r,a,e){let t=e.value;return e.value=function(...n){let o=t.apply(this,n);return o instanceof g?o.pipe(Le(()=>A(this,null,function*(){let i=xe.map(c=>A(this,null,function*(){yield kr(c)}));yield Promise.all(i),xe.length=0}))):o},e}}var Re=(()=>{class r{constructor(e,t){this.dbConfigs=e,this.indexedDB=t,this.defaultDatabaseName=null,Object.values(this.dbConfigs).forEach((n,o,i)=>this.instanciateConfig(n,i.length===1))}instanciateConfig(e,t){return A(this,null,function*(){if(!e.name)throw new Error("NgxIndexedDB: Please, provide the dbName in the configuration");if((e.isDefault??!1)&&this.defaultDatabaseName)throw new Error("NgxIndexedDB: Only one database can be set as default");((e.isDefault??!1)&&!this.defaultDatabaseName||t)&&(this.defaultDatabaseName=e.name,this.selectedDb=e.name),yield Pe(this.indexedDB,e.name,e.version,e.objectStoresMeta,e.migrationFactory),w(this.indexedDB,e.name).then(n=>{n.version!==e.version&&(L()&&(console.warn(`
|
|
4
4
|
Your DB Config doesn't match the most recent version of the DB with name ${e.name}, please update it
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as te,b as ne}from"./chunk-ZEALEXSH.js";import{a as ee}from"./chunk-J5PTSESV.js";import{a as $}from"./chunk-
|
|
1
|
+
import{a as te,b as ne}from"./chunk-ZEALEXSH.js";import{a as ee}from"./chunk-J5PTSESV.js";import{a as $}from"./chunk-ELKXBB2L.js";import"./chunk-6GSJBXEE.js";import"./chunk-2C6XBRGE.js";import"./chunk-RUHYZ275.js";import"./chunk-3BV4FPZE.js";import"./chunk-26I3WOHT.js";import"./chunk-72AE6737.js";import{a as Z}from"./chunk-KMCVYMXQ.js";import"./chunk-QDKVYF6D.js";import"./chunk-VAYLCOBC.js";import"./chunk-6PI5PUIQ.js";import"./chunk-6VOSRCWX.js";import"./chunk-XSXHGAXP.js";import"./chunk-W2CSYQ6H.js";import"./chunk-ODW7HQHU.js";import"./chunk-TWIWWZUD.js";import"./chunk-ACIMXBIC.js";import"./chunk-67AXBZYF.js";import"./chunk-5QG5PZ7U.js";import"./chunk-KYK2ZFUZ.js";import{b as Y}from"./chunk-L7K2JAJV.js";import"./chunk-DEQSZUMF.js";import"./chunk-NIRJAWTX.js";import"./chunk-RDXDKWLL.js";import"./chunk-2GINYFUG.js";import"./chunk-625TQFQL.js";import"./chunk-EDNKI3WA.js";import"./chunk-CM45JN3C.js";import"./chunk-7BEOEYAC.js";import"./chunk-WU3SNCIC.js";import"./chunk-A32JPG5P.js";import"./chunk-JY726AM5.js";import"./chunk-2BS4VK45.js";import"./chunk-TTMPMWUQ.js";import"./chunk-5RV2CJGS.js";import"./chunk-QGNTUEVO.js";import"./chunk-GJXDRPAS.js";import"./chunk-GBUDZCXK.js";import"./chunk-S3MYFAWN.js";import"./chunk-SPNVH2ST.js";import"./chunk-BXA5YUTN.js";import"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import{h as q}from"./chunk-5FO4RY4B.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import"./chunk-P5OAPFNC.js";import"./chunk-7R55YTL6.js";import{c as H}from"./chunk-NNVT5X6O.js";import{c as G,h as J,m as K,o as Q,z as X}from"./chunk-BUBQQEYA.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import{e as U}from"./chunk-45DFJJAO.js";import{e as W,g as j}from"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import{B as V,D as A}from"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{Eb as M,Ga as _,Oc as r,Pc as u,Qc as S,Sc as N,Tc as I,Uc as F,bc as x,bd as k,dc as E,fc as L,gc as T,hc as P,ic as p,jc as t,kb as y,kc as n,kd as v,lc as f,ld as z,mb as o,md as B,na as C,sc as R,sd as h,ua as D,va as O,xc as s,zc as w}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import{a as g,b}from"./chunk-66YHNWRR.js";var ie=l=>({ID:l});function oe(l,c){if(l&1&&(t(0,"tr")(1,"td"),r(2),n(),t(3,"td"),f(4,"img",23),n(),t(5,"td"),r(6),n(),t(7,"td",24)(8,"a",25),r(9),v(10,"number"),n()(),t(11,"td"),r(12),n(),t(13,"td"),r(14),v(15,"date"),n()()),l&2){let e=c.$implicit;o(2),u(e._source.ChannelName),o(2),p("src",e.logo,y),o(2),u(e._source.DateRange),o(2),p("queryParams",k(12,ie,e._source.ID)),o(),S(" ",z(10,7,e._source.CountOrder)," "),o(3),u(e._source.UserLogin),o(2),S(" ",B(15,9,e._source["@timestamp_received"],"dd MMM yyyy HH:mm")," ")}}function re(l,c){if(l&1){let e=R();t(0,"div",14)(1,"table",16)(2,"thead")(3,"tr",17)(4,"th",18),r(5,"Channel"),n(),t(6,"th",19),r(7,"Type"),n(),t(8,"th",20),r(9,"Download Date Range"),n(),t(10,"th",21),r(11,"Count"),n(),t(12,"th"),r(13,"User Login"),n(),t(14,"th"),r(15,"Created"),n()()(),t(16,"tbody"),T(17,oe,16,14,"tr",null,L),n()(),t(19,"mat-paginator",22),s("page",function(a){D(e);let m=w();return O(m.onPaginationChange(a))}),n()()}if(l&2){let e,i=w();o(17),P(i.downloadOrders()),o(2),p("length",i.paginationTotal())("pageSize",i.paginationPageSize())("pageIndex",((e=i.filter())==null?null:e.PageNumber)==0?0:((e=i.filter())==null?null:e.PageNumber)-1)}}function ae(l,c){l&1&&(t(0,"div",15),f(1,"app-empty-state"),n())}var Me=(()=>{class l{constructor(){this.http=C(U),this.authService=C(q),this.downloadOrdersResponse=_(null),this.downloadOrders=h(()=>{let e=this.downloadOrdersResponse();return e?e.hits.map(i=>(i.logo=H.getChannelLogoByTypeId(i._source.TypeID),i)):[]}),this.filter=_({PageNumber:0,RowCount:20,ChannelID:"",From:"",To:""}),this.paginationTotal=h(()=>this.downloadOrdersResponse()?.total.value??0),this.paginationPageSize=h(()=>{let e=this.paginationTotal();return this.filter().RowCount>e?e:this.filter().RowCount}),this.channelOptions=this.authService.getChannels(),this.onGetLoader()}onGetLoader(){this.http.post("/api/OrdersLoader/OrderLogsLoader",{}).subscribe(e=>{this.filter.set(e.Filter),this.getDownloadOrders()})}getDownloadOrders(){this.http.post("api/Orders/OrderLogsPaged",this.filter()).subscribe(e=>{this.downloadOrdersResponse.set(e)})}onPaginationChange(e){this.filter.update(i=>b(g({},i),{PageNumber:e.pageIndex+1})),this.getDownloadOrders()}onFilterChange(e){this.filter.update(i=>g(g({},i),e))}static{this.\u0275fac=function(i){return new(i||l)}}static{this.\u0275cmp=M({type:l,selectors:[["app-download-order-log"]],decls:27,vars:7,consts:[["headerTitle","Download Order Log",3,"onSubmit","hideSearchBox"],[1,"fw-bold","mb-2"],[3,"ngModelChange","ngModel"],[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"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[2,"width","200px"],[1,"text-end",2,"width","200px"],[3,"page","length","pageSize","pageIndex"],[2,"width","25px",3,"src"],[1,"text-end"],["routerLink","/menu/order/log/detail",3,"queryParams"]],template:function(i,a){if(i&1&&(t(0,"mainpanel",0),s("onSubmit",function(){return a.getDownloadOrders()}),t(1,"filters")(2,"div")(3,"label",1),r(4,"Channel"),n(),t(5,"app-channel-options-v2",2),s("ngModelChange",function(d){return a.onFilterChange({ChannelID:d})}),n()(),t(6,"div",3)(7,"label",4),r(8,"From/To"),n(),t(9,"div",5)(10,"datepicker",6),s("dateChange",function(d){return a.onFilterChange({From:d})}),n()(),t(11,"div")(12,"datepicker",7),s("dateChange",function(d){return a.onFilterChange({To:d})}),n()()(),t(13,"div",3)(14,"label",8),r(15,"Page Number"),n(),t(16,"input",9),s("ngModelChange",function(d){return a.onFilterChange({PageNumber:+d})}),n()(),t(17,"div",3)(18,"label",8),r(19,"Page Size"),n(),t(20,"input",10),F("ngModelChange",function(d){return I(a.filter().RowCount,d)||(a.filter().RowCount=d),d}),n()()(),t(21,"content")(22,"div",11)(23,"div",12)(24,"div",13),x(25,re,20,3,"div",14)(26,ae,2,0,"div",15),n()()()()()),i&2){let m;p("hideSearchBox",!0),o(5),p("ngModel",a.filter().ChannelID),o(5),p("date",a.filter().From),o(2),p("date",a.filter().To),o(4),p("ngModel",a.filter().PageNumber),o(4),N("ngModel",a.filter().RowCount),o(5),E(((m=a.downloadOrders())==null?null:m.length)>0?25:26)}},dependencies:[ne,te,Y,X,G,Q,J,K,ee,j,W,Z,$,V,A],encapsulation:2,changeDetection:0})}}return l})();export{Me as DownloadOrderLogComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as j}from"./chunk-
|
|
1
|
+
import{a as j}from"./chunk-ELKXBB2L.js";import"./chunk-6GSJBXEE.js";import"./chunk-2C6XBRGE.js";import"./chunk-RUHYZ275.js";import"./chunk-3BV4FPZE.js";import"./chunk-QDKVYF6D.js";import"./chunk-VAYLCOBC.js";import"./chunk-6PI5PUIQ.js";import"./chunk-6VOSRCWX.js";import"./chunk-XSXHGAXP.js";import"./chunk-W2CSYQ6H.js";import"./chunk-ODW7HQHU.js";import"./chunk-TWIWWZUD.js";import"./chunk-ACIMXBIC.js";import"./chunk-67AXBZYF.js";import"./chunk-5QG5PZ7U.js";import"./chunk-KYK2ZFUZ.js";import{b as O}from"./chunk-L7K2JAJV.js";import"./chunk-DEQSZUMF.js";import"./chunk-NIRJAWTX.js";import"./chunk-RDXDKWLL.js";import"./chunk-SPNVH2ST.js";import"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import"./chunk-5FO4RY4B.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import{a as T}from"./chunk-P5OAPFNC.js";import"./chunk-7R55YTL6.js";import"./chunk-NNVT5X6O.js";import{c as L,h as N,m as U,p as K,z as R}from"./chunk-BUBQQEYA.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import{e as D}from"./chunk-45DFJJAO.js";import"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import{C as B,z as I}from"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{Eb as P,Ga as g,Oc as l,Pc as A,V as b,Vc as V,Wc as E,Xc as x,bc as _,dc as f,ic as s,jc as i,kc as t,kd as S,lc as k,ld as M,mb as d,na as w,sc as v,ua as c,va as p,xc as m,zc as h}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";function F(n,y){if(n&1){let e=v();i(0,"input",30),m("ngModelChange",function(o){c(e);let r=h();return p(r.sku.set(o))}),t()}if(n&2){let e=h();s("ngModel",e.sku())}}function H(n,y){if(n&1){let e=v();i(0,"input",31),m("ngModelChange",function(o){c(e);let r=h();return p(r.itemId.set(o))}),t()}if(n&2){let e=h();s("ngModel",e.itemId())}}function J(n,y){if(n&1&&(i(0,"pre",28),l(1),S(2,"json"),t()),n&2){h();let e=x(35);d(),A(M(2,1,e))}}function $(n,y){n&1&&(i(0,"p",29),l(1," Your data will be shown here once it's available "),t())}var re=(()=>{class n{constructor(){this.httpService=w(D),this.selectedChannel=g(null),this.sku=g(null),this.itemId=g(null),this.searchBy=g("sku")}initProductLog(){let e={ChannelID:this.selectedChannel()};this.searchBy()==="sku"?e.SKU=this.sku():e.ItemID=this.itemId(),this.productLog$=this.httpService.post(T.GetProductApiLog,e).pipe(b(1))}copyToClipboard(e){if(!e)return;let a=typeof e=="string"?e:JSON.stringify(e,null,2);navigator.clipboard.writeText(a),alert("Copied to clipboard!")}static{this.\u0275fac=function(a){return new(a||n)}}static{this.\u0275cmp=P({type:n,selectors:[["app-product-api"]],decls:50,vars:14,consts:[["headerTitle","Origin Product Api",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-success","btn-fill","me-3",3,"click"],[1,"fa","fa-search"],[1,"container-fluid","mt-8","px-10"],[1,"row"],[1,"col-7"],[1,"d-flex","align-items-center"],[1,"w-75"],[1,"mb-0","text-muted","fst-italic"],[1,"w-100"],[3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center","mt-3"],[1,"mb-2"],[1,"form-check","form-check-inline"],["type","radio","name","searchBy","id","searchBySku",1,"form-check-input",3,"ngModelChange","ngModel","value"],["for","searchBySku",1,"form-check-label"],["type","radio","name","searchBy","id","searchByItemId",1,"form-check-input",3,"ngModelChange","ngModel","value"],["for","searchByItemId",1,"form-check-label"],["type","text","placeholder","Product Code / SKU",1,"form-control","rounded-1",2,"height","40px",3,"ngModel"],["type","text","placeholder","ItemID is Product id from seller center",1,"form-control","rounded-1",2,"height","40px",3,"ngModel"],[1,"row","mt-6"],[1,"col-12"],[1,"card"],[1,"card-header","d-flex","justify-content-between","align-items-center"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group","position-relative"],["id","productLogText"],[1,"text-center","my-12","text-muted"],["type","text","placeholder","Product Code / SKU",1,"form-control","rounded-1",2,"height","40px",3,"ngModelChange","ngModel"],["type","text","placeholder","ItemID is Product id from seller center",1,"form-control","rounded-1",2,"height","40px",3,"ngModelChange","ngModel"]],template:function(a,o){if(a&1){let r=v();i(0,"mainpanel",0)(1,"actions")(2,"button",1),m("click",function(){return c(r),p(o.initProductLog())}),k(3,"i",2),l(4," Search "),t()(),i(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h6"),l(12,"Channel"),t(),i(13,"p",8),l(14," View logs related to Product API Detail "),t()(),i(15,"div",9)(16,"app-channel-options-v2",10),m("ngModelChange",function(u){return c(r),p(o.selectedChannel.set(u))}),t()()(),i(17,"div",11)(18,"div",7)(19,"h6"),l(20,"Product Code / SKU"),t(),i(21,"p",8),l(22," Product SKU or Code from Channel Product "),t()(),i(23,"div",9)(24,"div",12)(25,"div",13)(26,"input",14),m("ngModelChange",function(u){return c(r),p(o.searchBy.set(u))}),t(),i(27,"label",15),l(28,"Search by SKU"),t()(),i(29,"div",13)(30,"input",16),m("ngModelChange",function(u){return c(r),p(o.searchBy.set(u))}),t(),i(31,"label",17),l(32,"Search by ItemID"),t()()(),_(33,F,1,1,"input",18),_(34,H,1,1,"input",19),t()()()(),V(35),S(36,"async"),i(37,"div",20)(38,"div",21)(39,"div",22)(40,"div",23)(41,"h5"),l(42,"Response"),t(),i(43,"button",24),m("click",function(){c(r);let u=x(35);return p(o.copyToClipboard(u))}),l(44," Copy "),t()(),i(45,"div",25)(46,"div",26)(47,"div",27),_(48,J,3,3,"pre",28)(49,$,2,0,"p",29),t()()()()()()()()()}if(a&2){s("hideSearchBox",!0)("hideSearchDropdown",!0),d(16),s("ngModel",o.selectedChannel()),d(10),s("ngModel",o.searchBy())("value","sku"),d(4),s("ngModel",o.searchBy())("value","itemid"),d(3),f(o.searchBy()==="sku"?33:-1),d(),f(o.searchBy()==="itemid"?34:-1),d();let r=E(M(36,11,o.productLog$));d(8),s("disabled",!r),d(5),f(r?48:49)}},dependencies:[R,L,K,N,U,O,j,I,B],encapsulation:2,changeDetection:0})}}return n})();export{re as ProductApiComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as oe,b as le,c as pe}from"./chunk-
|
|
1
|
+
import{a as oe,b as le,c as pe}from"./chunk-HSKAYNRW.js";import{a as me}from"./chunk-KIA53ZRS.js";import{a as T}from"./chunk-HHZM6PB4.js";import{a as de}from"./chunk-J5PTSESV.js";import{a as ae}from"./chunk-ELKXBB2L.js";import"./chunk-6GSJBXEE.js";import"./chunk-2C6XBRGE.js";import"./chunk-RUHYZ275.js";import"./chunk-3BV4FPZE.js";import{a as re}from"./chunk-TWRFL73R.js";import"./chunk-7ES2Z445.js";import{a as ne}from"./chunk-KMCVYMXQ.js";import"./chunk-QDKVYF6D.js";import"./chunk-VAYLCOBC.js";import"./chunk-6PI5PUIQ.js";import"./chunk-6VOSRCWX.js";import"./chunk-XSXHGAXP.js";import"./chunk-W2CSYQ6H.js";import"./chunk-ODW7HQHU.js";import"./chunk-TWIWWZUD.js";import"./chunk-ACIMXBIC.js";import"./chunk-67AXBZYF.js";import"./chunk-5QG5PZ7U.js";import"./chunk-KYK2ZFUZ.js";import{b as ie}from"./chunk-L7K2JAJV.js";import"./chunk-DEQSZUMF.js";import"./chunk-NIRJAWTX.js";import{a as te}from"./chunk-RDXDKWLL.js";import"./chunk-2GINYFUG.js";import"./chunk-625TQFQL.js";import"./chunk-EDNKI3WA.js";import"./chunk-CM45JN3C.js";import"./chunk-7BEOEYAC.js";import"./chunk-WU3SNCIC.js";import"./chunk-A32JPG5P.js";import"./chunk-JY726AM5.js";import"./chunk-2BS4VK45.js";import"./chunk-TTMPMWUQ.js";import"./chunk-5RV2CJGS.js";import"./chunk-QGNTUEVO.js";import"./chunk-GJXDRPAS.js";import"./chunk-GBUDZCXK.js";import"./chunk-S3MYFAWN.js";import"./chunk-SPNVH2ST.js";import"./chunk-BXA5YUTN.js";import{b as ee}from"./chunk-47Z3CNAW.js";import"./chunk-7KKV4BRH.js";import"./chunk-5FO4RY4B.js";import"./chunk-4JTBEEYK.js";import"./chunk-QXRG5XYP.js";import"./chunk-P5OAPFNC.js";import"./chunk-7R55YTL6.js";import"./chunk-NNVT5X6O.js";import{c as Q,h as X,m as Y,o as Z,z as $}from"./chunk-BUBQQEYA.js";import"./chunk-BMVBJQDF.js";import"./chunk-34FX4M3J.js";import"./chunk-45DFJJAO.js";import"./chunk-OF426VSL.js";import"./chunk-K5XOH3VV.js";import{B as J,D as K,z as G}from"./chunk-4NAKX6WQ.js";import"./chunk-ASFPLYOZ.js";import{$c as H,Eb as W,Ga as O,Nc as k,Oc as l,Pc as v,Qc as w,Sc as h,Tc as g,Uc as f,Vc as z,Wc as A,Xc as R,ad as j,bc as y,bd as U,dc as b,ec as D,gc as I,hc as B,ic as u,jc as t,kb as F,kc as i,kd as x,lc as c,ld as V,mb as o,md as q,na as N,sc as E,ua as d,va as m,xc as M,zc as _}from"./chunk-ZPV56E2J.js";import"./chunk-WFMAM73Y.js";import{a as P,b as L}from"./chunk-66YHNWRR.js";var se=()=>[],ce=r=>({"td-cell-hover":r});function ue(r,S){if(r&1&&c(0,"variants-dropdown",31),r&2){let e=_().$implicit;u("variants",e==null?null:e.Variants)}}function _e(r,S){if(r&1&&c(0,"variant-with-image",32),r&2){let e=_().$implicit;u("variant",e==null?null:e.Variants[0])}}function he(r,S){if(r&1&&(t(0,"span"),l(1),i()),r&2){let e=_().$implicit;o(),w("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function ge(r,S){if(r&1&&(t(0,"tr")(1,"td")(2,"div",24),c(3,"img",25),x(4,"channelImage"),t(5,"div",26)(6,"div"),l(7),i(),t(8,"small",27)(9,"span"),l(10),i()()()()(),t(11,"td")(12,"div",28)(13,"div"),c(14,"order-link",29),i(),t(15,"small"),l(16),x(17,"date"),i(),c(18,"br"),t(19,"small"),c(20,"i",30),l(21),i()()(),t(22,"td"),y(23,ue,1,1,"variants-dropdown",31)(24,_e,1,1,"variant-with-image",32),i(),t(25,"td",33),l(26),x(27,"number"),i(),t(28,"td")(29,"div",28)(30,"div",34)(31,"span"),l(32),i(),y(33,he,2,1,"span"),i(),t(34,"small"),l(35),i()()()()),r&2){let e=S.$implicit;o(3),u("src",V(4,14,e==null?null:e.MarketType),F)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),o(4),v(e.Outlet),o(3),v(e.ChannelName),o(4),u("order",e),o(2),w(" ",q(17,16,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),o(5),w(" ",e.Customer," "),o(),k(U(21,ce,(e.Variants==null?null:e.Variants.length)>1)),o(),b((e.Variants==null?null:e.Variants.length)>1?23:24),o(3),v(V(27,19,e.Amount)),o(6),v(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),o(),b(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?33:-1),o(2),w(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," ")}}function fe(r,S){if(r&1){let e=E();t(0,"div",15)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),l(5,"Outlet"),i(),t(6,"th",20),l(7,"Number"),i(),t(8,"th"),l(9,"Items"),i(),t(10,"th",21),l(11,"Amount"),i(),t(12,"th",22),l(13,"Shipping"),i()()(),t(14,"tbody"),I(15,ge,36,23,"tr",null,D),i()(),t(17,"app-custom-paginator",23),M("next",function(){d(e);let n=_();return m(n.initShippedOrders())})("previous",function(){d(e);let n=_();return m(n.initShippedOrders())}),i()()}if(r&2){let e=_(),p=R(0);o(15),B(p),o(2),u("filter",e.filter())("totaldata",p==null?null:p.length)}}function Se(r,S){r&1&&(t(0,"div",16),c(1,"app-empty-state"),i())}var ke=(()=>{class r{constructor(){this.orderService=N(T),this.filter=O({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:e=>{this.initFromDate(e)},error:e=>{console.error("Error fetching default date:",e),this.initFromDate(null)}})}initFromDate(e){this.filter.update(p=>L(P({},p),{From:e})),this.initShippedOrders()}initShippedOrders(){this.shippedOrders$=this.orderService.getShippedOrders(this.filter())}static{this.\u0275fac=function(p){return new(p||r)}}static{this.\u0275cmp=W({type:r,selectors:[["app-shipped"]],features:[H([T])],decls:34,vars:12,consts:[["headerTitle","Shipped","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-regular","fa-tv","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[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","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","200px"],[1,"text-end",2,"width","100px"],[2,"width","80px"],["rowCountApi","/api/orders/shippedcount",3,"next","previous","filter","totaldata"],[1,"d-flex","align-items-center","gap-3"],[2,"width","20px","height","20px",3,"src","alt"],[1,"lh-base"],[1,"d-flex","align-items-center","gap-2"],[1,"lh-sm"],[2,"font-size","14px",3,"order"],[1,"fa-solid","fa-user"],[3,"variants"],[3,"variant"],[1,"text-end"],[1,"d-flex","align-items-end","gap-2"]],template:function(p,n){if(p&1){let s=E();z(0),x(1,"async"),t(2,"mainpanel",0),M("onSubmit",function(){return d(s),m(n.initShippedOrders())}),f("textChange",function(a){return d(s),g(n.filter().Number,a)||(n.filter().Number=a),m(a)}),t(3,"actions")(4,"a",1),c(5,"i",2),t(6,"span"),l(7,"Order Fulfillment Display"),i()()(),t(8,"filters")(9,"div")(10,"label",3),l(11,"Channel"),i(),t(12,"app-channel-options-v2",4),f("ngModelChange",function(a){return d(s),g(n.filter().ListChannelID,a)||(n.filter().ListChannelID=a),m(a)}),i()(),t(13,"div",5)(14,"label",3),l(15,"From/To"),i(),t(16,"div",6)(17,"datepicker",7),f("dateChange",function(a){return d(s),g(n.filter().From,a)||(n.filter().From=a),m(a)}),i()(),t(18,"div")(19,"datepicker",8),f("dateChange",function(a){return d(s),g(n.filter().To,a)||(n.filter().To=a),m(a)}),i()()(),t(20,"div",5)(21,"label",9),l(22,"Page Number"),i(),t(23,"input",10),f("ngModelChange",function(a){return d(s),g(n.filter().PageNumber,a)||(n.filter().PageNumber=a),m(a)}),i()(),t(24,"div",5)(25,"label",9),l(26,"Page Size"),i(),t(27,"input",11),f("ngModelChange",function(a){return d(s),g(n.filter().PageSize,a)||(n.filter().PageSize=a),m(a)}),i()()(),t(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),y(32,fe,18,2,"div",15)(33,Se,2,0,"div",16),i()()()()()}if(p&2){let s=A(V(1,8,n.shippedOrders$)||j(11,se));o(2),h("text",n.filter().Number),o(10),u("multiple",!0),h("ngModel",n.filter().ListChannelID),o(5),h("date",n.filter().From),o(2),h("date",n.filter().To),o(4),h("ngModel",n.filter().PageNumber),o(4),h("ngModel",n.filter().PageSize),o(5),b(s.length>0?32:33)}},dependencies:[ie,ne,re,$,Q,Z,X,Y,le,pe,de,te,ee,me,ae,oe,G,J,K],encapsulation:2})}}return r})();export{ke as ShippedComponent};
|