dealpos 12.55.0 → 12.55.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 (115) hide show
  1. package/POS/{chunk-76GI4KGZ.js → chunk-277VNEJX.js} +1 -1
  2. package/POS/{chunk-MHXL4USM.js → chunk-2AFBXWNS.js} +1 -1
  3. package/POS/{chunk-EKXUXVIC.js → chunk-2H7M5PYC.js} +1 -1
  4. package/POS/chunk-32X2LAMI.js +1 -0
  5. package/POS/chunk-34AO5CZ6.js +20 -0
  6. package/POS/{chunk-3LOG5D4N.js → chunk-3AQSLJMW.js} +1 -1
  7. package/POS/{chunk-QVLJDBYF.js → chunk-3JCROOQH.js} +1 -1
  8. package/POS/{chunk-A57KRRAE.js → chunk-42H2K7O5.js} +1 -1
  9. package/POS/{chunk-DXY26PKV.js → chunk-4VOII6HY.js} +1 -1
  10. package/POS/{chunk-DKGS75MN.js → chunk-4Z2QM3NO.js} +1 -1
  11. package/POS/{chunk-MFU22NXE.js → chunk-5CZGNAJK.js} +1 -1
  12. package/POS/{chunk-NNDQM5VJ.js → chunk-5D5UTU4D.js} +1 -1
  13. package/POS/{chunk-UJDULRWA.js → chunk-5P5C34W7.js} +1 -1
  14. package/POS/{chunk-HYGXVVYD.js → chunk-5TN4BY4B.js} +1 -1
  15. package/POS/{chunk-M4QWOJIW.js → chunk-5WGISCWI.js} +1 -1
  16. package/POS/{chunk-CQCEWBJ2.js → chunk-6K6TIOP6.js} +1 -1
  17. package/POS/{chunk-56IRR6BF.js → chunk-6N5TP44L.js} +1 -1
  18. package/POS/{chunk-XUNP4KIH.js → chunk-6TRMMEFH.js} +3 -3
  19. package/POS/{chunk-7QLGBZEM.js → chunk-6VCXZ35T.js} +1 -1
  20. package/POS/{chunk-ZCKTBFXI.js → chunk-6XNLY67P.js} +1 -1
  21. package/POS/{chunk-24OO5MVO.js → chunk-6Z2URZPZ.js} +1 -1
  22. package/POS/{chunk-AIO7OJIQ.js → chunk-7FUHCHWC.js} +1 -1
  23. package/POS/{chunk-FIBYYFIF.js → chunk-7UHXU4PV.js} +1 -1
  24. package/POS/{chunk-TY55BIFA.js → chunk-ABX3RSUP.js} +1 -1
  25. package/POS/{chunk-BI74RYMH.js → chunk-AIORTWOA.js} +1 -1
  26. package/POS/{chunk-7HELR776.js → chunk-AMJRJEU7.js} +1 -1
  27. package/POS/{chunk-ELAZU22L.js → chunk-BLEFA3C2.js} +1 -1
  28. package/POS/{chunk-GXIVVTDN.js → chunk-BXF75MAL.js} +1 -1
  29. package/POS/{chunk-2PC7C3K2.js → chunk-CE5UQKNY.js} +1 -1
  30. package/POS/{chunk-H635NGW4.js → chunk-CQFGBMVT.js} +1 -1
  31. package/POS/{chunk-N6Q3XA2T.js → chunk-D4IFCEFB.js} +1 -1
  32. package/POS/{chunk-FIT7VD7M.js → chunk-DCYN2A7X.js} +1 -1
  33. package/POS/{chunk-NC26M2EP.js → chunk-DQW2V4E5.js} +1 -1
  34. package/POS/{chunk-7NKIT6WR.js → chunk-E4PNYXIY.js} +1 -1
  35. package/POS/chunk-EE7EPDP4.js +1 -0
  36. package/POS/{chunk-QOI7BYJR.js → chunk-ET5TZGTX.js} +1 -1
  37. package/POS/{chunk-KVVN56KD.js → chunk-EX67UFM7.js} +1 -1
  38. package/POS/{chunk-25LAKFQW.js → chunk-EYTKTC26.js} +1 -1
  39. package/POS/{chunk-ERWZWWEV.js → chunk-F4CNJMN2.js} +1 -1
  40. package/POS/{chunk-5644FXLR.js → chunk-FJLHP4Y6.js} +1 -1
  41. package/POS/{chunk-WBF35F4M.js → chunk-FWCV4QP5.js} +1 -1
  42. package/POS/{chunk-VBM4LZFW.js → chunk-GFFHV2UJ.js} +1 -1
  43. package/POS/{chunk-HPHCX43G.js → chunk-GFSHNMWP.js} +1 -1
  44. package/POS/{chunk-55OB3AL7.js → chunk-GOVLC5NE.js} +1 -1
  45. package/POS/{chunk-4EOXD2VI.js → chunk-GWSOGPT3.js} +1 -1
  46. package/POS/{chunk-FFATEUDV.js → chunk-H2HWCG5H.js} +1 -1
  47. package/POS/{chunk-WE6ANTIP.js → chunk-HEYFTGSM.js} +1 -1
  48. package/POS/chunk-I7TEFELF.js +1 -0
  49. package/POS/{chunk-Q3HMPSR6.js → chunk-IVMCNDKP.js} +1 -1
  50. package/POS/{chunk-NAFIXFTZ.js → chunk-IZG5GGP4.js} +1 -1
  51. package/POS/{chunk-7T24J5EW.js → chunk-J5ZPLRHU.js} +1 -1
  52. package/POS/chunk-JLRUM2BF.js +3 -0
  53. package/POS/{chunk-Y6G2U73H.js → chunk-JOKQBYK7.js} +2 -2
  54. package/POS/{chunk-4F23CJD5.js → chunk-K7ARKEHG.js} +1 -1
  55. package/POS/{chunk-KAA3YG25.js → chunk-KUOAMEFX.js} +1 -1
  56. package/POS/{chunk-KMBWKQKG.js → chunk-L72FOURF.js} +1 -1
  57. package/POS/{chunk-IN7WJZFQ.js → chunk-LRQH62HO.js} +1 -1
  58. package/POS/{chunk-NYUEOIS5.js → chunk-LVJP56JK.js} +1 -1
  59. package/POS/{chunk-NKXHEMIH.js → chunk-LVPMUVA7.js} +1 -1
  60. package/POS/{chunk-SCRAP4ON.js → chunk-LYT6MCEM.js} +1 -1
  61. package/POS/{chunk-GWRAGLFZ.js → chunk-LZKEW32V.js} +1 -1
  62. package/POS/{chunk-CEOVZORP.js → chunk-MF3ABWUR.js} +1 -1
  63. package/POS/{chunk-7LF72QP2.js → chunk-MHECHXQL.js} +1 -1
  64. package/POS/{chunk-4YKBGMH2.js → chunk-NBLSKMVG.js} +1 -1
  65. package/POS/{chunk-HTOJEHJA.js → chunk-NSN7UT65.js} +1 -1
  66. package/POS/{chunk-2SXO4PG7.js → chunk-NVB7THLT.js} +1 -1
  67. package/POS/{chunk-CWU5NZYB.js → chunk-O3WVLYCD.js} +1 -1
  68. package/POS/{chunk-N2PT5QCU.js → chunk-OGD42VLH.js} +1 -1
  69. package/POS/{chunk-6GMM6JE4.js → chunk-OMCKMPTF.js} +3 -3
  70. package/POS/{chunk-4MA4WYRC.js → chunk-OUS5DM25.js} +1 -1
  71. package/POS/{chunk-FX7YHYJK.js → chunk-OVHJDX5T.js} +1 -1
  72. package/POS/{chunk-TV7ZPPVD.js → chunk-OVY4KSU7.js} +1 -1
  73. package/POS/{chunk-RYNUX3YH.js → chunk-OYXA3URF.js} +1 -1
  74. package/POS/{chunk-HQAV6QL6.js → chunk-PEG7SSR6.js} +1 -1
  75. package/POS/{chunk-RGHSHLV6.js → chunk-PKERYGZ7.js} +1 -1
  76. package/POS/{chunk-QMPXC2IN.js → chunk-PKQQTEB5.js} +1 -1
  77. package/POS/{chunk-56OCNYIB.js → chunk-QEGWZ27L.js} +1 -1
  78. package/POS/{chunk-FBOZGZJI.js → chunk-QG7IBBER.js} +1 -1
  79. package/POS/chunk-RODSOPRE.js +1 -0
  80. package/POS/{chunk-6ANRXJHN.js → chunk-SHIRPPYE.js} +1 -1
  81. package/POS/{chunk-53SM53SQ.js → chunk-SZQZJEXA.js} +1 -1
  82. package/POS/{chunk-EHMMTGST.js → chunk-TK4WFBNE.js} +1 -1
  83. package/POS/{chunk-SSTIUYZP.js → chunk-UXOQCCUU.js} +1 -1
  84. package/POS/{chunk-7YYPWNVP.js → chunk-UZVMRKFR.js} +1 -1
  85. package/POS/{chunk-ENLOPJBU.js → chunk-V55O4NUA.js} +1 -1
  86. package/POS/{chunk-CBAU3RPE.js → chunk-VPUTK5SP.js} +1 -1
  87. package/POS/{chunk-2LX64MX4.js → chunk-VQVMVJNK.js} +1 -1
  88. package/POS/{chunk-QRA5CNVH.js → chunk-VSBNY5V5.js} +1 -1
  89. package/POS/{chunk-FYN56747.js → chunk-W7C3M3B4.js} +1 -1
  90. package/POS/{chunk-GBRZJ6PS.js → chunk-WBGSMFMR.js} +1 -1
  91. package/POS/{chunk-MKO3VWK5.js → chunk-WD3JCKQN.js} +1 -1
  92. package/POS/{chunk-BPW6ATYH.js → chunk-WOQ52BTF.js} +1 -1
  93. package/POS/{chunk-HUFKIRYO.js → chunk-X4J22SMW.js} +1 -1
  94. package/POS/{chunk-YHSCNXVJ.js → chunk-X5ZQJRN3.js} +1 -1
  95. package/POS/{chunk-KIQLYXQ5.js → chunk-XD2ONBCS.js} +1 -1
  96. package/POS/{chunk-6NYDXIUT.js → chunk-XV3CIM4J.js} +1 -1
  97. package/POS/{chunk-72VRINDC.js → chunk-XYCPVLU3.js} +1 -1
  98. package/POS/{chunk-LVSS733Z.js → chunk-Y2WKEPMJ.js} +1 -1
  99. package/POS/{chunk-ZLL2SIEP.js → chunk-Y4PFW76F.js} +1 -1
  100. package/POS/{chunk-UI3AARPT.js → chunk-YAFGGTEW.js} +1 -1
  101. package/POS/{chunk-6UNIMAGB.js → chunk-YOC7FGCJ.js} +1 -1
  102. package/POS/chunk-Z4QIUKR5.js +1 -0
  103. package/POS/{chunk-CSBOCI3N.js → chunk-ZFYFLUG5.js} +1 -1
  104. package/POS/{chunk-OMYJASV3.js → chunk-ZLHZMBCU.js} +1 -1
  105. package/POS/{chunk-YGDQF5II.js → chunk-ZZ4RSLIP.js} +1 -1
  106. package/POS/index.html +2 -2
  107. package/POS/{main-XRK3KUDL.js → main-6DAEKU2U.js} +2 -2
  108. package/package.json +1 -1
  109. package/POS/chunk-DOQGWMFY.js +0 -1
  110. package/POS/chunk-FUQKLIKZ.js +0 -1
  111. package/POS/chunk-HH2JSXRA.js +0 -1
  112. package/POS/chunk-KBDOZ3J4.js +0 -3
  113. package/POS/chunk-KFX77KPA.js +0 -1
  114. package/POS/chunk-NOW53S6O.js +0 -1
  115. package/POS/chunk-RWE3VA5Y.js +0 -20
@@ -1,4 +1,4 @@
1
- import{a as Ti,b as Di,c as Pi,d as Oi}from"./chunk-GRKWFTJ2.js";import{a as mt}from"./chunk-ELAZU22L.js";import{a as at,b as li}from"./chunk-6UNIMAGB.js";import"./chunk-MHXL4USM.js";import{b as Ii,c as Ei}from"./chunk-476V47W6.js";import{a as Mi,b as wi}from"./chunk-3LKE4M2Q.js";import{d as Ne,e as vi}from"./chunk-XUNP4KIH.js";import"./chunk-KMBWKQKG.js";import"./chunk-C4SDGOBF.js";import"./chunk-WMU7MFFB.js";import{a as ot}from"./chunk-EHMMTGST.js";import{a as Ci,b as yi}from"./chunk-Q3HMPSR6.js";import{d as xi,e as Si}from"./chunk-4IA4BZLM.js";import{a as Oe}from"./chunk-4MA4WYRC.js";import"./chunk-FX7YHYJK.js";import"./chunk-RGIAK7TL.js";import"./chunk-ZH3LHPKO.js";import{a as si,b as ci}from"./chunk-SIEUNTYO.js";import{b as X,c as hi}from"./chunk-FBOZGZJI.js";import"./chunk-WE6ANTIP.js";import{a as pi,b as pe}from"./chunk-56OCNYIB.js";import"./chunk-VUGL7GL5.js";import{G as pt,N as _i,g as lt,o as di,s as ui,v as fi}from"./chunk-MV3BEGPX.js";import{i as Q,j as re,k as le,m as Y,n as K,o as rt,u as gi,v as bi}from"./chunk-BI74RYMH.js";import{Aa as be,Ba as ri}from"./chunk-R5NLMT6O.js";import"./chunk-CEOVZORP.js";import{a as ni}from"./chunk-ZCKTBFXI.js";import"./chunk-UJBDZYC5.js";import{e as ke,f as mi}from"./chunk-53ZY7AX4.js";import"./chunk-5ZJO3PQ6.js";import"./chunk-44LJSYN6.js";import"./chunk-66WVYR24.js";import{a as F}from"./chunk-2FWFPV5I.js";import{A as tt,C as it,D as ai,c as z,h as A,i as Ee,k as Te,n as V,o as De,x as Pe,z as oi}from"./chunk-7UM6XERA.js";import"./chunk-GBRZJ6PS.js";import"./chunk-KIQLYXQ5.js";import{a as H,d as nt}from"./chunk-EQXS7YQT.js";import{a as He,b as T}from"./chunk-7HELR776.js";import{$ as zt,$b as y,Bb as C,C as ce,Da as $e,Eb as x,Fa as qt,Fc as Jt,Gb as c,Hd as et,Ic as Xt,Jb as Le,Jd as Se,K as Zt,Kb as Qt,Kd as Ie,Lc as ei,Md as At,Na as P,Nc as $,Oa as xe,Oc as N,Od as j,Sa as r,Ta as u,Tc as ti,U as Ze,Ub as R,Vb as o,Vc as Z,Wb as _,Xb as v,Xc as ae,Y as te,Yb as Me,Zb as Ft,_c as Xe,ac as M,b as We,ba as ze,bc as w,c as jt,cb as oe,cc as Yt,d as Ue,dc as Kt,eb as d,ec as Ke,fa as _e,fc as U,ga as Ge,gc as Je,ia as ne,ib as m,ja as Gt,kb as Qe,lb as Ye,mb as ge,md as ii,n as Wt,na as I,nc as f,oa as qe,oc as S,pc as D,qb as $t,qc as we,r as se,tc as de,ua as g,v as Ut,va as b,vb as i,wb as t,xb as h,yb as B,zb as L}from"./chunk-ZCFRJGRH.js";import{a as Lt,b as Ht}from"./chunk-LHUGHE24.js";function Vt(n){if(n instanceof Int8Array||n instanceof Uint8Array||n instanceof Uint8ClampedArray)return new DataView(n.buffer,n.byteOffset,n.byteLength);if(n instanceof ArrayBuffer)return new DataView(n);throw new TypeError("Expected `data` to be an ArrayBuffer, Buffer, Int8Array, Uint8Array or Uint8ClampedArray")}var Li="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",Hi="0123456789ABCDEFGHIJKLMNOPQRSTUV",ji="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function Rt(n,p,e){e=e||{};let a,l;switch(p){case"RFC3548":case"RFC4648":a=Li,l=!0;break;case"RFC4648-HEX":a=Hi,l=!0;break;case"Crockford":a=ji,l=!1;break;default:throw new Error("Unknown base32 variant: "+p)}let s=e.padding!==void 0?e.padding:l,E=Vt(n),q=0,O=0,fe="";for(let Be=0;Be<E.byteLength;Be++)for(O=O<<8|E.getUint8(Be),q+=8;q>=5;)fe+=a[O>>>q-5&31],q-=5;if(q>0&&(fe+=a[O<<5-q&31]),s)for(;fe.length%8!==0;)fe+="=";return fe}var st=class n{constructor(p){this.dialogRef=p}config;ngOnInit(){this.config=new Y,this.config.okText="Disable Two Factor Authentication",this.config.customWidth="500px",this.config.title="DIsabled Two Factor Authentication",this.config.headerType=F.Warning}onOk(){this.dialogRef.close(!0)}static \u0275fac=function(e){return new(e||n)(u(Q))};static \u0275cmp=I({type:n,selectors:[["POS-modal-confirmation-disabled"]],decls:5,vars:1,consts:[[3,"onOk","onCancel","onClose","config"],[1,"row","px-10","py-4"],[1,"font-weight-normal","h4","text-left","lh-base"]],template:function(e,a){e&1&&(i(0,"modal-material",0),x("onOk",function(){return a.onOk()})("onCancel",function(){return a.dialogRef.close()})("onClose",function(){return a.dialogRef.close()}),i(1,"content")(2,"div",1)(3,"p",2),o(4,"Are you sure you want to disable two factor authentication for your account? "),t()()()()),e&2&&m("config",a.config)},dependencies:[K]})};function Ui(n,p){if(n&1){let e=C();B(0),i(1,"div")(2,"div",3),o(3," Two Factor Authentication Status: "),i(4,"span",4),o(5,"Enabled"),t()()(),i(6,"div",5)(7,"button",6),x("click",function(){g(e);let l=c();return b(l.onDisableTotp())}),o(8,"Disable Two Factor Authentication"),t()(),L()}}function Zi(n,p){if(n&1){let e=C();i(0,"div",7)(1,"div",8)(2,"h4"),o(3,"Connect Your DealPOS account to an Authenticator Application"),t(),i(4,"p"),o(5,"Secure your login with One Time Password using an Authenticator Application!"),t()()(),i(6,"div",7)(7,"div",8)(8,"ol",9)(9,"li",10)(10,"h5"),o(11,"Download Authenticator application"),t(),i(12,"div",11)(13,"a",12),h(14,"img",13),o(15," Microsoft Authenticator "),t(),i(16,"a",14),h(17,"img",15),o(18," Google Authenticator "),t()()(),i(19,"li",16)(20,"h5"),o(21,"Scan the QR code below"),t(),i(22,"div",5),h(23,"qr-code",17),t()(),i(24,"li",16)(25,"h5"),o(26,"Validate your QR Code"),t(),i(27,"form",18),x("submit",function(){g(e);let l=c();return b(l.onValidate())}),i(28,"div")(29,"input",19),x("keypress",function(l){g(e);let s=c();return b(s.numberOnly(l))}),w("ngModelChange",function(l){g(e);let s=c();return M(s.validation2FA.ValidationCode,l)||(s.validation2FA.ValidationCode=l),b(l)}),t()(),i(30,"div",5)(31,"button",20),o(32,"Validate"),t()()()()()()()}if(n&2){let e=c();r(23),m("value",e.qrcodeContent)("size",265),r(6),y("ngModel",e.validation2FA.ValidationCode)}}var ct=class n{constructor(p,e,a,l){this.document=p;this.authenticatorService=e;this.toastrService=a;this.dialog=l;this.destroy$=new jt}qrcodeContent;validation2FA={SecretKey:null,ValidationCode:null,Enabled:!0};destroy$;totpEnabled;ngOnInit(){this.generateQrCodeContent()}generateQrCodeContent(){let p=this.getDomainName(),e=this.generateRandomSecret();this.validation2FA.SecretKey=e;var a=H.parseJwt(localStorage.getItem("Token"));let l=a.LID;this.qrcodeContent=`otpauth://totp/${l}?secret=${e}&issuer=${p}`}generateRandomSecret(){let p=H.Guid_NewGuid(),e=new TextEncoder().encode(p);return Rt(e,"RFC3548")}getDomainName(){return this.document.location.origin.replace(/^https?:\/\//,"")}onValidate(){this.validateOnVerfiyCode()&&this.authenticatorService.configure2FA(this.validation2FA).pipe(zt(this.destroy$)).subscribe(p=>{this.toastrService.success(p.Message,"TOTP Enabled"),this.totpEnabled=!0})}validateOnVerfiyCode(){let p=!0;return H.IsEmpty(this.validation2FA.ValidationCode)?(p=!1,this.toastrService.warning("You must enter a authentication code.","Warning")):(this.validation2FA.ValidationCode.length<6||this.validation2FA.ValidationCode.length>6)&&(p=!1,this.toastrService.warning("The authentication code must be six digits long.","Warning")),p}numberOnly(p){return H.numberOnly(p)}onDisableTotp(){this.dialog.open(st).afterClosed().pipe(ce(p=>H.IsNotEmpty(p)),te(()=>this.authenticatorService.disableTwoFactorAuthentication())).subscribe(p=>{this.toastrService.success(p.Message,"TOTP Disabled"),this.totpEnabled=!1})}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static \u0275fac=function(e){return new(e||n)(u(Xt),u(ot),u(j),u(le))};static \u0275cmp=I({type:n,selectors:[["POS-setup-2FA"]],inputs:{totpEnabled:"totpEnabled"},decls:4,vars:2,consts:[["TOTP_ENABLED",""],[1,"container-fluid","mt-6"],[4,"ngIf","ngIfElse"],[1,"d-inline-block","fs-5"],[1,"text-success","fw-bold"],[1,"mt-6"],["type","button","type","submit",1,"btn","btn-sm","btn-danger",3,"click"],[1,"row"],[1,"col-12"],[1,"ps-7"],[1,"fw-bold"],[1,"d-flex","align-items-center","mt-6"],["href","https://play.google.com/store/apps/details?id=com.azure.authenticator","target","_blank",1,"link-dark","border","py-3","px-6","me-6","border-primary","border-2"],["src","https://res.cloudinary.com/pos/image/upload/v1666247461/POS/Images/Login/Microsoft_Authenticator.png",2,"width","35px"],["href","https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2","target","_blank",1,"link-dark","border","py-3","px-6","me-6","border-primary","border-2"],["src","https://res.cloudinary.com/pos/image/upload/v1666247460/POS/Images/Login/Google_Authenticator.png",2,"width","35px"],[1,"fw-bold","mt-6"],["errorCorrectionLevel","H",1,"qr2fa",3,"value","size"],[1,"mt-6",3,"submit"],["type","text","name","auth","placeholder","Enter six Digit Code",1,"form-control","rounded","totpCustomStyle","border","border-2","border-primary",3,"keypress","ngModelChange","ngModel"],["type","button","type","submit",1,"btn","btn-sm","btn-primary","py-3"]],template:function(e,a){if(e&1&&(i(0,"div",1),d(1,Ui,9,0,"ng-container",2)(2,Zi,33,3,"ng-template",null,0,de),t()),e&2){let l=R(3);r(),m("ngIf",a.totpEnabled)("ngIfElse",l)}},dependencies:[N,De,z,A,Ee,V,Te,Mi],styles:[`.totpCustomStyle{height:3.625rem;padding:.75rem!important;color:#343434;font-size:.875rem;border-radius:.25rem!important;width:370px}qr-code.qr2fa>canvas{border:2px solid rgb(51,122,183);padding:2px}
1
+ import{a as Ti,b as Di,c as Pi,d as Oi}from"./chunk-GRKWFTJ2.js";import{a as mt}from"./chunk-BLEFA3C2.js";import{a as at,b as li}from"./chunk-YOC7FGCJ.js";import"./chunk-2AFBXWNS.js";import{b as Ii,c as Ei}from"./chunk-476V47W6.js";import{a as Mi,b as wi}from"./chunk-3LKE4M2Q.js";import{d as Ne,e as vi}from"./chunk-6TRMMEFH.js";import"./chunk-L72FOURF.js";import"./chunk-C4SDGOBF.js";import"./chunk-WMU7MFFB.js";import{a as ot}from"./chunk-TK4WFBNE.js";import{a as Ci,b as yi}from"./chunk-IVMCNDKP.js";import{d as xi,e as Si}from"./chunk-4IA4BZLM.js";import{a as Oe}from"./chunk-OUS5DM25.js";import"./chunk-OVHJDX5T.js";import"./chunk-RGIAK7TL.js";import"./chunk-ZH3LHPKO.js";import{a as si,b as ci}from"./chunk-SIEUNTYO.js";import{b as X,c as hi}from"./chunk-QG7IBBER.js";import"./chunk-HEYFTGSM.js";import{a as pi,b as pe}from"./chunk-QEGWZ27L.js";import"./chunk-VUGL7GL5.js";import{G as pt,N as _i,g as lt,o as di,s as ui,v as fi}from"./chunk-MV3BEGPX.js";import{i as Q,j as re,k as le,m as Y,n as K,o as rt,u as gi,v as bi}from"./chunk-AIORTWOA.js";import{Aa as be,Ba as ri}from"./chunk-R5NLMT6O.js";import"./chunk-MF3ABWUR.js";import{a as ni}from"./chunk-6XNLY67P.js";import"./chunk-UJBDZYC5.js";import{e as ke,f as mi}from"./chunk-53ZY7AX4.js";import"./chunk-5ZJO3PQ6.js";import"./chunk-44LJSYN6.js";import"./chunk-66WVYR24.js";import{a as F}from"./chunk-2FWFPV5I.js";import{A as tt,C as it,D as ai,c as z,h as A,i as Ee,k as Te,n as V,o as De,x as Pe,z as oi}from"./chunk-7UM6XERA.js";import"./chunk-WBGSMFMR.js";import"./chunk-XD2ONBCS.js";import{a as H,d as nt}from"./chunk-EQXS7YQT.js";import{a as He,b as T}from"./chunk-AMJRJEU7.js";import{$ as zt,$b as y,Bb as C,C as ce,Da as $e,Eb as x,Fa as qt,Fc as Jt,Gb as c,Hd as et,Ic as Xt,Jb as Le,Jd as Se,K as Zt,Kb as Qt,Kd as Ie,Lc as ei,Md as At,Na as P,Nc as $,Oa as xe,Oc as N,Od as j,Sa as r,Ta as u,Tc as ti,U as Ze,Ub as R,Vb as o,Vc as Z,Wb as _,Xb as v,Xc as ae,Y as te,Yb as Me,Zb as Ft,_c as Xe,ac as M,b as We,ba as ze,bc as w,c as jt,cb as oe,cc as Yt,d as Ue,dc as Kt,eb as d,ec as Ke,fa as _e,fc as U,ga as Ge,gc as Je,ia as ne,ib as m,ja as Gt,kb as Qe,lb as Ye,mb as ge,md as ii,n as Wt,na as I,nc as f,oa as qe,oc as S,pc as D,qb as $t,qc as we,r as se,tc as de,ua as g,v as Ut,va as b,vb as i,wb as t,xb as h,yb as B,zb as L}from"./chunk-ZCFRJGRH.js";import{a as Lt,b as Ht}from"./chunk-LHUGHE24.js";function Vt(n){if(n instanceof Int8Array||n instanceof Uint8Array||n instanceof Uint8ClampedArray)return new DataView(n.buffer,n.byteOffset,n.byteLength);if(n instanceof ArrayBuffer)return new DataView(n);throw new TypeError("Expected `data` to be an ArrayBuffer, Buffer, Int8Array, Uint8Array or Uint8ClampedArray")}var Li="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",Hi="0123456789ABCDEFGHIJKLMNOPQRSTUV",ji="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function Rt(n,p,e){e=e||{};let a,l;switch(p){case"RFC3548":case"RFC4648":a=Li,l=!0;break;case"RFC4648-HEX":a=Hi,l=!0;break;case"Crockford":a=ji,l=!1;break;default:throw new Error("Unknown base32 variant: "+p)}let s=e.padding!==void 0?e.padding:l,E=Vt(n),q=0,O=0,fe="";for(let Be=0;Be<E.byteLength;Be++)for(O=O<<8|E.getUint8(Be),q+=8;q>=5;)fe+=a[O>>>q-5&31],q-=5;if(q>0&&(fe+=a[O<<5-q&31]),s)for(;fe.length%8!==0;)fe+="=";return fe}var st=class n{constructor(p){this.dialogRef=p}config;ngOnInit(){this.config=new Y,this.config.okText="Disable Two Factor Authentication",this.config.customWidth="500px",this.config.title="DIsabled Two Factor Authentication",this.config.headerType=F.Warning}onOk(){this.dialogRef.close(!0)}static \u0275fac=function(e){return new(e||n)(u(Q))};static \u0275cmp=I({type:n,selectors:[["POS-modal-confirmation-disabled"]],decls:5,vars:1,consts:[[3,"onOk","onCancel","onClose","config"],[1,"row","px-10","py-4"],[1,"font-weight-normal","h4","text-left","lh-base"]],template:function(e,a){e&1&&(i(0,"modal-material",0),x("onOk",function(){return a.onOk()})("onCancel",function(){return a.dialogRef.close()})("onClose",function(){return a.dialogRef.close()}),i(1,"content")(2,"div",1)(3,"p",2),o(4,"Are you sure you want to disable two factor authentication for your account? "),t()()()()),e&2&&m("config",a.config)},dependencies:[K]})};function Ui(n,p){if(n&1){let e=C();B(0),i(1,"div")(2,"div",3),o(3," Two Factor Authentication Status: "),i(4,"span",4),o(5,"Enabled"),t()()(),i(6,"div",5)(7,"button",6),x("click",function(){g(e);let l=c();return b(l.onDisableTotp())}),o(8,"Disable Two Factor Authentication"),t()(),L()}}function Zi(n,p){if(n&1){let e=C();i(0,"div",7)(1,"div",8)(2,"h4"),o(3,"Connect Your DealPOS account to an Authenticator Application"),t(),i(4,"p"),o(5,"Secure your login with One Time Password using an Authenticator Application!"),t()()(),i(6,"div",7)(7,"div",8)(8,"ol",9)(9,"li",10)(10,"h5"),o(11,"Download Authenticator application"),t(),i(12,"div",11)(13,"a",12),h(14,"img",13),o(15," Microsoft Authenticator "),t(),i(16,"a",14),h(17,"img",15),o(18," Google Authenticator "),t()()(),i(19,"li",16)(20,"h5"),o(21,"Scan the QR code below"),t(),i(22,"div",5),h(23,"qr-code",17),t()(),i(24,"li",16)(25,"h5"),o(26,"Validate your QR Code"),t(),i(27,"form",18),x("submit",function(){g(e);let l=c();return b(l.onValidate())}),i(28,"div")(29,"input",19),x("keypress",function(l){g(e);let s=c();return b(s.numberOnly(l))}),w("ngModelChange",function(l){g(e);let s=c();return M(s.validation2FA.ValidationCode,l)||(s.validation2FA.ValidationCode=l),b(l)}),t()(),i(30,"div",5)(31,"button",20),o(32,"Validate"),t()()()()()()()}if(n&2){let e=c();r(23),m("value",e.qrcodeContent)("size",265),r(6),y("ngModel",e.validation2FA.ValidationCode)}}var ct=class n{constructor(p,e,a,l){this.document=p;this.authenticatorService=e;this.toastrService=a;this.dialog=l;this.destroy$=new jt}qrcodeContent;validation2FA={SecretKey:null,ValidationCode:null,Enabled:!0};destroy$;totpEnabled;ngOnInit(){this.generateQrCodeContent()}generateQrCodeContent(){let p=this.getDomainName(),e=this.generateRandomSecret();this.validation2FA.SecretKey=e;var a=H.parseJwt(localStorage.getItem("Token"));let l=a.LID;this.qrcodeContent=`otpauth://totp/${l}?secret=${e}&issuer=${p}`}generateRandomSecret(){let p=H.Guid_NewGuid(),e=new TextEncoder().encode(p);return Rt(e,"RFC3548")}getDomainName(){return this.document.location.origin.replace(/^https?:\/\//,"")}onValidate(){this.validateOnVerfiyCode()&&this.authenticatorService.configure2FA(this.validation2FA).pipe(zt(this.destroy$)).subscribe(p=>{this.toastrService.success(p.Message,"TOTP Enabled"),this.totpEnabled=!0})}validateOnVerfiyCode(){let p=!0;return H.IsEmpty(this.validation2FA.ValidationCode)?(p=!1,this.toastrService.warning("You must enter a authentication code.","Warning")):(this.validation2FA.ValidationCode.length<6||this.validation2FA.ValidationCode.length>6)&&(p=!1,this.toastrService.warning("The authentication code must be six digits long.","Warning")),p}numberOnly(p){return H.numberOnly(p)}onDisableTotp(){this.dialog.open(st).afterClosed().pipe(ce(p=>H.IsNotEmpty(p)),te(()=>this.authenticatorService.disableTwoFactorAuthentication())).subscribe(p=>{this.toastrService.success(p.Message,"TOTP Disabled"),this.totpEnabled=!1})}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static \u0275fac=function(e){return new(e||n)(u(Xt),u(ot),u(j),u(le))};static \u0275cmp=I({type:n,selectors:[["POS-setup-2FA"]],inputs:{totpEnabled:"totpEnabled"},decls:4,vars:2,consts:[["TOTP_ENABLED",""],[1,"container-fluid","mt-6"],[4,"ngIf","ngIfElse"],[1,"d-inline-block","fs-5"],[1,"text-success","fw-bold"],[1,"mt-6"],["type","button","type","submit",1,"btn","btn-sm","btn-danger",3,"click"],[1,"row"],[1,"col-12"],[1,"ps-7"],[1,"fw-bold"],[1,"d-flex","align-items-center","mt-6"],["href","https://play.google.com/store/apps/details?id=com.azure.authenticator","target","_blank",1,"link-dark","border","py-3","px-6","me-6","border-primary","border-2"],["src","https://res.cloudinary.com/pos/image/upload/v1666247461/POS/Images/Login/Microsoft_Authenticator.png",2,"width","35px"],["href","https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2","target","_blank",1,"link-dark","border","py-3","px-6","me-6","border-primary","border-2"],["src","https://res.cloudinary.com/pos/image/upload/v1666247460/POS/Images/Login/Google_Authenticator.png",2,"width","35px"],[1,"fw-bold","mt-6"],["errorCorrectionLevel","H",1,"qr2fa",3,"value","size"],[1,"mt-6",3,"submit"],["type","text","name","auth","placeholder","Enter six Digit Code",1,"form-control","rounded","totpCustomStyle","border","border-2","border-primary",3,"keypress","ngModelChange","ngModel"],["type","button","type","submit",1,"btn","btn-sm","btn-primary","py-3"]],template:function(e,a){if(e&1&&(i(0,"div",1),d(1,Ui,9,0,"ng-container",2)(2,Zi,33,3,"ng-template",null,0,de),t()),e&2){let l=R(3);r(),m("ngIf",a.totpEnabled)("ngIfElse",l)}},dependencies:[N,De,z,A,Ee,V,Te,Mi],styles:[`.totpCustomStyle{height:3.625rem;padding:.75rem!important;color:#343434;font-size:.875rem;border-radius:.25rem!important;width:370px}qr-code.qr2fa>canvas{border:2px solid rgb(51,122,183);padding:2px}
2
2
  `],encapsulation:2})};var Bt=n=>({active:n}),ki=n=>({"ng-invalid ng-dirty":n}),qi=(n,p)=>({border:n,"border-danger":p}),$i=n=>({"border-top-0":n});function Qi(n,p){if(n&1){let e=C();i(0,"button",71),x("click",function(){g(e);let l=c(3);return b(l.validate())}),o(1," Submit "),t()}if(n&2){c(2);let e=R(36);m("disabled",e==null||e.form==null?null:e.form.invalid)}}function Yi(n,p){if(n&1&&(B(0),d(1,Qi,2,1,"button",70),L()),n&2){let e=c(2);r(),m("ngIf",e.roleService.users.View||e.roleService.profile.View)}}function Ki(n,p){n&1&&(i(0,"small",75),o(1,"*Email is required"),t())}function Ji(n,p){n&1&&(i(0,"small",75),o(1,"*Enter a valid email address"),t())}function Xi(n,p){if(n&1&&(B(0),d(1,Ki,2,0,"small",74)(2,Ji,2,0,"small",74),L()),n&2){c();let e=R(2);r(),m("ngIf",e.errors==null?null:e.errors.required),r(),m("ngIf",e.errors==null?null:e.errors.pattern)}}function en(n,p){if(n&1){let e=C();i(0,"div",25)(1,"input",72,4),w("ngModelChange",function(l){g(e);let s=c(2);return M(s.formData.Email,l)||(s.formData.Email=l),b(l)}),t(),i(3,"label",73),o(4,"Email"),t(),d(5,Xi,3,2,"ng-container",7),t()}if(n&2){let e=R(2),a=c(2);r(),ge(Je(5,qi,e.touched&&e.invalid,e.touched&&e.invalid)),y("ngModel",a.formData.Email),m("disabled",!(a.roleService.users.View||a.roleService.profile.View)),r(4),m("ngIf",e.touched)}}function tn(n,p){n&1&&(i(0,"small",75),o(1,"*Enter a valid email address"),t())}function nn(n,p){if(n&1&&(B(0),d(1,tn,2,0,"small",74),L()),n&2){c();let e=R(2);r(),m("ngIf",e.errors==null?null:e.errors.pattern)}}function on(n,p){if(n&1){let e=C();i(0,"div",25)(1,"input",76,4),w("ngModelChange",function(l){g(e);let s=c(2);return M(s.formData.Email,l)||(s.formData.Email=l),b(l)}),t(),i(3,"label",73),o(4,"Email"),t(),d(5,nn,2,1,"ng-container",7),t()}if(n&2){let e=R(2),a=c(2);r(),m("disabled",!(a.roleService.users.View||a.roleService.profile.View)),y("ngModel",a.formData.Email),r(4),m("ngIf",e.touched)}}function an(n,p){n&1&&(i(0,"i",39),o(1," Password is required. "),t())}function rn(n,p){n&1&&(i(0,"i",39),o(1," These passwords don't match."),t())}function ln(n,p){if(n&1&&(i(0,"ul",77)(1,"li",78),o(2),t()()),n&2){let e=p.$implicit;r(2),_(e)}}function pn(n,p){if(n&1&&(i(0,"tr")(1,"td"),o(2),t(),i(3,"td"),o(4),t(),i(5,"td"),o(6),t()()),n&2){let e=p.$implicit,a=p.index;r(2),_(a+1),r(2),_(e.Key),r(2),_(e.Value)}}function mn(n,p){if(n&1&&(i(0,"ul",77)(1,"li",78),o(2),t()()),n&2){let e=p.$implicit;r(2),_(e)}}function sn(n,p){if(n&1&&(i(0,"tr")(1,"td"),o(2),t(),i(3,"td"),o(4),t(),i(5,"td"),o(6),t()()),n&2){let e=p.$implicit,a=p.index;r(2),_(a+1),r(2),_(e.Key),r(2),_(e.Value)}}function cn(n,p){if(n&1&&(i(0,"div",81)(1,"div",82),o(2),t()()),n&2){let e=p.$implicit,a=p.index;r(),ge(U(3,$i,a/4>=1)),r(),v(" ",e.Model," ")}}function dn(n,p){if(n&1&&(i(0,"div",59)(1,"div",79),o(2),t(),i(3,"div",44)(4,"div",20),d(5,cn,3,5,"div",80),t()()()),n&2){let e=p.$implicit;r(2),v(" ",e.Name," "),r(3),m("ngForOf",e.ListRole)}}function un(n,p){if(n&1){let e=C();i(0,"button",85),x("click",function(){g(e);let l=c(3);return b(l.copyToClipboard())}),o(1," Copy to Clipboard "),t()}if(n&2){let e=c(3);m("matTooltip",e.tooltipText)("cdkCopyToClipboard",e.formData.ClientID)}}function fn(n,p){if(n&1){let e=C();i(0,"a",86),x("click",function(){g(e);let l=c(3);return b(l.preview("Profile/GenerateClientID"))}),o(1,"Generate"),t()}}function _n(n,p){if(n&1&&(i(0,"div",21)(1,"div",64),h(2,"input",65),t()()),n&2){let e=c(3);r(2),m("value",e.formData.ClientSecret)}}function gn(n,p){if(n&1){let e=C();i(0,"button",85),x("click",function(){g(e);let l=c(3);return b(l.copyToClipboard())}),o(1," Copy to Clipboard "),t()}if(n&2){let e=c(3);m("matTooltip",e.tooltipText)("cdkCopyToClipboard",e.formData.ClientSecret)}}function bn(n,p){if(n&1){let e=C();i(0,"a",86),x("click",function(){g(e);let l=c(3);return b(l.preview("Profile/GenerateClientSecret"))}),o(1,"Generate"),t()}}function hn(n,p){if(n&1&&(B(0),i(1,"div",61)(2,"h3"),o(3,"API Client ID"),t(),i(4,"small",83),o(5,"(developer.dealpos.com)"),t()(),i(6,"div",63)(7,"div",21)(8,"div",64),h(9,"input",65),t()(),i(10,"div",21)(11,"div",25),d(12,un,2,2,"button",66)(13,fn,2,0,"a",67),t()()(),i(14,"div",61)(15,"h3"),o(16,"API Client Secret"),t(),i(17,"small",83),o(18,"(developer.dealpos.com)"),t()(),i(19,"div",63),d(20,_n,3,1,"div",84),i(21,"div",21)(22,"div",25),d(23,gn,2,2,"button",66)(24,bn,2,0,"a",67),t()()(),L()),n&2){let e=c(2);r(9),m("value",e.formData.ClientID),r(3),m("ngIf",e.formData.ClientID),r(),m("ngIf",e.roleService.users.View||e.roleService.profile.View),r(7),m("ngIf",e.formData.ClientSecret),r(3),m("ngIf",e.formData.ClientSecret),r(),m("ngIf",e.roleService.users.View||e.roleService.profile.View)}}function xn(n,p){n&1&&(i(0,"div",87)(1,"h4"),o(2," You have no access to view this info, please contact your administrator to view this tab information "),t()())}function Sn(n,p){if(n&1){let e=C();i(0,"button",85),x("click",function(){g(e);let l=c(2);return b(l.copyToClipboard())}),o(1," Copy to Clipboard "),t()}if(n&2){let e=c(2);m("matTooltip",e.tooltipText)("cdkCopyToClipboard",e.formData.OTTUrl)}}function vn(n,p){if(n&1){let e=C();i(0,"a",86),x("click",function(){g(e);let l=c(2);return b(l.generateOTT("Profile/GenerateOneTimeToken"))}),o(1,"Generate"),t()}}function Cn(n,p){if(n&1){let e=C();i(0,"mainpanel-cmp",6)(1,"actions"),d(2,Yi,2,1,"ng-container",7),t(),i(3,"content")(4,"div",8)(5,"div")(6,"ul",9)(7,"li",10)(8,"a",11),x("click",function(){g(e);let l=c();return b(l.onSelectTab("GENERAL"))}),o(9,"General"),t()(),i(10,"li",10)(11,"a",12),x("click",function(){g(e);let l=c();return b(l.onSelectTab("SECURITY"))}),o(12,"Security"),t()(),i(13,"li",10)(14,"a",13),x("click",function(){g(e);let l=c();return b(l.onSelectTab("ROLES"))}),o(15,"Roles"),t()(),i(16,"li",10)(17,"a",14),x("click",function(){g(e);let l=c();return b(l.onSelectTab("API"))}),o(18,"Developer API"),t()(),i(19,"li",10)(20,"a",15),x("click",function(){g(e);let l=c();return b(l.onSelectTab("TOTP"))}),o(21,"TOTP"),t()(),i(22,"li",10)(23,"a",16),x("click",function(){g(e);let l=c();return b(l.onSelectTab("OTT"))}),o(24,"One Time Token"),t()()(),i(25,"div",17)(26,"div",18)(27,"div",19)(28,"div",20)(29,"div",21)(30,"div",22)(31,"div",23)(32,"h2"),o(33,"General Credential"),t()(),i(34,"div",24)(35,"form",null,0)(37,"div",25)(38,"input",26),w("ngModelChange",function(l){g(e);let s=c();return M(s.formData.FirstName,l)||(s.formData.FirstName=l),b(l)}),t(),i(39,"label",27),o(40,"First Name"),t()(),i(41,"div",25)(42,"input",28),w("ngModelChange",function(l){g(e);let s=c();return M(s.formData.LastName,l)||(s.formData.LastName=l),b(l)}),t(),i(43,"label",29),o(44,"Last Name"),t()(),i(45,"div",25)(46,"input",30),w("ngModelChange",function(l){g(e);let s=c();return M(s.formData.LoginID,l)||(s.formData.LoginID=l),b(l)}),t(),i(47,"label",31),o(48,"Username"),t()(),d(49,en,6,8,"div",32)(50,on,6,3,"div",32),t()()()(),i(51,"div",21)(52,"div",22)(53,"div",23)(54,"h2"),o(55,"Change Password"),t(),i(56,"small",33),o(57,"Leave blank if you do not want to change"),t()(),i(58,"div",24)(59,"div")(60,"p-floatLabel")(61,"p-password",34,1),w("ngModelChange",function(l){g(e);let s=c();return M(s.formData.NewPassword,l)||(s.formData.NewPassword=l),b(l)}),t(),i(63,"label",35),o(64,"Password"),t()(),d(65,an,2,0,"i",36),t(),i(66,"div",37)(67,"p-floatLabel")(68,"p-password",38,2),w("ngModelChange",function(l){g(e);let s=c();return M(s.formData.RePassword,l)||(s.formData.RePassword=l),b(l)}),t(),i(70,"label",35),o(71,"Re-Password"),t()(),d(72,rn,2,0,"i",39),t()()()()()()(),i(73,"div",40)(74,"div",41)(75,"div",42)(76,"h5",43),o(77,"Group"),t(),i(78,"i"),o(79,"Profile Groups"),t()(),i(80,"div",44)(81,"div",20),d(82,ln,3,1,"ul",45),t()()(),i(83,"div",46)(84,"div",47)(85,"h5",43),o(86,"Outlets"),t(),i(87,"i"),o(88,"Profile Outlets"),t()(),i(89,"div",44)(90,"div",20)(91,"div")(92,"table",48)(93,"thead",49)(94,"tr")(95,"th"),o(96,"No"),t(),i(97,"th"),o(98,"Outlet"),t(),i(99,"th"),o(100,"Access"),t()()(),i(101,"tbody"),d(102,pn,7,3,"tr",50),t()()()()()()(),i(103,"div",51)(104,"div",41)(105,"div",42)(106,"h5",43),o(107,"Group"),t(),i(108,"i"),o(109,"Profile Groups"),t()(),i(110,"div",44)(111,"div",20),d(112,mn,3,1,"ul",45),t()()(),i(113,"div",46)(114,"div",47)(115,"h5",43),o(116,"Outlets"),t(),i(117,"i"),o(118,"Profile Outlets"),t()(),i(119,"div",44)(120,"div",20)(121,"div")(122,"table",48)(123,"thead",49)(124,"tr")(125,"th"),o(126,"No"),t(),i(127,"th"),o(128,"Outlet"),t(),i(129,"th"),o(130,"Access"),t()()(),i(131,"tbody"),d(132,sn,7,3,"tr",50),t()()()()()()(),i(133,"div",52),d(134,dn,6,2,"div",53),t(),i(135,"div",54),d(136,hn,25,6,"ng-container",55)(137,xn,3,0,"ng-template",null,3,de),t(),i(139,"div",56),h(140,"POS-setup-2FA",57),t(),i(141,"div",58)(142,"div",59)(143,"div",60)(144,"div",61)(145,"h3"),o(146,"One Time Token"),t(),i(147,"small",62),o(148,"*Token will expire in 1 hour"),t()(),i(149,"div",63)(150,"div",21)(151,"div",64),h(152,"input",65),t()(),i(153,"div",21)(154,"div",25),d(155,Sn,2,2,"button",66)(156,vn,2,0,"a",67),t()(),i(157,"div",60)(158,"small",68),o(159," Please refer this "),i(160,"a",69),o(161,"article"),t(),o(162," for more information "),t()()()()()()()()()()()}if(n&2){let e=R(62),a=R(69),l=R(138),s=c();m("pageData",s.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),r(2),m("ngIf",s.activeTab=="GENERAL"),r(6),m("ngClass",U(38,Bt,s.activeTab=="GENERAL")),r(3),m("ngClass",U(40,Bt,s.activeTab=="SECURITY")),r(15),m("ngClass",U(42,Bt,s.activeTab=="GENERAL")),r(12),y("ngModel",s.formData.FirstName),m("disabled",!(s.roleService.users.View||s.roleService.profile.View)),r(4),y("ngModel",s.formData.LastName),m("disabled",!(s.roleService.users.View||s.roleService.profile.View)),r(4),y("ngModel",s.formData.LoginID),m("disabled",!(s.roleService.users.View||s.roleService.profile.View)),r(3),m("ngIf",s.data.EmailRequired),r(),m("ngIf",!s.data.EmailRequired),r(11),m("toggleMask",!0)("feedback",!1)("disabled",!(s.roleService.users.View||s.roleService.profile.View)),y("ngModel",s.formData.NewPassword),m("ngClass",U(44,ki,e.touched&&e.invalid)),r(4),m("ngIf",(e.touched||a.dirty)&&e.invalid),r(3),y("ngModel",s.formData.RePassword),m("toggleMask",!0)("feedback",!1)("disabled",!(s.roleService.users.View||s.roleService.profile.View))("ngClass",U(46,ki,s.formData.NewPassword!=s.formData.RePassword&&(a.touched||a.dirty))),r(4),$t(s.formData.NewPassword!=s.formData.RePassword&&(a.touched||a.dirty)?72:-1),r(10),m("ngForOf",s.data.Security.Groups),r(20),m("ngForOf",s.data.Security.Outlets),r(10),m("ngForOf",s.data.Security.Groups),r(20),m("ngForOf",s.data.Security.Outlets),r(2),m("ngForOf",s.data.Role),r(2),m("ngIf",s.roleService.developer.Api)("ngIfElse",l),r(4),m("totpEnabled",s.totpEnabled),r(12),m("value",s.formData.OneTimeToken),r(3),m("ngIf",s.formData.OneTimeToken),r(),m("ngIf",s.roleService.users.View||s.roleService.profile.View)}}var dt=class n extends mt{constructor(e,a,l,s,E,q,O){super(e,a,"Profile/MyProfileFormInitial",l);this.toastr=s;this.dialog=E;this.authenticatorService=q;this.roleService=O}tooltipText="Copy to Clipboard";totpEnabled;activeTab="GENERAL";postBindForm(e){this.totpEnabled=e?.Form?.TOTPEnabled,this.data.Form.OTTUrl=window.location.hostname+`?OTT=${e?.Form?.OneTimeToken}`}validate(){if(this.formData.NewPassword!=this.formData.RePassword){this.toastr.error("Password and re-enter password must be equal.",F.Error);return}this.onSubmit("Profile/SubmitProfile")}onSubmitSuccess(){this.toastr.success("Your profile is successfuly updated",F.Success)}preview(e){this.httpService.post(`/API/${e}`).subscribe({next:a=>{this.data.Form=a},error:a=>{this.toastr.error(a,F.Error)}})}copyToClipboard(){this.tooltipText="Token has been copied to clipboard",setTimeout(()=>{this.tooltipText="Copy to Clipboard"},2e3)}onSelectTab(e){this.activeTab=e}generateOTT(e){this.httpService.post(`/API/${e}`).subscribe({next:a=>{this.data.Form.OneTimeToken=a.OneTimeToken,this.data.Form.OTTUrl="https://"+window.location.hostname+`?OTT=${this.data.Form.OneTimeToken}`},error:a=>{this.toastr.error(a,F.Error)}})}static \u0275fac=function(a){return new(a||n)(u(pe),u(T),u(et),u(j),u(le),u(ot),u(nt))};static \u0275cmp=I({type:n,selectors:[["POS-my-profile"]],features:[oe],decls:1,vars:1,consts:[["validation","ngForm"],["password","ngModel"],["rePassword","ngModel"],["REQUIRED_ROLE_API",""],["email","ngModel"],[3,"pageData","hideSearchBox","hideSearchDropdown",4,"ngIf"],[3,"pageData","hideSearchBox","hideSearchDropdown"],[4,"ngIf"],[1,"container-fluid","mt-5"],["id","myTab","role","tablist",1,"nav","nav-tabs"],[1,"nav-item","cursor"],["id","general-tab","data-bs-toggle","tab","href","#general","role","tab","aria-controls","general","aria-selected","false",1,"nav-link","active",3,"click","ngClass"],["id","security-tab","data-bs-toggle","tab","href","#security","role","tab","aria-controls","profile","aria-selected","false",1,"nav-link",3,"click","ngClass"],["id","roles-tab","data-bs-toggle","tab","href","#roles","role","tab","aria-controls","contact","aria-selected","false",1,"nav-link",3,"click"],["id","developerApi-tab","data-bs-toggle","tab","href","#developerApi","role","tab","aria-controls","developerApi","aria-selected","false",1,"nav-link",3,"click"],["id","setupAuth-tab","data-bs-toggle","tab","href","#setupAuth","role","tab","aria-controls","setupAuth","aria-selected","false",1,"nav-link",3,"click"],["id","ott-tab","data-bs-toggle","tab","href","#ott","role","tab","aria-controls","ott","aria-selected","false",1,"nav-link",3,"click"],["id","myTabContent",1,"tab-content"],["id","general","role","tab",1,"tab-pane","fade","show","active","mt-0","pt-8","border","border-top-0",3,"ngClass"],[1,"container"],[1,"row"],[1,"col-sm-6"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"form-floating-outline"],["type","text","id","inputFirstName","name","firstName","placeholder","First Name",1,"form-control",3,"ngModelChange","ngModel","disabled"],["for","inputFirstName"],["type","text","id","inputLastName","name","lastName","placeholder","Last Name",1,"form-control",3,"ngModelChange","ngModel","disabled"],["for","inputLastName"],["type","text","id","inputName","name","userName","placeholder","Username",1,"form-control",3,"ngModelChange","ngModel","disabled"],["for","inputName"],["class","form-floating-outline",4,"ngIf"],[1,"text-body-secondary","h6"],["required","",1,"p-change-password",3,"ngModelChange","toggleMask","feedback","disabled","ngModel","ngClass"],["for","password"],["class","control-label text-danger",4,"ngIf"],[1,"mt-6"],[1,"p-change-password",3,"ngModelChange","ngModel","toggleMask","feedback","disabled","ngClass"],[1,"control-label","text-danger"],["id","security","role","tab",1,"tab-pane","fade","show","border","border-top-0","mt-0"],[1,"border-bottom","row","pt-8","ms-3","me-3"],[1,"col-sm-2","mt-3"],[1,"fw-bold"],[1,"col-sm-10"],["class","mb-4",4,"ngFor","ngForOf"],[1,"row","border-bottom","mt-10","ms-3"],[1,"col-sm-2"],[1,"table"],[1,"thead-light","sticky-top-thead"],[4,"ngFor","ngForOf"],["id","security","role","tabpanel",1,"tab-pane","panel","fade","border","border-top-0","mt-0"],["id","roles","role","tabpanel",1,"tab-pane","panel","fade","border","border-top-0","mt-0"],["class","row pt-8 ms-3 me-3",4,"ngFor","ngForOf"],["id","developerApi","role","tab",1,"tab-pane","fade","show","border","border-top-0","p-5","mt-0"],[4,"ngIf","ngIfElse"],["id","setupAuth","role","tab",1,"tab-pane","fade","show","p-5","mt-0","border","border-top-0"],[3,"totpEnabled"],["id","ott","role","tab",1,"tab-pane","fade","show","p-5","mt-0","border","border-top-0"],[1,"row","pt-8","ms-3","me-3"],[1,"col-12"],[1,"d-flex","align-items-center"],[1,"text-danger","ms-5"],[1,"row","d-flex","align-items-center"],[1,"form-floating-outline","bg-light-gray"],["type","text","name","api-client","readonly","",1,"form-control",3,"value"],["mat-raised-button","","matTooltipPosition","above","id","btnCopyToken","class","btn btn-secondary btn-sm me-5",3,"matTooltip","cdkCopyToClipboard","click",4,"ngIf"],["class","btn btn-success btn-sm","role","button",3,"click",4,"ngIf"],[1,"text-body-secondary","fst-italic","h6","ms-2"],["href","https://support.dealpos.com/en/articles/9890206-one-time-token","target","_blank"],["matTooltipPosition","above","matTooltip","Save","class","btn btn-success","role","button",3,"disabled","click",4,"ngIf"],["matTooltipPosition","above","matTooltip","Save","role","button",1,"btn","btn-success",3,"click","disabled"],["type","text","id","email","name","email","placeholder","Email","pattern","[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}$","required","",1,"form-control",3,"ngModelChange","ngModel","disabled"],["for","email"],["class","text-danger",4,"ngIf"],[1,"text-danger"],["id","email","type","Email","name","email","placeholder","Email","pattern","[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}$",1,"form-control",3,"ngModelChange","disabled","ngModel"],[1,"mb-4"],[2,"list-style","circle"],[1,"col-sm-2","border","fw-bold","p-3","text-center",2,"background-color","#f6f6f6"],["class","col-md-3 px-0",4,"ngFor","ngForOf"],[1,"col-md-3","px-0"],[1,"p-3","border","border-start-0"],[1,"text-body-secondary","h6","ms-2"],["class","col-sm-6",4,"ngIf"],["mat-raised-button","","matTooltipPosition","above","id","btnCopyToken",1,"btn","btn-secondary","btn-sm","me-5",3,"click","matTooltip","cdkCopyToClipboard"],["role","button",1,"btn","btn-success","btn-sm",3,"click"],[1,"d-flex","justify-content-center","align-items-center","p-12"]],template:function(a,l){a&1&&d(0,Cn,163,48,"mainpanel-cmp",5),a&2&&m("ngIf",l.data&&l.formData)},dependencies:[ei,$,N,De,z,A,Ee,Pe,tt,V,Te,X,be,Ii,Ti,Pi,ct],styles:["p-password.p-change-password>div.p-password.p-component.p-inputwrapper{width:100%!important} p-password.p-change-password>div.p-password.p-component.p-inputwrapper>input{width:100%!important;height:58px!important;padding-left:15px!important;border:1px solid #dee2e6} p-password.p-change-password>div.p-password.p-component.p-inputwrapper>eyeicon.p-element.p-icon-wrapper{margin-right:10px}"]})};var yn=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],Mn=n=>({ID:n});function wn(n,p){n&1&&(i(0,"th",22),o(1," @@ Cost "),t())}function In(n,p){if(n&1&&(i(0,"span",39),o(1),f(2,"number"),t()),n&2){let e=c().$implicit;r(),_(" - Profit: "+S(2,1,e.Profit))}}function En(n,p){if(n&1&&(i(0,"small"),o(1),t()),n&2){let e=c(2).$implicit;r(),v("( ",e.Commissions[0].Quantity," unit )")}}function Tn(n,p){if(n&1&&(i(0,"i",52),o(1),d(2,En,2,1,"small",53),t()),n&2){let e=c().$implicit;r(),v("sold by ",e.Commissions[0].SalesName," "),r(),m("ngIf",e.Commissions[0].Quantity<e.Quantity)}}function Dn(n,p){if(n&1&&(i(0,"li")(1,"i"),o(2),t()()),n&2){let e=p.$implicit;r(2),v("( ",e.Quantity+" unit by "+e.SalesName," )")}}function Pn(n,p){if(n&1&&(i(0,"ul",54)(1,"li")(2,"i"),o(3,"sold by"),t()(),d(4,Dn,3,1,"li",19),t()),n&2){let e=c().$implicit;r(4),m("ngForOf",e.Commissions)}}function On(n,p){if(n&1&&(i(0,"th",55),o(1),f(2,"number"),t()),n&2){let e=c().$implicit;r(),_(S(2,1,e.UnitCost))}}function kn(n,p){if(n&1&&(i(0,"tr")(1,"th",40)(2,"div")(3,"span",41),o(4),t(),d(5,Tn,3,2,"i",42)(6,Pn,5,1,"ul",43),h(7,"span",44),f(8,"newlines"),t()(),i(9,"th",45),o(10),t(),i(11,"th",46),o(12),f(13,"number"),t(),i(14,"th",47),o(15),t(),d(16,On,3,3,"th",48),i(17,"th",49),o(18),f(19,"number"),t(),i(20,"th",50),o(21),t(),i(22,"th",51),o(23),f(24,"number"),t()()),n&2){let e=p.$implicit,a=c(3);r(4),_(e.Name),r(),m("ngIf",e.Commissions.length==1),r(),m("ngIf",e.Commissions.length>1),r(),m("innerHTML",S(8,11,e.Note),P),r(3),_(e.Code),r(2),_(S(13,13,e.Quantity)),r(3),_(e.UOMName),r(),m("ngIf",a.roleService.product.Cost),r(2),_(S(19,15,e.UnitPrice)),r(3),_(e.Discount==0?"":e.Discount+"%"),r(2),_(S(24,17,e.Total))}}function Nn(n,p){if(n&1&&(i(0,"tr")(1,"th",56),o(2,"\xA0"),t(),h(3,"th",57)(4,"th",58)(5,"th",59)(6,"th",16),i(7,"th",60),o(8),t(),i(9,"th",61),o(10),t(),i(11,"th",62),o(12),f(13,"number"),t()()),n&2){let e=p.$implicit;r(8),v("",e.Label," :"),r(2),_(e.CurrencySymbol),r(2),_(S(13,3,e.Amount))}}function Fn(n,p){if(n&1&&(i(0,"div")(1,"div",23)(2,"div",24)(3,"a",25),h(4,"span",26),f(5,"date"),h(6,"small",27),f(7,"date"),t(),i(8,"span"),o(9),f(10,"showIfNotNullOrEmptyString"),t(),h(11,"span",28),i(12,"strong",29),o(13),f(14,"sum"),f(15,"number"),i(16,"span"),o(17),f(18,"showIfNotNullOrEmptyString"),t()(),d(19,In,3,3,"span",30),i(20,"i",31),o(21),t(),i(22,"span",32),o(23),t(),i(24,"span",33),o(25),t()(),i(26,"div",34),h(27,"label",35),t()(),i(28,"table",36),h(29,"thead"),i(30,"tbody",37),d(31,kn,25,19,"tr",19),t()(),i(32,"table",38),d(33,Nn,14,5,"tr",19),t()()),n&2){let e=p.$implicit,a=c(2);r(3),m("routerLink",Ke(31,yn))("queryParams",U(32,Mn,e.ID)),r(),m("innerHTML",e.EntityName+" #"+e.Number+" - "+D(5,14,e.Date,"dd MMM yyyy"),P),r(2),m("innerHTML","("+D(7,17,e.Created,"HH:mm")+")",P),r(3),_(D(10,20,e.CustomerNameDisplay," - {0}")),r(4),v(" ","[Q: "+D(14,23,e.Items,"Quantity")+", T: "+S(15,26,e.Final)+"]"," "),r(4),_(D(18,28,e.SalesName," - Sales: {0}")),r(2),m("ngIf",a.roleService.report.Profit),r(2),_(e.DeliveryOutlet==null?"":": Delivered from "+e.DeliveryOutlet),r(2),_(e.PromotionCoupon==null?"":": "+e.PromotionCoupon),r(2),_(e.SONote==null?"":": "+e.SONote),r(2),m("innerHTML",e.PaymentStateLabel,P),r(4),m("ngForOf",e.Items),r(2),m("ngForOf",e.Aggregate)}}function An(n,p){if(n&1&&(i(0,"div")(1,"strong"),o(2,"Cost ("),h(3,"span",67),f(4,"number"),o(5,"%)"),t(),h(6,"span",65),f(7,"number"),t()),n&2){let e=c(3);r(3),m("innerHTML",S(4,2,e.data.Aggregate.CostRatio),P),r(3),m("innerHTML",S(7,4,e.data.Aggregate.Cost),P)}}function Vn(n,p){if(n&1&&(i(0,"div")(1,"strong")(2,"span"),o(3,"Profit"),t(),o(4," ("),h(5,"span",67),f(6,"number"),o(7,"%)"),t(),h(8,"span",65),f(9,"number"),t()),n&2){let e=c(3);r(5),m("innerHTML",S(6,2,e.data.Aggregate.ProfitRatio),P),r(3),m("innerHTML",S(9,4,e.data.Aggregate.Profit),P)}}function Rn(n,p){if(n&1&&(i(0,"div",63)(1,"div",64)(2,"div")(3,"strong"),o(4,"Tax Added"),t(),h(5,"span",65),f(6,"number"),t(),i(7,"div")(8,"strong"),o(9,"Sales with Tax"),t(),h(10,"span",65),f(11,"number"),t()(),i(12,"div",66)(13,"div")(14,"strong"),o(15,"Orders"),t(),h(16,"span",65),f(17,"number"),t(),i(18,"div")(19,"strong"),o(20,"Qty"),t(),h(21,"span",65),f(22,"number"),t()(),i(23,"div",66)(24,"div")(25,"strong"),o(26,"Gross Sales"),t(),h(27,"span",65),f(28,"number"),t(),i(29,"div")(30,"strong"),o(31,"Discount"),t(),h(32,"span",65),f(33,"number"),t(),i(34,"div")(35,"strong"),o(36,"Tax Incl."),t(),h(37,"span",65),f(38,"number"),t(),i(39,"div")(40,"strong"),o(41,"Net Sales"),t(),h(42,"span",65),f(43,"number"),t(),d(44,An,8,6,"div",53)(45,Vn,10,6,"div",53),t()()),n&2){let e=c(2);r(5),m("innerHTML",S(6,10,e.data.Aggregate.TaxAdd),P),r(5),m("innerHTML",S(11,12,e.data.Aggregate.SalesWithTax),P),r(6),m("innerHTML",S(17,14,e.data.Aggregate.Orders),P),r(5),m("innerHTML",S(22,16,e.data.Aggregate.ItemsQuantity),P),r(6),m("innerHTML",S(28,18,e.data.Aggregate.GrossItems),P),r(5),m("innerHTML",S(33,20,e.data.Aggregate.Discount),P),r(5),m("innerHTML",S(38,22,e.data.Aggregate.TaxInclude),P),r(5),m("innerHTML",S(43,24,e.data.Aggregate.SalesWithoutTax),P),r(2),m("ngIf",e.roleService.product.Cost),r(),m("ngIf",e.roleService.report.Profit)}}function Bn(n,p){if(n&1){let e=C();i(0,"mainpanel-cmp",1),x("onSubmit",function(){g(e);let l=c();return b(l.searchFromPageOne())}),i(1,"filters")(2,"div",2)(3,"div",3)(4,"div")(5,"h6"),o(6,"Type"),t(),i(7,"ng-select",4),w("ngModelChange",function(l){g(e);let s=c();return M(s.pageData.Filter.TypeID,l)||(s.pageData.Filter.TypeID=l),b(l)}),t()(),i(8,"div")(9,"h6"),o(10,"Customer"),t(),i(11,"autocompleteV2",5),x("onInputChange",function(l){g(e);let s=c();return b(s.resetCustomer(l))})("onSelect",function(l){g(e);let s=c();return b(s.onSelectCustomer(l))}),t()(),i(12,"div")(13,"h6"),o(14,"From"),t(),i(15,"datepicker",6),w("dateChange",function(l){g(e);let s=c();return M(s.pageData.Filter.From,l)||(s.pageData.Filter.From=l),b(l)}),t()(),i(16,"div")(17,"h6"),o(18,"To"),t(),i(19,"datepicker",7),w("dateChange",function(l){g(e);let s=c();return M(s.pageData.Filter.To,l)||(s.pageData.Filter.To=l),b(l)}),t()()()()(),i(20,"content")(21,"div",8)(22,"table",9)(23,"thead",10)(24,"tr")(25,"th",11),o(26," Name "),t(),i(27,"th",12),o(28," Code "),t(),i(29,"th",13),o(30," Qty "),t(),i(31,"th",14),o(32," UOM "),t(),d(33,wn,2,0,"th",15),i(34,"th",16),o(35," @@ Price "),t(),i(36,"th",17),o(37," % "),t(),i(38,"th",18),o(39," Total "),t()()()(),d(40,Fn,34,34,"div",19)(41,Rn,46,26,"div",20),i(42,"POS-complex-pagination",21),x("jumpToPage",function(){g(e);let l=c();return b(l.getListData())})("previousPage",function(){g(e);let l=c();return b(l.getListData())})("nextPage",function(){g(e);let l=c();return b(l.getListData())}),t()()()()}if(n&2){let e=c();m("pageData",e.menuData)("hideSearchBox",!0),r(7),m("items",e.pageData.Options.Types),y("ngModel",e.pageData.Filter.TypeID),r(8),y("date",e.pageData.Filter.From),r(4),y("date",e.pageData.Filter.To),r(14),m("ngIf",e.roleService.product.Cost),r(7),m("ngForOf",e.data.Data),r(),m("ngIf",e.data.Data&&e.data.Data.length>0),r(),m("total",e.data.Data?e.data.Data.length:0)("pageData",e.pageData)}}var ft=class n extends Oe{constructor(e,a,l){super(e,a,"Report/MySales","ReportLoader/MyActivity");this.roleService=l}onSelectCustomer(e){this.pageData.Filter.CustomerID=e}resetCustomer(e){e==""&&(this.pageData.Filter.CustomerID=null)}static \u0275fac=function(a){return new(a||n)(u(pe),u(T),u(nt))};static \u0275cmp=I({type:n,selectors:[["POS-my-sales"]],features:[oe],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"onSubmit","pageData","hideSearchBox"],[1,"d-flex"],["container",""],["bindLabel","Name","bindValue","ID",3,"ngModelChange","items","ngModel"],["requestUrl","/API/AC/GetCustomerSuggestion",1,"w-100",3,"onInputChange","onSelect"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","660px"],[2,"width","68px"],[1,"text-end",2,"width","30px"],[2,"width","50px"],["id","thCost","class","text-end","style","width: 80px",4,"ngIf"],[1,"text-end",2,"width","80px"],[1,"red",2,"width","30px"],[1,"text-end",2,"width","90px"],[4,"ngFor","ngForOf"],["class","clearfix mb-5 mt-5",4,"ngIf"],["api","Report/ReportDetailCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],["id","thCost",1,"text-end",2,"width","80px"],[1,"d-lg-flex","mt-sm-0"],[1,"me-auto","d-sm-block","mt-8","mb-2"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber",1,"ms-4",3,"innerHTML"],[1,"fst-italic","fw-bold",3,"innerHTML"],[1,"d-block"],[1,"text-danger","ms-3"],["class","fw-bold",4,"ngIf"],["id","deliveryNote"],[1,"d-inline-block","fst-italic"],[1,"d-inline-block"],[1,"d-lg-block","mt-8","me-2","fw-bold","fst-italic"],[1,"status",3,"innerHTML"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],[1,"table","table-sm","table-borderless","d-flex","justify-content-end","mt-3"],[1,"fw-bold"],[2,"width","726px"],[1,"fw-normal"],["class","text-warning inlineMarginLeft",4,"ngIf"],["class","list-inline text-warning inlineMarginLeft",4,"ngIf"],[1,"d-block","fw-normal","fst-italic",3,"innerHTML"],[1,"fw-normal",2,"width","75px"],[1,"fw-normal","text-end",2,"width","42px"],[1,"fst-italic","small",2,"width","52px"],["class","fw-normal text-end","style","width: 80px",4,"ngIf"],[1,"fw-normal","text-end",2,"width","92px"],[1,"fw-normal","text-end","text-danger",2,"width","30px"],[1,"fw-normal","text-end",2,"width","102px"],[1,"text-warning","inlineMarginLeft"],[4,"ngIf"],[1,"list-inline","text-warning","inlineMarginLeft"],[1,"fw-normal","text-end",2,"width","80px"],[2,"width","645px"],[2,"width","75px"],[2,"width","30px"],[2,"width","40px"],[1,"text-end",2,"width","130px"],[1,"fw-normal","text-end",2,"width","20px"],[1,"fw-normal","text-end","pe3",2,"width","60px"],[1,"clearfix","mb-5","mt-5"],[1,"zebra",2,"float","right"],[1,"text-end",3,"innerHTML"],[1,"zebra",2,"float","right","margin-right","20px"],[1,"Percentage",3,"innerHTML"]],template:function(a,l){a&1&&d(0,Bn,43,11,"mainpanel-cmp",0),a&2&&m("ngIf",l.data)},dependencies:[$,N,A,V,Ie,X,Ne,ke,Ci,gi,ae,Z,lt,di,ui]})};function Ln(n,p){n&1&&(i(0,"small",17),o(1,"*Enter a valid phone number"),t())}function Hn(n,p){if(n&1&&(B(0),d(1,Ln,2,0,"small",16),L()),n&2){c();let e=R(9);r(),m("ngIf",e.errors==null?null:e.errors.pattern)}}function jn(n,p){n&1&&(i(0,"small",17),o(1,"*Enter a valid email address"),t())}function Wn(n,p){if(n&1&&(B(0),d(1,jn,2,0,"small",16),L()),n&2){c();let e=R(16);r(),m("ngIf",e.errors==null?null:e.errors.pattern)}}var _t=class n{constructor(p,e,a,l,s){this.httpService=p;this.dialogRef=e;this.data=a;this.toastr=l;this.router=s;this.config.title="Subscribe Account Info",this.config.okText="I want to subscribe",this.config.cancelText="Cancel",this.config.customWidth="35vw"}config=new Y;onOk(p){if(p!=="Enter"){if(this.data.form.Qty==0){this.toastr.error("The number of outlets can't be empty",F.Error),this.dialogRef.close();return}this.httpService.post("/API/Subscription/SendSubscription",this.data.form).subscribe(e=>{this.toastr.success(e,F.Success),this.router.navigate(["/menu/Profile/Main/My_Subscription"]),this.dialogRef.close()})}}static \u0275fac=function(e){return new(e||n)(u(T),u(Q),u(re),u(j),u(Se))};static \u0275cmp=I({type:n,selectors:[["POS-modal-subscribe"]],decls:26,vars:7,consts:[["validation","ngForm"],["phoneCtrl","ngModel"],["emailCtrl","ngModel"],[3,"onOk","onCancel","onClose","dynamicValidated","config"],[1,"container"],[1,"row"],[1,"col-6"],[1,"form-floating-outline"],["type","text","id","inputPhone","placeholder","Phone","name","phone","pattern","[0-9]{0,15}","required","","matTooltipPosition","above","matTooltip","Your number will be saved to help our customer service quickly identify you in the future",1,"form-control",3,"ngModelChange","ngModel"],["for","inputPhone"],[4,"ngIf"],["type","text","id","inputEmail","placeholder","Email","name","email","pattern","[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}$","required","","matTooltipPosition","above","matTooltip","Your monthly recurring invoice will be sent to the email you specified above",1,"form-control",3,"ngModelChange","ngModel"],["for","inputEmail"],[1,"col-12"],["name","note","id","inputNote","placeholder","Note","rows","6",1,"form-control",3,"ngModelChange","ngModel"],["for","inputNote"],["class","text-danger",4,"ngIf"],[1,"text-danger"]],template:function(e,a){if(e&1){let l=C();i(0,"modal-material",3),x("onOk",function(E){return g(l),b(a.onOk(E))})("onCancel",function(){return g(l),b(a.dialogRef.close())})("onClose",function(){return g(l),b(a.dialogRef.close())}),i(1,"content")(2,"div",4)(3,"form",null,0)(5,"div",5)(6,"div",6)(7,"div",7)(8,"input",8,1),w("ngModelChange",function(E){return g(l),M(a.data.form.Phone,E)||(a.data.form.Phone=E),b(E)}),t(),i(10,"label",9),o(11,"Phone*"),t(),d(12,Hn,2,1,"ng-container",10),t()(),i(13,"div",6)(14,"div",7)(15,"input",11,2),w("ngModelChange",function(E){return g(l),M(a.data.form.Email,E)||(a.data.form.Email=E),b(E)}),t(),i(17,"label",12),o(18,"Email*"),t(),d(19,Wn,2,1,"ng-container",10),t()()(),i(20,"div",5)(21,"div",13)(22,"div",7)(23,"textarea",14),w("ngModelChange",function(E){return g(l),M(a.data.form.Note,E)||(a.data.form.Note=E),b(E)}),t(),i(24,"label",15),o(25,"Note"),t()()()()()()()()}if(e&2){let l=R(9),s=R(16);m("dynamicValidated",(l==null?null:l.valid)||(s==null?null:s.valid))("config",a.config),r(8),y("ngModel",a.data.form.Phone),r(4),m("ngIf",l.touched&&l.dirty),r(3),y("ngModel",a.data.form.Email),r(4),m("ngIf",s.touched&&s.dirty),r(4),y("ngModel",a.data.form.Note)}},dependencies:[N,De,z,A,Ee,Pe,tt,V,Te,K,be]})};function Un(n,p){if(n&1){let e=C();i(0,"div",23),x("click",function(){let l=g(e).$implicit,s=c(2);return b(s.onCycleChange(l.key))}),i(1,"div",24)(2,"span",25),o(3),t(),h(4,"div",26),t()()}if(n&2){let e=p.$implicit,a=c(2);ge(e.key==a.formData.Cycle?"active":""),r(3),_(e.dicount),r(),m("innerHTML",e.desc,P)}}function Zn(n,p){if(n&1){let e=C();i(0,"tr")(1,"th",27),o(2,"Register"),t(),i(3,"td"),o(4,":"),t(),i(5,"td")(6,"input",28),w("ngModelChange",function(l){g(e);let s=c(2);return M(s.formData.Register,l)||(s.formData.Register=l),b(l)}),x("ngModelChange",function(){g(e);let l=c(2);return b(l.onQtyRegisterChange())}),t(),i(7,"span"),o(8),f(9,"number"),t()()()}if(n&2){let e=c(2);r(6),m("preventNegative",!0),y("ngModel",e.formData.Register),r(2),v("/ ",S(9,3,e.data.Options.Register),"")}}function zn(n,p){if(n&1){let e=C();i(0,"div",7)(1,"div",29)(2,"div",9)(3,"h2",10),o(4,"Setup Fee "),t(),i(5,"small",11),o(6,"(One-time payment)"),t()()(),i(7,"div",30)(8,"table",31)(9,"tr")(10,"th"),o(11,"POS"),t(),i(12,"td"),o(13,"\xA0:"),t(),i(14,"td")(15,"label",32)(16,"radio-options",33),w("modelChange",function(l){g(e);let s=c(2);return M(s.data.Options.SetupFee,l)||(s.data.Options.SetupFee=l),b(l)}),x("modelChange",function(){g(e);let l=c(2);return b(l.calculateSetupFee())}),t()()()()()()()}if(n&2){let e=c(2);r(16),y("model",e.data.Options.SetupFee)}}function Gn(n,p){n&1&&(B(0),o(1,"s "),L())}function qn(n,p){if(n&1&&(i(0,"tr")(1,"td")(2,"strong"),o(3,"Additional Register"),t(),i(4,"p")(5,"small",40),o(6),t()()(),i(7,"td",36),o(8),t(),i(9,"td",37),h(10,"span",39),o(11),f(12,"number"),t(),i(13,"td",38),o(14),t(),i(15,"td",37),h(16,"span",39),o(17),f(18,"number"),t()()),n&2){let e=c(4);r(6),Me("",e.formData.Register," Register",e.formData.Register>1?"s":""," "),r(2),_(e.formData.Cycle),r(2),m("innerHTML",e.data.Options.Setup?"IDR ":"$ ",P),r(),_(S(12,8,e.data.Options.Register)),r(3),v(" ",e.formData.Discount>0?e.formData.Discount+"%":"-"," "),r(2),m("innerHTML",e.data.Options.Setup?"IDR ":"$ ",P),r(),_(S(18,10,e.registerFee))}}function $n(n,p){if(n&1&&(i(0,"tr")(1,"td")(2,"strong")(3,"span"),o(4,"POS"),t()(),i(5,"p")(6,"small",40),o(7," - Consultation "),h(8,"br"),o(9," - Training 2x "),h(10,"br"),o(11," - 1 Month Support Group"),t()()(),h(12,"td",36),i(13,"td",37)(14,"span"),o(15,"IDR "),t(),o(16),f(17,"number"),t(),h(18,"td",38),i(19,"td",37)(20,"span"),o(21,"IDR "),t(),o(22),f(23,"number"),t()()),n&2){let e=c(4);r(16),_(S(17,2,e.formData.Setup)),r(6),_(S(23,4,e.formData.Setup))}}function Qn(n,p){if(n&1&&(B(0),i(1,"tr")(2,"td")(3,"strong"),h(4,"span",39),t(),i(5,"p")(6,"small",40),o(7),d(8,Gn,2,0,"ng-container",17),t()()(),i(9,"td",36),o(10),t(),i(11,"td",37),h(12,"span",39),o(13),f(14,"number"),t(),i(15,"td",38),o(16),t(),i(17,"td",37),h(18,"span",39),o(19),f(20,"number"),t()(),d(21,qn,19,12,"tr",17)(22,$n,24,6,"tr",17),L()),n&2){let e=c(3);r(4),m("innerHTML",e.formData.Type==1?"Starter Subscription":"Standard Subscription",P),r(3),v(" ",e.formData.Qty," Outlet"),r(),m("ngIf",e.formData.Qty>1),r(2),_(e.formData.Cycle),r(2),m("innerHTML",e.data.Options.Setup?"IDR ":"$ ",P),r(),_(S(14,11,e.data.Options.Type)),r(3),v(" ",e.formData.Discount>0?e.formData.Discount+"%":"-"," "),r(2),m("innerHTML",e.data.Options.Setup?"IDR ":"$ ",P),r(),_(S(20,13,e.outletFee)),r(2),m("ngIf",e.formData.Register>0),r(),m("ngIf",e.data.Options.SetupFee)}}function Yn(n,p){if(n&1&&(i(0,"tr")(1,"th"),o(2,"Sub Total"),t(),i(3,"td",43),o(4,":"),t(),i(5,"td",37)(6,"strong"),h(7,"span",39),o(8),f(9,"number"),t()()()),n&2){let e=c(4);r(7),m("innerHTML",e.data.Options.Setup?"IDR ":"$ ",P),r(),_(S(9,2,e.subTotal))}}function Kn(n,p){if(n&1&&(i(0,"tr")(1,"th"),o(2,"Tax (11%)"),t(),i(3,"td",43),o(4,":"),t(),i(5,"td",37)(6,"strong"),h(7,"span",39),o(8),f(9,"number"),t()()()),n&2){let e=c(4);r(7),m("innerHTML",e.data.Options.Setup?"IDR ":"$ ",P),r(),_(S(9,2,e.subTotal*.11))}}function Jn(n,p){if(n&1&&(B(0),i(1,"div",41)(2,"table",42),d(3,Yn,10,4,"tr",17)(4,Kn,10,4,"tr",17),i(5,"tr")(6,"th"),o(7,"Total"),t(),i(8,"td",43),o(9,":"),t(),i(10,"td",37)(11,"strong"),h(12,"span",39),o(13),f(14,"number"),t()()()()(),L()),n&2){let e=c(3);r(3),m("ngIf",e.data.vatEnabled),r(),m("ngIf",e.data.vatEnabled),r(8),m("innerHTML",e.data.Options.Setup?"IDR ":"$ ",P),r(),v("",S(14,4,e.subTotal+(e.data.vatEnabled?e.subTotal*.11:0)),`
3
3
  `)}}function Xn(n,p){if(n&1&&(i(0,"div",30)(1,"table",34)(2,"thead",35)(3,"tr")(4,"th"),o(5,"Product"),t(),i(6,"th",36),o(7,"Month"),t(),i(8,"th",37),o(9,"Price"),t(),i(10,"th",38),o(11,"Disc"),t(),i(12,"th",37),o(13,"Total"),t()()(),i(14,"tbody"),d(15,Qn,23,15,"ng-container",17),t()(),d(16,Jn,15,6,"ng-container",17),t()),n&2){let e=c(2);r(15),m("ngIf",(e.formData==null?null:e.formData.Qty)>0),r(),m("ngIf",(e.formData==null?null:e.formData.Qty)>0)}}function eo(n,p){n&1&&(i(0,"div",7)(1,"div",29)(2,"h2"),o(3,'Your payment currency is "IDR"'),t()(),i(4,"div",30)(5,"div",44)(6,"div",45)(7,"h2",46)(8,"button",47),o(9," I Want to pay in USD "),t()(),i(10,"div",48)(11,"div",49)(12,"ol",50)(13,"li",51),o(14," Go to setup menu"),t(),i(15,"li",51),o(16," Click tab currency"),t(),i(17,"li",51),o(18," Select the currency you want to make for payment"),t(),i(19,"li",51),o(20," Select Yes at primary currency box and click save"),t(),i(21,"li",52),o(22," Then you can check to my subscribe again "),t()(),i(23,"p",53),o(24,"For more detailed information, please check the following article: "),i(25,"a",54),o(26,"Added Currency Conversion"),t()()()()()()()())}function to(n,p){if(n&1){let e=C();i(0,"mainpanel-cmp",2)(1,"actions")(2,"button",3),x("click",function(){g(e);let l=c();return b(l.onOpenSubscribeDialog())}),o(3,"Subscribe Now"),t()(),i(4,"content")(5,"div",4)(6,"div",5)(7,"div",6)(8,"div",7)(9,"div",8)(10,"div",9)(11,"h2",10),o(12,"Subscribe "),t(),i(13,"small",11),o(14,"(Recurring)"),t()(),i(15,"a",12),x("click",function(){g(e);let l=c();return b(l.showRegister=!l.showRegister)}),o(16,"More"),t()(),i(17,"div",13)(18,"table",14)(19,"tr")(20,"th"),o(21,"Outlets"),t(),i(22,"td"),o(23,":"),t(),i(24,"td")(25,"input",15,0),w("ngModelChange",function(l){g(e);let s=c();return M(s.formData.Qty,l)||(s.formData.Qty=l),b(l)}),x("ngModelChange",function(){g(e);let l=c();return b(l.onQtyOutletChange())}),t(),i(27,"span"),o(28),f(29,"number"),t()()(),i(30,"tr")(31,"th"),o(32,"Cycle"),t(),i(33,"td"),o(34,":"),t(),i(35,"td"),d(36,Un,5,4,"div",16),t()(),d(37,Zn,10,5,"tr",17),t()()(),d(38,zn,17,1,"div",18),t(),i(39,"div",19)(40,"div",7)(41,"div",20),x("click",function(){g(e);let l=c();return b(l.invoice=!l.invoice)}),i(42,"h2",21),o(43,"Invoice Preview"),t()(),d(44,Xn,17,2,"div",22),t(),d(45,eo,27,0,"div",18),t()()()()()}if(n&2){let e=c();m("pageData",e.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0)("hideMenu",!0),r(2),m("disabled",e.formData.Qty==0),r(23),m("preventNegative",!0),y("ngModel",e.formData.Qty),r(3),v("/ ",S(29,13,e.data.Type[0].amount),""),r(8),m("ngForOf",e.data.DiscountOptions),r(),m("ngIf",e.showRegister),r(),m("ngIf",e.data.Options.Setup),r(6),m("ngIf",e.invoice),r(),m("ngIf",e.data.Options.Setup)}}var gt=class n extends mt{constructor(e,a,l,s){super(e,a,"Subscription/MySubscriptionLoader",l);this.matDialog=s}showRegister=!1;invoice=!0;outletFee=0;registerFee=0;subTotal=0;postBindForm(e){this.calculate(),this.data.DiscountOptions=e.DiscountOptions}onOpenSubscribeDialog(){this.matDialog.open(_t,{data:{form:this.formData}})}onCycleChange(e){switch(this.formData.Cycle=e,e){case 3:this.formData.Discount=0;break;case 6:this.formData.Discount=10;break;case 12:this.formData.Discount=15;break}this.calculateregisterFee(),this.calculate()}onQtyOutletChange(){this.calculate()}calculate(){if(this.formData.Cycle>1){let e=this.data.Options.Type*this.formData.Qty*this.formData.Cycle;this.data.Discount=e*this.formData.Discount/100,this.outletFee=this.data.Options.Type*this.formData.Qty*this.formData.Cycle-this.data.Discount,this.subTotal=this.outletFee+this.registerFee}else this.outletFee=this.data.Options.Type*this.formData.Qty,this.subTotal=this.outletFee+this.registerFee,this.data.Discount=0;this.data.Options.SetupFee&&(this.subTotal=this.subTotal+this.formData.Setup)}calculateSetupFee(){this.data.Options.SetupFee?(this.formData.SetupFee=!0,this.subTotal=this.subTotal+this.formData.Setup):(this.formData.SetupFee=!1,this.subTotal=this.subTotal-this.formData.Setup)}onQtyRegisterChange(){this.calculateregisterFee(),this.calculate()}calculateregisterFee(){let e=this.data.Options.Register*this.formData.Cycle*this.formData.Register;if(this.formData.Discount>0){let a=e*this.formData.Discount/100;this.registerFee=e-a}else this.registerFee=e}static \u0275fac=function(a){return new(a||n)(u(pe),u(T),u(et),u(le))};static \u0275cmp=I({type:n,selectors:[["POS-choose-plan"]],features:[oe],decls:1,vars:1,consts:[["outletQty","ngModel"],[3,"pageData","hideSearchBox","hideSearchDropdown","hideMenu",4,"ngIf"],[3,"pageData","hideSearchBox","hideSearchDropdown","hideMenu"],[1,"btn","btn-success",3,"click","disabled"],[1,"container-fluid","bg-light-gray","pb-10"],[1,"row","pt-5"],[1,"col-md-5","m-0","pe-0","pt-0","pb-0"],[1,"card"],[1,"card-header","d-flex","justify-content-between"],[1,"me-auto","d-sm-block","mt-3"],[1,"d-inline"],[1,"text-body-secondary","h6"],["role","button",1,"btn","btn-outline-secondary",3,"click"],[1,"card-body",2,"padding-right","0.625rem"],[1,"table-sm"],["type","text","autoNum","",1,"form-control",2,"width","65px","display","inline-block",3,"ngModelChange","preventNegative","ngModel"],["class","card border-dark align-text-top d-inline-block me-1 mb-0",3,"class","click",4,"ngFor","ngForOf"],[4,"ngIf"],["class","card",4,"ngIf"],[1,"col-md-7"],[1,"card-header",3,"click"],[1,"title"],["class","card-body",4,"ngIf"],[1,"card","border-dark","align-text-top","d-inline-block","me-1","mb-0",3,"click"],[1,"card-body","text-center",2,"cursor","pointer","width","80px","padding","10px 5px"],[1,"fw-bold"],[1,"fw-normal","border-top","border-dark",3,"innerHTML"],["matTooltipPosition","above","matTooltip","Additional Register"],["type","text","autoNum","","maxlength","3",1,"form-control",2,"width","65px","display","inline-block",3,"ngModelChange","preventNegative","ngModel"],[1,"card-header"],[1,"card-body"],[1,"form-horizontal"],[1,"form-check","form-check-inline",2,"cursor","pointer","padding-top","8px"],["name","POS",3,"modelChange","model"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[1,"text-end",2,"min-width","65px"],[1,"text-end"],[1,"text-end",2,"min-width","85px"],[3,"innerHTML"],[2,"font-size","90% !important"],[1,"d-flex","justify-content-end"],[1,"table-sm","table-borderless","me-3"],[1,"sep"],["id","accordionExample",1,"accordion"],[1,"accordion-item"],["id","panelsStayOpen-headingTwo",1,"accordion-header"],["type","button","data-bs-toggle","collapse","data-bs-target","#panelsStayOpen-collapseTwo","aria-expanded","false","aria-controls","panelsStayOpen-collapseTwo",1,"accordion-button","collapsed"],["id","panelsStayOpen-collapseTwo","aria-labelledby","panelsStayOpen-headingTwo",1,"accordion-collapse","collapse"],[1,"accordion-body","pt-2"],[1,"list-group","list-group-numbered","mt-5","mb-3"],[1,"list-group-item","mb-3","border-top-0","border-start-0","border-end-0","border-bottom-1"],[1,"list-group-item","rounded-0","border-top-0","border-start-0","border-end-0","border-bottom-1"],[1,"ms-2","mt-6"],["href","https://support.dealpos.com/en/articles/8956190-how-to-create-new-currency","target","_blank"]],template:function(a,l){a&1&&d(0,to,46,15,"mainpanel-cmp",1),a&2&&m("ngIf",l.data&&l.formData)},dependencies:[$,N,z,A,oi,V,X,ci,xi,be,ae],styles:[".active[_ngcontent-%COMP%]{background-color:#fffed9}"]})};var bt=class n{constructor(p,e,a){this.dialogRef=p;this.data=e;this.router=a;this.config.title=this.data.title,this.config.okText="Yes",this.config.cancelText="No"}config=new Y;onOk(){this.router.navigate(["/menu/Profile/Main/My_Subscription/Choose_your_plan"]),this.dialogRef.close()}static \u0275fac=function(e){return new(e||n)(u(Q),u(re),u(Se))};static \u0275cmp=I({type:n,selectors:[["POS-modal-choose-plan"]],decls:6,vars:2,consts:[[3,"onOk","onCancel","onClose","config"],[1,"text-center",2,"width","440px"]],template:function(e,a){e&1&&(i(0,"modal-material",0),x("onOk",function(){return a.onOk()})("onCancel",function(){return a.dialogRef.close()})("onClose",function(){return a.dialogRef.close()}),i(1,"content")(2,"h4",1),o(3),i(4,"span"),o(5,"Do you want to Choose your Plan ?"),t()()()()),e&2&&(m("config",a.config),r(3),v(" ",a.data.body," "))},dependencies:[K]})};var ht=class n{constructor(p,e,a,l){this.httpService=p;this.dialogRef=e;this.data=a;this.toastr=l;this.config.title="Confim Adjusted Subscription"}message="";config=new Y;onOk(){let p={Message:this.message};this.message.trim().length==0?(this.toastr.error("The reason cannot be empty",F.Error),this.dialogRef.close()):this.httpService.post("/API/Subscription/Confirm",p).subscribe(e=>{this.toastr.success(e.Message,F.Success),this.dialogRef.close()})}static \u0275fac=function(e){return new(e||n)(u(T),u(Q),u(re),u(j))};static \u0275cmp=I({type:n,selectors:[["POS-modal-confirm-adjusted-plan"]],decls:8,vars:2,consts:[[3,"onOk","onCancel","onClose","config"],[1,"font-weight","h4","mb-5"],[1,"form-floating-outline"],["name","address","id","inputAddress","placeholder","Address","matTooltipPosition","above","matTooltip","Address","required","",1,"form-control",3,"ngModelChange","ngModel"],["for","inputAddress"]],template:function(e,a){e&1&&(i(0,"modal-material",0),x("onOk",function(){return a.onOk()})("onCancel",function(){return a.dialogRef.close()})("onClose",function(){return a.dialogRef.close()}),i(1,"content")(2,"p",1),o(3," Do you agree about billing adjusted? "),t(),i(4,"div",2)(5,"textarea",3),w("ngModelChange",function(s){return M(a.message,s)||(a.message=s),s}),t(),i(6,"label",4),o(7,"Reason"),t()()()()),e&2&&(m("config",a.config),r(5),y("ngModel",a.message))},dependencies:[z,A,Pe,V,K,be]})};var Ae=class n{constructor(p,e,a,l){this.httpService=p;this.dialogRef=e;this.data=a;this.toastr=l;this.config.title="Stop Subscription",this.config.customWidth="450px"}message="";config=new Y;onOk(){let p={Message:this.message};this.message.trim().length==0?(this.toastr.error("The reason cannot be empty",F.Error),this.dialogRef.close()):this.httpService.post("/API/Subscription/Close",p).subscribe(e=>{this.toastr.success(e.Message,F.Error),this.dialogRef.close()})}static \u0275fac=function(e){return new(e||n)(u(T),u(Q),u(re),u(j))};static \u0275cmp=I({type:n,selectors:[["POS-modal-stop-subscription"]],decls:6,vars:2,consts:[[3,"onOk","onCancel","onClose","config"],[1,"form-floating-outline"],["name","message",2,"width","100%","height","200px",3,"ngModelChange","ngModel"],["for","message"]],template:function(e,a){e&1&&(i(0,"modal-material",0),x("onOk",function(){return a.onOk()})("onCancel",function(){return a.dialogRef.close()})("onClose",function(){return a.dialogRef.close()}),i(1,"content")(2,"div",1)(3,"textarea",2),w("ngModelChange",function(s){return M(a.message,s)||(a.message=s),s}),t(),i(4,"label",3),o(5,"Reason"),t()()()()),e&2&&(m("config",a.config),r(3),y("ngModel",a.message))},dependencies:[z,A,V,K]})};var Ve=class n{apiUrl="https://app.midtrans.com/snap/snap.js";injected=!1;initScript(){return new We(p=>{let e;this.injected||(e=document.createElement("script"),e.src=this.apiUrl,e.async=!0,e.setAttribute("data-client-key",He.midtransClientKey),this.injected=!0,document.body.appendChild(e))})}static \u0275fac=function(e){return new(e||n)};static \u0275prov=_e({token:n,factory:n.\u0275fac,providedIn:"root"})};var io=()=>["/menu/Profile/Main/My_Subscription/Choose_your_plan"],no=(n,p)=>({"bg-warning":n,"bg-danger":p}),oo=n=>({"background-color":n}),ao=n=>({"bg-gradient-warning":n});function ro(n,p){n&1&&(i(0,"a",35),o(1,"Choose Your Plan"),t()),n&2&&m("routerLink",Ke(1,io))}function lo(n,p){if(n&1&&(i(0,"div",16),o(1),f(2,"date"),t()),n&2){let e=c(2);r(),v(" ",D(2,1,e.data.Zoho.Subscription.Since,"dd MMM yyyy")," ")}}function po(n,p){if(n&1&&(i(0,"div",36)(1,"div",37)(2,"h5",13),o(3," Subscription "),t(),i(4,"div",16),o(5),t()()()),n&2){let e=c(2);r(),ge(Je(3,no,e.data.Zoho.Subscription.SubscriptionState=="SellOnly"||e.data.Zoho.Subscription.SubscriptionState=="Overdue",e.data.Zoho.Subscription.SubscriptionState=="Suspended")),r(4),v(" ",e.data.Zoho.Subscription.SubscriptionState," ")}}function mo(n,p){if(n&1&&(i(0,"span",42),o(1),f(2,"number"),t()),n&2){let e=c(3);r(),v("",S(2,1,e.data.Zoho.Subscription.Discount)," %")}}function so(n,p){if(n&1&&(i(0,"span")(1,"del"),o(2),f(3,"number"),t(),h(4,"br"),t()),n&2){let e=c(3);r(2),_(S(3,1,e.data.Zoho.Subscription.TotalAmount))}}function co(n,p){if(n&1&&(i(0,"div",6)(1,"div",7)(2,"h2"),o(3,"Current Plan"),t()(),i(4,"div",28)(5,"table",29)(6,"thead",30)(7,"tr")(8,"th",38),o(9,"Usage"),t(),i(10,"th",38),o(11,"Frequency"),t(),i(12,"th",39),o(13,"Amount"),t()()(),i(14,"tbody")(15,"tr")(16,"td",40),o(17),h(18,"br"),o(19),f(20,"number"),i(21,"small"),o(22,"month"),t(),o(23,") "),t(),i(24,"td",40)(25,"span"),o(26),h(27,"br"),t(),d(28,mo,3,3,"span",41),t(),i(29,"td",40),d(30,so,5,3,"span",19),i(31,"span"),o(32),f(33,"number"),t()()()()()()()),n&2){let e=c(2);r(17),v(" ",e.data.Zoho.Subscription.OutletCount," Outlet"),r(2),v(" (",S(20,6,e.data.Zoho.Subscription.RecurringAmount)," / "),r(7),_(e.data.Zoho.Subscription.Frequency==12?"Yearly":e.data.Zoho.Subscription.Frequency==1?"Monthly":e.data.Zoho.Subscription.Frequency==3?"3 Months":"6 Months"),r(2),m("ngIf",e.data.Zoho.Subscription.Discount!=0),r(2),m("ngIf",e.data.Zoho.Subscription.Discount!=0),r(2),_(S(33,8,e.data.Zoho.Subscription.TotalAfterDiscount))}}function uo(n,p){if(n&1&&(i(0,"span",42),o(1),f(2,"number"),t()),n&2){let e=c(3);r(),v("",S(2,1,e.data.Zoho.Subscription.Discount)," %")}}function fo(n,p){if(n&1&&(i(0,"span")(1,"del"),o(2),f(3,"number"),t(),h(4,"br"),t()),n&2){let e=c(3);r(2),_(S(3,1,e.data.NextBilling.TotalAmount))}}function _o(n,p){if(n&1){let e=C();i(0,"div",6)(1,"div",7)(2,"div")(3,"h2"),o(4,"Adjusted Plan"),t()(),i(5,"div",43)(6,"button",44),x("click",function(){g(e);let l=c(2);return b(l.onOpenConfirmAdjustedModal())}),o(7," Confirm "),t()()(),i(8,"div",28)(9,"table",29)(10,"thead",30)(11,"tr")(12,"th",38),o(13,"Usage"),t(),i(14,"th",38),o(15,"Frequency"),t(),i(16,"th",39),o(17,"Amount"),t()()(),i(18,"tbody")(19,"tr")(20,"td",40),o(21),h(22,"br"),o(23),f(24,"number"),i(25,"small"),o(26,"month"),t(),o(27,") "),t(),i(28,"td",40)(29,"span"),o(30),h(31,"br"),t(),d(32,uo,3,3,"span",41),t(),i(33,"td",40),d(34,fo,5,3,"span",19),i(35,"span"),o(36),f(37,"number"),t()()()()()()()}if(n&2){let e=c(2);r(21),v(" ",e.data.NextBilling.Outlet," Outlet"),r(2),v(" (",S(24,6,e.data.NextBilling.RecurringAmount)," / "),r(7),_(e.data.Zoho.Subscription.Frequency==12?"Yearly":e.data.Zoho.Subscription.Frequency==3?"3 Monthly":"6 Months"),r(2),m("ngIf",e.data.Zoho.Subscription.Discount!=0),r(2),m("ngIf",e.data.Zoho.Subscription.Discount!=0),r(2),_(S(37,8,e.data.NextBilling.TotalAfterDiscount))}}function go(n,p){if(n&1&&(i(0,"tr")(1,"th",47),o(2,"Withholding Tax"),t(),i(3,"td"),o(4,":"),t(),i(5,"td"),o(6),t()()),n&2){let e=c(3);r(6),v(" ",e.data.Zoho.WHTPercentage," % ")}}function bo(n,p){if(n&1&&(i(0,"tr")(1,"th",47),o(2,"Document Link"),t(),i(3,"td"),o(4,":"),t(),i(5,"td")(6,"a",48),h(7,"i",49),o(8," Upload "),t()()()),n&2){let e=c(3);r(6),Le("href",e.data.Zoho.DocumentLink,xe)}}function ho(n,p){if(n&1&&(B(0),i(1,"div",6)(2,"div",7)(3,"h2"),h(4,"i",45),o(5,"Tax Information"),t()(),i(6,"div",9)(7,"table",46),d(8,go,7,1,"tr",19)(9,bo,9,1,"tr",19),t()()(),L()),n&2){let e=c(2);r(8),m("ngIf",e.data.Zoho.WHTPercentage>0),r(),m("ngIf",e.data.Zoho.DocumentLink)}}function xo(n,p){if(n&1){let e=C();i(0,"a",62),x("click",function(){g(e);let l=c(3);return b(l.payAllInvoice())}),h(1,"i",63),o(2),f(3,"Filter"),f(4,"sum"),f(5,"Filter"),f(6,"sum"),f(7,"number"),t()}if(n&2){let e=c(3);r(2),v(" Pay All ~ IDR ",S(7,15,D(4,5,we(3,1,e.data.Zoho.invoices,"overdue","status"),"total")+D(6,12,we(5,8,e.data.Zoho.invoices,"sent","status"),"total"))," ")}}function So(n,p){if(n&1&&(i(0,"p",68),o(1),f(2,"number"),t()),n&2){let e=c().$implicit;r(),v("(",S(2,1,e.balance)," due)")}}function vo(n,p){if(n&1&&(B(0),i(1,"a",69),h(2,"i",70),i(3,"span",71),o(4,"View"),t()(),L()),n&2){let e=c().$implicit;r(),Le("href",e.invoice_url,xe)}}function Co(n,p){if(n&1){let e=C();B(0),i(1,"button",72),x("click",function(){g(e);let l=c().$implicit,s=c(3);return b(s.paySingleInvoice(l))}),h(2,"i",63),i(3,"span",71),o(4,"Pay Now"),t()(),L()}if(n&2){let e=c().$implicit;r(),Qt("id","pay-button",e.invoice_number,"")}}function yo(n,p){if(n&1&&(i(0,"tr",64)(1,"td"),o(2),t(),i(3,"td"),o(4),f(5,"date"),t(),i(6,"td"),o(7),t(),i(8,"td",57),o(9),f(10,"number"),d(11,So,3,3,"p",65),t(),i(12,"td"),o(13),t(),i(14,"td",66),o(15),t(),i(16,"td",67),d(17,vo,5,1,"ng-container",19)(18,Co,5,2,"ng-container",19),t()()),n&2){let e=p.$implicit,a=p.index;Ye(U(16,oo,e.status=="overdue"?"#f2dede":"")),r(2),_(a+1+"."),r(2),_(D(5,11,e.date,"dd MMM yyyy")),r(3),_(e.invoice_number),r(2),v(" ",S(10,14,e.total)," "),r(2),m("ngIf",e.total!=e.balance&&e.balance>0),r(2),_(e.currency_code),r(2),_(e.status),r(2),m("ngIf",e.status!="draft"&&e.status!="void"),r(),m("ngIf",(e.status=="sent"||e.status=="overdue")&&e.currency_code=="IDR")}}function Mo(n,p){if(n&1&&(i(0,"div",6)(1,"div",7)(2,"div",50)(3,"h2",51),h(4,"i",52),o(5," Invoices"),t()(),d(6,xo,8,17,"a",53),t(),i(7,"div",28)(8,"table",54)(9,"thead",30)(10,"tr")(11,"th",31),o(12,"No"),t(),i(13,"th",55),o(14,"Date"),t(),i(15,"th",56),o(16,"Number"),t(),i(17,"th",57),o(18,"Amount"),t(),h(19,"th",58),i(20,"th",59),o(21,"Status"),t(),i(22,"th"),o(23,"Invoice"),t()()(),i(24,"tbody"),d(25,yo,19,18,"tr",60),t()(),i(26,"p",61),o(27," Please pay your biling directly inside our platform. We provide multiple methods ex: Credit Card/Bank Transfer/E-Money. "),t()()()),n&2){let e=c(2);r(6),m("ngIf",e.outstandingInvoiceCount>1&&e.data.Zoho.Subscription.Currency=="RP"),r(19),m("ngForOf",e.data.Zoho.invoices)}}function wo(n,p){if(n&1){let e=C();i(0,"button",73),x("click",function(){g(e);let l=c(2);return b(l.load())}),o(1," Load "),t()}}function Io(n,p){if(n&1&&(i(0,"tr",64)(1,"td"),o(2),t(),i(3,"td"),o(4),t(),i(5,"td",57),o(6),f(7,"number"),t(),i(8,"td",57),o(9),t(),i(10,"td",57),o(11),f(12,"date"),t(),i(13,"td",57),o(14),f(15,"date"),t()()),n&2){let e=p.$implicit,a=p.index;r(2),_(a+1+"."),r(2),_(e.Name),r(),ge(U(16,ao,e.OrdersCount<25)),r(),v(" ",S(7,8,e.OrdersCount),""),r(3),_(e.RegisterCount),r(2),_(D(12,10,e.MinDate,"dd MMM yyyy")),r(3),_(D(15,13,e.MaxDate,"dd MMM yyyy"))}}function Eo(n,p){if(n&1){let e=C();i(0,"mainpanel-cmp",1)(1,"actions"),d(2,ro,2,2,"a",2),t(),i(3,"content")(4,"div",3)(5,"div",4)(6,"div",5)(7,"div",6)(8,"div",7)(9,"h2"),h(10,"i",8),o(11," Account"),t()(),i(12,"div",9)(13,"div",10)(14,"div",11)(15,"div",12)(16,"h5",13),o(17," Since "),t(),d(18,lo,3,4,"div",14),t()(),i(19,"div",15)(20,"div",12)(21,"h5",13),o(22," Type "),t(),i(23,"div",16),o(24),t()()(),d(25,po,6,6,"div",17),t()()(),d(26,co,34,10,"div",18)(27,_o,38,10,"div",18)(28,ho,10,2,"ng-container",19),i(29,"div",6)(30,"div",7)(31,"h2"),h(32,"i",20),o(33," Close Store"),t()(),i(34,"div",9)(35,"div"),o(36," You can close your store to stop your billing. "),t(),i(37,"div",21)(38,"button",22),x("click",function(){g(e);let l=c();return b(l.onOpenCloseModal())}),o(39," Close "),t()()()()(),i(40,"div",23),d(41,Mo,28,2,"div",18),i(42,"div",6)(43,"div",24)(44,"h2"),h(45,"i",25),o(46," Outlets Usage "),i(47,"small",26),o(48),f(49,"date"),f(50,"date"),t()(),d(51,wo,2,0,"button",27),t(),i(52,"div",28)(53,"table",29)(54,"thead",30)(55,"tr")(56,"th",31),o(57,"No"),t(),i(58,"th"),o(59,"Outlet Name"),t(),i(60,"th",32),o(61,"Orders"),t(),i(62,"th",32),o(63,"Registers"),t(),i(64,"th",33),o(65,"Min Date"),t(),i(66,"th",33),o(67,"Max Date"),t()()(),i(68,"tbody"),d(69,Io,16,18,"tr",34),f(70,"sortBy"),t()()()()()()()()()}if(n&2){let e=c();m("pageData",e.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),r(2),m("ngIf",e.data.Account.Type=="Trial"),r(16),m("ngIf",e.data.Zoho.Subscription),r(6),v(" ",e.data.Account.Type," "),r(),m("ngIf",e.data.Zoho.CustomerID!=null),r(),m("ngIf",e.data.Zoho.Subscription!=null),r(),m("ngIf",e.data.Zoho.Subscription!=null&&e.data.NextBilling&&e.data.Billed>e.data.Zoho.Subscription.OutletCount),r(),m("ngIf",e.data.Zoho.WHTPercentage>0||e.data.Zoho.DocumentLink),r(13),m("ngIf",e.data.Zoho.invoices&&e.data.Zoho.invoices.length>0),r(7),Me("(",D(49,15,e.data.From,"dd MMM yyyy")," - ",D(50,18,e.data.To,"dd MMM yyyy"),")"),r(3),m("ngIf",e.data.Outlets.length==0),r(18),m("ngForOf",we(70,21,e.data.Outlets,"desc","OrdersCount"))}}var xt=class n extends pi{constructor(e,a,l,s,E,q){super(e);this.httpService=a;this.matDialog=l;this.midtrans=s;this.ngZone=E;this.toastr=q;this.data=null}modalTitle;modalBody;data;loadOutlet=!1;outstandingInvoiceCount=0;ngOnInit(){this.midtrans.initScript().subscribe(),this.menuData$.subscribe(()=>{this.getData()})}getData(){let e={LoadOutlet:this.loadOutlet};this.httpService.post("/API/Subscription/GetData",e).subscribe({next:a=>{this.data=a,H.IsEmpty(this.data.Outlets)&&(this.data.Outlets=[]),this.postInit(a)}})}postInit(e){e.Zoho.invoices=e.Zoho.invoices?e.Zoho.invoices:[],e.Zoho.code!=200&&(e.Zoho.code==401?this.modalTitle="Trial Customer":e.Zoho.code==400&&(this.modalTitle="your account customer"),e.Zoho.message==null?this.modalBody=e.Zoho.message:this.modalBody=e.Zoho.message,this.matDialog.open(bt,{data:{title:this.modalTitle,body:this.modalBody}})),e.Zoho.invoices.forEach(a=>{(a.status=="sent"||a.status=="overdue")&&this.outstandingInvoiceCount++})}showToaster(e){var a="Payment Successful!";e>1&&(a+=`
4
4
  Please Log out and re-login if your account is currently suspended!`),this.toastr.success(a,F.Success)}payAllInvoice(){let e=0,a,l,s,E;this.data.Zoho.invoices.forEach(O=>{(O.status=="sent"||O.status=="overdue")&&(e+=O.total,l==null?(a=O.invoice_number,l=O.invoice_number.concat("$"+O.total+";"),s=O.invoice_id,E=O.invoice_id.concat("$"+O.total+";")):(a=a.concat("_"+O.invoice_number),l=l.concat(O.invoice_number.concat("$"+O.total+";")),s=s.concat(";"+O.invoice_id),E=E.concat(O.invoice_id.concat("$"+O.total)+";")))});let q={CustomerID:this.data.Zoho.invoices[0].customer_id,InvNumber:l,OrderID:a,GrossAmount:e,WHTPercentage:this.data.Zoho.WHTPercentage,VATEnabled:this.data.Zoho.VATEnabled,InvoiceID:E};this.httpService.post("/API/Subscription/GetSNAPTokenMultipleInvoice",q).subscribe(O=>{this.openSNAPDialog(O)})}paySingleInvoice(e){let a={InvNumber:e.invoice_number,GrossAmount:e.balance,WHTPercentage:this.data.Zoho.WHTPercentage,VATEnabled:this.data.Zoho.VATEnabled,InvoiceID:e.invoice_id,CustomerID:e.customer_id};this.httpService.post("/API/Subscription/GetSNAPToken",a).subscribe(l=>{this.openSNAPDialog(l)})}openSNAPDialog(e){let a=this.data.Account.SubscriptionStatus;snap.pay(e.token,{onSuccess:l=>{this.ngZone.run(()=>{this.showToaster(a),this.getData()})}})}onOpenCloseModal(){this.matDialog.open(Ae)}onOpenConfirmAdjustedModal(){this.matDialog.open(ht)}load(){this.loadOutlet=!0,this.getData()}static \u0275fac=function(a){return new(a||n)(u(pe),u(T),u(le),u(Ve),u($e),u(j))};static \u0275cmp=I({type:n,selectors:[["POS-my-subscription"]],features:[oe],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","hideSearchDropdown",4,"ngIf"],[3,"pageData","hideSearchBox","hideSearchDropdown"],["class","btn btn-success",3,"routerLink",4,"ngIf"],[1,"container-fluid","bg-light-gray"],[1,"row","pt-5","ms-3"],[1,"col-md-4"],[1,"card"],[1,"card-header","d-flex","justify-content-between"],[1,"fa-solid","fa-user"],[1,"card-body"],[1,"row"],[1,"col","pe-0","ps-3"],[1,"p-3","border","rounded","bg-light-gray","text-black"],[1,"fw-bold"],["class","mt-4 h6",4,"ngIf"],[1,"col","pe-3","ps-3"],[1,"mt-4","h6"],["class","col ps-0 pe-3",4,"ngIf"],["class","card",4,"ngIf"],[4,"ngIf"],[1,"fa-solid","fa-xmark-circle"],[1,"mt-4"],["type","button",1,"btn","btn-sm","btn-danger","py-2",3,"click"],[1,"col-md-8"],[1,"card-header","d-flex","justify-content-between","align-items-center"],[1,"fa","fa-location-dot"],[1,"text-body-secondary","h6"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"card-body","table-responsive"],[1,"table","mt-5"],[1,"thead-light","sticky-top-thead"],[2,"width","20px"],[1,"text-end",2,"width","100px"],[1,"text-end",2,"width","120px"],["class","border",4,"ngFor","ngForOf"],[1,"btn","btn-success",3,"routerLink"],[1,"col","ps-0","pe-3"],[1,"p-3","border","rounded","bg-success","text-white"],[1,"text-center"],[1,"text-center",2,"width","104px"],[1,"text-center","align-top"],["class","text-danger",4,"ngIf"],[1,"text-danger"],[1,"btn-group"],["type","button",1,"btn","btn-sm","btn-success","py-2",3,"click"],[1,"fa-solid","fa-file-circle-plus"],[1,"table-sm","table-borderless"],[2,"width","103px"],["target","_blank",1,"btn","btn-light","btn-sm",2,"height","32px",3,"href"],[1,"fa","fa-upload"],[1,"me-auto","d-sm-block"],[1,"d-inline"],[1,"fa-solid","fa-file-invoice"],["class","btn btn-success btn-sm","role","button","matTooltipPosition","above","matTooltip","Pay All",3,"click",4,"ngIf"],["id","tableGrid",1,"table","mt-5"],[2,"width","120px"],[2,"width","100px"],[1,"text-end"],[2,"width","60px"],[2,"width","80px"],["class","border",3,"style",4,"ngFor","ngForOf"],[1,"pt-3"],["role","button","matTooltipPosition","above","matTooltip","Pay All",1,"btn","btn-success","btn-sm",3,"click"],[1,"fa-lg","fa-solid","fa-arrows-rotate"],[1,"border"],["class","fst-italic text-warning",4,"ngIf"],[1,"text-uppercase"],[1,"d-flex","justify-content-between"],[1,"fst-italic","text-warning"],["target","_blank",3,"href"],[1,"fa-lg","fa-solid","fa-file-lines"],[1,"ms-3"],[2,"border-width","1px",3,"click","id"],[1,"btn","btn-outline-secondary",3,"click"]],template:function(a,l){a&1&&d(0,Eo,71,25,"mainpanel-cmp",0),a&2&&m("ngIf",l.data)},dependencies:[$,N,Ie,X,be,ae,Z,lt,fi,pt]})};function To(n,p){n&1&&(i(0,"div",13)(1,"h5",14),h(2,"i",15),o(3," You are not listening to any outlet. Please select one. "),t()())}function Do(n,p){if(n&1&&(i(0,"div",16)(1,"h5",14),h(2,"i",15),o(3),t()()),n&2){let e=c(2);r(3),v(" You are currently listening to ",e.selectedOutlet==null?null:e.selectedOutlet.Name,". ")}}function Po(n,p){if(n&1&&(i(0,"div",9)(1,"div",10),d(2,To,4,0,"div",11)(3,Do,4,1,"div",12),t()()),n&2){let e=c();r(2),m("ngIf",!e.selectedOutlet),r(),m("ngIf",e.selectedOutlet)}}var St=class n{constructor(p,e,a,l){this.signalrClientService=p;this.httpService=e;this.dialogRef=a;this.toastr=l;this.modalConfig=new Y,this.modalConfig.title="Subscribe Notification",this.modalConfig.customWidth="475px",this.initModalLoader(),this.touchOnSelectOption=!1}modalConfig;entities;outletID;selectedOutlet;initialOutlet;touchOnSelectOption;previousSelectedOutlet;initModalLoader(){this.httpService.post("/api/NotificationLoader/PushNotificationList").pipe(ce(p=>H.IsNotEmpty(p))).subscribe(p=>{this.entities=p.Options.Entities,H.IsNotEmpty(p.SubscribeOn)&&(this.outletID=p.SubscribeOn),this.initSelectedOutlet()})}initSelectedOutlet(){this.selectedOutlet=this.findOutletByID(this.outletID),this.previousSelectedOutlet=this.selectedOutlet,this.initialOutlet=this.selectedOutlet,this.checkValidateButtonOk()}checkValidateButtonOk(){this.modalConfig.validated=!0,H.IsEmpty(this.selectedOutlet)&&(this.modalConfig.validated=!1)}onSelectOutlet(p){this.previousSelectedOutlet=this.selectedOutlet,this.selectedOutlet=p,this.modalConfig.validated=!0}onOpenSelectOutlet(){this.touchOnSelectOption=!0}onCancel(){this.dialogRef.close()}onOk(){let p=this.initialOutlet?this.initialOutlet.ID:null;this.outletID!==p?H.IsNotEmpty(this.outletID)?this.subscribeToPushNotification(`Listening to ${this.selectedOutlet?.Name}`,"Push Notification Enabled"):this.unsubscribeToPushNotification():this.dialogRef.close()}unsubscribeToPushNotification(){this.subscribeToPushNotification(`You are no longer listening to ${this.previousSelectedOutlet?.Name}`,"Push Notification Disabled"),this.setLocalStorage(!0)}subscribeToPushNotification(p,e){let a=localStorage.getItem("PushNotificationID"),l={EntityID:this.outletID};this.httpService.post("/api/PushNotification/Subscribe",l).subscribe(s=>{this.signalrClientService.SubscribeGroup(this.outletID?this.outletID:"",a),this.setLocalStorage(),this.toastr.success(p,e),this.dialogRef.close()})}setLocalStorage(p=!1){p?localStorage.removeItem("NotificationOutletID"):localStorage.setItem("NotificationOutletID",this.outletID)}findOutletByID(p){return this.entities.find(a=>a.ID==p)}static \u0275fac=function(e){return new(e||n)(u(ni),u(T),u(Q),u(j))};static \u0275cmp=I({type:n,selectors:[["POS-modal-subscribe-notification"]],decls:11,vars:4,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container"],["class","row",4,"ngIf"],[1,"row","mt-1"],[1,"col-md-2"],[1,"pt-10"],[1,"col-md-10"],[1,"form-floating-outline","selected"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose an Options","id","outlet",1,"productform",3,"open","clear","ngModelChange","change","items","ngModel"],[1,"row"],[1,"col-12"],["class","alert alert-danger",4,"ngIf"],["class","alert alert-success",4,"ngIf"],[1,"alert","alert-danger"],[1,"d-flex"],["aria-hidden","true",1,"fa-solid","fa-circle-info","me-3","mt-1"],[1,"alert","alert-success"]],template:function(e,a){e&1&&(i(0,"modal-material",0),x("onOk",function(){return a.onOk()})("onCancel",function(){return a.onCancel()})("onClose",function(){return a.onCancel()}),i(1,"content")(2,"div",1),d(3,Po,4,2,"div",2),i(4,"div",3)(5,"div",4)(6,"h5",5),o(7,"Outlet"),t()(),i(8,"div",6)(9,"div",7)(10,"ng-select",8),x("open",function(){return a.onOpenSelectOutlet()})("clear",function(){return a.onOpenSelectOutlet()}),w("ngModelChange",function(s){return M(a.outletID,s)||(a.outletID=s),s}),x("change",function(s){return a.onSelectOutlet(s)}),t()()()()()()()),e&2&&(m("config",a.modalConfig),r(3),m("ngIf",!a.touchOnSelectOption),r(7),m("items",a.entities),y("ngModel",a.outletID))},dependencies:[N,A,V,K,ke]})};var ko=n=>({ID:n});function No(n,p){if(n&1&&(i(0,"a",18),o(1),t()),n&2){let e=c().$implicit;m("routerLink","/menu"+e.URL)("queryParams",U(3,ko,e.ObjectID)),r(),v(" ",e.Body," ")}}function Fo(n,p){if(n&1&&(i(0,"a",19),o(1),t()),n&2){let e=c().$implicit;Le("href",e.URL,xe),r(),v(" ",e.Body," ")}}function Ao(n,p){if(n&1&&(i(0,"tr",15)(1,"td"),o(2),t(),i(3,"td")(4,"b"),o(5),t(),h(6,"br"),i(7,"span"),d(8,No,2,5,"a",16)(9,Fo,2,2,"a",17),t()(),i(10,"td"),o(11),f(12,"date"),t(),i(13,"td"),o(14),t()()),n&2){let e=p.$implicit;r(2),_(e.OutletName),r(3),_(e.Header),r(3),m("ngIf",e.ObjectIDType>0),r(),m("ngIf",e.ObjectIDType==0),r(2),_(D(12,6,e.Created,"dd MMM yyyy HH:mm")),r(3),_(e.TypeString)}}function Vo(n,p){if(n&1){let e=C();i(0,"mat-paginator",20),x("page",function(l){g(e);let s=c(2);return b(s.onPaginationChange(l))}),t()}if(n&2){let e=c(2);m("length",e.pagination.listTotal)("pageSize",e.pagination.pageSize)("pageIndex",e.pageData.Filter.PageNumber==0?0:e.pageData.Filter.PageNumber-1)}}function Ro(n,p){if(n&1){let e=C();i(0,"mainpanel-cmp",1),x("onSubmit",function(){g(e);let l=c();return b(l.searchFromPageOne())}),i(1,"actions")(2,"a",2),x("click",function(){g(e);let l=c();return b(l.openSubscribeModal())}),o(3,"Subscribe"),t()(),i(4,"filters")(5,"div",3)(6,"div",4)(7,"div")(8,"h6"),o(9,"Outlet"),t(),i(10,"ng-select",5),w("ngModelChange",function(l){g(e);let s=c();return M(s.pageData.Filter.ListIDs,l)||(s.pageData.Filter.ListIDs=l),b(l)}),t()(),i(11,"div")(12,"h6"),o(13,"From"),t(),i(14,"datepicker",6),w("dateChange",function(l){g(e);let s=c();return M(s.pageData.Filter.From,l)||(s.pageData.Filter.From=l),b(l)}),t()(),i(15,"div")(16,"h6"),o(17,"To"),t(),i(18,"datepicker",7),w("dateChange",function(l){g(e);let s=c();return M(s.pageData.Filter.To,l)||(s.pageData.Filter.To=l),b(l)}),t()()()()(),i(19,"content")(20,"div",8)(21,"table",9)(22,"thead",10)(23,"tr",11)(24,"th",12),o(25,"Outlet"),t(),i(26,"th"),o(27,"Message"),t(),i(28,"th"),o(29,"Created"),t(),i(30,"th"),o(31,"Type"),t()()(),i(32,"tbody"),d(33,Ao,15,9,"tr",13),t()(),i(34,"div"),d(35,Vo,1,3,"mat-paginator",14),t()()()()}if(n&2){let e=c();m("pageData",e.menuData)("hideSearchBox",!0),r(10),m("items",e.pageData.Options.Entities),y("ngModel",e.pageData.Filter.ListIDs),m("multiple",!0),r(4),y("date",e.pageData.Filter.From),r(4),y("date",e.pageData.Filter.To),r(15),m("ngForOf",e.data.Data),r(2),m("ngIf",e.pagination.listTotal>0)}}var vt=class n extends Oe{constructor(e,a,l){super(e,a,"v3/notification/WithTotalCount","NotificationLoader/PushNotificationList");this.dialog=l}preInitList(){let e=new Date;e.setHours(0,0,0,0);let a=new Date;a.setHours(23,59,59,59),this.pageData.Filter.From=e,this.pageData.Filter.To=a}openSubscribeModal(){this.dialog.open(St)}static \u0275fac=function(a){return new(a||n)(u(pe),u(T),u(le))};static \u0275cmp=I({type:n,selectors:[["POS-notification"]],features:[oe],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"onSubmit","pageData","hideSearchBox"],["role","button",1,"btn","btn-success",3,"click"],[1,"d-flex"],["container",""],["bindLabel","Name","bindValue","ID",3,"ngModelChange","items","ngModel","multiple"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[1,"header"],[2,"width","200px"],["class","border-bottom",4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page",4,"ngIf"],[1,"border-bottom"],["target","_blank",3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],["target","_blank",3,"routerLink","queryParams"],["target","_blank",3,"href"],[3,"page","length","pageSize","pageIndex"]],template:function(a,l){a&1&&d(0,Ro,36,9,"mainpanel-cmp",0),a&2&&m("ngIf",l.data)},dependencies:[$,N,A,V,Ie,X,at,Ne,ke,Z]})};var me=class n{_loadSubscriptionData=new Ue(null);loadSubscriptionData$=this._loadSubscriptionData.asObservable();subscriptionData$;lastUnpaidInvoiceDate$;constructor(p){this.subscriptionData$=this.loadSubscriptionData$.pipe(te(()=>p.get("/API/Subscription/GetInitialData").pipe(ze(e=>{let a=0;e.Subscription?.SubscriptionState=="Overdue"?a=1:e.Subscription?.SubscriptionState=="Sell Only"?a=2:e.Subscription?.SubscriptionState=="Suspended"&&(a=3),H.IsNotEmpty(e.Subscription)&&(e.Subscription.SubscriptionStatus=a)}))),Ze(1)),this.lastUnpaidInvoiceDate$=this.subscriptionData$.pipe(se(e=>e.invoices.filter(a=>(a.status=="sent"||a.status=="overdue")&&a.currency_code=="IDR")),se(e=>e.length>0?e[0].date:"-"))}loadSubscriptionData(){this._loadSubscriptionData.next()}static \u0275fac=function(e){return new(e||n)(ne(T))};static \u0275prov=_e({token:n,factory:n.\u0275fac,providedIn:"root"})};var Re=class n{constructor(p,e){p.subscriptionData$.pipe(ce(l=>l.code!=200),te(()=>Wt(e.navigate(["/menu/Profile/Main/My_Subscription/Choose_your_plan"])))).subscribe()}static \u0275fac=function(e){return new(e||n)(ne(me),ne(Se))};static \u0275prov=_e({token:n,factory:n.\u0275fac,providedIn:"root"})};var Ce=class n{outlets$;from$;to$;_isLoadOutlet=new Ue(!1);isLoadOutlet$=this._isLoadOutlet.asObservable().pipe(ce(p=>p));showLoadButton$;constructor(p,e){let a=this.isLoadOutlet$.pipe(te(()=>p.post("/API/Subscription/GetUsage").pipe()),Ze(1));this.outlets$=a.pipe(se(l=>l.Outlets)),this.from$=a.pipe(se(l=>l.From)),this.to$=a.pipe(se(l=>l.To)),e.subscriptionData$.pipe(ce(l=>l.Subscription?.OutletCount<=He.outletMaximumSubscription),ze(()=>this.loadOutlet())).subscribe(),this.showLoadButton$=Ut(e.subscriptionData$.pipe(se(l=>l.Subscription?.OutletCount>He.outletMaximumSubscription),Zt(1)),a.pipe(se(()=>!1)))}loadOutlet(){this._isLoadOutlet.next(!0)}static \u0275fac=function(e){return new(e||n)(ne(T),ne(me))};static \u0275prov=_e({token:n,factory:n.\u0275fac,providedIn:"root"})};var yt=class n{constructor(p,e,a){this.http=p;this.ngZone=e;this.toastr=a}payInvoice(p,e,a,l){let s={InvNumber:p.invoice_number,GrossAmount:p.balance,WHTPercentage:e,VATEnabled:a,InvoiceID:p.invoice_id,CustomerID:p.customer_id};return this.http.post("/API/Subscription/GetSNAPToken",s).pipe(te(E=>this.openSNAPDialog(E,l)))}payAllInvoices(p,e,a,l){let s=0,E,q,O,fe;p.forEach(G=>{(G.status=="sent"||G.status=="overdue")&&(s+=G.total,q==null?(E=G.invoice_number,q=G.invoice_number.concat("$"+G.total+";"),O=G.invoice_id,fe=G.invoice_id.concat("$"+G.total+";")):(E=E.concat("_"+G.invoice_number),q=q.concat(G.invoice_number.concat("$"+G.total+";")),O=O.concat(";"+G.invoice_id),fe=fe.concat(G.invoice_id.concat("$"+G.total)+";")))});let Be={CustomerID:p[0].customer_id,InvNumber:q,OrderID:E,GrossAmount:s,WHTPercentage:e,VATEnabled:a,InvoiceID:fe};return this.http.post("/API/Subscription/GetSNAPTokenMultipleInvoice",Be).pipe(te(G=>this.openSNAPDialog(G,l)))}openSNAPDialog(p,e){let a=e;return new We(l=>{snap.pay(p.token,{onSuccess:()=>{this.ngZone.run(()=>{this.showToaster(a),l.next(),l.complete()})}})})}showToaster(p){let e="Payment Successful!";p>1&&(e+=`
@@ -1 +1 @@
1
- import{e as Ge,f as Ye,h as Xe}from"./chunk-BI74RYMH.js";import{B as Fe,F as Ve,H as Pe,L as Le,M as We,aa as X,ba as U,ca as $,da as je,f as G,ga as Z,ha as Be,ma as Ke,q as De,r as Y,ra as qe,sa as ze,t as Re,ua as Ne,va as He,wa as Qe,xa as J}from"./chunk-R5NLMT6O.js";import{e as xe,g as Ae,k as Te,s as Ee}from"./chunk-7UM6XERA.js";import{$ as h,Ac as Me,B as O,Bb as B,Bc as v,Bd as Ie,C as V,Ca as S,Cc as N,Da as pe,Eb as M,Ga as me,Gb as g,Hb as ye,Ib as K,K as ae,Lc as Oe,N as ne,Nb as x,Ob as A,Pb as f,Qb as y,Sa as u,Ta as s,Ub as ve,Vb as q,Wb as z,X as P,Y as L,_c as we,c as C,cc as be,db as ue,dc as Ce,eb as k,ga as re,ha as w,hb as I,ib as W,ja as se,kb as _e,na as oe,nb as ge,oa as le,qb as j,qd as H,r as F,rd as Q,ta as ce,ua as p,ud as T,va as m,vb as c,vd as Se,w as ie,wa as de,wb as _,xb as fe,xd as E,za as he,zd as ke}from"./chunk-ZCFRJGRH.js";var dt=["trigger"],ht=["panel"],pt=[[["mat-select-trigger"]],"*"],mt=["mat-select-trigger","*"];function ut(n,b){if(n&1&&(c(0,"span",4),q(1),_()),n&2){let e=g();u(),z(e.placeholder)}}function _t(n,b){n&1&&K(0)}function gt(n,b){if(n&1&&(c(0,"span",11),q(1),_()),n&2){let e=g(2);u(),z(e.triggerValue)}}function ft(n,b){if(n&1&&(c(0,"span",5),k(1,_t,1,0)(2,gt,2,1,"span",11),_()),n&2){let e=g();u(),j(e.customTrigger?1:2)}}function yt(n,b){if(n&1){let e=B();c(0,"div",12,1),M("@transformPanel.done",function(i){p(e);let a=g();return m(a._panelDoneAnimatingStream.next(i.toState))})("keydown",function(i){p(e);let a=g();return m(a._handleKeydown(i))}),K(2,1),_()}if(n&2){let e=g();ge("mat-mdc-select-panel mdc-menu-surface mdc-menu-surface--open ",e._getPanelTheme(),""),W("ngClass",e.panelClass)("@transformPanel","showing"),I("id",e.id+"-panel")("aria-multiselectable",e.multiple)("aria-label",e.ariaLabel||null)("aria-labelledby",e._getPanelAriaLabelledby())}}var vt={transformPanelWrap:H("transformPanelWrap",[E("* => void",Ie("@transformPanel",[ke()],{optional:!0}))]),transformPanel:H("transformPanel",[Se("void",T({opacity:0,transform:"scale(1, 0.8)"})),E("void => showing",Q("120ms cubic-bezier(0, 0, 0.2, 1)",T({opacity:1,transform:"scale(1, 1)"}))),E("* => void",Q("100ms linear",T({opacity:0})))])};var et=0,tt=new w("mat-select-scroll-strategy",{providedIn:"root",factory:()=>{let n=se(X);return()=>n.scrollStrategies.reposition()}});function bt(n){return()=>n.scrollStrategies.reposition()}var Ct=new w("MAT_SELECT_CONFIG"),Mt={provide:tt,deps:[X],useFactory:bt},Ot=new w("MatSelectTrigger"),ee=class{constructor(b,e){this.source=b,this.value=e}},ni=(()=>{class n{_scrollOptionIntoView(e){let t=this.options.toArray()[e];if(t){let i=this.panel.nativeElement,a=He(e,this.options,this.optionGroups),r=t._getHostElement();e===0&&a===1?i.scrollTop=0:i.scrollTop=Qe(r.offsetTop,r.offsetHeight,i.scrollTop,i.offsetHeight)}}_positioningSettled(){this._scrollOptionIntoView(this._keyManager.activeItemIndex||0)}_getChangeEvent(e){return new ee(this,e)}get focused(){return this._focused||this._panelOpen}get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties()}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.stateChanges.next()}get required(){return this._required??this.ngControl?.control?.hasValidator(xe.required)??!1}set required(e){this._required=e,this.stateChanges.next()}get multiple(){return this._multiple}set multiple(e){this._selectionModel,this._multiple=e}get compareWith(){return this._compareWith}set compareWith(e){this._compareWith=e,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(e){this._assignValue(e)&&this._onChange(e)}get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(e){this._errorStateTracker.matcher=e}get id(){return this._id}set id(e){this._id=e||this._uid,this.stateChanges.next()}get errorState(){return this._errorStateTracker.errorState}set errorState(e){this._errorStateTracker.errorState=e}constructor(e,t,i,a,r,d,o,it,at,te,nt,rt,st,D){this._viewportRuler=e,this._changeDetectorRef=t,this._elementRef=r,this._dir=d,this._parentFormField=at,this.ngControl=te,this._liveAnnouncer=st,this._defaultOptions=D,this._positions=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"}],this._panelOpen=!1,this._compareWith=(l,R)=>l===R,this._uid=`mat-select-${et++}`,this._triggerAriaLabelledBy=null,this._destroy=new C,this.stateChanges=new C,this.disableAutomaticLabeling=!0,this._onChange=()=>{},this._onTouched=()=>{},this._valueId=`mat-select-value-${et++}`,this._panelDoneAnimatingStream=new C,this._overlayPanelClass=this._defaultOptions?.overlayPanelClass||"",this._focused=!1,this.controlType="mat-select",this.disabled=!1,this.disableRipple=!1,this.tabIndex=0,this._hideSingleSelectionIndicator=this._defaultOptions?.hideSingleSelectionIndicator??!1,this._multiple=!1,this.disableOptionCentering=this._defaultOptions?.disableOptionCentering??!1,this.ariaLabel="",this.panelWidth=this._defaultOptions&&typeof this._defaultOptions.panelWidth<"u"?this._defaultOptions.panelWidth:"auto",this._initialized=new C,this.optionSelectionChanges=ie(()=>{let l=this.options;return l?l.changes.pipe(P(l),L(()=>O(...l.map(R=>R.onSelectionChange)))):this._initialized.pipe(L(()=>this.optionSelectionChanges))}),this.openedChange=new S,this._openedStream=this.openedChange.pipe(V(l=>l),F(()=>{})),this._closedStream=this.openedChange.pipe(V(l=>!l),F(()=>{})),this.selectionChange=new S,this.valueChange=new S,this._trackedModal=null,this._skipPredicate=l=>this.panelOpen?!1:l.disabled,this.ngControl&&(this.ngControl.valueAccessor=this),D?.typeaheadDebounceInterval!=null&&(this.typeaheadDebounceInterval=D.typeaheadDebounceInterval),this._errorStateTracker=new Be(a,te,it,o,this.stateChanges),this._scrollStrategyFactory=rt,this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=parseInt(nt)||0,this.id=this.id}ngOnInit(){this._selectionModel=new Pe(this.multiple),this.stateChanges.next(),this._panelDoneAnimatingStream.pipe(ne(),h(this._destroy)).subscribe(()=>this._panelDoneAnimating(this.panelOpen)),this._viewportRuler.change().pipe(h(this._destroy)).subscribe(()=>{this.panelOpen&&(this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._changeDetectorRef.detectChanges())})}ngAfterContentInit(){this._initialized.next(),this._initialized.complete(),this._initKeyManager(),this._selectionModel.changed.pipe(h(this._destroy)).subscribe(e=>{e.added.forEach(t=>t.select()),e.removed.forEach(t=>t.deselect())}),this.options.changes.pipe(P(null),h(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection()})}ngDoCheck(){let e=this._getTriggerAriaLabelledby(),t=this.ngControl;if(e!==this._triggerAriaLabelledBy){let i=this._elementRef.nativeElement;this._triggerAriaLabelledBy=e,e?i.setAttribute("aria-labelledby",e):i.removeAttribute("aria-labelledby")}t&&(this._previousControl!==t.control&&(this._previousControl!==void 0&&t.disabled!==null&&t.disabled!==this.disabled&&(this.disabled=t.disabled),this._previousControl=t.control),this.updateErrorState())}ngOnChanges(e){(e.disabled||e.userAriaDescribedBy)&&this.stateChanges.next(),e.typeaheadDebounceInterval&&this._keyManager&&this._keyManager.withTypeAhead(this.typeaheadDebounceInterval)}ngOnDestroy(){this._keyManager?.destroy(),this._destroy.next(),this._destroy.complete(),this.stateChanges.complete(),this._clearFromModal()}toggle(){this.panelOpen?this.close():this.open()}open(){this._canOpen()&&(this._parentFormField&&(this._preferredOverlayOrigin=this._parentFormField.getConnectedOverlayOrigin()),this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._applyModalPanelOwnership(),this._panelOpen=!0,this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck(),this.stateChanges.next())}_applyModalPanelOwnership(){let e=this._elementRef.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');if(!e)return;let t=`${this.id}-panel`;this._trackedModal&&Y(this._trackedModal,"aria-owns",t),De(e,"aria-owns",t),this._trackedModal=e}_clearFromModal(){if(!this._trackedModal)return;let e=`${this.id}-panel`;Y(this._trackedModal,"aria-owns",e),this._trackedModal=null}close(){this._panelOpen&&(this._panelOpen=!1,this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched(),this.stateChanges.next())}writeValue(e){this._assignValue(e)}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck(),this.stateChanges.next()}get panelOpen(){return this._panelOpen}get selected(){return this.multiple?this._selectionModel?.selected||[]:this._selectionModel?.selected[0]}get triggerValue(){if(this.empty)return"";if(this._multiple){let e=this._selectionModel.selected.map(t=>t.viewValue);return this._isRtl()&&e.reverse(),e.join(", ")}return this._selectionModel.selected[0].viewValue}updateErrorState(){this._errorStateTracker.updateErrorState()}_isRtl(){return this._dir?this._dir.value==="rtl":!1}_handleKeydown(e){this.disabled||(this.panelOpen?this._handleOpenKeydown(e):this._handleClosedKeydown(e))}_handleClosedKeydown(e){let t=e.keyCode,i=t===40||t===38||t===37||t===39,a=t===13||t===32,r=this._keyManager;if(!r.isTyping()&&a&&!G(e)||(this.multiple||e.altKey)&&i)e.preventDefault(),this.open();else if(!this.multiple){let d=this.selected;r.onKeydown(e);let o=this.selected;o&&d!==o&&this._liveAnnouncer.announce(o.viewValue,1e4)}}_handleOpenKeydown(e){let t=this._keyManager,i=e.keyCode,a=i===40||i===38,r=t.isTyping();if(a&&e.altKey)e.preventDefault(),this.close();else if(!r&&(i===13||i===32)&&t.activeItem&&!G(e))e.preventDefault(),t.activeItem._selectViaInteraction();else if(!r&&this._multiple&&i===65&&e.ctrlKey){e.preventDefault();let d=this.options.some(o=>!o.disabled&&!o.selected);this.options.forEach(o=>{o.disabled||(d?o.select():o.deselect())})}else{let d=t.activeItemIndex;t.onKeydown(e),this._multiple&&a&&e.shiftKey&&t.activeItem&&t.activeItemIndex!==d&&t.activeItem._selectViaInteraction()}}_onFocus(){this.disabled||(this._focused=!0,this.stateChanges.next())}_onBlur(){this._focused=!1,this._keyManager?.cancelTypeahead(),!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next())}_onAttached(){this._overlayDir.positionChange.pipe(ae(1)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this._positioningSettled()})}_getPanelTheme(){return this._parentFormField?`mat-${this._parentFormField.color}`:""}get empty(){return!this._selectionModel||this._selectionModel.isEmpty()}_initializeSelection(){Promise.resolve().then(()=>{this.ngControl&&(this._value=this.ngControl.value),this._setSelectionByValue(this._value),this.stateChanges.next()})}_setSelectionByValue(e){if(this.options.forEach(t=>t.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&e)Array.isArray(e),e.forEach(t=>this._selectOptionByValue(t)),this._sortValues();else{let t=this._selectOptionByValue(e);t?this._keyManager.updateActiveItem(t):this.panelOpen||this._keyManager.updateActiveItem(-1)}this._changeDetectorRef.markForCheck()}_selectOptionByValue(e){let t=this.options.find(i=>{if(this._selectionModel.isSelected(i))return!1;try{return i.value!=null&&this._compareWith(i.value,e)}catch{return!1}});return t&&this._selectionModel.select(t),t}_assignValue(e){return e!==this._value||this._multiple&&Array.isArray(e)?(this.options&&this._setSelectionByValue(e),this._value=e,!0):!1}_getOverlayWidth(e){return this.panelWidth==="auto"?(e instanceof U?e.elementRef:e||this._elementRef).nativeElement.getBoundingClientRect().width:this.panelWidth===null?"":this.panelWidth}_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck()}_initKeyManager(){this._keyManager=new Re(this.options).withTypeAhead(this.typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withPageUpDown().withAllowedModifierKeys(["shiftKey"]).skipPredicate(this._skipPredicate),this._keyManager.tabOut.subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close())}),this._keyManager.change.subscribe(()=>{this._panelOpen&&this.panel?this._scrollOptionIntoView(this._keyManager.activeItemIndex||0):!this._panelOpen&&!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction()})}_resetOptions(){let e=O(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(h(e)).subscribe(t=>{this._onSelect(t.source,t.isUserInput),t.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus())}),O(...this.options.map(t=>t._stateChanges)).pipe(h(e)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this.stateChanges.next()})}_onSelect(e,t){let i=this._selectionModel.isSelected(e);e.value==null&&!this._multiple?(e.deselect(),this._selectionModel.clear(),this.value!=null&&this._propagateChanges(e.value)):(i!==e.selected&&(e.selected?this._selectionModel.select(e):this._selectionModel.deselect(e)),t&&this._keyManager.setActiveItem(e),this.multiple&&(this._sortValues(),t&&this.focus())),i!==this._selectionModel.isSelected(e)&&this._propagateChanges(),this.stateChanges.next()}_sortValues(){if(this.multiple){let e=this.options.toArray();this._selectionModel.sort((t,i)=>this.sortComparator?this.sortComparator(t,i,e):e.indexOf(t)-e.indexOf(i)),this.stateChanges.next()}}_propagateChanges(e){let t;this.multiple?t=this.selected.map(i=>i.value):t=this.selected?this.selected.value:e,this._value=t,this.valueChange.emit(t),this._onChange(t),this.selectionChange.emit(this._getChangeEvent(t)),this._changeDetectorRef.markForCheck()}_highlightCorrectOption(){if(this._keyManager)if(this.empty){let e=-1;for(let t=0;t<this.options.length;t++)if(!this.options.get(t).disabled){e=t;break}this._keyManager.setActiveItem(e)}else this._keyManager.setActiveItem(this._selectionModel.selected[0])}_canOpen(){return!this._panelOpen&&!this.disabled&&this.options?.length>0}focus(e){this._elementRef.nativeElement.focus(e)}_getPanelAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId(),t=e?e+" ":"";return this.ariaLabelledby?t+this.ariaLabelledby:e}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId(),t=(e?e+" ":"")+this._valueId;return this.ariaLabelledby&&(t+=" "+this.ariaLabelledby),t}_panelDoneAnimating(e){this.openedChange.emit(e)}setDescribedByIds(e){e.length?this._elementRef.nativeElement.setAttribute("aria-describedby",e.join(" ")):this._elementRef.nativeElement.removeAttribute("aria-describedby")}onContainerClick(){this.focus(),this.open()}get shouldLabelFloat(){return this.panelOpen||!this.empty||this.focused&&!!this.placeholder}static{this.\u0275fac=function(t){return new(t||n)(s(Le),s(Me),s(pe),s(Ke),s(me),s(Ve,8),s(Te,8),s(Ee,8),s(Ye,8),s(Ae,10),he("tabindex"),s(tt),s(Fe),s(Ct,8))}}static{this.\u0275cmp=oe({type:n,selectors:[["mat-select"]],contentQueries:function(t,i,a){if(t&1&&(x(a,Ot,5),x(a,Ne,5),x(a,ze,5)),t&2){let r;f(r=y())&&(i.customTrigger=r.first),f(r=y())&&(i.options=r),f(r=y())&&(i.optionGroups=r)}},viewQuery:function(t,i){if(t&1&&(A(dt,5),A(ht,5),A($,5)),t&2){let a;f(a=y())&&(i.trigger=a.first),f(a=y())&&(i.panel=a.first),f(a=y())&&(i._overlayDir=a.first)}},hostAttrs:["role","combobox","aria-haspopup","listbox",1,"mat-mdc-select"],hostVars:19,hostBindings:function(t,i){t&1&&M("keydown",function(r){return i._handleKeydown(r)})("focus",function(){return i._onFocus()})("blur",function(){return i._onBlur()}),t&2&&(I("id",i.id)("tabindex",i.disabled?-1:i.tabIndex)("aria-controls",i.panelOpen?i.id+"-panel":null)("aria-expanded",i.panelOpen)("aria-label",i.ariaLabel||null)("aria-required",i.required.toString())("aria-disabled",i.disabled.toString())("aria-invalid",i.errorState)("aria-activedescendant",i._getAriaActiveDescendant()),_e("mat-mdc-select-disabled",i.disabled)("mat-mdc-select-invalid",i.errorState)("mat-mdc-select-required",i.required)("mat-mdc-select-empty",i.empty)("mat-mdc-select-multiple",i.multiple))},inputs:{userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],panelClass:"panelClass",disabled:[2,"disabled","disabled",v],disableRipple:[2,"disableRipple","disableRipple",v],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:N(e)],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",v],placeholder:"placeholder",required:[2,"required","required",v],multiple:[2,"multiple","multiple",v],disableOptionCentering:[2,"disableOptionCentering","disableOptionCentering",v],compareWith:"compareWith",value:"value",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",typeaheadDebounceInterval:[2,"typeaheadDebounceInterval","typeaheadDebounceInterval",N],sortComparator:"sortComparator",id:"id",panelWidth:"panelWidth"},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},exportAs:["matSelect"],standalone:!0,features:[be([{provide:Ge,useExisting:n},{provide:qe,useExisting:n}]),ue,ce,Ce],ngContentSelectors:mt,decls:11,vars:8,consts:[["fallbackOverlayOrigin","cdkOverlayOrigin","trigger",""],["panel",""],["cdk-overlay-origin","",1,"mat-mdc-select-trigger",3,"click"],[1,"mat-mdc-select-value"],[1,"mat-mdc-select-placeholder","mat-mdc-select-min-line"],[1,"mat-mdc-select-value-text"],[1,"mat-mdc-select-arrow-wrapper"],[1,"mat-mdc-select-arrow"],["viewBox","0 0 24 24","width","24px","height","24px","focusable","false","aria-hidden","true"],["d","M7 10l5 5 5-5z"],["cdk-connected-overlay","","cdkConnectedOverlayLockPosition","","cdkConnectedOverlayHasBackdrop","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"backdropClick","attach","detach","cdkConnectedOverlayPanelClass","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayPositions","cdkConnectedOverlayWidth"],[1,"mat-mdc-select-min-line"],["role","listbox","tabindex","-1",3,"keydown","ngClass"]],template:function(t,i){if(t&1){let a=B();ye(pt),c(0,"div",2,0),M("click",function(){return p(a),m(i.open())}),c(3,"div",3),k(4,ut,2,1,"span",4)(5,ft,3,1,"span",5),_(),c(6,"div",6)(7,"div",7),de(),c(8,"svg",8),fe(9,"path",9),_()()()(),k(10,yt,3,9,"ng-template",10),M("backdropClick",function(){return p(a),m(i.close())})("attach",function(){return p(a),m(i._onAttached())})("detach",function(){return p(a),m(i.close())})}if(t&2){let a=ve(1);u(3),I("id",i._valueId),u(),j(i.empty?4:5),u(6),W("cdkConnectedOverlayPanelClass",i._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",i._scrollStrategy)("cdkConnectedOverlayOrigin",i._preferredOverlayOrigin||a)("cdkConnectedOverlayOpen",i.panelOpen)("cdkConnectedOverlayPositions",i._positions)("cdkConnectedOverlayWidth",i._overlayWidth)}},dependencies:[U,$,Oe],styles:['.mat-mdc-select{display:inline-block;width:100%;outline:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-select-enabled-trigger-text-color, var(--mat-app-on-surface));font-family:var(--mat-select-trigger-text-font, var(--mat-app-body-large-font));line-height:var(--mat-select-trigger-text-line-height, var(--mat-app-body-large-line-height));font-size:var(--mat-select-trigger-text-size, var(--mat-app-body-large-size));font-weight:var(--mat-select-trigger-text-weight, var(--mat-app-body-large-weight));letter-spacing:var(--mat-select-trigger-text-tracking, var(--mat-app-body-large-tracking))}div.mat-mdc-select-panel{box-shadow:var(--mat-select-container-elevation-shadow)}.mat-mdc-select-disabled{color:var(--mat-select-disabled-trigger-text-color)}.mat-mdc-select-trigger{display:inline-flex;align-items:center;cursor:pointer;position:relative;box-sizing:border-box;width:100%}.mat-mdc-select-disabled .mat-mdc-select-trigger{-webkit-user-select:none;user-select:none;cursor:default}.mat-mdc-select-value{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-mdc-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-mdc-select-arrow-wrapper{height:24px;flex-shrink:0;display:inline-flex;align-items:center}.mat-form-field-appearance-fill .mdc-text-field--no-label .mat-mdc-select-arrow-wrapper{transform:none}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-invalid .mat-mdc-select-arrow,.mat-form-field-invalid:not(.mat-form-field-disabled) .mat-mdc-form-field-infix::after{color:var(--mat-select-invalid-arrow-color, var(--mat-app-error))}.mat-mdc-select-arrow{width:10px;height:5px;position:relative;color:var(--mat-select-enabled-arrow-color, var(--mat-app-on-surface-variant))}.mat-mdc-form-field.mat-focused .mat-mdc-select-arrow{color:var(--mat-select-focused-arrow-color, var(--mat-app-primary))}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-disabled .mat-mdc-select-arrow{color:var(--mat-select-disabled-arrow-color)}.mat-mdc-select-arrow svg{fill:currentColor;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}.cdk-high-contrast-active .mat-mdc-select-arrow svg{fill:CanvasText}.mat-mdc-select-disabled .cdk-high-contrast-active .mat-mdc-select-arrow svg{fill:GrayText}div.mat-mdc-select-panel{width:100%;max-height:275px;outline:0;overflow:auto;padding:8px 0;border-radius:4px;box-sizing:border-box;position:static;background-color:var(--mat-select-panel-background-color, var(--mat-app-surface-container))}.cdk-high-contrast-active div.mat-mdc-select-panel{outline:solid 1px}.cdk-overlay-pane:not(.mat-mdc-select-panel-above) div.mat-mdc-select-panel{border-top-left-radius:0;border-top-right-radius:0;transform-origin:top center}.mat-mdc-select-panel-above div.mat-mdc-select-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:bottom center}div.mat-mdc-select-panel .mat-mdc-option{--mdc-list-list-item-container-color: var(--mat-select-panel-background-color)}.mat-mdc-select-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1);color:var(--mat-select-placeholder-text-color, var(--mat-app-on-surface-variant))}._mat-animation-noopable .mat-mdc-select-placeholder{transition:none}.mat-form-field-hide-placeholder .mat-mdc-select-placeholder{color:rgba(0,0,0,0);-webkit-text-fill-color:rgba(0,0,0,0);transition:none;display:block}.mat-mdc-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{cursor:pointer}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mat-mdc-floating-label{max-width:calc(100% - 18px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mdc-floating-label--float-above{max-width:calc(100%/0.75 - 24px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-notched-outline__notch{max-width:calc(100% - 60px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-text-field--label-floating .mdc-notched-outline__notch{max-width:calc(100% - 24px)}.mat-mdc-select-min-line:empty::before{content:" ";white-space:pre;width:1px;display:inline-block;visibility:hidden}.mat-form-field-appearance-fill .mat-mdc-select-arrow-wrapper{transform:var(--mat-select-arrow-transform)}'],encapsulation:2,data:{animation:[vt.transformPanel]},changeDetection:0})}}return n})();var ri=(()=>{class n{static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275mod=le({type:n})}static{this.\u0275inj=re({providers:[Mt],imports:[we,je,J,Z,We,Xe,J,Z]})}}return n})();export{ni as a,ri as b};
1
+ import{e as Ge,f as Ye,h as Xe}from"./chunk-AIORTWOA.js";import{B as Fe,F as Ve,H as Pe,L as Le,M as We,aa as X,ba as U,ca as $,da as je,f as G,ga as Z,ha as Be,ma as Ke,q as De,r as Y,ra as qe,sa as ze,t as Re,ua as Ne,va as He,wa as Qe,xa as J}from"./chunk-R5NLMT6O.js";import{e as xe,g as Ae,k as Te,s as Ee}from"./chunk-7UM6XERA.js";import{$ as h,Ac as Me,B as O,Bb as B,Bc as v,Bd as Ie,C as V,Ca as S,Cc as N,Da as pe,Eb as M,Ga as me,Gb as g,Hb as ye,Ib as K,K as ae,Lc as Oe,N as ne,Nb as x,Ob as A,Pb as f,Qb as y,Sa as u,Ta as s,Ub as ve,Vb as q,Wb as z,X as P,Y as L,_c as we,c as C,cc as be,db as ue,dc as Ce,eb as k,ga as re,ha as w,hb as I,ib as W,ja as se,kb as _e,na as oe,nb as ge,oa as le,qb as j,qd as H,r as F,rd as Q,ta as ce,ua as p,ud as T,va as m,vb as c,vd as Se,w as ie,wa as de,wb as _,xb as fe,xd as E,za as he,zd as ke}from"./chunk-ZCFRJGRH.js";var dt=["trigger"],ht=["panel"],pt=[[["mat-select-trigger"]],"*"],mt=["mat-select-trigger","*"];function ut(n,b){if(n&1&&(c(0,"span",4),q(1),_()),n&2){let e=g();u(),z(e.placeholder)}}function _t(n,b){n&1&&K(0)}function gt(n,b){if(n&1&&(c(0,"span",11),q(1),_()),n&2){let e=g(2);u(),z(e.triggerValue)}}function ft(n,b){if(n&1&&(c(0,"span",5),k(1,_t,1,0)(2,gt,2,1,"span",11),_()),n&2){let e=g();u(),j(e.customTrigger?1:2)}}function yt(n,b){if(n&1){let e=B();c(0,"div",12,1),M("@transformPanel.done",function(i){p(e);let a=g();return m(a._panelDoneAnimatingStream.next(i.toState))})("keydown",function(i){p(e);let a=g();return m(a._handleKeydown(i))}),K(2,1),_()}if(n&2){let e=g();ge("mat-mdc-select-panel mdc-menu-surface mdc-menu-surface--open ",e._getPanelTheme(),""),W("ngClass",e.panelClass)("@transformPanel","showing"),I("id",e.id+"-panel")("aria-multiselectable",e.multiple)("aria-label",e.ariaLabel||null)("aria-labelledby",e._getPanelAriaLabelledby())}}var vt={transformPanelWrap:H("transformPanelWrap",[E("* => void",Ie("@transformPanel",[ke()],{optional:!0}))]),transformPanel:H("transformPanel",[Se("void",T({opacity:0,transform:"scale(1, 0.8)"})),E("void => showing",Q("120ms cubic-bezier(0, 0, 0.2, 1)",T({opacity:1,transform:"scale(1, 1)"}))),E("* => void",Q("100ms linear",T({opacity:0})))])};var et=0,tt=new w("mat-select-scroll-strategy",{providedIn:"root",factory:()=>{let n=se(X);return()=>n.scrollStrategies.reposition()}});function bt(n){return()=>n.scrollStrategies.reposition()}var Ct=new w("MAT_SELECT_CONFIG"),Mt={provide:tt,deps:[X],useFactory:bt},Ot=new w("MatSelectTrigger"),ee=class{constructor(b,e){this.source=b,this.value=e}},ni=(()=>{class n{_scrollOptionIntoView(e){let t=this.options.toArray()[e];if(t){let i=this.panel.nativeElement,a=He(e,this.options,this.optionGroups),r=t._getHostElement();e===0&&a===1?i.scrollTop=0:i.scrollTop=Qe(r.offsetTop,r.offsetHeight,i.scrollTop,i.offsetHeight)}}_positioningSettled(){this._scrollOptionIntoView(this._keyManager.activeItemIndex||0)}_getChangeEvent(e){return new ee(this,e)}get focused(){return this._focused||this._panelOpen}get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties()}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.stateChanges.next()}get required(){return this._required??this.ngControl?.control?.hasValidator(xe.required)??!1}set required(e){this._required=e,this.stateChanges.next()}get multiple(){return this._multiple}set multiple(e){this._selectionModel,this._multiple=e}get compareWith(){return this._compareWith}set compareWith(e){this._compareWith=e,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(e){this._assignValue(e)&&this._onChange(e)}get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(e){this._errorStateTracker.matcher=e}get id(){return this._id}set id(e){this._id=e||this._uid,this.stateChanges.next()}get errorState(){return this._errorStateTracker.errorState}set errorState(e){this._errorStateTracker.errorState=e}constructor(e,t,i,a,r,d,o,it,at,te,nt,rt,st,D){this._viewportRuler=e,this._changeDetectorRef=t,this._elementRef=r,this._dir=d,this._parentFormField=at,this.ngControl=te,this._liveAnnouncer=st,this._defaultOptions=D,this._positions=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"}],this._panelOpen=!1,this._compareWith=(l,R)=>l===R,this._uid=`mat-select-${et++}`,this._triggerAriaLabelledBy=null,this._destroy=new C,this.stateChanges=new C,this.disableAutomaticLabeling=!0,this._onChange=()=>{},this._onTouched=()=>{},this._valueId=`mat-select-value-${et++}`,this._panelDoneAnimatingStream=new C,this._overlayPanelClass=this._defaultOptions?.overlayPanelClass||"",this._focused=!1,this.controlType="mat-select",this.disabled=!1,this.disableRipple=!1,this.tabIndex=0,this._hideSingleSelectionIndicator=this._defaultOptions?.hideSingleSelectionIndicator??!1,this._multiple=!1,this.disableOptionCentering=this._defaultOptions?.disableOptionCentering??!1,this.ariaLabel="",this.panelWidth=this._defaultOptions&&typeof this._defaultOptions.panelWidth<"u"?this._defaultOptions.panelWidth:"auto",this._initialized=new C,this.optionSelectionChanges=ie(()=>{let l=this.options;return l?l.changes.pipe(P(l),L(()=>O(...l.map(R=>R.onSelectionChange)))):this._initialized.pipe(L(()=>this.optionSelectionChanges))}),this.openedChange=new S,this._openedStream=this.openedChange.pipe(V(l=>l),F(()=>{})),this._closedStream=this.openedChange.pipe(V(l=>!l),F(()=>{})),this.selectionChange=new S,this.valueChange=new S,this._trackedModal=null,this._skipPredicate=l=>this.panelOpen?!1:l.disabled,this.ngControl&&(this.ngControl.valueAccessor=this),D?.typeaheadDebounceInterval!=null&&(this.typeaheadDebounceInterval=D.typeaheadDebounceInterval),this._errorStateTracker=new Be(a,te,it,o,this.stateChanges),this._scrollStrategyFactory=rt,this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=parseInt(nt)||0,this.id=this.id}ngOnInit(){this._selectionModel=new Pe(this.multiple),this.stateChanges.next(),this._panelDoneAnimatingStream.pipe(ne(),h(this._destroy)).subscribe(()=>this._panelDoneAnimating(this.panelOpen)),this._viewportRuler.change().pipe(h(this._destroy)).subscribe(()=>{this.panelOpen&&(this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._changeDetectorRef.detectChanges())})}ngAfterContentInit(){this._initialized.next(),this._initialized.complete(),this._initKeyManager(),this._selectionModel.changed.pipe(h(this._destroy)).subscribe(e=>{e.added.forEach(t=>t.select()),e.removed.forEach(t=>t.deselect())}),this.options.changes.pipe(P(null),h(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection()})}ngDoCheck(){let e=this._getTriggerAriaLabelledby(),t=this.ngControl;if(e!==this._triggerAriaLabelledBy){let i=this._elementRef.nativeElement;this._triggerAriaLabelledBy=e,e?i.setAttribute("aria-labelledby",e):i.removeAttribute("aria-labelledby")}t&&(this._previousControl!==t.control&&(this._previousControl!==void 0&&t.disabled!==null&&t.disabled!==this.disabled&&(this.disabled=t.disabled),this._previousControl=t.control),this.updateErrorState())}ngOnChanges(e){(e.disabled||e.userAriaDescribedBy)&&this.stateChanges.next(),e.typeaheadDebounceInterval&&this._keyManager&&this._keyManager.withTypeAhead(this.typeaheadDebounceInterval)}ngOnDestroy(){this._keyManager?.destroy(),this._destroy.next(),this._destroy.complete(),this.stateChanges.complete(),this._clearFromModal()}toggle(){this.panelOpen?this.close():this.open()}open(){this._canOpen()&&(this._parentFormField&&(this._preferredOverlayOrigin=this._parentFormField.getConnectedOverlayOrigin()),this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._applyModalPanelOwnership(),this._panelOpen=!0,this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck(),this.stateChanges.next())}_applyModalPanelOwnership(){let e=this._elementRef.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');if(!e)return;let t=`${this.id}-panel`;this._trackedModal&&Y(this._trackedModal,"aria-owns",t),De(e,"aria-owns",t),this._trackedModal=e}_clearFromModal(){if(!this._trackedModal)return;let e=`${this.id}-panel`;Y(this._trackedModal,"aria-owns",e),this._trackedModal=null}close(){this._panelOpen&&(this._panelOpen=!1,this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched(),this.stateChanges.next())}writeValue(e){this._assignValue(e)}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck(),this.stateChanges.next()}get panelOpen(){return this._panelOpen}get selected(){return this.multiple?this._selectionModel?.selected||[]:this._selectionModel?.selected[0]}get triggerValue(){if(this.empty)return"";if(this._multiple){let e=this._selectionModel.selected.map(t=>t.viewValue);return this._isRtl()&&e.reverse(),e.join(", ")}return this._selectionModel.selected[0].viewValue}updateErrorState(){this._errorStateTracker.updateErrorState()}_isRtl(){return this._dir?this._dir.value==="rtl":!1}_handleKeydown(e){this.disabled||(this.panelOpen?this._handleOpenKeydown(e):this._handleClosedKeydown(e))}_handleClosedKeydown(e){let t=e.keyCode,i=t===40||t===38||t===37||t===39,a=t===13||t===32,r=this._keyManager;if(!r.isTyping()&&a&&!G(e)||(this.multiple||e.altKey)&&i)e.preventDefault(),this.open();else if(!this.multiple){let d=this.selected;r.onKeydown(e);let o=this.selected;o&&d!==o&&this._liveAnnouncer.announce(o.viewValue,1e4)}}_handleOpenKeydown(e){let t=this._keyManager,i=e.keyCode,a=i===40||i===38,r=t.isTyping();if(a&&e.altKey)e.preventDefault(),this.close();else if(!r&&(i===13||i===32)&&t.activeItem&&!G(e))e.preventDefault(),t.activeItem._selectViaInteraction();else if(!r&&this._multiple&&i===65&&e.ctrlKey){e.preventDefault();let d=this.options.some(o=>!o.disabled&&!o.selected);this.options.forEach(o=>{o.disabled||(d?o.select():o.deselect())})}else{let d=t.activeItemIndex;t.onKeydown(e),this._multiple&&a&&e.shiftKey&&t.activeItem&&t.activeItemIndex!==d&&t.activeItem._selectViaInteraction()}}_onFocus(){this.disabled||(this._focused=!0,this.stateChanges.next())}_onBlur(){this._focused=!1,this._keyManager?.cancelTypeahead(),!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next())}_onAttached(){this._overlayDir.positionChange.pipe(ae(1)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this._positioningSettled()})}_getPanelTheme(){return this._parentFormField?`mat-${this._parentFormField.color}`:""}get empty(){return!this._selectionModel||this._selectionModel.isEmpty()}_initializeSelection(){Promise.resolve().then(()=>{this.ngControl&&(this._value=this.ngControl.value),this._setSelectionByValue(this._value),this.stateChanges.next()})}_setSelectionByValue(e){if(this.options.forEach(t=>t.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&e)Array.isArray(e),e.forEach(t=>this._selectOptionByValue(t)),this._sortValues();else{let t=this._selectOptionByValue(e);t?this._keyManager.updateActiveItem(t):this.panelOpen||this._keyManager.updateActiveItem(-1)}this._changeDetectorRef.markForCheck()}_selectOptionByValue(e){let t=this.options.find(i=>{if(this._selectionModel.isSelected(i))return!1;try{return i.value!=null&&this._compareWith(i.value,e)}catch{return!1}});return t&&this._selectionModel.select(t),t}_assignValue(e){return e!==this._value||this._multiple&&Array.isArray(e)?(this.options&&this._setSelectionByValue(e),this._value=e,!0):!1}_getOverlayWidth(e){return this.panelWidth==="auto"?(e instanceof U?e.elementRef:e||this._elementRef).nativeElement.getBoundingClientRect().width:this.panelWidth===null?"":this.panelWidth}_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck()}_initKeyManager(){this._keyManager=new Re(this.options).withTypeAhead(this.typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withPageUpDown().withAllowedModifierKeys(["shiftKey"]).skipPredicate(this._skipPredicate),this._keyManager.tabOut.subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close())}),this._keyManager.change.subscribe(()=>{this._panelOpen&&this.panel?this._scrollOptionIntoView(this._keyManager.activeItemIndex||0):!this._panelOpen&&!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction()})}_resetOptions(){let e=O(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(h(e)).subscribe(t=>{this._onSelect(t.source,t.isUserInput),t.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus())}),O(...this.options.map(t=>t._stateChanges)).pipe(h(e)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this.stateChanges.next()})}_onSelect(e,t){let i=this._selectionModel.isSelected(e);e.value==null&&!this._multiple?(e.deselect(),this._selectionModel.clear(),this.value!=null&&this._propagateChanges(e.value)):(i!==e.selected&&(e.selected?this._selectionModel.select(e):this._selectionModel.deselect(e)),t&&this._keyManager.setActiveItem(e),this.multiple&&(this._sortValues(),t&&this.focus())),i!==this._selectionModel.isSelected(e)&&this._propagateChanges(),this.stateChanges.next()}_sortValues(){if(this.multiple){let e=this.options.toArray();this._selectionModel.sort((t,i)=>this.sortComparator?this.sortComparator(t,i,e):e.indexOf(t)-e.indexOf(i)),this.stateChanges.next()}}_propagateChanges(e){let t;this.multiple?t=this.selected.map(i=>i.value):t=this.selected?this.selected.value:e,this._value=t,this.valueChange.emit(t),this._onChange(t),this.selectionChange.emit(this._getChangeEvent(t)),this._changeDetectorRef.markForCheck()}_highlightCorrectOption(){if(this._keyManager)if(this.empty){let e=-1;for(let t=0;t<this.options.length;t++)if(!this.options.get(t).disabled){e=t;break}this._keyManager.setActiveItem(e)}else this._keyManager.setActiveItem(this._selectionModel.selected[0])}_canOpen(){return!this._panelOpen&&!this.disabled&&this.options?.length>0}focus(e){this._elementRef.nativeElement.focus(e)}_getPanelAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId(),t=e?e+" ":"";return this.ariaLabelledby?t+this.ariaLabelledby:e}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId(),t=(e?e+" ":"")+this._valueId;return this.ariaLabelledby&&(t+=" "+this.ariaLabelledby),t}_panelDoneAnimating(e){this.openedChange.emit(e)}setDescribedByIds(e){e.length?this._elementRef.nativeElement.setAttribute("aria-describedby",e.join(" ")):this._elementRef.nativeElement.removeAttribute("aria-describedby")}onContainerClick(){this.focus(),this.open()}get shouldLabelFloat(){return this.panelOpen||!this.empty||this.focused&&!!this.placeholder}static{this.\u0275fac=function(t){return new(t||n)(s(Le),s(Me),s(pe),s(Ke),s(me),s(Ve,8),s(Te,8),s(Ee,8),s(Ye,8),s(Ae,10),he("tabindex"),s(tt),s(Fe),s(Ct,8))}}static{this.\u0275cmp=oe({type:n,selectors:[["mat-select"]],contentQueries:function(t,i,a){if(t&1&&(x(a,Ot,5),x(a,Ne,5),x(a,ze,5)),t&2){let r;f(r=y())&&(i.customTrigger=r.first),f(r=y())&&(i.options=r),f(r=y())&&(i.optionGroups=r)}},viewQuery:function(t,i){if(t&1&&(A(dt,5),A(ht,5),A($,5)),t&2){let a;f(a=y())&&(i.trigger=a.first),f(a=y())&&(i.panel=a.first),f(a=y())&&(i._overlayDir=a.first)}},hostAttrs:["role","combobox","aria-haspopup","listbox",1,"mat-mdc-select"],hostVars:19,hostBindings:function(t,i){t&1&&M("keydown",function(r){return i._handleKeydown(r)})("focus",function(){return i._onFocus()})("blur",function(){return i._onBlur()}),t&2&&(I("id",i.id)("tabindex",i.disabled?-1:i.tabIndex)("aria-controls",i.panelOpen?i.id+"-panel":null)("aria-expanded",i.panelOpen)("aria-label",i.ariaLabel||null)("aria-required",i.required.toString())("aria-disabled",i.disabled.toString())("aria-invalid",i.errorState)("aria-activedescendant",i._getAriaActiveDescendant()),_e("mat-mdc-select-disabled",i.disabled)("mat-mdc-select-invalid",i.errorState)("mat-mdc-select-required",i.required)("mat-mdc-select-empty",i.empty)("mat-mdc-select-multiple",i.multiple))},inputs:{userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],panelClass:"panelClass",disabled:[2,"disabled","disabled",v],disableRipple:[2,"disableRipple","disableRipple",v],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:N(e)],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",v],placeholder:"placeholder",required:[2,"required","required",v],multiple:[2,"multiple","multiple",v],disableOptionCentering:[2,"disableOptionCentering","disableOptionCentering",v],compareWith:"compareWith",value:"value",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",typeaheadDebounceInterval:[2,"typeaheadDebounceInterval","typeaheadDebounceInterval",N],sortComparator:"sortComparator",id:"id",panelWidth:"panelWidth"},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},exportAs:["matSelect"],standalone:!0,features:[be([{provide:Ge,useExisting:n},{provide:qe,useExisting:n}]),ue,ce,Ce],ngContentSelectors:mt,decls:11,vars:8,consts:[["fallbackOverlayOrigin","cdkOverlayOrigin","trigger",""],["panel",""],["cdk-overlay-origin","",1,"mat-mdc-select-trigger",3,"click"],[1,"mat-mdc-select-value"],[1,"mat-mdc-select-placeholder","mat-mdc-select-min-line"],[1,"mat-mdc-select-value-text"],[1,"mat-mdc-select-arrow-wrapper"],[1,"mat-mdc-select-arrow"],["viewBox","0 0 24 24","width","24px","height","24px","focusable","false","aria-hidden","true"],["d","M7 10l5 5 5-5z"],["cdk-connected-overlay","","cdkConnectedOverlayLockPosition","","cdkConnectedOverlayHasBackdrop","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"backdropClick","attach","detach","cdkConnectedOverlayPanelClass","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen","cdkConnectedOverlayPositions","cdkConnectedOverlayWidth"],[1,"mat-mdc-select-min-line"],["role","listbox","tabindex","-1",3,"keydown","ngClass"]],template:function(t,i){if(t&1){let a=B();ye(pt),c(0,"div",2,0),M("click",function(){return p(a),m(i.open())}),c(3,"div",3),k(4,ut,2,1,"span",4)(5,ft,3,1,"span",5),_(),c(6,"div",6)(7,"div",7),de(),c(8,"svg",8),fe(9,"path",9),_()()()(),k(10,yt,3,9,"ng-template",10),M("backdropClick",function(){return p(a),m(i.close())})("attach",function(){return p(a),m(i._onAttached())})("detach",function(){return p(a),m(i.close())})}if(t&2){let a=ve(1);u(3),I("id",i._valueId),u(),j(i.empty?4:5),u(6),W("cdkConnectedOverlayPanelClass",i._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",i._scrollStrategy)("cdkConnectedOverlayOrigin",i._preferredOverlayOrigin||a)("cdkConnectedOverlayOpen",i.panelOpen)("cdkConnectedOverlayPositions",i._positions)("cdkConnectedOverlayWidth",i._overlayWidth)}},dependencies:[U,$,Oe],styles:['.mat-mdc-select{display:inline-block;width:100%;outline:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-select-enabled-trigger-text-color, var(--mat-app-on-surface));font-family:var(--mat-select-trigger-text-font, var(--mat-app-body-large-font));line-height:var(--mat-select-trigger-text-line-height, var(--mat-app-body-large-line-height));font-size:var(--mat-select-trigger-text-size, var(--mat-app-body-large-size));font-weight:var(--mat-select-trigger-text-weight, var(--mat-app-body-large-weight));letter-spacing:var(--mat-select-trigger-text-tracking, var(--mat-app-body-large-tracking))}div.mat-mdc-select-panel{box-shadow:var(--mat-select-container-elevation-shadow)}.mat-mdc-select-disabled{color:var(--mat-select-disabled-trigger-text-color)}.mat-mdc-select-trigger{display:inline-flex;align-items:center;cursor:pointer;position:relative;box-sizing:border-box;width:100%}.mat-mdc-select-disabled .mat-mdc-select-trigger{-webkit-user-select:none;user-select:none;cursor:default}.mat-mdc-select-value{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-mdc-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-mdc-select-arrow-wrapper{height:24px;flex-shrink:0;display:inline-flex;align-items:center}.mat-form-field-appearance-fill .mdc-text-field--no-label .mat-mdc-select-arrow-wrapper{transform:none}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-invalid .mat-mdc-select-arrow,.mat-form-field-invalid:not(.mat-form-field-disabled) .mat-mdc-form-field-infix::after{color:var(--mat-select-invalid-arrow-color, var(--mat-app-error))}.mat-mdc-select-arrow{width:10px;height:5px;position:relative;color:var(--mat-select-enabled-arrow-color, var(--mat-app-on-surface-variant))}.mat-mdc-form-field.mat-focused .mat-mdc-select-arrow{color:var(--mat-select-focused-arrow-color, var(--mat-app-primary))}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-disabled .mat-mdc-select-arrow{color:var(--mat-select-disabled-arrow-color)}.mat-mdc-select-arrow svg{fill:currentColor;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}.cdk-high-contrast-active .mat-mdc-select-arrow svg{fill:CanvasText}.mat-mdc-select-disabled .cdk-high-contrast-active .mat-mdc-select-arrow svg{fill:GrayText}div.mat-mdc-select-panel{width:100%;max-height:275px;outline:0;overflow:auto;padding:8px 0;border-radius:4px;box-sizing:border-box;position:static;background-color:var(--mat-select-panel-background-color, var(--mat-app-surface-container))}.cdk-high-contrast-active div.mat-mdc-select-panel{outline:solid 1px}.cdk-overlay-pane:not(.mat-mdc-select-panel-above) div.mat-mdc-select-panel{border-top-left-radius:0;border-top-right-radius:0;transform-origin:top center}.mat-mdc-select-panel-above div.mat-mdc-select-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:bottom center}div.mat-mdc-select-panel .mat-mdc-option{--mdc-list-list-item-container-color: var(--mat-select-panel-background-color)}.mat-mdc-select-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1);color:var(--mat-select-placeholder-text-color, var(--mat-app-on-surface-variant))}._mat-animation-noopable .mat-mdc-select-placeholder{transition:none}.mat-form-field-hide-placeholder .mat-mdc-select-placeholder{color:rgba(0,0,0,0);-webkit-text-fill-color:rgba(0,0,0,0);transition:none;display:block}.mat-mdc-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{cursor:pointer}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mat-mdc-floating-label{max-width:calc(100% - 18px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mdc-floating-label--float-above{max-width:calc(100%/0.75 - 24px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-notched-outline__notch{max-width:calc(100% - 60px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-text-field--label-floating .mdc-notched-outline__notch{max-width:calc(100% - 24px)}.mat-mdc-select-min-line:empty::before{content:" ";white-space:pre;width:1px;display:inline-block;visibility:hidden}.mat-form-field-appearance-fill .mat-mdc-select-arrow-wrapper{transform:var(--mat-select-arrow-transform)}'],encapsulation:2,data:{animation:[vt.transformPanel]},changeDetection:0})}}return n})();var ri=(()=>{class n{static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275mod=le({type:n})}static{this.\u0275inj=re({providers:[Mt],imports:[we,je,J,Z,We,Xe,J,Z]})}}return n})();export{ni as a,ri as b};
@@ -1 +1 @@
1
- import{a as me}from"./chunk-Q7CBBXN2.js";import{a as ae}from"./chunk-SIEUNTYO.js";import{i as re,m as se,n as le,o as ce}from"./chunk-BI74RYMH.js";import{a as K,c as Q}from"./chunk-UJBDZYC5.js";import{a as g}from"./chunk-2FWFPV5I.js";import{B as ie,D as ne,c as Y,e as v,h as Z,i as $,s as ee,t as te}from"./chunk-7UM6XERA.js";import{a as k}from"./chunk-EQXS7YQT.js";import{b as oe}from"./chunk-7HELR776.js";import{C as D,Ca as I,Eb as w,F as G,G as B,Gb as F,Lc as A,Oc as J,Od as X,Q as L,S,Sa as s,Ta as q,U as N,Vb as f,Y as U,ba as H,d as h,dc as W,eb as d,ed as z,fa as V,fc as O,ha as j,ib as l,ja as p,m as M,n as _,na as P,o as x,qb as T,r as y,t as R,vb as r,wb as a,xb as E}from"./chunk-ZCFRJGRH.js";import{j as u}from"./chunk-LHUGHE24.js";var C=class{};var Ge=new j("baseURL"),b=class n extends C{connection;_cache=new Map;_Data=new h({});Data=this._Data.asObservable();previousCountByEpc={};httpService=p(oe);toastService=p(X);_isConnected=new h(!1);isConnected=this._isConnected.asObservable();_bufferTime=new h(100);set bufferTime(i){this._bufferTime.next(i)}get bufferTime(){return this._bufferTime.getValue()}intializeWebSocket(i="/"){return u(this,null,function*(){if(i.length<=0){this.toastService.error("RFID URL cannot be empty",g.Error);return}this.connection=new Q().withUrl(i).configureLogging(K.Information).build();try{yield this.connection.start(),yield this.initiateGroupSubscription(),this.onWebSocketMessageReceived(),this._isConnected.next(!0),this.toastService.success("RFID Connected",g.Success)}catch(t){throw this._isConnected.next(!1),this.toastService.error(JSON.stringify(t),g.Error),setTimeout(()=>this.intializeWebSocket(),5e3),new Error(JSON.stringify(t))}})}initiateGroupSubscription(){return u(this,null,function*(){try{yield this.connection.invoke("SubscribeGroup",{CurrentID:"TransferOrder"})}catch(i){throw this.toastService.error(JSON.stringify(i),g.Error),new Error(JSON.stringify(i))}})}onWebSocketMessageReceived(){try{this.connection.on("ReceiveSignal",i=>{this._Data.next(i)})}catch(i){throw new Error(JSON.stringify(i))}}getVariantByCode(i,t=k.GuidEmpty){let e=[{key:"Code",value:i},{key:"EntityID",value:t}];return this.httpService.get(me.GetVariantByCode,e).pipe(B(o=>o instanceof z?_(null):x(()=>new Error(o.message))))}processGroupedData(i=k.GuidEmpty){return this._Data.pipe(D(t=>t!==null&&t&&Object.keys(t).length>0),G(this._bufferTime.getValue()),R(t=>M(t)),L(t=>t.epc),R(t=>t.pipe(S((e,o)=>[...e,o],[]),U(e=>{let o=t.key;if(this._cache.has(o))return this._cache.get(o).pipe(y(c=>({epc:o,items:e,response:c})));{let c=this.getVariantByCode(o,i).pipe(D(m=>m),H(m=>this._cache.set(o,_(m))));return this._cache.set(o,c),c.pipe(y(m=>({epc:o,items:e,response:m})))}}))),S((t,e)=>{let o=this.previousCountByEpc&&this.previousCountByEpc[e.epc]||0,c=e.items.length,m=c-o;return t[e.epc]={data:e.items,count:m,variant:e.response},this.previousCountByEpc[e.epc]=c,t},{}),N({bufferSize:1,refCount:!0}))}constructor(){super()}static \u0275fac=function(t){return new(t||n)};static \u0275prov=V({token:n,factory:n.\u0275fac,providedIn:"root"})};var fe=n=>({"is-invalid":n});function de(n,i){n&1&&(r(0,"span"),f(1,"Host URL is required."),a())}function ge(n,i){if(n&1&&(r(0,"div",6),d(1,de,2,0,"span",8),E(2,"span"),a()),n&2){let t,e=F();s(),l("ngIf",(t=e.form.get("hostURL").errors)==null?null:t.required)}}function he(n,i){n&1&&(r(0,"span"),f(1,"Host URL is required."),a())}function ve(n,i){n&1&&(r(0,"span"),f(1,"BufferTime must be at least 100"),a())}function Ce(n,i){if(n&1&&(r(0,"div",6),d(1,he,2,0,"span",8)(2,ve,2,0,"span",8),a()),n&2){let t,e,o=F();s(),l("ngIf",(t=o.form.get("bufferTime").errors)==null?null:t.required),s(),l("ngIf",(e=o.form.get("bufferTime").errors)==null?null:e.min)}}var pe=class n{constructor(i){this.dialogRef=i;this.form=this.fb.group({hostURL:["https://localhost:5001/rfidhub",[v.required]],bufferTime:["100",[v.required,v.min(100)]]},{updateOn:"change"}),this.config.title="Connect RFID",this.config.customWidth="400px"}config=new se;isConnect=new I(!1);RFIDConnectionService=p(b);fb=p(ie);onOK=new I;form;ok(){return u(this,null,function*(){this.onOK.emit(this.form.value),this.dialogRef.close("void")})}close(){this.dialogRef.close()}onBlur(i){this.form.patchValue({bufferTime:Number(i.value)})}static \u0275fac=function(t){return new(t||n)(q(re))};static \u0275cmp=P({type:n,selectors:[["POS-dialog-connect-rfid"]],outputs:{onOK:"onOK"},standalone:!0,features:[W],decls:15,vars:12,consts:[[3,"onCancel","onClose","onOk","dynamicValidated","config"],[1,"d-flex","flex-column",2,"row-gap","1rem"],[1,"fw-normal"],[1,"form-floating-outline",3,"formGroup"],["formControlName","hostURL","id","floatingInput","placeholder","https://localhost:5030/rfidhub","type","text",1,"form-control",3,"ngClass"],["for","floatingInput"],["id","",1,"invalid-feedback"],["formControlName","bufferTime","id","floatingInput","placeholder","100","type","text",1,"form-control",3,"blur","ngClass"],[4,"ngIf"]],template:function(t,e){t&1&&(r(0,"modal-material",0),w("onCancel",function(){return e.close()})("onClose",function(){return e.close()})("onOk",function(){return e.ok()}),r(1,"content")(2,"div",1)(3,"h4",2),f(4,"Please input the RFID Host URL:"),a(),r(5,"div",3),E(6,"input",4),r(7,"label",5),f(8,"Host URL"),a(),d(9,ge,3,1,"div",6),a(),r(10,"div",3)(11,"input",7),w("blur",function(){return e.onBlur(e.form.get("bufferTime"))}),a(),r(12,"label",5),f(13,"Buffer Time (ms)"),a(),d(14,Ce,3,2,"div",6),a()()()()),t&2&&(l("dynamicValidated",e.form.valid)("config",e.config),s(5),l("formGroup",e.form),s(),l("ngClass",O(8,fe,e.form.invalid&&e.form.touched)),s(3),T(e.form.get("hostURL").invalid&&e.form.get("hostURL").touched?9:-1),s(),l("formGroup",e.form),s(),l("ngClass",O(10,fe,e.form.invalid&&e.form.touched)),s(3),T(e.form.get("bufferTime").invalid&&e.form.get("bufferTime").touched?14:-1))},dependencies:[ce,le,ae,J,ne,Y,Z,$,ee,te,A],styles:[".form-control.is-invalid[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]})};export{C as a,b,pe as c};
1
+ import{a as me}from"./chunk-Q7CBBXN2.js";import{a as ae}from"./chunk-SIEUNTYO.js";import{i as re,m as se,n as le,o as ce}from"./chunk-AIORTWOA.js";import{a as K,c as Q}from"./chunk-UJBDZYC5.js";import{a as g}from"./chunk-2FWFPV5I.js";import{B as ie,D as ne,c as Y,e as v,h as Z,i as $,s as ee,t as te}from"./chunk-7UM6XERA.js";import{a as k}from"./chunk-EQXS7YQT.js";import{b as oe}from"./chunk-AMJRJEU7.js";import{C as D,Ca as I,Eb as w,F as G,G as B,Gb as F,Lc as A,Oc as J,Od as X,Q as L,S,Sa as s,Ta as q,U as N,Vb as f,Y as U,ba as H,d as h,dc as W,eb as d,ed as z,fa as V,fc as O,ha as j,ib as l,ja as p,m as M,n as _,na as P,o as x,qb as T,r as y,t as R,vb as r,wb as a,xb as E}from"./chunk-ZCFRJGRH.js";import{j as u}from"./chunk-LHUGHE24.js";var C=class{};var Ge=new j("baseURL"),b=class n extends C{connection;_cache=new Map;_Data=new h({});Data=this._Data.asObservable();previousCountByEpc={};httpService=p(oe);toastService=p(X);_isConnected=new h(!1);isConnected=this._isConnected.asObservable();_bufferTime=new h(100);set bufferTime(i){this._bufferTime.next(i)}get bufferTime(){return this._bufferTime.getValue()}intializeWebSocket(i="/"){return u(this,null,function*(){if(i.length<=0){this.toastService.error("RFID URL cannot be empty",g.Error);return}this.connection=new Q().withUrl(i).configureLogging(K.Information).build();try{yield this.connection.start(),yield this.initiateGroupSubscription(),this.onWebSocketMessageReceived(),this._isConnected.next(!0),this.toastService.success("RFID Connected",g.Success)}catch(t){throw this._isConnected.next(!1),this.toastService.error(JSON.stringify(t),g.Error),setTimeout(()=>this.intializeWebSocket(),5e3),new Error(JSON.stringify(t))}})}initiateGroupSubscription(){return u(this,null,function*(){try{yield this.connection.invoke("SubscribeGroup",{CurrentID:"TransferOrder"})}catch(i){throw this.toastService.error(JSON.stringify(i),g.Error),new Error(JSON.stringify(i))}})}onWebSocketMessageReceived(){try{this.connection.on("ReceiveSignal",i=>{this._Data.next(i)})}catch(i){throw new Error(JSON.stringify(i))}}getVariantByCode(i,t=k.GuidEmpty){let e=[{key:"Code",value:i},{key:"EntityID",value:t}];return this.httpService.get(me.GetVariantByCode,e).pipe(B(o=>o instanceof z?_(null):x(()=>new Error(o.message))))}processGroupedData(i=k.GuidEmpty){return this._Data.pipe(D(t=>t!==null&&t&&Object.keys(t).length>0),G(this._bufferTime.getValue()),R(t=>M(t)),L(t=>t.epc),R(t=>t.pipe(S((e,o)=>[...e,o],[]),U(e=>{let o=t.key;if(this._cache.has(o))return this._cache.get(o).pipe(y(c=>({epc:o,items:e,response:c})));{let c=this.getVariantByCode(o,i).pipe(D(m=>m),H(m=>this._cache.set(o,_(m))));return this._cache.set(o,c),c.pipe(y(m=>({epc:o,items:e,response:m})))}}))),S((t,e)=>{let o=this.previousCountByEpc&&this.previousCountByEpc[e.epc]||0,c=e.items.length,m=c-o;return t[e.epc]={data:e.items,count:m,variant:e.response},this.previousCountByEpc[e.epc]=c,t},{}),N({bufferSize:1,refCount:!0}))}constructor(){super()}static \u0275fac=function(t){return new(t||n)};static \u0275prov=V({token:n,factory:n.\u0275fac,providedIn:"root"})};var fe=n=>({"is-invalid":n});function de(n,i){n&1&&(r(0,"span"),f(1,"Host URL is required."),a())}function ge(n,i){if(n&1&&(r(0,"div",6),d(1,de,2,0,"span",8),E(2,"span"),a()),n&2){let t,e=F();s(),l("ngIf",(t=e.form.get("hostURL").errors)==null?null:t.required)}}function he(n,i){n&1&&(r(0,"span"),f(1,"Host URL is required."),a())}function ve(n,i){n&1&&(r(0,"span"),f(1,"BufferTime must be at least 100"),a())}function Ce(n,i){if(n&1&&(r(0,"div",6),d(1,he,2,0,"span",8)(2,ve,2,0,"span",8),a()),n&2){let t,e,o=F();s(),l("ngIf",(t=o.form.get("bufferTime").errors)==null?null:t.required),s(),l("ngIf",(e=o.form.get("bufferTime").errors)==null?null:e.min)}}var pe=class n{constructor(i){this.dialogRef=i;this.form=this.fb.group({hostURL:["https://localhost:5001/rfidhub",[v.required]],bufferTime:["100",[v.required,v.min(100)]]},{updateOn:"change"}),this.config.title="Connect RFID",this.config.customWidth="400px"}config=new se;isConnect=new I(!1);RFIDConnectionService=p(b);fb=p(ie);onOK=new I;form;ok(){return u(this,null,function*(){this.onOK.emit(this.form.value),this.dialogRef.close("void")})}close(){this.dialogRef.close()}onBlur(i){this.form.patchValue({bufferTime:Number(i.value)})}static \u0275fac=function(t){return new(t||n)(q(re))};static \u0275cmp=P({type:n,selectors:[["POS-dialog-connect-rfid"]],outputs:{onOK:"onOK"},standalone:!0,features:[W],decls:15,vars:12,consts:[[3,"onCancel","onClose","onOk","dynamicValidated","config"],[1,"d-flex","flex-column",2,"row-gap","1rem"],[1,"fw-normal"],[1,"form-floating-outline",3,"formGroup"],["formControlName","hostURL","id","floatingInput","placeholder","https://localhost:5030/rfidhub","type","text",1,"form-control",3,"ngClass"],["for","floatingInput"],["id","",1,"invalid-feedback"],["formControlName","bufferTime","id","floatingInput","placeholder","100","type","text",1,"form-control",3,"blur","ngClass"],[4,"ngIf"]],template:function(t,e){t&1&&(r(0,"modal-material",0),w("onCancel",function(){return e.close()})("onClose",function(){return e.close()})("onOk",function(){return e.ok()}),r(1,"content")(2,"div",1)(3,"h4",2),f(4,"Please input the RFID Host URL:"),a(),r(5,"div",3),E(6,"input",4),r(7,"label",5),f(8,"Host URL"),a(),d(9,ge,3,1,"div",6),a(),r(10,"div",3)(11,"input",7),w("blur",function(){return e.onBlur(e.form.get("bufferTime"))}),a(),r(12,"label",5),f(13,"Buffer Time (ms)"),a(),d(14,Ce,3,2,"div",6),a()()()()),t&2&&(l("dynamicValidated",e.form.valid)("config",e.config),s(5),l("formGroup",e.form),s(),l("ngClass",O(8,fe,e.form.invalid&&e.form.touched)),s(3),T(e.form.get("hostURL").invalid&&e.form.get("hostURL").touched?9:-1),s(),l("formGroup",e.form),s(),l("ngClass",O(10,fe,e.form.invalid&&e.form.touched)),s(3),T(e.form.get("bufferTime").invalid&&e.form.get("bufferTime").touched?14:-1))},dependencies:[ce,le,ae,J,ne,Y,Z,$,ee,te,A],styles:[".form-control.is-invalid[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]})};export{C as a,b,pe as c};