dealpos 25.32.0 → 25.32.1

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 (72) hide show
  1. package/browser/{chunk-U4E4GFA3.js → chunk-3BKJB4EB.js} +1 -1
  2. package/browser/{chunk-NVZO3MOZ.js → chunk-3HGB2KX7.js} +1 -1
  3. package/browser/{chunk-AU5NSB5E.js → chunk-3IE46WQL.js} +2 -2
  4. package/browser/{chunk-ZTCHNGR5.js → chunk-42NI5Y2B.js} +1 -1
  5. package/browser/{chunk-7ZF6XZWY.js → chunk-4D6P6ZN5.js} +1 -1
  6. package/browser/{chunk-X7I2U4GR.js → chunk-4O6KU55Y.js} +2 -2
  7. package/browser/{chunk-DBK7DX7N.js → chunk-5MDQYEMB.js} +1 -1
  8. package/browser/{chunk-X6OU5HV5.js → chunk-6S6Q7SED.js} +1 -1
  9. package/browser/{chunk-H73MVYHX.js → chunk-6VQ2WO2R.js} +1 -1
  10. package/browser/{chunk-RIGRHB27.js → chunk-6ZHV4H72.js} +2 -2
  11. package/browser/{chunk-UWM724IJ.js → chunk-A7WBJIJP.js} +1 -1
  12. package/browser/{chunk-2SAQDBKA.js → chunk-APVQGR37.js} +1 -1
  13. package/browser/{chunk-75MGYBWY.js → chunk-B7VLDW2D.js} +1 -1
  14. package/browser/{chunk-P23T2EVP.js → chunk-BAW2PCX4.js} +1 -1
  15. package/browser/{chunk-X7J7XCND.js → chunk-BL367NTS.js} +1 -1
  16. package/browser/{chunk-EANKU65K.js → chunk-CZ7F77ZP.js} +1 -1
  17. package/browser/{chunk-QYVR6FKS.js → chunk-DDVWUPV6.js} +1 -1
  18. package/browser/{chunk-BR7ZRI7I.js → chunk-DJA3CX47.js} +1 -1
  19. package/browser/{chunk-HWY3QH6A.js → chunk-DWBSJPMC.js} +1 -1
  20. package/browser/{chunk-KO5IVQZS.js → chunk-DZG3LGZ3.js} +1 -1
  21. package/browser/{chunk-OVRODHEF.js → chunk-EAPNMYHA.js} +1 -1
  22. package/browser/{chunk-D6K7GLV2.js → chunk-ERJFDQFX.js} +1 -1
  23. package/browser/{chunk-UUN5OBN5.js → chunk-F6ZI74HP.js} +1 -1
  24. package/browser/{chunk-WMDD6KTG.js → chunk-GFYZWIV4.js} +1 -1
  25. package/browser/{chunk-Q45IFUGA.js → chunk-GGEENO4M.js} +1 -1
  26. package/browser/{chunk-CNMEDN2J.js → chunk-GLZMFXE6.js} +2 -2
  27. package/browser/{chunk-GIBMYPUI.js → chunk-GPYDY4KE.js} +1 -1
  28. package/browser/{chunk-KTYLKTKA.js → chunk-HT7MBQYU.js} +1 -1
  29. package/browser/{chunk-U6AHQ7OA.js → chunk-I33SFWJL.js} +1 -1
  30. package/browser/{chunk-26RWIMQI.js → chunk-IHY7TFGQ.js} +5 -5
  31. package/browser/{chunk-S6XWBUA5.js → chunk-JCJZ6B6B.js} +1 -1
  32. package/browser/{chunk-VUVNZP6V.js → chunk-JDMYDBXN.js} +1 -1
  33. package/browser/{chunk-35BXZ4TH.js → chunk-JY4TU5LB.js} +1 -1
  34. package/browser/{chunk-7JLLV4R2.js → chunk-K25WE32L.js} +1 -1
  35. package/browser/{chunk-YQM3WRXG.js → chunk-KBE7CFXH.js} +1 -1
  36. package/browser/{chunk-DZPKIRUW.js → chunk-KFV3U2MG.js} +1 -1
  37. package/browser/{chunk-TLVGFFQE.js → chunk-KU2S24JO.js} +1 -1
  38. package/browser/{chunk-IXN5A6FJ.js → chunk-LB5S2KZX.js} +1 -1
  39. package/browser/{chunk-5W2FAFPB.js → chunk-LQKZB5PG.js} +1 -1
  40. package/browser/{chunk-VWM4STKR.js → chunk-LWWP5RGP.js} +1 -1
  41. package/browser/{chunk-CIEKEDPX.js → chunk-MA64N42O.js} +1 -1
  42. package/browser/{chunk-KJGIGEWE.js → chunk-MBSLDPJK.js} +1 -1
  43. package/browser/{chunk-N6VH67NA.js → chunk-MW5P4LM5.js} +1 -1
  44. package/browser/{chunk-CSPZYSGN.js → chunk-N66KZGXZ.js} +1 -1
  45. package/browser/{chunk-35MHVXKF.js → chunk-OM6SJITM.js} +1 -1
  46. package/browser/{chunk-4746NLIA.js → chunk-PFK4WL2H.js} +1 -1
  47. package/browser/{chunk-DS5ZUU74.js → chunk-PGQ4D2W6.js} +1 -1
  48. package/browser/{chunk-YF5Z2Q2D.js → chunk-PKRNN3GZ.js} +1 -1
  49. package/browser/{chunk-UP2OTHWF.js → chunk-QUWHJ3A2.js} +3 -3
  50. package/browser/{chunk-TTBALV7Z.js → chunk-RAKPTR5Z.js} +1 -1
  51. package/browser/{chunk-WULI4TL4.js → chunk-RDARJWEZ.js} +1 -1
  52. package/browser/{chunk-JBDCESLL.js → chunk-RJVF37GS.js} +1 -1
  53. package/browser/{chunk-5VBPLGVM.js → chunk-RSSYP5IL.js} +1 -1
  54. package/browser/{chunk-ALON6KSY.js → chunk-RTJEAKQW.js} +1 -1
  55. package/browser/{chunk-ZB4GWUQV.js → chunk-RVN4YQAX.js} +1 -1
  56. package/browser/{chunk-7PVGAJ73.js → chunk-SG2RKHTW.js} +1 -1
  57. package/browser/{chunk-5FA5XUCV.js → chunk-SL4VOAHY.js} +2 -2
  58. package/browser/{chunk-ZYLRH43R.js → chunk-TUL555Y3.js} +1 -1
  59. package/browser/chunk-UFHFKY4U.js +2 -0
  60. package/browser/{chunk-2TWP52P7.js → chunk-UZGPU4VW.js} +1 -1
  61. package/browser/{chunk-EL2PFWZR.js → chunk-VVYAL6Y7.js} +1 -1
  62. package/browser/{chunk-YH6FQJMF.js → chunk-WFX2XCFO.js} +1 -1
  63. package/browser/{chunk-P3YO27X5.js → chunk-WMOWM6XW.js} +1 -1
  64. package/browser/{chunk-5H4KL2KJ.js → chunk-WP4PM74K.js} +1 -1
  65. package/browser/{chunk-KTMKLUKP.js → chunk-WYO3ICL4.js} +1 -1
  66. package/browser/{chunk-FWKNIZZ3.js → chunk-XDPWF5CB.js} +1 -1
  67. package/browser/{chunk-WYYDJSSS.js → chunk-ZNWP7UK2.js} +1 -1
  68. package/browser/{chunk-U765C72H.js → chunk-ZSBJ4BDP.js} +1 -1
  69. package/browser/index.html +2 -2
  70. package/browser/{main-ZYWB664N.js → main-Q6EK5PKL.js} +2 -2
  71. package/package.json +1 -1
  72. package/browser/chunk-TTISSB2D.js +0 -2
@@ -1 +1 @@
1
- import{a as ve}from"./chunk-GDU5B7WH.js";import{a as Ce}from"./chunk-U6AHQ7OA.js";import{a as fe}from"./chunk-7CXNVAHO.js";import"./chunk-BYXBJQAS.js";import{h as se,i as ce}from"./chunk-Q45IFUGA.js";import"./chunk-X6OU5HV5.js";import{b as ue}from"./chunk-2SAQDBKA.js";import"./chunk-GDLTEIKV.js";import"./chunk-PNVRIGOW.js";import{C as de,D as pe,E as me,u as re,v as ae,w as le}from"./chunk-KMVWE6IR.js";import"./chunk-4IJDCXOA.js";import{P as F}from"./chunk-QMH4FATM.js";import"./chunk-SRELAFRM.js";import"./chunk-O4T67QQ3.js";import"./chunk-2FWFPV5I.js";import"./chunk-WUSKRV4R.js";import{C as ee,D as oe,E as te,c as z,e as _,h as J,i as Y,p as X,t as Q,u as Z}from"./chunk-J577JGRK.js";import"./chunk-WULI4TL4.js";import"./chunk-VUVNZP6V.js";import{a as w,d as ie}from"./chunk-EQ6536VC.js";import"./chunk-5W2FAFPB.js";import{$a as l,$c as L,Db as f,Dc as q,E as N,Eb as A,Gb as O,Hb as U,Ib as n,Jb as i,Kb as s,Ma as D,Md as B,Nb as H,Nc as K,Ob as T,Qb as v,Rb as h,Td as W,Uc as R,Wd as ne,db as c,dc as $,ec as a,fc as G,gc as I,hd as M,kb as E,na as g,ob as V,pc as b,qb as u,qc as j,t as k,va as P,vb as m,wa as y}from"./chunk-ONCTFURX.js";import"./chunk-7DCB7DB2.js";var x=r=>({"is-invalid":r});function Pe(r,d){r&1&&(n(0,"div",16),a(1," Provider Name is required "),i())}function ye(r,d){r&1&&(n(0,"div",20),a(1," Validate Coupon URL is required "),i())}function Ee(r,d){r&1&&(n(0,"div",20),a(1," Redeem Coupon URL is required "),i())}function Ge(r,d){r&1&&(n(0,"div",20),a(1,"Key is required"),i())}var S=class r{constructor(d){this.data=d;this.config=new de,this.config.title="Register Provider",this.config.customWidth="600px",this.initForm()}dialogRef=g(re);config;fb=g(ee);formGroup;initForm(){this.formGroup=this.fb.group({name:[this.data?.name||"",[_.required]],validateCoupon:[this.data?.validateCoupon||"",[_.required]],redeemCoupon:[this.data?.redeemCoupon||"",[_.required]],enabled:[this.data?.enabled!==void 0?this.data.enabled:!0],header:[this.data?.header,[_.required]]})}onClose(){this.dialogRef.close()}onOk(){this.formGroup.markAllAsTouched(),!this.formGroup.invalid&&this.dialogRef.close(this.formGroup.value)}static \u0275fac=function(e){return new(e||r)(c(ae))};static \u0275cmp=E({type:r,selectors:[["app-modal-register-provider"]],decls:35,vars:18,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid","pt-4"],[1,"row"],[1,"col-12"],[3,"formGroup"],[1,"mb-8"],[1,"d-flex","align-items-center"],[1,"flex-grow-1","me-3"],[1,"form-floating-outline","mb-0"],["type","text","placeholder","Provider Name","id","name","name","name","formControlName","name",1,"form-control","bg-white",3,"ngClass"],["for","name"],[2,"width","75px"],[1,"form-check-floating"],[1,"d-flex","justify-content-center","pt-7","pb-4"],["formControlName","enabled"],[1,"labelFilledInput","text-center"],[1,"invalid-feedback","mt-2",2,"display","block"],[1,"form-floating-outline","mb-8"],["type","text","id","validateCoupon","name","validateCoupon","placeholder","Validate Coupon","formControlName","validateCoupon",1,"form-control","bg-white",3,"ngClass"],["for","validateCoupon"],[1,"invalid-feedback"],["type","text","id","redeemCoupon","placeholder","Redeem Coupon","name","redeemCoupon","formControlName","redeemCoupon",1,"form-control","bg-white",3,"ngClass"],["for","redeemCoupon"],[1,"form-floating-outline","mb-3"],["type","text","id","key","name","key","placeholder","Key: E.g. eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9","formControlName","header","rows","4",1,"form-control","bg-white",3,"ngClass"],["for","key"]],template:function(e,o){e&1&&(n(0,"modal-material",0),v("onOk",function(){return o.onOk()})("onCancel",function(){return o.onClose()})("onClose",function(){return o.onClose()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"form",4)(6,"div",5)(7,"div",6)(8,"div",7)(9,"div",8),s(10,"input",9),n(11,"label",10),a(12,"Coupon Provider"),i()()(),n(13,"div",11)(14,"div",12)(15,"div",13),s(16,"app-customize-toggle",14),i(),n(17,"label",15),a(18,"Enabled"),i()()()(),u(19,Pe,2,0,"div",16),i(),n(20,"div",17),s(21,"input",18),n(22,"label",19),a(23,"Validate Coupon URL"),i(),u(24,ye,2,0,"div",20),i(),n(25,"div",17),s(26,"input",21),n(27,"label",22),a(28,"Redeem Coupon URL"),i(),u(29,Ee,2,0,"div",20),i(),n(30,"div",23),s(31,"textarea",24),n(32,"label",25),a(33,"Request Header (Key: value)"),i(),u(34,Ge,2,0,"div",20),i()()()()()()()),e&2&&(m("config",o.config),l(5),m("formGroup",o.formGroup),l(5),m("ngClass",b(10,x,(o.formGroup.controls.name==null?null:o.formGroup.controls.name.invalid)&&((o.formGroup.controls.name==null?null:o.formGroup.controls.name.dirty)||(o.formGroup.controls.name==null?null:o.formGroup.controls.name.touched)))),l(9),f(o.formGroup.controls.name.invalid&&(o.formGroup.controls.name.dirty||o.formGroup.controls.name.touched)?19:-1),l(2),m("ngClass",b(12,x,(o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.invalid)&&((o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.dirty)||(o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.touched)))),l(3),f(o.formGroup.controls.validateCoupon.invalid&&(o.formGroup.controls.validateCoupon.dirty||o.formGroup.controls.validateCoupon.touched)?24:-1),l(2),m("ngClass",b(14,x,(o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.invalid)&&((o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.dirty)||(o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.touched)))),l(3),f(o.formGroup.controls.redeemCoupon.invalid&&(o.formGroup.controls.redeemCoupon.dirty||o.formGroup.controls.redeemCoupon.touched)?29:-1),l(2),m("ngClass",b(16,x,(o.formGroup.controls.header==null?null:o.formGroup.controls.header.invalid)&&((o.formGroup.controls.header==null?null:o.formGroup.controls.header.dirty)||(o.formGroup.controls.header==null?null:o.formGroup.controls.header.touched)))),l(3),f(o.formGroup.controls.header.invalid&&(o.formGroup.controls.header.dirty||o.formGroup.controls.header.touched)?34:-1))},dependencies:[M,R,te,X,z,J,Y,Q,Z,me,pe,ve],styles:["div.form-check-floating[_ngcontent-%COMP%]{border:1px solid #ced4da;position:relative;border-radius:.25rem!important}.labelFilledInput[_ngcontent-%COMP%]{position:absolute;top:-10px;left:10px;background:#fff;padding-left:4px;padding-right:4px;font-size:.75rem!important;color:#9da2a6}"]})};var Re=(r,d)=>({"bg-success-subtle text-success-emphasis":r,"bg-danger-subtle text-danger-emphasis":d});function Me(r,d){if(r&1){let e=T();n(0,"tr")(1,"td",10)(2,"i",11),v("click",function(){let t=P(e).$index,p=h(2);return y(p.onDeleteProvider(t))}),i()(),n(3,"td")(4,"a",12),v("click",function(){let t=P(e),p=t.$implicit,C=t.$index,he=h(2);return y(he.onUpdateProvider(p,C))}),a(5),i()(),n(6,"td"),a(7),i(),n(8,"td"),a(9),i(),n(10,"td"),a(11),i(),n(12,"td")(13,"span",13),a(14),i()()()}if(r&2){let e=d.$implicit;l(5),I(" ",e.Name," "),l(2),G(e.ValidateCoupon),l(2),G(e.RedeemCoupon),l(2),G(e.KeyUI),l(2),m("ngClass",j(6,Re,e.Enabled,!e.Enabled)),l(),I(" ",e.Enabled?"Enabled":"Disabled"," ")}}function xe(r,d){if(r&1&&O(0,Me,15,9,"tr",null,A),r&2){let e=h();U(e.listProviders())}}function Ne(r,d){r&1&&H(0)}function Te(r,d){if(r&1&&u(0,Ne,1,0,"ng-container",14),r&2){h();let e=$(26);m("ngTemplateOutlet",e)}}function Ie(r,d){r&1&&(n(0,"tr",15)(1,"td",16),s(2,"empty-state-table"),i()())}var ge=class r extends Ce{constructor(e,o,t,p,C){super(e,o,F.WebhookCouponProviderLoader,t);this.activatedRoute=t;this.role=p;this.dialog=C}toastr=g(W);couponProviders=D([]);listProviders=K(()=>this.couponProviders().map(e=>(e.KeyUI=this.generateKeyUI(e.Header),e)));generateKeyUI(e){if(!e||e.length<=25)return e||"";let o=e.substring(0,10),t=e.substring(e.length-10);return`${o}...${t}`}postBindForm(e){this.couponProviders.update(()=>e.Form.CouponProviders.map(t=>({FetchMemberPoint:t.FetchMemberPoint,Enabled:t.Enabled,Name:t.Name,RedeemCoupon:t.RedeemCoupon,ValidateCoupon:t.ValidateCoupon,Header:t.Header})))}addNewCouponProvider(){this.dialog.open(S).afterClosed().pipe(N(e=>w.IsNotEmpty(e)),k(e=>{let o={Name:e.name,ValidateCoupon:e.validateCoupon,RedeemCoupon:e.redeemCoupon,Enabled:e.enabled,Header:e.header};return[...this.couponProviders(),o]})).subscribe(e=>{this.couponProviders.update(()=>e),this.saveCouponProviders(`Coupon provider "${e[e.length-1].Name}" has been successfully added.`)})}onUpdateProvider(e,o){this.dialog.open(S,{data:{name:e.Name,validateCoupon:e.ValidateCoupon,redeemCoupon:e.RedeemCoupon,enabled:e.Enabled,header:e.Header}}).afterClosed().pipe(N(t=>w.IsNotEmpty(t))).subscribe(t=>{let p={Name:t.name,ValidateCoupon:t.validateCoupon,RedeemCoupon:t.redeemCoupon,Enabled:t.enabled,Header:t.header};this.couponProviders.update(C=>(C[o]=p,[...C])),this.saveCouponProviders(`Coupon provider "${t.name}" has been successfully updated.`)})}onDeleteProvider(e){if(confirm("Are you sure you want to delete this coupon provider?")){let o=this.couponProviders()[e]?.Name||"provider";this.couponProviders.update(t=>(t.splice(e,1),[...t])),this.saveCouponProviders(`Coupon provider "${o}" has been successfully deleted.`)}}saveCouponProviders(e){this.httpService.post(F.WebhookCouponProviderSave,this.couponProviders()).subscribe(()=>{this.toastr.success(e||"Coupon provider has been successfully updated.","Success")})}static \u0275fac=function(o){return new(o||r)(c(ue),c(ne),c(B),c(ie),c(le))};static \u0275cmp=E({type:r,selectors:[["app-coupon-configuration"]],features:[V],decls:27,vars:4,consts:[["EMPTY_STATE",""],[3,"pageData","hideSearchDropdown","hideSearchBox"],["type","button",1,"btn","btn-success",3,"click"],[1,"container-fluid","mt-6"],[1,"row"],[1,"col-12"],[1,"table","table-stripped","custom-table"],[1,"thead-light","sticky-top-thead"],[1,"text-center",2,"width","10px"],[2,"width","220px"],[1,"text-center"],["title","Delete provider",1,"fa","fa-xmark","text-danger",2,"cursor","pointer",3,"click"],["role","button",1,"link-primary","cursor-pointer",3,"click"],[1,"p-3","rounded-2",3,"ngClass"],[4,"ngTemplateOutlet"],[1,"table-border-bottom-0"],["colspan","7"]],template:function(o,t){if(o&1){let p=T();n(0,"mainpanel-cmp",1)(1,"actions")(2,"button",2),v("click",function(){return P(p),y(t.addNewCouponProvider())}),a(3," Add "),i()(),n(4,"content")(5,"div",3)(6,"div",4)(7,"div",5)(8,"table",6)(9,"thead",7)(10,"tr"),s(11,"th",8),n(12,"th",9),a(13,"Name"),i(),n(14,"th"),a(15,"Validate Coupon"),i(),n(16,"th"),a(17,"Redeem Coupon"),i(),n(18,"th"),a(19,"Value"),i(),n(20,"th"),a(21,"Status"),i()()(),n(22,"tbody"),u(23,xe,2,0)(24,Te,1,1,"ng-container"),i()()()()(),u(25,Ie,3,0,"ng-template",null,0,q),i()()}if(o&2){let p;m("pageData",t.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(23),f(((p=t.listProviders())==null?null:p.length)>0?23:24)}},dependencies:[M,R,L,ce,se,oe,fe],encapsulation:2})};export{ge as CouponConfigurationComponent};
1
+ import{a as ve}from"./chunk-GDU5B7WH.js";import{a as Ce}from"./chunk-I33SFWJL.js";import{a as fe}from"./chunk-7CXNVAHO.js";import"./chunk-BYXBJQAS.js";import{h as se,i as ce}from"./chunk-GGEENO4M.js";import"./chunk-6S6Q7SED.js";import{b as ue}from"./chunk-APVQGR37.js";import"./chunk-GDLTEIKV.js";import"./chunk-PNVRIGOW.js";import{C as de,D as pe,E as me,u as re,v as ae,w as le}from"./chunk-KMVWE6IR.js";import"./chunk-4IJDCXOA.js";import{P as F}from"./chunk-QMH4FATM.js";import"./chunk-SRELAFRM.js";import"./chunk-O4T67QQ3.js";import"./chunk-2FWFPV5I.js";import"./chunk-WUSKRV4R.js";import{C as ee,D as oe,E as te,c as z,e as _,h as J,i as Y,p as X,t as Q,u as Z}from"./chunk-J577JGRK.js";import"./chunk-RDARJWEZ.js";import"./chunk-JDMYDBXN.js";import{a as w,d as ie}from"./chunk-EQ6536VC.js";import"./chunk-LQKZB5PG.js";import{$a as l,$c as L,Db as f,Dc as q,E as N,Eb as A,Gb as O,Hb as U,Ib as n,Jb as i,Kb as s,Ma as D,Md as B,Nb as H,Nc as K,Ob as T,Qb as v,Rb as h,Td as W,Uc as R,Wd as ne,db as c,dc as $,ec as a,fc as G,gc as I,hd as M,kb as E,na as g,ob as V,pc as b,qb as u,qc as j,t as k,va as P,vb as m,wa as y}from"./chunk-ONCTFURX.js";import"./chunk-7DCB7DB2.js";var x=r=>({"is-invalid":r});function Pe(r,d){r&1&&(n(0,"div",16),a(1," Provider Name is required "),i())}function ye(r,d){r&1&&(n(0,"div",20),a(1," Validate Coupon URL is required "),i())}function Ee(r,d){r&1&&(n(0,"div",20),a(1," Redeem Coupon URL is required "),i())}function Ge(r,d){r&1&&(n(0,"div",20),a(1,"Key is required"),i())}var S=class r{constructor(d){this.data=d;this.config=new de,this.config.title="Register Provider",this.config.customWidth="600px",this.initForm()}dialogRef=g(re);config;fb=g(ee);formGroup;initForm(){this.formGroup=this.fb.group({name:[this.data?.name||"",[_.required]],validateCoupon:[this.data?.validateCoupon||"",[_.required]],redeemCoupon:[this.data?.redeemCoupon||"",[_.required]],enabled:[this.data?.enabled!==void 0?this.data.enabled:!0],header:[this.data?.header,[_.required]]})}onClose(){this.dialogRef.close()}onOk(){this.formGroup.markAllAsTouched(),!this.formGroup.invalid&&this.dialogRef.close(this.formGroup.value)}static \u0275fac=function(e){return new(e||r)(c(ae))};static \u0275cmp=E({type:r,selectors:[["app-modal-register-provider"]],decls:35,vars:18,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid","pt-4"],[1,"row"],[1,"col-12"],[3,"formGroup"],[1,"mb-8"],[1,"d-flex","align-items-center"],[1,"flex-grow-1","me-3"],[1,"form-floating-outline","mb-0"],["type","text","placeholder","Provider Name","id","name","name","name","formControlName","name",1,"form-control","bg-white",3,"ngClass"],["for","name"],[2,"width","75px"],[1,"form-check-floating"],[1,"d-flex","justify-content-center","pt-7","pb-4"],["formControlName","enabled"],[1,"labelFilledInput","text-center"],[1,"invalid-feedback","mt-2",2,"display","block"],[1,"form-floating-outline","mb-8"],["type","text","id","validateCoupon","name","validateCoupon","placeholder","Validate Coupon","formControlName","validateCoupon",1,"form-control","bg-white",3,"ngClass"],["for","validateCoupon"],[1,"invalid-feedback"],["type","text","id","redeemCoupon","placeholder","Redeem Coupon","name","redeemCoupon","formControlName","redeemCoupon",1,"form-control","bg-white",3,"ngClass"],["for","redeemCoupon"],[1,"form-floating-outline","mb-3"],["type","text","id","key","name","key","placeholder","Key: E.g. eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9","formControlName","header","rows","4",1,"form-control","bg-white",3,"ngClass"],["for","key"]],template:function(e,o){e&1&&(n(0,"modal-material",0),v("onOk",function(){return o.onOk()})("onCancel",function(){return o.onClose()})("onClose",function(){return o.onClose()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"form",4)(6,"div",5)(7,"div",6)(8,"div",7)(9,"div",8),s(10,"input",9),n(11,"label",10),a(12,"Coupon Provider"),i()()(),n(13,"div",11)(14,"div",12)(15,"div",13),s(16,"app-customize-toggle",14),i(),n(17,"label",15),a(18,"Enabled"),i()()()(),u(19,Pe,2,0,"div",16),i(),n(20,"div",17),s(21,"input",18),n(22,"label",19),a(23,"Validate Coupon URL"),i(),u(24,ye,2,0,"div",20),i(),n(25,"div",17),s(26,"input",21),n(27,"label",22),a(28,"Redeem Coupon URL"),i(),u(29,Ee,2,0,"div",20),i(),n(30,"div",23),s(31,"textarea",24),n(32,"label",25),a(33,"Request Header (Key: value)"),i(),u(34,Ge,2,0,"div",20),i()()()()()()()),e&2&&(m("config",o.config),l(5),m("formGroup",o.formGroup),l(5),m("ngClass",b(10,x,(o.formGroup.controls.name==null?null:o.formGroup.controls.name.invalid)&&((o.formGroup.controls.name==null?null:o.formGroup.controls.name.dirty)||(o.formGroup.controls.name==null?null:o.formGroup.controls.name.touched)))),l(9),f(o.formGroup.controls.name.invalid&&(o.formGroup.controls.name.dirty||o.formGroup.controls.name.touched)?19:-1),l(2),m("ngClass",b(12,x,(o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.invalid)&&((o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.dirty)||(o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.touched)))),l(3),f(o.formGroup.controls.validateCoupon.invalid&&(o.formGroup.controls.validateCoupon.dirty||o.formGroup.controls.validateCoupon.touched)?24:-1),l(2),m("ngClass",b(14,x,(o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.invalid)&&((o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.dirty)||(o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.touched)))),l(3),f(o.formGroup.controls.redeemCoupon.invalid&&(o.formGroup.controls.redeemCoupon.dirty||o.formGroup.controls.redeemCoupon.touched)?29:-1),l(2),m("ngClass",b(16,x,(o.formGroup.controls.header==null?null:o.formGroup.controls.header.invalid)&&((o.formGroup.controls.header==null?null:o.formGroup.controls.header.dirty)||(o.formGroup.controls.header==null?null:o.formGroup.controls.header.touched)))),l(3),f(o.formGroup.controls.header.invalid&&(o.formGroup.controls.header.dirty||o.formGroup.controls.header.touched)?34:-1))},dependencies:[M,R,te,X,z,J,Y,Q,Z,me,pe,ve],styles:["div.form-check-floating[_ngcontent-%COMP%]{border:1px solid #ced4da;position:relative;border-radius:.25rem!important}.labelFilledInput[_ngcontent-%COMP%]{position:absolute;top:-10px;left:10px;background:#fff;padding-left:4px;padding-right:4px;font-size:.75rem!important;color:#9da2a6}"]})};var Re=(r,d)=>({"bg-success-subtle text-success-emphasis":r,"bg-danger-subtle text-danger-emphasis":d});function Me(r,d){if(r&1){let e=T();n(0,"tr")(1,"td",10)(2,"i",11),v("click",function(){let t=P(e).$index,p=h(2);return y(p.onDeleteProvider(t))}),i()(),n(3,"td")(4,"a",12),v("click",function(){let t=P(e),p=t.$implicit,C=t.$index,he=h(2);return y(he.onUpdateProvider(p,C))}),a(5),i()(),n(6,"td"),a(7),i(),n(8,"td"),a(9),i(),n(10,"td"),a(11),i(),n(12,"td")(13,"span",13),a(14),i()()()}if(r&2){let e=d.$implicit;l(5),I(" ",e.Name," "),l(2),G(e.ValidateCoupon),l(2),G(e.RedeemCoupon),l(2),G(e.KeyUI),l(2),m("ngClass",j(6,Re,e.Enabled,!e.Enabled)),l(),I(" ",e.Enabled?"Enabled":"Disabled"," ")}}function xe(r,d){if(r&1&&O(0,Me,15,9,"tr",null,A),r&2){let e=h();U(e.listProviders())}}function Ne(r,d){r&1&&H(0)}function Te(r,d){if(r&1&&u(0,Ne,1,0,"ng-container",14),r&2){h();let e=$(26);m("ngTemplateOutlet",e)}}function Ie(r,d){r&1&&(n(0,"tr",15)(1,"td",16),s(2,"empty-state-table"),i()())}var ge=class r extends Ce{constructor(e,o,t,p,C){super(e,o,F.WebhookCouponProviderLoader,t);this.activatedRoute=t;this.role=p;this.dialog=C}toastr=g(W);couponProviders=D([]);listProviders=K(()=>this.couponProviders().map(e=>(e.KeyUI=this.generateKeyUI(e.Header),e)));generateKeyUI(e){if(!e||e.length<=25)return e||"";let o=e.substring(0,10),t=e.substring(e.length-10);return`${o}...${t}`}postBindForm(e){this.couponProviders.update(()=>e.Form.CouponProviders.map(t=>({FetchMemberPoint:t.FetchMemberPoint,Enabled:t.Enabled,Name:t.Name,RedeemCoupon:t.RedeemCoupon,ValidateCoupon:t.ValidateCoupon,Header:t.Header})))}addNewCouponProvider(){this.dialog.open(S).afterClosed().pipe(N(e=>w.IsNotEmpty(e)),k(e=>{let o={Name:e.name,ValidateCoupon:e.validateCoupon,RedeemCoupon:e.redeemCoupon,Enabled:e.enabled,Header:e.header};return[...this.couponProviders(),o]})).subscribe(e=>{this.couponProviders.update(()=>e),this.saveCouponProviders(`Coupon provider "${e[e.length-1].Name}" has been successfully added.`)})}onUpdateProvider(e,o){this.dialog.open(S,{data:{name:e.Name,validateCoupon:e.ValidateCoupon,redeemCoupon:e.RedeemCoupon,enabled:e.Enabled,header:e.Header}}).afterClosed().pipe(N(t=>w.IsNotEmpty(t))).subscribe(t=>{let p={Name:t.name,ValidateCoupon:t.validateCoupon,RedeemCoupon:t.redeemCoupon,Enabled:t.enabled,Header:t.header};this.couponProviders.update(C=>(C[o]=p,[...C])),this.saveCouponProviders(`Coupon provider "${t.name}" has been successfully updated.`)})}onDeleteProvider(e){if(confirm("Are you sure you want to delete this coupon provider?")){let o=this.couponProviders()[e]?.Name||"provider";this.couponProviders.update(t=>(t.splice(e,1),[...t])),this.saveCouponProviders(`Coupon provider "${o}" has been successfully deleted.`)}}saveCouponProviders(e){this.httpService.post(F.WebhookCouponProviderSave,this.couponProviders()).subscribe(()=>{this.toastr.success(e||"Coupon provider has been successfully updated.","Success")})}static \u0275fac=function(o){return new(o||r)(c(ue),c(ne),c(B),c(ie),c(le))};static \u0275cmp=E({type:r,selectors:[["app-coupon-configuration"]],features:[V],decls:27,vars:4,consts:[["EMPTY_STATE",""],[3,"pageData","hideSearchDropdown","hideSearchBox"],["type","button",1,"btn","btn-success",3,"click"],[1,"container-fluid","mt-6"],[1,"row"],[1,"col-12"],[1,"table","table-stripped","custom-table"],[1,"thead-light","sticky-top-thead"],[1,"text-center",2,"width","10px"],[2,"width","220px"],[1,"text-center"],["title","Delete provider",1,"fa","fa-xmark","text-danger",2,"cursor","pointer",3,"click"],["role","button",1,"link-primary","cursor-pointer",3,"click"],[1,"p-3","rounded-2",3,"ngClass"],[4,"ngTemplateOutlet"],[1,"table-border-bottom-0"],["colspan","7"]],template:function(o,t){if(o&1){let p=T();n(0,"mainpanel-cmp",1)(1,"actions")(2,"button",2),v("click",function(){return P(p),y(t.addNewCouponProvider())}),a(3," Add "),i()(),n(4,"content")(5,"div",3)(6,"div",4)(7,"div",5)(8,"table",6)(9,"thead",7)(10,"tr"),s(11,"th",8),n(12,"th",9),a(13,"Name"),i(),n(14,"th"),a(15,"Validate Coupon"),i(),n(16,"th"),a(17,"Redeem Coupon"),i(),n(18,"th"),a(19,"Value"),i(),n(20,"th"),a(21,"Status"),i()()(),n(22,"tbody"),u(23,xe,2,0)(24,Te,1,1,"ng-container"),i()()()()(),u(25,Ie,3,0,"ng-template",null,0,q),i()()}if(o&2){let p;m("pageData",t.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(23),f(((p=t.listProviders())==null?null:p.length)>0?23:24)}},dependencies:[M,R,L,ce,se,oe,fe],encapsulation:2})};export{ge as CouponConfigurationComponent};
@@ -1 +1 @@
1
- import{a as P}from"./chunk-H73MVYHX.js";import{a as C}from"./chunk-2PXEEOUO.js";import{a as w}from"./chunk-Q45IFUGA.js";import{a as A}from"./chunk-2SAQDBKA.js";import{a as I}from"./chunk-SRELAFRM.js";import{a as l}from"./chunk-2FWFPV5I.js";import{a as c}from"./chunk-EQ6536VC.js";import{fa as y,na as f,t as L,z as S}from"./chunk-ONCTFURX.js";import{a as F}from"./chunk-7DCB7DB2.js";var g=class{enabledDragItem;constructor(){this.enabledDragItem=!1}drop(o,t){C(t.Data,o.previousIndex,o.currentIndex)}toggleEnabledDragItem(){}onSaveDragAndDrop(o,t){this.enabledDragItem=!this.enabledDragItem,this.enabledDragItem||t.postListID(o,t.data.Data)}onPutSaveDragAndDrop(o,t){this.enabledDragItem=!this.enabledDragItem,this.enabledDragItem||t.putListID(o,t.data.Data)}};var u=class{constructor(o){this.httpService=o}exportCSV(o,t,e,i){e.pageData.Filter.Export=!0,e.pageData.Filter.FormatType=0,i=i||"export.csv",this.httpService.post(`/api/${t}`,e.pageData.Filter).subscribe(r=>{o.convertToCSV(r,i),e.pageData.Filter.Export=!1})}convertToCSV(o,t=!1,e){let i=this.ExportDataFromUI2(t);o.convertToCSV(i,e)}ExportDataFromUI2(o=!1){let t=document.getElementById("tableGrid"),e=[];return c.IsNotEmpty(t)&&t.querySelectorAll("tr").forEach(r=>{let a=new Object,s=0;r.querySelectorAll("th, td").forEach(n=>{s++;let b=parseInt(n.getAttribute("colspan"));for(let h=1;h<b;h++)a["column"+s]="",s++;let m=n.innerText,v=m.toString().split("");if(o&&v[0]==="0"&&v.length>1){let h="'"+m.trim();a["column"+s]=h}else a["column"+s]=m.trim()}),e.push(a)}),e}};var d=class{listTotal;pageSize;show;constructor(){this.listTotal=0,this.pageSize=0,this.show=!1}changePaginationData(o){this.pageSize=o.pageData.Filter.RowCount,this.listTotal=o.data?.ListTotal??o.data?.Data?.total?.value,this.show=this.pageSize<=this.listTotal}changePage(o,t,e){t.Filter.PageNumber=o.pageIndex+1,e.getListData()}};var x=class extends A{constructor(t,e,i,r,a,s,p){super(t);this.httpService=e;this.dataAPI=i;this.pageAPI=r;this.toastrService=a;this.route=s;this.initOpenDialog=p;this.exportHandler=new u(e),r?(s&&(this.loaderPayload=F({ListIDs:this.reportFilterService?.initOutletFilter()},s.snapshot.queryParams)),this.preInitLoader(),S([this.menuData$,this.httpService.post("/api/"+this.pageAPI,this.loaderPayload)]).pipe(L(([n,b])=>b)).pipe(I()).subscribe(n=>{this.pageData=n,this.pageData.Filter||(this.pageData.Filter={},this.pageData.Filter.RowCount=20),this.pageData.Filter.PageNumber=1,this.pageData.Filter.ID=this.loaderPayload.ID,this.preInitList(),p?this.openDialogFilter.openDialog():this.getListData()})):(this.pageData.Filter.RowCount=20,this.pageData.Filter.PageNumber=1,this.preInitList(),S({menuData:this.menuData$,listData:this.getListData$()}).pipe(I()).subscribe())}openDialogFilter=f(w);reportFilterService=f(P);pageData={Filter:{},Options:{},Roles:{},Config:{}};data;pagination=new d;dragDrop=new g;exportHandler;comparation=0;loaderPayload={};preInitLoader(){}preInitList(){}getListData(t){this.preGetList(),this.dataAPI&&this.httpService.post("/api/"+this.dataAPI,this.pageData.Filter).subscribe(e=>{this.data=e,this.postInit(e),this.pagination.changePaginationData(this),t&&(this.pageData.HideStoreApiCount=!1)})}getListData$(t){return this.preGetList(),this.httpService.post("/api/"+this.dataAPI,this.pageData.Filter).pipe(y(e=>{this.data=e,this.postInit(e),this.pagination.changePaginationData(this),t&&(this.pageData.HideStoreApiCount=!1)}))}searchFromPageOne(){this.preSearchFromPageOne(),this.pageData.Filter.PageNumber=1,this.getListData("filterMode")}postInit(t){t.PageTitle!=null&&(this.menuData.H=t.PageTitle)}preGetList(){this.pageData.Filter.From==null&&(this.pageData.Filter.From=c.MinDate),this.pageData.Filter.To==null&&(this.pageData.Filter.To=c.MinDate)}preSearchFromPageOne(){}onPaginationChange(t){this.pagination.changePage(t,this.pageData,this)}onSelectAllData(t){this.data.Data=this.data.Data.map(e=>(e.selected=t,e))}getSelectedData(){let t=[];return this.data&&(t=this.data.Data.filter(e=>e.selected)),t}httpPostListID(t,e,i){if(e||(e="Are you sure you want to selected record/s?"),confirm(e)==!1)return;let r=this.getSelectedData();r.length>0&&this.postListID(t,r,i)}httpPutListID(t,e,i){if(e||(e="Are you sure you want to selected record/s?"),confirm(e)==!1)return;let r=this.getSelectedData();r.length>0&&this.putListID(t,r,i)}httpDeleteListID(t,e,i){if(e||(e="Are you sure you want to delete selected record/s?"),confirm(e)==!1)return;let r=this.getSelectedData();r.length>0&&this.DeleteListID(t,r,i)}onSaveDragAndDrop(t){this.dragDrop.onSaveDragAndDrop(t,this)}onPutSaveDragAndDrop(t){this.dragDrop.onPutSaveDragAndDrop(t,this)}postListID(t,e,i){let r=e.map(a=>i?a[i]:a.ID);this.httpService.post(`/api/${t}`,r,1e6,!0).subscribe(a=>{this.toastrService.success(a.Message?a.Message:a,l.Success),this.getListData()},a=>{let s=a.status+" "+a.statusText;this.toastrService.error(a.error.Message!=""?a.error.Message:"An unknown error has occured!",s,{enableHtml:!0})})}putListID(t,e,i){let r=e.map(a=>i?a[i]:a.ID);this.httpService.put(`/api/${t}`,r).subscribe(a=>{this.toastrService.success(a.Message?a.Message:a,l.Success),this.afterPutListSuccess(),this.getListData()})}afterPutListSuccess(){}DeleteListID(t,e,i){let r=e.map(a=>i?a[i]:a.ID);this.httpService.delete(`/api/${t}`,{body:r}).subscribe(a=>{this.toastrService.success(a.Message?a.Message:a,l.Success),this.getListData()})}postData(t,e){this.httpService.post("/API/"+t,e).subscribe(i=>{this.getListData(),this.toastrService.success(i.Message?i.Message:i,l.Success)})}compare(t,e,i){return(t<e?-1:1)*(i?1:-1)}exportCSV(t,e,i){this.exportHandler.exportCSV(t,e,this,i)}s2ab(t){for(var e=new ArrayBuffer(t.length),i=new Uint8Array(e),r=0;r!=t.length;++r)i[r]=t.charCodeAt(r)&255;return e}exportXlsx(t,e){this.pageData.Filter.FormatType=1,this.pageData.Filter.Export=!0,this.httpService.post(`/api/${t}`,this.pageData.Filter).subscribe(i=>{e=decodeURI(e);let r=window.URL.createObjectURL(new Blob([this.s2ab(atob(i))],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,"})),a=document.createElement("a");a.href=r,a.setAttribute("download",e),document.body.appendChild(a),a.click(),window.URL.revokeObjectURL(r),a.remove()})}convertToCSV(t,e=!1,i){let r=this.exportHandler.ExportDataFromUI2(e);t.convertToCSV(r,i)}OnCompare(t){let e=t?this.data[t]:this.data;if(e.length<1)return;let i=Object.assign({},this.pageData.Filter);i.From=new Date(new Date(this.pageData.Filter.From).getFullYear(),new Date(this.pageData.Filter.From).getMonth()-1,1),i.To=new Date(new Date(this.pageData.Filter.To).getFullYear(),new Date(this.pageData.Filter.To).getMonth(),0).toDateString(),this.httpService.post("/API/"+this.dataAPI,i).subscribe(r=>{let a=t?r[t]:r;this.comparation=0,e.forEach(s=>{s.PrevIndex="-",s.CurrentIndex="-",s.Increase="-";let p=a.filter(n=>n.EntityID==s.EntityID);if(s.CurrentIndex=s.Rank,p.length>0){let n=p[0];s.PrevIndex=n.Rank,n.SalesNet?s.Increase=(s.SalesNet-n.SalesNet)/n.SalesNet*100:n.Sales&&(s.Increase=(s.Sales-n.Sales)/n.Sales*100),s.IsPositive=s.Increase>0,s.IsNegative=s.Increase<0,this.comparation+=s.Increase}})})}};export{x as a};
1
+ import{a as P}from"./chunk-6VQ2WO2R.js";import{a as C}from"./chunk-2PXEEOUO.js";import{a as w}from"./chunk-GGEENO4M.js";import{a as A}from"./chunk-APVQGR37.js";import{a as I}from"./chunk-SRELAFRM.js";import{a as l}from"./chunk-2FWFPV5I.js";import{a as c}from"./chunk-EQ6536VC.js";import{fa as y,na as f,t as L,z as S}from"./chunk-ONCTFURX.js";import{a as F}from"./chunk-7DCB7DB2.js";var g=class{enabledDragItem;constructor(){this.enabledDragItem=!1}drop(o,t){C(t.Data,o.previousIndex,o.currentIndex)}toggleEnabledDragItem(){}onSaveDragAndDrop(o,t){this.enabledDragItem=!this.enabledDragItem,this.enabledDragItem||t.postListID(o,t.data.Data)}onPutSaveDragAndDrop(o,t){this.enabledDragItem=!this.enabledDragItem,this.enabledDragItem||t.putListID(o,t.data.Data)}};var u=class{constructor(o){this.httpService=o}exportCSV(o,t,e,i){e.pageData.Filter.Export=!0,e.pageData.Filter.FormatType=0,i=i||"export.csv",this.httpService.post(`/api/${t}`,e.pageData.Filter).subscribe(r=>{o.convertToCSV(r,i),e.pageData.Filter.Export=!1})}convertToCSV(o,t=!1,e){let i=this.ExportDataFromUI2(t);o.convertToCSV(i,e)}ExportDataFromUI2(o=!1){let t=document.getElementById("tableGrid"),e=[];return c.IsNotEmpty(t)&&t.querySelectorAll("tr").forEach(r=>{let a=new Object,s=0;r.querySelectorAll("th, td").forEach(n=>{s++;let b=parseInt(n.getAttribute("colspan"));for(let h=1;h<b;h++)a["column"+s]="",s++;let m=n.innerText,v=m.toString().split("");if(o&&v[0]==="0"&&v.length>1){let h="'"+m.trim();a["column"+s]=h}else a["column"+s]=m.trim()}),e.push(a)}),e}};var d=class{listTotal;pageSize;show;constructor(){this.listTotal=0,this.pageSize=0,this.show=!1}changePaginationData(o){this.pageSize=o.pageData.Filter.RowCount,this.listTotal=o.data?.ListTotal??o.data?.Data?.total?.value,this.show=this.pageSize<=this.listTotal}changePage(o,t,e){t.Filter.PageNumber=o.pageIndex+1,e.getListData()}};var x=class extends A{constructor(t,e,i,r,a,s,p){super(t);this.httpService=e;this.dataAPI=i;this.pageAPI=r;this.toastrService=a;this.route=s;this.initOpenDialog=p;this.exportHandler=new u(e),r?(s&&(this.loaderPayload=F({ListIDs:this.reportFilterService?.initOutletFilter()},s.snapshot.queryParams)),this.preInitLoader(),S([this.menuData$,this.httpService.post("/api/"+this.pageAPI,this.loaderPayload)]).pipe(L(([n,b])=>b)).pipe(I()).subscribe(n=>{this.pageData=n,this.pageData.Filter||(this.pageData.Filter={},this.pageData.Filter.RowCount=20),this.pageData.Filter.PageNumber=1,this.pageData.Filter.ID=this.loaderPayload.ID,this.preInitList(),p?this.openDialogFilter.openDialog():this.getListData()})):(this.pageData.Filter.RowCount=20,this.pageData.Filter.PageNumber=1,this.preInitList(),S({menuData:this.menuData$,listData:this.getListData$()}).pipe(I()).subscribe())}openDialogFilter=f(w);reportFilterService=f(P);pageData={Filter:{},Options:{},Roles:{},Config:{}};data;pagination=new d;dragDrop=new g;exportHandler;comparation=0;loaderPayload={};preInitLoader(){}preInitList(){}getListData(t){this.preGetList(),this.dataAPI&&this.httpService.post("/api/"+this.dataAPI,this.pageData.Filter).subscribe(e=>{this.data=e,this.postInit(e),this.pagination.changePaginationData(this),t&&(this.pageData.HideStoreApiCount=!1)})}getListData$(t){return this.preGetList(),this.httpService.post("/api/"+this.dataAPI,this.pageData.Filter).pipe(y(e=>{this.data=e,this.postInit(e),this.pagination.changePaginationData(this),t&&(this.pageData.HideStoreApiCount=!1)}))}searchFromPageOne(){this.preSearchFromPageOne(),this.pageData.Filter.PageNumber=1,this.getListData("filterMode")}postInit(t){t.PageTitle!=null&&(this.menuData.H=t.PageTitle)}preGetList(){this.pageData.Filter.From==null&&(this.pageData.Filter.From=c.MinDate),this.pageData.Filter.To==null&&(this.pageData.Filter.To=c.MinDate)}preSearchFromPageOne(){}onPaginationChange(t){this.pagination.changePage(t,this.pageData,this)}onSelectAllData(t){this.data.Data=this.data.Data.map(e=>(e.selected=t,e))}getSelectedData(){let t=[];return this.data&&(t=this.data.Data.filter(e=>e.selected)),t}httpPostListID(t,e,i){if(e||(e="Are you sure you want to selected record/s?"),confirm(e)==!1)return;let r=this.getSelectedData();r.length>0&&this.postListID(t,r,i)}httpPutListID(t,e,i){if(e||(e="Are you sure you want to selected record/s?"),confirm(e)==!1)return;let r=this.getSelectedData();r.length>0&&this.putListID(t,r,i)}httpDeleteListID(t,e,i){if(e||(e="Are you sure you want to delete selected record/s?"),confirm(e)==!1)return;let r=this.getSelectedData();r.length>0&&this.DeleteListID(t,r,i)}onSaveDragAndDrop(t){this.dragDrop.onSaveDragAndDrop(t,this)}onPutSaveDragAndDrop(t){this.dragDrop.onPutSaveDragAndDrop(t,this)}postListID(t,e,i){let r=e.map(a=>i?a[i]:a.ID);this.httpService.post(`/api/${t}`,r,1e6,!0).subscribe(a=>{this.toastrService.success(a.Message?a.Message:a,l.Success),this.getListData()},a=>{let s=a.status+" "+a.statusText;this.toastrService.error(a.error.Message!=""?a.error.Message:"An unknown error has occured!",s,{enableHtml:!0})})}putListID(t,e,i){let r=e.map(a=>i?a[i]:a.ID);this.httpService.put(`/api/${t}`,r).subscribe(a=>{this.toastrService.success(a.Message?a.Message:a,l.Success),this.afterPutListSuccess(),this.getListData()})}afterPutListSuccess(){}DeleteListID(t,e,i){let r=e.map(a=>i?a[i]:a.ID);this.httpService.delete(`/api/${t}`,{body:r}).subscribe(a=>{this.toastrService.success(a.Message?a.Message:a,l.Success),this.getListData()})}postData(t,e){this.httpService.post("/API/"+t,e).subscribe(i=>{this.getListData(),this.toastrService.success(i.Message?i.Message:i,l.Success)})}compare(t,e,i){return(t<e?-1:1)*(i?1:-1)}exportCSV(t,e,i){this.exportHandler.exportCSV(t,e,this,i)}s2ab(t){for(var e=new ArrayBuffer(t.length),i=new Uint8Array(e),r=0;r!=t.length;++r)i[r]=t.charCodeAt(r)&255;return e}exportXlsx(t,e){this.pageData.Filter.FormatType=1,this.pageData.Filter.Export=!0,this.httpService.post(`/api/${t}`,this.pageData.Filter).subscribe(i=>{e=decodeURI(e);let r=window.URL.createObjectURL(new Blob([this.s2ab(atob(i))],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,"})),a=document.createElement("a");a.href=r,a.setAttribute("download",e),document.body.appendChild(a),a.click(),window.URL.revokeObjectURL(r),a.remove()})}convertToCSV(t,e=!1,i){let r=this.exportHandler.ExportDataFromUI2(e);t.convertToCSV(r,i)}OnCompare(t){let e=t?this.data[t]:this.data;if(e.length<1)return;let i=Object.assign({},this.pageData.Filter);i.From=new Date(new Date(this.pageData.Filter.From).getFullYear(),new Date(this.pageData.Filter.From).getMonth()-1,1),i.To=new Date(new Date(this.pageData.Filter.To).getFullYear(),new Date(this.pageData.Filter.To).getMonth(),0).toDateString(),this.httpService.post("/API/"+this.dataAPI,i).subscribe(r=>{let a=t?r[t]:r;this.comparation=0,e.forEach(s=>{s.PrevIndex="-",s.CurrentIndex="-",s.Increase="-";let p=a.filter(n=>n.EntityID==s.EntityID);if(s.CurrentIndex=s.Rank,p.length>0){let n=p[0];s.PrevIndex=n.Rank,n.SalesNet?s.Increase=(s.SalesNet-n.SalesNet)/n.SalesNet*100:n.Sales&&(s.Increase=(s.Sales-n.Sales)/n.Sales*100),s.IsPositive=s.Increase>0,s.IsNegative=s.Increase<0,this.comparation+=s.Increase}})})}};export{x as a};
@@ -1,4 +1,4 @@
1
- import{a as ue}from"./chunk-X6OU5HV5.js";import{a as me,d as he}from"./chunk-GDLTEIKV.js";import{a as It}from"./chunk-PNVRIGOW.js";import{C as Lt,D as Kt,E as $t,N as Nt,O as zt,u as Pt,v as Bt,w as Ot}from"./chunk-KMVWE6IR.js";import{ga as Et,ha as Ft,q as Dt}from"./chunk-4IJDCXOA.js";import{O as Rt,n as At}from"./chunk-QMH4FATM.js";import{a as bt}from"./chunk-SRELAFRM.js";import{a as de,c as Tt}from"./chunk-O4T67QQ3.js";import{C as Me,J as Ct,K as kt,U as wt,V as St,b as _t,ga as Vt,i as vt,ja as se,ka as A,m as xt,pa as Mt,s as yt,sa as pe}from"./chunk-WUSKRV4R.js";import{D as ht,a as rt,c as lt,g as ct,h as st,i as pt,k as dt,o as ut,p as mt}from"./chunk-J577JGRK.js";import{a as ot,c as gt}from"./chunk-WULI4TL4.js";import{a as ft}from"./chunk-VUVNZP6V.js";import{a as Y}from"./chunk-EQ6536VC.js";import{$a as s,$b as I,$c as G,Bd as le,Cd as ce,Db as je,Dc as Ge,Ed as Ve,Fa as _,Ga as $e,Ib as r,Ja as Ae,Jb as c,Jc as Ye,Kb as h,Kc as w,Lb as V,Lc as ae,Ma as Re,Mb as M,N as Be,Nb as He,Ob as b,Oc as we,Pd as tt,Qb as f,Qd as nt,Rb as p,Rd as it,Sb as ee,Tb as R,Td as at,Ub as Q,Uc as U,Wc as Xe,Xc as Z,Yb as F,Zb as Qe,_a as Ne,_b as T,_c as Je,aa as Oe,bc as te,cc as We,d as Fe,db as x,dc as qe,ec as v,fc as W,gb as J,gc as ne,hc as Ue,hd as $,ia as Le,id as re,ja as z,jc as O,ka as j,kb as y,kc as L,lb as H,lc as K,na as P,nb as ze,nc as ie,ob as B,oc as q,pc as k,qb as d,qc as Ce,t as Pe,ua as Ke,ub as C,va as u,vb as l,wa as m,xa as X,xb as xe,xc as oe,yb as ye,yc as ke,yd as et,za as S,zb as E,zc as Ze,zd as Se}from"./chunk-ONCTFURX.js";import{a as ve,b as Ee}from"./chunk-7DCB7DB2.js";var fe=class t{_openDialog=new Fe;openDialog$=this._openDialog.asObservable();openDialog(){this._openDialog.next()}static \u0275fac=function(e){return new(e||t)};static \u0275prov=z({token:t,factory:t.\u0275fac,providedIn:"root"})};var jt=(()=>{class t extends me{static \u0275fac=(()=>{let e;return function(i){return(e||(e=S(t)))(i||t)}})();static \u0275cmp=y({type:t,selectors:[["CheckIcon"]],features:[B],decls:2,vars:5,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M4.86199 11.5948C4.78717 11.5923 4.71366 11.5745 4.64596 11.5426C4.57826 11.5107 4.51779 11.4652 4.46827 11.4091L0.753985 7.69483C0.683167 7.64891 0.623706 7.58751 0.580092 7.51525C0.536478 7.44299 0.509851 7.36177 0.502221 7.27771C0.49459 7.19366 0.506156 7.10897 0.536046 7.03004C0.565935 6.95111 0.613367 6.88 0.674759 6.82208C0.736151 6.76416 0.8099 6.72095 0.890436 6.69571C0.970973 6.67046 1.05619 6.66385 1.13966 6.67635C1.22313 6.68886 1.30266 6.72017 1.37226 6.76792C1.44186 6.81567 1.4997 6.8786 1.54141 6.95197L4.86199 10.2503L12.6397 2.49483C12.7444 2.42694 12.8689 2.39617 12.9932 2.40745C13.1174 2.41873 13.2343 2.47141 13.3251 2.55705C13.4159 2.64268 13.4753 2.75632 13.4938 2.87973C13.5123 3.00315 13.4888 3.1292 13.4271 3.23768L5.2557 11.4091C5.20618 11.4652 5.14571 11.5107 5.07801 11.5426C5.01031 11.5745 4.9368 11.5923 4.86199 11.5948Z","fill","currentColor"]],template:function(n,i){n&1&&(X(),r(0,"svg",0),h(1,"path",1),c()),n&2&&(E(i.getClassNames()),C("aria-label",i.ariaLabel)("aria-hidden",i.ariaHidden)("role",i.role))},encapsulation:2})}return t})();var Ht=(()=>{class t extends me{static \u0275fac=(()=>{let e;return function(i){return(e||(e=S(t)))(i||t)}})();static \u0275cmp=y({type:t,selectors:[["MinusIcon"]],features:[B],decls:2,vars:5,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M13.2222 7.77778H0.777778C0.571498 7.77778 0.373667 7.69584 0.227806 7.54998C0.0819442 7.40412 0 7.20629 0 7.00001C0 6.79373 0.0819442 6.5959 0.227806 6.45003C0.373667 6.30417 0.571498 6.22223 0.777778 6.22223H13.2222C13.4285 6.22223 13.6263 6.30417 13.7722 6.45003C13.9181 6.5959 14 6.79373 14 7.00001C14 7.20629 13.9181 7.40412 13.7722 7.54998C13.6263 7.69584 13.4285 7.77778 13.2222 7.77778Z","fill","currentColor"]],template:function(n,i){n&1&&(X(),r(0,"svg",0),h(1,"path",1),c()),n&2&&(E(i.getClassNames()),C("aria-label",i.ariaLabel)("aria-hidden",i.ariaHidden)("role",i.role))},encapsulation:2})}return t})();var Jt=["checkboxicon"],en=["input"],tn=()=>({"p-checkbox-input":!0}),nn=t=>({checked:t,class:"p-checkbox-icon"});function on(t,o){if(t&1&&h(0,"span",8),t&2){let e=p(3);l("ngClass",e.checkboxIcon),C("data-pc-section","icon")}}function an(t,o){t&1&&h(0,"CheckIcon",9),t&2&&(l("styleClass","p-checkbox-icon"),C("data-pc-section","icon"))}function rn(t,o){if(t&1&&(V(0),d(1,on,1,2,"span",7)(2,an,1,2,"CheckIcon",6),M()),t&2){let e=p(2);s(),l("ngIf",e.checkboxIcon),s(),l("ngIf",!e.checkboxIcon)}}function ln(t,o){t&1&&h(0,"MinusIcon",9),t&2&&(l("styleClass","p-checkbox-icon"),C("data-pc-section","icon"))}function cn(t,o){if(t&1&&(V(0),d(1,rn,3,2,"ng-container",4)(2,ln,1,2,"MinusIcon",6),M()),t&2){let e=p();s(),l("ngIf",e.checked),s(),l("ngIf",e._indeterminate())}}function sn(t,o){}function pn(t,o){t&1&&d(0,sn,0,0,"ng-template")}var dn=({dt:t})=>`
1
+ import{a as ue}from"./chunk-6S6Q7SED.js";import{a as me,d as he}from"./chunk-GDLTEIKV.js";import{a as It}from"./chunk-PNVRIGOW.js";import{C as Lt,D as Kt,E as $t,N as Nt,O as zt,u as Pt,v as Bt,w as Ot}from"./chunk-KMVWE6IR.js";import{ga as Et,ha as Ft,q as Dt}from"./chunk-4IJDCXOA.js";import{O as Rt,n as At}from"./chunk-QMH4FATM.js";import{a as bt}from"./chunk-SRELAFRM.js";import{a as de,c as Tt}from"./chunk-O4T67QQ3.js";import{C as Me,J as Ct,K as kt,U as wt,V as St,b as _t,ga as Vt,i as vt,ja as se,ka as A,m as xt,pa as Mt,s as yt,sa as pe}from"./chunk-WUSKRV4R.js";import{D as ht,a as rt,c as lt,g as ct,h as st,i as pt,k as dt,o as ut,p as mt}from"./chunk-J577JGRK.js";import{a as ot,c as gt}from"./chunk-RDARJWEZ.js";import{a as ft}from"./chunk-JDMYDBXN.js";import{a as Y}from"./chunk-EQ6536VC.js";import{$a as s,$b as I,$c as G,Bd as le,Cd as ce,Db as je,Dc as Ge,Ed as Ve,Fa as _,Ga as $e,Ib as r,Ja as Ae,Jb as c,Jc as Ye,Kb as h,Kc as w,Lb as V,Lc as ae,Ma as Re,Mb as M,N as Be,Nb as He,Ob as b,Oc as we,Pd as tt,Qb as f,Qd as nt,Rb as p,Rd as it,Sb as ee,Tb as R,Td as at,Ub as Q,Uc as U,Wc as Xe,Xc as Z,Yb as F,Zb as Qe,_a as Ne,_b as T,_c as Je,aa as Oe,bc as te,cc as We,d as Fe,db as x,dc as qe,ec as v,fc as W,gb as J,gc as ne,hc as Ue,hd as $,ia as Le,id as re,ja as z,jc as O,ka as j,kb as y,kc as L,lb as H,lc as K,na as P,nb as ze,nc as ie,ob as B,oc as q,pc as k,qb as d,qc as Ce,t as Pe,ua as Ke,ub as C,va as u,vb as l,wa as m,xa as X,xb as xe,xc as oe,yb as ye,yc as ke,yd as et,za as S,zb as E,zc as Ze,zd as Se}from"./chunk-ONCTFURX.js";import{a as ve,b as Ee}from"./chunk-7DCB7DB2.js";var fe=class t{_openDialog=new Fe;openDialog$=this._openDialog.asObservable();openDialog(){this._openDialog.next()}static \u0275fac=function(e){return new(e||t)};static \u0275prov=z({token:t,factory:t.\u0275fac,providedIn:"root"})};var jt=(()=>{class t extends me{static \u0275fac=(()=>{let e;return function(i){return(e||(e=S(t)))(i||t)}})();static \u0275cmp=y({type:t,selectors:[["CheckIcon"]],features:[B],decls:2,vars:5,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M4.86199 11.5948C4.78717 11.5923 4.71366 11.5745 4.64596 11.5426C4.57826 11.5107 4.51779 11.4652 4.46827 11.4091L0.753985 7.69483C0.683167 7.64891 0.623706 7.58751 0.580092 7.51525C0.536478 7.44299 0.509851 7.36177 0.502221 7.27771C0.49459 7.19366 0.506156 7.10897 0.536046 7.03004C0.565935 6.95111 0.613367 6.88 0.674759 6.82208C0.736151 6.76416 0.8099 6.72095 0.890436 6.69571C0.970973 6.67046 1.05619 6.66385 1.13966 6.67635C1.22313 6.68886 1.30266 6.72017 1.37226 6.76792C1.44186 6.81567 1.4997 6.8786 1.54141 6.95197L4.86199 10.2503L12.6397 2.49483C12.7444 2.42694 12.8689 2.39617 12.9932 2.40745C13.1174 2.41873 13.2343 2.47141 13.3251 2.55705C13.4159 2.64268 13.4753 2.75632 13.4938 2.87973C13.5123 3.00315 13.4888 3.1292 13.4271 3.23768L5.2557 11.4091C5.20618 11.4652 5.14571 11.5107 5.07801 11.5426C5.01031 11.5745 4.9368 11.5923 4.86199 11.5948Z","fill","currentColor"]],template:function(n,i){n&1&&(X(),r(0,"svg",0),h(1,"path",1),c()),n&2&&(E(i.getClassNames()),C("aria-label",i.ariaLabel)("aria-hidden",i.ariaHidden)("role",i.role))},encapsulation:2})}return t})();var Ht=(()=>{class t extends me{static \u0275fac=(()=>{let e;return function(i){return(e||(e=S(t)))(i||t)}})();static \u0275cmp=y({type:t,selectors:[["MinusIcon"]],features:[B],decls:2,vars:5,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M13.2222 7.77778H0.777778C0.571498 7.77778 0.373667 7.69584 0.227806 7.54998C0.0819442 7.40412 0 7.20629 0 7.00001C0 6.79373 0.0819442 6.5959 0.227806 6.45003C0.373667 6.30417 0.571498 6.22223 0.777778 6.22223H13.2222C13.4285 6.22223 13.6263 6.30417 13.7722 6.45003C13.9181 6.5959 14 6.79373 14 7.00001C14 7.20629 13.9181 7.40412 13.7722 7.54998C13.6263 7.69584 13.4285 7.77778 13.2222 7.77778Z","fill","currentColor"]],template:function(n,i){n&1&&(X(),r(0,"svg",0),h(1,"path",1),c()),n&2&&(E(i.getClassNames()),C("aria-label",i.ariaLabel)("aria-hidden",i.ariaHidden)("role",i.role))},encapsulation:2})}return t})();var Jt=["checkboxicon"],en=["input"],tn=()=>({"p-checkbox-input":!0}),nn=t=>({checked:t,class:"p-checkbox-icon"});function on(t,o){if(t&1&&h(0,"span",8),t&2){let e=p(3);l("ngClass",e.checkboxIcon),C("data-pc-section","icon")}}function an(t,o){t&1&&h(0,"CheckIcon",9),t&2&&(l("styleClass","p-checkbox-icon"),C("data-pc-section","icon"))}function rn(t,o){if(t&1&&(V(0),d(1,on,1,2,"span",7)(2,an,1,2,"CheckIcon",6),M()),t&2){let e=p(2);s(),l("ngIf",e.checkboxIcon),s(),l("ngIf",!e.checkboxIcon)}}function ln(t,o){t&1&&h(0,"MinusIcon",9),t&2&&(l("styleClass","p-checkbox-icon"),C("data-pc-section","icon"))}function cn(t,o){if(t&1&&(V(0),d(1,rn,3,2,"ng-container",4)(2,ln,1,2,"MinusIcon",6),M()),t&2){let e=p();s(),l("ngIf",e.checked),s(),l("ngIf",e._indeterminate())}}function sn(t,o){}function pn(t,o){t&1&&d(0,sn,0,0,"ng-template")}var dn=({dt:t})=>`
2
2
  .p-checkbox {
3
3
  position: relative;
4
4
  display: inline-flex;