marketplacepos 3.16.0 → 3.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Marketplace/{chunk-WJHFT7N2.js → chunk-442UTXWT.js} +1 -1
- package/Marketplace/{chunk-74Q27XSN.js → chunk-56HMEZKJ.js} +1 -1
- package/Marketplace/{chunk-OIVGFES2.js → chunk-57IKCVRG.js} +1 -1
- package/Marketplace/{chunk-ORBROWBI.js → chunk-5DUVNRSI.js} +1 -1
- package/Marketplace/{chunk-B2LDDWVY.js → chunk-5HK5RDLE.js} +1 -1
- package/Marketplace/{chunk-5B5AH7UI.js → chunk-7KMBT32T.js} +1 -1
- package/Marketplace/{chunk-6KLIXK4G.js → chunk-7MV36WHX.js} +1 -1
- package/Marketplace/{chunk-BFRVDPWZ.js → chunk-DJN3BFQ5.js} +1 -1
- package/Marketplace/{chunk-3AQ7TTGV.js → chunk-FNOXM2SS.js} +1 -1
- package/Marketplace/{chunk-MUMKAGHD.js → chunk-FU3SO6X2.js} +1 -1
- package/Marketplace/{chunk-37VK7KFZ.js → chunk-GCTFQCQL.js} +1 -1
- package/Marketplace/{chunk-P5CREEUF.js → chunk-HDICR5JJ.js} +1 -1
- package/Marketplace/{chunk-YENGYJOK.js → chunk-ILLBE7MA.js} +1 -1
- package/Marketplace/{chunk-J7IMPJJT.js → chunk-L7OZWIEI.js} +1 -1
- package/Marketplace/{chunk-D5JZENHL.js → chunk-MAFA6A4E.js} +1 -1
- package/Marketplace/{chunk-YKWBTHPC.js → chunk-OUZSNKTY.js} +1 -1
- package/Marketplace/{chunk-TFKHUWSZ.js → chunk-P2RYEYAK.js} +1 -1
- package/Marketplace/{chunk-QP4EWGZJ.js → chunk-PTMDFQOD.js} +1 -1
- package/Marketplace/{chunk-GXGSVP3U.js → chunk-RRRAZVNG.js} +1 -1
- package/Marketplace/{chunk-KCIMRNO5.js → chunk-SLBTXHYH.js} +1 -1
- package/Marketplace/{chunk-7ODXSOE4.js → chunk-TD7KGWBY.js} +1 -1
- package/Marketplace/{chunk-PQZGH5ED.js → chunk-UDLUDP5I.js} +1 -1
- package/Marketplace/{chunk-CQLAG7FE.js → chunk-WKKTLYA4.js} +1 -1
- package/Marketplace/{chunk-LM3BZPEX.js → chunk-YNH3VQZY.js} +1 -1
- package/Marketplace/{chunk-4RD6A3OZ.js → chunk-ZHLEQV6S.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-PEE76VLX.js → main-B7T4QEWM.js} +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as xt,c as Ft}from"./chunk-3LNROKGQ.js";import"./chunk-F4FACWQU.js";import{a as Tt}from"./chunk-INOCIPFW.js";import{a as It,b as St}from"./chunk-HPCPVA6F.js";import{a as at,b as lt}from"./chunk-3HQCLIMJ.js";import{a as he,b as st,c as dt,d as ge,e as ut}from"./chunk-TFKHUWSZ.js";import{a as gt,b as Ct,c as ye,d as bt,e as yt,j as ae}from"./chunk-ITTQVZJZ.js";import{b as vt}from"./chunk-UUI7T7NV.js";import{b as ht,c as be}from"./chunk-OURZMROU.js";import{a as ft}from"./chunk-LIJHEC5V.js";import"./chunk-PW6QZKJS.js";import{b as _t,c as Ce}from"./chunk-A3ZMDUMP.js";import{a as ct,b as mt,f as pt,g as _e}from"./chunk-X54LLODL.js";import{d as H,e as W}from"./chunk-DDUQ3IZU.js";import"./chunk-4RD6A3OZ.js";import{e as re}from"./chunk-SUL6ZUGT.js";import"./chunk-KCDL7SWP.js";import{m as ot,n as rt}from"./chunk-SG42JTLJ.js";import{t as it,u as nt}from"./chunk-BZ7SMYI7.js";import{M as et,N as ue,O as tt,P as fe}from"./chunk-DRY23ALE.js";import{A as oe,B as Y,a as Xe,c as se,e as de,h as j,i as z,l as ke,m as ze,n as J,q as Q,r as Je,s as q,t as Qe,u as qe,v as Ze,z as Z}from"./chunk-VFLG2BDB.js";import{b as Ke,c as g}from"./chunk-T4MH7AFK.js";import{$ as N,$a as p,$b as T,Dc as I,H as Le,Hb as Ee,Ia as m,Ib as h,Ja as X,Jb as ne,Kb as K,Mb as je,Nb as Ye,Ob as He,Pb as F,Q as ie,Qb as U,Rb as pe,V as $e,X as L,Za as _,_a as Re,_b as S,aa as ce,ab as Ae,c as Ue,d as Be,da as f,ga as x,gb as k,ha as me,hb as $,jb as R,jc as We,kb as G,lb as s,mb as l,na as O,nb as u,oa as C,ob as D,pa as b,pb as V,q as B,rb as M,ub as y,wb as c,wc as A,xa as Fe,za as w,zb as Ge,zc as E}from"./chunk-IH2NT4RC.js";import"./chunk-GNOSNGXM.js";var ee=function(e){return e[e.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",e[e.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",e[e.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",e[e.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",e[e.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",e}(ee||{});var le=function(e){return e[e.FORMAT_NORMAL=1]="FORMAT_NORMAL",e[e.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",e}(le||{});var Me=(()=>{let i=class i{constructor(){this.shopeeUploadService=f(he),this.formBuilder=f(Z)}getAttributes(o){return this.shopeeUploadService.getAttributes(o.channelId,o.categoryId).pipe(B(t=>this.setLabelToIndonesian(t)))}setLabelToIndonesian(o=[]){let t,r;return o=o.map(a=>(t=a?.multi_lang?.find(d=>d.language=="id"),a.attribute_value_list=a?.attribute_value_list?.map(d=>(r=d?.multi_lang?.find(v=>v.language=="id"),d.name=r?.value,d)),a.name=t?.value?t?.value:a.name,a)),o}createFormGroup(o){let t=this.formBuilder.group({}),r=[];return o.forEach(a=>{if(r=[],a.mandatory&&r.push(de.required),a?.attribute_info?.format_type==le.FORMAT_QUANTITATIVE_WITH_UNIT&&a?.attribute_info?.input_type==ee.FREE_TEXT_FILED){let d=this.formBuilder.group({unit:new ke(null),value:new ke(null,r)});t.addControl(JSON.stringify(a.attribute_id),d)}else t.addControl(JSON.stringify(a.attribute_id),this.formBuilder.control(null,r))}),t}getFilteredAttributes(o,t){let r=JSON.parse(JSON.stringify(o)),a=Object.keys(t),d=r.filter(v=>a.findIndex(Te=>parseInt(Te)==v.attribute_id||v.mandatory)!=-1);return d=this.filterSelectedAttributes(d,t),d}filterSelectedAttributes(o,t){return o.map(a=>{switch(a.attribute_info.input_type){case ee.MULTI_COMBO_BOX:g.IsNotEmpty(a.attribute_value_list)?a.attribute_value_list=a.attribute_value_list.filter(d=>t[a.attribute_id]==d.value_id):a.attribute_value_list=[];break;case ee.FREE_TEXT_FILED:a.attribute_info.format_type==le.FORMAT_QUANTITATIVE_WITH_UNIT?a.attribute_value_list=this.setSelectedQuantitativeAttr(t[a.attribute_id]?.value,t[a.attribute_id]?.unit):g.IsNotEmpty(t[a.attribute_id])&&(a.attribute_value_list=[{value_id:0,name:t[a.attribute_id]}]);break;default:a.attribute_value_list=a.attribute_value_list.filter(d=>d.value_id==t[a.attribute_id])}return a}).filter(a=>a?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(o,t){let r=[];return g.IsNotEmpty(o)&&(r=[{value_id:0,original_value_name:JSON.stringify(o),value_unit:t}]),r}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac});let e=i;return e})();var ve=(()=>{let i=class i{constructor(){this._calendarHeaderConfig=new Be({hideBtnClear:!1,hideBtnToday:!1}),this.calendarConfig=this._calendarHeaderConfig.value}setHeaderConfig(o){this._calendarHeaderConfig.next(o)}getHeaderConfig$(){return this._calendarHeaderConfig.asObservable()}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac,providedIn:"root"});let e=i;return e})();var Bt=["class","component ts"];function Lt(e,i){if(e&1){let n=M();s(0,"button",3),y("click",function(){C(n);let t=c(2);return b(t.todayClicked())}),u(1,"i",4),l()}}function $t(e,i){if(e&1){let n=M();s(0,"button",5),y("click",function(){C(n);let t=c(2);return b(t.clearClicked())}),u(1,"i",6),l()}}function Rt(e,i){if(e&1&&(D(0),_(1,Lt,2,0,"button",1)(2,$t,2,0,"button",2),V()),e&2){let n=i.ngIf;m(),p("ngIf",!n.hideBtnToday),m(),p("ngIf",!n.hideBtnClear)}}var Et=(()=>{let i=class i{constructor(o,t,r,a,d){this._datePicker=o,this._calendar=t,this._dateAdapter=r,this.calendarService=a,this._destroyed=new Ue,t.stateChanges.pipe($e(this._destroyed)).subscribe(v=>d.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(o){this._calendar.ngOnChanges(o)}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}};i.\u0275fac=function(t){return new(t||i)(X(ye),X(Ct),X(ue),X(ve),X(We))},i.\u0275cmp=x({type:i,selectors:[["POS-DatepickerHeader",8,"component","ts"]],features:[O],attrs:Bt,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(t,r){t&1&&(s(0,"mat-calendar-header"),_(1,Rt,3,2,"ng-container",0),S(2,"async"),l()),t&2&&(m(),p("ngIf",T(2,1,r.calendarConfig$)))},dependencies:[A,_t,gt,E],encapsulation:2});let e=i;return e})(),kt=(()=>{let i=class i{};i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=me({type:i}),i.\u0275inj=ce({providers:[ae],imports:[I,Ce,fe,ae,_e,be]});let e=i;return e})();function Gt(e,i){if(e&1&&(s(0,"mat-label",6)(1,"span"),h(2),l()()),e&2){let n=c();p("show",n.placeholder),m(2),ne(n.placeholder)}}var jt={parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"DD MMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},Mt=(()=>{let i=class i{set hidelClearBtn(o){this.calendarService.setHeaderConfig({hideBtnClear:o,hideBtnToday:this.calendarService.calendarConfig.hideBtnToday})}change(o){let t=null;o&&(t=o.toDate(),t.setHours(0,0,0,0)),this.onChange(t),this.dateChange.emit(t)}constructor(o){this.calendarService=o,this.headerComponent=Et,this.appearance="outline",this.isFloatingLabel=!0,this.disabled=!1,this.readOnly=!1,this.dateChange=new w,this.minDate=g.MinDate,this.onChange=t=>{},this.displayToggle=!0}writeValue(o){this.date=o}registerOnChange(o){this.onChange=o}registerOnTouched(o){}setDisabledState(o){this.disabled=o}onOpenDatepicker(){let o=document.getElementById("dropdown-filter");if(o){var t=new bootstrap.Dropdown(o);t&&(t._config.autoClose="inside")}}onCloseDatepicker(){let o=document.getElementById("dropdown-filter");if(o){var t=new bootstrap.Dropdown(o);t&&(t._config.autoClose="outside")}}ngOnDestroy(){this.calendarService.setHeaderConfig({hideBtnClear:!1,hideBtnToday:!1})}};i.\u0275fac=function(t){return new(t||i)(X(ve))},i.\u0275cmp=x({type:i,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"},features:[F([{provide:ue,useClass:Tt,deps:[et]},{provide:tt,useValue:jt},{provide:Xe,multi:!0,useExisting:i}])],decls:6,vars:17,consts:[["picker1",""],[1,"datepicker",3,"disabled","appearance"],[3,"show",4,"ngIf"],["matInput","",3,"dateChange","click","matDatepicker","min","max","placeholder","value","disabled","readonly"],["matSuffix","",3,"for"],[3,"opened","closed","calendarHeaderComponent"],[3,"show"]],template:function(t,r){if(t&1){let a=M();s(0,"mat-form-field",1),_(1,Gt,3,2,"mat-label",2),s(2,"input",3),y("dateChange",function(v){return C(a),b(r.change(v.value))})("click",function(){C(a);let v=Ee(5);return b(v.open())}),l(),u(3,"mat-datepicker-toggle",4),s(4,"mat-datepicker",5,0),y("opened",function(){return C(a),b(r.onOpenDatepicker())})("closed",function(){return C(a),b(r.onCloseDatepicker())}),l()()}if(t&2){let a=Ee(5);Ae("width",r.width||100,"%"),p("disabled",r.disabled)("appearance",r.appearance),m(),p("ngIf",r.isFloatingLabel&&r.placeholder),m(),Ge("placeholder",r.placeholder||""),p("matDatepicker",a)("min",r.minDateValidation)("max",r.maxDateValidation)("value",r.date==r.minDate?null:r.date)("disabled",r.disabled)("readonly",r.readOnly),Re("data-cy",r.data_cy),m(),Ae("display",r.displayToggle?"unset":"none"),p("for",a),m(),p("calendarHeaderComponent",r.headerComponent)}},dependencies:[A,ye,bt,yt,pt,ct,mt,ht],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:33px;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}
|
|
1
|
+
import{a as xt,c as Ft}from"./chunk-3LNROKGQ.js";import"./chunk-F4FACWQU.js";import{a as Tt}from"./chunk-INOCIPFW.js";import{a as It,b as St}from"./chunk-HPCPVA6F.js";import{a as at,b as lt}from"./chunk-3HQCLIMJ.js";import{a as he,b as st,c as dt,d as ge,e as ut}from"./chunk-P2RYEYAK.js";import{a as gt,b as Ct,c as ye,d as bt,e as yt,j as ae}from"./chunk-ITTQVZJZ.js";import{b as vt}from"./chunk-UUI7T7NV.js";import{b as ht,c as be}from"./chunk-OURZMROU.js";import{a as ft}from"./chunk-LIJHEC5V.js";import"./chunk-PW6QZKJS.js";import{b as _t,c as Ce}from"./chunk-A3ZMDUMP.js";import{a as ct,b as mt,f as pt,g as _e}from"./chunk-X54LLODL.js";import{d as H,e as W}from"./chunk-DDUQ3IZU.js";import"./chunk-ZHLEQV6S.js";import{e as re}from"./chunk-SUL6ZUGT.js";import"./chunk-KCDL7SWP.js";import{m as ot,n as rt}from"./chunk-SG42JTLJ.js";import{t as it,u as nt}from"./chunk-BZ7SMYI7.js";import{M as et,N as ue,O as tt,P as fe}from"./chunk-DRY23ALE.js";import{A as oe,B as Y,a as Xe,c as se,e as de,h as j,i as z,l as ke,m as ze,n as J,q as Q,r as Je,s as q,t as Qe,u as qe,v as Ze,z as Z}from"./chunk-VFLG2BDB.js";import{b as Ke,c as g}from"./chunk-T4MH7AFK.js";import{$ as N,$a as p,$b as T,Dc as I,H as Le,Hb as Ee,Ia as m,Ib as h,Ja as X,Jb as ne,Kb as K,Mb as je,Nb as Ye,Ob as He,Pb as F,Q as ie,Qb as U,Rb as pe,V as $e,X as L,Za as _,_a as Re,_b as S,aa as ce,ab as Ae,c as Ue,d as Be,da as f,ga as x,gb as k,ha as me,hb as $,jb as R,jc as We,kb as G,lb as s,mb as l,na as O,nb as u,oa as C,ob as D,pa as b,pb as V,q as B,rb as M,ub as y,wb as c,wc as A,xa as Fe,za as w,zb as Ge,zc as E}from"./chunk-IH2NT4RC.js";import"./chunk-GNOSNGXM.js";var ee=function(e){return e[e.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",e[e.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",e[e.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",e[e.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",e[e.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",e}(ee||{});var le=function(e){return e[e.FORMAT_NORMAL=1]="FORMAT_NORMAL",e[e.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",e}(le||{});var Me=(()=>{let i=class i{constructor(){this.shopeeUploadService=f(he),this.formBuilder=f(Z)}getAttributes(o){return this.shopeeUploadService.getAttributes(o.channelId,o.categoryId).pipe(B(t=>this.setLabelToIndonesian(t)))}setLabelToIndonesian(o=[]){let t,r;return o=o.map(a=>(t=a?.multi_lang?.find(d=>d.language=="id"),a.attribute_value_list=a?.attribute_value_list?.map(d=>(r=d?.multi_lang?.find(v=>v.language=="id"),d.name=r?.value,d)),a.name=t?.value?t?.value:a.name,a)),o}createFormGroup(o){let t=this.formBuilder.group({}),r=[];return o.forEach(a=>{if(r=[],a.mandatory&&r.push(de.required),a?.attribute_info?.format_type==le.FORMAT_QUANTITATIVE_WITH_UNIT&&a?.attribute_info?.input_type==ee.FREE_TEXT_FILED){let d=this.formBuilder.group({unit:new ke(null),value:new ke(null,r)});t.addControl(JSON.stringify(a.attribute_id),d)}else t.addControl(JSON.stringify(a.attribute_id),this.formBuilder.control(null,r))}),t}getFilteredAttributes(o,t){let r=JSON.parse(JSON.stringify(o)),a=Object.keys(t),d=r.filter(v=>a.findIndex(Te=>parseInt(Te)==v.attribute_id||v.mandatory)!=-1);return d=this.filterSelectedAttributes(d,t),d}filterSelectedAttributes(o,t){return o.map(a=>{switch(a.attribute_info.input_type){case ee.MULTI_COMBO_BOX:g.IsNotEmpty(a.attribute_value_list)?a.attribute_value_list=a.attribute_value_list.filter(d=>t[a.attribute_id]==d.value_id):a.attribute_value_list=[];break;case ee.FREE_TEXT_FILED:a.attribute_info.format_type==le.FORMAT_QUANTITATIVE_WITH_UNIT?a.attribute_value_list=this.setSelectedQuantitativeAttr(t[a.attribute_id]?.value,t[a.attribute_id]?.unit):g.IsNotEmpty(t[a.attribute_id])&&(a.attribute_value_list=[{value_id:0,name:t[a.attribute_id]}]);break;default:a.attribute_value_list=a.attribute_value_list.filter(d=>d.value_id==t[a.attribute_id])}return a}).filter(a=>a?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(o,t){let r=[];return g.IsNotEmpty(o)&&(r=[{value_id:0,original_value_name:JSON.stringify(o),value_unit:t}]),r}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac});let e=i;return e})();var ve=(()=>{let i=class i{constructor(){this._calendarHeaderConfig=new Be({hideBtnClear:!1,hideBtnToday:!1}),this.calendarConfig=this._calendarHeaderConfig.value}setHeaderConfig(o){this._calendarHeaderConfig.next(o)}getHeaderConfig$(){return this._calendarHeaderConfig.asObservable()}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac,providedIn:"root"});let e=i;return e})();var Bt=["class","component ts"];function Lt(e,i){if(e&1){let n=M();s(0,"button",3),y("click",function(){C(n);let t=c(2);return b(t.todayClicked())}),u(1,"i",4),l()}}function $t(e,i){if(e&1){let n=M();s(0,"button",5),y("click",function(){C(n);let t=c(2);return b(t.clearClicked())}),u(1,"i",6),l()}}function Rt(e,i){if(e&1&&(D(0),_(1,Lt,2,0,"button",1)(2,$t,2,0,"button",2),V()),e&2){let n=i.ngIf;m(),p("ngIf",!n.hideBtnToday),m(),p("ngIf",!n.hideBtnClear)}}var Et=(()=>{let i=class i{constructor(o,t,r,a,d){this._datePicker=o,this._calendar=t,this._dateAdapter=r,this.calendarService=a,this._destroyed=new Ue,t.stateChanges.pipe($e(this._destroyed)).subscribe(v=>d.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(o){this._calendar.ngOnChanges(o)}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}};i.\u0275fac=function(t){return new(t||i)(X(ye),X(Ct),X(ue),X(ve),X(We))},i.\u0275cmp=x({type:i,selectors:[["POS-DatepickerHeader",8,"component","ts"]],features:[O],attrs:Bt,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(t,r){t&1&&(s(0,"mat-calendar-header"),_(1,Rt,3,2,"ng-container",0),S(2,"async"),l()),t&2&&(m(),p("ngIf",T(2,1,r.calendarConfig$)))},dependencies:[A,_t,gt,E],encapsulation:2});let e=i;return e})(),kt=(()=>{let i=class i{};i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=me({type:i}),i.\u0275inj=ce({providers:[ae],imports:[I,Ce,fe,ae,_e,be]});let e=i;return e})();function Gt(e,i){if(e&1&&(s(0,"mat-label",6)(1,"span"),h(2),l()()),e&2){let n=c();p("show",n.placeholder),m(2),ne(n.placeholder)}}var jt={parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"DD MMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},Mt=(()=>{let i=class i{set hidelClearBtn(o){this.calendarService.setHeaderConfig({hideBtnClear:o,hideBtnToday:this.calendarService.calendarConfig.hideBtnToday})}change(o){let t=null;o&&(t=o.toDate(),t.setHours(0,0,0,0)),this.onChange(t),this.dateChange.emit(t)}constructor(o){this.calendarService=o,this.headerComponent=Et,this.appearance="outline",this.isFloatingLabel=!0,this.disabled=!1,this.readOnly=!1,this.dateChange=new w,this.minDate=g.MinDate,this.onChange=t=>{},this.displayToggle=!0}writeValue(o){this.date=o}registerOnChange(o){this.onChange=o}registerOnTouched(o){}setDisabledState(o){this.disabled=o}onOpenDatepicker(){let o=document.getElementById("dropdown-filter");if(o){var t=new bootstrap.Dropdown(o);t&&(t._config.autoClose="inside")}}onCloseDatepicker(){let o=document.getElementById("dropdown-filter");if(o){var t=new bootstrap.Dropdown(o);t&&(t._config.autoClose="outside")}}ngOnDestroy(){this.calendarService.setHeaderConfig({hideBtnClear:!1,hideBtnToday:!1})}};i.\u0275fac=function(t){return new(t||i)(X(ve))},i.\u0275cmp=x({type:i,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"},features:[F([{provide:ue,useClass:Tt,deps:[et]},{provide:tt,useValue:jt},{provide:Xe,multi:!0,useExisting:i}])],decls:6,vars:17,consts:[["picker1",""],[1,"datepicker",3,"disabled","appearance"],[3,"show",4,"ngIf"],["matInput","",3,"dateChange","click","matDatepicker","min","max","placeholder","value","disabled","readonly"],["matSuffix","",3,"for"],[3,"opened","closed","calendarHeaderComponent"],[3,"show"]],template:function(t,r){if(t&1){let a=M();s(0,"mat-form-field",1),_(1,Gt,3,2,"mat-label",2),s(2,"input",3),y("dateChange",function(v){return C(a),b(r.change(v.value))})("click",function(){C(a);let v=Ee(5);return b(v.open())}),l(),u(3,"mat-datepicker-toggle",4),s(4,"mat-datepicker",5,0),y("opened",function(){return C(a),b(r.onOpenDatepicker())})("closed",function(){return C(a),b(r.onCloseDatepicker())}),l()()}if(t&2){let a=Ee(5);Ae("width",r.width||100,"%"),p("disabled",r.disabled)("appearance",r.appearance),m(),p("ngIf",r.isFloatingLabel&&r.placeholder),m(),Ge("placeholder",r.placeholder||""),p("matDatepicker",a)("min",r.minDateValidation)("max",r.maxDateValidation)("value",r.date==r.minDate?null:r.date)("disabled",r.disabled)("readonly",r.readOnly),Re("data-cy",r.data_cy),m(),Ae("display",r.displayToggle?"unset":"none"),p("for",a),m(),p("calendarHeaderComponent",r.headerComponent)}},dependencies:[A,ye,bt,yt,pt,ct,mt,ht],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:33px;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}
|
|
2
2
|
`],encapsulation:2});let e=i;return e})(),Pt=(()=>{let i=class i{};i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=me({type:i}),i.\u0275inj=ce({providers:[ae],imports:[I,Ce,fe,ae,_e,be,kt]});let e=i;return e})();var Pe=function(e){return e[e.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",e[e.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",e[e.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",e[e.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",e[e.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",e}(Pe||{});var Ne=()=>[];function Ht(e,i){e&1&&(s(0,"span",5),h(1,"*"),l())}function Wt(e,i){if(e&1&&u(0,"ng-select",6),e&2){let n=c().$implicit;p("multiple",!0)("formControlName",n.attribute_id)("items",n.attribute_value_list?n.attribute_value_list:pe(4,Ne))("placeholder","Pilih "+(n==null?null:n.name))}}function Xt(e,i){if(e&1&&u(0,"input",8),e&2){let n=c(2).$implicit;p("formControlName",n.attribute_id)("placeholder","Isi "+(n==null?null:n.name))}}function zt(e,i){if(e&1&&(s(0,"option",15),h(1),l()),e&2){let n=i.$implicit;p("value",n),m(),ne(n)}}function Jt(e,i){if(e&1&&(s(0,"div",10),u(1,"input",12),s(2,"select",13)(3,"option",14),h(4,"Unit"),l(),R(5,zt,2,2,"option",15,$),l()()),e&2){let n=c(3).$implicit;p("formGroupName",n.attribute_id),m(),p("placeholder","Isi "+(n==null?null:n.name)),m(2),p("value",null),m(2),G(n==null||n.attribute_info==null?null:n.attribute_info.attribute_unit_list)}}function Qt(e,i){if(e&1&&u(0,"input",11),e&2){let n=c(3).$implicit;p("formControlName",n.attribute_id)("placeholder","Isi "+(n==null?null:n.name))}}function qt(e,i){if(e&1&&_(0,Jt,7,3,"div",10)(1,Qt,1,2,"input",11),e&2){let n=c(2).$implicit,o=c(2);k((n==null||n.attribute_info==null?null:n.attribute_info.format_type)==o.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function Zt(e,i){if(e&1&&u(0,"datepicker",9),e&2){let n=c(2).$implicit;p("formControlName",n.attribute_id)}}function Kt(e,i){if(e&1&&_(0,Xt,1,2,"input",8)(1,qt,2,1)(2,Zt,1,1,"datepicker",9),e&2){let n,o=c().$implicit,t=c(2);k((n=o==null||o.attribute_info==null?null:o.attribute_info.input_validation_type)===t.validationType.VALIDATOR_STRING_TYPE?0:n===t.validationType.VALIDATOR_FLOAT_TYPE?1:n===t.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function ei(e,i){if(e&1&&u(0,"ng-select",7),e&2){let n=c().$implicit;p("formControlName",n.attribute_id)("items",n.attribute_value_list?n.attribute_value_list:pe(3,Ne))("placeholder","Pilih "+(n==null?null:n.name))}}function ti(e,i){if(e&1&&u(0,"ng-select",7),e&2){let n=c().$implicit;p("formControlName",n.attribute_id)("items",n.attribute_value_list?n.attribute_value_list:pe(3,Ne))("placeholder","Pilih "+(n==null?null:n.name))}}function ii(e,i){if(e&1&&(s(0,"div",3)(1,"div",4),_(2,Ht,2,0,"span",5),s(3,"span"),h(4),l()(),_(5,Wt,1,5,"ng-select",6)(6,Kt,3,1)(7,ei,1,4,"ng-select",7)(8,ti,1,4,"ng-select",7),l()),e&2){let n,o=i.$implicit,t=c(2);m(2),k(o.mandatory?2:-1),m(2),K(" ",o==null?null:o.name," "),m(),k((n=o==null||o.attribute_info==null?null:o.attribute_info.input_type)===t.inputType.MULTI_COMBO_BOX?5:n===t.inputType.FREE_TEXT_FILED?6:n===t.inputType.SINGLE_COMBO_BOX?7:8)}}function ni(e,i){if(e&1&&(D(0),s(1,"form",1)(2,"div",2),R(3,ii,9,3,"div",3,$),l()(),V()),e&2){let n=i.ngIf,o=c();m(),p("formGroup",o.form),m(2),G(n)}}var Nt=(()=>{let i=class i{constructor(){this.formCategoryService=f(Me),this.attributesChanges=new w,this.inputType=ee,this.formatType=le,this.validationType=Pe}ngOnChanges(){g.IsNotEmpty(this.categoryId)&&g.IsNotEmpty(this.channelId)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:this.categoryId,channelId:this.channelId,channelType:this.channelType}).pipe(L(o=>{this.form=this.formCategoryService.createFormGroup(o),this.listenToFormChange(o)}),ie(1)))}listenToFormChange(o){let t=[];this.formSubscription=this.form.valueChanges.subscribe(r=>{t=this.formCategoryService.getFilteredAttributes(o,r),this.attributesChanges.emit(t)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};i.\u0275fac=function(t){return new(t||i)},i.\u0275cmp=x({type:i,selectors:[["shopee-attribute-form"]],inputs:{channelType:"channelType",categoryId:"categoryId",channelId:"channelId",channelProductUpload:"channelProductUpload"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[F([Me]),O,U],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(t,r){t&1&&(_(0,ni,5,1,"ng-container",0),S(1,"async")),t&2&&p("ngIf",T(1,1,r.attributes$))},dependencies:[I,A,E,W,H,Y,J,qe,Ze,se,Qe,j,z,Q,q,Je,vt,Pt,Mt],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}"]});let e=i;return e})();var Oe=(()=>{let i=class i{constructor(){this.httpService=f(re),this.formBuilder=f(Z)}getAttributes(o,t){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:o},{key:"CategoryID",value:t}]).pipe(B(a=>(a=this.mappingAttributeSalesProperty(a),a)))}mappingAttributeSalesProperty(o){let t=0;return o.filter(r=>(r.type=="SALES_PROPERTY"&&(t+=1),t>1?(t=0,!1):!0)).map(r=>(r.type=="SALES_PROPERTY"&&(r.name="Jenis Variant",r.is_multiple_selection=!1,r.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),r))}createFormGroup(o){let t=this.formBuilder.group({}),r=[];return o.forEach(a=>{r=[],a.is_required&&r.push(de.required),t.addControl(a.id,this.formBuilder.control(null,r))}),t}getFilteredAttributes(o,t){let r=JSON.parse(JSON.stringify(o)),a=Object.keys(t),d=r.filter(v=>a.findIndex(Te=>parseInt(Te)==v.id)!=-1);return d=this.filterSelectedAttributes(d,t),d}filterSelectedAttributes(o,t){return o.map(a=>(a.is_multiple_selection?a.values=a.values.filter(d=>t[a.id]?.includes(d.id)):a.values=a.values.filter(d=>d.id==t[a.id]),a)).filter(a=>a?.values?.length>0)}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac});let e=i;return e})();function oi(e,i){e&1&&(s(0,"span",5),h(1,"*"),l())}function ri(e,i){if(e&1&&u(0,"ng-select",6),e&2){let n=c().$implicit;p("multiple",!0)("formControlName",n.id)("items",n.values)("placeholder","Pilih "+(n==null?null:n.name))}}function ai(e,i){if(e&1&&u(0,"ng-select",7),e&2){let n=c().$implicit;p("formControlName",n.id)("items",n.values)("placeholder","Pilih "+(n==null?null:n.name))}}function li(e,i){if(e&1&&(s(0,"small",5),h(1),l()),e&2){let n=c().$implicit;m(),K(" ",n==null?null:n.name," is mandatory ")}}function ci(e,i){if(e&1&&(s(0,"div",3)(1,"div",4),_(2,oi,2,0,"span",5),s(3,"span"),h(4),l()(),_(5,ri,1,4,"ng-select",6)(6,ai,1,3,"ng-select",7)(7,li,2,1,"small",5),l()),e&2){let n=i.$implicit;m(2),k(n.is_required?2:-1),m(2),K(" ",n==null?null:n.name," "),m(),k(n.is_multiple_selection?5:6),m(2),k(n.is_required?7:-1)}}function mi(e,i){if(e&1&&(D(0),s(1,"form",1)(2,"div",2),R(3,ci,8,4,"div",3,$),l()(),V()),e&2){let n=i.ngIf,o=c();m(),p("formGroup",o.form),m(2),G(n)}}var Ot=(()=>{let i=class i{constructor(){this.tiktokAttributeFormService=f(Oe),this.attributesChanges=new w}ngOnChanges(){g.IsNotEmpty(this.categoryId)&&g.IsNotEmpty(this.channelId)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(this.channelId,this.categoryId).pipe(B(o=>o.filter(t=>!(t.type=="PRODUCT_PROPERTY"&&(g.IsEmpty(t.values)||t.values?.length==0)))),L(o=>{this.form=this.tiktokAttributeFormService.createFormGroup(o),this.listenToFormChange(o)}),ie(1)))}listenToFormChange(o){let t=[];this.formSubscription=this.form.valueChanges.subscribe(r=>{t=this.tiktokAttributeFormService.getFilteredAttributes(o,r),this.attributesChanges.emit(t)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};i.\u0275fac=function(t){return new(t||i)},i.\u0275cmp=x({type:i,selectors:[["tiktok-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[F([Oe]),O,U],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","id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(t,r){t&1&&(_(0,mi,5,1,"ng-container",0),S(1,"async")),t&2&&p("ngIf",T(1,1,r.attributes$))},dependencies:[I,A,E,W,H,Y,J,j,z,Q,q,oe]});let e=i;return e})();var we=(()=>{let i=class i{constructor(){this.woocommerceUploadService=f(ge)}getAttributes(o,t){return this.woocommerceUploadService.getAttributes(o,t).pipe(B(r=>r.map(a=>({key:a.name,label:a.name}))))}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac});let e=i;return e})();var wt=(()=>{let i=class i{constructor(){this.wooAttributeFormService=f(we),this.channelId=Fe(),this.categoryId=Fe(),this.attributesChanges=new w}ngOnChanges(){g.IsNotEmpty(this.categoryId())&&g.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(o){this.attributesChanges.emit([o.key])}};i.\u0275fac=function(t){return new(t||i)},i.\u0275cmp=x({type:i,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[F([we]),O,U],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(t,r){t&1&&(s(0,"div",0)(1,"div",1)(2,"div",2),h(3,"Atribut"),l(),s(4,"ng-select",3),S(5,"async"),y("change",function(d){return r.onSelectAttribute(d)}),l()()()),t&2&&(m(4),p("items",T(5,1,r.attributes$)))},dependencies:[I,E,oe,W,H,Y]});let e=i;return e})();var De=(()=>{let i=class i{constructor(){this.httpService=f(re),this.formBuilder=f(Z)}getAttributes(o,t){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:o},{key:"CategoryID",value:t}]).pipe(B(a=>a))}createFormGroup(o){let t=this.formBuilder.group({});return o.forEach(r=>{t.addControl(r.variant,this.formBuilder.control(null))}),t}convertAttributes(o={}){return Object.values(o).filter(r=>r!==null).map(r=>JSON.stringify(r))}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac});let e=i;return e})();function pi(e,i){if(e&1&&(s(0,"div",3)(1,"div",4),h(2),l(),u(3,"ng-select",5),l()),e&2){let n=i.$implicit;m(2),K(" ",n==null?null:n.variant," "),m(),p("formControlName",n.variant)("items",n.values)("placeholder","Pilih "+(n==null?null:n.variant))}}function si(e,i){if(e&1&&(D(0),s(1,"form",1)(2,"div",2),R(3,pi,4,4,"div",3,$),l()(),V()),e&2){let n=i.ngIf,o=c();m(),p("formGroup",o.form),m(2),G(n)}}var Dt=(()=>{let i=class i{constructor(){this.tokpedAttrFormService=f(De),this.attributesChanges=new w}ngOnInit(){}ngOnChanges(o){g.IsNotEmpty(this.categoryId)&&g.IsNotEmpty(this.channelId)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(this.channelId,this.categoryId).pipe(L(t=>{this.form=this.tokpedAttrFormService.createFormGroup(t),this.listenToFormChange()})))}listenToFormChange(){let o=[];this.formSubscription=this.form.valueChanges.subscribe(t=>{o=this.tokpedAttrFormService.convertAttributes(t),this.attributesChanges.emit(o)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};i.\u0275fac=function(t){return new(t||i)},i.\u0275cmp=x({type:i,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[F([De]),O,U],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(t,r){t&1&&(_(0,si,5,1,"ng-container",0),S(1,"async")),t&2&&p("ngIf",T(1,1,r.attributes$))},dependencies:[I,A,E,W,H,Y,J,j,z,Q,q]});let e=i;return e})();var Ve=(()=>{let i=class i{constructor(){this.httpService=f(re),this.formBuilder=f(Z)}getAttributes(o){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:o}]).pipe(L(r=>(r.Options.StatusOptions=r.Options.Status.map(a=>({id:a,name:a})),r)))}createFormGroup(o){let t=this.formBuilder.group({});return Object.keys(o.Attribute).forEach(a=>{t.addControl(a,this.formBuilder.control(null))}),t}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac});let e=i;return e})();function di(e,i){if(e&1&&(D(0),s(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4),h(5," Brand "),l(),u(6,"input",5),l(),s(7,"div",6)(8,"div",4),h(9," Product Type "),l(),u(10,"input",7),l(),s(11,"div",6)(12,"div",4),h(13," Status "),l(),u(14,"ng-select",8),l()()(),V()),e&2){let n=i.ngIf,o=c();m(),p("formGroup",o.form),m(13),p("items",n.Options.StatusOptions)}}var Vt=(()=>{let i=class i{constructor(){this.attributesChanges=new w,this.shopifyFormService=f(Ve)}ngOnChanges(o){o.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId).pipe(L(t=>{this.form=this.shopifyFormService.createFormGroup(t),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(Le(500)).subscribe(o=>{this.attributesChanges.emit([o])})}ngOnDestroy(){this.formSubscription.unsubscribe()}};i.\u0275fac=function(t){return new(t||i)},i.\u0275cmp=x({type:i,selectors:[["shopify-attribute-form"]],inputs:{channelId:"channelId"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[F([Ve]),O,U],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(t,r){t&1&&(_(0,di,15,2,"ng-container",0),S(1,"async")),t&2&&p("ngIf",T(1,1,r.attributes$))},dependencies:[I,A,E,Y,J,se,j,z,Q,q,W,H]});let e=i;return e})();function ui(e,i){if(e&1&&(s(0,"div",6),u(1,"app-product-card",9),l()),e&2){let n=i.$implicit;m(),p("productId",n==null?null:n.ID)("title",n==null?null:n.Name)("image",n==null?null:n.ThumbnailUrl)("description",(n==null||n.Variants==null?null:n.Variants.length)>1?(n==null||n.Variants==null?null:n.Variants.length)+" Variants":null)("imageForZoom",n==null?null:n.ImageUrl)("code",n==null||n.Variants[0]==null?null:n.Variants[0].Code)("showFooter",!1)}}function fi(e,i){if(e&1){let n=M();D(0),s(1,"mat-checkbox",21),He("ngModelChange",function(t){C(n);let r=c().$implicit;return Ye(r.selected,t)||(r.selected=t),b(t)}),y("ngModelChange",function(){let t=C(n).ngIf,r=c(),a=r.$implicit,d=r.$index,v=c();return b(v.onSelectChannel(a,d,t))}),l(),V()}if(e&2){let n=c().$implicit;m(),je("ngModel",n.selected)}}function _i(e,i){e&1&&(s(0,"div",18),u(1,"input",22),l())}function hi(e,i){if(e&1){let n=M();s(0,"app-channel-category-select",23),y("selectedCategory",function(t){C(n);let r=c().$index,a=c();return b(a.onCategoryChange(r,t))}),l()}if(e&2){let n=c().$implicit,o=c();p("disabled",!n.selected||n.selected&&n.type==o.channelType.Lazada)("channelId",n.id)("channelType",n.type)("categoryId",n.categoryId)}}function gi(e,i){if(e&1){let n=M();s(0,"shopee-attribute-form",27),y("attributesChanges",function(t){C(n);let r=c(2).$index,a=c();return b(a.onAttributesChange(r,t))}),l()}if(e&2){let n=c(2).$implicit;p("categoryId",n.categoryId)("channelId",n.id)("channelType",n.type)}}function Ci(e,i){if(e&1){let n=M();s(0,"tiktok-attribute-form",28),y("attributesChanges",function(t){C(n);let r=c(2).$index,a=c();return b(a.onAttributesChange(r,t))}),l()}if(e&2){let n=c(2).$implicit;p("categoryId",n.categoryId)("channelId",n.id)}}function bi(e,i){if(e&1){let n=M();s(0,"wooocommerce-attribute-form",28),y("attributesChanges",function(t){C(n);let r=c(2).$index,a=c();return b(a.onAttributesChange(r,t))}),l()}if(e&2){let n=c(2).$implicit;p("categoryId",n.categoryId)("channelId",n.id)}}function yi(e,i){if(e&1){let n=M();s(0,"tokopedia-attribute-form",28),y("attributesChanges",function(t){C(n);let r=c(2).$index,a=c();return b(a.onAttributesChange(r,t))}),l()}if(e&2){let n=c(2).$implicit;p("categoryId",n.categoryId)("channelId",n.id)}}function vi(e,i){if(e&1&&(s(0,"div",20)(1,"div",24),_(2,gi,1,3,"shopee-attribute-form",25)(3,Ci,1,2,"tiktok-attribute-form",26)(4,bi,1,2,"wooocommerce-attribute-form",26)(5,yi,1,2,"tokopedia-attribute-form",26),l()()),e&2){let n,o=c().$implicit,t=c();m(2),k((n=o.type)===t.channelType.Shopee?2:n===t.channelType.Tiktok?3:n===t.channelType.WooCommerce?4:n===t.channelType.Tokopedia?5:-1)}}function xi(e,i){if(e&1){let n=M();s(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",29),y("attributesChanges",function(t){C(n);let r=c().$index,a=c();return b(a.onAttributesChange(r,t))}),l()()()}if(e&2){let n=c().$implicit;m(2),p("channelId",n.id)}}function Ii(e,i){if(e&1&&(s(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),_(6,fi,2,1,"ng-container",14),S(7,"async"),l(),s(8,"div"),u(9,"app-channel-logo",15),l(),s(10,"div",16)(11,"span"),h(12),l()()()(),s(13,"div",12)(14,"div",17),_(15,_i,2,0,"div",18)(16,hi,1,4,"app-channel-category-select",19),l()()(),_(17,vi,6,1,"div",20)(18,xi,3,1,"div",20),l()()),e&2){let n=i.$implicit,o=c();m(6),p("ngIf",T(7,7,o.defaultCategories$)),m(3),p("typeId",n.type),m(),p("matTooltip",n.name)("matTooltipShowDelay",2500),m(2),ne(n.name),m(3),k(n.type==o.channelType.Shopify?15:16),m(2),k(n.categoryId&&o.channelType.Lazada!=n.type&&n.selected?17:o.channelType.Shopify==n.type&&n.selected?18:-1)}}var yr=(()=>{let i=class i{constructor(){this.uploadProductService=f(ut),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=Ke,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(ie(1))}onCategoryChange(o,t){this.channelProductUploads.update(r=>r.map((a,d)=>(d==o&&(a.categoryId=t,a.attributes=[]),a)))}onAttributesChange(o,t){this.channelProductUploads.update(r=>r.map((a,d)=>(d==o&&(a.attributes=t),a)))}onSelectChannel(o,t,r){this.channelProductUploads.update(a=>a.map((d,v)=>{if(v==t&&o.selected){let Se=this.findCategoryByChannelId(o.id,r);d.categoryId=Se?.DefaultCategoryID}return v==t&&!o.selected&&(d.categoryId=null),d}))}findCategoryByChannelId(o,t){return t.find(r=>r.ID===o)}onUploadProduct(){this.uploadProductService.onUploadProduct(this.channelProductUploads())}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}};i.\u0275fac=function(t){return new(t||i)},i.\u0275cmp=x({type:i,selectors:[["app-product-upload"]],standalone:!0,features:[F([he,st,dt,ge]),U],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"],[2,"overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"matTooltip","matTooltipShowDelay"],[1,"w-100"],["matTooltip","Cannot change category, please change category in admin.shopify.com","matTooltipPosition","above"],[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","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(t,r){if(t&1&&(s(0,"mainpanel",0)(1,"actions")(2,"button",1),y("click",function(){return r.onUploadProduct()}),u(3,"i",2),h(4," Upload "),l()(),s(5,"content")(6,"div",3)(7,"h3",4),h(8,"Product To Upload"),l(),s(9,"div",5),R(10,ui,2,7,"div",6,$),S(12,"async"),l(),s(13,"h3",7),h(14,"Channel To Upload"),l(),R(15,Ii,19,9,"div",8,$),l()()()),t&2){let a;p("hideSearchBox",!0)("hideSearchDropdown",!0),m(2),p("disabled",((a=r.channelProductUploads())==null?null:a.length)==0),m(8),G(T(12,3,r.selectedProducts$)),m(5),G(r.channelProductUploads())}},dependencies:[I,A,E,xt,rt,ot,St,It,lt,at,oe,j,ze,nt,it,Nt,Ot,wt,Dt,Vt,ft,Ft],encapsulation:2});let e=i;return e})();export{yr as ProductUploadComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as ne,b as oe,c as re,d as ae,e as le,f as pe,g as se}from"./chunk-B42KSOUB.js";import{b as ie}from"./chunk-K66EVMAU.js";import{a as ee,b as te}from"./chunk-OKB4Q376.js";import{a as X}from"./chunk-
|
|
1
|
+
import{a as ne,b as oe,c as re,d as ae,e as le,f as pe,g as se}from"./chunk-B42KSOUB.js";import{b as ie}from"./chunk-K66EVMAU.js";import{a as ee,b as te}from"./chunk-OKB4Q376.js";import{a as X}from"./chunk-L7OZWIEI.js";import{g as Q}from"./chunk-ZHLEQV6S.js";import{e as J}from"./chunk-SUL6ZUGT.js";import"./chunk-KCDL7SWP.js";import{m as Y,n as Z}from"./chunk-SG42JTLJ.js";import"./chunk-BZ7SMYI7.js";import"./chunk-DRY23ALE.js";import{A as q,c as G,h as z,m as K}from"./chunk-VFLG2BDB.js";import"./chunk-T4MH7AFK.js";import{$ as D,$a as s,Dc as H,Ga as k,Hb as v,Ia as p,Ib as m,Ja as I,Jb as O,Kb as B,Mb as L,Nb as F,Ob as R,Pb as P,Sb as x,Vc as W,Xc as j,Za as c,Zc as $,aa as T,ca as U,ga as C,ha as N,lb as o,mb as r,nb as d,oa as g,ob as f,pa as h,pb as _,rb as S,ub as y,vc as w,wb as u,wc as V,xc as A,za as M}from"./chunk-IH2NT4RC.js";import"./chunk-GNOSNGXM.js";var ge=e=>[e];function he(e,t){if(e&1&&(f(0),o(1,"a",9),m(2),r(),_()),e&2){let a=t.$implicit;p(),s("routerLink",x(2,ge,a.url)),p(),B(" ",a.title,"")}}var ce=(()=>{let t=class t{constructor(){this.tabs=[{Title:"Download By Url",Url:"/menu/products/download/by-url",Description:"Download products information by product URL as a parameter"}],this.moreMenu=[{title:"Sold In Channel",url:"/menu/products/status/sold-in-channel"},{title:"In POS",url:"/menu/products/status/in-pos"},{title:"Not In Channel",url:"/menu/products/status/not-in-channel"},{title:"Duplicate SKU",url:"/menu/products/status/duplicate-sku"}]}};t.\u0275fac=function(i){return new(i||t)},t.\u0275cmp=C({type:t,selectors:[["app-download"]],decls:12,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-block"],[4,"ngFor","ngForOf"],[1,"dropdown-item",3,"routerLink"]],template:function(i,l){i&1&&(o(0,"nav",0)(1,"div",1)(2,"div"),d(3,"nav-tab",2),r()(),o(4,"div")(5,"div",3)(6,"a",4),d(7,"i",5),r(),o(8,"div",6)(9,"div",7),c(10,he,3,4,"ng-container",8),r()()()()(),d(11,"router-outlet")),i&2&&(p(3),s("Tabs",l.tabs),p(7),s("ngForOf",l.moreMenu))},dependencies:[w,ee,W,j]});let e=t;return e})();var E=(()=>{let t=class t{constructor(n){this.httpService=n}download(n){return this.httpService.post("/api/Product/downloadurl",n)}};t.\u0275fac=function(i){return new(i||t)(U(J))},t.\u0275prov=D({token:t,factory:t.\u0275fac,providedIn:"root"});let e=t;return e})();var Ce=e=>({"background-color":e});function ye(e,t){if(e&1&&(o(0,"th"),m(1),r()),e&2){let a=t.$implicit;p(),O(a.column)}}function ve(e,t){if(e&1&&(f(0),o(1,"td"),d(2,"span",6),r(),_()),e&2){let a=t.$implicit,n=u().$implicit;p(2),s("innerHTML",n[a.prop],k)}}function xe(e,t){if(e&1&&(o(0,"tr",5),c(1,ve,3,1,"ng-container",3),r()),e&2){let a=t.$implicit,n=u();s("ngStyle",x(2,Ce,a.Status>200?"#F4D6D5":"#DEE9C9")),p(),s("ngForOf",n.configs)}}var de=(()=>{let t=class t{constructor(){this.eventClose=new M}ngOnInit(){}onClose(){this.eventClose.emit()}};t.\u0275fac=function(i){return new(i||t)},t.\u0275cmp=C({type:t,selectors:[["app-response-api-list"]],inputs:{configs:"configs",data:"data",status:"status"},outputs:{eventClose:"onClose"},decls:7,vars:2,consts:[[1,"table-responsive"],[1,"table"],[1,"thead-light"],[4,"ngFor","ngForOf"],[3,"ngStyle",4,"ngFor","ngForOf"],[3,"ngStyle"],[3,"innerHTML"]],template:function(i,l){i&1&&(o(0,"div",0)(1,"table",1)(2,"thead",2)(3,"tr"),c(4,ye,2,1,"th",3),r()(),o(5,"tbody"),c(6,xe,2,4,"tr",4),r()()()),i&2&&(p(4),s("ngForOf",l.configs),p(2),s("ngForOf",l.data))},dependencies:[w,A]});let e=t;return e})();function be(e,t){if(e&1){let a=S();f(0),o(1,"button",15),y("click",function(){g(a);let i=u(),l=v(11);return h(i.onNewStepperState(l))}),d(2,"i",16),m(3," New "),r(),_()}}function Ee(e,t){if(e&1){let a=S();f(0),o(1,"button",15),y("click",function(){g(a),u();let i=v(11);return h(i.previous())}),m(2," Back "),r(),_()}}function Ie(e,t){if(e&1){let a=S();f(0),o(1,"button",17),y("click",function(){g(a);let i=u(),l=v(11);return h(i.onStepperNext(l))}),m(2," Next "),r(),_()}}function De(e,t){if(e&1){let a=S();f(0),o(1,"button",18),y("click",function(){g(a);let i=u(),l=v(11);return h(i.onSubmit(l))}),m(2,"Download"),r(),_()}if(e&2){let a=u();p(),s("disabled",!a.urls)}}function Te(e,t){e&1&&(d(0,"i",19),o(1,"span"),m(2,"Instruction"),r())}function Ue(e,t){e&1&&(o(0,"div",20)(1,"div",21)(2,"div",22)(3,"h4",23),m(4,"Note"),r()(),o(5,"div",24)(6,"ol",25)(7,"li"),m(8," Use this form to Download Products from Tokopedia using product URL "),r(),o(9,"li"),m(10," Copy Product URL from "),o(11,"a",26),m(12,"https://seller.tokopedia.com/ "),r(),m(13," and paste in this form "),r(),o(14,"li"),m(15," Use New Line when you want to input several product URLs "),r()()()()())}function Ne(e,t){e&1&&(d(0,"i",27),o(1,"span"),m(2,"Download"),r())}function Me(e,t){if(e&1){let a=S();o(0,"div",20)(1,"textarea",28),R("ngModelChange",function(i){g(a);let l=u();return F(l.urls,i)||(l.urls=i),h(i)}),r()()}if(e&2){let a=u();p(),s("placeholder",a.urlPlaceholder),L("ngModel",a.urls)}}function ke(e,t){e&1&&(d(0,"i",29),o(1,"span"),m(2,"Finish"),r())}function Oe(e,t){if(e&1&&(o(0,"div",20),d(1,"app-response-api-list",30),r()),e&2){let a=u();p(),s("data",a.downloadResponses)("configs",a.configs)}}function Be(e,t){e&1&&(o(0,"h6"),m(1,"1"),r())}function Le(e,t){e&1&&(o(0,"h6"),m(1,"2"),r())}function Fe(e,t){e&1&&(o(0,"h6"),m(1,"3"),r())}var ue=(()=>{let t=class t{constructor(n,i){this.downloadService=n,this.authService=i,this.configs=[{column:"Url",prop:"URL"},{column:"POS",prop:"Name"},{column:"Exception",prop:"Message"}],this.downloadResponses=[],this.stepperState="DOWNLOAD",this.urlPlaceholder=`https://tokopedia.com/tokoriyanadi/kaos-polos-biru
|
|
2
2
|
https://tokopedia.com/tokoriyanadi/Celana-Chinos-Coklat`,this.currentDomain=this.authService.getDomain()}onStepperChange(n){this.stepperState=n.selectedStep.state}onSubmit(n){let i=this.urls.split(/\r?\n/);this.downloadService.download(i).subscribe(l=>{this.downloadResponses=l,this.mappingLinkToProduct(),this.onStepperNext(n)})}mappingLinkToProduct(){this.downloadResponses=this.downloadResponses.map(n=>(n.Name=n?.Name?`<a href="${this.currentDomain}/menu/Products/Catalog/Products/Info?ID=${n.ID}" target="_blank">
|
|
3
3
|
${n?.Name}
|
|
4
4
|
</a>`:"-",n))}onNewStepperState(n){this.downloadResponses=[],this.urls=null,this.stepperState="DOWNLOAD",n.reset(),this.onStepperNext(n)}onStepperNext(n){n.selected.completed=!0,n.next()}};t.\u0275fac=function(i){return new(i||t)(I(E),I(Q))},t.\u0275cmp=C({type:t,selectors:[["app-by-url"]],features:[P([{provide:ne,useValue:{displayDefaultIndicatorType:!1}}])],decls:24,vars:11,consts:[["stepper",""],["headerTitle","Tokopedia - Product Download By Url",3,"hideSearchBox","hideSearchDropdown"],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-12"],["linear","",1,"stepper-downloadByUrl",3,"selectionChange","selectedIndex"],["state","GUIDE",3,"editable","completed"],["matStepLabel",""],["matStepContent",""],["state","DOWNLOAD",3,"editable","completed"],["state","FINISH"],["matStepperIcon","GUIDE"],["matStepperIcon","DOWNLOAD"],["matStepperIcon","FINISH"],[1,"btn","btn-outline-secondary","btn-fill","btn-lg",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],["type","button",1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-3",3,"click"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","text-white","ms-3",3,"click","disabled"],[1,"fa-solid","fa-info","me-3"],[1,"mt-8"],[1,"card","border","w-50"],[1,"card-header","py-6"],[1,"text-primary"],[1,"card-body",2,"padding-left","0px"],[1,"mt-6"],["href","https://seller.tokopedia.com","target","_blank"],[1,"fa-solid","fa-download","me-3"],["name","url","cols","30","rows","25",1,"form-control",3,"ngModelChange","placeholder","ngModel"],[1,"fa-sharp","fa-solid","fa-flag","me-3"],["status","error",3,"data","configs"]],template:function(i,l){if(i&1){let fe=S();o(0,"mainpanel",1)(1,"actions"),c(2,be,4,0,"ng-container",2)(3,Ee,3,0,"ng-container",2)(4,Ie,3,0,"ng-container",2)(5,De,3,1,"ng-container",2),r(),o(6,"content")(7,"div",3)(8,"div",4)(9,"div",5)(10,"mat-stepper",6,0),y("selectionChange",function(_e){return g(fe),h(l.onStepperChange(_e))}),o(12,"mat-step",7),c(13,Te,3,0,"ng-template",8)(14,Ue,16,0,"ng-template",9),r(),o(15,"mat-step",10),c(16,Ne,3,0,"ng-template",8)(17,Me,2,2,"ng-template",9),r(),o(18,"mat-step",11),c(19,ke,3,0,"ng-template",8)(20,Oe,2,2,"ng-template",9),r(),c(21,Be,2,0,"ng-template",12)(22,Le,2,0,"ng-template",13)(23,Fe,2,0,"ng-template",14),r()()()()()()}i&2&&(s("hideSearchBox",!0)("hideSearchDropdown",!0),p(2),s("ngIf",l.stepperState=="FINISH"),p(),s("ngIf",l.stepperState=="DOWNLOAD"),p(),s("ngIf",l.stepperState=="GUIDE"),p(),s("ngIf",l.stepperState=="DOWNLOAD"),p(5),s("selectedIndex",1),p(2),s("editable",l.stepperState!="FINISH")("completed",!0),p(3),s("editable",l.stepperState!="FINISH")("completed",!1))},dependencies:[V,G,z,K,Y,le,oe,pe,re,ae,de],styles:[`@import"https://fonts.googleapis.com/icon?family=Material+Icons";.card-header{background-color:#00000008}mat-stepper.stepper-downloadByUrl>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container{position:relative;width:60%;left:18%}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as E}from"./chunk-UUI7T7NV.js";import{g as j}from"./chunk-
|
|
1
|
+
import{a as E}from"./chunk-UUI7T7NV.js";import{g as j}from"./chunk-ZHLEQV6S.js";import{b as S,e as n}from"./chunk-SUL6ZUGT.js";import{b as s,c as g}from"./chunk-T4MH7AFK.js";import{$ as l,B as I,E as u,Ua as U,Wc as w,d as P,da as c,n as d,q as A,w as C}from"./chunk-IH2NT4RC.js";var D=(()=>{let r=class r{constructor(){this.httpService=c(n)}getAttributes(o,t){return this.httpService.get("api/product/shopee/GetAttributesTree",[{key:"ID",value:o},{key:"CategoryID",value:t}])}getCategories(o){return this.httpService.get("api/product/shopee/GetCategories",[{key:"ID",value:o}])}uploadProduct(o){return this.httpService.post("api/product/shopee/AddProduct",o).pipe(u(e=>d(null)))}generateAttribute(o){return o.map(t=>({attribute_id:t.attribute_id,attribute_value_list:t.attribute_value_list.map(e=>({value_id:e.value_id,name:e.name}))})),o}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=l({token:r,factory:r.\u0275fac,providedIn:"root"});let i=r;return i})();var R=(()=>{let r=class r{constructor(){this.httpService=c(n)}getCategories(o){return this.httpService.get("api/product/tiktok/GetCategories",[{key:"ID",value:o}])}uploadProduct(o){return this.httpService.post("api/product/tiktok/AddProduct",o).pipe(u(e=>d(null)))}generateAttribute(o){let t;return o.map(e=>(e.type=="PRODUCT_PROPERTY"?t={id:e.id,name:e.name,type:e.type,values:e.values}:t={id:e.id,name:e.values[0].id,type:e.type},t))}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=l({token:r,factory:r.\u0275fac,providedIn:"root"});let i=r;return i})();var H=(()=>{let r=class r{constructor(){this.httpService=c(n)}getAttributes(o,t){return this.httpService.get("api/product/lazada/GetAttributes",[{key:"ID",value:o},{key:"CategoryID",value:t}])}getCategories(o){return this.httpService.get("api/product/lazada/GetCategories",[{key:"ID",value:o}])}uploadProduct(o){return this.httpService.post("api/product/lazada/AddProduct",o).pipe(u(e=>d(null)))}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=l({token:r,factory:r.\u0275fac,providedIn:"root"});let i=r;return i})();var T=(()=>{let r=class r{constructor(){this.httpService=c(n)}getAttributes(o,t){return this.httpService.get("api/product/woo/GetAttributes",[{key:"ID",value:o},{key:"CategoryID",value:t}])}getCategories(o){return this.httpService.get("api/product/woo/GetCategories",[{key:"ID",value:o}])}uploadProduct(o){return this.httpService.post("api/product/woo/AddProduct",o).pipe(u(e=>d(null)))}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=l({token:r,factory:r.\u0275fac,providedIn:"root"});let i=r;return i})();var y=class{};var b=class{};var F=(()=>{let r=class r{constructor(){this.httpService=c(n)}getCategories(o){return this.httpService.get("api/product/tokopedia/GetCategories",[{key:"ID",value:o}])}uploadProduct(o){return this.httpService.post("api/product/tokopedia/AddProduct",o).pipe(u(e=>d(null)))}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=l({token:r,factory:r.\u0275fac,providedIn:"root"});let i=r;return i})();var x=(()=>{let r=class r{constructor(){this.toastrService=c(S)}showToastrUploadMultiple(o){let t=[],e=[],a=this.getResponseList(o);if(o.filter(p=>g.IsNotEmpty(p)).forEach(p=>{typeof p?.Response=="string"?e=[...e,a.length>1?this.setHtmlli(p.Response):this.setHtmlli(p.Response,!1)]:(p?.Response?.Success_list.forEach(f=>{t=[...t,a.length>1?this.setHtmlli(`
|
|
2
2
|
<div>
|
|
3
3
|
Product ${f.Name} was <div class="d-inline fw-bold">successfully</div> uploaded to ${p.Channel}
|
|
4
4
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as k,b as Ot,c as xe}from"./chunk-XGEX66UB.js";import"./chunk-HXV4FH6L.js";import{a as Se}from"./chunk-EVDAHZS7.js";import{a as Z}from"./chunk-7KG3DC5J.js";import{a as $}from"./chunk-43L7CBSZ.js";import{b as fe}from"./chunk-YXUEYLE5.js";import"./chunk-T3POIC5F.js";import"./chunk-V6PMZ6DL.js";import{a as ie,b as oe}from"./chunk-OKB4Q376.js";import{e as at}from"./chunk-TFKHUWSZ.js";import{f as ue,g as he,h as _e,i as ge,j as Ce}from"./chunk-ITTQVZJZ.js";import{a as j}from"./chunk-UUI7T7NV.js";import"./chunk-OURZMROU.js";import{a as Tt}from"./chunk-ZCPPEAJQ.js";import{a as z}from"./chunk-6JF7HXB4.js";import{b as ve}from"./chunk-AXDEQQNM.js";import{a as pe,b as de}from"./chunk-CHZBEIYE.js";import{a as re,b as ae,c as le}from"./chunk-KSTCUPYX.js";import{a as tt}from"./chunk-J7IMPJJT.js";import{a as q}from"./chunk-LIJHEC5V.js";import{a as me}from"./chunk-PW6QZKJS.js";import"./chunk-A3ZMDUMP.js";import{f as ce,g as se}from"./chunk-X54LLODL.js";import{a as rt,b as wt,d as Y,e as Yt}from"./chunk-DDUQ3IZU.js";import{g as R}from"./chunk-4RD6A3OZ.js";import{b as W,e as K}from"./chunk-SUL6ZUGT.js";import"./chunk-KCDL7SWP.js";import{b as Qt,c as Xt,d as J,h as Dt,i as te,j as ee,m as B,n as ne}from"./chunk-SG42JTLJ.js";import{t as yt,u as Mt}from"./chunk-BZ7SMYI7.js";import{P as Zt,X as qt}from"./chunk-DRY23ALE.js";import{A as It,b as Ht,c as ot,h as U,m as L}from"./chunk-VFLG2BDB.js";import{b as H,c as C}from"./chunk-T4MH7AFK.js";import{$a as s,$b as V,Ac as Kt,B as y,Cc as xt,Dc as vt,Ha as D,Hb as G,Ia as c,Ib as d,Ja as S,Jb as et,Kb as w,Mb as O,Nb as T,Ob as F,Qb as Gt,Rb as X,Sb as pt,T as ft,Uc as Pt,V as kt,Vc as Jt,Wc as it,X as Bt,Xc as bt,Za as x,Zc as zt,_b as E,aa as jt,ac as Wt,bc as nt,c as Lt,da as Vt,ga as M,ha as $t,lb as a,mb as l,nb as g,oa as m,ob as P,pa as u,pb as b,q as Rt,rb as v,ub as f,vc as N,wb as p,wc as A,zc as St}from"./chunk-IH2NT4RC.js";import"./chunk-GNOSNGXM.js";var Ne=()=>["/menu/products/download/by-url"],Pe=(()=>{let r=class r{constructor(){this.productTabs=[{Title:"Sold in Channel",Url:"/menu/products/status/sold-in-channel",Description:"SKU has been mapped between dealpos and marketplace"},{Title:"Not in POS",Url:"/menu/products/status/not-in-pos",Description:"SKU sold in Marketplace but not exist in DEALPOS"},{Title:"Not in Channel",Url:"/menu/products/status/not-in-channel",Description:"SKU has not been sold on one of channels"},{Title:"In POS",Url:"/menu/products/status/in-pos",Description:"All products which is already available in POS"},{Title:"Multiple Listing",Url:"/menu/products/status/duplicate-sku",Description:"SKU(s) which is listed more than one time (one to many)"},{Title:"Channel Statistic",Url:"/menu/products/status/channel-statistic",Description:"Product statistic from each channel obtained from the last product scan"}]}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=M({type:r,selectors:[["app-status"]],decls:13,vars:3,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-flex"],[1,"dropdown-item",3,"routerLink"]],template:function(e,i){e&1&&(a(0,"nav",0)(1,"div",1)(2,"div"),g(3,"nav-tab",2),l()(),a(4,"div")(5,"div",3)(6,"a",4),g(7,"i",5),l(),a(8,"div",6)(9,"div",7)(10,"a",8),d(11,"Download Product By Url"),l()()()()()(),g(12,"router-outlet")),e&2&&(c(3),s("Tabs",i.productTabs),c(7),s("routerLink",X(2,Ne)))},dependencies:[ie,Jt,bt]});let o=r;return o})();function ke(o,r){if(o&1&&(a(0,"mat-option",6)(1,"div"),g(2,"img",7),a(3,"span"),d(4),l()()()),o&2){let n=r.$implicit;s("value",n.ChannelID),c(2),s("src",n.logo,D),c(2),et(n.Title)}}var ct=(()=>{let r=class r{constructor(){this.dialogRef=Vt(Qt),this.channels=Vt(Xt)}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new te,this.modalConfig.title="Detach Product",this.modalConfig.okText="Save"}onClose(){this.dialogRef.close()}onSave(){let t=this.channels.find(i=>i.ChannelID===this.channelId),e={channelId:this.channelId,channelItemId:t.ChannelItemID};this.dialogRef.close(e)}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=M({type:r,selectors:[["app-modal-detach-product"]],standalone:!0,features:[Gt],decls:8,vars:4,consts:[[3,"onClose","onCancel","onOk","dynamicValidated","config"],["content",""],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"ngModelChange","ngModel"],["class","channel-option",3,"value",4,"ngFor","ngForOf"],[1,"channel-option",3,"value"],[2,"width","18px","margin-right","10px",3,"src"]],template:function(e,i){e&1&&(a(0,"modal-material",0),f("onClose",function(){return i.onClose()})("onCancel",function(){return i.onClose()})("onOk",function(){return i.onSave()}),a(1,"div",1)(2,"div")(3,"label",2),d(4,"Select a Channel"),l(),a(5,"mat-form-field",3)(6,"mat-select",4),F("ngModelChange",function(_){return T(i.channelId,_)||(i.channelId=_),_}),x(7,ke,5,3,"mat-option",5),l()()()()()),e&2&&(s("dynamicValidated",i.channelId)("config",i.modalConfig),c(6),O("ngModel",i.channelId),c(),s("ngForOf",i.channels))},dependencies:[vt,N,ee,se,ce,de,pe,qt,It,U,L,Mt]});let o=r;return o})();function Ve(o,r){if(o&1){let n=v();a(0,"button",13),f("click",function(){m(n);let e=p(2);return u(e.onOpenScanDialog())}),g(1,"i",14),d(2," Scan Channel "),l()}}function Ae(o,r){if(o&1&&(P(0),x(1,Ve,3,0,"button",12),b()),o&2){let n=p();c(),s("ngIf",!n.productService.hasSelection(n.products))}}function Ue(o,r){if(o&1){let n=v();P(0),a(1,"button",15),f("click",function(){m(n);let e=p();return u(e.onScanMultipleProduct())}),g(2,"i",14),d(3),l(),b()}if(o&2){let n,t=p();c(3),w(" Scan (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function Le(o,r){if(o&1){let n=v();P(0),a(1,"button",16),f("click",function(){m(n);let e=p();return u(e.onUploadMultipleProduct())}),g(2,"i",17),d(3),l(),b()}if(o&2){let n,t=p();c(3),w(" Upload (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function Re(o,r){if(o&1){let n=v();a(0,"div",18)(1,"app-product-card",19),f("onUpload",function(){let e=m(n).$implicit,i=p();return u(i.onUploadToMultipleChannel(e))})("onScan",function(){let e=m(n).$implicit,i=p();return u(i.onScanSingleProduct(e))})("onDescEvent",function(){let e=m(n).index,i=p();return u(i.onOpenDialogVariant(e))})("onCheckBoxChange",function(e){let i=m(n).$implicit;return u(i.selected=e)})("onDetach",function(){let e=m(n).$implicit,i=p();return u(i.onDetachProduct(e))}),l()()}if(o&2){let n=r.$implicit,t=p();c(),s("productId",n.ID)("title",n==null?null:n.Name)("image",n==null?null:n.ThumbnailUrl)("description",(n==null?null:n.Variants.length)>1?(n==null?null:n.Variants.length)+" Variants":null)("channels",t.productService.getChannelProduct(n))("code",t.getVariantCode(n==null?null:n.Variants))("showCheckBox",(n==null?null:n.Channel.length)<t.channelOptions.length)("scanButton",!0)("uploadButton",n==null?null:n.hasUpload)("imageForZoom",n==null?null:n.ImageUrl)("detachButton",(n==null||n.Channel==null?null:n.Channel.length)>0)}}function Be(o,r){o&1&&(P(0),a(1,"div",20),g(2,"app-empty-state"),l(),b())}function je(o,r){if(o&1){let n=v();P(0),a(1,"div",21)(2,"div",22)(3,"app-custom-paginator",23),f("next",function(){m(n);let e=p();return u(e.getProducts())})("previous",function(){m(n);let e=p();return u(e.getProducts())}),l()()(),b()}if(o&2){let n=p();c(3),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",!0)}}var we=(()=>{let r=class r{constructor(t,e,i,h,_,I,st){this.http=t,this.toastr=e,this.dialog=i,this.productService=h,this.authService=_,this.uploadProductService=I,this.route=st,this.searchFilter=new Z,this.products=[],this.rowCount=0,this.multipeScanChannels=[],this.getLoaderPage(),this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}getLoaderPage(){this.productService.LoadInPOS().subscribe(t=>{this.Categories=t.Options.Categories,this.searchFilter.PageNumber=t.Filter.PageNumber,this.searchFilter.RowCount=t.Filter.RowCount,this.searchFilter.ChannelID=null,this.searchFilter.Category=t.Filter.Category,this.searchFilter.PageSize=100,this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[H.Tokopedia,H.Tiktok])}getProducts(){let t={PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Category:this.searchFilter.Category,From:this.startDate,To:this.endDate};this.http.post("/api/product/GetInPOS",t).subscribe(e=>{this.products=e.Data,this.rowCount=e.Total==null?this.searchFilter.RowCount:e.Total.toString(),this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions)})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=C.GuidEMpty,this.dialog.open(k,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>C.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.Async,this.scanAllProduct()})}scanAllProduct(){if(this.searchFilter.ChannelID==null){this.toastr.error("Please Select Channel","Error");return}this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(t=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{this.getLoaderPage();let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,e,!this.searchFilter.UpdatedProduct)}})}onOpenDialogVariant(t){this.dialog.open(Ot,{data:{title:this.products[t].Name,variants:this.products[t].Variants},width:"800px"})}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.uploadProductService.setSelectedProduct(t),this.route.navigate(["/menu/products/upload"])}onUploadToMultipleChannel(t){this.uploadProductService.setSelectedProduct([t]),this.route.navigate(["/menu/products/upload"])}searchProduct(t){this.searchFilter.text=t,this.getProducts()}onScanMultipleProduct(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=C.GuidEMpty;let e=this.productService.filterChannelByTypeId(this.channelOptions,[H.Tokopedia,H.Tiktok]);this.dialog.open(k,{data:{filter:t,channelOptions:e,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(h=>C.IsNotEmpty(h))).subscribe(h=>{this.searchFilter.ChannelID=h.ChannelID,this.searchFilter.ScanFull=h.ScanFull,this.searchFilter.UpdatedProduct=h.UpdatedProduct;let _=this.productService.selectedProduct(this.products),I=this.productService.getVariantCodesProducts(_);this.scanSingleProduct(I)})}onScanSingleProduct(t){let e=JSON.parse(JSON.stringify(this.searchFilter));e.ChannelID=C.GuidEMpty,this.dialog.open(k,{data:{filter:e,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>C.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID;let h=this.productService.getVariantCodesProduct(t);this.scanSingleProduct(h)})}scanSingleProduct(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:e=>{if(e)this.toastr.success("Successfully Scan ","Success");else{let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${i?.Name} `,"Error")}this.searchFilter.ChannelID=C.GuidEMpty,e&&this.getProducts()},error:e=>{this.searchFilter.ChannelID=C.GuidEMpty}})}getVariantCode(t){let e;return t.length>1&&(e=(t[0].model?t[0].model:"")+t[0].Code),t.length==1&&(e=t[0].Code),e}onDetachProduct(t){t.Channel=C.assignChannelLogo(t.Channel),this.dialog.open(ct,{width:"600px",data:t.Channel}).afterClosed().pipe(y(e=>C.IsNotEmpty(e)),ft(e=>this.productService.detachProduct(e.channelId,e.channelItemId))).subscribe(e=>{this.toastr.success(e.Message,Dt.Success),this.getProducts()})}};r.\u0275fac=function(e){return new(e||r)(S(K),S(W),S(J),S(j),S(R),S(at),S(it))},r.\u0275cmp=M({type:r,selectors:[["app-in-pos"]],decls:22,vars:13,consts:[["picker",""],["description","All products which is already available in POS",3,"onSubmit","headerTitle"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","Name","bindValue","Name","placeholder","Select Category",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[1,"mt-5"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["type","button","data-cy","scanSoldinChannel","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onUpload","onScan","onDescEvent","onCheckBoxChange","onDetach","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","detachButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(e,i){if(e&1){let h=v();a(0,"mainpanel",1),f("onSubmit",function(I){return m(h),u(i.searchProduct(I))}),a(1,"actions"),x(2,Ae,2,1,"ng-container",2)(3,Ue,4,1,"ng-container",2)(4,Le,4,1,"ng-container",2),l(),a(5,"filters")(6,"div")(7,"label",3),d(8,"Category"),l(),a(9,"ng-select",4),f("ngModelChange",function(I){return m(h),u(i.searchFilter.Category=I)}),l()(),a(10,"div",5)(11,"mat-date-range-input",6)(12,"input",7),F("ngModelChange",function(I){return m(h),T(i.startDate,I)||(i.startDate=I),u(I)}),f("click",function(){m(h);let I=G(15);return u(I.open())}),l(),a(13,"input",8),F("ngModelChange",function(I){return m(h),T(i.endDate,I)||(i.endDate=I),u(I)}),f("click",function(){m(h);let I=G(15);return u(I.open())}),l()(),g(14,"mat-date-range-picker",null,0),l()(),a(16,"content")(17,"div",9)(18,"div",10),x(19,Re,2,11,"div",11)(20,Be,3,0,"ng-container",2),l(),x(21,je,4,4,"ng-container",2),l()()()}if(e&2){let h=G(15);s("headerTitle","In POS ("+i.rowCount+")"),c(2),s("ngIf",!i.productService.hasSelection(i.products)),c(),s("ngIf",i.productService.hasSelection(i.products)&&i.multipeScanChannels.length>0),c(),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("items",i.Categories)("ngModel",i.searchFilter.Category),c(2),s("rangePicker",h),c(),O("ngModel",i.startDate),c(),O("ngModel",i.endDate),c(6),s("ngForOf",i.products),c(),s("ngIf",i.products.length==0),c(),s("ngIf",i.products.length>0)}},dependencies:[N,A,ot,U,L,B,Y,z,q,$,_e,ue,he,ge],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.img-logo[_ngcontent-%COMP%]{height:24px;width:24px}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}"]});let o=r;return o})();function $e(o,r){if(o&1){let n=v();P(0),a(1,"button",10),f("click",function(){m(n);let e=p();return u(e.onOpenScanDialog())}),g(2,"i",11),d(3," Scan Channel "),l(),b()}}function Ge(o,r){if(o&1){let n=v();P(0),a(1,"button",12),f("click",function(){m(n);let e=p();return u(e.onScanMultipleProduct())}),g(2,"i",11),d(3),l(),b()}if(o&2){let n=p();c(3),w(" Scan (",n.productService.selectedProduct(n.products).length,") ")}}function We(o,r){if(o&1){let n=v();P(0),a(1,"button",13),f("click",function(){m(n);let e=p();return u(e.onUploadMultipleProduct())}),g(2,"i",14),d(3),l(),b()}if(o&2){let n=p();c(3),w(" Upload (",n.productService.selectedProduct(n.products).length,") ")}}function Ke(o,r){if(o&1&&(a(0,"span",15),g(1,"img",16),l(),d(2)),o&2){let n=r.item;c(),s("src",n.Img,D)("alt",n.Name),c(),w(" ",n.Name," ")}}function Je(o,r){if(o&1){let n=v();a(0,"div",17)(1,"label",18),d(2,"Item ID"),l(),a(3,"input",19),F("ngModelChange",function(e){m(n);let i=p();return T(i.searchFilter.Item_id,e)||(i.searchFilter.Item_id=e),u(e)}),l()()}if(o&2){let n=p();c(3),O("ngModel",n.searchFilter.Item_id)}}function ze(o,r){if(o&1){let n=v();a(0,"div",20)(1,"app-product-card",21),f("onUpload",function(){let e=m(n).$implicit,i=p();return u(i.onUploadToMultipleChannel(e))})("onDescEvent",function(){let e=m(n).index,i=p();return u(i.onOpenVariantDetail(e))})("onScan",function(){let e=m(n).$implicit,i=p();return u(i.onScanSingleProduct(e))})("onCheckBoxChange",function(e){let i=m(n).$implicit;return u(i.selected=e)})("onDetach",function(){let e=m(n).$implicit,i=p();return u(i.onDetachProduct(e))}),l()()}if(o&2){let n=r.$implicit,t=p();c(),s("productId",n==null?null:n.ID)("title",n==null?null:n.Name)("image",n==null?null:n.ThumbnailUrl)("description",(n==null||n.Variants==null?null:n.Variants.length)>1?(n==null||n.Variants==null?null:n.Variants.length)+" Variants":null)("channels",t.productService.getChannelProduct(n))("code",t.getVariantCode(n==null?null:n.Variants))("showCheckBox",n==null?null:n.hasScan)("scanButton",!0)("uploadButton",n==null?null:n.hasUpload)("imageForZoom",n==null?null:n.ImageUrl)("detachButton",(n==null||n.Channel==null?null:n.Channel.length)>0)}}function He(o,r){o&1&&(P(0),a(1,"div",22),g(2,"app-empty-state"),l(),b())}function Ye(o,r){if(o&1){let n=v();a(0,"div",23)(1,"div",24)(2,"app-custom-paginator",25),f("total",function(){m(n);let e=p();return u(e.getRowCount())})("next",function(){m(n);let e=p();return u(e.getProducts())})("previous",function(){m(n);let e=p();return u(e.getProducts())}),l()()()}if(o&2){let n=p();c(2),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}var ye=(()=>{let r=class r{constructor(t,e,i,h,_,I,st,Ct){this.http=t,this.dialog=e,this.toastr=i,this.productService=h,this.activateRouter=_,this.authService=I,this.route=st,this.uploadProductService=Ct,this.searchFilter=new Z,this.products=[],this.rowCount=0,this.hasClickRowCount=!1,this.guidEmpty=C.GuidEMpty,this.multipeScanChannels=[],this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(C.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(e=>{this.searchFilter=e.Filter,e.Filter.ChannelID!=C.GuidEMpty&&(this.searchFilter.ListChannelID=[],this.searchFilter.ListChannelID.push(e.Filter.ChannelID)),this.searchFilter.PageSize=e.Filter.RowCount,this.searchFilter.Item_id="",this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[H.Tokopedia,H.Tiktok])}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Item_id:this.searchFilter.Item_id};this.productService.findAllSoldInChannel(t).subscribe(e=>{this.products=e.Data,this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions),this.products=this.productService.checkProductHasScanButton(this.products,this.channelOptions)})}searchProduct(t){this.searchFilter.text=t,this.hasClickRowCount=!1,this.getProducts()}onOpenVariantDetail(t){let e=this.products[t].Variants;this.dialog.open(Ot,{data:{variants:e,title:this.products[t].Name},width:"800px"})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=C.GuidEMpty,this.dialog.open(k,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>C.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.Async,this.scanAllProduct()})}scanAllProduct(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).pipe(y(e=>e)).subscribe(e=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(e,t,!this.searchFilter.UpdatedProduct),this.initPageLoader(C.GuidEMpty))})}onScanSingleProduct(t){t.Channel=this.productService.getChannelProduct(t);let e=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(k,{data:{filter:e,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>C.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID;let h=this.productService.getVariantCodesProduct(t);this.scanProducts(h)})}onUploadToMultipleChannel(t){this.uploadProductService.setSelectedProduct([t]),this.route.navigate(["/menu/products/upload"])}onScanMultipleProduct(){this.searchFilter.ChannelID=C.GuidEMpty;let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(k,{data:{filter:t,channelOptions:this.multipeScanChannels,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>C.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct;let h=this.productService.selectedProduct(this.products),_=this.productService.getVariantCodesProducts(h);this.scanProducts(_)})}scanProducts(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:e=>{let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);e?this.toastr.success(`Product Successfully scan with ${i?.Name}`,"Success"):this.toastr.error(`This product is not existed in ${i?.Name} `,"Error"),this.searchFilter.ChannelID=C.GuidEMpty,e&&this.getProducts()},error:e=>{this.searchFilter.ChannelID=C.GuidEMpty}})}getVariantCode(t){let e;return t.length>1&&(e=(t[0].model?t[0].model:"")+t[0].Code),t.length==1&&(e=t[0].Code),e}onClearFilterChannel(){this.searchFilter.ChannelID=C.GuidEMpty,this.searchFilter.Item_id=""}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.uploadProductService.setSelectedProduct(t),this.route.navigate(["/menu/products/upload"])}getRowCount(){let t={ListChannelID:this.searchFilter.ListChannelID,text:this.searchFilter.text};this.http.post("/api/product/GetSoldInChannelRowCount",t).subscribe(e=>{this.hasClickRowCount=!0,this.rowCount=e.Total})}onDetachProduct(t){t.Channel=C.assignChannelLogo(t.Channel),this.dialog.open(ct,{width:"600px",data:t.Channel}).afterClosed().pipe(y(e=>C.IsNotEmpty(e)),ft(e=>this.productService.detachProduct(e.channelId,e.channelItemId))).subscribe(e=>{this.toastr.success(e.Message,Dt.Success),this.getProducts()})}};r.\u0275fac=function(e){return new(e||r)(S(K),S(J),S(W),S(j),S(Pt),S(R),S(it),S(at))},r.\u0275cmp=M({type:r,selectors:[["app-sold-in-channel"]],decls:18,vars:12,consts:[["description","SKU has been mapped between dealpos and marketplace",3,"onSubmit","headerTitle"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clear","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],["class","mt-5",4,"ngIf"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"mt-5"],[1,"fw-bold"],["type","text","name","Item_id","id","Item_id",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onUpload","onDescEvent","onScan","onCheckBoxChange","onDetach","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","detachButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(e,i){e&1&&(a(0,"mainpanel",0),f("onSubmit",function(_){return i.searchProduct(_)}),a(1,"actions"),x(2,$e,4,0,"ng-container",1)(3,Ge,4,1,"ng-container",1)(4,We,4,1,"ng-container",1),l(),a(5,"filters")(6,"div")(7,"label",2),d(8,"Channel"),l(),a(9,"ng-select",3),f("ngModelChange",function(_){return i.searchFilter.ListChannelID=_})("clear",function(){return i.onClearFilterChannel()}),x(10,Ke,3,3,"ng-template",4),l()(),x(11,Je,4,1,"div",5),l(),a(12,"content")(13,"div",6)(14,"div",7),x(15,ze,2,11,"div",8)(16,He,3,0,"ng-container",1),l(),x(17,Ye,3,4,"div",9),l()()()),e&2&&(s("headerTitle","Sold in Channel"),c(2),s("ngIf",!i.productService.hasSelection(i.products)),c(),s("ngIf",i.multipeScanChannels.length>0&&i.productService.hasSelection(i.products)),c(),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("multiple",!0)("items",i.channelOptions)("ngModel",i.searchFilter.ListChannelID),c(2),s("ngIf",i.searchFilter.ListChannelID!=null),c(4),s("ngForOf",i.products),c(),s("ngIf",i.products.length==0),c(),s("ngIf",i.products==null?null:i.products.length))},dependencies:[N,A,ot,U,L,B,Y,rt,wt,z,q,$],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]});let o=r;return o})();function qe(o,r){if(o&1){let n=v();a(0,"button",13),f("click",function(){m(n);let e=p(2);return u(e.uploadMultipleProduct())}),g(1,"i",14),d(2),l()}if(o&2){let n=p(2);c(2),w(" upload (",n.selectedProducts==null?null:n.selectedProducts.length,") ")}}function Qe(o,r){if(o&1){let n=v();P(0),a(1,"td",29)(2,"input",30),F("ngModelChange",function(e){m(n);let i=p(2).$implicit;return T(i.selected,e)||(i.selected=e),u(e)}),f("ngModelChange",function(){m(n);let e=p(3).ngIf,i=p(3);return u(i.onSelectProduct(e))}),l()(),b()}if(o&2){let n=p(2).$implicit;c(),s("rowSpan",n==null?null:n.Variants.length),c(),O("ngModel",n.selected)}}function Xe(o,r){if(o&1){let n=v();P(0),a(1,"img",35),f("click",function(e){m(n);let i=p(3).$implicit,h=p(4);return u(h.onZoomImage(e,i==null?null:i.ImageUrl))}),l(),b()}if(o&2){let n=p(3).$implicit;c(),s("src",n==null?null:n.ImageUrl,D)}}function tn(o,r){o&1&&g(0,"img",36)}function en(o,r){if(o&1&&(P(0),a(1,"td",29)(2,"div",31),x(3,Xe,2,1,"ng-container",11)(4,tn,1,0,"ng-template",null,1,nt),l()(),a(6,"td",32)(7,"h4",33)(8,"span",34),d(9),l()()(),b()),o&2){let n=G(5),t=p(2).$implicit;c(),s("rowSpan",t==null?null:t.Variants.length),c(2),s("ngIf",t==null?null:t.ImageUrl)("ngIfElse",n),c(3),s("rowSpan",t==null?null:t.Variants.length),c(2),s("matTooltip",(t==null||t.Name==null?null:t.Name.length)>50?t==null?null:t.Name:""),c(),w(" ",t==null?null:t.Name," ")}}function nn(o,r){if(o&1&&(a(0,"div")(1,"a",25),g(2,"img",37),l()()),o&2){let n=r.$implicit;c(),s("href",n.URL,D),c(),s("src",n.Img,D)("matTooltip",n.Name)}}function on(o,r){if(o&1&&(a(0,"div"),g(1,"img",37),l()),o&2){let n=r.$implicit;c(),s("src",n.Img,D)("matTooltip",n.Name)}}function rn(o,r){if(o&1&&(a(0,"tr"),x(1,Qe,3,2,"ng-container",12)(2,en,10,6,"ng-container",12),a(3,"td"),d(4),l(),a(5,"td")(6,"span"),d(7),l(),a(8,"span",24)(9,"a",25),g(10,"i",26),l()()(),a(11,"td",27)(12,"div",28),x(13,nn,3,3,"div",23),l()(),a(14,"td",27)(15,"div",28),x(16,on,2,2,"div",23),l()()()),o&2){let n=r.$implicit,t=r.index,e=p(5);c(),s("ngIf",t==0),c(),s("ngIf",t==0),c(2),w(" ",n.Name," "),c(3),w(" ",n.Code," "),c(2),s("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),D),c(4),s("ngForOf",n==null?null:n.Available),c(3),s("ngForOf",n==null?null:n.NotAvailable)}}function an(o,r){if(o&1&&(P(0),x(1,rn,17,7,"tr",23),b()),o&2){let n=r.$implicit;c(),s("ngForOf",n.Variants)}}function ln(o,r){if(o&1&&(a(0,"tbody"),x(1,an,2,1,"ng-container",23),l()),o&2){let n=r.ngIf;c(),s("ngForOf",n)}}function cn(o,r){if(o&1&&(P(0),a(1,"div",15)(2,"table",16)(3,"thead",17)(4,"tr"),g(5,"th",18),a(6,"th",19),d(7,"Product"),l(),a(8,"th",20),d(9,"Variant"),l(),a(10,"th",20),d(11,"SKU"),l(),a(12,"th",21),d(13,"Available In"),l(),a(14,"th",22),d(15,"Not Available In"),l()()(),x(16,ln,2,1,"tbody",12),E(17,"async"),l()(),b()),o&2){let n=p(2);c(16),s("ngIf",V(17,1,n.data$))}}function sn(o,r){o&1&&(a(0,"div",38),g(1,"app-empty-state"),l())}function pn(o,r){if(o&1){let n=v();a(0,"span",46),f("click",function(){m(n);let e=p(4);return u(e.getRowCount())}),a(1,"i",47),d(2,"?"),l()()}}function dn(o,r){if(o&1&&(a(0,"span"),d(1),E(2,"number"),l()),o&2){let n=r.ngIf;c(),et(V(2,1,n==null?null:n.Count))}}function mn(o,r){if(o&1){let n=v();a(0,"a",48),f("click",function(){m(n);let e=p(4);return u(e.onNextPage())}),g(1,"i",49),d(2," Next"),l()}}function un(o,r){if(o&1){let n=v();a(0,"a",50),f("click",function(){m(n);let e=p(4);return u(e.onLastPage())}),g(1,"i",51),d(2," Last"),l()}}function hn(o,r){if(o&1&&(P(0),a(1,"div",39)(2,"div",40)(3,"div",41),d(4),E(5,"number"),x(6,pn,3,0,"span",42)(7,dn,3,3,"span",12),E(8,"async"),d(9),l()(),a(10,"div",43),x(11,mn,3,0,"a",44)(12,un,3,0,"a",45),l()(),b()),o&2){let n=p().ngIf,t=p(2);c(4),w(" Showing 1 - ",V(5,6,n==null?null:n.length)," of "),c(2),s("ngIf",t.paginationService.hideCount),c(),s("ngIf",!t.paginationService.hideCount&&V(8,8,t.rowCount$)),c(2),w(" records ~ ",t.paginationService.footerPageNumber," Page "),c(2),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),c(),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}function _n(o,r){if(o&1&&(P(0),x(1,hn,13,10,"ng-container",12),b()),o&2){let n=r.ngIf;c(),s("ngIf",(n==null?null:n.length)>0)}}function gn(o,r){if(o&1){let n=v();a(0,"mainpanel",3),f("onSubmit",function(e){m(n);let i=p();return u(i.searchProduct(e))}),a(1,"actions"),x(2,qe,3,1,"button",4),a(3,"button",5),f("click",function(){m(n);let e=p();return u(e.openScanDialog())}),g(4,"i",6),d(5," Scan Channel "),l(),a(6,"button",7),f("click",function(){m(n);let e=p();return u(e.openExportDialog())}),g(7,"i",8),a(8,"span"),d(9,"Export"),l()()(),a(10,"content")(11,"div",9)(12,"div",10),x(13,cn,18,3,"ng-container",11),E(14,"async"),x(15,sn,2,0,"ng-template",null,0,nt),l(),x(17,_n,2,1,"ng-container",12),E(18,"async"),l()()()}if(o&2){let n,t=G(16),e=p();s("hideSearchDropdown",!0),c(2),s("ngIf",e.hasSelectionProduct),c(11),s("ngIf",((n=V(14,5,e.data$))==null?null:n.length)>0)("ngIfElse",t),c(4),s("ngIf",V(18,7,e.data$))}}var Me=(()=>{let r=class r{constructor(t,e,i,h,_,I,st,Ct,Ee){this.http=t,this.dialog=e,this.toastr=i,this.route=h,this.productService=_,this.paginationService=I,this.biggerPictureService=st,this.authService=Ct,this.uploadProductService=Ee,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannelV2",this.hasSelectionProduct=!1,this.selectedProducts=[],this.channelOptions=Ct.getChannels(),this.hostName=this.authService.getDomain()}ngOnInit(){this.initPageLoader(),this.iniData()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.notChannelAPI,this.loader$=this.http.post(`api/${this.loaderAPI}`,{}).pipe(Bt(t=>{this.filterSearch=t.Filter,this.paginationService.reloadPagination(t.Filter)}))}iniData(){this.data$=this.paginationService.data$.pipe(Rt(t=>(t=t.map(e=>(e.Variants=e.Variants.map(i=>(i.Available=this.productService.sortChannel(i.Available),i.NotAvailable=this.productService.sortChannel(i.NotAvailable),i.Available=this.assignLogoChannel(i.Available),i.NotAvailable=this.assignLogoChannel(i.NotAvailable),i)),e.Channel=e?.Variants[0]?.Available,e)),t)))}assignLogoChannel(t){return t=t.map(e=>(e.Img=C.getChannelLogoByTypeId(e.TypeID),e)),t}searchProduct(t){this.filterSearch.text=t,this.paginationService.reloadPagination(this.filterSearch)}scanAllProduct(){let t=this.productService.findChannelById(this.filterSearch.ChannelID,this.channelOptions);this.productService.scanAll(this.filterSearch.ChannelID,this.filterSearch.ScanFull,this.filterSearch.UpdatedProduct,this.filterSearch.Async).subscribe(e=>{this.filterSearch.Async?this.toastr.success("You will be notified when the scan is completed.","Scan Asynchronous"):(this.productService.successToastrScanAllProduct(e,t,!this.filterSearch.UpdatedProduct),this.initPageLoader())})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.filterSearch));t.ChannelID=C.GuidEMpty,this.dialog.open(k,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>C.IsNotEmpty(i))).subscribe(i=>{this.filterSearch.ChannelID=i.ChannelID,this.filterSearch.ScanFull=i.ScanFull,this.filterSearch.UpdatedProduct=i.UpdatedProduct,this.filterSearch.Async=i.Async,this.scanAllProduct()})}getRowCount(){this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`/api/${this.rowCountAPI}`,this.filterSearch)}onNextPage(){this.paginationService.onNextPage(this.filterSearch)}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:t=>{this.filterSearch.PageNumber=1,this.paginationService.getAllData(this.filterSearch,t.Count)}})}onZoomImage(t,e){this.biggerPictureService.openBiggerPicture(t,e)}onSelectProduct(t){this.hasSelectionProduct=this.productService.hasSelection(t),this.selectedProducts=this.productService.selectedProduct(t)}uploadMultipleProduct(){this.uploadProductService.setSelectedProduct(this.selectedProducts),this.route.navigate(["/menu/products/upload"])}ngOnDestroy(){this.paginationService.destroy()}openExportDialog(){this.dialog.open(fe,{data:{title:"Export Not In Channel",pageNumber:this.filterSearch.PageNumber,rowCount:this.filterSearch.RowCount,filterExport:this.filterSearch,getRowCountApi:"product/GetNotInChannelRowCount",exportApi:"product/GetNotInChannelExport"}}).afterClosed().subscribe()}};r.\u0275fac=function(e){return new(e||r)(S(K),S(J),S(W),S(it),S(j),S(Se),S(me),S(R),S(at))},r.\u0275cmp=M({type:r,selectors:[["app-not-in-channel"]],decls:2,vars:3,consts:[["EMPTY",""],["elsePic",""],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"hideSearchDropdown","onSubmit",4,"ngIf"],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"onSubmit","hideSearchDropdown"],["class","btn btn-light shadow rounded ms-2",3,"click",4,"ngIf"],["data-cy","scanNotinChannel","type","button",1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[4,"ngIf","ngIfElse"],[4,"ngIf"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-md-12"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[2,"width","10px"],["colspan","2",1,"ms-5","text-center",2,"width","450px"],[2,"width","150px"],[2,"width","20%"],[2,"width","16%"],[4,"ngFor","ngForOf"],[1,"ms-1"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"padding-left","0px"],[1,"d-flex","flex-wrap","mb-1"],[1,"text-center",3,"rowSpan"],["type","checkbox",3,"ngModelChange","ngModel"],[2,"padding-right","0px"],[1,"text-start",3,"rowSpan"],[1,"ms-5","fw-normal","text-ellipsis",2,"max-width","26vw !important"],[3,"matTooltip"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],["alt","",1,"channel-logo","cursor-pointer","ms-4","mt-3",3,"src","matTooltip"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(e,i){e&1&&(x(0,gn,19,9,"mainpanel",2),E(1,"async")),e&2&&s("ngIf",V(1,1,i.loader$))},dependencies:[N,A,Ht,U,L,B,yt,$,St,xt],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}thead[_ngcontent-%COMP%]{position:sticky;top:0}.channel-logo[_ngcontent-%COMP%]{width:20px}.w-img[_ngcontent-%COMP%]{width:100%}"]});let o=r;return o})();var Cn=o=>[o],fn=()=>[];function Sn(o,r){if(o&1){let n=v();a(0,"button",15),f("click",function(){m(n);let e=p();return u(e.openScanDialog())}),g(1,"i",16),d(2," Scan Channel "),l()}}function xn(o,r){if(o&1){let n=v();P(0),a(1,"button",17),f("click",function(){m(n);let e=p();return u(e.onDownloadAllProduct("SELECTED"))}),g(2,"i",18),d(3),l(),b()}if(o&2){let n,t=p();c(3),w(" Download (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function vn(o,r){if(o&1&&(a(0,"span",19),g(1,"img",20),l(),d(2)),o&2){let n=r.item;c(),s("src",n.Img,D)("alt",n.Name),c(),w(" ",n.Name," ")}}function Pn(o,r){if(o&1){let n=v();a(0,"div",21)(1,"app-product-card",22),f("onCheckBoxChange",function(e){let i=m(n).index,h=p();return u(h.onSelectProduct(e,i))})("onDescEvent",function(){let e=m(n).index,i=p();return u(i.onShowVariantDetail(e))})("onDownload",function(){let e=m(n).$implicit,i=p();return u(i.onDownloadProduct(e))})("onScan",function(){let e=m(n).$implicit,i=p();return u(i.onScanChannel(e))}),l()()}if(o&2){let n=r.$implicit;c(),s("showRedirectIcon",!1)("title",n==null?null:n.Name)("image",n==null?null:n.Image)("imageForZoom",n==null?null:n.Image)("code",n==null?null:n.SKU)("description",(n==null||n.Variant==null?null:n.Variant.length)>0?(n==null||n.Variant==null?null:n.Variant.length)+" Variants":null)("downloadButton",!0)("channels",n!=null&&n.Channel?pt(10,Cn,n==null?null:n.Channel):X(12,fn))("showCheckBox",!0)("scanButton",!0)}}function bn(o,r){o&1&&(P(0),a(1,"div",23),g(2,"app-empty-state"),l(),b())}function In(o,r){if(o&1){let n=v();a(0,"div",24)(1,"div",25)(2,"app-custom-paginator",26),f("total",function(){m(n);let e=p();return u(e.getRowCount())})("next",function(){m(n);let e=p();return u(e.getProducts())})("previous",function(){m(n);let e=p();return u(e.getProducts())}),l()()()}if(o&2){let n=p();c(2),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}var De=(()=>{let r=class r{constructor(t,e,i,h,_,I){this.http=t,this.dialog=e,this.productService=i,this.toastrService=h,this.activateRouter=_,this.authService=I,this.searchFilter=new Z,this.products=[],this.hasClickRowCount=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(C.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(e=>{this.searchFilter=e.Filter,this.searchFilter.PageSize=e.Filter.RowCount,this.getProducts()})}getProducts(){this.http.post("/api/product/GetProductChannelNotPOS",this.searchFilter).subscribe(t=>{this.products=t.Data,this.mapChannelToProduct(),this.setSkuProduct()})}mapChannelToProduct(){let t;this.products=this.products.map(e=>(t=this.channelOptions.find(i=>i.ID==e.ChannelID),t?e.Channel=JSON.parse(JSON.stringify(t)):e.Channel=null,e)).map(e=>(e.Channel&&(e.Channel.Url=e.Url),e))}setSkuProduct(){this.products=this.products.map(t=>(t?.Variant?.length==0?C.IsNotEmpty(t?.ChannelItemSKU)?t.SKU=t?.ChannelItemSKU:t.SKU="SKU not assigned":t.SKU=t?.Variant[0]?.ChannelVariationSKU?t?.Variant[0]?.ChannelVariationSKU:"SKU not assigned",t))}onSearch(t){this.searchFilter.text=t,this.hasClickRowCount=!1,this.getProducts()}onClearChannelFilter(){this.searchFilter.ChannelID=C.GuidEMpty}onScanAll(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(e=>{this.searchFilter.Async?this.toastrService.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.initPageLoader(C.GuidEMpty),this.productService.successToastrScanAllProduct(e,t,!this.searchFilter.UpdatedProduct)),this.searchFilter.ChannelID=C.GuidEMpty})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=C.GuidEMpty,this.dialog.open(k,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>C.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.Async=i.Async,this.onScanAll()})}onDownloadAllProduct(t){let e;t=="ALL"?e=this.products:e=this.productService.selectedProduct(this.products),e.length>0&&this.productService.downloadMultipleProduct(e).subscribe({next:()=>{this.getProducts()}})}onSelectProduct(t,e){this.products[e].selected=t}onDownloadProduct(t){confirm(`Are you sure you want to Retrieve product ${t?.Name} from ${t?.Channel.Name} to POS?`)&&this.productService.downloadProduct(t).subscribe({next:()=>{this.getProducts()}})}onScanChannel(t){let e=JSON.parse(JSON.stringify(t));delete e.Channel,this.productService.scanCompareToPos([e]).subscribe(i=>{i.Status?(this.initPageLoader(C.GuidEMpty),this.toastrService.success(`product ${t.Name} have been successfully scanned and synchronized with POS`,"Success")):this.toastrService.error(`Product ${t.Name} is not existed in POS`,"Error")})}onShowVariantDetail(t){let e=this.products[t].Variant;e.length>0&&this.dialog.open(xe,{data:{title:this.products[t].Name,variants:e},width:"30%"})}getRowCount(){let t={ChannelID:this.searchFilter.ChannelID,text:this.searchFilter.text,HaveSku:parseInt(this.searchFilter.HaveSku)};this.http.post("/api/product/GetProductChannelNotPOSRowCount",t).subscribe(e=>{this.hasClickRowCount=!0,this.rowCount=e.Count})}};r.\u0275fac=function(e){return new(e||r)(S(K),S(J),S(j),S(W),S(Pt),S(R))},r.\u0275cmp=M({type:r,selectors:[["app-not-in-pos"]],decls:30,vars:13,consts:[["headerTitle","Not in POS","textButton","Search","description","SKU sold in Marketplace but not exist in DEALPOS",3,"onSubmit"],["type","button","data-cy","scanNotInPos","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],[4,"ngIf"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp",""],[1,"mt-5"],[1,"fw-bold"],["name","haveSKU",1,"form-control","h-100","pt-3","rounded","mt-2",3,"ngModelChange","ngModel"],[1,"me-5",3,"value"],["type","text","name","Item_id","id","Item_id","placeholder","item id",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button","data-cy","scanNotInPos",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","ms-3",3,"click"],[1,"fa","fa-download"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onCheckBoxChange","onDescEvent","onDownload","onScan","showRedirectIcon","title","image","imageForZoom","code","description","downloadButton","channels","showCheckBox","scanButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(e,i){e&1&&(a(0,"mainpanel",0),f("onSubmit",function(_){return i.onSearch(_)}),a(1,"actions"),x(2,Sn,3,0,"button",1)(3,xn,4,1,"ng-container",2),l(),a(4,"filters")(5,"div")(6,"label",3),d(7,"Channel"),l(),a(8,"ng-select",4),F("ngModelChange",function(_){return T(i.searchFilter.ChannelID,_)||(i.searchFilter.ChannelID=_),_}),x(9,vn,3,3,"ng-template",5),l()(),a(10,"div",6)(11,"label",7),d(12,"SKU Assigned"),l(),a(13,"mat-radio-group",8),F("ngModelChange",function(_){return T(i.searchFilter.HaveSku,_)||(i.searchFilter.HaveSku=_),_}),a(14,"mat-radio-button",9),d(15," All "),l(),a(16,"mat-radio-button",9),d(17," Yes "),l(),a(18,"mat-radio-button",9),d(19," No "),l()()(),a(20,"div",6)(21,"label",7),d(22,"Item ID"),l(),a(23,"input",10),F("ngModelChange",function(_){return T(i.searchFilter.Item_id,_)||(i.searchFilter.Item_id=_),_}),l()()(),a(24,"content")(25,"div",11)(26,"div",12),x(27,Pn,2,13,"div",13)(28,bn,3,0,"ng-container",2),l(),x(29,In,3,4,"div",14),l()()()),e&2&&(c(2),s("ngIf",!i.productService.hasSelection(i.products)),c(),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("items",i.channelOptions),O("ngModel",i.searchFilter.ChannelID),c(5),O("ngModel",i.searchFilter.HaveSku),c(),s("value",0),c(2),s("value",1),c(2),s("value",2),c(5),O("ngModel",i.searchFilter.Item_id),c(4),s("ngForOf",i.products),c(),s("ngIf",i.products.length==0),c(),s("ngIf",(i.products==null?null:i.products.length)>0))},dependencies:[N,A,ot,U,L,B,Y,rt,re,ae,z,q,$],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.itemTitle[_ngcontent-%COMP%]{cursor:pointer}"]});let o=r;return o})();function wn(o,r){if(o&1&&(a(0,"span",9),g(1,"img",10),l(),d(2)),o&2){let n=r.item,t=p();c(),s("src",t.getChannelLogo(n.TypeID),D),c(),w(" ",n.Name," ")}}function yn(o,r){if(o&1&&(a(0,"div",11),g(1,"app-duplicate-product-card",12),l()),o&2){let n=r.$implicit,t=r.index;c(),s("imageForZoom",n.ImageUrl)("title",n.Name)("code",n.Code)("id",t)("image",n.ThumbnailURL)("channels",n.Channels)}}function Mn(o,r){o&1&&(P(0),a(1,"div",13),g(2,"app-empty-state"),l(),b())}function Dn(o,r){if(o&1){let n=v();P(0),a(1,"div",14)(2,"div",15)(3,"app-custom-paginator",16),f("next",function(){m(n);let e=p();return u(e.getProducts())})("previous",function(){m(n);let e=p();return u(e.getProducts())})("total",function(){m(n);let e=p();return u(e.getRowCount())}),l()()(),b()}if(o&2){let n=p();c(3),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickedRowCount)}}var Oe=(()=>{let r=class r{constructor(t,e,i){this.httpService=t,this.productService=e,this.authService=i,this.searchFilter=new Z,this.products=[],this.hasClickedRowCount=!1,this.getPageLoader(),this.channelOptions=i.getChannels()}getPageLoader(){this.productService.loader().subscribe(t=>{this.searchFilter=t.Filter,this.searchFilter.PageSize=t.Filter.RowCount,this.getProducts()})}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,RowCount:this.searchFilter.RowCount,PageNumber:this.searchFilter.PageNumber,text:this.searchFilter.text};this.httpService.post("/api/product/GetDuplicateInChannel",t).subscribe(e=>{this.products=e.Data})}onSearch(t){this.searchFilter.text=t,this.hasClickedRowCount=!1,this.getProducts()}onClearFilter(){this.searchFilter.ChannelID=C.GuidEMpty}getChannelLogo(t){return C.getChannelLogoByTypeId(t)}getRowCount(){let t={text:this.searchFilter.text,ChannelID:this.searchFilter.ChannelID};this.httpService.post("/api/product/GetDuplicateInChannelRowCount",t).subscribe(e=>{this.hasClickedRowCount=!0,this.rowCount=e.Total})}};r.\u0275fac=function(e){return new(e||r)(S(K),S(j),S(R))},r.\u0275cmp=M({type:r,selectors:[["app-duplicate-sku"]],decls:14,vars:7,consts:[["headerTitle","Multiple Listing","textButton"," Search","description","SKU(s) which is listed more than one time (one to many)",3,"onSubmit"],["container",""],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clear","multiple","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid"],[1,"row","mt-8","mx-1"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"imageForZoom","title","code","id","image","channels"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"next","previous","total","filter","totaldata","paginationTotal","hasClicked"]],template:function(e,i){e&1&&(a(0,"mainpanel",0),f("onSubmit",function(_){return i.onSearch(_)}),a(1,"filters")(2,"div",1)(3,"div")(4,"h6",2),d(5,"Channel"),l(),a(6,"ng-select",3),F("ngModelChange",function(_){return T(i.searchFilter.ListChannelID,_)||(i.searchFilter.ListChannelID=_),_}),f("clear",function(){return i.onClearFilter()}),x(7,wn,3,2,"ng-template",4),l()()()(),a(8,"content")(9,"div",5)(10,"div",6),x(11,yn,2,6,"div",7)(12,Mn,3,0,"ng-container",8),l(),x(13,Dn,4,4,"ng-container",8),l()()()),e&2&&(c(6),s("multiple",!0)("clearable",!0)("items",i.channelOptions),O("ngModel",i.searchFilter.ListChannelID),c(5),s("ngForOf",i.products),c(),s("ngIf",(i.products==null?null:i.products.length)==0),c(),s("ngIf",(i.products==null?null:i.products.length)>0))},dependencies:[N,A,U,L,B,Y,rt,wt,Tt,z,$]});let o=r;return o})();var On=()=>["/menu/products/status/sold-in-channel"],Te=o=>({ID:o}),Tn=()=>["/menu/products/status/not-in-pos"];function Fn(o,r){if(o&1&&(P(0),d(1),b()),o&2){let n=p().$implicit;c(),w(" ",n.Count," ")}}function En(o,r){if(o&1){let n=v();a(0,"span",26),f("click",function(){m(n);let e=p().$implicit,i=p(2);return u(i.getLiveProductCount(e.ID,e))}),g(1,"i",27),l()}}function Nn(o,r){if(o&1){let n=v();a(0,"tr")(1,"td"),g(2,"img",17),a(3,"span",18),d(4),l()(),a(5,"td",19),x(6,Fn,2,1,"ng-container",6)(7,En,2,0,"ng-template",null,1,nt),l(),a(9,"td",19)(10,"a",20),d(11),E(12,"number"),l()(),a(13,"td",19)(14,"a",20),d(15),E(16,"number"),l()(),a(17,"td"),d(18),E(19,"date"),l(),a(20,"td")(21,"div",21)(22,"button",22),f("click",function(){let e=m(n).$implicit,i=p(2);return u(i.onScanChannel(e))}),g(23,"i",23),d(24," Scan "),l(),a(25,"button",24),f("click",function(){let e=m(n).$implicit,i=p(2);return u(i.onClearCache(e.ID))}),g(26,"i",25),d(27," Clear "),l()()()()}if(o&2){let n=r.$implicit,t=G(8),e=p(2);c(2),s("src",e.getChannelLogo(n.TypeID),D),c(2),et(n.Name),c(2),s("ngIf",n.Count!==void 0)("ngIfElse",t),c(4),s("routerLink",X(18,On))("queryParams",pt(19,Te,n.ID)),c(),w(" ",V(12,11,n.SoldInChannel)," "),c(3),s("routerLink",X(21,Tn))("queryParams",pt(22,Te,n.ID)),c(),w(" ",V(16,13,n.NotInPOS)," "),c(3),w("",n.LastSync?Wt(19,15,n.LastSync,"dd MMM yyyy HH:mm"):"Never"," ")}}function kn(o,r){if(o&1&&(P(0),a(1,"div",7)(2,"table",8)(3,"thead",9)(4,"tr",10)(5,"th"),d(6,"Channel"),l(),a(7,"th",11),d(8,"Live Product"),l(),a(9,"th",12),d(10,"Sold In Channel"),l(),a(11,"th",13),d(12,"Product Not in POS"),l(),a(13,"th",14),d(14,"Last Sync"),l(),g(15,"th",15),l()(),a(16,"tbody"),x(17,Nn,28,24,"tr",16),E(18,"async"),l()()(),b()),o&2){let n,t=p();c(17),s("ngForOf",(n=V(18,1,t.channels$))==null?null:n.Data)}}function Vn(o,r){o&1&&(a(0,"div",28),g(1,"app-empty-state"),l())}var Fe=(()=>{let r=class r{constructor(t,e,i,h){this.productService=t,this.toastr=e,this.dialog=i,this.authService=h,this.destroy$=new Lt,this.channelOptions=h.getChannels()}ngOnInit(){this.setObsProductStatistic()}setObsProductStatistic(){this.channels$=this.productService.getProductStatistic()}getLiveProductCount(t,e){this.productService.getTotalProductLive(t).pipe(kt(this.destroy$)).subscribe(i=>{e.Count=i.Count})}onScanChannel(t){this.dialog.open(k,{width:"700px",data:{channelOptions:this.channelOptions,filter:{ChannelID:t.ID},disabledChannelOption:!0}}).afterClosed().pipe(y(e=>C.IsNotEmpty(e))).subscribe(e=>{this.scanAllProduct(t.ID,e)})}scanAllProduct(t,e){let i=this.productService.findChannelById(t,this.channelOptions);this.productService.scanAll(e.ChannelID,e.ScanFull,e.UpdatedProduct,e.Async).pipe(y(h=>h)).subscribe(h=>{e.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(h,i,!e.UpdatedProduct),this.setObsProductStatistic())})}onClearCache(t){confirm("Are you sure you want to Clear Cache? This Process will remove your product integration to marketplace")&&this.productService.clearCacheChannel(t).pipe(kt(this.destroy$)).subscribe(i=>{this.toastr.success("Successfully cleared cache","Success"),this.setObsProductStatistic()})}getChannelLogo(t){return C.getChannelLogoByTypeId(t)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};r.\u0275fac=function(e){return new(e||r)(S(j),S(W),S(J),S(R))},r.\u0275cmp=M({type:r,selectors:[["app-channel-statistic"]],decls:9,vars:6,consts:[["EMPTY",""],["QUESTION",""],["headerTitle","Products Statistic",3,"hideSearchBox","hideSearchDropdown"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[1,"text-center",2,"width","13rem"],[1,"text-center",2,"width","9rem"],[1,"text-center",2,"width","14rem"],[2,"width","10rem"],[2,"width","12rem"],[4,"ngFor","ngForOf"],[2,"width","24px","height","24px",3,"src"],[1,"ms-3"],[1,"text-center"],[3,"routerLink","queryParams"],[1,"d-flex","align-items-center","justify-content-center"],[1,"btn","btn-sm","btn-secondary","fs-6",3,"click"],[1,"fa","fa-spinner"],[1,"btn","btn-sm","btn-secondary","fs-6","ms-3",3,"click"],[1,"fa","fa-trash"],["matTooltip","Click to see total live product",1,"cursor-pointer","fs-5","text-primary",3,"click"],[1,"fa-solid","fa-circle-question","cursor"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(e,i){if(e&1&&(a(0,"mainpanel",2)(1,"content")(2,"div",3)(3,"div",4)(4,"div",5),x(5,kn,19,3,"ng-container",6),E(6,"async"),x(7,Vn,2,0,"ng-template",null,0,nt),l()()()()()),e&2){let h,_=G(8);s("hideSearchBox",!0)("hideSearchDropdown",!0),c(5),s("ngIf",((h=V(6,4,i.channels$))==null||h.Data==null?null:h.Data.length)>0)("ngIfElse",_)}},dependencies:[N,A,B,yt,bt,$,St,xt,Kt]});let o=r;return o})();var An=[{component:Pe,path:"",children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:we,canActivate:[tt],data:{title:"Products in POS"}},{path:"sold-in-channel",component:ye,canActivate:[tt],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:Me,canActivate:[tt],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:De,canActivate:[tt],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:Oe,canActivate:[tt],data:{title:"Duplicate Sku in Channel"}},{path:"channel-statistic",component:Fe,canActivate:[tt],data:{title:"Channel Statistic"}}]}],mo=(()=>{let r=class r{};r.\u0275fac=function(e){return new(e||r)},r.\u0275mod=$t({type:r}),r.\u0275inj=jt({imports:[vt,It,ne,Mt,Yt,ve,le,oe,Tt,z,q,zt.forChild(An),Ce,Zt,ct]});let o=r;return o})();export{mo as StatusModule};
|
|
1
|
+
import{a as k,b as Ot,c as xe}from"./chunk-XGEX66UB.js";import"./chunk-HXV4FH6L.js";import{a as Se}from"./chunk-EVDAHZS7.js";import{a as Z}from"./chunk-7KG3DC5J.js";import{a as $}from"./chunk-43L7CBSZ.js";import{b as fe}from"./chunk-YXUEYLE5.js";import"./chunk-T3POIC5F.js";import"./chunk-V6PMZ6DL.js";import{a as ie,b as oe}from"./chunk-OKB4Q376.js";import{e as at}from"./chunk-P2RYEYAK.js";import{f as ue,g as he,h as _e,i as ge,j as Ce}from"./chunk-ITTQVZJZ.js";import{a as j}from"./chunk-UUI7T7NV.js";import"./chunk-OURZMROU.js";import{a as Tt}from"./chunk-ZCPPEAJQ.js";import{a as z}from"./chunk-6JF7HXB4.js";import{b as ve}from"./chunk-AXDEQQNM.js";import{a as pe,b as de}from"./chunk-CHZBEIYE.js";import{a as re,b as ae,c as le}from"./chunk-KSTCUPYX.js";import{a as tt}from"./chunk-L7OZWIEI.js";import{a as q}from"./chunk-LIJHEC5V.js";import{a as me}from"./chunk-PW6QZKJS.js";import"./chunk-A3ZMDUMP.js";import{f as ce,g as se}from"./chunk-X54LLODL.js";import{a as rt,b as wt,d as Y,e as Yt}from"./chunk-DDUQ3IZU.js";import{g as R}from"./chunk-ZHLEQV6S.js";import{b as W,e as K}from"./chunk-SUL6ZUGT.js";import"./chunk-KCDL7SWP.js";import{b as Qt,c as Xt,d as J,h as Dt,i as te,j as ee,m as B,n as ne}from"./chunk-SG42JTLJ.js";import{t as yt,u as Mt}from"./chunk-BZ7SMYI7.js";import{P as Zt,X as qt}from"./chunk-DRY23ALE.js";import{A as It,b as Ht,c as ot,h as U,m as L}from"./chunk-VFLG2BDB.js";import{b as H,c as C}from"./chunk-T4MH7AFK.js";import{$a as s,$b as V,Ac as Kt,B as y,Cc as xt,Dc as vt,Ha as D,Hb as G,Ia as c,Ib as d,Ja as S,Jb as et,Kb as w,Mb as O,Nb as T,Ob as F,Qb as Gt,Rb as X,Sb as pt,T as ft,Uc as Pt,V as kt,Vc as Jt,Wc as it,X as Bt,Xc as bt,Za as x,Zc as zt,_b as E,aa as jt,ac as Wt,bc as nt,c as Lt,da as Vt,ga as M,ha as $t,lb as a,mb as l,nb as g,oa as m,ob as P,pa as u,pb as b,q as Rt,rb as v,ub as f,vc as N,wb as p,wc as A,zc as St}from"./chunk-IH2NT4RC.js";import"./chunk-GNOSNGXM.js";var Ne=()=>["/menu/products/download/by-url"],Pe=(()=>{let r=class r{constructor(){this.productTabs=[{Title:"Sold in Channel",Url:"/menu/products/status/sold-in-channel",Description:"SKU has been mapped between dealpos and marketplace"},{Title:"Not in POS",Url:"/menu/products/status/not-in-pos",Description:"SKU sold in Marketplace but not exist in DEALPOS"},{Title:"Not in Channel",Url:"/menu/products/status/not-in-channel",Description:"SKU has not been sold on one of channels"},{Title:"In POS",Url:"/menu/products/status/in-pos",Description:"All products which is already available in POS"},{Title:"Multiple Listing",Url:"/menu/products/status/duplicate-sku",Description:"SKU(s) which is listed more than one time (one to many)"},{Title:"Channel Statistic",Url:"/menu/products/status/channel-statistic",Description:"Product statistic from each channel obtained from the last product scan"}]}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=M({type:r,selectors:[["app-status"]],decls:13,vars:3,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-flex"],[1,"dropdown-item",3,"routerLink"]],template:function(e,i){e&1&&(a(0,"nav",0)(1,"div",1)(2,"div"),g(3,"nav-tab",2),l()(),a(4,"div")(5,"div",3)(6,"a",4),g(7,"i",5),l(),a(8,"div",6)(9,"div",7)(10,"a",8),d(11,"Download Product By Url"),l()()()()()(),g(12,"router-outlet")),e&2&&(c(3),s("Tabs",i.productTabs),c(7),s("routerLink",X(2,Ne)))},dependencies:[ie,Jt,bt]});let o=r;return o})();function ke(o,r){if(o&1&&(a(0,"mat-option",6)(1,"div"),g(2,"img",7),a(3,"span"),d(4),l()()()),o&2){let n=r.$implicit;s("value",n.ChannelID),c(2),s("src",n.logo,D),c(2),et(n.Title)}}var ct=(()=>{let r=class r{constructor(){this.dialogRef=Vt(Qt),this.channels=Vt(Xt)}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new te,this.modalConfig.title="Detach Product",this.modalConfig.okText="Save"}onClose(){this.dialogRef.close()}onSave(){let t=this.channels.find(i=>i.ChannelID===this.channelId),e={channelId:this.channelId,channelItemId:t.ChannelItemID};this.dialogRef.close(e)}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=M({type:r,selectors:[["app-modal-detach-product"]],standalone:!0,features:[Gt],decls:8,vars:4,consts:[[3,"onClose","onCancel","onOk","dynamicValidated","config"],["content",""],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"ngModelChange","ngModel"],["class","channel-option",3,"value",4,"ngFor","ngForOf"],[1,"channel-option",3,"value"],[2,"width","18px","margin-right","10px",3,"src"]],template:function(e,i){e&1&&(a(0,"modal-material",0),f("onClose",function(){return i.onClose()})("onCancel",function(){return i.onClose()})("onOk",function(){return i.onSave()}),a(1,"div",1)(2,"div")(3,"label",2),d(4,"Select a Channel"),l(),a(5,"mat-form-field",3)(6,"mat-select",4),F("ngModelChange",function(_){return T(i.channelId,_)||(i.channelId=_),_}),x(7,ke,5,3,"mat-option",5),l()()()()()),e&2&&(s("dynamicValidated",i.channelId)("config",i.modalConfig),c(6),O("ngModel",i.channelId),c(),s("ngForOf",i.channels))},dependencies:[vt,N,ee,se,ce,de,pe,qt,It,U,L,Mt]});let o=r;return o})();function Ve(o,r){if(o&1){let n=v();a(0,"button",13),f("click",function(){m(n);let e=p(2);return u(e.onOpenScanDialog())}),g(1,"i",14),d(2," Scan Channel "),l()}}function Ae(o,r){if(o&1&&(P(0),x(1,Ve,3,0,"button",12),b()),o&2){let n=p();c(),s("ngIf",!n.productService.hasSelection(n.products))}}function Ue(o,r){if(o&1){let n=v();P(0),a(1,"button",15),f("click",function(){m(n);let e=p();return u(e.onScanMultipleProduct())}),g(2,"i",14),d(3),l(),b()}if(o&2){let n,t=p();c(3),w(" Scan (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function Le(o,r){if(o&1){let n=v();P(0),a(1,"button",16),f("click",function(){m(n);let e=p();return u(e.onUploadMultipleProduct())}),g(2,"i",17),d(3),l(),b()}if(o&2){let n,t=p();c(3),w(" Upload (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function Re(o,r){if(o&1){let n=v();a(0,"div",18)(1,"app-product-card",19),f("onUpload",function(){let e=m(n).$implicit,i=p();return u(i.onUploadToMultipleChannel(e))})("onScan",function(){let e=m(n).$implicit,i=p();return u(i.onScanSingleProduct(e))})("onDescEvent",function(){let e=m(n).index,i=p();return u(i.onOpenDialogVariant(e))})("onCheckBoxChange",function(e){let i=m(n).$implicit;return u(i.selected=e)})("onDetach",function(){let e=m(n).$implicit,i=p();return u(i.onDetachProduct(e))}),l()()}if(o&2){let n=r.$implicit,t=p();c(),s("productId",n.ID)("title",n==null?null:n.Name)("image",n==null?null:n.ThumbnailUrl)("description",(n==null?null:n.Variants.length)>1?(n==null?null:n.Variants.length)+" Variants":null)("channels",t.productService.getChannelProduct(n))("code",t.getVariantCode(n==null?null:n.Variants))("showCheckBox",(n==null?null:n.Channel.length)<t.channelOptions.length)("scanButton",!0)("uploadButton",n==null?null:n.hasUpload)("imageForZoom",n==null?null:n.ImageUrl)("detachButton",(n==null||n.Channel==null?null:n.Channel.length)>0)}}function Be(o,r){o&1&&(P(0),a(1,"div",20),g(2,"app-empty-state"),l(),b())}function je(o,r){if(o&1){let n=v();P(0),a(1,"div",21)(2,"div",22)(3,"app-custom-paginator",23),f("next",function(){m(n);let e=p();return u(e.getProducts())})("previous",function(){m(n);let e=p();return u(e.getProducts())}),l()()(),b()}if(o&2){let n=p();c(3),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",!0)}}var we=(()=>{let r=class r{constructor(t,e,i,h,_,I,st){this.http=t,this.toastr=e,this.dialog=i,this.productService=h,this.authService=_,this.uploadProductService=I,this.route=st,this.searchFilter=new Z,this.products=[],this.rowCount=0,this.multipeScanChannels=[],this.getLoaderPage(),this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}getLoaderPage(){this.productService.LoadInPOS().subscribe(t=>{this.Categories=t.Options.Categories,this.searchFilter.PageNumber=t.Filter.PageNumber,this.searchFilter.RowCount=t.Filter.RowCount,this.searchFilter.ChannelID=null,this.searchFilter.Category=t.Filter.Category,this.searchFilter.PageSize=100,this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[H.Tokopedia,H.Tiktok])}getProducts(){let t={PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Category:this.searchFilter.Category,From:this.startDate,To:this.endDate};this.http.post("/api/product/GetInPOS",t).subscribe(e=>{this.products=e.Data,this.rowCount=e.Total==null?this.searchFilter.RowCount:e.Total.toString(),this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions)})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=C.GuidEMpty,this.dialog.open(k,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>C.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.Async,this.scanAllProduct()})}scanAllProduct(){if(this.searchFilter.ChannelID==null){this.toastr.error("Please Select Channel","Error");return}this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(t=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{this.getLoaderPage();let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,e,!this.searchFilter.UpdatedProduct)}})}onOpenDialogVariant(t){this.dialog.open(Ot,{data:{title:this.products[t].Name,variants:this.products[t].Variants},width:"800px"})}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.uploadProductService.setSelectedProduct(t),this.route.navigate(["/menu/products/upload"])}onUploadToMultipleChannel(t){this.uploadProductService.setSelectedProduct([t]),this.route.navigate(["/menu/products/upload"])}searchProduct(t){this.searchFilter.text=t,this.getProducts()}onScanMultipleProduct(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=C.GuidEMpty;let e=this.productService.filterChannelByTypeId(this.channelOptions,[H.Tokopedia,H.Tiktok]);this.dialog.open(k,{data:{filter:t,channelOptions:e,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(h=>C.IsNotEmpty(h))).subscribe(h=>{this.searchFilter.ChannelID=h.ChannelID,this.searchFilter.ScanFull=h.ScanFull,this.searchFilter.UpdatedProduct=h.UpdatedProduct;let _=this.productService.selectedProduct(this.products),I=this.productService.getVariantCodesProducts(_);this.scanSingleProduct(I)})}onScanSingleProduct(t){let e=JSON.parse(JSON.stringify(this.searchFilter));e.ChannelID=C.GuidEMpty,this.dialog.open(k,{data:{filter:e,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>C.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID;let h=this.productService.getVariantCodesProduct(t);this.scanSingleProduct(h)})}scanSingleProduct(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:e=>{if(e)this.toastr.success("Successfully Scan ","Success");else{let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${i?.Name} `,"Error")}this.searchFilter.ChannelID=C.GuidEMpty,e&&this.getProducts()},error:e=>{this.searchFilter.ChannelID=C.GuidEMpty}})}getVariantCode(t){let e;return t.length>1&&(e=(t[0].model?t[0].model:"")+t[0].Code),t.length==1&&(e=t[0].Code),e}onDetachProduct(t){t.Channel=C.assignChannelLogo(t.Channel),this.dialog.open(ct,{width:"600px",data:t.Channel}).afterClosed().pipe(y(e=>C.IsNotEmpty(e)),ft(e=>this.productService.detachProduct(e.channelId,e.channelItemId))).subscribe(e=>{this.toastr.success(e.Message,Dt.Success),this.getProducts()})}};r.\u0275fac=function(e){return new(e||r)(S(K),S(W),S(J),S(j),S(R),S(at),S(it))},r.\u0275cmp=M({type:r,selectors:[["app-in-pos"]],decls:22,vars:13,consts:[["picker",""],["description","All products which is already available in POS",3,"onSubmit","headerTitle"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","Name","bindValue","Name","placeholder","Select Category",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[1,"mt-5"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["type","button","data-cy","scanSoldinChannel","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onUpload","onScan","onDescEvent","onCheckBoxChange","onDetach","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","detachButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(e,i){if(e&1){let h=v();a(0,"mainpanel",1),f("onSubmit",function(I){return m(h),u(i.searchProduct(I))}),a(1,"actions"),x(2,Ae,2,1,"ng-container",2)(3,Ue,4,1,"ng-container",2)(4,Le,4,1,"ng-container",2),l(),a(5,"filters")(6,"div")(7,"label",3),d(8,"Category"),l(),a(9,"ng-select",4),f("ngModelChange",function(I){return m(h),u(i.searchFilter.Category=I)}),l()(),a(10,"div",5)(11,"mat-date-range-input",6)(12,"input",7),F("ngModelChange",function(I){return m(h),T(i.startDate,I)||(i.startDate=I),u(I)}),f("click",function(){m(h);let I=G(15);return u(I.open())}),l(),a(13,"input",8),F("ngModelChange",function(I){return m(h),T(i.endDate,I)||(i.endDate=I),u(I)}),f("click",function(){m(h);let I=G(15);return u(I.open())}),l()(),g(14,"mat-date-range-picker",null,0),l()(),a(16,"content")(17,"div",9)(18,"div",10),x(19,Re,2,11,"div",11)(20,Be,3,0,"ng-container",2),l(),x(21,je,4,4,"ng-container",2),l()()()}if(e&2){let h=G(15);s("headerTitle","In POS ("+i.rowCount+")"),c(2),s("ngIf",!i.productService.hasSelection(i.products)),c(),s("ngIf",i.productService.hasSelection(i.products)&&i.multipeScanChannels.length>0),c(),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("items",i.Categories)("ngModel",i.searchFilter.Category),c(2),s("rangePicker",h),c(),O("ngModel",i.startDate),c(),O("ngModel",i.endDate),c(6),s("ngForOf",i.products),c(),s("ngIf",i.products.length==0),c(),s("ngIf",i.products.length>0)}},dependencies:[N,A,ot,U,L,B,Y,z,q,$,_e,ue,he,ge],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.img-logo[_ngcontent-%COMP%]{height:24px;width:24px}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}"]});let o=r;return o})();function $e(o,r){if(o&1){let n=v();P(0),a(1,"button",10),f("click",function(){m(n);let e=p();return u(e.onOpenScanDialog())}),g(2,"i",11),d(3," Scan Channel "),l(),b()}}function Ge(o,r){if(o&1){let n=v();P(0),a(1,"button",12),f("click",function(){m(n);let e=p();return u(e.onScanMultipleProduct())}),g(2,"i",11),d(3),l(),b()}if(o&2){let n=p();c(3),w(" Scan (",n.productService.selectedProduct(n.products).length,") ")}}function We(o,r){if(o&1){let n=v();P(0),a(1,"button",13),f("click",function(){m(n);let e=p();return u(e.onUploadMultipleProduct())}),g(2,"i",14),d(3),l(),b()}if(o&2){let n=p();c(3),w(" Upload (",n.productService.selectedProduct(n.products).length,") ")}}function Ke(o,r){if(o&1&&(a(0,"span",15),g(1,"img",16),l(),d(2)),o&2){let n=r.item;c(),s("src",n.Img,D)("alt",n.Name),c(),w(" ",n.Name," ")}}function Je(o,r){if(o&1){let n=v();a(0,"div",17)(1,"label",18),d(2,"Item ID"),l(),a(3,"input",19),F("ngModelChange",function(e){m(n);let i=p();return T(i.searchFilter.Item_id,e)||(i.searchFilter.Item_id=e),u(e)}),l()()}if(o&2){let n=p();c(3),O("ngModel",n.searchFilter.Item_id)}}function ze(o,r){if(o&1){let n=v();a(0,"div",20)(1,"app-product-card",21),f("onUpload",function(){let e=m(n).$implicit,i=p();return u(i.onUploadToMultipleChannel(e))})("onDescEvent",function(){let e=m(n).index,i=p();return u(i.onOpenVariantDetail(e))})("onScan",function(){let e=m(n).$implicit,i=p();return u(i.onScanSingleProduct(e))})("onCheckBoxChange",function(e){let i=m(n).$implicit;return u(i.selected=e)})("onDetach",function(){let e=m(n).$implicit,i=p();return u(i.onDetachProduct(e))}),l()()}if(o&2){let n=r.$implicit,t=p();c(),s("productId",n==null?null:n.ID)("title",n==null?null:n.Name)("image",n==null?null:n.ThumbnailUrl)("description",(n==null||n.Variants==null?null:n.Variants.length)>1?(n==null||n.Variants==null?null:n.Variants.length)+" Variants":null)("channels",t.productService.getChannelProduct(n))("code",t.getVariantCode(n==null?null:n.Variants))("showCheckBox",n==null?null:n.hasScan)("scanButton",!0)("uploadButton",n==null?null:n.hasUpload)("imageForZoom",n==null?null:n.ImageUrl)("detachButton",(n==null||n.Channel==null?null:n.Channel.length)>0)}}function He(o,r){o&1&&(P(0),a(1,"div",22),g(2,"app-empty-state"),l(),b())}function Ye(o,r){if(o&1){let n=v();a(0,"div",23)(1,"div",24)(2,"app-custom-paginator",25),f("total",function(){m(n);let e=p();return u(e.getRowCount())})("next",function(){m(n);let e=p();return u(e.getProducts())})("previous",function(){m(n);let e=p();return u(e.getProducts())}),l()()()}if(o&2){let n=p();c(2),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}var ye=(()=>{let r=class r{constructor(t,e,i,h,_,I,st,Ct){this.http=t,this.dialog=e,this.toastr=i,this.productService=h,this.activateRouter=_,this.authService=I,this.route=st,this.uploadProductService=Ct,this.searchFilter=new Z,this.products=[],this.rowCount=0,this.hasClickRowCount=!1,this.guidEmpty=C.GuidEMpty,this.multipeScanChannels=[],this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(C.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(e=>{this.searchFilter=e.Filter,e.Filter.ChannelID!=C.GuidEMpty&&(this.searchFilter.ListChannelID=[],this.searchFilter.ListChannelID.push(e.Filter.ChannelID)),this.searchFilter.PageSize=e.Filter.RowCount,this.searchFilter.Item_id="",this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[H.Tokopedia,H.Tiktok])}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Item_id:this.searchFilter.Item_id};this.productService.findAllSoldInChannel(t).subscribe(e=>{this.products=e.Data,this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions),this.products=this.productService.checkProductHasScanButton(this.products,this.channelOptions)})}searchProduct(t){this.searchFilter.text=t,this.hasClickRowCount=!1,this.getProducts()}onOpenVariantDetail(t){let e=this.products[t].Variants;this.dialog.open(Ot,{data:{variants:e,title:this.products[t].Name},width:"800px"})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=C.GuidEMpty,this.dialog.open(k,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>C.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.Async,this.scanAllProduct()})}scanAllProduct(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).pipe(y(e=>e)).subscribe(e=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(e,t,!this.searchFilter.UpdatedProduct),this.initPageLoader(C.GuidEMpty))})}onScanSingleProduct(t){t.Channel=this.productService.getChannelProduct(t);let e=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(k,{data:{filter:e,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>C.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID;let h=this.productService.getVariantCodesProduct(t);this.scanProducts(h)})}onUploadToMultipleChannel(t){this.uploadProductService.setSelectedProduct([t]),this.route.navigate(["/menu/products/upload"])}onScanMultipleProduct(){this.searchFilter.ChannelID=C.GuidEMpty;let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(k,{data:{filter:t,channelOptions:this.multipeScanChannels,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>C.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct;let h=this.productService.selectedProduct(this.products),_=this.productService.getVariantCodesProducts(h);this.scanProducts(_)})}scanProducts(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:e=>{let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);e?this.toastr.success(`Product Successfully scan with ${i?.Name}`,"Success"):this.toastr.error(`This product is not existed in ${i?.Name} `,"Error"),this.searchFilter.ChannelID=C.GuidEMpty,e&&this.getProducts()},error:e=>{this.searchFilter.ChannelID=C.GuidEMpty}})}getVariantCode(t){let e;return t.length>1&&(e=(t[0].model?t[0].model:"")+t[0].Code),t.length==1&&(e=t[0].Code),e}onClearFilterChannel(){this.searchFilter.ChannelID=C.GuidEMpty,this.searchFilter.Item_id=""}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.uploadProductService.setSelectedProduct(t),this.route.navigate(["/menu/products/upload"])}getRowCount(){let t={ListChannelID:this.searchFilter.ListChannelID,text:this.searchFilter.text};this.http.post("/api/product/GetSoldInChannelRowCount",t).subscribe(e=>{this.hasClickRowCount=!0,this.rowCount=e.Total})}onDetachProduct(t){t.Channel=C.assignChannelLogo(t.Channel),this.dialog.open(ct,{width:"600px",data:t.Channel}).afterClosed().pipe(y(e=>C.IsNotEmpty(e)),ft(e=>this.productService.detachProduct(e.channelId,e.channelItemId))).subscribe(e=>{this.toastr.success(e.Message,Dt.Success),this.getProducts()})}};r.\u0275fac=function(e){return new(e||r)(S(K),S(J),S(W),S(j),S(Pt),S(R),S(it),S(at))},r.\u0275cmp=M({type:r,selectors:[["app-sold-in-channel"]],decls:18,vars:12,consts:[["description","SKU has been mapped between dealpos and marketplace",3,"onSubmit","headerTitle"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clear","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],["class","mt-5",4,"ngIf"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"mt-5"],[1,"fw-bold"],["type","text","name","Item_id","id","Item_id",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onUpload","onDescEvent","onScan","onCheckBoxChange","onDetach","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","detachButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(e,i){e&1&&(a(0,"mainpanel",0),f("onSubmit",function(_){return i.searchProduct(_)}),a(1,"actions"),x(2,$e,4,0,"ng-container",1)(3,Ge,4,1,"ng-container",1)(4,We,4,1,"ng-container",1),l(),a(5,"filters")(6,"div")(7,"label",2),d(8,"Channel"),l(),a(9,"ng-select",3),f("ngModelChange",function(_){return i.searchFilter.ListChannelID=_})("clear",function(){return i.onClearFilterChannel()}),x(10,Ke,3,3,"ng-template",4),l()(),x(11,Je,4,1,"div",5),l(),a(12,"content")(13,"div",6)(14,"div",7),x(15,ze,2,11,"div",8)(16,He,3,0,"ng-container",1),l(),x(17,Ye,3,4,"div",9),l()()()),e&2&&(s("headerTitle","Sold in Channel"),c(2),s("ngIf",!i.productService.hasSelection(i.products)),c(),s("ngIf",i.multipeScanChannels.length>0&&i.productService.hasSelection(i.products)),c(),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("multiple",!0)("items",i.channelOptions)("ngModel",i.searchFilter.ListChannelID),c(2),s("ngIf",i.searchFilter.ListChannelID!=null),c(4),s("ngForOf",i.products),c(),s("ngIf",i.products.length==0),c(),s("ngIf",i.products==null?null:i.products.length))},dependencies:[N,A,ot,U,L,B,Y,rt,wt,z,q,$],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]});let o=r;return o})();function qe(o,r){if(o&1){let n=v();a(0,"button",13),f("click",function(){m(n);let e=p(2);return u(e.uploadMultipleProduct())}),g(1,"i",14),d(2),l()}if(o&2){let n=p(2);c(2),w(" upload (",n.selectedProducts==null?null:n.selectedProducts.length,") ")}}function Qe(o,r){if(o&1){let n=v();P(0),a(1,"td",29)(2,"input",30),F("ngModelChange",function(e){m(n);let i=p(2).$implicit;return T(i.selected,e)||(i.selected=e),u(e)}),f("ngModelChange",function(){m(n);let e=p(3).ngIf,i=p(3);return u(i.onSelectProduct(e))}),l()(),b()}if(o&2){let n=p(2).$implicit;c(),s("rowSpan",n==null?null:n.Variants.length),c(),O("ngModel",n.selected)}}function Xe(o,r){if(o&1){let n=v();P(0),a(1,"img",35),f("click",function(e){m(n);let i=p(3).$implicit,h=p(4);return u(h.onZoomImage(e,i==null?null:i.ImageUrl))}),l(),b()}if(o&2){let n=p(3).$implicit;c(),s("src",n==null?null:n.ImageUrl,D)}}function tn(o,r){o&1&&g(0,"img",36)}function en(o,r){if(o&1&&(P(0),a(1,"td",29)(2,"div",31),x(3,Xe,2,1,"ng-container",11)(4,tn,1,0,"ng-template",null,1,nt),l()(),a(6,"td",32)(7,"h4",33)(8,"span",34),d(9),l()()(),b()),o&2){let n=G(5),t=p(2).$implicit;c(),s("rowSpan",t==null?null:t.Variants.length),c(2),s("ngIf",t==null?null:t.ImageUrl)("ngIfElse",n),c(3),s("rowSpan",t==null?null:t.Variants.length),c(2),s("matTooltip",(t==null||t.Name==null?null:t.Name.length)>50?t==null?null:t.Name:""),c(),w(" ",t==null?null:t.Name," ")}}function nn(o,r){if(o&1&&(a(0,"div")(1,"a",25),g(2,"img",37),l()()),o&2){let n=r.$implicit;c(),s("href",n.URL,D),c(),s("src",n.Img,D)("matTooltip",n.Name)}}function on(o,r){if(o&1&&(a(0,"div"),g(1,"img",37),l()),o&2){let n=r.$implicit;c(),s("src",n.Img,D)("matTooltip",n.Name)}}function rn(o,r){if(o&1&&(a(0,"tr"),x(1,Qe,3,2,"ng-container",12)(2,en,10,6,"ng-container",12),a(3,"td"),d(4),l(),a(5,"td")(6,"span"),d(7),l(),a(8,"span",24)(9,"a",25),g(10,"i",26),l()()(),a(11,"td",27)(12,"div",28),x(13,nn,3,3,"div",23),l()(),a(14,"td",27)(15,"div",28),x(16,on,2,2,"div",23),l()()()),o&2){let n=r.$implicit,t=r.index,e=p(5);c(),s("ngIf",t==0),c(),s("ngIf",t==0),c(2),w(" ",n.Name," "),c(3),w(" ",n.Code," "),c(2),s("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),D),c(4),s("ngForOf",n==null?null:n.Available),c(3),s("ngForOf",n==null?null:n.NotAvailable)}}function an(o,r){if(o&1&&(P(0),x(1,rn,17,7,"tr",23),b()),o&2){let n=r.$implicit;c(),s("ngForOf",n.Variants)}}function ln(o,r){if(o&1&&(a(0,"tbody"),x(1,an,2,1,"ng-container",23),l()),o&2){let n=r.ngIf;c(),s("ngForOf",n)}}function cn(o,r){if(o&1&&(P(0),a(1,"div",15)(2,"table",16)(3,"thead",17)(4,"tr"),g(5,"th",18),a(6,"th",19),d(7,"Product"),l(),a(8,"th",20),d(9,"Variant"),l(),a(10,"th",20),d(11,"SKU"),l(),a(12,"th",21),d(13,"Available In"),l(),a(14,"th",22),d(15,"Not Available In"),l()()(),x(16,ln,2,1,"tbody",12),E(17,"async"),l()(),b()),o&2){let n=p(2);c(16),s("ngIf",V(17,1,n.data$))}}function sn(o,r){o&1&&(a(0,"div",38),g(1,"app-empty-state"),l())}function pn(o,r){if(o&1){let n=v();a(0,"span",46),f("click",function(){m(n);let e=p(4);return u(e.getRowCount())}),a(1,"i",47),d(2,"?"),l()()}}function dn(o,r){if(o&1&&(a(0,"span"),d(1),E(2,"number"),l()),o&2){let n=r.ngIf;c(),et(V(2,1,n==null?null:n.Count))}}function mn(o,r){if(o&1){let n=v();a(0,"a",48),f("click",function(){m(n);let e=p(4);return u(e.onNextPage())}),g(1,"i",49),d(2," Next"),l()}}function un(o,r){if(o&1){let n=v();a(0,"a",50),f("click",function(){m(n);let e=p(4);return u(e.onLastPage())}),g(1,"i",51),d(2," Last"),l()}}function hn(o,r){if(o&1&&(P(0),a(1,"div",39)(2,"div",40)(3,"div",41),d(4),E(5,"number"),x(6,pn,3,0,"span",42)(7,dn,3,3,"span",12),E(8,"async"),d(9),l()(),a(10,"div",43),x(11,mn,3,0,"a",44)(12,un,3,0,"a",45),l()(),b()),o&2){let n=p().ngIf,t=p(2);c(4),w(" Showing 1 - ",V(5,6,n==null?null:n.length)," of "),c(2),s("ngIf",t.paginationService.hideCount),c(),s("ngIf",!t.paginationService.hideCount&&V(8,8,t.rowCount$)),c(2),w(" records ~ ",t.paginationService.footerPageNumber," Page "),c(2),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),c(),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}function _n(o,r){if(o&1&&(P(0),x(1,hn,13,10,"ng-container",12),b()),o&2){let n=r.ngIf;c(),s("ngIf",(n==null?null:n.length)>0)}}function gn(o,r){if(o&1){let n=v();a(0,"mainpanel",3),f("onSubmit",function(e){m(n);let i=p();return u(i.searchProduct(e))}),a(1,"actions"),x(2,qe,3,1,"button",4),a(3,"button",5),f("click",function(){m(n);let e=p();return u(e.openScanDialog())}),g(4,"i",6),d(5," Scan Channel "),l(),a(6,"button",7),f("click",function(){m(n);let e=p();return u(e.openExportDialog())}),g(7,"i",8),a(8,"span"),d(9,"Export"),l()()(),a(10,"content")(11,"div",9)(12,"div",10),x(13,cn,18,3,"ng-container",11),E(14,"async"),x(15,sn,2,0,"ng-template",null,0,nt),l(),x(17,_n,2,1,"ng-container",12),E(18,"async"),l()()()}if(o&2){let n,t=G(16),e=p();s("hideSearchDropdown",!0),c(2),s("ngIf",e.hasSelectionProduct),c(11),s("ngIf",((n=V(14,5,e.data$))==null?null:n.length)>0)("ngIfElse",t),c(4),s("ngIf",V(18,7,e.data$))}}var Me=(()=>{let r=class r{constructor(t,e,i,h,_,I,st,Ct,Ee){this.http=t,this.dialog=e,this.toastr=i,this.route=h,this.productService=_,this.paginationService=I,this.biggerPictureService=st,this.authService=Ct,this.uploadProductService=Ee,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannelV2",this.hasSelectionProduct=!1,this.selectedProducts=[],this.channelOptions=Ct.getChannels(),this.hostName=this.authService.getDomain()}ngOnInit(){this.initPageLoader(),this.iniData()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.notChannelAPI,this.loader$=this.http.post(`api/${this.loaderAPI}`,{}).pipe(Bt(t=>{this.filterSearch=t.Filter,this.paginationService.reloadPagination(t.Filter)}))}iniData(){this.data$=this.paginationService.data$.pipe(Rt(t=>(t=t.map(e=>(e.Variants=e.Variants.map(i=>(i.Available=this.productService.sortChannel(i.Available),i.NotAvailable=this.productService.sortChannel(i.NotAvailable),i.Available=this.assignLogoChannel(i.Available),i.NotAvailable=this.assignLogoChannel(i.NotAvailable),i)),e.Channel=e?.Variants[0]?.Available,e)),t)))}assignLogoChannel(t){return t=t.map(e=>(e.Img=C.getChannelLogoByTypeId(e.TypeID),e)),t}searchProduct(t){this.filterSearch.text=t,this.paginationService.reloadPagination(this.filterSearch)}scanAllProduct(){let t=this.productService.findChannelById(this.filterSearch.ChannelID,this.channelOptions);this.productService.scanAll(this.filterSearch.ChannelID,this.filterSearch.ScanFull,this.filterSearch.UpdatedProduct,this.filterSearch.Async).subscribe(e=>{this.filterSearch.Async?this.toastr.success("You will be notified when the scan is completed.","Scan Asynchronous"):(this.productService.successToastrScanAllProduct(e,t,!this.filterSearch.UpdatedProduct),this.initPageLoader())})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.filterSearch));t.ChannelID=C.GuidEMpty,this.dialog.open(k,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>C.IsNotEmpty(i))).subscribe(i=>{this.filterSearch.ChannelID=i.ChannelID,this.filterSearch.ScanFull=i.ScanFull,this.filterSearch.UpdatedProduct=i.UpdatedProduct,this.filterSearch.Async=i.Async,this.scanAllProduct()})}getRowCount(){this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`/api/${this.rowCountAPI}`,this.filterSearch)}onNextPage(){this.paginationService.onNextPage(this.filterSearch)}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:t=>{this.filterSearch.PageNumber=1,this.paginationService.getAllData(this.filterSearch,t.Count)}})}onZoomImage(t,e){this.biggerPictureService.openBiggerPicture(t,e)}onSelectProduct(t){this.hasSelectionProduct=this.productService.hasSelection(t),this.selectedProducts=this.productService.selectedProduct(t)}uploadMultipleProduct(){this.uploadProductService.setSelectedProduct(this.selectedProducts),this.route.navigate(["/menu/products/upload"])}ngOnDestroy(){this.paginationService.destroy()}openExportDialog(){this.dialog.open(fe,{data:{title:"Export Not In Channel",pageNumber:this.filterSearch.PageNumber,rowCount:this.filterSearch.RowCount,filterExport:this.filterSearch,getRowCountApi:"product/GetNotInChannelRowCount",exportApi:"product/GetNotInChannelExport"}}).afterClosed().subscribe()}};r.\u0275fac=function(e){return new(e||r)(S(K),S(J),S(W),S(it),S(j),S(Se),S(me),S(R),S(at))},r.\u0275cmp=M({type:r,selectors:[["app-not-in-channel"]],decls:2,vars:3,consts:[["EMPTY",""],["elsePic",""],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"hideSearchDropdown","onSubmit",4,"ngIf"],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"onSubmit","hideSearchDropdown"],["class","btn btn-light shadow rounded ms-2",3,"click",4,"ngIf"],["data-cy","scanNotinChannel","type","button",1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[4,"ngIf","ngIfElse"],[4,"ngIf"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-md-12"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[2,"width","10px"],["colspan","2",1,"ms-5","text-center",2,"width","450px"],[2,"width","150px"],[2,"width","20%"],[2,"width","16%"],[4,"ngFor","ngForOf"],[1,"ms-1"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"padding-left","0px"],[1,"d-flex","flex-wrap","mb-1"],[1,"text-center",3,"rowSpan"],["type","checkbox",3,"ngModelChange","ngModel"],[2,"padding-right","0px"],[1,"text-start",3,"rowSpan"],[1,"ms-5","fw-normal","text-ellipsis",2,"max-width","26vw !important"],[3,"matTooltip"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],["alt","",1,"channel-logo","cursor-pointer","ms-4","mt-3",3,"src","matTooltip"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(e,i){e&1&&(x(0,gn,19,9,"mainpanel",2),E(1,"async")),e&2&&s("ngIf",V(1,1,i.loader$))},dependencies:[N,A,Ht,U,L,B,yt,$,St,xt],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}thead[_ngcontent-%COMP%]{position:sticky;top:0}.channel-logo[_ngcontent-%COMP%]{width:20px}.w-img[_ngcontent-%COMP%]{width:100%}"]});let o=r;return o})();var Cn=o=>[o],fn=()=>[];function Sn(o,r){if(o&1){let n=v();a(0,"button",15),f("click",function(){m(n);let e=p();return u(e.openScanDialog())}),g(1,"i",16),d(2," Scan Channel "),l()}}function xn(o,r){if(o&1){let n=v();P(0),a(1,"button",17),f("click",function(){m(n);let e=p();return u(e.onDownloadAllProduct("SELECTED"))}),g(2,"i",18),d(3),l(),b()}if(o&2){let n,t=p();c(3),w(" Download (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function vn(o,r){if(o&1&&(a(0,"span",19),g(1,"img",20),l(),d(2)),o&2){let n=r.item;c(),s("src",n.Img,D)("alt",n.Name),c(),w(" ",n.Name," ")}}function Pn(o,r){if(o&1){let n=v();a(0,"div",21)(1,"app-product-card",22),f("onCheckBoxChange",function(e){let i=m(n).index,h=p();return u(h.onSelectProduct(e,i))})("onDescEvent",function(){let e=m(n).index,i=p();return u(i.onShowVariantDetail(e))})("onDownload",function(){let e=m(n).$implicit,i=p();return u(i.onDownloadProduct(e))})("onScan",function(){let e=m(n).$implicit,i=p();return u(i.onScanChannel(e))}),l()()}if(o&2){let n=r.$implicit;c(),s("showRedirectIcon",!1)("title",n==null?null:n.Name)("image",n==null?null:n.Image)("imageForZoom",n==null?null:n.Image)("code",n==null?null:n.SKU)("description",(n==null||n.Variant==null?null:n.Variant.length)>0?(n==null||n.Variant==null?null:n.Variant.length)+" Variants":null)("downloadButton",!0)("channels",n!=null&&n.Channel?pt(10,Cn,n==null?null:n.Channel):X(12,fn))("showCheckBox",!0)("scanButton",!0)}}function bn(o,r){o&1&&(P(0),a(1,"div",23),g(2,"app-empty-state"),l(),b())}function In(o,r){if(o&1){let n=v();a(0,"div",24)(1,"div",25)(2,"app-custom-paginator",26),f("total",function(){m(n);let e=p();return u(e.getRowCount())})("next",function(){m(n);let e=p();return u(e.getProducts())})("previous",function(){m(n);let e=p();return u(e.getProducts())}),l()()()}if(o&2){let n=p();c(2),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}var De=(()=>{let r=class r{constructor(t,e,i,h,_,I){this.http=t,this.dialog=e,this.productService=i,this.toastrService=h,this.activateRouter=_,this.authService=I,this.searchFilter=new Z,this.products=[],this.hasClickRowCount=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(C.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(e=>{this.searchFilter=e.Filter,this.searchFilter.PageSize=e.Filter.RowCount,this.getProducts()})}getProducts(){this.http.post("/api/product/GetProductChannelNotPOS",this.searchFilter).subscribe(t=>{this.products=t.Data,this.mapChannelToProduct(),this.setSkuProduct()})}mapChannelToProduct(){let t;this.products=this.products.map(e=>(t=this.channelOptions.find(i=>i.ID==e.ChannelID),t?e.Channel=JSON.parse(JSON.stringify(t)):e.Channel=null,e)).map(e=>(e.Channel&&(e.Channel.Url=e.Url),e))}setSkuProduct(){this.products=this.products.map(t=>(t?.Variant?.length==0?C.IsNotEmpty(t?.ChannelItemSKU)?t.SKU=t?.ChannelItemSKU:t.SKU="SKU not assigned":t.SKU=t?.Variant[0]?.ChannelVariationSKU?t?.Variant[0]?.ChannelVariationSKU:"SKU not assigned",t))}onSearch(t){this.searchFilter.text=t,this.hasClickRowCount=!1,this.getProducts()}onClearChannelFilter(){this.searchFilter.ChannelID=C.GuidEMpty}onScanAll(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(e=>{this.searchFilter.Async?this.toastrService.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.initPageLoader(C.GuidEMpty),this.productService.successToastrScanAllProduct(e,t,!this.searchFilter.UpdatedProduct)),this.searchFilter.ChannelID=C.GuidEMpty})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=C.GuidEMpty,this.dialog.open(k,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>C.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.Async=i.Async,this.onScanAll()})}onDownloadAllProduct(t){let e;t=="ALL"?e=this.products:e=this.productService.selectedProduct(this.products),e.length>0&&this.productService.downloadMultipleProduct(e).subscribe({next:()=>{this.getProducts()}})}onSelectProduct(t,e){this.products[e].selected=t}onDownloadProduct(t){confirm(`Are you sure you want to Retrieve product ${t?.Name} from ${t?.Channel.Name} to POS?`)&&this.productService.downloadProduct(t).subscribe({next:()=>{this.getProducts()}})}onScanChannel(t){let e=JSON.parse(JSON.stringify(t));delete e.Channel,this.productService.scanCompareToPos([e]).subscribe(i=>{i.Status?(this.initPageLoader(C.GuidEMpty),this.toastrService.success(`product ${t.Name} have been successfully scanned and synchronized with POS`,"Success")):this.toastrService.error(`Product ${t.Name} is not existed in POS`,"Error")})}onShowVariantDetail(t){let e=this.products[t].Variant;e.length>0&&this.dialog.open(xe,{data:{title:this.products[t].Name,variants:e},width:"30%"})}getRowCount(){let t={ChannelID:this.searchFilter.ChannelID,text:this.searchFilter.text,HaveSku:parseInt(this.searchFilter.HaveSku)};this.http.post("/api/product/GetProductChannelNotPOSRowCount",t).subscribe(e=>{this.hasClickRowCount=!0,this.rowCount=e.Count})}};r.\u0275fac=function(e){return new(e||r)(S(K),S(J),S(j),S(W),S(Pt),S(R))},r.\u0275cmp=M({type:r,selectors:[["app-not-in-pos"]],decls:30,vars:13,consts:[["headerTitle","Not in POS","textButton","Search","description","SKU sold in Marketplace but not exist in DEALPOS",3,"onSubmit"],["type","button","data-cy","scanNotInPos","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],[4,"ngIf"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp",""],[1,"mt-5"],[1,"fw-bold"],["name","haveSKU",1,"form-control","h-100","pt-3","rounded","mt-2",3,"ngModelChange","ngModel"],[1,"me-5",3,"value"],["type","text","name","Item_id","id","Item_id","placeholder","item id",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button","data-cy","scanNotInPos",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","ms-3",3,"click"],[1,"fa","fa-download"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onCheckBoxChange","onDescEvent","onDownload","onScan","showRedirectIcon","title","image","imageForZoom","code","description","downloadButton","channels","showCheckBox","scanButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(e,i){e&1&&(a(0,"mainpanel",0),f("onSubmit",function(_){return i.onSearch(_)}),a(1,"actions"),x(2,Sn,3,0,"button",1)(3,xn,4,1,"ng-container",2),l(),a(4,"filters")(5,"div")(6,"label",3),d(7,"Channel"),l(),a(8,"ng-select",4),F("ngModelChange",function(_){return T(i.searchFilter.ChannelID,_)||(i.searchFilter.ChannelID=_),_}),x(9,vn,3,3,"ng-template",5),l()(),a(10,"div",6)(11,"label",7),d(12,"SKU Assigned"),l(),a(13,"mat-radio-group",8),F("ngModelChange",function(_){return T(i.searchFilter.HaveSku,_)||(i.searchFilter.HaveSku=_),_}),a(14,"mat-radio-button",9),d(15," All "),l(),a(16,"mat-radio-button",9),d(17," Yes "),l(),a(18,"mat-radio-button",9),d(19," No "),l()()(),a(20,"div",6)(21,"label",7),d(22,"Item ID"),l(),a(23,"input",10),F("ngModelChange",function(_){return T(i.searchFilter.Item_id,_)||(i.searchFilter.Item_id=_),_}),l()()(),a(24,"content")(25,"div",11)(26,"div",12),x(27,Pn,2,13,"div",13)(28,bn,3,0,"ng-container",2),l(),x(29,In,3,4,"div",14),l()()()),e&2&&(c(2),s("ngIf",!i.productService.hasSelection(i.products)),c(),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("items",i.channelOptions),O("ngModel",i.searchFilter.ChannelID),c(5),O("ngModel",i.searchFilter.HaveSku),c(),s("value",0),c(2),s("value",1),c(2),s("value",2),c(5),O("ngModel",i.searchFilter.Item_id),c(4),s("ngForOf",i.products),c(),s("ngIf",i.products.length==0),c(),s("ngIf",(i.products==null?null:i.products.length)>0))},dependencies:[N,A,ot,U,L,B,Y,rt,re,ae,z,q,$],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.itemTitle[_ngcontent-%COMP%]{cursor:pointer}"]});let o=r;return o})();function wn(o,r){if(o&1&&(a(0,"span",9),g(1,"img",10),l(),d(2)),o&2){let n=r.item,t=p();c(),s("src",t.getChannelLogo(n.TypeID),D),c(),w(" ",n.Name," ")}}function yn(o,r){if(o&1&&(a(0,"div",11),g(1,"app-duplicate-product-card",12),l()),o&2){let n=r.$implicit,t=r.index;c(),s("imageForZoom",n.ImageUrl)("title",n.Name)("code",n.Code)("id",t)("image",n.ThumbnailURL)("channels",n.Channels)}}function Mn(o,r){o&1&&(P(0),a(1,"div",13),g(2,"app-empty-state"),l(),b())}function Dn(o,r){if(o&1){let n=v();P(0),a(1,"div",14)(2,"div",15)(3,"app-custom-paginator",16),f("next",function(){m(n);let e=p();return u(e.getProducts())})("previous",function(){m(n);let e=p();return u(e.getProducts())})("total",function(){m(n);let e=p();return u(e.getRowCount())}),l()()(),b()}if(o&2){let n=p();c(3),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickedRowCount)}}var Oe=(()=>{let r=class r{constructor(t,e,i){this.httpService=t,this.productService=e,this.authService=i,this.searchFilter=new Z,this.products=[],this.hasClickedRowCount=!1,this.getPageLoader(),this.channelOptions=i.getChannels()}getPageLoader(){this.productService.loader().subscribe(t=>{this.searchFilter=t.Filter,this.searchFilter.PageSize=t.Filter.RowCount,this.getProducts()})}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,RowCount:this.searchFilter.RowCount,PageNumber:this.searchFilter.PageNumber,text:this.searchFilter.text};this.httpService.post("/api/product/GetDuplicateInChannel",t).subscribe(e=>{this.products=e.Data})}onSearch(t){this.searchFilter.text=t,this.hasClickedRowCount=!1,this.getProducts()}onClearFilter(){this.searchFilter.ChannelID=C.GuidEMpty}getChannelLogo(t){return C.getChannelLogoByTypeId(t)}getRowCount(){let t={text:this.searchFilter.text,ChannelID:this.searchFilter.ChannelID};this.httpService.post("/api/product/GetDuplicateInChannelRowCount",t).subscribe(e=>{this.hasClickedRowCount=!0,this.rowCount=e.Total})}};r.\u0275fac=function(e){return new(e||r)(S(K),S(j),S(R))},r.\u0275cmp=M({type:r,selectors:[["app-duplicate-sku"]],decls:14,vars:7,consts:[["headerTitle","Multiple Listing","textButton"," Search","description","SKU(s) which is listed more than one time (one to many)",3,"onSubmit"],["container",""],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clear","multiple","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid"],[1,"row","mt-8","mx-1"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"imageForZoom","title","code","id","image","channels"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"next","previous","total","filter","totaldata","paginationTotal","hasClicked"]],template:function(e,i){e&1&&(a(0,"mainpanel",0),f("onSubmit",function(_){return i.onSearch(_)}),a(1,"filters")(2,"div",1)(3,"div")(4,"h6",2),d(5,"Channel"),l(),a(6,"ng-select",3),F("ngModelChange",function(_){return T(i.searchFilter.ListChannelID,_)||(i.searchFilter.ListChannelID=_),_}),f("clear",function(){return i.onClearFilter()}),x(7,wn,3,2,"ng-template",4),l()()()(),a(8,"content")(9,"div",5)(10,"div",6),x(11,yn,2,6,"div",7)(12,Mn,3,0,"ng-container",8),l(),x(13,Dn,4,4,"ng-container",8),l()()()),e&2&&(c(6),s("multiple",!0)("clearable",!0)("items",i.channelOptions),O("ngModel",i.searchFilter.ListChannelID),c(5),s("ngForOf",i.products),c(),s("ngIf",(i.products==null?null:i.products.length)==0),c(),s("ngIf",(i.products==null?null:i.products.length)>0))},dependencies:[N,A,U,L,B,Y,rt,wt,Tt,z,$]});let o=r;return o})();var On=()=>["/menu/products/status/sold-in-channel"],Te=o=>({ID:o}),Tn=()=>["/menu/products/status/not-in-pos"];function Fn(o,r){if(o&1&&(P(0),d(1),b()),o&2){let n=p().$implicit;c(),w(" ",n.Count," ")}}function En(o,r){if(o&1){let n=v();a(0,"span",26),f("click",function(){m(n);let e=p().$implicit,i=p(2);return u(i.getLiveProductCount(e.ID,e))}),g(1,"i",27),l()}}function Nn(o,r){if(o&1){let n=v();a(0,"tr")(1,"td"),g(2,"img",17),a(3,"span",18),d(4),l()(),a(5,"td",19),x(6,Fn,2,1,"ng-container",6)(7,En,2,0,"ng-template",null,1,nt),l(),a(9,"td",19)(10,"a",20),d(11),E(12,"number"),l()(),a(13,"td",19)(14,"a",20),d(15),E(16,"number"),l()(),a(17,"td"),d(18),E(19,"date"),l(),a(20,"td")(21,"div",21)(22,"button",22),f("click",function(){let e=m(n).$implicit,i=p(2);return u(i.onScanChannel(e))}),g(23,"i",23),d(24," Scan "),l(),a(25,"button",24),f("click",function(){let e=m(n).$implicit,i=p(2);return u(i.onClearCache(e.ID))}),g(26,"i",25),d(27," Clear "),l()()()()}if(o&2){let n=r.$implicit,t=G(8),e=p(2);c(2),s("src",e.getChannelLogo(n.TypeID),D),c(2),et(n.Name),c(2),s("ngIf",n.Count!==void 0)("ngIfElse",t),c(4),s("routerLink",X(18,On))("queryParams",pt(19,Te,n.ID)),c(),w(" ",V(12,11,n.SoldInChannel)," "),c(3),s("routerLink",X(21,Tn))("queryParams",pt(22,Te,n.ID)),c(),w(" ",V(16,13,n.NotInPOS)," "),c(3),w("",n.LastSync?Wt(19,15,n.LastSync,"dd MMM yyyy HH:mm"):"Never"," ")}}function kn(o,r){if(o&1&&(P(0),a(1,"div",7)(2,"table",8)(3,"thead",9)(4,"tr",10)(5,"th"),d(6,"Channel"),l(),a(7,"th",11),d(8,"Live Product"),l(),a(9,"th",12),d(10,"Sold In Channel"),l(),a(11,"th",13),d(12,"Product Not in POS"),l(),a(13,"th",14),d(14,"Last Sync"),l(),g(15,"th",15),l()(),a(16,"tbody"),x(17,Nn,28,24,"tr",16),E(18,"async"),l()()(),b()),o&2){let n,t=p();c(17),s("ngForOf",(n=V(18,1,t.channels$))==null?null:n.Data)}}function Vn(o,r){o&1&&(a(0,"div",28),g(1,"app-empty-state"),l())}var Fe=(()=>{let r=class r{constructor(t,e,i,h){this.productService=t,this.toastr=e,this.dialog=i,this.authService=h,this.destroy$=new Lt,this.channelOptions=h.getChannels()}ngOnInit(){this.setObsProductStatistic()}setObsProductStatistic(){this.channels$=this.productService.getProductStatistic()}getLiveProductCount(t,e){this.productService.getTotalProductLive(t).pipe(kt(this.destroy$)).subscribe(i=>{e.Count=i.Count})}onScanChannel(t){this.dialog.open(k,{width:"700px",data:{channelOptions:this.channelOptions,filter:{ChannelID:t.ID},disabledChannelOption:!0}}).afterClosed().pipe(y(e=>C.IsNotEmpty(e))).subscribe(e=>{this.scanAllProduct(t.ID,e)})}scanAllProduct(t,e){let i=this.productService.findChannelById(t,this.channelOptions);this.productService.scanAll(e.ChannelID,e.ScanFull,e.UpdatedProduct,e.Async).pipe(y(h=>h)).subscribe(h=>{e.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(h,i,!e.UpdatedProduct),this.setObsProductStatistic())})}onClearCache(t){confirm("Are you sure you want to Clear Cache? This Process will remove your product integration to marketplace")&&this.productService.clearCacheChannel(t).pipe(kt(this.destroy$)).subscribe(i=>{this.toastr.success("Successfully cleared cache","Success"),this.setObsProductStatistic()})}getChannelLogo(t){return C.getChannelLogoByTypeId(t)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};r.\u0275fac=function(e){return new(e||r)(S(j),S(W),S(J),S(R))},r.\u0275cmp=M({type:r,selectors:[["app-channel-statistic"]],decls:9,vars:6,consts:[["EMPTY",""],["QUESTION",""],["headerTitle","Products Statistic",3,"hideSearchBox","hideSearchDropdown"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[1,"text-center",2,"width","13rem"],[1,"text-center",2,"width","9rem"],[1,"text-center",2,"width","14rem"],[2,"width","10rem"],[2,"width","12rem"],[4,"ngFor","ngForOf"],[2,"width","24px","height","24px",3,"src"],[1,"ms-3"],[1,"text-center"],[3,"routerLink","queryParams"],[1,"d-flex","align-items-center","justify-content-center"],[1,"btn","btn-sm","btn-secondary","fs-6",3,"click"],[1,"fa","fa-spinner"],[1,"btn","btn-sm","btn-secondary","fs-6","ms-3",3,"click"],[1,"fa","fa-trash"],["matTooltip","Click to see total live product",1,"cursor-pointer","fs-5","text-primary",3,"click"],[1,"fa-solid","fa-circle-question","cursor"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(e,i){if(e&1&&(a(0,"mainpanel",2)(1,"content")(2,"div",3)(3,"div",4)(4,"div",5),x(5,kn,19,3,"ng-container",6),E(6,"async"),x(7,Vn,2,0,"ng-template",null,0,nt),l()()()()()),e&2){let h,_=G(8);s("hideSearchBox",!0)("hideSearchDropdown",!0),c(5),s("ngIf",((h=V(6,4,i.channels$))==null||h.Data==null?null:h.Data.length)>0)("ngIfElse",_)}},dependencies:[N,A,B,yt,bt,$,St,xt,Kt]});let o=r;return o})();var An=[{component:Pe,path:"",children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:we,canActivate:[tt],data:{title:"Products in POS"}},{path:"sold-in-channel",component:ye,canActivate:[tt],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:Me,canActivate:[tt],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:De,canActivate:[tt],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:Oe,canActivate:[tt],data:{title:"Duplicate Sku in Channel"}},{path:"channel-statistic",component:Fe,canActivate:[tt],data:{title:"Channel Statistic"}}]}],mo=(()=>{let r=class r{};r.\u0275fac=function(e){return new(e||r)},r.\u0275mod=$t({type:r}),r.\u0275inj=jt({imports:[vt,It,ne,Mt,Yt,ve,le,oe,Tt,z,q,zt.forChild(An),Ce,Zt,ct]});let o=r;return o})();export{mo as StatusModule};
|