marketplacepos 5.50.3 → 5.51.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/Marketplace/{chunk-ZM7ND6FE.js → chunk-26E54WQH.js} +1 -1
  2. package/Marketplace/{chunk-DIDUSCV7.js → chunk-3KECTTUV.js} +1 -1
  3. package/Marketplace/chunk-4XA7JWTB.js +1 -0
  4. package/Marketplace/{chunk-7VJ22OLT.js → chunk-575TS45M.js} +1 -1
  5. package/Marketplace/{chunk-EV6TBBSW.js → chunk-75RVMUFO.js} +1 -1
  6. package/Marketplace/{chunk-7E4ZSLPD.js → chunk-AMQMYSQR.js} +1 -1
  7. package/Marketplace/{chunk-NGQFZI6A.js → chunk-APQWBZOM.js} +1 -1
  8. package/Marketplace/{chunk-KKQ32Z72.js → chunk-AVSAALDJ.js} +1 -1
  9. package/Marketplace/{chunk-HAZ7U3MT.js → chunk-AVTQG66S.js} +1 -1
  10. package/Marketplace/{chunk-PFP5WMC3.js → chunk-BKVIOCLH.js} +1 -1
  11. package/Marketplace/{chunk-XYZI7ZXN.js → chunk-BZ7QY7N3.js} +1 -1
  12. package/Marketplace/{chunk-KDJVMFOK.js → chunk-CHCAQ4NV.js} +1 -1
  13. package/Marketplace/{chunk-UWKDFRVX.js → chunk-DCMOITWM.js} +1 -1
  14. package/Marketplace/{chunk-FBXKHJ2G.js → chunk-DOQD3RMB.js} +1 -1
  15. package/Marketplace/{chunk-RRRPWDKB.js → chunk-DV3BDHBL.js} +1 -1
  16. package/Marketplace/{chunk-QWEMPIP7.js → chunk-DVJ7VXWL.js} +1 -1
  17. package/Marketplace/{chunk-YQPAS2RI.js → chunk-DW7R34MP.js} +1 -1
  18. package/Marketplace/chunk-EXKAFEQL.js +1 -0
  19. package/Marketplace/{chunk-ZLJBRQ5V.js → chunk-FQM4RKLX.js} +1 -1
  20. package/Marketplace/{chunk-53ZGHR7J.js → chunk-GYQHWDWX.js} +1 -1
  21. package/Marketplace/{chunk-XCGXT3P7.js → chunk-HO6XCGRR.js} +1 -1
  22. package/Marketplace/{chunk-KNE2UYQ2.js → chunk-HPQDUJXF.js} +1 -1
  23. package/Marketplace/{chunk-HHDJUCIT.js → chunk-ICY32GYN.js} +1 -1
  24. package/Marketplace/{chunk-PHVEBMTE.js → chunk-ILFG3IYB.js} +1 -1
  25. package/Marketplace/{chunk-YDNXBOLU.js → chunk-IUJ6UX3L.js} +1 -1
  26. package/Marketplace/{chunk-2OKZEOBU.js → chunk-J4552BMI.js} +1 -1
  27. package/Marketplace/{chunk-YEU5TPRD.js → chunk-JUN3HVEV.js} +1 -1
  28. package/Marketplace/{chunk-JLDXWNDU.js → chunk-KHGTW7IV.js} +1 -1
  29. package/Marketplace/{chunk-CGDIULPW.js → chunk-KVLHLMO4.js} +1 -1
  30. package/Marketplace/{chunk-3YUIOGNI.js → chunk-LB276KSA.js} +1 -1
  31. package/Marketplace/{chunk-JEJHGIUU.js → chunk-MG7B4OWR.js} +1 -1
  32. package/Marketplace/chunk-MRWGPCR7.js +1 -0
  33. package/Marketplace/{chunk-MZWP4SZF.js → chunk-N6VPSXF7.js} +2 -2
  34. package/Marketplace/{chunk-TOPYLZOF.js → chunk-NEB6AMMM.js} +1 -1
  35. package/Marketplace/{chunk-HMDHDMIC.js → chunk-NKN7T3C3.js} +1 -1
  36. package/Marketplace/{chunk-VA7NXG7X.js → chunk-NMOQXVWS.js} +1 -1
  37. package/Marketplace/{chunk-6MUVEZMQ.js → chunk-NUF326RW.js} +1 -1
  38. package/Marketplace/{chunk-X2WAAZ7G.js → chunk-NX3QFU4A.js} +1 -1
  39. package/Marketplace/{chunk-QJH7APJQ.js → chunk-OEUA6IL2.js} +1 -1
  40. package/Marketplace/{chunk-FDVRSAF3.js → chunk-PGQYHHH3.js} +1 -1
  41. package/Marketplace/{chunk-QZMWXAUJ.js → chunk-Q3Z7EEVP.js} +1 -1
  42. package/Marketplace/{chunk-XMU7MXAM.js → chunk-QJ7SMXW4.js} +1 -1
  43. package/Marketplace/{chunk-JG7M73IA.js → chunk-QLFVXMNJ.js} +1 -1
  44. package/Marketplace/{chunk-FO75JP2L.js → chunk-QPELTSKE.js} +1 -1
  45. package/Marketplace/{chunk-3PUUKJCQ.js → chunk-QUIZLT5F.js} +1 -1
  46. package/Marketplace/{chunk-FPJTI4LM.js → chunk-REDQ2L7Y.js} +1 -1
  47. package/Marketplace/{chunk-CQBHWYUO.js → chunk-SLCKHYT3.js} +1 -1
  48. package/Marketplace/{chunk-2FB6QJKT.js → chunk-U4ARIHUF.js} +1 -1
  49. package/Marketplace/{chunk-XYRET5HT.js → chunk-UHWLUO2C.js} +1 -1
  50. package/Marketplace/{chunk-CBULW22C.js → chunk-UJAA73LE.js} +1 -1
  51. package/Marketplace/{chunk-N4MYHIMN.js → chunk-UOFJCKS5.js} +1 -1
  52. package/Marketplace/{chunk-YCKLOFMA.js → chunk-VRD2D2BP.js} +1 -1
  53. package/Marketplace/{chunk-MYJZFEAZ.js → chunk-WZQRKTBN.js} +1 -1
  54. package/Marketplace/{chunk-QJU2YGUH.js → chunk-YFR3EI3B.js} +1 -1
  55. package/Marketplace/{chunk-UMJVPGHV.js → chunk-YMOSVDG5.js} +1 -1
  56. package/Marketplace/{chunk-FS3VTRY2.js → chunk-YSYA7XCF.js} +1 -1
  57. package/Marketplace/index.html +2 -2
  58. package/Marketplace/{main-7TBLEURN.js → main-I5THR2C3.js} +1 -1
  59. package/package.json +1 -1
  60. package/Marketplace/chunk-CFJAZJYY.js +0 -1
  61. package/Marketplace/chunk-KMNWLBEP.js +0 -1
  62. package/Marketplace/chunk-S2ZFBPPJ.js +0 -1
@@ -1 +1 @@
1
- import{a as Ne,b as Fe}from"./chunk-RIIIECQH.js";import{a as Pe}from"./chunk-JWDQVXQP.js";import{a as Ee,b as Ve}from"./chunk-K5WSFDNA.js";import{a as De}from"./chunk-FBXKHJ2G.js";import{a as j}from"./chunk-L6CRWJ2O.js";import{a as Ae}from"./chunk-PV4OJSZI.js";import"./chunk-FSOZOROI.js";import"./chunk-VYI7JYH5.js";import"./chunk-BZWZ64N5.js";import{a as Me}from"./chunk-3PUUKJCQ.js";import"./chunk-VVNLTDLG.js";import"./chunk-OHAT7WXU.js";import"./chunk-L4EPB2CQ.js";import"./chunk-GNXSEYJF.js";import{a as Le}from"./chunk-ZZYFVEJO.js";import"./chunk-DLHIDOS3.js";import{a as Te}from"./chunk-27DIE2YS.js";import"./chunk-JU4ZP3HI.js";import"./chunk-3T5VLB63.js";import"./chunk-STOW2RQN.js";import"./chunk-GLBJ4Y4T.js";import"./chunk-XTNXL2IY.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import"./chunk-A6QXXKPR.js";import"./chunk-6Q4BDCI5.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{b as ke}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import{a as Se,c as we,e as ve,f as ye,g as xe}from"./chunk-IA7NJXJD.js";import{a as be}from"./chunk-UEXWQT5J.js";import"./chunk-3SCX7IMW.js";import"./chunk-K4Q33QIR.js";import"./chunk-JRCXHF2X.js";import"./chunk-M27MYADT.js";import"./chunk-TBVMCNS2.js";import"./chunk-RM6ZXD3O.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-3RK6DDJD.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-NJNRUDU6.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import"./chunk-JTKEMQZT.js";import{c as _e}from"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import"./chunk-2OKZEOBU.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import{a as x}from"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import{b as d,c as A}from"./chunk-UPRDDI4K.js";import{A as z,b as ge,c as fe,h as W,m as R,o as Ce}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{b as M,e as O}from"./chunk-D6JH2KV4.js";import"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{A as ue,B as he,w as me,y as de}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{Cc as te,Dc as ie,Ec as ne,G,Hb as N,Ia as B,Mc as oe,Nc as m,Oc as P,Pc as E,Rc as S,Sc as w,Tc as v,Uc as re,Vc as ae,Wc as F,Z as J,_c as le,aa as X,ac as k,ad as pe,cc as T,dc as Z,fc as $,gc as ee,hc as y,ic as o,id as V,jc as r,jd as I,kc as _,kd as se,ma as D,mb as Y,ob as c,pd as ce,ra as C,rc as L,v as K,wc as b,ya as h,yc as f,za as g}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import{a as Q,b as q}from"./chunk-66YHNWRR.js";var Ie=(()=>{let l=class l{constructor(){this.http=C(O),this.toastr=C(M)}printTokopediaShippingLabel(e,t=!1){let i={OrderNumber:e,Printed:t};return this.http.post(x.TokopediaPrintShippingLabel,i)}printTiktokShippingLabel(e,t){let i={ShopID:t,OrderNumber:e};return this.http.post(x.TiktokPrintShippingLabel,i)}printShopeeShippingLabel(e,t){let i={ShopID:t,OrderNumber:e};return this.http.post(x.ShopeePrintShippingLabel,i).pipe(K(p=>(p&&(p.Number=e),p)))}printLazadaShippingLabel(e,t){let i={ShopID:t,OrderNumber:e};return this.http.post(x.LazadaPrintShippingLabel,i)}handleShippingLabelResponse(e,t){switch(t){case d.Tokopedia:let u=window.open("about:blank","_blank");u.document.write(e.File),u.document.close();break;case d.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 d.Shopee:var i=Uint8Array.from(atob(e.File),s=>s.charCodeAt(0)),p=new Blob([i],{type:"octet/stream"});A.openDownloadFile(p,`${e?.Number}.pdf`);break;case d.Lazada:e?.result?.data!=null?window.open(e?.result?.data?.pdf_url,"_blank"):this.toastr.error(e.message,"Cannot Print");break}}};l.\u0275fac=function(t){return new(t||l)},l.\u0275prov=D({token:l,factory:l.\u0275fac,providedIn:"root"});let a=l;return a})();var Oe=(()=>{let l=class l{constructor(){this.dialogRef=C(Se),this.tandaiSudahDicetak=!1}onCancel(){this.dialogRef.close()}onPrint(){this.dialogRef.close(this.tandaiSudahDicetak?1:0)}};l.\u0275fac=function(t){return new(t||l)},l.\u0275cmp=N({type:l,selectors:[["app-print-tokopedia"]],decls:17,vars:1,consts:[[1,"container-fluid"],[1,"text-center","mb-4","fw-bold","mt-6"],[1,"row"],[1,"col-12"],[1,"fs-5"],[1,"d-flex","align-items-center","text-center","justify-content-center","mb-8"],[1,"me-2",3,"ngModelChange","ngModel"],[1,"fs-5","pt-1"],[1,"d-flex","align-items-center","justify-content-center"],[1,"btn","btn-light-blue","text-primary","btn-lg","fw-bold","mx-3",3,"click"],[1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3",3,"click"]],template:function(t,i){t&1&&(o(0,"div",0)(1,"h2",1),m(2,"Cetak label pesanan"),r(),o(3,"mat-dialog-content")(4,"div",2)(5,"div",3)(6,"p",4),m(7,"Kamu akan mencetak label yang berisi detail pesanan"),r(),o(8,"div",5)(9,"mat-checkbox",6),v("ngModelChange",function(u){return w(i.tandaiSudahDicetak,u)||(i.tandaiSudahDicetak=u),u}),r(),o(10,"span",7),m(11,'Pesanan telah ditandai sebagai "Sudah Dicetak"'),r()()()()(),o(12,"mat-dialog-actions",8)(13,"button",9),b("click",function(){return i.onCancel()}),m(14,"Cancel"),r(),o(15,"button",10),b("click",function(){return i.onPrint()}),m(16,"Cetak Pesanan"),r()()()),t&2&&(c(9),S("ngModel",i.tandaiSudahDicetak))},dependencies:[z,W,R,xe,ye,ve],encapsulation:2});let a=l;return a})();var U=(()=>{let l=class l{constructor(){this.httpService=C(O),this.shippingLabelService=C(Ie),this.toastrService=C(M),this.dialog=C(we)}printShippingLabel(e){switch(e?.MarketType){case d.Shopee:this.shippingLabelService.printShopeeShippingLabel(e.Number,e.ShopID).subscribe(t=>this.shippingLabelService.handleShippingLabelResponse(t,d.Shopee));break;case d.Tiktok:this.shippingLabelService.printTiktokShippingLabel(e.Number,e.ShopID).subscribe(t=>this.shippingLabelService.handleShippingLabelResponse(t,d.Tiktok));break;case d.Tokopedia:this.dialog.open(Oe).afterClosed().pipe(G(t=>A.IsNotEmpty(t)),X(t=>this.shippingLabelService.printTokopediaShippingLabel(e.Number,t))).subscribe(t=>this.shippingLabelService.handleShippingLabelResponse(t,d.Tokopedia));break;case d.Lazada:this.shippingLabelService.printLazadaShippingLabel(e.Number,e.ShopID).subscribe(t=>this.shippingLabelService.handleShippingLabelResponse(t,d.Lazada));break;case d.Shopify:this.toastrService.error("Shopify not supported","Error Not supported");break}}printMultipleShippingLabel(e){let t=e.map(p=>({OrderNumber:p.Number,ShopID:p.ShopID})),i="";switch(e[0]?.MarketType){case d.Shopee:i=x.ShopeePrintMultipleShippingLabel;break;case d.Tiktok:i=x.TiktokPrintMultipleShippingLabel;break;case d.Lazada:i=x.LazadaPrintMultipleShippingLabel;break}this.httpService.post(i,t).subscribe(p=>{var u=Uint8Array.from(atob(p.File),We=>We.charCodeAt(0)),s=new Blob([u],{type:"octet/stream"});A.openDownloadFile(s,`${p?.Name}.pdf`)})}};l.\u0275fac=function(t){return new(t||l)},l.\u0275prov=D({token:l,factory:l.\u0275fac});let a=l;return a})();var ze=["contextMenu"],Be=a=>({"td-cell-hover":a});function je(a,l){if(a&1){let n=L();o(0,"button",20),b("click",function(){h(n);let t=f(),i=F(0);return g(t.onDowloadShippingLabel(i))}),_(1,"i",21),o(2,"span"),m(3,"Download Shipping Label"),r()()}}function He(a,l){if(a&1){let n=L();o(0,"input",47),v("ngModelChange",function(t){h(n);let i=f().$implicit;return w(i.selected,t)||(i.selected=t),g(t)}),b("ngModelChange",function(){h(n);let t=f(3),i=F(0);return g(t.onSelectOrders(i))}),r()}if(a&2){let n=f().$implicit,e=f(2);S("ngModel",n.selected),y("disabled",e.selectedChannelType()!=null&&e.selectedChannelType()!=n.MarketType)}}function Ue(a,l){if(a&1&&_(0,"variants-dropdown",39),a&2){let n=f().$implicit;y("variants",n==null?null:n.Variants)}}function Qe(a,l){if(a&1&&_(0,"variant-with-image",40),a&2){let n=f().$implicit;y("variant",n==null?null:n.Variants[0])}}function qe(a,l){if(a&1&&(o(0,"span"),m(1),r()),a&2){let n=f().$implicit;c(),E("(",n.LogisticService==null?null:n.LogisticService.Option,")")}}function Ke(a,l){if(a&1){let n=L();o(0,"button",48),b("click",function(){h(n);let t=f().$implicit,i=f(2);return g(i.onPrintShippingLabel(t))}),_(1,"i",49),r()}}function Ge(a,l){if(a&1){let n=L();o(0,"tr")(1,"td"),k(2,He,1,2,"input",31),r(),o(3,"td")(4,"div",32),_(5,"img",33),V(6,"channelImage"),o(7,"div",34)(8,"div"),m(9),r(),o(10,"small",35)(11,"span"),m(12),r()()()()(),o(13,"td")(14,"div",36)(15,"div"),_(16,"order-link",37),r(),o(17,"small"),m(18),V(19,"date"),r(),_(20,"br"),o(21,"small"),_(22,"i",38),m(23),r()()(),o(24,"td"),k(25,Ue,1,1,"variants-dropdown",39)(26,Qe,1,1,"variant-with-image",40),r(),o(27,"td",41),m(28),V(29,"number"),r(),o(30,"td",42),b("mouseenter",function(t){let i=h(n).$implicit,p=f(2);return g(p.onMouseEnter(t,i))}),o(31,"div",43)(32,"div",36)(33,"div",44)(34,"span"),m(35),r(),k(36,qe,2,1,"span"),r(),o(37,"small"),m(38),r()()()(),o(39,"td",45),k(40,Ke,2,0,"button",46),r()()}if(a&2){let n=l.$implicit,e=f(2);c(2),T((n==null?null:n.MarketType)!=e.channelType.WooCommerce?2:-1),c(3),y("src",I(6,16,n==null?null:n.MarketType),Y)("alt",n==null||n.Variants[0]==null?null:n.Variants[0].Name),c(4),P(n.Outlet),c(3),P(n.ChannelName),c(4),y("order",n),c(2),E(" ",se(19,18,n==null?null:n.Created,"dd/MM/yyyy HH:mm:ss")," "),c(5),E(" ",n.Customer," "),c(),oe(pe(23,Be,(n.Variants==null?null:n.Variants.length)>1)),c(),T((n.Variants==null?null:n.Variants.length)>1?25:26),c(3),P(I(29,21,n.Amount)),c(7),P(n.LogisticService!=null&&n.LogisticService.Name?n.LogisticService==null?null:n.LogisticService.Name:"-"),c(),T(n.LogisticService!=null&&n.LogisticService.Option&&(n.LogisticService==null?null:n.LogisticService.Option)!="Default"?36:-1),c(2),E(" ",n.ReferenceNumber?n.ReferenceNumber:"-"," "),c(2),T((n==null?null:n.MarketType)!=e.channelType.WooCommerce?40:-1)}}function Je(a,l){if(a&1){let n=L();o(0,"div",17)(1,"table",22)(2,"thead",23)(3,"tr",24),_(4,"th",25),o(5,"th",26),m(6,"Outlet"),r(),o(7,"th",26),m(8,"Number"),r(),o(9,"th"),m(10,"Items"),r(),o(11,"th",27),m(12,"Amount"),r(),o(13,"th",28),m(14,"Shipping"),r(),_(15,"th",29),r()(),o(16,"tbody"),$(17,Ge,41,25,"tr",null,Z),r()(),o(19,"app-custom-paginator",30),b("next",function(){h(n);let t=f();return g(t.initAwaitingCollection())})("previous",function(){h(n);let t=f();return g(t.initAwaitingCollection())}),r()()}if(a&2){let n=f(),e=F(0);c(17),ee(e),c(2),y("filter",n.filter())("totaldata",e==null?null:e.length)}}function Xe(a,l){a&1&&(o(0,"div",18),_(1,"app-empty-state"),r())}var Jt=(()=>{let l=class l{constructor(){this.printShippingService=C(U),this.orderService=C(j),this.toastr=C(M),this.fulfillmentService=C(Ne),this.channelType=d,this.selectedOrders=B([]),this.selectedChannelType=ce(()=>{let e=null;return this.selectedOrders().length>0&&(e=this.selectedOrders()[0].MarketType),e}),this.filter=B({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.toastr.success("Fulfillment set successfully","Success"),this.initAwaitingCollection()})}refreshShippingAndRefNumber(e){this.orderService.refreshShippingCourier(e.ShopID,e.Number).subscribe(()=>{this.toastr.success("Shipping courier and reference number refreshed","Success"),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)}};l.\u0275fac=function(t){return new(t||l)},l.\u0275cmp=N({type:l,selectors:[["app-awaiting-collection"]],viewQuery:function(t,i){if(t&1&&te(ze,5),t&2){let p;ie(p=ne())&&(i.contextMenuEl=p.first)}},features:[le([j,U])],decls:37,vars:13,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"],[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,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","5px"],[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 p=L();re(0),V(1,"async"),o(2,"mainpanel",1),b("onSubmit",function(){return h(p),g(i.initAwaitingCollection())}),v("textChange",function(s){return h(p),w(i.filter().Number,s)||(i.filter().Number=s),g(s)}),o(3,"actions"),k(4,je,4,0,"button",2),o(5,"a",3),_(6,"i",4),o(7,"span"),m(8,"Order Fulfillment Display"),r()()(),o(9,"filters")(10,"div")(11,"label",5),m(12,"Channel"),r(),o(13,"app-channel-options-v2",6),v("ngModelChange",function(s){return h(p),w(i.filter().ListChannelID,s)||(i.filter().ListChannelID=s),g(s)}),r()(),o(14,"div",7)(15,"label",5),m(16,"From/To"),r(),o(17,"div",8)(18,"datepicker",9),v("dateChange",function(s){return h(p),w(i.filter().From,s)||(i.filter().From=s),g(s)}),r()(),o(19,"div")(20,"datepicker",10),v("dateChange",function(s){return h(p),w(i.filter().To,s)||(i.filter().To=s),g(s)}),r()()(),o(21,"div",7)(22,"label",11),m(23,"Page Number"),r(),o(24,"input",12),v("ngModelChange",function(s){return h(p),w(i.filter().PageNumber,s)||(i.filter().PageNumber=s),g(s)}),r()(),o(25,"div",7)(26,"label",11),m(27,"Page Size"),r(),o(28,"input",13),v("ngModelChange",function(s){return h(p),w(i.filter().PageSize,s)||(i.filter().PageSize=s),g(s)}),r()()(),o(29,"content")(30,"div",14)(31,"div",15)(32,"div",16),k(33,Je,20,2,"div",17)(34,Xe,2,0,"div",18),r()()()()(),o(35,"app-context-menu",19,0),b("onSelectItem",function(s){return h(p),g(i.onSelectContextItem(s))}),r()}if(t&2){let p=ae(I(1,10,i.awaitingCollections$));c(2),S("text",i.filter().Number),c(2),T(i.selectedOrders().length>0?4:-1),c(9),y("multiple",!0),S("ngModel",i.filter().ListChannelID),c(5),S("date",i.filter().From),c(2),S("date",i.filter().To),c(4),S("ngModel",i.filter().PageNumber),c(4),S("ngModel",i.filter().PageSize),c(5),T((p==null?null:p.length)>0?33:34),c(2),y("items",i.contextMenuItems)}},dependencies:[he,ke,Te,Le,z,fe,Ce,ge,W,R,Ee,Ve,Ae,be,_e,De,Fe,Me,me,ue,de,Pe],encapsulation:2});let a=l;return a})();export{Jt as AwaitingCollectionComponent};
1
+ import{a as Ne,b as Fe}from"./chunk-RIIIECQH.js";import{a as Pe}from"./chunk-JWDQVXQP.js";import{a as Ee,b as Ve}from"./chunk-K5WSFDNA.js";import{a as De}from"./chunk-DOQD3RMB.js";import{a as j}from"./chunk-L6CRWJ2O.js";import{a as Ae}from"./chunk-PV4OJSZI.js";import"./chunk-FSOZOROI.js";import"./chunk-VYI7JYH5.js";import"./chunk-BZWZ64N5.js";import{a as Me}from"./chunk-QUIZLT5F.js";import"./chunk-VVNLTDLG.js";import"./chunk-OHAT7WXU.js";import"./chunk-L4EPB2CQ.js";import"./chunk-GNXSEYJF.js";import{a as Le}from"./chunk-ZZYFVEJO.js";import"./chunk-DLHIDOS3.js";import{a as Te}from"./chunk-27DIE2YS.js";import"./chunk-JU4ZP3HI.js";import"./chunk-3T5VLB63.js";import"./chunk-STOW2RQN.js";import"./chunk-GLBJ4Y4T.js";import"./chunk-XTNXL2IY.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import"./chunk-A6QXXKPR.js";import"./chunk-6Q4BDCI5.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{b as ke}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import{a as Se,c as we,e as ve,f as ye,g as xe}from"./chunk-IA7NJXJD.js";import{a as be}from"./chunk-UEXWQT5J.js";import"./chunk-3SCX7IMW.js";import"./chunk-K4Q33QIR.js";import"./chunk-JRCXHF2X.js";import"./chunk-M27MYADT.js";import"./chunk-TBVMCNS2.js";import"./chunk-RM6ZXD3O.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-3RK6DDJD.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-NJNRUDU6.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import"./chunk-JTKEMQZT.js";import{c as _e}from"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import"./chunk-J4552BMI.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import{a as x}from"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import{b as d,c as A}from"./chunk-UPRDDI4K.js";import{A as z,b as ge,c as fe,h as W,m as R,o as Ce}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{b as M,e as O}from"./chunk-D6JH2KV4.js";import"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{A as ue,B as he,w as me,y as de}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{Cc as te,Dc as ie,Ec as ne,G,Hb as N,Ia as B,Mc as oe,Nc as m,Oc as P,Pc as E,Rc as S,Sc as w,Tc as v,Uc as re,Vc as ae,Wc as F,Z as J,_c as le,aa as X,ac as k,ad as pe,cc as T,dc as Z,fc as $,gc as ee,hc as y,ic as o,id as V,jc as r,jd as I,kc as _,kd as se,ma as D,mb as Y,ob as c,pd as ce,ra as C,rc as L,v as K,wc as b,ya as h,yc as f,za as g}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import{a as Q,b as q}from"./chunk-66YHNWRR.js";var Ie=(()=>{let l=class l{constructor(){this.http=C(O),this.toastr=C(M)}printTokopediaShippingLabel(e,t=!1){let i={OrderNumber:e,Printed:t};return this.http.post(x.TokopediaPrintShippingLabel,i)}printTiktokShippingLabel(e,t){let i={ShopID:t,OrderNumber:e};return this.http.post(x.TiktokPrintShippingLabel,i)}printShopeeShippingLabel(e,t){let i={ShopID:t,OrderNumber:e};return this.http.post(x.ShopeePrintShippingLabel,i).pipe(K(p=>(p&&(p.Number=e),p)))}printLazadaShippingLabel(e,t){let i={ShopID:t,OrderNumber:e};return this.http.post(x.LazadaPrintShippingLabel,i)}handleShippingLabelResponse(e,t){switch(t){case d.Tokopedia:let u=window.open("about:blank","_blank");u.document.write(e.File),u.document.close();break;case d.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 d.Shopee:var i=Uint8Array.from(atob(e.File),s=>s.charCodeAt(0)),p=new Blob([i],{type:"octet/stream"});A.openDownloadFile(p,`${e?.Number}.pdf`);break;case d.Lazada:e?.result?.data!=null?window.open(e?.result?.data?.pdf_url,"_blank"):this.toastr.error(e.message,"Cannot Print");break}}};l.\u0275fac=function(t){return new(t||l)},l.\u0275prov=D({token:l,factory:l.\u0275fac,providedIn:"root"});let a=l;return a})();var Oe=(()=>{let l=class l{constructor(){this.dialogRef=C(Se),this.tandaiSudahDicetak=!1}onCancel(){this.dialogRef.close()}onPrint(){this.dialogRef.close(this.tandaiSudahDicetak?1:0)}};l.\u0275fac=function(t){return new(t||l)},l.\u0275cmp=N({type:l,selectors:[["app-print-tokopedia"]],decls:17,vars:1,consts:[[1,"container-fluid"],[1,"text-center","mb-4","fw-bold","mt-6"],[1,"row"],[1,"col-12"],[1,"fs-5"],[1,"d-flex","align-items-center","text-center","justify-content-center","mb-8"],[1,"me-2",3,"ngModelChange","ngModel"],[1,"fs-5","pt-1"],[1,"d-flex","align-items-center","justify-content-center"],[1,"btn","btn-light-blue","text-primary","btn-lg","fw-bold","mx-3",3,"click"],[1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3",3,"click"]],template:function(t,i){t&1&&(o(0,"div",0)(1,"h2",1),m(2,"Cetak label pesanan"),r(),o(3,"mat-dialog-content")(4,"div",2)(5,"div",3)(6,"p",4),m(7,"Kamu akan mencetak label yang berisi detail pesanan"),r(),o(8,"div",5)(9,"mat-checkbox",6),v("ngModelChange",function(u){return w(i.tandaiSudahDicetak,u)||(i.tandaiSudahDicetak=u),u}),r(),o(10,"span",7),m(11,'Pesanan telah ditandai sebagai "Sudah Dicetak"'),r()()()()(),o(12,"mat-dialog-actions",8)(13,"button",9),b("click",function(){return i.onCancel()}),m(14,"Cancel"),r(),o(15,"button",10),b("click",function(){return i.onPrint()}),m(16,"Cetak Pesanan"),r()()()),t&2&&(c(9),S("ngModel",i.tandaiSudahDicetak))},dependencies:[z,W,R,xe,ye,ve],encapsulation:2});let a=l;return a})();var U=(()=>{let l=class l{constructor(){this.httpService=C(O),this.shippingLabelService=C(Ie),this.toastrService=C(M),this.dialog=C(we)}printShippingLabel(e){switch(e?.MarketType){case d.Shopee:this.shippingLabelService.printShopeeShippingLabel(e.Number,e.ShopID).subscribe(t=>this.shippingLabelService.handleShippingLabelResponse(t,d.Shopee));break;case d.Tiktok:this.shippingLabelService.printTiktokShippingLabel(e.Number,e.ShopID).subscribe(t=>this.shippingLabelService.handleShippingLabelResponse(t,d.Tiktok));break;case d.Tokopedia:this.dialog.open(Oe).afterClosed().pipe(G(t=>A.IsNotEmpty(t)),X(t=>this.shippingLabelService.printTokopediaShippingLabel(e.Number,t))).subscribe(t=>this.shippingLabelService.handleShippingLabelResponse(t,d.Tokopedia));break;case d.Lazada:this.shippingLabelService.printLazadaShippingLabel(e.Number,e.ShopID).subscribe(t=>this.shippingLabelService.handleShippingLabelResponse(t,d.Lazada));break;case d.Shopify:this.toastrService.error("Shopify not supported","Error Not supported");break}}printMultipleShippingLabel(e){let t=e.map(p=>({OrderNumber:p.Number,ShopID:p.ShopID})),i="";switch(e[0]?.MarketType){case d.Shopee:i=x.ShopeePrintMultipleShippingLabel;break;case d.Tiktok:i=x.TiktokPrintMultipleShippingLabel;break;case d.Lazada:i=x.LazadaPrintMultipleShippingLabel;break}this.httpService.post(i,t).subscribe(p=>{var u=Uint8Array.from(atob(p.File),We=>We.charCodeAt(0)),s=new Blob([u],{type:"octet/stream"});A.openDownloadFile(s,`${p?.Name}.pdf`)})}};l.\u0275fac=function(t){return new(t||l)},l.\u0275prov=D({token:l,factory:l.\u0275fac});let a=l;return a})();var ze=["contextMenu"],Be=a=>({"td-cell-hover":a});function je(a,l){if(a&1){let n=L();o(0,"button",20),b("click",function(){h(n);let t=f(),i=F(0);return g(t.onDowloadShippingLabel(i))}),_(1,"i",21),o(2,"span"),m(3,"Download Shipping Label"),r()()}}function He(a,l){if(a&1){let n=L();o(0,"input",47),v("ngModelChange",function(t){h(n);let i=f().$implicit;return w(i.selected,t)||(i.selected=t),g(t)}),b("ngModelChange",function(){h(n);let t=f(3),i=F(0);return g(t.onSelectOrders(i))}),r()}if(a&2){let n=f().$implicit,e=f(2);S("ngModel",n.selected),y("disabled",e.selectedChannelType()!=null&&e.selectedChannelType()!=n.MarketType)}}function Ue(a,l){if(a&1&&_(0,"variants-dropdown",39),a&2){let n=f().$implicit;y("variants",n==null?null:n.Variants)}}function Qe(a,l){if(a&1&&_(0,"variant-with-image",40),a&2){let n=f().$implicit;y("variant",n==null?null:n.Variants[0])}}function qe(a,l){if(a&1&&(o(0,"span"),m(1),r()),a&2){let n=f().$implicit;c(),E("(",n.LogisticService==null?null:n.LogisticService.Option,")")}}function Ke(a,l){if(a&1){let n=L();o(0,"button",48),b("click",function(){h(n);let t=f().$implicit,i=f(2);return g(i.onPrintShippingLabel(t))}),_(1,"i",49),r()}}function Ge(a,l){if(a&1){let n=L();o(0,"tr")(1,"td"),k(2,He,1,2,"input",31),r(),o(3,"td")(4,"div",32),_(5,"img",33),V(6,"channelImage"),o(7,"div",34)(8,"div"),m(9),r(),o(10,"small",35)(11,"span"),m(12),r()()()()(),o(13,"td")(14,"div",36)(15,"div"),_(16,"order-link",37),r(),o(17,"small"),m(18),V(19,"date"),r(),_(20,"br"),o(21,"small"),_(22,"i",38),m(23),r()()(),o(24,"td"),k(25,Ue,1,1,"variants-dropdown",39)(26,Qe,1,1,"variant-with-image",40),r(),o(27,"td",41),m(28),V(29,"number"),r(),o(30,"td",42),b("mouseenter",function(t){let i=h(n).$implicit,p=f(2);return g(p.onMouseEnter(t,i))}),o(31,"div",43)(32,"div",36)(33,"div",44)(34,"span"),m(35),r(),k(36,qe,2,1,"span"),r(),o(37,"small"),m(38),r()()()(),o(39,"td",45),k(40,Ke,2,0,"button",46),r()()}if(a&2){let n=l.$implicit,e=f(2);c(2),T((n==null?null:n.MarketType)!=e.channelType.WooCommerce?2:-1),c(3),y("src",I(6,16,n==null?null:n.MarketType),Y)("alt",n==null||n.Variants[0]==null?null:n.Variants[0].Name),c(4),P(n.Outlet),c(3),P(n.ChannelName),c(4),y("order",n),c(2),E(" ",se(19,18,n==null?null:n.Created,"dd/MM/yyyy HH:mm:ss")," "),c(5),E(" ",n.Customer," "),c(),oe(pe(23,Be,(n.Variants==null?null:n.Variants.length)>1)),c(),T((n.Variants==null?null:n.Variants.length)>1?25:26),c(3),P(I(29,21,n.Amount)),c(7),P(n.LogisticService!=null&&n.LogisticService.Name?n.LogisticService==null?null:n.LogisticService.Name:"-"),c(),T(n.LogisticService!=null&&n.LogisticService.Option&&(n.LogisticService==null?null:n.LogisticService.Option)!="Default"?36:-1),c(2),E(" ",n.ReferenceNumber?n.ReferenceNumber:"-"," "),c(2),T((n==null?null:n.MarketType)!=e.channelType.WooCommerce?40:-1)}}function Je(a,l){if(a&1){let n=L();o(0,"div",17)(1,"table",22)(2,"thead",23)(3,"tr",24),_(4,"th",25),o(5,"th",26),m(6,"Outlet"),r(),o(7,"th",26),m(8,"Number"),r(),o(9,"th"),m(10,"Items"),r(),o(11,"th",27),m(12,"Amount"),r(),o(13,"th",28),m(14,"Shipping"),r(),_(15,"th",29),r()(),o(16,"tbody"),$(17,Ge,41,25,"tr",null,Z),r()(),o(19,"app-custom-paginator",30),b("next",function(){h(n);let t=f();return g(t.initAwaitingCollection())})("previous",function(){h(n);let t=f();return g(t.initAwaitingCollection())}),r()()}if(a&2){let n=f(),e=F(0);c(17),ee(e),c(2),y("filter",n.filter())("totaldata",e==null?null:e.length)}}function Xe(a,l){a&1&&(o(0,"div",18),_(1,"app-empty-state"),r())}var Jt=(()=>{let l=class l{constructor(){this.printShippingService=C(U),this.orderService=C(j),this.toastr=C(M),this.fulfillmentService=C(Ne),this.channelType=d,this.selectedOrders=B([]),this.selectedChannelType=ce(()=>{let e=null;return this.selectedOrders().length>0&&(e=this.selectedOrders()[0].MarketType),e}),this.filter=B({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.toastr.success("Fulfillment set successfully","Success"),this.initAwaitingCollection()})}refreshShippingAndRefNumber(e){this.orderService.refreshShippingCourier(e.ShopID,e.Number).subscribe(()=>{this.toastr.success("Shipping courier and reference number refreshed","Success"),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)}};l.\u0275fac=function(t){return new(t||l)},l.\u0275cmp=N({type:l,selectors:[["app-awaiting-collection"]],viewQuery:function(t,i){if(t&1&&te(ze,5),t&2){let p;ie(p=ne())&&(i.contextMenuEl=p.first)}},features:[le([j,U])],decls:37,vars:13,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"],[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,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","5px"],[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 p=L();re(0),V(1,"async"),o(2,"mainpanel",1),b("onSubmit",function(){return h(p),g(i.initAwaitingCollection())}),v("textChange",function(s){return h(p),w(i.filter().Number,s)||(i.filter().Number=s),g(s)}),o(3,"actions"),k(4,je,4,0,"button",2),o(5,"a",3),_(6,"i",4),o(7,"span"),m(8,"Order Fulfillment Display"),r()()(),o(9,"filters")(10,"div")(11,"label",5),m(12,"Channel"),r(),o(13,"app-channel-options-v2",6),v("ngModelChange",function(s){return h(p),w(i.filter().ListChannelID,s)||(i.filter().ListChannelID=s),g(s)}),r()(),o(14,"div",7)(15,"label",5),m(16,"From/To"),r(),o(17,"div",8)(18,"datepicker",9),v("dateChange",function(s){return h(p),w(i.filter().From,s)||(i.filter().From=s),g(s)}),r()(),o(19,"div")(20,"datepicker",10),v("dateChange",function(s){return h(p),w(i.filter().To,s)||(i.filter().To=s),g(s)}),r()()(),o(21,"div",7)(22,"label",11),m(23,"Page Number"),r(),o(24,"input",12),v("ngModelChange",function(s){return h(p),w(i.filter().PageNumber,s)||(i.filter().PageNumber=s),g(s)}),r()(),o(25,"div",7)(26,"label",11),m(27,"Page Size"),r(),o(28,"input",13),v("ngModelChange",function(s){return h(p),w(i.filter().PageSize,s)||(i.filter().PageSize=s),g(s)}),r()()(),o(29,"content")(30,"div",14)(31,"div",15)(32,"div",16),k(33,Je,20,2,"div",17)(34,Xe,2,0,"div",18),r()()()()(),o(35,"app-context-menu",19,0),b("onSelectItem",function(s){return h(p),g(i.onSelectContextItem(s))}),r()}if(t&2){let p=ae(I(1,10,i.awaitingCollections$));c(2),S("text",i.filter().Number),c(2),T(i.selectedOrders().length>0?4:-1),c(9),y("multiple",!0),S("ngModel",i.filter().ListChannelID),c(5),S("date",i.filter().From),c(2),S("date",i.filter().To),c(4),S("ngModel",i.filter().PageNumber),c(4),S("ngModel",i.filter().PageSize),c(5),T((p==null?null:p.length)>0?33:34),c(2),y("items",i.contextMenuItems)}},dependencies:[he,ke,Te,Le,z,fe,Ce,ge,W,R,Ee,Ve,Ae,be,_e,De,Fe,Me,me,ue,de,Pe],encapsulation:2});let a=l;return a})();export{Jt as AwaitingCollectionComponent};
@@ -1 +1 @@
1
- import{a as ve,b as xe}from"./chunk-RIIIECQH.js";import{a as ge}from"./chunk-JWDQVXQP.js";import{a as Ce,b as Se}from"./chunk-K5WSFDNA.js";import{a as be}from"./chunk-FBXKHJ2G.js";import{a as N}from"./chunk-L6CRWJ2O.js";import{a as ye}from"./chunk-PV4OJSZI.js";import"./chunk-FSOZOROI.js";import"./chunk-VYI7JYH5.js";import"./chunk-BZWZ64N5.js";import{a as fe}from"./chunk-3PUUKJCQ.js";import"./chunk-VVNLTDLG.js";import"./chunk-OHAT7WXU.js";import"./chunk-L4EPB2CQ.js";import"./chunk-GNXSEYJF.js";import{a as he}from"./chunk-ZZYFVEJO.js";import"./chunk-DLHIDOS3.js";import{a as _e}from"./chunk-27DIE2YS.js";import"./chunk-JU4ZP3HI.js";import"./chunk-3T5VLB63.js";import"./chunk-STOW2RQN.js";import"./chunk-GLBJ4Y4T.js";import"./chunk-XTNXL2IY.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import"./chunk-A6QXXKPR.js";import"./chunk-6Q4BDCI5.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{b as ue}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import{a as ce}from"./chunk-UEXWQT5J.js";import"./chunk-3SCX7IMW.js";import"./chunk-K4Q33QIR.js";import"./chunk-JRCXHF2X.js";import"./chunk-M27MYADT.js";import"./chunk-TBVMCNS2.js";import"./chunk-RM6ZXD3O.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-3RK6DDJD.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-NJNRUDU6.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import"./chunk-JTKEMQZT.js";import{c as pe}from"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import"./chunk-2OKZEOBU.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import{b as ne}from"./chunk-UPRDDI4K.js";import{A as me,b as re,c as le,h as ae,m as se,o as de}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{b as oe}from"./chunk-D6JH2KV4.js";import"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{A as te,B as ie,w as $,y as ee}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{$c as K,Cc as H,Dc as Q,Ec as j,Hb as D,Ia as P,Mc as q,Nc as d,Oc as w,Pc as M,Rc as C,Sc as S,Tc as y,Uc as U,Vc as G,Wc as F,Z as I,_c as J,ac as v,ad as X,cc as x,dc as B,ea as k,fc as A,gc as z,hc as f,ic as t,id as V,jc as n,jd as O,kc as h,kd as Y,mb as W,ob as a,pd as Z,ra as E,rc as T,wc as g,ya as p,yc as u,za as c}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import{a as R,b as L}from"./chunk-66YHNWRR.js";var Te=["contextMenu"],we=()=>[],Me=l=>({"td-cell-hover":l});function Ve(l,m){if(l&1){let e=T();t(0,"button",20),g("click",function(){p(e);let r=u();return c(r.setMultipleFulfillment())}),d(1," Set Fulfillment "),n()}}function Re(l,m){if(l&1&&h(0,"variants-dropdown",38),l&2){let e=u().$implicit;f("variants",e==null?null:e.Variants)}}function Ee(l,m){if(l&1&&h(0,"variant-with-image",39),l&2){let e=u().$implicit;f("variant",e==null?null:e.Variants[0])}}function Oe(l,m){if(l&1&&(t(0,"span"),d(1),n()),l&2){let e=u().$implicit;a(),M("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function Pe(l,m){if(l&1){let e=T();t(0,"div",41)(1,"button",45),g("click",function(){p(e);let r=u().$implicit,o=u(2);return c(o.refreshShippingAndRefNumber(r))}),h(2,"i",46),n()()}}function Fe(l,m){if(l&1){let e=T();t(0,"button",47),g("click",function(){p(e);let r=u().$implicit,o=u(2);return c(o.onSetFulfillment(r))}),d(1," Set Fulfillment "),n()}}function Ne(l,m){if(l&1){let e=T();t(0,"tr")(1,"td")(2,"input",30),y("ngModelChange",function(r){let o=p(e).$implicit;return S(o.selected,r)||(o.selected=r),c(r)}),g("ngModelChange",function(){p(e);let r=u(2),o=F(0);return c(r.onSelectOrder(o))}),n()(),t(3,"td")(4,"div",31),h(5,"img",32),V(6,"channelImage"),t(7,"div",33)(8,"div"),d(9),n(),t(10,"small",34)(11,"span"),d(12),n()()()()(),t(13,"td")(14,"div",35)(15,"div"),h(16,"order-link",36),n(),t(17,"small"),d(18),V(19,"date"),n(),h(20,"br"),t(21,"small"),h(22,"i",37),d(23),n()()(),t(24,"td"),v(25,Re,1,1,"variants-dropdown",38)(26,Ee,1,1,"variant-with-image",39),n(),t(27,"td",40),d(28),V(29,"number"),n(),t(30,"td",41)(31,"div",42)(32,"div",35)(33,"div",43)(34,"span"),d(35),n(),v(36,Oe,2,1,"span"),n(),t(37,"small"),d(38),n()(),v(39,Pe,3,0,"div",41),n()(),t(40,"td",41),v(41,Fe,2,0,"button",44),n()()}if(l&2){let e=m.$implicit,i=u(2);a(2),C("ngModel",e.selected),f("disabled",i.selectedChannelType()!=null&&i.selectedChannelType()!=e.MarketType),a(3),f("src",O(6,18,e==null?null:e.MarketType),W)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),a(4),w(e.Outlet),a(3),w(e.ChannelName),a(4),f("order",e),a(2),M(" ",Y(19,20,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),a(5),M(" ",e.Customer," "),a(),q(X(25,Me,(e.Variants==null?null:e.Variants.length)>1)),a(),x((e.Variants==null?null:e.Variants.length)>1?25:26),a(3),w(O(29,23,e.Amount)),a(7),w(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),a(),x(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?36:-1),a(2),M(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," "),a(),x(!(e.LogisticService!=null&&e.LogisticService.Name)||!e.ReferenceNumber?39:-1),a(2),x((e==null?null:e.MarketType)!=i.channelType.WooCommerce?41:-1)}}function Le(l,m){if(l&1){let e=T();t(0,"div",17)(1,"table",21)(2,"thead",22)(3,"tr",23),h(4,"th",24),t(5,"th",25),d(6,"Outlet"),n(),t(7,"th",25),d(8,"Number"),n(),t(9,"th"),d(10,"Items"),n(),t(11,"th",26),d(12,"Amount"),n(),t(13,"th",27),d(14,"Shipping"),n(),h(15,"th",28),n()(),t(16,"tbody"),A(17,Ne,42,27,"tr",null,B),n()(),t(19,"app-custom-paginator",29),g("next",function(){p(e);let r=u();return c(r.initReadyToShip())})("previous",function(){p(e);let r=u();return c(r.initReadyToShip())}),n()()}if(l&2){let e=u(),i=F(0);a(17),z(i),a(2),f("filter",e.filter())("totaldata",i==null?null:i.length)}}function Ie(l,m){l&1&&(t(0,"div",18),h(1,"app-empty-state"),n())}var st=(()=>{let m=class m{constructor(){this.toastr=E(oe),this.orderService=E(N),this.fulfillmentService=E(ve),this.channelType=ne,this.selectedOrders=P([]),this.selectedChannelType=Z(()=>{let i=null;return this.selectedOrders().length>0&&(i=this.selectedOrders()[0].MarketType),i}),this.filter=P({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null}),this.contextMenuItems=[{id:"refresh",label:"Refresh Shipping",icon:"fa-solid fa-arrows-rotate"}]}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:i=>{this.initFromDate(i)},error:i=>{console.error("Error fetching default date:",i),this.initFromDate(null)}})}initFromDate(i){this.filter.update(r=>L(R({},r),{From:i})),this.initReadyToShip()}initReadyToShip(){this.readyToShip$=this.orderService.getReadyToShipOrders(this.filter()).pipe(k(()=>{this.selectedOrders.set([])}),I(1))}onFilterChange(i){this.filter.update(r=>R(R({},r),i))}onSetFulfillment(i){this.fulfillmentService.setFulfillmentOrder(i).subscribe(()=>{this.toastr.success("Fulfillment set successfully","Success"),this.initReadyToShip()})}refreshShippingAndRefNumber(i){this.orderService.refreshShippingCourier(i.ShopID,i.Number).subscribe(()=>{this.toastr.success("Shipping courier and reference number refreshed","Success"),this.initReadyToShip()})}setMultipleFulfillment(){this.fulfillmentService.setFulfillmentMultipleOrders(this.selectedOrders()).subscribe(()=>{this.toastr.success("Fulfillment set successfully","Success"),this.initReadyToShip()})}onSelectOrder(i){let r=i.filter(o=>o.selected);this.selectedOrders.set(r)}onMouseHover(i,r){(!r.LogisticService?.Name||!r.ReferenceNumber)&&this.contextMenuEl.show(i,r)}onSelectContextItem(i){i.item?.id==="refresh"&&this.refreshShippingAndRefNumber(i.data)}};m.\u0275fac=function(r){return new(r||m)},m.\u0275cmp=D({type:m,selectors:[["app-ready-to-ship"]],viewQuery:function(r,o){if(r&1&&H(Te,5),r&2){let _;Q(_=j())&&(o.contextMenuEl=_.first)}},features:[J([N])],decls:37,vars:14,consts:[["contextMenu",""],["headerTitle","To Ship","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-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"],[3,"onSelectItem","items"],[1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","5px"],[2,"width","200px"],[1,"text-end",2,"width","100px"],[2,"width","80px"],[2,"width","150px"],["rowCountApi","/api/orders/toshipcount",3,"next","previous","filter","totaldata"],["type","checkbox",3,"ngModelChange","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"],[1,"actions-cell"],[1,"d-flex","align-items-center","gap-6"],[1,"d-flex","align-items-end","gap-2"],[1,"btn","btn-success","btn-sm",2,"--bs-btn-padding-y","0.25rem","--bs-btn-padding-x","0.5rem","--bs-btn-font-size","0.75rem"],["matTooltip","Retrieve shipping courier and reference number",1,"btn","btn-icon-only",3,"click"],[1,"fa-solid","fa-arrows-rotate","fs-6"],[1,"btn","btn-success","btn-sm",2,"--bs-btn-padding-y","0.25rem","--bs-btn-padding-x","0.5rem","--bs-btn-font-size","0.75rem",3,"click"]],template:function(r,o){if(r&1){let _=T();U(0),V(1,"async"),t(2,"mainpanel",1),g("onSubmit",function(){return p(_),c(o.initReadyToShip())}),y("textChange",function(s){return p(_),S(o.filter().Number,s)||(o.filter().Number=s),c(s)}),t(3,"actions"),v(4,Ve,2,0,"button",2),t(5,"a",3),h(6,"i",4),t(7,"span"),d(8,"Order Fulfillment Display"),n()()(),t(9,"filters")(10,"div")(11,"label",5),d(12,"Channel"),n(),t(13,"app-channel-options-v2",6),y("ngModelChange",function(s){return p(_),S(o.filter().ListChannelID,s)||(o.filter().ListChannelID=s),c(s)}),n()(),t(14,"div",7)(15,"label",5),d(16,"From/To"),n(),t(17,"div",8)(18,"datepicker",9),y("dateChange",function(s){return p(_),S(o.filter().From,s)||(o.filter().From=s),c(s)}),n()(),t(19,"div")(20,"datepicker",10),y("dateChange",function(s){return p(_),S(o.filter().To,s)||(o.filter().To=s),c(s)}),n()()(),t(21,"div",7)(22,"label",11),d(23,"Page Number"),n(),t(24,"input",12),y("ngModelChange",function(s){return p(_),S(o.filter().PageNumber,s)||(o.filter().PageNumber=s),c(s)}),n()(),t(25,"div",7)(26,"label",11),d(27,"Page Size"),n(),t(28,"input",13),y("ngModelChange",function(s){return p(_),S(o.filter().PageSize,s)||(o.filter().PageSize=s),c(s)}),n()()(),t(29,"content")(30,"div",14)(31,"div",15)(32,"div",16),v(33,Le,20,2,"div",17)(34,Ie,2,0,"div",18),n()()()()(),t(35,"app-context-menu",19,0),g("onSelectItem",function(s){return p(_),c(o.onSelectContextItem(s))}),n()}if(r&2){let _=G(O(1,10,o.readyToShip$)||K(13,we));a(2),C("text",o.filter().Number),a(2),x(o.selectedOrders().length>0?4:-1),a(9),f("multiple",!0),C("ngModel",o.filter().ListChannelID),a(5),C("date",o.filter().From),a(2),C("date",o.filter().To),a(4),C("ngModel",o.filter().PageNumber),a(4),C("ngModel",o.filter().PageSize),a(5),x(_.length>0?33:34),a(2),f("items",o.contextMenuItems)}},dependencies:[ie,ue,_e,he,me,le,de,re,ae,se,Ce,Se,ye,be,ce,pe,xe,fe,$,te,ee,ge],styles:[".actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{opacity:0;visibility:hidden;transition:opacity .12s ease-in-out}tr[_ngcontent-%COMP%]:hover .actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%], div[_ngcontent-%COMP%]:hover.actions-cell .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%]:hover .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%]:focus-within .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]:focus{opacity:1;visibility:visible}"]});let l=m;return l})();export{st as ReadyToShipComponent};
1
+ import{a as ve,b as xe}from"./chunk-RIIIECQH.js";import{a as ge}from"./chunk-JWDQVXQP.js";import{a as Ce,b as Se}from"./chunk-K5WSFDNA.js";import{a as be}from"./chunk-DOQD3RMB.js";import{a as N}from"./chunk-L6CRWJ2O.js";import{a as ye}from"./chunk-PV4OJSZI.js";import"./chunk-FSOZOROI.js";import"./chunk-VYI7JYH5.js";import"./chunk-BZWZ64N5.js";import{a as fe}from"./chunk-QUIZLT5F.js";import"./chunk-VVNLTDLG.js";import"./chunk-OHAT7WXU.js";import"./chunk-L4EPB2CQ.js";import"./chunk-GNXSEYJF.js";import{a as he}from"./chunk-ZZYFVEJO.js";import"./chunk-DLHIDOS3.js";import{a as _e}from"./chunk-27DIE2YS.js";import"./chunk-JU4ZP3HI.js";import"./chunk-3T5VLB63.js";import"./chunk-STOW2RQN.js";import"./chunk-GLBJ4Y4T.js";import"./chunk-XTNXL2IY.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import"./chunk-A6QXXKPR.js";import"./chunk-6Q4BDCI5.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{b as ue}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import{a as ce}from"./chunk-UEXWQT5J.js";import"./chunk-3SCX7IMW.js";import"./chunk-K4Q33QIR.js";import"./chunk-JRCXHF2X.js";import"./chunk-M27MYADT.js";import"./chunk-TBVMCNS2.js";import"./chunk-RM6ZXD3O.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-3RK6DDJD.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-NJNRUDU6.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import"./chunk-JTKEMQZT.js";import{c as pe}from"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import"./chunk-J4552BMI.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import{b as ne}from"./chunk-UPRDDI4K.js";import{A as me,b as re,c as le,h as ae,m as se,o as de}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{b as oe}from"./chunk-D6JH2KV4.js";import"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{A as te,B as ie,w as $,y as ee}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{$c as K,Cc as H,Dc as Q,Ec as j,Hb as D,Ia as P,Mc as q,Nc as d,Oc as w,Pc as M,Rc as C,Sc as S,Tc as y,Uc as U,Vc as G,Wc as F,Z as I,_c as J,ac as v,ad as X,cc as x,dc as B,ea as k,fc as A,gc as z,hc as f,ic as t,id as V,jc as n,jd as O,kc as h,kd as Y,mb as W,ob as a,pd as Z,ra as E,rc as T,wc as g,ya as p,yc as u,za as c}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import{a as R,b as L}from"./chunk-66YHNWRR.js";var Te=["contextMenu"],we=()=>[],Me=l=>({"td-cell-hover":l});function Ve(l,m){if(l&1){let e=T();t(0,"button",20),g("click",function(){p(e);let r=u();return c(r.setMultipleFulfillment())}),d(1," Set Fulfillment "),n()}}function Re(l,m){if(l&1&&h(0,"variants-dropdown",38),l&2){let e=u().$implicit;f("variants",e==null?null:e.Variants)}}function Ee(l,m){if(l&1&&h(0,"variant-with-image",39),l&2){let e=u().$implicit;f("variant",e==null?null:e.Variants[0])}}function Oe(l,m){if(l&1&&(t(0,"span"),d(1),n()),l&2){let e=u().$implicit;a(),M("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function Pe(l,m){if(l&1){let e=T();t(0,"div",41)(1,"button",45),g("click",function(){p(e);let r=u().$implicit,o=u(2);return c(o.refreshShippingAndRefNumber(r))}),h(2,"i",46),n()()}}function Fe(l,m){if(l&1){let e=T();t(0,"button",47),g("click",function(){p(e);let r=u().$implicit,o=u(2);return c(o.onSetFulfillment(r))}),d(1," Set Fulfillment "),n()}}function Ne(l,m){if(l&1){let e=T();t(0,"tr")(1,"td")(2,"input",30),y("ngModelChange",function(r){let o=p(e).$implicit;return S(o.selected,r)||(o.selected=r),c(r)}),g("ngModelChange",function(){p(e);let r=u(2),o=F(0);return c(r.onSelectOrder(o))}),n()(),t(3,"td")(4,"div",31),h(5,"img",32),V(6,"channelImage"),t(7,"div",33)(8,"div"),d(9),n(),t(10,"small",34)(11,"span"),d(12),n()()()()(),t(13,"td")(14,"div",35)(15,"div"),h(16,"order-link",36),n(),t(17,"small"),d(18),V(19,"date"),n(),h(20,"br"),t(21,"small"),h(22,"i",37),d(23),n()()(),t(24,"td"),v(25,Re,1,1,"variants-dropdown",38)(26,Ee,1,1,"variant-with-image",39),n(),t(27,"td",40),d(28),V(29,"number"),n(),t(30,"td",41)(31,"div",42)(32,"div",35)(33,"div",43)(34,"span"),d(35),n(),v(36,Oe,2,1,"span"),n(),t(37,"small"),d(38),n()(),v(39,Pe,3,0,"div",41),n()(),t(40,"td",41),v(41,Fe,2,0,"button",44),n()()}if(l&2){let e=m.$implicit,i=u(2);a(2),C("ngModel",e.selected),f("disabled",i.selectedChannelType()!=null&&i.selectedChannelType()!=e.MarketType),a(3),f("src",O(6,18,e==null?null:e.MarketType),W)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),a(4),w(e.Outlet),a(3),w(e.ChannelName),a(4),f("order",e),a(2),M(" ",Y(19,20,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),a(5),M(" ",e.Customer," "),a(),q(X(25,Me,(e.Variants==null?null:e.Variants.length)>1)),a(),x((e.Variants==null?null:e.Variants.length)>1?25:26),a(3),w(O(29,23,e.Amount)),a(7),w(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),a(),x(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?36:-1),a(2),M(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," "),a(),x(!(e.LogisticService!=null&&e.LogisticService.Name)||!e.ReferenceNumber?39:-1),a(2),x((e==null?null:e.MarketType)!=i.channelType.WooCommerce?41:-1)}}function Le(l,m){if(l&1){let e=T();t(0,"div",17)(1,"table",21)(2,"thead",22)(3,"tr",23),h(4,"th",24),t(5,"th",25),d(6,"Outlet"),n(),t(7,"th",25),d(8,"Number"),n(),t(9,"th"),d(10,"Items"),n(),t(11,"th",26),d(12,"Amount"),n(),t(13,"th",27),d(14,"Shipping"),n(),h(15,"th",28),n()(),t(16,"tbody"),A(17,Ne,42,27,"tr",null,B),n()(),t(19,"app-custom-paginator",29),g("next",function(){p(e);let r=u();return c(r.initReadyToShip())})("previous",function(){p(e);let r=u();return c(r.initReadyToShip())}),n()()}if(l&2){let e=u(),i=F(0);a(17),z(i),a(2),f("filter",e.filter())("totaldata",i==null?null:i.length)}}function Ie(l,m){l&1&&(t(0,"div",18),h(1,"app-empty-state"),n())}var st=(()=>{let m=class m{constructor(){this.toastr=E(oe),this.orderService=E(N),this.fulfillmentService=E(ve),this.channelType=ne,this.selectedOrders=P([]),this.selectedChannelType=Z(()=>{let i=null;return this.selectedOrders().length>0&&(i=this.selectedOrders()[0].MarketType),i}),this.filter=P({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null}),this.contextMenuItems=[{id:"refresh",label:"Refresh Shipping",icon:"fa-solid fa-arrows-rotate"}]}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:i=>{this.initFromDate(i)},error:i=>{console.error("Error fetching default date:",i),this.initFromDate(null)}})}initFromDate(i){this.filter.update(r=>L(R({},r),{From:i})),this.initReadyToShip()}initReadyToShip(){this.readyToShip$=this.orderService.getReadyToShipOrders(this.filter()).pipe(k(()=>{this.selectedOrders.set([])}),I(1))}onFilterChange(i){this.filter.update(r=>R(R({},r),i))}onSetFulfillment(i){this.fulfillmentService.setFulfillmentOrder(i).subscribe(()=>{this.toastr.success("Fulfillment set successfully","Success"),this.initReadyToShip()})}refreshShippingAndRefNumber(i){this.orderService.refreshShippingCourier(i.ShopID,i.Number).subscribe(()=>{this.toastr.success("Shipping courier and reference number refreshed","Success"),this.initReadyToShip()})}setMultipleFulfillment(){this.fulfillmentService.setFulfillmentMultipleOrders(this.selectedOrders()).subscribe(()=>{this.toastr.success("Fulfillment set successfully","Success"),this.initReadyToShip()})}onSelectOrder(i){let r=i.filter(o=>o.selected);this.selectedOrders.set(r)}onMouseHover(i,r){(!r.LogisticService?.Name||!r.ReferenceNumber)&&this.contextMenuEl.show(i,r)}onSelectContextItem(i){i.item?.id==="refresh"&&this.refreshShippingAndRefNumber(i.data)}};m.\u0275fac=function(r){return new(r||m)},m.\u0275cmp=D({type:m,selectors:[["app-ready-to-ship"]],viewQuery:function(r,o){if(r&1&&H(Te,5),r&2){let _;Q(_=j())&&(o.contextMenuEl=_.first)}},features:[J([N])],decls:37,vars:14,consts:[["contextMenu",""],["headerTitle","To Ship","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-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"],[3,"onSelectItem","items"],[1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","5px"],[2,"width","200px"],[1,"text-end",2,"width","100px"],[2,"width","80px"],[2,"width","150px"],["rowCountApi","/api/orders/toshipcount",3,"next","previous","filter","totaldata"],["type","checkbox",3,"ngModelChange","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"],[1,"actions-cell"],[1,"d-flex","align-items-center","gap-6"],[1,"d-flex","align-items-end","gap-2"],[1,"btn","btn-success","btn-sm",2,"--bs-btn-padding-y","0.25rem","--bs-btn-padding-x","0.5rem","--bs-btn-font-size","0.75rem"],["matTooltip","Retrieve shipping courier and reference number",1,"btn","btn-icon-only",3,"click"],[1,"fa-solid","fa-arrows-rotate","fs-6"],[1,"btn","btn-success","btn-sm",2,"--bs-btn-padding-y","0.25rem","--bs-btn-padding-x","0.5rem","--bs-btn-font-size","0.75rem",3,"click"]],template:function(r,o){if(r&1){let _=T();U(0),V(1,"async"),t(2,"mainpanel",1),g("onSubmit",function(){return p(_),c(o.initReadyToShip())}),y("textChange",function(s){return p(_),S(o.filter().Number,s)||(o.filter().Number=s),c(s)}),t(3,"actions"),v(4,Ve,2,0,"button",2),t(5,"a",3),h(6,"i",4),t(7,"span"),d(8,"Order Fulfillment Display"),n()()(),t(9,"filters")(10,"div")(11,"label",5),d(12,"Channel"),n(),t(13,"app-channel-options-v2",6),y("ngModelChange",function(s){return p(_),S(o.filter().ListChannelID,s)||(o.filter().ListChannelID=s),c(s)}),n()(),t(14,"div",7)(15,"label",5),d(16,"From/To"),n(),t(17,"div",8)(18,"datepicker",9),y("dateChange",function(s){return p(_),S(o.filter().From,s)||(o.filter().From=s),c(s)}),n()(),t(19,"div")(20,"datepicker",10),y("dateChange",function(s){return p(_),S(o.filter().To,s)||(o.filter().To=s),c(s)}),n()()(),t(21,"div",7)(22,"label",11),d(23,"Page Number"),n(),t(24,"input",12),y("ngModelChange",function(s){return p(_),S(o.filter().PageNumber,s)||(o.filter().PageNumber=s),c(s)}),n()(),t(25,"div",7)(26,"label",11),d(27,"Page Size"),n(),t(28,"input",13),y("ngModelChange",function(s){return p(_),S(o.filter().PageSize,s)||(o.filter().PageSize=s),c(s)}),n()()(),t(29,"content")(30,"div",14)(31,"div",15)(32,"div",16),v(33,Le,20,2,"div",17)(34,Ie,2,0,"div",18),n()()()()(),t(35,"app-context-menu",19,0),g("onSelectItem",function(s){return p(_),c(o.onSelectContextItem(s))}),n()}if(r&2){let _=G(O(1,10,o.readyToShip$)||K(13,we));a(2),C("text",o.filter().Number),a(2),x(o.selectedOrders().length>0?4:-1),a(9),f("multiple",!0),C("ngModel",o.filter().ListChannelID),a(5),C("date",o.filter().From),a(2),C("date",o.filter().To),a(4),C("ngModel",o.filter().PageNumber),a(4),C("ngModel",o.filter().PageSize),a(5),x(_.length>0?33:34),a(2),f("items",o.contextMenuItems)}},dependencies:[ie,ue,_e,he,me,le,de,re,ae,se,Ce,Se,ye,be,ce,pe,xe,fe,$,te,ee,ge],styles:[".actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{opacity:0;visibility:hidden;transition:opacity .12s ease-in-out}tr[_ngcontent-%COMP%]:hover .actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%], div[_ngcontent-%COMP%]:hover.actions-cell .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%]:hover .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%]:focus-within .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]:focus{opacity:1;visibility:visible}"]});let l=m;return l})();export{st as ReadyToShipComponent};
@@ -1 +1 @@
1
- import{a as r}from"./chunk-MYJZFEAZ.js";import{a as l,b as u}from"./chunk-75IM3UUA.js";import"./chunk-UEXWQT5J.js";import"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import"./chunk-2OKZEOBU.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import"./chunk-UPRDDI4K.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import"./chunk-D6JH2KV4.js";import{c as d,g as s}from"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{Hb as i,hc as p,ic as m,jc as c,kc as n,ob as a}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var f=(()=>{let e=class e{constructor(){this.tabs=[{Title:"Origin Order API",Url:"/menu/json-api/order-api"},{Title:"Origin Product API",Url:"/menu/json-api/product-api"},{Title:"Origin Escrow API",Url:"/menu/json-api/escrow-api"}]}};e.\u0275fac=function(o){return new(o||e)},e.\u0275cmp=i({type:e,selectors:[["app-json-api"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(o,h){o&1&&(m(0,"nav",0)(1,"div",1)(2,"div"),n(3,"nav-tab",2),c()()(),n(4,"router-outlet")),o&2&&(a(3),p("Tabs",h.tabs))},dependencies:[u,l,s,d],encapsulation:2});let t=e;return t})();var I=[{path:"",component:f,children:[{path:"",redirectTo:"order-api",pathMatch:"full"},{path:"order-api",loadComponent(){return import("./chunk-CQBHWYUO.js").then(t=>t.OrderApiComponent)},canActivate:[r],data:{title:"Order API"}},{path:"product-api",loadComponent(){return import("./chunk-7VJ22OLT.js").then(t=>t.ProductApiComponent)},canActivate:[r],data:{title:"Product API"}},{path:"escrow-api",loadComponent(){return import("./chunk-PHVEBMTE.js").then(t=>t.EscrowApiComponent)},canActivate:[r],data:{title:"Escrow API"}}]}];export{I as routes};
1
+ import{a as r}from"./chunk-WZQRKTBN.js";import{a as l,b as u}from"./chunk-75IM3UUA.js";import"./chunk-UEXWQT5J.js";import"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import"./chunk-J4552BMI.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import"./chunk-UPRDDI4K.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import"./chunk-D6JH2KV4.js";import{c as d,g as s}from"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{Hb as i,hc as p,ic as m,jc as c,kc as n,ob as a}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var f=(()=>{let e=class e{constructor(){this.tabs=[{Title:"Origin Order API",Url:"/menu/json-api/order-api"},{Title:"Origin Product API",Url:"/menu/json-api/product-api"},{Title:"Origin Escrow API",Url:"/menu/json-api/escrow-api"}]}};e.\u0275fac=function(o){return new(o||e)},e.\u0275cmp=i({type:e,selectors:[["app-json-api"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(o,h){o&1&&(m(0,"nav",0)(1,"div",1)(2,"div"),n(3,"nav-tab",2),c()()(),n(4,"router-outlet")),o&2&&(a(3),p("Tabs",h.tabs))},dependencies:[u,l,s,d],encapsulation:2});let t=e;return t})();var I=[{path:"",component:f,children:[{path:"",redirectTo:"order-api",pathMatch:"full"},{path:"order-api",loadComponent(){return import("./chunk-SLCKHYT3.js").then(t=>t.OrderApiComponent)},canActivate:[r],data:{title:"Order API"}},{path:"product-api",loadComponent(){return import("./chunk-575TS45M.js").then(t=>t.ProductApiComponent)},canActivate:[r],data:{title:"Product API"}},{path:"escrow-api",loadComponent(){return import("./chunk-ILFG3IYB.js").then(t=>t.EscrowApiComponent)},canActivate:[r],data:{title:"Escrow API"}}]}];export{I as routes};
@@ -1 +1 @@
1
- import{f as _}from"./chunk-2OKZEOBU.js";import{c as a}from"./chunk-UPRDDI4K.js";import{e as k,g as C}from"./chunk-UB3ZV5NW.js";import{Hb as v,Nc as u,Pc as p,ac as I,bd as D,cc as g,hc as s,ic as c,jc as m,ma as h,mb as b,ob as l,pd as f,ra as o,ud as x,yc as d}from"./chunk-OHGMB7HJ.js";var y=(()=>{let e=class e{constructor(){this.localDataService=o(_),this.baseUrl=this.localDataService.getHostName()}getBaseUrl(n){let r="";return a.IsNotEmpty(n.ID)?r=`https://${this.baseUrl}/menu/Orders/Orders/Customer_Invoice/Info?ID=${n.ID}`:r="/menu/Order/detail",r}};e.\u0275fac=function(r){return new(r||e)},e.\u0275prov=h({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var U=(t,e)=>({Number:t,Outlet:e});function L(t,e){if(t&1&&(c(0,"a",0),u(1),m()),t&2){let i,n=d();s("href",n.baseUrl(),b),l(),p(" ",(i=n.order())==null?null:i.Number," ")}}function S(t,e){if(t&1&&(c(0,"a",1),u(1),m()),t&2){let i,n,r=d();s("routerLink",r.baseUrl())("queryParams",D(3,U,(i=r.order())==null?null:i.Number,(i=r.order())==null?null:i.Outlet)),l(),p(" ",(n=r.order())==null?null:n.Number," ")}}var z=(()=>{let e=class e{constructor(){this.order=x(),this.generateLinkService=o(y),this.baseUrl=f(()=>this.generateLinkService.getBaseUrl(this.order())),this.hasOrderID=f(()=>a.IsNotEmpty(this.order()?.ID))}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=v({type:e,selectors:[["order-link"]],inputs:{order:[1,"order"]},decls:2,vars:1,consts:[["target","_blank",3,"href"],["target","_blank",3,"routerLink","queryParams"]],template:function(r,N){r&1&&I(0,L,2,2,"a",0)(1,S,2,6,"a",1),r&2&&g(N.hasOrderID()?0:1)},dependencies:[C,k],encapsulation:2});let t=e;return t})();export{z as a};
1
+ import{f as _}from"./chunk-J4552BMI.js";import{c as a}from"./chunk-UPRDDI4K.js";import{e as k,g as C}from"./chunk-UB3ZV5NW.js";import{Hb as v,Nc as u,Pc as p,ac as I,bd as D,cc as g,hc as s,ic as c,jc as m,ma as h,mb as b,ob as l,pd as f,ra as o,ud as x,yc as d}from"./chunk-OHGMB7HJ.js";var y=(()=>{let e=class e{constructor(){this.localDataService=o(_),this.baseUrl=this.localDataService.getHostName()}getBaseUrl(n){let r="";return a.IsNotEmpty(n.ID)?r=`https://${this.baseUrl}/menu/Orders/Orders/Customer_Invoice/Info?ID=${n.ID}`:r="/menu/Order/detail",r}};e.\u0275fac=function(r){return new(r||e)},e.\u0275prov=h({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var U=(t,e)=>({Number:t,Outlet:e});function L(t,e){if(t&1&&(c(0,"a",0),u(1),m()),t&2){let i,n=d();s("href",n.baseUrl(),b),l(),p(" ",(i=n.order())==null?null:i.Number," ")}}function S(t,e){if(t&1&&(c(0,"a",1),u(1),m()),t&2){let i,n,r=d();s("routerLink",r.baseUrl())("queryParams",D(3,U,(i=r.order())==null?null:i.Number,(i=r.order())==null?null:i.Outlet)),l(),p(" ",(n=r.order())==null?null:n.Number," ")}}var z=(()=>{let e=class e{constructor(){this.order=x(),this.generateLinkService=o(y),this.baseUrl=f(()=>this.generateLinkService.getBaseUrl(this.order())),this.hasOrderID=f(()=>a.IsNotEmpty(this.order()?.ID))}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=v({type:e,selectors:[["order-link"]],inputs:{order:[1,"order"]},decls:2,vars:1,consts:[["target","_blank",3,"href"],["target","_blank",3,"routerLink","queryParams"]],template:function(r,N){r&1&&I(0,L,2,2,"a",0)(1,S,2,6,"a",1),r&2&&g(N.hasOrderID()?0:1)},dependencies:[C,k],encapsulation:2});let t=e;return t})();export{z as a};
@@ -1 +1 @@
1
- import{a as Se}from"./chunk-MSSRROS6.js";import{a as V}from"./chunk-ISMIPSYN.js";import"./chunk-7T5DBPDP.js";import"./chunk-OH5T7D7O.js";import"./chunk-DE3FRI5N.js";import{a as Ce,b as ge}from"./chunk-CBULW22C.js";import"./chunk-FH2KAM6J.js";import{c as fe,d as O,e as R}from"./chunk-C67KF7MG.js";import"./chunk-JKRELT7N.js";import"./chunk-WTHYLNPX.js";import{c as me,d as ue}from"./chunk-TUY6YGYA.js";import"./chunk-76AVMRJU.js";import"./chunk-2EGTHH3W.js";import"./chunk-LR2YCE6M.js";import{e as he}from"./chunk-BZWZ64N5.js";import"./chunk-L4EPB2CQ.js";import"./chunk-GNXSEYJF.js";import"./chunk-DLHIDOS3.js";import{a as de}from"./chunk-FPJTI4LM.js";import"./chunk-STOW2RQN.js";import"./chunk-GLBJ4Y4T.js";import"./chunk-XTNXL2IY.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import"./chunk-JLDXWNDU.js";import"./chunk-A6QXXKPR.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{a as ce,b as pe}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import{c as se}from"./chunk-IA7NJXJD.js";import"./chunk-UEXWQT5J.js";import"./chunk-M27MYADT.js";import"./chunk-TBVMCNS2.js";import"./chunk-3RK6DDJD.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import"./chunk-JTKEMQZT.js";import"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import{a as ne}from"./chunk-ZSUWHVKX.js";import{h as N}from"./chunk-2OKZEOBU.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import{a as E}from"./chunk-AGBJEXIM.js";import{b as ee,c as te}from"./chunk-NB2H6KA7.js";import{c as _}from"./chunk-UPRDDI4K.js";import{A as le,c as ie,h as oe,m as re,o as ae}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{b as Z,e as $}from"./chunk-D6JH2KV4.js";import"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{B as Y,w as X}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{G as k,Hb as A,Ia as y,Nb as G,Nc as v,Rc as b,Sc as I,Tc as T,Uc as K,_c as Q,ac as F,ad as J,cc as M,ea as H,hc as f,ic as s,id as w,jc as d,jd as P,kc as j,ma as W,ob as C,oc as z,pc as q,ra as c,rc as D,wc as S,ya as p,yc as g,za as h}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import{a as B,b as U}from"./chunk-66YHNWRR.js";var x=(()=>{let l=class l{constructor(){this.authService=c(N),this.channelOptions=this.authService.getChannels()}filterSelectedChannels(n,r){let e=Object.assign([],this.channelOptions),i=[],o;return n.forEach(t=>{o=e.find(u=>u.ID==t?.parent?.id),o&&(o=U(B({},o),{Name:`${t?.parent?.label} - ${t?.label}`,LocationID:t?.id}),i.push(o))}),r.forEach(t=>{o=e.find(u=>u.ID==t.id),o&&i.push(o)}),i}generateFilterLocation(n,r){let e=[],i=[],o=[];return n.length>0?(e=n.map(t=>t.id),i=n.filter(t=>_.IsNotEmpty(t?.parent?.id)).map(t=>t?.parent?.id).filter((t,u,L)=>L.indexOf(t)===u)):(e=[],i=[]),o=r.map(t=>t.id),o=o.concat(i).filter((t,u,L)=>L.indexOf(t)===u),{locationIds:e,channelIds:o}}};l.\u0275fac=function(r){return new(r||l)},l.\u0275prov=W({token:l,factory:l.\u0275fac});let a=l;return a})();var ye=a=>[a];function ve(a,l){if(a&1){let m=D();s(0,"button",17),S("click",function(){p(m);let r=g(2),e=g();return h(e.onUpdateItems(r))}),j(1,"i",18),v(2," Update "),d()}}function be(a,l){if(a&1&&(z(0),F(1,ve,3,0,"button",16),q()),a&2){let m=g(),n=g();C(),M(n.productService.hasSelectionVariant(m)?1:-1)}}function Ie(a,l){if(a&1&&(s(0,"actions")(1,"div",14),G(2,be,2,1,"ng-container",15),d()()),a&2){let m=g();C(2),f("ngxPermissionsOnly",J(1,ye,m.inventoryUpdateRole))}}function we(a,l){if(a&1){let m=D();s(0,"app-table",19),S("onToggle",function(r){p(m);let e=g();return h(e.onShowDifferenceStock(r))})("onSubmit",function(r){p(m);let e=g();return h(e.updateStockByVariant(r))}),d()}if(a&2){let m=g();f("data",l)("channel",m.channels())("showProductToggle",!0)("hiddenIPOSInventory",m.searchFilter.HiddenIPOSInventory)}}var st=(()=>{let l=class l{constructor(){this.http=c($),this.toastr=c(Z),this.dialog=c(se),this.productService=c(de),this.authService=c(N),this.mainPanelService=c(ce),this.placeholderService=c(me),this.paginationService=c(O),this.multiChannelService=c(x),this.updateResHandling=c(R),this.searchFilter={PageNumber:1,RowCount:100},this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.selectedLocations=y([]),this.selectedChannels=y([]),this.channels=y([]),this.inventoryUpdateRole=ne.InventoryUpdate,this.searchPlaceholder=y("Search ..."),this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.paginationService.fethRowCountEndpoint=this.allDataCountEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(H(n=>{n.Filter={PageNumber:n.Filter.PageNumber,filterModel:V.ALL,RowCount:n.Filter.PageSize,HiddenIPOSInventory:n.Filter.HiddenIPOSInventory,SearchType:n.Filter.SearchType,NumberFilterComparator:n.Filter.NumberFilterComparator},this.searchFilter=n.Filter,this.initSearchPlaceholder(),this.mainPanelService.openModalFilter()}))}initSearchPlaceholder(){this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(this.searchFilter.SearchType,this.searchFilter.NumberFilterComparator))}onChannelChange(n=[]){let r=n.filter(i=>_.isValidGUID(i.id)==!1),e=n.filter(i=>_.isValidGUID(i.id));this.selectedLocations.set(r),this.selectedChannels.set(e)}onSearch(n){let r=this.multiChannelService.filterSelectedChannels(this.selectedLocations(),this.selectedChannels());this.channels.set(r);let e=this.multiChannelService.generateFilterLocation(this.selectedLocations(),this.selectedChannels());this.searchFilter.ListChannelID=e.channelIds,this.searchFilter.ListLocationID=e.locationIds,this.searchFilter.text=n,this.initSearchPlaceholder(),this.paginationService.reloadPagination(this.searchFilter)}updateStock(n,r){if(n.length>0){let e=[];n.forEach(t=>{t.Channel?.forEach(u=>{e.push({ChannelItemID:u?.ChannelItemID,ChannelVariationID:u?.ChannelVariationID,Inventory:t.Inventory,LocationID:u?.LocationID})})});let o={ListChannelID:r.filter(t=>t.selected).map(t=>t.ID),List:e};this.http.post(E.UpdateInventoryChannel,o).subscribe(t=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+o.List.length+" variants in "+o.ListChannelID.length+" channels","Success")})}}updateStockByVariant(n){let r=n.InventoryMultiwarehouse[0]?.LocationID,e={ID:n.ChannelID,ChannelItemID:n.ChannelItemID,ChannelVariantID:n.ChannelVariationID,NewQuantity:n.Inventory,VariantID:n.ID,SKU:n?.Sku,LocationID:r};this.http.post(E.UpdateUpdateQuantityByItem,e).subscribe(i=>{this.paginationService.reloadPagination(this.searchFilter),this.handlingUpdateStock(i)})}handlingUpdateStock(n){if(n){let r=n?.Response?.Fail_list,e=n?.Response?.Success_list;this.updateResHandling.responseHandling(e,r,"Stock")}else this.toastr.error(n?.Exception,"Error")}onShowDifferenceStock(n){n?this.searchFilter.filterModel=V.DIFFERENCE:this.searchFilter.filterModel=V.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(n){let r=this.productService.selectedVariantProduct(n),e=this.channelOptions.filter(i=>this.channels()?.find(o=>o.ID===i.ID));this.dialog.open(Ce,{data:{selectedItems:r,channels:JSON.parse(JSON.stringify(e))},width:"400px"}).afterClosed().pipe(k(i=>_.IsNotEmpty(i))).subscribe(i=>{this.updateStock(r,i)})}};l.\u0275fac=function(r){return new(r||l)},l.\u0275cmp=A({type:l,selectors:[["app-multi-channel-comparison"]],features:[Q([O,x,R])],decls:28,vars:25,consts:[["headerTitle","Inventory Comparison","textButton","Search",3,"onSubmit","hideSearchBox","searchBoxPlaceHolder"],[1,"mb-5"],["for","selectChannel",1,"fw-bold","mb-3"],["id","selectChannel",3,"onChannelChange","multiple"],[3,"numberFilterComparatorChange","searchTypeChange","numberFilterComparatorOptions","numberFilterComparator","searchTypeOptions","searchType"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["table","inventory",3,"data","channel","showProductToggle","hiddenIPOSInventory"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"d-flex"],[4,"ngxPermissionsOnly"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"onToggle","onSubmit","data","channel","showProductToggle","hiddenIPOSInventory"]],template:function(r,e){if(r&1){let i=D();s(0,"mainpanel",0),S("onSubmit",function(t){return p(i),h(e.onSearch(t))}),F(1,Ie,3,3,"actions"),w(2,"async"),s(3,"filters"),K(4),w(5,"async"),s(6,"div",1)(7,"label",2),v(8,"Channel"),d(),s(9,"multiwarehouse-tree-select",3),S("onChannelChange",function(t){return p(i),h(e.onChannelChange(t))}),d()(),s(10,"div",1)(11,"filter-query-type",4),T("numberFilterComparatorChange",function(t){return p(i),I(e.searchFilter.NumberFilterComparator,t)||(e.searchFilter.NumberFilterComparator=t),h(t)})("searchTypeChange",function(t){return p(i),I(e.searchFilter.SearchType,t)||(e.searchFilter.SearchType=t),h(t)}),d()(),s(12,"div",1)(13,"label",5),v(14,"PageNumber"),d(),s(15,"input",6),T("ngModelChange",function(t){return p(i),I(e.searchFilter.PageNumber,t)||(e.searchFilter.PageNumber=t),h(t)}),d()(),s(16,"div")(17,"label",7),v(18,"Page Size"),d(),s(19,"input",8),T("ngModelChange",function(t){return p(i),I(e.searchFilter.RowCount,t)||(e.searchFilter.RowCount=t),h(t)}),d()()(),s(20,"content")(21,"div",9)(22,"div",10)(23,"div",11),F(24,we,1,4,"app-table",12),w(25,"async"),s(26,"infinite-paginator",13),w(27,"async"),S("onNextPage",function(){return p(i),h(e.paginationService.onNextPage(e.searchFilter))})("onLastPage",function(){return p(i),h(e.paginationService.onLastPage(e.searchFilter))})("onGetRowCount",function(){return p(i),h(e.paginationService.getRowCount(e.searchFilter))}),d()()()()()()}if(r&2){let i,o;f("hideSearchBox",!1)("searchBoxPlaceHolder",e.searchPlaceholder()),C(),M((i=P(2,17,e.paginationService.data$))?1:-1,i);let t=P(5,19,e.loader$);C(8),f("multiple",!0),C(2),f("numberFilterComparatorOptions",t==null||t.Options==null?null:t.Options.SearchComparatorTypeOptions),b("numberFilterComparator",e.searchFilter.NumberFilterComparator),f("searchTypeOptions",t==null||t.Options==null?null:t.Options.SearchSKUOnlyOrSKUNameOptions),b("searchType",e.searchFilter.SearchType),C(4),b("ngModel",e.searchFilter.PageNumber),C(4),b("ngModel",e.searchFilter.RowCount),C(5),M((o=P(25,21,e.paginationService.data$))?24:-1,o),C(2),f("totalData",e.paginationService.totalData())("hideCount",e.paginationService.hideCount())("rowCount",P(27,23,e.paginationService.totalRowCount$))("pageNumber",e.paginationService.pageNumber())("disableNextButton",e.paginationService.disableNextButton())("goToLastPage",e.paginationService.isLastPage())}},dependencies:[Y,pe,ge,le,ie,ae,oe,re,fe,Se,te,ee,he,ue,X],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let a=l;return a})();export{st as MultiChannelComparison};
1
+ import{a as Se}from"./chunk-MSSRROS6.js";import{a as V}from"./chunk-ISMIPSYN.js";import"./chunk-7T5DBPDP.js";import"./chunk-OH5T7D7O.js";import"./chunk-DE3FRI5N.js";import{a as Ce,b as ge}from"./chunk-UJAA73LE.js";import"./chunk-FH2KAM6J.js";import{c as fe,d as O,e as R}from"./chunk-C67KF7MG.js";import"./chunk-JKRELT7N.js";import"./chunk-WTHYLNPX.js";import{c as me,d as ue}from"./chunk-TUY6YGYA.js";import"./chunk-76AVMRJU.js";import"./chunk-2EGTHH3W.js";import"./chunk-LR2YCE6M.js";import{e as he}from"./chunk-BZWZ64N5.js";import"./chunk-L4EPB2CQ.js";import"./chunk-GNXSEYJF.js";import"./chunk-DLHIDOS3.js";import{a as de}from"./chunk-REDQ2L7Y.js";import"./chunk-STOW2RQN.js";import"./chunk-GLBJ4Y4T.js";import"./chunk-XTNXL2IY.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import"./chunk-KHGTW7IV.js";import"./chunk-A6QXXKPR.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{a as ce,b as pe}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import{c as se}from"./chunk-IA7NJXJD.js";import"./chunk-UEXWQT5J.js";import"./chunk-M27MYADT.js";import"./chunk-TBVMCNS2.js";import"./chunk-3RK6DDJD.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import"./chunk-JTKEMQZT.js";import"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import{a as ne}from"./chunk-ZSUWHVKX.js";import{h as N}from"./chunk-J4552BMI.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import{a as E}from"./chunk-AGBJEXIM.js";import{b as ee,c as te}from"./chunk-NB2H6KA7.js";import{c as _}from"./chunk-UPRDDI4K.js";import{A as le,c as ie,h as oe,m as re,o as ae}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{b as Z,e as $}from"./chunk-D6JH2KV4.js";import"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{B as Y,w as X}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{G as k,Hb as A,Ia as y,Nb as G,Nc as v,Rc as b,Sc as I,Tc as T,Uc as K,_c as Q,ac as F,ad as J,cc as M,ea as H,hc as f,ic as s,id as w,jc as d,jd as P,kc as j,ma as W,ob as C,oc as z,pc as q,ra as c,rc as D,wc as S,ya as p,yc as g,za as h}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import{a as B,b as U}from"./chunk-66YHNWRR.js";var x=(()=>{let l=class l{constructor(){this.authService=c(N),this.channelOptions=this.authService.getChannels()}filterSelectedChannels(n,r){let e=Object.assign([],this.channelOptions),i=[],o;return n.forEach(t=>{o=e.find(u=>u.ID==t?.parent?.id),o&&(o=U(B({},o),{Name:`${t?.parent?.label} - ${t?.label}`,LocationID:t?.id}),i.push(o))}),r.forEach(t=>{o=e.find(u=>u.ID==t.id),o&&i.push(o)}),i}generateFilterLocation(n,r){let e=[],i=[],o=[];return n.length>0?(e=n.map(t=>t.id),i=n.filter(t=>_.IsNotEmpty(t?.parent?.id)).map(t=>t?.parent?.id).filter((t,u,L)=>L.indexOf(t)===u)):(e=[],i=[]),o=r.map(t=>t.id),o=o.concat(i).filter((t,u,L)=>L.indexOf(t)===u),{locationIds:e,channelIds:o}}};l.\u0275fac=function(r){return new(r||l)},l.\u0275prov=W({token:l,factory:l.\u0275fac});let a=l;return a})();var ye=a=>[a];function ve(a,l){if(a&1){let m=D();s(0,"button",17),S("click",function(){p(m);let r=g(2),e=g();return h(e.onUpdateItems(r))}),j(1,"i",18),v(2," Update "),d()}}function be(a,l){if(a&1&&(z(0),F(1,ve,3,0,"button",16),q()),a&2){let m=g(),n=g();C(),M(n.productService.hasSelectionVariant(m)?1:-1)}}function Ie(a,l){if(a&1&&(s(0,"actions")(1,"div",14),G(2,be,2,1,"ng-container",15),d()()),a&2){let m=g();C(2),f("ngxPermissionsOnly",J(1,ye,m.inventoryUpdateRole))}}function we(a,l){if(a&1){let m=D();s(0,"app-table",19),S("onToggle",function(r){p(m);let e=g();return h(e.onShowDifferenceStock(r))})("onSubmit",function(r){p(m);let e=g();return h(e.updateStockByVariant(r))}),d()}if(a&2){let m=g();f("data",l)("channel",m.channels())("showProductToggle",!0)("hiddenIPOSInventory",m.searchFilter.HiddenIPOSInventory)}}var st=(()=>{let l=class l{constructor(){this.http=c($),this.toastr=c(Z),this.dialog=c(se),this.productService=c(de),this.authService=c(N),this.mainPanelService=c(ce),this.placeholderService=c(me),this.paginationService=c(O),this.multiChannelService=c(x),this.updateResHandling=c(R),this.searchFilter={PageNumber:1,RowCount:100},this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.selectedLocations=y([]),this.selectedChannels=y([]),this.channels=y([]),this.inventoryUpdateRole=ne.InventoryUpdate,this.searchPlaceholder=y("Search ..."),this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.paginationService.fethRowCountEndpoint=this.allDataCountEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(H(n=>{n.Filter={PageNumber:n.Filter.PageNumber,filterModel:V.ALL,RowCount:n.Filter.PageSize,HiddenIPOSInventory:n.Filter.HiddenIPOSInventory,SearchType:n.Filter.SearchType,NumberFilterComparator:n.Filter.NumberFilterComparator},this.searchFilter=n.Filter,this.initSearchPlaceholder(),this.mainPanelService.openModalFilter()}))}initSearchPlaceholder(){this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(this.searchFilter.SearchType,this.searchFilter.NumberFilterComparator))}onChannelChange(n=[]){let r=n.filter(i=>_.isValidGUID(i.id)==!1),e=n.filter(i=>_.isValidGUID(i.id));this.selectedLocations.set(r),this.selectedChannels.set(e)}onSearch(n){let r=this.multiChannelService.filterSelectedChannels(this.selectedLocations(),this.selectedChannels());this.channels.set(r);let e=this.multiChannelService.generateFilterLocation(this.selectedLocations(),this.selectedChannels());this.searchFilter.ListChannelID=e.channelIds,this.searchFilter.ListLocationID=e.locationIds,this.searchFilter.text=n,this.initSearchPlaceholder(),this.paginationService.reloadPagination(this.searchFilter)}updateStock(n,r){if(n.length>0){let e=[];n.forEach(t=>{t.Channel?.forEach(u=>{e.push({ChannelItemID:u?.ChannelItemID,ChannelVariationID:u?.ChannelVariationID,Inventory:t.Inventory,LocationID:u?.LocationID})})});let o={ListChannelID:r.filter(t=>t.selected).map(t=>t.ID),List:e};this.http.post(E.UpdateInventoryChannel,o).subscribe(t=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+o.List.length+" variants in "+o.ListChannelID.length+" channels","Success")})}}updateStockByVariant(n){let r=n.InventoryMultiwarehouse[0]?.LocationID,e={ID:n.ChannelID,ChannelItemID:n.ChannelItemID,ChannelVariantID:n.ChannelVariationID,NewQuantity:n.Inventory,VariantID:n.ID,SKU:n?.Sku,LocationID:r};this.http.post(E.UpdateUpdateQuantityByItem,e).subscribe(i=>{this.paginationService.reloadPagination(this.searchFilter),this.handlingUpdateStock(i)})}handlingUpdateStock(n){if(n){let r=n?.Response?.Fail_list,e=n?.Response?.Success_list;this.updateResHandling.responseHandling(e,r,"Stock")}else this.toastr.error(n?.Exception,"Error")}onShowDifferenceStock(n){n?this.searchFilter.filterModel=V.DIFFERENCE:this.searchFilter.filterModel=V.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(n){let r=this.productService.selectedVariantProduct(n),e=this.channelOptions.filter(i=>this.channels()?.find(o=>o.ID===i.ID));this.dialog.open(Ce,{data:{selectedItems:r,channels:JSON.parse(JSON.stringify(e))},width:"400px"}).afterClosed().pipe(k(i=>_.IsNotEmpty(i))).subscribe(i=>{this.updateStock(r,i)})}};l.\u0275fac=function(r){return new(r||l)},l.\u0275cmp=A({type:l,selectors:[["app-multi-channel-comparison"]],features:[Q([O,x,R])],decls:28,vars:25,consts:[["headerTitle","Inventory Comparison","textButton","Search",3,"onSubmit","hideSearchBox","searchBoxPlaceHolder"],[1,"mb-5"],["for","selectChannel",1,"fw-bold","mb-3"],["id","selectChannel",3,"onChannelChange","multiple"],[3,"numberFilterComparatorChange","searchTypeChange","numberFilterComparatorOptions","numberFilterComparator","searchTypeOptions","searchType"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["table","inventory",3,"data","channel","showProductToggle","hiddenIPOSInventory"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"d-flex"],[4,"ngxPermissionsOnly"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"onToggle","onSubmit","data","channel","showProductToggle","hiddenIPOSInventory"]],template:function(r,e){if(r&1){let i=D();s(0,"mainpanel",0),S("onSubmit",function(t){return p(i),h(e.onSearch(t))}),F(1,Ie,3,3,"actions"),w(2,"async"),s(3,"filters"),K(4),w(5,"async"),s(6,"div",1)(7,"label",2),v(8,"Channel"),d(),s(9,"multiwarehouse-tree-select",3),S("onChannelChange",function(t){return p(i),h(e.onChannelChange(t))}),d()(),s(10,"div",1)(11,"filter-query-type",4),T("numberFilterComparatorChange",function(t){return p(i),I(e.searchFilter.NumberFilterComparator,t)||(e.searchFilter.NumberFilterComparator=t),h(t)})("searchTypeChange",function(t){return p(i),I(e.searchFilter.SearchType,t)||(e.searchFilter.SearchType=t),h(t)}),d()(),s(12,"div",1)(13,"label",5),v(14,"PageNumber"),d(),s(15,"input",6),T("ngModelChange",function(t){return p(i),I(e.searchFilter.PageNumber,t)||(e.searchFilter.PageNumber=t),h(t)}),d()(),s(16,"div")(17,"label",7),v(18,"Page Size"),d(),s(19,"input",8),T("ngModelChange",function(t){return p(i),I(e.searchFilter.RowCount,t)||(e.searchFilter.RowCount=t),h(t)}),d()()(),s(20,"content")(21,"div",9)(22,"div",10)(23,"div",11),F(24,we,1,4,"app-table",12),w(25,"async"),s(26,"infinite-paginator",13),w(27,"async"),S("onNextPage",function(){return p(i),h(e.paginationService.onNextPage(e.searchFilter))})("onLastPage",function(){return p(i),h(e.paginationService.onLastPage(e.searchFilter))})("onGetRowCount",function(){return p(i),h(e.paginationService.getRowCount(e.searchFilter))}),d()()()()()()}if(r&2){let i,o;f("hideSearchBox",!1)("searchBoxPlaceHolder",e.searchPlaceholder()),C(),M((i=P(2,17,e.paginationService.data$))?1:-1,i);let t=P(5,19,e.loader$);C(8),f("multiple",!0),C(2),f("numberFilterComparatorOptions",t==null||t.Options==null?null:t.Options.SearchComparatorTypeOptions),b("numberFilterComparator",e.searchFilter.NumberFilterComparator),f("searchTypeOptions",t==null||t.Options==null?null:t.Options.SearchSKUOnlyOrSKUNameOptions),b("searchType",e.searchFilter.SearchType),C(4),b("ngModel",e.searchFilter.PageNumber),C(4),b("ngModel",e.searchFilter.RowCount),C(5),M((o=P(25,21,e.paginationService.data$))?24:-1,o),C(2),f("totalData",e.paginationService.totalData())("hideCount",e.paginationService.hideCount())("rowCount",P(27,23,e.paginationService.totalRowCount$))("pageNumber",e.paginationService.pageNumber())("disableNextButton",e.paginationService.disableNextButton())("goToLastPage",e.paginationService.isLastPage())}},dependencies:[Y,pe,ge,le,ie,ae,oe,re,fe,Se,te,ee,he,ue,X],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let a=l;return a})();export{st as MultiChannelComparison};
@@ -1 +1 @@
1
- import{b as w}from"./chunk-JLDXWNDU.js";import"./chunk-A6QXXKPR.js";import{b as k}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import"./chunk-UEXWQT5J.js";import"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import"./chunk-2OKZEOBU.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import"./chunk-UPRDDI4K.js";import"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import"./chunk-D6JH2KV4.js";import{b as T,e as P,g as R}from"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{A as g,B as M,w as y,y as I}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{Hb as E,Nc as i,Oc as l,Pc as D,aa as C,ac as m,cc as p,hc as _,ic as t,id as v,jc as e,jd as b,kd as x,ob as d,ra as u,v as h,yc as f}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";function B(a,o){if(a&1&&(t(0,"div",9)(1,"div",12)(2,"div",6)(3,"h5"),i(4,"Perflog"),e()(),t(5,"div",7)(6,"div",13)(7,"div",14)(8,"pre"),i(9),e()()()()()()),a&2){let n=f();d(9),l(n.Perflog)}}function L(a,o){if(a&1&&(t(0,"div",15)(1,"div",12)(2,"div",6)(3,"h5"),i(4,"StackTrace"),e()(),t(5,"div",7)(6,"div",13)(7,"div",14)(8,"pre"),i(9),e()()()()()()),a&2){let n=f();d(9),l(n==null?null:n.StackTrace)}}function N(a,o){if(a&1&&(t(0,"mainpanel",0)(1,"actions")(2,"a",1),i(3,"Back"),e()(),t(4,"content")(5,"div",2)(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"h5"),i(11,"General"),e()(),t(12,"div",7)(13,"div",8)(14,"div",9)(15,"div",10)(16,"label"),i(17,"Created Date"),e(),t(18,"div")(19,"span"),i(20),v(21,"date"),e()()()(),t(22,"div",9)(23,"div",10)(24,"label"),i(25,"Status"),e(),t(26,"div")(27,"span"),i(28),e()()()()(),t(29,"div",11)(30,"div",9)(31,"div",10)(32,"label"),i(33,"Duration"),e(),t(34,"div")(35,"span"),i(36),v(37,"number"),e()()()(),t(38,"div",9)(39,"div",10)(40,"label"),i(41,"Label"),e(),t(42,"div")(43,"span"),i(44),e()()()()()()()()(),t(45,"div",3)(46,"div",9)(47,"div",12)(48,"div",6)(49,"h5"),i(50,"Message"),e()(),t(51,"div",7)(52,"div",13)(53,"div",14)(54,"pre"),i(55),e()()()()()(),m(56,B,10,1,"div",9),m(57,L,10,1,"div",15),e()()()()),a&2){let n=o;_("headerTitle","Notification "+n.Name)("hideSearchBox",!0)("hideSearchDropdown",!0),d(20),l(x(21,10,n.Created,"dd MMM yyyy HH:mm:ss")),d(8),l(n.StatusLabel),d(8),D("",x(37,13,n.DurationInSecond,"1.1-1")," s"),d(8),l(n.Label),d(11),l(n.Message),d(),p(n!=null&&n.Perflog?56:-1),d(),p(n!=null&&n.StackTrace?57:-1)}}var Q=(()=>{let o=class o{constructor(){this.activatedRoute=u(T),this.notificationService=u(w)}ngOnInit(){this.notification$=this.activatedRoute.queryParams.pipe(C(s=>{let r=s.ID;return this.notificationService.getNotificationDetail(r).pipe(h(c=>(c.DurationInSecond=parseInt(c.Duration)/1e3,c)))}))}};o.\u0275fac=function(r){return new(r||o)},o.\u0275cmp=E({type:o,selectors:[["app-detail"]],decls:2,vars:3,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/products/status/notification",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-8"],[1,"row"],[1,"col-12"],[1,"card","mb-8"],[1,"card-header"],[1,"card-body"],[1,"row","mt-6"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-4"],[1,"card"],[1,"col-sm-12","mt-2"],[1,"form-group"],[1,"col-sm-12"]],template:function(r,c){if(r&1&&(m(0,N,58,16,"mainpanel",0),v(1,"async")),r&2){let S;p((S=b(1,1,c.notification$))?0:-1,S)}},dependencies:[M,k,R,P,y,g,I],encapsulation:2});let a=o;return a})();export{Q as DetailComponent};
1
+ import{b as w}from"./chunk-KHGTW7IV.js";import"./chunk-A6QXXKPR.js";import{b as k}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import"./chunk-UEXWQT5J.js";import"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import"./chunk-J4552BMI.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import"./chunk-UPRDDI4K.js";import"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import"./chunk-D6JH2KV4.js";import{b as T,e as P,g as R}from"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{A as g,B as M,w as y,y as I}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{Hb as E,Nc as i,Oc as l,Pc as D,aa as C,ac as m,cc as p,hc as _,ic as t,id as v,jc as e,jd as b,kd as x,ob as d,ra as u,v as h,yc as f}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";function B(a,o){if(a&1&&(t(0,"div",9)(1,"div",12)(2,"div",6)(3,"h5"),i(4,"Perflog"),e()(),t(5,"div",7)(6,"div",13)(7,"div",14)(8,"pre"),i(9),e()()()()()()),a&2){let n=f();d(9),l(n.Perflog)}}function L(a,o){if(a&1&&(t(0,"div",15)(1,"div",12)(2,"div",6)(3,"h5"),i(4,"StackTrace"),e()(),t(5,"div",7)(6,"div",13)(7,"div",14)(8,"pre"),i(9),e()()()()()()),a&2){let n=f();d(9),l(n==null?null:n.StackTrace)}}function N(a,o){if(a&1&&(t(0,"mainpanel",0)(1,"actions")(2,"a",1),i(3,"Back"),e()(),t(4,"content")(5,"div",2)(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"h5"),i(11,"General"),e()(),t(12,"div",7)(13,"div",8)(14,"div",9)(15,"div",10)(16,"label"),i(17,"Created Date"),e(),t(18,"div")(19,"span"),i(20),v(21,"date"),e()()()(),t(22,"div",9)(23,"div",10)(24,"label"),i(25,"Status"),e(),t(26,"div")(27,"span"),i(28),e()()()()(),t(29,"div",11)(30,"div",9)(31,"div",10)(32,"label"),i(33,"Duration"),e(),t(34,"div")(35,"span"),i(36),v(37,"number"),e()()()(),t(38,"div",9)(39,"div",10)(40,"label"),i(41,"Label"),e(),t(42,"div")(43,"span"),i(44),e()()()()()()()()(),t(45,"div",3)(46,"div",9)(47,"div",12)(48,"div",6)(49,"h5"),i(50,"Message"),e()(),t(51,"div",7)(52,"div",13)(53,"div",14)(54,"pre"),i(55),e()()()()()(),m(56,B,10,1,"div",9),m(57,L,10,1,"div",15),e()()()()),a&2){let n=o;_("headerTitle","Notification "+n.Name)("hideSearchBox",!0)("hideSearchDropdown",!0),d(20),l(x(21,10,n.Created,"dd MMM yyyy HH:mm:ss")),d(8),l(n.StatusLabel),d(8),D("",x(37,13,n.DurationInSecond,"1.1-1")," s"),d(8),l(n.Label),d(11),l(n.Message),d(),p(n!=null&&n.Perflog?56:-1),d(),p(n!=null&&n.StackTrace?57:-1)}}var Q=(()=>{let o=class o{constructor(){this.activatedRoute=u(T),this.notificationService=u(w)}ngOnInit(){this.notification$=this.activatedRoute.queryParams.pipe(C(s=>{let r=s.ID;return this.notificationService.getNotificationDetail(r).pipe(h(c=>(c.DurationInSecond=parseInt(c.Duration)/1e3,c)))}))}};o.\u0275fac=function(r){return new(r||o)},o.\u0275cmp=E({type:o,selectors:[["app-detail"]],decls:2,vars:3,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/products/status/notification",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-8"],[1,"row"],[1,"col-12"],[1,"card","mb-8"],[1,"card-header"],[1,"card-body"],[1,"row","mt-6"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-4"],[1,"card"],[1,"col-sm-12","mt-2"],[1,"form-group"],[1,"col-sm-12"]],template:function(r,c){if(r&1&&(m(0,N,58,16,"mainpanel",0),v(1,"async")),r&2){let S;p((S=b(1,1,c.notification$))?0:-1,S)}},dependencies:[M,k,R,P,y,g,I],encapsulation:2});let a=o;return a})();export{Q as DetailComponent};
@@ -1 +1 @@
1
- import{a as pe}from"./chunk-JWDQVXQP.js";import{a as de,b as me}from"./chunk-K5WSFDNA.js";import{a as ce}from"./chunk-FBXKHJ2G.js";import{a as P}from"./chunk-L6CRWJ2O.js";import{a as se}from"./chunk-PV4OJSZI.js";import{a as le}from"./chunk-3PUUKJCQ.js";import"./chunk-VVNLTDLG.js";import"./chunk-OHAT7WXU.js";import"./chunk-L4EPB2CQ.js";import"./chunk-GNXSEYJF.js";import{a as oe}from"./chunk-ZZYFVEJO.js";import"./chunk-DLHIDOS3.js";import{a as ae}from"./chunk-27DIE2YS.js";import"./chunk-JU4ZP3HI.js";import"./chunk-3T5VLB63.js";import"./chunk-STOW2RQN.js";import"./chunk-GLBJ4Y4T.js";import"./chunk-XTNXL2IY.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import"./chunk-A6QXXKPR.js";import"./chunk-6Q4BDCI5.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{b as re}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import{a as ne}from"./chunk-UEXWQT5J.js";import"./chunk-3SCX7IMW.js";import"./chunk-K4Q33QIR.js";import"./chunk-JRCXHF2X.js";import"./chunk-M27MYADT.js";import"./chunk-TBVMCNS2.js";import"./chunk-RM6ZXD3O.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-3RK6DDJD.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-NJNRUDU6.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import"./chunk-JTKEMQZT.js";import{c as ie}from"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import"./chunk-2OKZEOBU.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import"./chunk-UPRDDI4K.js";import{A as te,c as Y,h as Z,m as $,o as ee}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import"./chunk-D6JH2KV4.js";import"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{A as Q,B as X,w as J,y as K}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{$c as U,Hb as D,Ia as F,Mc as z,Nc as l,Oc as w,Pc as x,Rc as f,Sc as S,Tc as C,Uc as A,Vc as R,Wc as H,_c as j,ac as b,ad as q,cc as V,dc as I,fc as B,gc as k,hc as g,ic as t,id as y,jc as i,jd as E,kc as _,kd as G,mb as W,ob as r,ra as O,rc as M,wc as T,ya as s,yc as h,za as c}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import{a as L,b as N}from"./chunk-66YHNWRR.js";var ue=()=>[],_e=a=>({"td-cell-hover":a});function ge(a,p){if(a&1&&_(0,"variants-dropdown",31),a&2){let e=h().$implicit;g("variants",e==null?null:e.Variants)}}function he(a,p){if(a&1&&_(0,"variant-with-image",32),a&2){let e=h().$implicit;g("variant",e==null?null:e.Variants[0])}}function fe(a,p){if(a&1&&(t(0,"span"),l(1),i()),a&2){let e=h().$implicit;r(),x("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function Se(a,p){if(a&1&&(t(0,"tr")(1,"td")(2,"div",24),_(3,"img",25),y(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"),_(14,"order-link",29),i(),t(15,"small"),l(16),y(17,"date"),i(),_(18,"br"),t(19,"small"),_(20,"i",30),l(21),i()()(),t(22,"td"),b(23,ge,1,1,"variants-dropdown",31)(24,he,1,1,"variant-with-image",32),i(),t(25,"td",33),l(26),y(27,"number"),i(),t(28,"td")(29,"div",28)(30,"div",34)(31,"span"),l(32),i(),b(33,fe,2,1,"span"),i(),t(34,"small"),l(35),i()()()()),a&2){let e=p.$implicit;r(3),g("src",E(4,14,e==null?null:e.MarketType),W)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),r(4),w(e.Outlet),r(3),w(e.ChannelName),r(4),g("order",e),r(2),x(" ",G(17,16,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),r(5),x(" ",e.Customer," "),r(),z(q(21,_e,(e.Variants==null?null:e.Variants.length)>1)),r(),V((e.Variants==null?null:e.Variants.length)>1?23:24),r(3),w(E(27,19,e.Amount)),r(6),w(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),r(),V(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?33:-1),r(2),x(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," ")}}function Ce(a,p){if(a&1){let e=M();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"),B(15,Se,36,23,"tr",null,I),i()(),t(17,"app-custom-paginator",23),T("next",function(){s(e);let m=h();return c(m.initShippedOrders())})("previous",function(){s(e);let m=h();return c(m.initShippedOrders())}),i()()}if(a&2){let e=h(),d=H(0);r(15),k(d),r(2),g("filter",e.filter())("totaldata",d==null?null:d.length)}}function ve(a,p){a&1&&(t(0,"div",16),_(1,"app-empty-state"),i())}var Re=(()=>{let p=class p{constructor(){this.orderService=O(P),this.filter=F({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:d=>{this.initFromDate(d)},error:d=>{console.error("Error fetching default date:",d),this.initFromDate(null)}})}initFromDate(d){this.filter.update(m=>N(L({},m),{From:d})),this.initShippedOrders()}initShippedOrders(){this.shippedOrders$=this.orderService.getShippedOrders(this.filter())}};p.\u0275fac=function(m){return new(m||p)},p.\u0275cmp=D({type:p,selectors:[["app-shipped"]],features:[j([P])],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(m,o){if(m&1){let u=M();A(0),y(1,"async"),t(2,"mainpanel",0),T("onSubmit",function(){return s(u),c(o.initShippedOrders())}),C("textChange",function(n){return s(u),S(o.filter().Number,n)||(o.filter().Number=n),c(n)}),t(3,"actions")(4,"a",1),_(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),C("ngModelChange",function(n){return s(u),S(o.filter().ListChannelID,n)||(o.filter().ListChannelID=n),c(n)}),i()(),t(13,"div",5)(14,"label",3),l(15,"From/To"),i(),t(16,"div",6)(17,"datepicker",7),C("dateChange",function(n){return s(u),S(o.filter().From,n)||(o.filter().From=n),c(n)}),i()(),t(18,"div")(19,"datepicker",8),C("dateChange",function(n){return s(u),S(o.filter().To,n)||(o.filter().To=n),c(n)}),i()()(),t(20,"div",5)(21,"label",9),l(22,"Page Number"),i(),t(23,"input",10),C("ngModelChange",function(n){return s(u),S(o.filter().PageNumber,n)||(o.filter().PageNumber=n),c(n)}),i()(),t(24,"div",5)(25,"label",9),l(26,"Page Size"),i(),t(27,"input",11),C("ngModelChange",function(n){return s(u),S(o.filter().PageSize,n)||(o.filter().PageSize=n),c(n)}),i()()(),t(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),b(32,Ce,18,2,"div",15)(33,ve,2,0,"div",16),i()()()()()}if(m&2){let u=R(E(1,8,o.shippedOrders$)||U(11,ue));r(2),f("text",o.filter().Number),r(10),g("multiple",!0),f("ngModel",o.filter().ListChannelID),r(5),f("date",o.filter().From),r(2),f("date",o.filter().To),r(4),f("ngModel",o.filter().PageNumber),r(4),f("ngModel",o.filter().PageSize),r(5),V(u.length>0?32:33)}},dependencies:[X,re,ae,oe,te,Y,ee,Z,$,de,me,se,ne,ie,ce,le,J,Q,K,pe],encapsulation:2});let a=p;return a})();export{Re as ShippedComponent};
1
+ import{a as pe}from"./chunk-JWDQVXQP.js";import{a as de,b as me}from"./chunk-K5WSFDNA.js";import{a as ce}from"./chunk-DOQD3RMB.js";import{a as P}from"./chunk-L6CRWJ2O.js";import{a as se}from"./chunk-PV4OJSZI.js";import{a as le}from"./chunk-QUIZLT5F.js";import"./chunk-VVNLTDLG.js";import"./chunk-OHAT7WXU.js";import"./chunk-L4EPB2CQ.js";import"./chunk-GNXSEYJF.js";import{a as oe}from"./chunk-ZZYFVEJO.js";import"./chunk-DLHIDOS3.js";import{a as ae}from"./chunk-27DIE2YS.js";import"./chunk-JU4ZP3HI.js";import"./chunk-3T5VLB63.js";import"./chunk-STOW2RQN.js";import"./chunk-GLBJ4Y4T.js";import"./chunk-XTNXL2IY.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import"./chunk-A6QXXKPR.js";import"./chunk-6Q4BDCI5.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{b as re}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import{a as ne}from"./chunk-UEXWQT5J.js";import"./chunk-3SCX7IMW.js";import"./chunk-K4Q33QIR.js";import"./chunk-JRCXHF2X.js";import"./chunk-M27MYADT.js";import"./chunk-TBVMCNS2.js";import"./chunk-RM6ZXD3O.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-3RK6DDJD.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-NJNRUDU6.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import"./chunk-JTKEMQZT.js";import{c as ie}from"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import"./chunk-J4552BMI.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import"./chunk-UPRDDI4K.js";import{A as te,c as Y,h as Z,m as $,o as ee}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import"./chunk-D6JH2KV4.js";import"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{A as Q,B as X,w as J,y as K}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{$c as U,Hb as D,Ia as F,Mc as z,Nc as l,Oc as w,Pc as x,Rc as f,Sc as S,Tc as C,Uc as A,Vc as R,Wc as H,_c as j,ac as b,ad as q,cc as V,dc as I,fc as B,gc as k,hc as g,ic as t,id as y,jc as i,jd as E,kc as _,kd as G,mb as W,ob as r,ra as O,rc as M,wc as T,ya as s,yc as h,za as c}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import{a as L,b as N}from"./chunk-66YHNWRR.js";var ue=()=>[],_e=a=>({"td-cell-hover":a});function ge(a,p){if(a&1&&_(0,"variants-dropdown",31),a&2){let e=h().$implicit;g("variants",e==null?null:e.Variants)}}function he(a,p){if(a&1&&_(0,"variant-with-image",32),a&2){let e=h().$implicit;g("variant",e==null?null:e.Variants[0])}}function fe(a,p){if(a&1&&(t(0,"span"),l(1),i()),a&2){let e=h().$implicit;r(),x("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function Se(a,p){if(a&1&&(t(0,"tr")(1,"td")(2,"div",24),_(3,"img",25),y(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"),_(14,"order-link",29),i(),t(15,"small"),l(16),y(17,"date"),i(),_(18,"br"),t(19,"small"),_(20,"i",30),l(21),i()()(),t(22,"td"),b(23,ge,1,1,"variants-dropdown",31)(24,he,1,1,"variant-with-image",32),i(),t(25,"td",33),l(26),y(27,"number"),i(),t(28,"td")(29,"div",28)(30,"div",34)(31,"span"),l(32),i(),b(33,fe,2,1,"span"),i(),t(34,"small"),l(35),i()()()()),a&2){let e=p.$implicit;r(3),g("src",E(4,14,e==null?null:e.MarketType),W)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),r(4),w(e.Outlet),r(3),w(e.ChannelName),r(4),g("order",e),r(2),x(" ",G(17,16,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),r(5),x(" ",e.Customer," "),r(),z(q(21,_e,(e.Variants==null?null:e.Variants.length)>1)),r(),V((e.Variants==null?null:e.Variants.length)>1?23:24),r(3),w(E(27,19,e.Amount)),r(6),w(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),r(),V(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?33:-1),r(2),x(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," ")}}function Ce(a,p){if(a&1){let e=M();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"),B(15,Se,36,23,"tr",null,I),i()(),t(17,"app-custom-paginator",23),T("next",function(){s(e);let m=h();return c(m.initShippedOrders())})("previous",function(){s(e);let m=h();return c(m.initShippedOrders())}),i()()}if(a&2){let e=h(),d=H(0);r(15),k(d),r(2),g("filter",e.filter())("totaldata",d==null?null:d.length)}}function ve(a,p){a&1&&(t(0,"div",16),_(1,"app-empty-state"),i())}var Re=(()=>{let p=class p{constructor(){this.orderService=O(P),this.filter=F({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:d=>{this.initFromDate(d)},error:d=>{console.error("Error fetching default date:",d),this.initFromDate(null)}})}initFromDate(d){this.filter.update(m=>N(L({},m),{From:d})),this.initShippedOrders()}initShippedOrders(){this.shippedOrders$=this.orderService.getShippedOrders(this.filter())}};p.\u0275fac=function(m){return new(m||p)},p.\u0275cmp=D({type:p,selectors:[["app-shipped"]],features:[j([P])],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(m,o){if(m&1){let u=M();A(0),y(1,"async"),t(2,"mainpanel",0),T("onSubmit",function(){return s(u),c(o.initShippedOrders())}),C("textChange",function(n){return s(u),S(o.filter().Number,n)||(o.filter().Number=n),c(n)}),t(3,"actions")(4,"a",1),_(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),C("ngModelChange",function(n){return s(u),S(o.filter().ListChannelID,n)||(o.filter().ListChannelID=n),c(n)}),i()(),t(13,"div",5)(14,"label",3),l(15,"From/To"),i(),t(16,"div",6)(17,"datepicker",7),C("dateChange",function(n){return s(u),S(o.filter().From,n)||(o.filter().From=n),c(n)}),i()(),t(18,"div")(19,"datepicker",8),C("dateChange",function(n){return s(u),S(o.filter().To,n)||(o.filter().To=n),c(n)}),i()()(),t(20,"div",5)(21,"label",9),l(22,"Page Number"),i(),t(23,"input",10),C("ngModelChange",function(n){return s(u),S(o.filter().PageNumber,n)||(o.filter().PageNumber=n),c(n)}),i()(),t(24,"div",5)(25,"label",9),l(26,"Page Size"),i(),t(27,"input",11),C("ngModelChange",function(n){return s(u),S(o.filter().PageSize,n)||(o.filter().PageSize=n),c(n)}),i()()(),t(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),b(32,Ce,18,2,"div",15)(33,ve,2,0,"div",16),i()()()()()}if(m&2){let u=R(E(1,8,o.shippedOrders$)||U(11,ue));r(2),f("text",o.filter().Number),r(10),g("multiple",!0),f("ngModel",o.filter().ListChannelID),r(5),f("date",o.filter().From),r(2),f("date",o.filter().To),r(4),f("ngModel",o.filter().PageNumber),r(4),f("ngModel",o.filter().PageSize),r(5),V(u.length>0?32:33)}},dependencies:[X,re,ae,oe,te,Y,ee,Z,$,de,me,se,ne,ie,ce,le,J,Q,K,pe],encapsulation:2});let a=p;return a})();export{Re as ShippedComponent};
@@ -0,0 +1 @@
1
+ import{a as e}from"./chunk-WZQRKTBN.js";import{a as d,b as v}from"./chunk-75IM3UUA.js";import"./chunk-UEXWQT5J.js";import"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import"./chunk-J4552BMI.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import"./chunk-UPRDDI4K.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import"./chunk-D6JH2KV4.js";import{c as m}from"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{Hb as a,hc as l,ic as c,jc as p,kc as r,ob as i}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var s=(()=>{let n=class n{constructor(){this.reportTabs=[{Title:"1.Create Order",Url:"/menu/sync-log/sync-order"},{Title:"2.Convert Order To Invoice",Url:"/menu/sync-log/convert-to-invoice"},{Title:"3.Create Invoice",Url:"/menu/sync-log/invoice"},{Title:"4.Create Outbound Logistic",Url:"/menu/sync-log/delivery"},{Title:"5.Add Payment",Url:"/menu/sync-log/payment"},{Title:"6.Void Invoice",Url:"/menu/sync-log/void-invoice"},{Title:"All",Url:"/menu/sync-log/all"}]}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=a({type:n,selectors:[["app-order"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(o,y){o&1&&(c(0,"nav",0)(1,"div",1)(2,"div"),r(3,"nav-tab",2),p()()(),r(4,"router-outlet")),o&2&&(i(3),l("Tabs",y.reportTabs))},dependencies:[v,d,m],styles:[".dropdown[_ngcontent-%COMP%] .dropdown-menu.report.show[_ngcontent-%COMP%]{top:100%!important;transform:none!important;z-index:10000;cursor:pointer;right:-50%}"]});let t=n;return t})();var O=[{path:"",component:s,children:[{path:"",redirectTo:"all",pathMatch:"full"},{path:"sync-order",loadComponent(){return import("./chunk-RZXE2MFY.js").then(t=>t.SalesOrderComponent)},canActivate:[e],data:{title:"Sync Order"}},{path:"convert-to-invoice",loadComponent(){return import("./chunk-PCOAEOIL.js").then(t=>t.ConvertInvoiceComponent)},canActivate:[e],data:{title:"Sync Convert to Invoice"}},{path:"invoice",loadComponent(){return import("./chunk-MHIYVGFS.js").then(t=>t.InvoiceComponent)},canActivate:[e],data:{title:"Sync Invoice"}},{path:"delivery",loadComponent(){return import("./chunk-2ZKHC4YC.js").then(t=>t.DeliveryComponent)},canActivate:[e],data:{title:"Sync Delivery"}},{path:"payment",loadComponent(){return import("./chunk-2Y3L7QOV.js").then(t=>t.PaymentComponent)},canActivate:[e],data:{title:"Sync Payment"}},{path:"void-invoice",loadComponent(){return import("./chunk-Z4RYN6X5.js").then(t=>t.VoidInvoiceComponent)},canActivate:[e],data:{title:"Sync void invoice"}},{path:"all",loadComponent(){return import("./chunk-YZQDWPFY.js").then(t=>t.AllComponent)},canActivate:[e],data:{title:"All Report"}}]}];export{O as routes};
@@ -1 +1 @@
1
- import{a as zt}from"./chunk-E7LOFZQV.js";import"./chunk-YLQBIIZH.js";import{b as Xt}from"./chunk-7T5DBPDP.js";import"./chunk-OH5T7D7O.js";import{a as Kt,b as Jt}from"./chunk-FH2KAM6J.js";import{a as Yt}from"./chunk-YKKHSYDW.js";import{a as Ht}from"./chunk-WTHYLNPX.js";import{a as ct,b as Gt,c as jt,d as mt,e as pt}from"./chunk-KNE2UYQ2.js";import"./chunk-TQROQOXU.js";import{a as Wt}from"./chunk-IQGRGC3E.js";import{d as R,e as B}from"./chunk-BZWZ64N5.js";import"./chunk-OHAT7WXU.js";import"./chunk-L4EPB2CQ.js";import"./chunk-GNXSEYJF.js";import"./chunk-DLHIDOS3.js";import"./chunk-FPJTI4LM.js";import"./chunk-STOW2RQN.js";import"./chunk-GLBJ4Y4T.js";import"./chunk-XTNXL2IY.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import"./chunk-JLDXWNDU.js";import"./chunk-A6QXXKPR.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{b as Bt}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import{a as Rt}from"./chunk-UEXWQT5J.js";import{b as qt,c as Qt}from"./chunk-RPHZK33A.js";import"./chunk-3SCX7IMW.js";import"./chunk-JHSG3KRS.js";import"./chunk-K4Q33QIR.js";import"./chunk-JRCXHF2X.js";import"./chunk-M27MYADT.js";import"./chunk-TBVMCNS2.js";import"./chunk-RM6ZXD3O.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-3RK6DDJD.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-NJNRUDU6.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import"./chunk-JTKEMQZT.js";import{c as $t}from"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import"./chunk-ZSUWHVKX.js";import"./chunk-2OKZEOBU.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import{b as Ct,c as h}from"./chunk-UPRDDI4K.js";import{A as et,B as $,c as tt,e as nt,h as L,i as W,l as st,m as Mt,n as Y,q as H,r as wt,s as X,t as Vt,u as Ut,v as Lt,z as K}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{b as Dt,e as Z}from"./chunk-D6JH2KV4.js";import"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{B as A,w as S}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{$ as Pt,$c as lt,Hb as x,K as At,M as Ft,Nc as f,Oa as D,Oc as at,Pc as q,Rc as Et,Sc as Nt,Tc as Ot,Z as z,_c as I,ac as C,ca as ht,cc as g,dc as w,ea as E,f as St,fc as V,gc as U,hc as d,ic as c,id as v,jc as s,jd as T,kc as _,ma as N,ob as p,ra as u,rc as j,tb as M,td as kt,ud as b,v as P,wc as F,ya as O,yc as l,za as k}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var J=(function(t){return t[t.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",t[t.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",t[t.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",t[t.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",t[t.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",t})(J||{});var it=(function(t){return t[t.FORMAT_NORMAL=1]="FORMAT_NORMAL",t[t.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",t})(it||{});var ot=(function(t){return t[t.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",t[t.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",t[t.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",t[t.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",t[t.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",t})(ot||{});var gt=class extends st{setValue(r,i){if(r instanceof Date){let n=Math.floor(r.getTime()/1e3);super.setValue(n,i)}else super.setValue(r,i)}},bt=(()=>{let r=class r{constructor(){this.shopeeUploadService=u(ct),this.formBuilder=u(K)}getAttributes(n){return this.shopeeUploadService.getAttributes(n.channelId,n.categoryId).pipe(P(e=>this.setLabelToIndonesian(e)))}setLabelToIndonesian(n=[]){let e,a;return n=n.map(o=>(e=o?.multi_lang?.find(m=>m.language=="id"),o.attribute_value_list=o?.attribute_value_list?.map(m=>(a=m?.multi_lang?.find(y=>y.language=="id"),m.name=a?.value,m)),o.name=e?.value?e?.value:o.name,o)),n}createFormGroup(n){let e=this.formBuilder.group({}),a=[];return n.forEach(o=>{if(a=[],o.mandatory&&a.push(nt.required),o?.attribute_info?.format_type==it.FORMAT_QUANTITATIVE_WITH_UNIT&&o?.attribute_info?.input_type==J.FREE_TEXT_FILED){let m=this.formBuilder.group({unit:new st(null),value:new st(null,a)});e.addControl(JSON.stringify(o.attribute_id),m)}else o?.attribute_info?.input_type==J.FREE_TEXT_FILED&&o?.attribute_info?.input_validation_type==ot.VALIDATOR_DATE_TYPE?e.addControl(JSON.stringify(o.attribute_id),new gt(null,a)):e.addControl(JSON.stringify(o.attribute_id),this.formBuilder.control(null,a))}),e}getFilteredAttributes(n,e){let a=JSON.parse(JSON.stringify(n)),o=Object.keys(e),m=a.filter(y=>o.findIndex(ft=>parseInt(ft)==y.attribute_id||y.mandatory)!=-1);return m=this.filterSelectedAttributes(m,e),m}filterSelectedAttributes(n,e){return n.map(o=>{switch(o.attribute_info.input_type){case J.MULTI_COMBO_BOX:h.IsNotEmpty(e[o.attribute_id])?o.attribute_value_list=o.attribute_value_list.filter(m=>e[o.attribute_id]?.findIndex(y=>y==m.value_id)!=-1):o.attribute_value_list=[];break;case J.FREE_TEXT_FILED:o.attribute_info.format_type==it.FORMAT_QUANTITATIVE_WITH_UNIT?o.attribute_value_list=this.setSelectedQuantitativeAttr(e[o.attribute_id]?.value,e[o.attribute_id]?.unit):o.attribute_info.input_validation_type==ot.VALIDATOR_DATE_TYPE?o.attribute_value_list=this.setSelectedDateAttr(e[o.attribute_id]):o.attribute_value_list=this.setSelectedQuantitativeAttr(e[o.attribute_id]);break;default:o.attribute_value_list=o.attribute_value_list.filter(m=>m.value_id==e[o.attribute_id])}return o}).filter(o=>o?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(n,e){let a=[];if(h.IsNotEmpty(n)){let o={value_id:0,original_value_name:JSON.stringify(n)};h.IsNotEmpty(e)&&(o.value_unit=e),a=[o]}return a}setSelectedDateAttr(n){let e=[];return h.IsNotEmpty(n)&&(e=[{value_id:0,original_value_name:JSON.stringify(n)}]),e}};r.\u0275fac=function(e){return new(e||r)},r.\u0275prov=N({token:r,factory:r.\u0275fac});let t=r;return t})();var yt=()=>[];function ne(t,r){t&1&&(c(0,"span",4),f(1,"*"),s())}function re(t,r){if(t&1&&_(0,"ng-select",5),t&2){let i=l().$implicit;d("multiple",!0)("formControlName",i.attribute_id)("items",i.attribute_value_list?i.attribute_value_list:lt(4,yt))("placeholder","Pilih "+(i==null?null:i.name))}}function ae(t,r){if(t&1&&_(0,"input",7),t&2){let i=l(2).$implicit;d("formControlName",i.attribute_id)("placeholder","Isi "+(i==null?null:i.name))}}function le(t,r){if(t&1&&(c(0,"option",14),f(1),s()),t&2){let i=r.$implicit;d("value",i),p(),at(i)}}function se(t,r){if(t&1&&(c(0,"div",9),_(1,"input",11),c(2,"select",12)(3,"option",13),f(4,"Unit"),s(),V(5,le,2,2,"option",14,w),s()()),t&2){let i=l(3).$implicit;d("formGroupName",i.attribute_id),p(),d("placeholder","Isi "+(i==null?null:i.name)),p(2),d("value",null),p(2),U(i==null||i.attribute_info==null?null:i.attribute_info.attribute_unit_list)}}function ce(t,r){if(t&1&&_(0,"input",10),t&2){let i=l(3).$implicit;d("formControlName",i.attribute_id)("placeholder","Isi "+(i==null?null:i.name))}}function me(t,r){if(t&1&&C(0,se,7,3,"div",9)(1,ce,1,2,"input",10),t&2){let i=l(2).$implicit,n=l(2);g((i==null||i.attribute_info==null?null:i.attribute_info.format_type)==n.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function pe(t,r){if(t&1&&_(0,"datepicker",8),t&2){let i=l(2).$implicit;d("formControlName",i.attribute_id)}}function de(t,r){if(t&1&&C(0,ae,1,2,"input",7)(1,me,2,1)(2,pe,1,1,"datepicker",8),t&2){let i,n=l().$implicit,e=l(2);g((i=n==null||n.attribute_info==null?null:n.attribute_info.input_validation_type)===e.validationType.VALIDATOR_STRING_TYPE?0:i===e.validationType.VALIDATOR_FLOAT_TYPE?1:i===e.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function ue(t,r){if(t&1&&_(0,"ng-select",6),t&2){let i=l().$implicit;d("formControlName",i.attribute_id)("items",i.attribute_value_list?i.attribute_value_list:lt(3,yt))("placeholder","Pilih "+(i==null?null:i.name))}}function _e(t,r){if(t&1&&_(0,"ng-select",6),t&2){let i=l().$implicit;d("formControlName",i.attribute_id)("items",i.attribute_value_list?i.attribute_value_list:lt(3,yt))("placeholder","Pilih "+(i==null?null:i.name))}}function fe(t,r){if(t&1&&(c(0,"div",2)(1,"div",3),C(2,ne,2,0,"span",4),c(3,"span"),f(4),s()(),C(5,re,1,5,"ng-select",5)(6,de,3,1)(7,ue,1,4,"ng-select",6)(8,_e,1,4,"ng-select",6),s()),t&2){let i,n=r.$implicit,e=l(2);p(2),g(n.mandatory?2:-1),p(2),q(" ",n==null?null:n.name," "),p(),g((i=n==null||n.attribute_info==null?null:n.attribute_info.input_type)===e.inputType.MULTI_COMBO_BOX?5:i===e.inputType.FREE_TEXT_FILED?6:i===e.inputType.SINGLE_COMBO_BOX?7:8)}}function he(t,r){if(t&1&&(c(0,"form",0)(1,"div",1),V(2,fe,9,3,"div",2,w),s()()),t&2){let i=l();d("formGroup",i.form),p(2),U(r)}}var Zt=(()=>{let r=class r{constructor(){this.formCategoryService=u(bt),this.channelType=b(void 0),this.categoryId=b(void 0),this.channelId=b(void 0),this.channelProductUpload=b(void 0),this.attributesChanges=new M,this.inputType=J,this.formatType=it,this.validationType=ot}ngOnChanges(){let n=this.categoryId(),e=this.channelId();h.IsNotEmpty(n)&&h.IsNotEmpty(e)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:n,channelId:e,channelType:this.channelType()}).pipe(E(a=>{this.form=this.formCategoryService.createFormGroup(a),this.listenToFormChange(a)}),z(1)))}listenToFormChange(n){let e=[];this.formSubscription=this.form.valueChanges.subscribe(a=>{e=this.formCategoryService.getFilteredAttributes(n,a),this.attributesChanges.emit(e)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=x({type:r,selectors:[["shopee-attribute-form"]],inputs:{channelType:[1,"channelType"],categoryId:[1,"categoryId"],channelId:[1,"channelId"],channelProductUpload:[1,"channelProductUpload"]},outputs:{attributesChanges:"attributesChanges"},features:[I([bt]),D],decls:2,vars:3,consts:[[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","value_id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","value_id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"],[1,"attribute-datepicker",3,"formControlName"],[1,"d-flex","align-items-center",3,"formGroupName"],["type","text","autoNum","",1,"form-control",3,"formControlName","placeholder"],["formControlName","value","type","text","autoNum","",1,"form-control","me-1",2,"width","200px",3,"placeholder"],["name","unit","id","unit","formControlName","unit",1,"form-control"],["disabled","","selected","",3,"value"],[3,"value"]],template:function(e,a){if(e&1&&(C(0,he,4,1,"form",0),v(1,"async")),e&2){let o;g((o=T(1,1,a.attributes$))?0:-1,o)}},dependencies:[A,B,R,$,Y,Ut,Lt,tt,Vt,L,W,H,X,wt,Ht,Qt,qt,S],styles:["input[_ngcontent-%COMP%], select[_ngcontent-%COMP%]{height:36px;border-radius:4px} datepicker.attribute-datepicker>mat-form-field.mat-mdc-form-field>.mat-mdc-text-field-wrapper{height:36px} datepicker.attribute-datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{padding-top:11px!important;padding-bottom:11px!important;height:36px;min-height:36px!important} datepicker.attribute-datepicker mat-datepicker-toggle>button.mat-mdc-icon-button.mat-mdc-button-base{--mat-icon-button-state-layer-size: 36px}"]});let t=r;return t})();var Q=(function(t){return t.TIKTOK_SHOP="TIKTOK_SHOP",t.TOKOPEDIA="TOKOPEDIA",t})(Q||{});var vt=(()=>{let r=class r{constructor(){this.httpService=u(Z),this.formBuilder=u(K),this.uploadProductService=u(pt)}getAttributes(n,e){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:n},{key:"CategoryID",value:e}]).pipe(At(o=>this.uploadProductService.selectedProduct$.pipe(P(m=>(o=this.mappingAttributeSalesProperty(o,m),o)))))}mappingAttributeSalesProperty(n,e){let a=0;return n.filter(o=>(o.type=="SALES_PROPERTY"&&(a+=1),a>1?(a=0,!1):!0)).map(o=>(o.type=="SALES_PROPERTY"&&(o.name="Jenis Variant",o.is_multiple_selection=!1,o.is_required=this.isProductHasMoreVariant(e),o.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),o))}isProductHasMoreVariant(n){let e=!1,a=[];return n.forEach(o=>{o.Variants&&a.push(o.Variants.length)}),e=a.some(o=>o>1),e}createFormGroup(n){let e=this.formBuilder.group({}),a=[];return n.forEach(o=>{a=[],o.is_required&&a.push(nt.required),e.addControl(o.id,this.formBuilder.control(null,a))}),e.addControl("listingPlatform",this.formBuilder.control([Q.TIKTOK_SHOP,Q.TOKOPEDIA],[nt.required])),e}getFilteredAttributes(n,e){let a=JSON.parse(JSON.stringify(n)),o=Object.keys(e),m=a.filter(y=>o.findIndex(ft=>parseInt(ft)==y.id)!=-1);return m=this.filterSelectedAttributes(m,e),m}filterSelectedAttributes(n,e){return n.map(o=>(h.IsNotEmpty(o.values)?o.is_multiple_selection?o.values=o.values.filter(m=>e[o.id]?.includes(m.id)):o.values=o.values.filter(m=>m.id==e[o.id]):e[o.id]&&(o.values=[{id:null,name:e[o.id]}]),o)).filter(o=>o?.values?.length>0)}};r.\u0275fac=function(e){return new(e||r)},r.\u0275prov=N({token:r,factory:r.\u0275fac});let t=r;return t})();function Ce(t,r){t&1&&(c(0,"small",5),f(1," Platform is required "),s())}function ge(t,r){t&1&&(c(0,"span",5),f(1,"*"),s())}function be(t,r){if(t&1&&_(0,"ng-select",6),t&2){let i=l().$implicit;d("multiple",!0)("formControlName",i.id)("items",i.values)("placeholder","Pilih "+(i==null?null:i.name))}}function ye(t,r){if(t&1&&_(0,"ng-select",7),t&2){let i=l().$implicit;d("formControlName",i.id)("items",i.values)("placeholder","Pilih "+(i==null?null:i.name))}}function ve(t,r){if(t&1&&_(0,"input",8),t&2){let i=l().$implicit;d("formControlName",i.id)("placeholder",i==null?null:i.name)}}function Te(t,r){if(t&1&&(c(0,"small",5),f(1),s()),t&2){let i=l().$implicit;p(),q(" ",i==null?null:i.name," is mandatory ")}}function xe(t,r){if(t&1&&(c(0,"div",2)(1,"div",3),C(2,ge,2,0,"span",5),c(3,"span"),f(4),s()(),C(5,be,1,4,"ng-select",6)(6,ye,1,3,"ng-select",7)(7,ve,1,2,"input",8),C(8,Te,2,1,"small",5),s()),t&2){let i=r.$implicit;p(2),g(i.is_required?2:-1),p(2),q(" ",i==null?null:i.name," "),p(),g(i.is_multiple_selection?5:i.values!==null&&i.values.length>0?6:7),p(3),g(i.is_required?8:-1)}}function Ie(t,r){if(t&1&&(c(0,"form",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"span"),f(5," Platform Options"),s()(),_(6,"ng-select",4),C(7,Ce,2,0,"small",5),s(),V(8,xe,9,4,"div",2,w),s()()),t&2){let i,n=l();d("formGroup",n.form),p(6),d("multiple",!0)("items",n.platformOptions)("clearable",!1),p(),g(!(n.form==null||(i=n.form.get("listingPlatform").errors)==null)&&i.required?7:-1),p(),U(r)}}var te=(()=>{let r=class r{constructor(){this.tiktokAttributeFormService=u(vt),this.channelId=b(void 0),this.categoryId=b(void 0),this.platformChange=kt({alias:"onPlatformChanges"}),this.formSubscription=new St,this.attributesChanges=new M,this.platformOptions=[{label:"TikTok Shop",value:Q.TIKTOK_SHOP},{label:"Tokopedia",value:Q.TOKOPEDIA}]}ngOnChanges(){let n=this.categoryId(),e=this.channelId();h.IsNotEmpty(n)&&h.IsNotEmpty(e)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(e,n).pipe(P(a=>a.filter(o=>!(o.type=="PRODUCT_PROPERTY"&&(h.IsEmpty(o.values)||o.values?.length==0)&&o.is_customizable==!1))),E(a=>{this.form=this.tiktokAttributeFormService.createFormGroup(a),this.listenToFormChange(a)}),z(1)))}listenToFormChange(n){let e=[];this.form.valueChanges.pipe(ht(this.formSubscription)).subscribe(a=>{delete a.listingPlatform,e=this.tiktokAttributeFormService.getFilteredAttributes(n,a),this.attributesChanges.emit(e)}),this.form.get("listingPlatform").valueChanges.pipe(Pt(this.form.get("listingPlatform").value),ht(this.formSubscription)).subscribe(a=>{this.platformChange.emit(a)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=x({type:r,selectors:[["tiktok-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{platformChange:"onPlatformChanges",attributesChanges:"attributesChanges"},features:[I([vt]),D],decls:2,vars:3,consts:[[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","listingPlatform","bindLabel","label","bindValue","value","placeholder","Platform Options",3,"multiple","items","clearable"],[1,"text-danger"],["bindLabel","name","bindValue","id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"]],template:function(e,a){if(e&1&&(C(0,Ie,10,5,"form",0),v(1,"async")),e&2){let o;g((o=T(1,1,a.attributes$))?0:-1,o)}},dependencies:[A,B,R,$,Y,tt,L,W,H,X,et,S],encapsulation:2});let t=r;return t})();var Tt=(()=>{let r=class r{constructor(){this.woocommerceUploadService=u(mt)}getAttributes(n,e){return this.woocommerceUploadService.getAttributes(n,e).pipe(P(a=>a.map(o=>({key:o.name,label:o.name}))))}};r.\u0275fac=function(e){return new(e||r)},r.\u0275prov=N({token:r,factory:r.\u0275fac});let t=r;return t})();var ee=(()=>{let r=class r{constructor(){this.wooAttributeFormService=u(Tt),this.channelId=b(),this.categoryId=b(),this.attributesChanges=new M}ngOnChanges(){h.IsNotEmpty(this.categoryId())&&h.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(n){this.attributesChanges.emit([n.key])}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=x({type:r,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[I([Tt]),D],decls:6,vars:3,consts:[[1,"row"],[1,"col-6"],[1,"mb-1"],["bindLabel","label","bindValue","id","placeholder","Pilih Atribut",3,"change","items"]],template:function(e,a){e&1&&(c(0,"div",0)(1,"div",1)(2,"div",2),f(3,"Atribut"),s(),c(4,"ng-select",3),v(5,"async"),F("change",function(m){return a.onSelectAttribute(m)}),s()()()),e&2&&(p(4),d("items",T(5,1,a.attributes$)))},dependencies:[A,et,B,R,$,S],encapsulation:2});let t=r;return t})();var xt=(()=>{let r=class r{constructor(){this.httpService=u(Z),this.formBuilder=u(K)}getAttributes(n,e){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:n},{key:"CategoryID",value:e}]).pipe(P(o=>o))}createFormGroup(n){let e=this.formBuilder.group({});return n.forEach(a=>{e.addControl(a.variant,this.formBuilder.control(null))}),e}convertAttributes(n={}){return Object.values(n).filter(a=>a!==null).map(a=>JSON.stringify(a))}};r.\u0275fac=function(e){return new(e||r)},r.\u0275prov=N({token:r,factory:r.\u0275fac});let t=r;return t})();function Se(t,r){if(t&1&&(c(0,"div",2)(1,"div",3),f(2),s(),_(3,"ng-select",4),s()),t&2){let i=r.$implicit;p(2),q(" ",i==null?null:i.variant," "),p(),d("formControlName",i.variant)("items",i.values)("placeholder","Pilih "+(i==null?null:i.variant))}}function Ae(t,r){if(t&1&&(c(0,"form",0)(1,"div",1),V(2,Se,4,4,"div",2,w),s()()),t&2){let i=l();d("formGroup",i.form),p(2),U(r)}}var ie=(()=>{let r=class r{constructor(){this.tokpedAttrFormService=u(xt),this.channelId=b(void 0),this.categoryId=b(void 0),this.attributesChanges=new M}ngOnInit(){}ngOnChanges(n){let e=this.categoryId(),a=this.channelId();h.IsNotEmpty(e)&&h.IsNotEmpty(a)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(a,e).pipe(E(o=>{this.form=this.tokpedAttrFormService.createFormGroup(o),this.listenToFormChange()})))}listenToFormChange(){let n=[];this.formSubscription=this.form.valueChanges.subscribe(e=>{n=this.tokpedAttrFormService.convertAttributes(e),this.attributesChanges.emit(n)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=x({type:r,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[I([xt]),D],decls:2,vars:3,consts:[[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(e,a){if(e&1&&(C(0,Ae,4,1,"form",0),v(1,"async")),e&2){let o;g((o=T(1,1,a.attributes$))?0:-1,o)}},dependencies:[A,B,R,$,Y,L,W,H,X,S],encapsulation:2});let t=r;return t})();var It=(()=>{let r=class r{constructor(){this.httpService=u(Z),this.formBuilder=u(K)}getAttributes(n){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:n}]).pipe(E(a=>(a.Options.StatusOptions=a.Options.Status.map(o=>({id:o,name:o})),a)))}createFormGroup(n){let e=this.formBuilder.group({});return Object.keys(n.Attribute).forEach(o=>{e.addControl(o,this.formBuilder.control(null))}),e}};r.\u0275fac=function(e){return new(e||r)},r.\u0275prov=N({token:r,factory:r.\u0275fac});let t=r;return t})();function Fe(t,r){if(t&1&&(c(0,"form",0)(1,"div",1)(2,"div",2)(3,"div",3),f(4," Brand "),s(),_(5,"input",4),s(),c(6,"div",5)(7,"div",3),f(8," Product Type "),s(),_(9,"input",6),s(),c(10,"div",5)(11,"div",3),f(12," Status "),s(),_(13,"ng-select",7),s()()()),t&2){let i=l();d("formGroup",i.form),p(13),d("items",r.Options.StatusOptions)}}var oe=(()=>{let r=class r{constructor(){this.channelId=b(void 0),this.attributesChanges=new M,this.shopifyFormService=u(It)}ngOnChanges(n){n.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId()).pipe(E(e=>{this.form=this.shopifyFormService.createFormGroup(e),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(Ft(500)).subscribe(n=>{this.attributesChanges.emit([n])})}ngOnDestroy(){this.formSubscription.unsubscribe()}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=x({type:r,selectors:[["shopify-attribute-form"]],inputs:{channelId:[1,"channelId"]},outputs:{attributesChanges:"attributesChanges"},features:[I([It]),D],decls:2,vars:3,consts:[[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","Brand","type","text","placeholder","brand",1,"form-control"],[1,"col-6"],["formControlName","ProductType","type","text","placeholder","Product Type",1,"form-control"],["formControlName","Status","bindLabel","name","bindValue","id","placeholder","Status",3,"items"]],template:function(e,a){if(e&1&&(C(0,Fe,14,2,"form",0),v(1,"async")),e&2){let o;g((o=T(1,1,a.attributes$))?0:-1,o)}},dependencies:[A,$,Y,tt,L,W,H,X,B,R,S],encapsulation:2});let t=r;return t})();function Pe(t,r){if(t&1&&(c(0,"div",6),_(1,"app-product-card",9),s()),t&2){let i=r.$implicit;p(),d("productId",i==null?null:i.ID)("title",i==null?null:i.Name)("image",i==null?null:i.ThumbnailUrl)("description",(i==null||i.Variants==null?null:i.Variants.length)>1?(i==null||i.Variants==null?null:i.Variants.length)+" Variants":null)("imageForZoom",i==null?null:i.ImageUrl)("code",i==null||i.Variants[0]==null?null:i.Variants[0].Code)("showFooter",!1)}}function Ee(t,r){if(t&1){let i=j();c(0,"mat-checkbox",21),Ot("ngModelChange",function(e){O(i);let a=l().$implicit;return Nt(a.selected,e)||(a.selected=e),k(e)}),F("ngModelChange",function(){let e=O(i),a=l(),o=a.$implicit,m=a.$index,y=l();return k(y.onSelectChannel(o,m,e))}),s()}if(t&2){let i=l().$implicit;Et("ngModel",i.selected)}}function Ne(t,r){if(t&1&&(c(0,"div",18),_(1,"input",22),s()),t&2){let i=l().$implicit,n=l();d("matTooltip",i.type==n.channelType.Shopify||i.type==n.channelType.ShopifyV2?"Cannot change category, please change category in admin.shopify.com":i.type==n.channelType.Plugo?"You can change the category after the product has been uploaded to the Plugo Dashboard.":"")}}function Oe(t,r){if(t&1){let i=j();c(0,"app-channel-category-select",23),F("selectedCategory",function(e){O(i);let a=l().$index,o=l();return k(o.onCategoryChange(a,e))}),s()}if(t&2){let i=l().$implicit,n=l();d("disabled",!i.selected||i.selected&&i.type==n.channelType.Lazada)("channelId",i.id)("channelType",i.type)("categoryId",i.categoryId)}}function ke(t,r){if(t&1){let i=j();c(0,"shopee-attribute-form",27),F("attributesChanges",function(e){O(i);let a=l(2).$index,o=l();return k(o.onAttributesChange(a,e))}),s()}if(t&2){let i=l(2).$implicit;d("categoryId",i.categoryId)("channelId",i.id)("channelType",i.type)}}function De(t,r){if(t&1){let i=j();c(0,"tiktok-attribute-form",28),F("attributesChanges",function(e){O(i);let a=l(2).$index,o=l();return k(o.onAttributesChange(a,e))})("onPlatformChanges",function(e){O(i);let a=l(2).$index,o=l();return k(o.onPlatformChange(a,e))}),s()}if(t&2){let i=l(2).$implicit;d("categoryId",i.categoryId)("channelId",i.id)}}function Me(t,r){if(t&1){let i=j();c(0,"wooocommerce-attribute-form",29),F("attributesChanges",function(e){O(i);let a=l(2).$index,o=l();return k(o.onAttributesChange(a,e))}),s()}if(t&2){let i=l(2).$implicit;d("categoryId",i.categoryId)("channelId",i.id)}}function we(t,r){if(t&1){let i=j();c(0,"tokopedia-attribute-form",29),F("attributesChanges",function(e){O(i);let a=l(2).$index,o=l();return k(o.onAttributesChange(a,e))}),s()}if(t&2){let i=l(2).$implicit;d("categoryId",i.categoryId)("channelId",i.id)}}function Ve(t,r){if(t&1&&(c(0,"div",20)(1,"div",24),C(2,ke,1,3,"shopee-attribute-form",25)(3,De,1,2,"tiktok-attribute-form",26)(4,Me,1,2,"wooocommerce-attribute-form",26)(5,we,1,2,"tokopedia-attribute-form",26),s()()),t&2){let i,n=l().$implicit,e=l();p(2),g((i=n.type)===e.channelType.Shopee?2:i===e.channelType.Tiktok?3:i===e.channelType.WooCommerce?4:i===e.channelType.Tokopedia?5:-1)}}function Ue(t,r){if(t&1){let i=j();c(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",30),F("attributesChanges",function(e){O(i);let a=l().$index,o=l();return k(o.onAttributesChange(a,e))}),s()()()}if(t&2){let i=l().$implicit;p(2),d("channelId",i.id)}}function Le(t,r){if(t&1&&(c(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),C(6,Ee,1,1,"mat-checkbox",14),v(7,"async"),s(),c(8,"div"),_(9,"app-channel-logo",15),s(),c(10,"div",16)(11,"span"),f(12),s()()()(),c(13,"div",12)(14,"div",17),C(15,Ne,2,1,"div",18)(16,Oe,1,4,"app-channel-category-select",19),s()()(),C(17,Ve,6,1,"div",20)(18,Ue,3,1,"div",20),s()()),t&2){let i,n=r.$implicit,e=l();p(6),g((i=T(7,8,e.defaultCategories$))?6:-1,i),p(3),d("typeId",n.type)("showChannelName",!1),p(),d("matTooltip",n.name)("matTooltipShowDelay",2500),p(2),at(n.name),p(3),g(n.type==e.channelType.Shopify||n.type==e.channelType.Plugo||n.type==e.channelType.ShopifyV2?15:16),p(2),g(n.categoryId&&e.channelType.Lazada!=n.type&&n.selected?17:(e.channelType.Shopify==n.type||n.type==e.channelType.ShopifyV2)&&n.selected?18:-1)}}var en=(()=>{let r=class r{constructor(){this.toastr=u(Dt),this.uploadProductService=u(pt),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=Ct,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(z(1))}onCategoryChange(n,e){this.channelProductUploads.update(a=>a.map((o,m)=>(m==n&&(o.categoryId=e,o.attributes=[]),o)))}onPlatformChange(n,e){this.channelProductUploads.update(a=>a.map((o,m)=>(m==n&&(o.listing_platforms=e),o)))}onAttributesChange(n,e){this.channelProductUploads.update(a=>a.map((o,m)=>(m==n&&(o.attributes=e),o)))}tiktokPlatformChanges(n,e){this.channelProductUploads.update(a=>a.map((o,m)=>(m==n&&(o.listing_platforms=e),o)))}onSelectChannel(n,e,a){this.channelProductUploads.update(o=>o.map((m,y)=>{if(y==e&&n.selected){let _t=this.findCategoryByChannelId(n.id,a);m.categoryId=_t?.DefaultCategoryID}return y==e&&!n.selected&&(m.categoryId=null),m}))}findCategoryByChannelId(n,e){return e.find(a=>a.ID===n)}onUploadProduct(){if(this.checkTiktokPlatform()==!1){this.toastr.error("Please select at least one platform for TikTok channel","Platform is Required");return}this.uploadProductService.onUploadProduct(this.channelProductUploads())}checkTiktokPlatform(){return this.channelProductUploads().every(e=>e.type==Ct.Tiktok&&h.IsNotEmpty(e?.categoryId)?e.listing_platforms.length>0:!0)}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=x({type:r,selectors:[["app-product-upload"]],features:[I([ct,Gt,jt,mt])],decls:17,vars:5,consts:[["headerTitle","Upload Product To Channel",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-upload"],[1,"container-fluid","mt-6"],[1,"ps-3","mt-8","pb-5","fw-medium"],[1,"row","mb-10","ps-3"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"ps-3","mb-8","border-bottom","pb-5","fw-medium"],[1,"row","mb-6"],[3,"productId","title","image","description","imageForZoom","code","showFooter"],[1,"col-12"],[1,"row"],[1,"col-3"],[1,"d-flex","align-items-center"],["color","primary",1,"example-margin",3,"ngModel"],[3,"typeId","showChannelName"],[2,"overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"matTooltip","matTooltipShowDelay"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip"],[3,"disabled","channelId","channelType","categoryId"],[1,"row","my-3"],["color","primary",1,"example-margin",3,"ngModelChange","ngModel"],["disabled","","type","text","placeholder","Category Unavailable",1,"form-control","rounded-1",2,"height","35px"],[3,"selectedCategory","disabled","channelId","channelType","categoryId"],[1,"col-12","ps-11"],[3,"categoryId","channelId","channelType"],[3,"categoryId","channelId"],[3,"attributesChanges","categoryId","channelId","channelType"],[3,"attributesChanges","onPlatformChanges","categoryId","channelId"],[3,"attributesChanges","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(e,a){if(e&1&&(c(0,"mainpanel",0)(1,"actions")(2,"button",1),F("click",function(){return a.onUploadProduct()}),_(3,"i",2),f(4," Upload "),s()(),c(5,"content")(6,"div",3)(7,"h3",4),f(8,"Product To Upload"),s(),c(9,"div",5),V(10,Pe,2,7,"div",6,w),v(12,"async"),s(),c(13,"h3",7),f(14,"Channel To Upload"),s(),V(15,Le,19,10,"div",8,w),s()()()),e&2){let o;d("hideSearchBox",!0)("hideSearchDropdown",!0),p(2),d("disabled",((o=a.channelProductUploads())==null?null:o.length)==0),p(8),U(T(12,3,a.selectedProducts$)),p(5),U(a.channelProductUploads())}},dependencies:[A,Xt,Bt,Jt,Kt,Yt,et,L,Mt,Rt,$t,te,ee,ie,oe,Wt,zt,Zt,S],encapsulation:2});let t=r;return t})();export{en as ProductUploadComponent};
1
+ import{a as zt}from"./chunk-E7LOFZQV.js";import"./chunk-YLQBIIZH.js";import{b as Xt}from"./chunk-7T5DBPDP.js";import"./chunk-OH5T7D7O.js";import{a as Kt,b as Jt}from"./chunk-FH2KAM6J.js";import{a as Yt}from"./chunk-YKKHSYDW.js";import{a as Ht}from"./chunk-WTHYLNPX.js";import{a as ct,b as Gt,c as jt,d as mt,e as pt}from"./chunk-HPQDUJXF.js";import"./chunk-TQROQOXU.js";import{a as Wt}from"./chunk-IQGRGC3E.js";import{d as R,e as B}from"./chunk-BZWZ64N5.js";import"./chunk-OHAT7WXU.js";import"./chunk-L4EPB2CQ.js";import"./chunk-GNXSEYJF.js";import"./chunk-DLHIDOS3.js";import"./chunk-REDQ2L7Y.js";import"./chunk-STOW2RQN.js";import"./chunk-GLBJ4Y4T.js";import"./chunk-XTNXL2IY.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import"./chunk-KHGTW7IV.js";import"./chunk-A6QXXKPR.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{b as Bt}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import{a as Rt}from"./chunk-UEXWQT5J.js";import{b as qt,c as Qt}from"./chunk-RPHZK33A.js";import"./chunk-3SCX7IMW.js";import"./chunk-JHSG3KRS.js";import"./chunk-K4Q33QIR.js";import"./chunk-JRCXHF2X.js";import"./chunk-M27MYADT.js";import"./chunk-TBVMCNS2.js";import"./chunk-RM6ZXD3O.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-3RK6DDJD.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-NJNRUDU6.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import"./chunk-JTKEMQZT.js";import{c as $t}from"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import"./chunk-ZSUWHVKX.js";import"./chunk-J4552BMI.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import{b as Ct,c as h}from"./chunk-UPRDDI4K.js";import{A as et,B as $,c as tt,e as nt,h as L,i as W,l as st,m as Mt,n as Y,q as H,r as wt,s as X,t as Vt,u as Ut,v as Lt,z as K}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{b as Dt,e as Z}from"./chunk-D6JH2KV4.js";import"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{B as A,w as S}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{$ as Pt,$c as lt,Hb as x,K as At,M as Ft,Nc as f,Oa as D,Oc as at,Pc as q,Rc as Et,Sc as Nt,Tc as Ot,Z as z,_c as I,ac as C,ca as ht,cc as g,dc as w,ea as E,f as St,fc as V,gc as U,hc as d,ic as c,id as v,jc as s,jd as T,kc as _,ma as N,ob as p,ra as u,rc as j,tb as M,td as kt,ud as b,v as P,wc as F,ya as O,yc as l,za as k}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var J=(function(t){return t[t.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",t[t.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",t[t.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",t[t.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",t[t.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",t})(J||{});var it=(function(t){return t[t.FORMAT_NORMAL=1]="FORMAT_NORMAL",t[t.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",t})(it||{});var ot=(function(t){return t[t.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",t[t.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",t[t.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",t[t.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",t[t.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",t})(ot||{});var gt=class extends st{setValue(r,i){if(r instanceof Date){let n=Math.floor(r.getTime()/1e3);super.setValue(n,i)}else super.setValue(r,i)}},bt=(()=>{let r=class r{constructor(){this.shopeeUploadService=u(ct),this.formBuilder=u(K)}getAttributes(n){return this.shopeeUploadService.getAttributes(n.channelId,n.categoryId).pipe(P(e=>this.setLabelToIndonesian(e)))}setLabelToIndonesian(n=[]){let e,a;return n=n.map(o=>(e=o?.multi_lang?.find(m=>m.language=="id"),o.attribute_value_list=o?.attribute_value_list?.map(m=>(a=m?.multi_lang?.find(y=>y.language=="id"),m.name=a?.value,m)),o.name=e?.value?e?.value:o.name,o)),n}createFormGroup(n){let e=this.formBuilder.group({}),a=[];return n.forEach(o=>{if(a=[],o.mandatory&&a.push(nt.required),o?.attribute_info?.format_type==it.FORMAT_QUANTITATIVE_WITH_UNIT&&o?.attribute_info?.input_type==J.FREE_TEXT_FILED){let m=this.formBuilder.group({unit:new st(null),value:new st(null,a)});e.addControl(JSON.stringify(o.attribute_id),m)}else o?.attribute_info?.input_type==J.FREE_TEXT_FILED&&o?.attribute_info?.input_validation_type==ot.VALIDATOR_DATE_TYPE?e.addControl(JSON.stringify(o.attribute_id),new gt(null,a)):e.addControl(JSON.stringify(o.attribute_id),this.formBuilder.control(null,a))}),e}getFilteredAttributes(n,e){let a=JSON.parse(JSON.stringify(n)),o=Object.keys(e),m=a.filter(y=>o.findIndex(ft=>parseInt(ft)==y.attribute_id||y.mandatory)!=-1);return m=this.filterSelectedAttributes(m,e),m}filterSelectedAttributes(n,e){return n.map(o=>{switch(o.attribute_info.input_type){case J.MULTI_COMBO_BOX:h.IsNotEmpty(e[o.attribute_id])?o.attribute_value_list=o.attribute_value_list.filter(m=>e[o.attribute_id]?.findIndex(y=>y==m.value_id)!=-1):o.attribute_value_list=[];break;case J.FREE_TEXT_FILED:o.attribute_info.format_type==it.FORMAT_QUANTITATIVE_WITH_UNIT?o.attribute_value_list=this.setSelectedQuantitativeAttr(e[o.attribute_id]?.value,e[o.attribute_id]?.unit):o.attribute_info.input_validation_type==ot.VALIDATOR_DATE_TYPE?o.attribute_value_list=this.setSelectedDateAttr(e[o.attribute_id]):o.attribute_value_list=this.setSelectedQuantitativeAttr(e[o.attribute_id]);break;default:o.attribute_value_list=o.attribute_value_list.filter(m=>m.value_id==e[o.attribute_id])}return o}).filter(o=>o?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(n,e){let a=[];if(h.IsNotEmpty(n)){let o={value_id:0,original_value_name:JSON.stringify(n)};h.IsNotEmpty(e)&&(o.value_unit=e),a=[o]}return a}setSelectedDateAttr(n){let e=[];return h.IsNotEmpty(n)&&(e=[{value_id:0,original_value_name:JSON.stringify(n)}]),e}};r.\u0275fac=function(e){return new(e||r)},r.\u0275prov=N({token:r,factory:r.\u0275fac});let t=r;return t})();var yt=()=>[];function ne(t,r){t&1&&(c(0,"span",4),f(1,"*"),s())}function re(t,r){if(t&1&&_(0,"ng-select",5),t&2){let i=l().$implicit;d("multiple",!0)("formControlName",i.attribute_id)("items",i.attribute_value_list?i.attribute_value_list:lt(4,yt))("placeholder","Pilih "+(i==null?null:i.name))}}function ae(t,r){if(t&1&&_(0,"input",7),t&2){let i=l(2).$implicit;d("formControlName",i.attribute_id)("placeholder","Isi "+(i==null?null:i.name))}}function le(t,r){if(t&1&&(c(0,"option",14),f(1),s()),t&2){let i=r.$implicit;d("value",i),p(),at(i)}}function se(t,r){if(t&1&&(c(0,"div",9),_(1,"input",11),c(2,"select",12)(3,"option",13),f(4,"Unit"),s(),V(5,le,2,2,"option",14,w),s()()),t&2){let i=l(3).$implicit;d("formGroupName",i.attribute_id),p(),d("placeholder","Isi "+(i==null?null:i.name)),p(2),d("value",null),p(2),U(i==null||i.attribute_info==null?null:i.attribute_info.attribute_unit_list)}}function ce(t,r){if(t&1&&_(0,"input",10),t&2){let i=l(3).$implicit;d("formControlName",i.attribute_id)("placeholder","Isi "+(i==null?null:i.name))}}function me(t,r){if(t&1&&C(0,se,7,3,"div",9)(1,ce,1,2,"input",10),t&2){let i=l(2).$implicit,n=l(2);g((i==null||i.attribute_info==null?null:i.attribute_info.format_type)==n.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function pe(t,r){if(t&1&&_(0,"datepicker",8),t&2){let i=l(2).$implicit;d("formControlName",i.attribute_id)}}function de(t,r){if(t&1&&C(0,ae,1,2,"input",7)(1,me,2,1)(2,pe,1,1,"datepicker",8),t&2){let i,n=l().$implicit,e=l(2);g((i=n==null||n.attribute_info==null?null:n.attribute_info.input_validation_type)===e.validationType.VALIDATOR_STRING_TYPE?0:i===e.validationType.VALIDATOR_FLOAT_TYPE?1:i===e.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function ue(t,r){if(t&1&&_(0,"ng-select",6),t&2){let i=l().$implicit;d("formControlName",i.attribute_id)("items",i.attribute_value_list?i.attribute_value_list:lt(3,yt))("placeholder","Pilih "+(i==null?null:i.name))}}function _e(t,r){if(t&1&&_(0,"ng-select",6),t&2){let i=l().$implicit;d("formControlName",i.attribute_id)("items",i.attribute_value_list?i.attribute_value_list:lt(3,yt))("placeholder","Pilih "+(i==null?null:i.name))}}function fe(t,r){if(t&1&&(c(0,"div",2)(1,"div",3),C(2,ne,2,0,"span",4),c(3,"span"),f(4),s()(),C(5,re,1,5,"ng-select",5)(6,de,3,1)(7,ue,1,4,"ng-select",6)(8,_e,1,4,"ng-select",6),s()),t&2){let i,n=r.$implicit,e=l(2);p(2),g(n.mandatory?2:-1),p(2),q(" ",n==null?null:n.name," "),p(),g((i=n==null||n.attribute_info==null?null:n.attribute_info.input_type)===e.inputType.MULTI_COMBO_BOX?5:i===e.inputType.FREE_TEXT_FILED?6:i===e.inputType.SINGLE_COMBO_BOX?7:8)}}function he(t,r){if(t&1&&(c(0,"form",0)(1,"div",1),V(2,fe,9,3,"div",2,w),s()()),t&2){let i=l();d("formGroup",i.form),p(2),U(r)}}var Zt=(()=>{let r=class r{constructor(){this.formCategoryService=u(bt),this.channelType=b(void 0),this.categoryId=b(void 0),this.channelId=b(void 0),this.channelProductUpload=b(void 0),this.attributesChanges=new M,this.inputType=J,this.formatType=it,this.validationType=ot}ngOnChanges(){let n=this.categoryId(),e=this.channelId();h.IsNotEmpty(n)&&h.IsNotEmpty(e)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:n,channelId:e,channelType:this.channelType()}).pipe(E(a=>{this.form=this.formCategoryService.createFormGroup(a),this.listenToFormChange(a)}),z(1)))}listenToFormChange(n){let e=[];this.formSubscription=this.form.valueChanges.subscribe(a=>{e=this.formCategoryService.getFilteredAttributes(n,a),this.attributesChanges.emit(e)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=x({type:r,selectors:[["shopee-attribute-form"]],inputs:{channelType:[1,"channelType"],categoryId:[1,"categoryId"],channelId:[1,"channelId"],channelProductUpload:[1,"channelProductUpload"]},outputs:{attributesChanges:"attributesChanges"},features:[I([bt]),D],decls:2,vars:3,consts:[[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","value_id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","value_id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"],[1,"attribute-datepicker",3,"formControlName"],[1,"d-flex","align-items-center",3,"formGroupName"],["type","text","autoNum","",1,"form-control",3,"formControlName","placeholder"],["formControlName","value","type","text","autoNum","",1,"form-control","me-1",2,"width","200px",3,"placeholder"],["name","unit","id","unit","formControlName","unit",1,"form-control"],["disabled","","selected","",3,"value"],[3,"value"]],template:function(e,a){if(e&1&&(C(0,he,4,1,"form",0),v(1,"async")),e&2){let o;g((o=T(1,1,a.attributes$))?0:-1,o)}},dependencies:[A,B,R,$,Y,Ut,Lt,tt,Vt,L,W,H,X,wt,Ht,Qt,qt,S],styles:["input[_ngcontent-%COMP%], select[_ngcontent-%COMP%]{height:36px;border-radius:4px} datepicker.attribute-datepicker>mat-form-field.mat-mdc-form-field>.mat-mdc-text-field-wrapper{height:36px} datepicker.attribute-datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{padding-top:11px!important;padding-bottom:11px!important;height:36px;min-height:36px!important} datepicker.attribute-datepicker mat-datepicker-toggle>button.mat-mdc-icon-button.mat-mdc-button-base{--mat-icon-button-state-layer-size: 36px}"]});let t=r;return t})();var Q=(function(t){return t.TIKTOK_SHOP="TIKTOK_SHOP",t.TOKOPEDIA="TOKOPEDIA",t})(Q||{});var vt=(()=>{let r=class r{constructor(){this.httpService=u(Z),this.formBuilder=u(K),this.uploadProductService=u(pt)}getAttributes(n,e){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:n},{key:"CategoryID",value:e}]).pipe(At(o=>this.uploadProductService.selectedProduct$.pipe(P(m=>(o=this.mappingAttributeSalesProperty(o,m),o)))))}mappingAttributeSalesProperty(n,e){let a=0;return n.filter(o=>(o.type=="SALES_PROPERTY"&&(a+=1),a>1?(a=0,!1):!0)).map(o=>(o.type=="SALES_PROPERTY"&&(o.name="Jenis Variant",o.is_multiple_selection=!1,o.is_required=this.isProductHasMoreVariant(e),o.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),o))}isProductHasMoreVariant(n){let e=!1,a=[];return n.forEach(o=>{o.Variants&&a.push(o.Variants.length)}),e=a.some(o=>o>1),e}createFormGroup(n){let e=this.formBuilder.group({}),a=[];return n.forEach(o=>{a=[],o.is_required&&a.push(nt.required),e.addControl(o.id,this.formBuilder.control(null,a))}),e.addControl("listingPlatform",this.formBuilder.control([Q.TIKTOK_SHOP,Q.TOKOPEDIA],[nt.required])),e}getFilteredAttributes(n,e){let a=JSON.parse(JSON.stringify(n)),o=Object.keys(e),m=a.filter(y=>o.findIndex(ft=>parseInt(ft)==y.id)!=-1);return m=this.filterSelectedAttributes(m,e),m}filterSelectedAttributes(n,e){return n.map(o=>(h.IsNotEmpty(o.values)?o.is_multiple_selection?o.values=o.values.filter(m=>e[o.id]?.includes(m.id)):o.values=o.values.filter(m=>m.id==e[o.id]):e[o.id]&&(o.values=[{id:null,name:e[o.id]}]),o)).filter(o=>o?.values?.length>0)}};r.\u0275fac=function(e){return new(e||r)},r.\u0275prov=N({token:r,factory:r.\u0275fac});let t=r;return t})();function Ce(t,r){t&1&&(c(0,"small",5),f(1," Platform is required "),s())}function ge(t,r){t&1&&(c(0,"span",5),f(1,"*"),s())}function be(t,r){if(t&1&&_(0,"ng-select",6),t&2){let i=l().$implicit;d("multiple",!0)("formControlName",i.id)("items",i.values)("placeholder","Pilih "+(i==null?null:i.name))}}function ye(t,r){if(t&1&&_(0,"ng-select",7),t&2){let i=l().$implicit;d("formControlName",i.id)("items",i.values)("placeholder","Pilih "+(i==null?null:i.name))}}function ve(t,r){if(t&1&&_(0,"input",8),t&2){let i=l().$implicit;d("formControlName",i.id)("placeholder",i==null?null:i.name)}}function Te(t,r){if(t&1&&(c(0,"small",5),f(1),s()),t&2){let i=l().$implicit;p(),q(" ",i==null?null:i.name," is mandatory ")}}function xe(t,r){if(t&1&&(c(0,"div",2)(1,"div",3),C(2,ge,2,0,"span",5),c(3,"span"),f(4),s()(),C(5,be,1,4,"ng-select",6)(6,ye,1,3,"ng-select",7)(7,ve,1,2,"input",8),C(8,Te,2,1,"small",5),s()),t&2){let i=r.$implicit;p(2),g(i.is_required?2:-1),p(2),q(" ",i==null?null:i.name," "),p(),g(i.is_multiple_selection?5:i.values!==null&&i.values.length>0?6:7),p(3),g(i.is_required?8:-1)}}function Ie(t,r){if(t&1&&(c(0,"form",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"span"),f(5," Platform Options"),s()(),_(6,"ng-select",4),C(7,Ce,2,0,"small",5),s(),V(8,xe,9,4,"div",2,w),s()()),t&2){let i,n=l();d("formGroup",n.form),p(6),d("multiple",!0)("items",n.platformOptions)("clearable",!1),p(),g(!(n.form==null||(i=n.form.get("listingPlatform").errors)==null)&&i.required?7:-1),p(),U(r)}}var te=(()=>{let r=class r{constructor(){this.tiktokAttributeFormService=u(vt),this.channelId=b(void 0),this.categoryId=b(void 0),this.platformChange=kt({alias:"onPlatformChanges"}),this.formSubscription=new St,this.attributesChanges=new M,this.platformOptions=[{label:"TikTok Shop",value:Q.TIKTOK_SHOP},{label:"Tokopedia",value:Q.TOKOPEDIA}]}ngOnChanges(){let n=this.categoryId(),e=this.channelId();h.IsNotEmpty(n)&&h.IsNotEmpty(e)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(e,n).pipe(P(a=>a.filter(o=>!(o.type=="PRODUCT_PROPERTY"&&(h.IsEmpty(o.values)||o.values?.length==0)&&o.is_customizable==!1))),E(a=>{this.form=this.tiktokAttributeFormService.createFormGroup(a),this.listenToFormChange(a)}),z(1)))}listenToFormChange(n){let e=[];this.form.valueChanges.pipe(ht(this.formSubscription)).subscribe(a=>{delete a.listingPlatform,e=this.tiktokAttributeFormService.getFilteredAttributes(n,a),this.attributesChanges.emit(e)}),this.form.get("listingPlatform").valueChanges.pipe(Pt(this.form.get("listingPlatform").value),ht(this.formSubscription)).subscribe(a=>{this.platformChange.emit(a)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=x({type:r,selectors:[["tiktok-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{platformChange:"onPlatformChanges",attributesChanges:"attributesChanges"},features:[I([vt]),D],decls:2,vars:3,consts:[[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","listingPlatform","bindLabel","label","bindValue","value","placeholder","Platform Options",3,"multiple","items","clearable"],[1,"text-danger"],["bindLabel","name","bindValue","id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"]],template:function(e,a){if(e&1&&(C(0,Ie,10,5,"form",0),v(1,"async")),e&2){let o;g((o=T(1,1,a.attributes$))?0:-1,o)}},dependencies:[A,B,R,$,Y,tt,L,W,H,X,et,S],encapsulation:2});let t=r;return t})();var Tt=(()=>{let r=class r{constructor(){this.woocommerceUploadService=u(mt)}getAttributes(n,e){return this.woocommerceUploadService.getAttributes(n,e).pipe(P(a=>a.map(o=>({key:o.name,label:o.name}))))}};r.\u0275fac=function(e){return new(e||r)},r.\u0275prov=N({token:r,factory:r.\u0275fac});let t=r;return t})();var ee=(()=>{let r=class r{constructor(){this.wooAttributeFormService=u(Tt),this.channelId=b(),this.categoryId=b(),this.attributesChanges=new M}ngOnChanges(){h.IsNotEmpty(this.categoryId())&&h.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(n){this.attributesChanges.emit([n.key])}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=x({type:r,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[I([Tt]),D],decls:6,vars:3,consts:[[1,"row"],[1,"col-6"],[1,"mb-1"],["bindLabel","label","bindValue","id","placeholder","Pilih Atribut",3,"change","items"]],template:function(e,a){e&1&&(c(0,"div",0)(1,"div",1)(2,"div",2),f(3,"Atribut"),s(),c(4,"ng-select",3),v(5,"async"),F("change",function(m){return a.onSelectAttribute(m)}),s()()()),e&2&&(p(4),d("items",T(5,1,a.attributes$)))},dependencies:[A,et,B,R,$,S],encapsulation:2});let t=r;return t})();var xt=(()=>{let r=class r{constructor(){this.httpService=u(Z),this.formBuilder=u(K)}getAttributes(n,e){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:n},{key:"CategoryID",value:e}]).pipe(P(o=>o))}createFormGroup(n){let e=this.formBuilder.group({});return n.forEach(a=>{e.addControl(a.variant,this.formBuilder.control(null))}),e}convertAttributes(n={}){return Object.values(n).filter(a=>a!==null).map(a=>JSON.stringify(a))}};r.\u0275fac=function(e){return new(e||r)},r.\u0275prov=N({token:r,factory:r.\u0275fac});let t=r;return t})();function Se(t,r){if(t&1&&(c(0,"div",2)(1,"div",3),f(2),s(),_(3,"ng-select",4),s()),t&2){let i=r.$implicit;p(2),q(" ",i==null?null:i.variant," "),p(),d("formControlName",i.variant)("items",i.values)("placeholder","Pilih "+(i==null?null:i.variant))}}function Ae(t,r){if(t&1&&(c(0,"form",0)(1,"div",1),V(2,Se,4,4,"div",2,w),s()()),t&2){let i=l();d("formGroup",i.form),p(2),U(r)}}var ie=(()=>{let r=class r{constructor(){this.tokpedAttrFormService=u(xt),this.channelId=b(void 0),this.categoryId=b(void 0),this.attributesChanges=new M}ngOnInit(){}ngOnChanges(n){let e=this.categoryId(),a=this.channelId();h.IsNotEmpty(e)&&h.IsNotEmpty(a)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(a,e).pipe(E(o=>{this.form=this.tokpedAttrFormService.createFormGroup(o),this.listenToFormChange()})))}listenToFormChange(){let n=[];this.formSubscription=this.form.valueChanges.subscribe(e=>{n=this.tokpedAttrFormService.convertAttributes(e),this.attributesChanges.emit(n)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=x({type:r,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[I([xt]),D],decls:2,vars:3,consts:[[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(e,a){if(e&1&&(C(0,Ae,4,1,"form",0),v(1,"async")),e&2){let o;g((o=T(1,1,a.attributes$))?0:-1,o)}},dependencies:[A,B,R,$,Y,L,W,H,X,S],encapsulation:2});let t=r;return t})();var It=(()=>{let r=class r{constructor(){this.httpService=u(Z),this.formBuilder=u(K)}getAttributes(n){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:n}]).pipe(E(a=>(a.Options.StatusOptions=a.Options.Status.map(o=>({id:o,name:o})),a)))}createFormGroup(n){let e=this.formBuilder.group({});return Object.keys(n.Attribute).forEach(o=>{e.addControl(o,this.formBuilder.control(null))}),e}};r.\u0275fac=function(e){return new(e||r)},r.\u0275prov=N({token:r,factory:r.\u0275fac});let t=r;return t})();function Fe(t,r){if(t&1&&(c(0,"form",0)(1,"div",1)(2,"div",2)(3,"div",3),f(4," Brand "),s(),_(5,"input",4),s(),c(6,"div",5)(7,"div",3),f(8," Product Type "),s(),_(9,"input",6),s(),c(10,"div",5)(11,"div",3),f(12," Status "),s(),_(13,"ng-select",7),s()()()),t&2){let i=l();d("formGroup",i.form),p(13),d("items",r.Options.StatusOptions)}}var oe=(()=>{let r=class r{constructor(){this.channelId=b(void 0),this.attributesChanges=new M,this.shopifyFormService=u(It)}ngOnChanges(n){n.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId()).pipe(E(e=>{this.form=this.shopifyFormService.createFormGroup(e),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(Ft(500)).subscribe(n=>{this.attributesChanges.emit([n])})}ngOnDestroy(){this.formSubscription.unsubscribe()}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=x({type:r,selectors:[["shopify-attribute-form"]],inputs:{channelId:[1,"channelId"]},outputs:{attributesChanges:"attributesChanges"},features:[I([It]),D],decls:2,vars:3,consts:[[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","Brand","type","text","placeholder","brand",1,"form-control"],[1,"col-6"],["formControlName","ProductType","type","text","placeholder","Product Type",1,"form-control"],["formControlName","Status","bindLabel","name","bindValue","id","placeholder","Status",3,"items"]],template:function(e,a){if(e&1&&(C(0,Fe,14,2,"form",0),v(1,"async")),e&2){let o;g((o=T(1,1,a.attributes$))?0:-1,o)}},dependencies:[A,$,Y,tt,L,W,H,X,B,R,S],encapsulation:2});let t=r;return t})();function Pe(t,r){if(t&1&&(c(0,"div",6),_(1,"app-product-card",9),s()),t&2){let i=r.$implicit;p(),d("productId",i==null?null:i.ID)("title",i==null?null:i.Name)("image",i==null?null:i.ThumbnailUrl)("description",(i==null||i.Variants==null?null:i.Variants.length)>1?(i==null||i.Variants==null?null:i.Variants.length)+" Variants":null)("imageForZoom",i==null?null:i.ImageUrl)("code",i==null||i.Variants[0]==null?null:i.Variants[0].Code)("showFooter",!1)}}function Ee(t,r){if(t&1){let i=j();c(0,"mat-checkbox",21),Ot("ngModelChange",function(e){O(i);let a=l().$implicit;return Nt(a.selected,e)||(a.selected=e),k(e)}),F("ngModelChange",function(){let e=O(i),a=l(),o=a.$implicit,m=a.$index,y=l();return k(y.onSelectChannel(o,m,e))}),s()}if(t&2){let i=l().$implicit;Et("ngModel",i.selected)}}function Ne(t,r){if(t&1&&(c(0,"div",18),_(1,"input",22),s()),t&2){let i=l().$implicit,n=l();d("matTooltip",i.type==n.channelType.Shopify||i.type==n.channelType.ShopifyV2?"Cannot change category, please change category in admin.shopify.com":i.type==n.channelType.Plugo?"You can change the category after the product has been uploaded to the Plugo Dashboard.":"")}}function Oe(t,r){if(t&1){let i=j();c(0,"app-channel-category-select",23),F("selectedCategory",function(e){O(i);let a=l().$index,o=l();return k(o.onCategoryChange(a,e))}),s()}if(t&2){let i=l().$implicit,n=l();d("disabled",!i.selected||i.selected&&i.type==n.channelType.Lazada)("channelId",i.id)("channelType",i.type)("categoryId",i.categoryId)}}function ke(t,r){if(t&1){let i=j();c(0,"shopee-attribute-form",27),F("attributesChanges",function(e){O(i);let a=l(2).$index,o=l();return k(o.onAttributesChange(a,e))}),s()}if(t&2){let i=l(2).$implicit;d("categoryId",i.categoryId)("channelId",i.id)("channelType",i.type)}}function De(t,r){if(t&1){let i=j();c(0,"tiktok-attribute-form",28),F("attributesChanges",function(e){O(i);let a=l(2).$index,o=l();return k(o.onAttributesChange(a,e))})("onPlatformChanges",function(e){O(i);let a=l(2).$index,o=l();return k(o.onPlatformChange(a,e))}),s()}if(t&2){let i=l(2).$implicit;d("categoryId",i.categoryId)("channelId",i.id)}}function Me(t,r){if(t&1){let i=j();c(0,"wooocommerce-attribute-form",29),F("attributesChanges",function(e){O(i);let a=l(2).$index,o=l();return k(o.onAttributesChange(a,e))}),s()}if(t&2){let i=l(2).$implicit;d("categoryId",i.categoryId)("channelId",i.id)}}function we(t,r){if(t&1){let i=j();c(0,"tokopedia-attribute-form",29),F("attributesChanges",function(e){O(i);let a=l(2).$index,o=l();return k(o.onAttributesChange(a,e))}),s()}if(t&2){let i=l(2).$implicit;d("categoryId",i.categoryId)("channelId",i.id)}}function Ve(t,r){if(t&1&&(c(0,"div",20)(1,"div",24),C(2,ke,1,3,"shopee-attribute-form",25)(3,De,1,2,"tiktok-attribute-form",26)(4,Me,1,2,"wooocommerce-attribute-form",26)(5,we,1,2,"tokopedia-attribute-form",26),s()()),t&2){let i,n=l().$implicit,e=l();p(2),g((i=n.type)===e.channelType.Shopee?2:i===e.channelType.Tiktok?3:i===e.channelType.WooCommerce?4:i===e.channelType.Tokopedia?5:-1)}}function Ue(t,r){if(t&1){let i=j();c(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",30),F("attributesChanges",function(e){O(i);let a=l().$index,o=l();return k(o.onAttributesChange(a,e))}),s()()()}if(t&2){let i=l().$implicit;p(2),d("channelId",i.id)}}function Le(t,r){if(t&1&&(c(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),C(6,Ee,1,1,"mat-checkbox",14),v(7,"async"),s(),c(8,"div"),_(9,"app-channel-logo",15),s(),c(10,"div",16)(11,"span"),f(12),s()()()(),c(13,"div",12)(14,"div",17),C(15,Ne,2,1,"div",18)(16,Oe,1,4,"app-channel-category-select",19),s()()(),C(17,Ve,6,1,"div",20)(18,Ue,3,1,"div",20),s()()),t&2){let i,n=r.$implicit,e=l();p(6),g((i=T(7,8,e.defaultCategories$))?6:-1,i),p(3),d("typeId",n.type)("showChannelName",!1),p(),d("matTooltip",n.name)("matTooltipShowDelay",2500),p(2),at(n.name),p(3),g(n.type==e.channelType.Shopify||n.type==e.channelType.Plugo||n.type==e.channelType.ShopifyV2?15:16),p(2),g(n.categoryId&&e.channelType.Lazada!=n.type&&n.selected?17:(e.channelType.Shopify==n.type||n.type==e.channelType.ShopifyV2)&&n.selected?18:-1)}}var en=(()=>{let r=class r{constructor(){this.toastr=u(Dt),this.uploadProductService=u(pt),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=Ct,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(z(1))}onCategoryChange(n,e){this.channelProductUploads.update(a=>a.map((o,m)=>(m==n&&(o.categoryId=e,o.attributes=[]),o)))}onPlatformChange(n,e){this.channelProductUploads.update(a=>a.map((o,m)=>(m==n&&(o.listing_platforms=e),o)))}onAttributesChange(n,e){this.channelProductUploads.update(a=>a.map((o,m)=>(m==n&&(o.attributes=e),o)))}tiktokPlatformChanges(n,e){this.channelProductUploads.update(a=>a.map((o,m)=>(m==n&&(o.listing_platforms=e),o)))}onSelectChannel(n,e,a){this.channelProductUploads.update(o=>o.map((m,y)=>{if(y==e&&n.selected){let _t=this.findCategoryByChannelId(n.id,a);m.categoryId=_t?.DefaultCategoryID}return y==e&&!n.selected&&(m.categoryId=null),m}))}findCategoryByChannelId(n,e){return e.find(a=>a.ID===n)}onUploadProduct(){if(this.checkTiktokPlatform()==!1){this.toastr.error("Please select at least one platform for TikTok channel","Platform is Required");return}this.uploadProductService.onUploadProduct(this.channelProductUploads())}checkTiktokPlatform(){return this.channelProductUploads().every(e=>e.type==Ct.Tiktok&&h.IsNotEmpty(e?.categoryId)?e.listing_platforms.length>0:!0)}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=x({type:r,selectors:[["app-product-upload"]],features:[I([ct,Gt,jt,mt])],decls:17,vars:5,consts:[["headerTitle","Upload Product To Channel",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-upload"],[1,"container-fluid","mt-6"],[1,"ps-3","mt-8","pb-5","fw-medium"],[1,"row","mb-10","ps-3"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"ps-3","mb-8","border-bottom","pb-5","fw-medium"],[1,"row","mb-6"],[3,"productId","title","image","description","imageForZoom","code","showFooter"],[1,"col-12"],[1,"row"],[1,"col-3"],[1,"d-flex","align-items-center"],["color","primary",1,"example-margin",3,"ngModel"],[3,"typeId","showChannelName"],[2,"overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"matTooltip","matTooltipShowDelay"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip"],[3,"disabled","channelId","channelType","categoryId"],[1,"row","my-3"],["color","primary",1,"example-margin",3,"ngModelChange","ngModel"],["disabled","","type","text","placeholder","Category Unavailable",1,"form-control","rounded-1",2,"height","35px"],[3,"selectedCategory","disabled","channelId","channelType","categoryId"],[1,"col-12","ps-11"],[3,"categoryId","channelId","channelType"],[3,"categoryId","channelId"],[3,"attributesChanges","categoryId","channelId","channelType"],[3,"attributesChanges","onPlatformChanges","categoryId","channelId"],[3,"attributesChanges","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(e,a){if(e&1&&(c(0,"mainpanel",0)(1,"actions")(2,"button",1),F("click",function(){return a.onUploadProduct()}),_(3,"i",2),f(4," Upload "),s()(),c(5,"content")(6,"div",3)(7,"h3",4),f(8,"Product To Upload"),s(),c(9,"div",5),V(10,Pe,2,7,"div",6,w),v(12,"async"),s(),c(13,"h3",7),f(14,"Channel To Upload"),s(),V(15,Le,19,10,"div",8,w),s()()()),e&2){let o;d("hideSearchBox",!0)("hideSearchDropdown",!0),p(2),d("disabled",((o=a.channelProductUploads())==null?null:o.length)==0),p(8),U(T(12,3,a.selectedProducts$)),p(5),U(a.channelProductUploads())}},dependencies:[A,Xt,Bt,Jt,Kt,Yt,et,L,Mt,Rt,$t,te,ee,ie,oe,Wt,zt,Zt,S],encapsulation:2});let t=r;return t})();export{en as ProductUploadComponent};