dealpos 25.39.1 → 25.39.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/browser/{chunk-4D5LU6WP.js → chunk-22YZI422.js} +1 -1
  2. package/browser/{chunk-SPWVFE3S.js → chunk-26S2EEKX.js} +1 -1
  3. package/browser/{chunk-AP7SDPBZ.js → chunk-2C6MWHDS.js} +1 -1
  4. package/browser/{chunk-3E2POQOE.js → chunk-2MWJFITN.js} +1 -1
  5. package/browser/{chunk-SUNT3LCJ.js → chunk-34DM3UGK.js} +1 -1
  6. package/browser/{chunk-GUENPOXA.js → chunk-3KUJU5BU.js} +1 -1
  7. package/browser/{chunk-RTX5XAH7.js → chunk-3MBKXSSX.js} +1 -1
  8. package/browser/{chunk-UDQTRTX2.js → chunk-3T4NN6PB.js} +1 -1
  9. package/browser/{chunk-365GNBX3.js → chunk-43GXPSBB.js} +1 -1
  10. package/browser/{chunk-EZHMLFME.js → chunk-4CARUV4H.js} +1 -1
  11. package/browser/{chunk-45IBPFMD.js → chunk-4GQXMRUO.js} +1 -1
  12. package/browser/{chunk-DFYI47OA.js → chunk-4GWH3ZCR.js} +2 -2
  13. package/browser/{chunk-23OOL7UP.js → chunk-5FQNAE5Q.js} +1 -1
  14. package/browser/{chunk-DE2KR7E4.js → chunk-6WIZZLEN.js} +1 -1
  15. package/browser/{chunk-5TIJEZIR.js → chunk-736JCGLJ.js} +1 -1
  16. package/browser/{chunk-PWGLDS46.js → chunk-7B7GNMTJ.js} +2 -2
  17. package/browser/{chunk-23X4TU5M.js → chunk-7GPICHCI.js} +1 -1
  18. package/browser/{chunk-UJWY2RAO.js → chunk-AMX24G23.js} +1 -1
  19. package/browser/{chunk-XLK4IMKW.js → chunk-AW3RJSE6.js} +2 -2
  20. package/browser/{chunk-YQKGQMBQ.js → chunk-BKPYLOWM.js} +1 -1
  21. package/browser/{chunk-3RXBPKLI.js → chunk-BMAU6N5H.js} +1 -1
  22. package/browser/{chunk-2JCKAW74.js → chunk-BNMCFXUM.js} +1 -1
  23. package/browser/{chunk-ZL4GSXVP.js → chunk-C4LUL5KJ.js} +1 -1
  24. package/browser/{chunk-PENIHHYB.js → chunk-CBMNFMAH.js} +1 -1
  25. package/browser/{chunk-VXDPSA46.js → chunk-CGLLB7US.js} +1 -1
  26. package/browser/{chunk-HCOCU2U4.js → chunk-DA2JCXEB.js} +1 -1
  27. package/browser/{chunk-A5LNLL32.js → chunk-E6HIYDN6.js} +1 -1
  28. package/browser/{chunk-NSNBYR6U.js → chunk-E6TB2F65.js} +1 -1
  29. package/browser/{chunk-TFEIBMHX.js → chunk-ECQX76DP.js} +1 -1
  30. package/browser/{chunk-7WSRVEP4.js → chunk-F4LTPPFA.js} +1 -1
  31. package/browser/{chunk-64TO4BSY.js → chunk-FQFTJVIA.js} +2 -2
  32. package/browser/{chunk-NQUVDWF3.js → chunk-G6C77ZXY.js} +1 -1
  33. package/browser/{chunk-JKYIIESS.js → chunk-G7MHJB7B.js} +1 -1
  34. package/browser/{chunk-T7NKMFBC.js → chunk-GAO5Z2TO.js} +1 -1
  35. package/browser/{chunk-Z63B2IPB.js → chunk-GHKPWAVT.js} +2 -2
  36. package/browser/{chunk-6IH2M6ZG.js → chunk-H7WJLWSG.js} +1 -1
  37. package/browser/{chunk-NDAWG7SW.js → chunk-HZAKBODD.js} +1 -1
  38. package/browser/{chunk-VJ5D6M65.js → chunk-ILGPXBYT.js} +1 -1
  39. package/browser/{chunk-NWG5G44C.js → chunk-JQN6H3DD.js} +1 -1
  40. package/browser/{chunk-3UP4RL34.js → chunk-JSN4HB24.js} +1 -1
  41. package/browser/{chunk-JYW3ZTOC.js → chunk-LMDLCZHL.js} +1 -1
  42. package/browser/{chunk-LGYCRWQ4.js → chunk-LNGGJ44D.js} +1 -1
  43. package/browser/{chunk-5UD5FCK5.js → chunk-LTYV6XXV.js} +1 -1
  44. package/browser/{chunk-VZZN7ID6.js → chunk-LWN7KMCU.js} +1 -1
  45. package/browser/{chunk-BEAF7Q4K.js → chunk-LWUZB66X.js} +1 -1
  46. package/browser/{chunk-KE7I2M72.js → chunk-M3ZKWNV5.js} +1 -1
  47. package/browser/{chunk-4O6WXPMX.js → chunk-MHKRUO7I.js} +1 -1
  48. package/browser/{chunk-CAKATCRA.js → chunk-MIOD33IS.js} +1 -1
  49. package/browser/{chunk-EJFSGEW3.js → chunk-NEIYR7P7.js} +1 -1
  50. package/browser/{chunk-WJZPCVXD.js → chunk-NGB4NIKA.js} +1 -1
  51. package/browser/{chunk-G2PX75WQ.js → chunk-NGZ77ZI3.js} +2 -2
  52. package/browser/{chunk-VSYIBZTH.js → chunk-NVIQOMNI.js} +1 -1
  53. package/browser/chunk-OJHT6ADV.js +1 -0
  54. package/browser/{chunk-OUL26K4D.js → chunk-OWLODVC2.js} +1 -1
  55. package/browser/{chunk-QPGHT5ME.js → chunk-PIOHEDRB.js} +1 -1
  56. package/browser/{chunk-2HCIB2TD.js → chunk-RT3VKQMM.js} +1 -1
  57. package/browser/{chunk-6T5AX7KT.js → chunk-S33TYRYA.js} +1 -1
  58. package/browser/{chunk-AHC4QMET.js → chunk-SNB2E7OE.js} +1 -1
  59. package/browser/{chunk-I5ZU4QA5.js → chunk-SQURNPXM.js} +1 -1
  60. package/browser/{chunk-JFSGRUDU.js → chunk-SUFPFQV3.js} +1 -1
  61. package/browser/{chunk-6YSKFV5B.js → chunk-TUQHMQZM.js} +1 -1
  62. package/browser/{chunk-CCZZYGNK.js → chunk-TUVTTOAU.js} +1 -1
  63. package/browser/{chunk-EUKUPVTC.js → chunk-VEA62MJP.js} +1 -1
  64. package/browser/{chunk-277FJY7G.js → chunk-VNYLCXAG.js} +1 -1
  65. package/browser/{chunk-FI7QIPEN.js → chunk-VTNMEIUX.js} +2 -2
  66. package/browser/{chunk-Y6E6JEKH.js → chunk-W4EQMAJL.js} +1 -1
  67. package/browser/{chunk-XM2BCJOR.js → chunk-WU2F67XH.js} +1 -1
  68. package/browser/{chunk-7STM3WMS.js → chunk-X5SJKYJF.js} +1 -1
  69. package/browser/{chunk-NDIM325Y.js → chunk-X5WM5BVA.js} +1 -1
  70. package/browser/{chunk-3WDOZUDH.js → chunk-XCYDPBY2.js} +1 -1
  71. package/browser/{chunk-W3WUQRTZ.js → chunk-XED4PAPO.js} +1 -1
  72. package/browser/{chunk-I7DLJ5BI.js → chunk-XGGDC3Z6.js} +1 -1
  73. package/browser/{chunk-FQBWTGP7.js → chunk-YMXIO4RH.js} +1 -1
  74. package/browser/{chunk-RSKOUVVW.js → chunk-Z7PBEESK.js} +1 -1
  75. package/browser/{chunk-7DXTNKFV.js → chunk-ZPX3JQLX.js} +1 -1
  76. package/browser/index.html +2 -2
  77. package/browser/{main-WUMYSVAP.js → main-N6Y6NF7J.js} +2 -2
  78. package/package.json +1 -1
  79. package/browser/chunk-SXOBYT7M.js +0 -1
@@ -1,4 +1,4 @@
1
- import{a as L}from"./chunk-52EOLV7I.js";import{a as be}from"./chunk-CGESXTHC.js";import{V as ue,W as he,la as pe,ma as D,ua as de}from"./chunk-TLOTIYIE.js";import{a as ae,g as se}from"./chunk-2RSBMS36.js";import{a as re,c as le}from"./chunk-4O6WXPMX.js";import{a as R}from"./chunk-AHCRE4GP.js";import{$a as a,$b as $,Fa as I,Ib as l,Jb as u,Kb as b,Lb as O,Ma as Y,Mb as z,Mc as f,Nc as ee,Ob as Z,Qb as K,Qd as oe,Rb as g,Rd as ne,Sc as te,Td as ce,Wc as V,Yb as A,Zb as X,Zc as F,_b as w,bd as ie,db as M,ec as E,gc as J,ia as q,ja as Q,jd as B,ka as H,kb as d,lb as G,na as P,ob as x,pc as W,qb as k,qc as T,rc as C,ua as U,ub as s,va as v,vb as c,wa as S,xa as _,yb as N,za as m,zb as p}from"./chunk-DZT5XHBQ.js";var ye=e=>({"pe-none":e}),ve=()=>["/menu/Profile/Main/My_Subscription"],Se=e=>({"text-decoration-none":e}),_e=e=>({"text-capitalize":e});function Ie(e,n){if(e&1&&(l(0,"div",1)(1,"h5",2),E(2),l(3,"a",3)(4,"u",4)(5,"span",4),E(6,"please"),u(),E(7," process your payment! "),u()()()()),e&2){let t=g();p("alert rounded-0 mb-0 text-center border-bottom "+(t.subscriptionState==null?null:t.subscriptionState.class)),a(2),J(" ",t.subscriptionState==null?null:t.subscriptionState.message," "),a(),c("ngClass",C(7,ye,t.isMySubscriptionMenu))("routerLink",T(9,ve)),a(),c("ngClass",C(10,Se,t.isMySubscriptionMenu)),a(),c("ngClass",C(12,_e,t.isNotEmpty(t.currentSubStatus)&&t.currentSubStatus!=t.subsStatusEnum.OVERDUE))}}var me=class e{constructor(n,t,o){this.document=n;this.router=t;this.authService=o}subscriptionStatus;subscriptionState;currentSubStatus;subsStatusEnum=re;isMySubscriptionMenu;htmlStyleElement;htmlBodyElement;ngOnInit(){this.checkMySubscriptionMenu(),this.initSubscriptionStatus(),this.getCurrentSubscriptionStatus()}getCurrentSubscriptionStatus(){this.overrideCssStickyHeader()}checkMySubscriptionMenu(){this.isMySubscriptionMenu=!1,this.router.url.includes("/Profile/Main/My_Subscription")&&(this.isMySubscriptionMenu=!0)}isNotEmpty(n){return R.IsNotEmpty(n)}overrideCssStickyHeader(){if(R.IsNotEmpty(this.currentSubStatus)&&this.currentSubStatus!==0){let n=`.sticky-top-thead th {
1
+ import{a as L}from"./chunk-52EOLV7I.js";import{a as be}from"./chunk-CGESXTHC.js";import{V as ue,W as he,la as pe,ma as D,ua as de}from"./chunk-TLOTIYIE.js";import{a as ae,g as se}from"./chunk-2RSBMS36.js";import{a as re,c as le}from"./chunk-MHKRUO7I.js";import{a as R}from"./chunk-AHCRE4GP.js";import{$a as a,$b as $,Fa as I,Ib as l,Jb as u,Kb as b,Lb as O,Ma as Y,Mb as z,Mc as f,Nc as ee,Ob as Z,Qb as K,Qd as oe,Rb as g,Rd as ne,Sc as te,Td as ce,Wc as V,Yb as A,Zb as X,Zc as F,_b as w,bd as ie,db as M,ec as E,gc as J,ia as q,ja as Q,jd as B,ka as H,kb as d,lb as G,na as P,ob as x,pc as W,qb as k,qc as T,rc as C,ua as U,ub as s,va as v,vb as c,wa as S,xa as _,yb as N,za as m,zb as p}from"./chunk-DZT5XHBQ.js";var ye=e=>({"pe-none":e}),ve=()=>["/menu/Profile/Main/My_Subscription"],Se=e=>({"text-decoration-none":e}),_e=e=>({"text-capitalize":e});function Ie(e,n){if(e&1&&(l(0,"div",1)(1,"h5",2),E(2),l(3,"a",3)(4,"u",4)(5,"span",4),E(6,"please"),u(),E(7," process your payment! "),u()()()()),e&2){let t=g();p("alert rounded-0 mb-0 text-center border-bottom "+(t.subscriptionState==null?null:t.subscriptionState.class)),a(2),J(" ",t.subscriptionState==null?null:t.subscriptionState.message," "),a(),c("ngClass",C(7,ye,t.isMySubscriptionMenu))("routerLink",T(9,ve)),a(),c("ngClass",C(10,Se,t.isMySubscriptionMenu)),a(),c("ngClass",C(12,_e,t.isNotEmpty(t.currentSubStatus)&&t.currentSubStatus!=t.subsStatusEnum.OVERDUE))}}var me=class e{constructor(n,t,o){this.document=n;this.router=t;this.authService=o}subscriptionStatus;subscriptionState;currentSubStatus;subsStatusEnum=re;isMySubscriptionMenu;htmlStyleElement;htmlBodyElement;ngOnInit(){this.checkMySubscriptionMenu(),this.initSubscriptionStatus(),this.getCurrentSubscriptionStatus()}getCurrentSubscriptionStatus(){this.overrideCssStickyHeader()}checkMySubscriptionMenu(){this.isMySubscriptionMenu=!1,this.router.url.includes("/Profile/Main/My_Subscription")&&(this.isMySubscriptionMenu=!0)}isNotEmpty(n){return R.IsNotEmpty(n)}overrideCssStickyHeader(){if(R.IsNotEmpty(this.currentSubStatus)&&this.currentSubStatus!==0){let n=`.sticky-top-thead th {
2
2
  top: 100px !important;
3
3
  z-index: 1020;
4
4
  }`;this.htmlBodyElement=this.document.getElementsByTagName("body")[0],this.htmlStyleElement=this.document.createElement("style"),this.htmlStyleElement.appendChild(this.document.createTextNode(n)),this.htmlBodyElement.appendChild(this.htmlStyleElement)}}initSubscriptionStatus(){this.currentSubStatus=this.authService.getSubscriptionStatus(),this.subscriptionStatus=[{status:1,class:"alert-warning",message:"Your subscription is overdue. To avoid suspension, "},{status:2,class:"alert-danger",message:"Your subscription is partially suspended."},{status:3,class:"alert-danger",message:"Your subscription is suspended."}],this.subscriptionState=this.subscriptionStatus.filter(n=>n.status==this.currentSubStatus)[0]}ngOnDestroy(){this.htmlBodyElement&&this.htmlBodyElement.removeChild(this.htmlStyleElement)}static \u0275fac=function(t){return new(t||e)(M(te),M(oe),M(le))};static \u0275cmp=d({type:e,selectors:[["subscription-alert"]],decls:1,vars:1,consts:[["role","alert",3,"class",4,"ngIf"],["role","alert"],[1,"fw-normal"],[1,"alert-link",3,"ngClass","routerLink"],[3,"ngClass"]],template:function(t,o){t&1&&k(0,Ie,8,14,"div",0),t&2&&c("ngIf",(o.subscriptionState==null?null:o.subscriptionState.status)==o.currentSubStatus&&o.isNotEmpty(o.currentSubStatus))},dependencies:[B,V,F,ce,ne],encapsulation:2})};var ke=(()=>{class e extends L{static \u0275fac=(()=>{let t;return function(i){return(t||(t=m(e)))(i||e)}})();static \u0275cmp=d({type:e,selectors:[["CheckIcon"]],features:[x],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(o,i){o&1&&(_(),l(0,"svg",0),b(1,"path",1),u()),o&2&&(p(i.getClassNames()),s("aria-label",i.ariaLabel)("aria-hidden",i.ariaHidden)("role",i.role))},encapsulation:2})}return e})();var fe=(()=>{class e extends L{static \u0275fac=(()=>{let t;return function(i){return(t||(t=m(e)))(i||e)}})();static \u0275cmp=d({type:e,selectors:[["MinusIcon"]],features:[x],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(o,i){o&1&&(_(),l(0,"svg",0),b(1,"path",1),u()),o&2&&(p(i.getClassNames()),s("aria-label",i.ariaLabel)("aria-hidden",i.ariaHidden)("role",i.role))},encapsulation:2})}return e})();var Me=["checkboxicon"],we=["input"],$e=()=>({"p-checkbox-input":!0}),Ee=e=>({checked:e,class:"p-checkbox-icon"});function Te(e,n){if(e&1&&b(0,"span",8),e&2){let t=g(3);c("ngClass",t.checkboxIcon),s("data-pc-section","icon")}}function Ve(e,n){e&1&&b(0,"CheckIcon",9),e&2&&(c("styleClass","p-checkbox-icon"),s("data-pc-section","icon"))}function Fe(e,n){if(e&1&&(O(0),k(1,Te,1,2,"span",7)(2,Ve,1,2,"CheckIcon",6),z()),e&2){let t=g(2);a(),c("ngIf",t.checkboxIcon),a(),c("ngIf",!t.checkboxIcon)}}function Be(e,n){e&1&&b(0,"MinusIcon",9),e&2&&(c("styleClass","p-checkbox-icon"),s("data-pc-section","icon"))}function De(e,n){if(e&1&&(O(0),k(1,Fe,3,2,"ng-container",4)(2,Be,1,2,"MinusIcon",6),z()),e&2){let t=g();a(),c("ngIf",t.checked),a(),c("ngIf",t._indeterminate())}}function Le(e,n){}function Ne(e,n){e&1&&k(0,Le,0,0,"ng-template")}var Oe=({dt:e})=>`
@@ -1,2 +1,2 @@
1
- import{O as b}from"./chunk-L5FSQ5F6.js";import{a as m}from"./chunk-2FWFPV5I.js";import{a as u}from"./chunk-JFSGRUDU.js";import{Vd as d,Yd as h,ja as n,na as c}from"./chunk-DZT5XHBQ.js";import{j as l}from"./chunk-7DCB7DB2.js";var p=class a{constructor(){}copy(t){return new Promise((o,r)=>{try{if(navigator.clipboard)navigator.clipboard.writeText(t).then(o,r);else{let e=document.createElement("textarea");e.value=t,e.style.position="fixed",document.body.appendChild(e),e.focus(),e.select();try{document.execCommand("copy")?o():r(new Error("Failed to copy with execCommand"))}catch(i){r(i)}finally{document.body.removeChild(e)}}}catch(e){r(e)}})}static \u0275fac=function(o){return new(o||a)};static \u0275prov=n({token:a,factory:a.\u0275fac,providedIn:"root"})};var y=class a{toastr=c(d);httpService=c(h);copyToClipBoard=c(p);createCustomerFromNewNumberAndSendReceipt(t,o,r,e,i){r==0?this.httpService.post(b.CreateCustomerInvoice,{InvoiceID:e.ObjectID,Mobile:t}).subscribe(s=>l(this,null,function*(){this.toastr.success(s.Message,m.Success),yield this.sendReceiptToWhatsapp(t,e,o,i)})):this.toastr.info("WABA is not supported yet",m.Info)}createWhatsappReceipt(t,o,r){let e=I=>new Intl.NumberFormat("id-ID",{style:"currency",currency:"IDR"}).format(I).replace("Rp","").trim().split(",00")?.[0],i=JSON.parse(localStorage.getItem("AccountInfo"))?.BrandName,{ObjectID:s,Final:g,InvoiceNumber:f}=t,v=window.location.host,w=`https://receipt.dealpos.app/s?Data=${window.btoa(`${s}_${v}`)}`;return this.convertWhatsappTemplateMessage({Amount:e(g),Brand:i,Currency:o,Number:f,ReceiptLink:w},r)}convertWhatsappTemplateMessage(t,o){let r=o||u?.whatsappTemplateMessage,e=["Brand","Number","Currency","Amount","ReceiptLink"],i=r;return e.forEach(s=>i=i.replace(`{${s}}`,t[s])),i}redirectToWhatsapp(t,o){let r=t;r=r[0]==="0"?`62${r.slice(1)}`:r;let e=`whatsapp://send?phone=${r}&text=${encodeURIComponent(o)}`;window.location.href=e,this.showToastrWhatsappNoInstalled()}showToastrWhatsappNoInstalled(){let t=!1;window.onblur=function(){t=!0},setTimeout(()=>{t||this.toastr.warning(`Currently, sending an e-receipt automatically opens WhatsApp Desktop, provided the device has the app installed
1
+ import{O as b}from"./chunk-L5FSQ5F6.js";import{a as m}from"./chunk-2FWFPV5I.js";import{a as u}from"./chunk-SUFPFQV3.js";import{Vd as d,Yd as h,ja as n,na as c}from"./chunk-DZT5XHBQ.js";import{j as l}from"./chunk-7DCB7DB2.js";var p=class a{constructor(){}copy(t){return new Promise((o,r)=>{try{if(navigator.clipboard)navigator.clipboard.writeText(t).then(o,r);else{let e=document.createElement("textarea");e.value=t,e.style.position="fixed",document.body.appendChild(e),e.focus(),e.select();try{document.execCommand("copy")?o():r(new Error("Failed to copy with execCommand"))}catch(i){r(i)}finally{document.body.removeChild(e)}}}catch(e){r(e)}})}static \u0275fac=function(o){return new(o||a)};static \u0275prov=n({token:a,factory:a.\u0275fac,providedIn:"root"})};var y=class a{toastr=c(d);httpService=c(h);copyToClipBoard=c(p);createCustomerFromNewNumberAndSendReceipt(t,o,r,e,i){r==0?this.httpService.post(b.CreateCustomerInvoice,{InvoiceID:e.ObjectID,Mobile:t}).subscribe(s=>l(this,null,function*(){this.toastr.success(s.Message,m.Success),yield this.sendReceiptToWhatsapp(t,e,o,i)})):this.toastr.info("WABA is not supported yet",m.Info)}createWhatsappReceipt(t,o,r){let e=I=>new Intl.NumberFormat("id-ID",{style:"currency",currency:"IDR"}).format(I).replace("Rp","").trim().split(",00")?.[0],i=JSON.parse(localStorage.getItem("AccountInfo"))?.BrandName,{ObjectID:s,Final:g,InvoiceNumber:f}=t,v=window.location.host,w=`https://receipt.dealpos.app/s?Data=${window.btoa(`${s}_${v}`)}`;return this.convertWhatsappTemplateMessage({Amount:e(g),Brand:i,Currency:o,Number:f,ReceiptLink:w},r)}convertWhatsappTemplateMessage(t,o){let r=o||u?.whatsappTemplateMessage,e=["Brand","Number","Currency","Amount","ReceiptLink"],i=r;return e.forEach(s=>i=i.replace(`{${s}}`,t[s])),i}redirectToWhatsapp(t,o){let r=t;r=r[0]==="0"?`62${r.slice(1)}`:r;let e=`whatsapp://send?phone=${r}&text=${encodeURIComponent(o)}`;window.location.href=e,this.showToastrWhatsappNoInstalled()}showToastrWhatsappNoInstalled(){let t=!1;window.onblur=function(){t=!0},setTimeout(()=>{t||this.toastr.warning(`Currently, sending an e-receipt automatically opens WhatsApp Desktop, provided the device has the app installed
2
2
  `,"WhatsApp not installed")},2e3)}copyToClipboard(t){return new Promise((o,r)=>this.copyToClipBoard.copy(t).then(()=>{this.toastr.info("Message copied to clipboard. If WhatsApp doesn't show the message, please paste it manually.","Receipt Ready",{timeOut:8e3}),o("Copied to clipboard")}).catch(e=>{console.log(e),this.toastr.warning("Could not copy message to clipboard","Clipboard Error",{timeOut:8e3}),r(e)}))}sendReceiptToWhatsapp(t,o,r,e){return l(this,null,function*(){try{let i=this.createWhatsappReceipt(o,r,e);try{yield this.copyToClipboard(i)}finally{this.redirectToWhatsapp(t,i)}}catch(i){console.warn(i),this.toastr.error("Failed to send receipt")}})}static \u0275fac=function(o){return new(o||a)};static \u0275prov=n({token:a,factory:a.\u0275fac})};export{y as a};