marketplacepos 5.46.6 → 5.46.7

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 (94) hide show
  1. package/Marketplace/3rdpartylicenses.txt +52 -52
  2. package/Marketplace/chunk-25345PS7.js +257 -0
  3. package/Marketplace/chunk-2UIK6NRS.js +1 -0
  4. package/Marketplace/chunk-37MIOA6D.js +1 -0
  5. package/Marketplace/chunk-3DCFDJVG.js +1 -0
  6. package/Marketplace/chunk-3X5SEOLP.js +1 -0
  7. package/Marketplace/chunk-4RTDKHTN.js +1 -0
  8. package/Marketplace/chunk-4VJ3SIJF.js +1 -0
  9. package/Marketplace/{chunk-PTNJ3YC5.js → chunk-5G3N7OU5.js} +1 -1
  10. package/Marketplace/{chunk-AWNZSJSP.js → chunk-5KNFEBH5.js} +1 -1
  11. package/Marketplace/{chunk-USBIAIK6.js → chunk-5QO5B7YG.js} +1 -1
  12. package/Marketplace/{chunk-4HOZLG47.js → chunk-6NRH3MJL.js} +1 -1
  13. package/Marketplace/chunk-6QFP63YQ.js +1 -0
  14. package/Marketplace/{chunk-P2IQLBGG.js → chunk-7KN3UVZI.js} +1 -1
  15. package/Marketplace/chunk-7L3UKJDU.js +1 -0
  16. package/Marketplace/{chunk-TI67Q3JR.js → chunk-AGURPBGY.js} +1 -1
  17. package/Marketplace/chunk-BDBETNFT.js +137 -0
  18. package/Marketplace/{chunk-YEDXFYTD.js → chunk-BTO76EDH.js} +1 -1
  19. package/Marketplace/{chunk-ZYQD6SBV.js → chunk-BVDLO6WD.js} +1 -1
  20. package/Marketplace/{chunk-5KUKIH4H.js → chunk-CMBQCMTZ.js} +1 -1
  21. package/Marketplace/{chunk-GSVFDIM6.js → chunk-CWNZ6HAV.js} +1 -1
  22. package/Marketplace/chunk-CYG42H2K.js +1 -0
  23. package/Marketplace/{chunk-FHNST4Y7.js → chunk-DNNH5AQJ.js} +1 -1
  24. package/Marketplace/{chunk-3PPLPXAX.js → chunk-DPAQQ77L.js} +1 -1
  25. package/Marketplace/{chunk-JZDOMET2.js → chunk-EAA6S4WB.js} +1 -1
  26. package/Marketplace/chunk-F2T43CJB.js +51 -0
  27. package/Marketplace/{chunk-MZWTCBAF.js → chunk-F4Z47C2S.js} +8 -8
  28. package/Marketplace/chunk-FJYAC47U.js +2 -0
  29. package/Marketplace/{chunk-22ARBR7W.js → chunk-GJTQNOXV.js} +1 -1
  30. package/Marketplace/chunk-GUO3DTDP.js +1 -0
  31. package/Marketplace/{chunk-X4B2FYY3.js → chunk-HBVCUV6A.js} +1 -1
  32. package/Marketplace/{chunk-OGJMVAEL.js → chunk-HZKRKNLA.js} +1 -1
  33. package/Marketplace/chunk-IQ3ER4NM.js +1 -0
  34. package/Marketplace/{chunk-FOT5AJYX.js → chunk-JP6HRQLK.js} +2 -2
  35. package/Marketplace/chunk-JZC463X6.js +1 -0
  36. package/Marketplace/chunk-K4NTJPH5.js +1 -0
  37. package/Marketplace/{chunk-LS7AO6KP.js → chunk-KXU32D3B.js} +1 -1
  38. package/Marketplace/{chunk-NDBC2CS6.js → chunk-LBDA5KP3.js} +1 -1
  39. package/Marketplace/chunk-LETC4UBH.js +1 -0
  40. package/Marketplace/chunk-LVZDOEKQ.js +1 -0
  41. package/Marketplace/{chunk-MGLOTL2T.js → chunk-LW3PTNRL.js} +1 -1
  42. package/Marketplace/chunk-LYCCI55Z.js +1 -0
  43. package/Marketplace/{chunk-Y4XF2TXJ.js → chunk-MAQ6FWVP.js} +1 -1
  44. package/Marketplace/{chunk-FGRPTNDB.js → chunk-MFMD6ZSP.js} +1 -1
  45. package/Marketplace/chunk-MYPTLVUU.js +1 -0
  46. package/Marketplace/{chunk-7Y7SPMGZ.js → chunk-NAGQF4JJ.js} +1 -1
  47. package/Marketplace/chunk-NCLAP5OW.js +1 -0
  48. package/Marketplace/{chunk-2DLU2LJJ.js → chunk-NTGU2UMX.js} +1 -1
  49. package/Marketplace/chunk-NX4WQMFK.js +1 -0
  50. package/Marketplace/chunk-O3ADJ3YS.js +1 -0
  51. package/Marketplace/{chunk-GZS2MOSK.js → chunk-OMPJUICC.js} +1 -1
  52. package/Marketplace/{chunk-EXSI44LD.js → chunk-OR6TBLPO.js} +2 -2
  53. package/Marketplace/{chunk-V3ZRQKJA.js → chunk-QPLUVWFA.js} +1 -1
  54. package/Marketplace/chunk-R5KKW4LC.js +1 -0
  55. package/Marketplace/{chunk-TWOIWWMO.js → chunk-SCHKXMJN.js} +1 -1
  56. package/Marketplace/chunk-TLEH7QMI.js +1 -0
  57. package/Marketplace/chunk-TUHKMG57.js +1 -0
  58. package/Marketplace/chunk-U7WCPDIV.js +1 -0
  59. package/Marketplace/{chunk-LLHPMXKP.js → chunk-UQWB6RQP.js} +1 -1
  60. package/Marketplace/{chunk-2BV7ZXRB.js → chunk-VLF5RZ3X.js} +1 -1
  61. package/Marketplace/{chunk-7WY57PVD.js → chunk-VRPKQ2HJ.js} +1 -1
  62. package/Marketplace/{chunk-CT73GC7O.js → chunk-WUKVYBD3.js} +1 -1
  63. package/Marketplace/{chunk-PGP3WHIS.js → chunk-YHT4EYQJ.js} +1 -1
  64. package/Marketplace/{chunk-P2AADVEN.js → chunk-ZHPHANAW.js} +1 -1
  65. package/Marketplace/index.html +2 -2
  66. package/Marketplace/{main-YKZPM7WW.js → main-HRVNLZTX.js} +1 -1
  67. package/package.json +1 -1
  68. package/Marketplace/chunk-4YRBARG2.js +0 -1
  69. package/Marketplace/chunk-5BHSTOJT.js +0 -1
  70. package/Marketplace/chunk-5DTUHJSS.js +0 -1
  71. package/Marketplace/chunk-5Z5Y537T.js +0 -1
  72. package/Marketplace/chunk-B2ZWLW3F.js +0 -1
  73. package/Marketplace/chunk-CBQUB3KW.js +0 -1
  74. package/Marketplace/chunk-CRD4OUSG.js +0 -1
  75. package/Marketplace/chunk-D2TELRO7.js +0 -1
  76. package/Marketplace/chunk-EFB55SZR.js +0 -1
  77. package/Marketplace/chunk-ELZBUFG5.js +0 -1
  78. package/Marketplace/chunk-EPBVNII2.js +0 -51
  79. package/Marketplace/chunk-F3GLNINI.js +0 -1
  80. package/Marketplace/chunk-FKQ7ZVGD.js +0 -1
  81. package/Marketplace/chunk-JUJFPAAU.js +0 -1
  82. package/Marketplace/chunk-LXXEN7OV.js +0 -1
  83. package/Marketplace/chunk-OO2CSDGF.js +0 -1
  84. package/Marketplace/chunk-QREUIGWW.js +0 -1
  85. package/Marketplace/chunk-RGAKHXPF.js +0 -1
  86. package/Marketplace/chunk-SLEJQAL7.js +0 -1
  87. package/Marketplace/chunk-TMKLT3K2.js +0 -1
  88. package/Marketplace/chunk-URGPZLCB.js +0 -1
  89. package/Marketplace/chunk-UYFUJBC4.js +0 -2
  90. package/Marketplace/chunk-UZWED4UK.js +0 -137
  91. package/Marketplace/chunk-WGCIF2R4.js +0 -257
  92. package/Marketplace/chunk-X52QA4QU.js +0 -1
  93. package/Marketplace/chunk-XLWWNO5M.js +0 -1
  94. package/Marketplace/chunk-YF4XELSP.js +0 -1
@@ -0,0 +1,257 @@
1
+ import{a as ti}from"./chunk-NFGFM7TW.js";import{a as En}from"./chunk-O3ADJ3YS.js";import{a as xe,b as zt}from"./chunk-GUO3DTDP.js";import{a as ye}from"./chunk-2UIK6NRS.js";import{b as Xn}from"./chunk-GRYGUILI.js";import{a as nt}from"./chunk-KTB223SK.js";import{a as zn}from"./chunk-YERZ6W22.js";import{e as Nt}from"./chunk-5QO5B7YG.js";import"./chunk-7TI3OR34.js";import{d as jn,k as Zn,l as Jn,m as Qn,n as Yn,o as qn}from"./chunk-KS7ACI26.js";import{a as be}from"./chunk-RGY4FVTG.js";import{a as X}from"./chunk-7KN3UVZI.js";import"./chunk-PE5AFID4.js";import{b as ei}from"./chunk-ABYG6YZT.js";import{a as Hn,b as Gn}from"./chunk-RAQRGWCZ.js";import{a as Ce,b as Se,c as Ln}from"./chunk-KSHWHTCH.js";import"./chunk-HVCIQI7B.js";import{a as q}from"./chunk-LBDA5KP3.js";import{a as _t}from"./chunk-YU2SDRUC.js";import{c as Un,f as Bn}from"./chunk-3GDM5JNY.js";import"./chunk-XXT6F2ZS.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import"./chunk-YTCIQBSO.js";import"./chunk-RHHHL4OR.js";import{a as et}from"./chunk-HBVCUV6A.js";import"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import{a as fe}from"./chunk-HIC5QC3Y.js";import{f as $n}from"./chunk-JBT7GBCM.js";import{a as B}from"./chunk-UMP6ZMEJ.js";import{a as wn,b as In}from"./chunk-WRJFUNM3.js";import"./chunk-JVNHFIYT.js";import{a as Kn}from"./chunk-63ANFYRV.js";import{a as kn}from"./chunk-5EIQGYTB.js";import{a as ht}from"./chunk-7KG3DC5J.js";import{a as me}from"./chunk-OMPJUICC.js";import{d as de,e as Sn}from"./chunk-PYXL7UF7.js";import{a as gt}from"./chunk-4RTDKHTN.js";import{a as An,b as Rn,c as Wn}from"./chunk-DPAQQ77L.js";import"./chunk-MFMD6ZSP.js";import"./chunk-OXWPLJEW.js";import{a as lt}from"./chunk-LDL3A7NM.js";import"./chunk-5CKVZBHM.js";import{a as Nn}from"./chunk-F2T43CJB.js";import"./chunk-BKRCW7SH.js";import{a as Fn}from"./chunk-BDBETNFT.js";import"./chunk-T2OSIFLN.js";import{d as Vn}from"./chunk-QW4EOJRM.js";import"./chunk-Q4N2QUV6.js";import{a as ge}from"./chunk-7G6GQTSH.js";import"./chunk-ACIMXBIC.js";import{i as at}from"./chunk-ZHPHANAW.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-YQLOB7IQ.js";import{e as _e}from"./chunk-OZ7LWNOK.js";import{a as We}from"./chunk-YFDFIBAG.js";import{O as Tn,P as Mn,aa as Vt,fa as On,ja as Wt,na as Dn,oa as je}from"./chunk-RC5PUUVM.js";import{a as Cn}from"./chunk-CGOB6Y3X.js";import{b as Y,e as Z}from"./chunk-WN5DZGA4.js";import{c as Ue,d as Be,f as ce,g as mn,i as pe,k as un,m as hn}from"./chunk-4NEKWRL7.js";import{b as T,c as C}from"./chunk-EUYQST7Q.js";import{b as kt,c as Et,d as rt,e as xn,f as yn,g as bn,h as vn,i as ue,j as Ft,k as he,m as tt,n as Pn}from"./chunk-HJXYT6MI.js";import{A as Dt,b as dn,c as Ot,h as G,m as K}from"./chunk-5PS6ZS3N.js";import{a as _n}from"./chunk-V3USB3ZU.js";import{a as gn,b as ot,c as fn}from"./chunk-ERXVXBTU.js";import{r as mt,s as ut}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{E as le,F as cn,G as it,H as se,J as pn,d as yt,f as U,g as A,h as rn,i as ln,j as Tt,k as sn,m as Mt,n as J}from"./chunk-FXQKRJWU.js";import{$b as ne,$c as N,Aa as te,Ac as Le,Bc as It,Ca as St,Cc as Pt,Fc as Q,G as F,Gb as I,Gc as d,Hb as Ve,Hc as V,Ic as v,K as Qe,Ka as pt,Kb as ct,Kc as D,La as tn,Lc as k,Mb as g,Mc as E,Qc as Ut,Ra as z,Rc as xt,Sc as P,Tc as Bt,Vc as ae,X as Ye,Xb as O,Yb as l,Z as Yt,Zb as en,aa as $t,ac as dt,ad as R,bd as on,ca as Lt,cd as H,dc as M,ea as qt,ec as Ne,f as Qt,fa as qe,g as Ee,gc as Ae,hc as Re,ic as o,ja as Xt,jc as r,ka as Fe,kc as _,lc as y,mc as b,nc as $e,oa as Xe,ob as ee,oc as S,od as re,pa as $,pb as L,pd as jt,rb as a,rd as an,tc as f,uc as p,v as Ct,vc as nn,wc as ie,xb as x,ya as m,za as u,zc as oe}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var ni=(()=>{class e{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(i){return new(i||e)}}static{this.\u0275cmp=I({type:e,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(i,n){i&1&&(o(0,"nav",0)(1,"div",1)(2,"div"),_(3,"nav-tab",2),r()()(),_(4,"router-outlet")),i&2&&(a(3),l("Tabs",n.productTabs))},dependencies:[wn,cn],encapsulation:2})}}return e})();var ii=(()=>{class e extends ge{pathId;ngOnInit(){this.pathId="url(#"+Vt()+")"}static \u0275fac=(()=>{let t;return function(n){return(t||(t=St(e)))(n||e)}})();static \u0275cmp=I({type:e,selectors:[["ExclamationTriangleIcon"]],features:[ct],decls:8,vars:7,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M13.4018 13.1893H0.598161C0.49329 13.189 0.390283 13.1615 0.299143 13.1097C0.208003 13.0578 0.131826 12.9832 0.0780112 12.8932C0.0268539 12.8015 0 12.6982 0 12.5931C0 12.4881 0.0268539 12.3848 0.0780112 12.293L6.47985 1.08982C6.53679 1.00399 6.61408 0.933574 6.70484 0.884867C6.7956 0.836159 6.897 0.810669 7 0.810669C7.103 0.810669 7.2044 0.836159 7.29516 0.884867C7.38592 0.933574 7.46321 1.00399 7.52015 1.08982L13.922 12.293C13.9731 12.3848 14 12.4881 14 12.5931C14 12.6982 13.9731 12.8015 13.922 12.8932C13.8682 12.9832 13.792 13.0578 13.7009 13.1097C13.6097 13.1615 13.5067 13.189 13.4018 13.1893ZM1.63046 11.989H12.3695L7 2.59425L1.63046 11.989Z","fill","currentColor"],["d","M6.99996 8.78801C6.84143 8.78594 6.68997 8.72204 6.57787 8.60993C6.46576 8.49782 6.40186 8.34637 6.39979 8.18784V5.38703C6.39979 5.22786 6.46302 5.0752 6.57557 4.96265C6.68813 4.85009 6.84078 4.78686 6.99996 4.78686C7.15914 4.78686 7.31179 4.85009 7.42435 4.96265C7.5369 5.0752 7.60013 5.22786 7.60013 5.38703V8.18784C7.59806 8.34637 7.53416 8.49782 7.42205 8.60993C7.30995 8.72204 7.15849 8.78594 6.99996 8.78801Z","fill","currentColor"],["d","M6.99996 11.1887C6.84143 11.1866 6.68997 11.1227 6.57787 11.0106C6.46576 10.8985 6.40186 10.7471 6.39979 10.5885V10.1884C6.39979 10.0292 6.46302 9.87658 6.57557 9.76403C6.68813 9.65147 6.84078 9.58824 6.99996 9.58824C7.15914 9.58824 7.31179 9.65147 7.42435 9.76403C7.5369 9.87658 7.60013 10.0292 7.60013 10.1884V10.5885C7.59806 10.7471 7.53416 10.8985 7.42205 11.0106C7.30995 11.1227 7.15849 11.1866 6.99996 11.1887Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(i,n){i&1&&(te(),o(0,"svg",0)(1,"g"),_(2,"path",1)(3,"path",2)(4,"path",3),r(),o(5,"defs")(6,"clipPath",4),_(7,"rect",5),r()()()),i&2&&(dt(n.getClassNames()),O("aria-label",n.ariaLabel)("aria-hidden",n.ariaHidden)("role",n.role),a(),O("clip-path",n.pathId),a(5),l("id",n.pathId))},encapsulation:2})}return e})();var oi=(()=>{class e extends ge{pathId;ngOnInit(){this.pathId="url(#"+Vt()+")"}static \u0275fac=(()=>{let t;return function(n){return(t||(t=St(e)))(n||e)}})();static \u0275cmp=I({type:e,selectors:[["InfoCircleIcon"]],features:[ct],decls:6,vars:7,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["fill-rule","evenodd","clip-rule","evenodd","d","M3.11101 12.8203C4.26215 13.5895 5.61553 14 7 14C8.85652 14 10.637 13.2625 11.9497 11.9497C13.2625 10.637 14 8.85652 14 7C14 5.61553 13.5895 4.26215 12.8203 3.11101C12.0511 1.95987 10.9579 1.06266 9.67879 0.532846C8.3997 0.00303296 6.99224 -0.13559 5.63437 0.134506C4.2765 0.404603 3.02922 1.07129 2.05026 2.05026C1.07129 3.02922 0.404603 4.2765 0.134506 5.63437C-0.13559 6.99224 0.00303296 8.3997 0.532846 9.67879C1.06266 10.9579 1.95987 12.0511 3.11101 12.8203ZM3.75918 2.14976C4.71846 1.50879 5.84628 1.16667 7 1.16667C8.5471 1.16667 10.0308 1.78125 11.1248 2.87521C12.2188 3.96918 12.8333 5.45291 12.8333 7C12.8333 8.15373 12.4912 9.28154 11.8502 10.2408C11.2093 11.2001 10.2982 11.9478 9.23232 12.3893C8.16642 12.8308 6.99353 12.9463 5.86198 12.7212C4.73042 12.4962 3.69102 11.9406 2.87521 11.1248C2.05941 10.309 1.50384 9.26958 1.27876 8.13803C1.05367 7.00647 1.16919 5.83358 1.61071 4.76768C2.05222 3.70178 2.79989 2.79074 3.75918 2.14976ZM7.00002 4.8611C6.84594 4.85908 6.69873 4.79698 6.58977 4.68801C6.48081 4.57905 6.4187 4.43185 6.41669 4.27776V3.88888C6.41669 3.73417 6.47815 3.58579 6.58754 3.4764C6.69694 3.367 6.84531 3.30554 7.00002 3.30554C7.15473 3.30554 7.3031 3.367 7.4125 3.4764C7.52189 3.58579 7.58335 3.73417 7.58335 3.88888V4.27776C7.58134 4.43185 7.51923 4.57905 7.41027 4.68801C7.30131 4.79698 7.1541 4.85908 7.00002 4.8611ZM7.00002 10.6945C6.84594 10.6925 6.69873 10.6304 6.58977 10.5214C6.48081 10.4124 6.4187 10.2652 6.41669 10.1111V6.22225C6.41669 6.06754 6.47815 5.91917 6.58754 5.80977C6.69694 5.70037 6.84531 5.63892 7.00002 5.63892C7.15473 5.63892 7.3031 5.70037 7.4125 5.80977C7.52189 5.91917 7.58335 6.06754 7.58335 6.22225V10.1111C7.58134 10.2652 7.51923 10.4124 7.41027 10.5214C7.30131 10.6304 7.1541 10.6925 7.00002 10.6945Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(i,n){i&1&&(te(),o(0,"svg",0)(1,"g"),_(2,"path",1),r(),o(3,"defs")(4,"clipPath",2),_(5,"rect",3),r()()()),i&2&&(dt(n.getClassNames()),O("aria-label",n.ariaLabel)("aria-hidden",n.ariaHidden)("role",n.role),a(),O("clip-path",n.pathId),a(3),l("id",n.pathId))},encapsulation:2})}return e})();function Si(e,c){if(e&1&&(o(0,"div",10),_(1,"img",11),o(2,"span"),d(3),r()()),e&2){let t=c.$implicit;l("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),a(),l("src",t.Img,L),a(2),V(t.Name)}}function xi(e,c){if(e&1&&(o(0,"div",10),_(1,"img",11),o(2,"span"),d(3),r()()),e&2){let t=c.$implicit;l("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),a(),l("src",t.Img,L),a(2),V(t.Name)}}function yi(e,c){if(e&1&&(o(0,"div",10),_(1,"img",11),o(2,"span"),d(3),r()()),e&2){let t=c.$implicit;l("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),a(),l("src",t.Img,L),a(2),V(t.Name)}}function bi(e,c){if(e&1&&(o(0,"mat-radio-button",16),d(1," Sellable "),r()),e&2){let t=p(2);l("value",t.scanTypeEnum.Sellable)}}function vi(e,c){if(e&1){let t=S();o(0,"div",12)(1,"label",13),d(2,"Scan Type"),r(),o(3,"mat-radio-group",14),E("ngModelChange",function(n){m(t);let s=p();return k(s.filter.ScanFull,n)||(s.filter.ScanFull=n),u(n)}),o(4,"mat-radio-button",15),d(5," All "),r(),g(6,bi,2,1,"mat-radio-button",16),o(7,"mat-radio-button",17),d(8," Active "),r()()()}if(e&2){let t=p();a(3),D("ngModel",t.filter.ScanFull),a(),l("value",t.scanTypeEnum.All),a(2),M(t.selectedChannel.TypeID==t.channelType.Tiktok?6:-1),a(),l("value",t.scanTypeEnum.Active)}}function wi(e,c){e&1&&(o(0,"span"),d(1,"Never"),r())}function Ii(e,c){if(e&1&&(o(0,"span"),d(1),N(2,"async"),r()),e&2){let t=p(2);a(),V(R(2,1,t.lastSync$))}}function Pi(e,c){if(e&1){let t=S();o(0,"div",8)(1,"label",5)(2,"span",18),d(3,"Last Scan:"),r(),g(4,wi,2,0,"span"),N(5,"async"),g(6,Ii,3,3,"span"),r(),o(7,"mat-radio-group",19),E("ngModelChange",function(n){m(t);let s=p();return k(s.filter.UpdatedProduct,n)||(s.filter.UpdatedProduct=n),u(n)}),o(8,"mat-radio-button",20),d(9," Scan All Products "),r(),o(10,"mat-radio-button",21),d(11),r()()()}if(e&2){let t=p();a(4),M(R(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(),v(" ",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Product Download By URL":"Scan Updated Products"," ")}}function Ti(e,c){if(e&1){let t=S();o(0,"div",8)(1,"label",5),d(2," Scan Option "),r(),o(3,"mat-radio-group",22),E("ngModelChange",function(n){m(t);let s=p();return k(s.filter.Async,n)||(s.filter.Async=n),u(n)}),o(4,"mat-radio-button",23),d(5," Asynchronous (Get Notified when Complete) "),r(),o(6,"mat-radio-button",24),d(7," Synchronous (Wait until Complete) "),r()()()}if(e&2){let t=p();a(3),D("ngModel",t.filter.Async),a(),l("value",!0),a(2),l("value",!1)}}var W=(()=>{class e extends Wn{constructor(t,i,n){super(),this.dialogRef=t,this.data=i,this.router=n,this.channelService=$(En),this.channelType=T,this.disabledChannelOption=!1,this.filter={ChannelID:C.GuidEMpty,ScanFull:0,UpdatedProduct:!1,Async:!1},this.scanTypeEnum=zn,this.isSingleChannel=C.IsNotEmpty(i.isSingleChannel)?this.data.isSingleChannel:!1,this.disabledChannelOption=C.IsEmpty(i.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 Ft,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==T.Tiktok||t.TypeID==T.Tokopedia||t.TypeID==T.Lazada||t.TypeID==T.WooCommerce)&&(t.disabled=!1),t)).sort(t=>t.disabled?1:-1))}onSelectChannel(t){let i=this.filterChannelById(t);this.selectedChannel=i,this.filter.Async=!0,this.iniHasScanUpdate(),this.getLastSync(t)}onClickSelect(){setTimeout(()=>{this.adjustOverlayPosition()},0)}getLastSync(t){this.lastSync$=this.channelService.getLastSync(t).pipe(Ct(i=>(this.selectedChannel.LastSync=i.LastSync,this.setDefaultConfigUpdate(),C.IsNotEmpty(i.LastSync)?C.convertToReadableDate(i.LastSync):null)),Yt(1))}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&C.IsNotEmpty(this.selectedChannel.LastSync)&&(this.selectedChannel.TypeID==T.Shopee||this.selectedChannel.TypeID==T.Tiktok||this.selectedChannel.TypeID==T.Lazada)&&(this.filter.UpdatedProduct=!0)}iniHasScanUpdate(){this.selectedChannel?.TypeID!=T.WooCommerce&&this.selectedChannel?.TypeID!=T.KalCare&&this.selectedChannel?.TypeID!=T.None&&!this.isSingleChannel?this.hasScanUpdate=!0:this.hasScanUpdate=!1}filterChannelById(t){let i;return this.channelOptions&&(i=this.channelOptions.find(n=>n.ID==t)),i}submit(){this.selectedChannel.TypeID==T.Tokopedia&&this.filter.UpdatedProduct?this.router.navigate(["/menu/products/download/by-url"]).then(()=>{this.dialogRef.close()}):this.dialogRef.close(this.filter)}isNotEmpty(t){return C.IsNotEmpty(t)}onClose(){this.dialogRef.close()}static{this.\u0275fac=function(i){return new(i||e)(x(kt),x(Et),x(it))}}static{this.\u0275cmp=I({type:e,selectors:[["app-scan-dialog"]],features:[ct],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 available for sale, including 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(i,n){if(i&1){let s=S();o(0,"modal-material",2),f("onOk",function(){return m(s),u(n.submit())})("onClose",function(){return m(s),u(n.onClose())})("onCancel",function(){return m(s),u(n.onClose())}),o(1,"div",3)(2,"div",4)(3,"label",5),d(4,"Select a Channel"),r(),o(5,"p-select",6),f("click",function(){return m(s),u(n.onClickSelect())}),E("ngModelChange",function(w){return m(s),k(n.filter.ChannelID,w)||(n.filter.ChannelID=w),u(w)}),f("ngModelChange",function(w){return m(s),u(n.onSelectChannel(w))}),g(6,Si,4,3,"ng-template",null,0,H)(8,xi,4,3,"ng-template",null,1,H)(10,yi,4,3,"ng-template",null,1,H),r(),g(12,vi,9,4,"div",7)(13,Pi,12,8,"div",8)(14,Ti,8,3,"div",9),r()()()}i&2&&(l("dynamicValidated",n.isNotEmpty(n.filter.ChannelID))("config",n.modalConfig),a(5),l("options",n.channelOptions),D("ngModel",n.filter.ChannelID),l("filter",!0),a(7),l("ngIf",!n.isSingleChannel&&n.isNotEmpty(n.filter.ChannelID)),a(),M(n.hasScanUpdate&&n.selectedChannel?13:-1),a(),l("ngIf",!n.isSingleChannel&&n.isNotEmpty(n.filter.ChannelID)))},dependencies:[J,A,Tt,Rn,An,Dt,G,K,he,fe,Se,ut,mt,Bn,Ce],encapsulation:2})}}return e})();var wt=function(e){return e.Tokopedia="https://seller.tokopedia.com",e.Shoope="https://seller.shopee.co.id",e.Tiktok="https://seller-id.tiktok.com",e.WooCommerce="https://woocommerce.dealpos.app",e.Lazada="https://sellercenter.lazada.co.id",e}(wt||{});var He={Success:"Success",Info:"Info",Warning:"Warning",Error:"Error"};var Mi=[[["header"]],[["content"]],[["footer"]]],Oi=["header","content","footer"],Di=(e,c)=>({bodyScrollable:e,hideScrollbar:c}),ki=(e,c,t,i)=>({"bg-success":e,"bg-warning":c,"bg-info":t,"bg-danger":i}),Ei=e=>({"mx-auto":e}),Fi=(e,c)=>({"show-footer":e,"p-0":c});function Vi(e,c){if(e&1){let t=S();o(0,"div",8),f("click",function(){m(t);let n=p();return u(n.onBack.emit())}),o(1,"a",9),_(2,"i",10),r()()}}function Ni(e,c){if(e&1){let t=S();o(0,"div")(1,"a",11),f("click",function(){m(t);let n=p();return u(n.onClose.emit())}),_(2,"i",12),r()()}}function Ai(e,c){if(e&1){let t=S();o(0,"a",16),f("click",function(){m(t);let n=p(2);return u(n.onCancel.emit())}),d(1),r()}if(e&2){let t=p(2);a(),v(" ",t.config!=null&&t.config.cancelText?t.config==null?null:t.config.cancelText:"Cancel","")}}function Ri(e,c){if(e&1){let t=S();o(0,"button",17),f("click",function(){m(t);let n=p(2);return u(n.onOk.emit())})("keyup.F2",function(){m(t);let n=p(2);return u(n.onOk.emit())}),r()}if(e&2){let t=p(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)",ee)}}function $i(e,c){if(e&1&&(o(0,"mat-dialog-actions",13),ie(1,2),g(2,Ai,2,1,"a",14)(3,Ri,1,2,"button",15),r()),e&2){let t=p();a(2),l("ngIf",!(t.config!=null&&t.config.hideCancel)),a(),l("ngIf",!(t.config!=null&&t.config.hideOk))}}var Ge=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=He.Success,this.validated=!0,this.customWidth="initial",this.bodyScrollable=!1,this.hideScrollbar=!1,this.disableKeyup=!1,this.noPadding=!1}},ai=(()=>{class e{constructor(){this.dynamicValidated=!0,this.onOk=new pt,this.onCancel=new pt,this.onClose=new pt,this.onBack=new pt,this.headerType=He}ngOnInit(){this.config==null&&(this.config=new Ge)}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(i){return new(i||e)}}static{this.\u0275cmp=I({type:e,selectors:[["modal-material"]],inputs:{config:"config",dynamicValidated:"dynamicValidated"},outputs:{onOk:"onOk",onCancel:"onCancel",onClose:"onClose",onBack:"onBack"},ngContentSelectors:Oi,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(i,n){i&1&&(nn(Mi),o(0,"div",0),f("keyup",function(h){return n.onKeyup(h)}),o(1,"div",1),g(2,Vi,3,0,"div",2),o(3,"div",3)(4,"h4",4),d(5),r(),ie(6),r(),g(7,Ni,3,0,"div",5),r(),o(8,"mat-dialog-content",6),ie(9,1),r(),g(10,$i,4,2,"mat-dialog-actions",7),r()),i&2&&(en("width",n.config==null?null:n.config.customWidth),l("ngClass",Bt(10,Di,n.config==null?null:n.config.bodyScrollable,n.config==null?null:n.config.hideScrollbar)),a(),l("ngClass",ae(13,ki,n.headerType.Success==(n.config==null?null:n.config.headerType),n.headerType.Warning==(n.config==null?null:n.config.headerType),n.headerType.Info==(n.config==null?null:n.config.headerType),n.headerType.Error==(n.config==null?null:n.config.headerType))),a(),l("ngIf",n.config==null?null:n.config.eMoney),a(),l("ngClass",P(18,Ei,n.config==null?null:n.config.eMoney)),a(2),V(n.config==null?null:n.config.title),a(2),l("ngIf",!(n.config!=null&&n.config.hideClose)),a(),l("ngClass",Bt(20,Fi,!(n.config!=null&&n.config.hideFooter),n.config==null?null:n.config.noPadding)),a(2),l("ngIf",!(n.config!=null&&n.config.hideFooter)))},dependencies:[J,yt,A,vn,xn,bn,yn],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 e})();var Li=e=>({"is-disabled":e});function Ui(e,c){if(e&1&&(y(0),o(1,"tr")(2,"td",10),d(3),r(),o(4,"td",10),d(5),r(),o(6,"td",11)(7,"p",12),d(8,"Product Not in Channel!"),r()()(),b()),e&2){let t=p().$implicit;a(3),v(" ",t==null?null:t.Model," "),a(2),v(" ",t==null?null:t.Code," ")}}function Bi(e,c){if(e&1&&(o(0,"td",10),d(1),r()),e&2){let t=p(3).$implicit;O("rowspan",t.Channel.length),a(),v(" ",t==null?null:t.Model," ")}}function ji(e,c){if(e&1&&(o(0,"td",10),d(1),r()),e&2){let t=p(3).$implicit;O("rowspan",t.Channel.length),a(),v(" ",t==null?null:t.Code," ")}}function Wi(e,c){if(e&1){let t=S();o(0,"tr"),g(1,Bi,2,2,"td",13)(2,ji,2,2,"td",13),o(3,"td",10)(4,"div",14)(5,"a",15),_(6,"img",16),r(),o(7,"div",17),d(8),r()()(),o(9,"td",10),d(10),N(11,"number"),r(),o(12,"td",18),d(13),N(14,"number"),r(),o(15,"td",19)(16,"div",20)(17,"button",21),f("click",function(){let n=m(t).$implicit,s=p(2).$implicit,h=p();return u(h.onDetach(n,s))}),_(18,"i",22),o(19,"span",23),d(20,"Detach"),r()(),o(21,"a",24),_(22,"i",25),o(23,"span",23),d(24,"Edit"),r()()()()()}if(e&2){let t=c.$implicit,i=c.$index,n=p(3);a(),l("ngIf",i==0),a(),l("ngIf",i==0),a(3),l("href",t.Url,L)("title",t.Title),a(),l("src",n.getChannelLogo(t.TypeID),L),a(),l("matTooltip",(t==null||t.Name==null?null:t.Name.length)>40?t==null?null:t.Name:""),a(),v(" ",t.Name," "),a(2),V(R(11,12,t.Price)),a(3),V(R(14,14,t.Inventory)),a(8),l("href",n.getHyperlinkSellerCenter(t),L)("ngClass",P(16,Li,t.TypeID==n.channelType.KalCare))("matTooltip",t.TypeID!=n.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function zi(e,c){if(e&1&&Ae(0,Wi,25,18,"tr",null,Ne),e&2){let t=p().$implicit;Re(t==null?null:t.Channel)}}function Hi(e,c){if(e&1&&g(0,Ui,9,2,"ng-container",9)(1,zi,2,0,"ng-template",null,0,H),e&2){let t=c.$implicit,i=Q(2);l("ngIf",!t.Channel||t.Channel.length<1)("ngIfElse",i)}}var ve=(()=>{class e{constructor(t,i){this.data=t,this.dialogRef=i,this.httpService=$(Z),this.toastr=$(Y),this.variants=z([]),this.channelType=T,this.variants.set(this.data.variants),this.title=t.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new Ft,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideFooter=!0,this.modalConfig.customWidth="850px"}onDetach(t,i){let n={ChannelID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariationID:t.ChannelVariationID};this.httpService.post(Cn.DetachVariant,[n]).subscribe(s=>{this.toastr.success(s.Message,"Success"),this.updateVariantAfterDetach(i,t.ChannelVariationID)})}updateVariantAfterDetach(t,i){this.variants.update(n=>{let s=n.findIndex(h=>h.ID===t.ID);return s!==-1&&(n[s].Channel=n[s].Channel.filter(h=>h.ChannelVariationID!==i)),[...n]})}getChannelLogo(t){return C.getChannelLogoByTypeId(t)}getHyperlinkSellerCenter(t){let i="javascript:void(0)";switch(t.TypeID){case T.Shopee:i=`${wt.Shoope}/portal/product/${t.ChannelItemID}`;break;case T.Tiktok:i=`${wt.Tiktok}/product/edit/${t.ChannelItemID}`;break;case T.Tokopedia:i=`${wt.Tokopedia}/edit-product/${t.ChannelItemID}`;break;case T.WooCommerce:i=`${wt.WooCommerce}/wp-admin/post.php?post=${t.ChannelItemID}&action=edit`;break;case T.Lazada:i=`${wt.Lazada}/apps/product/publish?productId=${t.ChannelItemID}`;break}return i}static{this.\u0275fac=function(i){return new(i||e)(x(Et),x(kt))}}static{this.\u0275cmp=I({type:e,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(i,n){i&1&&(o(0,"modal-material",1),f("onClose",function(){return n.dialogRef.close()})("onCancel",function(){return n.dialogRef.close()}),o(1,"content")(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4)(6,"div",5)(7,"span"),d(8,"VARIANT"),r(),o(9,"sup"),_(10,"i",6),r()()(),o(11,"th",4),d(12,"SKU"),r(),o(13,"th",4)(14,"div",5)(15,"span"),d(16,"PRODUCT"),r(),o(17,"sup"),_(18,"i",7),r()()(),o(19,"th",4),d(20,"PRICE"),r(),o(21,"th",8),d(22,"INVENTORY"),r(),_(23,"th",4),r()(),o(24,"tbody"),Ae(25,Hi,3,2,null,null,Ne),r()()()()),i&2&&(l("config",n.modalConfig),a(25),Re(n.variants()))},dependencies:[J,yt,A,Mt,ut,mt,ai],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 e})();function Gi(e,c){if(e&1&&(o(0,"mat-option",6)(1,"div"),_(2,"img",7),o(3,"span"),d(4),r()()()),e&2){let t=c.$implicit;l("value",t.ChannelID),a(2),l("src",t.logo,L),a(2),V(t.Title)}}var Rt=(()=>{class e{constructor(){this.dialogRef=$(kt),this.channels=$(Et),this.channelIds=z([]),this.channelOptions=z([])}ngOnInit(){this.initModalConfig();let t=this.channels.filter((i,n,s)=>s.findIndex(h=>h.ChannelID===i.ChannelID)===n);this.channelOptions.set(t)}initModalConfig(){this.modalConfig=new Ft,this.modalConfig.title="Detach Product",this.modalConfig.okText="Save"}onClose(){this.dialogRef.close()}onSave(){let t=this.channels.filter(i=>this.channelIds().includes(i.ChannelID)).map(i=>({ChannelID:i.ChannelID,ChannelItemID:i.ChannelItemID}));this.dialogRef.close(t)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=I({type:e,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(i,n){i&1&&(o(0,"modal-material",0),f("onClose",function(){return n.onClose()})("onCancel",function(){return n.onClose()})("onOk",function(){return n.onSave()}),o(1,"div",1)(2,"div")(3,"label",2),d(4,"Select a Channel"),r(),o(5,"mat-form-field",3)(6,"mat-select",4),E("ngModelChange",function(h){return k(n.channelIds,h)||(n.channelIds=h),h}),g(7,Gi,5,3,"mat-option",5),r()()()()()),i&2&&(l("dynamicValidated",n.channelIds().length>0)("config",n.modalConfig),a(6),D("ngModel",n.channelIds),l("multiple",!0),a(),l("ngForOf",n.channelOptions()))},dependencies:[J,U,he,fe,$n,Gn,Hn,Un,Dt,G,K,ut],encapsulation:2})}}return e})();var we=e=>[e];function Zi(e,c){if(e&1){let t=S();o(0,"button",14),f("click",function(){m(t);let n=p(2);return u(n.onDetachMultipleProduct())}),_(1,"i",15),d(2),r()}if(e&2){let t,i=p(2);a(2),v("Detach (",(t=i.productService.selectedProduct(i.products))==null?null:t.length,") ")}}function Ji(e,c){if(e&1&&(y(0),g(1,Zi,3,1,"button",13),b()),e&2){let t=p();a(),M(t.productService.hasSelection(t.products)?1:-1)}}function Qi(e,c){if(e&1){let t=S();o(0,"button",18),f("click",function(){m(t);let n=p(3);return u(n.onOpenScanDialog())}),_(1,"i",19),d(2," Scan Channel "),r()}}function Yi(e,c){if(e&1&&g(0,Qi,3,0,"button",17),e&2){let t=p(2);l("ngIf",!t.productService.hasSelection(t.products))}}function qi(e,c){if(e&1&&(y(0),g(1,Yi,1,1,"button",16),b()),e&2){let t=p();a(),M(t.productService.hasSelection(t.products)?-1:1)}}function Xi(e,c){if(e&1){let t=S();o(0,"button",21),f("click",function(){m(t);let n=p(2);return u(n.onScanMultipleProduct())}),_(1,"i",19),d(2),r()}if(e&2){let t,i=p(2);a(2),v(" Scan (",(t=i.productService.selectedProduct(i.products))==null?null:t.length,") ")}}function to(e,c){if(e&1&&(y(0),g(1,Xi,3,1,"button",20),b()),e&2){let t=p();a(),M(t.productService.hasSelection(t.products)&&t.multipeScanChannels.length>0?1:-1)}}function eo(e,c){if(e&1){let t=S();o(0,"button",23),f("click",function(){m(t);let n=p(2);return u(n.onUploadMultipleProduct())}),_(1,"i",24),d(2),r()}if(e&2){let t,i=p(2);a(2),v(" Upload (",(t=i.productService.selectedProduct(i.products))==null?null:t.length,") ")}}function no(e,c){if(e&1&&(y(0),g(1,eo,3,1,"button",22),b()),e&2){let t=p();a(),M(t.productService.hasSelection(t.products)?1:-1)}}function io(e,c){if(e&1){let t=S();o(0,"div",25)(1,"app-product-card",26),f("onUpload",function(){let n=m(t).$implicit,s=p();return u(s.onUploadToMultipleChannel(n))})("onScan",function(){let n=m(t).$implicit,s=p();return u(s.onScanSingleProduct(n))})("onDescEvent",function(){let n=m(t).index,s=p();return u(s.onOpenDialogVariant(n))})("onCheckBoxChange",function(n){let s=m(t).$implicit;return u(s.selected=n)})("onDetach",function(){let n=m(t).$implicit,s=p();return u(s.onDetachProduct([n]))}),r()()}if(e&2){let t=c.$implicit,i=p();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",i.productService.getChannelProduct(t))("code",i.getVariantCode(t==null?null:t.Variants))("showCheckBox",(t==null?null:t.Channel.length)<i.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 oo(e,c){e&1&&(y(0),o(1,"div",27),_(2,"app-empty-state"),r(),b())}function ao(e,c){if(e&1){let t=S();y(0),o(1,"div",28)(2,"div",29)(3,"app-custom-paginator",30),f("next",function(){m(t);let n=p();return u(n.getProducts())})("previous",function(){m(t);let n=p();return u(n.getProducts())}),r()()(),b()}if(e&2){let t=p();a(3),l("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",!0)("nextButtonAlwaysVisible",!0)}}var si=(()=>{class e{constructor(t,i,n,s,h,w,ft){this.http=t,this.toastr=i,this.dialog=n,this.productService=s,this.authService=h,this.uploadProductService=w,this.route=ft,this.searchFilter=new ht,this.products=[],this.rowCount=0,this.multipeScanChannels=[],this.scanProductRole=B.ProductScan,this.uploadProductRole=B.ProductUpload,this.detachProductRole=B.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,[T.Tokopedia,T.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(i=>{this.products=i.Data,this.rowCount=i.Total==null?this.searchFilter.RowCount:i.Total.toString(),this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions)})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=C.GuidEMpty,this.dialog.open(W,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(F(n=>C.IsNotEmpty(n))).subscribe(n=>{this.searchFilter.ChannelID=n.ChannelID,this.searchFilter.ScanFull=n.ScanFull,this.searchFilter.UpdatedProduct=n.UpdatedProduct,this.searchFilter.Async=n.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 i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,i,!this.searchFilter.UpdatedProduct)}})}onOpenDialogVariant(t){let i=this.products[t]?.Variants||[];this.dialog.open(ve,{data:{title:this.products[t].Name,variants:i}})}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.uploadProductService.setSelectedProduct(t),this.route.navigate(["/menu/products/upload"])}onUploadToMultipleChannel(t){this.uploadProductService.setSelectedProduct([t]),this.route.navigate(["/menu/products/upload"])}searchProduct(t){this.searchFilter.text=t,this.getProducts()}onScanMultipleProduct(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=C.GuidEMpty;let i=this.productService.filterChannelByTypeId(this.channelOptions,[T.Tokopedia,T.Tiktok]);this.dialog.open(W,{data:{filter:t,channelOptions:i,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(F(s=>C.IsNotEmpty(s))).subscribe(s=>{this.searchFilter.ChannelID=s.ChannelID,this.searchFilter.ScanFull=s.ScanFull,this.searchFilter.UpdatedProduct=s.UpdatedProduct;let h=this.productService.selectedProduct(this.products),w=this.productService.getVariantCodesProducts(h);this.scanSingleProduct(w)})}onScanSingleProduct(t){let i=JSON.parse(JSON.stringify(this.searchFilter));i.ChannelID=C.GuidEMpty,this.dialog.open(W,{data:{filter:i,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(F(n=>C.IsNotEmpty(n))).subscribe(n=>{this.searchFilter.ChannelID=n.ChannelID;let s=this.productService.getVariantCodesProduct(t);this.scanSingleProduct(s)})}scanSingleProduct(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:i=>{if(i)this.toastr.success("Successfully Scan ","Success");else{let n=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${n?.Name} `,"Error")}this.searchFilter.ChannelID=C.GuidEMpty,i&&this.getProducts()},error:i=>{this.searchFilter.ChannelID=C.GuidEMpty}})}getVariantCode(t=[]){let i;return t?.length>1&&(i=(t[0].model?t[0].model:"")+t[0].Code),t?.length==1&&(i=t[0].Code),i}onDetachProduct(t){let i=[];t.forEach(n=>{n.Channel=C.assignChannelLogo(n.Channel),i.push(...n.Channel)}),this.dialog.open(Rt,{width:"600px",data:[...i]}).afterClosed().pipe(F(n=>C.IsNotEmpty(n)),$t(n=>this.productService.detachProduct(n))).subscribe(n=>{this.toastr.success(n.Message,ue.Success),this.getProducts()})}onDetachMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.onDetachProduct(t)}static{this.\u0275fac=function(i){return new(i||e)(x(Z),x(Y),x(rt),x(et),x(at),x(Nt),x(it))}}static{this.\u0275cmp=I({type:e,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(i,n){if(i&1){let s=S();o(0,"mainpanel",1),f("onSubmit",function(w){return m(s),u(n.searchProduct(w))}),o(1,"actions"),g(2,Ji,2,1,"ng-container",2)(3,qi,2,1,"ng-container",2)(4,to,2,1,"ng-container",2)(5,no,2,1,"ng-container",2),r(),o(6,"filters")(7,"div")(8,"label",3),d(9,"Category"),r(),o(10,"ng-select",4),f("ngModelChange",function(w){return m(s),u(n.searchFilter.Category=w)}),r()(),o(11,"div",5)(12,"mat-date-range-input",6)(13,"input",7),E("ngModelChange",function(w){return m(s),k(n.startDate,w)||(n.startDate=w),u(w)}),f("click",function(){m(s);let w=Q(16);return u(w.open())}),r(),o(14,"input",8),E("ngModelChange",function(w){return m(s),k(n.endDate,w)||(n.endDate=w),u(w)}),f("click",function(){m(s);let w=Q(16);return u(w.open())}),r()(),_(15,"mat-date-range-picker",null,0),r()(),o(17,"content")(18,"div",9)(19,"div",10),g(20,io,2,11,"div",11)(21,oo,3,0,"ng-container",12),r(),g(22,ao,4,5,"ng-container",12),r()()()}if(i&2){let s=Q(16);l("headerTitle","In POS ("+n.rowCount+")"),a(2),l("ngxPermissionsOnly",P(14,we,n.detachProductRole)),a(),l("ngxPermissionsOnly",P(16,we,n.scanProductRole)),a(),l("ngxPermissionsOnly",P(18,we,n.scanProductRole)),a(),l("ngxPermissionsOnly",P(20,we,n.scanProductRole)),a(5),l("clearable",!0)("items",n.Categories)("ngModel",n.searchFilter.Category),a(2),l("rangePicker",s),a(),D("ngModel",n.startDate),a(),D("ngModel",n.endDate),a(6),l("ngForOf",n.products),a(),l("ngIf",n.products.length==0),a(),l("ngIf",n.products.length>0)}},dependencies:[U,A,Ot,G,K,tt,de,lt,_t,nt,Zn,Jn,Qn,Yn,ot],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 e})();var ci=["container"],ro=(e,c,t,i)=>({showTransformParams:e,hideTransformParams:c,showTransitionParams:t,hideTransitionParams:i}),lo=e=>({value:"visible",params:e}),so=(e,c)=>({$implicit:e,closeFn:c}),co=e=>({$implicit:e});function po(e,c){e&1&&$e(0)}function mo(e,c){if(e&1&&g(0,po,1,0,"ng-container",3),e&2){let t=p();l("ngTemplateOutlet",t.headlessTemplate)("ngTemplateOutletContext",Bt(2,so,t.message,t.onCloseIconClick))}}function uo(e,c){if(e&1&&_(0,"span",4),e&2){let t=p(3);l("ngClass",t.cx("messageIcon"))}}function ho(e,c){e&1&&_(0,"CheckIcon"),e&2&&O("aria-hidden",!0)("data-pc-section","icon")}function _o(e,c){e&1&&_(0,"InfoCircleIcon"),e&2&&O("aria-hidden",!0)("data-pc-section","icon")}function go(e,c){e&1&&_(0,"TimesCircleIcon"),e&2&&O("aria-hidden",!0)("data-pc-section","icon")}function fo(e,c){e&1&&_(0,"ExclamationTriangleIcon"),e&2&&O("aria-hidden",!0)("data-pc-section","icon")}function Co(e,c){e&1&&_(0,"InfoCircleIcon"),e&2&&O("aria-hidden",!0)("data-pc-section","icon")}function So(e,c){if(e&1&&(o(0,"span",4),g(1,ho,1,2,"CheckIcon")(2,_o,1,2,"InfoCircleIcon")(3,go,1,2,"TimesCircleIcon")(4,fo,1,2,"ExclamationTriangleIcon")(5,Co,1,2,"InfoCircleIcon"),r()),e&2){let t,i=p(3);l("ngClass",i.cx("messageIcon")),O("aria-hidden",!0)("data-pc-section","icon"),a(),M((t=i.message.severity)==="success"?1:t==="info"?2:t==="error"?3:t==="warn"?4:5)}}function xo(e,c){if(e&1&&(y(0),g(1,uo,1,1,"span",6)(2,So,6,4,"span",6),o(3,"div",4)(4,"div",4),d(5),r(),o(6,"div",4),d(7),r()(),b()),e&2){let t=p(2);a(),l("ngIf",t.message.icon),a(),l("ngIf",!t.message.icon),a(),l("ngClass",t.cx("messageText")),O("data-pc-section","text"),a(),l("ngClass",t.cx("summary")),O("data-pc-section","summary"),a(),v(" ",t.message.summary," "),a(),l("ngClass",t.cx("detail")),O("data-pc-section","detail"),a(),V(t.message.detail)}}function yo(e,c){e&1&&$e(0)}function bo(e,c){if(e&1&&_(0,"span",4),e&2){let t=p(4);l("ngClass",t.cx("closeIcon"))}}function vo(e,c){if(e&1&&g(0,bo,1,1,"span",6),e&2){let t=p(3);l("ngIf",t.message.closeIcon)}}function wo(e,c){if(e&1&&_(0,"TimesIcon",4),e&2){let t=p(3);l("ngClass",t.cx("closeIcon")),O("aria-hidden",!0)("data-pc-section","closeicon")}}function Io(e,c){if(e&1){let t=S();o(0,"div")(1,"button",7),f("click",function(n){m(t);let s=p(2);return u(s.onCloseIconClick(n))})("keydown.enter",function(n){m(t);let s=p(2);return u(s.onCloseIconClick(n))}),g(2,vo,1,1,"span",4)(3,wo,1,3,"TimesIcon",4),r()()}if(e&2){let t=p(2);a(),l("ariaLabel",t.closeAriaLabel),O("class",t.cx("closeButton"))("data-pc-section","closebutton"),a(),M(t.message.closeIcon?2:3)}}function Po(e,c){if(e&1&&(o(0,"div",4),g(1,xo,8,10,"ng-container",5)(2,yo,1,0,"ng-container",3)(3,Io,4,4,"div"),r()),e&2){let t=p();dt(t.message==null?null:t.message.contentStyleClass),l("ngClass",t.cx("messageContent")),O("data-pc-section","content"),a(),l("ngIf",!t.template),a(),l("ngTemplateOutlet",t.template)("ngTemplateOutletContext",P(8,co,t.message)),a(),M((t.message==null?null:t.message.closable)!==!1?3:-1)}}var To=["message"],Mo=["headless"];function Oo(e,c){if(e&1){let t=S();o(0,"p-toastItem",3),f("onClose",function(n){m(t);let s=p();return u(s.onMessageClose(n))})("@toastAnimation.start",function(n){m(t);let s=p();return u(s.onAnimationStart(n))})("@toastAnimation.done",function(n){m(t);let s=p();return u(s.onAnimationEnd(n))}),r()}if(e&2){let t=c.$implicit,i=c.index,n=p();l("message",t)("index",i)("life",n.life)("template",n.template||n._template)("headlessTemplate",n.headlessTemplate||n._headlessTemplate)("@toastAnimation",void 0)("showTransformOptions",n.showTransformOptions)("hideTransformOptions",n.hideTransformOptions)("showTransitionOptions",n.showTransitionOptions)("hideTransitionOptions",n.hideTransitionOptions)}}var Do=({dt:e})=>`
2
+ .p-toast {
3
+ width: ${e("toast.width")};
4
+ white-space: pre-line;
5
+ word-break: break-word;
6
+ }
7
+
8
+ .p-toast-message {
9
+ margin: 0 0 1rem 0;
10
+ }
11
+
12
+ .p-toast-message-icon {
13
+ flex-shrink: 0;
14
+ font-size: ${e("toast.icon.size")};
15
+ width: ${e("toast.icon.size")};
16
+ height: ${e("toast.icon.size")};
17
+ }
18
+
19
+ .p-toast-message-content {
20
+ display: flex;
21
+ align-items: flex-start;
22
+ padding: ${e("toast.content.padding")};
23
+ gap: ${e("toast.content.gap")};
24
+ }
25
+
26
+ .p-toast-message-text {
27
+ flex: 1 1 auto;
28
+ display: flex;
29
+ flex-direction: column;
30
+ gap: ${e("toast.text.gap")};
31
+ }
32
+
33
+ .p-toast-summary {
34
+ font-weight: ${e("toast.summary.font.weight")};
35
+ font-size: ${e("toast.summary.font.size")};
36
+ }
37
+
38
+ .p-toast-detail {
39
+ font-weight: ${e("toast.detail.font.weight")};
40
+ font-size: ${e("toast.detail.font.size")};
41
+ }
42
+
43
+ .p-toast-close-button {
44
+ display: flex;
45
+ align-items: center;
46
+ justify-content: center;
47
+ overflow: hidden;
48
+ position: relative;
49
+ cursor: pointer;
50
+ background: transparent;
51
+ transition: background ${e("toast.transition.duration")}, color ${e("toast.transition.duration")}, outline-color ${e("toast.transition.duration")}, box-shadow ${e("toast.transition.duration")};
52
+ outline-color: transparent;
53
+ color: inherit;
54
+ width: ${e("toast.close.button.width")};
55
+ height: ${e("toast.close.button.height")};
56
+ border-radius: ${e("toast.close.button.border.radius")};
57
+ margin: -25% 0 0 0;
58
+ right: -25%;
59
+ padding: 0;
60
+ border: none;
61
+ user-select: none;
62
+ }
63
+
64
+ .p-toast-close-button:dir(rtl) {
65
+ margin: -25% 0 0 auto;
66
+ left: -25%;
67
+ right: auto;
68
+ }
69
+
70
+ .p-toast-message-info,
71
+ .p-toast-message-success,
72
+ .p-toast-message-warn,
73
+ .p-toast-message-error,
74
+ .p-toast-message-secondary,
75
+ .p-toast-message-contrast {
76
+ border-width: ${e("toast.border.width")};
77
+ border-style: solid;
78
+ backdrop-filter: blur(${e("toast.blur")});
79
+ border-radius: ${e("toast.border.radius")};
80
+ }
81
+
82
+ .p-toast-close-icon {
83
+ font-size: ${e("toast.close.icon.size")};
84
+ width: ${e("toast.close.icon.size")};
85
+ height: ${e("toast.close.icon.size")};
86
+ }
87
+
88
+ .p-toast-close-button:focus-visible {
89
+ outline-width: ${e("focus.ring.width")};
90
+ outline-style: ${e("focus.ring.style")};
91
+ outline-offset: ${e("focus.ring.offset")};
92
+ }
93
+
94
+ .p-toast-message-info {
95
+ background: ${e("toast.info.background")};
96
+ border-color: ${e("toast.info.border.color")};
97
+ color: ${e("toast.info.color")};
98
+ box-shadow: ${e("toast.info.shadow")};
99
+ }
100
+
101
+ .p-toast-message-info .p-toast-detail {
102
+ color: ${e("toast.info.detail.color")};
103
+ }
104
+
105
+ .p-toast-message-info .p-toast-close-button:focus-visible {
106
+ outline-color: ${e("toast.info.close.button.focus.ring.color")};
107
+ box-shadow: ${e("toast.info.close.button.focus.ring.shadow")};
108
+ }
109
+
110
+ .p-toast-message-info .p-toast-close-button:hover {
111
+ background: ${e("toast.info.close.button.hover.background")};
112
+ }
113
+
114
+ .p-toast-message-success {
115
+ background: ${e("toast.success.background")};
116
+ border-color: ${e("toast.success.border.color")};
117
+ color: ${e("toast.success.color")};
118
+ box-shadow: ${e("toast.success.shadow")};
119
+ }
120
+
121
+ .p-toast-message-success .p-toast-detail {
122
+ color: ${e("toast.success.detail.color")};
123
+ }
124
+
125
+ .p-toast-message-success .p-toast-close-button:focus-visible {
126
+ outline-color: ${e("toast.success.close.button.focus.ring.color")};
127
+ box-shadow: ${e("toast.success.close.button.focus.ring.shadow")};
128
+ }
129
+
130
+ .p-toast-message-success .p-toast-close-button:hover {
131
+ background: ${e("toast.success.close.button.hover.background")};
132
+ }
133
+
134
+ .p-toast-message-warn {
135
+ background: ${e("toast.warn.background")};
136
+ border-color: ${e("toast.warn.border.color")};
137
+ color: ${e("toast.warn.color")};
138
+ box-shadow: ${e("toast.warn.shadow")};
139
+ }
140
+
141
+ .p-toast-message-warn .p-toast-detail {
142
+ color: ${e("toast.warn.detail.color")};
143
+ }
144
+
145
+ .p-toast-message-warn .p-toast-close-button:focus-visible {
146
+ outline-color: ${e("toast.warn.close.button.focus.ring.color")};
147
+ box-shadow: ${e("toast.warn.close.button.focus.ring.shadow")};
148
+ }
149
+
150
+ .p-toast-message-warn .p-toast-close-button:hover {
151
+ background: ${e("toast.warn.close.button.hover.background")};
152
+ }
153
+
154
+ .p-toast-message-error {
155
+ background: ${e("toast.error.background")};
156
+ border-color: ${e("toast.error.border.color")};
157
+ color: ${e("toast.error.color")};
158
+ box-shadow: ${e("toast.error.shadow")};
159
+ }
160
+
161
+ .p-toast-message-error .p-toast-detail {
162
+ color: ${e("toast.error.detail.color")};
163
+ }
164
+
165
+ .p-toast-message-error .p-toast-close-button:focus-visible {
166
+ outline-color: ${e("toast.error.close.button.focus.ring.color")};
167
+ box-shadow: ${e("toast.error.close.button.focus.ring.shadow")};
168
+ }
169
+
170
+ .p-toast-message-error .p-toast-close-button:hover {
171
+ background: ${e("toast.error.close.button.hover.background")};
172
+ }
173
+
174
+ .p-toast-message-secondary {
175
+ background: ${e("toast.secondary.background")};
176
+ border-color: ${e("toast.secondary.border.color")};
177
+ color: ${e("toast.secondary.color")};
178
+ box-shadow: ${e("toast.secondary.shadow")};
179
+ }
180
+
181
+ .p-toast-message-secondary .p-toast-detail {
182
+ color: ${e("toast.secondary.detail.color")};
183
+ }
184
+
185
+ .p-toast-message-secondary .p-toast-close-button:focus-visible {
186
+ outline-color: ${e("toast.secondary.close.button.focus.ring.color")};
187
+ box-shadow: ${e("toast.secondary.close.button.focus.ring.shadow")};
188
+ }
189
+
190
+ .p-toast-message-secondary .p-toast-close-button:hover {
191
+ background: ${e("toast.secondary.close.button.hover.background")};
192
+ }
193
+
194
+ .p-toast-message-contrast {
195
+ background: ${e("toast.contrast.background")};
196
+ border-color: ${e("toast.contrast.border.color")};
197
+ color: ${e("toast.contrast.color")};
198
+ box-shadow: ${e("toast.contrast.shadow")};
199
+ }
200
+
201
+ .p-toast-message-contrast .p-toast-detail {
202
+ color: ${e("toast.contrast.detail.color")};
203
+ }
204
+
205
+ .p-toast-message-contrast .p-toast-close-button:focus-visible {
206
+ outline-color: ${e("toast.contrast.close.button.focus.ring.color")};
207
+ box-shadow: ${e("toast.contrast.close.button.focus.ring.shadow")};
208
+ }
209
+
210
+ .p-toast-message-contrast .p-toast-close-button:hover {
211
+ background: ${e("toast.contrast.close.button.hover.background")};
212
+ }
213
+
214
+ .p-toast-top-center {
215
+ transform: translateX(-50%);
216
+ }
217
+
218
+ .p-toast-bottom-center {
219
+ transform: translateX(-50%);
220
+ }
221
+
222
+ .p-toast-center {
223
+ min-width: 20vw;
224
+ transform: translate(-50%, -50%);
225
+ }
226
+
227
+ .p-toast-message-enter-from {
228
+ opacity: 0;
229
+ transform: translateY(50%);
230
+ }
231
+
232
+ .p-toast-message-leave-from {
233
+ max-height: 1000px;
234
+ }
235
+
236
+ .p-toast .p-toast-message.p-toast-message-leave-to {
237
+ max-height: 0;
238
+ opacity: 0;
239
+ margin-bottom: 0;
240
+ overflow: hidden;
241
+ }
242
+
243
+ .p-toast-message-enter-active {
244
+ transition: transform 0.3s, opacity 0.3s;
245
+ }
246
+
247
+ .p-toast-message-leave-active {
248
+ transition: max-height 0.45s cubic-bezier(0, 1, 0, 1), opacity 0.3s, margin-bottom 0.3s;
249
+ }
250
+ `,ko={root:({instance:e})=>{let{_position:c}=e;return{position:"fixed",top:c==="top-right"||c==="top-left"||c==="top-center"?"20px":c==="center"?"50%":null,right:(c==="top-right"||c==="bottom-right")&&"20px",bottom:(c==="bottom-left"||c==="bottom-right"||c==="bottom-center")&&"20px",left:c==="top-left"||c==="bottom-left"?"20px":c==="center"||c==="top-center"||c==="bottom-center"?"50%":null}}},Eo={root:({instance:e})=>({"p-toast p-component":!0,[`p-toast-${e._position}`]:!!e._position}),message:({instance:e})=>({"p-toast-message":!0,"p-toast-message-info":e.message.severity==="info"||e.message.severity===void 0,"p-toast-message-warn":e.message.severity==="warn","p-toast-message-error":e.message.severity==="error","p-toast-message-success":e.message.severity==="success","p-toast-message-secondary":e.message.severity==="secondary","p-toast-message-contrast":e.message.severity==="contrast"}),messageContent:"p-toast-message-content",messageIcon:({instance:e})=>({"p-toast-message-icon":!0,[`pi ${e.message.icon}`]:!!e.message.icon}),messageText:"p-toast-message-text",summary:"p-toast-summary",detail:"p-toast-detail",closeButton:"p-toast-close-button",closeIcon:({instance:e})=>({"p-toast-close-icon":!0,[`pi ${e.message.closeIcon}`]:!!e.message.closeIcon})},Me=(()=>{class e extends On{name="toast";theme=Do;classes=Eo;inlineStyles=ko;static \u0275fac=(()=>{let t;return function(n){return(t||(t=St(e)))(n||e)}})();static \u0275prov=Xt({token:e,factory:e.\u0275fac})}return e})();var Fo=(()=>{class e extends We{zone;message;index;life;template;headlessTemplate;showTransformOptions;hideTransformOptions;showTransitionOptions;hideTransitionOptions;onClose=new pt;containerViewChild;_componentStyle=$(Me);timeout;constructor(t){super(),this.zone=t}ngAfterViewInit(){super.ngAfterViewInit(),this.initTimeout()}initTimeout(){this.message?.sticky||this.zone.runOutsideAngular(()=>{this.timeout=setTimeout(()=>{this.onClose.emit({index:this.index,message:this.message})},this.message?.life||this.life||3e3)})}clearTimeout(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null)}onMouseEnter(){this.clearTimeout()}onMouseLeave(){this.initTimeout()}onCloseIconClick=t=>{this.clearTimeout(),this.onClose.emit({index:this.index,message:this.message}),t.preventDefault()};get closeAriaLabel(){return this.config.translation.aria?this.config.translation.aria.close:void 0}ngOnDestroy(){this.clearTimeout(),super.ngOnDestroy()}static \u0275fac=function(i){return new(i||e)(x(tn))};static \u0275cmp=I({type:e,selectors:[["p-toastItem"]],viewQuery:function(i,n){if(i&1&&Le(ci,5),i&2){let s;It(s=Pt())&&(n.containerViewChild=s.first)}},inputs:{message:"message",index:[2,"index","index",jt],life:[2,"life","life",jt],template:"template",headlessTemplate:"headlessTemplate",showTransformOptions:"showTransformOptions",hideTransformOptions:"hideTransformOptions",showTransitionOptions:"showTransitionOptions",hideTransitionOptions:"hideTransitionOptions"},outputs:{onClose:"onClose"},features:[Ut([Me]),ct],decls:4,vars:15,consts:[["container",""],["role","alert","aria-live","assertive","aria-atomic","true",3,"mouseenter","mouseleave","ngClass"],[3,"ngClass","class"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"ngClass"],[4,"ngIf"],[3,"ngClass",4,"ngIf"],["type","button","autofocus","",3,"click","keydown.enter","ariaLabel"]],template:function(i,n){if(i&1){let s=S();o(0,"div",1,0),f("mouseenter",function(){return m(s),u(n.onMouseEnter())})("mouseleave",function(){return m(s),u(n.onMouseLeave())}),g(2,mo,1,5,"ng-container")(3,Po,4,10,"div",2),r()}i&2&&(dt(n.message==null?null:n.message.styleClass),l("ngClass",n.cx("message"))("@messageState",P(13,lo,ae(8,ro,n.showTransformOptions,n.hideTransformOptions,n.showTransitionOptions,n.hideTransitionOptions))),O("id",n.message==null?null:n.message.id)("data-pc-name","toast")("data-pc-section","root"),a(2),M(n.headlessTemplate?2:3))},dependencies:[J,yt,A,ln,Fn,ii,oi,Vn,Nn,je],encapsulation:2,data:{animation:[Ue("messageState",[mn("visible",ce({transform:"translateY(0)",opacity:1})),pe("void => *",[ce({transform:"{{showTransformParams}}",opacity:0}),Be("{{showTransitionParams}}")]),pe("* => void",[Be("{{hideTransitionParams}}",ce({height:0,opacity:0,transform:"{{hideTransformParams}}"}))])])]},changeDetection:0})}return e})(),pi=(()=>{class e extends We{key;autoZIndex=!0;baseZIndex=0;life=3e3;style;styleClass;get position(){return this._position}set position(t){this._position=t,this.cd.markForCheck()}preventOpenDuplicates=!1;preventDuplicates=!1;showTransformOptions="translateY(100%)";hideTransformOptions="translateY(-100%)";showTransitionOptions="300ms ease-out";hideTransitionOptions="250ms ease-in";breakpoints;onClose=new pt;template;headlessTemplate;containerViewChild;messageSubscription;clearSubscription;messages;messagesArchieve;_position="top-right";messageService=$(Wt);_componentStyle=$(Me);styleElement;id=Vt("pn_id_");templates;ngOnInit(){super.ngOnInit(),this.messageSubscription=this.messageService.messageObserver.subscribe(t=>{if(t)if(Array.isArray(t)){let i=t.filter(n=>this.canAdd(n));this.add(i)}else this.canAdd(t)&&this.add([t])}),this.clearSubscription=this.messageService.clearObserver.subscribe(t=>{t?this.key===t&&(this.messages=null):this.messages=null,this.cd.markForCheck()})}_template;_headlessTemplate;ngAfterContentInit(){this.templates?.forEach(t=>{switch(t.getType()){case"message":this._template=t.template;break;case"headless":this._headlessTemplate=t.template;break;default:this._template=t.template;break}})}ngAfterViewInit(){super.ngAfterViewInit(),this.breakpoints&&this.createStyle()}add(t){this.messages=this.messages?[...this.messages,...t]:[...t],this.preventDuplicates&&(this.messagesArchieve=this.messagesArchieve?[...this.messagesArchieve,...t]:[...t]),this.cd.markForCheck()}canAdd(t){let i=this.key===t.key;return i&&this.preventOpenDuplicates&&(i=!this.containsMessage(this.messages,t)),i&&this.preventDuplicates&&(i=!this.containsMessage(this.messagesArchieve,t)),i}containsMessage(t,i){return t?t.find(n=>n.summary===i.summary&&n.detail==i.detail&&n.severity===i.severity)!=null:!1}onMessageClose(t){this.messages?.splice(t.index,1),this.onClose.emit({message:t.message}),this.cd.detectChanges()}onAnimationStart(t){t.fromState==="void"&&(this.renderer.setAttribute(this.containerViewChild?.nativeElement,this.id,""),this.autoZIndex&&this.containerViewChild?.nativeElement.style.zIndex===""&&_e.set("modal",this.containerViewChild?.nativeElement,this.baseZIndex||this.config.zIndex.modal))}onAnimationEnd(t){t.toState==="void"&&this.autoZIndex&&Mn(this.messages)&&_e.clear(this.containerViewChild?.nativeElement)}createStyle(){if(!this.styleElement){this.styleElement=this.renderer.createElement("style"),this.styleElement.type="text/css",this.renderer.appendChild(this.document.head,this.styleElement);let t="";for(let i in this.breakpoints){let n="";for(let s in this.breakpoints[i])n+=s+":"+this.breakpoints[i][s]+" !important;";t+=`
251
+ @media screen and (max-width: ${i}) {
252
+ .p-toast[${this.id}] {
253
+ ${n}
254
+ }
255
+ }
256
+ `}this.renderer.setProperty(this.styleElement,"innerHTML",t),Tn(this.styleElement,"nonce",this.config?.csp()?.nonce)}}destroyStyle(){this.styleElement&&(this.renderer.removeChild(this.document.head,this.styleElement),this.styleElement=null)}ngOnDestroy(){this.messageSubscription&&this.messageSubscription.unsubscribe(),this.containerViewChild&&this.autoZIndex&&_e.clear(this.containerViewChild.nativeElement),this.clearSubscription&&this.clearSubscription.unsubscribe(),this.destroyStyle(),super.ngOnDestroy()}static \u0275fac=(()=>{let t;return function(n){return(t||(t=St(e)))(n||e)}})();static \u0275cmp=I({type:e,selectors:[["p-toast"]],contentQueries:function(i,n,s){if(i&1&&(oe(s,To,5),oe(s,Mo,5),oe(s,Dn,4)),i&2){let h;It(h=Pt())&&(n.template=h.first),It(h=Pt())&&(n.headlessTemplate=h.first),It(h=Pt())&&(n.templates=h)}},viewQuery:function(i,n){if(i&1&&Le(ci,5),i&2){let s;It(s=Pt())&&(n.containerViewChild=s.first)}},inputs:{key:"key",autoZIndex:[2,"autoZIndex","autoZIndex",re],baseZIndex:[2,"baseZIndex","baseZIndex",jt],life:[2,"life","life",jt],style:"style",styleClass:"styleClass",position:"position",preventOpenDuplicates:[2,"preventOpenDuplicates","preventOpenDuplicates",re],preventDuplicates:[2,"preventDuplicates","preventDuplicates",re],showTransformOptions:"showTransformOptions",hideTransformOptions:"hideTransformOptions",showTransitionOptions:"showTransitionOptions",hideTransitionOptions:"hideTransitionOptions",breakpoints:"breakpoints"},outputs:{onClose:"onClose"},features:[Ut([Me]),ct],decls:3,vars:7,consts:[["container",""],[3,"ngClass","ngStyle"],[3,"message","index","life","template","headlessTemplate","showTransformOptions","hideTransformOptions","showTransitionOptions","hideTransitionOptions","onClose",4,"ngFor","ngForOf"],[3,"onClose","message","index","life","template","headlessTemplate","showTransformOptions","hideTransformOptions","showTransitionOptions","hideTransitionOptions"]],template:function(i,n){i&1&&(o(0,"div",1,0),g(2,Oo,1,10,"p-toastItem",2),r()),i&2&&(ne(n.style),dt(n.styleClass),l("ngClass",n.cx("root"))("ngStyle",n.sx("root")),a(2),l("ngForOf",n.messages))},dependencies:[J,yt,U,rn,Fo,je],encapsulation:2,data:{animation:[Ue("toastAnimation",[pe(":enter, :leave",[hn("@*",un())])])]},changeDetection:0})}return e})();var Vo=()=>({"--p-toast-width":"375px !important"});function No(e,c){e&1&&_(0,"i",4)}function Ao(e,c){e&1&&_(0,"i",5)}function Ro(e,c){e&1&&_(0,"i",6)}function $o(e,c){if(e&1){let t=S();o(0,"button",16),f("click",function(){m(t);let n=p(2);return u(n.copyToClipboard())}),d(1),r()}if(e&2){let t=p(2);a(),v(" ",t.copyText()," ")}}function Lo(e,c){if(e&1){let t=S();o(0,"div",2)(1,"div",3),g(2,No,1,0,"i",4)(3,Ao,1,0,"i",5)(4,Ro,1,0,"i",6),r(),o(5,"div",7)(6,"div",8)(7,"span",9),d(8),r()(),o(9,"div",10),_(10,"app-channel-logo",11),o(11,"div",12),d(12),r()(),o(13,"div",12),_(14,"span",13),r(),o(15,"div",14),g(16,$o,2,1,"button",15),o(17,"button",16),f("click",function(){m(t);let n=p();return u(n.navigateToNotificationPage())}),d(18," Notification "),r()()()()}if(e&2){let t,i=c.$implicit;a(2),M((t=i.severity)==="info"?2:t==="success"?3:t==="error"?4:-1),a(6),V(i.text),a(2),l("showChannelName",!1)("width",14)("height",14)("typeId",i==null||i.data==null?null:i.data.channelTypeId),a(2),V(i==null||i.data==null?null:i.data.channelName),a(2),l("innerHTML",i.detail,ee),a(2),M(i.severity=="info"?16:-1)}}var Oe=(()=>{class e{constructor(){this.toastr=$(me),this.messageService=$(Wt),this.router=$(it),this.jobId=z(null),this.copyText=z("Copy"),this.key=z(0),this.stringKey=an(()=>JSON.stringify(this.key())),this.listenOnShowToast()}listenOnShowToast(){this.toastr.onShowToast$.pipe(_n()).subscribe(t=>{this.copyText.set("Copy"),this.jobId.set(t?.data?.jobId),this.messageService.add(t)})}copyToClipboard(){navigator.clipboard.writeText(this.jobId()).then(()=>{this.copyText.set("Copied")})}navigateToNotificationPage(){this.router.navigate(["/menu/products/status/notificationV2"]),this.messageService.clear()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=I({type:e,selectors:[["scan-channel-toastr"]],features:[Ut([Wt])],decls:3,vars:4,consts:[["message",""],["position","top-right",1,"p-toast-custom",3,"baseZIndex"],[1,"d-flex","align-items-start","gap-3","flex-fill"],[1,"pt-2"],[1,"fa-solid","fa-circle-info","info-icon-color","fs-4"],[1,"fa-solid","fa-circle-check","success-icon-color","fs-4"],[1,"fa-solid","fa-circle-xmark","error-icon-color","fs-4"],[1,"d-flex","flex-column","align-items-start","flex-fill","gap-1"],[1,"d-flex","align-items-center","gap-2","flex-fill"],[1,"fw-bold","fs-4"],[1,"fs-6","d-flex","align-items-center","mt-1"],[3,"showChannelName","width","height","typeId"],[1,"opacity-75"],[3,"innerHTML"],[1,"d-flex","align-items-center","gap-8","mt-2",2,"font-size","12px"],[1,"btn","btn-icon-only","fw-medium"],[1,"btn","btn-icon-only","fw-medium",3,"click"]],template:function(i,n){i&1&&(o(0,"p-toast",1),g(1,Lo,19,9,"ng-template",null,0,H),r()),i&2&&(ne(xt(3,Vo)),l("baseZIndex",5e3))},dependencies:[pi,kn],styles:[`.p-toast-custom .p-toast-message.p-toast-message-info,.p-toast-custom .p-toast-message.p-toast-message-success,.p-toast-custom .p-toast-message.p-toast-message-error{background-color:#fff!important;color:#000}.p-toast-custom .p-toast-message.p-toast-message-info{border-left:8px solid #0078d4!important}.p-toast-custom .p-toast-message.p-toast-message-success{border-left:8px solid #28a745!important}.p-toast-custom .p-toast-message.p-toast-message-error{border-left:8px solid #dc3545!important}.info-icon-color{color:#0078d4!important}.success-icon-color{color:#28a745!important}.error-icon-color{color:#dc3545!important}
257
+ `],encapsulation:2})}}return e})();var Ze=e=>[e];function Bo(e,c){if(e&1){let t=S();o(0,"button",15),f("click",function(){m(t);let n=p(2);return u(n.onDetachMultipleProduct())}),_(1,"i",16),d(2),r()}if(e&2){let t,i=p(2);a(2),v("Detach (",(t=i.productService.selectedProduct(i.products))==null?null:t.length,") ")}}function jo(e,c){if(e&1&&(y(0),g(1,Bo,3,1,"button",14),b()),e&2){let t=p();a(),M(t.productService.hasSelection(t.products)?1:-1)}}function Wo(e,c){if(e&1){let t=S();o(0,"div",17)(1,"button",19),f("click",function(){m(t);let n=p(2);return u(n.onScanAllProducts())}),_(2,"i",20),d(3," Scan Channel "),r(),_(4,"button",21),o(5,"ul",22)(6,"li")(7,"a",23),f("click",function(){m(t);let n=p(2);return u(n.onScanAllV2Products())}),_(8,"i",20),d(9," Scan Channel V2 "),r()()()()}}function zo(e,c){if(e&1){let t=S();o(0,"button",24),f("click",function(){m(t);let n=p(2);return u(n.onScanMultipleProduct())}),_(1,"i",20),d(2),r()}if(e&2){let t=p(2);a(2),v(" Scan (",t.productService.selectedProduct(t.products).length,") ")}}function Ho(e,c){if(e&1&&(y(0),g(1,Wo,10,0,"div",17)(2,zo,3,1,"button",18),b()),e&2){let t=p();a(),M(t.productService.hasSelection(t.products)?t.multipeScanChannels.length>0&&t.productService.hasSelection(t.products)?2:-1:1)}}function Go(e,c){if(e&1){let t=S();o(0,"button",26),f("click",function(){m(t);let n=p(2);return u(n.onUploadMultipleProduct())}),_(1,"i",27),d(2),r()}if(e&2){let t=p(2);a(2),v(" Upload (",t.productService.selectedProduct(t.products).length,") ")}}function Ko(e,c){if(e&1&&(y(0),g(1,Go,3,1,"button",25),b()),e&2){let t=p();a(),M(t.productService.hasSelection(t.products)?1:-1)}}function Zo(e,c){if(e&1){let t=S();o(0,"div",4)(1,"label",2),d(2,"Item ID"),r(),o(3,"input",28),E("ngModelChange",function(n){m(t);let s=p();return k(s.searchFilter.Item_id,n)||(s.searchFilter.Item_id=n),u(n)}),r()()}if(e&2){let t=p();a(3),D("ngModel",t.searchFilter.Item_id)}}function Jo(e,c){if(e&1){let t=S();o(0,"div",29)(1,"app-product-card",30),f("onUpload",function(){let n=m(t).$implicit,s=p();return u(s.onUploadToMultipleChannel(n))})("onDescEvent",function(){let n=m(t).index,s=p();return u(s.onOpenVariantDetail(n))})("onScan",function(){let n=m(t).$implicit,s=p();return u(s.onScanSingleProduct(n))})("onCheckBoxChange",function(n){let s=m(t).$implicit;return u(s.selected=n)})("onDetach",function(){let n=m(t).$implicit,s=p();return u(s.onDetachProduct([n]))}),r()()}if(e&2){let t=c.$implicit,i=p();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",i.productService.getChannelProduct(t))("code",i.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 Qo(e,c){e&1&&(y(0),o(1,"div",31),_(2,"app-empty-state"),r(),b())}function Yo(e,c){if(e&1){let t=S();o(0,"div",32)(1,"div",33)(2,"app-custom-paginator",34),f("total",function(){m(t);let n=p();return u(n.getRowCount())})("next",function(){m(t);let n=p();return u(n.getProducts())})("previous",function(){m(t);let n=p();return u(n.getProducts())}),r()()()}if(e&2){let t=p();a(2),l("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",t.hasClickRowCount)}}var mi=(()=>{class e{constructor(t,i,n,s,h,w,ft,Jt,ke){this.http=t,this.dialog=i,this.toastr=n,this.productService=s,this.activateRouter=h,this.authService=w,this.route=ft,this.uploadProductService=Jt,this.scanChannelToastr=ke,this.searchFilter=new ht,this.products=[],this.rowCount=0,this.hasClickRowCount=!1,this.guidEmpty=C.GuidEMpty,this.multipeScanChannels=[],this.filterOptions=z({SearchComparatorTypeOptions:[],SearchSKUOnlyOrSKUNameOptions:[]}),this.searchPlaceholder=z("Search ..."),this.scanProductRole=B.ProductScan,this.uploadProductRole=B.ProductUpload,this.detachProductRole=B.ProductDetach,this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(C.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(i=>{this.filterOptions.set(i.Options),this.searchFilter=i.Filter,i.Filter.ChannelID!=C.GuidEMpty&&(this.searchFilter.ListChannelID=[],this.searchFilter.ListChannelID.push(i.Filter.ChannelID)),this.searchFilter.PageSize=i.Filter?.RowCount,this.getProducts(),this.onChangeSearchType()})}onChangeSearchType(){let t=this.searchFilter.SearchType,i=this.searchFilter.NumberFilterComparator,n="Search ...";switch(t){case xe.SkuAndName:n="SKU / Name";break;case xe.SKUOnly:n="SKU";break;case xe.NameOnly:n="Name";break}switch(i){case zt.StartsWith:n=`${n} Starts With`;break;case zt.EndsWith:n=`${n} Ends With`;break;case zt.Contains:n=`${n} Contains`;break;case zt.Is:n=`${n} Is`;break}this.searchPlaceholder.set(n)}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[T.Tokopedia,T.Tiktok])}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,NumberFilterComparator:this.searchFilter.NumberFilterComparator,SearchType:this.searchFilter.SearchType};this.productService.findAllSoldInChannel(t).subscribe(i=>{this.products=i.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(),this.onChangeSearchType()}onOpenVariantDetail(t){let i=this.products[t].Variants;this.dialog.open(ve,{data:{variants:i,title:this.products[t].Name}})}onScanAllProducts(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=C.GuidEMpty,this.dialog.open(W,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(F(n=>C.IsNotEmpty(n))).subscribe(n=>{this.searchFilter.ChannelID=n.ChannelID,this.searchFilter.ScanFull=n.ScanFull,this.searchFilter.UpdatedProduct=n.UpdatedProduct,this.searchFilter.Async=n.Async,this.scanAllProduct()})}onScanAllV2Products(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=C.GuidEMpty,this.dialog.open(W,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(F(i=>C.IsNotEmpty(i)),$t(i=>this.productService.scanProductV2(i.ChannelID,i.ScanFull,i.UpdatedProduct,i.Async))).subscribe(()=>{this.initPageLoader(C.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(i=>i)).subscribe(i=>{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(i,t,!this.searchFilter.UpdatedProduct),this.initPageLoader(C.GuidEMpty))})}onScanSingleProduct(t){t.Channel=this.productService.getChannelProduct(t);let i=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(W,{data:{filter:i,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(F(n=>C.IsNotEmpty(n))).subscribe(n=>{this.searchFilter.ChannelID=n.ChannelID;let s=this.productService.getVariantCodesProduct(t);this.scanProducts(s)})}onUploadToMultipleChannel(t){this.uploadProductService.setSelectedProduct([t]),this.route.navigate(["/menu/products/upload"])}onScanMultipleProduct(){this.searchFilter.ChannelID=C.GuidEMpty;let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(W,{data:{filter:t,channelOptions:this.multipeScanChannels,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(F(n=>C.IsNotEmpty(n))).subscribe(n=>{this.searchFilter.ChannelID=n.ChannelID,this.searchFilter.ScanFull=n.ScanFull,this.searchFilter.UpdatedProduct=n.UpdatedProduct;let s=this.productService.selectedProduct(this.products),h=this.productService.getVariantCodesProducts(s);this.scanProducts(h)})}scanProducts(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:i=>{let n=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);i?this.toastr.success(`Product Successfully scan with ${n?.Name}`,"Success"):this.toastr.error(`This product is not existed in ${n?.Name} `,"Error"),this.searchFilter.ChannelID=C.GuidEMpty,i&&this.getProducts()},error:i=>{this.searchFilter.ChannelID=C.GuidEMpty}})}getVariantCode(t){let i;return t.length>1&&(i=(t[0].model?t[0].model:"")+t[0].Code),t.length==1&&(i=t[0].Code),i}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(i=>{this.hasClickRowCount=!0,this.rowCount=i.Total})}onDetachProduct(t){let i=[];t.forEach(n=>{n.Channel=C.assignChannelLogo(n.Channel),i.push(...n.Channel)}),this.dialog.open(Rt,{width:"600px",data:[...i]}).afterClosed().pipe(F(n=>C.IsNotEmpty(n)),$t(n=>this.productService.detachProduct(n))).subscribe(n=>{this.toastr.success(n.Message,ue.Success),this.getProducts()})}onDetachMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.onDetachProduct(t)}static{this.\u0275fac=function(i){return new(i||e)(x(Z),x(rt),x(Y),x(et),x(le),x(at),x(it),x(Nt),x(me))}}static{this.\u0275cmp=I({type:e,selectors:[["app-sold-in-channel"]],standalone:!1,decls:27,vars:21,consts:[["description","SKU has been mapped between dealpos and marketplace",3,"onSubmit","headerTitle","searchBoxPlaceHolder"],[4,"ngxPermissionsOnly"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],["bindLabel","Value","bindValue","Key","placeholder","Number Filter Comparator","name","numberFilterComparator","appendTo","body",3,"ngModelChange","items","ngModel"],[1,"mt-6"],[1,"border","border-1","rounded-1","p-4"],[3,"ngModelChange","options","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"],["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"],["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(i,n){i&1&&(o(0,"mainpanel",0),f("onSubmit",function(h){return n.searchProduct(h)}),o(1,"actions"),g(2,jo,2,1,"ng-container",1)(3,Ho,3,1,"ng-container",1)(4,Ko,2,1,"ng-container",1),r(),o(5,"filters")(6,"div")(7,"label",2),d(8,"Channel"),r(),o(9,"app-channel-options-v2",3),E("ngModelChange",function(h){return k(n.searchFilter.ListChannelID,h)||(n.searchFilter.ListChannelID=h),h}),r()(),g(10,Zo,4,1,"div",4),o(11,"div",4)(12,"label",2),d(13,"Number Filter Comparator"),r(),o(14,"ng-select",5),E("ngModelChange",function(h){return k(n.searchFilter.NumberFilterComparator,h)||(n.searchFilter.NumberFilterComparator=h),h}),r()(),o(15,"div",6)(16,"label",2),d(17,"Search Type"),r(),o(18,"div",7)(19,"lib-radio-options",8),E("ngModelChange",function(h){return k(n.searchFilter.SearchType,h)||(n.searchFilter.SearchType=h),h}),r()()()(),o(20,"content"),_(21,"scan-channel-toastr"),o(22,"div",9)(23,"div",10),g(24,Jo,2,11,"div",11)(25,Qo,3,0,"ng-container",12),r(),g(26,Yo,3,4,"div",13),r()()()),i&2&&(l("headerTitle","Sold in Channel")("searchBoxPlaceHolder",n.searchPlaceholder()),a(2),l("ngxPermissionsOnly",P(15,Ze,n.detachProductRole)),a(),l("ngxPermissionsOnly",P(17,Ze,n.scanProductRole)),a(),l("ngxPermissionsOnly",P(19,Ze,n.uploadProductRole)),a(5),l("multiple",!0),D("ngModel",n.searchFilter.ListChannelID),a(),M(n.searchFilter.ListChannelID!=null?10:-1),a(4),l("items",n.filterOptions().SearchComparatorTypeOptions),D("ngModel",n.searchFilter.NumberFilterComparator),a(5),l("options",n.filterOptions().SearchSKUOnlyOrSKUNameOptions),D("ngModel",n.searchFilter.SearchType),a(5),l("ngForOf",n.products),a(),l("ngIf",n.products.length==0),a(),l("ngIf",n.products==null?null:n.products.length))},dependencies:[U,A,Ot,G,K,tt,de,lt,_t,nt,ot,ye,Oe,gt],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 e})();var ui=(()=>{class e{get footerPageNumber(){return this._footerPageNumber}set footerPageNumber(t){this._footerPageNumber=t}get hideCount(){return this._hideCount}set hideCount(t){this._hideCount=t}get disableNextButton(){return this._disableNextButton}set disableNextButton(t){this._disableNextButton=t}get goToLastPage(){return this._goToLastPage}set goToLastPage(t){this._goToLastPage=t}constructor(t){this.http=t,this.pagination$=new Ee(null),this.destroy$=new Qt,this.data$=this.paginationFunction()}onNextPage(t){t.PageNumber+=1,this.pagination$.next(t)}setPageNumberFooter(t){this.footerPageNumber=t.PageNumber}setPaginationButtonState(t,i){i==0?this.disableNextButton=!0:this.disableNextButton=!(i<t.RowCount*t.PageNumber)}reloadPagination(t){C.IsEmpty(t.PageNumber)&&(t.PageNumber=1),this.pagination$.next(t),this.hideCount=!0,this.goToLastPage=!1}getAllData(t,i){t.RowCount=i,this.pagination$.next(t),this.goToLastPage=!0}destroy(){this.destroy$.next(!0),this.destroy$.complete(),this.pagination$=null,this.pagination$=new Ee(null),this.data$=this.paginationFunction()}paginationFunction(){return this.pagination$.pipe(Lt(this.destroy$),F(t=>t!=null),Qe(t=>this.http.post(`/API/${this.fetchDataEndpoint}`,JSON.stringify(t)).pipe(Ct(i=>i.Data))),qe(this.pagination$),Ye((t,i)=>{let[n,s]=t,[h]=i;return s.PageNumber==1?[h,s]:[n.concat(h),s]}),qt(([t,i])=>{this.setPageNumberFooter(i),this.setPaginationButtonState(i,t.length)}),Ct(([t])=>t),Yt())}static{this.\u0275fac=function(i){return new(i||e)(Xe(Z))}}static{this.\u0275prov=Xt({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var De=e=>[e];function Xo(e,c){if(e&1){let t=S();o(0,"button",12),f("click",function(){m(t);let n=p(3);return u(n.uploadMultipleProduct())}),_(1,"i",13),d(2),r()}if(e&2){let t=p(3);a(2),v(" upload (",t.selectedProducts==null?null:t.selectedProducts.length,") ")}}function ta(e,c){if(e&1&&(y(0),g(1,Xo,3,1,"button",11),b()),e&2){let t=p(2);a(),l("ngIf",t.hasSelectionProduct)}}function ea(e,c){if(e&1){let t=S();y(0),o(1,"button",14),f("click",function(){m(t);let n=p(2);return u(n.openScanDialog())}),_(2,"i",15),d(3," Scan Channel "),r(),b()}}function na(e,c){e&1&&(y(0),_(1,"th",23),b())}function ia(e,c){if(e&1){let t=S();y(0),o(1,"td",30)(2,"input",31),E("ngModelChange",function(n){m(t);let s=p(3).$implicit;return k(s.selected,n)||(s.selected=n),u(n)}),f("ngModelChange",function(){m(t);let n=p(4).ngIf,s=p(3);return u(s.onSelectProduct(n))}),r()(),b()}if(e&2){let t=p(3).$implicit;a(),l("rowSpan",t==null?null:t.Variants.length),a(),D("ngModel",t.selected)}}function oa(e,c){if(e&1&&(y(0),g(1,ia,3,2,"ng-container",10),b()),e&2){let t=p().index;a(),l("ngIf",t==0)}}function aa(e,c){if(e&1){let t=S();y(0),o(1,"img",36),f("click",function(n){m(t);let s=p(3).$implicit,h=p(4);return u(h.onZoomImage(n,s==null?null:s.ImageUrl))}),r(),b()}if(e&2){let t=p(3).$implicit;a(),l("src",t==null?null:t.ImageUrl,L)}}function ra(e,c){e&1&&_(0,"img",37)}function la(e,c){if(e&1&&(y(0),o(1,"td",30)(2,"div",32),g(3,aa,2,1,"ng-container",9)(4,ra,1,0,"ng-template",null,1,H),r()(),o(6,"td",33)(7,"h4",34)(8,"span",35),d(9),r()()(),b()),e&2){let t=Q(5),i=p(2).$implicit;a(),l("rowSpan",i==null?null:i.Variants.length),a(2),l("ngIf",i==null?null:i.ImageUrl)("ngIfElse",t),a(3),l("rowSpan",i==null?null:i.Variants.length),a(2),l("matTooltip",(i==null||i.Name==null?null:i.Name.length)>50?i==null?null:i.Name:""),a(),v(" ",i==null?null:i.Name," ")}}function sa(e,c){if(e&1&&(o(0,"div")(1,"a",26),_(2,"img",38),r()()),e&2){let t=c.$implicit;a(),l("href",t.URL,L),a(),l("src",t.Img,L)("matTooltip",t.Name)}}function ca(e,c){if(e&1&&(o(0,"div"),_(1,"img",38),r()),e&2){let t=c.$implicit;a(),l("src",t.Img,L)("matTooltip",t.Name)}}function pa(e,c){if(e&1&&(o(0,"tr"),g(1,oa,2,1,"ng-container",4)(2,la,10,6,"ng-container",10),o(3,"td"),d(4),r(),o(5,"td")(6,"span"),d(7),r(),o(8,"span",25)(9,"a",26),_(10,"i",27),r()()(),o(11,"td",28)(12,"div",29),g(13,sa,3,3,"div",24),r()(),o(14,"td",28)(15,"div",29),g(16,ca,2,2,"div",24),r()()()),e&2){let t=c.$implicit,i=c.index,n=p(5);a(),l("ngxPermissionsOnly",P(7,De,n.uploadProductRole)),a(),l("ngIf",i==0),a(2),v(" ",t.Name," "),a(3),v(" ",t.Code," "),a(2),l("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),L),a(4),l("ngForOf",t==null?null:t.Available),a(3),l("ngForOf",t==null?null:t.NotAvailable)}}function da(e,c){if(e&1&&(y(0),g(1,pa,17,9,"tr",24),b()),e&2){let t=c.$implicit;a(),l("ngForOf",t.Variants)}}function ma(e,c){if(e&1&&(o(0,"tbody"),g(1,da,2,1,"ng-container",24),r()),e&2){let t=c.ngIf;a(),l("ngForOf",t)}}function ua(e,c){if(e&1&&(y(0),o(1,"div",16)(2,"table",17)(3,"thead",18)(4,"tr"),g(5,na,2,0,"ng-container",4),o(6,"th",19),d(7," Product "),r(),o(8,"th",20),d(9,"Variant"),r(),o(10,"th",20),d(11,"SKU"),r(),o(12,"th",21),d(13,"Available In"),r(),o(14,"th",22),d(15,"Not Available In"),r()()(),g(16,ma,2,1,"tbody",10),N(17,"async"),r()(),b()),e&2){let t=p(2);a(5),l("ngxPermissionsOnly",P(4,De,t.uploadProductRole)),a(11),l("ngIf",R(17,2,t.data$))}}function ha(e,c){e&1&&(o(0,"div",39),_(1,"app-empty-state"),r())}function _a(e,c){if(e&1){let t=S();o(0,"span",47),f("click",function(){m(t);let n=p(4);return u(n.getRowCount())}),o(1,"i",48),d(2,"?"),r()()}}function ga(e,c){if(e&1&&(o(0,"span"),d(1),N(2,"number"),r()),e&2){let t=c.ngIf;a(),V(R(2,1,t==null?null:t.Count))}}function fa(e,c){if(e&1){let t=S();o(0,"a",49),f("click",function(){m(t);let n=p(4);return u(n.onNextPage())}),_(1,"i",50),d(2," Next"),r()}}function Ca(e,c){if(e&1){let t=S();o(0,"a",51),f("click",function(){m(t);let n=p(4);return u(n.onLastPage())}),_(1,"i",52),d(2," Last"),r()}}function Sa(e,c){if(e&1&&(y(0),o(1,"div",40)(2,"div",41)(3,"div",42),d(4),N(5,"number"),g(6,_a,3,0,"span",43)(7,ga,3,3,"span",10),N(8,"async"),d(9),r()(),o(10,"div",44),g(11,fa,3,0,"a",45)(12,Ca,3,0,"a",46),r()(),b()),e&2){let t=p().ngIf,i=p(2);a(4),v(" Showing 1 - ",R(5,6,t==null?null:t.length)," of "),a(2),l("ngIf",i.paginationService.hideCount),a(),l("ngIf",!i.paginationService.hideCount&&R(8,8,i.rowCount$)),a(2),v(" records ~ ",i.paginationService.footerPageNumber," Page "),a(2),l("ngIf",i.paginationService.disableNextButton&&!i.paginationService.goToLastPage),a(),l("ngIf",i.paginationService.disableNextButton&&!i.paginationService.goToLastPage)}}function xa(e,c){if(e&1&&(y(0),g(1,Sa,13,10,"ng-container",10),b()),e&2){let t=c.ngIf;a(),l("ngIf",(t==null?null:t.length)>0)}}function ya(e,c){if(e&1){let t=S();o(0,"mainpanel",3),f("onSubmit",function(n){m(t);let s=p();return u(s.searchProduct(n))}),o(1,"actions"),g(2,ta,2,1,"ng-container",4)(3,ea,4,0,"ng-container",4),o(4,"button",5),f("click",function(){m(t);let n=p();return u(n.openExportDialog())}),_(5,"i",6),o(6,"span"),d(7,"Export"),r()()(),o(8,"content")(9,"div",7)(10,"div",8),g(11,ua,18,6,"ng-container",9),N(12,"async"),g(13,ha,2,0,"ng-template",null,0,H),r(),g(15,xa,2,1,"ng-container",10),N(16,"async"),r()()()}if(e&2){let t,i=Q(14),n=p();l("hideSearchDropdown",!0),a(2),l("ngxPermissionsOnly",P(10,De,n.uploadProductRole)),a(),l("ngxPermissionsOnly",P(12,De,n.scanProductRole)),a(8),l("ngIf",((t=R(12,6,n.data$))==null?null:t.length)>0)("ngIfElse",i),a(4),l("ngIf",R(16,8,n.data$))}}var hi=(()=>{class e{constructor(t,i,n,s,h,w,ft,Jt,ke){this.http=t,this.dialog=i,this.toastr=n,this.route=s,this.productService=h,this.paginationService=w,this.biggerPictureService=ft,this.authService=Jt,this.uploadProductService=ke,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannelV2",this.hasSelectionProduct=!1,this.selectedProducts=[],this.scanProductRole=B.ProductScan,this.uploadProductRole=B.ProductUpload,this.channelOptions=Jt.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(qt(t=>{this.filterSearch=t.Filter,this.paginationService.reloadPagination(t.Filter)}))}iniData(){this.data$=this.paginationService.data$.pipe(Ct(t=>(t=t.map(i=>(i.Variants=i.Variants.map(n=>(n.Available=this.productService.sortChannel(n.Available),n.NotAvailable=this.productService.sortChannel(n.NotAvailable),n.Available=this.assignLogoChannel(n.Available),n.NotAvailable=this.assignLogoChannel(n.NotAvailable),n)),i.Channel=i?.Variants[0]?.Available,i)),t)))}assignLogoChannel(t){return t=t.map(i=>(i.Img=C.getChannelLogoByTypeId(i.TypeID),i)),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(i=>{this.filterSearch.Async?this.toastr.success("You will be notified when the scan is completed.","Scan Asynchronous"):(this.productService.successToastrScanAllProduct(i,t,!this.filterSearch.UpdatedProduct),this.initPageLoader())})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.filterSearch));t.ChannelID=C.GuidEMpty,this.dialog.open(W,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(F(n=>C.IsNotEmpty(n))).subscribe(n=>{this.filterSearch.ChannelID=n.ChannelID,this.filterSearch.ScanFull=n.ScanFull,this.filterSearch.UpdatedProduct=n.UpdatedProduct,this.filterSearch.Async=n.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,i){this.biggerPictureService.openBiggerPicture(t,i)}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(Xn,{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(i){return new(i||e)(x(Z),x(rt),x(Y),x(it),x(et),x(ui),x(Kn),x(at),x(Nt))}}static{this.\u0275cmp=I({type:e,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(i,n){i&1&&(g(0,ya,17,14,"mainpanel",2),N(1,"async")),i&2&&l("ngIf",R(1,1,n.loader$))},dependencies:[U,A,dn,G,K,tt,mt,nt,ot,Tt,Mt],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 e})();var Je=e=>[e],ba=()=>[];function va(e,c){if(e&1){let t=S();o(0,"button",15),f("click",function(){m(t);let n=p(2);return u(n.openScanDialog())}),_(1,"i",16),d(2," Scan Channel "),r()}}function wa(e,c){if(e&1&&(y(0),g(1,va,3,0,"button",14),b()),e&2){let t=p();a(),M(t.productService.hasSelection(t.products)?-1:1)}}function Ia(e,c){if(e&1){let t=S();o(0,"button",18),f("click",function(){m(t);let n=p(2);return u(n.onDownloadAllProduct("SELECTED"))}),_(1,"i",19),d(2),r()}if(e&2){let t,i=p(2);a(2),v(" Download (",(t=i.productService.selectedProduct(i.products))==null?null:t.length,") ")}}function Pa(e,c){if(e&1&&(y(0),g(1,Ia,3,1,"button",17),b()),e&2){let t=p();a(),M(t.productService.hasSelection(t.products)?1:-1)}}function Ta(e,c){if(e&1){let t=S();o(0,"div",20)(1,"app-product-card",21),f("onCheckBoxChange",function(n){let s=m(t).index,h=p();return u(h.onSelectProduct(n,s))})("onDescEvent",function(){let n=m(t).index,s=p();return u(s.onShowVariantDetail(n))})("onDownload",function(){let n=m(t).$implicit,s=p();return u(s.onDownloadProduct(n))})("onScan",function(){let n=m(t).$implicit,s=p();return u(s.onScanChannel(n))}),r()()}if(e&2){let t=c.$implicit,i=p();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?P(10,Je,t==null?null:t.Channel):xt(12,ba))("showCheckBox",i.hasDownloadRole())("scanButton",!0)}}function Ma(e,c){e&1&&(y(0),o(1,"div",22),_(2,"app-empty-state"),r(),b())}function Oa(e,c){if(e&1){let t=S();o(0,"div",23)(1,"div",24)(2,"app-custom-paginator",25),f("total",function(){m(t);let n=p();return u(n.getRowCount())})("next",function(){m(t);let n=p();return u(n.getProducts())})("previous",function(){m(t);let n=p();return u(n.getProducts())}),r()()()}if(e&2){let t=p();a(2),l("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",t.hasClickRowCount)}}var _i=(()=>{class e{constructor(t,i,n,s,h,w){this.http=t,this.dialog=i,this.productService=n,this.toastrService=s,this.activateRouter=h,this.authService=w,this.permissionService=$(gn),this.searchFilter=new ht,this.products=[],this.hasClickRowCount=!1,this.scanProductRole=B.ProductScan,this.downloadProductRole=B.ProductDownload,this.hasDownloadRole=z(!0),this.channelOptions=this.authService.getChannels(),this.permissionService.hasPermission(this.downloadProductRole).then(ft=>{this.hasDownloadRole.set(ft)})}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(C.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(i=>{this.searchFilter=i.Filter,this.searchFilter.PageSize=i.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(i=>(t=this.channelOptions.find(n=>n.ID==i.ChannelID),t?i.Channel=JSON.parse(JSON.stringify(t)):i.Channel=null,i)).map(i=>(i.Channel&&(i.Channel.Url=i.Url),i))}setSkuProduct(){this.products=this.products.map(t=>(t?.Variant?.length==0?C.IsNotEmpty(t?.ChannelItemSKU)?t.SKU=t?.ChannelItemSKU:t.SKU="SKU not assigned":t.SKU=t?.Variant[0]?.ChannelVariationSKU?t?.Variant[0]?.ChannelVariationSKU:"SKU not assigned",t))}onSearch(t){this.searchFilter.text=t,this.hasClickRowCount=!1,this.getProducts()}onClearChannelFilter(){this.searchFilter.ChannelID=C.GuidEMpty}onScanAll(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(i=>{this.searchFilter.Async?this.toastrService.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.initPageLoader(C.GuidEMpty),this.productService.successToastrScanAllProduct(i,t,!this.searchFilter.UpdatedProduct)),this.searchFilter.ChannelID=C.GuidEMpty})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=C.GuidEMpty,this.dialog.open(W,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(F(n=>C.IsNotEmpty(n))).subscribe(n=>{this.searchFilter.ChannelID=n.ChannelID,this.searchFilter.UpdatedProduct=n.UpdatedProduct,this.searchFilter.ScanFull=n.ScanFull,this.searchFilter.Async=n.Async,this.onScanAll()})}onDownloadAllProduct(t){let i;t=="ALL"?i=this.products:i=this.productService.selectedProduct(this.products),i.length>0&&this.productService.downloadMultipleProduct(i).subscribe({next:()=>{this.getProducts()}})}onSelectProduct(t,i){this.products[i].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 i=JSON.parse(JSON.stringify(t));delete i.Channel,this.productService.scanCompareToPos([i]).subscribe(n=>{n.Status?(this.initPageLoader(C.GuidEMpty),this.toastrService.success(`product ${t.Name} have been successfully scanned and synchronized with POS`,"Success")):this.toastrService.error(`Product ${t.Name} is not existed in POS`,"Error")})}onShowVariantDetail(t){let i=this.products[t].Variant;i.length>0&&this.dialog.open(ti,{data:{title:this.products[t].Name,variants:i},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(i=>{this.hasClickRowCount=!0,this.rowCount=i.Count})}static{this.\u0275fac=function(i){return new(i||e)(x(Z),x(rt),x(et),x(Y),x(le),x(at))}}static{this.\u0275cmp=I({type:e,selectors:[["app-not-in-pos"]],standalone:!1,decls:29,vars:15,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"],[3,"ngModelChange","ngModel"],[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,"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(i,n){i&1&&(o(0,"mainpanel",0),f("onSubmit",function(h){return n.onSearch(h)}),o(1,"actions"),g(2,wa,2,1,"ng-container",1)(3,Pa,2,1,"ng-container",1),r(),o(4,"filters")(5,"div")(6,"label",2),d(7,"Channel"),r(),o(8,"app-channel-options-v2",3),E("ngModelChange",function(h){return k(n.searchFilter.ChannelID,h)||(n.searchFilter.ChannelID=h),h}),r()(),o(9,"div",4)(10,"label",5),d(11,"SKU Assigned"),r(),o(12,"mat-radio-group",6),E("ngModelChange",function(h){return k(n.searchFilter.HaveSku,h)||(n.searchFilter.HaveSku=h),h}),o(13,"mat-radio-button",7),d(14," All "),r(),o(15,"mat-radio-button",7),d(16," Yes "),r(),o(17,"mat-radio-button",7),d(18," No "),r()()(),o(19,"div",4)(20,"label",5),d(21,"Item ID"),r(),o(22,"input",8),E("ngModelChange",function(h){return k(n.searchFilter.Item_id,h)||(n.searchFilter.Item_id=h),h}),r()()(),o(23,"content")(24,"div",9)(25,"div",10),g(26,Ta,2,13,"div",11)(27,Ma,3,0,"ng-container",12),r(),g(28,Oa,3,4,"div",13),r()()()),i&2&&(a(2),l("ngxPermissionsOnly",P(11,Je,n.scanProductRole)),a(),l("ngxPermissionsOnly",P(13,Je,n.downloadProductRole)),a(5),D("ngModel",n.searchFilter.ChannelID),a(4),D("ngModel",n.searchFilter.HaveSku),a(),l("value",0),a(2),l("value",1),a(2),l("value",2),a(5),D("ngModel",n.searchFilter.Item_id),a(4),l("ngForOf",n.products),a(),l("ngIf",n.products.length==0),a(),l("ngIf",(n.products==null?null:n.products.length)>0))},dependencies:[U,A,Ot,G,K,tt,Ce,Se,lt,_t,nt,ot,gt],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 e})();function Da(e,c){if(e&1&&(o(0,"div",10),_(1,"app-duplicate-product-card",11),r()),e&2){let t=c.$implicit,i=c.index;a(),l("imageForZoom",t.ImageUrl)("title",t.Name)("code",t.Code)("id",i)("image",t.ThumbnailURL)("channels",t.Channels)("totalChannel",t.Total)}}function ka(e,c){e&1&&(y(0),o(1,"div",12),_(2,"app-empty-state"),r(),b())}function Ea(e,c){if(e&1){let t=S();y(0),o(1,"div",13)(2,"div",14)(3,"app-custom-paginator",15),f("next",function(){m(t);let n=p();return u(n.getProducts())})("previous",function(){m(t);let n=p();return u(n.getProducts())})("total",function(){m(t);let n=p();return u(n.getRowCount())}),r()()(),b()}if(e&2){let t=p();a(3),l("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",t.hasClickedRowCount)}}var gi=(()=>{class e{constructor(t,i){this.httpService=t,this.productService=i,this.searchFilter=new ht,this.products=[],this.hasClickedRowCount=!1,this.getPageLoader()}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(i=>{this.products=i.Data})}onSearch(t){this.searchFilter.text=t,this.hasClickedRowCount=!1,this.getProducts()}onClearFilter(){this.searchFilter.ChannelID=C.GuidEMpty}getChannelLogo(t){return C.getChannelLogoByTypeId(t)}getRowCount(){let t={text:this.searchFilter.text,ChannelID:this.searchFilter.ChannelID};this.httpService.post("/api/product/GetDuplicateInChannelRowCount",t).subscribe(i=>{this.hasClickedRowCount=!0,this.rowCount=i.Total})}static{this.\u0275fac=function(i){return new(i||e)(x(Z),x(et))}}static{this.\u0275cmp=I({type:e,selectors:[["app-duplicate-sku"]],standalone:!1,decls:18,vars:5,consts:[["headerTitle","Multiple Listing","textButton"," Search","description","SKU(s) which is listed more than one time (one to many)",3,"onSubmit"],["routerLink","/menu/products/status/duplicate-sku/table",1,"btn","btn-outline-secondary","btn-lg","d-flex","align-items-center","gap-2"],[1,"fa-solid","fa-table"],["container",""],[1,"mb-2"],[3,"ngModelChange","multiple","ngModel"],[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,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"imageForZoom","title","code","id","image","channels","totalChannel"],[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(i,n){i&1&&(o(0,"mainpanel",0),f("onSubmit",function(h){return n.onSearch(h)}),o(1,"actions")(2,"a",1),_(3,"i",2),o(4,"span"),d(5,"Table View"),r()()(),o(6,"filters")(7,"div",3)(8,"div")(9,"h6",4),d(10,"Channel"),r(),o(11,"app-channel-options-v2",5),E("ngModelChange",function(h){return k(n.searchFilter.ListChannelID,h)||(n.searchFilter.ListChannelID=h),h}),r()()()(),o(12,"content")(13,"div",6)(14,"div",7),g(15,Da,2,7,"div",8)(16,ka,3,0,"ng-container",9),r(),g(17,Ea,4,4,"ng-container",9),r()()()),i&2&&(a(11),l("multiple",!0),D("ngModel",n.searchFilter.ListChannelID),a(4),l("ngForOf",n.products),a(),l("ngIf",(n.products==null?null:n.products.length)==0),a(),l("ngIf",(n.products==null?null:n.products.length)>0))},dependencies:[U,A,G,K,tt,be,lt,se,nt,gt],encapsulation:2})}}return e})();var Fa=()=>["/menu/products/status/sold-in-channel"],fi=e=>({ID:e}),Va=()=>["/menu/products/status/not-in-pos"],Na=e=>[e];function Aa(e,c){if(e&1&&(y(0),d(1),b()),e&2){let t=p().$implicit;a(),v(" ",t.Count," ")}}function Ra(e,c){if(e&1){let t=S();o(0,"span",25),f("click",function(){m(t);let n=p().$implicit,s=p(2);return u(s.getLiveProductCount(n.ID,n))}),_(1,"i",26),r()}}function $a(e,c){if(e&1){let t=S();y(0),o(1,"button",27),f("click",function(){m(t);let n=p().$implicit,s=p(2);return u(s.onScanChannel(n))}),_(2,"i",28),d(3," Scan "),r(),b()}}function La(e,c){if(e&1){let t=S();o(0,"tr")(1,"td"),_(2,"img",17),o(3,"span",18),d(4),r()(),o(5,"td",19),g(6,Aa,2,1,"ng-container",6)(7,Ra,2,0,"ng-template",null,1,H),r(),o(9,"td",19)(10,"a",20),d(11),N(12,"number"),r()(),o(13,"td",19)(14,"a",20),d(15),N(16,"number"),r()(),o(17,"td"),d(18),N(19,"date"),r(),o(20,"td")(21,"div",21),g(22,$a,4,0,"ng-container",22),o(23,"button",23),f("click",function(){let n=m(t).$implicit,s=p(2);return u(s.onClearCache(n.ID))}),_(24,"i",24),d(25," Clear "),r()()()()}if(e&2){let t=c.$implicit,i=Q(8),n=p(2);a(2),l("src",n.getChannelLogo(t.TypeID),L),a(2),V(t.Name),a(2),l("ngIf",t.Count!==void 0)("ngIfElse",i),a(4),l("routerLink",xt(19,Fa))("queryParams",P(20,fi,t.ID)),a(),v(" ",R(12,12,t.SoldInChannel)," "),a(3),l("routerLink",xt(22,Va))("queryParams",P(23,fi,t.ID)),a(),v(" ",R(16,14,t.NotInPOS)," "),a(3),v(" ",t.LastSync?on(19,16,t.LastSync,"dd MMM yyyy HH:mm"):"Never"," "),a(4),l("ngxPermissionsOnly",P(25,Na,n.scanProductRole))}}function Ua(e,c){if(e&1&&(y(0),o(1,"div",7)(2,"table",8)(3,"thead",9)(4,"tr",10)(5,"th"),d(6,"Channel"),r(),o(7,"th",11),d(8," Live Product "),r(),o(9,"th",12),d(10," Sold In Channel "),r(),o(11,"th",13),d(12," Product Not in POS "),r(),o(13,"th",14),d(14,"Last Sync"),r(),_(15,"th",15),r()(),o(16,"tbody"),g(17,La,26,27,"tr",16),N(18,"async"),r()()(),b()),e&2){let t,i=p();a(17),l("ngForOf",(t=R(18,1,i.channels$))==null?null:t.Data)}}function Ba(e,c){e&1&&(o(0,"div",29),_(1,"app-empty-state"),r())}var Ci=(()=>{class e{constructor(t,i,n,s){this.productService=t,this.toastr=i,this.dialog=n,this.authService=s,this.scanProductRole=B.ProductScan,this.destroy$=new Qt,this.channelOptions=s.getChannels()}ngOnInit(){this.setObsProductStatistic()}setObsProductStatistic(){this.channels$=this.productService.getProductStatistic()}getLiveProductCount(t,i){this.productService.getTotalProductLive(t).pipe(Lt(this.destroy$)).subscribe(n=>{i.Count=n.Count})}onScanChannel(t){this.dialog.open(W,{width:"700px",data:{channelOptions:this.channelOptions,filter:{ChannelID:t.ID},disabledChannelOption:!0}}).afterClosed().pipe(F(i=>C.IsNotEmpty(i))).subscribe(i=>{this.scanAllProduct(t.ID,i)})}scanAllProduct(t,i){let n=this.productService.findChannelById(t,this.channelOptions);this.productService.scanAll(i.ChannelID,i.ScanFull,i.UpdatedProduct,i.Async).pipe(F(s=>s)).subscribe(s=>{i.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(s,n,!i.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(Lt(this.destroy$)).subscribe(n=>{this.toastr.success("Successfully cleared cache","Success"),this.setObsProductStatistic()})}getChannelLogo(t){return C.getChannelLogoByTypeId(t)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(i){return new(i||e)(x(et),x(Y),x(rt),x(at))}}static{this.\u0275cmp=I({type:e,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(i,n){if(i&1&&(o(0,"mainpanel",2)(1,"content")(2,"div",3)(3,"div",4)(4,"div",5),g(5,Ua,19,3,"ng-container",6),N(6,"async"),g(7,Ba,2,0,"ng-template",null,0,H),r()()()()()),i&2){let s,h=Q(8);l("hideSearchBox",!0)("hideSearchDropdown",!0),a(5),l("ngIf",((s=R(6,4,n.channels$))==null||s.Data==null?null:s.Data.length)>0)("ngIfElse",h)}},dependencies:[U,A,tt,mt,se,nt,ot,Tt,Mt,sn],encapsulation:2})}}return e})();var ja=[{component:ni,path:"",children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:si,canActivate:[q,X],data:{title:"Products in POS"}},{path:"sold-in-channel",component:mi,canActivate:[q,X],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:hi,canActivate:[q,X],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:_i,canActivate:[q,X],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:gi,canActivate:[q,X],data:{title:"Duplicate Sku in Channel"}},{path:"duplicate-sku/table",loadComponent(){return import("./chunk-LETC4UBH.js").then(e=>e.DuplicateSkuV2Component)},canActivate:[q,X],data:{title:"Duplicate Sku in Channel"}},{path:"channel-statistic",component:Ci,canActivate:[q,X],data:{title:"Channel Statistic"}},{path:"notification",loadComponent(){return import("./chunk-U7WCPDIV.js").then(e=>e.NotificationComponent)},canActivate:[q,X],data:{title:"Notification"}},{path:"notificationV2",loadComponent(){return import("./chunk-3X5SEOLP.js").then(e=>e.NotificationV2Component)},canActivate:[q,X],data:{title:"Notification"}},{path:"notification/detailV2",loadComponent(){return import("./chunk-XONEJSCE.js").then(e=>e.DetailComponent)},canActivate:[q,X],data:{title:"Notification Detail"}},{path:"notification/detail",loadComponent(){return import("./chunk-GJTQNOXV.js").then(e=>e.DetailComponent)},canActivate:[q,X],data:{title:"Notification Detail"}}]}],pc=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=Ve({type:e})}static{this.\u0275inj=Fe({imports:[J,Dt,Pn,ut,Sn,ei,Ln,In,be,lt,_t,pn.forChild(ja),qn,jn,Rt,fn,ye,Oe,gt]})}}return e})();export{pc as StatusModule};
@@ -0,0 +1 @@
1
+ import{a as R,b as E,c as B}from"./chunk-KSHWHTCH.js";import{A as T,a as v,h as y,m as P}from"./chunk-5PS6ZS3N.js";import{r as x,s as F}from"./chunk-MFQQEEHJ.js";import{f as M,n as O}from"./chunk-FXQKRJWU.js";import{$b as u,Gb as c,Gc as _,Ic as b,Ka as s,Mb as p,Qc as C,Tc as f,Yb as a,ia as m,ic as d,jc as l,rb as r,tc as g,uc as h}from"./chunk-OJMQBH6T.js";var V=(o,n)=>({color:o,"font-weight":n});function k(o,n){if(o&1&&(d(0,"mat-radio-button",2),_(1),l()),o&2){let t=n.$implicit,i=n.index,e=h();u(f(7,V,e.model==t.Key&&e.activeBold?"#0976b4":"",e.model==t.Key&&e.activeBold?"700":"")),a("disabled",e.exception==t.Value)("matTooltip",e.title.length>0?e.title[i]:"")("value",t.Key)("name",e.name),r(),b("",t.Value," ")}}var H=(()=>{class o{constructor(){this.model=null,this.disabled=!1,this.modelChange=new s,this.options=[{Key:!1,Value:"No"},{Key:!0,Value:"Yes"}],this.border=!1,this.name="",this.title=[],this.exception="",this.activeBold="",this.onChange=()=>{},this.onTouched=()=>{}}writeValue(t){this.model=t}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.disabled=t}change(t){let i=t&&t.value!==void 0?t.value:t;this.model=i,this.modelChange.emit(i),this.onChange(i),this.onTouched()}static{this.\u0275fac=function(i){return new(i||o)}}static{this.\u0275cmp=c({type:o,selectors:[["lib-radio-options"]],inputs:{model:"model",disabled:"disabled",options:"options",border:"border",name:"name",title:"title",exception:"exception",activeBold:"activeBold"},outputs:{modelChange:"modelChange"},features:[C([{provide:v,useExisting:m(()=>o),multi:!0}])],decls:2,vars:3,consts:[["color","primary",3,"ngModelChange","disabled","ngModel"],["matTooltipPosition","above","class","me-4 mt-1",3,"style","disabled","matTooltip","value","name",4,"ngFor","ngForOf"],["matTooltipPosition","above",1,"me-4","mt-1",3,"disabled","matTooltip","value","name"]],template:function(i,e){i&1&&(d(0,"mat-radio-group",0),g("ngModelChange",function(S){return e.change(S)}),p(1,k,2,10,"mat-radio-button",1),l()),i&2&&(a("disabled",e.disabled)("ngModel",e.model),r(),a("ngForOf",e.options))},dependencies:[O,M,B,R,E,T,y,P,F,x],styles:["html[_ngcontent-%COMP%]{--mdc-radio-state-layer-size: 36px}html[_ngcontent-%COMP%]{--mat-radio-touch-target-display: block}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled:checked + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__outer-circle[_ngcontent-%COMP%]{border-color:#0976b4!important}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__inner-circle[_ngcontent-%COMP%]{background-color:#0976b4!important;border-color:#0976b4!important}"]})}}return o})();export{H as a};
@@ -0,0 +1 @@
1
+ import{a as D}from"./chunk-PIBVGTHJ.js";import{a as U}from"./chunk-UMP6ZMEJ.js";import{b as fe}from"./chunk-F2T43CJB.js";import"./chunk-7G6GQTSH.js";import{a as pe}from"./chunk-ACIMXBIC.js";import{a as re}from"./chunk-Z3ITXK3D.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import"./chunk-CGOB6Y3X.js";import{b as ae}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{c as oe}from"./chunk-EUYQST7Q.js";import{m as me,n as ue}from"./chunk-HJXYT6MI.js";import{A as ie}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import{b as le,c as se}from"./chunk-ERXVXBTU.js";import{r as de,s as ce}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.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-FXQKRJWU.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-OJMQBH6T.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};