marketplacepos 5.44.0 → 5.44.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/Marketplace/{chunk-XYEV5RMD.js → chunk-2TXL3UEN.js} +1 -1
  2. package/Marketplace/{chunk-DHIDUIOD.js → chunk-3DMGCQAD.js} +1 -1
  3. package/Marketplace/{chunk-JF4QOCAZ.js → chunk-3IIKX554.js} +1 -1
  4. package/Marketplace/{chunk-EVXMYPWP.js → chunk-3YNS3PF3.js} +1 -1
  5. package/Marketplace/{chunk-MRODDSR7.js → chunk-4GW36MPQ.js} +1 -1
  6. package/Marketplace/{chunk-HZHUTC6E.js → chunk-4J4NGUMH.js} +1 -1
  7. package/Marketplace/{chunk-X67M7TFE.js → chunk-5SYAYUVP.js} +1 -1
  8. package/Marketplace/{chunk-M6YFSBMG.js → chunk-5UGNYVSK.js} +1 -1
  9. package/Marketplace/chunk-66N77XWP.js +1 -0
  10. package/Marketplace/chunk-6EH5RQIV.js +1 -0
  11. package/Marketplace/{chunk-JHYTM6OD.js → chunk-6JUVLRWS.js} +1 -1
  12. package/Marketplace/{chunk-YRSF6N67.js → chunk-74U7L3IP.js} +1 -1
  13. package/Marketplace/{chunk-ZMEMG7ZN.js → chunk-7YA3MQOI.js} +1 -1
  14. package/Marketplace/{chunk-OFD3D5IO.js → chunk-AVT3WVH4.js} +1 -1
  15. package/Marketplace/chunk-BAUHJDSM.js +1 -0
  16. package/Marketplace/chunk-BXW7N3ER.js +1 -0
  17. package/Marketplace/{chunk-ZXNM4AGN.js → chunk-CZDUJH26.js} +1 -1
  18. package/Marketplace/{chunk-55BJO7BI.js → chunk-DUEZ2ZYL.js} +2 -2
  19. package/Marketplace/{chunk-JIOSKHGT.js → chunk-DXEJKRNB.js} +1 -1
  20. package/Marketplace/{chunk-PVPN53WE.js → chunk-EYBZQLBT.js} +1 -1
  21. package/Marketplace/{chunk-BO7BG424.js → chunk-FIXI7CJ5.js} +1 -1
  22. package/Marketplace/{chunk-LFAU6HXM.js → chunk-GGSB6FC2.js} +1 -1
  23. package/Marketplace/{chunk-MKUH4R2N.js → chunk-GLZJR5RB.js} +1 -1
  24. package/Marketplace/{chunk-TZQFN56G.js → chunk-GYPJGQYN.js} +1 -1
  25. package/Marketplace/{chunk-IMEGV3MV.js → chunk-HVLMIZAB.js} +1 -1
  26. package/Marketplace/{chunk-5GLSI4QU.js → chunk-IBCRFNV4.js} +1 -1
  27. package/Marketplace/{chunk-5W7TCSDK.js → chunk-IT3DTSKV.js} +1 -1
  28. package/Marketplace/{chunk-22AHRDNQ.js → chunk-KCH7AGAT.js} +1 -1
  29. package/Marketplace/{chunk-V4D6BB2N.js → chunk-KPGKJKR5.js} +1 -1
  30. package/Marketplace/{chunk-NSS35UR3.js → chunk-KX7FIURR.js} +1 -1
  31. package/Marketplace/{chunk-HWHDJDQN.js → chunk-L6WNU54G.js} +1 -1
  32. package/Marketplace/{chunk-4YWSKMFD.js → chunk-LZQRF7OP.js} +1 -1
  33. package/Marketplace/chunk-M6UMLTY2.js +1 -0
  34. package/Marketplace/{chunk-LRCKOJEI.js → chunk-M6UQ3NJ3.js} +1 -1
  35. package/Marketplace/{chunk-ELE7BOLL.js → chunk-M7HQIICB.js} +1 -1
  36. package/Marketplace/{chunk-OFUTQWBX.js → chunk-MMLMRH2X.js} +1 -1
  37. package/Marketplace/{chunk-KGMQTWMX.js → chunk-NAT7HRBS.js} +1 -1
  38. package/Marketplace/chunk-NRNXUMZX.js +1 -0
  39. package/Marketplace/{chunk-64JGYG54.js → chunk-NXOXSOUJ.js} +1 -1
  40. package/Marketplace/{chunk-MDHPQWC7.js → chunk-O6GXF2YS.js} +2 -2
  41. package/Marketplace/{chunk-C3VEI2IE.js → chunk-O75DCJY4.js} +1 -1
  42. package/Marketplace/{chunk-GRIUDEPO.js → chunk-OWQ3RWNF.js} +1 -1
  43. package/Marketplace/{chunk-LYBSI3ZX.js → chunk-PAMSUURJ.js} +1 -1
  44. package/Marketplace/{chunk-4PDRBB73.js → chunk-PH6H2XX4.js} +1 -1
  45. package/Marketplace/{chunk-X743YBE6.js → chunk-Q6P7MEKT.js} +1 -1
  46. package/Marketplace/{chunk-ENLYKIFW.js → chunk-QANQWW5Y.js} +1 -1
  47. package/Marketplace/{chunk-UCQKKX2L.js → chunk-QINTIYLK.js} +1 -1
  48. package/Marketplace/{chunk-RHCH74ZR.js → chunk-R46PZJM7.js} +1 -1
  49. package/Marketplace/{chunk-QYCOQS7D.js → chunk-ROEKFCHJ.js} +2 -2
  50. package/Marketplace/{chunk-STPUGFHI.js → chunk-S25SHAFH.js} +1 -1
  51. package/Marketplace/{chunk-W7VYUPIP.js → chunk-SNPFU5TF.js} +1 -1
  52. package/Marketplace/{chunk-LYZVX4EZ.js → chunk-U7I4JXN6.js} +11 -11
  53. package/Marketplace/chunk-UD3DLFU3.js +1 -0
  54. package/Marketplace/{chunk-NDSJ4AAU.js → chunk-UTCTTFIM.js} +1 -1
  55. package/Marketplace/{chunk-W7H6T326.js → chunk-UWAXFTHD.js} +1 -1
  56. package/Marketplace/{chunk-EJWZFRMT.js → chunk-UYYAK364.js} +1 -1
  57. package/Marketplace/{chunk-G3O7MWIB.js → chunk-VA7FHRY6.js} +1 -1
  58. package/Marketplace/{chunk-TPC5KHGH.js → chunk-VK3NG4L3.js} +1 -1
  59. package/Marketplace/{chunk-RMAEWPJV.js → chunk-VPWALMDU.js} +1 -1
  60. package/Marketplace/{chunk-KIPJJIYU.js → chunk-WMFWJNS5.js} +1 -1
  61. package/Marketplace/{chunk-LC6TXSYB.js → chunk-WQ3GDXQW.js} +1 -1
  62. package/Marketplace/{chunk-WKUTDZ7J.js → chunk-X3TNRXVW.js} +1 -1
  63. package/Marketplace/chunk-YERZ6W22.js +1 -0
  64. package/Marketplace/{chunk-TPW56VWM.js → chunk-YTL4RBBS.js} +1 -1
  65. package/Marketplace/{chunk-WY4BY2ID.js → chunk-ZKZ5DIIR.js} +1 -1
  66. package/Marketplace/{chunk-3VUDKIND.js → chunk-ZOKAF4JQ.js} +1 -1
  67. package/Marketplace/index.html +2 -2
  68. package/Marketplace/{main-WUG4WUAT.js → main-QWLBNOBB.js} +1 -1
  69. package/package.json +1 -1
  70. package/Marketplace/chunk-G5DA2OSB.js +0 -1
  71. package/Marketplace/chunk-H3DIKLA5.js +0 -1
  72. package/Marketplace/chunk-PANQ33RQ.js +0 -1
  73. package/Marketplace/chunk-UUSBNUEH.js +0 -1
  74. package/Marketplace/chunk-W3L5LPU5.js +0 -1
  75. package/Marketplace/chunk-XF4BVLTJ.js +0 -1
  76. package/Marketplace/chunk-ZEYELO7U.js +0 -1
@@ -0,0 +1 @@
1
+ import{a as rn}from"./chunk-OPFENZ3W.js";import{a as Ke}from"./chunk-H3IVI3LN.js";import{a as Le}from"./chunk-NXOXSOUJ.js";import"./chunk-MS4AQ6UA.js";import{a as Be,b as je}from"./chunk-W6FZQ6XT.js";import{a as an}from"./chunk-LDHQNVI5.js";import{a as Z}from"./chunk-EPVCMYCI.js";import{e as Pt}from"./chunk-GLZJR5RB.js";import"./chunk-35XX6SQT.js";import{d as He,k as Qe,l as Xe,m as tn,n as en,o as nn}from"./chunk-L3FX4O3H.js";import{a as Ht}from"./chunk-GCDQNJQN.js";import{a as Q}from"./chunk-R46PZJM7.js";import"./chunk-PE5AFID4.js";import{a as Gt,b as zt,c as We}from"./chunk-K5GEJ2GZ.js";import{b as ln}from"./chunk-B5V5KFQU.js";import{a as Ye,b as Ze}from"./chunk-E4Z7OR75.js";import{a as q}from"./chunk-Q6P7MEKT.js";import{a as pt}from"./chunk-CCWNSX4Y.js";import{c as Ge,f as ze}from"./chunk-PNITO7BE.js";import"./chunk-E4KNET2R.js";import{b as on}from"./chunk-ZQ5EGXEB.js";import"./chunk-3LRWABHB.js";import"./chunk-74IXJYWO.js";import"./chunk-GIRXMYNI.js";import"./chunk-YPWHTELF.js";import"./chunk-OLOIQI4D.js";import"./chunk-RECNBAEB.js";import"./chunk-IA6KOBDJ.js";import"./chunk-M5XGP4SG.js";import"./chunk-SN4AOGQK.js";import"./chunk-SB7NWPDS.js";import"./chunk-AYPY47VM.js";import"./chunk-SM3P57SO.js";import{a as Y}from"./chunk-YTL4RBBS.js";import"./chunk-IIZDEGGW.js";import"./chunk-AQTXFEBA.js";import{a as qe}from"./chunk-SYUFPF3D.js";import"./chunk-SDUUFQUI.js";import"./chunk-5OHRA4AS.js";import"./chunk-IL5JIRWJ.js";import"./chunk-MH4SJTQX.js";import"./chunk-3RK6DDJD.js";import{a as Wt}from"./chunk-CUB2QFUO.js";import{f as $e}from"./chunk-KALG6D6L.js";import{a as U}from"./chunk-UMP6ZMEJ.js";import"./chunk-PAEIUO2F.js";import"./chunk-OZ7LWNOK.js";import"./chunk-ECRWEMEV.js";import"./chunk-LZCEM2PC.js";import{a as Re,b as Ae}from"./chunk-IMK2JGZA.js";import"./chunk-CMTBBXR5.js";import{a as dt}from"./chunk-7KG3DC5J.js";import"./chunk-ZOKAF4JQ.js";import{a as Je}from"./chunk-YERZ6W22.js";import{a as ot}from"./chunk-D6URDVES.js";import{h as K}from"./chunk-ZKZ5DIIR.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-AEOSNAHH.js";import"./chunk-TGMCGROM.js";import{a as Oe}from"./chunk-OWQ3RWNF.js";import{b as z,e as H}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{a as xt,b as Bt,d as lt,e as Ee}from"./chunk-5JVEEL2T.js";import{b as I,c as f}from"./chunk-PW42BQIY.js";import{b as yt,c as vt,d as it,e as ke,f as Fe,g as Ve,h as Ne,i as jt,j as bt,k as $t,m as J,n as Ue}from"./chunk-UGVEAL7H.js";import{A as St,b as Me,c as ft,h as j,m as $}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{a as Te,b as nt,c as De}from"./chunk-SWQXSJ7O.js";import{r as ct,s as st}from"./chunk-IHNN4Q2N.js";import"./chunk-EQIFZBRG.js";import{E as Lt,F as Pe,G as rt,H as Ie,J as we,d as Ut,f as B,g as N,j as gt,k as be,m as Ct,n as et}from"./chunk-M2FCTYGU.js";import{$c as k,Fc as W,G as F,Gb as T,Gc as p,Hb as Ce,Hc as A,Ic as b,Ka as Dt,Kb as fe,Kc as D,Lc as O,Mb as h,Mc as E,Ra as ut,Rc as Ot,Sc as w,Tc as oe,Vc as ye,Xb as te,Yb as l,Z as ue,Zb as Se,aa as Tt,ad as V,bd as ve,ca as Xt,cd as G,dc as R,ea as he,ec as ee,f as me,gc as ne,hc as ie,ic as o,jc as r,ka as _e,kc as g,lc as y,mc as v,ob as ge,oc as x,pa as tt,pb as M,rb as a,tc as C,uc as s,v as Rt,vc as xe,wc as At,xb as S,ya as m,za as u}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var cn=(()=>{class i{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"},{Title:"Scan Job",Url:"/menu/products/status/notification",Description:"Scan results for each channel, including product counts and synchronization status"}]}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=T({type:i,selectors:[["app-status"]],standalone:!1,decls:5,vars:1,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"]],template:function(n,e){n&1&&(o(0,"nav",0)(1,"div",1)(2,"div"),g(3,"nav-tab",2),r()()(),g(4,"router-outlet")),n&2&&(a(3),l("Tabs",e.productTabs))},dependencies:[Re,Pe],encapsulation:2})}}return i})();function xn(i,d){if(i&1&&(o(0,"div",10),g(1,"img",11),o(2,"span"),p(3),r()()),i&2){let t=d.$implicit;l("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),a(),l("src",t.Img,M),a(2),A(t.Name)}}function yn(i,d){if(i&1&&(o(0,"div",10),g(1,"img",11),o(2,"span"),p(3),r()()),i&2){let t=d.$implicit;l("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),a(),l("src",t.Img,M),a(2),A(t.Name)}}function vn(i,d){if(i&1&&(o(0,"div",10),g(1,"img",11),o(2,"span"),p(3),r()()),i&2){let t=d.$implicit;l("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),a(),l("src",t.Img,M),a(2),A(t.Name)}}function bn(i,d){if(i&1&&(o(0,"mat-radio-button",16),p(1," Sellable "),r()),i&2){let t=s(2);l("value",t.scanTypeEnum.Sellable)}}function Pn(i,d){if(i&1){let t=x();o(0,"div",12)(1,"label",13),p(2,"Scan Type"),r(),o(3,"mat-radio-group",14),E("ngModelChange",function(e){m(t);let c=s();return O(c.filter.ScanFull,e)||(c.filter.ScanFull=e),u(e)}),o(4,"mat-radio-button",15),p(5," All "),r(),h(6,bn,2,1,"mat-radio-button",16),o(7,"mat-radio-button",17),p(8," Active "),r()()()}if(i&2){let t=s();a(3),D("ngModel",t.filter.ScanFull),a(),l("value",t.scanTypeEnum.All),a(2),R(t.selectedChannel.TypeID==t.channelType.Tiktok?6:-1),a(),l("value",t.scanTypeEnum.Active)}}function In(i,d){i&1&&(o(0,"span"),p(1,"Never"),r())}function wn(i,d){if(i&1&&(o(0,"span"),p(1),k(2,"async"),r()),i&2){let t=s(2);a(),A(V(2,1,t.lastSync$))}}function Mn(i,d){if(i&1){let t=x();o(0,"div",8)(1,"label",5)(2,"span",18),p(3,"Last Scan:"),r(),h(4,In,2,0,"span"),k(5,"async"),h(6,wn,3,3,"span"),r(),o(7,"mat-radio-group",19),E("ngModelChange",function(e){m(t);let c=s();return O(c.filter.UpdatedProduct,e)||(c.filter.UpdatedProduct=e),u(e)}),o(8,"mat-radio-button",20),p(9," Scan All Products "),r(),o(10,"mat-radio-button",21),p(11),r()()()}if(i&2){let t=s();a(4),R(V(5,6,t.lastSync$)==null?4:6),a(3),D("ngModel",t.filter.UpdatedProduct),a(),l("value",!1),a(2),l("value",!0)("matTooltip",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Use Tokopedia URL for mapping SKU between POS and Tokopedia":"Scan only products that have been updated since the last channel scan"),a(),b(" ",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Product Download By URL":"Scan Updated Products"," ")}}function Tn(i,d){if(i&1){let t=x();o(0,"div",8)(1,"label",5),p(2," Scan Option "),r(),o(3,"mat-radio-group",22),E("ngModelChange",function(e){m(t);let c=s();return O(c.filter.Async,e)||(c.filter.Async=e),u(e)}),o(4,"mat-radio-button",23),p(5," Asynchronous (Get Notified when Complete) "),r(),o(6,"mat-radio-button",24),p(7," Synchronous (Wait until Complete) "),r()()()}if(i&2){let t=s();a(3),D("ngModel",t.filter.Async),a(),l("value",!0),a(2),l("value",!1)}}var L=(()=>{class i extends Ke{constructor(t,n,e){super(),this.dialogRef=t,this.data=n,this.router=e,this.channelService=tt(Le),this.channelType=I,this.disabledChannelOption=!1,this.filter={ChannelID:f.GuidEMpty,ScanFull:0,UpdatedProduct:!1,Async:!1},this.scanTypeEnum=Je,this.isSingleChannel=f.IsNotEmpty(n.isSingleChannel)?this.data.isSingleChannel:!1,this.disabledChannelOption=f.IsEmpty(n.disabledChannelOption)?!1:this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}ngAfterViewInit(){this.initTopPosition()}ngOnDestroy(){this.stopOverlayObserver()}initModalConfig(){this.modalConfig=new bt,this.modalConfig.title=this.isSingleChannel?"Scan Single Product":"Scan Channel Marketplace",this.modalConfig.bodyScrollable=!0}initFilter(){this.filter.ChannelID=this.data?.filter?.ChannelID}initChannelOptions(){this.channelOptions=JSON.parse(JSON.stringify(this.data.channelOptions)),this.isSingleChannel&&(this.channelOptions=this.channelOptions.map(t=>(t.disabled=!0,(t.TypeID==I.Tiktok||t.TypeID==I.Tokopedia||t.TypeID==I.Lazada||t.TypeID==I.WooCommerce)&&(t.disabled=!1),t)).sort(t=>t.disabled?1:-1))}onSelectChannel(t){let n=this.filterChannelById(t);this.selectedChannel=n,this.filter.Async=!0,this.iniHasScanUpdate(),this.getLastSync(t)}onClickSelect(){setTimeout(()=>{this.adjustOverlayPosition()},0)}getLastSync(t){this.lastSync$=this.channelService.getLastSync(t).pipe(Rt(n=>(this.selectedChannel.LastSync=n.LastSync,this.setDefaultConfigUpdate(),f.IsNotEmpty(n.LastSync)?f.convertToReadableDate(n.LastSync):null)),ue(1))}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&f.IsNotEmpty(this.selectedChannel.LastSync)&&(this.selectedChannel.TypeID==I.Shopee||this.selectedChannel.TypeID==I.Tiktok||this.selectedChannel.TypeID==I.Lazada)&&(this.filter.UpdatedProduct=!0)}iniHasScanUpdate(){this.selectedChannel?.TypeID!=I.WooCommerce&&this.selectedChannel?.TypeID!=I.KalCare&&this.selectedChannel?.TypeID!=I.None&&!this.isSingleChannel?this.hasScanUpdate=!0:this.hasScanUpdate=!1}filterChannelById(t){let n;return this.channelOptions&&(n=this.channelOptions.find(e=>e.ID==t)),n}submit(){this.selectedChannel.TypeID==I.Tokopedia&&this.filter.UpdatedProduct?this.router.navigate(["/menu/products/download/by-url"]).then(()=>{this.dialogRef.close()}):this.dialogRef.close(this.filter)}isNotEmpty(t){return f.IsNotEmpty(t)}onClose(){this.dialogRef.close()}static{this.\u0275fac=function(n){return new(n||i)(S(yt),S(vt),S(rt))}}static{this.\u0275cmp=T({type:i,selectors:[["app-scan-dialog"]],features:[fe],decls:15,vars:8,consts:[["selectedItem",""],["item",""],[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[1,"mx-4"],[1,"mb-2","fw-bold"],["optionLabel","Name","optionValue","ID","placeholder","Select a Channel","appendTo","body","filterBy","Name",1,"w-100",2,"--p-select-padding-y","0.75rem",3,"click","ngModelChange","options","ngModel","filter"],["class","mt-4",4,"ngIf"],[1,"mt-8"],["class","mt-8",4,"ngIf"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],[2,"width","18px","margin-right","10px",3,"src"],[1,"mt-4"],[1,"mb-2","fw-bold","mt-3"],["name","scanType",1,"form-control","h-100","rounded-1",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Scans all products across every status in seller center",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Scans products with status Active, Pending, Seller Deactivated, and Unknown status in seller center",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Scan Product with Active status in seller center",1,"me-5",3,"value"],[1,"me-2"],["name","ScanFull",1,"form-control","h-100","rounded-1",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Scan product from beginning ( use this if you haven't scanned at all)",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above",1,"me-5",3,"value","matTooltip"],["name","Async",1,"form-control","h-100","rounded-1",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltip","Scan is running in the background, status will be visible in the notification menu","matTooltipPosition","above",1,"me-5",3,"value"],[1,"me-5",3,"value"]],template:function(n,e){if(n&1){let c=x();o(0,"modal-material",2),C("onOk",function(){return m(c),u(e.submit())})("onClose",function(){return m(c),u(e.onClose())})("onCancel",function(){return m(c),u(e.onClose())}),o(1,"div",3)(2,"div",4)(3,"label",5),p(4,"Select a Channel"),r(),o(5,"p-select",6),C("click",function(){return m(c),u(e.onClickSelect())}),E("ngModelChange",function(P){return m(c),O(e.filter.ChannelID,P)||(e.filter.ChannelID=P),u(P)}),C("ngModelChange",function(P){return m(c),u(e.onSelectChannel(P))}),h(6,xn,4,3,"ng-template",null,0,G)(8,yn,4,3,"ng-template",null,1,G)(10,vn,4,3,"ng-template",null,1,G),r(),h(12,Pn,9,4,"div",7)(13,Mn,12,8,"div",8)(14,Tn,8,3,"div",9),r()()()}n&2&&(l("dynamicValidated",e.isNotEmpty(e.filter.ChannelID))("config",e.modalConfig),a(5),l("options",e.channelOptions),D("ngModel",e.filter.ChannelID),l("filter",!0),a(7),l("ngIf",!e.isSingleChannel&&e.isNotEmpty(e.filter.ChannelID)),a(),R(e.hasScanUpdate&&e.selectedChannel?13:-1),a(),l("ngIf",!e.isSingleChannel&&e.isNotEmpty(e.filter.ChannelID)))},dependencies:[et,N,gt,je,Be,St,j,$,$t,Wt,zt,st,ct,ze,Gt],encapsulation:2})}}return i})();var _t=function(i){return i.Tokopedia="https://seller.tokopedia.com",i.Shoope="https://seller.shopee.co.id",i.Tiktok="https://seller-id.tiktok.com",i.WooCommerce="https://woocommerce.dealpos.app",i.Lazada="https://sellercenter.lazada.co.id",i}(_t||{});var re={Success:"Success",Info:"Info",Warning:"Warning",Error:"Error"};var Dn=[[["header"]],[["content"]],[["footer"]]],On=["header","content","footer"],En=(i,d)=>({bodyScrollable:i,hideScrollbar:d}),kn=(i,d,t,n)=>({"bg-success":i,"bg-warning":d,"bg-info":t,"bg-danger":n}),Fn=i=>({"mx-auto":i}),Vn=(i,d)=>({"show-footer":i,"p-0":d});function Nn(i,d){if(i&1){let t=x();o(0,"div",8),C("click",function(){m(t);let e=s();return u(e.onBack.emit())}),o(1,"a",9),g(2,"i",10),r()()}}function Rn(i,d){if(i&1){let t=x();o(0,"div")(1,"a",11),C("click",function(){m(t);let e=s();return u(e.onClose.emit())}),g(2,"i",12),r()()}}function An(i,d){if(i&1){let t=x();o(0,"a",16),C("click",function(){m(t);let e=s(2);return u(e.onCancel.emit())}),p(1),r()}if(i&2){let t=s(2);a(),b(" ",t.config!=null&&t.config.cancelText?t.config==null?null:t.config.cancelText:"Cancel","")}}function Un(i,d){if(i&1){let t=x();o(0,"button",17),C("click",function(){m(t);let e=s(2);return u(e.onOk.emit())})("keyup.F2",function(){m(t);let e=s(2);return u(e.onOk.emit())}),r()}if(i&2){let t=s(2);l("disabled",!(t.config!=null&&t.config.validated)||!t.dynamicValidated)("innerHTML",t.config!=null&&t.config.okText?t.config==null?null:t.config.okText:"Ok (F2)",ge)}}function Ln(i,d){if(i&1&&(o(0,"mat-dialog-actions",13),At(1,2),h(2,An,2,1,"a",14)(3,Un,1,2,"button",15),r()),i&2){let t=s();a(2),l("ngIf",!(t.config!=null&&t.config.hideCancel)),a(),l("ngIf",!(t.config!=null&&t.config.hideOk))}}var le=class{constructor(){this.title="New Modal",this.okText="Ok (F2)",this.cancelText="Cancel",this.hideFooter=!1,this.hideCancel=!1,this.hideOk=!1,this.hideClose=!1,this.eMoney=!1,this.headerType=re.Success,this.validated=!0,this.customWidth="initial",this.bodyScrollable=!1,this.hideScrollbar=!1,this.disableKeyup=!1,this.noPadding=!1}},sn=(()=>{class i{constructor(){this.dynamicValidated=!0,this.onOk=new Dt,this.onCancel=new Dt,this.onClose=new Dt,this.onBack=new Dt,this.headerType=re}ngOnInit(){this.config==null&&(this.config=new le)}onKeyup(t){this.config?.disableKeyup||(t.code=="F2"&&this.onOk.emit("F2"),(t.code=="Enter"||t.code=="NumpadEnter")&&this.onOk.emit("Enter"))}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=T({type:i,selectors:[["modal-material"]],inputs:{config:"config",dynamicValidated:"dynamicValidated"},outputs:{onOk:"onOk",onCancel:"onCancel",onClose:"onClose",onBack:"onBack"},ngContentSelectors:On,decls:11,vars:23,consts:[["id","modal_material",1,"modal-material","d-flex","align-items-start","flex-column","position-relative","maxHeight",3,"keyup","ngClass"],["mat-dialog-title","",1,"d-flex","w-100","justify-content-between","modal-header","position-relative",3,"ngClass"],["class","back-button position-absolute pointer d-print-none",3,"click",4,"ngIf"],[1,"d-flex","flex-row","d-print-none","align-items-center",3,"ngClass"],[1,"fw-normal"],[4,"ngIf"],[1,"modal-body","w-100",3,"ngClass"],["class","w-100 py-7 border-top d-flex justify-content-end d-print-none",4,"ngIf"],[1,"back-button","position-absolute","pointer","d-print-none",3,"click"],[1,"btn","back-button"],[1,"fa-solid","fa-arrow-left"],[1,"btn-light-blue","btn-sm","pointer","close",3,"click"],[1,"fa-solid","fa-xmark","fa-lg","text-primary"],[1,"w-100","py-7","border-top","d-flex","justify-content-end","d-print-none"],["class","btn btn-light-blue text-primary btn-lg fw-bold mx-3",3,"click",4,"ngIf"],["class","btn btn-light-blue me-6 text-primary btn-lg fw-bold mx-3","data-cy","btn-ok",3,"disabled","innerHTML","click","keyup.F2",4,"ngIf"],[1,"btn","btn-light-blue","text-primary","btn-lg","fw-bold","mx-3",3,"click"],["data-cy","btn-ok",1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3",3,"click","keyup.F2","disabled","innerHTML"]],template:function(n,e){n&1&&(xe(Dn),o(0,"div",0),C("keyup",function(_){return e.onKeyup(_)}),o(1,"div",1),h(2,Nn,3,0,"div",2),o(3,"div",3)(4,"h4",4),p(5),r(),At(6),r(),h(7,Rn,3,0,"div",5),r(),o(8,"mat-dialog-content",6),At(9,1),r(),h(10,Ln,4,2,"mat-dialog-actions",7),r()),n&2&&(Se("width",e.config==null?null:e.config.customWidth),l("ngClass",oe(10,En,e.config==null?null:e.config.bodyScrollable,e.config==null?null:e.config.hideScrollbar)),a(),l("ngClass",ye(13,kn,e.headerType.Success==(e.config==null?null:e.config.headerType),e.headerType.Warning==(e.config==null?null:e.config.headerType),e.headerType.Info==(e.config==null?null:e.config.headerType),e.headerType.Error==(e.config==null?null:e.config.headerType))),a(),l("ngIf",e.config==null?null:e.config.eMoney),a(),l("ngClass",w(18,Fn,e.config==null?null:e.config.eMoney)),a(2),A(e.config==null?null:e.config.title),a(2),l("ngIf",!(e.config!=null&&e.config.hideClose)),a(),l("ngClass",oe(20,Vn,!(e.config!=null&&e.config.hideFooter),e.config==null?null:e.config.noPadding)),a(2),l("ngIf",!(e.config!=null&&e.config.hideFooter)))},dependencies:[et,Ut,N,Ne,ke,Ve,Fe],styles:[".mat-mdc-dialog-container{padding:0!important;border-radius:4px!important;overflow:visible!important} .mat-mdc-dialog-container [mat-dialog-title]{color:#fff;padding:15px;border:none}@media print{ .mat-mdc-dialog-container{box-shadow:unset;width:100vw}}@media print{ .cdk-overlay-pane{position:absolute!important;top:-30px;max-width:100vw!important}.modal-body[_ngcontent-%COMP%]{width:100vw!important}}body.modal-body[_ngcontent-%COMP%]{height:100%;overflow-y:hidden}mat-dialog-actions[_ngcontent-%COMP%]{bottom:15px}mat-dialog-actions[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{padding:15px!important;margin-right:12px}mat-dialog-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:15px!important}mat-dialog-actions[_ngcontent-%COMP%] .more[_ngcontent-%COMP%]{margin-right:auto;margin-top:-1rem;padding-top:.4rem!important;margin-left:1rem}.back-button[_ngcontent-%COMP%]{top:5px;left:0}.close[_ngcontent-%COMP%]{padding:.4rem .5rem}.no-padding[_ngcontent-%COMP%]{padding:0}.modal-material[_ngcontent-%COMP%]{width:40vw}@media (max-width: 992px){.modal-material[_ngcontent-%COMP%]{width:50vw!important}}@media (max-width: 576px){ .dialog-filter .modal-material{width:100%!important} .dialog-filter mat-dialog-actions{position:sticky;bottom:0;background:#fff} .dialog-filter .modal-material.d-flex.align-items-start.flex-column.position-relative.maxHeight.bodyScrollable.maxHeight.bodyScrollable .modal-body{max-height:100%!important;overflow-y:auto}}.maxHeight.bodyScrollable[_ngcontent-%COMP%] .modal-body[_ngcontent-%COMP%]{max-height:450px;overflow-y:auto}.modal-header[_ngcontent-%COMP%], .modal-footer[_ngcontent-%COMP%], .modal-footer[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{padding:15px}.modal-dialog[_ngcontent-%COMP%]{max-width:none}.modal-content[_ngcontent-%COMP%]{width:auto;margin:auto;max-width:850px}.maxHeight[_ngcontent-%COMP%] .modal-body[_ngcontent-%COMP%]{max-height:450px;overflow:auto}.modal-body[_ngcontent-%COMP%]{padding:1rem}.modal-body[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{display:block}.modal-body[_ngcontent-%COMP%] .more[_ngcontent-%COMP%]{margin:0;position:absolute;bottom:-20px}.modal-body[_ngcontent-%COMP%] input[type=text][_ngcontent-%COMP%], .modal-body[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%], .modal-body[_ngcontent-%COMP%] input[type=password][_ngcontent-%COMP%]{border:1px solid #c8d3df;padding:5px 7px}.modal-body[_ngcontent-%COMP%] table[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{width:330px;height:90px}"]})}}return i})();var Bn=i=>({"is-disabled":i});function jn(i,d){if(i&1&&(y(0),o(1,"tr")(2,"td",10),p(3),r(),o(4,"td",10),p(5),r(),o(6,"td",11)(7,"p",12),p(8,"Product Not in Channel!"),r()()(),v()),i&2){let t=s().$implicit;a(3),b(" ",t==null?null:t.Model," "),a(2),b(" ",t==null?null:t.Code," ")}}function $n(i,d){if(i&1&&(o(0,"td",10),p(1),r()),i&2){let t=s(3).$implicit;te("rowspan",t.Channel.length),a(),b(" ",t==null?null:t.Model," ")}}function Wn(i,d){if(i&1&&(o(0,"td",10),p(1),r()),i&2){let t=s(3).$implicit;te("rowspan",t.Channel.length),a(),b(" ",t==null?null:t.Code," ")}}function Gn(i,d){if(i&1){let t=x();o(0,"tr"),h(1,$n,2,2,"td",13)(2,Wn,2,2,"td",13),o(3,"td",10)(4,"div",14)(5,"a",15),g(6,"img",16),r(),o(7,"div",17),p(8),r()()(),o(9,"td",10),p(10),k(11,"number"),r(),o(12,"td",18),p(13),k(14,"number"),r(),o(15,"td",19)(16,"div",20)(17,"button",21),C("click",function(){let e=m(t).$implicit,c=s(2).$implicit,_=s();return u(_.onDetach(e,c))}),g(18,"i",22),o(19,"span",23),p(20,"Detach"),r()(),o(21,"a",24),g(22,"i",25),o(23,"span",23),p(24,"Edit"),r()()()()()}if(i&2){let t=d.$implicit,n=d.$index,e=s(3);a(),l("ngIf",n==0),a(),l("ngIf",n==0),a(3),l("href",t.Url,M)("title",t.Title),a(),l("src",e.getChannelLogo(t.TypeID),M),a(),l("matTooltip",(t==null||t.Name==null?null:t.Name.length)>40?t==null?null:t.Name:""),a(),b(" ",t.Name," "),a(2),A(V(11,12,t.Price)),a(3),A(V(14,14,t.Inventory)),a(8),l("href",e.getHyperlinkSellerCenter(t),M)("ngClass",w(16,Bn,t.TypeID==e.channelType.KalCare))("matTooltip",t.TypeID!=e.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function zn(i,d){if(i&1&&ne(0,Gn,25,18,"tr",null,ee),i&2){let t=s().$implicit;ie(t==null?null:t.Channel)}}function Hn(i,d){if(i&1&&h(0,jn,9,2,"ng-container",9)(1,zn,2,0,"ng-template",null,0,G),i&2){let t=d.$implicit,n=W(2);l("ngIf",!t.Channel||t.Channel.length<1)("ngIfElse",n)}}var Kt=(()=>{class i{constructor(t,n){this.data=t,this.dialogRef=n,this.httpService=tt(H),this.toastr=tt(z),this.variants=ut([]),this.channelType=I,this.variants.set(this.data.variants),this.title=t.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new bt,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideFooter=!0,this.modalConfig.customWidth="850px"}onDetach(t,n){let e={ChannelID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariationID:t.ChannelVariationID};this.httpService.post(Oe.DetachVariant,[e]).subscribe(c=>{this.toastr.success(c.Message,"Success"),this.updateVariantAfterDetach(n,t.ChannelVariationID)})}updateVariantAfterDetach(t,n){this.variants.update(e=>{let c=e.findIndex(_=>_.ID===t.ID);return c!==-1&&(e[c].Channel=e[c].Channel.filter(_=>_.ChannelVariationID!==n)),[...e]})}getChannelLogo(t){return f.getChannelLogoByTypeId(t)}getHyperlinkSellerCenter(t){let n="javascript:void(0)";switch(t.TypeID){case I.Shopee:n=`${_t.Shoope}/portal/product/${t.ChannelItemID}`;break;case I.Tiktok:n=`${_t.Tiktok}/product/edit/${t.ChannelItemID}`;break;case I.Tokopedia:n=`${_t.Tokopedia}/edit-product/${t.ChannelItemID}`;break;case I.WooCommerce:n=`${_t.WooCommerce}/wp-admin/post.php?post=${t.ChannelItemID}&action=edit`;break;case I.Lazada:n=`${_t.Lazada}/apps/product/publish?productId=${t.ChannelItemID}`;break}return n}static{this.\u0275fac=function(n){return new(n||i)(S(vt),S(yt))}}static{this.\u0275cmp=T({type:i,selectors:[["app-modal-variant"]],decls:27,vars:1,consts:[["printChannelModal",""],[3,"onClose","onCancel","config"],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"text-start","sticky-top"],[1,"d-flex","align-items-center"],["matTooltip","Variant from POS",1,"fas","fa-info-circle","ms-1"],["matTooltip","Product and Variant from each Channel",1,"fas","fa-info-circle","ms-1"],[1,"text-start","sticky-top",2,"width","0%"],[4,"ngIf","ngIfElse"],[1,"text-start"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-start",4,"ngIf"],[1,"d-flex"],["target","_blank",1,"me-1",3,"href","title"],[2,"width","20px","height","20px",3,"src"],[1,"text-ellipsis","ps-2",2,"max-width","18vw",3,"matTooltip"],[1,"text-center"],[1,"text-end"],[1,"d-flex","align-items-center","justify-content-end"],[1,"btn","btn-small","btn-light","px-4","py-2","me-3",3,"click"],[1,"fa-sharp","fa-link-slash","me-2",2,"font-size","10px"],[1,"fs-6"],["target","_blank",1,"btn","btn-small","btn-light","px-4","py-2",3,"href","ngClass","matTooltip"],[1,"fa-solid","fa-edit","me-2",2,"font-size","10px"]],template:function(n,e){n&1&&(o(0,"modal-material",1),C("onClose",function(){return e.dialogRef.close()})("onCancel",function(){return e.dialogRef.close()}),o(1,"content")(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4)(6,"div",5)(7,"span"),p(8,"VARIANT"),r(),o(9,"sup"),g(10,"i",6),r()()(),o(11,"th",4),p(12,"SKU"),r(),o(13,"th",4)(14,"div",5)(15,"span"),p(16,"PRODUCT"),r(),o(17,"sup"),g(18,"i",7),r()()(),o(19,"th",4),p(20,"PRICE"),r(),o(21,"th",8),p(22,"INVENTORY"),r(),g(23,"th",4),r()(),o(24,"tbody"),ne(25,Hn,3,2,null,null,ee),r()()()()),n&2&&(l("config",e.modalConfig),a(25),ie(e.variants()))},dependencies:[et,Ut,N,Ct,st,ct,sn],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#fff!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}a.is-disabled[_ngcontent-%COMP%]{color:gray;cursor:default}a.is-disabled[_ngcontent-%COMP%]:hover{text-decoration:none}"]})}}return i})();function Kn(i,d){if(i&1&&(o(0,"mat-option",6)(1,"div"),g(2,"img",7),o(3,"span"),p(4),r()()()),i&2){let t=d.$implicit;l("value",t.ChannelID),a(2),l("src",t.logo,M),a(2),A(t.Title)}}var Mt=(()=>{class i{constructor(){this.dialogRef=tt(yt),this.channels=tt(vt),this.channelIds=ut([]),this.channelOptions=ut([])}ngOnInit(){this.initModalConfig();let t=this.channels.filter((n,e,c)=>c.findIndex(_=>_.ChannelID===n.ChannelID)===e);this.channelOptions.set(t)}initModalConfig(){this.modalConfig=new bt,this.modalConfig.title="Detach Product",this.modalConfig.okText="Save"}onClose(){this.dialogRef.close()}onSave(){let t=this.channels.filter(n=>this.channelIds().includes(n.ChannelID)).map(n=>({ChannelID:n.ChannelID,ChannelItemID:n.ChannelItemID}));this.dialogRef.close(t)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=T({type:i,selectors:[["app-modal-detach-product"]],decls:8,vars:5,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","multiple"],["class","channel-option",3,"value",4,"ngFor","ngForOf"],[1,"channel-option",3,"value"],[2,"width","18px","margin-right","10px",3,"src"]],template:function(n,e){n&1&&(o(0,"modal-material",0),C("onClose",function(){return e.onClose()})("onCancel",function(){return e.onClose()})("onOk",function(){return e.onSave()}),o(1,"div",1)(2,"div")(3,"label",2),p(4,"Select a Channel"),r(),o(5,"mat-form-field",3)(6,"mat-select",4),E("ngModelChange",function(_){return O(e.channelIds,_)||(e.channelIds=_),_}),h(7,Kn,5,3,"mat-option",5),r()()()()()),n&2&&(l("dynamicValidated",e.channelIds().length>0)("config",e.modalConfig),a(6),D("ngModel",e.channelIds),l("multiple",!0),a(),l("ngForOf",e.channelOptions()))},dependencies:[et,B,$t,Wt,$e,Ze,Ye,Ge,St,j,$,st],encapsulation:2})}}return i})();var Jt=i=>[i];function Jn(i,d){if(i&1){let t=x();o(0,"button",14),C("click",function(){m(t);let e=s(2);return u(e.onDetachMultipleProduct())}),g(1,"i",15),p(2),r()}if(i&2){let t,n=s(2);a(2),b("Detach (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function Yn(i,d){if(i&1&&(y(0),h(1,Jn,3,1,"button",13),v()),i&2){let t=s();a(),R(t.productService.hasSelection(t.products)?1:-1)}}function Zn(i,d){if(i&1){let t=x();o(0,"button",18),C("click",function(){m(t);let e=s(3);return u(e.onOpenScanDialog())}),g(1,"i",19),p(2," Scan Channel "),r()}}function qn(i,d){if(i&1&&h(0,Zn,3,0,"button",17),i&2){let t=s(2);l("ngIf",!t.productService.hasSelection(t.products))}}function Qn(i,d){if(i&1&&(y(0),h(1,qn,1,1,"button",16),v()),i&2){let t=s();a(),R(t.productService.hasSelection(t.products)?-1:1)}}function Xn(i,d){if(i&1){let t=x();o(0,"button",21),C("click",function(){m(t);let e=s(2);return u(e.onScanMultipleProduct())}),g(1,"i",19),p(2),r()}if(i&2){let t,n=s(2);a(2),b(" Scan (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function ti(i,d){if(i&1&&(y(0),h(1,Xn,3,1,"button",20),v()),i&2){let t=s();a(),R(t.productService.hasSelection(t.products)&&t.multipeScanChannels.length>0?1:-1)}}function ei(i,d){if(i&1){let t=x();o(0,"button",23),C("click",function(){m(t);let e=s(2);return u(e.onUploadMultipleProduct())}),g(1,"i",24),p(2),r()}if(i&2){let t,n=s(2);a(2),b(" Upload (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function ni(i,d){if(i&1&&(y(0),h(1,ei,3,1,"button",22),v()),i&2){let t=s();a(),R(t.productService.hasSelection(t.products)?1:-1)}}function ii(i,d){if(i&1){let t=x();o(0,"div",25)(1,"app-product-card",26),C("onUpload",function(){let e=m(t).$implicit,c=s();return u(c.onUploadToMultipleChannel(e))})("onScan",function(){let e=m(t).$implicit,c=s();return u(c.onScanSingleProduct(e))})("onDescEvent",function(){let e=m(t).index,c=s();return u(c.onOpenDialogVariant(e))})("onCheckBoxChange",function(e){let c=m(t).$implicit;return u(c.selected=e)})("onDetach",function(){let e=m(t).$implicit,c=s();return u(c.onDetachProduct([e]))}),r()()}if(i&2){let t=d.$implicit,n=s();a(),l("productId",t.ID)("title",t==null?null:t.Name)("image",t==null?null:t.ThumbnailUrl)("description",(t==null||t.Variants==null?null:t.Variants.length)>1?(t==null||t.Variants==null?null:t.Variants.length)+" Variants":null)("channels",n.productService.getChannelProduct(t))("code",n.getVariantCode(t==null?null:t.Variants))("showCheckBox",(t==null?null:t.Channel.length)<n.channelOptions.length)("scanButton",!0)("uploadButton",t==null?null:t.hasUpload)("imageForZoom",t==null?null:t.ImageUrl)("detachButton",(t==null||t.Channel==null?null:t.Channel.length)>0)}}function oi(i,d){i&1&&(y(0),o(1,"div",27),g(2,"app-empty-state"),r(),v())}function ai(i,d){if(i&1){let t=x();y(0),o(1,"div",28)(2,"div",29)(3,"app-custom-paginator",30),C("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())}),r()()(),v()}if(i&2){let t=s();a(3),l("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",!0)("nextButtonAlwaysVisible",!0)}}var mn=(()=>{class i{constructor(t,n,e,c,_,P,mt){this.http=t,this.toastr=n,this.dialog=e,this.productService=c,this.authService=_,this.uploadProductService=P,this.route=mt,this.searchFilter=new dt,this.products=[],this.rowCount=0,this.multipeScanChannels=[],this.scanProductRole=U.ProductScan,this.uploadProductRole=U.ProductUpload,this.detachProductRole=U.ProductDetach,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,[I.Tokopedia,I.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(n=>{this.products=n.Data,this.rowCount=n.Total==null?this.searchFilter.RowCount:n.Total.toString(),this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions)})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=f.GuidEMpty,this.dialog.open(L,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(F(e=>f.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.UpdatedProduct=e.UpdatedProduct,this.searchFilter.Async=e.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 n=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,n,!this.searchFilter.UpdatedProduct)}})}onOpenDialogVariant(t){let n=this.products[t]?.Variants||[];this.dialog.open(Kt,{data:{title:this.products[t].Name,variants:n}})}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=f.GuidEMpty;let n=this.productService.filterChannelByTypeId(this.channelOptions,[I.Tokopedia,I.Tiktok]);this.dialog.open(L,{data:{filter:t,channelOptions:n,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(F(c=>f.IsNotEmpty(c))).subscribe(c=>{this.searchFilter.ChannelID=c.ChannelID,this.searchFilter.ScanFull=c.ScanFull,this.searchFilter.UpdatedProduct=c.UpdatedProduct;let _=this.productService.selectedProduct(this.products),P=this.productService.getVariantCodesProducts(_);this.scanSingleProduct(P)})}onScanSingleProduct(t){let n=JSON.parse(JSON.stringify(this.searchFilter));n.ChannelID=f.GuidEMpty,this.dialog.open(L,{data:{filter:n,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(F(e=>f.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID;let c=this.productService.getVariantCodesProduct(t);this.scanSingleProduct(c)})}scanSingleProduct(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:n=>{if(n)this.toastr.success("Successfully Scan ","Success");else{let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${e?.Name} `,"Error")}this.searchFilter.ChannelID=f.GuidEMpty,n&&this.getProducts()},error:n=>{this.searchFilter.ChannelID=f.GuidEMpty}})}getVariantCode(t=[]){let n;return t?.length>1&&(n=(t[0].model?t[0].model:"")+t[0].Code),t?.length==1&&(n=t[0].Code),n}onDetachProduct(t){let n=[];t.forEach(e=>{e.Channel=f.assignChannelLogo(e.Channel),n.push(...e.Channel)}),this.dialog.open(Mt,{width:"600px",data:[...n]}).afterClosed().pipe(F(e=>f.IsNotEmpty(e)),Tt(e=>this.productService.detachProduct(e))).subscribe(e=>{this.toastr.success(e.Message,jt.Success),this.getProducts()})}onDetachMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.onDetachProduct(t)}static{this.\u0275fac=function(n){return new(n||i)(S(H),S(z),S(it),S(Y),S(K),S(Pt),S(rt))}}static{this.\u0275cmp=T({type:i,selectors:[["app-in-pos"]],standalone:!1,decls:23,vars:22,consts:[["picker",""],["description","All products which is already available in POS",3,"onSubmit","headerTitle"],[4,"ngxPermissionsOnly"],[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"],[4,"ngIf"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"fa-sharp","fa-link-slash","me-2"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded"],["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"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2"],[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","nextButtonAlwaysVisible"]],template:function(n,e){if(n&1){let c=x();o(0,"mainpanel",1),C("onSubmit",function(P){return m(c),u(e.searchProduct(P))}),o(1,"actions"),h(2,Yn,2,1,"ng-container",2)(3,Qn,2,1,"ng-container",2)(4,ti,2,1,"ng-container",2)(5,ni,2,1,"ng-container",2),r(),o(6,"filters")(7,"div")(8,"label",3),p(9,"Category"),r(),o(10,"ng-select",4),C("ngModelChange",function(P){return m(c),u(e.searchFilter.Category=P)}),r()(),o(11,"div",5)(12,"mat-date-range-input",6)(13,"input",7),E("ngModelChange",function(P){return m(c),O(e.startDate,P)||(e.startDate=P),u(P)}),C("click",function(){m(c);let P=W(16);return u(P.open())}),r(),o(14,"input",8),E("ngModelChange",function(P){return m(c),O(e.endDate,P)||(e.endDate=P),u(P)}),C("click",function(){m(c);let P=W(16);return u(P.open())}),r()(),g(15,"mat-date-range-picker",null,0),r()(),o(17,"content")(18,"div",9)(19,"div",10),h(20,ii,2,11,"div",11)(21,oi,3,0,"ng-container",12),r(),h(22,ai,4,5,"ng-container",12),r()()()}if(n&2){let c=W(16);l("headerTitle","In POS ("+e.rowCount+")"),a(2),l("ngxPermissionsOnly",w(14,Jt,e.detachProductRole)),a(),l("ngxPermissionsOnly",w(16,Jt,e.scanProductRole)),a(),l("ngxPermissionsOnly",w(18,Jt,e.scanProductRole)),a(),l("ngxPermissionsOnly",w(20,Jt,e.scanProductRole)),a(5),l("clearable",!0)("items",e.Categories)("ngModel",e.searchFilter.Category),a(2),l("rangePicker",c),a(),D("ngModel",e.startDate),a(),D("ngModel",e.endDate),a(6),l("ngForOf",e.products),a(),l("ngIf",e.products.length==0),a(),l("ngIf",e.products.length>0)}},dependencies:[B,N,ft,j,$,J,lt,ot,pt,Z,Qe,Xe,tn,en,nt],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}"]})}}return i})();var de=i=>[i];function ri(i,d){if(i&1){let t=x();o(0,"button",12),C("click",function(){m(t);let e=s(2);return u(e.onDetachMultipleProduct())}),g(1,"i",13),p(2),r()}if(i&2){let t,n=s(2);a(2),b("Detach (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function li(i,d){if(i&1&&(y(0),h(1,ri,3,1,"button",11),v()),i&2){let t=s();a(),R(t.productService.hasSelection(t.products)?1:-1)}}function ci(i,d){if(i&1){let t=x();o(0,"div",14)(1,"button",16),C("click",function(){m(t);let e=s(2);return u(e.onScanAllProducts())}),g(2,"i",17),p(3," Scan Channel "),r(),g(4,"button",18),o(5,"ul",19)(6,"li")(7,"a",20),C("click",function(){m(t);let e=s(2);return u(e.onScanAllV2Products())}),g(8,"i",17),p(9," Scan Channel V2 "),r()()()()}}function si(i,d){if(i&1){let t=x();o(0,"button",21),C("click",function(){m(t);let e=s(2);return u(e.onScanMultipleProduct())}),g(1,"i",17),p(2),r()}if(i&2){let t=s(2);a(2),b(" Scan (",t.productService.selectedProduct(t.products).length,") ")}}function di(i,d){if(i&1&&(y(0),h(1,ci,10,0,"div",14)(2,si,3,1,"button",15),v()),i&2){let t=s();a(),R(t.productService.hasSelection(t.products)?t.multipeScanChannels.length>0&&t.productService.hasSelection(t.products)?2:-1:1)}}function pi(i,d){if(i&1){let t=x();o(0,"button",23),C("click",function(){m(t);let e=s(2);return u(e.onUploadMultipleProduct())}),g(1,"i",24),p(2),r()}if(i&2){let t=s(2);a(2),b(" Upload (",t.productService.selectedProduct(t.products).length,") ")}}function mi(i,d){if(i&1&&(y(0),h(1,pi,3,1,"button",22),v()),i&2){let t=s();a(),R(t.productService.hasSelection(t.products)?1:-1)}}function ui(i,d){if(i&1&&(o(0,"span",25),g(1,"img",26),r(),p(2)),i&2){let t=d.item;a(),l("src",t.Img,M)("alt",t.Name),a(),b(" ",t.Name," ")}}function hi(i,d){if(i&1){let t=x();o(0,"div",27)(1,"label",28),p(2,"Item ID"),r(),o(3,"input",29),E("ngModelChange",function(e){m(t);let c=s();return O(c.searchFilter.Item_id,e)||(c.searchFilter.Item_id=e),u(e)}),r()()}if(i&2){let t=s();a(3),D("ngModel",t.searchFilter.Item_id)}}function _i(i,d){if(i&1){let t=x();o(0,"div",30)(1,"app-product-card",31),C("onUpload",function(){let e=m(t).$implicit,c=s();return u(c.onUploadToMultipleChannel(e))})("onDescEvent",function(){let e=m(t).index,c=s();return u(c.onOpenVariantDetail(e))})("onScan",function(){let e=m(t).$implicit,c=s();return u(c.onScanSingleProduct(e))})("onCheckBoxChange",function(e){let c=m(t).$implicit;return u(c.selected=e)})("onDetach",function(){let e=m(t).$implicit,c=s();return u(c.onDetachProduct([e]))}),r()()}if(i&2){let t=d.$implicit,n=s();a(),l("productId",t==null?null:t.ID)("title",t==null?null:t.Name)("image",t==null?null:t.ThumbnailUrl)("description",(t==null||t.Variants==null?null:t.Variants.length)>1?(t==null||t.Variants==null?null:t.Variants.length)+" Variants":null)("channels",n.productService.getChannelProduct(t))("code",n.getVariantCode(t==null?null:t.Variants))("showCheckBox",t==null?null:t.hasScan)("scanButton",!0)("uploadButton",t==null?null:t.hasUpload)("imageForZoom",t==null?null:t.ImageUrl)("detachButton",(t==null||t.Channel==null?null:t.Channel.length)>0)}}function gi(i,d){i&1&&(y(0),o(1,"div",32),g(2,"app-empty-state"),r(),v())}function Ci(i,d){if(i&1){let t=x();o(0,"div",33)(1,"div",34)(2,"app-custom-paginator",35),C("total",function(){m(t);let e=s();return u(e.getRowCount())})("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())}),r()()()}if(i&2){let t=s();a(2),l("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",t.hasClickRowCount)}}var un=(()=>{class i{constructor(t,n,e,c,_,P,mt,Nt){this.http=t,this.dialog=n,this.toastr=e,this.productService=c,this.activateRouter=_,this.authService=P,this.route=mt,this.uploadProductService=Nt,this.searchFilter=new dt,this.products=[],this.rowCount=0,this.hasClickRowCount=!1,this.guidEmpty=f.GuidEMpty,this.multipeScanChannels=[],this.scanProductRole=U.ProductScan,this.uploadProductRole=U.ProductUpload,this.detachProductRole=U.ProductDetach,this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(f.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(n=>{this.searchFilter=n.Filter,n.Filter.ChannelID!=f.GuidEMpty&&(this.searchFilter.ListChannelID=[],this.searchFilter.ListChannelID.push(n.Filter.ChannelID)),this.searchFilter.PageSize=n.Filter.RowCount,this.searchFilter.Item_id="",this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[I.Tokopedia,I.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(n=>{this.products=n.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 n=this.products[t].Variants;this.dialog.open(Kt,{data:{variants:n,title:this.products[t].Name}})}onScanAllProducts(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=f.GuidEMpty,this.dialog.open(L,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(F(e=>f.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.UpdatedProduct=e.UpdatedProduct,this.searchFilter.Async=e.Async,this.scanAllProduct()})}onScanAllV2Products(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=f.GuidEMpty,this.dialog.open(L,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(F(n=>f.IsNotEmpty(n)),Tt(n=>this.productService.scanProductV2(n.ChannelID,n.ScanFull,n.UpdatedProduct,n.Async))).subscribe(()=>{this.initPageLoader(f.GuidEMpty)})}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(F(n=>n)).subscribe(n=>{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(n,t,!this.searchFilter.UpdatedProduct),this.initPageLoader(f.GuidEMpty))})}onScanSingleProduct(t){t.Channel=this.productService.getChannelProduct(t);let n=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(L,{data:{filter:n,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(F(e=>f.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID;let c=this.productService.getVariantCodesProduct(t);this.scanProducts(c)})}onUploadToMultipleChannel(t){this.uploadProductService.setSelectedProduct([t]),this.route.navigate(["/menu/products/upload"])}onScanMultipleProduct(){this.searchFilter.ChannelID=f.GuidEMpty;let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(L,{data:{filter:t,channelOptions:this.multipeScanChannels,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(F(e=>f.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.UpdatedProduct=e.UpdatedProduct;let c=this.productService.selectedProduct(this.products),_=this.productService.getVariantCodesProducts(c);this.scanProducts(_)})}scanProducts(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:n=>{let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);n?this.toastr.success(`Product Successfully scan with ${e?.Name}`,"Success"):this.toastr.error(`This product is not existed in ${e?.Name} `,"Error"),this.searchFilter.ChannelID=f.GuidEMpty,n&&this.getProducts()},error:n=>{this.searchFilter.ChannelID=f.GuidEMpty}})}getVariantCode(t){let n;return t.length>1&&(n=(t[0].model?t[0].model:"")+t[0].Code),t.length==1&&(n=t[0].Code),n}onClearFilterChannel(){this.searchFilter.ChannelID=f.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(n=>{this.hasClickRowCount=!0,this.rowCount=n.Total})}onDetachProduct(t){let n=[];t.forEach(e=>{e.Channel=f.assignChannelLogo(e.Channel),n.push(...e.Channel)}),this.dialog.open(Mt,{width:"600px",data:[...n]}).afterClosed().pipe(F(e=>f.IsNotEmpty(e)),Tt(e=>this.productService.detachProduct(e))).subscribe(e=>{this.toastr.success(e.Message,jt.Success),this.getProducts()})}onDetachMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.onDetachProduct(t)}static{this.\u0275fac=function(n){return new(n||i)(S(H),S(it),S(z),S(Y),S(Lt),S(K),S(rt),S(Pt))}}static{this.\u0275cmp=T({type:i,selectors:[["app-sold-in-channel"]],standalone:!1,decls:18,vars:18,consts:[["description","SKU has been mapped between dealpos and marketplace",3,"onSubmit","headerTitle"],[4,"ngxPermissionsOnly"],[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"],[4,"ngIf"],["class","row",4,"ngIf"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"fa-sharp","fa-link-slash","me-2"],[1,"btn-group","me-3","shadow"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2"],[1,"btn","btn-outline-secondary","border-end-0",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu",2,"cursor","pointer"],[1,"dropdown-item",3,"click"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2"],[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(n,e){n&1&&(o(0,"mainpanel",0),C("onSubmit",function(_){return e.searchProduct(_)}),o(1,"actions"),h(2,li,2,1,"ng-container",1)(3,di,3,1,"ng-container",1)(4,mi,2,1,"ng-container",1),r(),o(5,"filters")(6,"div")(7,"label",2),p(8,"Channel"),r(),o(9,"ng-select",3),C("ngModelChange",function(_){return e.searchFilter.ListChannelID=_})("clear",function(){return e.onClearFilterChannel()}),h(10,ui,3,3,"ng-template",4),r()(),h(11,hi,4,1,"div",5),r(),o(12,"content")(13,"div",6)(14,"div",7),h(15,_i,2,11,"div",8)(16,gi,3,0,"ng-container",9),r(),h(17,Ci,3,4,"div",10),r()()()),n&2&&(l("headerTitle","Sold in Channel"),a(2),l("ngxPermissionsOnly",w(12,de,e.detachProductRole)),a(),l("ngxPermissionsOnly",w(14,de,e.scanProductRole)),a(),l("ngxPermissionsOnly",w(16,de,e.uploadProductRole)),a(5),l("clearable",!0)("multiple",!0)("items",e.channelOptions)("ngModel",e.searchFilter.ListChannelID),a(2),l("ngIf",e.searchFilter.ListChannelID!=null),a(4),l("ngForOf",e.products),a(),l("ngIf",e.products.length==0),a(),l("ngIf",e.products==null?null:e.products.length))},dependencies:[B,N,ft,j,$,J,lt,xt,Bt,ot,pt,Z,nt],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}"]})}}return i})();var Qt=i=>[i];function fi(i,d){if(i&1){let t=x();o(0,"button",12),C("click",function(){m(t);let e=s(3);return u(e.uploadMultipleProduct())}),g(1,"i",13),p(2),r()}if(i&2){let t=s(3);a(2),b(" upload (",t.selectedProducts==null?null:t.selectedProducts.length,") ")}}function Si(i,d){if(i&1&&(y(0),h(1,fi,3,1,"button",11),v()),i&2){let t=s(2);a(),l("ngIf",t.hasSelectionProduct)}}function xi(i,d){if(i&1){let t=x();y(0),o(1,"button",14),C("click",function(){m(t);let e=s(2);return u(e.openScanDialog())}),g(2,"i",15),p(3," Scan Channel "),r(),v()}}function yi(i,d){i&1&&(y(0),g(1,"th",23),v())}function vi(i,d){if(i&1){let t=x();y(0),o(1,"td",30)(2,"input",31),E("ngModelChange",function(e){m(t);let c=s(3).$implicit;return O(c.selected,e)||(c.selected=e),u(e)}),C("ngModelChange",function(){m(t);let e=s(4).ngIf,c=s(3);return u(c.onSelectProduct(e))}),r()(),v()}if(i&2){let t=s(3).$implicit;a(),l("rowSpan",t==null?null:t.Variants.length),a(),D("ngModel",t.selected)}}function bi(i,d){if(i&1&&(y(0),h(1,vi,3,2,"ng-container",10),v()),i&2){let t=s().index;a(),l("ngIf",t==0)}}function Pi(i,d){if(i&1){let t=x();y(0),o(1,"img",36),C("click",function(e){m(t);let c=s(3).$implicit,_=s(4);return u(_.onZoomImage(e,c==null?null:c.ImageUrl))}),r(),v()}if(i&2){let t=s(3).$implicit;a(),l("src",t==null?null:t.ImageUrl,M)}}function Ii(i,d){i&1&&g(0,"img",37)}function wi(i,d){if(i&1&&(y(0),o(1,"td",30)(2,"div",32),h(3,Pi,2,1,"ng-container",9)(4,Ii,1,0,"ng-template",null,1,G),r()(),o(6,"td",33)(7,"h4",34)(8,"span",35),p(9),r()()(),v()),i&2){let t=W(5),n=s(2).$implicit;a(),l("rowSpan",n==null?null:n.Variants.length),a(2),l("ngIf",n==null?null:n.ImageUrl)("ngIfElse",t),a(3),l("rowSpan",n==null?null:n.Variants.length),a(2),l("matTooltip",(n==null||n.Name==null?null:n.Name.length)>50?n==null?null:n.Name:""),a(),b(" ",n==null?null:n.Name," ")}}function Mi(i,d){if(i&1&&(o(0,"div")(1,"a",26),g(2,"img",38),r()()),i&2){let t=d.$implicit;a(),l("href",t.URL,M),a(),l("src",t.Img,M)("matTooltip",t.Name)}}function Ti(i,d){if(i&1&&(o(0,"div"),g(1,"img",38),r()),i&2){let t=d.$implicit;a(),l("src",t.Img,M)("matTooltip",t.Name)}}function Di(i,d){if(i&1&&(o(0,"tr"),h(1,bi,2,1,"ng-container",4)(2,wi,10,6,"ng-container",10),o(3,"td"),p(4),r(),o(5,"td")(6,"span"),p(7),r(),o(8,"span",25)(9,"a",26),g(10,"i",27),r()()(),o(11,"td",28)(12,"div",29),h(13,Mi,3,3,"div",24),r()(),o(14,"td",28)(15,"div",29),h(16,Ti,2,2,"div",24),r()()()),i&2){let t=d.$implicit,n=d.index,e=s(5);a(),l("ngxPermissionsOnly",w(7,Qt,e.uploadProductRole)),a(),l("ngIf",n==0),a(2),b(" ",t.Name," "),a(3),b(" ",t.Code," "),a(2),l("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),M),a(4),l("ngForOf",t==null?null:t.Available),a(3),l("ngForOf",t==null?null:t.NotAvailable)}}function Oi(i,d){if(i&1&&(y(0),h(1,Di,17,9,"tr",24),v()),i&2){let t=d.$implicit;a(),l("ngForOf",t.Variants)}}function Ei(i,d){if(i&1&&(o(0,"tbody"),h(1,Oi,2,1,"ng-container",24),r()),i&2){let t=d.ngIf;a(),l("ngForOf",t)}}function ki(i,d){if(i&1&&(y(0),o(1,"div",16)(2,"table",17)(3,"thead",18)(4,"tr"),h(5,yi,2,0,"ng-container",4),o(6,"th",19),p(7," Product "),r(),o(8,"th",20),p(9,"Variant"),r(),o(10,"th",20),p(11,"SKU"),r(),o(12,"th",21),p(13,"Available In"),r(),o(14,"th",22),p(15,"Not Available In"),r()()(),h(16,Ei,2,1,"tbody",10),k(17,"async"),r()(),v()),i&2){let t=s(2);a(5),l("ngxPermissionsOnly",w(4,Qt,t.uploadProductRole)),a(11),l("ngIf",V(17,2,t.data$))}}function Fi(i,d){i&1&&(o(0,"div",39),g(1,"app-empty-state"),r())}function Vi(i,d){if(i&1){let t=x();o(0,"span",47),C("click",function(){m(t);let e=s(4);return u(e.getRowCount())}),o(1,"i",48),p(2,"?"),r()()}}function Ni(i,d){if(i&1&&(o(0,"span"),p(1),k(2,"number"),r()),i&2){let t=d.ngIf;a(),A(V(2,1,t==null?null:t.Count))}}function Ri(i,d){if(i&1){let t=x();o(0,"a",49),C("click",function(){m(t);let e=s(4);return u(e.onNextPage())}),g(1,"i",50),p(2," Next"),r()}}function Ai(i,d){if(i&1){let t=x();o(0,"a",51),C("click",function(){m(t);let e=s(4);return u(e.onLastPage())}),g(1,"i",52),p(2," Last"),r()}}function Ui(i,d){if(i&1&&(y(0),o(1,"div",40)(2,"div",41)(3,"div",42),p(4),k(5,"number"),h(6,Vi,3,0,"span",43)(7,Ni,3,3,"span",10),k(8,"async"),p(9),r()(),o(10,"div",44),h(11,Ri,3,0,"a",45)(12,Ai,3,0,"a",46),r()(),v()),i&2){let t=s().ngIf,n=s(2);a(4),b(" Showing 1 - ",V(5,6,t==null?null:t.length)," of "),a(2),l("ngIf",n.paginationService.hideCount),a(),l("ngIf",!n.paginationService.hideCount&&V(8,8,n.rowCount$)),a(2),b(" records ~ ",n.paginationService.footerPageNumber," Page "),a(2),l("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage),a(),l("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage)}}function Li(i,d){if(i&1&&(y(0),h(1,Ui,13,10,"ng-container",10),v()),i&2){let t=d.ngIf;a(),l("ngIf",(t==null?null:t.length)>0)}}function Bi(i,d){if(i&1){let t=x();o(0,"mainpanel",3),C("onSubmit",function(e){m(t);let c=s();return u(c.searchProduct(e))}),o(1,"actions"),h(2,Si,2,1,"ng-container",4)(3,xi,4,0,"ng-container",4),o(4,"button",5),C("click",function(){m(t);let e=s();return u(e.openExportDialog())}),g(5,"i",6),o(6,"span"),p(7,"Export"),r()()(),o(8,"content")(9,"div",7)(10,"div",8),h(11,ki,18,6,"ng-container",9),k(12,"async"),h(13,Fi,2,0,"ng-template",null,0,G),r(),h(15,Li,2,1,"ng-container",10),k(16,"async"),r()()()}if(i&2){let t,n=W(14),e=s();l("hideSearchDropdown",!0),a(2),l("ngxPermissionsOnly",w(10,Qt,e.uploadProductRole)),a(),l("ngxPermissionsOnly",w(12,Qt,e.scanProductRole)),a(8),l("ngIf",((t=V(12,6,e.data$))==null?null:t.length)>0)("ngIfElse",n),a(4),l("ngIf",V(16,8,e.data$))}}var hn=(()=>{class i{constructor(t,n,e,c,_,P,mt,Nt,Sn){this.http=t,this.dialog=n,this.toastr=e,this.route=c,this.productService=_,this.paginationService=P,this.biggerPictureService=mt,this.authService=Nt,this.uploadProductService=Sn,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannelV2",this.hasSelectionProduct=!1,this.selectedProducts=[],this.scanProductRole=U.ProductScan,this.uploadProductRole=U.ProductUpload,this.channelOptions=Nt.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(he(t=>{this.filterSearch=t.Filter,this.paginationService.reloadPagination(t.Filter)}))}iniData(){this.data$=this.paginationService.data$.pipe(Rt(t=>(t=t.map(n=>(n.Variants=n.Variants.map(e=>(e.Available=this.productService.sortChannel(e.Available),e.NotAvailable=this.productService.sortChannel(e.NotAvailable),e.Available=this.assignLogoChannel(e.Available),e.NotAvailable=this.assignLogoChannel(e.NotAvailable),e)),n.Channel=n?.Variants[0]?.Available,n)),t)))}assignLogoChannel(t){return t=t.map(n=>(n.Img=f.getChannelLogoByTypeId(n.TypeID),n)),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(n=>{this.filterSearch.Async?this.toastr.success("You will be notified when the scan is completed.","Scan Asynchronous"):(this.productService.successToastrScanAllProduct(n,t,!this.filterSearch.UpdatedProduct),this.initPageLoader())})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.filterSearch));t.ChannelID=f.GuidEMpty,this.dialog.open(L,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(F(e=>f.IsNotEmpty(e))).subscribe(e=>{this.filterSearch.ChannelID=e.ChannelID,this.filterSearch.ScanFull=e.ScanFull,this.filterSearch.UpdatedProduct=e.UpdatedProduct,this.filterSearch.Async=e.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,n){this.biggerPictureService.openBiggerPicture(t,n)}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(on,{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()}static{this.\u0275fac=function(n){return new(n||i)(S(H),S(it),S(z),S(rt),S(Y),S(an),S(qe),S(K),S(Pt))}}static{this.\u0275cmp=T({type:i,selectors:[["app-not-in-channel"]],standalone:!1,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"],[4,"ngxPermissionsOnly"],[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"],["class","btn btn-light shadow rounded ms-2",3,"click",4,"ngIf"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],["data-cy","scanNotinChannel","type","button",1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"col-md-12"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"ms-5","text-center",2,"width","450px"],[2,"width","150px"],[2,"width","20%"],[2,"width","16%"],[2,"width","10px"],[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(n,e){n&1&&(h(0,Bi,17,14,"mainpanel",2),k(1,"async")),n&2&&l("ngIf",V(1,1,e.loader$))},dependencies:[B,N,Me,j,$,J,ct,Z,nt,gt,Ct],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%}"]})}}return i})();var pe=i=>[i],ji=()=>[];function $i(i,d){if(i&1){let t=x();o(0,"button",16),C("click",function(){m(t);let e=s(2);return u(e.openScanDialog())}),g(1,"i",17),p(2," Scan Channel "),r()}}function Wi(i,d){if(i&1&&(y(0),h(1,$i,3,0,"button",15),v()),i&2){let t=s();a(),R(t.productService.hasSelection(t.products)?-1:1)}}function Gi(i,d){if(i&1){let t=x();o(0,"button",19),C("click",function(){m(t);let e=s(2);return u(e.onDownloadAllProduct("SELECTED"))}),g(1,"i",20),p(2),r()}if(i&2){let t,n=s(2);a(2),b(" Download (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function zi(i,d){if(i&1&&(y(0),h(1,Gi,3,1,"button",18),v()),i&2){let t=s();a(),R(t.productService.hasSelection(t.products)?1:-1)}}function Hi(i,d){if(i&1&&(o(0,"span",21),g(1,"img",22),r(),p(2)),i&2){let t=d.item;a(),l("src",t.Img,M)("alt",t.Name),a(),b(" ",t.Name," ")}}function Ki(i,d){if(i&1){let t=x();o(0,"div",23)(1,"app-product-card",24),C("onCheckBoxChange",function(e){let c=m(t).index,_=s();return u(_.onSelectProduct(e,c))})("onDescEvent",function(){let e=m(t).index,c=s();return u(c.onShowVariantDetail(e))})("onDownload",function(){let e=m(t).$implicit,c=s();return u(c.onDownloadProduct(e))})("onScan",function(){let e=m(t).$implicit,c=s();return u(c.onScanChannel(e))}),r()()}if(i&2){let t=d.$implicit,n=s();a(),l("showRedirectIcon",!1)("title",t==null?null:t.Name)("image",t==null?null:t.Image)("imageForZoom",t==null?null:t.Image)("code",t==null?null:t.SKU)("description",(t==null||t.Variant==null?null:t.Variant.length)>0?(t==null||t.Variant==null?null:t.Variant.length)+" Variants":null)("downloadButton",!0)("channels",t!=null&&t.Channel?w(10,pe,t==null?null:t.Channel):Ot(12,ji))("showCheckBox",n.hasDownloadRole())("scanButton",!0)}}function Ji(i,d){i&1&&(y(0),o(1,"div",25),g(2,"app-empty-state"),r(),v())}function Yi(i,d){if(i&1){let t=x();o(0,"div",26)(1,"div",27)(2,"app-custom-paginator",28),C("total",function(){m(t);let e=s();return u(e.getRowCount())})("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())}),r()()()}if(i&2){let t=s();a(2),l("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",t.hasClickRowCount)}}var _n=(()=>{class i{constructor(t,n,e,c,_,P){this.http=t,this.dialog=n,this.productService=e,this.toastrService=c,this.activateRouter=_,this.authService=P,this.permissionService=tt(Te),this.searchFilter=new dt,this.products=[],this.hasClickRowCount=!1,this.scanProductRole=U.ProductScan,this.downloadProductRole=U.ProductDownload,this.hasDownloadRole=ut(!0),this.channelOptions=this.authService.getChannels(),this.permissionService.hasPermission(this.downloadProductRole).then(mt=>{this.hasDownloadRole.set(mt)})}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(f.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(n=>{this.searchFilter=n.Filter,this.searchFilter.PageSize=n.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(n=>(t=this.channelOptions.find(e=>e.ID==n.ChannelID),t?n.Channel=JSON.parse(JSON.stringify(t)):n.Channel=null,n)).map(n=>(n.Channel&&(n.Channel.Url=n.Url),n))}setSkuProduct(){this.products=this.products.map(t=>(t?.Variant?.length==0?f.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=f.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(n=>{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(f.GuidEMpty),this.productService.successToastrScanAllProduct(n,t,!this.searchFilter.UpdatedProduct)),this.searchFilter.ChannelID=f.GuidEMpty})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=f.GuidEMpty,this.dialog.open(L,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(F(e=>f.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.UpdatedProduct=e.UpdatedProduct,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.Async=e.Async,this.onScanAll()})}onDownloadAllProduct(t){let n;t=="ALL"?n=this.products:n=this.productService.selectedProduct(this.products),n.length>0&&this.productService.downloadMultipleProduct(n).subscribe({next:()=>{this.getProducts()}})}onSelectProduct(t,n){this.products[n].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 n=JSON.parse(JSON.stringify(t));delete n.Channel,this.productService.scanCompareToPos([n]).subscribe(e=>{e.Status?(this.initPageLoader(f.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 n=this.products[t].Variant;n.length>0&&this.dialog.open(rn,{data:{title:this.products[t].Name,variants:n},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(n=>{this.hasClickRowCount=!0,this.rowCount=n.Count})}static{this.\u0275fac=function(n){return new(n||i)(S(H),S(it),S(Y),S(z),S(Lt),S(K))}}static{this.\u0275cmp=T({type:i,selectors:[["app-not-in-pos"]],standalone:!1,decls:30,vars:17,consts:[["headerTitle","Not in POS","textButton","Search","description","SKU sold in Marketplace but not exist in DEALPOS",3,"onSubmit"],[4,"ngxPermissionsOnly"],[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"],[4,"ngIf"],["class","row",4,"ngIf"],["type","button","data-cy","scanNotInPos",1,"btn","btn-outline-secondary","shadow","rounded"],["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"],["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(n,e){n&1&&(o(0,"mainpanel",0),C("onSubmit",function(_){return e.onSearch(_)}),o(1,"actions"),h(2,Wi,2,1,"ng-container",1)(3,zi,2,1,"ng-container",1),r(),o(4,"filters")(5,"div")(6,"label",2),p(7,"Channel"),r(),o(8,"ng-select",3),E("ngModelChange",function(_){return O(e.searchFilter.ChannelID,_)||(e.searchFilter.ChannelID=_),_}),h(9,Hi,3,3,"ng-template",4),r()(),o(10,"div",5)(11,"label",6),p(12,"SKU Assigned"),r(),o(13,"mat-radio-group",7),E("ngModelChange",function(_){return O(e.searchFilter.HaveSku,_)||(e.searchFilter.HaveSku=_),_}),o(14,"mat-radio-button",8),p(15," All "),r(),o(16,"mat-radio-button",8),p(17," Yes "),r(),o(18,"mat-radio-button",8),p(19," No "),r()()(),o(20,"div",5)(21,"label",6),p(22,"Item ID"),r(),o(23,"input",9),E("ngModelChange",function(_){return O(e.searchFilter.Item_id,_)||(e.searchFilter.Item_id=_),_}),r()()(),o(24,"content")(25,"div",10)(26,"div",11),h(27,Ki,2,13,"div",12)(28,Ji,3,0,"ng-container",13),r(),h(29,Yi,3,4,"div",14),r()()()),n&2&&(a(2),l("ngxPermissionsOnly",w(13,pe,e.scanProductRole)),a(),l("ngxPermissionsOnly",w(15,pe,e.downloadProductRole)),a(5),l("clearable",!0)("items",e.channelOptions),D("ngModel",e.searchFilter.ChannelID),a(5),D("ngModel",e.searchFilter.HaveSku),a(),l("value",0),a(2),l("value",1),a(2),l("value",2),a(5),D("ngModel",e.searchFilter.Item_id),a(4),l("ngForOf",e.products),a(),l("ngIf",e.products.length==0),a(),l("ngIf",(e.products==null?null:e.products.length)>0))},dependencies:[B,N,ft,j,$,J,lt,xt,Gt,zt,ot,pt,Z,nt],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}"]})}}return i})();function Zi(i,d){if(i&1&&(o(0,"span",9),g(1,"img",10),r(),p(2)),i&2){let t=d.item,n=s();a(),l("src",n.getChannelLogo(t.TypeID),M),a(),b(" ",t.Name," ")}}function qi(i,d){if(i&1&&(o(0,"div",11),g(1,"app-duplicate-product-card",12),r()),i&2){let t=d.$implicit,n=d.index;a(),l("imageForZoom",t.ImageUrl)("title",t.Name)("code",t.Code)("id",n)("image",t.ThumbnailURL)("channels",t.Channels)}}function Qi(i,d){i&1&&(y(0),o(1,"div",13),g(2,"app-empty-state"),r(),v())}function Xi(i,d){if(i&1){let t=x();y(0),o(1,"div",14)(2,"div",15)(3,"app-custom-paginator",16),C("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())})("total",function(){m(t);let e=s();return u(e.getRowCount())}),r()()(),v()}if(i&2){let t=s();a(3),l("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",t.hasClickedRowCount)}}var gn=(()=>{class i{constructor(t,n,e){this.httpService=t,this.productService=n,this.authService=e,this.searchFilter=new dt,this.products=[],this.hasClickedRowCount=!1,this.getPageLoader(),this.channelOptions=e.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(n=>{this.products=n.Data})}onSearch(t){this.searchFilter.text=t,this.hasClickedRowCount=!1,this.getProducts()}onClearFilter(){this.searchFilter.ChannelID=f.GuidEMpty}getChannelLogo(t){return f.getChannelLogoByTypeId(t)}getRowCount(){let t={text:this.searchFilter.text,ChannelID:this.searchFilter.ChannelID};this.httpService.post("/api/product/GetDuplicateInChannelRowCount",t).subscribe(n=>{this.hasClickedRowCount=!0,this.rowCount=n.Total})}static{this.\u0275fac=function(n){return new(n||i)(S(H),S(Y),S(K))}}static{this.\u0275cmp=T({type:i,selectors:[["app-duplicate-sku"]],standalone:!1,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(n,e){n&1&&(o(0,"mainpanel",0),C("onSubmit",function(_){return e.onSearch(_)}),o(1,"filters")(2,"div",1)(3,"div")(4,"h6",2),p(5,"Channel"),r(),o(6,"ng-select",3),E("ngModelChange",function(_){return O(e.searchFilter.ListChannelID,_)||(e.searchFilter.ListChannelID=_),_}),C("clear",function(){return e.onClearFilter()}),h(7,Zi,3,2,"ng-template",4),r()()()(),o(8,"content")(9,"div",5)(10,"div",6),h(11,qi,2,6,"div",7)(12,Qi,3,0,"ng-container",8),r(),h(13,Xi,4,4,"ng-container",8),r()()()),n&2&&(a(6),l("multiple",!0)("clearable",!0)("items",e.channelOptions),D("ngModel",e.searchFilter.ListChannelID),a(5),l("ngForOf",e.products),a(),l("ngIf",(e.products==null?null:e.products.length)==0),a(),l("ngIf",(e.products==null?null:e.products.length)>0))},dependencies:[B,N,j,$,J,lt,xt,Bt,Ht,ot,Z],encapsulation:2})}}return i})();var to=()=>["/menu/products/status/sold-in-channel"],Cn=i=>({ID:i}),eo=()=>["/menu/products/status/not-in-pos"],no=i=>[i];function io(i,d){if(i&1&&(y(0),p(1),v()),i&2){let t=s().$implicit;a(),b(" ",t.Count," ")}}function oo(i,d){if(i&1){let t=x();o(0,"span",25),C("click",function(){m(t);let e=s().$implicit,c=s(2);return u(c.getLiveProductCount(e.ID,e))}),g(1,"i",26),r()}}function ao(i,d){if(i&1){let t=x();y(0),o(1,"button",27),C("click",function(){m(t);let e=s().$implicit,c=s(2);return u(c.onScanChannel(e))}),g(2,"i",28),p(3," Scan "),r(),v()}}function ro(i,d){if(i&1){let t=x();o(0,"tr")(1,"td"),g(2,"img",17),o(3,"span",18),p(4),r()(),o(5,"td",19),h(6,io,2,1,"ng-container",6)(7,oo,2,0,"ng-template",null,1,G),r(),o(9,"td",19)(10,"a",20),p(11),k(12,"number"),r()(),o(13,"td",19)(14,"a",20),p(15),k(16,"number"),r()(),o(17,"td"),p(18),k(19,"date"),r(),o(20,"td")(21,"div",21),h(22,ao,4,0,"ng-container",22),o(23,"button",23),C("click",function(){let e=m(t).$implicit,c=s(2);return u(c.onClearCache(e.ID))}),g(24,"i",24),p(25," Clear "),r()()()()}if(i&2){let t=d.$implicit,n=W(8),e=s(2);a(2),l("src",e.getChannelLogo(t.TypeID),M),a(2),A(t.Name),a(2),l("ngIf",t.Count!==void 0)("ngIfElse",n),a(4),l("routerLink",Ot(19,to))("queryParams",w(20,Cn,t.ID)),a(),b(" ",V(12,12,t.SoldInChannel)," "),a(3),l("routerLink",Ot(22,eo))("queryParams",w(23,Cn,t.ID)),a(),b(" ",V(16,14,t.NotInPOS)," "),a(3),b(" ",t.LastSync?ve(19,16,t.LastSync,"dd MMM yyyy HH:mm"):"Never"," "),a(4),l("ngxPermissionsOnly",w(25,no,e.scanProductRole))}}function lo(i,d){if(i&1&&(y(0),o(1,"div",7)(2,"table",8)(3,"thead",9)(4,"tr",10)(5,"th"),p(6,"Channel"),r(),o(7,"th",11),p(8," Live Product "),r(),o(9,"th",12),p(10," Sold In Channel "),r(),o(11,"th",13),p(12," Product Not in POS "),r(),o(13,"th",14),p(14,"Last Sync"),r(),g(15,"th",15),r()(),o(16,"tbody"),h(17,ro,26,27,"tr",16),k(18,"async"),r()()(),v()),i&2){let t,n=s();a(17),l("ngForOf",(t=V(18,1,n.channels$))==null?null:t.Data)}}function co(i,d){i&1&&(o(0,"div",29),g(1,"app-empty-state"),r())}var fn=(()=>{class i{constructor(t,n,e,c){this.productService=t,this.toastr=n,this.dialog=e,this.authService=c,this.scanProductRole=U.ProductScan,this.destroy$=new me,this.channelOptions=c.getChannels()}ngOnInit(){this.setObsProductStatistic()}setObsProductStatistic(){this.channels$=this.productService.getProductStatistic()}getLiveProductCount(t,n){this.productService.getTotalProductLive(t).pipe(Xt(this.destroy$)).subscribe(e=>{n.Count=e.Count})}onScanChannel(t){this.dialog.open(L,{width:"700px",data:{channelOptions:this.channelOptions,filter:{ChannelID:t.ID},disabledChannelOption:!0}}).afterClosed().pipe(F(n=>f.IsNotEmpty(n))).subscribe(n=>{this.scanAllProduct(t.ID,n)})}scanAllProduct(t,n){let e=this.productService.findChannelById(t,this.channelOptions);this.productService.scanAll(n.ChannelID,n.ScanFull,n.UpdatedProduct,n.Async).pipe(F(c=>c)).subscribe(c=>{n.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(c,e,!n.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(Xt(this.destroy$)).subscribe(e=>{this.toastr.success("Successfully cleared cache","Success"),this.setObsProductStatistic()})}getChannelLogo(t){return f.getChannelLogoByTypeId(t)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(n){return new(n||i)(S(Y),S(z),S(it),S(K))}}static{this.\u0275cmp=T({type:i,selectors:[["app-channel-statistic"]],standalone:!1,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"],[4,"ngxPermissionsOnly"],[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,"btn","btn-sm","btn-secondary","fs-6",3,"click"],[1,"fa","fa-spinner"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(n,e){if(n&1&&(o(0,"mainpanel",2)(1,"content")(2,"div",3)(3,"div",4)(4,"div",5),h(5,lo,19,3,"ng-container",6),k(6,"async"),h(7,co,2,0,"ng-template",null,0,G),r()()()()()),n&2){let c,_=W(8);l("hideSearchBox",!0)("hideSearchDropdown",!0),a(5),l("ngIf",((c=V(6,4,e.channels$))==null||c.Data==null?null:c.Data.length)>0)("ngIfElse",_)}},dependencies:[B,N,J,ct,Ie,Z,nt,gt,Ct,be],encapsulation:2})}}return i})();var so=[{component:cn,path:"",children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:mn,canActivate:[q,Q],data:{title:"Products in POS"}},{path:"sold-in-channel",component:un,canActivate:[q,Q],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:hn,canActivate:[q,Q],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:_n,canActivate:[q,Q],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:gn,canActivate:[q,Q],data:{title:"Duplicate Sku in Channel"}},{path:"channel-statistic",component:fn,canActivate:[q,Q],data:{title:"Channel Statistic"}},{path:"notification",loadComponent(){return import("./chunk-GYPJGQYN.js").then(i=>i.NotificationComponent)},canActivate:[q,Q],data:{title:"Notification"}},{path:"notificationV2",loadComponent(){return import("./chunk-66N77XWP.js").then(i=>i.NotificationV2Component)},canActivate:[q,Q],data:{title:"Notification"}},{path:"notification/detailV2",loadComponent(){return import("./chunk-M6UMLTY2.js").then(i=>i.DetailComponent)},canActivate:[q,Q],data:{title:"Notification Detail"}},{path:"notification/detail",loadComponent(){return import("./chunk-74U7L3IP.js").then(i=>i.DetailComponent)},canActivate:[q,Q],data:{title:"Notification Detail"}}]}],jr=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Ce({type:i})}static{this.\u0275inj=_e({imports:[et,St,Ue,st,Ee,ln,We,Ae,Ht,ot,pt,we.forChild(so),nn,He,Mt,De]})}}return i})();export{jr as StatusModule};
@@ -1 +1 @@
1
- import{a as D}from"./chunk-ZXNM4AGN.js";import{a as fe}from"./chunk-NS46QSCM.js";import"./chunk-SM3P57SO.js";import{a as U}from"./chunk-UMP6ZMEJ.js";import"./chunk-ECRWEMEV.js";import"./chunk-LZCEM2PC.js";import{a as re}from"./chunk-Z3ITXK3D.js";import{a as pe}from"./chunk-ACIMXBIC.js";import"./chunk-GRIUDEPO.js";import{b as ae}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{c as oe}from"./chunk-PW42BQIY.js";import{m as me,n as ue}from"./chunk-UGVEAL7H.js";import{A as ie}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{b as le,c as se}from"./chunk-SWQXSJ7O.js";import{r as de,s as ce}from"./chunk-IHNN4Q2N.js";import"./chunk-EQIFZBRG.js";import{E as Y,G as ee,H as te,J as ne,d as K,g as Q,j as W,m as X,n as P}from"./chunk-M2FCTYGU.js";import{$c as _,Gb as x,Gc as s,Hc as h,Ic as z,Jb as L,Mb as m,Nc as q,Oc as $,Pc as C,Qc as j,Sc as I,Tc as J,Yb as p,Z as V,aa as w,ac as S,ad as y,dc as T,ec as k,gc as A,hc as H,ic as a,jc as l,kc as u,lc as g,mc as v,ob as F,oc as B,pa as b,rb as r,rd as Z,tc as G,uc as c,v as M,ya as N,za as R}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import{a as E,b as O}from"./chunk-66YHNWRR.js";var ge=(()=>{class t{transform(e){return typeof e=="number"&&(e=e.toString()),e!=null?e.replace(/\n/g,"<br />"):e}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275pipe=L({name:"newlines",type:t,pure:!0})}}return t})();var Ce=t=>({disabled:t}),_e=(t,d)=>({labelFilledInput:t,labelEmptyInput:d});function ye(t,d){if(t&1&&(a(0,"p"),s(1),_(2,"number"),l()),t&2){let e=c();r(),h(e.inputValueType()==="number"?y(2,1,e.inputValue):e.inputValue)}}function xe(t,d){if(t&1&&(u(0,"p",3),_(1,"newlines")),t&2){let e=c();p("innerHTML",y(1,1,e.inputValue),F)}}function Ie(t,d){if(t&1&&(g(0),s(1),v()),t&2){let e=c();r(),z(" ",e.labelValue," ")}}var ve=(()=>{class t{constructor(){this.inputValue="",this.labelValue="",this.inputType="input",this.labelVisible=!0,this.disabled=!1,this.class="mb-6",this.tooltip="",this.isInputFilled=!1,this.isNotEmpty=pe.IsNotEmpty}inputValueType(){return typeof this.inputValue}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=x({type:t,selectors:[["lib-info-page-input"]],inputs:{inputValue:"inputValue",labelValue:"labelValue",inputType:"inputType",labelVisible:"labelVisible",disabled:"disabled",class:"class",tooltip:"tooltip"},decls:5,vars:14,consts:[["matTooltipPosition","above",3,"ngClass","matTooltip"],[4,"ngIf"],[3,"innerHTML",4,"ngIf"],[3,"innerHTML"]],template:function(o,n){o&1&&(a(0,"div",0),m(1,ye,3,3,"p",1)(2,xe,2,3,"p",2),a(3,"label"),m(4,Ie,2,1,"ng-container",1),l()()),o&2&&(S(n.class),p("ngClass",I(9,Ce,n.disabled))("matTooltip",n.tooltip),r(),p("ngIf",n.isNotEmpty(n.inputValue)&&n.inputType=="input"),r(),p("ngIf",n.isNotEmpty(n.inputValue)&&n.inputType=="textarea"),r(),S(J(11,_e,n.isNotEmpty(n.inputValue),!n.isNotEmpty(n.inputValue))),r(),p("ngIf",n.labelVisible))},dependencies:[P,K,Q,X,ge,ce,de],styles:["div[_ngcontent-%COMP%]{border:1px solid #ced4da;position:relative;margin-bottom:1rem;border-radius:.25rem!important}p[_ngcontent-%COMP%]{margin-top:18px;margin-bottom:18px;padding-left:.75rem!important;font-size:.875rem}.labelFilledInput[_ngcontent-%COMP%]{position:absolute;top:-10px;left:10px;background:#fff;padding-left:4px;padding-right:4px;font-size:.75rem!important;color:#9da2a6}.labelEmptyInput[_ngcontent-%COMP%]{margin-top:18px;margin-bottom:18px;padding-left:.75rem!important;font-size:.875rem;color:#ccc}.disabled[_ngcontent-%COMP%]{background-color:#e9ecef;opacity:1}"]})}}return t})();var Pe=t=>({ID:t});function Me(t,d){if(t&1){let e=B();a(0,"button",24),G("click",function(){N(e);let n=c(2),i=C(0);return R(n.onDeleteUser(i==null||i.selectedUser==null?null:i.selectedUser.ID))}),u(1,"i",25),s(2," Delete "),l()}}function Se(t,d){if(t&1&&(g(0),m(1,Me,3,0,"button",23),v()),t&2){let e,o=c(),n=C(0);r(),T((n==null||n.selectedUser==null?null:n.selectedUser.Name)!==((e=o.currentLoginUser())==null?null:e.username)?1:-1)}}function Te(t,d){if(t&1&&(g(0),a(1,"a",26),u(2,"i",27),s(3," Edit "),l(),v()),t&2){c();let e=C(0);r(),p("queryParams",I(1,Pe,e==null||e.selectedUser==null?null:e.selectedUser.ID))}}function Ue(t,d){t&1&&(a(0,"div",20),s(1," All channels assigned to this user "),l())}function De(t,d){if(t&1&&u(0,"p-chip",28),t&2){let e=d.$implicit;p("label",e.Name)("image",e.logo)("alt",e.Name)}}function Ee(t,d){if(t&1&&A(0,De,1,3,"p-chip",28,k),t&2){c();let e=C(0);H(e==null?null:e.selectedChannels)}}var ot=(()=>{class t{constructor(){this.userService=b(D),this.activatedRoute=b(Y),this.toastService=b(ae),this.router=b(ee),this.userLoader$=this.activatedRoute.queryParams.pipe(w(e=>{let o=e.ID||null;return this.userService.getUserFormLoader(o).pipe(V(1),M(n=>(n.Options.Channels=oe.assignChannelLogo(n.Options.Channels),n)))}),M(e=>{let o=e.Options.Users.find(f=>f.ID===e.Form?.ID),n=e.Options.Groups.find(f=>f.ID===e.Form?.GroupID),i=e.Options.Channels.filter(f=>e.UserChannels?.includes(f.ID));return O(E({},e),{selectedUser:o||null,selectedGroup:n||null,selectedChannels:i||[],DownloadOrderDaysRange:e.Form?.DownloadOrderDaysRange||"0"})})),this.userEditRole=U.UserEdit,this.userDeleteRole=U.UserDelete,this.currentLoginUser=Z(()=>{let e=localStorage.getItem(re.AUTHORIZATION);return e?JSON.parse(e):null})}onDeleteUser(e){confirm("Are you sure you want to delete this user?")&&this.userService.deleteUsers([e]).subscribe({next:()=>{this.router.navigate(["/menu/users/users"]),this.toastService.success("User deleted successfully","Success")}})}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-user-info"]],features:[j([D])],decls:50,vars:12,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","group","aria-label","User Actions",1,"btn-group"],[4,"ngxPermissionsOnly"],[1,"container-fluid","py-5","bg-light-gray"],[1,"row","mt-8"],[1,"col-12"],[1,"card"],[1,"card-header"],[1,"card-body","mt-8","pb-4"],[1,"row"],[1,"col-6"],[1,"info-label-group"],["id","myTab","role","tablist",1,"nav","nav-tabs"],["role","presentation",1,"nav-item"],["id","channel-tab","data-bs-toggle","tab","data-bs-target","#channel-tab-pane","type","button","role","tab","aria-controls","channel-tab-pane","aria-selected","true",1,"nav-link","active"],["id","restriction-tab","data-bs-toggle","tab","data-bs-target","#restriction-tab-pane","type","button","role","tab","aria-controls","restriction-tab-pane","aria-selected","false",1,"nav-link"],[1,"card","rounded-0","border-top-0"],[1,"card-body","pb-4"],["id","myTabContent",1,"tab-content"],["id","channel-tab-pane","role","tabpanel","aria-labelledby","channel-tab","tabindex","0",1,"tab-pane","fade","show","active"],[1,"text-center","fs-5","opacity-50"],["id","restriction-tab-pane","role","tabpanel","aria-labelledby","restriction-tab-pane","tabindex","1",1,"tab-pane","fade"],["tooltip","How many days of past orders this user can download.","labelValue","Download Order Days Range","inputType","input",3,"inputValue"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],[1,"fa","fa-trash","me-1"],["role","button","routerLink","/menu/users/users/form",1,"btn","btn-outline-secondary",3,"queryParams"],[1,"fa","fa-edit","me-1"],[1,"me-3","mb-3",2,"--p-chip-image-width","1.2rem","--p-chip-image-height","1.2rem","--p-chip-padding-x","1rem","--p-chip-padding-y","0.5rem","--p-chip-border-radius","0.5rem","--p-chip-font-size","1.2rem",3,"label","image","alt"]],template:function(o,n){if(o&1&&(q(0),_(1,"async"),a(2,"mainpanel",0)(3,"actions")(4,"div",1),m(5,Se,2,1,"ng-container",2)(6,Te,4,3,"ng-container",2),l()(),a(7,"content")(8,"div",3)(9,"div",4)(10,"div",5)(11,"div",6)(12,"div",7)(13,"h3"),s(14,"User Information"),l()(),a(15,"div",8)(16,"div",9)(17,"div",10)(18,"div",11)(19,"label"),s(20,"Selected User"),l(),a(21,"div")(22,"span"),s(23),l()()()(),a(24,"div",10)(25,"div",11)(26,"label"),s(27,"Selected Group"),l(),a(28,"div")(29,"span"),s(30),l()()()()()()()()(),a(31,"div",9)(32,"div",5)(33,"ul",12)(34,"li",13)(35,"button",14),s(36," Channels Filter "),l()(),a(37,"li",13)(38,"button",15),s(39," Restriction "),l()()(),a(40,"div",16)(41,"div",17)(42,"div",18)(43,"div",19),m(44,Ue,2,0,"div",20)(45,Ee,2,0),l(),a(46,"div",21)(47,"div",9)(48,"div",10),u(49,"lib-info-page-input",22),l()()()()()()()()()()()),o&2){let i=$(y(1,9,n.userLoader$));r(2),p("headerTitle",(i==null||i.selectedUser==null?null:i.selectedUser.Name)+" Info")("hideSearchBox",!0)("hideSearchDropdown",!0),r(3),p("ngxPermissionsOnly",n.userDeleteRole),r(),p("ngxPermissionsOnly",n.userEditRole),r(17),h(i==null||i.selectedUser==null?null:i.selectedUser.Name),r(7),h(i==null||i.selectedGroup==null?null:i.selectedGroup.Name),r(14),T((i==null||i.selectedChannels==null?null:i.selectedChannels.length)===0?44:45),r(5),p("inputValue",i==null?null:i.DownloadOrderDaysRange)}},dependencies:[P,W,ue,me,ie,ne,te,fe,se,le,ve],styles:[".nav-tabs[_ngcontent-%COMP%] .nav-link.active[_ngcontent-%COMP%]:hover, .nav-tabs[_ngcontent-%COMP%] .nav-link.active[_ngcontent-%COMP%]:focus, .nav-tabs[_ngcontent-%COMP%] .nav-item.show[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]:hover, .nav-tabs[_ngcontent-%COMP%] .nav-item.show[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]:focus{background-color:#fff!important;border-color:#dee2e6 #dee2e6 #fff}"]})}}return t})();export{ot as UserInfoComponent};
1
+ import{a as D}from"./chunk-CZDUJH26.js";import{a as fe}from"./chunk-NS46QSCM.js";import"./chunk-SM3P57SO.js";import{a as U}from"./chunk-UMP6ZMEJ.js";import"./chunk-ECRWEMEV.js";import"./chunk-LZCEM2PC.js";import{a as re}from"./chunk-Z3ITXK3D.js";import{a as pe}from"./chunk-ACIMXBIC.js";import"./chunk-OWQ3RWNF.js";import{b as ae}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{c as oe}from"./chunk-PW42BQIY.js";import{m as me,n as ue}from"./chunk-UGVEAL7H.js";import{A as ie}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import{b as le,c as se}from"./chunk-SWQXSJ7O.js";import{r as de,s as ce}from"./chunk-IHNN4Q2N.js";import"./chunk-EQIFZBRG.js";import{E as Y,G as ee,H as te,J as ne,d as K,g as Q,j as W,m as X,n as P}from"./chunk-M2FCTYGU.js";import{$c as _,Gb as x,Gc as s,Hc as h,Ic as z,Jb as L,Mb as m,Nc as q,Oc as $,Pc as C,Qc as j,Sc as I,Tc as J,Yb as p,Z as V,aa as w,ac as S,ad as y,dc as T,ec as k,gc as A,hc as H,ic as a,jc as l,kc as u,lc as g,mc as v,ob as F,oc as B,pa as b,rb as r,rd as Z,tc as G,uc as c,v as M,ya as N,za as R}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import{a as E,b as O}from"./chunk-66YHNWRR.js";var ge=(()=>{class t{transform(e){return typeof e=="number"&&(e=e.toString()),e!=null?e.replace(/\n/g,"<br />"):e}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275pipe=L({name:"newlines",type:t,pure:!0})}}return t})();var Ce=t=>({disabled:t}),_e=(t,d)=>({labelFilledInput:t,labelEmptyInput:d});function ye(t,d){if(t&1&&(a(0,"p"),s(1),_(2,"number"),l()),t&2){let e=c();r(),h(e.inputValueType()==="number"?y(2,1,e.inputValue):e.inputValue)}}function xe(t,d){if(t&1&&(u(0,"p",3),_(1,"newlines")),t&2){let e=c();p("innerHTML",y(1,1,e.inputValue),F)}}function Ie(t,d){if(t&1&&(g(0),s(1),v()),t&2){let e=c();r(),z(" ",e.labelValue," ")}}var ve=(()=>{class t{constructor(){this.inputValue="",this.labelValue="",this.inputType="input",this.labelVisible=!0,this.disabled=!1,this.class="mb-6",this.tooltip="",this.isInputFilled=!1,this.isNotEmpty=pe.IsNotEmpty}inputValueType(){return typeof this.inputValue}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=x({type:t,selectors:[["lib-info-page-input"]],inputs:{inputValue:"inputValue",labelValue:"labelValue",inputType:"inputType",labelVisible:"labelVisible",disabled:"disabled",class:"class",tooltip:"tooltip"},decls:5,vars:14,consts:[["matTooltipPosition","above",3,"ngClass","matTooltip"],[4,"ngIf"],[3,"innerHTML",4,"ngIf"],[3,"innerHTML"]],template:function(o,n){o&1&&(a(0,"div",0),m(1,ye,3,3,"p",1)(2,xe,2,3,"p",2),a(3,"label"),m(4,Ie,2,1,"ng-container",1),l()()),o&2&&(S(n.class),p("ngClass",I(9,Ce,n.disabled))("matTooltip",n.tooltip),r(),p("ngIf",n.isNotEmpty(n.inputValue)&&n.inputType=="input"),r(),p("ngIf",n.isNotEmpty(n.inputValue)&&n.inputType=="textarea"),r(),S(J(11,_e,n.isNotEmpty(n.inputValue),!n.isNotEmpty(n.inputValue))),r(),p("ngIf",n.labelVisible))},dependencies:[P,K,Q,X,ge,ce,de],styles:["div[_ngcontent-%COMP%]{border:1px solid #ced4da;position:relative;margin-bottom:1rem;border-radius:.25rem!important}p[_ngcontent-%COMP%]{margin-top:18px;margin-bottom:18px;padding-left:.75rem!important;font-size:.875rem}.labelFilledInput[_ngcontent-%COMP%]{position:absolute;top:-10px;left:10px;background:#fff;padding-left:4px;padding-right:4px;font-size:.75rem!important;color:#9da2a6}.labelEmptyInput[_ngcontent-%COMP%]{margin-top:18px;margin-bottom:18px;padding-left:.75rem!important;font-size:.875rem;color:#ccc}.disabled[_ngcontent-%COMP%]{background-color:#e9ecef;opacity:1}"]})}}return t})();var Pe=t=>({ID:t});function Me(t,d){if(t&1){let e=B();a(0,"button",24),G("click",function(){N(e);let n=c(2),i=C(0);return R(n.onDeleteUser(i==null||i.selectedUser==null?null:i.selectedUser.ID))}),u(1,"i",25),s(2," Delete "),l()}}function Se(t,d){if(t&1&&(g(0),m(1,Me,3,0,"button",23),v()),t&2){let e,o=c(),n=C(0);r(),T((n==null||n.selectedUser==null?null:n.selectedUser.Name)!==((e=o.currentLoginUser())==null?null:e.username)?1:-1)}}function Te(t,d){if(t&1&&(g(0),a(1,"a",26),u(2,"i",27),s(3," Edit "),l(),v()),t&2){c();let e=C(0);r(),p("queryParams",I(1,Pe,e==null||e.selectedUser==null?null:e.selectedUser.ID))}}function Ue(t,d){t&1&&(a(0,"div",20),s(1," All channels assigned to this user "),l())}function De(t,d){if(t&1&&u(0,"p-chip",28),t&2){let e=d.$implicit;p("label",e.Name)("image",e.logo)("alt",e.Name)}}function Ee(t,d){if(t&1&&A(0,De,1,3,"p-chip",28,k),t&2){c();let e=C(0);H(e==null?null:e.selectedChannels)}}var ot=(()=>{class t{constructor(){this.userService=b(D),this.activatedRoute=b(Y),this.toastService=b(ae),this.router=b(ee),this.userLoader$=this.activatedRoute.queryParams.pipe(w(e=>{let o=e.ID||null;return this.userService.getUserFormLoader(o).pipe(V(1),M(n=>(n.Options.Channels=oe.assignChannelLogo(n.Options.Channels),n)))}),M(e=>{let o=e.Options.Users.find(f=>f.ID===e.Form?.ID),n=e.Options.Groups.find(f=>f.ID===e.Form?.GroupID),i=e.Options.Channels.filter(f=>e.UserChannels?.includes(f.ID));return O(E({},e),{selectedUser:o||null,selectedGroup:n||null,selectedChannels:i||[],DownloadOrderDaysRange:e.Form?.DownloadOrderDaysRange||"0"})})),this.userEditRole=U.UserEdit,this.userDeleteRole=U.UserDelete,this.currentLoginUser=Z(()=>{let e=localStorage.getItem(re.AUTHORIZATION);return e?JSON.parse(e):null})}onDeleteUser(e){confirm("Are you sure you want to delete this user?")&&this.userService.deleteUsers([e]).subscribe({next:()=>{this.router.navigate(["/menu/users/users"]),this.toastService.success("User deleted successfully","Success")}})}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-user-info"]],features:[j([D])],decls:50,vars:12,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","group","aria-label","User Actions",1,"btn-group"],[4,"ngxPermissionsOnly"],[1,"container-fluid","py-5","bg-light-gray"],[1,"row","mt-8"],[1,"col-12"],[1,"card"],[1,"card-header"],[1,"card-body","mt-8","pb-4"],[1,"row"],[1,"col-6"],[1,"info-label-group"],["id","myTab","role","tablist",1,"nav","nav-tabs"],["role","presentation",1,"nav-item"],["id","channel-tab","data-bs-toggle","tab","data-bs-target","#channel-tab-pane","type","button","role","tab","aria-controls","channel-tab-pane","aria-selected","true",1,"nav-link","active"],["id","restriction-tab","data-bs-toggle","tab","data-bs-target","#restriction-tab-pane","type","button","role","tab","aria-controls","restriction-tab-pane","aria-selected","false",1,"nav-link"],[1,"card","rounded-0","border-top-0"],[1,"card-body","pb-4"],["id","myTabContent",1,"tab-content"],["id","channel-tab-pane","role","tabpanel","aria-labelledby","channel-tab","tabindex","0",1,"tab-pane","fade","show","active"],[1,"text-center","fs-5","opacity-50"],["id","restriction-tab-pane","role","tabpanel","aria-labelledby","restriction-tab-pane","tabindex","1",1,"tab-pane","fade"],["tooltip","How many days of past orders this user can download.","labelValue","Download Order Days Range","inputType","input",3,"inputValue"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],[1,"fa","fa-trash","me-1"],["role","button","routerLink","/menu/users/users/form",1,"btn","btn-outline-secondary",3,"queryParams"],[1,"fa","fa-edit","me-1"],[1,"me-3","mb-3",2,"--p-chip-image-width","1.2rem","--p-chip-image-height","1.2rem","--p-chip-padding-x","1rem","--p-chip-padding-y","0.5rem","--p-chip-border-radius","0.5rem","--p-chip-font-size","1.2rem",3,"label","image","alt"]],template:function(o,n){if(o&1&&(q(0),_(1,"async"),a(2,"mainpanel",0)(3,"actions")(4,"div",1),m(5,Se,2,1,"ng-container",2)(6,Te,4,3,"ng-container",2),l()(),a(7,"content")(8,"div",3)(9,"div",4)(10,"div",5)(11,"div",6)(12,"div",7)(13,"h3"),s(14,"User Information"),l()(),a(15,"div",8)(16,"div",9)(17,"div",10)(18,"div",11)(19,"label"),s(20,"Selected User"),l(),a(21,"div")(22,"span"),s(23),l()()()(),a(24,"div",10)(25,"div",11)(26,"label"),s(27,"Selected Group"),l(),a(28,"div")(29,"span"),s(30),l()()()()()()()()(),a(31,"div",9)(32,"div",5)(33,"ul",12)(34,"li",13)(35,"button",14),s(36," Channels Filter "),l()(),a(37,"li",13)(38,"button",15),s(39," Restriction "),l()()(),a(40,"div",16)(41,"div",17)(42,"div",18)(43,"div",19),m(44,Ue,2,0,"div",20)(45,Ee,2,0),l(),a(46,"div",21)(47,"div",9)(48,"div",10),u(49,"lib-info-page-input",22),l()()()()()()()()()()()),o&2){let i=$(y(1,9,n.userLoader$));r(2),p("headerTitle",(i==null||i.selectedUser==null?null:i.selectedUser.Name)+" Info")("hideSearchBox",!0)("hideSearchDropdown",!0),r(3),p("ngxPermissionsOnly",n.userDeleteRole),r(),p("ngxPermissionsOnly",n.userEditRole),r(17),h(i==null||i.selectedUser==null?null:i.selectedUser.Name),r(7),h(i==null||i.selectedGroup==null?null:i.selectedGroup.Name),r(14),T((i==null||i.selectedChannels==null?null:i.selectedChannels.length)===0?44:45),r(5),p("inputValue",i==null?null:i.DownloadOrderDaysRange)}},dependencies:[P,W,ue,me,ie,ne,te,fe,se,le,ve],styles:[".nav-tabs[_ngcontent-%COMP%] .nav-link.active[_ngcontent-%COMP%]:hover, .nav-tabs[_ngcontent-%COMP%] .nav-link.active[_ngcontent-%COMP%]:focus, .nav-tabs[_ngcontent-%COMP%] .nav-item.show[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]:hover, .nav-tabs[_ngcontent-%COMP%] .nav-item.show[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]:focus{background-color:#fff!important;border-color:#dee2e6 #dee2e6 #fff}"]})}}return t})();export{ot as UserInfoComponent};
@@ -1 +1 @@
1
- import{a as ne,b as ae,c as pe,d as ce,e as se,f as le}from"./chunk-VIMB2VWB.js";import{a as T}from"./chunk-TPC5KHGH.js";import"./chunk-B5VBBEEN.js";import{b as ie,c as re}from"./chunk-EH6HWI3G.js";import"./chunk-E3ROEHBW.js";import"./chunk-RECNBAEB.js";import"./chunk-AYPY47VM.js";import"./chunk-SM3P57SO.js";import{a as te,b as oe}from"./chunk-PAEIUO2F.js";import"./chunk-OZ7LWNOK.js";import"./chunk-ECRWEMEV.js";import"./chunk-LZCEM2PC.js";import"./chunk-GRIUDEPO.js";import{b as Y}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as Z,n as ee}from"./chunk-UGVEAL7H.js";import{A as X,c as K,h as Q,m as U}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import"./chunk-IHNN4Q2N.js";import"./chunk-EQIFZBRG.js";import{E as z,G as q,H,J,j as A,n as j}from"./chunk-M2FCTYGU.js";import{$b as v,$c as L,Gb as P,Gc as m,Hc as I,Ic as N,Kc as k,Lc as x,Mb as D,Mc as w,Nc as O,Qc as W,Ra as f,Rc as F,Sc as B,Yb as g,aa as G,ac as V,ad as $,dc as E,ea as R,ec as y,gc as M,hc as S,ic as r,jc as a,oc as C,pa as h,rb as p,tc as u,uc as b,ya as c,za as s}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var de=()=>({display:"d-flex"}),me=n=>({"border-end-0":n});function ue(n,_){if(n&1){let t=C();r(0,"div",18),u("click",function(){let e=c(t).$implicit;return s(e.checked=!e.checked)}),r(1,"div",19)(2,"p-checkbox",20),w("ngModelChange",function(e){let o=c(t).$implicit;return x(o.checked,e)||(o.checked=e),s(e)}),u("click",function(e){return c(t),s(e.stopPropagation())}),a(),r(3,"p",21),m(4),a()()()}if(n&2){let t=_.$implicit,i=_.$index,e=b().$implicit;V(B(8,me,i!==e.Roles.length-1)),g("pTooltip",t.Description),p(2),v(F(10,de)),g("binary",!0),k("ngModel",t.checked),p(2),N(" ",t.Name," ")}}function _e(n,_){if(n&1){let t=C();r(0,"div",11)(1,"div",12),u("click",function(){let e=c(t).$implicit,o=b(2);return s(o.onPermissionGroupChange(!e.checked,e.ID))}),r(2,"div",13)(3,"span",14),m(4),a(),r(5,"p-checkbox",15),u("click",function(e){return c(t),s(e.stopPropagation())})("onChange",function(e){let o=c(t).$implicit,l=b(2);return s(l.onPermissionGroupChange(e.checked,o.ID))}),a()()(),r(6,"div",16)(7,"div",11),M(8,ue,5,11,"div",17,y),a()()()}if(n&2){let t=_.$implicit;p(4),I(t.Name),p(),v(F(5,de)),g("binary",!0)("ngModel",t.checked),p(3),S(t==null?null:t.Roles)}}function he(n,_){if(n&1&&(r(0,"div",9),M(1,_e,10,6,"div",11,y),a()),n&2){let t=b();p(),S(t.roleOptions())}}var We=(()=>{class n{constructor(){this.groupService=h(T),this.activatedRoute=h(z),this.toastr=h(Y),this.router=h(q),this.groupName=f(null),this.roleOptions=f([]),this.description=f(null),this.group$=this.activatedRoute.queryParams.pipe(G(t=>(this.groupID=t.ID,this.groupService.getGroupsForm(t.ID))),R(t=>{this.groupName.set(t.Group.Name),this.description.set(t.Group.Description),this.initRoleOptions(t.Options,t.RoleSelected)}))}initRoleOptions(t,i){t=t.map(e=>(e.Roles=e.Roles.map(o=>(o.checked=i.includes(o.ID),o)),e.checked=e.Roles.every(o=>o.checked),e)),this.roleOptions.set(t)}onPermissionGroupChange(t,i){this.roleOptions.update(e=>{let o=e.findIndex(l=>l.ID===i);return o!==-1&&(e[o].checked=t,e[o].Roles=e[o].Roles.map(l=>(l.checked=t,l))),[...e]})}onSubmit(){let t={Group:{ID:this.groupID,Name:this.groupName(),Description:this.description()},RoleSelected:this.getSelecedRoles()};this.groupService.submitGroup(t).subscribe({next:i=>{this.toastr.success("Group saved successfully","Success"),this.router.navigate(["/menu/users/groups"])}})}getSelecedRoles(){let t=[];return this.roleOptions().forEach(i=>{i.Roles.forEach(e=>{e.checked&&t.push(e.ID)})}),t}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=P({type:n,selectors:[["app-groups-form"]],features:[W([T])],decls:24,vars:8,consts:[["headerTitle","Groups Form",3,"headerTitle","hideSearchBox","hideSearchDropdown"],["routerLink","/menu/users/groups",1,"btn","btn-secondary","me-3"],[1,"btn","btn-success",3,"click"],[1,"container-fluid"],[1,"row","mt-8"],[1,"col-12"],["type","text","pInputText","","placeholder","Group Name",1,"w-100","form-control","rounded-1",2,"padding-top","12px","padding-bottom","12px","font-size","14px",3,"ngModelChange","ngModel"],["value","0"],["value","1"],[1,"d-flex","flex-column","row-gap-6","ps-8"],["pInputTextarea","","rows","10","placeholder","Description",1,"w-100","form-control","rounded-1",3,"ngModelChange","ngModel"],[1,"row"],[1,"col-2","border","d-flex","align-items-center","justify-content-between","border-end-0","cursor-pointer",2,"height","40px","background","#f6f6f6","cursor","pointer",3,"click"],[1,"d-flex","justify-content-center","w-100","align-items-center","gap-4"],[1,"fs-5","w-100","text-center"],["size","small",3,"click","onChange","binary","ngModel"],[1,"col"],["tooltipPosition","top",1,"col-3","border","p-0","bg-white","cursor-pointer",2,"height","40px",3,"class","pTooltip"],["tooltipPosition","top",1,"col-3","border","p-0","bg-white","cursor-pointer",2,"height","40px",3,"click","pTooltip"],[1,"d-flex","h-100","align-items-center","gap-4","px-2"],["size","small",3,"ngModelChange","click","binary","ngModel"],[1,"fs-6","text-dark",2,"margin","0"]],template:function(i,e){if(i&1){let o=C();O(0),L(1,"async"),r(2,"mainpanel",0)(3,"actions")(4,"a",1),m(5," Cancel "),a(),r(6,"button",2),u("click",function(){return c(o),s(e.onSubmit())}),m(7,"Save"),a()(),r(8,"content")(9,"div",3)(10,"div",4)(11,"div",5)(12,"input",6),w("ngModelChange",function(d){return c(o),x(e.groupName,d)||(e.groupName=d),s(d)}),a()()(),r(13,"p-tabs",7)(14,"p-tablist")(15,"p-tab",7),m(16,"Permission"),a(),r(17,"p-tab",8),m(18,"Description"),a()(),r(19,"p-tabpanels")(20,"p-tabpanel",7),D(21,he,3,0,"div",9),a(),r(22,"p-tabpanel",8)(23,"textarea",10),w("ngModelChange",function(d){return c(o),x(e.description,d)||(e.description=d),s(d)}),a()()()()()()()}if(i&2){let o=$(1,6,e.group$);p(2),g("headerTitle",e.groupName()?"Edit Group - "+e.groupName():"New Group Form")("hideSearchBox",!0)("hideSearchDropdown",!0),p(10),k("ngModel",e.groupName),p(9),E(o?21:-1),p(2),k("ngModel",e.description)}},dependencies:[j,A,ee,Z,le,se,ce,pe,ne,ae,X,K,Q,U,re,ie,oe,te,J,H],styles:["[_nghost-%COMP%] .p-checkbox{display:flex!important;--p-checkbox-checked-background: #0976b4;--p-checkbox-hover-border-color: #0976b4;--p-checkbox-checked-border-color: #0976b4;--p-checkbox-checked-hover-border-color: #0976b4;--p-checkbox-hover-border-color-background: #0669a2;--p-checkbox-checked-hover-background: #0976b4}[_nghost-%COMP%] .p-tabs{--p-tabs-tab-active-color: #555555;--p-tabs-tab-color: #0976b4}[_nghost-%COMP%] .p-tabs .p-tabpanels{padding-left:0!important}[_nghost-%COMP%] .p-tabs .p-tablist-active-bar{background-color:#555!important}[_nghost-%COMP%] .p-panel .p-panel-header{display:none!important}"],changeDetection:0})}}return n})();export{We as GroupsFormComponent};
1
+ import{a as ne,b as ae,c as pe,d as ce,e as se,f as le}from"./chunk-VIMB2VWB.js";import{a as T}from"./chunk-VK3NG4L3.js";import"./chunk-B5VBBEEN.js";import{b as ie,c as re}from"./chunk-EH6HWI3G.js";import"./chunk-E3ROEHBW.js";import"./chunk-RECNBAEB.js";import"./chunk-AYPY47VM.js";import"./chunk-SM3P57SO.js";import{a as te,b as oe}from"./chunk-PAEIUO2F.js";import"./chunk-OZ7LWNOK.js";import"./chunk-ECRWEMEV.js";import"./chunk-LZCEM2PC.js";import"./chunk-OWQ3RWNF.js";import{b as Y}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{m as Z,n as ee}from"./chunk-UGVEAL7H.js";import{A as X,c as K,h as Q,m as U}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import"./chunk-IHNN4Q2N.js";import"./chunk-EQIFZBRG.js";import{E as z,G as q,H,J,j as A,n as j}from"./chunk-M2FCTYGU.js";import{$b as v,$c as L,Gb as P,Gc as m,Hc as I,Ic as N,Kc as k,Lc as x,Mb as D,Mc as w,Nc as O,Qc as W,Ra as f,Rc as F,Sc as B,Yb as g,aa as G,ac as V,ad as $,dc as E,ea as R,ec as y,gc as M,hc as S,ic as r,jc as a,oc as C,pa as h,rb as p,tc as u,uc as b,ya as c,za as s}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var de=()=>({display:"d-flex"}),me=n=>({"border-end-0":n});function ue(n,_){if(n&1){let t=C();r(0,"div",18),u("click",function(){let e=c(t).$implicit;return s(e.checked=!e.checked)}),r(1,"div",19)(2,"p-checkbox",20),w("ngModelChange",function(e){let o=c(t).$implicit;return x(o.checked,e)||(o.checked=e),s(e)}),u("click",function(e){return c(t),s(e.stopPropagation())}),a(),r(3,"p",21),m(4),a()()()}if(n&2){let t=_.$implicit,i=_.$index,e=b().$implicit;V(B(8,me,i!==e.Roles.length-1)),g("pTooltip",t.Description),p(2),v(F(10,de)),g("binary",!0),k("ngModel",t.checked),p(2),N(" ",t.Name," ")}}function _e(n,_){if(n&1){let t=C();r(0,"div",11)(1,"div",12),u("click",function(){let e=c(t).$implicit,o=b(2);return s(o.onPermissionGroupChange(!e.checked,e.ID))}),r(2,"div",13)(3,"span",14),m(4),a(),r(5,"p-checkbox",15),u("click",function(e){return c(t),s(e.stopPropagation())})("onChange",function(e){let o=c(t).$implicit,l=b(2);return s(l.onPermissionGroupChange(e.checked,o.ID))}),a()()(),r(6,"div",16)(7,"div",11),M(8,ue,5,11,"div",17,y),a()()()}if(n&2){let t=_.$implicit;p(4),I(t.Name),p(),v(F(5,de)),g("binary",!0)("ngModel",t.checked),p(3),S(t==null?null:t.Roles)}}function he(n,_){if(n&1&&(r(0,"div",9),M(1,_e,10,6,"div",11,y),a()),n&2){let t=b();p(),S(t.roleOptions())}}var We=(()=>{class n{constructor(){this.groupService=h(T),this.activatedRoute=h(z),this.toastr=h(Y),this.router=h(q),this.groupName=f(null),this.roleOptions=f([]),this.description=f(null),this.group$=this.activatedRoute.queryParams.pipe(G(t=>(this.groupID=t.ID,this.groupService.getGroupsForm(t.ID))),R(t=>{this.groupName.set(t.Group.Name),this.description.set(t.Group.Description),this.initRoleOptions(t.Options,t.RoleSelected)}))}initRoleOptions(t,i){t=t.map(e=>(e.Roles=e.Roles.map(o=>(o.checked=i.includes(o.ID),o)),e.checked=e.Roles.every(o=>o.checked),e)),this.roleOptions.set(t)}onPermissionGroupChange(t,i){this.roleOptions.update(e=>{let o=e.findIndex(l=>l.ID===i);return o!==-1&&(e[o].checked=t,e[o].Roles=e[o].Roles.map(l=>(l.checked=t,l))),[...e]})}onSubmit(){let t={Group:{ID:this.groupID,Name:this.groupName(),Description:this.description()},RoleSelected:this.getSelecedRoles()};this.groupService.submitGroup(t).subscribe({next:i=>{this.toastr.success("Group saved successfully","Success"),this.router.navigate(["/menu/users/groups"])}})}getSelecedRoles(){let t=[];return this.roleOptions().forEach(i=>{i.Roles.forEach(e=>{e.checked&&t.push(e.ID)})}),t}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=P({type:n,selectors:[["app-groups-form"]],features:[W([T])],decls:24,vars:8,consts:[["headerTitle","Groups Form",3,"headerTitle","hideSearchBox","hideSearchDropdown"],["routerLink","/menu/users/groups",1,"btn","btn-secondary","me-3"],[1,"btn","btn-success",3,"click"],[1,"container-fluid"],[1,"row","mt-8"],[1,"col-12"],["type","text","pInputText","","placeholder","Group Name",1,"w-100","form-control","rounded-1",2,"padding-top","12px","padding-bottom","12px","font-size","14px",3,"ngModelChange","ngModel"],["value","0"],["value","1"],[1,"d-flex","flex-column","row-gap-6","ps-8"],["pInputTextarea","","rows","10","placeholder","Description",1,"w-100","form-control","rounded-1",3,"ngModelChange","ngModel"],[1,"row"],[1,"col-2","border","d-flex","align-items-center","justify-content-between","border-end-0","cursor-pointer",2,"height","40px","background","#f6f6f6","cursor","pointer",3,"click"],[1,"d-flex","justify-content-center","w-100","align-items-center","gap-4"],[1,"fs-5","w-100","text-center"],["size","small",3,"click","onChange","binary","ngModel"],[1,"col"],["tooltipPosition","top",1,"col-3","border","p-0","bg-white","cursor-pointer",2,"height","40px",3,"class","pTooltip"],["tooltipPosition","top",1,"col-3","border","p-0","bg-white","cursor-pointer",2,"height","40px",3,"click","pTooltip"],[1,"d-flex","h-100","align-items-center","gap-4","px-2"],["size","small",3,"ngModelChange","click","binary","ngModel"],[1,"fs-6","text-dark",2,"margin","0"]],template:function(i,e){if(i&1){let o=C();O(0),L(1,"async"),r(2,"mainpanel",0)(3,"actions")(4,"a",1),m(5," Cancel "),a(),r(6,"button",2),u("click",function(){return c(o),s(e.onSubmit())}),m(7,"Save"),a()(),r(8,"content")(9,"div",3)(10,"div",4)(11,"div",5)(12,"input",6),w("ngModelChange",function(d){return c(o),x(e.groupName,d)||(e.groupName=d),s(d)}),a()()(),r(13,"p-tabs",7)(14,"p-tablist")(15,"p-tab",7),m(16,"Permission"),a(),r(17,"p-tab",8),m(18,"Description"),a()(),r(19,"p-tabpanels")(20,"p-tabpanel",7),D(21,he,3,0,"div",9),a(),r(22,"p-tabpanel",8)(23,"textarea",10),w("ngModelChange",function(d){return c(o),x(e.description,d)||(e.description=d),s(d)}),a()()()()()()()}if(i&2){let o=$(1,6,e.group$);p(2),g("headerTitle",e.groupName()?"Edit Group - "+e.groupName():"New Group Form")("hideSearchBox",!0)("hideSearchDropdown",!0),p(10),k("ngModel",e.groupName),p(9),E(o?21:-1),p(2),k("ngModel",e.description)}},dependencies:[j,A,ee,Z,le,se,ce,pe,ne,ae,X,K,Q,U,re,ie,oe,te,J,H],styles:["[_nghost-%COMP%] .p-checkbox{display:flex!important;--p-checkbox-checked-background: #0976b4;--p-checkbox-hover-border-color: #0976b4;--p-checkbox-checked-border-color: #0976b4;--p-checkbox-checked-hover-border-color: #0976b4;--p-checkbox-hover-border-color-background: #0669a2;--p-checkbox-checked-hover-background: #0976b4}[_nghost-%COMP%] .p-tabs{--p-tabs-tab-active-color: #555555;--p-tabs-tab-color: #0976b4}[_nghost-%COMP%] .p-tabs .p-tabpanels{padding-left:0!important}[_nghost-%COMP%] .p-tabs .p-tablist-active-bar{background-color:#555!important}[_nghost-%COMP%] .p-panel .p-panel-header{display:none!important}"],changeDetection:0})}}return n})();export{We as GroupsFormComponent};
@@ -1 +1 @@
1
- import{a as m,b as c}from"./chunk-IMK2JGZA.js";import"./chunk-SWQXSJ7O.js";import"./chunk-IHNN4Q2N.js";import"./chunk-EQIFZBRG.js";import{F as p,J as l}from"./chunk-M2FCTYGU.js";import{Gb as i,Yb as r,ic as a,jc as s,kc as o,rb as n}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var u=(()=>{class e{constructor(){this.tabs=[{Title:"Roles",Url:"/menu/profile/roles"}]}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=i({type:e,selectors:[["app-my-profile"]],decls:5,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs","usePermissions"]],template:function(t,f){t&1&&(a(0,"nav",0)(1,"div",1)(2,"div"),o(3,"nav-tab",2),s()()(),o(4,"router-outlet")),t&2&&(n(3),r("Tabs",f.tabs)("usePermissions",!0))},dependencies:[c,m,l,p],encapsulation:2})}}return e})(),M=[{path:"",component:u,children:[{path:"",redirectTo:"roles",pathMatch:"full"},{path:"roles",loadComponent:()=>import("./chunk-LC6TXSYB.js").then(e=>e.RolesInfoComponent),data:{title:"Roles Info"}}]}];export{u as MyProfileComponent,M as routes};
1
+ import{a as m,b as c}from"./chunk-IMK2JGZA.js";import"./chunk-SWQXSJ7O.js";import"./chunk-IHNN4Q2N.js";import"./chunk-EQIFZBRG.js";import{F as p,J as l}from"./chunk-M2FCTYGU.js";import{Gb as i,Yb as r,ic as a,jc as s,kc as o,rb as n}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var u=(()=>{class e{constructor(){this.tabs=[{Title:"Roles",Url:"/menu/profile/roles"}]}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=i({type:e,selectors:[["app-my-profile"]],decls:5,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs","usePermissions"]],template:function(t,f){t&1&&(a(0,"nav",0)(1,"div",1)(2,"div"),o(3,"nav-tab",2),s()()(),o(4,"router-outlet")),t&2&&(n(3),r("Tabs",f.tabs)("usePermissions",!0))},dependencies:[c,m,l,p],encapsulation:2})}}return e})(),M=[{path:"",component:u,children:[{path:"",redirectTo:"roles",pathMatch:"full"},{path:"roles",loadComponent:()=>import("./chunk-WQ3GDXQW.js").then(e=>e.RolesInfoComponent),data:{title:"Roles Info"}}]}];export{u as MyProfileComponent,M as routes};
@@ -1,2 +1,2 @@
1
- import{b as Ft}from"./chunk-QJJ2WFVX.js";import"./chunk-UEPQYAWE.js";import{a as St}from"./chunk-DL66NZ2A.js";import{a as be,b as ut,c as _t,d as ye,e as ve}from"./chunk-MKUH4R2N.js";import"./chunk-35XX6SQT.js";import{a as st,b as he,c as mt,d as ge,f as gt,g as Ct,h as Te,i as bt,o as re}from"./chunk-L3FX4O3H.js";import{b as vt}from"./chunk-G7R7LUW4.js";import{a as ft}from"./chunk-CCWNSX4Y.js";import"./chunk-PNITO7BE.js";import{b as ht,d as xe}from"./chunk-E4KNET2R.js";import{a as Tt,b as It}from"./chunk-YM4TJJMM.js";import"./chunk-74IXJYWO.js";import"./chunk-GIRXMYNI.js";import{b as xt}from"./chunk-OC2FBL33.js";import"./chunk-NS46QSCM.js";import"./chunk-EH6HWI3G.js";import"./chunk-E3ROEHBW.js";import"./chunk-OLOIQI4D.js";import"./chunk-RECNBAEB.js";import"./chunk-IA6KOBDJ.js";import{a as yt}from"./chunk-M5XGP4SG.js";import"./chunk-SN4AOGQK.js";import"./chunk-SB7NWPDS.js";import"./chunk-AYPY47VM.js";import"./chunk-SM3P57SO.js";import"./chunk-TPW56VWM.js";import{a as dt,b as Ce}from"./chunk-IIZDEGGW.js";import"./chunk-AQTXFEBA.js";import"./chunk-SYUFPF3D.js";import"./chunk-SDUUFQUI.js";import"./chunk-5OHRA4AS.js";import"./chunk-IL5JIRWJ.js";import"./chunk-MH4SJTQX.js";import"./chunk-3RK6DDJD.js";import{a as fe}from"./chunk-CUB2QFUO.js";import{a as lt,b as ct,f as pt}from"./chunk-KALG6D6L.js";import"./chunk-UMP6ZMEJ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-ECRWEMEV.js";import"./chunk-LZCEM2PC.js";import{a as rt,b as at}from"./chunk-M7NQID2Z.js";import"./chunk-CMTBBXR5.js";import"./chunk-3VUDKIND.js";import"./chunk-WY4BY2ID.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-AEOSNAHH.js";import"./chunk-TGMCGROM.js";import"./chunk-GRIUDEPO.js";import{e as oe}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{d as Y,e as j}from"./chunk-5JVEEL2T.js";import{b as et,c as h}from"./chunk-PW42BQIY.js";import{m as nt,n as ot}from"./chunk-UGVEAL7H.js";import{A as ne,B as G,a as Je,c as ie,e as ue,h as $,i as W,l as _e,m as ze,n as X,q as J,r as Qe,s as z,t as qe,u as Ze,v as Ke,z as Q}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import"./chunk-SWQXSJ7O.js";import{r as tt,s as it}from"./chunk-IHNN4Q2N.js";import"./chunk-EQIFZBRG.js";import{g as F,j as A,n as x}from"./chunk-M2FCTYGU.js";import{$c as T,Fc as me,Gb as v,Gc as f,Hb as se,Hc as te,Ic as Z,K as Be,Ka as P,Kc as je,Lc as He,M as Re,Mb as _,Mc as We,Oa as ke,Qc as S,Rc as de,Xb as Ge,Yb as c,Z as ee,Zb as Ee,ad as I,ca as $e,dc as k,ea as U,ec as L,f as Ue,g as Le,gc as B,hc as R,ic as p,ja as D,jc as r,jd as Xe,ka as pe,kc as d,lc as w,mc as O,oc as E,pa as u,rb as m,tc as y,uc as a,v as V,xa as N,xb as H,xc as Ye,ya as C,za as b}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var q=function(t){return t[t.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",t[t.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",t[t.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",t[t.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",t[t.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",t}(q||{});var ae=function(t){return t[t.FORMAT_NORMAL=1]="FORMAT_NORMAL",t[t.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",t}(ae||{});var le=function(t){return t[t.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",t[t.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",t[t.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",t[t.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",t[t.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",t}(le||{});var Me=class extends _e{setValue(s,e){if(s instanceof Date){let i=Math.floor(s.getTime()/1e3);super.setValue(i,e)}else super.setValue(s,e)}},De=(()=>{class t{constructor(){this.shopeeUploadService=u(be),this.formBuilder=u(Q)}getAttributes(e){return this.shopeeUploadService.getAttributes(e.channelId,e.categoryId).pipe(V(i=>this.setLabelToIndonesian(i)))}setLabelToIndonesian(e=[]){let i,o;return e=e.map(n=>(i=n?.multi_lang?.find(l=>l.language=="id"),n.attribute_value_list=n?.attribute_value_list?.map(l=>(o=l?.multi_lang?.find(g=>g.language=="id"),l.name=o?.value,l)),n.name=i?.value?i?.value:n.name,n)),e}createFormGroup(e){let i=this.formBuilder.group({}),o=[];return e.forEach(n=>{if(o=[],n.mandatory&&o.push(ue.required),n?.attribute_info?.format_type==ae.FORMAT_QUANTITATIVE_WITH_UNIT&&n?.attribute_info?.input_type==q.FREE_TEXT_FILED){let l=this.formBuilder.group({unit:new _e(null),value:new _e(null,o)});i.addControl(JSON.stringify(n.attribute_id),l)}else n?.attribute_info?.input_type==q.FREE_TEXT_FILED&&n?.attribute_info?.input_validation_type==le.VALIDATOR_DATE_TYPE?i.addControl(JSON.stringify(n.attribute_id),new Me(null,o)):i.addControl(JSON.stringify(n.attribute_id),this.formBuilder.control(null,o))}),i}getFilteredAttributes(e,i){let o=JSON.parse(JSON.stringify(e)),n=Object.keys(i),l=o.filter(g=>n.findIndex(Ae=>parseInt(Ae)==g.attribute_id||g.mandatory)!=-1);return l=this.filterSelectedAttributes(l,i),l}filterSelectedAttributes(e,i){return e.map(n=>{switch(n.attribute_info.input_type){case q.MULTI_COMBO_BOX:h.IsNotEmpty(i[n.attribute_id])?n.attribute_value_list=n.attribute_value_list.filter(l=>i[n.attribute_id]?.findIndex(g=>g==l.value_id)!=-1):n.attribute_value_list=[];break;case q.FREE_TEXT_FILED:n.attribute_info.format_type==ae.FORMAT_QUANTITATIVE_WITH_UNIT?n.attribute_value_list=this.setSelectedQuantitativeAttr(i[n.attribute_id]?.value,i[n.attribute_id]?.unit):n.attribute_info.input_validation_type==le.VALIDATOR_DATE_TYPE?n.attribute_value_list=this.setSelectedDateAttr(i[n.attribute_id]):n.attribute_value_list=this.setSelectedQuantitativeAttr(i[n.attribute_id]);break;default:n.attribute_value_list=n.attribute_value_list.filter(l=>l.value_id==i[n.attribute_id])}return n}).filter(n=>n?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(e,i){let o=[];if(h.IsNotEmpty(e)){let n={value_id:0,original_value_name:JSON.stringify(e)};h.IsNotEmpty(i)&&(n.value_unit=i),o=[n]}return o}setSelectedDateAttr(e){let i=[];return h.IsNotEmpty(e)&&(i=[{value_id:0,original_value_name:JSON.stringify(e)}]),i}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=D({token:t,factory:t.\u0275fac})}}return t})();var Ie=(()=>{class t{constructor(){this._calendarHeaderConfig=new Le({hideBtnClear:!1,hideBtnToday:!1}),this.calendarConfig=this._calendarHeaderConfig.value}setHeaderConfig(e){this._calendarHeaderConfig.next(e)}getHeaderConfig$(){return this._calendarHeaderConfig.asObservable()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=D({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Lt=["class","component ts"];function Bt(t,s){if(t&1){let e=E();p(0,"button",3),y("click",function(){C(e);let o=a(2);return b(o.todayClicked())}),d(1,"i",4),r()}}function Rt(t,s){if(t&1){let e=E();p(0,"button",5),y("click",function(){C(e);let o=a(2);return b(o.clearClicked())}),d(1,"i",6),r()}}function $t(t,s){if(t&1&&(w(0),_(1,Bt,2,0,"button",1)(2,Rt,2,0,"button",2),O()),t&2){let e=s.ngIf;m(),c("ngIf",!e.hideBtnToday),m(),c("ngIf",!e.hideBtnClear)}}var kt=(()=>{class t{constructor(e,i,o,n,l){this._datePicker=e,this._calendar=i,this._dateAdapter=o,this.calendarService=n,this._destroyed=new Ue,i.stateChanges.pipe($e(this._destroyed)).subscribe(g=>l.markForCheck()),this.calendarConfig$=this.calendarService.getHeaderConfig$()}todayClicked(){this._calendar.activeDate=this._dateAdapter.today(),this._datePicker.select(this._dateAdapter.today()),this._datePicker.close()}clearClicked(){this._datePicker.select(null),this._datePicker.close()}ngOnChanges(e){this._calendar.ngOnChanges(e)}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}static{this.\u0275fac=function(i){return new(i||t)(H(Te),H(Ct),H(he),H(Ie),H(Xe))}}static{this.\u0275cmp=v({type:t,selectors:[["POS-DatepickerHeader",8,"component","ts"]],standalone:!1,features:[N],attrs:Lt,decls:3,vars:3,consts:[[4,"ngIf"],["mat-icon-button","","title","Today",3,"click",4,"ngIf"],["mat-icon-button","","title","Clear",3,"click",4,"ngIf"],["mat-icon-button","","title","Today",3,"click"],[1,"far","fa-clock",2,"font-size","18px"],["mat-icon-button","","title","Clear",3,"click"],[1,"far","fa-xmark-circle",2,"font-size","18px"]],template:function(i,o){i&1&&(p(0,"mat-calendar-header"),_(1,$t,3,2,"ng-container",0),T(2,"async"),r()),i&2&&(m(),c("ngIf",I(2,1,o.calendarConfig$)))},dependencies:[F,ht,gt,A],encapsulation:2})}}return t})(),Et=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=se({type:t})}static{this.\u0275inj=pe({providers:[re],imports:[x,xe,ge,re,fe,Ce]})}}return t})();function Gt(t,s){if(t&1&&(p(0,"mat-label",7)(1,"span"),f(2),r()()),t&2){let e=a();c("show",e.placeholder),m(2),te(e.placeholder)}}var Yt={parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"dddd, D MMMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"dddd, D MMMM YYYY",monthYearA11yLabel:"MMMM YYYY"}},Mt=(()=>{class t{set hidelClearBtn(e){this.calendarService.setHeaderConfig({hideBtnClear:e,hideBtnToday:this.calendarService.calendarConfig.hideBtnToday})}change(e){let i=null;e&&(i=e.toDate(),i.setHours(0,0,0,0)),this.onChange(i),this.dateChange.emit(i)}constructor(e){this.calendarService=e,this.headerComponent=kt,this.appearance="outline",this.isFloatingLabel=!0,this.disabled=!1,this.readOnly=!1,this.dateChange=new P,this.minDate=h.MinDate,this.onChange=i=>{},this.displayToggle=!0}writeValue(e){this.date=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){this.disabled=e}onOpenDatepicker(){let e=document.getElementById("dropdown-filter");if(e){var i=new bootstrap.Dropdown(e);i&&(i._config.autoClose="inside")}}onCloseDatepicker(){let e=document.getElementById("dropdown-filter");if(e){var i=new bootstrap.Dropdown(e);i&&(i._config.autoClose="outside")}}ngOnDestroy(){this.calendarService.setHeaderConfig({hideBtnClear:!1,hideBtnToday:!1})}static{this.\u0275fac=function(i){return new(i||t)(H(Ie))}}static{this.\u0275cmp=v({type:t,selectors:[["datepicker"]],inputs:{data_cy:"data_cy",placeholder:"placeholder",displayToggle:"displayToggle",appearance:"appearance",width:"width",isFloatingLabel:"isFloatingLabel",date:"date",disabled:"disabled",readOnly:"readOnly",minDateValidation:"minDateValidation",maxDateValidation:"maxDateValidation",hidelClearBtn:"hidelClearBtn"},outputs:{dateChange:"dateChange"},standalone:!1,features:[S([{provide:he,useClass:St,deps:[st]},{provide:mt,useValue:Yt},{provide:Je,multi:!0,useExisting:t}])],decls:7,vars:16,consts:[["picker1",""],[1,"datepicker",3,"disabled","appearance"],[3,"show",4,"ngIf"],["matInput","",3,"dateChange","click","matDatepicker","min","max","placeholder","value","disabled","readonly"],["matSuffix","","aria-hidden","true",1,"datepicker-toggle-icon",3,"click"],[1,"fa-regular","fa-angle-down"],[3,"opened","closed","calendarHeaderComponent"],[3,"show"]],template:function(i,o){if(i&1){let n=E();p(0,"mat-form-field",1),_(1,Gt,3,2,"mat-label",2),p(2,"input",3),y("dateChange",function(g){return C(n),b(o.change(g.value))})("click",function(){C(n);let g=me(6);return b(g.open())}),r(),p(3,"span",4),y("click",function(){C(n);let g=me(6);return b(g.open())}),d(4,"i",5),r(),p(5,"mat-datepicker",6,0),y("opened",function(){return C(n),b(o.onOpenDatepicker())})("closed",function(){return C(n),b(o.onCloseDatepicker())}),r()()}if(i&2){let n=me(6);Ee("width",o.width||100,"%"),c("disabled",o.disabled)("appearance",o.appearance),m(),c("ngIf",o.isFloatingLabel&&o.placeholder),m(),Ye("placeholder",o.placeholder||""),c("matDatepicker",n)("min",o.minDateValidation)("max",o.maxDateValidation)("value",o.date==o.minDate?null:o.date)("disabled",o.disabled)("readonly",o.readOnly),Ge("data-cy",o.data_cy),m(),Ee("display",o.displayToggle?"unset":"none"),m(2),c("calendarHeaderComponent",o.headerComponent)}},dependencies:[F,Te,bt,pt,lt,ct,dt],styles:[`.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:3px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{top:28px!important;font-size:16px;color:#9da2a6}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:23px!important;font-size:.875rem;color:#ccc}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}.datepicker .datepicker-toggle-icon{width:28px;height:36px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;margin-right:6px}.datepicker .datepicker-toggle-icon i{font-family:"Font Awesome 6 Pro","Font Awesome 6 Free","Font Awesome 5 Pro","Font Awesome 5 Free";font-weight:400;font-size:16px;line-height:1;color:#6b7280}
1
+ import{b as Ft}from"./chunk-QJJ2WFVX.js";import"./chunk-UEPQYAWE.js";import{a as St}from"./chunk-DL66NZ2A.js";import{a as be,b as ut,c as _t,d as ye,e as ve}from"./chunk-GLZJR5RB.js";import"./chunk-35XX6SQT.js";import{a as st,b as he,c as mt,d as ge,f as gt,g as Ct,h as Te,i as bt,o as re}from"./chunk-L3FX4O3H.js";import{b as vt}from"./chunk-G7R7LUW4.js";import{a as ft}from"./chunk-CCWNSX4Y.js";import"./chunk-PNITO7BE.js";import{b as ht,d as xe}from"./chunk-E4KNET2R.js";import{a as Tt,b as It}from"./chunk-YM4TJJMM.js";import"./chunk-74IXJYWO.js";import"./chunk-GIRXMYNI.js";import{b as xt}from"./chunk-OC2FBL33.js";import"./chunk-NS46QSCM.js";import"./chunk-EH6HWI3G.js";import"./chunk-E3ROEHBW.js";import"./chunk-OLOIQI4D.js";import"./chunk-RECNBAEB.js";import"./chunk-IA6KOBDJ.js";import{a as yt}from"./chunk-M5XGP4SG.js";import"./chunk-SN4AOGQK.js";import"./chunk-SB7NWPDS.js";import"./chunk-AYPY47VM.js";import"./chunk-SM3P57SO.js";import"./chunk-YTL4RBBS.js";import{a as dt,b as Ce}from"./chunk-IIZDEGGW.js";import"./chunk-AQTXFEBA.js";import"./chunk-SYUFPF3D.js";import"./chunk-SDUUFQUI.js";import"./chunk-5OHRA4AS.js";import"./chunk-IL5JIRWJ.js";import"./chunk-MH4SJTQX.js";import"./chunk-3RK6DDJD.js";import{a as fe}from"./chunk-CUB2QFUO.js";import{a as lt,b as ct,f as pt}from"./chunk-KALG6D6L.js";import"./chunk-UMP6ZMEJ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-ECRWEMEV.js";import"./chunk-LZCEM2PC.js";import{a as rt,b as at}from"./chunk-M7NQID2Z.js";import"./chunk-CMTBBXR5.js";import"./chunk-ZOKAF4JQ.js";import"./chunk-ZKZ5DIIR.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-AEOSNAHH.js";import"./chunk-TGMCGROM.js";import"./chunk-OWQ3RWNF.js";import{e as oe}from"./chunk-JXSBFTQM.js";import"./chunk-K5XRGNWG.js";import{d as Y,e as j}from"./chunk-5JVEEL2T.js";import{b as et,c as h}from"./chunk-PW42BQIY.js";import{m as nt,n as ot}from"./chunk-UGVEAL7H.js";import{A as ne,B as G,a as Je,c as ie,e as ue,h as $,i as W,l as _e,m as ze,n as X,q as J,r as Qe,s as z,t as qe,u as Ze,v as Ke,z as Q}from"./chunk-6QYD6NIJ.js";import"./chunk-ATZ475FN.js";import"./chunk-SWQXSJ7O.js";import{r as tt,s as it}from"./chunk-IHNN4Q2N.js";import"./chunk-EQIFZBRG.js";import{g as F,j as A,n as x}from"./chunk-M2FCTYGU.js";import{$c as T,Fc as me,Gb as v,Gc as f,Hb as se,Hc as te,Ic as Z,K as Be,Ka as P,Kc as je,Lc as He,M as Re,Mb as _,Mc as We,Oa as ke,Qc as S,Rc as de,Xb as Ge,Yb as c,Z as ee,Zb as Ee,ad as I,ca as $e,dc as k,ea as U,ec as L,f as Ue,g as Le,gc as B,hc as R,ic as p,ja as D,jc as r,jd as Xe,ka as pe,kc as d,lc as w,mc as O,oc as E,pa as u,rb as m,tc as y,uc as a,v as V,xa as N,xb as H,xc as Ye,ya as C,za as b}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var q=function(t){return t[t.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",t[t.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",t[t.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",t[t.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",t[t.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",t}(q||{});var ae=function(t){return t[t.FORMAT_NORMAL=1]="FORMAT_NORMAL",t[t.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",t}(ae||{});var le=function(t){return t[t.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",t[t.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",t[t.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",t[t.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",t[t.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",t}(le||{});var Me=class extends _e{setValue(s,e){if(s instanceof Date){let i=Math.floor(s.getTime()/1e3);super.setValue(i,e)}else super.setValue(s,e)}},De=(()=>{class t{constructor(){this.shopeeUploadService=u(be),this.formBuilder=u(Q)}getAttributes(e){return this.shopeeUploadService.getAttributes(e.channelId,e.categoryId).pipe(V(i=>this.setLabelToIndonesian(i)))}setLabelToIndonesian(e=[]){let i,o;return e=e.map(n=>(i=n?.multi_lang?.find(l=>l.language=="id"),n.attribute_value_list=n?.attribute_value_list?.map(l=>(o=l?.multi_lang?.find(g=>g.language=="id"),l.name=o?.value,l)),n.name=i?.value?i?.value:n.name,n)),e}createFormGroup(e){let i=this.formBuilder.group({}),o=[];return e.forEach(n=>{if(o=[],n.mandatory&&o.push(ue.required),n?.attribute_info?.format_type==ae.FORMAT_QUANTITATIVE_WITH_UNIT&&n?.attribute_info?.input_type==q.FREE_TEXT_FILED){let l=this.formBuilder.group({unit:new _e(null),value:new _e(null,o)});i.addControl(JSON.stringify(n.attribute_id),l)}else n?.attribute_info?.input_type==q.FREE_TEXT_FILED&&n?.attribute_info?.input_validation_type==le.VALIDATOR_DATE_TYPE?i.addControl(JSON.stringify(n.attribute_id),new Me(null,o)):i.addControl(JSON.stringify(n.attribute_id),this.formBuilder.control(null,o))}),i}getFilteredAttributes(e,i){let o=JSON.parse(JSON.stringify(e)),n=Object.keys(i),l=o.filter(g=>n.findIndex(Ae=>parseInt(Ae)==g.attribute_id||g.mandatory)!=-1);return l=this.filterSelectedAttributes(l,i),l}filterSelectedAttributes(e,i){return e.map(n=>{switch(n.attribute_info.input_type){case q.MULTI_COMBO_BOX:h.IsNotEmpty(i[n.attribute_id])?n.attribute_value_list=n.attribute_value_list.filter(l=>i[n.attribute_id]?.findIndex(g=>g==l.value_id)!=-1):n.attribute_value_list=[];break;case q.FREE_TEXT_FILED:n.attribute_info.format_type==ae.FORMAT_QUANTITATIVE_WITH_UNIT?n.attribute_value_list=this.setSelectedQuantitativeAttr(i[n.attribute_id]?.value,i[n.attribute_id]?.unit):n.attribute_info.input_validation_type==le.VALIDATOR_DATE_TYPE?n.attribute_value_list=this.setSelectedDateAttr(i[n.attribute_id]):n.attribute_value_list=this.setSelectedQuantitativeAttr(i[n.attribute_id]);break;default:n.attribute_value_list=n.attribute_value_list.filter(l=>l.value_id==i[n.attribute_id])}return n}).filter(n=>n?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(e,i){let o=[];if(h.IsNotEmpty(e)){let n={value_id:0,original_value_name:JSON.stringify(e)};h.IsNotEmpty(i)&&(n.value_unit=i),o=[n]}return o}setSelectedDateAttr(e){let i=[];return h.IsNotEmpty(e)&&(i=[{value_id:0,original_value_name:JSON.stringify(e)}]),i}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=D({token:t,factory:t.\u0275fac})}}return t})();var Ie=(()=>{class t{constructor(){this._calendarHeaderConfig=new Le({hideBtnClear:!1,hideBtnToday:!1}),this.calendarConfig=this._calendarHeaderConfig.value}setHeaderConfig(e){this._calendarHeaderConfig.next(e)}getHeaderConfig$(){return this._calendarHeaderConfig.asObservable()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=D({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Lt=["class","component ts"];function Bt(t,s){if(t&1){let e=E();p(0,"button",3),y("click",function(){C(e);let o=a(2);return b(o.todayClicked())}),d(1,"i",4),r()}}function Rt(t,s){if(t&1){let e=E();p(0,"button",5),y("click",function(){C(e);let o=a(2);return b(o.clearClicked())}),d(1,"i",6),r()}}function $t(t,s){if(t&1&&(w(0),_(1,Bt,2,0,"button",1)(2,Rt,2,0,"button",2),O()),t&2){let e=s.ngIf;m(),c("ngIf",!e.hideBtnToday),m(),c("ngIf",!e.hideBtnClear)}}var kt=(()=>{class t{constructor(e,i,o,n,l){this._datePicker=e,this._calendar=i,this._dateAdapter=o,this.calendarService=n,this._destroyed=new Ue,i.stateChanges.pipe($e(this._destroyed)).subscribe(g=>l.markForCheck()),this.calendarConfig$=this.calendarService.getHeaderConfig$()}todayClicked(){this._calendar.activeDate=this._dateAdapter.today(),this._datePicker.select(this._dateAdapter.today()),this._datePicker.close()}clearClicked(){this._datePicker.select(null),this._datePicker.close()}ngOnChanges(e){this._calendar.ngOnChanges(e)}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}static{this.\u0275fac=function(i){return new(i||t)(H(Te),H(Ct),H(he),H(Ie),H(Xe))}}static{this.\u0275cmp=v({type:t,selectors:[["POS-DatepickerHeader",8,"component","ts"]],standalone:!1,features:[N],attrs:Lt,decls:3,vars:3,consts:[[4,"ngIf"],["mat-icon-button","","title","Today",3,"click",4,"ngIf"],["mat-icon-button","","title","Clear",3,"click",4,"ngIf"],["mat-icon-button","","title","Today",3,"click"],[1,"far","fa-clock",2,"font-size","18px"],["mat-icon-button","","title","Clear",3,"click"],[1,"far","fa-xmark-circle",2,"font-size","18px"]],template:function(i,o){i&1&&(p(0,"mat-calendar-header"),_(1,$t,3,2,"ng-container",0),T(2,"async"),r()),i&2&&(m(),c("ngIf",I(2,1,o.calendarConfig$)))},dependencies:[F,ht,gt,A],encapsulation:2})}}return t})(),Et=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=se({type:t})}static{this.\u0275inj=pe({providers:[re],imports:[x,xe,ge,re,fe,Ce]})}}return t})();function Gt(t,s){if(t&1&&(p(0,"mat-label",7)(1,"span"),f(2),r()()),t&2){let e=a();c("show",e.placeholder),m(2),te(e.placeholder)}}var Yt={parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"dddd, D MMMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"dddd, D MMMM YYYY",monthYearA11yLabel:"MMMM YYYY"}},Mt=(()=>{class t{set hidelClearBtn(e){this.calendarService.setHeaderConfig({hideBtnClear:e,hideBtnToday:this.calendarService.calendarConfig.hideBtnToday})}change(e){let i=null;e&&(i=e.toDate(),i.setHours(0,0,0,0)),this.onChange(i),this.dateChange.emit(i)}constructor(e){this.calendarService=e,this.headerComponent=kt,this.appearance="outline",this.isFloatingLabel=!0,this.disabled=!1,this.readOnly=!1,this.dateChange=new P,this.minDate=h.MinDate,this.onChange=i=>{},this.displayToggle=!0}writeValue(e){this.date=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){this.disabled=e}onOpenDatepicker(){let e=document.getElementById("dropdown-filter");if(e){var i=new bootstrap.Dropdown(e);i&&(i._config.autoClose="inside")}}onCloseDatepicker(){let e=document.getElementById("dropdown-filter");if(e){var i=new bootstrap.Dropdown(e);i&&(i._config.autoClose="outside")}}ngOnDestroy(){this.calendarService.setHeaderConfig({hideBtnClear:!1,hideBtnToday:!1})}static{this.\u0275fac=function(i){return new(i||t)(H(Ie))}}static{this.\u0275cmp=v({type:t,selectors:[["datepicker"]],inputs:{data_cy:"data_cy",placeholder:"placeholder",displayToggle:"displayToggle",appearance:"appearance",width:"width",isFloatingLabel:"isFloatingLabel",date:"date",disabled:"disabled",readOnly:"readOnly",minDateValidation:"minDateValidation",maxDateValidation:"maxDateValidation",hidelClearBtn:"hidelClearBtn"},outputs:{dateChange:"dateChange"},standalone:!1,features:[S([{provide:he,useClass:St,deps:[st]},{provide:mt,useValue:Yt},{provide:Je,multi:!0,useExisting:t}])],decls:7,vars:16,consts:[["picker1",""],[1,"datepicker",3,"disabled","appearance"],[3,"show",4,"ngIf"],["matInput","",3,"dateChange","click","matDatepicker","min","max","placeholder","value","disabled","readonly"],["matSuffix","","aria-hidden","true",1,"datepicker-toggle-icon",3,"click"],[1,"fa-regular","fa-angle-down"],[3,"opened","closed","calendarHeaderComponent"],[3,"show"]],template:function(i,o){if(i&1){let n=E();p(0,"mat-form-field",1),_(1,Gt,3,2,"mat-label",2),p(2,"input",3),y("dateChange",function(g){return C(n),b(o.change(g.value))})("click",function(){C(n);let g=me(6);return b(g.open())}),r(),p(3,"span",4),y("click",function(){C(n);let g=me(6);return b(g.open())}),d(4,"i",5),r(),p(5,"mat-datepicker",6,0),y("opened",function(){return C(n),b(o.onOpenDatepicker())})("closed",function(){return C(n),b(o.onCloseDatepicker())}),r()()}if(i&2){let n=me(6);Ee("width",o.width||100,"%"),c("disabled",o.disabled)("appearance",o.appearance),m(),c("ngIf",o.isFloatingLabel&&o.placeholder),m(),Ye("placeholder",o.placeholder||""),c("matDatepicker",n)("min",o.minDateValidation)("max",o.maxDateValidation)("value",o.date==o.minDate?null:o.date)("disabled",o.disabled)("readonly",o.readOnly),Ge("data-cy",o.data_cy),m(),Ee("display",o.displayToggle?"unset":"none"),m(2),c("calendarHeaderComponent",o.headerComponent)}},dependencies:[F,Te,bt,pt,lt,ct,dt],styles:[`.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:3px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{top:28px!important;font-size:16px;color:#9da2a6}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:23px!important;font-size:.875rem;color:#ccc}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}.datepicker .datepicker-toggle-icon{width:28px;height:36px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;margin-right:6px}.datepicker .datepicker-toggle-icon i{font-family:"Font Awesome 6 Pro","Font Awesome 6 Free","Font Awesome 5 Pro","Font Awesome 5 Free";font-weight:400;font-size:16px;line-height:1;color:#6b7280}
2
2
  `],encapsulation:2})}}return t})(),Dt=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=se({type:t})}static{this.\u0275inj=pe({providers:[re],imports:[x,xe,ge,re,fe,Ce,Et,vt]})}}return t})();var Ne=()=>[];function Ht(t,s){t&1&&(p(0,"span",5),f(1,"*"),r())}function Wt(t,s){if(t&1&&d(0,"ng-select",6),t&2){let e=a().$implicit;c("multiple",!0)("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:de(4,Ne))("placeholder","Pilih "+(e==null?null:e.name))}}function Xt(t,s){if(t&1&&d(0,"input",8),t&2){let e=a(2).$implicit;c("formControlName",e.attribute_id)("placeholder","Isi "+(e==null?null:e.name))}}function Jt(t,s){if(t&1&&(p(0,"option",15),f(1),r()),t&2){let e=s.$implicit;c("value",e),m(),te(e)}}function zt(t,s){if(t&1&&(p(0,"div",10),d(1,"input",12),p(2,"select",13)(3,"option",14),f(4,"Unit"),r(),B(5,Jt,2,2,"option",15,L),r()()),t&2){let e=a(3).$implicit;c("formGroupName",e.attribute_id),m(),c("placeholder","Isi "+(e==null?null:e.name)),m(2),c("value",null),m(2),R(e==null||e.attribute_info==null?null:e.attribute_info.attribute_unit_list)}}function Qt(t,s){if(t&1&&d(0,"input",11),t&2){let e=a(3).$implicit;c("formControlName",e.attribute_id)("placeholder","Isi "+(e==null?null:e.name))}}function qt(t,s){if(t&1&&_(0,zt,7,3,"div",10)(1,Qt,1,2,"input",11),t&2){let e=a(2).$implicit,i=a(2);k((e==null||e.attribute_info==null?null:e.attribute_info.format_type)==i.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function Zt(t,s){if(t&1&&d(0,"datepicker",9),t&2){let e=a(2).$implicit;c("formControlName",e.attribute_id)}}function Kt(t,s){if(t&1&&_(0,Xt,1,2,"input",8)(1,qt,2,1)(2,Zt,1,1,"datepicker",9),t&2){let e,i=a().$implicit,o=a(2);k((e=i==null||i.attribute_info==null?null:i.attribute_info.input_validation_type)===o.validationType.VALIDATOR_STRING_TYPE?0:e===o.validationType.VALIDATOR_FLOAT_TYPE?1:e===o.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function ei(t,s){if(t&1&&d(0,"ng-select",7),t&2){let e=a().$implicit;c("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:de(3,Ne))("placeholder","Pilih "+(e==null?null:e.name))}}function ti(t,s){if(t&1&&d(0,"ng-select",7),t&2){let e=a().$implicit;c("formControlName",e.attribute_id)("items",e.attribute_value_list?e.attribute_value_list:de(3,Ne))("placeholder","Pilih "+(e==null?null:e.name))}}function ii(t,s){if(t&1&&(p(0,"div",3)(1,"div",4),_(2,Ht,2,0,"span",5),p(3,"span"),f(4),r()(),_(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),r()),t&2){let e,i=s.$implicit,o=a(2);m(2),k(i.mandatory?2:-1),m(2),Z(" ",i==null?null:i.name," "),m(),k((e=i==null||i.attribute_info==null?null:i.attribute_info.input_type)===o.inputType.MULTI_COMBO_BOX?5:e===o.inputType.FREE_TEXT_FILED?6:e===o.inputType.SINGLE_COMBO_BOX?7:8)}}function ni(t,s){if(t&1&&(w(0),p(1,"form",1)(2,"div",2),B(3,ii,9,3,"div",3,L),r()(),O()),t&2){let e=s.ngIf,i=a();m(),c("formGroup",i.form),m(2),R(e)}}var Nt=(()=>{class t{constructor(){this.formCategoryService=u(De),this.attributesChanges=new P,this.inputType=q,this.formatType=ae,this.validationType=le}ngOnChanges(){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:this.categoryId,channelId:this.channelId,channelType:this.channelType}).pipe(U(e=>{this.form=this.formCategoryService.createFormGroup(e),this.listenToFormChange(e)}),ee(1)))}listenToFormChange(e){let i=[];this.formSubscription=this.form.valueChanges.subscribe(o=>{i=this.formCategoryService.getFilteredAttributes(e,o),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["shopee-attribute-form"]],inputs:{channelType:"channelType",categoryId:"categoryId",channelId:"channelId",channelProductUpload:"channelProductUpload"},outputs:{attributesChanges:"attributesChanges"},features:[S([De]),N],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","value_id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","value_id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"],[1,"attribute-datepicker",3,"formControlName"],[1,"d-flex","align-items-center",3,"formGroupName"],["type","text","autoNum","",1,"form-control",3,"formControlName","placeholder"],["formControlName","value","type","text","autoNum","",1,"form-control","me-1",2,"width","200px",3,"placeholder"],["name","unit","id","unit","formControlName","unit",1,"form-control"],["disabled","","selected","",3,"value"],[3,"value"]],template:function(i,o){i&1&&(_(0,ni,5,1,"ng-container",0),T(1,"async")),i&2&&c("ngIf",I(1,1,o.attributes$))},dependencies:[x,F,A,j,Y,G,X,Ze,Ke,ie,qe,$,W,J,z,Qe,yt,Dt,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}"]})}}return t})();var Pe=(()=>{class t{constructor(){this.httpService=u(oe),this.formBuilder=u(Q),this.uploadProductService=u(ve)}getAttributes(e,i){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:e},{key:"CategoryID",value:i}]).pipe(Be(n=>this.uploadProductService.selectedProduct$.pipe(V(l=>(n=this.mappingAttributeSalesProperty(n,l),n)))))}mappingAttributeSalesProperty(e,i){let o=0;return e.filter(n=>(n.type=="SALES_PROPERTY"&&(o+=1),o>1?(o=0,!1):!0)).map(n=>(n.type=="SALES_PROPERTY"&&(n.name="Jenis Variant",n.is_multiple_selection=!1,n.is_required=this.isProductHasMoreVariant(i),n.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),n))}isProductHasMoreVariant(e){let i=!1,o=[];return e.forEach(n=>{n.Variants&&o.push(n.Variants.length)}),i=o.some(n=>n>1),i}createFormGroup(e){let i=this.formBuilder.group({}),o=[];return e.forEach(n=>{o=[],n.is_required&&o.push(ue.required),i.addControl(n.id,this.formBuilder.control(null,o))}),i}getFilteredAttributes(e,i){let o=JSON.parse(JSON.stringify(e)),n=Object.keys(i),l=o.filter(g=>n.findIndex(Ae=>parseInt(Ae)==g.id)!=-1);return l=this.filterSelectedAttributes(l,i),l}filterSelectedAttributes(e,i){return e.map(n=>(h.IsNotEmpty(n.values)?n.is_multiple_selection?n.values=n.values.filter(l=>i[n.id]?.includes(l.id)):n.values=n.values.filter(l=>l.id==i[n.id]):i[n.id]&&(n.values=[{id:null,name:i[n.id]}]),n)).filter(n=>n?.values?.length>0)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=D({token:t,factory:t.\u0275fac})}}return t})();function oi(t,s){t&1&&(p(0,"span",5),f(1,"*"),r())}function ri(t,s){if(t&1&&d(0,"ng-select",6),t&2){let e=a().$implicit;c("multiple",!0)("formControlName",e.id)("items",e.values)("placeholder","Pilih "+(e==null?null:e.name))}}function ai(t,s){if(t&1&&d(0,"ng-select",7),t&2){let e=a().$implicit;c("formControlName",e.id)("items",e.values)("placeholder","Pilih "+(e==null?null:e.name))}}function li(t,s){if(t&1&&d(0,"input",8),t&2){let e=a().$implicit;c("formControlName",e.id)("placeholder",e==null?null:e.name)}}function ci(t,s){if(t&1&&(p(0,"small",5),f(1),r()),t&2){let e=a().$implicit;m(),Z(" ",e==null?null:e.name," is mandatory ")}}function pi(t,s){if(t&1&&(p(0,"div",3)(1,"div",4),_(2,oi,2,0,"span",5),p(3,"span"),f(4),r()(),_(5,ri,1,4,"ng-select",6)(6,ai,1,3,"ng-select",7)(7,li,1,2,"input",8)(8,ci,2,1,"small",5),r()),t&2){let e=s.$implicit;m(2),k(e.is_required?2:-1),m(2),Z(" ",e==null?null:e.name," "),m(),k(e.is_multiple_selection?5:e.values!==null&&e.values.length>0?6:7),m(3),k(e.is_required?8:-1)}}function si(t,s){if(t&1&&(w(0),p(1,"form",1)(2,"div",2),B(3,pi,9,4,"div",3,L),r()(),O()),t&2){let e=s.ngIf,i=a();m(),c("formGroup",i.form),m(2),R(e)}}var Pt=(()=>{class t{constructor(){this.tiktokAttributeFormService=u(Pe),this.attributesChanges=new P}ngOnChanges(){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(this.channelId,this.categoryId).pipe(V(e=>e.filter(i=>!(i.type=="PRODUCT_PROPERTY"&&(h.IsEmpty(i.values)||i.values?.length==0)&&i.is_customizable==!1))),U(e=>{this.form=this.tiktokAttributeFormService.createFormGroup(e),this.listenToFormChange(e)}),ee(1)))}listenToFormChange(e){let i=[];this.formSubscription=this.form.valueChanges.subscribe(o=>{i=this.tiktokAttributeFormService.getFilteredAttributes(e,o),this.attributesChanges.emit(i)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["tiktok-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[S([Pe]),N],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"],["type","text",1,"form-control",3,"formControlName","placeholder"]],template:function(i,o){i&1&&(_(0,si,5,1,"ng-container",0),T(1,"async")),i&2&&c("ngIf",I(1,1,o.attributes$))},dependencies:[x,F,A,j,Y,G,X,ie,$,W,J,z,ne],encapsulation:2})}}return t})();var we=(()=>{class t{constructor(){this.woocommerceUploadService=u(ye)}getAttributes(e,i){return this.woocommerceUploadService.getAttributes(e,i).pipe(V(o=>o.map(n=>({key:n.name,label:n.name}))))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=D({token:t,factory:t.\u0275fac})}}return t})();var wt=(()=>{class t{constructor(){this.wooAttributeFormService=u(we),this.channelId=ke(),this.categoryId=ke(),this.attributesChanges=new P}ngOnChanges(){h.IsNotEmpty(this.categoryId())&&h.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(e){this.attributesChanges.emit([e.key])}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},features:[S([we]),N],decls:6,vars:3,consts:[[1,"row"],[1,"col-6"],[1,"mb-1"],["bindLabel","label","bindValue","id","placeholder","Pilih Atribut",3,"change","items"]],template:function(i,o){i&1&&(p(0,"div",0)(1,"div",1)(2,"div",2),f(3,"Atribut"),r(),p(4,"ng-select",3),T(5,"async"),y("change",function(l){return o.onSelectAttribute(l)}),r()()()),i&2&&(m(4),c("items",I(5,1,o.attributes$)))},dependencies:[x,A,ne,j,Y,G],encapsulation:2})}}return t})();var Oe=(()=>{class t{constructor(){this.httpService=u(oe),this.formBuilder=u(Q)}getAttributes(e,i){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:e},{key:"CategoryID",value:i}]).pipe(V(n=>n))}createFormGroup(e){let i=this.formBuilder.group({});return e.forEach(o=>{i.addControl(o.variant,this.formBuilder.control(null))}),i}convertAttributes(e={}){return Object.values(e).filter(o=>o!==null).map(o=>JSON.stringify(o))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=D({token:t,factory:t.\u0275fac})}}return t})();function mi(t,s){if(t&1&&(p(0,"div",3)(1,"div",4),f(2),r(),d(3,"ng-select",5),r()),t&2){let e=s.$implicit;m(2),Z(" ",e==null?null:e.variant," "),m(),c("formControlName",e.variant)("items",e.values)("placeholder","Pilih "+(e==null?null:e.variant))}}function di(t,s){if(t&1&&(w(0),p(1,"form",1)(2,"div",2),B(3,mi,4,4,"div",3,L),r()(),O()),t&2){let e=s.ngIf,i=a();m(),c("formGroup",i.form),m(2),R(e)}}var Ot=(()=>{class t{constructor(){this.tokpedAttrFormService=u(Oe),this.attributesChanges=new P}ngOnInit(){}ngOnChanges(e){h.IsNotEmpty(this.categoryId)&&h.IsNotEmpty(this.channelId)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(this.channelId,this.categoryId).pipe(U(i=>{this.form=this.tokpedAttrFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){let e=[];this.formSubscription=this.form.valueChanges.subscribe(i=>{e=this.tokpedAttrFormService.convertAttributes(i),this.attributesChanges.emit(e)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},features:[S([Oe]),N],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(i,o){i&1&&(_(0,di,5,1,"ng-container",0),T(1,"async")),i&2&&c("ngIf",I(1,1,o.attributes$))},dependencies:[x,F,A,j,Y,G,X,$,W,J,z],encapsulation:2})}}return t})();var Ve=(()=>{class t{constructor(){this.httpService=u(oe),this.formBuilder=u(Q)}getAttributes(e){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:e}]).pipe(U(o=>(o.Options.StatusOptions=o.Options.Status.map(n=>({id:n,name:n})),o)))}createFormGroup(e){let i=this.formBuilder.group({});return Object.keys(e.Attribute).forEach(n=>{i.addControl(n,this.formBuilder.control(null))}),i}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=D({token:t,factory:t.\u0275fac})}}return t})();function ui(t,s){if(t&1&&(w(0),p(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4),f(5," Brand "),r(),d(6,"input",5),r(),p(7,"div",6)(8,"div",4),f(9," Product Type "),r(),d(10,"input",7),r(),p(11,"div",6)(12,"div",4),f(13," Status "),r(),d(14,"ng-select",8),r()()(),O()),t&2){let e=s.ngIf,i=a();m(),c("formGroup",i.form),m(13),c("items",e.Options.StatusOptions)}}var Vt=(()=>{class t{constructor(){this.attributesChanges=new P,this.shopifyFormService=u(Ve)}ngOnChanges(e){e.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId).pipe(U(i=>{this.form=this.shopifyFormService.createFormGroup(i),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(Re(500)).subscribe(e=>{this.attributesChanges.emit([e])})}ngOnDestroy(){this.formSubscription.unsubscribe()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["shopify-attribute-form"]],inputs:{channelId:"channelId"},outputs:{attributesChanges:"attributesChanges"},features:[S([Ve]),N],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","Brand","type","text","placeholder","brand",1,"form-control"],[1,"col-6"],["formControlName","ProductType","type","text","placeholder","Product Type",1,"form-control"],["formControlName","Status","bindLabel","name","bindValue","id","placeholder","Status",3,"items"]],template:function(i,o){i&1&&(_(0,ui,15,2,"ng-container",0),T(1,"async")),i&2&&c("ngIf",I(1,1,o.attributes$))},dependencies:[x,F,A,G,X,ie,$,W,J,z,j,Y],encapsulation:2})}}return t})();function _i(t,s){if(t&1&&(p(0,"div",6),d(1,"app-product-card",9),r()),t&2){let e=s.$implicit;m(),c("productId",e==null?null:e.ID)("title",e==null?null:e.Name)("image",e==null?null:e.ThumbnailUrl)("description",(e==null||e.Variants==null?null:e.Variants.length)>1?(e==null||e.Variants==null?null:e.Variants.length)+" Variants":null)("imageForZoom",e==null?null:e.ImageUrl)("code",e==null||e.Variants[0]==null?null:e.Variants[0].Code)("showFooter",!1)}}function fi(t,s){if(t&1){let e=E();w(0),p(1,"mat-checkbox",21),We("ngModelChange",function(o){C(e);let n=a().$implicit;return He(n.selected,o)||(n.selected=o),b(o)}),y("ngModelChange",function(){let o=C(e).ngIf,n=a(),l=n.$implicit,g=n.$index,ce=a();return b(ce.onSelectChannel(l,g,o))}),r(),O()}if(t&2){let e=a().$implicit;m(),je("ngModel",e.selected)}}function hi(t,s){if(t&1&&(p(0,"div",18),d(1,"input",22),r()),t&2){let e=a().$implicit,i=a();c("matTooltip",e.type==i.channelType.Shopify?"Cannot change category, please change category in admin.shopify.com":e.type==i.channelType.Plugo?"You can change the category after the product has been uploaded to the Plugo Dashboard.":"")}}function gi(t,s){if(t&1){let e=E();p(0,"app-channel-category-select",23),y("selectedCategory",function(o){C(e);let n=a().$index,l=a();return b(l.onCategoryChange(n,o))}),r()}if(t&2){let e=a().$implicit,i=a();c("disabled",!e.selected||e.selected&&e.type==i.channelType.Lazada)("channelId",e.id)("channelType",e.type)("categoryId",e.categoryId)}}function Ci(t,s){if(t&1){let e=E();p(0,"shopee-attribute-form",27),y("attributesChanges",function(o){C(e);let n=a(2).$index,l=a();return b(l.onAttributesChange(n,o))}),r()}if(t&2){let e=a(2).$implicit;c("categoryId",e.categoryId)("channelId",e.id)("channelType",e.type)}}function bi(t,s){if(t&1){let e=E();p(0,"tiktok-attribute-form",28),y("attributesChanges",function(o){C(e);let n=a(2).$index,l=a();return b(l.onAttributesChange(n,o))}),r()}if(t&2){let e=a(2).$implicit;c("categoryId",e.categoryId)("channelId",e.id)}}function yi(t,s){if(t&1){let e=E();p(0,"wooocommerce-attribute-form",28),y("attributesChanges",function(o){C(e);let n=a(2).$index,l=a();return b(l.onAttributesChange(n,o))}),r()}if(t&2){let e=a(2).$implicit;c("categoryId",e.categoryId)("channelId",e.id)}}function vi(t,s){if(t&1){let e=E();p(0,"tokopedia-attribute-form",28),y("attributesChanges",function(o){C(e);let n=a(2).$index,l=a();return b(l.onAttributesChange(n,o))}),r()}if(t&2){let e=a(2).$implicit;c("categoryId",e.categoryId)("channelId",e.id)}}function xi(t,s){if(t&1&&(p(0,"div",20)(1,"div",24),_(2,Ci,1,3,"shopee-attribute-form",25)(3,bi,1,2,"tiktok-attribute-form",26)(4,yi,1,2,"wooocommerce-attribute-form",26)(5,vi,1,2,"tokopedia-attribute-form",26),r()()),t&2){let e,i=a().$implicit,o=a();m(2),k((e=i.type)===o.channelType.Shopee?2:e===o.channelType.Tiktok?3:e===o.channelType.WooCommerce?4:e===o.channelType.Tokopedia?5:-1)}}function Ti(t,s){if(t&1){let e=E();p(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",29),y("attributesChanges",function(o){C(e);let n=a().$index,l=a();return b(l.onAttributesChange(n,o))}),r()()()}if(t&2){let e=a().$implicit;m(2),c("channelId",e.id)}}function Ii(t,s){if(t&1&&(p(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),_(6,fi,2,1,"ng-container",14),T(7,"async"),r(),p(8,"div"),d(9,"app-channel-logo",15),r(),p(10,"div",16)(11,"span"),f(12),r()()()(),p(13,"div",12)(14,"div",17),_(15,hi,2,1,"div",18)(16,gi,1,4,"app-channel-category-select",19),r()()(),_(17,xi,6,1,"div",20)(18,Ti,3,1,"div",20),r()()),t&2){let e=s.$implicit,i=a();m(6),c("ngIf",I(7,8,i.defaultCategories$)),m(3),c("typeId",e.type)("showChannelName",!1),m(),c("matTooltip",e.name)("matTooltipShowDelay",2500),m(2),te(e.name),m(3),k(e.type==i.channelType.Shopify||e.type==i.channelType.Plugo?15:16),m(2),k(e.categoryId&&i.channelType.Lazada!=e.type&&e.selected?17:i.channelType.Shopify==e.type&&e.selected?18:-1)}}var br=(()=>{class t{constructor(){this.uploadProductService=u(ve),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=et,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(ee(1))}onCategoryChange(e,i){this.channelProductUploads.update(o=>o.map((n,l)=>(l==e&&(n.categoryId=i,n.attributes=[]),n)))}onAttributesChange(e,i){this.channelProductUploads.update(o=>o.map((n,l)=>(l==e&&(n.attributes=i),n)))}onSelectChannel(e,i,o){this.channelProductUploads.update(n=>n.map((l,g)=>{if(g==i&&e.selected){let ce=this.findCategoryByChannelId(e.id,o);l.categoryId=ce?.DefaultCategoryID}return g==i&&!e.selected&&(l.categoryId=null),l}))}findCategoryByChannelId(e,i){return i.find(o=>o.ID===e)}onUploadProduct(){this.uploadProductService.onUploadProduct(this.channelProductUploads())}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=v({type:t,selectors:[["app-product-upload"]],features:[S([be,ut,_t,ye])],decls:17,vars:5,consts:[["headerTitle","Upload Product To Channel",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-upload"],[1,"container-fluid","mt-6"],[1,"ps-3","mt-8","pb-5","fw-medium"],[1,"row","mb-10","ps-3"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"ps-3","mb-8","border-bottom","pb-5","fw-medium"],[1,"row","mb-6"],[3,"productId","title","image","description","imageForZoom","code","showFooter"],[1,"col-12"],[1,"row"],[1,"col-3"],[1,"d-flex","align-items-center"],[4,"ngIf"],[3,"typeId","showChannelName"],[2,"overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"matTooltip","matTooltipShowDelay"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip"],[3,"disabled","channelId","channelType","categoryId"],[1,"row","my-3"],["color","primary",1,"example-margin",3,"ngModelChange","ngModel"],["disabled","","type","text","placeholder","Category Unavailable",1,"form-control","rounded-1",2,"height","35px"],[3,"selectedCategory","disabled","channelId","channelType","categoryId"],[1,"col-12","ps-11"],[3,"categoryId","channelId","channelType"],[3,"categoryId","channelId"],[3,"attributesChanges","categoryId","channelId","channelType"],[3,"attributesChanges","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(i,o){if(i&1&&(p(0,"mainpanel",0)(1,"actions")(2,"button",1),y("click",function(){return o.onUploadProduct()}),d(3,"i",2),f(4," Upload "),r()(),p(5,"content")(6,"div",3)(7,"h3",4),f(8,"Product To Upload"),r(),p(9,"div",5),B(10,_i,2,7,"div",6,L),T(12,"async"),r(),p(13,"h3",7),f(14,"Channel To Upload"),r(),B(15,Ii,19,10,"div",8,L),r()()()),i&2){let n;c("hideSearchBox",!0)("hideSearchDropdown",!0),m(2),c("disabled",((n=o.channelProductUploads())==null?null:n.length)==0),m(8),R(I(12,3,o.selectedProducts$)),m(5),R(o.channelProductUploads())}},dependencies:[x,F,A,xt,ot,nt,It,Tt,at,rt,ne,$,ze,it,tt,Pt,wt,Ot,Vt,ft,Ft,Nt],encapsulation:2})}}return t})();export{br as ProductUploadComponent};
@@ -1 +1 @@
1
- import{a as r}from"./chunk-GRIUDEPO.js";import{e as p}from"./chunk-JXSBFTQM.js";import{ja as o,pa as i}from"./chunk-B7KTCPKC.js";var G=(()=>{class e{constructor(){this.httpService=i(p)}getGroupsLoader(){return this.httpService.get(r.GetGroupsLoader)}getGroups(t){return this.httpService.post(r.GetGroups,t)}getGroupsForm(t){return this.httpService.post(r.GetGroupFormLoader,{ID:t})}submitGroup(t){return this.httpService.post(r.SubmitGroup,t)}deleteGroups(t){return this.httpService.post(r.DeleteGroups,{ListID:t})}static{this.\u0275fac=function(s){return new(s||e)}}static{this.\u0275prov=o({token:e,factory:e.\u0275fac})}}return e})();export{G as a};
1
+ import{a as r}from"./chunk-OWQ3RWNF.js";import{e as p}from"./chunk-JXSBFTQM.js";import{ja as o,pa as i}from"./chunk-B7KTCPKC.js";var G=(()=>{class e{constructor(){this.httpService=i(p)}getGroupsLoader(){return this.httpService.get(r.GetGroupsLoader)}getGroups(t){return this.httpService.post(r.GetGroups,t)}getGroupsForm(t){return this.httpService.post(r.GetGroupFormLoader,{ID:t})}submitGroup(t){return this.httpService.post(r.SubmitGroup,t)}deleteGroups(t){return this.httpService.post(r.DeleteGroups,{ListID:t})}static{this.\u0275fac=function(s){return new(s||e)}}static{this.\u0275prov=o({token:e,factory:e.\u0275fac})}}return e})();export{G as a};
@@ -1 +1 @@
1
- import{a as m,b as l}from"./chunk-IMK2JGZA.js";import"./chunk-SWQXSJ7O.js";import"./chunk-IHNN4Q2N.js";import"./chunk-EQIFZBRG.js";import{F as i,J as u}from"./chunk-M2FCTYGU.js";import{Gb as r,Yb as p,ic as s,jc as a,kc as o,rb as n}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var c=(()=>{class t{constructor(){this.tabs=[{Title:"Users",Url:"/menu/users/users",Description:""},{Title:"Groups",Url:"/menu/users/groups",Description:""},{Title:"Setup",Url:"/menu/users/setup",Description:""}]}static{this.\u0275fac=function(e){return new(e||t)}}static{this.\u0275cmp=r({type:t,selectors:[["app-user-menu"]],decls:5,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs","usePermissions"]],template:function(e,f){e&1&&(s(0,"nav",0)(1,"div",1)(2,"div"),o(3,"nav-tab",2),a()()(),o(4,"router-outlet")),e&2&&(n(3),p("Tabs",f.tabs)("usePermissions",!0))},dependencies:[l,m,u,i],encapsulation:2})}}return t})(),T=[{path:"",component:c,children:[{path:"users",loadComponent(){return import("./chunk-JIOSKHGT.js").then(t=>t.UsersComponent)},data:{title:"Users"}},{path:"users/form",loadComponent(){return import("./chunk-KGMQTWMX.js").then(t=>t.UserFormComponent)},data:{title:"Users Form"}},{path:"users/info",loadComponent(){return import("./chunk-NDSJ4AAU.js").then(t=>t.UserInfoComponent)},data:{title:"Users Info"}},{path:"groups",loadComponent(){return import("./chunk-PVPN53WE.js").then(t=>t.GroupsComponent)},data:{title:"Groups"}},{path:"setup",loadComponent(){return import("./chunk-LFAU6HXM.js").then(t=>t.SetupInfoComponent)},data:{title:"Setup Info"}},{path:"setup/form",loadComponent(){return import("./chunk-MRODDSR7.js").then(t=>t.SetupFormComponent)},data:{title:"Setup Form"}},{path:"groups/form",loadComponent(){return import("./chunk-W7H6T326.js").then(t=>t.GroupsFormComponent)},data:{title:"Groups Form"}},{path:"groups/info",loadComponent(){return import("./chunk-22AHRDNQ.js").then(t=>t.GroupInfoComponent)},data:{title:"Groups Info"}},{path:"**",redirectTo:"users",pathMatch:"full"},{path:"",pathMatch:"full",redirectTo:"users"}]}];export{c as UserMenuComponent,T as userRoutes};
1
+ import{a as m,b as l}from"./chunk-IMK2JGZA.js";import"./chunk-SWQXSJ7O.js";import"./chunk-IHNN4Q2N.js";import"./chunk-EQIFZBRG.js";import{F as i,J as u}from"./chunk-M2FCTYGU.js";import{Gb as r,Yb as p,ic as s,jc as a,kc as o,rb as n}from"./chunk-B7KTCPKC.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var c=(()=>{class t{constructor(){this.tabs=[{Title:"Users",Url:"/menu/users/users",Description:""},{Title:"Groups",Url:"/menu/users/groups",Description:""},{Title:"Setup",Url:"/menu/users/setup",Description:""}]}static{this.\u0275fac=function(e){return new(e||t)}}static{this.\u0275cmp=r({type:t,selectors:[["app-user-menu"]],decls:5,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs","usePermissions"]],template:function(e,f){e&1&&(s(0,"nav",0)(1,"div",1)(2,"div"),o(3,"nav-tab",2),a()()(),o(4,"router-outlet")),e&2&&(n(3),p("Tabs",f.tabs)("usePermissions",!0))},dependencies:[l,m,u,i],encapsulation:2})}}return t})(),T=[{path:"",component:c,children:[{path:"users",loadComponent(){return import("./chunk-DXEJKRNB.js").then(t=>t.UsersComponent)},data:{title:"Users"}},{path:"users/form",loadComponent(){return import("./chunk-NAT7HRBS.js").then(t=>t.UserFormComponent)},data:{title:"Users Form"}},{path:"users/info",loadComponent(){return import("./chunk-UTCTTFIM.js").then(t=>t.UserInfoComponent)},data:{title:"Users Info"}},{path:"groups",loadComponent(){return import("./chunk-EYBZQLBT.js").then(t=>t.GroupsComponent)},data:{title:"Groups"}},{path:"setup",loadComponent(){return import("./chunk-GGSB6FC2.js").then(t=>t.SetupInfoComponent)},data:{title:"Setup Info"}},{path:"setup/form",loadComponent(){return import("./chunk-4GW36MPQ.js").then(t=>t.SetupFormComponent)},data:{title:"Setup Form"}},{path:"groups/form",loadComponent(){return import("./chunk-UWAXFTHD.js").then(t=>t.GroupsFormComponent)},data:{title:"Groups Form"}},{path:"groups/info",loadComponent(){return import("./chunk-KCH7AGAT.js").then(t=>t.GroupInfoComponent)},data:{title:"Groups Info"}},{path:"**",redirectTo:"users",pathMatch:"full"},{path:"",pathMatch:"full",redirectTo:"users"}]}];export{c as UserMenuComponent,T as userRoutes};
@@ -1 +1 @@
1
- import{h as k}from"./chunk-WY4BY2ID.js";import{a as A,b as F,d as U,e as W}from"./chunk-5JVEEL2T.js";import{A as L,a as D,h as V,m as I}from"./chunk-6QYD6NIJ.js";import{n as E}from"./chunk-M2FCTYGU.js";import{Gb as M,Gc as p,Ic as f,Kc as O,Lc as T,Mb as u,Mc as N,Oa as d,Qc as w,Yb as s,dc as y,ic as a,jc as o,kc as h,oc as x,pa as S,pb as g,rb as r,tc as C,uc as _,ya as v,za as b}from"./chunk-B7KTCPKC.js";function z(t,m){if(t&1&&(a(0,"span",3),h(1,"img",4),o(),a(2,"span"),p(3),o()),t&2){let e=m.item;r(),s("src",e==null?null:e.Img,g),r(2),f(" ",e.Name," ")}}function P(t,m){if(t&1){let e=x();a(0,"span",6),C("click",function(){v(e);let n=_(),c=n.item,l=n.clear;return b(l(c))}),p(1,"x"),o()}}function j(t,m){if(t&1&&(a(0,"span",3),h(1,"img",4),o(),a(2,"span"),p(3),o(),u(4,P,2,0,"span",5)),t&2){let e=m.item,i=_();r(),s("src",e==null?null:e.Img,g),r(2),f(" ",e.Name," "),r(),y(i.clearable()?4:-1)}}var Y=(()=>{class t{constructor(){this.authService=S(k),this.multiple=d(!1),this.clearable=d(!0),this.options=this.authService.getChannels(),this.onChange=e=>{}}onChannelChange(e){this.onChange(e)}writeValue(e){this.selectedChannels=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=M({type:t,selectors:[["channel-select-options"]],inputs:{multiple:[1,"multiple"],clearable:[1,"clearable"]},features:[w([{provide:D,multi:!0,useExisting:t}])],decls:3,vars:4,consts:[["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel","multiple"],["ng-option-tmp",""],["ng-label-tmp",""],[1,"me-2"],[2,"width","18px",3,"src"],["aria-hidden","true",1,"ng-value-icon","right"],["aria-hidden","true",1,"ng-value-icon","right",3,"click"]],template:function(i,n){i&1&&(a(0,"ng-select",0),N("ngModelChange",function(l){return T(n.selectedChannels,l)||(n.selectedChannels=l),l}),C("ngModelChange",function(l){return n.onChannelChange(l)}),u(1,z,4,2,"ng-template",1)(2,j,5,3,"ng-template",2),o()),i&2&&(s("clearable",n.clearable())("items",n.options),O("ngModel",n.selectedChannels),s("multiple",n.multiple()))},dependencies:[E,W,U,A,F,L,V,I],encapsulation:2})}}return t})();export{Y as a};
1
+ import{h as k}from"./chunk-ZKZ5DIIR.js";import{a as A,b as F,d as U,e as W}from"./chunk-5JVEEL2T.js";import{A as L,a as D,h as V,m as I}from"./chunk-6QYD6NIJ.js";import{n as E}from"./chunk-M2FCTYGU.js";import{Gb as M,Gc as p,Ic as f,Kc as O,Lc as T,Mb as u,Mc as N,Oa as d,Qc as w,Yb as s,dc as y,ic as a,jc as o,kc as h,oc as x,pa as S,pb as g,rb as r,tc as C,uc as _,ya as v,za as b}from"./chunk-B7KTCPKC.js";function z(t,m){if(t&1&&(a(0,"span",3),h(1,"img",4),o(),a(2,"span"),p(3),o()),t&2){let e=m.item;r(),s("src",e==null?null:e.Img,g),r(2),f(" ",e.Name," ")}}function P(t,m){if(t&1){let e=x();a(0,"span",6),C("click",function(){v(e);let n=_(),c=n.item,l=n.clear;return b(l(c))}),p(1,"x"),o()}}function j(t,m){if(t&1&&(a(0,"span",3),h(1,"img",4),o(),a(2,"span"),p(3),o(),u(4,P,2,0,"span",5)),t&2){let e=m.item,i=_();r(),s("src",e==null?null:e.Img,g),r(2),f(" ",e.Name," "),r(),y(i.clearable()?4:-1)}}var Y=(()=>{class t{constructor(){this.authService=S(k),this.multiple=d(!1),this.clearable=d(!0),this.options=this.authService.getChannels(),this.onChange=e=>{}}onChannelChange(e){this.onChange(e)}writeValue(e){this.selectedChannels=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=M({type:t,selectors:[["channel-select-options"]],inputs:{multiple:[1,"multiple"],clearable:[1,"clearable"]},features:[w([{provide:D,multi:!0,useExisting:t}])],decls:3,vars:4,consts:[["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel","multiple"],["ng-option-tmp",""],["ng-label-tmp",""],[1,"me-2"],[2,"width","18px",3,"src"],["aria-hidden","true",1,"ng-value-icon","right"],["aria-hidden","true",1,"ng-value-icon","right",3,"click"]],template:function(i,n){i&1&&(a(0,"ng-select",0),N("ngModelChange",function(l){return T(n.selectedChannels,l)||(n.selectedChannels=l),l}),C("ngModelChange",function(l){return n.onChannelChange(l)}),u(1,z,4,2,"ng-template",1)(2,j,5,3,"ng-template",2),o()),i&2&&(s("clearable",n.clearable())("items",n.options),O("ngModel",n.selectedChannels),s("multiple",n.multiple()))},dependencies:[E,W,U,A,F,L,V,I],encapsulation:2})}}return t})();export{Y as a};