marketplacepos 5.46.5 → 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 (110) 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-GHFADTRR.js → chunk-5EIQGYTB.js} +1 -1
  10. package/Marketplace/{chunk-KUYNX5QT.js → chunk-5G3N7OU5.js} +1 -1
  11. package/Marketplace/{chunk-6NZJ2XKE.js → chunk-5KNFEBH5.js} +1 -1
  12. package/Marketplace/{chunk-GVXBDVLX.js → chunk-5QO5B7YG.js} +1 -1
  13. package/Marketplace/{chunk-C7YK5TDP.js → chunk-63ANFYRV.js} +1 -1
  14. package/Marketplace/{chunk-6WE2RKUX.js → chunk-6NRH3MJL.js} +1 -1
  15. package/Marketplace/chunk-6QFP63YQ.js +1 -0
  16. package/Marketplace/{chunk-SXFLJBXI.js → chunk-7KN3UVZI.js} +1 -1
  17. package/Marketplace/chunk-7L3UKJDU.js +1 -0
  18. package/Marketplace/{chunk-DGIH7HSJ.js → chunk-7TI3OR34.js} +1 -1
  19. package/Marketplace/{chunk-LS2KMKMD.js → chunk-AGURPBGY.js} +1 -1
  20. package/Marketplace/chunk-BDBETNFT.js +137 -0
  21. package/Marketplace/{chunk-HZPILY4V.js → chunk-BTO76EDH.js} +1 -1
  22. package/Marketplace/{chunk-RT3SMV6M.js → chunk-BVDLO6WD.js} +1 -1
  23. package/Marketplace/{chunk-WHV5AYGI.js → chunk-CMBQCMTZ.js} +1 -1
  24. package/Marketplace/{chunk-RUXJCVKX.js → chunk-CWNZ6HAV.js} +1 -1
  25. package/Marketplace/chunk-CYG42H2K.js +1 -0
  26. package/Marketplace/{chunk-DRVWJPA2.js → chunk-DNNH5AQJ.js} +1 -1
  27. package/Marketplace/{chunk-3PPLPXAX.js → chunk-DPAQQ77L.js} +1 -1
  28. package/Marketplace/{chunk-WBCI5HV5.js → chunk-EAA6S4WB.js} +1 -1
  29. package/Marketplace/chunk-EUYQST7Q.js +1 -0
  30. package/Marketplace/chunk-F2T43CJB.js +51 -0
  31. package/Marketplace/{chunk-PHLSX23M.js → chunk-F2XHUFJC.js} +2 -2
  32. package/Marketplace/{chunk-7IOOG3TG.js → chunk-F4Z47C2S.js} +8 -8
  33. package/Marketplace/chunk-FJYAC47U.js +2 -0
  34. package/Marketplace/{chunk-OFEZTCJA.js → chunk-GJTQNOXV.js} +1 -1
  35. package/Marketplace/chunk-GUO3DTDP.js +1 -0
  36. package/Marketplace/{chunk-7ES3PHES.js → chunk-HBVCUV6A.js} +1 -1
  37. package/Marketplace/{chunk-7TQWJCUW.js → chunk-HZKRKNLA.js} +1 -1
  38. package/Marketplace/chunk-IQ3ER4NM.js +1 -0
  39. package/Marketplace/{chunk-WY37QAZ4.js → chunk-JAWWMIGP.js} +1 -1
  40. package/Marketplace/{chunk-WREH3C74.js → chunk-JP6HRQLK.js} +2 -2
  41. package/Marketplace/chunk-JZC463X6.js +1 -0
  42. package/Marketplace/chunk-K4NTJPH5.js +1 -0
  43. package/Marketplace/chunk-KTB223SK.js +1 -0
  44. package/Marketplace/{chunk-IJVKHW3C.js → chunk-KWHVCPX2.js} +1 -1
  45. package/Marketplace/{chunk-VQIT62HE.js → chunk-KXU32D3B.js} +1 -1
  46. package/Marketplace/{chunk-774TVUXT.js → chunk-LBDA5KP3.js} +1 -1
  47. package/Marketplace/chunk-LETC4UBH.js +1 -0
  48. package/Marketplace/chunk-LVZDOEKQ.js +1 -0
  49. package/Marketplace/{chunk-6RCPPNMX.js → chunk-LW3PTNRL.js} +1 -1
  50. package/Marketplace/chunk-LYCCI55Z.js +1 -0
  51. package/Marketplace/{chunk-R5WARQUS.js → chunk-MAQ6FWVP.js} +1 -1
  52. package/Marketplace/{chunk-FGRPTNDB.js → chunk-MFMD6ZSP.js} +1 -1
  53. package/Marketplace/chunk-MYPTLVUU.js +1 -0
  54. package/Marketplace/{chunk-OG4QM5FO.js → chunk-NAGQF4JJ.js} +1 -1
  55. package/Marketplace/chunk-NCLAP5OW.js +1 -0
  56. package/Marketplace/{chunk-57MSCWQ4.js → chunk-NFGFM7TW.js} +1 -1
  57. package/Marketplace/{chunk-VEYUDPOA.js → chunk-NTGU2UMX.js} +1 -1
  58. package/Marketplace/chunk-NX4WQMFK.js +1 -0
  59. package/Marketplace/{chunk-TKV7XWBT.js → chunk-O2YNPIYM.js} +1 -1
  60. package/Marketplace/chunk-O3ADJ3YS.js +1 -0
  61. package/Marketplace/{chunk-5ZR5WIHG.js → chunk-OMPJUICC.js} +1 -1
  62. package/Marketplace/{chunk-CAK6MZUW.js → chunk-OR6TBLPO.js} +2 -2
  63. package/Marketplace/{chunk-L74PANZ5.js → chunk-QPLUVWFA.js} +1 -1
  64. package/Marketplace/chunk-R5KKW4LC.js +1 -0
  65. package/Marketplace/{chunk-BPAZ4TES.js → chunk-RGY4FVTG.js} +1 -1
  66. package/Marketplace/{chunk-QUEDQBZU.js → chunk-SCHKXMJN.js} +1 -1
  67. package/Marketplace/{chunk-RU43F4UK.js → chunk-T27ABFCP.js} +1 -1
  68. package/Marketplace/chunk-TLEH7QMI.js +1 -0
  69. package/Marketplace/chunk-TUHKMG57.js +1 -0
  70. package/Marketplace/chunk-U7WCPDIV.js +1 -0
  71. package/Marketplace/{chunk-FYB62QQV.js → chunk-UQWB6RQP.js} +1 -1
  72. package/Marketplace/{chunk-LEM7ESKJ.js → chunk-VLF5RZ3X.js} +1 -1
  73. package/Marketplace/{chunk-74AYYW2T.js → chunk-VRPKQ2HJ.js} +1 -1
  74. package/Marketplace/{chunk-KEW73FTY.js → chunk-WUKVYBD3.js} +1 -1
  75. package/Marketplace/{chunk-2REDCSBO.js → chunk-XONEJSCE.js} +1 -1
  76. package/Marketplace/{chunk-PGP3WHIS.js → chunk-YHT4EYQJ.js} +1 -1
  77. package/Marketplace/{chunk-2WHJU6CS.js → chunk-YU2SDRUC.js} +1 -1
  78. package/Marketplace/{chunk-OLVWSY6L.js → chunk-ZHPHANAW.js} +1 -1
  79. package/Marketplace/index.html +4 -4
  80. package/Marketplace/{main-KIV2XNXR.js → main-HRVNLZTX.js} +1 -1
  81. package/package.json +1 -1
  82. package/Marketplace/chunk-4BWA3J6V.js +0 -1
  83. package/Marketplace/chunk-4YRBARG2.js +0 -1
  84. package/Marketplace/chunk-5EDCBXCE.js +0 -1
  85. package/Marketplace/chunk-5X2M3HM4.js +0 -1
  86. package/Marketplace/chunk-6YBD22SK.js +0 -1
  87. package/Marketplace/chunk-74WQHBVN.js +0 -1
  88. package/Marketplace/chunk-7QKEL4DD.js +0 -1
  89. package/Marketplace/chunk-AY25KXUA.js +0 -2
  90. package/Marketplace/chunk-BVV5R6HN.js +0 -1
  91. package/Marketplace/chunk-CO5XZENC.js +0 -1
  92. package/Marketplace/chunk-EMJTQYVO.js +0 -1
  93. package/Marketplace/chunk-EPBVNII2.js +0 -51
  94. package/Marketplace/chunk-HVA57ZPZ.js +0 -1
  95. package/Marketplace/chunk-JX63Y4CW.js +0 -1
  96. package/Marketplace/chunk-LRBJ5RU5.js +0 -1
  97. package/Marketplace/chunk-LSWILW54.js +0 -1
  98. package/Marketplace/chunk-MACYDQHW.js +0 -1
  99. package/Marketplace/chunk-OLANEXLB.js +0 -1
  100. package/Marketplace/chunk-RGAKHXPF.js +0 -1
  101. package/Marketplace/chunk-RNZC6DAM.js +0 -1
  102. package/Marketplace/chunk-RXQX7567.js +0 -1
  103. package/Marketplace/chunk-SLEJQAL7.js +0 -1
  104. package/Marketplace/chunk-U23D2EPE.js +0 -1
  105. package/Marketplace/chunk-UQFILVPA.js +0 -257
  106. package/Marketplace/chunk-UQL42ODX.js +0 -1
  107. package/Marketplace/chunk-UZWED4UK.js +0 -137
  108. package/Marketplace/chunk-VIXNFSMT.js +0 -1
  109. package/Marketplace/chunk-XANN3R5J.js +0 -1
  110. package/Marketplace/chunk-XHBBUUIF.js +0 -1
@@ -0,0 +1 @@
1
+ import{a as J}from"./chunk-63ANFYRV.js";import{a as z}from"./chunk-5EIQGYTB.js";import{a as Q}from"./chunk-4RTDKHTN.js";import"./chunk-DPAQQ77L.js";import"./chunk-MFMD6ZSP.js";import"./chunk-OXWPLJEW.js";import{a as q}from"./chunk-LDL3A7NM.js";import"./chunk-5CKVZBHM.js";import"./chunk-F2T43CJB.js";import"./chunk-BKRCW7SH.js";import"./chunk-BDBETNFT.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import"./chunk-ACIMXBIC.js";import"./chunk-ZHPHANAW.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-YQLOB7IQ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import{a as y}from"./chunk-CGOB6Y3X.js";import{e as H}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import"./chunk-EUYQST7Q.js";import{m as Z,n as j}from"./chunk-HJXYT6MI.js";import{A as G,h as W,m as $}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{H as N,J as O,j as A,m as R,n as F}from"./chunk-FXQKRJWU.js";import{$c as w,Gb as b,Gc as a,Hc as g,Kc as K,Lc as P,Mb as k,Mc as T,Nc as B,Ra as D,Yb as s,Z as V,ad as v,dc as U,ec as I,gc as E,hc as L,ic as e,jc as t,kc as c,oc as x,pa as C,pb as M,rb as l,tc as _,uc as S,ya as m,za as u}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";function X(o,h){if(o&1){let i=x();e(0,"img",21),_("click",function(r){m(i);let n=S().$implicit,d=S();return u(d.onZoomImage(r,n==null?null:n.ImageUrl))}),t()}if(o&2){let i=S().$implicit;s("src",i==null?null:i.ThumbnailUrl,M)}}function Y(o,h){o&1&&c(0,"img",17)}function ee(o,h){if(o&1&&(e(0,"tr")(1,"td")(2,"div",15),k(3,X,1,1,"img",16)(4,Y,1,0,"img",17),t()(),e(5,"td"),a(6),t(),e(7,"td"),a(8),t(),e(9,"td")(10,"div",18),c(11,"app-channel-logo",19),e(12,"span"),a(13),t()()(),e(14,"td",20),a(15),w(16,"number"),t()()),o&2){let i=h.$implicit;l(3),U(i.ImageUrl?3:4),l(3),g(i.Name),l(2),g(i.SKU),l(3),s("typeId",i.TypeID),l(2),g(i.ChannelName),l(2),g(v(16,6,i.Count))}}var xe=(()=>{class o{constructor(){this.httpService=C(H),this.biggerPictureService=C(J),this.filter=D({PageNumber:1,RowCount:20,ListChannelID:[]}),this.rowCountApi=y.GetMultilistingSKUCount,this.initMultipleListingSKU()}initMultipleListingSKU(){this.multipleListingSKU$=this.httpService.post(y.GetMultiListingSKU,this.filter()).pipe(V(1))}onZoomImage(i,p){this.biggerPictureService.openBiggerPicture(i,p)}static{this.\u0275fac=function(p){return new(p||o)}}static{this.\u0275cmp=b({type:o,selectors:[["app-duplicate-sku-v2"]],decls:33,vars:8,consts:[["headerTitle","Duplicate SKU","description","SKU(s) which is listed more than one time (one to many)",3,"onSubmit","hideSearchBox"],["routerLink","/menu/products/status/duplicate-sku",1,"d-flex","align-items-center","gap-2","btn","btn-outline-secondary","btn-lg"],[1,"fa-solid","fa-credit-card"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"container-fluid"],[1,"row","mt-6"],[1,"col-12"],[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[2,"width","200px"],[2,"width","250px"],[1,"text-end",2,"width","50px"],[3,"next","previous","filter","totaldata","rowCountApi"],[2,"padding-right","0px"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],[1,"d-flex","align-items-center"],[3,"typeId"],[1,"text-end"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"click","src"]],template:function(p,r){if(p&1){let n=x();B(0),w(1,"async"),e(2,"mainpanel",0),_("onSubmit",function(){return m(n),u(r.initMultipleListingSKU())}),e(3,"actions")(4,"a",1),c(5,"i",2),e(6,"span"),a(7,"Card View"),t()()(),e(8,"filters")(9,"div")(10,"label",3),a(11,"Channel"),t(),e(12,"app-channel-options-v2",4),T("ngModelChange",function(f){return m(n),P(r.filter().ListChannelID,f)||(r.filter().ListChannelID=f),u(f)}),t()()(),e(13,"content")(14,"div",5)(15,"div",6)(16,"div",7)(17,"table",8)(18,"thead",9)(19,"tr"),c(20,"th",10),e(21,"th"),a(22,"Product"),t(),e(23,"th",11),a(24,"SKU"),t(),e(25,"th",12),a(26,"Channel"),t(),e(27,"th",13),a(28,"Count"),t()()(),e(29,"tbody"),E(30,ee,17,8,"tr",null,I),t()(),e(32,"app-custom-paginator",14),_("next",function(){return m(n),u(r.initMultipleListingSKU())})("previous",function(){return m(n),u(r.initMultipleListingSKU())}),t()()()()()()}if(p&2){let n=v(1,6,r.multipleListingSKU$);l(2),s("hideSearchBox",!0),l(10),s("multiple",!0),K("ngModel",r.filter().ListChannelID),l(18),L(n==null?null:n.Data),l(2),s("filter",r.filter())("totaldata",n==null||n.Data==null?null:n.Data.length)("rowCountApi",r.rowCountApi)}},dependencies:[F,A,R,j,Z,q,O,N,z,Q,G,W,$],encapsulation:2})}}return o})();export{xe as DuplicateSkuV2Component};
@@ -0,0 +1 @@
1
+ import{a as de,b as pe,c as se}from"./chunk-T27ABFCP.js";import{a as ce}from"./chunk-DNNH5AQJ.js";import{a as A}from"./chunk-UQWB6RQP.js";import{a as ue}from"./chunk-67HPC5Y3.js";import{a as ae}from"./chunk-KTB223SK.js";import"./chunk-PFY5UG5D.js";import"./chunk-KS7ACI26.js";import"./chunk-3GDM5JNY.js";import"./chunk-XXT6F2ZS.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import"./chunk-JVNHFIYT.js";import"./chunk-63ANFYRV.js";import{a as me}from"./chunk-4RTDKHTN.js";import"./chunk-DPAQQ77L.js";import"./chunk-MFMD6ZSP.js";import"./chunk-OXWPLJEW.js";import{a as oe}from"./chunk-LDL3A7NM.js";import"./chunk-5CKVZBHM.js";import"./chunk-F2T43CJB.js";import"./chunk-BKRCW7SH.js";import"./chunk-BDBETNFT.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import"./chunk-ACIMXBIC.js";import"./chunk-ZHPHANAW.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-YQLOB7IQ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import"./chunk-CGOB6Y3X.js";import"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import"./chunk-EUYQST7Q.js";import{m as re,n as le}from"./chunk-HJXYT6MI.js";import{A as te,c as Y,h as Z,m as $,o as ee}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import{r as ie,s as ne}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{j as J,k as K,m as Q,n as X}from"./chunk-FXQKRJWU.js";import{$c as v,Gb as W,Gc as a,Hc as x,Ic as b,Kc as f,Lc as g,Mb as w,Mc as C,Nc as z,Oc as R,Pc as H,Qc as j,Ra as N,Rc as U,Sc as q,Yb as u,Z as L,ac as D,ad as V,bd as G,dc as y,ec as I,gc as B,hc as k,ic as t,jc as i,kc as c,oc as E,pa as F,pb as O,rb as o,tc as M,uc as _,ya as p,za as s}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{a as T,b as P}from"./chunk-66YHNWRR.js";var _e=()=>[],fe=r=>({"td-cell-hover":r});function ge(r,h){if(r&1&&c(0,"variants-dropdown",27),r&2){let e=_().$implicit;u("variants",e==null?null:e.Variants)}}function Ce(r,h){if(r&1&&c(0,"variant-with-image",28),r&2){let e=_().$implicit;u("variant",e==null?null:e.Variants[0])}}function he(r,h){if(r&1&&(t(0,"span"),a(1),i()),r&2){let e=_().$implicit;o(),b("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function Se(r,h){if(r&1&&(t(0,"tr")(1,"td")(2,"div",23)(3,"div",24)(4,"div"),c(5,"img",25),v(6,"channelImage"),i(),t(7,"div"),c(8,"order-link",26),i()(),t(9,"small"),a(10),v(11,"date"),i()()(),t(12,"td"),a(13),i(),t(14,"td"),w(15,ge,1,1,"variants-dropdown",27)(16,Ce,1,1,"variant-with-image",28),i(),t(17,"td"),a(18),v(19,"number"),i(),t(20,"td")(21,"div",23)(22,"div",24)(23,"span"),a(24),i(),w(25,he,2,1,"span"),i(),t(26,"small"),a(27),i()()()()),r&2){let e=h.$implicit;o(5),u("src",V(6,12,e==null?null:e.MarketType),O)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),o(3),u("order",e),o(2),b(" ",G(11,14,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),o(3),x(e.Customer),o(),D(q(19,fe,(e.Variants==null?null:e.Variants.length)>1)),o(),y((e.Variants==null?null:e.Variants.length)>1?15:16),o(3),x(V(19,17,e.Amount)),o(6),x(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),o(),y(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?25:-1),o(2),b(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," ")}}function ve(r,h){if(r&1){let e=E();t(0,"div",15)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),a(5,"Number"),i(),t(6,"th",20),a(7,"Customer"),i(),t(8,"th"),a(9,"Items"),i(),t(10,"th",21),a(11,"Amount"),i(),t(12,"th",21),a(13,"Shipping"),i()()(),t(14,"tbody"),B(15,Se,28,21,"tr",null,I),i()(),t(17,"app-custom-paginator",22),M("next",function(){p(e);let n=_();return s(n.initAllOrders())})("previous",function(){p(e);let n=_();return s(n.initAllOrders())}),i()()}if(r&2){let e=_(),m=H(0);o(15),k(m),o(2),u("filter",e.filter())("totaldata",m==null?null:m.length)}}function we(r,h){r&1&&(t(0,"div",16),c(1,"app-empty-state"),i())}var Ue=(()=>{class r{constructor(){this.orderService=F(A),this.filter=N({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:e=>{this.initFromDate(e)},error:e=>{console.error("Error fetching default date:",e),this.initFromDate(null)}})}initFromDate(e){this.filter.update(m=>P(T({},m),{From:e})),this.initAllOrders()}initAllOrders(){this.allOrders$=this.orderService.getAllOrders(this.filter()).pipe(L(1))}static{this.\u0275fac=function(m){return new(m||r)}}static{this.\u0275cmp=W({type:r,selectors:[["app-all"]],features:[j([A])],decls:34,vars:12,consts:[["headerTitle","Completed","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],["rowCountApi","/api/orders/allcount",3,"next","previous","filter","totaldata"],[1,"lh-sm"],[1,"d-flex","align-items-end","gap-2"],[2,"width","14px","padding-bottom","2.5px",3,"src","alt"],[3,"order"],[3,"variants"],[3,"variant"]],template:function(m,n){if(m&1){let d=E();z(0),v(1,"async"),t(2,"mainpanel",0),M("onSubmit",function(){return p(d),s(n.initAllOrders())}),C("textChange",function(l){return p(d),g(n.filter().Number,l)||(n.filter().Number=l),s(l)}),t(3,"actions")(4,"a",1),c(5,"i",2),t(6,"span"),a(7,"Order Fulfillment Display"),i()()(),t(8,"filters")(9,"div")(10,"label",3),a(11,"Channel"),i(),t(12,"app-channel-options-v2",4),C("ngModelChange",function(l){return p(d),g(n.filter().ListChannelID,l)||(n.filter().ListChannelID=l),s(l)}),i()(),t(13,"div",5)(14,"label",3),a(15,"From/To"),i(),t(16,"div",6)(17,"datepicker",7),C("dateChange",function(l){return p(d),g(n.filter().From,l)||(n.filter().From=l),s(l)}),i()(),t(18,"div")(19,"datepicker",8),C("dateChange",function(l){return p(d),g(n.filter().To,l)||(n.filter().To=l),s(l)}),i()()(),t(20,"div",5)(21,"label",9),a(22,"Page Number"),i(),t(23,"input",10),C("ngModelChange",function(l){return p(d),g(n.filter().PageNumber,l)||(n.filter().PageNumber=l),s(l)}),i()(),t(24,"div",5)(25,"label",9),a(26,"Page Size"),i(),t(27,"input",11),C("ngModelChange",function(l){return p(d),g(n.filter().PageSize,l)||(n.filter().PageSize=l),s(l)}),i()()(),t(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),w(32,ve,18,2,"div",15)(33,we,2,0,"div",16),i()()()()()}if(m&2){let d=R(V(1,8,n.allOrders$)||U(11,_e));o(2),f("text",n.filter().Number),o(10),u("multiple",!0),f("ngModel",n.filter().ListChannelID),o(5),f("date",n.filter().From),o(2),f("date",n.filter().To),o(4),f("ngModel",n.filter().PageNumber),o(4),f("ngModel",n.filter().PageSize),o(5),y((d==null?null:d.length)>0?32:33)}},dependencies:[X,J,Q,K,le,re,ae,oe,te,Y,ee,Z,$,de,pe,se,ue,ne,ie,ce,me],encapsulation:2})}}return r})();export{Ue as AllComponent};
@@ -1 +1 @@
1
- import{a as ae}from"./chunk-OLANEXLB.js";import{a as oe,b as le}from"./chunk-ABYG6YZT.js";import"./chunk-RAQRGWCZ.js";import"./chunk-HVCIQI7B.js";import"./chunk-3GDM5JNY.js";import"./chunk-XXT6F2ZS.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import"./chunk-JVNHFIYT.js";import{a as Y,b as Z,d as ee,e as te}from"./chunk-PYXL7UF7.js";import{i as X}from"./chunk-OLVWSY6L.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import{e as Q}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{c as K}from"./chunk-RXQX7567.js";import{m as ne,n as ie}from"./chunk-HJXYT6MI.js";import{A as G,h as H,m as U}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{j as V,k as J,l as W,n as k}from"./chunk-FXQKRJWU.js";import{$c as m,Gb as P,Gc as p,Hc as C,Ic as y,Kc as j,Lc as O,Mb as u,Mc as q,Qc as z,Yb as d,Z as M,aa as D,ad as c,bd as A,dc as R,ec as B,g as L,gc as T,hc as $,ic as i,ja as w,jc as a,kc as f,oc as F,pa as g,pb as S,rb as l,tc as v,uc as x,v as I,ya as E,za as N}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{a as _}from"./chunk-66YHNWRR.js";var b=(()=>{class n{constructor(){this.httpService=g(Q),this._pageination=new L({PageNumber:1,RowCount:100,ChannelID:null}),this.filter$=this._pageination.asObservable(),this.log$=this.filter$.pipe(D(e=>this.getLogs$(e).pipe()))}getLogs$(e){return this.httpService.post("/api/Channel/GetChannelLogPaged",e)}onPaginationChange(e){let t=this._pageination.value;t.PageNumber=e.pageIndex+1,this._pageination.next(t)}onFilter(e){let t=this._pageination.value;t.PageNumber=1,t=_(_({},t),e),this._pageination.next(t)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=w({token:n,factory:n.\u0275fac})}}return n})();function pe(n,h){if(n&1&&(i(0,"span",10),f(1,"img",11),a(),p(2)),n&2){let e=h.item;l(),d("src",e.Img,S)("alt",e.Name),l(),y(" ",e.Name," ")}}function me(n,h){if(n&1&&(i(0,"tr")(1,"td"),f(2,"img",17),i(3,"span"),p(4),a()(),i(5,"td")(6,"span",18),p(7),m(8,"json"),a()(),i(9,"td"),p(10),m(11,"json"),a(),i(12,"td"),p(13),m(14,"date"),a()()),n&2){let e=h.$implicit;l(2),d("src",e.Img,S),l(2),y(" ",e.ChannelName," "),l(3),C(c(8,5,e.Request)),l(3),C(c(11,7,e.Response)),l(3),C(A(14,9,e.Created,"dd-MM-yyyy hh:mm:ss"))}}function se(n,h){if(n&1){let e=F();i(0,"div",8)(1,"table",12)(2,"thead")(3,"tr",13)(4,"th",14),p(5,"Channel"),a(),i(6,"th"),p(7,"Request"),a(),i(8,"th"),p(9,"Response"),a(),i(10,"th",15),p(11,"Created"),a()()(),i(12,"tbody"),T(13,me,15,12,"tr",null,B),m(15,"async"),a()(),i(16,"mat-paginator",16),m(17,"async"),m(18,"async"),m(19,"async"),m(20,"async"),v("page",function(r){E(e);let o=x();return N(o.channelLogService.onPaginationChange(r))}),a()()}if(n&2){let e,t,r,o,s=x();l(13),$((e=c(15,3,s.channelLogs$))==null?null:e.Data),l(3),d("length",(t=c(17,5,s.channelLogs$))==null?null:t.Count)("pageSize",(r=c(18,7,s.filter$))==null?null:r.RowCount)("pageIndex",(o=c(19,9,s.filter$))!=null&&o.PageNumber?0:((o=c(20,11,s.filter$))==null?null:o.PageNumber)-1)}}function ce(n,h){n&1&&(i(0,"div",9),f(1,"app-empty-state"),a())}var Fe=(()=>{class n{constructor(){this.channelLogService=g(b),this.authService=g(X),this.channelOptions=this.authService.getChannels(),this.channelLogs$=this.channelLogService.log$.pipe(I(e=>(e.Data?e.Data=e.Data.map(t=>(t.Response=t.Response?JSON.parse(t.Response):"",t.Request=t.Request?JSON.parse(t.Request):"",t.Img=K.getChannelLogoByTypeId(t.TypeID),t)):e.Data=[],e)),M(1)),this.filter$=this.channelLogService.filter$}onSubmitFilter(){this.channelLogService.onFilter({ChannelID:this.channelID})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=P({type:n,selectors:[["app-channel-log"]],features:[z([b])],decls:15,vars:7,consts:[["headerTitle","Authorization Log",3,"onSubmit","hideSearchBox"],["container",""],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[3,"page","length","pageSize","pageIndex"],[1,"me-2",2,"width","25px",3,"src"],[1,""]],template:function(t,r){if(t&1&&(i(0,"mainpanel",0),v("onSubmit",function(){return r.onSubmitFilter()}),i(1,"filters")(2,"div",1)(3,"div")(4,"label",2),p(5,"Channel"),a(),i(6,"ng-select",3),q("ngModelChange",function(s){return O(r.channelID,s)||(r.channelID=s),s}),u(7,pe,3,3,"ng-template",4),a()()()(),i(8,"content")(9,"div",5)(10,"div",6)(11,"div",7),u(12,se,21,13,"div",8),m(13,"async"),u(14,ce,2,0,"div",9),a()()()()()),t&2){let o;d("hideSearchBox",!0),l(6),d("clearable",!0)("items",r.channelOptions),j("ngModel",r.channelID),l(6),R(((o=c(13,5,r.channelLogs$))==null||o.Data==null?null:o.Data.length)>0?12:14)}},dependencies:[k,V,W,J,ie,ne,ae,le,oe,te,ee,Y,Z,G,H,U],encapsulation:2})}}return n})();export{Fe as ChannelLogComponent};
1
+ import{a as ae}from"./chunk-KTB223SK.js";import{a as oe,b as le}from"./chunk-ABYG6YZT.js";import"./chunk-RAQRGWCZ.js";import"./chunk-HVCIQI7B.js";import"./chunk-3GDM5JNY.js";import"./chunk-XXT6F2ZS.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import"./chunk-JVNHFIYT.js";import{a as Y,b as Z,d as ee,e as te}from"./chunk-PYXL7UF7.js";import{i as X}from"./chunk-ZHPHANAW.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import{e as Q}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{c as K}from"./chunk-EUYQST7Q.js";import{m as ne,n as ie}from"./chunk-HJXYT6MI.js";import{A as G,h as H,m as U}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{j as V,k as J,l as W,n as k}from"./chunk-FXQKRJWU.js";import{$c as m,Gb as P,Gc as p,Hc as C,Ic as y,Kc as j,Lc as O,Mb as u,Mc as q,Qc as z,Yb as d,Z as M,aa as D,ad as c,bd as A,dc as R,ec as B,g as L,gc as T,hc as $,ic as i,ja as w,jc as a,kc as f,oc as F,pa as g,pb as S,rb as l,tc as v,uc as x,v as I,ya as E,za as N}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{a as _}from"./chunk-66YHNWRR.js";var b=(()=>{class n{constructor(){this.httpService=g(Q),this._pageination=new L({PageNumber:1,RowCount:100,ChannelID:null}),this.filter$=this._pageination.asObservable(),this.log$=this.filter$.pipe(D(e=>this.getLogs$(e).pipe()))}getLogs$(e){return this.httpService.post("/api/Channel/GetChannelLogPaged",e)}onPaginationChange(e){let t=this._pageination.value;t.PageNumber=e.pageIndex+1,this._pageination.next(t)}onFilter(e){let t=this._pageination.value;t.PageNumber=1,t=_(_({},t),e),this._pageination.next(t)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=w({token:n,factory:n.\u0275fac})}}return n})();function pe(n,h){if(n&1&&(i(0,"span",10),f(1,"img",11),a(),p(2)),n&2){let e=h.item;l(),d("src",e.Img,S)("alt",e.Name),l(),y(" ",e.Name," ")}}function me(n,h){if(n&1&&(i(0,"tr")(1,"td"),f(2,"img",17),i(3,"span"),p(4),a()(),i(5,"td")(6,"span",18),p(7),m(8,"json"),a()(),i(9,"td"),p(10),m(11,"json"),a(),i(12,"td"),p(13),m(14,"date"),a()()),n&2){let e=h.$implicit;l(2),d("src",e.Img,S),l(2),y(" ",e.ChannelName," "),l(3),C(c(8,5,e.Request)),l(3),C(c(11,7,e.Response)),l(3),C(A(14,9,e.Created,"dd-MM-yyyy hh:mm:ss"))}}function se(n,h){if(n&1){let e=F();i(0,"div",8)(1,"table",12)(2,"thead")(3,"tr",13)(4,"th",14),p(5,"Channel"),a(),i(6,"th"),p(7,"Request"),a(),i(8,"th"),p(9,"Response"),a(),i(10,"th",15),p(11,"Created"),a()()(),i(12,"tbody"),T(13,me,15,12,"tr",null,B),m(15,"async"),a()(),i(16,"mat-paginator",16),m(17,"async"),m(18,"async"),m(19,"async"),m(20,"async"),v("page",function(r){E(e);let o=x();return N(o.channelLogService.onPaginationChange(r))}),a()()}if(n&2){let e,t,r,o,s=x();l(13),$((e=c(15,3,s.channelLogs$))==null?null:e.Data),l(3),d("length",(t=c(17,5,s.channelLogs$))==null?null:t.Count)("pageSize",(r=c(18,7,s.filter$))==null?null:r.RowCount)("pageIndex",(o=c(19,9,s.filter$))!=null&&o.PageNumber?0:((o=c(20,11,s.filter$))==null?null:o.PageNumber)-1)}}function ce(n,h){n&1&&(i(0,"div",9),f(1,"app-empty-state"),a())}var Fe=(()=>{class n{constructor(){this.channelLogService=g(b),this.authService=g(X),this.channelOptions=this.authService.getChannels(),this.channelLogs$=this.channelLogService.log$.pipe(I(e=>(e.Data?e.Data=e.Data.map(t=>(t.Response=t.Response?JSON.parse(t.Response):"",t.Request=t.Request?JSON.parse(t.Request):"",t.Img=K.getChannelLogoByTypeId(t.TypeID),t)):e.Data=[],e)),M(1)),this.filter$=this.channelLogService.filter$}onSubmitFilter(){this.channelLogService.onFilter({ChannelID:this.channelID})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=P({type:n,selectors:[["app-channel-log"]],features:[z([b])],decls:15,vars:7,consts:[["headerTitle","Authorization Log",3,"onSubmit","hideSearchBox"],["container",""],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[3,"page","length","pageSize","pageIndex"],[1,"me-2",2,"width","25px",3,"src"],[1,""]],template:function(t,r){if(t&1&&(i(0,"mainpanel",0),v("onSubmit",function(){return r.onSubmitFilter()}),i(1,"filters")(2,"div",1)(3,"div")(4,"label",2),p(5,"Channel"),a(),i(6,"ng-select",3),q("ngModelChange",function(s){return O(r.channelID,s)||(r.channelID=s),s}),u(7,pe,3,3,"ng-template",4),a()()()(),i(8,"content")(9,"div",5)(10,"div",6)(11,"div",7),u(12,se,21,13,"div",8),m(13,"async"),u(14,ce,2,0,"div",9),a()()()()()),t&2){let o;d("hideSearchBox",!0),l(6),d("clearable",!0)("items",r.channelOptions),j("ngModel",r.channelID),l(6),R(((o=c(13,5,r.channelLogs$))==null||o.Data==null?null:o.Data.length)>0?12:14)}},dependencies:[k,V,W,J,ie,ne,ae,le,oe,te,ee,Y,Z,G,H,U],encapsulation:2})}}return n})();export{Fe as ChannelLogComponent};
@@ -0,0 +1 @@
1
+ import{a as de}from"./chunk-NCLAP5OW.js";import{a as he}from"./chunk-EHBCYQSG.js";import{a as ne,b as re}from"./chunk-GUO3DTDP.js";import{a as oe}from"./chunk-2UIK6NRS.js";import{b as le}from"./chunk-GRYGUILI.js";import"./chunk-KSHWHTCH.js";import"./chunk-HVCIQI7B.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import{a as pe}from"./chunk-NTGU2UMX.js";import{a as se}from"./chunk-RGAWEFPQ.js";import{c as ce,d as N,e as T}from"./chunk-O2YNPIYM.js";import"./chunk-YTCIQBSO.js";import"./chunk-LYPHZP72.js";import"./chunk-RHHHL4OR.js";import{a as ie}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"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import"./chunk-UMP6ZMEJ.js";import"./chunk-JVNHFIYT.js";import"./chunk-63ANFYRV.js";import"./chunk-OMPJUICC.js";import{d as X,e as Y}from"./chunk-PYXL7UF7.js";import{a as ae}from"./chunk-4RTDKHTN.js";import"./chunk-DPAQQ77L.js";import"./chunk-MFMD6ZSP.js";import"./chunk-OXWPLJEW.js";import"./chunk-5CKVZBHM.js";import"./chunk-F2T43CJB.js";import"./chunk-BKRCW7SH.js";import"./chunk-BDBETNFT.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import"./chunk-ACIMXBIC.js";import{i as Q}from"./chunk-ZHPHANAW.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-YQLOB7IQ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import{a as M}from"./chunk-CGOB6Y3X.js";import{b as q,e as z}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{c as J}from"./chunk-EUYQST7Q.js";import{d as Z,l as $,m as ee,n as te}from"./chunk-HJXYT6MI.js";import{A as K,c as k,h as x,m as G,o as H}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{g as A,j as W,m as U,n as j}from"./chunk-FXQKRJWU.js";import{$c as _,G as D,Gb as O,Gc as m,Kc as C,Lc as P,Mb as I,Mc as f,Nc as L,Qc as B,Ra as w,Yb as d,Z as E,ad as S,ea as R,ic as o,jc as a,kc as F,oc as v,pa as b,rb as c,tc as g,uc as y,xb as u,ya as s,za as p}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";function me(h,V){if(h&1){let t=v();o(0,"button",19),g("click",function(){s(t);let e=y().ngIf,n=y();return p(n.onUpdateItems(e))}),F(1,"i",20),m(2," Update "),a()}}function ue(h,V){if(h&1&&(o(0,"div"),I(1,me,3,0,"button",18),a()),h&2){let t=V.ngIf,r=y();c(),d("ngIf",r.productService.hasSelectionVariant(t))}}var ze=(()=>{class h{constructor(t,r,e,n,l,i){this.http=t,this.toastr=r,this.dialog=e,this.productService=n,this.authService=l,this.placeholderService=i,this.infinitePagination=b(N),this.updateResHandling=b(T),this.mainPanelService=b($),this.channelOptions=w([]),this.searchFilter=w({PageNumber:1,RowCount:50,filterModel:1,text:"",ListChannelID:[],SearchType:ne.NameOnly,NumberFilterComparator:re.Contains}),this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.data$=this.infinitePagination.data$.pipe(E()),this.searchPlaceholder=w("Search ...")}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.getDataAPI,this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe(R(t=>{t.Filter={PageNumber:t.Filter.PageNumber,RowCount:t.Filter.RowCount,filterModel:1,SearchType:t.Filter.SearchType,NumberFilterComparator:t.Filter.NumberFilterComparator},this.initSearchPlaceholder(),this.searchFilter.set(t.Filter),this.mainPanelService.openModalFilter()}))}initSearchPlaceholder(){this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(this.searchFilter().SearchType,this.searchFilter().NumberFilterComparator))}onShowDifferencePrice(t){let r=1;t&&(r=3),this.searchFilter.update(e=>(e.filterModel=r,e)),this.infinitePagination.reloadPagination(this.searchFilter())}onSearch(t){this.searchFilter.update(r=>(r.text=t,r)),this.infinitePagination.reloadPagination(this.searchFilter()),this.filterSelectedChannels(),this.initSearchPlaceholder()}onUpdateItems(t){let r=JSON.parse(JSON.stringify(this.channelOptions())),e=this.productService.selectedVariantProduct(t);this.dialog.open(se,{data:{title:"Updating Price",selectedItems:e,channels:r},width:"400px"}).afterClosed().pipe(D(n=>J.IsNotEmpty(n))).subscribe(n=>{this.channelOptions.set(n),this.updatePrice(t)})}filterSelectedChannels(){let r=this.authService.getChannels().filter(e=>this.searchFilter().ListChannelID?.indexOf(e.ID)!==-1);this.channelOptions.set(r)}updatePrice(t){let r=this.productService.selectedVariantProduct(t);if(r.length>0){let e=r.map(i=>({ID:i.ID,Code:i.Code,Price:i.UnitPrice})),l={ListChannelID:this.getSelectedChannels().map(i=>i.ID),ListPrice:e};this.http.post(M.UpdateChannelPrice,l).subscribe(i=>{this.infinitePagination.reloadPagination(this.searchFilter()),this.handlingUpdatePrice(i),this.resetSelectedChannels()})}}updatePriceByVariant(t){let r={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,Price:t.Price-0,VariantID:t.ID};this.http.post(M.UpdatePriceById,r).subscribe(e=>{this.infinitePagination.reloadPagination(this.searchFilter()),this.handlingUpdatePrice(e)})}handlingUpdatePrice(t){let r=t?.Response?.success_list,e=t?.Response?.failure_list,n=this.getSelectedChannels();r?.length>0||e?.length>0?this.updateResHandling.responseHandling(r,e,"Price",n):this.toastr.error(t[0]?.Exception,"Error")}openExportDialog(){this.dialog.open(le,{data:{title:"Export Multi Channel Comparison",pageNumber:this.searchFilter().PageNumber,rowCount:this.searchFilter().RowCount,filterExport:this.searchFilter(),getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportMultipleChannelComparison"}}).afterClosed().subscribe()}resetSelectedChannels(){this.channelOptions.update(t=>(t.forEach(r=>{r.selected=!1}),t))}getSelectedChannels(){return this.channelOptions().filter(t=>t.selected)}static{this.\u0275fac=function(r){return new(r||h)(u(z),u(q),u(Z),u(ie),u(Q),u(de))}}static{this.\u0275cmp=O({type:h,selectors:[["app-price-pos-channel"]],features:[B([N,U,he,T])],decls:41,vars:27,consts:[["headerTitle","Price Comparison","textButton","Search",3,"onSubmit"],[1,"d-flex"],[4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"mb-5"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],["bindLabel","Value","bindValue","Key","placeholder","Number Filter Comparator","name","numberFilterComparator","appendTo","body",3,"ngModelChange","items","ngModel"],[1,"border","border-1","rounded-1","p-4"],[3,"ngModelChange","options","ngModel"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"onToggle","onSubmit","showProductToggle","data","channel","hiddenIPOSInventory"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"]],template:function(r,e){if(r&1){let n=v();L(0),_(1,"async"),o(2,"mainpanel",0),g("onSubmit",function(i){return s(n),p(e.onSearch(i))}),o(3,"actions")(4,"div",1),I(5,ue,2,1,"div",2),_(6,"async"),o(7,"button",3),g("click",function(){return s(n),p(e.openExportDialog())}),F(8,"i",4),o(9,"span"),m(10,"Export"),a()()()(),o(11,"filters")(12,"div",5)(13,"label",6),m(14,"Channel"),a(),o(15,"app-channel-options-v2",7),f("ngModelChange",function(i){return s(n),P(e.searchFilter().ListChannelID,i)||(e.searchFilter().ListChannelID=i),p(i)}),a()(),o(16,"div",5)(17,"label",6),m(18,"Number Filter Comparator"),a(),o(19,"ng-select",8),f("ngModelChange",function(i){return s(n),P(e.searchFilter().NumberFilterComparator,i)||(e.searchFilter().NumberFilterComparator=i),p(i)}),a()(),o(20,"div",5)(21,"label",6),m(22,"Search Type"),a(),o(23,"div",9)(24,"lib-radio-options",10),f("ngModelChange",function(i){return s(n),P(e.searchFilter().SearchType,i)||(e.searchFilter().SearchType=i),p(i)}),a()()(),o(25,"div",5)(26,"label",11),m(27,"Page Number"),a(),o(28,"input",12),f("ngModelChange",function(i){return s(n),P(e.searchFilter().PageNumber,i)||(e.searchFilter().PageNumber=i),p(i)}),a()(),o(29,"div")(30,"label",11),m(31,"Page Size"),a(),o(32,"input",12),f("ngModelChange",function(i){return s(n),P(e.searchFilter().RowCount,i)||(e.searchFilter().RowCount=i),p(i)}),a()()(),o(33,"content")(34,"div",13)(35,"div",14)(36,"div",15)(37,"app-table",16),_(38,"async"),g("onToggle",function(i){return s(n),p(e.onShowDifferencePrice(i))})("onSubmit",function(i){return s(n),p(e.updatePriceByVariant(i))}),a(),o(39,"infinite-paginator",17),_(40,"async"),g("onNextPage",function(){return s(n),p(e.infinitePagination.onNextPage(e.searchFilter()))})("onLastPage",function(){return s(n),p(e.infinitePagination.onLastPage(e.searchFilter()))})("onGetRowCount",function(){return s(n),p(e.infinitePagination.getRowCount(e.searchFilter()))}),a()()()()()()}if(r&2){let n=S(1,19,e.loader$);c(5),d("ngIf",S(6,21,e.data$)),c(10),d("multiple",!0),C("ngModel",e.searchFilter().ListChannelID),c(4),d("items",n==null||n.Options==null?null:n.Options.SearchComparatorTypeOptions),C("ngModel",e.searchFilter().NumberFilterComparator),c(5),d("options",n==null||n.Options==null?null:n.Options.SearchSKUOnlyOrSKUNameOptions),C("ngModel",e.searchFilter().SearchType),c(4),C("ngModel",e.searchFilter().PageNumber),c(4),C("ngModel",e.searchFilter().RowCount),c(5),d("showProductToggle",!0)("data",S(38,23,e.data$))("channel",e.channelOptions())("hiddenIPOSInventory",!1),c(2),d("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",S(40,25,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}},dependencies:[j,A,W,K,k,H,x,G,ce,te,ee,pe,ae,oe,Y,X],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]})}}return h})();export{ze as PricePosChannelComponent};
@@ -1 +1 @@
1
- import{a as ie,b as oe}from"./chunk-PGP3WHIS.js";import{a as ee,b as te}from"./chunk-OXWPLJEW.js";import{na as Z}from"./chunk-RC5PUUVM.js";import{e as Q}from"./chunk-WN5DZGA4.js";import{b as g,c as r}from"./chunk-RXQX7567.js";import{A as K,a as H,h as J,m as $}from"./chunk-5PS6ZS3N.js";import{r as X,s as Y}from"./chunk-MFQQEEHJ.js";import{i as R,j as U,n as q}from"./chunk-FXQKRJWU.js";import{$c as G,Fc as L,Gb as A,Gc as x,Ic as V,Ka as F,Kc as D,Lc as P,Mb as m,Mc as z,Qc as W,Ra as b,Yb as u,Z as S,aa as p,ad as j,cd as B,dc as M,ea as s,g as c,ia as k,ic as y,ja as I,jc as _,nc as w,oc as O,pa as f,q as l,rb as T,tc as E,uc as n,xa as N,ya as C,za as h}from"./chunk-OJMQBH6T.js";var ae=(()=>{class o{constructor(){this.httpService=f(Q),this.shopeeCategories=new c({data:[],isFirstLoad:!1}),this.tiktokCategories=new c({data:[],isFirstLoad:!1}),this.lazadaCategories=new c({data:[],isFirstLoad:!1}),this.tokopediaCategories=new c({data:[],isFirstLoad:!1}),this.wooCommerceCategories=new c({data:[],isFirstLoad:!1})}getCategories(e,i){switch(e){case g.Shopee:return this.shopeeCategories.asObservable().pipe(p(t=>t.isFirstLoad?l(t.data):this.getShopeeCategories(i)));case g.Tiktok:return this.tiktokCategories.asObservable().pipe(p(t=>t.isFirstLoad?l(t.data):this.getTiktokCategories(i)));case g.Lazada:return this.lazadaCategories.asObservable().pipe(p(t=>t.isFirstLoad?l(t.data):this.getLazadaCategories(i)));case g.Tokopedia:return this.tokopediaCategories.asObservable().pipe(p(t=>t.isFirstLoad?l(t.data):this.getTokopediaCategories(i)));case g.WooCommerce:return this.wooCommerceCategories.asObservable().pipe(p(t=>t.isFirstLoad?l(t.data):this.getWooCommerceCategories(i)));default:return l([])}}getShopeeCategories(e){return this.httpService.get("api/product/shopee/GetCategories",[{key:"ID",value:e}]).pipe(s(t=>{let a={data:t,isFirstLoad:!0};this.shopeeCategories.next(a)}))}getTiktokCategories(e){return this.httpService.get("api/product/tiktok/GetCategories",[{key:"ID",value:e}]).pipe(s(t=>{let a={data:t,isFirstLoad:!0};this.tiktokCategories.next(a)}))}getLazadaCategories(e){return this.httpService.get("api/product/lazada/GetCategories",[{key:"ID",value:e}]).pipe(s(t=>{let a={data:t,isFirstLoad:!0};this.lazadaCategories.next(a)}))}getTokopediaCategories(e){return this.httpService.get("api/product/tokopedia/GetCategories",[{key:"ID",value:e}]).pipe(s(t=>{let a={data:t,isFirstLoad:!0};this.tokopediaCategories.next(a)}))}getWooCommerceCategories(e){return this.httpService.get("api/product/woo/GetCategories",[{key:"ID",value:e}]).pipe(s(t=>{let a={data:t,isFirstLoad:!0};this.wooCommerceCategories.next(a)}))}searchByIdWithParentDFS(e,i){let t=[...e];for(;t.length>0;){let a=t.pop();if(a.id===JSON.stringify(i))return a;if(a.children&&a.children.length>0)for(let v of a.children)v.parent=a,t.push(v)}return null}searchSelectAbleNode(e){let i=null;if(e.selectable)return e;let t=e.children?e.children:[];if(t.length==0)return e;for(let a of t){if(a.children.length==0&&a.selectable)return a;if(i=this.searchSelectAbleNode(a),i)return i}return i}generateCategoryLabel(e){let i="";return e?i=r.getLabelPathTree(e):i="Select a Category",i}static{this.\u0275fac=function(i){return new(i||o)}}static{this.\u0275prov=I({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();function ne(o,d){o&1&&w(0)}function se(o,d){if(o&1&&(y(0,"p-floatLabel",1),m(1,ne,1,0,"ng-container",2),y(2,"label",3),x(3,"Category"),_()()),o&2){n();let e=L(3);T(),u("ngTemplateOutlet",e)}}function le(o,d){o&1&&w(0)}function ce(o,d){if(o&1&&m(0,le,1,0,"ng-container",2),o&2){n();let e=L(3);u("ngTemplateOutlet",e)}}function pe(o,d){if(o&1&&(y(0,"div",6),x(1),_()),o&2){let e=n(2);u("matTooltip",e.selectedCategoryLabel()),T(),V(" ",e.selectedCategoryLabel()," ")}}function ge(o,d){if(o&1){let e=O();y(0,"p-treeSelect",4),G(1,"async"),z("ngModelChange",function(t){C(e);let a=n();return P(a.selectedNode,t)||(a.selectedNode=t),h(t)}),E("click",function(){C(e);let t=n();return h(t.onClickSelect())})("onNodeSelect",function(t){C(e);let a=n();return h(a.onNodeSelect(t))})("onClear",function(){C(e);let t=n();return h(t.onNodeUnselect())}),m(2,pe,2,2,"ng-template",5),_()}if(o&2){let e=n();D("ngModel",e.selectedNode),u("filter",!0)("options",j(1,5,e.categories$))("showClear",e.showClear)("disabled",e.disabled)}}var Pe=(()=>{class o{constructor(){this.categoryService=f(ae),this.showClear=!1,this.showLabel=!1,this.disabled=!1,this.selectedCategory=new F,this.selectedCategoryLabel=b("Select a Category"),this.selectedNode=b(null),this.onChange=e=>{},this.onTouched=()=>{}}ngOnChanges(e){let i=e?.categoryId?.previousValue,t=e?.categoryId?.currentValue;r.IsEmpty(i)&&r.IsNotEmpty(t)&&this.initCategories(),r.IsEmpty(t)&&r.IsNotEmpty(i)&&this.generateCategoryLabel(null)}initCategories(){this.categories$=this.categoryService.getCategories(this.channelType,this.channelId).pipe(s(e=>this.setDefaultCategory(e)),S(1))}setDefaultCategory(e){try{let i=this.categoryService.searchByIdWithParentDFS(e,this.categoryId);i&&(this.generateCategoryLabel(i),this.selectedNode.set(i))}catch(i){console.error(i)}}onClickSelect(){this.disabled==!1&&(this.categories$=this.categoryService.getCategories(this.channelType,this.channelId).pipe(S(1)))}onNodeSelect(e){let i=this.categoryService.searchSelectAbleNode(e.node);this.selectedCategoryLabel.set(r.getLabelPathTree(i));let t=parseInt(i.id);this.onChange(t),this.selectedCategory.emit(t)}onNodeUnselect(){this.selectedCategoryLabel.set("Select a Category"),this.selectedCategory.emit(null)}generateCategoryLabel(e){e?this.selectedCategoryLabel.set(r.getLabelPathTree(e)):this.selectedCategoryLabel.set("Select a Category")}writeValue(e){r.IsNotEmpty(e)&&(this.categoryId=e,this.initCategories())}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.disabled=e}static{this.\u0275fac=function(i){return new(i||o)}}static{this.\u0275cmp=A({type:o,selectors:[["app-channel-category-select"]],inputs:{channelId:"channelId",channelType:"channelType",categoryId:"categoryId",showClear:"showClear",showLabel:"showLabel",disabled:"disabled"},outputs:{selectedCategory:"selectedCategory"},features:[W([{provide:H,useExisting:k(()=>o),multi:!0}]),N],decls:4,vars:1,consts:[["categorySelectTemplate",""],["variant","on",1,"w-100"],[4,"ngTemplateOutlet"],["for","selectCategory",1,"tree-category-label"],["appendTo","body","containerStyleClass","w-100","placeholder","Select a Category","id","selectCategory","inputId","selectCategory",3,"ngModelChange","click","onNodeSelect","onClear","ngModel","filter","options","showClear","disabled"],["pTemplate","value"],["matTooltipPosition","above",3,"matTooltip"]],template:function(i,t){i&1&&m(0,se,4,1,"p-floatLabel",1)(1,ce,1,1,"ng-container")(2,ge,3,7,"ng-template",null,0,B),i&2&&M(t.showLabel?0:1)},dependencies:[q,R,U,oe,ie,Z,Y,X,K,J,$,te,ee],styles:[".p-overlay.p-component{z-index:10000000000000000000000!important} .p-treeselect-panel .p-treeselect-items-wrapper .p-tree{padding-left:4px!important} .p-inputwrapper-filled~label.tree-category-label{left:.5rem!important}"]})}}return o})();export{ae as a,Pe as b};
1
+ import{a as ie,b as oe}from"./chunk-YHT4EYQJ.js";import{a as ee,b as te}from"./chunk-OXWPLJEW.js";import{na as Z}from"./chunk-RC5PUUVM.js";import{e as Q}from"./chunk-WN5DZGA4.js";import{b as g,c as r}from"./chunk-EUYQST7Q.js";import{A as K,a as H,h as J,m as $}from"./chunk-5PS6ZS3N.js";import{r as X,s as Y}from"./chunk-MFQQEEHJ.js";import{i as R,j as U,n as q}from"./chunk-FXQKRJWU.js";import{$c as G,Fc as L,Gb as A,Gc as x,Ic as V,Ka as F,Kc as D,Lc as P,Mb as m,Mc as z,Qc as W,Ra as b,Yb as u,Z as S,aa as p,ad as j,cd as B,dc as M,ea as s,g as c,ia as k,ic as y,ja as I,jc as _,nc as w,oc as O,pa as f,q as l,rb as T,tc as E,uc as n,xa as N,ya as C,za as h}from"./chunk-OJMQBH6T.js";var ae=(()=>{class o{constructor(){this.httpService=f(Q),this.shopeeCategories=new c({data:[],isFirstLoad:!1}),this.tiktokCategories=new c({data:[],isFirstLoad:!1}),this.lazadaCategories=new c({data:[],isFirstLoad:!1}),this.tokopediaCategories=new c({data:[],isFirstLoad:!1}),this.wooCommerceCategories=new c({data:[],isFirstLoad:!1})}getCategories(e,i){switch(e){case g.Shopee:return this.shopeeCategories.asObservable().pipe(p(t=>t.isFirstLoad?l(t.data):this.getShopeeCategories(i)));case g.Tiktok:return this.tiktokCategories.asObservable().pipe(p(t=>t.isFirstLoad?l(t.data):this.getTiktokCategories(i)));case g.Lazada:return this.lazadaCategories.asObservable().pipe(p(t=>t.isFirstLoad?l(t.data):this.getLazadaCategories(i)));case g.Tokopedia:return this.tokopediaCategories.asObservable().pipe(p(t=>t.isFirstLoad?l(t.data):this.getTokopediaCategories(i)));case g.WooCommerce:return this.wooCommerceCategories.asObservable().pipe(p(t=>t.isFirstLoad?l(t.data):this.getWooCommerceCategories(i)));default:return l([])}}getShopeeCategories(e){return this.httpService.get("api/product/shopee/GetCategories",[{key:"ID",value:e}]).pipe(s(t=>{let a={data:t,isFirstLoad:!0};this.shopeeCategories.next(a)}))}getTiktokCategories(e){return this.httpService.get("api/product/tiktok/GetCategories",[{key:"ID",value:e}]).pipe(s(t=>{let a={data:t,isFirstLoad:!0};this.tiktokCategories.next(a)}))}getLazadaCategories(e){return this.httpService.get("api/product/lazada/GetCategories",[{key:"ID",value:e}]).pipe(s(t=>{let a={data:t,isFirstLoad:!0};this.lazadaCategories.next(a)}))}getTokopediaCategories(e){return this.httpService.get("api/product/tokopedia/GetCategories",[{key:"ID",value:e}]).pipe(s(t=>{let a={data:t,isFirstLoad:!0};this.tokopediaCategories.next(a)}))}getWooCommerceCategories(e){return this.httpService.get("api/product/woo/GetCategories",[{key:"ID",value:e}]).pipe(s(t=>{let a={data:t,isFirstLoad:!0};this.wooCommerceCategories.next(a)}))}searchByIdWithParentDFS(e,i){let t=[...e];for(;t.length>0;){let a=t.pop();if(a.id===JSON.stringify(i))return a;if(a.children&&a.children.length>0)for(let v of a.children)v.parent=a,t.push(v)}return null}searchSelectAbleNode(e){let i=null;if(e.selectable)return e;let t=e.children?e.children:[];if(t.length==0)return e;for(let a of t){if(a.children.length==0&&a.selectable)return a;if(i=this.searchSelectAbleNode(a),i)return i}return i}generateCategoryLabel(e){let i="";return e?i=r.getLabelPathTree(e):i="Select a Category",i}static{this.\u0275fac=function(i){return new(i||o)}}static{this.\u0275prov=I({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();function ne(o,d){o&1&&w(0)}function se(o,d){if(o&1&&(y(0,"p-floatLabel",1),m(1,ne,1,0,"ng-container",2),y(2,"label",3),x(3,"Category"),_()()),o&2){n();let e=L(3);T(),u("ngTemplateOutlet",e)}}function le(o,d){o&1&&w(0)}function ce(o,d){if(o&1&&m(0,le,1,0,"ng-container",2),o&2){n();let e=L(3);u("ngTemplateOutlet",e)}}function pe(o,d){if(o&1&&(y(0,"div",6),x(1),_()),o&2){let e=n(2);u("matTooltip",e.selectedCategoryLabel()),T(),V(" ",e.selectedCategoryLabel()," ")}}function ge(o,d){if(o&1){let e=O();y(0,"p-treeSelect",4),G(1,"async"),z("ngModelChange",function(t){C(e);let a=n();return P(a.selectedNode,t)||(a.selectedNode=t),h(t)}),E("click",function(){C(e);let t=n();return h(t.onClickSelect())})("onNodeSelect",function(t){C(e);let a=n();return h(a.onNodeSelect(t))})("onClear",function(){C(e);let t=n();return h(t.onNodeUnselect())}),m(2,pe,2,2,"ng-template",5),_()}if(o&2){let e=n();D("ngModel",e.selectedNode),u("filter",!0)("options",j(1,5,e.categories$))("showClear",e.showClear)("disabled",e.disabled)}}var Pe=(()=>{class o{constructor(){this.categoryService=f(ae),this.showClear=!1,this.showLabel=!1,this.disabled=!1,this.selectedCategory=new F,this.selectedCategoryLabel=b("Select a Category"),this.selectedNode=b(null),this.onChange=e=>{},this.onTouched=()=>{}}ngOnChanges(e){let i=e?.categoryId?.previousValue,t=e?.categoryId?.currentValue;r.IsEmpty(i)&&r.IsNotEmpty(t)&&this.initCategories(),r.IsEmpty(t)&&r.IsNotEmpty(i)&&this.generateCategoryLabel(null)}initCategories(){this.categories$=this.categoryService.getCategories(this.channelType,this.channelId).pipe(s(e=>this.setDefaultCategory(e)),S(1))}setDefaultCategory(e){try{let i=this.categoryService.searchByIdWithParentDFS(e,this.categoryId);i&&(this.generateCategoryLabel(i),this.selectedNode.set(i))}catch(i){console.error(i)}}onClickSelect(){this.disabled==!1&&(this.categories$=this.categoryService.getCategories(this.channelType,this.channelId).pipe(S(1)))}onNodeSelect(e){let i=this.categoryService.searchSelectAbleNode(e.node);this.selectedCategoryLabel.set(r.getLabelPathTree(i));let t=parseInt(i.id);this.onChange(t),this.selectedCategory.emit(t)}onNodeUnselect(){this.selectedCategoryLabel.set("Select a Category"),this.selectedCategory.emit(null)}generateCategoryLabel(e){e?this.selectedCategoryLabel.set(r.getLabelPathTree(e)):this.selectedCategoryLabel.set("Select a Category")}writeValue(e){r.IsNotEmpty(e)&&(this.categoryId=e,this.initCategories())}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.disabled=e}static{this.\u0275fac=function(i){return new(i||o)}}static{this.\u0275cmp=A({type:o,selectors:[["app-channel-category-select"]],inputs:{channelId:"channelId",channelType:"channelType",categoryId:"categoryId",showClear:"showClear",showLabel:"showLabel",disabled:"disabled"},outputs:{selectedCategory:"selectedCategory"},features:[W([{provide:H,useExisting:k(()=>o),multi:!0}]),N],decls:4,vars:1,consts:[["categorySelectTemplate",""],["variant","on",1,"w-100"],[4,"ngTemplateOutlet"],["for","selectCategory",1,"tree-category-label"],["appendTo","body","containerStyleClass","w-100","placeholder","Select a Category","id","selectCategory","inputId","selectCategory",3,"ngModelChange","click","onNodeSelect","onClear","ngModel","filter","options","showClear","disabled"],["pTemplate","value"],["matTooltipPosition","above",3,"matTooltip"]],template:function(i,t){i&1&&m(0,se,4,1,"p-floatLabel",1)(1,ce,1,1,"ng-container")(2,ge,3,7,"ng-template",null,0,B),i&2&&M(t.showLabel?0:1)},dependencies:[q,R,U,oe,ie,Z,Y,X,K,J,$,te,ee],styles:[".p-overlay.p-component{z-index:10000000000000000000000!important} .p-treeselect-panel .p-treeselect-items-wrapper .p-tree{padding-left:4px!important} .p-inputwrapper-filled~label.tree-category-label{left:.5rem!important}"]})}}return o})();export{ae as a,Pe as b};
@@ -1,4 +1,4 @@
1
- import{a as pt}from"./chunk-EPBVNII2.js";import{b as be}from"./chunk-UZWED4UK.js";import{a as et,b as nt,c as ot,d as ct}from"./chunk-5CKVZBHM.js";import{a as st}from"./chunk-BKRCW7SH.js";import{a as tt}from"./chunk-RGAKHXPF.js";import{b as at}from"./chunk-T2OSIFLN.js";import{a as Xe,c as it,d as lt}from"./chunk-QW4EOJRM.js";import{a as rt}from"./chunk-Q4N2QUV6.js";import{a as Je}from"./chunk-YQLOB7IQ.js";import{a as We,c as Ye}from"./chunk-OZ7LWNOK.js";import{a as ye}from"./chunk-YFDFIBAG.js";import{H as ge,Q as Ke,R as E,S as z,T as H,V as N,Y as Qe,_ as He,a as Q,aa as Ne,e as ze,fa as Ge,ia as qe,ka as Be,la as Ze,ma as je,na as Ue,oa as G,pa as q,q as ee,r as A,t as De,u as Re,z as Pe}from"./chunk-RC5PUUVM.js";import{A as fe,a as Ae,h as _e,m as he}from"./chunk-5PS6ZS3N.js";import{d as ce,f as $e,g as pe,h as de,i as ue,n as me}from"./chunk-FXQKRJWU.js";import{$b as U,Ac as M,Bc as m,Ca as ne,Cc as _,Fc as R,Gb as le,Gc as F,Hb as Ce,Hc as D,Ic as J,Ka as C,Kb as oe,Kc as ke,La as Te,Lc as Me,Mb as p,Mc as Fe,Qc as Ee,Ra as L,Rc as se,Sc as V,Tc as P,Uc as re,Xb as v,Yb as s,Zb as Oe,_b as we,ac as W,cd as k,dc as Y,ia as Ie,ic as u,ja as xe,jc as h,ka as Se,kc as $,lc as x,mc as S,nc as O,oc as w,od as g,pa as ve,pd as K,rb as c,rd as X,sd as Le,tc as T,uc as r,vc as Ve,wc as ae,xb as j,ya as y,za as b,zc as I}from"./chunk-OJMQBH6T.js";import{a as te,b as ie}from"./chunk-66YHNWRR.js";var B=t=>({height:t}),gt=(t,a,e)=>({"p-multiselect-option-selected":t,"p-disabled":a,"p-focus":e}),ut=t=>({$implicit:t}),yt=(t,a)=>({checked:t,class:a});function bt(t,a){}function It(t,a){t&1&&p(0,bt,0,0,"ng-template")}function xt(t,a){if(t&1&&p(0,It,1,0,null,4),t&2){let e=a.class,n=r(2);s("ngTemplateOutlet",n.itemCheckboxIconTemplate)("ngTemplateOutletContext",P(2,yt,n.selected,e))}}function St(t,a){t&1&&(x(0),p(1,xt,1,5,"ng-template",null,0,k),S())}function vt(t,a){if(t&1&&(u(0,"span"),F(1),h()),t&2){let e,n=r();c(),D((e=n.label)!==null&&e!==void 0?e:"empty")}}function Tt(t,a){t&1&&O(0)}var Ct=["item"],Ot=["group"],wt=["loader"],Vt=["header"],kt=["filter"],Mt=["footer"],Ft=["emptyfilter"],Et=["empty"],Lt=["selecteditems"],$t=["checkicon"],At=["loadingicon"],zt=["filtericon"],Dt=["removetokenicon"],Rt=["chipicon"],Pt=["clearicon"],Kt=["dropdownicon"],Qt=["itemcheckboxicon"],Ht=["headercheckboxicon"],Nt=["overlay"],Gt=["filterInput"],qt=["focusInput"],Bt=["items"],Zt=["scroller"],jt=["lastHiddenFocusableEl"],Ut=["firstHiddenFocusableEl"],Wt=["headerCheckbox"],Yt=[[["p-header"]],[["p-footer"]]],Jt=["p-header","p-footer"],Xt=()=>({class:"p-multiselect-chip-icon"}),ei=(t,a)=>({$implicit:t,removeChip:a}),mt=t=>({options:t}),ti=(t,a,e)=>({checked:t,partialSelected:a,class:e}),_t=(t,a)=>({$implicit:t,options:a}),ii=()=>({});function ni(t,a){if(t&1&&(x(0),F(1),S()),t&2){let e=r(2);c(),D(e.label()||"empty")}}function li(t,a){if(t&1&&F(0),t&2){let e=r(3);J(" ",e.getSelectedItemsLabel()," ")}}function oi(t,a){t&1&&O(0)}function ai(t,a){if(t&1){let e=w();u(0,"span",28),T("click",function(i){y(e);let l=r(4).$implicit,o=r(4);return b(o.removeOption(l,i))}),p(1,oi,1,0,"ng-container",29),h()}if(t&2){let e=r(8);v("data-pc-section","clearicon")("aria-hidden",!0),c(),s("ngTemplateOutlet",e.chipIconTemplate||e._chipIconTemplate||e.removeTokenIconTemplate||e._removeTokenIconTemplate)("ngTemplateOutletContext",se(4,Xt))}}function si(t,a){if(t&1&&(x(0),p(1,ai,2,5,"span",27),S()),t&2){let e=r(7);c(),s("ngIf",e.chipIconTemplate||e._chipIconTemplate||e.removeTokenIconTemplate||e._removeTokenIconTemplate)}}function ri(t,a){if(t&1&&p(0,si,2,1,"ng-container",20),t&2){let e=r(6);s("ngIf",!e.disabled&&!e.readonly)}}function ci(t,a){t&1&&(x(0),p(1,ri,1,1,"ng-template",null,5,k),S())}function pi(t,a){if(t&1){let e=w();u(0,"div",24,4)(2,"p-chip",26),T("onRemove",function(i){let l=y(e).$implicit,o=r(4);return b(o.removeOption(l,i))}),p(3,ci,3,0,"ng-container",20),h()()}if(t&2){let e=a.$implicit,n=r(4);c(2),s("label",n.getLabelByValue(e))("removable",!n.disabled&&!n.readonly)("removeIcon",n.chipIcon),c(),s("ngIf",n.chipIconTemplate||n._chipIconTemplate||n.removeTokenIconTemplate||n._removeTokenIconTemplate)}}function di(t,a){if(t&1&&p(0,pi,4,4,"div",25),t&2){let e=r(3);s("ngForOf",e.chipSelectedItems())}}function ui(t,a){if(t&1&&(x(0),F(1),S()),t&2){let e=r(3);c(),D(e.placeholder()||e.defaultLabel||"empty")}}function mi(t,a){if(t&1&&(x(0),p(1,li,1,1)(2,di,1,1,"div",24)(3,ui,2,1,"ng-container",20),S()),t&2){let e=r(2);c(),Y(e.chipSelectedItems()&&e.chipSelectedItems().length===e.maxSelectedLabels?1:2),c(2),s("ngIf",!e.modelValue()||e.modelValue().length===0)}}function _i(t,a){if(t&1&&(x(0),p(1,ni,2,1,"ng-container",20)(2,mi,4,2,"ng-container",20),S()),t&2){let e=r();c(),s("ngIf",e.display==="comma"),c(),s("ngIf",e.display==="chip")}}function hi(t,a){t&1&&O(0)}function fi(t,a){if(t&1&&(x(0),F(1),S()),t&2){let e=r(2);c(),D(e.placeholder()||e.defaultLabel||"empty")}}function gi(t,a){if(t&1&&(x(0),p(1,hi,1,0,"ng-container",29)(2,fi,2,1,"ng-container",20),S()),t&2){let e=r();c(),s("ngTemplateOutlet",e.selectedItemsTemplate||e._selectedItemsTemplate)("ngTemplateOutletContext",P(3,ei,e.selectedOptions,e.removeOption.bind(e))),c(),s("ngIf",!e.modelValue()||e.modelValue().length===0)}}function yi(t,a){if(t&1){let e=w();u(0,"TimesIcon",31),T("click",function(i){y(e);let l=r(2);return b(l.clear(i))}),h()}t&2&&v("data-pc-section","clearicon")("aria-hidden",!0)}function bi(t,a){}function Ii(t,a){t&1&&p(0,bi,0,0,"ng-template")}function xi(t,a){if(t&1){let e=w();u(0,"span",31),T("click",function(i){y(e);let l=r(2);return b(l.clear(i))}),p(1,Ii,1,0,null,32),h()}if(t&2){let e=r(2);v("data-pc-section","clearicon")("aria-hidden",!0),c(),s("ngTemplateOutlet",e.clearIconTemplate||e._clearIconTemplate)}}function Si(t,a){if(t&1&&(x(0),p(1,yi,1,2,"TimesIcon",30)(2,xi,2,3,"span",30),S()),t&2){let e=r();c(),s("ngIf",!e.clearIconTemplate&&!e._clearIconTemplate),c(),s("ngIf",e.clearIconTemplate||e._clearIconTemplate)}}function vi(t,a){t&1&&O(0)}function Ti(t,a){if(t&1&&(x(0),p(1,vi,1,0,"ng-container",32),S()),t&2){let e=r(2);c(),s("ngTemplateOutlet",e.loadingIconTemplate||e._loadingIconTemplate)}}function Ci(t,a){if(t&1&&$(0,"span",35),t&2){let e=r(3);s("ngClass","p-multiselect-loading-icon pi-spin "+e.loadingIcon)}}function Oi(t,a){t&1&&$(0,"span",36),t&2&&W("p-multiselect-loading-icon pi pi-spinner pi-spin")}function wi(t,a){if(t&1&&(x(0),p(1,Ci,1,1,"span",33)(2,Oi,1,2,"span",34),S()),t&2){let e=r(2);c(),s("ngIf",e.loadingIcon),c(),s("ngIf",!e.loadingIcon)}}function Vi(t,a){if(t&1&&(x(0),p(1,Ti,2,1,"ng-container",20)(2,wi,3,2,"ng-container",20),S()),t&2){let e=r();c(),s("ngIf",e.loadingIconTemplate||e._loadingIconTemplate),c(),s("ngIf",!e.loadingIconTemplate&&!e._loadingIconTemplate)}}function ki(t,a){if(t&1&&$(0,"span",40),t&2){let e=r(3);s("ngClass",e.dropdownIcon),v("data-pc-section","triggericon")("aria-hidden",!0)}}function Mi(t,a){t&1&&$(0,"ChevronDownIcon",41),t&2&&(s("styleClass","p-multiselect-dropdown-icon"),v("data-pc-section","triggericon")("aria-hidden",!0))}function Fi(t,a){if(t&1&&(x(0),p(1,ki,1,3,"span",38)(2,Mi,1,3,"ChevronDownIcon",39),S()),t&2){let e=r(2);c(),s("ngIf",e.dropdownIcon),c(),s("ngIf",!e.dropdownIcon)}}function Ei(t,a){}function Li(t,a){t&1&&p(0,Ei,0,0,"ng-template")}function $i(t,a){if(t&1&&(u(0,"span",42),p(1,Li,1,0,null,32),h()),t&2){let e=r(2);v("data-pc-section","triggericon")("aria-hidden",!0),c(),s("ngTemplateOutlet",e.dropdownIconTemplate||e._dropdownIconTemplate)}}function Ai(t,a){if(t&1&&p(0,Fi,3,2,"ng-container",20)(1,$i,2,3,"span",37),t&2){let e=r();s("ngIf",!e.dropdownIconTemplate&&!e._dropdownIconTemplate),c(),s("ngIf",e.dropdownIconTemplate||e._dropdownIconTemplate)}}function zi(t,a){t&1&&O(0)}function Di(t,a){t&1&&O(0)}function Ri(t,a){if(t&1&&(x(0),p(1,Di,1,0,"ng-container",29),S()),t&2){let e=r(3);c(),s("ngTemplateOutlet",e.filterTemplate||e._filterTemplate)("ngTemplateOutletContext",V(2,mt,e.filterOptions))}}function Pi(t,a){if(t&1&&$(0,"CheckIcon",41),t&2){let e=r().class;s("styleClass",e),v("data-pc-section","icon")}}function Ki(t,a){}function Qi(t,a){t&1&&p(0,Ki,0,0,"ng-template")}function Hi(t,a){if(t&1&&p(0,Pi,1,2,"CheckIcon",39)(1,Qi,1,0,null,29),t&2){let e=a.class,n=r(5);s("ngIf",!n.headerCheckboxIconTemplate&&!n._headerCheckboxIconTemplate&&n.allSelected()),c(),s("ngTemplateOutlet",n.headerCheckboxIconTemplate||n._headerCheckboxIconTemplate)("ngTemplateOutletContext",re(3,ti,n.allSelected(),n.partialSelected(),e))}}function Ni(t,a){if(t&1){let e=w();u(0,"p-checkbox",51,10),T("onChange",function(i){y(e);let l=r(4);return b(l.onToggleAll(i))}),p(2,Hi,2,7,"ng-template",null,11,k),h()}if(t&2){let e=r(4);s("ngModel",e.allSelected())("ariaLabel",e.toggleAllAriaLabel)("binary",!0)("variant",e.variant)("disabled",e.disabled)}}function Gi(t,a){t&1&&$(0,"SearchIcon",41),t&2&&s("styleClass","p-multiselect-filter-icon")}function qi(t,a){}function Bi(t,a){t&1&&p(0,qi,0,0,"ng-template")}function Zi(t,a){if(t&1&&(u(0,"span",55),p(1,Bi,1,0,null,32),h()),t&2){let e=r(5);c(),s("ngTemplateOutlet",e.filterIconTemplate||e._filterIconTemplate)}}function ji(t,a){if(t&1){let e=w();u(0,"div",52)(1,"p-iconfield")(2,"input",53,12),T("input",function(i){y(e);let l=r(4);return b(l.onFilterInputChange(i))})("keydown",function(i){y(e);let l=r(4);return b(l.onFilterKeyDown(i))})("click",function(i){y(e);let l=r(4);return b(l.onInputClick(i))})("blur",function(i){y(e);let l=r(4);return b(l.onFilterBlur(i))}),h(),u(4,"p-inputicon"),p(5,Gi,1,1,"SearchIcon",39)(6,Zi,2,1,"span",54),h()()()}if(t&2){let e=r(4);c(2),s("variant",e.variant)("value",e._filterValue()||"")("disabled",e.disabled),v("autocomplete",e.autocomplete)("aria-owns",e.id+"_list")("aria-activedescendant",e.focusedOptionId)("placeholder",e.filterPlaceHolder)("aria-label",e.ariaFilterLabel),c(3),s("ngIf",!e.filterIconTemplate&&!e._filterIconTemplate),c(),s("ngIf",e.filterIconTemplate||e._filterIconTemplate)}}function Ui(t,a){if(t&1&&p(0,Ni,4,5,"p-checkbox",49)(1,ji,7,10,"div",50),t&2){let e=r(3);s("ngIf",e.showToggleAll&&!e.selectionLimit),c(),s("ngIf",e.filter)}}function Wi(t,a){if(t&1&&(u(0,"div",48),ae(1),p(2,Ri,2,4,"ng-container",22)(3,Ui,2,2,"ng-template",null,9,k),h()),t&2){let e=R(4),n=r(2);c(2),s("ngIf",n.filterTemplate||n._filterTemplate)("ngIfElse",e)}}function Yi(t,a){t&1&&O(0)}function Ji(t,a){if(t&1&&p(0,Yi,1,0,"ng-container",29),t&2){let e=a.$implicit,n=a.options;r(2);let i=R(9);s("ngTemplateOutlet",i)("ngTemplateOutletContext",P(2,_t,e,n))}}function Xi(t,a){t&1&&O(0)}function en(t,a){if(t&1&&p(0,Xi,1,0,"ng-container",29),t&2){let e=a.options,n=r(4);s("ngTemplateOutlet",n.loaderTemplate||n._loaderTemplate)("ngTemplateOutletContext",V(2,mt,e))}}function tn(t,a){t&1&&(x(0),p(1,en,1,4,"ng-template",null,14,k),S())}function nn(t,a){if(t&1){let e=w();u(0,"p-scroller",56,13),T("onLazyLoad",function(i){y(e);let l=r(2);return b(l.onLazyLoad.emit(i))}),p(2,Ji,1,5,"ng-template",null,3,k)(4,tn,3,0,"ng-container",20),h()}if(t&2){let e=r(2);U(V(9,B,e.scrollHeight)),s("items",e.visibleOptions())("itemSize",e.virtualScrollItemSize||e._itemSize)("autoSize",!0)("tabindex",-1)("lazy",e.lazy)("options",e.virtualScrollOptions),c(4),s("ngIf",e.loaderTemplate||e._loaderTemplate)}}function ln(t,a){t&1&&O(0)}function on(t,a){if(t&1&&(x(0),p(1,ln,1,0,"ng-container",29),S()),t&2){r();let e=R(9),n=r();c(),s("ngTemplateOutlet",e)("ngTemplateOutletContext",P(3,_t,n.visibleOptions(),se(2,ii)))}}function an(t,a){if(t&1&&(u(0,"span"),F(1),h()),t&2){let e=r(2).$implicit,n=r(3);c(),D(n.getOptionGroupLabel(e.optionGroup))}}function sn(t,a){t&1&&O(0)}function rn(t,a){if(t&1&&(x(0),u(1,"li",60),p(2,an,2,1,"span",20)(3,sn,1,0,"ng-container",29),h(),S()),t&2){let e=r(),n=e.$implicit,i=e.index,l=r().options,o=r(2);c(),s("ngStyle",V(5,B,l.itemSize+"px")),v("id",o.id+"_"+o.getOptionIndex(i,l)),c(),s("ngIf",!o.groupTemplate),c(),s("ngTemplateOutlet",o.groupTemplate)("ngTemplateOutletContext",V(7,ut,n.optionGroup))}}function cn(t,a){if(t&1){let e=w();x(0),u(1,"p-multiselect-item",61),T("onClick",function(i){y(e);let l=r().index,o=r().options,d=r(2);return b(d.onOptionSelect(i,!1,d.getOptionIndex(l,o)))})("onMouseEnter",function(i){y(e);let l=r().index,o=r().options,d=r(2);return b(d.onOptionMouseEnter(i,d.getOptionIndex(l,o)))}),h(),S()}if(t&2){let e=r(),n=e.$implicit,i=e.index,l=r().options,o=r(2);c(),s("id",o.id+"_"+o.getOptionIndex(i,l))("option",n)("selected",o.isSelected(n))("label",o.getOptionLabel(n))("disabled",o.isOptionDisabled(n))("template",o.itemTemplate||o._itemTemplate)("checkIconTemplate",o.checkIconTemplate||o._checkIconTemplate)("itemCheckboxIconTemplate",o.itemCheckboxIconTemplate||o._itemCheckboxIconTemplate)("itemSize",l.itemSize)("focused",o.focusedOptionIndex()===o.getOptionIndex(i,l))("ariaPosInset",o.getAriaPosInset(o.getOptionIndex(i,l)))("ariaSetSize",o.ariaSetSize)("variant",o.variant)("highlightOnSelect",o.highlightOnSelect)}}function pn(t,a){if(t&1&&p(0,rn,4,9,"ng-container",20)(1,cn,2,14,"ng-container",20),t&2){let e=a.$implicit,n=r(3);s("ngIf",n.isOptionGroup(e)),c(),s("ngIf",!n.isOptionGroup(e))}}function dn(t,a){if(t&1&&F(0),t&2){let e=r(4);J(" ",e.emptyFilterMessageLabel," ")}}function un(t,a){t&1&&O(0)}function mn(t,a){if(t&1&&p(0,un,1,0,"ng-container",32),t&2){let e=r(4);s("ngTemplateOutlet",e.emptyFilterTemplate||e._emptyFilterTemplate||e.emptyTemplate||e._emptyFilterTemplate)}}function _n(t,a){if(t&1&&(u(0,"li",62),p(1,dn,1,1)(2,mn,1,1,"ng-container"),h()),t&2){let e=r().options,n=r(2);s("ngStyle",V(2,B,e.itemSize+"px")),c(),Y(!n.emptyFilterTemplate&&!n._emptyFilterTemplate&&!n.emptyTemplate&&!n._emptyTemplate?1:2)}}function hn(t,a){if(t&1&&F(0),t&2){let e=r(4);J(" ",e.emptyMessageLabel," ")}}function fn(t,a){t&1&&O(0)}function gn(t,a){if(t&1&&p(0,fn,1,0,"ng-container",32),t&2){let e=r(4);s("ngTemplateOutlet",e.emptyTemplate||e._emptyTemplate)}}function yn(t,a){if(t&1&&(u(0,"li",62),p(1,hn,1,1)(2,gn,1,1,"ng-container"),h()),t&2){let e=r().options,n=r(2);s("ngStyle",V(2,B,e.itemSize+"px")),c(),Y(!n.emptyTemplate&&!n._emptyTemplate?1:2)}}function bn(t,a){if(t&1&&(u(0,"ul",57,15),p(2,pn,2,2,"ng-template",58)(3,_n,3,4,"li",59)(4,yn,3,4,"li",59),h()),t&2){let e=a.$implicit,n=a.options,i=r(2);U(n.contentStyle),s("ngClass",n.contentStyleClass),v("aria-label",i.listLabel),c(2),s("ngForOf",e),c(),s("ngIf",i.hasFilter()&&i.isEmpty()),c(),s("ngIf",!i.hasFilter()&&i.isEmpty())}}function In(t,a){t&1&&O(0)}function xn(t,a){if(t&1&&(u(0,"div"),ae(1,1),p(2,In,1,0,"ng-container",32),h()),t&2){let e=r(2);c(2),s("ngTemplateOutlet",e.footerTemplate||e._footerTemplate)}}function Sn(t,a){if(t&1){let e=w();u(0,"div",43)(1,"span",44,6),T("focus",function(i){y(e);let l=r();return b(l.onFirstHiddenFocus(i))}),h(),p(3,zi,1,0,"ng-container",32)(4,Wi,5,2,"div",45),u(5,"div",46),p(6,nn,5,11,"p-scroller",47)(7,on,2,6,"ng-container",20)(8,bn,5,7,"ng-template",null,7,k),h(),p(10,xn,3,1,"div",20),u(11,"span",44,8),T("focus",function(i){y(e);let l=r();return b(l.onLastHiddenFocus(i))}),h()()}if(t&2){let e=r();W(e.panelStyleClass),s("ngClass","p-multiselect-overlay p-component")("ngStyle",e.panelStyle),v("id",e.id+"_list"),c(),v("tabindex",0)("data-p-hidden-accessible",!0)("data-p-hidden-focusable",!0),c(2),s("ngTemplateOutlet",e.headerTemplate||e._headerTemplate),c(),s("ngIf",e.showHeader),c(),Oe("max-height",e.virtualScroll?"auto":e.scrollHeight||"auto"),c(),s("ngIf",e.virtualScroll),c(),s("ngIf",!e.virtualScroll),c(3),s("ngIf",e.footerFacet||e.footerTemplate||e._footerTemplate),c(),v("tabindex",0)("data-p-hidden-accessible",!0)("data-p-hidden-focusable",!0)}}var vn=({dt:t})=>`
1
+ import{a as et,b as nt,c as ot,d as ct}from"./chunk-5CKVZBHM.js";import{b as pt}from"./chunk-F2T43CJB.js";import{a as st}from"./chunk-BKRCW7SH.js";import{a as tt,c as be}from"./chunk-BDBETNFT.js";import{b as at}from"./chunk-T2OSIFLN.js";import{a as Xe,c as it,d as lt}from"./chunk-QW4EOJRM.js";import{a as rt}from"./chunk-Q4N2QUV6.js";import{a as Je}from"./chunk-YQLOB7IQ.js";import{a as We,c as Ye}from"./chunk-OZ7LWNOK.js";import{a as ye}from"./chunk-YFDFIBAG.js";import{H as ge,Q as Ke,R as E,S as z,T as H,V as N,Y as Qe,_ as He,a as Q,aa as Ne,e as ze,fa as Ge,ia as qe,ka as Be,la as Ze,ma as je,na as Ue,oa as G,pa as q,q as ee,r as A,t as De,u as Re,z as Pe}from"./chunk-RC5PUUVM.js";import{A as fe,a as Ae,h as _e,m as he}from"./chunk-5PS6ZS3N.js";import{d as ce,f as $e,g as pe,h as de,i as ue,n as me}from"./chunk-FXQKRJWU.js";import{$b as U,Ac as M,Bc as m,Ca as ne,Cc as _,Fc as R,Gb as le,Gc as F,Hb as Ce,Hc as D,Ic as J,Ka as C,Kb as oe,Kc as ke,La as Te,Lc as Me,Mb as p,Mc as Fe,Qc as Ee,Ra as L,Rc as se,Sc as V,Tc as P,Uc as re,Xb as v,Yb as s,Zb as Oe,_b as we,ac as W,cd as k,dc as Y,ia as Ie,ic as u,ja as xe,jc as h,ka as Se,kc as $,lc as x,mc as S,nc as O,oc as w,od as g,pa as ve,pd as K,rb as c,rd as X,sd as Le,tc as T,uc as r,vc as Ve,wc as ae,xb as j,ya as y,za as b,zc as I}from"./chunk-OJMQBH6T.js";import{a as te,b as ie}from"./chunk-66YHNWRR.js";var B=t=>({height:t}),gt=(t,a,e)=>({"p-multiselect-option-selected":t,"p-disabled":a,"p-focus":e}),ut=t=>({$implicit:t}),yt=(t,a)=>({checked:t,class:a});function bt(t,a){}function It(t,a){t&1&&p(0,bt,0,0,"ng-template")}function xt(t,a){if(t&1&&p(0,It,1,0,null,4),t&2){let e=a.class,n=r(2);s("ngTemplateOutlet",n.itemCheckboxIconTemplate)("ngTemplateOutletContext",P(2,yt,n.selected,e))}}function St(t,a){t&1&&(x(0),p(1,xt,1,5,"ng-template",null,0,k),S())}function vt(t,a){if(t&1&&(u(0,"span"),F(1),h()),t&2){let e,n=r();c(),D((e=n.label)!==null&&e!==void 0?e:"empty")}}function Tt(t,a){t&1&&O(0)}var Ct=["item"],Ot=["group"],wt=["loader"],Vt=["header"],kt=["filter"],Mt=["footer"],Ft=["emptyfilter"],Et=["empty"],Lt=["selecteditems"],$t=["checkicon"],At=["loadingicon"],zt=["filtericon"],Dt=["removetokenicon"],Rt=["chipicon"],Pt=["clearicon"],Kt=["dropdownicon"],Qt=["itemcheckboxicon"],Ht=["headercheckboxicon"],Nt=["overlay"],Gt=["filterInput"],qt=["focusInput"],Bt=["items"],Zt=["scroller"],jt=["lastHiddenFocusableEl"],Ut=["firstHiddenFocusableEl"],Wt=["headerCheckbox"],Yt=[[["p-header"]],[["p-footer"]]],Jt=["p-header","p-footer"],Xt=()=>({class:"p-multiselect-chip-icon"}),ei=(t,a)=>({$implicit:t,removeChip:a}),mt=t=>({options:t}),ti=(t,a,e)=>({checked:t,partialSelected:a,class:e}),_t=(t,a)=>({$implicit:t,options:a}),ii=()=>({});function ni(t,a){if(t&1&&(x(0),F(1),S()),t&2){let e=r(2);c(),D(e.label()||"empty")}}function li(t,a){if(t&1&&F(0),t&2){let e=r(3);J(" ",e.getSelectedItemsLabel()," ")}}function oi(t,a){t&1&&O(0)}function ai(t,a){if(t&1){let e=w();u(0,"span",28),T("click",function(i){y(e);let l=r(4).$implicit,o=r(4);return b(o.removeOption(l,i))}),p(1,oi,1,0,"ng-container",29),h()}if(t&2){let e=r(8);v("data-pc-section","clearicon")("aria-hidden",!0),c(),s("ngTemplateOutlet",e.chipIconTemplate||e._chipIconTemplate||e.removeTokenIconTemplate||e._removeTokenIconTemplate)("ngTemplateOutletContext",se(4,Xt))}}function si(t,a){if(t&1&&(x(0),p(1,ai,2,5,"span",27),S()),t&2){let e=r(7);c(),s("ngIf",e.chipIconTemplate||e._chipIconTemplate||e.removeTokenIconTemplate||e._removeTokenIconTemplate)}}function ri(t,a){if(t&1&&p(0,si,2,1,"ng-container",20),t&2){let e=r(6);s("ngIf",!e.disabled&&!e.readonly)}}function ci(t,a){t&1&&(x(0),p(1,ri,1,1,"ng-template",null,5,k),S())}function pi(t,a){if(t&1){let e=w();u(0,"div",24,4)(2,"p-chip",26),T("onRemove",function(i){let l=y(e).$implicit,o=r(4);return b(o.removeOption(l,i))}),p(3,ci,3,0,"ng-container",20),h()()}if(t&2){let e=a.$implicit,n=r(4);c(2),s("label",n.getLabelByValue(e))("removable",!n.disabled&&!n.readonly)("removeIcon",n.chipIcon),c(),s("ngIf",n.chipIconTemplate||n._chipIconTemplate||n.removeTokenIconTemplate||n._removeTokenIconTemplate)}}function di(t,a){if(t&1&&p(0,pi,4,4,"div",25),t&2){let e=r(3);s("ngForOf",e.chipSelectedItems())}}function ui(t,a){if(t&1&&(x(0),F(1),S()),t&2){let e=r(3);c(),D(e.placeholder()||e.defaultLabel||"empty")}}function mi(t,a){if(t&1&&(x(0),p(1,li,1,1)(2,di,1,1,"div",24)(3,ui,2,1,"ng-container",20),S()),t&2){let e=r(2);c(),Y(e.chipSelectedItems()&&e.chipSelectedItems().length===e.maxSelectedLabels?1:2),c(2),s("ngIf",!e.modelValue()||e.modelValue().length===0)}}function _i(t,a){if(t&1&&(x(0),p(1,ni,2,1,"ng-container",20)(2,mi,4,2,"ng-container",20),S()),t&2){let e=r();c(),s("ngIf",e.display==="comma"),c(),s("ngIf",e.display==="chip")}}function hi(t,a){t&1&&O(0)}function fi(t,a){if(t&1&&(x(0),F(1),S()),t&2){let e=r(2);c(),D(e.placeholder()||e.defaultLabel||"empty")}}function gi(t,a){if(t&1&&(x(0),p(1,hi,1,0,"ng-container",29)(2,fi,2,1,"ng-container",20),S()),t&2){let e=r();c(),s("ngTemplateOutlet",e.selectedItemsTemplate||e._selectedItemsTemplate)("ngTemplateOutletContext",P(3,ei,e.selectedOptions,e.removeOption.bind(e))),c(),s("ngIf",!e.modelValue()||e.modelValue().length===0)}}function yi(t,a){if(t&1){let e=w();u(0,"TimesIcon",31),T("click",function(i){y(e);let l=r(2);return b(l.clear(i))}),h()}t&2&&v("data-pc-section","clearicon")("aria-hidden",!0)}function bi(t,a){}function Ii(t,a){t&1&&p(0,bi,0,0,"ng-template")}function xi(t,a){if(t&1){let e=w();u(0,"span",31),T("click",function(i){y(e);let l=r(2);return b(l.clear(i))}),p(1,Ii,1,0,null,32),h()}if(t&2){let e=r(2);v("data-pc-section","clearicon")("aria-hidden",!0),c(),s("ngTemplateOutlet",e.clearIconTemplate||e._clearIconTemplate)}}function Si(t,a){if(t&1&&(x(0),p(1,yi,1,2,"TimesIcon",30)(2,xi,2,3,"span",30),S()),t&2){let e=r();c(),s("ngIf",!e.clearIconTemplate&&!e._clearIconTemplate),c(),s("ngIf",e.clearIconTemplate||e._clearIconTemplate)}}function vi(t,a){t&1&&O(0)}function Ti(t,a){if(t&1&&(x(0),p(1,vi,1,0,"ng-container",32),S()),t&2){let e=r(2);c(),s("ngTemplateOutlet",e.loadingIconTemplate||e._loadingIconTemplate)}}function Ci(t,a){if(t&1&&$(0,"span",35),t&2){let e=r(3);s("ngClass","p-multiselect-loading-icon pi-spin "+e.loadingIcon)}}function Oi(t,a){t&1&&$(0,"span",36),t&2&&W("p-multiselect-loading-icon pi pi-spinner pi-spin")}function wi(t,a){if(t&1&&(x(0),p(1,Ci,1,1,"span",33)(2,Oi,1,2,"span",34),S()),t&2){let e=r(2);c(),s("ngIf",e.loadingIcon),c(),s("ngIf",!e.loadingIcon)}}function Vi(t,a){if(t&1&&(x(0),p(1,Ti,2,1,"ng-container",20)(2,wi,3,2,"ng-container",20),S()),t&2){let e=r();c(),s("ngIf",e.loadingIconTemplate||e._loadingIconTemplate),c(),s("ngIf",!e.loadingIconTemplate&&!e._loadingIconTemplate)}}function ki(t,a){if(t&1&&$(0,"span",40),t&2){let e=r(3);s("ngClass",e.dropdownIcon),v("data-pc-section","triggericon")("aria-hidden",!0)}}function Mi(t,a){t&1&&$(0,"ChevronDownIcon",41),t&2&&(s("styleClass","p-multiselect-dropdown-icon"),v("data-pc-section","triggericon")("aria-hidden",!0))}function Fi(t,a){if(t&1&&(x(0),p(1,ki,1,3,"span",38)(2,Mi,1,3,"ChevronDownIcon",39),S()),t&2){let e=r(2);c(),s("ngIf",e.dropdownIcon),c(),s("ngIf",!e.dropdownIcon)}}function Ei(t,a){}function Li(t,a){t&1&&p(0,Ei,0,0,"ng-template")}function $i(t,a){if(t&1&&(u(0,"span",42),p(1,Li,1,0,null,32),h()),t&2){let e=r(2);v("data-pc-section","triggericon")("aria-hidden",!0),c(),s("ngTemplateOutlet",e.dropdownIconTemplate||e._dropdownIconTemplate)}}function Ai(t,a){if(t&1&&p(0,Fi,3,2,"ng-container",20)(1,$i,2,3,"span",37),t&2){let e=r();s("ngIf",!e.dropdownIconTemplate&&!e._dropdownIconTemplate),c(),s("ngIf",e.dropdownIconTemplate||e._dropdownIconTemplate)}}function zi(t,a){t&1&&O(0)}function Di(t,a){t&1&&O(0)}function Ri(t,a){if(t&1&&(x(0),p(1,Di,1,0,"ng-container",29),S()),t&2){let e=r(3);c(),s("ngTemplateOutlet",e.filterTemplate||e._filterTemplate)("ngTemplateOutletContext",V(2,mt,e.filterOptions))}}function Pi(t,a){if(t&1&&$(0,"CheckIcon",41),t&2){let e=r().class;s("styleClass",e),v("data-pc-section","icon")}}function Ki(t,a){}function Qi(t,a){t&1&&p(0,Ki,0,0,"ng-template")}function Hi(t,a){if(t&1&&p(0,Pi,1,2,"CheckIcon",39)(1,Qi,1,0,null,29),t&2){let e=a.class,n=r(5);s("ngIf",!n.headerCheckboxIconTemplate&&!n._headerCheckboxIconTemplate&&n.allSelected()),c(),s("ngTemplateOutlet",n.headerCheckboxIconTemplate||n._headerCheckboxIconTemplate)("ngTemplateOutletContext",re(3,ti,n.allSelected(),n.partialSelected(),e))}}function Ni(t,a){if(t&1){let e=w();u(0,"p-checkbox",51,10),T("onChange",function(i){y(e);let l=r(4);return b(l.onToggleAll(i))}),p(2,Hi,2,7,"ng-template",null,11,k),h()}if(t&2){let e=r(4);s("ngModel",e.allSelected())("ariaLabel",e.toggleAllAriaLabel)("binary",!0)("variant",e.variant)("disabled",e.disabled)}}function Gi(t,a){t&1&&$(0,"SearchIcon",41),t&2&&s("styleClass","p-multiselect-filter-icon")}function qi(t,a){}function Bi(t,a){t&1&&p(0,qi,0,0,"ng-template")}function Zi(t,a){if(t&1&&(u(0,"span",55),p(1,Bi,1,0,null,32),h()),t&2){let e=r(5);c(),s("ngTemplateOutlet",e.filterIconTemplate||e._filterIconTemplate)}}function ji(t,a){if(t&1){let e=w();u(0,"div",52)(1,"p-iconfield")(2,"input",53,12),T("input",function(i){y(e);let l=r(4);return b(l.onFilterInputChange(i))})("keydown",function(i){y(e);let l=r(4);return b(l.onFilterKeyDown(i))})("click",function(i){y(e);let l=r(4);return b(l.onInputClick(i))})("blur",function(i){y(e);let l=r(4);return b(l.onFilterBlur(i))}),h(),u(4,"p-inputicon"),p(5,Gi,1,1,"SearchIcon",39)(6,Zi,2,1,"span",54),h()()()}if(t&2){let e=r(4);c(2),s("variant",e.variant)("value",e._filterValue()||"")("disabled",e.disabled),v("autocomplete",e.autocomplete)("aria-owns",e.id+"_list")("aria-activedescendant",e.focusedOptionId)("placeholder",e.filterPlaceHolder)("aria-label",e.ariaFilterLabel),c(3),s("ngIf",!e.filterIconTemplate&&!e._filterIconTemplate),c(),s("ngIf",e.filterIconTemplate||e._filterIconTemplate)}}function Ui(t,a){if(t&1&&p(0,Ni,4,5,"p-checkbox",49)(1,ji,7,10,"div",50),t&2){let e=r(3);s("ngIf",e.showToggleAll&&!e.selectionLimit),c(),s("ngIf",e.filter)}}function Wi(t,a){if(t&1&&(u(0,"div",48),ae(1),p(2,Ri,2,4,"ng-container",22)(3,Ui,2,2,"ng-template",null,9,k),h()),t&2){let e=R(4),n=r(2);c(2),s("ngIf",n.filterTemplate||n._filterTemplate)("ngIfElse",e)}}function Yi(t,a){t&1&&O(0)}function Ji(t,a){if(t&1&&p(0,Yi,1,0,"ng-container",29),t&2){let e=a.$implicit,n=a.options;r(2);let i=R(9);s("ngTemplateOutlet",i)("ngTemplateOutletContext",P(2,_t,e,n))}}function Xi(t,a){t&1&&O(0)}function en(t,a){if(t&1&&p(0,Xi,1,0,"ng-container",29),t&2){let e=a.options,n=r(4);s("ngTemplateOutlet",n.loaderTemplate||n._loaderTemplate)("ngTemplateOutletContext",V(2,mt,e))}}function tn(t,a){t&1&&(x(0),p(1,en,1,4,"ng-template",null,14,k),S())}function nn(t,a){if(t&1){let e=w();u(0,"p-scroller",56,13),T("onLazyLoad",function(i){y(e);let l=r(2);return b(l.onLazyLoad.emit(i))}),p(2,Ji,1,5,"ng-template",null,3,k)(4,tn,3,0,"ng-container",20),h()}if(t&2){let e=r(2);U(V(9,B,e.scrollHeight)),s("items",e.visibleOptions())("itemSize",e.virtualScrollItemSize||e._itemSize)("autoSize",!0)("tabindex",-1)("lazy",e.lazy)("options",e.virtualScrollOptions),c(4),s("ngIf",e.loaderTemplate||e._loaderTemplate)}}function ln(t,a){t&1&&O(0)}function on(t,a){if(t&1&&(x(0),p(1,ln,1,0,"ng-container",29),S()),t&2){r();let e=R(9),n=r();c(),s("ngTemplateOutlet",e)("ngTemplateOutletContext",P(3,_t,n.visibleOptions(),se(2,ii)))}}function an(t,a){if(t&1&&(u(0,"span"),F(1),h()),t&2){let e=r(2).$implicit,n=r(3);c(),D(n.getOptionGroupLabel(e.optionGroup))}}function sn(t,a){t&1&&O(0)}function rn(t,a){if(t&1&&(x(0),u(1,"li",60),p(2,an,2,1,"span",20)(3,sn,1,0,"ng-container",29),h(),S()),t&2){let e=r(),n=e.$implicit,i=e.index,l=r().options,o=r(2);c(),s("ngStyle",V(5,B,l.itemSize+"px")),v("id",o.id+"_"+o.getOptionIndex(i,l)),c(),s("ngIf",!o.groupTemplate),c(),s("ngTemplateOutlet",o.groupTemplate)("ngTemplateOutletContext",V(7,ut,n.optionGroup))}}function cn(t,a){if(t&1){let e=w();x(0),u(1,"p-multiselect-item",61),T("onClick",function(i){y(e);let l=r().index,o=r().options,d=r(2);return b(d.onOptionSelect(i,!1,d.getOptionIndex(l,o)))})("onMouseEnter",function(i){y(e);let l=r().index,o=r().options,d=r(2);return b(d.onOptionMouseEnter(i,d.getOptionIndex(l,o)))}),h(),S()}if(t&2){let e=r(),n=e.$implicit,i=e.index,l=r().options,o=r(2);c(),s("id",o.id+"_"+o.getOptionIndex(i,l))("option",n)("selected",o.isSelected(n))("label",o.getOptionLabel(n))("disabled",o.isOptionDisabled(n))("template",o.itemTemplate||o._itemTemplate)("checkIconTemplate",o.checkIconTemplate||o._checkIconTemplate)("itemCheckboxIconTemplate",o.itemCheckboxIconTemplate||o._itemCheckboxIconTemplate)("itemSize",l.itemSize)("focused",o.focusedOptionIndex()===o.getOptionIndex(i,l))("ariaPosInset",o.getAriaPosInset(o.getOptionIndex(i,l)))("ariaSetSize",o.ariaSetSize)("variant",o.variant)("highlightOnSelect",o.highlightOnSelect)}}function pn(t,a){if(t&1&&p(0,rn,4,9,"ng-container",20)(1,cn,2,14,"ng-container",20),t&2){let e=a.$implicit,n=r(3);s("ngIf",n.isOptionGroup(e)),c(),s("ngIf",!n.isOptionGroup(e))}}function dn(t,a){if(t&1&&F(0),t&2){let e=r(4);J(" ",e.emptyFilterMessageLabel," ")}}function un(t,a){t&1&&O(0)}function mn(t,a){if(t&1&&p(0,un,1,0,"ng-container",32),t&2){let e=r(4);s("ngTemplateOutlet",e.emptyFilterTemplate||e._emptyFilterTemplate||e.emptyTemplate||e._emptyFilterTemplate)}}function _n(t,a){if(t&1&&(u(0,"li",62),p(1,dn,1,1)(2,mn,1,1,"ng-container"),h()),t&2){let e=r().options,n=r(2);s("ngStyle",V(2,B,e.itemSize+"px")),c(),Y(!n.emptyFilterTemplate&&!n._emptyFilterTemplate&&!n.emptyTemplate&&!n._emptyTemplate?1:2)}}function hn(t,a){if(t&1&&F(0),t&2){let e=r(4);J(" ",e.emptyMessageLabel," ")}}function fn(t,a){t&1&&O(0)}function gn(t,a){if(t&1&&p(0,fn,1,0,"ng-container",32),t&2){let e=r(4);s("ngTemplateOutlet",e.emptyTemplate||e._emptyTemplate)}}function yn(t,a){if(t&1&&(u(0,"li",62),p(1,hn,1,1)(2,gn,1,1,"ng-container"),h()),t&2){let e=r().options,n=r(2);s("ngStyle",V(2,B,e.itemSize+"px")),c(),Y(!n.emptyTemplate&&!n._emptyTemplate?1:2)}}function bn(t,a){if(t&1&&(u(0,"ul",57,15),p(2,pn,2,2,"ng-template",58)(3,_n,3,4,"li",59)(4,yn,3,4,"li",59),h()),t&2){let e=a.$implicit,n=a.options,i=r(2);U(n.contentStyle),s("ngClass",n.contentStyleClass),v("aria-label",i.listLabel),c(2),s("ngForOf",e),c(),s("ngIf",i.hasFilter()&&i.isEmpty()),c(),s("ngIf",!i.hasFilter()&&i.isEmpty())}}function In(t,a){t&1&&O(0)}function xn(t,a){if(t&1&&(u(0,"div"),ae(1,1),p(2,In,1,0,"ng-container",32),h()),t&2){let e=r(2);c(2),s("ngTemplateOutlet",e.footerTemplate||e._footerTemplate)}}function Sn(t,a){if(t&1){let e=w();u(0,"div",43)(1,"span",44,6),T("focus",function(i){y(e);let l=r();return b(l.onFirstHiddenFocus(i))}),h(),p(3,zi,1,0,"ng-container",32)(4,Wi,5,2,"div",45),u(5,"div",46),p(6,nn,5,11,"p-scroller",47)(7,on,2,6,"ng-container",20)(8,bn,5,7,"ng-template",null,7,k),h(),p(10,xn,3,1,"div",20),u(11,"span",44,8),T("focus",function(i){y(e);let l=r();return b(l.onLastHiddenFocus(i))}),h()()}if(t&2){let e=r();W(e.panelStyleClass),s("ngClass","p-multiselect-overlay p-component")("ngStyle",e.panelStyle),v("id",e.id+"_list"),c(),v("tabindex",0)("data-p-hidden-accessible",!0)("data-p-hidden-focusable",!0),c(2),s("ngTemplateOutlet",e.headerTemplate||e._headerTemplate),c(),s("ngIf",e.showHeader),c(),Oe("max-height",e.virtualScroll?"auto":e.scrollHeight||"auto"),c(),s("ngIf",e.virtualScroll),c(),s("ngIf",!e.virtualScroll),c(3),s("ngIf",e.footerFacet||e.footerTemplate||e._footerTemplate),c(),v("tabindex",0)("data-p-hidden-accessible",!0)("data-p-hidden-focusable",!0)}}var vn=({dt:t})=>`
2
2
  .p-multiselect {
3
3
  display: inline-flex;
4
4
  cursor: pointer;
@@ -0,0 +1 @@
1
+ import{a as ke}from"./chunk-NCLAP5OW.js";import{a as Ne}from"./chunk-EHBCYQSG.js";import"./chunk-GUO3DTDP.js";import{a as Ie}from"./chunk-2UIK6NRS.js";import{a as Ve,b as Te}from"./chunk-GRYGUILI.js";import"./chunk-KSHWHTCH.js";import"./chunk-HVCIQI7B.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import{a as D}from"./chunk-XHAXYWZ7.js";import{a as Ee,b as De,c as Me,d as B,e as O}from"./chunk-O2YNPIYM.js";import{a as be,b as Fe}from"./chunk-YTCIQBSO.js";import"./chunk-RHHHL4OR.js";import{a as ye}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"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import{a as se}from"./chunk-UMP6ZMEJ.js";import"./chunk-JVNHFIYT.js";import{a as we}from"./chunk-63ANFYRV.js";import"./chunk-OMPJUICC.js";import{d as Ce,e as ue}from"./chunk-PYXL7UF7.js";import{a as ve}from"./chunk-4RTDKHTN.js";import"./chunk-DPAQQ77L.js";import"./chunk-MFMD6ZSP.js";import"./chunk-OXWPLJEW.js";import"./chunk-5CKVZBHM.js";import"./chunk-F2T43CJB.js";import"./chunk-BKRCW7SH.js";import"./chunk-BDBETNFT.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import"./chunk-ACIMXBIC.js";import{i as ge}from"./chunk-ZHPHANAW.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-YQLOB7IQ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import"./chunk-CGOB6Y3X.js";import{b as _e,e as me}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{c as pe}from"./chunk-EUYQST7Q.js";import{d as xe,l as fe,m as Se,n as Pe}from"./chunk-HJXYT6MI.js";import{A as ce,b as ie,c as oe,h as ae,m as re,o as le}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import{b as de,c as he}from"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{d as X,g as Y,j as ee,m as E,n as te,q as ne}from"./chunk-FXQKRJWU.js";import{$c as v,Fc as q,G as U,Gb as z,Gc as d,Hc as L,Ic as F,Kc as S,Lc as P,Mb as g,Mc as y,Qc as J,Ra as j,Sc as V,Yb as m,Z as A,ad as b,bd as Z,cd as Q,dc as w,ea as $,ec as N,gc as k,hc as R,ic as a,jc as l,kc as I,lc as H,mc as G,oc as x,pa as M,pb as T,rb as c,tc as C,uc as r,xb as u,xc as K,ya as p,za as _}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var W=i=>[i],We=i=>({"text-decoration-line-through":i}),Ue=i=>({"bg-gradient-warning":i});function Ae(i,s){if(i&1){let e=x();a(0,"button",16),C("click",function(){p(e);let n=r().ngIf,o=r(2);return _(o.updateStock(n))}),I(1,"i",17),d(2," Update "),l()}}function $e(i,s){if(i&1){let e=x();a(0,"actions")(1,"div",12),g(2,Ae,3,0,"button",13),a(3,"button",14),C("click",function(){p(e);let n=r(2);return _(n.openExportDialog())}),I(4,"i",15),a(5,"span"),d(6,"Export"),l()()()()}if(i&2){let e=s.ngIf,t=r(2);c(2),m("ngIf",t.productService.hasSelectionVariant(e))}}function je(i,s){if(i&1){let e=x();a(0,"th")(1,"input",32),C("change",function(n){p(e);let o=r().ngIf,h=r(2);return _(h.onSelectAllSKU(n.target.checked,o))}),l()()}}function ze(i,s){if(i&1){let e=x();a(0,"input",49),y("ngModelChange",function(n){p(e);let o=r(4).$implicit;return P(o.selected,n)||(o.selected=n),_(n)}),C("ngModelChange",function(){p(e);let n=r(4).$implicit,o=r(3);return _(o.onCheckboxStateProduct(n))}),l()}if(i&2){let e=r(4).$implicit;S("ngModel",e.selected)}}function He(i,s){if(i&1&&g(0,ze,1,1,"ng-template",26),i&2){let e=r(6);m("ngxPermissionsOnly",V(1,W,e.rolePriceEdit))}}function Ge(i,s){if(i&1){let e=x();H(0),a(1,"img",50),C("click",function(n){p(e);let o=r(3).$implicit,h=r(3);return _(h.onZoomImage(n,o==null?null:o.ImageUrl))}),l(),G()}if(i&2){let e=r(3).$implicit;c(),K("src",e.ThumbnailUrl,T)}}function Ke(i,s){i&1&&I(0,"img",51)}function qe(i,s){if(i&1&&(a(0,"small",48),d(1),l()),i&2){let e=r(3).$implicit;c(),F("(",e.Category,")")}}function Je(i,s){if(i&1&&(a(0,"td",44)(1,"div",35),g(2,He,1,3,null,26),a(3,"div"),g(4,Ge,2,1,"ng-container",45)(5,Ke,1,0,"ng-template",null,0,Q),l()()(),a(7,"td",46)(8,"span",47),d(9),l(),g(10,qe,2,1,"small",48),l()),i&2){let e=q(6),t=r(2).$implicit;m("rowSpan",t.Variants.length),c(2),w((t.Variants==null?null:t.Variants.length)>1?2:-1),c(2),m("ngIf",t.ThumbnailUrl)("ngIfElse",e),c(3),m("rowSpan",t.Variants.length),c(2),L(t.Name),c(),w(t.Category?10:-1)}}function Ze(i,s){if(i&1){let e=x();a(0,"input",54),y("ngModelChange",function(n){p(e);let o=r(2).$implicit;return P(o.selected,n)||(o.selected=n),_(n)}),l()}if(i&2){let e=r(2).$implicit;S("ngModel",e.selected)}}function Qe(i,s){if(i&1&&(a(0,"td",52),g(1,Ze,1,1,"input",53),l()),i&2){let e=r().$implicit;c(),w(e.UnitPrice>=0?1:-1)}}function Xe(i,s){i&1&&(a(0,"div",36),d(1," Not Found "),l())}function Ye(i,s){if(i&1&&(a(0,"div"),d(1),v(2,"number"),l()),i&2){let e=r().$implicit;c(),F(" ",b(2,1,e.UnitPrice)," ")}}function et(i,s){if(i&1&&(a(0,"div",37)(1,"a",40),I(2,"i",55),l()()),i&2){let e=r().$implicit,t=r(4);c(),m("href",t.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),T)}}function tt(i,s){if(i&1){let e=x();a(0,"div",56),C("click",function(){p(e);let n=r().$implicit,o=r().$implicit,h=r(2).ngIf,f=r();return _(f.openTableDialog(n,o,h))}),d(1),v(2,"number"),l()}if(i&2){let e=r().$implicit;c(),F(" ",b(2,1,e.Channel[0]==null?null:e.Channel[0].Price)," ")}}function nt(i,s){if(i&1){let e=x();a(0,"tr",33),g(1,Je,11,7),a(2,"td",24),d(3),l(),a(4,"td",27)(5,"span",34),d(6),l()(),g(7,Qe,2,1,"ng-template",26),a(8,"td",27)(9,"div",35),g(10,Xe,2,0,"div",36)(11,Ye,3,3,"div")(12,et,3,1,"div",37),l()(),a(13,"td",38)(14,"div",35),g(15,tt,3,3,"div",39),a(16,"div",37)(17,"a",40),I(18,"i",41),l()(),a(19,"div",37)(20,"div",42),C("click",function(){let n=p(e).$implicit,o=r(4);return _(o.refreshPrice(n))}),I(21,"i",43),l()()()()()}if(i&2){let e=s.$implicit,t=s.$index,n=r(4);c(),w(t==0?1:-1),c(2),L(e.Model),c(2),m("matTooltip",e.Discontinued?n.discontinuedVariantMsg:"")("ngClass",V(12,We,e.Discontinued)),c(),F(" ",e.Code," "),c(),m("ngxPermissionsOnly",V(14,W,n.rolePriceEdit)),c(3),w((e.Channel[0]==null?null:e.Channel[0].Description)!=null?10:-1),c(),w((e.Channel[0]==null?null:e.Channel[0].Description)==null?11:-1),c(),w((e.Channel[0]==null?null:e.Channel[0].Description)==null?12:-1),c(),m("ngClass",V(16,Ue,e.UnitPrice!=(e.Channel[0]==null?null:e.Channel[0].Price))),c(2),w(e.Channel.length>0?15:-1),c(2),m("href",e.Channel[0]==null?null:e.Channel[0].Url,T)}}function it(i,s){if(i&1&&k(0,nt,22,18,"tr",33,N),i&2){let e=s.$implicit;R(e.Variants)}}function ot(i,s){if(i&1){let e=x();a(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),a(8,"div")(9,"mat-slide-toggle",23),y("ngModelChange",function(n){p(e);let o=r(2);return P(o.toggleDifferentInventory,n)||(o.toggleDifferentInventory=n),_(n)}),C("toggleChange",function(){p(e);let n=r(2);return _(n.onToggleDifferentInventory())}),a(10,"small",9),d(11,"FILTER DIFFERENT PRICE"),l()()()(),a(12,"th",24),d(13,"Variant"),l(),a(14,"th",25),d(15,"SKU"),l(),g(16,je,2,0,"ng-template",26),a(17,"th",27),d(18,"POS"),l(),a(19,"th",27)(20,"div",28),C("click",function(){p(e);let n=r(2);return _(n.openModalFilter())}),I(21,"img",29),a(22,"span",30),d(23),v(24,"stringLimit"),l()()()()(),a(25,"tbody"),k(26,it,2,0,null,null,N),l()(),a(28,"infinite-paginator",31),v(29,"async"),C("onNextPage",function(){p(e);let n=r(2);return _(n.infinitePagination.onNextPage(n.searchFilter))})("onLastPage",function(){p(e);let n=r(2);return _(n.infinitePagination.onLastPage(n.searchFilter))})("onGetRowCount",function(){p(e);let n=r(2);return _(n.infinitePagination.getRowCount(n.searchFilter))}),l()()()()}if(i&2){let e=s.ngIf,t=r(2);c(9),S("ngModel",t.toggleDifferentInventory),c(7),m("ngxPermissionsOnly",V(16,W,t.rolePriceEdit)),c(4),m("matTooltip",(t.selectedChannel==null||t.selectedChannel.Name==null?null:t.selectedChannel.Name.length)>=20?t.selectedChannel==null?null:t.selectedChannel.Name:""),c(),m("src",t.selectedChannel==null?null:t.selectedChannel.Img,T),c(2),F(" ",Z(24,11,t.selectedChannel==null?null:t.selectedChannel.Name,20)," "),c(3),R(e),c(2),m("totalData",t.infinitePagination.totalData())("hideCount",t.infinitePagination.hideCount())("rowCount",b(29,14,t.infinitePagination.totalRowCount$))("pageNumber",t.infinitePagination.pageNumber())("disableNextButton",t.infinitePagination.disableNextButton())("goToLastPage",t.infinitePagination.isLastPage())}}function at(i,s){if(i&1){let e=x();a(0,"mainpanel",2),y("textChange",function(n){p(e);let o=r();return P(o.searchFilter.text,n)||(o.searchFilter.text=n),_(n)}),C("onSubmit",function(){p(e);let n=r();return _(n.onSearch())}),a(1,"filters")(2,"div",3)(3,"label",4),d(4,"Channel"),l(),a(5,"app-channel-options-v2",5),y("ngModelChange",function(n){p(e);let o=r();return P(o.searchFilter.ChannelID,n)||(o.searchFilter.ChannelID=n),_(n)}),l()(),a(6,"div",3)(7,"label",4),d(8,"Number Filter Comparator"),l(),a(9,"ng-select",6),y("ngModelChange",function(n){p(e);let o=r();return P(o.searchFilter.NumberFilterComparator,n)||(o.searchFilter.NumberFilterComparator=n),_(n)}),l()(),a(10,"div",3)(11,"label",4),d(12,"Search Type"),l(),a(13,"div",7)(14,"lib-radio-options",8),y("ngModelChange",function(n){p(e);let o=r();return P(o.searchFilter.SearchType,n)||(o.searchFilter.SearchType=n),_(n)}),l()()(),a(15,"div",3)(16,"label",9),d(17,"Page Number"),l(),a(18,"input",10),y("ngModelChange",function(n){p(e);let o=r();return P(o.searchFilter.PageNumber,n)||(o.searchFilter.PageNumber=n),_(n)}),l()(),a(19,"div")(20,"label",9),d(21,"Page Size"),l(),a(22,"input",10),y("ngModelChange",function(n){p(e);let o=r();return P(o.searchFilter.RowCount,n)||(o.searchFilter.RowCount=n),_(n)}),l()()(),g(23,$e,7,1,"actions",11),v(24,"async"),g(25,ot,30,18,"content",11),v(26,"async"),l()}if(i&2){let e=s.ngIf,t=r();m("headerTitle",t.pageTitle),S("text",t.searchFilter.text),m("searchBoxPlaceHolder",t.searchPlaceholder()),c(5),S("ngModel",t.searchFilter.ChannelID),c(4),m("items",e==null||e.Options==null?null:e.Options.SearchComparatorTypeOptions),S("ngModel",t.searchFilter.NumberFilterComparator),c(5),m("options",e==null||e.Options==null?null:e.Options.SearchSKUOnlyOrSKUNameOptions),S("ngModel",t.searchFilter.SearchType),c(4),S("ngModel",t.searchFilter.PageNumber),c(4),S("ngModel",t.searchFilter.RowCount),c(),m("ngIf",b(24,12,t.data$)),c(2),m("ngIf",b(26,14,t.data$))}}var Ht=(()=>{class i{constructor(e,t,n,o,h,f,Re,Le,Be,Oe){this.http=e,this.toastr=t,this.dialog=n,this.productService=o,this.biggerPictureService=h,this.authService=f,this.mainPanelService=Re,this.exportService=Le,this.decimalPipe=Be,this.placeholderService=Oe,this.infinitePagination=M(B),this.updateResHandling=M(O),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=se.PriceUpdate,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.searchPlaceholder=j("Search ..."),this.hostName=this.authService.getDomain(),this.data$=this.infinitePagination.data$.pipe(A(1)),this.channelOptions=f.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe($(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=D.ALL,this.initSearchPlaceholder(),this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}initSearchPlaceholder(){this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(this.searchFilter.SearchType,this.searchFilter.NumberFilterComparator))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=D.ALL:this.searchFilter.filterModel=D.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(t=>(t.selected=e.selected,t))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let n=this.productService.selectedVariantProduct(e).map(h=>({ID:h.ID,ChannelID:h.Channel[0].ChannelID,Code:h.Code,Price:h.UnitPrice})),o={ListChannelID:[this.searchFilter.ChannelID],ListPrice:n};this.http.post("/api/Price/UpdateChannel",o).subscribe(h=>{this.onSearch(),this.handlingUpdateStock(h.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let t=e.failure_list,n=e.success_list;this.updateResHandling.responseHandling(n,t,"Price")}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let t={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",t).subscribe(n=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel(),this.initSearchPlaceholder()}openTableDialog(e,t,n){let o=JSON.parse(JSON.stringify(e));this.dialog.open(Ee,{data:{Name:t.Name,Variant:o,ChannelID:o?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:o?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(U(f=>pe.IsNotEmpty(f))).subscribe(f=>{this.updateItemAfterDialog(f,e)})}updateItemAfterDialog(e,t){let n={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",n).subscribe(o=>{let h=this.productService.findChannelById(n.ID,this.channelOptions),f=n.Price?this.decimalPipe.transform(n.Price):n.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${h.Name} to ${f}`,"Success"),t.Channel[0]&&(t.Channel[0].Price=n.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,t){t=t.map(n=>(n.Variants=n.Variants.map(o=>(o.selected=e,o)),n))}onZoomImage(e,t){this.biggerPictureService.openBiggerPicture(e,t)}openExportDialog(){this.dialog.open(Te,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}static{this.\u0275fac=function(t){return new(t||i)(u(me),u(_e),u(xe),u(ye),u(we),u(ge),u(fe),u(Ve),u(E),u(ke))}}static{this.\u0275cmp=z({type:i,selectors:[["app-price-single-channel"]],features:[J([B,Ne,ne("https://resc.cloudinary.com/"),E,O])],decls:2,vars:3,consts:[["elsePic",""],["class","single-price",3,"headerTitle","text","searchBoxPlaceHolder","textChange","onSubmit",4,"ngIf"],[1,"single-price",3,"textChange","onSubmit","headerTitle","text","searchBoxPlaceHolder"],[1,"mb-5"],[1,"fw-bold","mb-2"],[3,"ngModelChange","ngModel"],["bindLabel","Value","bindValue","Key","placeholder","Number Filter Comparator","name","numberFilterComparator","appendTo","body",3,"ngModelChange","items","ngModel"],[1,"border","border-1","rounded-1","p-4"],[3,"ngModelChange","options","ngModel"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[4,"ngIf"],[1,"d-flex"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModelChange","toggleChange","ngModel"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-solid","fa-arrow-up-right-from-square"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[4,"ngIf","ngIfElse"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","8px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","8px"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"cursor","pointer",3,"click"]],template:function(t,n){t&1&&(g(0,at,27,16,"mainpanel",1),v(1,"async")),t&2&&m("ngIf",b(1,1,n.loader$))},dependencies:[te,X,Y,ee,E,Pe,Se,ce,oe,le,ie,ae,re,De,Me,he,de,Fe,be,ve,Ie,ue,Ce],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"],changeDetection:0})}}return i})();export{Ht as PriceSingleChannelComponent};
@@ -1 +1 @@
1
- import{c as ht}from"./chunk-KSHWHTCH.js";import"./chunk-HVCIQI7B.js";import"./chunk-EHUVS2VB.js";import{b as ut}from"./chunk-YTCIQBSO.js";import"./chunk-W3JTS22H.js";import"./chunk-6OMSPZZC.js";import{a as Z}from"./chunk-UMP6ZMEJ.js";import"./chunk-JVNHFIYT.js";import{a as st,b as at,d as lt,e as ct}from"./chunk-PYXL7UF7.js";import{i as rt}from"./chunk-OLVWSY6L.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import{b as et,e as it}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{b as h,c as tt}from"./chunk-RXQX7567.js";import{m as dt,n as gt}from"./chunk-HJXYT6MI.js";import{A as Y,h as Q,m as X}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import{b as nt,c as ot}from"./chunk-ERXVXBTU.js";import{r as mt,s as pt}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{J as y,f as J,g as G,j as q,n as L}from"./chunk-FXQKRJWU.js";import{$c as C,Fc as P,Gb as V,Gc as a,Hb as S,Hc as u,Ic as W,Kc as w,Lc as D,Mb as g,Mc as R,Nc as $,Oc as A,Pc as H,Sc as z,Yb as l,Z as M,aa as F,ad as x,cd as U,ea as k,ic as o,jc as r,ka as f,kc as j,lc as T,mc as N,oc as O,pb as K,q as B,rb as s,tc as I,uc as c,v,xb as _,ya as b,za as E}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var Ct=e=>[e];function xt(e,m){if(e&1&&(o(0,"span",15),j(1,"img",16),r(),o(2,"span"),a(3),r()),e&2){let t=m.item;s(),l("src",t.Img,K)("alt",t.Name),s(2),W(" ",t.Name," ")}}function Lt(e,m){if(e&1){let t=O();T(0),$(1),C(2,"async"),o(3,"a",17),I("click",function(){b(t);let n=H(1),p=c();return E(p.submitLogistics(n))}),a(4,"Submit"),r(),N()}if(e&2){let t=c();s(),A(x(2,0,t.logisticServices$))}}function yt(e,m){}function vt(e,m){if(e&1){let t=O();o(0,"ng-select",20),R("ngModelChange",function(n){b(t);let p=c(2).$implicit;return D(p.ProductSKU,n)||(p.ProductSKU=n),E(n)}),r()}if(e&2){let t=c().ngIf,i=c().$implicit;w("ngModel",i.ProductSKU),l("items",t)}}function Mt(e,m){if(e&1&&(o(0,"span"),a(1),r()),e&2){let t=c(2).$implicit;s(),u(t.ProductSKU||"-")}}function bt(e,m){if(e&1&&(T(0),g(1,yt,0,0,"ng-template",19)(2,vt,1,2,"ng-template",null,0,U)(4,Mt,2,1,"ng-template",null,1,U),N()),e&2){let t=P(3),i=P(5),n=c(2);s(),l("ngxPermissionsOnly",z(3,Ct,n.logisticEditRole))("ngxPermissionsOnlyThen",t)("ngxPermissionsOnlyElse",i)}}function Et(e,m){if(e&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td"),a(4),r(),o(5,"td"),a(6),r(),o(7,"td"),g(8,bt,6,5,"ng-container",18),C(9,"async"),r()()),e&2){let t=m.$implicit,i=c();s(2),u(t.Name),s(2),u(t.Service),s(2),u(t.TypeString),s(2),l("ngIf",x(9,4,i.logisticOptions$))}}var _t=(()=>{class e{constructor(t,i,n){this.http=t,this.toastr=i,this.authService=n,this.filter={ChannelID:""},this.logisticEditRole=Z.LogisticUpdate,this.channelOptions=this.authService.getChannels(),this.initUnsupportedChannel(),this.initLoader()}initUnsupportedChannel(){let t=[h.WooCommerce,h.Lazada,h.Shopify,h.Plugo,h.Tokopedia];this.channelOptions=this.channelOptions.map(i=>(t.forEach(n=>{i.TypeID===n&&(i.disabled=!0)}),i))}initLoader(){this.http.post("/api/Logistic/Load",{}).subscribe(t=>{this.filter=t.Filter,this.channelName=this.channelOptions[0].Name,this.initLogisticServiceOptions(),this.getLogisticService()})}initLogisticServiceOptions(){this.logisticOptions$=this.http.get("/api/Logistic/OptionLogisticsService").pipe(M(1))}submitLogistics(t){this.clonedLogisticServices$.pipe(v(i=>t.map(n=>(i.findIndex(d=>d.Name===n.Name&&d.ProductSKU==n.ProductSKU)==-1&&(n.IsChange=!0),n))),F(i=>this.http.post("/api/Logistic/Submit",i))).subscribe(()=>{this.toastr.success("Logistic service updated successfully.","Success"),this.getLogisticService()})}getLogisticService(){this.iniTitle(),this.logisticServices$=this.http.post("/api/Logistic/Get",this.filter).pipe(v(t=>t.map(i=>(i.ProductSKU=tt.IsEmpty(i.ProductSKU)?null:i.ProductSKU,i))),k(t=>{let i=JSON.parse(JSON.stringify(t));this.clonedLogisticServices$=B(i)}),M(1))}iniTitle(){let t=this.channelOptions.find(i=>i.ID==this.filter.ChannelID);this.channelName=t?t.Name:null}static{this.\u0275fac=function(i){return new(i||e)(_(it),_(et),_(rt))}}static{this.\u0275cmp=V({type:e,selectors:[["app-logistic"]],standalone:!1,decls:28,vars:9,consts:[["thenBlock",""],["elseBlock",""],["hideSearchBox","true","searchBoxPlaceHolder","Enter Number...",3,"onSubmit","headerTitle","hideSearchDropdown"],[1,"mb-2","fw-bold"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[4,"ngxPermissionsOnly"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[1,"me-2"],[2,"width","18px",3,"src","alt"],["role","button","data-toggle","tooltip","data-placement","top","matTooltip","enter Logistic for recorded",1,"btn","btn-success","btn-fill","btn-lg","text-white",3,"click"],[4,"ngIf"],[3,"ngxPermissionsOnly","ngxPermissionsOnlyThen","ngxPermissionsOnlyElse"],["placeholder","Logistic Service Code","bindLabel","Name","bindValue","Code",1,"w-75",3,"ngModelChange","ngModel","items"]],template:function(i,n){i&1&&(o(0,"mainpanel",2),I("onSubmit",function(){return n.getLogisticService()}),o(1,"filters")(2,"div")(3,"label",3),a(4,"Select a Channel"),r(),o(5,"ng-select",4),R("ngModelChange",function(d){return D(n.filter.ChannelID,d)||(n.filter.ChannelID=d),d}),g(6,xt,4,3,"ng-template",5),r()()(),o(7,"actions"),g(8,Lt,5,3,"ng-container",6),r(),o(9,"content")(10,"div",7)(11,"div",8)(12,"div",9)(13,"div",10)(14,"table",11)(15,"thead",12)(16,"tr",13)(17,"th"),a(18,"Logistic"),r(),o(19,"th"),a(20,"Service"),r(),o(21,"th"),a(22,"Type"),r(),o(23,"th"),a(24,"Logistic Service"),r()()(),o(25,"tbody"),g(26,Et,10,6,"tr",14),C(27,"async"),r()()()()()()()()),i&2&&(l("headerTitle","Logistic Courier - "+n.channelName)("hideSearchDropdown",!1),s(5),l("clearable",!1)("items",n.channelOptions),w("ngModel",n.filter.ChannelID),s(3),l("ngxPermissionsOnly",n.logisticEditRole),s(18),l("ngForOf",x(27,7,n.logisticServices$)))},dependencies:[J,G,Q,X,dt,lt,st,at,mt,nt,q],encapsulation:2})}}return e})();var Tt=[{path:"",component:_t}],St=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=S({type:e})}static{this.\u0275inj=f({imports:[L,y.forChild(Tt)]})}}return e})();var oe=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=S({type:e})}static{this.\u0275inj=f({imports:[L,y,St,Y,gt,ct,ut,ht,pt,ot]})}}return e})();export{oe as LogisticModule};
1
+ import{c as ht}from"./chunk-KSHWHTCH.js";import"./chunk-HVCIQI7B.js";import"./chunk-EHUVS2VB.js";import{b as ut}from"./chunk-YTCIQBSO.js";import"./chunk-W3JTS22H.js";import"./chunk-6OMSPZZC.js";import{a as Z}from"./chunk-UMP6ZMEJ.js";import"./chunk-JVNHFIYT.js";import{a as st,b as at,d as lt,e as ct}from"./chunk-PYXL7UF7.js";import{i as rt}from"./chunk-ZHPHANAW.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import{b as et,e as it}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{b as h,c as tt}from"./chunk-EUYQST7Q.js";import{m as dt,n as gt}from"./chunk-HJXYT6MI.js";import{A as Y,h as Q,m as X}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import{b as nt,c as ot}from"./chunk-ERXVXBTU.js";import{r as mt,s as pt}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{J as y,f as J,g as G,j as q,n as L}from"./chunk-FXQKRJWU.js";import{$c as C,Fc as P,Gb as V,Gc as a,Hb as S,Hc as u,Ic as W,Kc as w,Lc as D,Mb as g,Mc as R,Nc as $,Oc as A,Pc as H,Sc as z,Yb as l,Z as M,aa as F,ad as x,cd as U,ea as k,ic as o,jc as r,ka as f,kc as j,lc as T,mc as N,oc as O,pb as K,q as B,rb as s,tc as I,uc as c,v,xb as _,ya as b,za as E}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var Ct=e=>[e];function xt(e,m){if(e&1&&(o(0,"span",15),j(1,"img",16),r(),o(2,"span"),a(3),r()),e&2){let t=m.item;s(),l("src",t.Img,K)("alt",t.Name),s(2),W(" ",t.Name," ")}}function Lt(e,m){if(e&1){let t=O();T(0),$(1),C(2,"async"),o(3,"a",17),I("click",function(){b(t);let n=H(1),p=c();return E(p.submitLogistics(n))}),a(4,"Submit"),r(),N()}if(e&2){let t=c();s(),A(x(2,0,t.logisticServices$))}}function yt(e,m){}function vt(e,m){if(e&1){let t=O();o(0,"ng-select",20),R("ngModelChange",function(n){b(t);let p=c(2).$implicit;return D(p.ProductSKU,n)||(p.ProductSKU=n),E(n)}),r()}if(e&2){let t=c().ngIf,i=c().$implicit;w("ngModel",i.ProductSKU),l("items",t)}}function Mt(e,m){if(e&1&&(o(0,"span"),a(1),r()),e&2){let t=c(2).$implicit;s(),u(t.ProductSKU||"-")}}function bt(e,m){if(e&1&&(T(0),g(1,yt,0,0,"ng-template",19)(2,vt,1,2,"ng-template",null,0,U)(4,Mt,2,1,"ng-template",null,1,U),N()),e&2){let t=P(3),i=P(5),n=c(2);s(),l("ngxPermissionsOnly",z(3,Ct,n.logisticEditRole))("ngxPermissionsOnlyThen",t)("ngxPermissionsOnlyElse",i)}}function Et(e,m){if(e&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td"),a(4),r(),o(5,"td"),a(6),r(),o(7,"td"),g(8,bt,6,5,"ng-container",18),C(9,"async"),r()()),e&2){let t=m.$implicit,i=c();s(2),u(t.Name),s(2),u(t.Service),s(2),u(t.TypeString),s(2),l("ngIf",x(9,4,i.logisticOptions$))}}var _t=(()=>{class e{constructor(t,i,n){this.http=t,this.toastr=i,this.authService=n,this.filter={ChannelID:""},this.logisticEditRole=Z.LogisticUpdate,this.channelOptions=this.authService.getChannels(),this.initUnsupportedChannel(),this.initLoader()}initUnsupportedChannel(){let t=[h.WooCommerce,h.Lazada,h.Shopify,h.Plugo,h.Tokopedia];this.channelOptions=this.channelOptions.map(i=>(t.forEach(n=>{i.TypeID===n&&(i.disabled=!0)}),i))}initLoader(){this.http.post("/api/Logistic/Load",{}).subscribe(t=>{this.filter=t.Filter,this.channelName=this.channelOptions[0].Name,this.initLogisticServiceOptions(),this.getLogisticService()})}initLogisticServiceOptions(){this.logisticOptions$=this.http.get("/api/Logistic/OptionLogisticsService").pipe(M(1))}submitLogistics(t){this.clonedLogisticServices$.pipe(v(i=>t.map(n=>(i.findIndex(d=>d.Name===n.Name&&d.ProductSKU==n.ProductSKU)==-1&&(n.IsChange=!0),n))),F(i=>this.http.post("/api/Logistic/Submit",i))).subscribe(()=>{this.toastr.success("Logistic service updated successfully.","Success"),this.getLogisticService()})}getLogisticService(){this.iniTitle(),this.logisticServices$=this.http.post("/api/Logistic/Get",this.filter).pipe(v(t=>t.map(i=>(i.ProductSKU=tt.IsEmpty(i.ProductSKU)?null:i.ProductSKU,i))),k(t=>{let i=JSON.parse(JSON.stringify(t));this.clonedLogisticServices$=B(i)}),M(1))}iniTitle(){let t=this.channelOptions.find(i=>i.ID==this.filter.ChannelID);this.channelName=t?t.Name:null}static{this.\u0275fac=function(i){return new(i||e)(_(it),_(et),_(rt))}}static{this.\u0275cmp=V({type:e,selectors:[["app-logistic"]],standalone:!1,decls:28,vars:9,consts:[["thenBlock",""],["elseBlock",""],["hideSearchBox","true","searchBoxPlaceHolder","Enter Number...",3,"onSubmit","headerTitle","hideSearchDropdown"],[1,"mb-2","fw-bold"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[4,"ngxPermissionsOnly"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[1,"me-2"],[2,"width","18px",3,"src","alt"],["role","button","data-toggle","tooltip","data-placement","top","matTooltip","enter Logistic for recorded",1,"btn","btn-success","btn-fill","btn-lg","text-white",3,"click"],[4,"ngIf"],[3,"ngxPermissionsOnly","ngxPermissionsOnlyThen","ngxPermissionsOnlyElse"],["placeholder","Logistic Service Code","bindLabel","Name","bindValue","Code",1,"w-75",3,"ngModelChange","ngModel","items"]],template:function(i,n){i&1&&(o(0,"mainpanel",2),I("onSubmit",function(){return n.getLogisticService()}),o(1,"filters")(2,"div")(3,"label",3),a(4,"Select a Channel"),r(),o(5,"ng-select",4),R("ngModelChange",function(d){return D(n.filter.ChannelID,d)||(n.filter.ChannelID=d),d}),g(6,xt,4,3,"ng-template",5),r()()(),o(7,"actions"),g(8,Lt,5,3,"ng-container",6),r(),o(9,"content")(10,"div",7)(11,"div",8)(12,"div",9)(13,"div",10)(14,"table",11)(15,"thead",12)(16,"tr",13)(17,"th"),a(18,"Logistic"),r(),o(19,"th"),a(20,"Service"),r(),o(21,"th"),a(22,"Type"),r(),o(23,"th"),a(24,"Logistic Service"),r()()(),o(25,"tbody"),g(26,Et,10,6,"tr",14),C(27,"async"),r()()()()()()()()),i&2&&(l("headerTitle","Logistic Courier - "+n.channelName)("hideSearchDropdown",!1),s(5),l("clearable",!1)("items",n.channelOptions),w("ngModel",n.filter.ChannelID),s(3),l("ngxPermissionsOnly",n.logisticEditRole),s(18),l("ngForOf",x(27,7,n.logisticServices$)))},dependencies:[J,G,Q,X,dt,lt,st,at,mt,nt,q],encapsulation:2})}}return e})();var Tt=[{path:"",component:_t}],St=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=S({type:e})}static{this.\u0275inj=f({imports:[L,y.forChild(Tt)]})}}return e})();var oe=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=S({type:e})}static{this.\u0275inj=f({imports:[L,y,St,Y,gt,ct,ut,ht,pt,ot]})}}return e})();export{oe as LogisticModule};
@@ -0,0 +1 @@
1
+ import{a as t,b as r}from"./chunk-GUO3DTDP.js";import{ja as o}from"./chunk-OJMQBH6T.js";var h=(()=>{class a{generatePlaceholderBySearchType(s,c){let e="Search ...";switch(s){case t.SkuAndName:e="SKU / Name";break;case t.SKUOnly:e="SKU";break;case t.NameOnly:e="Name";break}switch(c){case r.StartsWith:e=`${e} Starts With`;break;case r.EndsWith:e=`${e} Ends With`;break;case r.Contains:e=`${e} Contains`;break;case r.Is:e=`${e} Is`;break}return e}static{this.\u0275fac=function(c){return new(c||a)}}static{this.\u0275prov=o({token:a,factory:a.\u0275fac,providedIn:"root"})}}return a})();export{h as a};
@@ -1 +1 @@
1
- import{c as C}from"./chunk-RXQX7567.js";import{b as x,c as V,j as R,k as A}from"./chunk-HJXYT6MI.js";import{r as v}from"./chunk-MFQQEEHJ.js";import{d as P}from"./chunk-FXQKRJWU.js";import{Gb as y,Gc as m,Hc as g,Ra as u,Sc as E,Yb as d,ec as S,gc as O,hc as b,ic as a,jc as l,rb as p,tc as T,xb as f}from"./chunk-OJMQBH6T.js";var K=i=>({"bg-gradient-warning":i});function U(i,I){if(i&1&&(a(0,"tr",5)(1,"td"),m(2),l(),a(3,"td",6),m(4),l()()),i&2){let t=I.$implicit;d("matTooltip",t.duplicateMessage),p(2),g(t==null?null:t.Name),p(),d("ngClass",E(4,K,t.isDuplicate)),p(),g(t!=null&&t.ChannelVariationSKU?t==null?null:t.ChannelVariationSKU:"Not Assigned")}}var lt=(()=>{class i{constructor(t,e){this.data=t,this.dialogRef=e,this.variants=u([])}ngOnInit(){this.initModalConfig(),this.initVariants()}initVariants(){let t=this.data?.variants,e={},o=[],h=t.filter(n=>C.IsEmpty(n.ChannelVariationSKU));t.filter(n=>C.IsNotEmpty(n.ChannelVariationSKU)).forEach((n,r,M)=>{e[n.ChannelVariationSKU]=M.filter(s=>s.ChannelVariationSKU===n.ChannelVariationSKU)}),Object.keys(e).forEach(n=>{e[n].length>1&&(e[n]=e[n].map((r,M,s)=>{let _=`SKU ${r.ChannelVariationSKU} is duplicated with variant`;return s.forEach((c,L)=>{c.Name!==r.Name&&(_+=` ${s.length>2?c.Name+(L!==s.length-1?",":""):c.Name}`)}),r.duplicateMessage=_,r.isDuplicate=!0,r})),o.push(...e[n])}),o.push(...h),this.variants.set(o)}initModalConfig(){this.modalConfig=new R,this.modalConfig.title=this.data?.title,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0,this.modalConfig.bodyScrollable=!0}static{this.\u0275fac=function(e){return new(e||i)(f(V),f(x))}}static{this.\u0275cmp=y({type:i,selectors:[["app-modal-variants"]],standalone:!1,decls:12,vars:1,consts:[[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"sticky-top"],["matTooltipPosition","above",3,"matTooltip"],[3,"ngClass"]],template:function(e,o){e&1&&(a(0,"modal-material",0),T("onCancel",function(){return o.dialogRef.close()}),a(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4),m(6,"Variant"),l(),a(7,"th",4),m(8,"SKU"),l()()(),a(9,"tbody"),O(10,U,5,6,"tr",5,S),l()()()()),e&2&&(d("config",o.modalConfig),p(10),b(o.variants()))},dependencies:[P,v,A],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:#f6f6f6!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}"]})}}return i})();export{lt as a};
1
+ import{c as C}from"./chunk-EUYQST7Q.js";import{b as x,c as V,j as R,k as A}from"./chunk-HJXYT6MI.js";import{r as v}from"./chunk-MFQQEEHJ.js";import{d as P}from"./chunk-FXQKRJWU.js";import{Gb as y,Gc as m,Hc as g,Ra as u,Sc as E,Yb as d,ec as S,gc as O,hc as b,ic as a,jc as l,rb as p,tc as T,xb as f}from"./chunk-OJMQBH6T.js";var K=i=>({"bg-gradient-warning":i});function U(i,I){if(i&1&&(a(0,"tr",5)(1,"td"),m(2),l(),a(3,"td",6),m(4),l()()),i&2){let t=I.$implicit;d("matTooltip",t.duplicateMessage),p(2),g(t==null?null:t.Name),p(),d("ngClass",E(4,K,t.isDuplicate)),p(),g(t!=null&&t.ChannelVariationSKU?t==null?null:t.ChannelVariationSKU:"Not Assigned")}}var lt=(()=>{class i{constructor(t,e){this.data=t,this.dialogRef=e,this.variants=u([])}ngOnInit(){this.initModalConfig(),this.initVariants()}initVariants(){let t=this.data?.variants,e={},o=[],h=t.filter(n=>C.IsEmpty(n.ChannelVariationSKU));t.filter(n=>C.IsNotEmpty(n.ChannelVariationSKU)).forEach((n,r,M)=>{e[n.ChannelVariationSKU]=M.filter(s=>s.ChannelVariationSKU===n.ChannelVariationSKU)}),Object.keys(e).forEach(n=>{e[n].length>1&&(e[n]=e[n].map((r,M,s)=>{let _=`SKU ${r.ChannelVariationSKU} is duplicated with variant`;return s.forEach((c,L)=>{c.Name!==r.Name&&(_+=` ${s.length>2?c.Name+(L!==s.length-1?",":""):c.Name}`)}),r.duplicateMessage=_,r.isDuplicate=!0,r})),o.push(...e[n])}),o.push(...h),this.variants.set(o)}initModalConfig(){this.modalConfig=new R,this.modalConfig.title=this.data?.title,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0,this.modalConfig.bodyScrollable=!0}static{this.\u0275fac=function(e){return new(e||i)(f(V),f(x))}}static{this.\u0275cmp=y({type:i,selectors:[["app-modal-variants"]],standalone:!1,decls:12,vars:1,consts:[[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"sticky-top"],["matTooltipPosition","above",3,"matTooltip"],[3,"ngClass"]],template:function(e,o){e&1&&(a(0,"modal-material",0),T("onCancel",function(){return o.dialogRef.close()}),a(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4),m(6,"Variant"),l(),a(7,"th",4),m(8,"SKU"),l()()(),a(9,"tbody"),O(10,U,5,6,"tr",5,S),l()()()()),e&2&&(d("config",o.modalConfig),p(10),b(o.variants()))},dependencies:[P,v,A],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:#f6f6f6!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}"]})}}return i})();export{lt as a};
@@ -1 +1 @@
1
- import{a as be,b as ye}from"./chunk-TKV7XWBT.js";import{a as fe,b as Te}from"./chunk-YTCIQBSO.js";import{b as he}from"./chunk-IHSGQFDX.js";import{a as xe}from"./chunk-HIC5QC3Y.js";import{a as F}from"./chunk-UMP6ZMEJ.js";import{a as Ce}from"./chunk-C7YK5TDP.js";import{i as pe}from"./chunk-OLVWSY6L.js";import{c as z}from"./chunk-RXQX7567.js";import{d as ge,h as ue}from"./chunk-HJXYT6MI.js";import{A as le,b as oe,h as re,m as ae}from"./chunk-5PS6ZS3N.js";import{a as ce,b as _e,c as se}from"./chunk-ERXVXBTU.js";import{r as me,s as de}from"./chunk-MFQQEEHJ.js";import{d as J,f as Q,g as ee,i as te,m as ne,n as ie}from"./chunk-FXQKRJWU.js";import{$c as $,Fc as b,G as H,Gb as K,Gc as m,Hc as O,Ic as y,Ka as R,Kc as k,Lc as D,Mb as p,Mc as N,Oa as j,Ra as B,Sc as T,Tc as Y,Yb as s,ad as W,bd as G,ca as Z,cd as w,dc as S,ec as E,f as A,gc as M,hc as V,ic as c,jc as _,kc as I,lc as x,mc as h,nc as L,oc as C,pa as q,pb as v,rb as a,tc as f,uc as o,xb as P,xc as X,ya as d,za as g}from"./chunk-OJMQBH6T.js";var U=t=>[t],Se=t=>({"text-decoration-line-through":t}),Ie=t=>({"text-danger":t}),we=(t,l)=>({"bg-gradient-warning":t,"cell-hover pointer":l});function Fe(t,l){if(t&1){let e=C();c(0,"mat-slide-toggle",13),f("toggleChange",function(){d(e);let n=o();return n.toggleStatus=!n.toggleStatus,g(n.onToggle())}),c(1,"small",14),m(2),_()()}if(t&2){let e=o();a(2),y(" ",e.productToggleTitle?e.productToggleTitle:"FILTER DIFFERENT INVENTORY"," ")}}function Pe(t,l){if(t&1){let e=C();c(0,"th")(1,"input",16),N("ngModelChange",function(n){d(e);let r=o(2);return D(r.checkboxState,n)||(r.checkboxState=n),g(n)}),f("ngModelChange",function(){d(e);let n=o(2);return g(n.onCheckboxStateChange())}),_()()}if(t&2){let e=o(2);a(),k("ngModel",e.checkboxState)}}function Ee(t,l){if(t&1&&(p(0,Pe,2,1,"ng-template",15),c(1,"th",11),m(2,"POS"),_()),t&2){let e=o();s("ngxPermissionsOnly",T(1,U,e.rolePriceEdit))}}function Me(t,l){if(t&1&&(x(0),c(1,"th",17)(2,"div",18)(3,"div",19),I(4,"img",20),c(5,"div",21),m(6),$(7,"stringLimit"),_()()()(),h()),t&2){let e=l.$implicit;a(3),s("matTooltip",(e.Name==null?null:e.Name.length)>20?e.Name:""),a(),s("src",e==null?null:e.Img,v),a(2),y(" ",G(7,3,e.Name,20)," ")}}function Ve(t,l){t&1&&L(0)}function Oe(t,l){if(t&1&&p(0,Ve,1,0,"ng-container",33),t&2){o(2);let e=b(7);s("ngTemplateOutlet",e)}}function ke(t,l){if(t&1&&(x(0),p(1,Oe,1,1,"ng-template",15),h()),t&2){let e=o(4);a(),s("ngxPermissionsOnly",T(1,U,e.roleInventoryUpdate))}}function De(t,l){t&1&&L(0)}function Ne(t,l){if(t&1&&p(0,De,1,0,"ng-container",33),t&2){o(2);let e=b(7);s("ngTemplateOutlet",e)}}function $e(t,l){if(t&1&&p(0,Ne,1,1,"ng-template",15),t&2){let e=o(4);s("ngxPermissionsOnly",T(1,U,e.rolePriceEdit))}}function Ue(t,l){if(t&1){let e=C();x(0),c(1,"div")(2,"input",34),N("ngModelChange",function(n){d(e);let r=o(4).$implicit;return D(r.selected,n)||(r.selected=n),g(n)}),f("ngModelChange",function(){d(e);let n=o(4).$implicit,r=o();return g(r.onCheckboxStateProduct(n.ID))}),_()(),h()}if(t&2){let e=o(4).$implicit;a(2),k("ngModel",e.selected),s("disabled",!(e!=null&&e.Category))}}function Re(t,l){if(t&1&&p(0,Ue,3,2,"ng-container",22),t&2){let e=o(3).$implicit;s("ngIf",(e==null||e.Variants==null?null:e.Variants.length)>1)}}function je(t,l){if(t&1){let e=C();x(0),c(1,"img",35),f("click",function(n){d(e);let r=o(3).$implicit,u=o();return g(u.onZoomImage(n,r==null?null:r.ImageUrl))}),_(),h()}if(t&2){let e=o(3).$implicit;a(),X("src",e==null?null:e.ThumbnailUrl,v)}}function Be(t,l){t&1&&I(0,"img",36)}function Le(t,l){if(t&1&&(x(0),c(1,"td",28)(2,"div",29),p(3,ke,2,3,"ng-container",30)(4,$e,1,3,"ng-template",null,0,w)(6,Re,1,1,"ng-template",null,1,w),c(8,"div"),p(9,je,2,1,"ng-container",30)(10,Be,1,0,"ng-template",null,2,w),_()()(),c(12,"td",31)(13,"div"),m(14),_(),c(15,"small",32),m(16),_()(),h()),t&2){let e=b(5),i=b(11),n=o(2).$implicit,r=o();a(),s("rowSpan",n==null?null:n.Variants.length),a(2),s("ngIf",r.table=="inventory")("ngIfElse",e),a(6),s("ngIf",n==null?null:n.ThumbnailUrl)("ngIfElse",i),a(3),s("rowSpan",n==null?null:n.Variants.length),a(2),O(n==null?null:n.Name),a(),s("ngClass",T(9,Ie,!(n!=null&&n.Category))),a(),y("(",n!=null&&n.Category?n==null?null:n.Category:"Not Found In POS",")")}}function We(t,l){if(t&1&&(c(0,"a",27),I(1,"i",37),_()),t&2){let e=o().$implicit,i=o(2);s("href",i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),v)}}function ze(t,l){if(t&1){let e=C();c(0,"input",40),N("ngModelChange",function(n){d(e);let r=o(3).$implicit;return D(r.selected,n)||(r.selected=n),g(n)}),_()}if(t&2){let e=o(3).$implicit,i=o().$implicit;k("ngModel",e.selected),s("disabled",!(i!=null&&i.Category))}}function Ae(t,l){if(t&1&&(c(0,"td",38),p(1,ze,1,2,"input",39),_()),t&2){let e=o(2).$implicit,i=o(2);a(),s("ngIf",i.printPOS(e)>=0||i.table=="price")}}function He(t,l){if(t&1&&(p(0,Ae,2,1,"ng-template",15),c(1,"td",24),m(2),$(3,"number"),_()),t&2){let e=o().$implicit,i=o(2);s("ngxPermissionsOnly",T(4,U,i.rolePriceEdit)),a(2),O(W(3,2,i.printPOS(e)))}}function Ze(t,l){if(t&1){let e=C();x(0),c(1,"td",41),f("click",function(){d(e);let n=o().$implicit,r=o().$implicit,u=o().$implicit,ve=o();return g(ve.onUpdateData(u.Name,r,n.ID,u.ChannelItemID))}),c(2,"div",42)(3,"div",43),m(4),$(5,"number"),_(),c(6,"a",44),f("click",function(n){return d(e),g(n==null?null:n.stopPropagation())}),I(7,"i",37),_()()(),h()}if(t&2){let e=l.$implicit,i=o(2).$implicit,n=o(2);a(),s("ngClass",Y(5,we,n.printPOS(i)!=n.printItem(e)&&n.hiddenIPOSInventory()==!1,n.hasPriceEdit()&&n.table=="price"||n.hasInventoryEdit()&&n.table=="inventory")),a(3),y(" ",W(5,3,n.printItem(e))," "),a(2),s("href",e.Url,v)}}function qe(t,l){t&1&&(c(0,"td",45)(1,"div",42)(2,"span"),m(3,"X"),_()()())}function Ke(t,l){if(t&1&&p(0,Ze,8,8,"ng-container",30)(1,qe,4,0,"ng-template",null,3,w),t&2){let e=l.$implicit,i=b(2),n=o().$implicit,r=o(2);s("ngIf",r.getItemFromChannel(n,e))("ngIfElse",i)}}function Xe(t,l){if(t&1&&(c(0,"tr"),p(1,Le,17,11,"ng-container",22),c(2,"td",23),m(3),_(),c(4,"td",24)(5,"div",25)(6,"div",26),m(7),_(),c(8,"div",21),p(9,We,2,1,"a",27),_()()(),p(10,He,4,6),M(11,Ke,3,2,null,null,E),_()),t&2){let e=l.$implicit,i=l.$index,n=o().$implicit,r=o();a(),s("ngIf",i==0),a(2),O(e==null?null:e.Model),a(2),s("matTooltip",e.Discontinued?r.discontinuedVariantMsg:""),a(),s("ngClass",T(7,Se,e.Discontinued)),a(),y(" ",e.Code," "),a(2),S(n.Category?9:-1),a(),S(r.hiddenIPOSInventory()==!1?10:-1),a(),V(r.channel)}}function Ye(t,l){if(t&1&&(c(0,"tbody"),M(1,Xe,13,9,"tr",null,E),_()),t&2){let e=l.$implicit;a(),V(e.Variants)}}var vt=(()=>{class t{constructor(e,i,n){this.dialog=e,this.biggerPictureService=i,this.authService=n,this.permissionsService=q(ce),this.showProductToggle=!1,this.multiwarehouse=j(!1),this.hiddenIPOSInventory=j(!1),this.toggleStatus=!1,this.checkboxState=!1,this.rolePriceEdit=F.PriceUpdate,this.roleInventoryUpdate=F.InventoryUpdate,this.hasPriceEdit=B(!1),this.hasInventoryEdit=B(!1),this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.onSubmit=new R,this.destroy$=new A,this.toggle=new R,this.hostName=this.authService.getDomain()}ngOnInit(){this.initRoles(),this.table=="inventory"?this.stockHeader="Stock":this.table=="price"&&(this.stockHeader="Price")}initRoles(){this.permissionsService.hasPermission(F.InventoryUpdate).then(e=>this.hasInventoryEdit.set(e)),this.permissionsService.hasPermission(F.PriceUpdate).then(e=>this.hasPriceEdit.set(e))}onCheckboxStateProduct(e){let i=this.data.filter(n=>n.ID==e);i.length>0&&(i=i.map(n=>(n.Variants=n.Variants.map(r=>(r.selected=n.selected,r)),n)))}onCheckboxStateChange(){this.data=this.data.map(e=>(e.Variants=e.Variants.map(i=>(i.selected=this.checkboxState,i)),e))}getItemFromChannel(e,i){return e.Channel.find(r=>z.IsNotEmpty(i.LocationID)?r.LocationID==i.LocationID:r.ChannelID==i.ID)}printItem(e){if(this.table=="inventory")return e.Inventory;if(this.table=="price")return e.Price}onUpdateData(e,i,n,r){this.hasPriceEdit()&&this.table=="price"&&this.onOpenDialogUpdate(e,i,n,r),this.hasInventoryEdit()&&this.table=="inventory"&&this.onOpenDialogUpdate(e,i,n,r)}onOpenDialogUpdate(e,i,n,r){this.dialog.open(be,{data:{Name:e,Variant:i,ChannelID:n,Table:this.table,ChannelItemID:r}}).afterClosed().pipe(H(u=>z.IsNotEmpty(u)),Z(this.destroy$)).subscribe(u=>{this.onSubmit.emit(u)})}printPOS(e){return this.table=="inventory"?e.Inventory?e.Inventory:0:this.table=="price"?e.UnitPrice:null}onToggle(){this.toggle.emit(this.toggleStatus)}onZoomImage(e,i){this.biggerPictureService.openBiggerPicture(e,i)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(i){return new(i||t)(P(ge),P(Ce),P(pe))}}static{this.\u0275cmp=K({type:t,selectors:[["app-table"]],inputs:{data:"data",table:"table",channel:"channel",showProductToggle:"showProductToggle",productToggleTitle:"productToggleTitle",multiwarehouse:[1,"multiwarehouse"],hiddenIPOSInventory:[1,"hiddenIPOSInventory"]},outputs:{onSubmit:"onSubmit",toggle:"onToggle"},decls:17,vars:3,consts:[["PRICE",""],["checkbox_update",""],["elsePic",""],["elseCol",""],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","w-25"],[1,"w-100"],[2,"width","200px"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[4,"ngFor","ngForOf"],[2,"width","200px",3,"toggleChange"],[1,"fw-bold"],[3,"ngxPermissionsOnly"],["type","checkbox",3,"ngModelChange","ngModel"],["scope","col"],[1,"w-100","d-flex","align-items-center","justify-content-center"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],[4,"ngIf"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-end",3,"matTooltip"],[3,"ngClass"],["target","_blank",3,"href"],[1,"text-center",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-end"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"padding-left","0px",3,"rowSpan"],[1,"mt-1",3,"ngClass"],[4,"ngTemplateOutlet"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel","disabled"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"align-middle"],["type","checkbox",3,"ngModel","disabled","ngModelChange",4,"ngIf"],["type","checkbox",3,"ngModelChange","ngModel","disabled"],[1,"p-0",3,"click","ngClass"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2","mt-1"],["target","_blank",3,"click","href"],[1,"table-white","text-center",2,"color","red"]],template:function(i,n){i&1&&(c(0,"div",4)(1,"table",5)(2,"thead",6)(3,"tr")(4,"th",7)(5,"div",8)(6,"div"),m(7,"Product"),_(),p(8,Fe,3,1,"mat-slide-toggle",9),_()(),c(9,"th",10),m(10,"Variant"),_(),c(11,"th",11),m(12,"SKU"),_(),p(13,Ee,3,3)(14,Me,8,6,"ng-container",12),_()(),M(15,Ye,3,0,"tbody",null,E),_()()),i&2&&(a(8),S(n.showProductToggle?8:-1),a(5),S(n.hiddenIPOSInventory()==!1?13:-1),a(),s("ngForOf",n.channel),a(),V(n.data))},dependencies:[ie,J,Q,ee,te,ne,le,oe,re,ae,Te,fe,ue,xe,he,se,_e,de,me,ye],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}.text-wrapping[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:88px}.cell-hover[_ngcontent-%COMP%]{width:400px!important}"]})}}return t})();export{vt as a};
1
+ import{a as be,b as ye}from"./chunk-O2YNPIYM.js";import{a as fe,b as Te}from"./chunk-YTCIQBSO.js";import{b as he}from"./chunk-IHSGQFDX.js";import{a as xe}from"./chunk-HIC5QC3Y.js";import{a as F}from"./chunk-UMP6ZMEJ.js";import{a as Ce}from"./chunk-63ANFYRV.js";import{i as pe}from"./chunk-ZHPHANAW.js";import{c as z}from"./chunk-EUYQST7Q.js";import{d as ge,h as ue}from"./chunk-HJXYT6MI.js";import{A as le,b as oe,h as re,m as ae}from"./chunk-5PS6ZS3N.js";import{a as ce,b as _e,c as se}from"./chunk-ERXVXBTU.js";import{r as me,s as de}from"./chunk-MFQQEEHJ.js";import{d as J,f as Q,g as ee,i as te,m as ne,n as ie}from"./chunk-FXQKRJWU.js";import{$c as $,Fc as b,G as H,Gb as K,Gc as m,Hc as O,Ic as y,Ka as R,Kc as k,Lc as D,Mb as p,Mc as N,Oa as j,Ra as B,Sc as T,Tc as Y,Yb as s,ad as W,bd as G,ca as Z,cd as w,dc as S,ec as E,f as A,gc as M,hc as V,ic as c,jc as _,kc as I,lc as x,mc as h,nc as L,oc as C,pa as q,pb as v,rb as a,tc as f,uc as o,xb as P,xc as X,ya as d,za as g}from"./chunk-OJMQBH6T.js";var U=t=>[t],Se=t=>({"text-decoration-line-through":t}),Ie=t=>({"text-danger":t}),we=(t,l)=>({"bg-gradient-warning":t,"cell-hover pointer":l});function Fe(t,l){if(t&1){let e=C();c(0,"mat-slide-toggle",13),f("toggleChange",function(){d(e);let n=o();return n.toggleStatus=!n.toggleStatus,g(n.onToggle())}),c(1,"small",14),m(2),_()()}if(t&2){let e=o();a(2),y(" ",e.productToggleTitle?e.productToggleTitle:"FILTER DIFFERENT INVENTORY"," ")}}function Pe(t,l){if(t&1){let e=C();c(0,"th")(1,"input",16),N("ngModelChange",function(n){d(e);let r=o(2);return D(r.checkboxState,n)||(r.checkboxState=n),g(n)}),f("ngModelChange",function(){d(e);let n=o(2);return g(n.onCheckboxStateChange())}),_()()}if(t&2){let e=o(2);a(),k("ngModel",e.checkboxState)}}function Ee(t,l){if(t&1&&(p(0,Pe,2,1,"ng-template",15),c(1,"th",11),m(2,"POS"),_()),t&2){let e=o();s("ngxPermissionsOnly",T(1,U,e.rolePriceEdit))}}function Me(t,l){if(t&1&&(x(0),c(1,"th",17)(2,"div",18)(3,"div",19),I(4,"img",20),c(5,"div",21),m(6),$(7,"stringLimit"),_()()()(),h()),t&2){let e=l.$implicit;a(3),s("matTooltip",(e.Name==null?null:e.Name.length)>20?e.Name:""),a(),s("src",e==null?null:e.Img,v),a(2),y(" ",G(7,3,e.Name,20)," ")}}function Ve(t,l){t&1&&L(0)}function Oe(t,l){if(t&1&&p(0,Ve,1,0,"ng-container",33),t&2){o(2);let e=b(7);s("ngTemplateOutlet",e)}}function ke(t,l){if(t&1&&(x(0),p(1,Oe,1,1,"ng-template",15),h()),t&2){let e=o(4);a(),s("ngxPermissionsOnly",T(1,U,e.roleInventoryUpdate))}}function De(t,l){t&1&&L(0)}function Ne(t,l){if(t&1&&p(0,De,1,0,"ng-container",33),t&2){o(2);let e=b(7);s("ngTemplateOutlet",e)}}function $e(t,l){if(t&1&&p(0,Ne,1,1,"ng-template",15),t&2){let e=o(4);s("ngxPermissionsOnly",T(1,U,e.rolePriceEdit))}}function Ue(t,l){if(t&1){let e=C();x(0),c(1,"div")(2,"input",34),N("ngModelChange",function(n){d(e);let r=o(4).$implicit;return D(r.selected,n)||(r.selected=n),g(n)}),f("ngModelChange",function(){d(e);let n=o(4).$implicit,r=o();return g(r.onCheckboxStateProduct(n.ID))}),_()(),h()}if(t&2){let e=o(4).$implicit;a(2),k("ngModel",e.selected),s("disabled",!(e!=null&&e.Category))}}function Re(t,l){if(t&1&&p(0,Ue,3,2,"ng-container",22),t&2){let e=o(3).$implicit;s("ngIf",(e==null||e.Variants==null?null:e.Variants.length)>1)}}function je(t,l){if(t&1){let e=C();x(0),c(1,"img",35),f("click",function(n){d(e);let r=o(3).$implicit,u=o();return g(u.onZoomImage(n,r==null?null:r.ImageUrl))}),_(),h()}if(t&2){let e=o(3).$implicit;a(),X("src",e==null?null:e.ThumbnailUrl,v)}}function Be(t,l){t&1&&I(0,"img",36)}function Le(t,l){if(t&1&&(x(0),c(1,"td",28)(2,"div",29),p(3,ke,2,3,"ng-container",30)(4,$e,1,3,"ng-template",null,0,w)(6,Re,1,1,"ng-template",null,1,w),c(8,"div"),p(9,je,2,1,"ng-container",30)(10,Be,1,0,"ng-template",null,2,w),_()()(),c(12,"td",31)(13,"div"),m(14),_(),c(15,"small",32),m(16),_()(),h()),t&2){let e=b(5),i=b(11),n=o(2).$implicit,r=o();a(),s("rowSpan",n==null?null:n.Variants.length),a(2),s("ngIf",r.table=="inventory")("ngIfElse",e),a(6),s("ngIf",n==null?null:n.ThumbnailUrl)("ngIfElse",i),a(3),s("rowSpan",n==null?null:n.Variants.length),a(2),O(n==null?null:n.Name),a(),s("ngClass",T(9,Ie,!(n!=null&&n.Category))),a(),y("(",n!=null&&n.Category?n==null?null:n.Category:"Not Found In POS",")")}}function We(t,l){if(t&1&&(c(0,"a",27),I(1,"i",37),_()),t&2){let e=o().$implicit,i=o(2);s("href",i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),v)}}function ze(t,l){if(t&1){let e=C();c(0,"input",40),N("ngModelChange",function(n){d(e);let r=o(3).$implicit;return D(r.selected,n)||(r.selected=n),g(n)}),_()}if(t&2){let e=o(3).$implicit,i=o().$implicit;k("ngModel",e.selected),s("disabled",!(i!=null&&i.Category))}}function Ae(t,l){if(t&1&&(c(0,"td",38),p(1,ze,1,2,"input",39),_()),t&2){let e=o(2).$implicit,i=o(2);a(),s("ngIf",i.printPOS(e)>=0||i.table=="price")}}function He(t,l){if(t&1&&(p(0,Ae,2,1,"ng-template",15),c(1,"td",24),m(2),$(3,"number"),_()),t&2){let e=o().$implicit,i=o(2);s("ngxPermissionsOnly",T(4,U,i.rolePriceEdit)),a(2),O(W(3,2,i.printPOS(e)))}}function Ze(t,l){if(t&1){let e=C();x(0),c(1,"td",41),f("click",function(){d(e);let n=o().$implicit,r=o().$implicit,u=o().$implicit,ve=o();return g(ve.onUpdateData(u.Name,r,n.ID,u.ChannelItemID))}),c(2,"div",42)(3,"div",43),m(4),$(5,"number"),_(),c(6,"a",44),f("click",function(n){return d(e),g(n==null?null:n.stopPropagation())}),I(7,"i",37),_()()(),h()}if(t&2){let e=l.$implicit,i=o(2).$implicit,n=o(2);a(),s("ngClass",Y(5,we,n.printPOS(i)!=n.printItem(e)&&n.hiddenIPOSInventory()==!1,n.hasPriceEdit()&&n.table=="price"||n.hasInventoryEdit()&&n.table=="inventory")),a(3),y(" ",W(5,3,n.printItem(e))," "),a(2),s("href",e.Url,v)}}function qe(t,l){t&1&&(c(0,"td",45)(1,"div",42)(2,"span"),m(3,"X"),_()()())}function Ke(t,l){if(t&1&&p(0,Ze,8,8,"ng-container",30)(1,qe,4,0,"ng-template",null,3,w),t&2){let e=l.$implicit,i=b(2),n=o().$implicit,r=o(2);s("ngIf",r.getItemFromChannel(n,e))("ngIfElse",i)}}function Xe(t,l){if(t&1&&(c(0,"tr"),p(1,Le,17,11,"ng-container",22),c(2,"td",23),m(3),_(),c(4,"td",24)(5,"div",25)(6,"div",26),m(7),_(),c(8,"div",21),p(9,We,2,1,"a",27),_()()(),p(10,He,4,6),M(11,Ke,3,2,null,null,E),_()),t&2){let e=l.$implicit,i=l.$index,n=o().$implicit,r=o();a(),s("ngIf",i==0),a(2),O(e==null?null:e.Model),a(2),s("matTooltip",e.Discontinued?r.discontinuedVariantMsg:""),a(),s("ngClass",T(7,Se,e.Discontinued)),a(),y(" ",e.Code," "),a(2),S(n.Category?9:-1),a(),S(r.hiddenIPOSInventory()==!1?10:-1),a(),V(r.channel)}}function Ye(t,l){if(t&1&&(c(0,"tbody"),M(1,Xe,13,9,"tr",null,E),_()),t&2){let e=l.$implicit;a(),V(e.Variants)}}var vt=(()=>{class t{constructor(e,i,n){this.dialog=e,this.biggerPictureService=i,this.authService=n,this.permissionsService=q(ce),this.showProductToggle=!1,this.multiwarehouse=j(!1),this.hiddenIPOSInventory=j(!1),this.toggleStatus=!1,this.checkboxState=!1,this.rolePriceEdit=F.PriceUpdate,this.roleInventoryUpdate=F.InventoryUpdate,this.hasPriceEdit=B(!1),this.hasInventoryEdit=B(!1),this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.onSubmit=new R,this.destroy$=new A,this.toggle=new R,this.hostName=this.authService.getDomain()}ngOnInit(){this.initRoles(),this.table=="inventory"?this.stockHeader="Stock":this.table=="price"&&(this.stockHeader="Price")}initRoles(){this.permissionsService.hasPermission(F.InventoryUpdate).then(e=>this.hasInventoryEdit.set(e)),this.permissionsService.hasPermission(F.PriceUpdate).then(e=>this.hasPriceEdit.set(e))}onCheckboxStateProduct(e){let i=this.data.filter(n=>n.ID==e);i.length>0&&(i=i.map(n=>(n.Variants=n.Variants.map(r=>(r.selected=n.selected,r)),n)))}onCheckboxStateChange(){this.data=this.data.map(e=>(e.Variants=e.Variants.map(i=>(i.selected=this.checkboxState,i)),e))}getItemFromChannel(e,i){return e.Channel.find(r=>z.IsNotEmpty(i.LocationID)?r.LocationID==i.LocationID:r.ChannelID==i.ID)}printItem(e){if(this.table=="inventory")return e.Inventory;if(this.table=="price")return e.Price}onUpdateData(e,i,n,r){this.hasPriceEdit()&&this.table=="price"&&this.onOpenDialogUpdate(e,i,n,r),this.hasInventoryEdit()&&this.table=="inventory"&&this.onOpenDialogUpdate(e,i,n,r)}onOpenDialogUpdate(e,i,n,r){this.dialog.open(be,{data:{Name:e,Variant:i,ChannelID:n,Table:this.table,ChannelItemID:r}}).afterClosed().pipe(H(u=>z.IsNotEmpty(u)),Z(this.destroy$)).subscribe(u=>{this.onSubmit.emit(u)})}printPOS(e){return this.table=="inventory"?e.Inventory?e.Inventory:0:this.table=="price"?e.UnitPrice:null}onToggle(){this.toggle.emit(this.toggleStatus)}onZoomImage(e,i){this.biggerPictureService.openBiggerPicture(e,i)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(i){return new(i||t)(P(ge),P(Ce),P(pe))}}static{this.\u0275cmp=K({type:t,selectors:[["app-table"]],inputs:{data:"data",table:"table",channel:"channel",showProductToggle:"showProductToggle",productToggleTitle:"productToggleTitle",multiwarehouse:[1,"multiwarehouse"],hiddenIPOSInventory:[1,"hiddenIPOSInventory"]},outputs:{onSubmit:"onSubmit",toggle:"onToggle"},decls:17,vars:3,consts:[["PRICE",""],["checkbox_update",""],["elsePic",""],["elseCol",""],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","w-25"],[1,"w-100"],[2,"width","200px"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[4,"ngFor","ngForOf"],[2,"width","200px",3,"toggleChange"],[1,"fw-bold"],[3,"ngxPermissionsOnly"],["type","checkbox",3,"ngModelChange","ngModel"],["scope","col"],[1,"w-100","d-flex","align-items-center","justify-content-center"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],[4,"ngIf"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-end",3,"matTooltip"],[3,"ngClass"],["target","_blank",3,"href"],[1,"text-center",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-end"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"padding-left","0px",3,"rowSpan"],[1,"mt-1",3,"ngClass"],[4,"ngTemplateOutlet"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel","disabled"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"align-middle"],["type","checkbox",3,"ngModel","disabled","ngModelChange",4,"ngIf"],["type","checkbox",3,"ngModelChange","ngModel","disabled"],[1,"p-0",3,"click","ngClass"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2","mt-1"],["target","_blank",3,"click","href"],[1,"table-white","text-center",2,"color","red"]],template:function(i,n){i&1&&(c(0,"div",4)(1,"table",5)(2,"thead",6)(3,"tr")(4,"th",7)(5,"div",8)(6,"div"),m(7,"Product"),_(),p(8,Fe,3,1,"mat-slide-toggle",9),_()(),c(9,"th",10),m(10,"Variant"),_(),c(11,"th",11),m(12,"SKU"),_(),p(13,Ee,3,3)(14,Me,8,6,"ng-container",12),_()(),M(15,Ye,3,0,"tbody",null,E),_()()),i&2&&(a(8),S(n.showProductToggle?8:-1),a(5),S(n.hiddenIPOSInventory()==!1?13:-1),a(),s("ngForOf",n.channel),a(),V(n.data))},dependencies:[ie,J,Q,ee,te,ne,le,oe,re,ae,Te,fe,ue,xe,he,se,_e,de,me,ye],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}.text-wrapping[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:88px}.cell-hover[_ngcontent-%COMP%]{width:400px!important}"]})}}return t})();export{vt as a};
@@ -0,0 +1 @@
1
+ import{a as k}from"./chunk-PIBVGTHJ.js";import{a as Ve}from"./chunk-GH5FTODR.js";import{a as Y}from"./chunk-UMP6ZMEJ.js";import{d as Ce,e as fe}from"./chunk-PYXL7UF7.js";import{a as Me,c as be}from"./chunk-DPAQQ77L.js";import"./chunk-5CKVZBHM.js";import{b as ke,c as Ee}from"./chunk-F2T43CJB.js";import"./chunk-BKRCW7SH.js";import{c as Te,d as De}from"./chunk-BDBETNFT.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import{a as ue}from"./chunk-Z3ITXK3D.js";import"./chunk-YQLOB7IQ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import"./chunk-CGOB6Y3X.js";import{b as Z}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{c as de}from"./chunk-EUYQST7Q.js";import{b as xe,c as te,d as ye,j as Se,k as ve,m as Ue,n as we}from"./chunk-HJXYT6MI.js";import{A as H,b as me,h as q,m as j}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import{a as _e,b as ge,c as he}from"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{H as ce,J as pe,j as $,n as z}from"./chunk-FXQKRJWU.js";import{$b as K,$c as F,G as se,Gb as B,Gc as g,Hc as Q,Ic as D,Kb as le,Kc as U,Lc as w,Mb as f,Mc as M,Nc as O,Oc as N,Pc as h,Qc as W,Ra as S,Rc as X,Sc as ee,Yb as _,Z as E,ad as A,dc as v,ea as J,ec as V,gc as P,hc as I,ic as o,jc as s,kc as L,lc as b,mc as T,oc as y,pa as x,pb as ae,q as oe,rb as a,rd as R,tc as C,uc as l,v as G,ya as c,za as p}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{a as ne,b as re}from"./chunk-66YHNWRR.js";var ie=function(i){return i.ERROR="https://resc.cloudinary.com/pos/image/upload/v1705387550/POS/Images/Cashier/globalerror.svg",i.UNAUTHORIZED="https://resc.cloudinary.com/pos/image/upload/v1702547639/POS/Images/Dashboard/locked.svg",i.EMPTY_LIST="https://resc.cloudinary.com/pos/image/upload/v1705388070/POS/Images/Cashier/globalnodata.svg",i.REMOVE="https://resc.cloudinary.com/pos/image/upload/v1706156973/icons/globalerrorclear.svg",i}(ie||{});var Pe=()=>({display:"d-flex"});function Ae(i,m){if(i&1&&(o(0,"div",6),L(1,"img",9),o(2,"p",10),g(3," All users already migrated. "),s()()),i&2){let e=l();a(),_("src",e.emptyStateIcon,ae)}}function Re(i,m){if(i&1){let e=y();o(0,"div",14)(1,"p-checkBox",15),M("ngModelChange",function(t){let n=c(e).$implicit;return w(n.selected,t)||(n.selected=t),p(t)}),C("ngModelChange",function(){c(e);let t=l(2),n=h(0);return p(t.onUserCheckChange(n))}),s(),o(2,"label",16),g(3),s()()}if(i&2){let e=m.$implicit;a(),K(X(7,Pe)),_("binary",!0)("id",e.ID),U("ngModel",e.selected),a(),_("for",e.ID),a(),D(" ",e.Name," ")}}function Ge(i,m){if(i&1){let e=y();o(0,"div",11)(1,"p-checkBox",12),M("ngModelChange",function(t){c(e);let n=l();return w(n.isCheckAll,t)||(n.isCheckAll=t),p(t)}),C("ngModelChange",function(t){c(e);let n=l(),d=h(0);return p(n.onCheckAllChange(t,d))}),s(),o(2,"label",13),g(3," Check All "),s()(),P(4,Re,4,8,"div",14,V)}if(i&2){let e=l(),r=h(0);a(),K(X(4,Pe)),_("binary",!0),U("ngModel",e.isCheckAll),a(3),I(r)}}var Ie=(()=>{class i extends be{constructor(){super(),this.dialogRef=x(xe),this.data=x(te),this.userService=x(k),this.dialogData=x(te),this.toastr=x(Z),this.userGroups=R(()=>this.dialogData.userGroups||[]),this.availableUsers=R(()=>{let e=new Map;return this.dialogData.availableUsers.forEach(r=>e.set(r.ID,r)),e}),this.migrateLoader$=this.userService.getUserMigrateLoader().pipe(G(e=>e.Data),G(e=>e.filter(t=>this.availableUsers().has(t.ID)===!1)),G(e=>e.map(t=>(t.selected=!0,t))),E(1)),this.isCheckAll=S(!0),this.selectedGroup=S(null),this.emptyStateIcon=ie.EMPTY_LIST,this.config=new Se,this.config.title="Migrate Users",this.config.customWidth="600px"}ngAfterViewInit(){this.initTopPosition()}ngOnDestroy(){this.stopOverlayObserver()}onUserCheckChange(e){let r=e.every(t=>t.selected);this.isCheckAll.set(r)}onCheckAllChange(e,r){this.isCheckAll.set(e),r.forEach(t=>t.selected=e)}onClose(){this.dialogRef.close(!1)}onSubmit(e){let r=e.filter(n=>n.selected);if(r.length===0){this.toastr.error("Please select at least one user","Error");return}if(de.IsEmpty(this.selectedGroup())){this.toastr.error("Please select a user group","Error");return}let t={userIds:r.map(n=>n.ID),groupId:this.selectedGroup()};this.userService.migrateUser(t).subscribe(()=>{this.dialogRef.close(!0),this.toastr.success("Users migrated successfully","Success")})}onClickSelect(){setTimeout(()=>{this.adjustOverlayPosition()},0)}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=B({type:i,selectors:[["app-migrate-dialog"]],features:[W([k]),le],decls:15,vars:8,consts:[[3,"onClose","onCancel","onOk","config"],["content",""],[1,"row"],[1,"col","border-end"],[1,"modal-title","mb-8"],[1,"user-list-scroll","mt-5",2,"max-height","300x","overflow-y","auto","overflow-x","hidden","box-sizing","border-box"],[1,"d-flex","flex-column","align-items-center","mt-5"],[1,"col"],["optionLabel","Name","optionValue","ID","placeholder","Select a group","filterBy","Name","appendTo","body",1,"w-100",3,"click","ngModelChange","options","filter","ngModel"],["alt","No users found",2,"width","100px","height","100px",3,"src"],[1,"text-muted","mt-4","opacity-50",2,"margin-bottom","0px"],[1,"d-flex","w-100","align-items-center","mb-4"],["id","checkBoxAll",3,"ngModelChange","binary","ngModel"],["for","checkBoxAll",1,"ms-2"],[1,"d-flex","w-100","align-items-center","mb-3","ms-10"],[3,"ngModelChange","binary","id","ngModel"],[1,"ms-2",3,"for"]],template:function(r,t){if(r&1){let n=y();O(0),F(1,"async"),o(2,"modal-material",0),C("onClose",function(){return c(n),p(t.onClose())})("onCancel",function(){return c(n),p(t.onClose())})("onOk",function(){c(n);let u=h(0);return p(t.onSubmit(u))}),o(3,"div",1)(4,"div",2)(5,"div",3)(6,"h5",4),g(7,"Users from POS"),s(),o(8,"div",5),f(9,Ae,4,1,"div",6)(10,Ge,6,5),s()(),o(11,"div",7)(12,"h5",4),g(13,"Assign Group"),s(),o(14,"p-select",8),C("click",function(){return c(n),p(t.onClickSelect())}),M("ngModelChange",function(u){return c(n),w(t.selectedGroup,u)||(t.selectedGroup=u),p(u)}),s()()()()()}if(r&2){let n=N(A(1,5,t.migrateLoader$));a(2),_("config",t.config),a(7),v((n==null?null:n.length)===0?9:10),a(5),_("options",t.userGroups())("filter",!0),U("ngModel",t.selectedGroup)}},dependencies:[z,$,ve,H,q,j,Te,Me],styles:[".user-list-scroll[_ngcontent-%COMP%]{max-height:160px;overflow-y:auto;overflow-x:hidden;box-sizing:border-box}"]})}}return i})();var Le=i=>({ID:i});function Be(i,m){if(i&1){let e=y();o(0,"button",13),C("click",function(){c(e);let t=l(2),n=h(0);return p(t.onDeleteUser(n==null?null:n.Filter))}),L(1,"i",14),g(2),s()}if(i&2){let e,r=l(2);a(2),D(" Delete (",(e=r.selectedUsers())==null?null:e.length,") ")}}function We(i,m){if(i&1&&(b(0),f(1,Be,3,1,"button",12),T()),i&2){let e,r=l();a(),v(((e=r.selectedUsers())==null?null:e.length)>0?1:-1)}}function $e(i,m){if(i&1){let e=y();b(0),o(1,"button",15),C("click",function(){c(e);let t=l(),n=h(0),d=h(2);return p(t.onMigrateUser(n==null||n.Options==null?null:n.Options.Groups,d==null?null:d.Data))}),g(2," Migrate "),s(),T()}}function ze(i,m){i&1&&(b(0),o(1,"a",16),g(2," Invite "),s(),T())}function qe(i,m){if(i&1){let e=y();b(0),o(1,"th",17)(2,"div",18)(3,"input",19),C("change",function(t){c(e);let n=l(),d=h(2);return p(n.onCheckAllUser(t.target.checked,d==null?null:d.Data))}),s()()(),T()}}function je(i,m){if(i&1){let e=y();o(0,"div",18)(1,"input",23),M("ngModelChange",function(t){c(e);let n=l(2).$implicit;return w(n.checked,t)||(n.checked=t),p(t)}),C("ngModelChange",function(){c(e);let t=l(3),n=h(2);return p(t.onSelectUser(n==null?null:n.Data))}),s()()}if(i&2){let e=l(2).$implicit;a(),U("ngModel",e.checked)}}function He(i,m){if(i&1&&(b(0),o(1,"td"),f(2,je,2,1,"div",18),s(),T()),i&2){let e,r=l().$implicit,t=l();a(2),v(r.Name!==((e=t.currentLoginUser())==null?null:e.username)?2:-1)}}function Ye(i,m){if(i&1&&(o(0,"a",20),g(1),s()),i&2){let e=l().$implicit;_("queryParams",ee(2,Le,e.UserID)),a(),D(" ",e.Name," ")}}function Ze(i,m){if(i&1&&(o(0,"span"),g(1),s()),i&2){let e=l().$implicit;a(),Q(e.Name)}}function Je(i,m){if(i&1&&(o(0,"a",21),g(1),s()),i&2){let e=l().$implicit;_("queryParams",ee(2,Le,e.GroupID)),a(),D(" ",e.GroupName," ")}}function Ke(i,m){if(i&1&&(o(0,"span"),g(1),s()),i&2){let e=l().$implicit;a(),Q(e.GroupName)}}function Qe(i,m){if(i&1&&L(0,"p-chip",24),i&2){let e=m.$implicit;_("label",e.Name)("image",e.Logo)("alt",e.Name)}}function Xe(i,m){if(i&1&&P(0,Qe,1,3,"p-chip",24,V),i&2){let e=l().$implicit;I(e.Channels)}}function et(i,m){i&1&&(o(0,"span"),g(1,"All Channels"),s())}function tt(i,m){if(i&1&&(o(0,"tr"),f(1,He,3,1,"ng-container",3),o(2,"td"),f(3,Ye,2,4,"a",20)(4,Ze,2,1,"span"),s(),o(5,"td"),f(6,Je,2,4,"a",21)(7,Ke,2,1,"span"),s(),o(8,"td")(9,"div",22),f(10,Xe,2,0)(11,et,2,0,"span"),s()()()),i&2){let e=m.$implicit,r=l();a(),_("ngxPermissionsOnly",r.userDeleteRole),a(2),v(r.hasUserEditRole()?3:4),a(3),v(r.hasUserEditRole()?6:7),a(4),v((e.Channels==null?null:e.Channels.length)>0?10:11)}}function it(i,m){if(i&1){let e=y();o(0,"app-mat-paginator-no-count",25),C("next",function(){c(e);let t=l(),n=h(0);return p(t.onNextPage(n==null?null:n.Filter))})("previous",function(){c(e);let t=l(),n=h(0);return p(t.onPrevPage(n==null?null:n.Filter))}),s()}if(i&2){l();let e=h(0),r=h(2);_("filter",e==null?null:e.Filter)("totaldata",r==null||r.Data==null?null:r.Data.length)("paginationTotal",r==null?null:r.Count)("hasClicked",!0)("alwaysShowNextButton",!0)}}var zt=(()=>{class i{constructor(){this.usersService=x(k),this.permissionService=x(_e),this.toastService=x(Z),this.dialog=x(ye),this.userInviteOptions=S([]),this.searchText=S(null),this.selectedGroup=S(null),this.userLoader$=this.usersService.getLoader().pipe(J(e=>{this.userInviteOptions.set(e.Options.Users),this.initUsers(e.Filter)}),E(1)),this.users$=oe({Count:0,Data:[]}),this.userAddRole=Y.UserInvite,this.userDeleteRole=Y.UserDelete,this.hasUserEditRole=S(!1),this.selectedUsers=S([]),this.currentLoginUser=R(()=>{let e=localStorage.getItem(ue.AUTHORIZATION);return e?JSON.parse(e):null}),this.permissionService.hasPermission(Y.UserEdit).then(e=>{this.hasUserEditRole.set(e)})}initUsers(e){let r=re(ne({},e),{Name:this.searchText(),GroupID:this.selectedGroup()});this.users$=this.usersService.getUsers(r).pipe(J(t=>this.filterUserInvtiteOptions(t.Data)),E(1))}filterUserInvtiteOptions(e){this.userInviteOptions.update(r=>r.filter(t=>e.findIndex(n=>n.UserID===t.ID)===-1))}onCheckAllUser(e,r){r.forEach(n=>{n.Name!==this.currentLoginUser()?.username&&(n.checked=e)});let t=r.filter(n=>n.checked);this.selectedUsers.set(t)}onSelectUser(e){let r=e.filter(t=>t.checked);this.selectedUsers.set(r)}onDeleteUser(e={PageNumber:1,PageSize:10}){let r=this.selectedUsers().map(n=>n.UserID);confirm("Are you sure you want to delete selected users?")&&this.usersService.deleteUsers(r).subscribe(()=>{this.selectedUsers.set([]),this.toastService.success("User deleted successfully","Success"),this.initUsers(e)})}onMigrateUser(e,r){this.dialog.open(Ie,{data:{userGroups:e,availableUsers:r}}).afterClosed().pipe(se(t=>t===!0)).subscribe(()=>{this.initUsers({PageNumber:1,PageSize:10})})}onNextPage(e){e.PageNumber+=1,this.initUsers(e)}onPrevPage(e){e.PageNumber-=1,this.initUsers(e)}onSuccessUpdateUser(e){e.PageNumber=1,this.initUsers(e)}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=B({type:i,selectors:[["app-users"]],features:[W([k])],decls:33,vars:17,consts:[["headerTitle","Users","description","Manage your users and their permissions",3,"textChange","onSubmit","text"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","Name","bindValue","ID","placeholder","Select Group",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[4,"ngxPermissionsOnly"],[1,"container-fluid"],[1,"row","mt-6"],[1,"col-12"],[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","15%"],[3,"filter","totaldata","paginationTotal","hasClicked","alwaysShowNextButton"],[3,"onSuccessUpdateUser","groups","users"],[1,"btn","btn-danger","me-3"],[1,"btn","btn-danger","me-3",3,"click"],[1,"fa","fa-trash","me-1"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["role","button","routerLink","/menu/users/users/form",1,"btn","btn-success"],[2,"width","5px"],[1,"d-flex"],["name","selectAll","type","checkbox",3,"change"],["routerLink","/menu/users/users/info",3,"queryParams"],["routerLink","/menu/users/groups/info",3,"queryParams"],[1,"lh-base"],["type","checkbox",3,"ngModelChange","ngModel"],[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"],[3,"next","previous","filter","totaldata","paginationTotal","hasClicked","alwaysShowNextButton"]],template:function(r,t){if(r&1){let n=y();O(0),F(1,"async"),O(2),F(3,"async"),o(4,"mainpanel",0),M("textChange",function(u){return c(n),w(t.searchText,u)||(t.searchText=u),p(u)}),C("onSubmit",function(){c(n);let u=h(0);return p(t.initUsers(u==null?null:u.Filter))}),o(5,"filters")(6,"div")(7,"label",1),g(8,"Group"),s(),o(9,"ng-select",2),M("ngModelChange",function(u){return c(n),w(t.selectedGroup,u)||(t.selectedGroup=u),p(u)}),s()()(),o(10,"actions"),f(11,We,2,1,"ng-container",3)(12,$e,3,0,"ng-container",3)(13,ze,3,0,"ng-container",3),s(),o(14,"content")(15,"div",4)(16,"div",5)(17,"div",6)(18,"table",7)(19,"thead",8)(20,"tr"),f(21,qe,4,0,"ng-container",3),o(22,"th",9),g(23,"Login ID"),s(),o(24,"th",9),g(25,"Group"),s(),o(26,"th"),g(27,"Channel"),s()()(),o(28,"tbody"),P(29,tt,12,4,"tr",null,V),s()(),f(31,it,1,5,"app-mat-paginator-no-count",10),s()()()()(),o(32,"invite-group",11),C("onSuccessUpdateUser",function(){c(n);let u=h(0);return p(t.onSuccessUpdateUser(u==null?null:u.Filter))}),s()}if(r&2){let n=N(A(1,11,t.userLoader$));a(2);let d=N(A(3,14,t.users$));a(2),U("text",t.searchText),a(5),_("clearable",!0)("items",n==null||n.Options==null?null:n.Options.Groups),U("ngModel",t.selectedGroup),a(2),_("ngxPermissionsOnly",t.userDeleteRole),a(),_("ngxPermissionsOnly",t.userAddRole),a(),_("ngxPermissionsOnly",t.userAddRole),a(8),_("ngxPermissionsOnly",t.userDeleteRole),a(8),I(d==null?null:d.Data),a(2),v(n?31:-1),a(),_("groups",n==null||n.Options==null?null:n.Options.Groups)("users",t.userInviteOptions())}},dependencies:[z,$,we,Ue,pe,ce,Ve,he,ge,fe,Ce,H,me,q,j,De,Ee,ke],encapsulation:2})}}return i})();export{zt as UsersComponent};
@@ -1,4 +1,4 @@
1
- import{a as wt}from"./chunk-RHHHL4OR.js";import{b as vt}from"./chunk-IHSGQFDX.js";import{a as Tt}from"./chunk-HIC5QC3Y.js";import{a as mt}from"./chunk-UMP6ZMEJ.js";import{b as pt,e as dt}from"./chunk-WN5DZGA4.js";import{b as ct}from"./chunk-RXQX7567.js";import{b as _t,c as Ct,h as bt,j as xt,k as Pt}from"./chunk-HJXYT6MI.js";import{A as lt,c as at,h as rt,m as st}from"./chunk-5PS6ZS3N.js";import{a as gt,c as ut}from"./chunk-ERXVXBTU.js";import{r as ht,s as ft}from"./chunk-MFQQEEHJ.js";import{g as L,i as ot,m as $,n as R}from"./chunk-FXQKRJWU.js";import{$c as I,Fc as V,G as W,Gb as S,Gc as m,Hc as w,Ic as A,Jb as Z,K as z,Ka as D,Kc as et,Lc as it,Mb as u,Mc as nt,Oa as f,Ra as C,X as J,Yb as h,Z as Y,ad as y,ca as q,cd as U,dc as P,ea as F,f as H,fa as K,g as G,ic as r,ja as M,jc as s,kc as j,lc as T,mc as v,nc as tt,oa as Q,oc as _,pa as X,rb as a,rd as N,tc as b,uc as l,v as x,xb as E,ya as d,za as g}from"./chunk-OJMQBH6T.js";function Mt(i,p){i&1&&tt(0)}function Dt(i,p){if(i&1&&(T(0),u(1,Mt,1,0,"ng-container",5),v()),i&2){l(2);let t=V(4);a(),h("ngTemplateOutlet",t)}}function Et(i,p){if(i&1&&(r(0,"div",6)(1,"label"),m(2,"Editing Data"),s(),r(3,"div")(4,"span"),m(5),I(6,"number"),s()()()),i&2){let t=l(2);a(5),w(y(6,1,t.value))}}function St(i,p){if(i&1&&(T(0),u(1,Dt,2,1,"ng-container",4)(2,Et,7,3,"ng-template",null,1,U),v()),i&2){let t=V(3),e=l();a(),h("ngIf",e.hasPriceEdit)("ngIfElse",t)}}function Vt(i,p){if(i&1){let t=_();r(0,"div",7)(1,"input",8),nt("ngModelChange",function(n){d(t);let o=l();return it(o.value,n)||(o.value=n),g(n)}),s(),r(2,"label",9),m(3),s()()}if(i&2){let t=l();a(),et("ngModel",t.value),h("max",t.maxEditInventory),a(2),w(t.item.Table)}}var te=(()=>{class i{constructor(t,e,n){this.dialogRef=t,this.item=e,this.permissionService=n,this.maxEditInventory=1e5,this.permissionService.hasPermission(mt.PriceUpdate).then(o=>this.hasPriceEdit=o)}ngOnInit(){this.selectedChannel=this.item.Variant.Channel.find(t=>t.ChannelID==this.item.ChannelID),this.selectedChannel.ID=this.item.Variant.ID,this.selectedChannel.Sku=this.item.Variant.Code,this.item.Table=="inventory"?(this.value=this.selectedChannel.Inventory,this.maxEditInventory=this.selectedChannel?.TypeID==ct.Tokopedia?1e5:null):this.item.Table=="price"&&(this.value=this.selectedChannel.Price,this.maxEditInventory=null),this.selectedChannel.ItemName=this.item.Name,this.selectedChannel.VarName=this.item.Variant.Model,this.initModalConfig()}initModalConfig(){let t=this.item.Table=="inventory"?"Update Inventory":"Update Price";this.modalConfig=new xt,this.modalConfig.title=`${t} ${this.item?.Name} in ${this.selectedChannel?.Title}`}onSubmit(){this.item.Table=="inventory"?this.selectedChannel.Inventory=this.value:this.item.Table=="price"&&(this.selectedChannel.Price=this.value),this.dialogRef.close(this.selectedChannel)}onClose(){this.dialogRef.close()}static{this.\u0275fac=function(e){return new(e||i)(E(_t),E(Ct),E(gt))}}static{this.\u0275cmp=S({type:i,selectors:[["app-table-dialog"]],decls:5,vars:4,consts:[["INVENTORY",""],["DISABLED",""],[3,"onClose","onCancel","onOk","dynamicValidated","config"],["content",""],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],["matTooltipPosition","above","matTooltip","Cannot edit Unit Price because you dont have access ProductEditor role",1,"info-label-group","mt-3",2,"background","#e9ecef","opacity","1"],[1,"form-label-group","mt-3"],["type","text","name","edit","autoNum","",1,"form-control",3,"ngModelChange","ngModel","max"],["for","edit",1,"text-capitalize"]],template:function(e,n){if(e&1){let o=_();r(0,"modal-material",2),b("onClose",function(){return d(o),g(n.onClose())})("onCancel",function(){return d(o),g(n.onClose())})("onOk",function(){return d(o),g(n.onSubmit())}),r(1,"div",3),u(2,St,4,2,"ng-container",4)(3,Vt,4,3,"ng-template",null,0,U),s()()}if(e&2){let o=V(4);h("dynamicValidated",n.value)("config",n.modalConfig),a(2),h("ngIf",n.item.Table=="price")("ngIfElse",o)}},dependencies:[R,L,ot,$,bt,Tt,vt,wt,Pt,lt,at,rt,st,ut,ft,ht],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-left:1rem;margin-right:1rem}.mat-dialog-content[_ngcontent-%COMP%]{padding-left:.5rem;padding-right:.5rem;margin-left:.5rem;margin-right:.5rem}.font-lg[_ngcontent-%COMP%]{font-size:large}.font-lgr[_ngcontent-%COMP%]{font-size:larger}"]})}}return i})();var ie=(()=>{class i{transform(t,e,n=0){if(!t)return t;let o=e?parseInt(e,10):10;return t.length>o?t.substring(n,o)+"...":t}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275pipe=Z({name:"stringLimit",type:i,pure:!0})}}return i})();function Lt(i,p){if(i&1){let t=_();r(0,"span",6),b("click",function(){d(t);let n=l();return g(n.onGetRowCount())}),r(1,"i",7),m(2,"?"),s()()}}function $t(i,p){if(i&1&&(T(0),r(1,"span"),m(2),I(3,"number"),s(),v()),i&2){let t=l();a(2),w(y(3,1,t.rowCount()))}}function Rt(i,p){if(i&1){let t=_();r(0,"a",10),b("click",function(){d(t);let n=l(2);return g(n.onNextPage())}),j(1,"i",11),m(2," Next"),s()}}function Ot(i,p){if(i&1){let t=_();r(0,"a",12),b("click",function(){d(t);let n=l(2);return g(n.onLastPage())}),j(1,"i",13),m(2," Last"),s()}}function kt(i,p){if(i&1&&(r(0,"div",5),u(1,Rt,3,0,"a",8)(2,Ot,3,0,"a",9),s()),i&2){let t=l();a(),P(t.disableNextButton()&&!t.goToLastPage()?1:-1),a(),P(t.disableNextButton()&&!t.goToLastPage()?2:-1)}}var le=(()=>{class i{constructor(){this.totalData=f(0),this.rowCount=f(),this.pageNumber=f(),this.disableNextButton=f(),this.goToLastPage=f(),this.hideCount=f(),this.nextPage=new D,this.lastPage=new D,this.getRowCount=new D}onNextPage(){this.nextPage.emit()}onLastPage(){this.lastPage.emit()}onGetRowCount(){this.getRowCount.emit()}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275cmp=S({type:i,selectors:[["infinite-paginator"]],inputs:{totalData:[1,"totalData"],rowCount:[1,"rowCount"],pageNumber:[1,"pageNumber"],disableNextButton:[1,"disableNextButton"],goToLastPage:[1,"goToLastPage"],hideCount:[1,"hideCount"]},outputs:{nextPage:"onNextPage",lastPage:"onLastPage",getRowCount:"onGetRowCount"},decls:9,vars:7,consts:[[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"],[2,"cursor","pointer"],[4,"ngIf"],[1,"btn-group"],[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"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary","border-start-0"],["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","border-start-0",3,"click"],[1,"fas","fa-share"]],template:function(e,n){e&1&&(r(0,"div",0)(1,"div",1)(2,"div",2),m(3),I(4,"number"),u(5,Lt,3,0,"span",3)(6,$t,4,3,"ng-container",4),m(7),s()(),u(8,kt,3,2,"div",5),s()),e&2&&(a(3),A(" Showing 1 - ",y(4,5,n.totalData())," of "),a(2),P(n.hideCount()?5:-1),a(),h("ngIf",!n.hideCount()&&n.rowCount()),a(),A(" records ~ ",n.pageNumber()," Page "),a(),P(n.totalData()>0?8:-1))},dependencies:[R,L,$],encapsulation:2})}}return i})();var ue=(()=>{class i{constructor(t){this.http=t,this.pagination$=new G(null),this._pageNumber=C(1),this.pageNumber=N(()=>this._pageNumber()),this._hideCount=C(!0),this.hideCount=N(()=>this._hideCount()),this._disableNextButton=C(!0),this.disableNextButton=N(()=>this._disableNextButton()),this._goToLastPage=C(!1),this.isLastPage=N(()=>this._goToLastPage()),this.totalData=C(0),this.destroy$=new H,this.data$=this.paginationFunction()}onNextPage(t){t.PageNumber+=1,this.pagination$.next(t)}setPageNumberFooter(t){this._pageNumber.set(t.PageNumber)}setPaginationButtonState(t,e){e==0?this._disableNextButton.set(!0):this._disableNextButton.set(!(e<t.RowCount*t.PageNumber))}reloadPagination(t){t.PageNumber=1,this.pagination$.next(t),this._hideCount.set(!0),this._goToLastPage.set(!1)}onLastPage(t={}){let e=JSON.parse(JSON.stringify(t));this.totalRowCount$=this.http.post(`/api/${this.fethRowCountEndpoint}`,e).pipe(x(n=>n.Total),F(n=>{this._hideCount.set(!1),e.RowCount=n,e.PageNumber=1,this.pagination$.next(e),this._goToLastPage.set(!0)}))}paginationFunction(){return this.pagination$.pipe(q(this.destroy$),W(t=>t!=null),z(t=>this.http.post(`/API/${this.fetchDataEndpoint}`,JSON.stringify(t)).pipe(x(e=>e.Data?e.Data:[]))),K(this.pagination$),J((t,e)=>{let[n,o]=t,[c]=e;return o.PageNumber==1?[c,o]:[n.concat(c),o]}),F(([t,e])=>{this.setPageNumberFooter(e);let n=this.calculateProductLength(t);this.totalData.set(n),this.setPaginationButtonState(e,n)}),x(([t])=>t),Y())}getRowCount(t){this._hideCount.set(!1),this.totalRowCount$=this.http.post(`/API/${this.fethRowCountEndpoint}`,t).pipe(x(e=>e.Total))}calculateProductLength(t=[]){return t.reduce((n,o)=>n+(o.Variants?.length?o.Variants?.length:0),0)}static{this.\u0275fac=function(e){return new(e||i)(Q(dt))}}static{this.\u0275prov=M({token:i,factory:i.\u0275fac})}}return i})();var be=(()=>{class i{constructor(){this.toastr=X(pt)}responseHandling(t=[],e=[],n,o=[]){let c=t.length>0,k=e.length>0;if(!k&&c&&this.toastr.success(`${this.generateSuccessMessage(t.length,o)}`,"Success",{enableHtml:!0}),k&&c){let B=`<li>${this.generateSuccessMessage(t.length)}</li>`,It=this.generateErrorMessage(n,e),yt=`<ol>${B} ${It}</ol>`;this.toastr.warning(yt,"Warning",{enableHtml:!0})}if(k&&!c){let B=`<ol>${this.generateErrorMessage(n,e)}</ol>`;this.toastr.error(B,"Error",{enableHtml:!0})}}generateSuccessMessage(t,e=[]){let n=e.length>1?e.length:1;return`
1
+ import{a as wt}from"./chunk-RHHHL4OR.js";import{b as vt}from"./chunk-IHSGQFDX.js";import{a as Tt}from"./chunk-HIC5QC3Y.js";import{a as mt}from"./chunk-UMP6ZMEJ.js";import{b as pt,e as dt}from"./chunk-WN5DZGA4.js";import{b as ct}from"./chunk-EUYQST7Q.js";import{b as _t,c as Ct,h as bt,j as xt,k as Pt}from"./chunk-HJXYT6MI.js";import{A as lt,c as at,h as rt,m as st}from"./chunk-5PS6ZS3N.js";import{a as gt,c as ut}from"./chunk-ERXVXBTU.js";import{r as ht,s as ft}from"./chunk-MFQQEEHJ.js";import{g as L,i as ot,m as $,n as R}from"./chunk-FXQKRJWU.js";import{$c as I,Fc as V,G as W,Gb as S,Gc as m,Hc as w,Ic as A,Jb as Z,K as z,Ka as D,Kc as et,Lc as it,Mb as u,Mc as nt,Oa as f,Ra as C,X as J,Yb as h,Z as Y,ad as y,ca as q,cd as U,dc as P,ea as F,f as H,fa as K,g as G,ic as r,ja as M,jc as s,kc as j,lc as T,mc as v,nc as tt,oa as Q,oc as _,pa as X,rb as a,rd as N,tc as b,uc as l,v as x,xb as E,ya as d,za as g}from"./chunk-OJMQBH6T.js";function Mt(i,p){i&1&&tt(0)}function Dt(i,p){if(i&1&&(T(0),u(1,Mt,1,0,"ng-container",5),v()),i&2){l(2);let t=V(4);a(),h("ngTemplateOutlet",t)}}function Et(i,p){if(i&1&&(r(0,"div",6)(1,"label"),m(2,"Editing Data"),s(),r(3,"div")(4,"span"),m(5),I(6,"number"),s()()()),i&2){let t=l(2);a(5),w(y(6,1,t.value))}}function St(i,p){if(i&1&&(T(0),u(1,Dt,2,1,"ng-container",4)(2,Et,7,3,"ng-template",null,1,U),v()),i&2){let t=V(3),e=l();a(),h("ngIf",e.hasPriceEdit)("ngIfElse",t)}}function Vt(i,p){if(i&1){let t=_();r(0,"div",7)(1,"input",8),nt("ngModelChange",function(n){d(t);let o=l();return it(o.value,n)||(o.value=n),g(n)}),s(),r(2,"label",9),m(3),s()()}if(i&2){let t=l();a(),et("ngModel",t.value),h("max",t.maxEditInventory),a(2),w(t.item.Table)}}var te=(()=>{class i{constructor(t,e,n){this.dialogRef=t,this.item=e,this.permissionService=n,this.maxEditInventory=1e5,this.permissionService.hasPermission(mt.PriceUpdate).then(o=>this.hasPriceEdit=o)}ngOnInit(){this.selectedChannel=this.item.Variant.Channel.find(t=>t.ChannelID==this.item.ChannelID),this.selectedChannel.ID=this.item.Variant.ID,this.selectedChannel.Sku=this.item.Variant.Code,this.item.Table=="inventory"?(this.value=this.selectedChannel.Inventory,this.maxEditInventory=this.selectedChannel?.TypeID==ct.Tokopedia?1e5:null):this.item.Table=="price"&&(this.value=this.selectedChannel.Price,this.maxEditInventory=null),this.selectedChannel.ItemName=this.item.Name,this.selectedChannel.VarName=this.item.Variant.Model,this.initModalConfig()}initModalConfig(){let t=this.item.Table=="inventory"?"Update Inventory":"Update Price";this.modalConfig=new xt,this.modalConfig.title=`${t} ${this.item?.Name} in ${this.selectedChannel?.Title}`}onSubmit(){this.item.Table=="inventory"?this.selectedChannel.Inventory=this.value:this.item.Table=="price"&&(this.selectedChannel.Price=this.value),this.dialogRef.close(this.selectedChannel)}onClose(){this.dialogRef.close()}static{this.\u0275fac=function(e){return new(e||i)(E(_t),E(Ct),E(gt))}}static{this.\u0275cmp=S({type:i,selectors:[["app-table-dialog"]],decls:5,vars:4,consts:[["INVENTORY",""],["DISABLED",""],[3,"onClose","onCancel","onOk","dynamicValidated","config"],["content",""],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],["matTooltipPosition","above","matTooltip","Cannot edit Unit Price because you dont have access ProductEditor role",1,"info-label-group","mt-3",2,"background","#e9ecef","opacity","1"],[1,"form-label-group","mt-3"],["type","text","name","edit","autoNum","",1,"form-control",3,"ngModelChange","ngModel","max"],["for","edit",1,"text-capitalize"]],template:function(e,n){if(e&1){let o=_();r(0,"modal-material",2),b("onClose",function(){return d(o),g(n.onClose())})("onCancel",function(){return d(o),g(n.onClose())})("onOk",function(){return d(o),g(n.onSubmit())}),r(1,"div",3),u(2,St,4,2,"ng-container",4)(3,Vt,4,3,"ng-template",null,0,U),s()()}if(e&2){let o=V(4);h("dynamicValidated",n.value)("config",n.modalConfig),a(2),h("ngIf",n.item.Table=="price")("ngIfElse",o)}},dependencies:[R,L,ot,$,bt,Tt,vt,wt,Pt,lt,at,rt,st,ut,ft,ht],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-left:1rem;margin-right:1rem}.mat-dialog-content[_ngcontent-%COMP%]{padding-left:.5rem;padding-right:.5rem;margin-left:.5rem;margin-right:.5rem}.font-lg[_ngcontent-%COMP%]{font-size:large}.font-lgr[_ngcontent-%COMP%]{font-size:larger}"]})}}return i})();var ie=(()=>{class i{transform(t,e,n=0){if(!t)return t;let o=e?parseInt(e,10):10;return t.length>o?t.substring(n,o)+"...":t}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275pipe=Z({name:"stringLimit",type:i,pure:!0})}}return i})();function Lt(i,p){if(i&1){let t=_();r(0,"span",6),b("click",function(){d(t);let n=l();return g(n.onGetRowCount())}),r(1,"i",7),m(2,"?"),s()()}}function $t(i,p){if(i&1&&(T(0),r(1,"span"),m(2),I(3,"number"),s(),v()),i&2){let t=l();a(2),w(y(3,1,t.rowCount()))}}function Rt(i,p){if(i&1){let t=_();r(0,"a",10),b("click",function(){d(t);let n=l(2);return g(n.onNextPage())}),j(1,"i",11),m(2," Next"),s()}}function Ot(i,p){if(i&1){let t=_();r(0,"a",12),b("click",function(){d(t);let n=l(2);return g(n.onLastPage())}),j(1,"i",13),m(2," Last"),s()}}function kt(i,p){if(i&1&&(r(0,"div",5),u(1,Rt,3,0,"a",8)(2,Ot,3,0,"a",9),s()),i&2){let t=l();a(),P(t.disableNextButton()&&!t.goToLastPage()?1:-1),a(),P(t.disableNextButton()&&!t.goToLastPage()?2:-1)}}var le=(()=>{class i{constructor(){this.totalData=f(0),this.rowCount=f(),this.pageNumber=f(),this.disableNextButton=f(),this.goToLastPage=f(),this.hideCount=f(),this.nextPage=new D,this.lastPage=new D,this.getRowCount=new D}onNextPage(){this.nextPage.emit()}onLastPage(){this.lastPage.emit()}onGetRowCount(){this.getRowCount.emit()}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275cmp=S({type:i,selectors:[["infinite-paginator"]],inputs:{totalData:[1,"totalData"],rowCount:[1,"rowCount"],pageNumber:[1,"pageNumber"],disableNextButton:[1,"disableNextButton"],goToLastPage:[1,"goToLastPage"],hideCount:[1,"hideCount"]},outputs:{nextPage:"onNextPage",lastPage:"onLastPage",getRowCount:"onGetRowCount"},decls:9,vars:7,consts:[[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"],[2,"cursor","pointer"],[4,"ngIf"],[1,"btn-group"],[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"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary","border-start-0"],["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","border-start-0",3,"click"],[1,"fas","fa-share"]],template:function(e,n){e&1&&(r(0,"div",0)(1,"div",1)(2,"div",2),m(3),I(4,"number"),u(5,Lt,3,0,"span",3)(6,$t,4,3,"ng-container",4),m(7),s()(),u(8,kt,3,2,"div",5),s()),e&2&&(a(3),A(" Showing 1 - ",y(4,5,n.totalData())," of "),a(2),P(n.hideCount()?5:-1),a(),h("ngIf",!n.hideCount()&&n.rowCount()),a(),A(" records ~ ",n.pageNumber()," Page "),a(),P(n.totalData()>0?8:-1))},dependencies:[R,L,$],encapsulation:2})}}return i})();var ue=(()=>{class i{constructor(t){this.http=t,this.pagination$=new G(null),this._pageNumber=C(1),this.pageNumber=N(()=>this._pageNumber()),this._hideCount=C(!0),this.hideCount=N(()=>this._hideCount()),this._disableNextButton=C(!0),this.disableNextButton=N(()=>this._disableNextButton()),this._goToLastPage=C(!1),this.isLastPage=N(()=>this._goToLastPage()),this.totalData=C(0),this.destroy$=new H,this.data$=this.paginationFunction()}onNextPage(t){t.PageNumber+=1,this.pagination$.next(t)}setPageNumberFooter(t){this._pageNumber.set(t.PageNumber)}setPaginationButtonState(t,e){e==0?this._disableNextButton.set(!0):this._disableNextButton.set(!(e<t.RowCount*t.PageNumber))}reloadPagination(t){t.PageNumber=1,this.pagination$.next(t),this._hideCount.set(!0),this._goToLastPage.set(!1)}onLastPage(t={}){let e=JSON.parse(JSON.stringify(t));this.totalRowCount$=this.http.post(`/api/${this.fethRowCountEndpoint}`,e).pipe(x(n=>n.Total),F(n=>{this._hideCount.set(!1),e.RowCount=n,e.PageNumber=1,this.pagination$.next(e),this._goToLastPage.set(!0)}))}paginationFunction(){return this.pagination$.pipe(q(this.destroy$),W(t=>t!=null),z(t=>this.http.post(`/API/${this.fetchDataEndpoint}`,JSON.stringify(t)).pipe(x(e=>e.Data?e.Data:[]))),K(this.pagination$),J((t,e)=>{let[n,o]=t,[c]=e;return o.PageNumber==1?[c,o]:[n.concat(c),o]}),F(([t,e])=>{this.setPageNumberFooter(e);let n=this.calculateProductLength(t);this.totalData.set(n),this.setPaginationButtonState(e,n)}),x(([t])=>t),Y())}getRowCount(t){this._hideCount.set(!1),this.totalRowCount$=this.http.post(`/API/${this.fethRowCountEndpoint}`,t).pipe(x(e=>e.Total))}calculateProductLength(t=[]){return t.reduce((n,o)=>n+(o.Variants?.length?o.Variants?.length:0),0)}static{this.\u0275fac=function(e){return new(e||i)(Q(dt))}}static{this.\u0275prov=M({token:i,factory:i.\u0275fac})}}return i})();var be=(()=>{class i{constructor(){this.toastr=X(pt)}responseHandling(t=[],e=[],n,o=[]){let c=t.length>0,k=e.length>0;if(!k&&c&&this.toastr.success(`${this.generateSuccessMessage(t.length,o)}`,"Success",{enableHtml:!0}),k&&c){let B=`<li>${this.generateSuccessMessage(t.length)}</li>`,It=this.generateErrorMessage(n,e),yt=`<ol>${B} ${It}</ol>`;this.toastr.warning(yt,"Warning",{enableHtml:!0})}if(k&&!c){let B=`<ol>${this.generateErrorMessage(n,e)}</ol>`;this.toastr.error(B,"Error",{enableHtml:!0})}}generateSuccessMessage(t,e=[]){let n=e.length>1?e.length:1;return`
2
2
  <div>
3
3
  <span class="fw-bold">Successfully</span> updated ${t} variants in ${n} channels
4
4
  </div>
@@ -0,0 +1 @@
1
+ import{h as C}from"./chunk-ZHPHANAW.js";import{a as r}from"./chunk-CGOB6Y3X.js";import{b as l,e as S}from"./chunk-WN5DZGA4.js";import{b as a,c as u}from"./chunk-EUYQST7Q.js";import{aa as p,ea as h,ja as c,oa as o,v as s}from"./chunk-OJMQBH6T.js";var y=(()=>{class i{constructor(e,t,n){this.httpService=e,this.toastr=t,this.tokenService=n}saveChannel(e){return this.httpService.post("/api/Channel/SubmitChannel",e).pipe(p(t=>this.tokenService.refreshToken().pipe(s(n=>t))))}getLastSync(e){return this.httpService.get(`${r.ChannelGetLastSyncByID}/?ID=${e}`)}getChannel(e){return this.httpService.post(r.GetChannel,e)}getChannelLoader(){return this.httpService.get(r.GetChannelLoader)}testShopID(e){return this.httpService.post(r.TestShopID,e).pipe(h(t=>{this.showTostrSuccessTestShopID(t)}))}updateChannelIndex(e){return this.httpService.post(r.UpdateChannelIndex,e)}deleteChannel(e){return this.httpService.post(r.DeleteChannel,e)}mapChannelImage(e){return e.map(t=>(t.img=u.getChannelLogoByTypeId(t.TypeID),t))}showTostrSuccessTestShopID(e){let t="";for(var n in e)t+=n+" : "+e[n]+"<br/>";this.toastr.success(t,"Success",{enableHtml:!0,closeButton:!0,positionClass:"toast-bottom-right"})}getRegisterByOutletName(e){return this.httpService.post(r.GetRegisterByOutletName,{Outlet:e})}getChannelRowCount(e){return this.httpService.post(r.GetChannelRowCount,e).pipe(s(t=>t.Count))}getChannelWarehouse(e){return this.httpService.get(`${r.GetChannelWarehouse}/?ChannelID=${e}`)}unSynchronizedWarehouse(e){return this.httpService.delete(`${r.UnSynchronizedWarehouse}?ID=${e}`)}authorizedChannel(e){let t=this.getApiAuthorize(e);return this.httpService.post(`/api/${t}`,null).pipe(h(n=>{window.open(n.Url,"_blank")}))}getApiAuthorize(e){let t;switch(e){case a.Shopee:t="ChannelAuthorization/ShopeeV2_URL";break;case a.Tiktok:t="ChannelAuthorization/Tiktok_URL";break;case a.Lazada:t="ChannelAuthorization/Lazada_URL";break}return t}static{this.\u0275fac=function(t){return new(t||i)(o(S),o(l),o(C))}}static{this.\u0275prov=c({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();export{y as a};