marketplacepos 5.46.4 → 5.46.6

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 (90) hide show
  1. package/Marketplace/3rdpartylicenses.txt +43 -43
  2. package/Marketplace/{chunk-T4OUIM2Z.js → chunk-22ARBR7W.js} +1 -1
  3. package/Marketplace/{chunk-QTTNQJAK.js → chunk-2BV7ZXRB.js} +1 -1
  4. package/Marketplace/{chunk-EEZKQOJW.js → chunk-2DLU2LJJ.js} +1 -1
  5. package/Marketplace/{chunk-PQQSREEC.js → chunk-3PPLPXAX.js} +2 -2
  6. package/Marketplace/{chunk-7ZMHGW2W.js → chunk-4HOZLG47.js} +1 -1
  7. package/Marketplace/{chunk-HGGI2V4H.js → chunk-5BHSTOJT.js} +1 -1
  8. package/Marketplace/chunk-5DTUHJSS.js +1 -0
  9. package/Marketplace/{chunk-GHFADTRR.js → chunk-5EIQGYTB.js} +1 -1
  10. package/Marketplace/{chunk-5G2U27IM.js → chunk-5KUKIH4H.js} +1 -1
  11. package/Marketplace/chunk-5Z5Y537T.js +1 -0
  12. package/Marketplace/{chunk-C7YK5TDP.js → chunk-63ANFYRV.js} +1 -1
  13. package/Marketplace/{chunk-DGIH7HSJ.js → chunk-7TI3OR34.js} +1 -1
  14. package/Marketplace/{chunk-5BCJEYHC.js → chunk-7WY57PVD.js} +1 -1
  15. package/Marketplace/{chunk-FY73EXB5.js → chunk-7Y7SPMGZ.js} +1 -1
  16. package/Marketplace/{chunk-KVOROMP7.js → chunk-AWNZSJSP.js} +1 -1
  17. package/Marketplace/{chunk-5KMDUD2M.js → chunk-B2ZWLW3F.js} +1 -1
  18. package/Marketplace/chunk-CBQUB3KW.js +1 -0
  19. package/Marketplace/{chunk-HS64MICX.js → chunk-CRD4OUSG.js} +1 -1
  20. package/Marketplace/{chunk-W4MTON2T.js → chunk-CT73GC7O.js} +1 -1
  21. package/Marketplace/chunk-D2TELRO7.js +1 -0
  22. package/Marketplace/{chunk-GQXYHXWJ.js → chunk-DXPLB6OB.js} +1 -1
  23. package/Marketplace/chunk-EFB55SZR.js +1 -0
  24. package/Marketplace/{chunk-BG4CT2T7.js → chunk-ELZBUFG5.js} +1 -1
  25. package/Marketplace/chunk-EUYQST7Q.js +1 -0
  26. package/Marketplace/{chunk-WIMLQM6B.js → chunk-EXSI44LD.js} +2 -2
  27. package/Marketplace/{chunk-PHLSX23M.js → chunk-F2XHUFJC.js} +2 -2
  28. package/Marketplace/chunk-F3GLNINI.js +1 -0
  29. package/Marketplace/{chunk-34DHFHCG.js → chunk-FHNST4Y7.js} +1 -1
  30. package/Marketplace/{chunk-P35PCOWA.js → chunk-FKQ7ZVGD.js} +1 -1
  31. package/Marketplace/{chunk-6K6XBSWF.js → chunk-FOT5AJYX.js} +2 -2
  32. package/Marketplace/{chunk-BIHR6KWH.js → chunk-GSVFDIM6.js} +1 -1
  33. package/Marketplace/{chunk-UWC2EVFY.js → chunk-GZS2MOSK.js} +1 -1
  34. package/Marketplace/{chunk-WY37QAZ4.js → chunk-JAWWMIGP.js} +1 -1
  35. package/Marketplace/{chunk-6DYFCRDG.js → chunk-JUJFPAAU.js} +1 -1
  36. package/Marketplace/{chunk-ZMF3NFLA.js → chunk-JZDOMET2.js} +1 -1
  37. package/Marketplace/chunk-KTB223SK.js +1 -0
  38. package/Marketplace/{chunk-IJVKHW3C.js → chunk-KWHVCPX2.js} +1 -1
  39. package/Marketplace/{chunk-ZKROHCYD.js → chunk-LLHPMXKP.js} +1 -1
  40. package/Marketplace/{chunk-YJKAX7P2.js → chunk-LS7AO6KP.js} +1 -1
  41. package/Marketplace/{chunk-SBLG2UP7.js → chunk-LXXEN7OV.js} +1 -1
  42. package/Marketplace/{chunk-UBA54WUZ.js → chunk-MGLOTL2T.js} +1 -1
  43. package/Marketplace/{chunk-F4X5RWKY.js → chunk-MZWTCBAF.js} +8 -8
  44. package/Marketplace/{chunk-5RAWBW2Q.js → chunk-NDBC2CS6.js} +1 -1
  45. package/Marketplace/{chunk-57MSCWQ4.js → chunk-NFGFM7TW.js} +1 -1
  46. package/Marketplace/{chunk-TKV7XWBT.js → chunk-O2YNPIYM.js} +1 -1
  47. package/Marketplace/{chunk-SWV5QK47.js → chunk-OGJMVAEL.js} +1 -1
  48. package/Marketplace/{chunk-KEQ7PUNM.js → chunk-OO2CSDGF.js} +1 -1
  49. package/Marketplace/{chunk-BVPWV5YO.js → chunk-P2AADVEN.js} +1 -1
  50. package/Marketplace/{chunk-NRUVGW2I.js → chunk-P2IQLBGG.js} +1 -1
  51. package/Marketplace/{chunk-2O4IEGGR.js → chunk-PGP3WHIS.js} +3 -3
  52. package/Marketplace/{chunk-NABJFAKJ.js → chunk-PTNJ3YC5.js} +1 -1
  53. package/Marketplace/chunk-QREUIGWW.js +1 -0
  54. package/Marketplace/{chunk-BPAZ4TES.js → chunk-RGY4FVTG.js} +1 -1
  55. package/Marketplace/{chunk-RU43F4UK.js → chunk-T27ABFCP.js} +1 -1
  56. package/Marketplace/{chunk-2GS6DJ33.js → chunk-TI67Q3JR.js} +1 -1
  57. package/Marketplace/chunk-TMKLT3K2.js +1 -0
  58. package/Marketplace/{chunk-AR6PLQ6X.js → chunk-TWOIWWMO.js} +1 -1
  59. package/Marketplace/{chunk-CJ4F7QUO.js → chunk-UGYIOLBR.js} +1 -1
  60. package/Marketplace/{chunk-NTWV33QC.js → chunk-URGPZLCB.js} +1 -1
  61. package/Marketplace/{chunk-FF4PEO2O.js → chunk-USBIAIK6.js} +1 -1
  62. package/Marketplace/{chunk-32YMOC74.js → chunk-UYFUJBC4.js} +1 -1
  63. package/Marketplace/{chunk-XSJBP4EN.js → chunk-V3ZRQKJA.js} +1 -1
  64. package/Marketplace/{chunk-PNF6K247.js → chunk-WGCIF2R4.js} +2 -2
  65. package/Marketplace/{chunk-NLJHQ4MQ.js → chunk-X4B2FYY3.js} +1 -1
  66. package/Marketplace/chunk-X52QA4QU.js +1 -0
  67. package/Marketplace/chunk-XLWWNO5M.js +1 -0
  68. package/Marketplace/{chunk-2REDCSBO.js → chunk-XONEJSCE.js} +1 -1
  69. package/Marketplace/{chunk-B3HL4DNT.js → chunk-Y4XF2TXJ.js} +1 -1
  70. package/Marketplace/{chunk-TEJITT3W.js → chunk-YEDXFYTD.js} +1 -1
  71. package/Marketplace/chunk-YF4XELSP.js +1 -0
  72. package/Marketplace/{chunk-2WHJU6CS.js → chunk-YU2SDRUC.js} +1 -1
  73. package/Marketplace/{chunk-GCOS7VK3.js → chunk-ZYQD6SBV.js} +10 -10
  74. package/Marketplace/index.html +4 -4
  75. package/Marketplace/{main-QTIXFWWZ.js → main-YKZPM7WW.js} +1 -1
  76. package/package.json +1 -1
  77. package/Marketplace/chunk-4L5TB6FG.js +0 -1
  78. package/Marketplace/chunk-5JBIRETU.js +0 -1
  79. package/Marketplace/chunk-A44LN77B.js +0 -1
  80. package/Marketplace/chunk-CZBE6NFO.js +0 -1
  81. package/Marketplace/chunk-DLZRRLED.js +0 -1
  82. package/Marketplace/chunk-DZJWZ52D.js +0 -1
  83. package/Marketplace/chunk-HGDEIMTN.js +0 -1
  84. package/Marketplace/chunk-LRKVYKNL.js +0 -1
  85. package/Marketplace/chunk-OLANEXLB.js +0 -1
  86. package/Marketplace/chunk-QNX7E4P2.js +0 -1
  87. package/Marketplace/chunk-RI627B2Z.js +0 -1
  88. package/Marketplace/chunk-RXQX7567.js +0 -1
  89. package/Marketplace/chunk-TFM5EMU4.js +0 -1
  90. package/Marketplace/chunk-TYSVSEYQ.js +0 -1
@@ -1,2 +1,2 @@
1
- import{b as Et}from"./chunk-B3HL4DNT.js";import"./chunk-OXWPLJEW.js";import{a as kt}from"./chunk-PFY5UG5D.js";import{a as Te,b as ht,c as gt,d as xe,e as Ie}from"./chunk-FF4PEO2O.js";import"./chunk-DGIH7HSJ.js";import{a as ut,b as be,c as ft,d as ye,f as yt,g as vt,h as Fe,i as Tt,o as ae}from"./chunk-KS7ACI26.js";import{b as It}from"./chunk-PHUHUFYL.js";import{a as Ct}from"./chunk-2WHJU6CS.js";import"./chunk-3GDM5JNY.js";import{b as bt,d as Se}from"./chunk-XXT6F2ZS.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import{b as St}from"./chunk-2O4IEGGR.js";import"./chunk-VFATXJRG.js";import{a as Ft,b as At}from"./chunk-LYPHZP72.js";import"./chunk-EPBVNII2.js";import"./chunk-UZWED4UK.js";import"./chunk-4YRBARG2.js";import"./chunk-5CKVZBHM.js";import"./chunk-BKRCW7SH.js";import"./chunk-RGAKHXPF.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import{a as xt}from"./chunk-RHHHL4OR.js";import"./chunk-NLJHQ4MQ.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import{a as _t,b as ve}from"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import{a as Ce}from"./chunk-HIC5QC3Y.js";import{a as st,b as mt,f as dt}from"./chunk-JBT7GBCM.js";import"./chunk-UMP6ZMEJ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import"./chunk-JVNHFIYT.js";import"./chunk-C7YK5TDP.js";import{a as pt}from"./chunk-GHFADTRR.js";import"./chunk-UWC2EVFY.js";import"./chunk-ACIMXBIC.js";import"./chunk-BVPWV5YO.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import{b as ot,e as re}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{d as H,e as Y}from"./chunk-PYXL7UF7.js";import{b as De,c as h}from"./chunk-RXQX7567.js";import{m as lt,n as ct}from"./chunk-HJXYT6MI.js";import{A as oe,B as G,a as Qe,c as ne,e as me,h as $,i as W,l as ge,m as Ze,n as X,q as K,r as et,s as J,t as tt,u as it,v as nt,z as q}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import{r as rt,s as at}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{g as A,j as k,n as T}from"./chunk-FXQKRJWU.js";import{$ as Ye,$c as x,Fc as _e,Gb as v,Gc as f,Hb as fe,Hc as ie,Ic as Q,K as Ge,Ka as D,Kc as Ke,Lc as Je,M as He,Mb as _,Mc as qe,Na as je,Oa as Me,Qc as F,Rc as he,Xb as We,Yb as p,Z as te,Zb as Oe,ad as I,ca as se,dc as S,ea as U,ec as B,f as de,g as $e,gc as L,hc as R,ic as s,ja as M,jc as a,jd as ze,ka as ue,kc as d,lc as N,mc as w,oc as E,pa as u,rb as c,tc as y,uc as l,v as V,xa as O,xb as j,xc as Xe,ya as C,za as b}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var z=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}(z||{});var le=function(t){return t[t.FORMAT_NORMAL=1]="FORMAT_NORMAL",t[t.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",t}(le||{});var ce=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}(ce||{});var Ne=class extends ge{setValue(m,e){if(m instanceof Date){let i=Math.floor(m.getTime()/1e3);super.setValue(i,e)}else super.setValue(m,e)}},we=(()=>{class t{constructor(){this.shopeeUploadService=u(Te),this.formBuilder=u(q)}getAttributes(e){return this.shopeeUploadService.getAttributes(e.channelId,e.categoryId).pipe(V(i=>this.setLabelToIndonesian(i)))}setLabelToIndonesian(e=[]){let i,n;return e=e.map(o=>(i=o?.multi_lang?.find(r=>r.language=="id"),o.attribute_value_list=o?.attribute_value_list?.map(r=>(n=r?.multi_lang?.find(g=>g.language=="id"),r.name=n?.value,r)),o.name=i?.value?i?.value:o.name,o)),e}createFormGroup(e){let i=this.formBuilder.group({}),n=[];return e.forEach(o=>{if(n=[],o.mandatory&&n.push(me.required),o?.attribute_info?.format_type==le.FORMAT_QUANTITATIVE_WITH_UNIT&&o?.attribute_info?.input_type==z.FREE_TEXT_FILED){let r=this.formBuilder.group({unit:new ge(null),value:new ge(null,n)});i.addControl(JSON.stringify(o.attribute_id),r)}else o?.attribute_info?.input_type==z.FREE_TEXT_FILED&&o?.attribute_info?.input_validation_type==ce.VALIDATOR_DATE_TYPE?i.addControl(JSON.stringify(o.attribute_id),new Ne(null,n)):i.addControl(JSON.stringify(o.attribute_id),this.formBuilder.control(null,n))}),i}getFilteredAttributes(e,i){let n=JSON.parse(JSON.stringify(e)),o=Object.keys(i),r=n.filter(g=>o.findIndex(Pe=>parseInt(Pe)==g.attribute_id||g.mandatory)!=-1);return r=this.filterSelectedAttributes(r,i),r}filterSelectedAttributes(e,i){return e.map(o=>{switch(o.attribute_info.input_type){case z.MULTI_COMBO_BOX:h.IsNotEmpty(i[o.attribute_id])?o.attribute_value_list=o.attribute_value_list.filter(r=>i[o.attribute_id]?.findIndex(g=>g==r.value_id)!=-1):o.attribute_value_list=[];break;case z.FREE_TEXT_FILED:o.attribute_info.format_type==le.FORMAT_QUANTITATIVE_WITH_UNIT?o.attribute_value_list=this.setSelectedQuantitativeAttr(i[o.attribute_id]?.value,i[o.attribute_id]?.unit):o.attribute_info.input_validation_type==ce.VALIDATOR_DATE_TYPE?o.attribute_value_list=this.setSelectedDateAttr(i[o.attribute_id]):o.attribute_value_list=this.setSelectedQuantitativeAttr(i[o.attribute_id]);break;default:o.attribute_value_list=o.attribute_value_list.filter(r=>r.value_id==i[o.attribute_id])}return o}).filter(o=>o?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(e,i){let n=[];if(h.IsNotEmpty(e)){let o={value_id:0,original_value_name:JSON.stringify(e)};h.IsNotEmpty(i)&&(o.value_unit=i),n=[o]}return n}setSelectedDateAttr(e){let i=[];return h.IsNotEmpty(e)&&(i=[{value_id:0,original_value_name:JSON.stringify(e)}]),i}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=M({token:t,factory:t.\u0275fac})}}return t})();var Ae=(()=>{class t{constructor(){this._calendarHeaderConfig=new $e({hideBtnClear:!1,hideBtnToday:!1}),this.calendarConfig=this._calendarHeaderConfig.value}setHeaderConfig(e){this._calendarHeaderConfig.next(e)}getHeaderConfig$(){return this._calendarHeaderConfig.asObservable()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=M({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var $t=["class","component ts"];function Gt(t,m){if(t&1){let e=E();s(0,"button",3),y("click",function(){C(e);let n=l(2);return b(n.todayClicked())}),d(1,"i",4),a()}}function Ht(t,m){if(t&1){let e=E();s(0,"button",5),y("click",function(){C(e);let n=l(2);return b(n.clearClicked())}),d(1,"i",6),a()}}function Yt(t,m){if(t&1&&(N(0),_(1,Gt,2,0,"button",1)(2,Ht,2,0,"button",2),w()),t&2){let e=m.ngIf;c(),p("ngIf",!e.hideBtnToday),c(),p("ngIf",!e.hideBtnClear)}}var Mt=(()=>{class t{constructor(e,i,n,o,r){this._datePicker=e,this._calendar=i,this._dateAdapter=n,this.calendarService=o,this._destroyed=new de,i.stateChanges.pipe(se(this._destroyed)).subscribe(g=>r.markForCheck()),this.calendarConfig$=this.calendarService.getHeaderConfig$()}todayClicked(){this._calendar.activeDate=this._dateAdapter.today(),this._datePicker.select(this._dateAdapter.today()),this._datePicker.close()}clearClicked(){this._datePicker.select(null),this._datePicker.close()}ngOnChanges(e){this._calendar.ngOnChanges(e)}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}static{this.\u0275fac=function(i){return new(i||t)(j(Fe),j(vt),j(be),j(Ae),j(ze))}}static{this.\u0275cmp=v({type:t,selectors:[["POS-DatepickerHeader",8,"component","ts"]],standalone:!1,features:[O],attrs:$t,decls:3,vars:3,consts:[[4,"ngIf"],["mat-icon-button","","title","Today",3,"click",4,"ngIf"],["mat-icon-button","","title","Clear",3,"click",4,"ngIf"],["mat-icon-button","","title","Today",3,"click"],[1,"far","fa-clock",2,"font-size","18px"],["mat-icon-button","","title","Clear",3,"click"],[1,"far","fa-xmark-circle",2,"font-size","18px"]],template:function(i,n){i&1&&(s(0,"mat-calendar-header"),_(1,Yt,3,2,"ng-container",0),x(2,"async"),a()),i&2&&(c(),p("ngIf",I(2,1,n.calendarConfig$)))},dependencies:[A,bt,yt,k],encapsulation:2})}}return t})(),Ot=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=fe({type:t})}static{this.\u0275inj=ue({providers:[ae],imports:[T,Se,ye,ae,Ce,ve]})}}return t})();function jt(t,m){if(t&1&&(s(0,"mat-label",7)(1,"span"),f(2),a()()),t&2){let e=l();p("show",e.placeholder),c(2),ie(e.placeholder)}}var Wt={parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"dddd, D MMMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"dddd, D MMMM YYYY",monthYearA11yLabel:"MMMM YYYY"}},Dt=(()=>{class t{set hidelClearBtn(e){this.calendarService.setHeaderConfig({hideBtnClear:e,hideBtnToday:this.calendarService.calendarConfig.hideBtnToday})}change(e){let i=null;e&&(i=e.toDate(),i.setHours(0,0,0,0)),this.onChange(i),this.dateChange.emit(i)}constructor(e){this.calendarService=e,this.headerComponent=Mt,this.appearance="outline",this.isFloatingLabel=!0,this.disabled=!1,this.readOnly=!1,this.dateChange=new D,this.minDate=h.MinDate,this.onChange=i=>{},this.displayToggle=!0}writeValue(e){this.date=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){this.disabled=e}onOpenDatepicker(){let e=document.getElementById("dropdown-filter");if(e){var i=new bootstrap.Dropdown(e);i&&(i._config.autoClose="inside")}}onCloseDatepicker(){let e=document.getElementById("dropdown-filter");if(e){var i=new bootstrap.Dropdown(e);i&&(i._config.autoClose="outside")}}ngOnDestroy(){this.calendarService.setHeaderConfig({hideBtnClear:!1,hideBtnToday:!1})}static{this.\u0275fac=function(i){return new(i||t)(j(Ae))}}static{this.\u0275cmp=v({type:t,selectors:[["datepicker"]],inputs:{data_cy:"data_cy",placeholder:"placeholder",displayToggle:"displayToggle",appearance:"appearance",width:"width",isFloatingLabel:"isFloatingLabel",date:"date",disabled:"disabled",readOnly:"readOnly",minDateValidation:"minDateValidation",maxDateValidation:"maxDateValidation",hidelClearBtn:"hidelClearBtn"},outputs:{dateChange:"dateChange"},standalone:!1,features:[F([{provide:be,useClass:kt,deps:[ut]},{provide:ft,useValue:Wt},{provide:Qe,multi:!0,useExisting:t}])],decls:7,vars:16,consts:[["picker1",""],[1,"datepicker",3,"disabled","appearance"],[3,"show",4,"ngIf"],["matInput","",3,"dateChange","click","matDatepicker","min","max","placeholder","value","disabled","readonly"],["matSuffix","","aria-hidden","true",1,"datepicker-toggle-icon",3,"click"],[1,"fa-regular","fa-angle-down"],[3,"opened","closed","calendarHeaderComponent"],[3,"show"]],template:function(i,n){if(i&1){let o=E();s(0,"mat-form-field",1),_(1,jt,3,2,"mat-label",2),s(2,"input",3),y("dateChange",function(g){return C(o),b(n.change(g.value))})("click",function(){C(o);let g=_e(6);return b(g.open())}),a(),s(3,"span",4),y("click",function(){C(o);let g=_e(6);return b(g.open())}),d(4,"i",5),a(),s(5,"mat-datepicker",6,0),y("opened",function(){return C(o),b(n.onOpenDatepicker())})("closed",function(){return C(o),b(n.onCloseDatepicker())}),a()()}if(i&2){let o=_e(6);Oe("width",n.width||100,"%"),p("disabled",n.disabled)("appearance",n.appearance),c(),p("ngIf",n.isFloatingLabel&&n.placeholder),c(),Xe("placeholder",n.placeholder||""),p("matDatepicker",o)("min",n.minDateValidation)("max",n.maxDateValidation)("value",n.date==n.minDate?null:n.date)("disabled",n.disabled)("readonly",n.readOnly),We("data-cy",n.data_cy),c(),Oe("display",n.displayToggle?"unset":"none"),c(2),p("calendarHeaderComponent",n.headerComponent)}},dependencies:[A,Fe,Tt,dt,st,mt,_t],styles:[`.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:3px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{top:28px!important;font-size:16px;color:#9da2a6}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:23px!important;font-size:.875rem;color:#ccc}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}.datepicker .datepicker-toggle-icon{width:28px;height:36px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;margin-right:6px}.datepicker .datepicker-toggle-icon i{font-family:"Font Awesome 6 Pro","Font Awesome 6 Free","Font Awesome 5 Pro","Font Awesome 5 Free";font-weight:400;font-size:16px;line-height:1;color:#6b7280}
1
+ import{b as Et}from"./chunk-Y4XF2TXJ.js";import{a as kt}from"./chunk-PFY5UG5D.js";import{a as Te,b as ht,c as gt,d as xe,e as Ie}from"./chunk-USBIAIK6.js";import"./chunk-7TI3OR34.js";import{a as ut,b as be,c as ft,d as ye,f as yt,g as vt,h as Fe,i as Tt,o as ae}from"./chunk-KS7ACI26.js";import{b as It}from"./chunk-PHUHUFYL.js";import{a as Ct}from"./chunk-YU2SDRUC.js";import"./chunk-3GDM5JNY.js";import{b as bt,d as Se}from"./chunk-XXT6F2ZS.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import{b as St}from"./chunk-PGP3WHIS.js";import"./chunk-VFATXJRG.js";import{a as Ft,b as At}from"./chunk-LYPHZP72.js";import{a as xt}from"./chunk-RHHHL4OR.js";import"./chunk-X4B2FYY3.js";import{a as _t,b as ve}from"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import{a as Ce}from"./chunk-HIC5QC3Y.js";import{a as st,b as mt,f as dt}from"./chunk-JBT7GBCM.js";import"./chunk-UMP6ZMEJ.js";import"./chunk-JVNHFIYT.js";import"./chunk-OXWPLJEW.js";import"./chunk-EPBVNII2.js";import"./chunk-UZWED4UK.js";import"./chunk-5CKVZBHM.js";import"./chunk-4YRBARG2.js";import"./chunk-BKRCW7SH.js";import"./chunk-RGAKHXPF.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import"./chunk-63ANFYRV.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import{a as pt}from"./chunk-5EIQGYTB.js";import"./chunk-GZS2MOSK.js";import"./chunk-ACIMXBIC.js";import{d as H,e as Y}from"./chunk-PYXL7UF7.js";import"./chunk-P2AADVEN.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import{b as ot,e as re}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{b as De,c as h}from"./chunk-EUYQST7Q.js";import{m as lt,n as ct}from"./chunk-HJXYT6MI.js";import{A as oe,B as G,a as Qe,c as ne,e as me,h as $,i as W,l as ge,m as Ze,n as X,q as K,r as et,s as J,t as tt,u as it,v as nt,z as q}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import{r as rt,s as at}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{g as A,j as k,n as T}from"./chunk-FXQKRJWU.js";import{$ as Ye,$c as x,Fc as _e,Gb as v,Gc as f,Hb as fe,Hc as ie,Ic as Q,K as Ge,Ka as D,Kc as Ke,Lc as Je,M as He,Mb as _,Mc as qe,Na as je,Oa as Me,Qc as F,Rc as he,Xb as We,Yb as p,Z as te,Zb as Oe,ad as I,ca as se,dc as S,ea as U,ec as B,f as de,g as $e,gc as L,hc as R,ic as s,ja as M,jc as a,jd as ze,ka as ue,kc as d,lc as N,mc as w,oc as E,pa as u,rb as c,tc as y,uc as l,v as V,xa as O,xb as j,xc as Xe,ya as C,za as b}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var z=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}(z||{});var le=function(t){return t[t.FORMAT_NORMAL=1]="FORMAT_NORMAL",t[t.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",t}(le||{});var ce=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}(ce||{});var Ne=class extends ge{setValue(m,e){if(m instanceof Date){let i=Math.floor(m.getTime()/1e3);super.setValue(i,e)}else super.setValue(m,e)}},we=(()=>{class t{constructor(){this.shopeeUploadService=u(Te),this.formBuilder=u(q)}getAttributes(e){return this.shopeeUploadService.getAttributes(e.channelId,e.categoryId).pipe(V(i=>this.setLabelToIndonesian(i)))}setLabelToIndonesian(e=[]){let i,n;return e=e.map(o=>(i=o?.multi_lang?.find(r=>r.language=="id"),o.attribute_value_list=o?.attribute_value_list?.map(r=>(n=r?.multi_lang?.find(g=>g.language=="id"),r.name=n?.value,r)),o.name=i?.value?i?.value:o.name,o)),e}createFormGroup(e){let i=this.formBuilder.group({}),n=[];return e.forEach(o=>{if(n=[],o.mandatory&&n.push(me.required),o?.attribute_info?.format_type==le.FORMAT_QUANTITATIVE_WITH_UNIT&&o?.attribute_info?.input_type==z.FREE_TEXT_FILED){let r=this.formBuilder.group({unit:new ge(null),value:new ge(null,n)});i.addControl(JSON.stringify(o.attribute_id),r)}else o?.attribute_info?.input_type==z.FREE_TEXT_FILED&&o?.attribute_info?.input_validation_type==ce.VALIDATOR_DATE_TYPE?i.addControl(JSON.stringify(o.attribute_id),new Ne(null,n)):i.addControl(JSON.stringify(o.attribute_id),this.formBuilder.control(null,n))}),i}getFilteredAttributes(e,i){let n=JSON.parse(JSON.stringify(e)),o=Object.keys(i),r=n.filter(g=>o.findIndex(Pe=>parseInt(Pe)==g.attribute_id||g.mandatory)!=-1);return r=this.filterSelectedAttributes(r,i),r}filterSelectedAttributes(e,i){return e.map(o=>{switch(o.attribute_info.input_type){case z.MULTI_COMBO_BOX:h.IsNotEmpty(i[o.attribute_id])?o.attribute_value_list=o.attribute_value_list.filter(r=>i[o.attribute_id]?.findIndex(g=>g==r.value_id)!=-1):o.attribute_value_list=[];break;case z.FREE_TEXT_FILED:o.attribute_info.format_type==le.FORMAT_QUANTITATIVE_WITH_UNIT?o.attribute_value_list=this.setSelectedQuantitativeAttr(i[o.attribute_id]?.value,i[o.attribute_id]?.unit):o.attribute_info.input_validation_type==ce.VALIDATOR_DATE_TYPE?o.attribute_value_list=this.setSelectedDateAttr(i[o.attribute_id]):o.attribute_value_list=this.setSelectedQuantitativeAttr(i[o.attribute_id]);break;default:o.attribute_value_list=o.attribute_value_list.filter(r=>r.value_id==i[o.attribute_id])}return o}).filter(o=>o?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(e,i){let n=[];if(h.IsNotEmpty(e)){let o={value_id:0,original_value_name:JSON.stringify(e)};h.IsNotEmpty(i)&&(o.value_unit=i),n=[o]}return n}setSelectedDateAttr(e){let i=[];return h.IsNotEmpty(e)&&(i=[{value_id:0,original_value_name:JSON.stringify(e)}]),i}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=M({token:t,factory:t.\u0275fac})}}return t})();var Ae=(()=>{class t{constructor(){this._calendarHeaderConfig=new $e({hideBtnClear:!1,hideBtnToday:!1}),this.calendarConfig=this._calendarHeaderConfig.value}setHeaderConfig(e){this._calendarHeaderConfig.next(e)}getHeaderConfig$(){return this._calendarHeaderConfig.asObservable()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=M({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var $t=["class","component ts"];function Gt(t,m){if(t&1){let e=E();s(0,"button",3),y("click",function(){C(e);let n=l(2);return b(n.todayClicked())}),d(1,"i",4),a()}}function Ht(t,m){if(t&1){let e=E();s(0,"button",5),y("click",function(){C(e);let n=l(2);return b(n.clearClicked())}),d(1,"i",6),a()}}function Yt(t,m){if(t&1&&(N(0),_(1,Gt,2,0,"button",1)(2,Ht,2,0,"button",2),w()),t&2){let e=m.ngIf;c(),p("ngIf",!e.hideBtnToday),c(),p("ngIf",!e.hideBtnClear)}}var Mt=(()=>{class t{constructor(e,i,n,o,r){this._datePicker=e,this._calendar=i,this._dateAdapter=n,this.calendarService=o,this._destroyed=new de,i.stateChanges.pipe(se(this._destroyed)).subscribe(g=>r.markForCheck()),this.calendarConfig$=this.calendarService.getHeaderConfig$()}todayClicked(){this._calendar.activeDate=this._dateAdapter.today(),this._datePicker.select(this._dateAdapter.today()),this._datePicker.close()}clearClicked(){this._datePicker.select(null),this._datePicker.close()}ngOnChanges(e){this._calendar.ngOnChanges(e)}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}static{this.\u0275fac=function(i){return new(i||t)(j(Fe),j(vt),j(be),j(Ae),j(ze))}}static{this.\u0275cmp=v({type:t,selectors:[["POS-DatepickerHeader",8,"component","ts"]],standalone:!1,features:[O],attrs:$t,decls:3,vars:3,consts:[[4,"ngIf"],["mat-icon-button","","title","Today",3,"click",4,"ngIf"],["mat-icon-button","","title","Clear",3,"click",4,"ngIf"],["mat-icon-button","","title","Today",3,"click"],[1,"far","fa-clock",2,"font-size","18px"],["mat-icon-button","","title","Clear",3,"click"],[1,"far","fa-xmark-circle",2,"font-size","18px"]],template:function(i,n){i&1&&(s(0,"mat-calendar-header"),_(1,Yt,3,2,"ng-container",0),x(2,"async"),a()),i&2&&(c(),p("ngIf",I(2,1,n.calendarConfig$)))},dependencies:[A,bt,yt,k],encapsulation:2})}}return t})(),Ot=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=fe({type:t})}static{this.\u0275inj=ue({providers:[ae],imports:[T,Se,ye,ae,Ce,ve]})}}return t})();function jt(t,m){if(t&1&&(s(0,"mat-label",7)(1,"span"),f(2),a()()),t&2){let e=l();p("show",e.placeholder),c(2),ie(e.placeholder)}}var Wt={parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"dddd, D MMMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"dddd, D MMMM YYYY",monthYearA11yLabel:"MMMM YYYY"}},Dt=(()=>{class t{set hidelClearBtn(e){this.calendarService.setHeaderConfig({hideBtnClear:e,hideBtnToday:this.calendarService.calendarConfig.hideBtnToday})}change(e){let i=null;e&&(i=e.toDate(),i.setHours(0,0,0,0)),this.onChange(i),this.dateChange.emit(i)}constructor(e){this.calendarService=e,this.headerComponent=Mt,this.appearance="outline",this.isFloatingLabel=!0,this.disabled=!1,this.readOnly=!1,this.dateChange=new D,this.minDate=h.MinDate,this.onChange=i=>{},this.displayToggle=!0}writeValue(e){this.date=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){this.disabled=e}onOpenDatepicker(){let e=document.getElementById("dropdown-filter");if(e){var i=new bootstrap.Dropdown(e);i&&(i._config.autoClose="inside")}}onCloseDatepicker(){let e=document.getElementById("dropdown-filter");if(e){var i=new bootstrap.Dropdown(e);i&&(i._config.autoClose="outside")}}ngOnDestroy(){this.calendarService.setHeaderConfig({hideBtnClear:!1,hideBtnToday:!1})}static{this.\u0275fac=function(i){return new(i||t)(j(Ae))}}static{this.\u0275cmp=v({type:t,selectors:[["datepicker"]],inputs:{data_cy:"data_cy",placeholder:"placeholder",displayToggle:"displayToggle",appearance:"appearance",width:"width",isFloatingLabel:"isFloatingLabel",date:"date",disabled:"disabled",readOnly:"readOnly",minDateValidation:"minDateValidation",maxDateValidation:"maxDateValidation",hidelClearBtn:"hidelClearBtn"},outputs:{dateChange:"dateChange"},standalone:!1,features:[F([{provide:be,useClass:kt,deps:[ut]},{provide:ft,useValue:Wt},{provide:Qe,multi:!0,useExisting:t}])],decls:7,vars:16,consts:[["picker1",""],[1,"datepicker",3,"disabled","appearance"],[3,"show",4,"ngIf"],["matInput","",3,"dateChange","click","matDatepicker","min","max","placeholder","value","disabled","readonly"],["matSuffix","","aria-hidden","true",1,"datepicker-toggle-icon",3,"click"],[1,"fa-regular","fa-angle-down"],[3,"opened","closed","calendarHeaderComponent"],[3,"show"]],template:function(i,n){if(i&1){let o=E();s(0,"mat-form-field",1),_(1,jt,3,2,"mat-label",2),s(2,"input",3),y("dateChange",function(g){return C(o),b(n.change(g.value))})("click",function(){C(o);let g=_e(6);return b(g.open())}),a(),s(3,"span",4),y("click",function(){C(o);let g=_e(6);return b(g.open())}),d(4,"i",5),a(),s(5,"mat-datepicker",6,0),y("opened",function(){return C(o),b(n.onOpenDatepicker())})("closed",function(){return C(o),b(n.onCloseDatepicker())}),a()()}if(i&2){let o=_e(6);Oe("width",n.width||100,"%"),p("disabled",n.disabled)("appearance",n.appearance),c(),p("ngIf",n.isFloatingLabel&&n.placeholder),c(),Xe("placeholder",n.placeholder||""),p("matDatepicker",o)("min",n.minDateValidation)("max",n.maxDateValidation)("value",n.date==n.minDate?null:n.date)("disabled",n.disabled)("readonly",n.readOnly),We("data-cy",n.data_cy),c(),Oe("display",n.displayToggle?"unset":"none"),c(2),p("calendarHeaderComponent",n.headerComponent)}},dependencies:[A,Fe,Tt,dt,st,mt,_t],styles:[`.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:3px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{top:28px!important;font-size:16px;color:#9da2a6}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:23px!important;font-size:.875rem;color:#ccc}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}.datepicker .datepicker-toggle-icon{width:28px;height:36px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;margin-right:6px}.datepicker .datepicker-toggle-icon i{font-family:"Font Awesome 6 Pro","Font Awesome 6 Free","Font Awesome 5 Pro","Font Awesome 5 Free";font-weight:400;font-size:16px;line-height:1;color:#6b7280}
2
2
  `],encapsulation:2})}}return t})(),Nt=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=fe({type:t})}static{this.\u0275inj=ue({providers:[ae],imports:[T,Se,ye,ae,Ce,ve,Ot,It]})}}return t})();var Ve=()=>[];function Kt(t,m){t&1&&(s(0,"span",5),f(1,"*"),a())}function Jt(t,m){if(t&1&&d(0,"ng-select",6),t&2){let e=l().$implicit;p("multiple",!0)("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:he(4,Ve))("placeholder","Pilih "+(e==null?null:e.name))}}function qt(t,m){if(t&1&&d(0,"input",8),t&2){let e=l(2).$implicit;p("formControlName",e.attribute_id)("placeholder","Isi "+(e==null?null:e.name))}}function zt(t,m){if(t&1&&(s(0,"option",15),f(1),a()),t&2){let e=m.$implicit;p("value",e),c(),ie(e)}}function Qt(t,m){if(t&1&&(s(0,"div",10),d(1,"input",12),s(2,"select",13)(3,"option",14),f(4,"Unit"),a(),L(5,zt,2,2,"option",15,B),a()()),t&2){let e=l(3).$implicit;p("formGroupName",e.attribute_id),c(),p("placeholder","Isi "+(e==null?null:e.name)),c(2),p("value",null),c(2),R(e==null||e.attribute_info==null?null:e.attribute_info.attribute_unit_list)}}function Zt(t,m){if(t&1&&d(0,"input",11),t&2){let e=l(3).$implicit;p("formControlName",e.attribute_id)("placeholder","Isi "+(e==null?null:e.name))}}function ei(t,m){if(t&1&&_(0,Qt,7,3,"div",10)(1,Zt,1,2,"input",11),t&2){let e=l(2).$implicit,i=l(2);S((e==null||e.attribute_info==null?null:e.attribute_info.format_type)==i.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function ti(t,m){if(t&1&&d(0,"datepicker",9),t&2){let e=l(2).$implicit;p("formControlName",e.attribute_id)}}function ii(t,m){if(t&1&&_(0,qt,1,2,"input",8)(1,ei,2,1)(2,ti,1,1,"datepicker",9),t&2){let e,i=l().$implicit,n=l(2);S((e=i==null||i.attribute_info==null?null:i.attribute_info.input_validation_type)===n.validationType.VALIDATOR_STRING_TYPE?0:e===n.validationType.VALIDATOR_FLOAT_TYPE?1:e===n.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function ni(t,m){if(t&1&&d(0,"ng-select",7),t&2){let e=l().$implicit;p("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:he(3,Ve))("placeholder","Pilih "+(e==null?null:e.name))}}function oi(t,m){if(t&1&&d(0,"ng-select",7),t&2){let e=l().$implicit;p("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:he(3,Ve))("placeholder","Pilih "+(e==null?null:e.name))}}function ri(t,m){if(t&1&&(s(0,"div",3)(1,"div",4),_(2,Kt,2,0,"span",5),s(3,"span"),f(4),a()(),_(5,Jt,1,5,"ng-select",6)(6,ii,3,1)(7,ni,1,4,"ng-select",7)(8,oi,1,4,"ng-select",7),a()),t&2){let e,i=m.$implicit,n=l(2);c(2),S(i.mandatory?2:-1),c(2),Q(" ",i==null?null:i.name," "),c(),S((e=i==null||i.attribute_info==null?null:i.attribute_info.input_type)===n.inputType.MULTI_COMBO_BOX?5:e===n.inputType.FREE_TEXT_FILED?6:e===n.inputType.SINGLE_COMBO_BOX?7:8)}}function ai(t,m){if(t&1&&(N(0),s(1,"form",1)(2,"div",2),L(3,ri,9,3,"div",3,B),a()(),w()),t&2){let e=m.ngIf,i=l();c(),p("formGroup",i.form),c(2),R(e)}}var wt=(()=>{class t{constructor(){this.formCategoryService=u(we),this.attributesChanges=new D,this.inputType=z,this.formatType=le,this.validationType=ce}ngOnChanges(){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:this.categoryId,channelId:this.channelId,channelType:this.channelType}).pipe(U(e=>{this.form=this.formCategoryService.createFormGroup(e),this.listenToFormChange(e)}),te(1)))}listenToFormChange(e){let i=[];this.formSubscription=this.form.valueChanges.subscribe(n=>{i=this.formCategoryService.getFilteredAttributes(e,n),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["shopee-attribute-form"]],inputs:{channelType:"channelType",categoryId:"categoryId",channelId:"channelId",channelProductUpload:"channelProductUpload"},outputs:{attributesChanges:"attributesChanges"},features:[F([we]),O],decls:2,vars:3,consts:[[4,"ngIf"],[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(i,n){i&1&&(_(0,ai,5,1,"ng-container",0),x(1,"async")),i&2&&p("ngIf",I(1,1,n.attributes$))},dependencies:[T,A,k,Y,H,G,X,it,nt,ne,tt,$,W,K,J,et,xt,Nt,Dt],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{--mdc-icon-button-state-layer-size: 36px}"]})}}return t})();var ee=function(t){return t.TIKTOK_SHOP="TIKTOK_SHOP",t.TOKOPEDIA="TOKOPEDIA",t}(ee||{});var Ue=(()=>{class t{constructor(){this.httpService=u(re),this.formBuilder=u(q),this.uploadProductService=u(Ie)}getAttributes(e,i){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:e},{key:"CategoryID",value:i}]).pipe(Ge(o=>this.uploadProductService.selectedProduct$.pipe(V(r=>(o=this.mappingAttributeSalesProperty(o,r),o)))))}mappingAttributeSalesProperty(e,i){let n=0;return e.filter(o=>(o.type=="SALES_PROPERTY"&&(n+=1),n>1?(n=0,!1):!0)).map(o=>(o.type=="SALES_PROPERTY"&&(o.name="Jenis Variant",o.is_multiple_selection=!1,o.is_required=this.isProductHasMoreVariant(i),o.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),o))}isProductHasMoreVariant(e){let i=!1,n=[];return e.forEach(o=>{o.Variants&&n.push(o.Variants.length)}),i=n.some(o=>o>1),i}createFormGroup(e){let i=this.formBuilder.group({}),n=[];return e.forEach(o=>{n=[],o.is_required&&n.push(me.required),i.addControl(o.id,this.formBuilder.control(null,n))}),i.addControl("listingPlatform",this.formBuilder.control([ee.TIKTOK_SHOP,ee.TOKOPEDIA],[me.required])),i}getFilteredAttributes(e,i){let n=JSON.parse(JSON.stringify(e)),o=Object.keys(i),r=n.filter(g=>o.findIndex(Pe=>parseInt(Pe)==g.id)!=-1);return r=this.filterSelectedAttributes(r,i),r}filterSelectedAttributes(e,i){return e.map(o=>(h.IsNotEmpty(o.values)?o.is_multiple_selection?o.values=o.values.filter(r=>i[o.id]?.includes(r.id)):o.values=o.values.filter(r=>r.id==i[o.id]):i[o.id]&&(o.values=[{id:null,name:i[o.id]}]),o)).filter(o=>o?.values?.length>0)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=M({token:t,factory:t.\u0275fac})}}return t})();function li(t,m){t&1&&(s(0,"small",6),f(1," Platform is required "),a())}function ci(t,m){t&1&&(s(0,"span",6),f(1,"*"),a())}function pi(t,m){if(t&1&&d(0,"ng-select",7),t&2){let e=l().$implicit;p("multiple",!0)("formControlName",e.id)("items",e.values)("placeholder","Pilih "+(e==null?null:e.name))}}function si(t,m){if(t&1&&d(0,"ng-select",8),t&2){let e=l().$implicit;p("formControlName",e.id)("items",e.values)("placeholder","Pilih "+(e==null?null:e.name))}}function mi(t,m){if(t&1&&d(0,"input",9),t&2){let e=l().$implicit;p("formControlName",e.id)("placeholder",e==null?null:e.name)}}function di(t,m){if(t&1&&(s(0,"small",6),f(1),a()),t&2){let e=l().$implicit;c(),Q(" ",e==null?null:e.name," is mandatory ")}}function ui(t,m){if(t&1&&(s(0,"div",3)(1,"div",4),_(2,ci,2,0,"span",6),s(3,"span"),f(4),a()(),_(5,pi,1,4,"ng-select",7)(6,si,1,3,"ng-select",8)(7,mi,1,2,"input",9)(8,di,2,1,"small",6),a()),t&2){let e=m.$implicit;c(2),S(e.is_required?2:-1),c(2),Q(" ",e==null?null:e.name," "),c(),S(e.is_multiple_selection?5:e.values!==null&&e.values.length>0?6:7),c(3),S(e.is_required?8:-1)}}function fi(t,m){if(t&1&&(N(0),s(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"span"),f(6," Platform Options"),a()(),d(7,"ng-select",5),_(8,li,2,0,"small",6),a(),L(9,ui,9,4,"div",3,B),a()(),w()),t&2){let e,i=m.ngIf,n=l();c(),p("formGroup",n.form),c(6),p("multiple",!0)("items",n.platformOptions)("clearable",!1),c(),S(!(n.form==null||(e=n.form.get("listingPlatform").errors)==null)&&e.required?8:-1),c(),R(i)}}var Vt=(()=>{class t{constructor(){this.tiktokAttributeFormService=u(Ue),this.platformChange=je({alias:"onPlatformChanges"}),this.formSubscription=new de,this.attributesChanges=new D,this.platformOptions=[{label:"TikTok Shop",value:ee.TIKTOK_SHOP},{label:"Tokopedia",value:ee.TOKOPEDIA}]}ngOnChanges(){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(this.channelId,this.categoryId).pipe(V(e=>e.filter(i=>!(i.type=="PRODUCT_PROPERTY"&&(h.IsEmpty(i.values)||i.values?.length==0)&&i.is_customizable==!1))),U(e=>{this.form=this.tiktokAttributeFormService.createFormGroup(e),this.listenToFormChange(e)}),te(1)))}listenToFormChange(e){let i=[];this.form.valueChanges.pipe(se(this.formSubscription)).subscribe(n=>{delete n.listingPlatform,i=this.tiktokAttributeFormService.getFilteredAttributes(e,n),this.attributesChanges.emit(i)}),this.form.get("listingPlatform").valueChanges.pipe(Ye(this.form.get("listingPlatform").value),se(this.formSubscription)).subscribe(n=>{this.platformChange.emit(n)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["tiktok-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{platformChange:"onPlatformChanges",attributesChanges:"attributesChanges"},features:[F([Ue]),O],decls:2,vars:3,consts:[[4,"ngIf"],[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(i,n){i&1&&(_(0,fi,11,5,"ng-container",0),x(1,"async")),i&2&&p("ngIf",I(1,1,n.attributes$))},dependencies:[T,A,k,Y,H,G,X,ne,$,W,K,J,oe],encapsulation:2})}}return t})();var Be=(()=>{class t{constructor(){this.woocommerceUploadService=u(xe)}getAttributes(e,i){return this.woocommerceUploadService.getAttributes(e,i).pipe(V(n=>n.map(o=>({key:o.name,label:o.name}))))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=M({token:t,factory:t.\u0275fac})}}return t})();var Ut=(()=>{class t{constructor(){this.wooAttributeFormService=u(Be),this.channelId=Me(),this.categoryId=Me(),this.attributesChanges=new D}ngOnChanges(){h.IsNotEmpty(this.categoryId())&&h.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(e){this.attributesChanges.emit([e.key])}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[F([Be]),O],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(i,n){i&1&&(s(0,"div",0)(1,"div",1)(2,"div",2),f(3,"Atribut"),a(),s(4,"ng-select",3),x(5,"async"),y("change",function(r){return n.onSelectAttribute(r)}),a()()()),i&2&&(c(4),p("items",I(5,1,n.attributes$)))},dependencies:[T,k,oe,Y,H,G],encapsulation:2})}}return t})();var Le=(()=>{class t{constructor(){this.httpService=u(re),this.formBuilder=u(q)}getAttributes(e,i){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:e},{key:"CategoryID",value:i}]).pipe(V(o=>o))}createFormGroup(e){let i=this.formBuilder.group({});return e.forEach(n=>{i.addControl(n.variant,this.formBuilder.control(null))}),i}convertAttributes(e={}){return Object.values(e).filter(n=>n!==null).map(n=>JSON.stringify(n))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=M({token:t,factory:t.\u0275fac})}}return t})();function _i(t,m){if(t&1&&(s(0,"div",3)(1,"div",4),f(2),a(),d(3,"ng-select",5),a()),t&2){let e=m.$implicit;c(2),Q(" ",e==null?null:e.variant," "),c(),p("formControlName",e.variant)("items",e.values)("placeholder","Pilih "+(e==null?null:e.variant))}}function hi(t,m){if(t&1&&(N(0),s(1,"form",1)(2,"div",2),L(3,_i,4,4,"div",3,B),a()(),w()),t&2){let e=m.ngIf,i=l();c(),p("formGroup",i.form),c(2),R(e)}}var Bt=(()=>{class t{constructor(){this.tokpedAttrFormService=u(Le),this.attributesChanges=new D}ngOnInit(){}ngOnChanges(e){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(this.channelId,this.categoryId).pipe(U(i=>{this.form=this.tokpedAttrFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){let e=[];this.formSubscription=this.form.valueChanges.subscribe(i=>{e=this.tokpedAttrFormService.convertAttributes(i),this.attributesChanges.emit(e)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[F([Le]),O],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(i,n){i&1&&(_(0,hi,5,1,"ng-container",0),x(1,"async")),i&2&&p("ngIf",I(1,1,n.attributes$))},dependencies:[T,A,k,Y,H,G,X,$,W,K,J],encapsulation:2})}}return t})();var Re=(()=>{class t{constructor(){this.httpService=u(re),this.formBuilder=u(q)}getAttributes(e){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:e}]).pipe(U(n=>(n.Options.StatusOptions=n.Options.Status.map(o=>({id:o,name:o})),n)))}createFormGroup(e){let i=this.formBuilder.group({});return Object.keys(e.Attribute).forEach(o=>{i.addControl(o,this.formBuilder.control(null))}),i}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=M({token:t,factory:t.\u0275fac})}}return t})();function gi(t,m){if(t&1&&(N(0),s(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4),f(5," Brand "),a(),d(6,"input",5),a(),s(7,"div",6)(8,"div",4),f(9," Product Type "),a(),d(10,"input",7),a(),s(11,"div",6)(12,"div",4),f(13," Status "),a(),d(14,"ng-select",8),a()()(),w()),t&2){let e=m.ngIf,i=l();c(),p("formGroup",i.form),c(13),p("items",e.Options.StatusOptions)}}var Lt=(()=>{class t{constructor(){this.attributesChanges=new D,this.shopifyFormService=u(Re)}ngOnChanges(e){e.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId).pipe(U(i=>{this.form=this.shopifyFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(He(500)).subscribe(e=>{this.attributesChanges.emit([e])})}ngOnDestroy(){this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["shopify-attribute-form"]],inputs:{channelId:"channelId"},outputs:{attributesChanges:"attributesChanges"},features:[F([Re]),O],decls:2,vars:3,consts:[[4,"ngIf"],[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(i,n){i&1&&(_(0,gi,15,2,"ng-container",0),x(1,"async")),i&2&&p("ngIf",I(1,1,n.attributes$))},dependencies:[T,A,k,G,X,ne,$,W,K,J,Y,H],encapsulation:2})}}return t})();function Ci(t,m){if(t&1&&(s(0,"div",6),d(1,"app-product-card",9),a()),t&2){let e=m.$implicit;c(),p("productId",e==null?null:e.ID)("title",e==null?null:e.Name)("image",e==null?null:e.ThumbnailUrl)("description",(e==null||e.Variants==null?null:e.Variants.length)>1?(e==null||e.Variants==null?null:e.Variants.length)+" Variants":null)("imageForZoom",e==null?null:e.ImageUrl)("code",e==null||e.Variants[0]==null?null:e.Variants[0].Code)("showFooter",!1)}}function bi(t,m){if(t&1){let e=E();N(0),s(1,"mat-checkbox",21),qe("ngModelChange",function(n){C(e);let o=l().$implicit;return Je(o.selected,n)||(o.selected=n),b(n)}),y("ngModelChange",function(){let n=C(e).ngIf,o=l(),r=o.$implicit,g=o.$index,pe=l();return b(pe.onSelectChannel(r,g,n))}),a(),w()}if(t&2){let e=l().$implicit;c(),Ke("ngModel",e.selected)}}function yi(t,m){if(t&1&&(s(0,"div",18),d(1,"input",22),a()),t&2){let e=l().$implicit,i=l();p("matTooltip",e.type==i.channelType.Shopify||e.type==i.channelType.ShopifyV2?"Cannot change category, please change category in admin.shopify.com":e.type==i.channelType.Plugo?"You can change the category after the product has been uploaded to the Plugo Dashboard.":"")}}function vi(t,m){if(t&1){let e=E();s(0,"app-channel-category-select",23),y("selectedCategory",function(n){C(e);let o=l().$index,r=l();return b(r.onCategoryChange(o,n))}),a()}if(t&2){let e=l().$implicit,i=l();p("disabled",!e.selected||e.selected&&e.type==i.channelType.Lazada)("channelId",e.id)("channelType",e.type)("categoryId",e.categoryId)}}function Ti(t,m){if(t&1){let e=E();s(0,"shopee-attribute-form",27),y("attributesChanges",function(n){C(e);let o=l(2).$index,r=l();return b(r.onAttributesChange(o,n))}),a()}if(t&2){let e=l(2).$implicit;p("categoryId",e.categoryId)("channelId",e.id)("channelType",e.type)}}function xi(t,m){if(t&1){let e=E();s(0,"tiktok-attribute-form",28),y("attributesChanges",function(n){C(e);let o=l(2).$index,r=l();return b(r.onAttributesChange(o,n))})("onPlatformChanges",function(n){C(e);let o=l(2).$index,r=l();return b(r.onPlatformChange(o,n))}),a()}if(t&2){let e=l(2).$implicit;p("categoryId",e.categoryId)("channelId",e.id)}}function Ii(t,m){if(t&1){let e=E();s(0,"wooocommerce-attribute-form",29),y("attributesChanges",function(n){C(e);let o=l(2).$index,r=l();return b(r.onAttributesChange(o,n))}),a()}if(t&2){let e=l(2).$implicit;p("categoryId",e.categoryId)("channelId",e.id)}}function Si(t,m){if(t&1){let e=E();s(0,"tokopedia-attribute-form",29),y("attributesChanges",function(n){C(e);let o=l(2).$index,r=l();return b(r.onAttributesChange(o,n))}),a()}if(t&2){let e=l(2).$implicit;p("categoryId",e.categoryId)("channelId",e.id)}}function Fi(t,m){if(t&1&&(s(0,"div",20)(1,"div",24),_(2,Ti,1,3,"shopee-attribute-form",25)(3,xi,1,2,"tiktok-attribute-form",26)(4,Ii,1,2,"wooocommerce-attribute-form",26)(5,Si,1,2,"tokopedia-attribute-form",26),a()()),t&2){let e,i=l().$implicit,n=l();c(2),S((e=i.type)===n.channelType.Shopee?2:e===n.channelType.Tiktok?3:e===n.channelType.WooCommerce?4:e===n.channelType.Tokopedia?5:-1)}}function Ai(t,m){if(t&1){let e=E();s(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",30),y("attributesChanges",function(n){C(e);let o=l().$index,r=l();return b(r.onAttributesChange(o,n))}),a()()()}if(t&2){let e=l().$implicit;c(2),p("channelId",e.id)}}function ki(t,m){if(t&1&&(s(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),_(6,bi,2,1,"ng-container",14),x(7,"async"),a(),s(8,"div"),d(9,"app-channel-logo",15),a(),s(10,"div",16)(11,"span"),f(12),a()()()(),s(13,"div",12)(14,"div",17),_(15,yi,2,1,"div",18)(16,vi,1,4,"app-channel-category-select",19),a()()(),_(17,Fi,6,1,"div",20)(18,Ai,3,1,"div",20),a()()),t&2){let e=m.$implicit,i=l();c(6),p("ngIf",I(7,8,i.defaultCategories$)),c(3),p("typeId",e.type)("showChannelName",!1),c(),p("matTooltip",e.name)("matTooltipShowDelay",2500),c(2),ie(e.name),c(3),S(e.type==i.channelType.Shopify||e.type==i.channelType.Plugo||e.type==i.channelType.ShopifyV2?15:16),c(2),S(e.categoryId&&i.channelType.Lazada!=e.type&&e.selected?17:(i.channelType.Shopify==e.type||e.type==i.channelType.ShopifyV2)&&e.selected?18:-1)}}var Ar=(()=>{class t{constructor(){this.toastr=u(ot),this.uploadProductService=u(Ie),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=De,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(te(1))}onCategoryChange(e,i){this.channelProductUploads.update(n=>n.map((o,r)=>(r==e&&(o.categoryId=i,o.attributes=[]),o)))}onPlatformChange(e,i){this.channelProductUploads.update(n=>n.map((o,r)=>(r==e&&(o.listing_platforms=i),o)))}onAttributesChange(e,i){this.channelProductUploads.update(n=>n.map((o,r)=>(r==e&&(o.attributes=i),o)))}tiktokPlatformChanges(e,i){this.channelProductUploads.update(n=>n.map((o,r)=>(r==e&&(o.listing_platforms=i),o)))}onSelectChannel(e,i,n){this.channelProductUploads.update(o=>o.map((r,g)=>{if(g==i&&e.selected){let pe=this.findCategoryByChannelId(e.id,n);r.categoryId=pe?.DefaultCategoryID}return g==i&&!e.selected&&(r.categoryId=null),r}))}findCategoryByChannelId(e,i){return i.find(n=>n.ID===e)}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(i=>i.type==De.Tiktok&&h.IsNotEmpty(i?.categoryId)?i.listing_platforms.length>0:!0)}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["app-product-upload"]],features:[F([Te,ht,gt,xe])],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"],[4,"ngIf"],[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(i,n){if(i&1&&(s(0,"mainpanel",0)(1,"actions")(2,"button",1),y("click",function(){return n.onUploadProduct()}),d(3,"i",2),f(4," Upload "),a()(),s(5,"content")(6,"div",3)(7,"h3",4),f(8,"Product To Upload"),a(),s(9,"div",5),L(10,Ci,2,7,"div",6,B),x(12,"async"),a(),s(13,"h3",7),f(14,"Channel To Upload"),a(),L(15,ki,19,10,"div",8,B),a()()()),i&2){let o;p("hideSearchBox",!0)("hideSearchDropdown",!0),c(2),p("disabled",((o=n.channelProductUploads())==null?null:o.length)==0),c(8),R(I(12,3,n.selectedProducts$)),c(5),R(n.channelProductUploads())}},dependencies:[T,A,k,St,ct,lt,At,Ft,pt,oe,$,Ze,at,rt,Vt,Ut,Bt,Lt,Ct,Et,wt],encapsulation:2})}}return t})();export{Ar as ProductUploadComponent};
@@ -1 +1 @@
1
- import{a as Z,b as ee,c as te,d as oe,e as ie,f as ne}from"./chunk-QWISVEBT.js";import{a as R}from"./chunk-DAXM2MPK.js";import"./chunk-EYONZQ2W.js";import"./chunk-VFATXJRG.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import{a as T}from"./chunk-UMP6ZMEJ.js";import{a as X,b as Y}from"./chunk-YQLOB7IQ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import"./chunk-CGOB6Y3X.js";import{b as H}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{m as Q,n as W}from"./chunk-HJXYT6MI.js";import"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import{b as J,c as K}from"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{E as q,G as U,H as V,J as z,j as B,n as j}from"./chunk-FXQKRJWU.js";import{$c as N,Gb as E,Gc as d,Hc as k,Ic as O,Mb as u,Nc as F,Oc as $,Pc as g,Qc as L,Sc as S,Yb as s,aa as I,ac as G,ad as A,dc as _,ec as b,gc as h,hc as v,ic as r,jc as a,kc as f,lc as C,mc as y,oc as w,pa as m,rb as l,tc as M,uc as c,v as x,ya as P,za as D}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var re=t=>({ID:t}),ae=t=>({"border-end-0":t});function le(t,p){if(t&1){let e=w();C(0),r(1,"button",11),M("click",function(){P(e);let n=c(),o=g(0);return D(n.onDeleteGroup(o==null?null:o.id))}),f(2,"i",12),d(3," Delete "),a(),y()}}function pe(t,p){if(t&1&&(C(0),r(1,"a",13),f(2,"i",14),d(3," Edit "),a(),y()),t&2){c();let e=g(0);l(),s("queryParams",S(1,re,e==null?null:e.id))}}function se(t,p){if(t&1&&(r(0,"div",21)(1,"div",22)(2,"p",23),d(3),a()()()),t&2){let e=c(),i=e.$implicit,n=e.$index,o=c(2).$implicit;G(S(4,ae,n!==o.Roles.length-1)),s("pTooltip",i.Description),l(3),O(" ",i.Name," ")}}function ce(t,p){if(t&1&&u(0,se,4,6,"div",20),t&2){let e=p.$implicit;_(e.checked?0:-1)}}function de(t,p){if(t&1&&(r(0,"div",15)(1,"div",16)(2,"div",17)(3,"span",18),d(4),a()()(),r(5,"div",19)(6,"div",15),h(7,ce,1,1,null,null,b),a()()()),t&2){let e=c().$implicit;l(4),k(e.Name),l(3),v(e==null?null:e.Roles)}}function me(t,p){if(t&1&&u(0,de,9,1,"div",15),t&2){let e=p.$implicit;_((e==null||e.Roles==null?null:e.Roles.length)>0?0:-1)}}function ue(t,p){if(t&1&&(r(0,"div",9),h(1,me,1,1,null,null,b),a()),t&2){c();let e=g(0);l(),v(e.groups)}}var Oe=(()=>{class t{constructor(){this.groupService=m(R),this.activatedRoute=m(q),this.toastr=m(H),this.route=m(U),this.group$=this.activatedRoute.queryParams.pipe(I(e=>this.groupService.getGroupsForm(e.ID).pipe(x(i=>(i.ID=e.ID,i)))),x(e=>({id:e.ID,name:e.Group.Name,groups:this.mapSelectedRoles(e.Options,e.RoleSelected),description:e.Group.Description}))),this.userEditRole=T.UserEdit,this.userDeleteRole=T.UserDelete}mapSelectedRoles(e,i){return e.map(n=>(n.Roles=n.Roles.map(o=>(o.checked=i.includes(o.ID),o)).filter(o=>o.checked),n.checked=n.Roles.some(o=>o.checked),n))}onDeleteGroup(e){confirm("Are you sure you want to delete this group?")&&this.groupService.deleteGroups([e]).subscribe(()=>{this.toastr.success("Group deleted successfully","Success"),this.route.navigate(["/menu/users/groups"])})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=E({type:t,selectors:[["app-group-info"]],features:[L([R])],decls:23,vars:11,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","group","aria-label","User Group Actions",1,"btn-group"],[4,"ngxPermissionsOnly"],[1,"container-fluid"],[1,"row","mt-8"],[1,"col-12"],["type","text","pInputText","","placeholder","Group Name","readonly","",1,"w-100","form-control","rounded-1",2,"padding-top","12px","padding-bottom","12px","font-size","14px",3,"value"],["value","0"],["value","1"],[1,"d-flex","flex-column","row-gap-6","ps-8"],["pInputTextarea","","rows","10","placeholder","Description","readonly","",1,"w-100","form-control","rounded-1",3,"value"],[1,"btn","btn-outline-secondary",3,"click"],[1,"fa","fa-trash","me-1"],["role","button","routerLink","/menu/users/groups/form",1,"btn","btn-outline-secondary",3,"queryParams"],[1,"fa","fa-edit","me-1"],[1,"row"],[1,"col-2","border","d-flex","align-items-center","justify-content-between","border-end-0",2,"height","40px","background","#f6f6f6"],[1,"d-flex","justify-content-center","w-100","align-items-center","gap-4"],[1,"fs-5","w-100","text-center"],[1,"col"],["tooltipPosition","top",1,"col-3","border","p-0","bg-white",2,"height","40px",3,"class","pTooltip"],["tooltipPosition","top",1,"col-3","border","p-0","bg-white",2,"height","40px",3,"pTooltip"],[1,"d-flex","h-100","align-items-center","gap-4","px-2"],[1,"fs-6","text-dark",2,"margin","0"]],template:function(i,n){if(i&1&&(F(0),N(1,"async"),r(2,"mainpanel",0)(3,"actions")(4,"div",1),u(5,le,4,0,"ng-container",2)(6,pe,4,3,"ng-container",2),a()(),r(7,"content")(8,"div",3)(9,"div",4)(10,"div",5),f(11,"input",6),a()(),r(12,"p-tabs",7)(13,"p-tablist")(14,"p-tab",7),d(15,"Permission"),a(),r(16,"p-tab",8),d(17,"Description"),a()(),r(18,"p-tabpanels")(19,"p-tabpanel",7),u(20,ue,3,0,"div",9),a(),r(21,"p-tabpanel",8),f(22,"textarea",10),a()()()()()()),i&2){let o=$(A(1,8,n.group$));l(2),s("headerTitle",(o==null?null:o.name)+" Info")("hideSearchBox",!0)("hideSearchDropdown",!0),l(3),s("ngxPermissionsOnly",n.userDeleteRole),l(),s("ngxPermissionsOnly",n.userEditRole),l(5),s("value",o==null?null:o.name),l(9),_(o?20:-1),l(2),s("value",o==null?null:o.description)}},dependencies:[j,B,W,Q,ne,ie,oe,te,Z,ee,Y,X,K,J,z,V],styles:["[_nghost-%COMP%] .p-tabs{--p-tabs-tab-active-color: #555555;--p-tabs-tab-color: #0976b4}[_nghost-%COMP%] .p-tabs .p-tabpanels{padding-left:0!important}[_nghost-%COMP%] .p-tabs .p-tablist-active-bar{background-color:#555!important}[_nghost-%COMP%] .p-panel .p-panel-header{display:none!important}[_nghost-%COMP%] .btn-outline-secondary{background-color:#fff;border-color:#ccc;color:#000}[_nghost-%COMP%] .btn-outline-secondary:hover{background-color:#f8f9fa;border-color:#b3b3b3;color:#000}"]})}}return t})();export{Oe as GroupInfoComponent};
1
+ import{a as Z,b as ee,c as te,d as oe,e as ie,f as ne}from"./chunk-QWISVEBT.js";import{a as R}from"./chunk-DAXM2MPK.js";import"./chunk-EYONZQ2W.js";import"./chunk-VFATXJRG.js";import{a as T}from"./chunk-UMP6ZMEJ.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import{a as X,b as Y}from"./chunk-YQLOB7IQ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import"./chunk-CGOB6Y3X.js";import{b as H}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{m as Q,n as W}from"./chunk-HJXYT6MI.js";import"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import{b as J,c as K}from"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{E as q,G as U,H as V,J as z,j as B,n as j}from"./chunk-FXQKRJWU.js";import{$c as N,Gb as E,Gc as d,Hc as k,Ic as O,Mb as u,Nc as F,Oc as $,Pc as g,Qc as L,Sc as S,Yb as s,aa as I,ac as G,ad as A,dc as _,ec as b,gc as h,hc as v,ic as r,jc as a,kc as f,lc as C,mc as y,oc as w,pa as m,rb as l,tc as M,uc as c,v as x,ya as P,za as D}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var re=t=>({ID:t}),ae=t=>({"border-end-0":t});function le(t,p){if(t&1){let e=w();C(0),r(1,"button",11),M("click",function(){P(e);let n=c(),o=g(0);return D(n.onDeleteGroup(o==null?null:o.id))}),f(2,"i",12),d(3," Delete "),a(),y()}}function pe(t,p){if(t&1&&(C(0),r(1,"a",13),f(2,"i",14),d(3," Edit "),a(),y()),t&2){c();let e=g(0);l(),s("queryParams",S(1,re,e==null?null:e.id))}}function se(t,p){if(t&1&&(r(0,"div",21)(1,"div",22)(2,"p",23),d(3),a()()()),t&2){let e=c(),i=e.$implicit,n=e.$index,o=c(2).$implicit;G(S(4,ae,n!==o.Roles.length-1)),s("pTooltip",i.Description),l(3),O(" ",i.Name," ")}}function ce(t,p){if(t&1&&u(0,se,4,6,"div",20),t&2){let e=p.$implicit;_(e.checked?0:-1)}}function de(t,p){if(t&1&&(r(0,"div",15)(1,"div",16)(2,"div",17)(3,"span",18),d(4),a()()(),r(5,"div",19)(6,"div",15),h(7,ce,1,1,null,null,b),a()()()),t&2){let e=c().$implicit;l(4),k(e.Name),l(3),v(e==null?null:e.Roles)}}function me(t,p){if(t&1&&u(0,de,9,1,"div",15),t&2){let e=p.$implicit;_((e==null||e.Roles==null?null:e.Roles.length)>0?0:-1)}}function ue(t,p){if(t&1&&(r(0,"div",9),h(1,me,1,1,null,null,b),a()),t&2){c();let e=g(0);l(),v(e.groups)}}var Oe=(()=>{class t{constructor(){this.groupService=m(R),this.activatedRoute=m(q),this.toastr=m(H),this.route=m(U),this.group$=this.activatedRoute.queryParams.pipe(I(e=>this.groupService.getGroupsForm(e.ID).pipe(x(i=>(i.ID=e.ID,i)))),x(e=>({id:e.ID,name:e.Group.Name,groups:this.mapSelectedRoles(e.Options,e.RoleSelected),description:e.Group.Description}))),this.userEditRole=T.UserEdit,this.userDeleteRole=T.UserDelete}mapSelectedRoles(e,i){return e.map(n=>(n.Roles=n.Roles.map(o=>(o.checked=i.includes(o.ID),o)).filter(o=>o.checked),n.checked=n.Roles.some(o=>o.checked),n))}onDeleteGroup(e){confirm("Are you sure you want to delete this group?")&&this.groupService.deleteGroups([e]).subscribe(()=>{this.toastr.success("Group deleted successfully","Success"),this.route.navigate(["/menu/users/groups"])})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=E({type:t,selectors:[["app-group-info"]],features:[L([R])],decls:23,vars:11,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","group","aria-label","User Group Actions",1,"btn-group"],[4,"ngxPermissionsOnly"],[1,"container-fluid"],[1,"row","mt-8"],[1,"col-12"],["type","text","pInputText","","placeholder","Group Name","readonly","",1,"w-100","form-control","rounded-1",2,"padding-top","12px","padding-bottom","12px","font-size","14px",3,"value"],["value","0"],["value","1"],[1,"d-flex","flex-column","row-gap-6","ps-8"],["pInputTextarea","","rows","10","placeholder","Description","readonly","",1,"w-100","form-control","rounded-1",3,"value"],[1,"btn","btn-outline-secondary",3,"click"],[1,"fa","fa-trash","me-1"],["role","button","routerLink","/menu/users/groups/form",1,"btn","btn-outline-secondary",3,"queryParams"],[1,"fa","fa-edit","me-1"],[1,"row"],[1,"col-2","border","d-flex","align-items-center","justify-content-between","border-end-0",2,"height","40px","background","#f6f6f6"],[1,"d-flex","justify-content-center","w-100","align-items-center","gap-4"],[1,"fs-5","w-100","text-center"],[1,"col"],["tooltipPosition","top",1,"col-3","border","p-0","bg-white",2,"height","40px",3,"class","pTooltip"],["tooltipPosition","top",1,"col-3","border","p-0","bg-white",2,"height","40px",3,"pTooltip"],[1,"d-flex","h-100","align-items-center","gap-4","px-2"],[1,"fs-6","text-dark",2,"margin","0"]],template:function(i,n){if(i&1&&(F(0),N(1,"async"),r(2,"mainpanel",0)(3,"actions")(4,"div",1),u(5,le,4,0,"ng-container",2)(6,pe,4,3,"ng-container",2),a()(),r(7,"content")(8,"div",3)(9,"div",4)(10,"div",5),f(11,"input",6),a()(),r(12,"p-tabs",7)(13,"p-tablist")(14,"p-tab",7),d(15,"Permission"),a(),r(16,"p-tab",8),d(17,"Description"),a()(),r(18,"p-tabpanels")(19,"p-tabpanel",7),u(20,ue,3,0,"div",9),a(),r(21,"p-tabpanel",8),f(22,"textarea",10),a()()()()()()),i&2){let o=$(A(1,8,n.group$));l(2),s("headerTitle",(o==null?null:o.name)+" Info")("hideSearchBox",!0)("hideSearchDropdown",!0),l(3),s("ngxPermissionsOnly",n.userDeleteRole),l(),s("ngxPermissionsOnly",n.userEditRole),l(5),s("value",o==null?null:o.name),l(9),_(o?20:-1),l(2),s("value",o==null?null:o.description)}},dependencies:[j,B,W,Q,ne,ie,oe,te,Z,ee,Y,X,K,J,z,V],styles:["[_nghost-%COMP%] .p-tabs{--p-tabs-tab-active-color: #555555;--p-tabs-tab-color: #0976b4}[_nghost-%COMP%] .p-tabs .p-tabpanels{padding-left:0!important}[_nghost-%COMP%] .p-tabs .p-tablist-active-bar{background-color:#555!important}[_nghost-%COMP%] .p-panel .p-panel-header{display:none!important}[_nghost-%COMP%] .btn-outline-secondary{background-color:#fff;border-color:#ccc;color:#000}[_nghost-%COMP%] .btn-outline-secondary:hover{background-color:#f8f9fa;border-color:#b3b3b3;color:#000}"]})}}return t})();export{Oe as GroupInfoComponent};
@@ -1 +1 @@
1
- import{a as pe,b as me,c as de}from"./chunk-RU43F4UK.js";import{a as ce}from"./chunk-34DHFHCG.js";import{a as T}from"./chunk-ZKROHCYD.js";import{a as se}from"./chunk-67HPC5Y3.js";import{a as oe}from"./chunk-OLANEXLB.js";import"./chunk-PFY5UG5D.js";import"./chunk-KS7ACI26.js";import"./chunk-3GDM5JNY.js";import"./chunk-XXT6F2ZS.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import"./chunk-JVNHFIYT.js";import{a as le}from"./chunk-4L5TB6FG.js";import"./chunk-C7YK5TDP.js";import"./chunk-ACIMXBIC.js";import{a as ae}from"./chunk-LDL3A7NM.js";import"./chunk-BVPWV5YO.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import"./chunk-PYXL7UF7.js";import"./chunk-RXQX7567.js";import{m as ne,n as re}from"./chunk-HJXYT6MI.js";import{A as ee,c as X,h as Y,m as Z,o as $}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import{r as te,s as ie}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{j as G,k as J,m as K,n as Q}from"./chunk-FXQKRJWU.js";import{$c as w,Gb as W,Gc as l,Hc as v,Ic as b,Kc as _,Lc as g,Mb as x,Mc as f,Nc as z,Oc as A,Pc as R,Qc as H,Ra as N,Rc as j,Sc as U,Yb as c,ac as I,ad as E,bd as q,dc as y,ec as D,gc as B,hc as k,ic as t,jc as i,kc as u,oc as V,pa as O,pb as F,rb as o,tc as M,uc as h,ya as m,za as d}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{a as P,b as L}from"./chunk-66YHNWRR.js";var ue=()=>[],he=r=>({"td-cell-hover":r});function _e(r,S){if(r&1&&u(0,"variants-dropdown",31),r&2){let e=h().$implicit;c("variants",e==null?null:e.Variants)}}function ge(r,S){if(r&1&&u(0,"variant-with-image",32),r&2){let e=h().$implicit;c("variant",e==null?null:e.Variants[0])}}function fe(r,S){if(r&1&&(t(0,"span"),l(1),i()),r&2){let e=h().$implicit;o(),b("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function Se(r,S){if(r&1&&(t(0,"tr")(1,"td")(2,"div",24),u(3,"img",25),w(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",29)(14,"div"),u(15,"order-link",30),i()(),t(16,"small"),l(17),w(18,"date"),i()()(),t(19,"td"),l(20),i(),t(21,"td"),x(22,_e,1,1,"variants-dropdown",31)(23,ge,1,1,"variant-with-image",32),i(),t(24,"td",33),l(25),w(26,"number"),i(),t(27,"td")(28,"div",28)(29,"div",29)(30,"span"),l(31),i(),x(32,fe,2,1,"span"),i(),t(33,"small"),l(34),i()()()()),r&2){let e=S.$implicit;o(3),c("src",E(4,14,e==null?null:e.MarketType),F)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),o(4),v(e.Outlet),o(3),v(e.ChannelName),o(5),c("order",e),o(2),b(" ",q(18,16,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),o(3),v(e.Customer),o(),I(U(21,he,(e.Variants==null?null:e.Variants.length)>1)),o(),y((e.Variants==null?null:e.Variants.length)>1?22:23),o(3),v(E(26,19,e.Amount)),o(6),v(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),o(),y(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?32:-1),o(2),b(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," ")}}function Ce(r,S){if(r&1){let e=V();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",20),l(9,"Customer"),i(),t(10,"th"),l(11,"Items"),i(),t(12,"th",21),l(13,"Amount"),i(),t(14,"th",22),l(15,"Shipping"),i()()(),t(16,"tbody"),B(17,Se,35,23,"tr",null,D),i()(),t(19,"app-custom-paginator",23),M("next",function(){m(e);let n=h();return d(n.initShippedOrders())})("previous",function(){m(e);let n=h();return d(n.initShippedOrders())}),i()()}if(r&2){let e=h(),p=R(0);o(17),k(p),o(2),c("filter",e.filter())("totaldata",p==null?null:p.length)}}function ve(r,S){r&1&&(t(0,"div",16),u(1,"app-empty-state"),i())}var He=(()=>{class r{constructor(){this.orderService=O(T),this.filter=N({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:e=>{this.initFromDate(e)},error:e=>{console.error("Error fetching default date:",e),this.initFromDate(null)}})}initFromDate(e){this.filter.update(p=>L(P({},p),{From:e})),this.initShippedOrders()}initShippedOrders(){this.shippedOrders$=this.orderService.getShippedOrders(this.filter())}static{this.\u0275fac=function(p){return new(p||r)}}static{this.\u0275cmp=W({type:r,selectors:[["app-shipped"]],features:[H([T])],decls:34,vars:12,consts:[["headerTitle","Shipped","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-regular","fa-tv","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","200px"],[1,"text-end",2,"width","100px"],[2,"width","100px"],["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"],[1,"d-flex","align-items-end","gap-2"],[2,"font-size","14px",3,"order"],[3,"variants"],[3,"variant"],[1,"text-end"]],template:function(p,n){if(p&1){let s=V();z(0),w(1,"async"),t(2,"mainpanel",0),M("onSubmit",function(){return m(s),d(n.initShippedOrders())}),f("textChange",function(a){return m(s),g(n.filter().Number,a)||(n.filter().Number=a),d(a)}),t(3,"actions")(4,"a",1),u(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,"channel-select-options",4),f("ngModelChange",function(a){return m(s),g(n.filter().ListChannelID,a)||(n.filter().ListChannelID=a),d(a)}),i()(),t(13,"div",5)(14,"label",3),l(15,"From/To"),i(),t(16,"div",6)(17,"datepicker",7),f("dateChange",function(a){return m(s),g(n.filter().From,a)||(n.filter().From=a),d(a)}),i()(),t(18,"div")(19,"datepicker",8),f("dateChange",function(a){return m(s),g(n.filter().To,a)||(n.filter().To=a),d(a)}),i()()(),t(20,"div",5)(21,"label",9),l(22,"Page Number"),i(),t(23,"input",10),f("ngModelChange",function(a){return m(s),g(n.filter().PageNumber,a)||(n.filter().PageNumber=a),d(a)}),i()(),t(24,"div",5)(25,"label",9),l(26,"Page Size"),i(),t(27,"input",11),f("ngModelChange",function(a){return m(s),g(n.filter().PageSize,a)||(n.filter().PageSize=a),d(a)}),i()()(),t(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),x(32,Ce,20,2,"div",15)(33,ve,2,0,"div",16),i()()()()()}if(p&2){let s=A(E(1,8,n.shippedOrders$)||j(11,ue));o(2),_("text",n.filter().Number),o(10),c("multiple",!0),_("ngModel",n.filter().ListChannelID),o(5),_("date",n.filter().From),o(2),_("date",n.filter().To),o(4),_("ngModel",n.filter().PageNumber),o(4),_("ngModel",n.filter().PageSize),o(5),y(s.length>0?32:33)}},dependencies:[Q,G,K,J,re,ne,oe,ae,ee,X,$,Y,Z,pe,me,de,se,le,ie,te,ce],encapsulation:2})}}return r})();export{He as ShippedComponent};
1
+ import{a as pe,b as me,c as de}from"./chunk-T27ABFCP.js";import{a as ue}from"./chunk-FHNST4Y7.js";import{a as T}from"./chunk-LLHPMXKP.js";import{a as se}from"./chunk-67HPC5Y3.js";import{a as oe}from"./chunk-KTB223SK.js";import"./chunk-PFY5UG5D.js";import"./chunk-KS7ACI26.js";import"./chunk-3GDM5JNY.js";import"./chunk-XXT6F2ZS.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import"./chunk-JVNHFIYT.js";import{a as le}from"./chunk-CBQUB3KW.js";import"./chunk-FGRPTNDB.js";import"./chunk-3PPLPXAX.js";import"./chunk-OXWPLJEW.js";import"./chunk-EPBVNII2.js";import"./chunk-UZWED4UK.js";import"./chunk-5CKVZBHM.js";import"./chunk-4YRBARG2.js";import"./chunk-BKRCW7SH.js";import"./chunk-RGAKHXPF.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import"./chunk-63ANFYRV.js";import"./chunk-YQLOB7IQ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import"./chunk-ACIMXBIC.js";import{a as ae}from"./chunk-LDL3A7NM.js";import"./chunk-P2AADVEN.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import"./chunk-EUYQST7Q.js";import{m as ne,n as re}from"./chunk-HJXYT6MI.js";import{A as ee,c as X,h as Y,m as Z,o as $}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import{r as te,s as ie}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{j as G,k as J,m as K,n as Q}from"./chunk-FXQKRJWU.js";import{$c as w,Gb as W,Gc as l,Hc as v,Ic as b,Kc as _,Lc as g,Mb as x,Mc as f,Nc as z,Oc as A,Pc as R,Qc as H,Ra as N,Rc as j,Sc as U,Yb as u,ac as I,ad as E,bd as q,dc as y,ec as D,gc as B,hc as k,ic as t,jc as i,kc as c,oc as V,pa as O,pb as F,rb as o,tc as M,uc as h,ya as m,za as d}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{a as P,b as L}from"./chunk-66YHNWRR.js";var ce=()=>[],he=r=>({"td-cell-hover":r});function _e(r,S){if(r&1&&c(0,"variants-dropdown",31),r&2){let e=h().$implicit;u("variants",e==null?null:e.Variants)}}function ge(r,S){if(r&1&&c(0,"variant-with-image",32),r&2){let e=h().$implicit;u("variant",e==null?null:e.Variants[0])}}function fe(r,S){if(r&1&&(t(0,"span"),l(1),i()),r&2){let e=h().$implicit;o(),b("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function Se(r,S){if(r&1&&(t(0,"tr")(1,"td")(2,"div",24),c(3,"img",25),w(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",29)(14,"div"),c(15,"order-link",30),i()(),t(16,"small"),l(17),w(18,"date"),i()()(),t(19,"td"),l(20),i(),t(21,"td"),x(22,_e,1,1,"variants-dropdown",31)(23,ge,1,1,"variant-with-image",32),i(),t(24,"td",33),l(25),w(26,"number"),i(),t(27,"td")(28,"div",28)(29,"div",29)(30,"span"),l(31),i(),x(32,fe,2,1,"span"),i(),t(33,"small"),l(34),i()()()()),r&2){let e=S.$implicit;o(3),u("src",E(4,14,e==null?null:e.MarketType),F)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),o(4),v(e.Outlet),o(3),v(e.ChannelName),o(5),u("order",e),o(2),b(" ",q(18,16,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),o(3),v(e.Customer),o(),I(U(21,he,(e.Variants==null?null:e.Variants.length)>1)),o(),y((e.Variants==null?null:e.Variants.length)>1?22:23),o(3),v(E(26,19,e.Amount)),o(6),v(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),o(),y(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?32:-1),o(2),b(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," ")}}function Ce(r,S){if(r&1){let e=V();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",20),l(9,"Customer"),i(),t(10,"th"),l(11,"Items"),i(),t(12,"th",21),l(13,"Amount"),i(),t(14,"th",22),l(15,"Shipping"),i()()(),t(16,"tbody"),B(17,Se,35,23,"tr",null,D),i()(),t(19,"app-custom-paginator",23),M("next",function(){m(e);let n=h();return d(n.initShippedOrders())})("previous",function(){m(e);let n=h();return d(n.initShippedOrders())}),i()()}if(r&2){let e=h(),p=R(0);o(17),k(p),o(2),u("filter",e.filter())("totaldata",p==null?null:p.length)}}function ve(r,S){r&1&&(t(0,"div",16),c(1,"app-empty-state"),i())}var He=(()=>{class r{constructor(){this.orderService=O(T),this.filter=N({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:e=>{this.initFromDate(e)},error:e=>{console.error("Error fetching default date:",e),this.initFromDate(null)}})}initFromDate(e){this.filter.update(p=>L(P({},p),{From:e})),this.initShippedOrders()}initShippedOrders(){this.shippedOrders$=this.orderService.getShippedOrders(this.filter())}static{this.\u0275fac=function(p){return new(p||r)}}static{this.\u0275cmp=W({type:r,selectors:[["app-shipped"]],features:[H([T])],decls:34,vars:12,consts:[["headerTitle","Shipped","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-regular","fa-tv","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","200px"],[1,"text-end",2,"width","100px"],[2,"width","100px"],["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"],[1,"d-flex","align-items-end","gap-2"],[2,"font-size","14px",3,"order"],[3,"variants"],[3,"variant"],[1,"text-end"]],template:function(p,n){if(p&1){let s=V();z(0),w(1,"async"),t(2,"mainpanel",0),M("onSubmit",function(){return m(s),d(n.initShippedOrders())}),f("textChange",function(a){return m(s),g(n.filter().Number,a)||(n.filter().Number=a),d(a)}),t(3,"actions")(4,"a",1),c(5,"i",2),t(6,"span"),l(7,"Order Fulfillment Display"),i()()(),t(8,"filters")(9,"div")(10,"label",3),l(11,"Channel"),i(),t(12,"app-channel-options-v2",4),f("ngModelChange",function(a){return m(s),g(n.filter().ListChannelID,a)||(n.filter().ListChannelID=a),d(a)}),i()(),t(13,"div",5)(14,"label",3),l(15,"From/To"),i(),t(16,"div",6)(17,"datepicker",7),f("dateChange",function(a){return m(s),g(n.filter().From,a)||(n.filter().From=a),d(a)}),i()(),t(18,"div")(19,"datepicker",8),f("dateChange",function(a){return m(s),g(n.filter().To,a)||(n.filter().To=a),d(a)}),i()()(),t(20,"div",5)(21,"label",9),l(22,"Page Number"),i(),t(23,"input",10),f("ngModelChange",function(a){return m(s),g(n.filter().PageNumber,a)||(n.filter().PageNumber=a),d(a)}),i()(),t(24,"div",5)(25,"label",9),l(26,"Page Size"),i(),t(27,"input",11),f("ngModelChange",function(a){return m(s),g(n.filter().PageSize,a)||(n.filter().PageSize=a),d(a)}),i()()(),t(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),x(32,Ce,20,2,"div",15)(33,ve,2,0,"div",16),i()()()()()}if(p&2){let s=A(E(1,8,n.shippedOrders$)||j(11,ce));o(2),_("text",n.filter().Number),o(10),u("multiple",!0),_("ngModel",n.filter().ListChannelID),o(5),_("date",n.filter().From),o(2),_("date",n.filter().To),o(4),_("ngModel",n.filter().PageNumber),o(4),_("ngModel",n.filter().PageSize),o(5),y(s.length>0?32:33)}},dependencies:[Q,G,K,J,re,ne,oe,ae,ee,X,$,Y,Z,pe,me,de,se,ie,te,ue,le],encapsulation:2})}}return r})();export{He as ShippedComponent};
@@ -1 +1 @@
1
- import{a as F}from"./chunk-DGIH7HSJ.js";import{a as E}from"./chunk-NLJHQ4MQ.js";import{i as T}from"./chunk-BVPWV5YO.js";import{a as w}from"./chunk-CGOB6Y3X.js";import{b as D,e as s}from"./chunk-WN5DZGA4.js";import{b as i,c as m}from"./chunk-RXQX7567.js";import{G as j}from"./chunk-FXQKRJWU.js";import{B as U,G as I,J as u,Ra as C,g as b,ja as c,pa as a,q as d,v as A}from"./chunk-OJMQBH6T.js";var x=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/shopee/GetAttributesTree",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/shopee/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/shopee/AddProduct",t).pipe(u(o=>d(null)))}generateAttribute(t){return t.map(e=>({attribute_id:e.attribute_id,attribute_value_list:e.attribute_value_list.map(o=>({value_id:o.value_id,name:o.name}))})),t}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var H=(()=>{class r{constructor(){this.httpService=a(s)}getCategories(t){return this.httpService.get("api/product/tiktok/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tiktok/AddProduct",t).pipe(u(o=>d(null)))}generateAttribute(t){let e;return t.map(o=>(o.type=="PRODUCT_PROPERTY"?e={id:o.id,name:o.name,type:o.type,values:o.values}:e={id:o.id,name:o.values[0].id,type:o.type},e))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var R=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/lazada/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/lazada/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/lazada/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var z=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/woo/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/woo/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/woo/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var g=class{};var S=class{};var V=(()=>{class r{constructor(){this.httpService=a(s)}getCategories(t){return this.httpService.get("api/product/tokopedia/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tokopedia/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var G=(()=>{class r{constructor(){this.httpService=a(s)}uploadProduct(t){return this.httpService.post("api/product/shopify/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var N=(()=>{class r{constructor(){this.httpService=a(s)}uploadProduct(t){return this.httpService.post(w.UploadPlugoProduct,t).pipe(u(e=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var _t=(()=>{class r{constructor(){this.authService=a(T),this.productService=a(E),this.shoppeUploadService=a(x),this.tiktokUploadService=a(H),this.lazadaUploadService=a(R),this.tokopediaUploadService=a(V),this.wooUploadService=a(z),this.shopifyUploadService=a(G),this.plugoUploadService=a(N),this.toastrHandlingService=a(F),this.toastr=a(D),this.router=a(j),this.httpService=a(s),this._selectedProduct=new b(this.getStoredProducts()),this.selectedProduct$=this._selectedProduct.asObservable().pipe(I(t=>t&&t.length>0))}getStoredProducts(){let t=localStorage.getItem("productsUpload");if(t){let e=JSON.parse(t);return e&&e.length>0?e:[]}else return[]}setSelectedProduct(t){localStorage.setItem("productsUpload",JSON.stringify(t)),this._selectedProduct.next(t)}clearSelectedProduct(){localStorage.removeItem("productsUpload"),this._selectedProduct.next([])}getUnselectedChannels(){let t=this.authService.getChannels(),e=this._selectedProduct.getValue();return this.productService.filterUnselectedChannel(e,t)}getDefaultCategory(){return this.httpService.get("api/v1/Channel/ProductCategory/Default")}get channelProductUpload(){let t=this.getUnselectedChannels();return C(t.map(o=>{let p=new g;return p.id=o.ID,p.name=o.Name,p.type=o.TypeID,p.categoryId=null,p.attributes=[],p.selected=!1,p}))}onUploadProduct(t){let e=t.filter(o=>o.selected&&m.IsNotEmpty(o.categoryId)||o.selected&&(o.type==i.Shopify||o.type==i.ShopifyV2||o.type==i.Plugo));if(e.length>0){let o=this.generateDataForUpload(e);this.uploadProduct(o)}else this.toastr.warning("Please select a channel and category to upload the product.","Warning!")}uploadProduct(t){let e=this.generateObservableForUpload(t);U(e).pipe(A(o=>{let p=[];return o.filter(h=>m.IsNotEmpty(h)).forEach(h=>{p=[...p,...h]}),p})).subscribe({next:(o=[])=>{m.IsNotEmpty(o)&&this.toastrHandlingService.showToastrUploadMultiple(o),this.hasSuccessRes(o)&&this.onSuccessUpload()}})}hasSuccessRes(t){let e=!1;return t.forEach(o=>{o?.Response.Success_list?.length>0&&m.IsNotEmpty(o)&&(e=!0)}),e}onSuccessUpload(){this.router.navigate(["/menu/products/status/sold-in-channel"]),this.clearSelectedProduct()}generateObservableForUpload(t){let e=[],o=[],p=[],h=[],v=[],y=[],P=[],k=[];t.forEach(l=>{switch(l.ChannelType){case i.Shopee:o.push(l);break;case i.Tiktok:e.push(l);break;case i.Lazada:p.push(l);break;case i.Tokopedia:h.push(l);break;case i.WooCommerce:v.push(l);break;case i.Shopify:y.push(l);break;case i.ShopifyV2:P.push(l);break;case i.Plugo:k.push(l);break}});let n=[];return[{type:i.Shopee,data:o},{type:i.Tiktok,data:e},{type:i.Lazada,data:p},{type:i.Tokopedia,data:h},{type:i.WooCommerce,data:v},{type:i.Shopify,data:y},{type:i.ShopifyV2,data:P},{type:i.Plugo,data:k}].filter(l=>l.data.length>0).forEach(l=>{switch(l.type){case i.Shopee:n.push(this.shoppeUploadService.uploadProduct(o));break;case i.Tiktok:n.push(this.tiktokUploadService.uploadProduct(e));break;case i.Lazada:n.push(this.lazadaUploadService.uploadProduct(p));break;case i.Tokopedia:n.push(this.tokopediaUploadService.uploadProduct(h));break;case i.WooCommerce:n.push(this.wooUploadService.uploadProduct(v));break;case i.Shopify:n.push(this.shopifyUploadService.uploadProduct(y));break;case i.ShopifyV2:n.push(this.shopifyUploadService.uploadProduct(P));break;case i.Plugo:n.push(this.plugoUploadService.uploadProduct(k));break}}),n}generateDataForUpload(t){let e=[];return t.forEach(o=>{let p=new S;p.ChannelID=o.id,p.ChannelType=o.type,p.Products=this._selectedProduct.getValue(),o.type==i.Shopify||o.type==i.ShopifyV2?delete p.CategoryID:p.CategoryID=o.categoryId,p=this.generateAttributeHttpRequest(o,p),e.push(p)}),e}generateAttributeHttpRequest(t,e){return t.type==i.WooCommerce||t.type==i.Shopify||t.type==i.ShopifyV2?e.Attribute=t.attributes[0]:t.type==i.Tiktok?(e.Attributes=this.formatAttributes(t.type,t.attributes),e.listing_platforms=t.listing_platforms):e.Attributes=this.formatAttributes(t.type,t.attributes),e}formatAttributes(t,e){let o;switch(t){case i.Shopee:o=this.shoppeUploadService.generateAttribute(e);break;case i.Tiktok:o=this.tiktokUploadService.generateAttribute(e);break;case i.WooCommerce:o=this.tiktokUploadService.generateAttribute(e);break;case i.Tokopedia:o=e;break;case i.Shopify:o=e;break;case i.ShopifyV2:o=e;break;default:o=[];break}return o}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();export{x as a,H as b,R as c,z as d,_t as e};
1
+ import{a as F}from"./chunk-7TI3OR34.js";import{a as E}from"./chunk-X4B2FYY3.js";import{i as T}from"./chunk-P2AADVEN.js";import{a as w}from"./chunk-CGOB6Y3X.js";import{b as D,e as s}from"./chunk-WN5DZGA4.js";import{b as i,c as m}from"./chunk-EUYQST7Q.js";import{G as j}from"./chunk-FXQKRJWU.js";import{B as U,G as I,J as u,Ra as C,g as b,ja as c,pa as a,q as d,v as A}from"./chunk-OJMQBH6T.js";var x=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/shopee/GetAttributesTree",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/shopee/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/shopee/AddProduct",t).pipe(u(o=>d(null)))}generateAttribute(t){return t.map(e=>({attribute_id:e.attribute_id,attribute_value_list:e.attribute_value_list.map(o=>({value_id:o.value_id,name:o.name}))})),t}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var H=(()=>{class r{constructor(){this.httpService=a(s)}getCategories(t){return this.httpService.get("api/product/tiktok/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tiktok/AddProduct",t).pipe(u(o=>d(null)))}generateAttribute(t){let e;return t.map(o=>(o.type=="PRODUCT_PROPERTY"?e={id:o.id,name:o.name,type:o.type,values:o.values}:e={id:o.id,name:o.values[0].id,type:o.type},e))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var R=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/lazada/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/lazada/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/lazada/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var z=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/woo/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/woo/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/woo/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var g=class{};var S=class{};var V=(()=>{class r{constructor(){this.httpService=a(s)}getCategories(t){return this.httpService.get("api/product/tokopedia/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tokopedia/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var G=(()=>{class r{constructor(){this.httpService=a(s)}uploadProduct(t){return this.httpService.post("api/product/shopify/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var N=(()=>{class r{constructor(){this.httpService=a(s)}uploadProduct(t){return this.httpService.post(w.UploadPlugoProduct,t).pipe(u(e=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var _t=(()=>{class r{constructor(){this.authService=a(T),this.productService=a(E),this.shoppeUploadService=a(x),this.tiktokUploadService=a(H),this.lazadaUploadService=a(R),this.tokopediaUploadService=a(V),this.wooUploadService=a(z),this.shopifyUploadService=a(G),this.plugoUploadService=a(N),this.toastrHandlingService=a(F),this.toastr=a(D),this.router=a(j),this.httpService=a(s),this._selectedProduct=new b(this.getStoredProducts()),this.selectedProduct$=this._selectedProduct.asObservable().pipe(I(t=>t&&t.length>0))}getStoredProducts(){let t=localStorage.getItem("productsUpload");if(t){let e=JSON.parse(t);return e&&e.length>0?e:[]}else return[]}setSelectedProduct(t){localStorage.setItem("productsUpload",JSON.stringify(t)),this._selectedProduct.next(t)}clearSelectedProduct(){localStorage.removeItem("productsUpload"),this._selectedProduct.next([])}getUnselectedChannels(){let t=this.authService.getChannels(),e=this._selectedProduct.getValue();return this.productService.filterUnselectedChannel(e,t)}getDefaultCategory(){return this.httpService.get("api/v1/Channel/ProductCategory/Default")}get channelProductUpload(){let t=this.getUnselectedChannels();return C(t.map(o=>{let p=new g;return p.id=o.ID,p.name=o.Name,p.type=o.TypeID,p.categoryId=null,p.attributes=[],p.selected=!1,p}))}onUploadProduct(t){let e=t.filter(o=>o.selected&&m.IsNotEmpty(o.categoryId)||o.selected&&(o.type==i.Shopify||o.type==i.ShopifyV2||o.type==i.Plugo));if(e.length>0){let o=this.generateDataForUpload(e);this.uploadProduct(o)}else this.toastr.warning("Please select a channel and category to upload the product.","Warning!")}uploadProduct(t){let e=this.generateObservableForUpload(t);U(e).pipe(A(o=>{let p=[];return o.filter(h=>m.IsNotEmpty(h)).forEach(h=>{p=[...p,...h]}),p})).subscribe({next:(o=[])=>{m.IsNotEmpty(o)&&this.toastrHandlingService.showToastrUploadMultiple(o),this.hasSuccessRes(o)&&this.onSuccessUpload()}})}hasSuccessRes(t){let e=!1;return t.forEach(o=>{o?.Response.Success_list?.length>0&&m.IsNotEmpty(o)&&(e=!0)}),e}onSuccessUpload(){this.router.navigate(["/menu/products/status/sold-in-channel"]),this.clearSelectedProduct()}generateObservableForUpload(t){let e=[],o=[],p=[],h=[],v=[],y=[],P=[],k=[];t.forEach(l=>{switch(l.ChannelType){case i.Shopee:o.push(l);break;case i.Tiktok:e.push(l);break;case i.Lazada:p.push(l);break;case i.Tokopedia:h.push(l);break;case i.WooCommerce:v.push(l);break;case i.Shopify:y.push(l);break;case i.ShopifyV2:P.push(l);break;case i.Plugo:k.push(l);break}});let n=[];return[{type:i.Shopee,data:o},{type:i.Tiktok,data:e},{type:i.Lazada,data:p},{type:i.Tokopedia,data:h},{type:i.WooCommerce,data:v},{type:i.Shopify,data:y},{type:i.ShopifyV2,data:P},{type:i.Plugo,data:k}].filter(l=>l.data.length>0).forEach(l=>{switch(l.type){case i.Shopee:n.push(this.shoppeUploadService.uploadProduct(o));break;case i.Tiktok:n.push(this.tiktokUploadService.uploadProduct(e));break;case i.Lazada:n.push(this.lazadaUploadService.uploadProduct(p));break;case i.Tokopedia:n.push(this.tokopediaUploadService.uploadProduct(h));break;case i.WooCommerce:n.push(this.wooUploadService.uploadProduct(v));break;case i.Shopify:n.push(this.shopifyUploadService.uploadProduct(y));break;case i.ShopifyV2:n.push(this.shopifyUploadService.uploadProduct(P));break;case i.Plugo:n.push(this.plugoUploadService.uploadProduct(k));break}}),n}generateDataForUpload(t){let e=[];return t.forEach(o=>{let p=new S;p.ChannelID=o.id,p.ChannelType=o.type,p.Products=this._selectedProduct.getValue(),o.type==i.Shopify||o.type==i.ShopifyV2?delete p.CategoryID:p.CategoryID=o.categoryId,p=this.generateAttributeHttpRequest(o,p),e.push(p)}),e}generateAttributeHttpRequest(t,e){return t.type==i.WooCommerce||t.type==i.Shopify||t.type==i.ShopifyV2?e.Attribute=t.attributes[0]:t.type==i.Tiktok?(e.Attributes=this.formatAttributes(t.type,t.attributes),e.listing_platforms=t.listing_platforms):e.Attributes=this.formatAttributes(t.type,t.attributes),e}formatAttributes(t,e){let o;switch(t){case i.Shopee:o=this.shoppeUploadService.generateAttribute(e);break;case i.Tiktok:o=this.tiktokUploadService.generateAttribute(e);break;case i.WooCommerce:o=this.tiktokUploadService.generateAttribute(e);break;case i.Tokopedia:o=e;break;case i.Shopify:o=e;break;case i.ShopifyV2:o=e;break;default:o=[];break}return o}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();export{x as a,H as b,R as c,z as d,_t as e};
@@ -1,2 +1,2 @@
1
- import{a as R}from"./chunk-EHBCYQSG.js";import{b as ze}from"./chunk-GRYGUILI.js";import"./chunk-HVCIQI7B.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import{a as Ze}from"./chunk-QTTNQJAK.js";import"./chunk-IITU3NV6.js";import{a as ee}from"./chunk-XHAXYWZ7.js";import{a as Ge,b as Ye,c as Ke,d as J,e as te}from"./chunk-TKV7XWBT.js";import{a as Qe,b as He}from"./chunk-YTCIQBSO.js";import"./chunk-2O4IEGGR.js";import"./chunk-VFATXJRG.js";import"./chunk-EPBVNII2.js";import"./chunk-UZWED4UK.js";import"./chunk-4YRBARG2.js";import"./chunk-5CKVZBHM.js";import"./chunk-BKRCW7SH.js";import"./chunk-RGAKHXPF.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-RHHHL4OR.js";import{a as We}from"./chunk-NLJHQ4MQ.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import{a as q}from"./chunk-UMP6ZMEJ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import{a as Ue,b as Be,c as $e}from"./chunk-GHVAGYK3.js";import"./chunk-JVNHFIYT.js";import{a as je}from"./chunk-C7YK5TDP.js";import"./chunk-UWC2EVFY.js";import"./chunk-ACIMXBIC.js";import{i as Te}from"./chunk-BVPWV5YO.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import{a as X}from"./chunk-CGOB6Y3X.js";import{b as ve,e as Ie}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{e as De}from"./chunk-PYXL7UF7.js";import{c as f}from"./chunk-RXQX7567.js";import{b as Me,c as Ve,d as ke,j as Re,k as Le,l as Ne,m as Ae,n as Oe}from"./chunk-HJXYT6MI.js";import{A as ye,b as Ce,c as ge,h as fe,m as xe,o as Se}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import{a as we,b as be,c as Fe}from"./chunk-ERXVXBTU.js";import{r as Pe,s as Ee}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{H as ue,J as he,d as me,g as de,j as $,k as W,m as _e,n as j}from"./chunk-FXQKRJWU.js";import{$c as g,Fc as K,G as Q,Gb as U,Gc as c,Hc as O,Ic as I,Kc as b,Lc as F,Mb as h,Mc as T,Nc as re,Oc as se,Pc as ce,Qc as B,Ra as V,Rc as pe,Sc as M,Yb as m,Z as N,ac as ae,ad as y,bd as k,cd as Z,dc as v,ea as H,ec as z,gc as G,hc as Y,ic as a,jc as l,kc as x,lc as P,mc as E,oc as S,pa as w,pb as A,rb as s,tc as C,uc as r,v as L,xb as D,xc as le,ya as d,za as _}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{a as oe}from"./chunk-66YHNWRR.js";var tt=()=>["/menu/order/download"];function nt(n,p){if(n&1&&(a(0,"li",4)(1,"div"),c(2," The last time you manually download your order is on "),a(3,"span",8),c(4),g(5,"date"),l()(),a(6,"div",9),c(7),l()()),n&2){r();let e=ce(0);s(4),I(" ",k(5,2,e==null?null:e.OrderDownloadLatestOn,"dd MMM yyyy HH:mm")," "),s(3),I("(",e==null?null:e.calculatedDate,")")}}function it(n,p){n&1&&(a(0,"li",4),c(1," The last time you manually download your order is on (-) "),l())}var qe=(()=>{class n{constructor(){this.dialogRef=w(Me),this.data=w(Ve),this.modalConfig=new Re,this.inventoryService=w(R),this.lastDownloadInfo$=this.inventoryService.getLastInfoDownloadInventory(this.data.channelId).pipe(L(e=>{let o=e.OrderDownloadLatestOn!=f.MinDate,t=null,i=null;return o&&(t=new Date(e.OrderDownloadLatestOn),i=f.convertToReadableDate(t)),{OrderDownloadLatestOn:t,calculatedDate:i}}),N(1)),this.selectedProducts=V(this.data.selectedProducts||[]),this.modalConfig.title="Manual Inventory Sync",this.modalConfig.customWidth="500px",this.modalConfig.bodyScrollable=!0,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0}onUpdate(){this.dialogRef.close(!0)}onCancel(){this.dialogRef.close(!1)}static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275cmp=U({type:n,selectors:[["app-dialog-update-product-info"]],features:[B([R])],decls:16,vars:8,consts:[[3,"onCancel","config"],["content",""],[1,"container"],[1,"mt-8"],[1,"lh-base"],["footer",""],[1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3","py-8",3,"click","routerLink"],[1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3","py-8",3,"click","keyup.F2"],[1,"fw-bold","me-1"],[1,"fw-bold"]],template:function(o,t){if(o&1){let i=S();re(0),g(1,"async"),a(2,"modal-material",0),C("onCancel",function(){return d(i),_(t.onCancel())}),a(3,"div",1)(4,"div",2)(5,"h4"),c(6),l(),a(7,"div",3)(8,"ul"),h(9,nt,8,5,"li",4)(10,it,2,0,"li",4),l()()()(),a(11,"div",5)(12,"a",6),C("click",function(){return d(i),_(t.onCancel())}),c(13," Download "),l(),a(14,"button",7),C("click",function(){return d(i),_(t.onUpdate())})("keyup.F2",function(){return d(i),_(t.onUpdate())}),c(15," Update Anyway "),l()()()}if(o&2){let i=se(y(1,4,t.lastDownloadInfo$));s(2),m("config",t.modalConfig),s(4),I("",t.selectedProducts().length," Product(s) will be updated."),s(3),v(i!=null&&i.OrderDownloadLatestOn?9:10),s(3),m("routerLink",pe(7,tt))}},dependencies:[Le,j,$,W,he,ue],encapsulation:2})}}return n})();var ne=n=>[n],ot=n=>({"text-decoration-line-through":n}),at=n=>({"me-10":n}),lt=n=>({"bg-gradient-warning":n}),rt=n=>({cursor:n});function st(n,p){if(n&1){let e=S();a(0,"button",39),C("click",function(){d(e);let t=r().ngIf,i=r(2);return _(i.onScanInventory(t))}),x(1,"i",40),c(2,"Refresh "),l()}}function ct(n,p){if(n&1){let e=S();a(0,"div",37)(1,"button",41),C("click",function(){d(e);let t=r().ngIf,i=r(2);return _(i.onOpenDialogUpdateStockInfo(t))}),x(2,"i",42),c(3," Update "),l(),x(4,"button",43),a(5,"ul",44)(6,"a",45),C("click",function(){d(e);let t=r(3);return _(t.openExportDialog())}),x(7,"i",46),a(8,"span"),c(9,"Export"),l()()()()}}function pt(n,p){if(n&1){let e=S();a(0,"button",47),C("click",function(){d(e);let t=r(3);return _(t.openExportDialog())}),x(1,"i",46),a(2,"span"),c(3,"Export"),l()()}}function mt(n,p){if(n&1&&(a(0,"div"),h(1,st,3,0,"button",36)(2,ct,10,0,"div",37)(3,pt,4,0,"button",38),l()),n&2){let e=p.ngIf,o=r(2);s(),m("ngIf",o.productService.hasSelectionVariant(e)),s(),v(o.productService.hasSelectionVariant(e)?2:3)}}function dt(n,p){n&1&&(a(0,"div",48)(1,"span"),c(2," showing only different stock, please press next to populate more data "),l()())}function _t(n,p){if(n&1){let e=S();a(0,"th")(1,"input",49),T("ngModelChange",function(t){d(e);let i=r(3);return F(i.checkboxState,t)||(i.checkboxState=t),_(t)}),C("ngModelChange",function(){let t=d(e).ngIf,i=r(3);return _(i.onCheckboxStateChange(t))}),l()()}if(n&2){let e=r(3);s(),b("ngModel",e.checkboxState)}}function ut(n,p){if(n&1&&(P(0),h(1,_t,2,1,"th",5),g(2,"async"),E()),n&2){let e=r(2);s(),m("ngIf",y(2,1,e.products$))}}function ht(n,p){n&1&&(a(0,"th",33),c(1," Reserved "),l())}function Ct(n,p){if(n&1){let e=S();a(0,"input",65),T("ngModelChange",function(t){d(e);let i=r(4).$implicit;return F(i.selected,t)||(i.selected=t),_(t)}),C("ngModelChange",function(){d(e);let t=r(4).$implicit,i=r(2);return _(i.onCheckboxStateProduct(t))}),l()}if(n&2){let e=r(4).$implicit;b("ngModel",e.selected)}}function gt(n,p){if(n&1&&(P(0),a(1,"div",63),h(2,Ct,1,1,"input",64),l(),E()),n&2){let e=r(3).$implicit;s(),m("ngClass",M(2,at,e.Variants.length<=1)),s(),v(e.Variants.length>1?2:-1)}}function ft(n,p){if(n&1){let e=S();a(0,"img",66),C("click",function(t){d(e);let i=r(3).$implicit,u=r(2);return _(u.onZoomImage(t,i==null?null:i.ImageUrl))}),l()}if(n&2){let e=r(3).$implicit;le("src",e==null?null:e.ThumbnailUrl,A)}}function xt(n,p){n&1&&x(0,"img",60)}function St(n,p){if(n&1&&(x(0,"br"),a(1,"div",67),x(2,"i",68),a(3,"small"),c(4),l()()),n&2){let e=r(3).$implicit;s(4),I("(",e==null?null:e.Category,")")}}function yt(n,p){if(n&1&&(a(0,"td",58)(1,"div",14),h(2,gt,3,4,"ng-container",27),a(3,"div"),h(4,ft,1,1,"img",59)(5,xt,1,0,"img",60),l()()(),a(6,"td",61)(7,"span",62),c(8),l(),h(9,St,5,1),l()),n&2){let e=r(2).$implicit,o=r(2);m("rowSpan",e==null?null:e.Variants.length),s(2),m("ngxPermissionsOnly",M(6,ne,o.inventoryUpdateRole)),s(2),v(e!=null&&e.ThumbnailUrl?4:5),s(2),m("rowSpan",e==null?null:e.Variants.length),s(2),O(e==null?null:e.Name),s(),v(e.CategoryID!==null&&e.CategoryID!=o.guidEmpty?9:-1)}}function vt(n,p){if(n&1){let e=S();a(0,"input",49),T("ngModelChange",function(t){d(e);let i=r(3).$implicit;return F(i.selected,t)||(i.selected=t),_(t)}),l()}if(n&2){let e=r(3).$implicit;b("ngModel",e.selected)}}function It(n,p){if(n&1&&h(0,vt,1,1,"input",70),n&2){let e=r(2).$implicit;v((e==null?null:e.Inventory)<=1e5?0:-1)}}function wt(n,p){if(n&1){let e=S();a(0,"input",49),T("ngModelChange",function(t){d(e);let i=r(2).$implicit;return F(i.selected,t)||(i.selected=t),_(t)}),l()}if(n&2){let e=r(2).$implicit;b("ngModel",e.selected)}}function bt(n,p){if(n&1&&(P(0),a(1,"td",69),h(2,It,1,1)(3,wt,1,1,"input",70),l(),E()),n&2){let e=r().$implicit;s(2),v((e==null?null:e.Channel[0].TypeID)==1?2:(e==null?null:e.Inventory)>=0?3:-1)}}function Ft(n,p){n&1&&(a(0,"div",71),c(1," Not Found "),l())}function Tt(n,p){if(n&1&&(a(0,"div")(1,"span",72),c(2),g(3,"number"),l(),c(4," => "),a(5,"span",73),c(6),g(7,"number"),l()()),n&2){let e=r().$implicit;s(2),I(" ",y(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),O(y(7,4,e==null?null:e.Inventory))}}function Dt(n,p){if(n&1&&(c(0),g(1,"number")),n&2){let e=r().$implicit;I(" ",y(1,1,e==null?null:e.Inventory)," ")}}function Pt(n,p){if(n&1&&(P(0),a(1,"div",74)(2,"a",75),x(3,"i",76),l()(),E()),n&2){let e=r().$implicit,o=r(3);s(2),m("href",o.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),A)}}function Et(n,p){if(n&1){let e=S();a(0,"span",81),C("click",function(){d(e);let t=r(2).$implicit,i=r().$implicit,u=r(2);return _(u.openTableDialog(i,t))}),c(1),g(2,"number"),l()}if(n&2){let e=r(2).$implicit,o=r(3);ae(M(5,rt,o.hasInventoryEdit())),s(),I(" ",y(2,3,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function Mt(n,p){if(n&1){let e=S();a(0,"td",77)(1,"div",53)(2,"div"),h(3,Et,3,7,"span",78),g(4,"async"),l(),a(5,"div",74)(6,"a",75),x(7,"i",76),l()(),a(8,"div",74)(9,"span",79),C("click",function(){d(e);let t=r().$implicit,i=r(3);return _(i.refreshInventory(t==null||t.Channel[0]==null?null:t.Channel[0].ChannelItemID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelVariationID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelID,t==null?null:t.ID))}),x(10,"i",80),l()()()()}if(n&2){let e=r().$implicit,o=r(3);m("ngClass",M(5,lt,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(3),m("ngIf",y(4,3,o.products$)),s(3),m("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,A)}}function Vt(n,p){if(n&1&&(P(0),a(1,"span",82),c(2),g(3,"number"),l(),E()),n&2){let e=r(2).$implicit;s(2),I(" (",y(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function kt(n,p){n&1&&c(0," - ")}function Rt(n,p){if(n&1&&(P(0),a(1,"td",51),h(2,Vt,4,3,"ng-container",57)(3,kt,1,0,"ng-template",null,1,Z),l(),E()),n&2){let e=K(4),o=r().$implicit;s(2),m("ngIf",o==null||o.Channel[0]==null?null:o.Channel[0].InventoryReserved)("ngIfElse",e)}}function Lt(n,p){n&1&&(P(0),c(1," - "),E())}function Nt(n,p){if(n&1&&(a(0,"span",83),g(1,"date"),c(2),g(3,"date"),l()),n&2){let e=r().$implicit;m("matTooltip",k(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),I(" ",k(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function At(n,p){if(n&1&&(a(0,"tr"),h(1,yt,10,8),a(2,"td",50),c(3),l(),a(4,"td",51)(5,"span",52),c(6),l()(),h(7,bt,4,1,"ng-container",27),a(8,"td")(9,"div",53),h(10,Ft,2,0,"div",54)(11,Tt,8,6,"div")(12,Dt,2,3)(13,Pt,4,1,"ng-container",5),l()(),h(14,Mt,11,7,"td",55)(15,Rt,5,2,"ng-container",5),a(16,"td",56),h(17,Lt,2,0,"ng-container",57)(18,Nt,4,8,"ng-template",null,0,Z),l()()),n&2){let e=p.$implicit,o=p.$index,t=K(19),i=r(3);s(),v(o==0?1:-1),s(2),O(e==null?null:e.Model),s(2),m("matTooltip",e.Discontinued?i.discontinuedVariantMsg:"")("ngClass",M(14,ot,e.Discontinued)),s(),O(e==null?null:e.Code),s(),m("ngxPermissionsOnly",M(16,ne,i.inventoryUpdateRole)),s(3),m("ngIf",(e==null?null:e.I)==null),s(),v((e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)?11:-1),s(),v((e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)?12:-1),s(),m("ngIf",(e==null?null:e.I)!=null),s(),m("ngIf",e==null?null:e.Channel),s(),m("ngIf",i.isShowReservedColumn),s(2),m("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==i.minDate)("ngIfElse",t)}}function Ot(n,p){if(n&1&&(a(0,"tbody"),G(1,At,20,18,"tr",null,z),l()),n&2){let e=p.$implicit;s(),Y(e.Variants)}}function Ut(n,p){if(n&1){let e=S();a(0,"mainpanel",3),C("onSubmit",function(t){d(e);let i=r();return _(i.onSearch(t))}),a(1,"actions")(2,"div",4),h(3,mt,4,2,"div",5),g(4,"async"),l()(),a(5,"filters")(6,"div")(7,"label",6),c(8,"Channel"),l(),a(9,"multiwarehouse-tree-select",7),C("onChannelChange",function(t){d(e);let i=r();return _(i.onChannelChange(t))}),l()(),a(10,"div",8)(11,"label",9),c(12,"PageNumber"),l(),a(13,"input",10),T("ngModelChange",function(t){d(e);let i=r();return F(i.searchFilter.PageNumber,t)||(i.searchFilter.PageNumber=t),_(t)}),l()(),a(14,"div",8)(15,"label",11),c(16,"Page Size"),l(),a(17,"input",12),T("ngModelChange",function(t){d(e);let i=r();return F(i.searchFilter.RowCount,t)||(i.searchFilter.RowCount=t),_(t)}),l()(),a(18,"div",8)(19,"label",13),c(20,"Quantity From - To"),l(),a(21,"div",14)(22,"input",15),T("ngModelChange",function(t){d(e);let i=r();return F(i.searchFilter.QuantityFrom,t)||(i.searchFilter.QuantityFrom=t),_(t)}),l(),c(23," - "),a(24,"input",16),T("ngModelChange",function(t){d(e);let i=r();return F(i.searchFilter.QuantityTo,t)||(i.searchFilter.QuantityTo=t),_(t)}),l()()()(),a(25,"content")(26,"div",17)(27,"div",18)(28,"div",19),h(29,dt,3,0,"div",20),a(30,"table",21),C("matSortChange",function(t){d(e);let i=r();return _(i.onSortVariant(t))}),a(31,"thead",22)(32,"tr")(33,"th",23),c(34," Product "),x(35,"br"),a(36,"mat-slide-toggle",24),C("toggleChange",function(){d(e);let t=r();return t.showDifferenceStock=!t.showDifferenceStock,_(t.onShowDifferenceStock())}),a(37,"small",13),c(38,"FILTER DIFFERENT INVENTORY"),l()()(),a(39,"th",25),c(40,"Variant"),l(),a(41,"th",26),c(42,"SKU"),l(),h(43,ut,3,3,"ng-container",27),a(44,"th",28),c(45," POS "),l(),a(46,"th",29)(47,"div",30),C("click",function(){d(e);let t=r();return _(t.openModalFilter())}),x(48,"img",31),a(49,"span",32),c(50),g(51,"stringLimit"),l()()(),h(52,ht,2,0,"th",33),a(53,"th",34),c(54,"Last Sync"),l()()(),G(55,Ot,3,0,"tbody",null,z),g(57,"async"),l(),a(58,"infinite-paginator",35),g(59,"async"),C("onNextPage",function(){d(e);let t=r();return _(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){d(e);let t=r();return _(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){d(e);let t=r();return _(t.infinitePagination.getRowCount(t.searchFilter))}),l()()()()()()}if(n&2){let e,o,t,i=r();m("headerTitle","Inventory Comparison")("pageData",i.pageData)("hideSearchBox",!1),s(3),m("ngIf",y(4,21,i.products$)),s(6),m("ngModel",(i.searchFilter==null?null:i.searchFilter.LocationID)||(i.searchFilter==null?null:i.searchFilter.ChannelID)),s(4),b("ngModel",i.searchFilter.PageNumber),s(4),b("ngModel",i.searchFilter.RowCount),s(5),b("ngModel",i.searchFilter.QuantityFrom),s(2),b("ngModel",i.searchFilter.QuantityTo),s(5),m("ngIf",(i.searchFilter==null?null:i.searchFilter.filterModel)==3),s(14),m("ngxPermissionsOnly",M(30,ne,i.inventoryUpdateRole)),s(4),m("matTooltip",((e=i.channelIdentity())==null||e.label==null?null:e.label.length)>13?(e=i.channelIdentity())==null?null:e.label:""),s(),m("src",(o=i.channelIdentity())==null?null:o.img,A),s(2),I(" ",k(51,23,(t=i.channelIdentity())==null?null:t.label,13)," "),s(2),v(i.isShowReservedColumn?52:-1),s(3),Y(y(57,26,i.products$)),s(3),m("totalData",i.infinitePagination.totalData())("hideCount",i.infinitePagination.hideCount())("rowCount",y(59,28,i.infinitePagination.totalRowCount$))("pageNumber",i.infinitePagination.pageNumber())("disableNextButton",i.infinitePagination.disableNextButton())("goToLastPage",i.infinitePagination.isLastPage())}}var An=(()=>{class n{constructor(e,o,t,i,u,ie,Xe){this.http=e,this.toastr=o,this.dialog=t,this.productService=i,this.authService=u,this.biggerPictureService=ie,this.mainPanelService=Xe,this.infinitePagination=w(J),this.ngxPermissionsService=w(we),this.updateResHandling=w(te),this.inventoryService=w(R),this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="InventoryLoader/Load",this.fetchApi="Inventory/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.minDate=f.MinDate,this.isShowReservedColumn=!0,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.guidEmpty=f.GuidEMpty,this.selectedChannel=V(null),this.channelIdentity=V({img:null,label:null}),this.inventoryUpdateRole=q.InventoryUpdate,this.hasInventoryEdit=V(!0),this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]}}ngOnInit(){this.initRoles(),this.hostName=this.authService.getDomain(),this.initPageLoader(),this.sourceObs$=this.infinitePagination.data$.pipe(H(e=>{this.checkShowReservedColumn(e)}),L(e=>(e=this.calculateAvailableStock(e),e)),N(1)),this.products$=this.sourceObs$}initRoles(){this.ngxPermissionsService.hasPermission(q.InventoryUpdate).then(e=>this.hasInventoryEdit.set(e))}calculateAvailableStock(e){return e.map(t=>(t.totalAvailable=t.Variants.reduce((i,u)=>(i+=u.I?.Available||0,i),0),t))}checkShowReservedColumn(e){let o=0,t;e.forEach(i=>{t=i.Variants.find(u=>f.IsNotEmpty(u?.Channel[0]?.InventoryReserved)),t&&(o+=1)}),this.isShowReservedColumn=o>0}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.fetchApi,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/api/${this.loaderApi}`,{}).pipe(N(1),H(e=>{this.searchFilter={RowCount:e.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:e.Filter.ChannelID,LocationID:e.Filter.LocationID},this.initReloadData(),this.showToastrMarketplaceInactive(!e.Filter.IsMarketplaceAppActive)}))}onChannelChange(e){let o=Object.assign({},e);this.selectedChannel.set(o),f.IsEmpty(this.channelIdentity()?.label)&&this.setChannelFilter()}setChannelFilter(){if(this.selectedChannel()){let e=Object.assign({},this.selectedChannel());f.IsNotEmpty(e.parent)?(this.searchFilter.LocationID=e.id,this.searchFilter.ChannelID=e?.parent?.id,e.label=e?.parent?.label+" - "+e?.label,e.img=f.getChannelLogoByTypeId(e?.parent?.typeid)):(this.searchFilter.LocationID=null,e.img=f.getChannelLogoByTypeId(e?.typeid),this.searchFilter.ChannelID=e?.id,this.selectedChannel.set(e)),this.channelIdentity.update(()=>({img:e.img,label:e.label}))}}initReloadData(){this.infinitePagination.reloadPagination(this.searchFilter)}showToastrMarketplaceInactive(e){e&&this.toastr.warning(`Automatic inventory sync disabled.
1
+ import{a as R}from"./chunk-EHBCYQSG.js";import{b as ze}from"./chunk-GRYGUILI.js";import"./chunk-HVCIQI7B.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import{a as Ze}from"./chunk-2BV7ZXRB.js";import"./chunk-IITU3NV6.js";import{a as ee}from"./chunk-XHAXYWZ7.js";import{a as Ge,b as Ye,c as Ke,d as J,e as te}from"./chunk-O2YNPIYM.js";import{a as Qe,b as He}from"./chunk-YTCIQBSO.js";import"./chunk-PGP3WHIS.js";import"./chunk-VFATXJRG.js";import"./chunk-RHHHL4OR.js";import{a as We}from"./chunk-X4B2FYY3.js";import"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import{a as q}from"./chunk-UMP6ZMEJ.js";import{a as Ue,b as Be,c as $e}from"./chunk-GHVAGYK3.js";import"./chunk-JVNHFIYT.js";import"./chunk-EPBVNII2.js";import"./chunk-UZWED4UK.js";import"./chunk-5CKVZBHM.js";import"./chunk-4YRBARG2.js";import"./chunk-BKRCW7SH.js";import"./chunk-RGAKHXPF.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import{a as je}from"./chunk-63ANFYRV.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import"./chunk-GZS2MOSK.js";import"./chunk-ACIMXBIC.js";import{e as De}from"./chunk-PYXL7UF7.js";import{i as Te}from"./chunk-P2AADVEN.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import{a as X}from"./chunk-CGOB6Y3X.js";import{b as ve,e as Ie}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{c as f}from"./chunk-EUYQST7Q.js";import{b as Me,c as Ve,d as ke,j as Re,k as Le,l as Ne,m as Ae,n as Oe}from"./chunk-HJXYT6MI.js";import{A as ye,b as Ce,c as ge,h as fe,m as xe,o as Se}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import{a as we,b as be,c as Fe}from"./chunk-ERXVXBTU.js";import{r as Pe,s as Ee}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{H as ue,J as he,d as me,g as de,j as $,k as W,m as _e,n as j}from"./chunk-FXQKRJWU.js";import{$c as g,Fc as K,G as Q,Gb as U,Gc as c,Hc as O,Ic as I,Kc as b,Lc as F,Mb as h,Mc as T,Nc as re,Oc as se,Pc as ce,Qc as B,Ra as V,Rc as pe,Sc as M,Yb as m,Z as N,ac as ae,ad as y,bd as k,cd as Z,dc as v,ea as H,ec as z,gc as G,hc as Y,ic as a,jc as l,kc as x,lc as P,mc as E,oc as S,pa as w,pb as A,rb as s,tc as C,uc as r,v as L,xb as D,xc as le,ya as d,za as _}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{a as oe}from"./chunk-66YHNWRR.js";var tt=()=>["/menu/order/download"];function nt(n,p){if(n&1&&(a(0,"li",4)(1,"div"),c(2," The last time you manually download your order is on "),a(3,"span",8),c(4),g(5,"date"),l()(),a(6,"div",9),c(7),l()()),n&2){r();let e=ce(0);s(4),I(" ",k(5,2,e==null?null:e.OrderDownloadLatestOn,"dd MMM yyyy HH:mm")," "),s(3),I("(",e==null?null:e.calculatedDate,")")}}function it(n,p){n&1&&(a(0,"li",4),c(1," The last time you manually download your order is on (-) "),l())}var qe=(()=>{class n{constructor(){this.dialogRef=w(Me),this.data=w(Ve),this.modalConfig=new Re,this.inventoryService=w(R),this.lastDownloadInfo$=this.inventoryService.getLastInfoDownloadInventory(this.data.channelId).pipe(L(e=>{let o=e.OrderDownloadLatestOn!=f.MinDate,t=null,i=null;return o&&(t=new Date(e.OrderDownloadLatestOn),i=f.convertToReadableDate(t)),{OrderDownloadLatestOn:t,calculatedDate:i}}),N(1)),this.selectedProducts=V(this.data.selectedProducts||[]),this.modalConfig.title="Manual Inventory Sync",this.modalConfig.customWidth="500px",this.modalConfig.bodyScrollable=!0,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0}onUpdate(){this.dialogRef.close(!0)}onCancel(){this.dialogRef.close(!1)}static{this.\u0275fac=function(o){return new(o||n)}}static{this.\u0275cmp=U({type:n,selectors:[["app-dialog-update-product-info"]],features:[B([R])],decls:16,vars:8,consts:[[3,"onCancel","config"],["content",""],[1,"container"],[1,"mt-8"],[1,"lh-base"],["footer",""],[1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3","py-8",3,"click","routerLink"],[1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3","py-8",3,"click","keyup.F2"],[1,"fw-bold","me-1"],[1,"fw-bold"]],template:function(o,t){if(o&1){let i=S();re(0),g(1,"async"),a(2,"modal-material",0),C("onCancel",function(){return d(i),_(t.onCancel())}),a(3,"div",1)(4,"div",2)(5,"h4"),c(6),l(),a(7,"div",3)(8,"ul"),h(9,nt,8,5,"li",4)(10,it,2,0,"li",4),l()()()(),a(11,"div",5)(12,"a",6),C("click",function(){return d(i),_(t.onCancel())}),c(13," Download "),l(),a(14,"button",7),C("click",function(){return d(i),_(t.onUpdate())})("keyup.F2",function(){return d(i),_(t.onUpdate())}),c(15," Update Anyway "),l()()()}if(o&2){let i=se(y(1,4,t.lastDownloadInfo$));s(2),m("config",t.modalConfig),s(4),I("",t.selectedProducts().length," Product(s) will be updated."),s(3),v(i!=null&&i.OrderDownloadLatestOn?9:10),s(3),m("routerLink",pe(7,tt))}},dependencies:[Le,j,$,W,he,ue],encapsulation:2})}}return n})();var ne=n=>[n],ot=n=>({"text-decoration-line-through":n}),at=n=>({"me-10":n}),lt=n=>({"bg-gradient-warning":n}),rt=n=>({cursor:n});function st(n,p){if(n&1){let e=S();a(0,"button",39),C("click",function(){d(e);let t=r().ngIf,i=r(2);return _(i.onScanInventory(t))}),x(1,"i",40),c(2,"Refresh "),l()}}function ct(n,p){if(n&1){let e=S();a(0,"div",37)(1,"button",41),C("click",function(){d(e);let t=r().ngIf,i=r(2);return _(i.onOpenDialogUpdateStockInfo(t))}),x(2,"i",42),c(3," Update "),l(),x(4,"button",43),a(5,"ul",44)(6,"a",45),C("click",function(){d(e);let t=r(3);return _(t.openExportDialog())}),x(7,"i",46),a(8,"span"),c(9,"Export"),l()()()()}}function pt(n,p){if(n&1){let e=S();a(0,"button",47),C("click",function(){d(e);let t=r(3);return _(t.openExportDialog())}),x(1,"i",46),a(2,"span"),c(3,"Export"),l()()}}function mt(n,p){if(n&1&&(a(0,"div"),h(1,st,3,0,"button",36)(2,ct,10,0,"div",37)(3,pt,4,0,"button",38),l()),n&2){let e=p.ngIf,o=r(2);s(),m("ngIf",o.productService.hasSelectionVariant(e)),s(),v(o.productService.hasSelectionVariant(e)?2:3)}}function dt(n,p){n&1&&(a(0,"div",48)(1,"span"),c(2," showing only different stock, please press next to populate more data "),l()())}function _t(n,p){if(n&1){let e=S();a(0,"th")(1,"input",49),T("ngModelChange",function(t){d(e);let i=r(3);return F(i.checkboxState,t)||(i.checkboxState=t),_(t)}),C("ngModelChange",function(){let t=d(e).ngIf,i=r(3);return _(i.onCheckboxStateChange(t))}),l()()}if(n&2){let e=r(3);s(),b("ngModel",e.checkboxState)}}function ut(n,p){if(n&1&&(P(0),h(1,_t,2,1,"th",5),g(2,"async"),E()),n&2){let e=r(2);s(),m("ngIf",y(2,1,e.products$))}}function ht(n,p){n&1&&(a(0,"th",33),c(1," Reserved "),l())}function Ct(n,p){if(n&1){let e=S();a(0,"input",65),T("ngModelChange",function(t){d(e);let i=r(4).$implicit;return F(i.selected,t)||(i.selected=t),_(t)}),C("ngModelChange",function(){d(e);let t=r(4).$implicit,i=r(2);return _(i.onCheckboxStateProduct(t))}),l()}if(n&2){let e=r(4).$implicit;b("ngModel",e.selected)}}function gt(n,p){if(n&1&&(P(0),a(1,"div",63),h(2,Ct,1,1,"input",64),l(),E()),n&2){let e=r(3).$implicit;s(),m("ngClass",M(2,at,e.Variants.length<=1)),s(),v(e.Variants.length>1?2:-1)}}function ft(n,p){if(n&1){let e=S();a(0,"img",66),C("click",function(t){d(e);let i=r(3).$implicit,u=r(2);return _(u.onZoomImage(t,i==null?null:i.ImageUrl))}),l()}if(n&2){let e=r(3).$implicit;le("src",e==null?null:e.ThumbnailUrl,A)}}function xt(n,p){n&1&&x(0,"img",60)}function St(n,p){if(n&1&&(x(0,"br"),a(1,"div",67),x(2,"i",68),a(3,"small"),c(4),l()()),n&2){let e=r(3).$implicit;s(4),I("(",e==null?null:e.Category,")")}}function yt(n,p){if(n&1&&(a(0,"td",58)(1,"div",14),h(2,gt,3,4,"ng-container",27),a(3,"div"),h(4,ft,1,1,"img",59)(5,xt,1,0,"img",60),l()()(),a(6,"td",61)(7,"span",62),c(8),l(),h(9,St,5,1),l()),n&2){let e=r(2).$implicit,o=r(2);m("rowSpan",e==null?null:e.Variants.length),s(2),m("ngxPermissionsOnly",M(6,ne,o.inventoryUpdateRole)),s(2),v(e!=null&&e.ThumbnailUrl?4:5),s(2),m("rowSpan",e==null?null:e.Variants.length),s(2),O(e==null?null:e.Name),s(),v(e.CategoryID!==null&&e.CategoryID!=o.guidEmpty?9:-1)}}function vt(n,p){if(n&1){let e=S();a(0,"input",49),T("ngModelChange",function(t){d(e);let i=r(3).$implicit;return F(i.selected,t)||(i.selected=t),_(t)}),l()}if(n&2){let e=r(3).$implicit;b("ngModel",e.selected)}}function It(n,p){if(n&1&&h(0,vt,1,1,"input",70),n&2){let e=r(2).$implicit;v((e==null?null:e.Inventory)<=1e5?0:-1)}}function wt(n,p){if(n&1){let e=S();a(0,"input",49),T("ngModelChange",function(t){d(e);let i=r(2).$implicit;return F(i.selected,t)||(i.selected=t),_(t)}),l()}if(n&2){let e=r(2).$implicit;b("ngModel",e.selected)}}function bt(n,p){if(n&1&&(P(0),a(1,"td",69),h(2,It,1,1)(3,wt,1,1,"input",70),l(),E()),n&2){let e=r().$implicit;s(2),v((e==null?null:e.Channel[0].TypeID)==1?2:(e==null?null:e.Inventory)>=0?3:-1)}}function Ft(n,p){n&1&&(a(0,"div",71),c(1," Not Found "),l())}function Tt(n,p){if(n&1&&(a(0,"div")(1,"span",72),c(2),g(3,"number"),l(),c(4," => "),a(5,"span",73),c(6),g(7,"number"),l()()),n&2){let e=r().$implicit;s(2),I(" ",y(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),O(y(7,4,e==null?null:e.Inventory))}}function Dt(n,p){if(n&1&&(c(0),g(1,"number")),n&2){let e=r().$implicit;I(" ",y(1,1,e==null?null:e.Inventory)," ")}}function Pt(n,p){if(n&1&&(P(0),a(1,"div",74)(2,"a",75),x(3,"i",76),l()(),E()),n&2){let e=r().$implicit,o=r(3);s(2),m("href",o.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),A)}}function Et(n,p){if(n&1){let e=S();a(0,"span",81),C("click",function(){d(e);let t=r(2).$implicit,i=r().$implicit,u=r(2);return _(u.openTableDialog(i,t))}),c(1),g(2,"number"),l()}if(n&2){let e=r(2).$implicit,o=r(3);ae(M(5,rt,o.hasInventoryEdit())),s(),I(" ",y(2,3,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function Mt(n,p){if(n&1){let e=S();a(0,"td",77)(1,"div",53)(2,"div"),h(3,Et,3,7,"span",78),g(4,"async"),l(),a(5,"div",74)(6,"a",75),x(7,"i",76),l()(),a(8,"div",74)(9,"span",79),C("click",function(){d(e);let t=r().$implicit,i=r(3);return _(i.refreshInventory(t==null||t.Channel[0]==null?null:t.Channel[0].ChannelItemID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelVariationID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelID,t==null?null:t.ID))}),x(10,"i",80),l()()()()}if(n&2){let e=r().$implicit,o=r(3);m("ngClass",M(5,lt,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(3),m("ngIf",y(4,3,o.products$)),s(3),m("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,A)}}function Vt(n,p){if(n&1&&(P(0),a(1,"span",82),c(2),g(3,"number"),l(),E()),n&2){let e=r(2).$implicit;s(2),I(" (",y(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function kt(n,p){n&1&&c(0," - ")}function Rt(n,p){if(n&1&&(P(0),a(1,"td",51),h(2,Vt,4,3,"ng-container",57)(3,kt,1,0,"ng-template",null,1,Z),l(),E()),n&2){let e=K(4),o=r().$implicit;s(2),m("ngIf",o==null||o.Channel[0]==null?null:o.Channel[0].InventoryReserved)("ngIfElse",e)}}function Lt(n,p){n&1&&(P(0),c(1," - "),E())}function Nt(n,p){if(n&1&&(a(0,"span",83),g(1,"date"),c(2),g(3,"date"),l()),n&2){let e=r().$implicit;m("matTooltip",k(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),I(" ",k(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function At(n,p){if(n&1&&(a(0,"tr"),h(1,yt,10,8),a(2,"td",50),c(3),l(),a(4,"td",51)(5,"span",52),c(6),l()(),h(7,bt,4,1,"ng-container",27),a(8,"td")(9,"div",53),h(10,Ft,2,0,"div",54)(11,Tt,8,6,"div")(12,Dt,2,3)(13,Pt,4,1,"ng-container",5),l()(),h(14,Mt,11,7,"td",55)(15,Rt,5,2,"ng-container",5),a(16,"td",56),h(17,Lt,2,0,"ng-container",57)(18,Nt,4,8,"ng-template",null,0,Z),l()()),n&2){let e=p.$implicit,o=p.$index,t=K(19),i=r(3);s(),v(o==0?1:-1),s(2),O(e==null?null:e.Model),s(2),m("matTooltip",e.Discontinued?i.discontinuedVariantMsg:"")("ngClass",M(14,ot,e.Discontinued)),s(),O(e==null?null:e.Code),s(),m("ngxPermissionsOnly",M(16,ne,i.inventoryUpdateRole)),s(3),m("ngIf",(e==null?null:e.I)==null),s(),v((e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)?11:-1),s(),v((e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)?12:-1),s(),m("ngIf",(e==null?null:e.I)!=null),s(),m("ngIf",e==null?null:e.Channel),s(),m("ngIf",i.isShowReservedColumn),s(2),m("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==i.minDate)("ngIfElse",t)}}function Ot(n,p){if(n&1&&(a(0,"tbody"),G(1,At,20,18,"tr",null,z),l()),n&2){let e=p.$implicit;s(),Y(e.Variants)}}function Ut(n,p){if(n&1){let e=S();a(0,"mainpanel",3),C("onSubmit",function(t){d(e);let i=r();return _(i.onSearch(t))}),a(1,"actions")(2,"div",4),h(3,mt,4,2,"div",5),g(4,"async"),l()(),a(5,"filters")(6,"div")(7,"label",6),c(8,"Channel"),l(),a(9,"multiwarehouse-tree-select",7),C("onChannelChange",function(t){d(e);let i=r();return _(i.onChannelChange(t))}),l()(),a(10,"div",8)(11,"label",9),c(12,"PageNumber"),l(),a(13,"input",10),T("ngModelChange",function(t){d(e);let i=r();return F(i.searchFilter.PageNumber,t)||(i.searchFilter.PageNumber=t),_(t)}),l()(),a(14,"div",8)(15,"label",11),c(16,"Page Size"),l(),a(17,"input",12),T("ngModelChange",function(t){d(e);let i=r();return F(i.searchFilter.RowCount,t)||(i.searchFilter.RowCount=t),_(t)}),l()(),a(18,"div",8)(19,"label",13),c(20,"Quantity From - To"),l(),a(21,"div",14)(22,"input",15),T("ngModelChange",function(t){d(e);let i=r();return F(i.searchFilter.QuantityFrom,t)||(i.searchFilter.QuantityFrom=t),_(t)}),l(),c(23," - "),a(24,"input",16),T("ngModelChange",function(t){d(e);let i=r();return F(i.searchFilter.QuantityTo,t)||(i.searchFilter.QuantityTo=t),_(t)}),l()()()(),a(25,"content")(26,"div",17)(27,"div",18)(28,"div",19),h(29,dt,3,0,"div",20),a(30,"table",21),C("matSortChange",function(t){d(e);let i=r();return _(i.onSortVariant(t))}),a(31,"thead",22)(32,"tr")(33,"th",23),c(34," Product "),x(35,"br"),a(36,"mat-slide-toggle",24),C("toggleChange",function(){d(e);let t=r();return t.showDifferenceStock=!t.showDifferenceStock,_(t.onShowDifferenceStock())}),a(37,"small",13),c(38,"FILTER DIFFERENT INVENTORY"),l()()(),a(39,"th",25),c(40,"Variant"),l(),a(41,"th",26),c(42,"SKU"),l(),h(43,ut,3,3,"ng-container",27),a(44,"th",28),c(45," POS "),l(),a(46,"th",29)(47,"div",30),C("click",function(){d(e);let t=r();return _(t.openModalFilter())}),x(48,"img",31),a(49,"span",32),c(50),g(51,"stringLimit"),l()()(),h(52,ht,2,0,"th",33),a(53,"th",34),c(54,"Last Sync"),l()()(),G(55,Ot,3,0,"tbody",null,z),g(57,"async"),l(),a(58,"infinite-paginator",35),g(59,"async"),C("onNextPage",function(){d(e);let t=r();return _(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){d(e);let t=r();return _(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){d(e);let t=r();return _(t.infinitePagination.getRowCount(t.searchFilter))}),l()()()()()()}if(n&2){let e,o,t,i=r();m("headerTitle","Inventory Comparison")("pageData",i.pageData)("hideSearchBox",!1),s(3),m("ngIf",y(4,21,i.products$)),s(6),m("ngModel",(i.searchFilter==null?null:i.searchFilter.LocationID)||(i.searchFilter==null?null:i.searchFilter.ChannelID)),s(4),b("ngModel",i.searchFilter.PageNumber),s(4),b("ngModel",i.searchFilter.RowCount),s(5),b("ngModel",i.searchFilter.QuantityFrom),s(2),b("ngModel",i.searchFilter.QuantityTo),s(5),m("ngIf",(i.searchFilter==null?null:i.searchFilter.filterModel)==3),s(14),m("ngxPermissionsOnly",M(30,ne,i.inventoryUpdateRole)),s(4),m("matTooltip",((e=i.channelIdentity())==null||e.label==null?null:e.label.length)>13?(e=i.channelIdentity())==null?null:e.label:""),s(),m("src",(o=i.channelIdentity())==null?null:o.img,A),s(2),I(" ",k(51,23,(t=i.channelIdentity())==null?null:t.label,13)," "),s(2),v(i.isShowReservedColumn?52:-1),s(3),Y(y(57,26,i.products$)),s(3),m("totalData",i.infinitePagination.totalData())("hideCount",i.infinitePagination.hideCount())("rowCount",y(59,28,i.infinitePagination.totalRowCount$))("pageNumber",i.infinitePagination.pageNumber())("disableNextButton",i.infinitePagination.disableNextButton())("goToLastPage",i.infinitePagination.isLastPage())}}var An=(()=>{class n{constructor(e,o,t,i,u,ie,Xe){this.http=e,this.toastr=o,this.dialog=t,this.productService=i,this.authService=u,this.biggerPictureService=ie,this.mainPanelService=Xe,this.infinitePagination=w(J),this.ngxPermissionsService=w(we),this.updateResHandling=w(te),this.inventoryService=w(R),this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="InventoryLoader/Load",this.fetchApi="Inventory/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.minDate=f.MinDate,this.isShowReservedColumn=!0,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.guidEmpty=f.GuidEMpty,this.selectedChannel=V(null),this.channelIdentity=V({img:null,label:null}),this.inventoryUpdateRole=q.InventoryUpdate,this.hasInventoryEdit=V(!0),this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]}}ngOnInit(){this.initRoles(),this.hostName=this.authService.getDomain(),this.initPageLoader(),this.sourceObs$=this.infinitePagination.data$.pipe(H(e=>{this.checkShowReservedColumn(e)}),L(e=>(e=this.calculateAvailableStock(e),e)),N(1)),this.products$=this.sourceObs$}initRoles(){this.ngxPermissionsService.hasPermission(q.InventoryUpdate).then(e=>this.hasInventoryEdit.set(e))}calculateAvailableStock(e){return e.map(t=>(t.totalAvailable=t.Variants.reduce((i,u)=>(i+=u.I?.Available||0,i),0),t))}checkShowReservedColumn(e){let o=0,t;e.forEach(i=>{t=i.Variants.find(u=>f.IsNotEmpty(u?.Channel[0]?.InventoryReserved)),t&&(o+=1)}),this.isShowReservedColumn=o>0}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.fetchApi,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/api/${this.loaderApi}`,{}).pipe(N(1),H(e=>{this.searchFilter={RowCount:e.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:e.Filter.ChannelID,LocationID:e.Filter.LocationID},this.initReloadData(),this.showToastrMarketplaceInactive(!e.Filter.IsMarketplaceAppActive)}))}onChannelChange(e){let o=Object.assign({},e);this.selectedChannel.set(o),f.IsEmpty(this.channelIdentity()?.label)&&this.setChannelFilter()}setChannelFilter(){if(this.selectedChannel()){let e=Object.assign({},this.selectedChannel());f.IsNotEmpty(e.parent)?(this.searchFilter.LocationID=e.id,this.searchFilter.ChannelID=e?.parent?.id,e.label=e?.parent?.label+" - "+e?.label,e.img=f.getChannelLogoByTypeId(e?.parent?.typeid)):(this.searchFilter.LocationID=null,e.img=f.getChannelLogoByTypeId(e?.typeid),this.searchFilter.ChannelID=e?.id,this.selectedChannel.set(e)),this.channelIdentity.update(()=>({img:e.img,label:e.label}))}}initReloadData(){this.infinitePagination.reloadPagination(this.searchFilter)}showToastrMarketplaceInactive(e){e&&this.toastr.warning(`Automatic inventory sync disabled.
2
2
  Please enable Dealpos X Marketplace Apps integration in POS Configuration`,"Warning")}onSearch(e){this.searchFilter.text=e,this.setChannelFilter(),this.initReloadData()}openModalFilter(){this.mainPanelService.openModalFilter()}onOpenDialogUpdateStockInfo(e){let o=this.productService.selectedVariantProduct(e);this.dialog.open(qe,{data:{channelId:o[0]?.Channel[0]?.ChannelID,selectedProducts:o}}).afterClosed().pipe(Q(t=>t===!0)).subscribe(()=>{this.updateStock(o)})}updateStock(e){if(e.length>0){let o=this.searchFilter.LocationID,t=e.map(u=>oe({ChannelItemID:u?.Channel[0]?.ChannelItemID,ChannelVariationID:u?.Channel[0]?.ChannelVariationID,Inventory:u.Inventory},f.IsNotEmpty(o)&&{LocationID:o})),i={ListChannelID:[this.searchFilter.ChannelID],List:t};this.http.post(X.UpdateInventoryChannel,i).subscribe(u=>{this.initReloadData(),this.checkboxState=!1,this.handlingUpdateStock(u)})}}handlingUpdateStock(e){if(e[0]?.Response){let o=e[0]?.Response?.Fail_list,t=e[0]?.Response?.Success_list;this.updateResHandling.responseHandling(t,o,"Stock")}else this.toastr.error(e[0]?.Exception,"Error")}refreshInventory(e,o,t,i){let u={ChannelItemID:e,ChannelVariationID:o,ChannelID:t,VariantID:i};this.http.post("/api/Inventory/RefreshInventoryChannel",u).subscribe(ie=>{this.toastr.success("Successfully updated","Success"),this.initReloadData()})}onCheckboxStateProduct(e){e.Variants=e.Variants.map(o=>(o.Inventory>=0&&(o.selected=e.selected),o))}onCheckboxStateChange(e){e=e.map(o=>(o.Variants=o.Variants.map(t=>(t.selected=this.checkboxState,t)),o))}openTableDialog(e,o){this.hasInventoryEdit()&&this.dialog.open(Ge,{data:{Name:e.Name,Variant:o,ChannelID:o?.Channel[0]?.ChannelID,Table:"inventory",ChannelItemID:e.ChannelItemID}}).afterClosed().pipe(Q(i=>f.IsNotEmpty(i))).subscribe(i=>{this.updateItemAfterDialog(i)})}updateItemAfterDialog(e){let o=e.InventoryMultiwarehouse[0]?.LocationID,t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,NewQuantity:e?.Inventory,VariantID:e.ID,SKU:e?.Sku,LocationID:o};this.http.post(X.UpdateUpdateQuantityByItem,t).subscribe(i=>{this.searchFilter.PageNumber=1,this.initReloadData(),this.handlingUpdateStock([i])})}onScanInventory(e){let o=this.productService.selectedVariantProduct(e);this.inventoryService.refreshInventory(o).subscribe(()=>{this.initReloadData(),this.toastr.success("Inventory refreshed successfully","Success")})}openExportDialog(){this.dialog.open(ze,{data:{title:"Export Inventory Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,QuantityFrom:this.searchFilter.QuantityFrom,QuantityTo:this.searchFilter.QuantityTo,exportApi:"Inventory/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}onShowDifferenceStock(){this.showDifferenceStock?this.searchFilter.filterModel=ee.DIFFERENCE:this.searchFilter.filterModel=ee.ALL,this.initReloadData()}onZoomImage(e,o){this.biggerPictureService.openBiggerPicture(e,o)}onSortVariant(e){if(e.direction==""){this.products$=this.sourceObs$;return}this.products$=this.products$.pipe(L(o=>o.map(t=>(t.Variants=t.Variants.sort((i,u)=>f.compare(i.I?.Available,u.I?.Available,e.direction==="asc")),t)).sort((t,i)=>f.compare(t.totalAvailable,i.totalAvailable,e.direction==="asc"))))}static{this.\u0275fac=function(o){return new(o||n)(D(Ie),D(ve),D(ke),D(We),D(Te),D(je),D(Ne))}}static{this.\u0275cmp=U({type:n,selectors:[["app-single-channel-comparison"]],features:[B([J,R,te])],decls:2,vars:3,consts:[["SYNCDATE",""],["EMPTY_RESERVED",""],["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit",4,"ngIf"],["textButton","Search",3,"onSubmit","headerTitle","pageData","hideSearchBox"],[1,"d-flex"],[4,"ngIf"],["for","channelOptions",1,"fw-bold","mb-2"],["id","channelOptions",3,"onChannelChange","ngModel"],[1,"mt-5"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"mat-mdc-tooltip-trigger","form-control","ng-pristine","ng-valid","ng-touched","mt-3",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"mat-mdc-tooltip-trigger","form-control","ng-pristine","ng-valid","ng-touched","mt-3",3,"ngModelChange","ngModel"],[1,"fw-bold"],[1,"d-flex","align-items-center","justify-content-start"],["type","number","name","QuantityFrom",1,"w-25","me-2","mt-3","form-control",3,"ngModelChange","ngModel"],["type","number","name","QuantityTo",1,"w-25","ms-2","form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["class","alert alert-warning d-flex justify-content-between text-dark","role","alert",4,"ngIf"],["matSort","",1,"table","border-bottom",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","ps-12",2,"width","25%"],[3,"toggleChange"],["scope","col",1,"text-start"],["scope","col",1,"text-end",2,"width","10%"],[4,"ngxPermissionsOnly"],["scope","col","mat-sort-header","Available","arrowPosition","before",1,"text-end","w-10",2,"width","8%"],[1,"text-end",2,"width","150px"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],["matTooltip","Reserved Stock","matTooltipPosition","above",1,"text-end",2,"width","80px"],[1,"text-center",2,"width","145px"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["class","btn btn-outline-dark me-3","matTooltip","Fetch the latest stock directly from the channel",3,"click",4,"ngIf"],[1,"btn-group"],[1,"btn","btn-outline-secondary","shadow","rounded"],["matTooltip","Fetch the latest stock directly from the channel",1,"btn","btn-outline-dark","me-3",3,"click"],[1,"fa-solid","fa-arrows-rotate","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],["data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-success","btn-sm","dropdown-toggle","border-start"],[1,"dropdown-menu","dropdown-menu-end","pointer"],["role","button",1,"dropdown-item","cursor-pointer","fs-5",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],["role","alert",1,"alert","alert-warning","d-flex","justify-content-between","text-dark"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["class","text-danger","matTooltip","This product is no longer available in POS","matTooltipPosition","above",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],[1,"text-center"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[3,"ngClass"],["type","checkbox",1,"me-3",3,"ngModel"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],[1,"d-flex","align-items-center"],["title","Category",1,"fa-solid","fa-tags","me-2",2,"opacity","60%"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],["title","Stock Available"],["title","Inventory below minimum inventory"],[1,"ms-3"],["target","_blank",3,"href"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"text-end",3,"ngClass"],[3,"class","click",4,"ngIf"],["matTooltip","Refresh stock according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","fa-sync","fa-lg","external-link-custom","pt-1"],[3,"click"],[1,"text-danger"],["matTooltipShowDelay","500",3,"matTooltip"]],template:function(o,t){o&1&&(h(0,Ut,60,32,"mainpanel",2),g(1,"async")),o&2&&m("ngIf",y(1,1,t.loader$))},dependencies:[j,me,de,$,_e,W,Oe,Ae,De,ye,ge,Se,Ce,fe,xe,Ye,Ke,Fe,be,He,Qe,Ee,Pe,$e,Ue,Be,Ze],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}"]})}}return n})();export{An as SingleChannelComparisonComponent};
@@ -1,4 +1,4 @@
1
- import{a as Vt}from"./chunk-XPCRS7AL.js";import{a as At,b as he}from"./chunk-MX5SR3SR.js";import{a as Ft}from"./chunk-Q4N2QUV6.js";import{a as Lt,b as Je}from"./chunk-YQLOB7IQ.js";import{e as Xe}from"./chunk-OZ7LWNOK.js";import{a as Ye}from"./chunk-YFDFIBAG.js";import{A as kt,F as St,I as Tt,M as Mt,P as Qe,R as F,V as Ue,W as We,_ as wt,aa as Pt,f as Ze,fa as Dt,k as bt,ka as Ot,m as vt,n as yt,na as Et,oa as de,q as Ee,r as Le,w as Ct,x as qe}from"./chunk-RC5PUUVM.js";import{a as ue}from"./chunk-ACIMXBIC.js";import{a as S}from"./chunk-CGOB6Y3X.js";import{e as Ce}from"./chunk-WN5DZGA4.js";import{c as je,d as Ge,f as me,i as pe}from"./chunk-4NEKWRL7.js";import{c as ke,d as Se,e as Te}from"./chunk-PYXL7UF7.js";import{b as x,c as He}from"./chunk-RXQX7567.js";import{b as Me,c as we,d as xt,e as Pe,f as De,g as It,h as Oe}from"./chunk-HJXYT6MI.js";import{A as V,h as ve,m as ye}from"./chunk-5PS6ZS3N.js";import{r as gt,s as ft}from"./chunk-MFQQEEHJ.js";import{H as _t,J as ze,d as Re,f as dt,g as Ne,h as Be,i as ht,k as be,n as T,o as ce}from"./chunk-FXQKRJWU.js";import{$b as ct,$c as q,Ac as G,Bc as w,Ca as st,Cc as P,Fc as fe,G as Y,Gb as C,Gc as u,Hb as lt,Hc as M,Ic as oe,Ka as L,Kb as $e,Kc as re,Lc as se,Mb as f,Mc as ae,Na as H,Oa as j,Qc as mt,Ra as I,Rc as Z,Sc as xe,Tc as pt,Xb as v,Yb as a,_b as Ke,aa as R,ac as N,bd as Q,cd as le,dc as X,ec as J,gc as ee,hc as te,ia as ot,ic as l,ja as E,jc as m,ka as rt,kc as y,lc as ie,mc as ne,ob as Fe,oc as k,od as B,pa as b,pb as at,pd as U,rb as c,rd as Ie,sd as ut,tc as _,uc as r,v as W,xb as Ae,ya as d,za as h,zc as ge}from"./chunk-OJMQBH6T.js";import{a as D,b as O}from"./chunk-66YHNWRR.js";var $t=(()=>{class n{constructor(){this.httpService=b(Ce)}getShippingOptions(e,t){return this.httpService.post(S.GetShopeeShippingOptions,{OrderNumber:e,ShopID:t})}pickupOrder(e){return this.httpService.post(S.ShopeeSelectShipping,e)}pickupMultipleOrders(e){return this.httpService.post(S.ShopeeSelectMultipleShipping,e)}dropOffOrder(e,t){let i={OrderNumber:e,ShopID:t,dropoff:{}};return this.httpService.post(S.ShopeeSelectShipping,i)}dropOffMultipleOrders(e){return this.httpService.post(S.ShopeeSelectMultipleShipping,e)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=E({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var Kt=(()=>{class n{constructor(){this.httpService=b(Ce)}getShippingOptions(e,t){return this.httpService.post(S.GetTiktokShippingOptions,{OrderNumber:e,ShopID:t}).pipe(W(i=>this.formatDatePickUpOptions(i)))}pickupOrder(e){return this.httpService.post(S.TiktokSelectShipping,e)}pickupMultipleOrders(e){return this.httpService.post(S.TiktokSelectMultipleShipping,e)}dropOffOrder(e,t){let i={handover_method:"DROP_OFF",PackageID:e,ShopID:t};return this.httpService.post(S.TiktokSelectShipping,i)}dropOffMultipleOrders(e){return this.httpService.post(S.TiktokSelectMultipleShipping,e)}formatDatePickUpOptions(e){return e?.Options?.pickup_slots&&(e.Options.pickup_slots=e?.Options?.pickup_slots.map(t=>{let i=He.convertTimestampToDate(t.start_time),o=He.convertTimestampToDate(t.end_time);return t.start_date=i,t.end_date=o,t})),e}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=E({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();function Zt(n,p){if(n&1){let e=k();l(0,"div",10),_("click",function(){d(e);let i=r();return h(i.onSelectDelivery("DROP_OFF"))}),l(1,"div",11),y(2,"i",12),l(3,"h3",13),u(4,"Drop off"),m()(),l(5,"p",14),u(6," You can drop off your package at the nearest shipping counter in your city. "),m()()}if(n&2){let e=r();Ke("text-muted",e.selectedDelivery()&&e.selectedDelivery()==="PICK_UP")("selected",e.selectedDelivery()==="DROP_OFF")}}function qt(n,p){if(n&1){let e=k();l(0,"div",10),_("click",function(){d(e);let i=r();return h(i.onSelectDelivery("PICK_UP"))}),l(1,"div",11),y(2,"i",15),l(3,"h3",16),u(4,"Pick up"),m()(),l(5,"p",17),u(6," The courier will collect the package from your address. "),m()()}if(n&2){let e=r();Ke("text-muted",e.selectedDelivery()&&e.selectedDelivery()==="DROP_OFF")("selected",e.selectedDelivery()==="PICK_UP")}}var et=(()=>{class n{constructor(){this.data=b(we),this.dialogRef=b(Me),this.selectedDelivery=I("DROP_OFF"),this.showPickup=I(!0),this.showDropOff=I(!0),this.initOptionsCondition()}onSelectDelivery(e){this.selectedDelivery.set(e)}initOptionsCondition(){switch(this.data.channelType){case x.Shopee:break;case x.Tiktok:this.showPickup.set(this.data.options?.Form?.information?.can_pickup),this.showDropOff.set(this.data.options?.Form?.information?.can_drop_off);break}}onConfirm(){this.dialogRef.close(this.selectedDelivery())}onClose(){this.dialogRef.close()}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=C({type:n,selectors:[["app-delivery-dialog"]],decls:16,vars:2,consts:[["mat-dialog-title","",1,"mt-12","mb-8"],[1,"d-flex","justify-content-between","align-items-start","lh-lg"],[1,"ms-2"],[1,"text-secondary-emphasis"],[1,"fa-solid","fa-xmark","text-muted","cursor-pointer","fs-3",3,"click"],[1,"pb-0"],[1,"d-flex","align-items-center","justify-content-center","gap-12"],["role","button",1,"delivery-option","d-flex","flex-column","align-items-center","justify-content-center","p-4","cursor-pointer",3,"text-muted","selected"],[1,"d-flex","justify-content-end",2,"margin-top","1.5rem"],[1,"btn","btn-light-blue","me-3","text-primary","btn-lg","fw-bold","mx-3","py-6",2,"width","70px",3,"click"],["role","button",1,"delivery-option","d-flex","flex-column","align-items-center","justify-content-center","p-4","cursor-pointer",3,"click"],[1,"text-center"],[1,"fa-solid","fa-cart-shopping-fast","fa-4x"],[1,"mt-4","titlew"],[1,"text-center","mt-4","lh-sm","subtitlew"],[1,"fa-solid","fa-hand-holding-box","fa-4x"],[1,"mt-4"],[1,"text-center","mt-4","lh-sm"]],template:function(t,i){t&1&&(l(0,"div",0)(1,"div",1)(2,"div",2)(3,"h2"),u(4,"Delivery Order"),m(),l(5,"div",3),u(6,"Your selected order(s) will be set to"),m()(),l(7,"div")(8,"i",4),_("click",function(){return i.onClose()}),m()()()(),l(9,"mat-dialog-content",5)(10,"div",6),f(11,Zt,7,4,"div",7)(12,qt,7,4,"div",7),m(),l(13,"div",8)(14,"button",9),_("click",function(){return i.onConfirm()}),u(15," OK "),m()()()),t&2&&(c(11),X(i.showPickup()?11:-1),c(),X(i.showDropOff()?12:-1))},dependencies:[T,Oe,Pe,De],styles:[".delivery-option[_ngcontent-%COMP%]{width:14rem;height:12rem;border:1px solid #656565}.delivery-option[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:0}.delivery-option.text-muted[_ngcontent-%COMP%]{border-color:#000;color:#000}.delivery-option.selected[_ngcontent-%COMP%]{color:#5e9708;border-color:#5e9708}.delivery-option.selected[_ngcontent-%COMP%] .titlew[_ngcontent-%COMP%]{color:#5e9708;font-weight:700}.delivery-option.selected[_ngcontent-%COMP%] .subtitlew[_ngcontent-%COMP%]{color:#5e9708}"]})}}return n})();function Wt(n,p){if(n&1&&(l(0,"ng-option",3),u(1),m()),n&2){let e=p.$implicit;a("value",e==null?null:e.address_id)("matTooltip",e==null?null:e.address),c(),M(e==null?null:e.address)}}function Yt(n,p){if(n&1&&(l(0,"ng-option",6)(1,"span",7),u(2),q(3,"date"),m(),l(4,"span"),u(5),m()()),n&2){let e=p.$implicit;a("value",e==null?null:e.pickup_time_id),c(2),M(Q(3,3,e==null?null:e.date,"d MMMM")),c(3),M(e==null?null:e.time_text)}}var Nt=(()=>{class n{constructor(){this.shippingOptions=j(),this.onFormChanges=H(),this.addressList=Ie(()=>this.shippingOptions()?.response?.pickup?.address_list||[]),this.selectedShipping=I(null),this.timeOptions=I(this.convertTimestampToDate(this.addressList()[0]?.time_slot_list||[])),this.pickupTime=I(null)}onAddressChange(e){let t=this.addressList().find(i=>i.address_id===e);this.timeOptions.set(this.convertTimestampToDate(t?.time_slot_list||[])),this.pickupTime.set(null)}onValueChanges(){this.onFormChanges.emit({address_id:this.selectedShipping(),pickup_time_id:this.pickupTime()})}convertTimestampToDate(e){return e.map(t=>{let i=new Date(t.date*1e3);return O(D({},t),{date:i})})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=C({type:n,selectors:[["shopee-pickup"]],inputs:{shippingOptions:[1,"shippingOptions"]},outputs:{onFormChanges:"onFormChanges"},decls:12,vars:4,consts:[[1,"mb-6"],["for","address",1,"mb-2","text-muted"],["id","address","placeholder","Select Address to Pickup","appendTo","body",1,"shipping-timepicker",3,"ngModelChange","clearable","ngModel"],[3,"value","matTooltip"],["for","timepicker",1,"mb-2","text-muted"],["id","timepicker","placeholder","Select Date Pickup","appendTo","body",1,"shipping-timepicker",3,"ngModelChange","clearable","ngModel"],[3,"value"],[1,"me-2"]],template:function(t,i){t&1&&(l(0,"div",0)(1,"label",1),u(2,"Address"),m(),l(3,"ng-select",2),ae("ngModelChange",function(s){return se(i.selectedShipping,s)||(i.selectedShipping=s),s}),_("ngModelChange",function(s){return i.onAddressChange(s),i.onValueChanges()}),ee(4,Wt,2,3,"ng-option",3,J),m()(),l(6,"div",0)(7,"label",4),u(8,"Date"),m(),l(9,"ng-select",5),ae("ngModelChange",function(s){return se(i.pickupTime,s)||(i.pickupTime=s),s}),_("ngModelChange",function(){return i.onValueChanges()}),ee(10,Yt,6,6,"ng-option",6,J),m()()),t&2&&(c(3),a("clearable",!1),re("ngModel",i.selectedShipping),c(),te(i.addressList()),c(5),a("clearable",!1),re("ngModel",i.pickupTime),c(),te(i.timeOptions()))},dependencies:[T,be,Te,Se,ke,V,ve,ye,ft,gt],encapsulation:2})}}return n})();function Xt(n,p){if(n&1&&(l(0,"ng-option",3)(1,"span",4),u(2),q(3,"date"),m(),l(4,"span"),u(5),q(6,"date"),m(),l(7,"span",5),u(8,"-"),m(),l(9,"span"),u(10),q(11,"date"),m()()),n&2){let e=p.$implicit,t=p.$index;a("value",t),c(2),M(Q(3,4,e==null?null:e.start_date,"d MMMM")),c(3),M(Q(6,7,e==null?null:e.start_date,"HH:mm")),c(5),M(Q(11,10,e==null?null:e.end_date,"HH:mm"))}}var Bt=(()=>{class n{constructor(){this.shippingOptions=j(),this.onFormChanges=H(),this.timeOptions=Ie(()=>this.shippingOptions()?.Options?.pickup_slots),this.selectedTimeIndex=I(null)}onValueChanges(){let e=this.timeOptions()[this.selectedTimeIndex()];this.onFormChanges.emit({start_time:e?.start_time,end_time:e?.end_time})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=C({type:n,selectors:[["tiktok-pickup"]],inputs:{shippingOptions:[1,"shippingOptions"]},outputs:{onFormChanges:"onFormChanges"},decls:6,vars:2,consts:[[1,"mb-6"],["for","timepicker",1,"mb-2","text-muted"],["id","timepicker","placeholder","Select Time Pickup","appendTo","body",1,"shipping-timepicker",3,"ngModelChange","clearable","ngModel"],[3,"value"],[1,"me-2"],[1,"mx-1"]],template:function(t,i){t&1&&(l(0,"div",0)(1,"label",1),u(2,"Time"),m(),l(3,"ng-select",2),ae("ngModelChange",function(s){return se(i.selectedTimeIndex,s)||(i.selectedTimeIndex=s),s}),_("ngModelChange",function(){return i.onValueChanges()}),ee(4,Xt,12,13,"ng-option",3,J),m()()),t&2&&(c(3),a("clearable",!1),re("ngModel",i.selectedTimeIndex),c(),te(i.timeOptions()))},dependencies:[T,be,Te,Se,ke,V,ve,ye],encapsulation:2})}}return n})();function Jt(n,p){if(n&1){let e=k();l(0,"shopee-pickup",10),_("onFormChanges",function(i){d(e);let o=r();return h(o.onFormChanges(i))}),m()}if(n&2){let e=r();a("shippingOptions",e.dialogData.shippingOptions)}}function ei(n,p){if(n&1){let e=k();l(0,"tiktok-pickup",10),_("onFormChanges",function(i){d(e);let o=r();return h(o.onFormChanges(i))}),m()}if(n&2){let e=r();a("shippingOptions",e.dialogData.shippingOptions)}}var tt=(()=>{class n{constructor(){this.dialogRef=b(Me),this.dialogData=b(we),this.shippingOptions=I(this.dialogData.shippingOptions),this.channelType=I(this.dialogData.channelType),this.order=I(this.dialogData.order),this.channelTypeEnum=x,this.pickupData=I(null)}onFormChanges(e){this.pickupData.set(e)}onClose(){this.dialogRef.close()}onSave(){let e=this.generatePickupData();this.dialogRef.close(e)}generatePickupData(){let e=this.dialogData.multipleOrder??!1;switch(this.channelType()){case x.Shopee:return e?{pickup:this.pickupData()}:{OrderNumber:this.order().Number,ShopID:this.order().ShopID,pickup:this.pickupData()};case x.Tiktok:return e?{pickup_slot:this.pickupData(),handover_method:"PICKUP"}:{handover_method:"PICKUP",PackageID:this.shippingOptions().Form?.information?.PackageID,ShopID:this.order().ShopID,pickup_slot:this.pickupData()}}}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=C({type:n,selectors:[["app-pickup-dialog"]],decls:21,vars:2,consts:[["mat-dialog-title","",1,"mt-12","mb-6"],[1,"d-flex","justify-content-between","align-items-start","lh-lg"],[1,"lh-base","mt-6"],[1,"text-muted","fs-6"],["role","button",1,"fa-solid","fa-xmark","text-muted","cursor-pointer","fs-3",3,"click"],[2,"padding-bottom","10px"],[3,"shippingOptions"],[1,"d-flex","justify-content-end","align-items-center","w-100","pe-8","mb-4"],[1,"btn","btn-outline-secondary","me-4",2,"width","70px",3,"click"],[1,"btn","btn-success",2,"width","70px",3,"click"],[3,"onFormChanges","shippingOptions"]],template:function(t,i){if(t&1&&(l(0,"div",0)(1,"div",1)(2,"div")(3,"h3"),u(4,"Set Pickup"),m(),l(5,"div",2)(6,"div",3),u(7,"Shipping Method"),m(),l(8,"div",3),u(9),m()()(),l(10,"div")(11,"i",4),_("click",function(){return i.onClose()}),m()()()(),l(12,"mat-dialog-content",5),f(13,Jt,1,1,"shopee-pickup",6)(14,ei,1,1,"tiktok-pickup",6),m(),l(15,"mat-dialog-actions")(16,"div",7)(17,"button",8),_("click",function(){return i.onClose()}),u(18," Cancel "),m(),l(19,"button",9),_("click",function(){return i.onSave()}),u(20," Ok "),m()()()),t&2){let o,s;c(9),oe(" ",!((o=i.order())==null||o.LogisticService==null)&&o.LogisticService.Name?(o=i.order())==null||o.LogisticService==null?null:o.LogisticService.Name:"-"," "),c(4),X((s=i.channelType())===i.channelTypeEnum.Shopee?13:s===i.channelTypeEnum.Tiktok?14:-1)}},dependencies:[T,Oe,Pe,It,De,V,Nt,Bt],styles:['ng-select.shipping-timepicker .ng-arrow{border:none!important;width:0;height:0} ng-select.shipping-timepicker .ng-arrow-wrapper{width:28px;display:flex;align-items:center;justify-content:center} ng-select.shipping-timepicker .ng-arrow-wrapper:after{content:"\\f107";font-family:"Font Awesome 7 Pro";font-style:normal;font-weight:400!important;font-size:16px;line-height:1;display:inline-block;color:#6b7280;pointer-events:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:auto}.label-opacity[_ngcontent-%COMP%]{opacity:.7}']})}}return n})();var Zn=(()=>{class n{constructor(){this.shopeeShippingService=b($t),this.tiktokShippingService=b(Kt),this.dialog=b(xt)}setFulfillmentOrder(e){return this.getShippingOptions(e.Number,e.ShopID,e.MarketType).pipe(R(t=>this.dialog.open(et,{height:"400px",width:"530px",data:{options:t,channelType:e.MarketType}}).afterClosed().pipe(Y(i=>ue.IsNotEmpty(i)),W(i=>({type:i,order:e,options:t})),R(i=>i.type=="PICK_UP"?this.onPickupOrder(i.order,i.options):this.onDropOffOrder(i.order,i.options)))))}onPickupOrder(e,t){return this.dialog.open(tt,{width:"530px",data:{order:e,shippingOptions:t,channelType:e.MarketType,multipleOrder:!1},disableClose:!0}).afterClosed().pipe(Y(i=>ue.IsNotEmpty(i)),R(i=>this.pickupOrder(e,i)))}pickupOrder(e,t){switch(e.MarketType){case x.Shopee:return this.shopeeShippingService.pickupOrder(t);case x.Tiktok:return this.tiktokShippingService.pickupOrder(t)}}onDropOffOrder(e,t){switch(e.MarketType){case x.Shopee:return this.shopeeShippingService.dropOffOrder(e.Number,e.ShopID);case x.Tiktok:let i=t?.Form?.information?.PackageID;return this.tiktokShippingService.dropOffOrder(i,e.ShopID)}}setFulfillmentMultipleOrders(e){let t=e[0];return this.getShippingOptions(t.Number,t.ShopID,t.MarketType).pipe(R(i=>this.dialog.open(et,{height:"400px",width:"530px",data:{options:i,channelType:t.MarketType}}).afterClosed().pipe(Y(o=>ue.IsNotEmpty(o)),W(o=>({type:o,orders:e,options:i})))),R(i=>i.type=="PICK_UP"?this.openDialogPickupMultipleOrders(i.orders,i.options):this.dropOffMultipleOrder(i.orders,i.options)))}openDialogPickupMultipleOrders(e,t){let i=e[0];return this.dialog.open(tt,{width:"530px",data:{order:i,shippingOptions:t,channelType:i.MarketType,multipleOrder:!0},disableClose:!0}).afterClosed().pipe(Y(o=>ue.IsNotEmpty(o)),R(o=>this.pickupMultipleOrder(e,o)))}pickupMultipleOrder(e,t){let i=e[0],o=this.generateMultiplePickupData(e,t);switch(i.MarketType){case x.Shopee:return this.shopeeShippingService.pickupOrder(o);case x.Tiktok:return this.tiktokShippingService.pickupOrder(o)}}generateMultiplePickupData(e,t){switch(e[0].MarketType){case x.Shopee:let i=e.map(s=>({OrderNumber:s.Number,ShopID:s.ShopID}));return t.List=i,t;case x.Tiktok:let o=e.map(s=>({PackageID:s.Number,ShopID:s.ShopID}));return t.List=o,t}}dropOffMultipleOrder(e,t){switch(e[0].MarketType){case x.Shopee:let o=this.generateMultipleDropOffData(e);return this.shopeeShippingService.dropOffMultipleOrders(o);case x.Tiktok:let s=t?.Form?.information?.PackageID,g=this.generateMultipleDropOffData(e,s);return this.tiktokShippingService.dropOffMultipleOrders(g)}}generateMultipleDropOffData(e,t){switch(e[0].MarketType){case x.Shopee:return e.map(g=>({OrderNumber:g.Number,ShopID:g.ShopID}));case x.Tiktok:return{List:e.map(g=>({PackageID:t,ShopID:g.ShopID})),handover_method:"DROP_OFF"}}}getShippingOptions(e,t,i){switch(i){case x.Shopee:return this.getShopeeShippingOptions(e,t);case x.Tiktok:return this.getTiktokShippingOptions(e,t)}}getShopeeShippingOptions(e,t){return this.shopeeShippingService.getShippingOptions(e,t)}getTiktokShippingOptions(e,t){return this.tiktokShippingService.getShippingOptions(e,t)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=E({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var ti=["sublist"],ii=(n,p)=>({"p-contextmenu-submenu":n,"p-contextmenu-root-list":p}),ni=()=>({"p-contextmenu-item-link":!0}),Ht=()=>({class:"p-contextmenu-submenu-icon"}),oi=()=>({exact:!1}),ri=n=>({"p-contextmenu-item-link":!0,"p-disabled":n}),si=n=>({$implicit:n});function ai(n,p){if(n&1&&y(0,"li",8),n&2){let e=r().$implicit,t=r(2);ct(t.getItemProp(e,"style")),a("ngClass",t.getSeparatorItemClass(e)),v("id",t.getItemId(e))("data-pc-section","separator")}}function li(n,p){if(n&1&&y(0,"span",19),n&2){let e=r(4).$implicit,t=r(2);a("ngClass",t.getItemProp(e,"icon"))("ngStyle",t.getItemProp(e,"iconStyle")),v("data-pc-section","icon")("aria-hidden",!0)("tabindex",-1)}}function ci(n,p){if(n&1&&(l(0,"span",20),u(1),m()),n&2){let e=r(4).$implicit,t=r(2);v("data-pc-section","label"),c(),oe(" ",t.getItemLabel(e)," ")}}function mi(n,p){if(n&1&&y(0,"span",21),n&2){let e=r(4).$implicit,t=r(2);a("innerHTML",t.getItemLabel(e),Fe),v("data-pc-section","label")}}function pi(n,p){if(n&1&&y(0,"p-badge",22),n&2){let e=r(4).$implicit,t=r(2);a("styleClass",t.getItemProp(e,"badgeStyleClass"))("value",t.getItemProp(e,"badge"))}}function ui(n,p){n&1&&y(0,"AngleRightIcon"),n&2&&(N("p-contextmenu-submenu-icon"),v("data-pc-section","submenuicon")("aria-hidden",!0))}function di(n,p){}function hi(n,p){n&1&&f(0,di,0,0,"ng-template",25),n&2&&a("data-pc-section","submenuicon")("aria-hidden",!0)}function _i(n,p){if(n&1&&(ie(0),f(1,ui,1,4,"AngleRightIcon",23)(2,hi,1,2,null,24),ne()),n&2){let e=r(6);c(),a("ngIf",!e.contextMenu.submenuIconTemplate&&!e.contextMenu._submenuIconTemplate),c(),a("ngTemplateOutlet",e.contextMenu.submenuIconTemplate||e.contextMenu._submenuIconTemplate)("ngTemplateOutletContext",Z(3,Ht))}}function gi(n,p){if(n&1&&(l(0,"a",15),f(1,li,1,5,"span",16)(2,ci,2,2,"span",17)(3,mi,1,2,"ng-template",null,2,le)(5,pi,1,2,"p-badge",18)(6,_i,3,4,"ng-container",11),m()),n&2){let e=fe(4),t=r(3).$implicit,i=r(2);a("target",i.getItemProp(t,"target"))("ngClass",Z(12,ni)),v("href",i.getItemProp(t,"url"),at)("aria-hidden",!0)("data-automationid",i.getItemProp(t,"automationId"))("data-pc-section","action")("tabindex",-1),c(),a("ngIf",i.getItemProp(t,"icon")),c(),a("ngIf",i.getItemProp(t,"escape"))("ngIfElse",e),c(3),a("ngIf",i.getItemProp(t,"badge")),c(),a("ngIf",i.isItemGroup(t))}}function fi(n,p){if(n&1&&y(0,"span",19),n&2){let e=r(4).$implicit,t=r(2);a("ngClass",t.getItemProp(e,"icon"))("ngStyle",t.getItemProp(e,"iconStyle")),v("data-pc-section","icon")("aria-hidden",!0)("tabindex",-1)}}function xi(n,p){if(n&1&&(l(0,"span",20),u(1),m()),n&2){let e=r(4).$implicit,t=r(2);v("data-pc-section","label"),c(),oe(" ",t.getItemLabel(e)," ")}}function Ii(n,p){if(n&1&&y(0,"span",21),n&2){let e=r(4).$implicit,t=r(2);a("innerHTML",t.getItemLabel(e),Fe),v("data-pc-section","label")}}function bi(n,p){if(n&1&&y(0,"p-badge",22),n&2){let e=r(4).$implicit,t=r(2);a("styleClass",t.getItemProp(e,"badgeStyleClass"))("value",t.getItemProp(e,"badge"))}}function vi(n,p){n&1&&y(0,"AngleRightIcon"),n&2&&(N("p-contextmenu-submenu-icon"),v("data-pc-section","submenuicon")("aria-hidden",!0))}function yi(n,p){}function Ci(n,p){n&1&&f(0,yi,0,0,"ng-template",25),n&2&&a("data-pc-section","submenuicon")("aria-hidden",!0)}function ki(n,p){if(n&1&&(ie(0),f(1,vi,1,4,"AngleRightIcon",23)(2,Ci,1,2,null,24),ne()),n&2){let e=r(6);c(),a("ngIf",!e.contextMenu.submenuIconTemplate&&!e.contextMenu._submenuIconTemplate),c(),a("ngTemplateOutlet",!e.contextMenu.submenuIconTemplate||!e.contextMenu._submenuIconTemplate)("ngTemplateOutletContext",Z(3,Ht))}}function Si(n,p){if(n&1&&(l(0,"a",26),f(1,fi,1,5,"span",16)(2,xi,2,2,"span",17)(3,Ii,1,2,"ng-template",null,2,le)(5,bi,1,2,"p-badge",18)(6,ki,3,4,"ng-container",11),m()),n&2){let e=fe(4),t=r(3).$implicit,i=r(2);a("routerLink",i.getItemProp(t,"routerLink"))("queryParams",i.getItemProp(t,"queryParams"))("routerLinkActiveOptions",i.getItemProp(t,"routerLinkActiveOptions")||Z(20,oi))("target",i.getItemProp(t,"target"))("ngClass",xe(21,ri,i.getItemProp(t,"disabled")))("fragment",i.getItemProp(t,"fragment"))("queryParamsHandling",i.getItemProp(t,"queryParamsHandling"))("preserveFragment",i.getItemProp(t,"preserveFragment"))("skipLocationChange",i.getItemProp(t,"skipLocationChange"))("replaceUrl",i.getItemProp(t,"replaceUrl"))("state",i.getItemProp(t,"state")),v("data-automationid",i.getItemProp(t,"automationId"))("tabindex",-1)("aria-hidden",!0)("data-pc-section","action"),c(),a("ngIf",i.getItemProp(t,"icon")),c(),a("ngIf",i.getItemProp(t,"escape"))("ngIfElse",e),c(3),a("ngIf",i.getItemProp(t,"badge")),c(),a("ngIf",i.isItemGroup(t))}}function Ti(n,p){if(n&1&&(ie(0),f(1,gi,7,13,"a",13)(2,Si,7,23,"a",14),ne()),n&2){let e=r(2).$implicit,t=r(2);c(),a("ngIf",!t.getItemProp(e,"routerLink")),c(),a("ngIf",t.getItemProp(e,"routerLink"))}}function Mi(n,p){}function wi(n,p){n&1&&f(0,Mi,0,0,"ng-template")}function Pi(n,p){if(n&1&&(ie(0),f(1,wi,1,0,null,24),ne()),n&2){let e=r(2).$implicit,t=r(2);c(),a("ngTemplateOutlet",t.itemTemplate)("ngTemplateOutletContext",xe(2,si,e.item))}}function Di(n,p){if(n&1){let e=k();l(0,"p-contextmenu-sub",27),_("itemClick",function(i){d(e);let o=r(4);return h(o.itemClick.emit(i))})("itemMouseEnter",function(i){d(e);let o=r(4);return h(o.onItemMouseEnter(i))}),m()}if(n&2){let e=r(2).$implicit,t=r(2);a("items",e.items)("itemTemplate",t.itemTemplate)("menuId",t.menuId)("visible",t.isItemActive(e)&&t.isItemGroup(e))("activeItemPath",t.activeItemPath)("focusedItemId",t.focusedItemId)("level",t.level+1)}}function Oi(n,p){if(n&1){let e=k();l(0,"li",9,1)(2,"div",10),_("click",function(i){d(e);let o=r().$implicit,s=r(2);return h(s.onItemClick(i,o))})("mouseenter",function(i){d(e);let o=r().$implicit,s=r(2);return h(s.onItemMouseEnter({$event:i,processedItem:o}))}),f(3,Ti,3,2,"ng-container",11)(4,Pi,2,4,"ng-container",11),m(),f(5,Di,1,7,"p-contextmenu-sub",12),m()}if(n&2){let e=r(),t=e.$implicit,i=e.index,o=r(2);N(o.getItemProp(t,"styleClass")),a("ngStyle",o.getItemProp(t,"style"))("ngClass",o.getItemClass(t))("tooltipOptions",o.getItemProp(t,"tooltipOptions")),v("id",o.getItemId(t))("data-pc-section","menuitem")("data-p-highlight",o.isItemActive(t))("data-p-focused",o.isItemFocused(t))("data-p-disabled",o.isItemDisabled(t))("aria-label",o.getItemLabel(t))("aria-disabled",o.isItemDisabled(t)||void 0)("aria-haspopup",o.isItemGroup(t)&&!o.getItemProp(t,"to")?"menu":void 0)("aria-expanded",o.isItemGroup(t)?o.isItemActive(t):void 0)("aria-level",o.level+1)("aria-setsize",o.getAriaSetSize())("aria-posinset",o.getAriaPosInset(i)),c(2),v("data-pc-section","content"),c(),a("ngIf",!o.itemTemplate),c(),a("ngIf",o.itemTemplate),c(),a("ngIf",o.isItemVisible(t)&&o.isItemGroup(t))}}function Ei(n,p){if(n&1&&f(0,ai,1,5,"li",6)(1,Oi,6,21,"li",7),n&2){let e=p.$implicit,t=r(2);a("ngIf",t.isItemVisible(e)&&t.getItemProp(e,"separator")),c(),a("ngIf",t.isItemVisible(e)&&!t.getItemProp(e,"separator"))}}function Li(n,p){if(n&1){let e=k();l(0,"ul",4,0),_("@overlayAnimation.start",function(i){d(e);let o=fe(1),s=r();return h(s.onEnter(i,o))})("keydown",function(i){d(e);let o=r();return h(o.menuKeydown.emit(i))})("focus",function(i){d(e);let o=r();return h(o.menuFocus.emit(i))})("blur",function(i){d(e);let o=r();return h(o.menuBlur.emit(i))}),f(2,Ei,2,2,"ng-template",5),m()}if(n&2){let e=r();a("ngClass",pt(10,ii,!e.root,e.root))("@overlayAnimation",e.visible)("tabindex",e.tabindex),v("id",e.menuId+"_list")("aria-label",e.ariaLabel)("aria-labelledBy",e.ariaLabelledBy)("aria-activedescendant",e.focusedItemId)("aria-orientation","vertical")("data-pc-section","menu"),c(2),a("ngForOf",e.items)}}var Vi=["item"],Fi=["submenuicon"],Ai=["rootmenu"],$i=["container"],Ki=n=>({"p-contextmenu p-component":!0,"p-contextmenu-mobile":n}),Ri=()=>({value:"visible"});function Ni(n,p){if(n&1){let e=k();l(0,"div",3,0),_("@overlayAnimation.start",function(i){d(e);let o=r();return h(o.onOverlayAnimationStart(i))})("@overlayAnimation.done",function(i){d(e);let o=r();return h(o.onOverlayAnimationEnd(i))}),l(2,"p-contextmenu-sub",4,1),_("itemClick",function(i){d(e);let o=r();return h(o.onItemClick(i))})("menuFocus",function(i){d(e);let o=r();return h(o.onMenuFocus(i))})("menuBlur",function(i){d(e);let o=r();return h(o.onMenuBlur(i))})("menuKeydown",function(i){d(e);let o=r();return h(o.onKeyDown(i))})("itemMouseEnter",function(i){d(e);let o=r();return h(o.onItemMouseEnter(i))}),m()()}if(n&2){let e=r();N(e.styleClass),a("ngClass",xe(20,Ki,e.queryMatches))("ngStyle",e.style)("@overlayAnimation",Z(22,Ri)),v("data-pc-section","root")("data-pc-name","contextmenu")("id",e.id),c(2),a("root",!0)("items",e.processedItems)("itemTemplate",e.itemTemplate||e._itemTemplate)("menuId",e.id)("tabindex",e.disabled?-1:e.tabindex)("ariaLabel",e.ariaLabel)("ariaLabelledBy",e.ariaLabelledBy)("baseZIndex",e.baseZIndex)("autoZIndex",e.autoZIndex)("visible",e.submenuVisible())("focusedItemId",e.focused?e.focusedItemId:void 0)("activeItemPath",e.activeItemPath())}}var Bi=({dt:n})=>`
1
+ import{a as Vt}from"./chunk-XPCRS7AL.js";import{a as At,b as he}from"./chunk-MX5SR3SR.js";import{a as Ft}from"./chunk-Q4N2QUV6.js";import{a as Lt,b as Je}from"./chunk-YQLOB7IQ.js";import{e as Xe}from"./chunk-OZ7LWNOK.js";import{a as Ye}from"./chunk-YFDFIBAG.js";import{A as kt,F as St,I as Tt,M as Mt,P as Qe,R as F,V as Ue,W as We,_ as wt,aa as Pt,f as Ze,fa as Dt,k as bt,ka as Ot,m as vt,n as yt,na as Et,oa as de,q as Ee,r as Le,w as Ct,x as qe}from"./chunk-RC5PUUVM.js";import{a as ue}from"./chunk-ACIMXBIC.js";import{c as ke,d as Se,e as Te}from"./chunk-PYXL7UF7.js";import{a as S}from"./chunk-CGOB6Y3X.js";import{e as Ce}from"./chunk-WN5DZGA4.js";import{c as je,d as Ge,f as me,i as pe}from"./chunk-4NEKWRL7.js";import{b as x,c as He}from"./chunk-EUYQST7Q.js";import{b as Me,c as we,d as xt,e as Pe,f as De,g as It,h as Oe}from"./chunk-HJXYT6MI.js";import{A as V,h as ve,m as ye}from"./chunk-5PS6ZS3N.js";import{r as gt,s as ft}from"./chunk-MFQQEEHJ.js";import{H as _t,J as ze,d as Re,f as dt,g as Ne,h as Be,i as ht,k as be,n as T,o as ce}from"./chunk-FXQKRJWU.js";import{$b as ct,$c as q,Ac as G,Bc as w,Ca as st,Cc as P,Fc as fe,G as Y,Gb as C,Gc as u,Hb as lt,Hc as M,Ic as oe,Ka as L,Kb as $e,Kc as re,Lc as se,Mb as f,Mc as ae,Na as H,Oa as j,Qc as mt,Ra as I,Rc as Z,Sc as xe,Tc as pt,Xb as v,Yb as a,_b as Ke,aa as R,ac as N,bd as Q,cd as le,dc as X,ec as J,gc as ee,hc as te,ia as ot,ic as l,ja as E,jc as m,ka as rt,kc as y,lc as ie,mc as ne,ob as Fe,oc as k,od as B,pa as b,pb as at,pd as U,rb as c,rd as Ie,sd as ut,tc as _,uc as r,v as W,xb as Ae,ya as d,za as h,zc as ge}from"./chunk-OJMQBH6T.js";import{a as D,b as O}from"./chunk-66YHNWRR.js";var $t=(()=>{class n{constructor(){this.httpService=b(Ce)}getShippingOptions(e,t){return this.httpService.post(S.GetShopeeShippingOptions,{OrderNumber:e,ShopID:t})}pickupOrder(e){return this.httpService.post(S.ShopeeSelectShipping,e)}pickupMultipleOrders(e){return this.httpService.post(S.ShopeeSelectMultipleShipping,e)}dropOffOrder(e,t){let i={OrderNumber:e,ShopID:t,dropoff:{}};return this.httpService.post(S.ShopeeSelectShipping,i)}dropOffMultipleOrders(e){return this.httpService.post(S.ShopeeSelectMultipleShipping,e)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=E({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var Kt=(()=>{class n{constructor(){this.httpService=b(Ce)}getShippingOptions(e,t){return this.httpService.post(S.GetTiktokShippingOptions,{OrderNumber:e,ShopID:t}).pipe(W(i=>this.formatDatePickUpOptions(i)))}pickupOrder(e){return this.httpService.post(S.TiktokSelectShipping,e)}pickupMultipleOrders(e){return this.httpService.post(S.TiktokSelectMultipleShipping,e)}dropOffOrder(e,t){let i={handover_method:"DROP_OFF",PackageID:e,ShopID:t};return this.httpService.post(S.TiktokSelectShipping,i)}dropOffMultipleOrders(e){return this.httpService.post(S.TiktokSelectMultipleShipping,e)}formatDatePickUpOptions(e){return e?.Options?.pickup_slots&&(e.Options.pickup_slots=e?.Options?.pickup_slots.map(t=>{let i=He.convertTimestampToDate(t.start_time),o=He.convertTimestampToDate(t.end_time);return t.start_date=i,t.end_date=o,t})),e}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=E({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();function Zt(n,p){if(n&1){let e=k();l(0,"div",10),_("click",function(){d(e);let i=r();return h(i.onSelectDelivery("DROP_OFF"))}),l(1,"div",11),y(2,"i",12),l(3,"h3",13),u(4,"Drop off"),m()(),l(5,"p",14),u(6," You can drop off your package at the nearest shipping counter in your city. "),m()()}if(n&2){let e=r();Ke("text-muted",e.selectedDelivery()&&e.selectedDelivery()==="PICK_UP")("selected",e.selectedDelivery()==="DROP_OFF")}}function qt(n,p){if(n&1){let e=k();l(0,"div",10),_("click",function(){d(e);let i=r();return h(i.onSelectDelivery("PICK_UP"))}),l(1,"div",11),y(2,"i",15),l(3,"h3",16),u(4,"Pick up"),m()(),l(5,"p",17),u(6," The courier will collect the package from your address. "),m()()}if(n&2){let e=r();Ke("text-muted",e.selectedDelivery()&&e.selectedDelivery()==="DROP_OFF")("selected",e.selectedDelivery()==="PICK_UP")}}var et=(()=>{class n{constructor(){this.data=b(we),this.dialogRef=b(Me),this.selectedDelivery=I("DROP_OFF"),this.showPickup=I(!0),this.showDropOff=I(!0),this.initOptionsCondition()}onSelectDelivery(e){this.selectedDelivery.set(e)}initOptionsCondition(){switch(this.data.channelType){case x.Shopee:break;case x.Tiktok:this.showPickup.set(this.data.options?.Form?.information?.can_pickup),this.showDropOff.set(this.data.options?.Form?.information?.can_drop_off);break}}onConfirm(){this.dialogRef.close(this.selectedDelivery())}onClose(){this.dialogRef.close()}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=C({type:n,selectors:[["app-delivery-dialog"]],decls:16,vars:2,consts:[["mat-dialog-title","",1,"mt-12","mb-8"],[1,"d-flex","justify-content-between","align-items-start","lh-lg"],[1,"ms-2"],[1,"text-secondary-emphasis"],[1,"fa-solid","fa-xmark","text-muted","cursor-pointer","fs-3",3,"click"],[1,"pb-0"],[1,"d-flex","align-items-center","justify-content-center","gap-12"],["role","button",1,"delivery-option","d-flex","flex-column","align-items-center","justify-content-center","p-4","cursor-pointer",3,"text-muted","selected"],[1,"d-flex","justify-content-end",2,"margin-top","1.5rem"],[1,"btn","btn-light-blue","me-3","text-primary","btn-lg","fw-bold","mx-3","py-6",2,"width","70px",3,"click"],["role","button",1,"delivery-option","d-flex","flex-column","align-items-center","justify-content-center","p-4","cursor-pointer",3,"click"],[1,"text-center"],[1,"fa-solid","fa-cart-shopping-fast","fa-4x"],[1,"mt-4","titlew"],[1,"text-center","mt-4","lh-sm","subtitlew"],[1,"fa-solid","fa-hand-holding-box","fa-4x"],[1,"mt-4"],[1,"text-center","mt-4","lh-sm"]],template:function(t,i){t&1&&(l(0,"div",0)(1,"div",1)(2,"div",2)(3,"h2"),u(4,"Delivery Order"),m(),l(5,"div",3),u(6,"Your selected order(s) will be set to"),m()(),l(7,"div")(8,"i",4),_("click",function(){return i.onClose()}),m()()()(),l(9,"mat-dialog-content",5)(10,"div",6),f(11,Zt,7,4,"div",7)(12,qt,7,4,"div",7),m(),l(13,"div",8)(14,"button",9),_("click",function(){return i.onConfirm()}),u(15," OK "),m()()()),t&2&&(c(11),X(i.showPickup()?11:-1),c(),X(i.showDropOff()?12:-1))},dependencies:[T,Oe,Pe,De],styles:[".delivery-option[_ngcontent-%COMP%]{width:14rem;height:12rem;border:1px solid #656565}.delivery-option[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:0}.delivery-option.text-muted[_ngcontent-%COMP%]{border-color:#000;color:#000}.delivery-option.selected[_ngcontent-%COMP%]{color:#5e9708;border-color:#5e9708}.delivery-option.selected[_ngcontent-%COMP%] .titlew[_ngcontent-%COMP%]{color:#5e9708;font-weight:700}.delivery-option.selected[_ngcontent-%COMP%] .subtitlew[_ngcontent-%COMP%]{color:#5e9708}"]})}}return n})();function Wt(n,p){if(n&1&&(l(0,"ng-option",3),u(1),m()),n&2){let e=p.$implicit;a("value",e==null?null:e.address_id)("matTooltip",e==null?null:e.address),c(),M(e==null?null:e.address)}}function Yt(n,p){if(n&1&&(l(0,"ng-option",6)(1,"span",7),u(2),q(3,"date"),m(),l(4,"span"),u(5),m()()),n&2){let e=p.$implicit;a("value",e==null?null:e.pickup_time_id),c(2),M(Q(3,3,e==null?null:e.date,"d MMMM")),c(3),M(e==null?null:e.time_text)}}var Nt=(()=>{class n{constructor(){this.shippingOptions=j(),this.onFormChanges=H(),this.addressList=Ie(()=>this.shippingOptions()?.response?.pickup?.address_list||[]),this.selectedShipping=I(null),this.timeOptions=I(this.convertTimestampToDate(this.addressList()[0]?.time_slot_list||[])),this.pickupTime=I(null)}onAddressChange(e){let t=this.addressList().find(i=>i.address_id===e);this.timeOptions.set(this.convertTimestampToDate(t?.time_slot_list||[])),this.pickupTime.set(null)}onValueChanges(){this.onFormChanges.emit({address_id:this.selectedShipping(),pickup_time_id:this.pickupTime()})}convertTimestampToDate(e){return e.map(t=>{let i=new Date(t.date*1e3);return O(D({},t),{date:i})})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=C({type:n,selectors:[["shopee-pickup"]],inputs:{shippingOptions:[1,"shippingOptions"]},outputs:{onFormChanges:"onFormChanges"},decls:12,vars:4,consts:[[1,"mb-6"],["for","address",1,"mb-2","text-muted"],["id","address","placeholder","Select Address to Pickup","appendTo","body",1,"shipping-timepicker",3,"ngModelChange","clearable","ngModel"],[3,"value","matTooltip"],["for","timepicker",1,"mb-2","text-muted"],["id","timepicker","placeholder","Select Date Pickup","appendTo","body",1,"shipping-timepicker",3,"ngModelChange","clearable","ngModel"],[3,"value"],[1,"me-2"]],template:function(t,i){t&1&&(l(0,"div",0)(1,"label",1),u(2,"Address"),m(),l(3,"ng-select",2),ae("ngModelChange",function(s){return se(i.selectedShipping,s)||(i.selectedShipping=s),s}),_("ngModelChange",function(s){return i.onAddressChange(s),i.onValueChanges()}),ee(4,Wt,2,3,"ng-option",3,J),m()(),l(6,"div",0)(7,"label",4),u(8,"Date"),m(),l(9,"ng-select",5),ae("ngModelChange",function(s){return se(i.pickupTime,s)||(i.pickupTime=s),s}),_("ngModelChange",function(){return i.onValueChanges()}),ee(10,Yt,6,6,"ng-option",6,J),m()()),t&2&&(c(3),a("clearable",!1),re("ngModel",i.selectedShipping),c(),te(i.addressList()),c(5),a("clearable",!1),re("ngModel",i.pickupTime),c(),te(i.timeOptions()))},dependencies:[T,be,Te,Se,ke,V,ve,ye,ft,gt],encapsulation:2})}}return n})();function Xt(n,p){if(n&1&&(l(0,"ng-option",3)(1,"span",4),u(2),q(3,"date"),m(),l(4,"span"),u(5),q(6,"date"),m(),l(7,"span",5),u(8,"-"),m(),l(9,"span"),u(10),q(11,"date"),m()()),n&2){let e=p.$implicit,t=p.$index;a("value",t),c(2),M(Q(3,4,e==null?null:e.start_date,"d MMMM")),c(3),M(Q(6,7,e==null?null:e.start_date,"HH:mm")),c(5),M(Q(11,10,e==null?null:e.end_date,"HH:mm"))}}var Bt=(()=>{class n{constructor(){this.shippingOptions=j(),this.onFormChanges=H(),this.timeOptions=Ie(()=>this.shippingOptions()?.Options?.pickup_slots),this.selectedTimeIndex=I(null)}onValueChanges(){let e=this.timeOptions()[this.selectedTimeIndex()];this.onFormChanges.emit({start_time:e?.start_time,end_time:e?.end_time})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=C({type:n,selectors:[["tiktok-pickup"]],inputs:{shippingOptions:[1,"shippingOptions"]},outputs:{onFormChanges:"onFormChanges"},decls:6,vars:2,consts:[[1,"mb-6"],["for","timepicker",1,"mb-2","text-muted"],["id","timepicker","placeholder","Select Time Pickup","appendTo","body",1,"shipping-timepicker",3,"ngModelChange","clearable","ngModel"],[3,"value"],[1,"me-2"],[1,"mx-1"]],template:function(t,i){t&1&&(l(0,"div",0)(1,"label",1),u(2,"Time"),m(),l(3,"ng-select",2),ae("ngModelChange",function(s){return se(i.selectedTimeIndex,s)||(i.selectedTimeIndex=s),s}),_("ngModelChange",function(){return i.onValueChanges()}),ee(4,Xt,12,13,"ng-option",3,J),m()()),t&2&&(c(3),a("clearable",!1),re("ngModel",i.selectedTimeIndex),c(),te(i.timeOptions()))},dependencies:[T,be,Te,Se,ke,V,ve,ye],encapsulation:2})}}return n})();function Jt(n,p){if(n&1){let e=k();l(0,"shopee-pickup",10),_("onFormChanges",function(i){d(e);let o=r();return h(o.onFormChanges(i))}),m()}if(n&2){let e=r();a("shippingOptions",e.dialogData.shippingOptions)}}function ei(n,p){if(n&1){let e=k();l(0,"tiktok-pickup",10),_("onFormChanges",function(i){d(e);let o=r();return h(o.onFormChanges(i))}),m()}if(n&2){let e=r();a("shippingOptions",e.dialogData.shippingOptions)}}var tt=(()=>{class n{constructor(){this.dialogRef=b(Me),this.dialogData=b(we),this.shippingOptions=I(this.dialogData.shippingOptions),this.channelType=I(this.dialogData.channelType),this.order=I(this.dialogData.order),this.channelTypeEnum=x,this.pickupData=I(null)}onFormChanges(e){this.pickupData.set(e)}onClose(){this.dialogRef.close()}onSave(){let e=this.generatePickupData();this.dialogRef.close(e)}generatePickupData(){let e=this.dialogData.multipleOrder??!1;switch(this.channelType()){case x.Shopee:return e?{pickup:this.pickupData()}:{OrderNumber:this.order().Number,ShopID:this.order().ShopID,pickup:this.pickupData()};case x.Tiktok:return e?{pickup_slot:this.pickupData(),handover_method:"PICKUP"}:{handover_method:"PICKUP",PackageID:this.shippingOptions().Form?.information?.PackageID,ShopID:this.order().ShopID,pickup_slot:this.pickupData()}}}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=C({type:n,selectors:[["app-pickup-dialog"]],decls:21,vars:2,consts:[["mat-dialog-title","",1,"mt-12","mb-6"],[1,"d-flex","justify-content-between","align-items-start","lh-lg"],[1,"lh-base","mt-6"],[1,"text-muted","fs-6"],["role","button",1,"fa-solid","fa-xmark","text-muted","cursor-pointer","fs-3",3,"click"],[2,"padding-bottom","10px"],[3,"shippingOptions"],[1,"d-flex","justify-content-end","align-items-center","w-100","pe-8","mb-4"],[1,"btn","btn-outline-secondary","me-4",2,"width","70px",3,"click"],[1,"btn","btn-success",2,"width","70px",3,"click"],[3,"onFormChanges","shippingOptions"]],template:function(t,i){if(t&1&&(l(0,"div",0)(1,"div",1)(2,"div")(3,"h3"),u(4,"Set Pickup"),m(),l(5,"div",2)(6,"div",3),u(7,"Shipping Method"),m(),l(8,"div",3),u(9),m()()(),l(10,"div")(11,"i",4),_("click",function(){return i.onClose()}),m()()()(),l(12,"mat-dialog-content",5),f(13,Jt,1,1,"shopee-pickup",6)(14,ei,1,1,"tiktok-pickup",6),m(),l(15,"mat-dialog-actions")(16,"div",7)(17,"button",8),_("click",function(){return i.onClose()}),u(18," Cancel "),m(),l(19,"button",9),_("click",function(){return i.onSave()}),u(20," Ok "),m()()()),t&2){let o,s;c(9),oe(" ",!((o=i.order())==null||o.LogisticService==null)&&o.LogisticService.Name?(o=i.order())==null||o.LogisticService==null?null:o.LogisticService.Name:"-"," "),c(4),X((s=i.channelType())===i.channelTypeEnum.Shopee?13:s===i.channelTypeEnum.Tiktok?14:-1)}},dependencies:[T,Oe,Pe,It,De,V,Nt,Bt],styles:['ng-select.shipping-timepicker .ng-arrow{border:none!important;width:0;height:0} ng-select.shipping-timepicker .ng-arrow-wrapper{width:28px;display:flex;align-items:center;justify-content:center} ng-select.shipping-timepicker .ng-arrow-wrapper:after{content:"\\f107";font-family:"Font Awesome 7 Pro";font-style:normal;font-weight:400!important;font-size:16px;line-height:1;display:inline-block;color:#6b7280;pointer-events:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:auto}.label-opacity[_ngcontent-%COMP%]{opacity:.7}']})}}return n})();var Zn=(()=>{class n{constructor(){this.shopeeShippingService=b($t),this.tiktokShippingService=b(Kt),this.dialog=b(xt)}setFulfillmentOrder(e){return this.getShippingOptions(e.Number,e.ShopID,e.MarketType).pipe(R(t=>this.dialog.open(et,{height:"400px",width:"530px",data:{options:t,channelType:e.MarketType}}).afterClosed().pipe(Y(i=>ue.IsNotEmpty(i)),W(i=>({type:i,order:e,options:t})),R(i=>i.type=="PICK_UP"?this.onPickupOrder(i.order,i.options):this.onDropOffOrder(i.order,i.options)))))}onPickupOrder(e,t){return this.dialog.open(tt,{width:"530px",data:{order:e,shippingOptions:t,channelType:e.MarketType,multipleOrder:!1},disableClose:!0}).afterClosed().pipe(Y(i=>ue.IsNotEmpty(i)),R(i=>this.pickupOrder(e,i)))}pickupOrder(e,t){switch(e.MarketType){case x.Shopee:return this.shopeeShippingService.pickupOrder(t);case x.Tiktok:return this.tiktokShippingService.pickupOrder(t)}}onDropOffOrder(e,t){switch(e.MarketType){case x.Shopee:return this.shopeeShippingService.dropOffOrder(e.Number,e.ShopID);case x.Tiktok:let i=t?.Form?.information?.PackageID;return this.tiktokShippingService.dropOffOrder(i,e.ShopID)}}setFulfillmentMultipleOrders(e){let t=e[0];return this.getShippingOptions(t.Number,t.ShopID,t.MarketType).pipe(R(i=>this.dialog.open(et,{height:"400px",width:"530px",data:{options:i,channelType:t.MarketType}}).afterClosed().pipe(Y(o=>ue.IsNotEmpty(o)),W(o=>({type:o,orders:e,options:i})))),R(i=>i.type=="PICK_UP"?this.openDialogPickupMultipleOrders(i.orders,i.options):this.dropOffMultipleOrder(i.orders,i.options)))}openDialogPickupMultipleOrders(e,t){let i=e[0];return this.dialog.open(tt,{width:"530px",data:{order:i,shippingOptions:t,channelType:i.MarketType,multipleOrder:!0},disableClose:!0}).afterClosed().pipe(Y(o=>ue.IsNotEmpty(o)),R(o=>this.pickupMultipleOrder(e,o)))}pickupMultipleOrder(e,t){let i=e[0],o=this.generateMultiplePickupData(e,t);switch(i.MarketType){case x.Shopee:return this.shopeeShippingService.pickupOrder(o);case x.Tiktok:return this.tiktokShippingService.pickupOrder(o)}}generateMultiplePickupData(e,t){switch(e[0].MarketType){case x.Shopee:let i=e.map(s=>({OrderNumber:s.Number,ShopID:s.ShopID}));return t.List=i,t;case x.Tiktok:let o=e.map(s=>({PackageID:s.Number,ShopID:s.ShopID}));return t.List=o,t}}dropOffMultipleOrder(e,t){switch(e[0].MarketType){case x.Shopee:let o=this.generateMultipleDropOffData(e);return this.shopeeShippingService.dropOffMultipleOrders(o);case x.Tiktok:let s=t?.Form?.information?.PackageID,g=this.generateMultipleDropOffData(e,s);return this.tiktokShippingService.dropOffMultipleOrders(g)}}generateMultipleDropOffData(e,t){switch(e[0].MarketType){case x.Shopee:return e.map(g=>({OrderNumber:g.Number,ShopID:g.ShopID}));case x.Tiktok:return{List:e.map(g=>({PackageID:t,ShopID:g.ShopID})),handover_method:"DROP_OFF"}}}getShippingOptions(e,t,i){switch(i){case x.Shopee:return this.getShopeeShippingOptions(e,t);case x.Tiktok:return this.getTiktokShippingOptions(e,t)}}getShopeeShippingOptions(e,t){return this.shopeeShippingService.getShippingOptions(e,t)}getTiktokShippingOptions(e,t){return this.tiktokShippingService.getShippingOptions(e,t)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=E({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var ti=["sublist"],ii=(n,p)=>({"p-contextmenu-submenu":n,"p-contextmenu-root-list":p}),ni=()=>({"p-contextmenu-item-link":!0}),Ht=()=>({class:"p-contextmenu-submenu-icon"}),oi=()=>({exact:!1}),ri=n=>({"p-contextmenu-item-link":!0,"p-disabled":n}),si=n=>({$implicit:n});function ai(n,p){if(n&1&&y(0,"li",8),n&2){let e=r().$implicit,t=r(2);ct(t.getItemProp(e,"style")),a("ngClass",t.getSeparatorItemClass(e)),v("id",t.getItemId(e))("data-pc-section","separator")}}function li(n,p){if(n&1&&y(0,"span",19),n&2){let e=r(4).$implicit,t=r(2);a("ngClass",t.getItemProp(e,"icon"))("ngStyle",t.getItemProp(e,"iconStyle")),v("data-pc-section","icon")("aria-hidden",!0)("tabindex",-1)}}function ci(n,p){if(n&1&&(l(0,"span",20),u(1),m()),n&2){let e=r(4).$implicit,t=r(2);v("data-pc-section","label"),c(),oe(" ",t.getItemLabel(e)," ")}}function mi(n,p){if(n&1&&y(0,"span",21),n&2){let e=r(4).$implicit,t=r(2);a("innerHTML",t.getItemLabel(e),Fe),v("data-pc-section","label")}}function pi(n,p){if(n&1&&y(0,"p-badge",22),n&2){let e=r(4).$implicit,t=r(2);a("styleClass",t.getItemProp(e,"badgeStyleClass"))("value",t.getItemProp(e,"badge"))}}function ui(n,p){n&1&&y(0,"AngleRightIcon"),n&2&&(N("p-contextmenu-submenu-icon"),v("data-pc-section","submenuicon")("aria-hidden",!0))}function di(n,p){}function hi(n,p){n&1&&f(0,di,0,0,"ng-template",25),n&2&&a("data-pc-section","submenuicon")("aria-hidden",!0)}function _i(n,p){if(n&1&&(ie(0),f(1,ui,1,4,"AngleRightIcon",23)(2,hi,1,2,null,24),ne()),n&2){let e=r(6);c(),a("ngIf",!e.contextMenu.submenuIconTemplate&&!e.contextMenu._submenuIconTemplate),c(),a("ngTemplateOutlet",e.contextMenu.submenuIconTemplate||e.contextMenu._submenuIconTemplate)("ngTemplateOutletContext",Z(3,Ht))}}function gi(n,p){if(n&1&&(l(0,"a",15),f(1,li,1,5,"span",16)(2,ci,2,2,"span",17)(3,mi,1,2,"ng-template",null,2,le)(5,pi,1,2,"p-badge",18)(6,_i,3,4,"ng-container",11),m()),n&2){let e=fe(4),t=r(3).$implicit,i=r(2);a("target",i.getItemProp(t,"target"))("ngClass",Z(12,ni)),v("href",i.getItemProp(t,"url"),at)("aria-hidden",!0)("data-automationid",i.getItemProp(t,"automationId"))("data-pc-section","action")("tabindex",-1),c(),a("ngIf",i.getItemProp(t,"icon")),c(),a("ngIf",i.getItemProp(t,"escape"))("ngIfElse",e),c(3),a("ngIf",i.getItemProp(t,"badge")),c(),a("ngIf",i.isItemGroup(t))}}function fi(n,p){if(n&1&&y(0,"span",19),n&2){let e=r(4).$implicit,t=r(2);a("ngClass",t.getItemProp(e,"icon"))("ngStyle",t.getItemProp(e,"iconStyle")),v("data-pc-section","icon")("aria-hidden",!0)("tabindex",-1)}}function xi(n,p){if(n&1&&(l(0,"span",20),u(1),m()),n&2){let e=r(4).$implicit,t=r(2);v("data-pc-section","label"),c(),oe(" ",t.getItemLabel(e)," ")}}function Ii(n,p){if(n&1&&y(0,"span",21),n&2){let e=r(4).$implicit,t=r(2);a("innerHTML",t.getItemLabel(e),Fe),v("data-pc-section","label")}}function bi(n,p){if(n&1&&y(0,"p-badge",22),n&2){let e=r(4).$implicit,t=r(2);a("styleClass",t.getItemProp(e,"badgeStyleClass"))("value",t.getItemProp(e,"badge"))}}function vi(n,p){n&1&&y(0,"AngleRightIcon"),n&2&&(N("p-contextmenu-submenu-icon"),v("data-pc-section","submenuicon")("aria-hidden",!0))}function yi(n,p){}function Ci(n,p){n&1&&f(0,yi,0,0,"ng-template",25),n&2&&a("data-pc-section","submenuicon")("aria-hidden",!0)}function ki(n,p){if(n&1&&(ie(0),f(1,vi,1,4,"AngleRightIcon",23)(2,Ci,1,2,null,24),ne()),n&2){let e=r(6);c(),a("ngIf",!e.contextMenu.submenuIconTemplate&&!e.contextMenu._submenuIconTemplate),c(),a("ngTemplateOutlet",!e.contextMenu.submenuIconTemplate||!e.contextMenu._submenuIconTemplate)("ngTemplateOutletContext",Z(3,Ht))}}function Si(n,p){if(n&1&&(l(0,"a",26),f(1,fi,1,5,"span",16)(2,xi,2,2,"span",17)(3,Ii,1,2,"ng-template",null,2,le)(5,bi,1,2,"p-badge",18)(6,ki,3,4,"ng-container",11),m()),n&2){let e=fe(4),t=r(3).$implicit,i=r(2);a("routerLink",i.getItemProp(t,"routerLink"))("queryParams",i.getItemProp(t,"queryParams"))("routerLinkActiveOptions",i.getItemProp(t,"routerLinkActiveOptions")||Z(20,oi))("target",i.getItemProp(t,"target"))("ngClass",xe(21,ri,i.getItemProp(t,"disabled")))("fragment",i.getItemProp(t,"fragment"))("queryParamsHandling",i.getItemProp(t,"queryParamsHandling"))("preserveFragment",i.getItemProp(t,"preserveFragment"))("skipLocationChange",i.getItemProp(t,"skipLocationChange"))("replaceUrl",i.getItemProp(t,"replaceUrl"))("state",i.getItemProp(t,"state")),v("data-automationid",i.getItemProp(t,"automationId"))("tabindex",-1)("aria-hidden",!0)("data-pc-section","action"),c(),a("ngIf",i.getItemProp(t,"icon")),c(),a("ngIf",i.getItemProp(t,"escape"))("ngIfElse",e),c(3),a("ngIf",i.getItemProp(t,"badge")),c(),a("ngIf",i.isItemGroup(t))}}function Ti(n,p){if(n&1&&(ie(0),f(1,gi,7,13,"a",13)(2,Si,7,23,"a",14),ne()),n&2){let e=r(2).$implicit,t=r(2);c(),a("ngIf",!t.getItemProp(e,"routerLink")),c(),a("ngIf",t.getItemProp(e,"routerLink"))}}function Mi(n,p){}function wi(n,p){n&1&&f(0,Mi,0,0,"ng-template")}function Pi(n,p){if(n&1&&(ie(0),f(1,wi,1,0,null,24),ne()),n&2){let e=r(2).$implicit,t=r(2);c(),a("ngTemplateOutlet",t.itemTemplate)("ngTemplateOutletContext",xe(2,si,e.item))}}function Di(n,p){if(n&1){let e=k();l(0,"p-contextmenu-sub",27),_("itemClick",function(i){d(e);let o=r(4);return h(o.itemClick.emit(i))})("itemMouseEnter",function(i){d(e);let o=r(4);return h(o.onItemMouseEnter(i))}),m()}if(n&2){let e=r(2).$implicit,t=r(2);a("items",e.items)("itemTemplate",t.itemTemplate)("menuId",t.menuId)("visible",t.isItemActive(e)&&t.isItemGroup(e))("activeItemPath",t.activeItemPath)("focusedItemId",t.focusedItemId)("level",t.level+1)}}function Oi(n,p){if(n&1){let e=k();l(0,"li",9,1)(2,"div",10),_("click",function(i){d(e);let o=r().$implicit,s=r(2);return h(s.onItemClick(i,o))})("mouseenter",function(i){d(e);let o=r().$implicit,s=r(2);return h(s.onItemMouseEnter({$event:i,processedItem:o}))}),f(3,Ti,3,2,"ng-container",11)(4,Pi,2,4,"ng-container",11),m(),f(5,Di,1,7,"p-contextmenu-sub",12),m()}if(n&2){let e=r(),t=e.$implicit,i=e.index,o=r(2);N(o.getItemProp(t,"styleClass")),a("ngStyle",o.getItemProp(t,"style"))("ngClass",o.getItemClass(t))("tooltipOptions",o.getItemProp(t,"tooltipOptions")),v("id",o.getItemId(t))("data-pc-section","menuitem")("data-p-highlight",o.isItemActive(t))("data-p-focused",o.isItemFocused(t))("data-p-disabled",o.isItemDisabled(t))("aria-label",o.getItemLabel(t))("aria-disabled",o.isItemDisabled(t)||void 0)("aria-haspopup",o.isItemGroup(t)&&!o.getItemProp(t,"to")?"menu":void 0)("aria-expanded",o.isItemGroup(t)?o.isItemActive(t):void 0)("aria-level",o.level+1)("aria-setsize",o.getAriaSetSize())("aria-posinset",o.getAriaPosInset(i)),c(2),v("data-pc-section","content"),c(),a("ngIf",!o.itemTemplate),c(),a("ngIf",o.itemTemplate),c(),a("ngIf",o.isItemVisible(t)&&o.isItemGroup(t))}}function Ei(n,p){if(n&1&&f(0,ai,1,5,"li",6)(1,Oi,6,21,"li",7),n&2){let e=p.$implicit,t=r(2);a("ngIf",t.isItemVisible(e)&&t.getItemProp(e,"separator")),c(),a("ngIf",t.isItemVisible(e)&&!t.getItemProp(e,"separator"))}}function Li(n,p){if(n&1){let e=k();l(0,"ul",4,0),_("@overlayAnimation.start",function(i){d(e);let o=fe(1),s=r();return h(s.onEnter(i,o))})("keydown",function(i){d(e);let o=r();return h(o.menuKeydown.emit(i))})("focus",function(i){d(e);let o=r();return h(o.menuFocus.emit(i))})("blur",function(i){d(e);let o=r();return h(o.menuBlur.emit(i))}),f(2,Ei,2,2,"ng-template",5),m()}if(n&2){let e=r();a("ngClass",pt(10,ii,!e.root,e.root))("@overlayAnimation",e.visible)("tabindex",e.tabindex),v("id",e.menuId+"_list")("aria-label",e.ariaLabel)("aria-labelledBy",e.ariaLabelledBy)("aria-activedescendant",e.focusedItemId)("aria-orientation","vertical")("data-pc-section","menu"),c(2),a("ngForOf",e.items)}}var Vi=["item"],Fi=["submenuicon"],Ai=["rootmenu"],$i=["container"],Ki=n=>({"p-contextmenu p-component":!0,"p-contextmenu-mobile":n}),Ri=()=>({value:"visible"});function Ni(n,p){if(n&1){let e=k();l(0,"div",3,0),_("@overlayAnimation.start",function(i){d(e);let o=r();return h(o.onOverlayAnimationStart(i))})("@overlayAnimation.done",function(i){d(e);let o=r();return h(o.onOverlayAnimationEnd(i))}),l(2,"p-contextmenu-sub",4,1),_("itemClick",function(i){d(e);let o=r();return h(o.onItemClick(i))})("menuFocus",function(i){d(e);let o=r();return h(o.onMenuFocus(i))})("menuBlur",function(i){d(e);let o=r();return h(o.onMenuBlur(i))})("menuKeydown",function(i){d(e);let o=r();return h(o.onKeyDown(i))})("itemMouseEnter",function(i){d(e);let o=r();return h(o.onItemMouseEnter(i))}),m()()}if(n&2){let e=r();N(e.styleClass),a("ngClass",xe(20,Ki,e.queryMatches))("ngStyle",e.style)("@overlayAnimation",Z(22,Ri)),v("data-pc-section","root")("data-pc-name","contextmenu")("id",e.id),c(2),a("root",!0)("items",e.processedItems)("itemTemplate",e.itemTemplate||e._itemTemplate)("menuId",e.id)("tabindex",e.disabled?-1:e.tabindex)("ariaLabel",e.ariaLabel)("ariaLabelledBy",e.ariaLabelledBy)("baseZIndex",e.baseZIndex)("autoZIndex",e.autoZIndex)("visible",e.submenuVisible())("focusedItemId",e.focused?e.focusedItemId:void 0)("activeItemPath",e.activeItemPath())}}var Bi=({dt:n})=>`
2
2
  .p-contextmenu {
3
3
  position: absolute;
4
4
  background: ${n("contextmenu.background")};